forked from public/foundryvtt-reve-de-dragon
Compare commits
50 Commits
ed222c7b6d
...
12.0.24
Author | SHA1 | Date | |
---|---|---|---|
37c281b300 | |||
9b1a179a71 | |||
8be4c3343f | |||
6af5a85dc1 | |||
c6d64e09d5 | |||
56c99c5044 | |||
a7862a25e5 | |||
f4b5a4a4d2 | |||
6a17586a6c | |||
40f7ef48c9 | |||
62dfa8a580 | |||
e71088fe2f | |||
b7cb0f0752 | |||
9b31f25640 | |||
2291eaf135 | |||
a91264cd82 | |||
864194e3b4 | |||
2c836f17e7 | |||
444e52cb49 | |||
82b0537d43 | |||
1eea07c8a8 | |||
de70ba8a3c | |||
f0e02e2205 | |||
7d9ccfaf28 | |||
830cd1c200 | |||
b9458c717e | |||
22f25b45ce | |||
dca9505925 | |||
45e9e94646 | |||
a0c7b87996 | |||
a214256d69 | |||
d2de8aa972 | |||
00ec86632f | |||
010234e001 | |||
39604afa32 | |||
aad256bfee | |||
6ebd2ee576 | |||
ac6e8b4689 | |||
387713e6f8 | |||
c69cb3c13a | |||
bda2e39e35 | |||
cb2d462cfe | |||
5f8b5b104d | |||
9fe265165b | |||
b92003ac1f | |||
a1e4bfb529 | |||
b4f0be5d64 | |||
5ff31d462f | |||
be1d109def | |||
d91bee0f42 |
63
.gitea/workflows/release.yaml
Normal file
63
.gitea/workflows/release.yaml
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
name: Release Creation
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- run: echo "💡 The ${{ gitea.repository }} repository will cloned to the runner."
|
||||||
|
|
||||||
|
#- uses: actions/checkout@v3
|
||||||
|
- uses: RouxAntoine/checkout@v3.5.4
|
||||||
|
|
||||||
|
# get part of the tag after the `v`
|
||||||
|
- name: Extract tag version number
|
||||||
|
id: get_version
|
||||||
|
uses: battila7/get-version-action@v2
|
||||||
|
|
||||||
|
# Substitute the Manifest and Download URLs in the module.json
|
||||||
|
- name: Substitute Manifest and Download Links For Versioned Ones
|
||||||
|
id: sub_manifest_link_version
|
||||||
|
uses: microsoft/variable-substitution@v1
|
||||||
|
with:
|
||||||
|
files: 'system.json'
|
||||||
|
env:
|
||||||
|
version: ${{steps.get_version.outputs.version-without-v}}
|
||||||
|
url: https://www.uberwald.me/gitea/${{gitea.repository}}
|
||||||
|
manifest: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download//${{github.event.release.tag_name}}/system.json
|
||||||
|
download: https://www.uberwald.me/gitea/${{gitea.repository}}/releases/download/${{github.event.release.tag_name}}/rddsystem.zip
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '18' # Use the node version your project requires
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install
|
||||||
|
|
||||||
|
- name: Build the compendiums
|
||||||
|
run: node ./tools/packCompendiumsToDist.mjs
|
||||||
|
|
||||||
|
# Create a zip file with all files required by the module to add to the release
|
||||||
|
- run: |
|
||||||
|
apt update -y
|
||||||
|
apt install -y zip
|
||||||
|
|
||||||
|
- run: zip -r ./rddsystem.zip system.json template.json README.md LICENSE.txt assets/ fonts/ icons lang/ module/ packs/ pic/ sounds/ styles/ templates/
|
||||||
|
|
||||||
|
- name: setup go
|
||||||
|
uses: actions/setup-go@v3
|
||||||
|
with:
|
||||||
|
go-version: '>=1.20.1'
|
||||||
|
|
||||||
|
- name: Use Go Action
|
||||||
|
id: use-go-action
|
||||||
|
uses: https://gitea.com/actions/release-action@main
|
||||||
|
with:
|
||||||
|
files: |-
|
||||||
|
./rddsystem.zip
|
||||||
|
system.json
|
||||||
|
api_key: '${{secrets.ALLOW_PUSH_RELEASE}}'
|
BIN
assets/scenes/YSpVuLeMCX9tAmgn-thumb.webp
Normal file
BIN
assets/scenes/YSpVuLeMCX9tAmgn-thumb.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
37
changelog.md
37
changelog.md
@ -1,4 +1,41 @@
|
|||||||
# 12.0
|
# 12.0
|
||||||
|
## 12.0.24 - Les ajustements d'Astrobazzarh
|
||||||
|
- amélioration
|
||||||
|
- meilleure gestion des noms des voies de draconic
|
||||||
|
- affichage du détail des sorts avec le nom de voie, 'court', la difficulté, le coût
|
||||||
|
- corrections
|
||||||
|
- les tas dans les conteneurs peuvent être désempilés sans rendre le conteneur inutilisable
|
||||||
|
- les conteneurs ne peuvent plus être empilés (pour éviter que le contenu de Schroedinger quand on les sépare)
|
||||||
|
- on peut maintenant saisir et supprimer les bonus de cases de manière intuitive
|
||||||
|
|
||||||
|
## 12.0.23 - La bibliothèque d'Astrobazzarh
|
||||||
|
- corrections mineures
|
||||||
|
- meilleure gestion de la parade des armes naturelles
|
||||||
|
- cas de "User lacks permission to update" pour les blessures et les StatusEffects
|
||||||
|
- risque de message d'encaissement non affiché
|
||||||
|
- support de sorts à voies multiples
|
||||||
|
- correction de compendiums
|
||||||
|
- résistance des armes mise à jour
|
||||||
|
- voies multiples pour las sorts de Lecture d'aura, Détection d'aura et Annulation de magie
|
||||||
|
- améliorations "Scriptarium"
|
||||||
|
- recherche des compétences sans accents pour permettre les noms accentués (standard Scriptarium)
|
||||||
|
- affichage r1+ des sorts à coût variable dans la feuille simplifiée
|
||||||
|
- affichage de Corps à corps pour le combat à mains nues dans la feuille simplifiée
|
||||||
|
- dans les compendiums, les compétences Écriture et Épée ont une majuscule accentuée. Les Épée dans le compendium d'équipements référence le nom de compétence accentué.
|
||||||
|
|
||||||
|
## 12.0.21 - La nomination d'Astrobazzarh
|
||||||
|
- Les noms pour les messages dans le tchat sont maintenant ceux des tokens plutôt que ceux des acteurs
|
||||||
|
- Fix: le choix des effets dans les options s'affiche correctement
|
||||||
|
|
||||||
|
## 12.0.20 - Le tableau d'Astrobazzarh
|
||||||
|
- Ecran d'accueil officiel Scriptarium
|
||||||
|
|
||||||
|
## 12.0.19 - La témérité d'Astrobazzarh
|
||||||
|
- Fix
|
||||||
|
- les défenses des créatures sont correctement filtrées
|
||||||
|
- le lancer d'initiative pour tous les personnages/PNJs fonctionne correctement
|
||||||
|
- les lieux et commerces n'ont pas d'initiative
|
||||||
|
|
||||||
## 12.0.18 - A la barbe d'Astrobazzarh
|
## 12.0.18 - A la barbe d'Astrobazzarh
|
||||||
- Améliorations sur la feuille de PNJ simplifiée
|
- Améliorations sur la feuille de PNJ simplifiée
|
||||||
- Ajout du portrait
|
- Ajout du portrait
|
||||||
|
61
dev-notes.md
61
dev-notes.md
@ -1,61 +0,0 @@
|
|||||||
# Actor notes
|
|
||||||
|
|
||||||
> The Actor#getData default implementation gives you the following for use in sheet rendering:
|
|
||||||
|
|
||||||
```
|
|
||||||
actor -> the Actor instance
|
|
||||||
data -> a cloned copy of Actor#data
|
|
||||||
items -> a cloned copy of Actor#data#items
|
|
||||||
effects -> a cloned copy of Actor#data#effects
|
|
||||||
```
|
|
||||||
|
|
||||||
> if all you need is a safe copy of `Actor#data`, you'll be much better off by simply defining your own function and avoiding all the wasted work that the parent class does which will slow down your sheet
|
|
||||||
```js
|
|
||||||
getData(options) {
|
|
||||||
return {
|
|
||||||
data: foundry.utils.deepClone(this.object.data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
who knows, maybe you don't even need to copy your actor data, skip the copy and it's even faster:
|
|
||||||
```js
|
|
||||||
getData(options) {
|
|
||||||
return {
|
|
||||||
data: this.object.data
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
Atropos19/02/2021
|
|
||||||
There are two recommended ways to create owned items in 0.8.0:
|
|
||||||
```js
|
|
||||||
await Item.create(itemData, {parent: actor});
|
|
||||||
await actor.createEmbeddedDocuments("Item", itemDataArray);
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
You can update an embedded item in one of two ways:
|
|
||||||
```js
|
|
||||||
//Method 1:
|
|
||||||
|
|
||||||
const item = actor.items.get(itemId);
|
|
||||||
item.update(data);
|
|
||||||
|
|
||||||
//Method 2:
|
|
||||||
actor.updateEmbeddedDocuments("Item", [{_id: itemId, ...}]);
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
I noticed adding an ActiveEffect to an actor in code using
|
|
||||||
|
|
||||||
```js
|
|
||||||
this.createEmbeddedDocuments('ActiveEffect', [effet], options);
|
|
||||||
this.applyActiveEffects();
|
|
||||||
```
|
|
||||||
|
|
||||||
Atropos — Aujourd’hui à 14:42
|
|
||||||
Two notes on this:
|
|
||||||
1. You don't actually need to call this.applyActiveEffects() because this will happen automatically whenever an effect is created/updated/deleted
|
|
||||||
2. If you want to suppress the automatic display of the sheet for the newly created document, you can pass options.renderSheet = false as part of your options object
|
|
@ -80,7 +80,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
|||||||
const actor = this.actor;
|
const actor = this.actor;
|
||||||
formData.combat = foundry.utils.duplicate(formData.armes);
|
formData.combat = foundry.utils.duplicate(formData.armes);
|
||||||
RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
|
RdDItemArme.computeNiveauArmes(formData.combat, formData.competences);
|
||||||
formData.combat.push(RdDItemArme.mainsNues(actor));
|
formData.combat.push(RdDItemArme.corpsACorps(actor));
|
||||||
formData.combat.push(RdDItemArme.empoignade(actor));
|
formData.combat.push(RdDItemArme.empoignade(actor));
|
||||||
|
|
||||||
formData.esquives = this.actor.getCompetences("Esquive");
|
formData.esquives = this.actor.getCompetences("Esquive");
|
||||||
|
@ -36,6 +36,8 @@ import { ITEM_TYPES } from "./item.js";
|
|||||||
import { RdDBaseActorSang } from "./actor/base-actor-sang.js";
|
import { RdDBaseActorSang } from "./actor/base-actor-sang.js";
|
||||||
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
import { RdDCoeur } from "./coeur/rdd-coeur.js";
|
||||||
import { DialogChoixXpCarac } from "./dialog-choix-xp-carac.js";
|
import { DialogChoixXpCarac } from "./dialog-choix-xp-carac.js";
|
||||||
|
import { RdDItemArme } from "./item-arme.js";
|
||||||
|
import { RdDCombatManager } from "./rdd-combat.js";
|
||||||
|
|
||||||
export const MAINS_DIRECTRICES = ['Droitier', 'Gaucher', 'Ambidextre']
|
export const MAINS_DIRECTRICES = ['Droitier', 'Gaucher', 'Ambidextre']
|
||||||
|
|
||||||
@ -130,6 +132,23 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
.reduce(Misc.sum(), 0);
|
.reduce(Misc.sum(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
listActionsCombat() {
|
||||||
|
// Recupération des armes
|
||||||
|
const actions = RdDCombatManager.listActionsArmes(
|
||||||
|
this.itemTypes[ITEM_TYPES.arme]
|
||||||
|
.filter(it => RdDItemArme.isAttaque(it))
|
||||||
|
.concat(RdDItemArme.corpsACorps(this))
|
||||||
|
.concat(RdDItemArme.empoignade(this))
|
||||||
|
,
|
||||||
|
this.itemTypes[ITEM_TYPES.competence],
|
||||||
|
this.system.carac)
|
||||||
|
|
||||||
|
if (this.system.attributs.hautrevant.value) {
|
||||||
|
actions.push({ name: "Draconic", action: 'haut-reve', system: { initOnly: true, competence: "Draconic" } });
|
||||||
|
}
|
||||||
|
return actions
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getTache(id) { return this.findItemLike(id, 'tache') }
|
getTache(id) { return this.findItemLike(id, 'tache') }
|
||||||
getMeditation(id) { return this.findItemLike(id, 'meditation') }
|
getMeditation(id) { return this.findItemLike(id, 'meditation') }
|
||||||
@ -162,7 +181,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-potionenchantee-chateaudormant.html`, {
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-potionenchantee-chateaudormant.html`, {
|
||||||
pr: nouveauReve,
|
pr: nouveauReve,
|
||||||
alias: this.name,
|
alias: this.getAlias(),
|
||||||
potionName: it.name,
|
potionName: it.name,
|
||||||
potionImg: it.img
|
potionImg: it.img
|
||||||
})
|
})
|
||||||
@ -1322,7 +1341,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
const etat = this.getEtatGeneral({ ethylisme: true });
|
const etat = this.getEtatGeneral({ ethylisme: true });
|
||||||
const nbDoses = Number(this.system.compteurs.ethylisme.nb_doses || 0);
|
const nbDoses = Number(this.system.compteurs.ethylisme.nb_doses || 0);
|
||||||
const ethylismeData = {
|
const ethylismeData = {
|
||||||
alias: this.name,
|
alias: this.getAlias(),
|
||||||
actor: this,
|
actor: this,
|
||||||
vie: this.system.sante.vie.max,
|
vie: this.system.sante.vie.max,
|
||||||
alcool: alcool,
|
alcool: alcool,
|
||||||
@ -1407,7 +1426,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
const perteDissolution = Math.max(0, Math.min(dissolution, conversion));
|
const perteDissolution = Math.max(0, Math.min(dissolution, conversion));
|
||||||
|
|
||||||
let stressRollData = {
|
let stressRollData = {
|
||||||
alias: this.name,
|
alias: this.getAlias(),
|
||||||
selectedCarac: this.system.carac.reve,
|
selectedCarac: this.system.carac.reve,
|
||||||
rolled: stressRoll,
|
rolled: stressRoll,
|
||||||
stress: fromStress,
|
stress: fromStress,
|
||||||
@ -1498,7 +1517,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
carac.value = niveauSuivant;
|
carac.value = niveauSuivant;
|
||||||
|
|
||||||
let checkXp = {
|
let checkXp = {
|
||||||
alias: this.name,
|
alias: this.getAlias(),
|
||||||
carac: caracName,
|
carac: caracName,
|
||||||
value: niveauSuivant,
|
value: niveauSuivant,
|
||||||
xp: carac.xp
|
xp: carac.xp
|
||||||
@ -1528,7 +1547,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
newCompData.system.niveau += 1;
|
newCompData.system.niveau += 1;
|
||||||
newCompData.system.xp = newXP;
|
newCompData.system.xp = newXP;
|
||||||
let checkXp = {
|
let checkXp = {
|
||||||
alias: this.name,
|
alias: this.getAlias(),
|
||||||
competence: newCompData.name,
|
competence: newCompData.name,
|
||||||
niveau: newCompData.system.niveau,
|
niveau: newCompData.system.niveau,
|
||||||
xp: newCompData.system.xp,
|
xp: newCompData.system.xp,
|
||||||
@ -1548,7 +1567,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') {
|
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') {
|
||||||
if (!Misc.isFirstConnectedGM()){
|
if (!Misc.isFirstConnectedGM()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM)
|
hideChatMessage = hideChatMessage == 'hide' || (Misc.isRollModeHiddenToPlayer() && !game.user.isGM)
|
||||||
@ -1765,7 +1784,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
}
|
}
|
||||||
const competence = this.getCompetence(compName);
|
const competence = this.getCompetence(compName);
|
||||||
let rollData = {
|
let rollData = {
|
||||||
alias: this.name,
|
alias: this.getAlias(),
|
||||||
caracValue: Number(carac.value),
|
caracValue: Number(carac.value),
|
||||||
selectedCarac: carac,
|
selectedCarac: carac,
|
||||||
competence: competence,
|
competence: competence,
|
||||||
@ -1838,7 +1857,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
label: 'Jet ' + Grammar.apostrophe('de', competence.name),
|
label: 'Jet ' + Grammar.apostrophe('de', competence.name),
|
||||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html',
|
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-competence.html',
|
||||||
rollData: {
|
rollData: {
|
||||||
alias: this.name,
|
alias: this.getAlias(),
|
||||||
carac: this.system.carac,
|
carac: this.system.carac,
|
||||||
selectedCarac: this.getCaracByName(caracName),
|
selectedCarac: this.getCaracByName(caracName),
|
||||||
selectedCaracName: caracName,
|
selectedCaracName: caracName,
|
||||||
@ -2911,7 +2930,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
|
|
||||||
let newQuantite = herbeData.system.quantite - herbeData.nbBrins;
|
let newQuantite = herbeData.system.quantite - herbeData.nbBrins;
|
||||||
let messageData = {
|
let messageData = {
|
||||||
alias: this.name,
|
alias: this.getAlias(),
|
||||||
nbBrinsReste: newQuantite,
|
nbBrinsReste: newQuantite,
|
||||||
potion: newPotion,
|
potion: newPotion,
|
||||||
herbe: herbeData
|
herbe: herbeData
|
||||||
@ -2998,15 +3017,16 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
case 'queue':
|
case 'queue':
|
||||||
case 'ombre':
|
case 'ombre':
|
||||||
case 'souffle':
|
case 'souffle':
|
||||||
await this.onDeleteOwnedDraconique(item, options, id);
|
await this.onDeleteOwnedDraconique(item, options, id)
|
||||||
break;
|
break
|
||||||
case 'casetmr':
|
case 'casetmr':
|
||||||
await this.onDeleteOwnedCaseTmr(item, options, id);
|
await this.onDeleteOwnedCaseTmr(item, options, id)
|
||||||
break;
|
break
|
||||||
case 'empoignade':
|
case 'empoignade':
|
||||||
await RdDEmpoignade.deleteLinkedEmpoignade(this.id, item)
|
await RdDEmpoignade.deleteLinkedEmpoignade(this.id, item)
|
||||||
break;
|
break
|
||||||
}
|
}
|
||||||
|
super.onDeleteItem(item, options, id)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -3067,7 +3087,7 @@ export class RdDActor extends RdDBaseActorSang {
|
|||||||
incarnation.name = 'Réincarnation de ' + incarnation.name
|
incarnation.name = 'Réincarnation de ' + incarnation.name
|
||||||
incarnation.system = {
|
incarnation.system = {
|
||||||
carac: foundry.utils.duplicate(this.system.carac),
|
carac: foundry.utils.duplicate(this.system.carac),
|
||||||
heure: RdDTimestamp.defHeure(await RdDDice.rollHeure( { rollMode: "selfroll", showDice: SHOW_DICE })).key,
|
heure: RdDTimestamp.defHeure(await RdDDice.rollHeure({ rollMode: "selfroll", showDice: SHOW_DICE })).key,
|
||||||
age: 18,
|
age: 18,
|
||||||
biographie: '',
|
biographie: '',
|
||||||
notes: '',
|
notes: '',
|
||||||
|
@ -15,7 +15,7 @@ import { StatusEffects } from "../settings/status-effects.js";
|
|||||||
import { ITEM_TYPES } from "../item.js";
|
import { ITEM_TYPES } from "../item.js";
|
||||||
import { Targets } from "../targets.js";
|
import { Targets } from "../targets.js";
|
||||||
import { RdDPossession } from "../rdd-possession.js";
|
import { RdDPossession } from "../rdd-possession.js";
|
||||||
import { RdDCombat } from "../rdd-combat.js";
|
import { RdDCombat, RdDCombatManager } from "../rdd-combat.js";
|
||||||
import { RdDConfirm } from "../rdd-confirm.js";
|
import { RdDConfirm } from "../rdd-confirm.js";
|
||||||
import { ENTITE_INCARNE, SHOW_DICE, SYSTEM_RDD } from "../constants.js";
|
import { ENTITE_INCARNE, SHOW_DICE, SYSTEM_RDD } from "../constants.js";
|
||||||
import { RdDItemArme } from "../item-arme.js";
|
import { RdDItemArme } from "../item-arme.js";
|
||||||
@ -83,6 +83,23 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
getEtatGeneral(options = { ethylisme: false }) { return 0 }
|
getEtatGeneral(options = { ethylisme: false }) { return 0 }
|
||||||
isActorCombat() { return true }
|
isActorCombat() { return true }
|
||||||
|
|
||||||
|
getCaracInit(competence) {
|
||||||
|
if (!competence){
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
if (competence.type == ITEM_TYPES.competencecreature) {
|
||||||
|
return competence.system.carac_value
|
||||||
|
}
|
||||||
|
return this.system.carac[competence.system.defaut_carac].value;
|
||||||
|
}
|
||||||
|
listActionsCombat() {
|
||||||
|
return this.itemTypes[ITEM_TYPES.competencecreature]
|
||||||
|
.filter(it => RdDItemCompetenceCreature.isAttaque(it))
|
||||||
|
.map(it => RdDItemCompetenceCreature.armeCreature(it))
|
||||||
|
.filter(it => it != undefined);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
async computeArmure(attackerRoll) { return this.getProtectionNaturelle() }
|
async computeArmure(attackerRoll) { return this.getProtectionNaturelle() }
|
||||||
async remiseANeuf() { }
|
async remiseANeuf() { }
|
||||||
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') { }
|
async appliquerAjoutExperience(rollData, hideChatMessage = 'show') { }
|
||||||
@ -100,7 +117,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
for (let effect of this.getEffects()) {
|
for (let effect of this.getEffects()) {
|
||||||
if (effect.duration.type !== 'none' && (effect.duration.remaining <= 0 || options.terminer)) {
|
if (effect.duration.type !== 'none' && (effect.duration.remaining <= 0 || options.terminer)) {
|
||||||
await effect.delete();
|
await effect.delete();
|
||||||
ChatMessage.create({ content: `${this.name} n'est plus ${Misc.lowerFirst(game.i18n.localize(effect.system.label))} !` });
|
ChatMessage.create({ content: `${this.getAlias()} n'est plus ${Misc.lowerFirst(game.i18n.localize(effect.system.label))} !` });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -155,9 +172,6 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
getPossession(possessionId) {
|
getPossession(possessionId) {
|
||||||
return this.itemTypes[ITEM_TYPES.possession].find(it => it.system.possessionid == possessionId);
|
return this.itemTypes[ITEM_TYPES.possession].find(it => it.system.possessionid == possessionId);
|
||||||
}
|
}
|
||||||
getPossessions() {
|
|
||||||
return this.itemTypes[ITEM_TYPES.possession];
|
|
||||||
}
|
|
||||||
getEmpoignades() {
|
getEmpoignades() {
|
||||||
return this.itemTypes[ITEM_TYPES.empoignade];
|
return this.itemTypes[ITEM_TYPES.empoignade];
|
||||||
}
|
}
|
||||||
@ -274,7 +288,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
|
|
||||||
await this.openRollDialog({
|
await this.openRollDialog({
|
||||||
name: `jet-${this.id}`,
|
name: `jet-${this.id}`,
|
||||||
label: `Jet de ${this.name}`,
|
label: `Jet de ${this.getAlias()}`,
|
||||||
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll.html',
|
template: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll.html',
|
||||||
rollData: {
|
rollData: {
|
||||||
carac: carac,
|
carac: carac,
|
||||||
@ -370,7 +384,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
rollArme(arme, categorieArme, token) {
|
rollArme(arme, categorieArme, token) {
|
||||||
token = token ?? RdDUtility.getSelectedToken(this)
|
token = token ?? RdDUtility.getSelectedToken(this)
|
||||||
const compToUse = this.$getCompetenceArme(arme, categorieArme)
|
const compToUse = this.$getCompetenceArme(arme, categorieArme)
|
||||||
if (!RdDItemArme.isArmeUtilisable(arme)) {
|
if (!RdDItemArme.isUtilisable(arme)) {
|
||||||
ui.notifications.warn(`Arme inutilisable: ${arme.name} a une résistance de 0 ou moins`)
|
ui.notifications.warn(`Arme inutilisable: ${arme.name} a une résistance de 0 ou moins`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -449,10 +463,10 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
|
|
||||||
async $afficherEncaissement(encaissement, show, defenderToken) {
|
async $afficherEncaissement(encaissement, show, defenderToken) {
|
||||||
foundry.utils.mergeObject(encaissement, {
|
foundry.utils.mergeObject(encaissement, {
|
||||||
alias: defenderToken?.name ?? this.name,
|
alias: defenderToken?.name ?? this.getAlias(),
|
||||||
hasPlayerOwner: this.hasPlayerOwner,
|
hasPlayerOwner: this.hasPlayerOwner,
|
||||||
show: show ?? {}
|
show: show ?? {}
|
||||||
}, {overwrite: false});
|
}, { overwrite: false });
|
||||||
|
|
||||||
await ChatUtility.createChatWithRollMode(
|
await ChatUtility.createChatWithRollMode(
|
||||||
{
|
{
|
||||||
@ -482,7 +496,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
}
|
}
|
||||||
const rolled = await RdDResolutionTable.roll(this.getReveActuel(), - Number(entite.system.carac.niveau.value));
|
const rolled = await RdDResolutionTable.roll(this.getReveActuel(), - Number(entite.system.carac.niveau.value));
|
||||||
const rollData = {
|
const rollData = {
|
||||||
alias: this.name,
|
alias: this.getAlias(),
|
||||||
rolled: rolled,
|
rolled: rolled,
|
||||||
entite: entite.name,
|
entite: entite.name,
|
||||||
selectedCarac: this.system.carac.reve
|
selectedCarac: this.system.carac.reve
|
||||||
@ -502,7 +516,7 @@ export class RdDBaseActorReve extends RdDBaseActor {
|
|||||||
isEntiteAccordee(attacker) { return true }
|
isEntiteAccordee(attacker) { return true }
|
||||||
|
|
||||||
async setEntiteReveAccordee(actor) {
|
async setEntiteReveAccordee(actor) {
|
||||||
ui.notifications.error("Impossible de s'accorder à " + this.name + ": ce n'est pas une entité incarnée");
|
ui.notifications.error("Impossible de s'accorder à " + this.getAlias() + ": ce n'est pas une entité incarnée");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -191,7 +191,7 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
|||||||
encaissement.mort = true;
|
encaissement.mort = true;
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
content: `<img class="chat-icon" src="icons/svg/skull.svg" data-tooltip="charge" />
|
content: `<img class="chat-icon" src="icons/svg/skull.svg" data-tooltip="charge" />
|
||||||
<strong>${this.name} vient de succomber à une seconde blessure critique ! Que les Dragons gardent son Archétype en paix !</strong>`
|
<strong>${this.getAlias()} vient de succomber à une seconde blessure critique ! Que les Dragons gardent son Archétype en paix !</strong>`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return blessure;
|
return blessure;
|
||||||
@ -218,7 +218,7 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
|||||||
async jetDeVie() {
|
async jetDeVie() {
|
||||||
if (this.isDead()) {
|
if (this.isDead()) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
content: `Jet de Vie: ${this.name} est déjà mort, ce n'est pas la peine d'en rajouter !!!!!`,
|
content: `Jet de Vie: ${this.getAlias()} est déjà mort, ce n'est pas la peine d'en rajouter !!!!!`,
|
||||||
whisper: ChatUtility.getOwners(this)
|
whisper: ChatUtility.getOwners(this)
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
@ -242,7 +242,7 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
|||||||
await this.santeIncDec("vie", -perte);
|
await this.santeIncDec("vie", -perte);
|
||||||
}
|
}
|
||||||
if (this.isDead()) {
|
if (this.isDead()) {
|
||||||
msgText += `<br><strong>${this.name} est mort !!!!</strong>`;
|
msgText += `<br><strong>${this.getAlias()} est mort !!!!</strong>`;
|
||||||
}
|
}
|
||||||
else if (prochainJet > 0) {
|
else if (prochainJet > 0) {
|
||||||
msgText += `<br>Prochain jet de vie dans ${prochainJet} ${isCritique ? 'round' : 'minute'}${prochainJet > 1 ? 's' : ''} ${isCritique ? '(état critique)' : '(état grave)'}`
|
msgText += `<br>Prochain jet de vie dans ${prochainJet} ${isCritique ? 'round' : 'minute'}${prochainJet > 1 ? 's' : ''} ${isCritique ? '(état critique)' : '(état grave)'}`
|
||||||
@ -273,7 +273,7 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
|||||||
|
|
||||||
async setSonne(sonne = true) {
|
async setSonne(sonne = true) {
|
||||||
if (!game.combat && sonne) {
|
if (!game.combat && sonne) {
|
||||||
ui.notifications.info(`${this.name} est hors combat, il ne reste donc pas sonné`);
|
ui.notifications.info(`${this.getAlias()} est hors combat, il ne reste donc pas sonné`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
await this.setEffect(STATUSES.StatusStunned, sonne)
|
await this.setEffect(STATUSES.StatusStunned, sonne)
|
||||||
|
@ -78,6 +78,13 @@ export class RdDBaseActor extends Actor {
|
|||||||
return game.actors.get(actorId)
|
return game.actors.get(actorId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAlias() {
|
||||||
|
if (this.token?.name != null && this.token != this.prototypeToken) {
|
||||||
|
return this.token.name
|
||||||
|
}
|
||||||
|
return this.name
|
||||||
|
}
|
||||||
|
|
||||||
isPersonnageJoueur() { return false }
|
isPersonnageJoueur() { return false }
|
||||||
|
|
||||||
static extractActorMin = (actor) => { return { id: actor?.id, type: actor?.type, name: actor?.name, img: actor?.img }; };
|
static extractActorMin = (actor) => { return { id: actor?.id, type: actor?.type, name: actor?.name, img: actor?.img }; };
|
||||||
@ -206,8 +213,20 @@ export class RdDBaseActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async onPreUpdateItem(item, change, options, id) { }
|
async onPreUpdateItem(item, change, options, id) { }
|
||||||
async onCreateItem(item, options, id) { }
|
async onCreateItem(item, options, id) { }
|
||||||
async onDeleteItem(item, options, id) { }
|
|
||||||
async onUpdateActor(update, options, actorId) { }
|
async onUpdateActor(update, options, actorId) { }
|
||||||
|
async onDeleteItem(item, options, id) {
|
||||||
|
if (item.isInventaire()) {
|
||||||
|
this._removeItemFromConteneur(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_removeItemFromConteneur(item) {
|
||||||
|
this.items.filter(it => it.isConteneur() && it.system.contenu.includes(item.id))
|
||||||
|
.forEach(conteneur => {
|
||||||
|
const nouveauContenu = conteneur.system.contenu.filter(id => id != item.id);
|
||||||
|
conteneur.update({ 'system.contenu': nouveauContenu });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async onTimeChanging(oldTimestamp, newTimestamp) {
|
async onTimeChanging(oldTimestamp, newTimestamp) {
|
||||||
this.items.filter(it => it.isFinPeriode(oldTimestamp, newTimestamp))
|
this.items.filter(it => it.isFinPeriode(oldTimestamp, newTimestamp))
|
||||||
@ -367,7 +386,7 @@ export class RdDBaseActor extends Actor {
|
|||||||
chatAchatItem.quantiteTotal = quantite;
|
chatAchatItem.quantiteTotal = quantite;
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
user: achat.userId,
|
user: achat.userId,
|
||||||
speaker: { alias: (acheteur ?? vendeur).name },
|
speaker: { alias: (acheteur ?? vendeur).getAlias() },
|
||||||
whisper: ChatUtility.getOwners(this),
|
whisper: ChatUtility.getOwners(this),
|
||||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-achat-item.html', chatAchatItem)
|
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-achat-item.html', chatAchatItem)
|
||||||
});
|
});
|
||||||
@ -683,7 +702,7 @@ export class RdDBaseActor extends Actor {
|
|||||||
type: this.type,
|
type: this.type,
|
||||||
img: this.img,
|
img: this.img,
|
||||||
pack: this.pack,
|
pack: this.pack,
|
||||||
name: this.name,
|
name: this.getAlias(),
|
||||||
system: { description: this.system.description }
|
system: { description: this.system.description }
|
||||||
}
|
}
|
||||||
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.html', chatData)
|
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.html', chatData)
|
||||||
@ -691,10 +710,10 @@ export class RdDBaseActor extends Actor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
actionImpossible(action) {
|
actionImpossible(action) {
|
||||||
ui.notifications.info(`${this.name} ne peut pas faire cette action: ${action}`)
|
ui.notifications.info(`${this.getAlias()} ne peut pas faire cette action: ${action}`)
|
||||||
|
|
||||||
}
|
}
|
||||||
async roll() { this.actionImpossible("jet de caractéristiques") }
|
|
||||||
async jetEthylisme() { this.actionImpossible("jet d'éthylisme") }
|
async jetEthylisme() { this.actionImpossible("jet d'éthylisme") }
|
||||||
async rollAppelChance() { this.actionImpossible("appel à la chance") }
|
async rollAppelChance() { this.actionImpossible("appel à la chance") }
|
||||||
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
||||||
@ -710,4 +729,19 @@ export class RdDBaseActor extends Actor {
|
|||||||
getItemUse(itemId) { return 0; }
|
getItemUse(itemId) { return 0; }
|
||||||
async finDeRound(options = { terminer: false }) { }
|
async finDeRound(options = { terminer: false }) { }
|
||||||
isActorCombat() { return false }
|
isActorCombat() { return false }
|
||||||
|
getCaracInit(competence) { return 0 }
|
||||||
|
listActionsCombat() { return [] }
|
||||||
|
listActionsPossessions() {
|
||||||
|
return this.itemTypes[ITEM_TYPES.possession]
|
||||||
|
.map(p => {
|
||||||
|
return {
|
||||||
|
name: p.name,
|
||||||
|
action: 'possession',
|
||||||
|
system: {
|
||||||
|
competence: p.name,
|
||||||
|
possessionid: p.system.possessionid,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
@ -73,7 +73,7 @@ export class RdDCommerceSheet extends RdDBaseActorSheet {
|
|||||||
}
|
}
|
||||||
const disponible = this.actor.getQuantiteDisponible(item)
|
const disponible = this.actor.getQuantiteDisponible(item)
|
||||||
if (disponible == 0) {
|
if (disponible == 0) {
|
||||||
ui.notifications.warn(`${this.name} n'a plus de ${item.name} en vente`);
|
ui.notifications.warn(`${this.getAlias()} n'a plus de ${item.name} en vente`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +140,8 @@ export class Mapping {
|
|||||||
|
|
||||||
static prepareArmes(actor) {
|
static prepareArmes(actor) {
|
||||||
const armes = actor.items.filter(it => it.type == ITEM_TYPES.arme)
|
const armes = actor.items.filter(it => it.type == ITEM_TYPES.arme)
|
||||||
RdDItemArme.ajoutCorpsACorps(armes, actor)
|
armes.push(RdDItemArme.corpsACorps(actor));
|
||||||
|
armes.push(RdDItemArme.empoignade(actor));
|
||||||
return armes.map(arme => [
|
return armes.map(arme => [
|
||||||
arme.system.unemain ? Mapping.prepareArme(actor, arme, 'unemain') : undefined,
|
arme.system.unemain ? Mapping.prepareArme(actor, arme, 'unemain') : undefined,
|
||||||
arme.system.deuxmains ? Mapping.prepareArme(actor, arme, 'deuxmains') : undefined,
|
arme.system.deuxmains ? Mapping.prepareArme(actor, arme, 'deuxmains') : undefined,
|
||||||
@ -152,8 +153,8 @@ export class Mapping {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static prepareArme(actor, arme, maniement) {
|
static prepareArme(actor, arme, maniement) {
|
||||||
const nameCompArme = RdDItemArme.getCompetenceArme(arme, maniement)
|
const nameCompetenceArme = RdDItemArme.getCompetenceArme(arme, maniement)
|
||||||
const competence = actor.getCompetence(nameCompArme)
|
const competence = actor.getCompetence(nameCompetenceArme)
|
||||||
if (RdDItemCompetence.isNiveauBase(competence)) {
|
if (RdDItemCompetence.isNiveauBase(competence)) {
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
@ -237,7 +238,7 @@ export class Mapping {
|
|||||||
|
|
||||||
static prepareSorts(actor) {
|
static prepareSorts(actor) {
|
||||||
const codeVoies = Mapping.getCompetencesCategorie(actor, CATEGORIES_DRACONIC)
|
const codeVoies = Mapping.getCompetencesCategorie(actor, CATEGORIES_DRACONIC)
|
||||||
.map(it => RdDItemSort.getVoieCode(it))
|
.map(it => RdDItemSort.getCodeVoie(it.name))
|
||||||
|
|
||||||
return actor.itemTypes[ITEM_TYPES.sort].map(it => Mapping.prepareSort(it, codeVoies))
|
return actor.itemTypes[ITEM_TYPES.sort].map(it => Mapping.prepareSort(it, codeVoies))
|
||||||
.sort(Misc.ascending(it => `${it.voie} : ${it.description}`))
|
.sort(Misc.ascending(it => `${it.voie} : ${it.description}`))
|
||||||
@ -245,7 +246,7 @@ export class Mapping {
|
|||||||
|
|
||||||
static prepareSort(sort, voies) {
|
static prepareSort(sort, voies) {
|
||||||
return {
|
return {
|
||||||
voie: RdDItemSort.getCodeDraconic(sort, voies),
|
voie: RdDItemSort.getCode(sort, voies),
|
||||||
description: Mapping.descriptionSort(sort),
|
description: Mapping.descriptionSort(sort),
|
||||||
bonus: Mapping.bonusCase(sort)
|
bonus: Mapping.bonusCase(sort)
|
||||||
}
|
}
|
||||||
@ -254,21 +255,13 @@ export class Mapping {
|
|||||||
static descriptionSort(sort) {
|
static descriptionSort(sort) {
|
||||||
const ptSeuil = Array(sort.system.coutseuil).map(it => '*')
|
const ptSeuil = Array(sort.system.coutseuil).map(it => '*')
|
||||||
const caseTMR = sort.system.caseTMRspeciale.length > 0 ? Mapping.toVar(sort.system.caseTMRspeciale) : Misc.upperFirst(TMRType[sort.system.caseTMR].name)
|
const caseTMR = sort.system.caseTMRspeciale.length > 0 ? Mapping.toVar(sort.system.caseTMRspeciale) : Misc.upperFirst(TMRType[sort.system.caseTMR].name)
|
||||||
const ptreve = Mapping.addSpaceToNonNumeric(sort.system.ptreve)
|
const coutReve = 'r' + RdDItemSort.addSpaceToNonNumeric(sort.system.ptreve)
|
||||||
const diff = Mapping.addSpaceToNonNumeric(sort.system.difficulte)
|
const diff = 'R' + RdDItemSort.addSpaceToNonNumeric(sort.system.difficulte)
|
||||||
return `${sort.name}${ptSeuil} (${caseTMR}) R${diff} r${ptreve}`
|
return `${sort.name}${ptSeuil} (${caseTMR}) ${diff} ${coutReve}`
|
||||||
}
|
|
||||||
|
|
||||||
static addSpaceToNonNumeric(value) {
|
|
||||||
return Number.isNumeric(value) ? value : ' ' + Mapping.toVar(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
static toVar(value) {
|
|
||||||
return value.replace('variable', 'var')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bonusCase(sort) {
|
static bonusCase(sort) {
|
||||||
const list = RdDItemSort.bonuscaseStringToList(sort.system.bonuscase).sort(Misc.descending(it => it.bonus))
|
const list = RdDItemSort.stringToBonuscases(sort.system.bonuscase).sort(Misc.descending(it => it.bonus))
|
||||||
if (list.length > 0) {
|
if (list.length > 0) {
|
||||||
const bonus = list[0]
|
const bonus = list[0]
|
||||||
return `+${bonus.bonus}% en ${bonus.case}`
|
return `+${bonus.bonus}% en ${bonus.case}`
|
||||||
|
@ -19,7 +19,7 @@ const PATHS = [
|
|||||||
|
|
||||||
const RANDOM_VALUES = {
|
const RANDOM_VALUES = {
|
||||||
'system.sexe': { 'masculin': 1, 'féminin': 1 },
|
'system.sexe': { 'masculin': 1, 'féminin': 1 },
|
||||||
'system.main': { 'droitier': 51, 'gaucher': 15, 'ambidectre': 6 },
|
'system.main': { 'droitier': 51, 'gaucher': 15, 'ambidextre': 6 },
|
||||||
'system.cheveux': { 'noirs': 2, 'bruns': 5, 'châtains clair': 5, 'blonds': 4, 'blonds très clair': 1, 'roux carotte': 1, 'roux cuivré': 3 },
|
'system.cheveux': { 'noirs': 2, 'bruns': 5, 'châtains clair': 5, 'blonds': 4, 'blonds très clair': 1, 'roux carotte': 1, 'roux cuivré': 3 },
|
||||||
'system.yeux': { 'noirs': 2, 'noisettes': 3, 'bruns vert': 4, 'verts': 3, 'bleus clair': 3, 'bleus gris': 2, 'gris': 1, 'mauves': 1, 'indigos': 1 },
|
'system.yeux': { 'noirs': 2, 'noisettes': 3, 'bruns vert': 4, 'verts': 3, 'bleus clair': 3, 'bleus gris': 2, 'gris': 1, 'mauves': 1, 'indigos': 1 },
|
||||||
}
|
}
|
||||||
|
@ -51,7 +51,7 @@ export class DialogCreateSigneDraconique extends Dialog {
|
|||||||
whisper: ChatUtility.getOwners(actor),
|
whisper: ChatUtility.getOwners(actor),
|
||||||
content: await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-actor.html", {
|
content: await renderTemplate("systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-actor.html", {
|
||||||
signe: signe,
|
signe: signe,
|
||||||
alias: actor.name
|
alias: actor.getAlias()
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ export class Grammar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static includesLowerCaseNoAccent(value, content) {
|
static includesLowerCaseNoAccent(value, content) {
|
||||||
return Grammar.toLowerCaseNoAccent(value).includes(Grammar.toLowerCaseNoAccent(content));
|
return Grammar.toLowerCaseNoAccent(value)?.includes(Grammar.toLowerCaseNoAccent(content));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
|
import { Grammar } from "./grammar.js";
|
||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js"
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js"
|
||||||
import { ITEM_TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./item.js";
|
||||||
import { RdDCombatManager } from "./rdd-combat.js";
|
import { RdDCombatManager } from "./rdd-combat.js";
|
||||||
|
|
||||||
const nomCategorieParade = {
|
const nomCategorieParade = {
|
||||||
"sans-armes": "Sans arme",
|
"sans-armes": "Sans arme",
|
||||||
"armes-naturelles": "Sans arme",
|
"armes-naturelles": "Armes naturelles",
|
||||||
"hast": "Armes d'hast",
|
"hast": "Armes d'hast",
|
||||||
"batons": "Bâtons",
|
"batons": "Bâtons",
|
||||||
"boucliers": "Boucliers",
|
"boucliers": "Boucliers",
|
||||||
@ -30,7 +31,7 @@ export class RdDItemArme extends Item {
|
|||||||
case ITEM_TYPES.competencecreature:
|
case ITEM_TYPES.competencecreature:
|
||||||
return RdDItemCompetenceCreature.armeCreature(arme);
|
return RdDItemCompetenceCreature.armeCreature(arme);
|
||||||
}
|
}
|
||||||
return RdDItemArme.mainsNues();
|
return RdDItemArme.corpsACorps();
|
||||||
}
|
}
|
||||||
|
|
||||||
static getCompetenceArme(arme, maniement) {
|
static getCompetenceArme(arme, maniement) {
|
||||||
@ -56,8 +57,8 @@ export class RdDItemArme extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static niveauCompetenceArme(arme, competences) {
|
static niveauCompetenceArme(arme, competences) {
|
||||||
const compArme = competences.find(it => it.name == arme.system.competence);
|
const compArme = competences.find(it => Grammar.equalsInsensitive(it.name, arme.system.competence))
|
||||||
return compArme?.system.niveau ?? -8;
|
return compArme?.system.niveau ?? -8
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -206,7 +207,7 @@ export class RdDItemArme extends Item {
|
|||||||
return arme.system.competence.replace(" 1 main", " 2 mains");
|
return arme.system.competence.replace(" 1 main", " 2 mains");
|
||||||
}
|
}
|
||||||
|
|
||||||
static isArmeUtilisable(arme) {
|
static isUtilisable(arme) {
|
||||||
switch (arme.type) {
|
switch (arme.type) {
|
||||||
case ITEM_TYPES.arme: return arme.system.equipe && (arme.system.resistance > 0 || arme.system.portee_courte > 0)
|
case ITEM_TYPES.arme: return arme.system.equipe && (arme.system.resistance > 0 || arme.system.portee_courte > 0)
|
||||||
case ITEM_TYPES.competencecreature: return true
|
case ITEM_TYPES.competencecreature: return true
|
||||||
@ -214,9 +215,24 @@ export class RdDItemArme extends Item {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
static ajoutCorpsACorps(armes, actor) {
|
static isAttaque(arme) {
|
||||||
armes.push(RdDItemArme.mainsNues(actor));
|
switch (arme.type) {
|
||||||
armes.push(RdDItemArme.empoignade(actor));
|
case ITEM_TYPES.arme:
|
||||||
|
return arme.system.equipe && (arme.system.resistance > 0 || arme.system.portee_courte > 0)
|
||||||
|
case ITEM_TYPES.competencecreature:
|
||||||
|
return arme.system.iscombat && RdDItemCompetenceCreature.isAttaque(item)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
static isParade(arme) {
|
||||||
|
switch (arme.type) {
|
||||||
|
case ITEM_TYPES.arme:
|
||||||
|
return arme.system.equipe && arme.system.resistance > 0 && true/* TODO: regarder la categorie d'arme?*/
|
||||||
|
case ITEM_TYPES.competencecreature:
|
||||||
|
return arme.system.iscombat && RdDItemCompetenceCreature.isParade(arme)
|
||||||
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
static corpsACorps(actor) {
|
static corpsACorps(actor) {
|
||||||
@ -237,6 +253,8 @@ export class RdDItemArme extends Item {
|
|||||||
mortalite: 'non-mortel',
|
mortalite: 'non-mortel',
|
||||||
competence: 'Corps à corps',
|
competence: 'Corps à corps',
|
||||||
resistance: 1,
|
resistance: 1,
|
||||||
|
baseInit: 4,
|
||||||
|
cac: 'pugilat',
|
||||||
deuxmains: true,
|
deuxmains: true,
|
||||||
categorie_parade: 'sans-armes'
|
categorie_parade: 'sans-armes'
|
||||||
}
|
}
|
||||||
@ -246,8 +264,6 @@ export class RdDItemArme extends Item {
|
|||||||
static mainsNues(actor) {
|
static mainsNues(actor) {
|
||||||
const mainsNues = RdDItemArme.corpsACorps(actor)
|
const mainsNues = RdDItemArme.corpsACorps(actor)
|
||||||
mainsNues.name = 'Mains nues'
|
mainsNues.name = 'Mains nues'
|
||||||
mainsNues.system.cac = 'pugilat'
|
|
||||||
mainsNues.system.baseInit = 4
|
|
||||||
return mainsNues;
|
return mainsNues;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,40 +27,29 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
static armeCreature(item) {
|
static armeCreature(item) {
|
||||||
const categorieAttaque = RdDItemCompetenceCreature.getCategorieAttaque(item)
|
const categorieAttaque = RdDItemCompetenceCreature.getCategorieAttaque(item)
|
||||||
if (categorieAttaque != undefined) {
|
if (categorieAttaque != undefined) {
|
||||||
// si c'est un Item compétence: cloner pour ne pas modifier la compétence
|
// cloner pour ne pas modifier la compétence
|
||||||
let arme = item.clone();
|
return foundry.utils.mergeObject(item, {
|
||||||
return foundry.utils.mergeObject(arme, {
|
|
||||||
action: item.isCompetencePossession() ? 'possession' : 'attaque',
|
action: item.isCompetencePossession() ? 'possession' : 'attaque',
|
||||||
system: {
|
system: {
|
||||||
competence: arme.name,
|
competence: item.name,
|
||||||
cac: categorieAttaque == "naturelle" ? "naturelle" : "",
|
cac: categorieAttaque == "naturelle" ? "naturelle" : "",
|
||||||
niveau: item.system.niveau,
|
niveau: item.system.niveau,
|
||||||
initiative: RdDCombatManager.calculInitiative(item.system.niveau, item.system.carac_value),
|
initiative: RdDCombatManager.calculInitiative(item.system.niveau, item.system.carac_value),
|
||||||
equipe: true,
|
equipe: true,
|
||||||
resistance: 100,
|
resistance: 100,
|
||||||
dommagesReels: arme.system.dommages,
|
dommagesReels: item.system.dommages,
|
||||||
penetration: 0,
|
penetration: 0,
|
||||||
force: 0,
|
force: 0,
|
||||||
rapide: true,
|
rapide: true,
|
||||||
}
|
}
|
||||||
}, { inplace: false });
|
}, { inplace: false, });
|
||||||
}
|
}
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isCompetenceAttaque(item) {
|
static isAttaque(item) {
|
||||||
if (item.type == ITEM_TYPES.competencecreature) {
|
return RdDItemCompetenceCreature.getCategorieAttaque(item) != undefined
|
||||||
switch (item.system.categorie) {
|
|
||||||
case "melee":
|
|
||||||
case "tir":
|
|
||||||
case "lancer":
|
|
||||||
case "naturelle":
|
|
||||||
case "possession":
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return undefined
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static getCategorieAttaque(item) {
|
static getCategorieAttaque(item) {
|
||||||
@ -71,12 +60,12 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
case "lancer":
|
case "lancer":
|
||||||
case "naturelle":
|
case "naturelle":
|
||||||
case "possession":
|
case "possession":
|
||||||
case "parade":
|
|
||||||
return item.system.categorie
|
return item.system.categorie
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
static isDommages(item) {
|
static isDommages(item) {
|
||||||
if (item.type == ITEM_TYPES.competencecreature) {
|
if (item.type == ITEM_TYPES.competencecreature) {
|
||||||
switch (item.system.categorie) {
|
switch (item.system.categorie) {
|
||||||
@ -89,20 +78,12 @@ export class RdDItemCompetenceCreature extends Item {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
static isParade(item) {
|
static isParade(item) {
|
||||||
if (item.type == ITEM_TYPES.competencecreature) {
|
if (item.type == ITEM_TYPES.competencecreature) {
|
||||||
switch (item.system.categorie) {
|
return armeData.system.categorie_parade || armeData.system.isparade
|
||||||
case "melee":
|
|
||||||
case "naturelle":
|
|
||||||
case "parade":
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
}
|
||||||
static isCompetenceParade(item) {
|
|
||||||
return item.type == 'competencecreature' && item.system.categorie_parade !== "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -13,6 +13,7 @@ import { Misc } from "./misc.js";
|
|||||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||||
import { ITEM_TYPES, RdDItem } from "./item.js";
|
import { ITEM_TYPES, RdDItem } from "./item.js";
|
||||||
|
import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend the basic ItemSheet for RdD specific items
|
* Extend the basic ItemSheet for RdD specific items
|
||||||
@ -100,55 +101,59 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
descriptionmj: await TextEditor.enrichHTML(this.item.system.descriptionmj, { async: true }),
|
descriptionmj: await TextEditor.enrichHTML(this.item.system.descriptionmj, { async: true }),
|
||||||
isComestible: this.item.getUtilisationCuisine(),
|
isComestible: this.item.getUtilisationCuisine(),
|
||||||
options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable),
|
options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable),
|
||||||
|
competences: await SystemCompendiums.getCompetences('personnage'),
|
||||||
|
categories: RdDItem.getCategories(this.item.type),
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.item.type == ITEM_TYPES.competencecreature) {
|
if (this.item.type == ITEM_TYPES.competencecreature) {
|
||||||
formData.isparade = RdDItemCompetenceCreature.isParade(this.item)
|
formData.isparade = RdDItemCompetenceCreature.isParade(this.item)
|
||||||
formData.isdommages = RdDItemCompetenceCreature.isDommages(this.item)
|
formData.isdommages = RdDItemCompetenceCreature.isDommages(this.item)
|
||||||
}
|
}
|
||||||
|
if (this.item.type == ITEM_TYPES.tache ||
|
||||||
const competences = await SystemCompendiums.getCompetences('personnage');
|
this.item.type == ITEM_TYPES.livre ||
|
||||||
formData.categories = RdDItem.getCategories(this.item.type)
|
this.item.type == ITEM_TYPES.meditation ||
|
||||||
if (this.item.type == 'tache' || this.item.type == 'livre' || this.item.type == 'meditation' || this.item.type == 'oeuvre') {
|
this.item.type == ITEM_TYPES.oeuvre) {
|
||||||
formData.caracList = foundry.utils.duplicate(game.model.Actor.personnage.carac)
|
formData.caracList = foundry.utils.duplicate(game.model.Actor.personnage.carac)
|
||||||
formData.caracList["reve-actuel"] = foundry.utils.duplicate(game.model.Actor.personnage.reve.reve)
|
formData.caracList["reve-actuel"] = foundry.utils.duplicate(game.model.Actor.personnage.reve.reve)
|
||||||
formData.competences = competences;
|
|
||||||
}
|
}
|
||||||
if (this.item.type == 'arme') {
|
if (this.item.type == ITEM_TYPES.arme) {
|
||||||
formData.competences = competences.filter(it => it.isCompetenceArme())
|
formData.competences = formData.competences.filter(it => it.isCompetenceArme())
|
||||||
}
|
}
|
||||||
if (['sort', 'sortreserve'].includes(this.item.type)) {
|
if (this.item.type == ITEM_TYPES.recettecuisine) {
|
||||||
formData.competences = competences.filter(it => RdDItemCompetence.isDraconic(it));
|
|
||||||
}
|
|
||||||
if (this.item.type == 'recettecuisine') {
|
|
||||||
formData.ingredients = await TextEditor.enrichHTML(this.object.system.ingredients, { async: true })
|
formData.ingredients = await TextEditor.enrichHTML(this.object.system.ingredients, { async: true })
|
||||||
}
|
}
|
||||||
if (this.item.type == 'extraitpoetique') {
|
if (this.item.type == ITEM_TYPES.extraitpoetique) {
|
||||||
formData.extrait = await TextEditor.enrichHTML(this.object.system.extrait, { async: true })
|
formData.extrait = await TextEditor.enrichHTML(this.object.system.extrait, { async: true })
|
||||||
formData.texte = await TextEditor.enrichHTML(this.object.system.texte, { async: true })
|
formData.texte = await TextEditor.enrichHTML(this.object.system.texte, { async: true })
|
||||||
}
|
}
|
||||||
if (this.item.type == 'recettealchimique') {
|
if (this.item.type == ITEM_TYPES.recettealchimique) {
|
||||||
RdDAlchimie.processManipulation(this.item, this.actor && this.actor.id);
|
RdDAlchimie.processManipulation(this.item, this.actor?.id);
|
||||||
formData.manipulation_update = await TextEditor.enrichHTML(this.object.system.manipulation_update, { async: true })
|
formData.manipulation_update = await TextEditor.enrichHTML(this.object.system.manipulation_update, { async: true })
|
||||||
formData.utilisation = await TextEditor.enrichHTML(this.object.system.utilisation, { async: true })
|
formData.utilisation = await TextEditor.enrichHTML(this.object.system.utilisation, { async: true })
|
||||||
formData.enchantement = await TextEditor.enrichHTML(this.object.system.enchantement, { async: true })
|
formData.enchantement = await TextEditor.enrichHTML(this.object.system.enchantement, { async: true })
|
||||||
formData.sureffet = await TextEditor.enrichHTML(this.object.system.sureffet, { async: true })
|
formData.sureffet = await TextEditor.enrichHTML(this.object.system.sureffet, { async: true })
|
||||||
}
|
}
|
||||||
if (this.item.type == 'gemme') {
|
if (this.item.type == ITEM_TYPES.gemme) {
|
||||||
formData.gemmeTypeList = RdDGemme.getGemmeTypeOptionList();
|
formData.gemmeTypeList = RdDGemme.getGemmeTypeOptionList();
|
||||||
RdDGemme.calculDataDerivees(this.item);
|
RdDGemme.calculDataDerivees(this.item)
|
||||||
}
|
}
|
||||||
if (this.item.type == 'potion') {
|
if (this.item.type == ITEM_TYPES.potion) {
|
||||||
await RdDHerbes.addPotionFormData(formData);
|
RdDHerbes.calculFormData(formData, this.item)
|
||||||
}
|
}
|
||||||
if (formData.options.isOwned && this.item.type == 'herbe' && (formData.system.categorie == 'Soin' || formData.system.categorie == 'Repos')) {
|
if (this.item.type == ITEM_TYPES.herbe) {
|
||||||
formData.isIngredientPotionBase = true;
|
if (formData.options.isOwned && ['Soin', 'Repos'].includes(formData.system.categorie)) {
|
||||||
|
formData.isIngredientPotionBase = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (this.item.type == 'sortreserve') {
|
if (this.item.type == ITEM_TYPES.sortreserve) {
|
||||||
const sortId = this.item.system.sortid;
|
const sortId = this.item.system.sortid;
|
||||||
|
formData.competences = formData.competences.filter(it => RdDItemCompetence.isDraconic(it));
|
||||||
formData.sort = formData.options.isOwned ? this.item.actor.items.get(sortId) : game.items.get(sortId);
|
formData.sort = formData.options.isOwned ? this.item.actor.items.get(sortId) : game.items.get(sortId);
|
||||||
}
|
}
|
||||||
formData.bonusCaseList = RdDItemSort.getBonusCaseList(formData, true);
|
if (this.item.type == ITEM_TYPES.sort) {
|
||||||
|
formData.competences = formData.competences.filter(it => RdDItemCompetence.isDraconic(it));
|
||||||
|
formData.bonusCaseList = RdDItemSort.getBonusCaseList(this.item);
|
||||||
|
}
|
||||||
return formData;
|
return formData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,6 +190,9 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
this.html.find('.delete-bonus-case').click((event) => {
|
||||||
|
this.supprimerBonusCase(event.currentTarget.attributes['data-deleteCoord'].value)
|
||||||
|
})
|
||||||
|
|
||||||
this.html.find('.date-enchantement').change((event) => {
|
this.html.find('.date-enchantement').change((event) => {
|
||||||
const jour = Number(this.html.find('input.date-enchantement[name="enchantement.jour"]').val());
|
const jour = Number(this.html.find('input.date-enchantement[name="enchantement.jour"]').val());
|
||||||
@ -264,23 +272,66 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async supprimerBonusCase(deleteCoord){
|
||||||
|
if (this.item.type == ITEM_TYPES.sort) {
|
||||||
|
const oldList = RdDItemSort.getBonusCaseList(this.item)
|
||||||
|
const newList = oldList.filter(it => it.case != deleteCoord);
|
||||||
|
if (newList.length != oldList.length) {
|
||||||
|
await this.item.update({
|
||||||
|
'system.bonuscase': RdDItemSort.bonuscasesToString(newList)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/** @override */
|
/** @override */
|
||||||
_updateObject(event, formData) {
|
_updateObject(event, formData) {
|
||||||
switch (this.item.type) {
|
switch (this.item.type) {
|
||||||
case ITEM_TYPES.sort:
|
case ITEM_TYPES.sort:
|
||||||
// Données de bonus de cases ?
|
formData['system.bonuscase'] = RdDItemSort.bonuscasesToString(RdDItemSheet._listCaseTmr(
|
||||||
formData['system.bonuscase'] = RdDItemSort.buildBonuscaseFromArrays(formData.bonusValue, formData.caseValue)
|
formData.caseTmrCoord,
|
||||||
|
formData.caseTmrBonus,
|
||||||
|
formData.caseTmrAdd
|
||||||
|
))
|
||||||
break
|
break
|
||||||
case ITEM_TYPES.competence:
|
case ITEM_TYPES.competence:
|
||||||
if (formData['system.niveau'] == undefined) {
|
formData['system.niveau'] = formData['system.niveau'] ?? formData['system.base']
|
||||||
formData['system.niveau'] = formData['system.base']
|
break
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.item.update(formData);
|
return this.item.update(formData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
/**
|
||||||
|
* reconstruit les bonus de cases
|
||||||
|
* @param {*} caseTmrCoord tableau des coordonées
|
||||||
|
* @param {*} caseTmrBonus tableau des bonus
|
||||||
|
* @param {*} caseTmrAdd case à ajouter
|
||||||
|
* @returns list d'objets {coord, bonus}
|
||||||
|
*/
|
||||||
|
static _listCaseTmr(caseTmrCoord, caseTmrBonus, caseTmrAdd) {
|
||||||
|
const listCaseTmrCoord = caseTmrCoord == undefined ? [] : Array.isArray(caseTmrCoord) ? caseTmrCoord : [caseTmrCoord]
|
||||||
|
const listCaseTmrBonus = caseTmrBonus == undefined ? [] : Array.isArray(caseTmrBonus) ? caseTmrBonus : [caseTmrBonus]
|
||||||
|
if (caseTmrAdd != undefined && caseTmrAdd != '' && TMRUtility.verifyTMRCoord(caseTmrAdd) && !listCaseTmrCoord.includes(caseTmrAdd)) {
|
||||||
|
listCaseTmrCoord.push(TMRUtility.getTMR(caseTmrAdd).coord)
|
||||||
|
listCaseTmrBonus.push(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
const list = [];
|
||||||
|
const caseChecked = {};
|
||||||
|
for (let i = 0; i < listCaseTmrBonus.length && i < listCaseTmrCoord.length; i++) {
|
||||||
|
const coord = listCaseTmrCoord[i] == FLEUVE_COORD ? FLEUVE_COORD : (listCaseTmrCoord[i]?.toUpperCase() ?? 'A1')
|
||||||
|
const bonus = listCaseTmrBonus[i] ?? 0
|
||||||
|
if (TMRUtility.verifyTMRCoord(coord) && bonus >= 0 && !caseChecked[coord]) {
|
||||||
|
caseChecked[coord] = coord
|
||||||
|
list.push({ case: coord, bonus: bonus })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _onDragStart(event) {
|
async _onDragStart(event) {
|
||||||
}
|
}
|
||||||
|
@ -2,52 +2,69 @@ import { Grammar } from "./grammar.js";
|
|||||||
import { RdDItemCompetence } from "./item-competence.js";
|
import { RdDItemCompetence } from "./item-competence.js";
|
||||||
import { ITEM_TYPES } from "./item.js";
|
import { ITEM_TYPES } from "./item.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { TMRUtility } from "./tmr-utility.js";
|
import { FLEUVE_COORD, TMRUtility } from "./tmr-utility.js";
|
||||||
|
|
||||||
const VOIES_DRACONIC = [
|
export const VOIES_DRACONIC = [
|
||||||
{ code: 'O', label: "Voie d'Oniros", short: 'Oniros', ordre: 'a' },
|
{ code: 'O', label: "Voie d'Oniros", short: 'Oniros', ordre: 'a' },
|
||||||
{ code: 'H', label: "Voie d'Hypnos", short: 'Hypnos', ordre: 'b' },
|
{ code: 'H', label: "Voie d'Hypnos", short: 'Hypnos', ordre: 'b' },
|
||||||
{ code: 'N', label: "Voie de Narcos", short: 'Narcos', ordre: 'c' },
|
{ code: 'N', label: "Voie de Narcos", short: 'Narcos', ordre: 'c' },
|
||||||
{ code: 'T', label: "Voie de Thanatos", short: 'Thanatos', ordre: 'd' },
|
{ code: 'T', label: "Voie de Thanatos", short: 'Thanatos', ordre: 'd' },
|
||||||
{ code: 'O/H/N/T', label: "Oniros/Hypnos/Narcos/Thanatos", short: 'Oniros/Hypnos/Narcos/Thanatos', ordre: 'e' },
|
{ code: 'O/H/N/T', label: "Oniros/Hypnos/Narcos/Thanatos", short: 'O/H/N/T', ordre: 'e' },
|
||||||
{ code: 'O/H/N', label: "Oniros/Hypnos/Narcos", short: "Oniros/Hypnos/Narcos", ordre: 'f' }
|
{ code: 'O/H/N', label: "Oniros/Hypnos/Narcos", short: "O/H/N", ordre: 'f' }
|
||||||
]
|
]
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
export class RdDItemSort extends Item {
|
export class RdDItemSort extends Item {
|
||||||
|
static preloadHandlebars() {
|
||||||
|
Handlebars.registerHelper('itemSort-spaceIfText', val => RdDItemSort.addSpaceToNonNumeric(val))
|
||||||
|
Handlebars.registerHelper('itemSort-codeDraconic', voie => RdDItemSort.getCode(voie))
|
||||||
|
Handlebars.registerHelper('itemSort-shortDraconic', voie => RdDItemSort.getShortVoie(voie))
|
||||||
|
}
|
||||||
|
|
||||||
static getDraconicsSort(draconicList, sort) {
|
static addSpaceToNonNumeric(value) {
|
||||||
|
return Number.isNumeric(value) || ['-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'].includes( String(value).charAt[0]) ? value : ' ' + RdDItemSort.toVar(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
static toVar(value) {
|
||||||
|
return value ? value.replace('variable', 'var') : ''
|
||||||
|
}
|
||||||
|
|
||||||
|
static getDraconicsSort(competencesDraconic, sort) {
|
||||||
|
// se baser sur la voie du sort?
|
||||||
switch (Grammar.toLowerCaseNoAccent(sort.name)) {
|
switch (Grammar.toLowerCaseNoAccent(sort.name)) {
|
||||||
case "lecture d'aura":
|
case "lecture d'aura":
|
||||||
case "detection d'aura":
|
case "detection d'aura":
|
||||||
return draconicList;
|
return competencesDraconic;
|
||||||
case "annulation de magie":
|
case "annulation de magie":
|
||||||
return draconicList.filter(it => !RdDItemCompetence.isThanatos(it));
|
return competencesDraconic.filter(it => !RdDItemCompetence.isThanatos(it));
|
||||||
}
|
}
|
||||||
return [RdDItemCompetence.getVoieDraconic(draconicList, sort.system.draconic)];
|
const voies = sort.system.draconic.split('/')
|
||||||
|
return voies.map(voie => RdDItemCompetence.getVoieDraconic(competencesDraconic, voie))
|
||||||
}
|
}
|
||||||
|
|
||||||
static getOrdreCode(code) {
|
static getOrdreCode(code) {
|
||||||
return (VOIES_DRACONIC.find(it => it.code == code)?.ordre ?? '?')
|
return (VOIES_DRACONIC.find(it => it.code == code)?.ordre ?? '?')
|
||||||
}
|
}
|
||||||
|
|
||||||
static getVoieCode(voie) {
|
static getCodeVoie(voie) {
|
||||||
return VOIES_DRACONIC.find(it => voie.name.includes(it.short))?.code ?? '?'
|
return VOIES_DRACONIC.find(it => [it.code, it.short, it.label].includes(voie))?.code ?? '?'
|
||||||
}
|
}
|
||||||
|
|
||||||
static getCodeDraconic(sort, voies = ['O', 'H', 'N', 'T']) {
|
static getShortVoie(voie) {
|
||||||
|
return VOIES_DRACONIC.find(it => [it.code, it.short, it.label].includes(voie))?.short ?? voie
|
||||||
|
}
|
||||||
|
|
||||||
|
static getCode(sort, codeVoies = ['O', 'H', 'N', 'T']) {
|
||||||
switch (Grammar.toLowerCaseNoAccent(sort.name)) {
|
switch (Grammar.toLowerCaseNoAccent(sort.name)) {
|
||||||
case "lecture d'aura":
|
case "lecture d'aura":
|
||||||
case "detection d'aura":
|
case "detection d'aura":
|
||||||
return RdDItemSort.$voiesConnues('O/H/N/T', voies)
|
return RdDItemSort.$voiesConnues('O/H/N/T', codeVoies)
|
||||||
case "annulation de magie":
|
case "annulation de magie":
|
||||||
return RdDItemSort.$voiesConnues('O/H/N', voies)
|
return RdDItemSort.$voiesConnues('O/H/N', codeVoies)
|
||||||
}
|
}
|
||||||
const voie = VOIES_DRACONIC.find(it => it.label.includes(sort.system.draconic))
|
return RdDItemSort.getCodeVoie(sort.system.draconic)
|
||||||
return voie?.code ?? sort.system.draconic
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static $voiesConnues(voiesSort, voies) {
|
static $voiesConnues(voiesSort, voies) {
|
||||||
const codes = voies.filter(it => voiesSort.includes(it))
|
const codes = voies.filter(it => voiesSort.includes(it))
|
||||||
.sort(Misc.ascending(it => RdDItemSort.getOrdreCode(it)))
|
.sort(Misc.ascending(it => RdDItemSort.getOrdreCode(it)))
|
||||||
@ -79,89 +96,60 @@ export class RdDItemSort extends Item {
|
|||||||
return variable;
|
return variable;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static buildBonusCaseList(bonuscase, newCase) {
|
|
||||||
const list = RdDItemSort.bonuscaseStringToList(bonuscase)
|
|
||||||
if (newCase) {
|
|
||||||
list.push({ case: "Nouvelle", bonus: 0 })
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retourne une liste de bonus/case pour un item-sheet
|
* Retourne une liste de bonus/case pour un item-sheet
|
||||||
* @param {} item
|
* @param {} item
|
||||||
*/
|
*/
|
||||||
static getBonusCaseList(item, newCase = false) {
|
static getBonusCaseList(item) {
|
||||||
// Gestion spéciale case bonus
|
// Gestion spéciale case bonus
|
||||||
if (item.type == ITEM_TYPES.sort) {
|
if (item.type == ITEM_TYPES.sort) {
|
||||||
return RdDItemSort.buildBonusCaseList(item.system.bonuscase, newCase);
|
return RdDItemSort.stringToBonuscases(item.system.bonuscase)
|
||||||
}
|
}
|
||||||
return undefined;
|
return [];
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
/** Met à jour les données de formulaire
|
|
||||||
* si static des bonus de cases sont présents
|
|
||||||
* */
|
|
||||||
static buildBonuscaseFromArrays(bonuses, coords) {
|
|
||||||
if (bonuses) {
|
|
||||||
const list = [];
|
|
||||||
const caseCheck = {};
|
|
||||||
for (let i = 0; i < bonuses.length && i < coords.length; i++) {
|
|
||||||
const coord = coords[i] == 'Fleuve' ? 'Fleuve' : (coords[i]?.toUpperCase() ?? 'A1');
|
|
||||||
const bonus = bonuses[i] || 0;
|
|
||||||
if (TMRUtility.verifyTMRCoord(coord) && bonus > 0 && caseCheck[coord] == undefined) {
|
|
||||||
caseCheck[coord] = bonus;
|
|
||||||
list.push({ case: coord, bonus: bonus });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return RdDItemSort._bonuscaseListToString(list);
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static incrementBonusCase(actor, sort, coord) {
|
static incrementBonusCase(actor, sort, coord) {
|
||||||
if (TMRUtility.getTMR(coord).type == "fleuve") {
|
if (TMRUtility.isFleuve(coord)) {
|
||||||
coord = 'Fleuve';
|
coord = FLEUVE_COORD;
|
||||||
|
}
|
||||||
|
let list = RdDItemSort.stringToBonuscases(sort.system.bonuscase);
|
||||||
|
const existing = list.find(it => it.case == coord)
|
||||||
|
const bonus = Number(existing?.bonus ?? 0) + 1
|
||||||
|
if (existing) {
|
||||||
|
existing.bonus = bonus
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
list.push({ case: coord, bonus: 1 })
|
||||||
}
|
}
|
||||||
const list = RdDItemSort.buildBonusCaseList(sort.system.bonuscase, false);
|
|
||||||
const bonus = Number(list.find(it => it.case == coord)?.bonus ?? 0);
|
|
||||||
const modified = { case: coord, bonus: bonus + 1 };
|
|
||||||
|
|
||||||
const bonuscase = RdDItemSort._bonuscaseListToString(
|
actor.updateEmbeddedDocuments('Item', [{ _id: sort._id, 'system.bonuscase': RdDItemSort.bonuscasesToString(list) }]);
|
||||||
list.filter(it => it.case != coord).concat(modified)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Sauvegarde/update
|
|
||||||
actor.updateEmbeddedDocuments('Item', [{ _id: sort._id, 'system.bonuscase': bonuscase }]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getCaseBonus(sort, coord) {
|
static getCaseBonus(sort, coord) {
|
||||||
const isFleuve = TMRUtility.getTMR(coord).type == "fleuve";
|
const search = TMRUtility.isFleuve(coord)
|
||||||
|
? it => it.case == 'Fleuve'
|
||||||
let bc = RdDItemSort.buildBonusCaseList(sort.system.bonuscase, false)
|
: it => it.case == coord;
|
||||||
.filter(it => it.case == coord || (isFleuve && it.case == 'Fleuve'))
|
const bc = RdDItemSort.stringToBonuscases(sort.system.bonuscase)
|
||||||
.find(it => true)
|
.find(search)
|
||||||
return Number(bc?.bonus ?? 0);
|
return Number(bc?.bonus ?? 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static _bonuscaseListToString(list) {
|
static bonuscasesToString(list) {
|
||||||
return list.map(it => `${it.case}:${it.bonus}`)
|
return list.map(it => `${it.case}:${it.bonus}`)
|
||||||
.sort(Misc.ascending())
|
.sort(Misc.ascending())
|
||||||
.join(',');
|
.join(',');
|
||||||
}
|
}
|
||||||
static bonuscaseStringToList(bonuscase) {
|
|
||||||
|
static stringToBonuscases(bonuscase) {
|
||||||
if (bonuscase == undefined || bonuscase == '') {
|
if (bonuscase == undefined || bonuscase == '') {
|
||||||
return []
|
return []
|
||||||
}
|
}
|
||||||
return bonuscase.split(',').map(it => {
|
return bonuscase.split(',')
|
||||||
const b = it.split(':');
|
.map(it => it.split(':'))
|
||||||
return { case: b[0], bonus: b[1] };
|
.map(it => { return { case: it[0], bonus: it[1] } });
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -571,6 +571,7 @@ export class RdDItem extends Item {
|
|||||||
else {
|
else {
|
||||||
await this.quantiteIncDec(item.system.quantite);
|
await this.quantiteIncDec(item.system.quantite);
|
||||||
}
|
}
|
||||||
|
// TODO: suppression dans les conteneurs!
|
||||||
await item.delete();
|
await item.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -601,6 +602,9 @@ export class RdDItem extends Item {
|
|||||||
if (!other || !this.isInventaire()) {
|
if (!other || !this.isInventaire()) {
|
||||||
return [false, undefined];
|
return [false, undefined];
|
||||||
}
|
}
|
||||||
|
if (this.isConteneur()){
|
||||||
|
return [false, `Impossible de regrouper des conteneurs, ils ne sont pas empilables`];
|
||||||
|
}
|
||||||
if (this.system.quantite == undefined) {
|
if (this.system.quantite == undefined) {
|
||||||
return [false, `Impossible de regrouper des ${this.type}, ils ne sont pas empilables`];
|
return [false, `Impossible de regrouper des ${this.type}, ils ne sont pas empilables`];
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import { Monnaie } from "./item-monnaie.js";
|
|||||||
import { RdDItem, ITEM_TYPES } from "./item.js";
|
import { RdDItem, ITEM_TYPES } from "./item.js";
|
||||||
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
import { RdDTimestamp } from "./time/rdd-timestamp.js";
|
||||||
import { RdDRaretes } from "./item/raretes.js";
|
import { RdDRaretes } from "./item/raretes.js";
|
||||||
import { RdDCalendrier } from "./time/rdd-calendrier.js";
|
import { VOIES_DRACONIC } from "./item-sort.js";
|
||||||
|
|
||||||
class Migration {
|
class Migration {
|
||||||
get code() { return "sample"; }
|
get code() { return "sample"; }
|
||||||
@ -530,6 +530,32 @@ class _11_2_20_MigrationAstrologie extends Migration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _12_0_24_MigrationVoieSorts extends Migration {
|
||||||
|
get code() { return "migration-voies-sorts" }
|
||||||
|
get version() { return "12.0.24" }
|
||||||
|
|
||||||
|
async migrate() {
|
||||||
|
await this.applyItemsUpdates(items => items
|
||||||
|
.filter(it => ITEM_TYPES.sort == it.type)
|
||||||
|
.map(it => this.migrateSort(it))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
migrateSort(it) {
|
||||||
|
return {
|
||||||
|
_id: it.id,
|
||||||
|
'system.draconic': this.convertDraconic(it.system.draconic),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
convertDraconic(draconic) {
|
||||||
|
for (let v of VOIES_DRACONIC) {
|
||||||
|
if ([v.label, v.short, v.code].includes(draconic)) {
|
||||||
|
return v.short
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return draconic
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export class Migrations {
|
export class Migrations {
|
||||||
static getMigrations() {
|
static getMigrations() {
|
||||||
return [
|
return [
|
||||||
|
@ -189,13 +189,7 @@ export class Misc {
|
|||||||
* and there is no connected GM
|
* and there is no connected GM
|
||||||
*/
|
*/
|
||||||
static documentIfResponsible(document) {
|
static documentIfResponsible(document) {
|
||||||
if (foundry.utils.isNewerVersion(game.release.version, '12.0')) {
|
if (Misc.isFirstConnectedGM() || (Misc.connectedGMs().length == 0 && Misc.isFirstOwnerPlayer(document))) {
|
||||||
if (game.users.activeGM || (Misc.connectedGMs().length == 0 && Misc.isOwnerPlayer(document)))
|
|
||||||
{
|
|
||||||
return document
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (Misc.isFirstConnectedGM() || (Misc.connectedGMs().length == 0 && Misc.isOwnerPlayer(document))) {
|
|
||||||
return document
|
return document
|
||||||
}
|
}
|
||||||
return undefined
|
return undefined
|
||||||
@ -205,8 +199,15 @@ export class Misc {
|
|||||||
return document.testUserPermission && document.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)
|
return document.testUserPermission && document.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static isFirstOwnerPlayer(document) {
|
||||||
|
if (!document.testUserPermission){
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return game.users.filter(u => document.testUserPermission(u, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)) == game.user
|
||||||
|
}
|
||||||
|
|
||||||
static isOwnerPlayerOrUniqueConnectedGM(actor) {
|
static isOwnerPlayerOrUniqueConnectedGM(actor) {
|
||||||
return Misc.isOwnerPlayer(actor) ?? Misc.isFirstConnectedGM();
|
return Misc.isFirstOwnerPlayer(actor) ?? Misc.isFirstConnectedGM();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,9 +53,14 @@ export class RdDCarac {
|
|||||||
return selectedCarac?.label?.toLowerCase()?.match(/r(e|ê)ve(( |-)actuel)?/);
|
return selectedCarac?.label?.toLowerCase()?.match(/r(e|ê)ve(( |-)actuel)?/);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* L’appel à la chance n’est possible que pour recommencer les jets d’actions physiques :
|
||||||
|
* tous les jets de combat, de FORCE, d’AGILITÉ, de DEXTÉRITÉ, de Dérobée, d’APPARENCE,
|
||||||
|
* ainsi que de Perception active et volontaire.
|
||||||
|
*/
|
||||||
static isActionPhysique(selectedCarac) {
|
static isActionPhysique(selectedCarac) {
|
||||||
return !selectedCarac ||
|
return Grammar.toLowerCaseNoAccent(selectedCarac?.label)
|
||||||
selectedCarac?.label.match(/(Apparence|Force|Agilité|Dextérité|Vue|Ouïe|Odorat-Goût|Empathie|Dérobée|Mêlée|Tir|Lancer)/);
|
?.match(/(apparence|force|agilite|dexterite|vue|ouie|gout|odorat|empathie|melee|tir|lancer|derobee)/) != null
|
||||||
}
|
}
|
||||||
|
|
||||||
static getCaracDerivee(value) {
|
static getCaracDerivee(value) {
|
||||||
@ -90,15 +95,4 @@ export class RdDCarac {
|
|||||||
static getCaracXp(targetValue) {
|
static getCaracXp(targetValue) {
|
||||||
return RdDCarac.getCaracDerivee(targetValue)?.xp ?? 200;
|
return RdDCarac.getCaracDerivee(targetValue)?.xp ?? 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* L’appel à la chance n’est possible que pour recommencer les jets d’actions physiques :
|
|
||||||
* tous les jets de combat, de FORCE, d’AGILITÉ, de DEXTÉRITÉ, de Dérobée, d’APPARENCE,
|
|
||||||
* ainsi que de Perception active et volontaire.
|
|
||||||
*/
|
|
||||||
static isActionPhysique(selectedCarac) {
|
|
||||||
return Grammar.toLowerCaseNoAccent(selectedCarac?.label)?.match(/(apparence|force|agilite|dexterite|vue|ouie|odorat|empathie|melee|tir|lancer|derobee)/);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -72,19 +72,28 @@ export class RdDCombatManager extends Combat {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async finDeRound(options = { terminer: false }) {
|
async finDeRound(options = { terminer: false }) {
|
||||||
|
this.combatants.map(it => RdDCombatManager.getActorCombatant(it, { warning: false }))
|
||||||
|
.filter(it => it != undefined)
|
||||||
|
.forEach(async actor => {
|
||||||
|
await actor.finDeRound(options)
|
||||||
|
await actor.resetItemUse()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
for (let combatant of this.combatants) {
|
static getActorCombatant(combatant, options = { warning: true }) {
|
||||||
if (!combatant.actor) {
|
if (!combatant.actor) {
|
||||||
|
if (options.warning) {
|
||||||
ui.notifications.warn(`Le combatant ${combatant.name} n'est pas associé à un acteur!`)
|
ui.notifications.warn(`Le combatant ${combatant.name} n'est pas associé à un acteur!`)
|
||||||
}
|
}
|
||||||
else if (!combatant.actor.isActorCombat()) {
|
return undefined
|
||||||
ui.notifications.warn(`Le combatant ${combatant.name} ne peut pas combattre!`)
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
await combatant.actor.finDeRound(options)
|
|
||||||
await combatant.actor.resetItemUse()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else if (!combatant.actor.isActorCombat()) {
|
||||||
|
if (options.warning) {
|
||||||
|
ui.notifications.warn(`${combatant.name} ne peut pas combattre!`)
|
||||||
|
}
|
||||||
|
return undefined
|
||||||
|
}
|
||||||
|
return combatant.actor
|
||||||
}
|
}
|
||||||
|
|
||||||
static calculAjustementInit(actor, arme) {
|
static calculAjustementInit(actor, arme) {
|
||||||
@ -95,56 +104,27 @@ export class RdDCombatManager extends Combat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************/
|
/************************************************************************************/
|
||||||
async rollInitiative(ids, formula = undefined, messageOptions = {}) {
|
async rollInitiative(ids, messageOptions = {}) {
|
||||||
console.log(`${game.system.title} | Combat.rollInitiative()`, ids, formula, messageOptions);
|
console.log(`${game.system.title} | Combat.rollInitiative()`, ids, messageOptions)
|
||||||
|
ids = typeof ids === "string" ? [ids] : ids
|
||||||
|
ids.forEach(async id =>
|
||||||
|
await this.rollInitRdD(id, undefined, messageOptions)
|
||||||
|
)
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
ids = typeof ids === "string" ? [ids] : ids;
|
async rollInitRdD(id, formula, messageOptions = {}) {
|
||||||
// calculate initiative
|
const combatant = this.combatants.get(id);
|
||||||
for (let cId = 0; cId < ids.length; cId++) {
|
const actor = RdDCombatManager.getActorCombatant(combatant)
|
||||||
const combatant = this.combatants.get(ids[cId]);
|
if (actor) {
|
||||||
const ajustement = RdDCombatManager.calculAjustementInit(combatant.actor, undefined);
|
const rollFormula = formula ?? RdDCombatManager.getFirstInitRollFormula(actor)
|
||||||
let rollFormula = formula ?? RdDCombatManager.formuleInitiative(2, 10, 0, ajustement);
|
|
||||||
|
|
||||||
if (!formula) {
|
|
||||||
if (combatant.actor.type == 'creature' || combatant.actor.type == 'entite') {
|
|
||||||
const competence = combatant.actor.items.find(it => RdDItemCompetenceCreature.isCompetenceAttaque(it))
|
|
||||||
if (competence) {
|
|
||||||
rollFormula = RdDCombatManager.formuleInitiative(2, competence.system.carac_value, competence.system.niveau, etatGeneral);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const armeCombat = combatant.actor.itemTypes['arme'].find(it => it.system.equipe)
|
|
||||||
let compName = "Corps à corps"
|
|
||||||
if (armeCombat) {
|
|
||||||
if (armeCombat.system.competence != "") {
|
|
||||||
compName = armeCombat.system.competence
|
|
||||||
}
|
|
||||||
if (armeCombat.system.lancer != "") {
|
|
||||||
compName = armeCombat.system.lancer
|
|
||||||
}
|
|
||||||
if (armeCombat.system.tir != "") {
|
|
||||||
compName = armeCombat.system.tir
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const competence = RdDItemCompetence.findCompetence(combatant.actor.items, compName);
|
|
||||||
if (competence && competence.system.defaut_carac) {
|
|
||||||
const carac = combatant.actor.system.carac[competence.system.defaut_carac].value;
|
|
||||||
const niveau = competence.system.niveau;
|
|
||||||
|
|
||||||
const ajustement = RdDCombatManager.calculAjustementInit(combatant.actor, armeCombat)
|
|
||||||
rollFormula = RdDCombatManager.formuleInitiative(2, carac, niveau, ajustement);
|
|
||||||
} else {
|
|
||||||
ui.notifications.warn(`Votre arme ${armeCombat.name} n'a pas de compétence renseignée`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const roll = combatant.getInitiativeRoll(rollFormula);
|
const roll = combatant.getInitiativeRoll(rollFormula);
|
||||||
if (!roll.total) {
|
if (!roll.total) {
|
||||||
await roll.evaluate();
|
await roll.evaluate();
|
||||||
}
|
}
|
||||||
const total = Math.max(roll.total, 0.00);
|
const total = Math.max(roll.total, 0.00);
|
||||||
console.log("Compute init for", rollFormula, roll, total, combatant);
|
console.log("Compute init for", rollFormula, roll, total, combatant);
|
||||||
let id = combatant._id || combatant.id;
|
await this.updateEmbeddedDocuments("Combatant", [{ _id: combatant._id || combatant.id, initiative: total }]);
|
||||||
await this.updateEmbeddedDocuments("Combatant", [{ _id: id, initiative: total }]);
|
|
||||||
|
|
||||||
// Send a chat message
|
// Send a chat message
|
||||||
let rollMode = messageOptions.rollMode || game.settings.get("core", "rollMode");
|
let rollMode = messageOptions.rollMode || game.settings.get("core", "rollMode");
|
||||||
@ -153,10 +133,10 @@ export class RdDCombatManager extends Combat {
|
|||||||
scene: canvas.scene._id,
|
scene: canvas.scene._id,
|
||||||
actor: combatant.actor?._id,
|
actor: combatant.actor?._id,
|
||||||
token: combatant.token._id,
|
token: combatant.token._id,
|
||||||
alias: combatant.token.name,
|
alias: combatant.token?.name,
|
||||||
sound: CONFIG.sounds.dice,
|
sound: CONFIG.sounds.dice,
|
||||||
},
|
},
|
||||||
flavor: `${combatant.token.name} a fait son jet d'Initiative (${messageOptions.initInfo})<br>`,
|
flavor: `${combatant.token?.name} a fait son jet d'Initiative (${messageOptions.info})<br>`
|
||||||
},
|
},
|
||||||
messageOptions);
|
messageOptions);
|
||||||
roll.toMessage(messageData, { rollMode, create: true });
|
roll.toMessage(messageData, { rollMode, create: true });
|
||||||
@ -164,7 +144,20 @@ export class RdDCombatManager extends Combat {
|
|||||||
RdDCombatManager.processPremierRoundInit();
|
RdDCombatManager.processPremierRoundInit();
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
static getFirstInitRollFormula(actor) {
|
||||||
|
const actions = actor.listActionsCombat()
|
||||||
|
if (actions.length > 0) {
|
||||||
|
const action = actions[0]
|
||||||
|
const init = RdDCombatManager.getInitData(actor, action)
|
||||||
|
const ajustement = RdDCombatManager.calculAjustementInit(actor, action)
|
||||||
|
return RdDCombatManager.formuleInitiative(init.offset, init.carac, init.niveau, ajustement);
|
||||||
|
}
|
||||||
|
|
||||||
|
let ajustement = RdDCombatManager.calculAjustementInit(actor, undefined);
|
||||||
|
return RdDCombatManager.formuleInitiative(2, 10, 0, ajustement);
|
||||||
|
}
|
||||||
|
|
||||||
static formuleInitiative(rang, carac, niveau, bonusMalus) {
|
static formuleInitiative(rang, carac, niveau, bonusMalus) {
|
||||||
return `${rang} +( (${RdDCombatManager.calculInitiative(niveau, carac, bonusMalus)} )/100)`;
|
return `${rang} +( (${RdDCombatManager.calculInitiative(niveau, carac, bonusMalus)} )/100)`;
|
||||||
@ -233,7 +226,7 @@ export class RdDCombatManager extends Combat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static $prepareAttaqueArme(infoAttaque) {
|
static $prepareAttaqueArme(infoAttaque) {
|
||||||
const comp = infoAttaque.competences.find(c => c.name == infoAttaque.competence);
|
const comp = infoAttaque.competences.find(it => Grammar.equalsInsensitive(it.name, infoAttaque.competence))
|
||||||
const arme = infoAttaque.arme;
|
const arme = infoAttaque.arme;
|
||||||
const attaque = foundry.utils.duplicate(arme);
|
const attaque = foundry.utils.duplicate(arme);
|
||||||
attaque.action = 'attaque';
|
attaque.action = 'attaque';
|
||||||
@ -247,61 +240,6 @@ export class RdDCombatManager extends Combat {
|
|||||||
return attaque;
|
return attaque;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static listActionsCombat(combatant) {
|
|
||||||
const actor = combatant.actor;
|
|
||||||
if (!actor.isActorCombat()) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
let actions = RdDCombatManager.listActionsPossessions(actor);
|
|
||||||
if (actions.length > 0) {
|
|
||||||
return actions;
|
|
||||||
}
|
|
||||||
if (actor.isCreatureEntite()) {
|
|
||||||
actions = RdDCombatManager.listActionsCreature(actor.itemTypes['competencecreature']);
|
|
||||||
} else if (actor.isPersonnage()) {
|
|
||||||
// Recupération des items 'arme'
|
|
||||||
const competences = actor.itemTypes['competence'];
|
|
||||||
const armes = actor.itemTypes['arme'].filter(it => RdDItemArme.isArmeUtilisable(it))
|
|
||||||
.concat(RdDItemArme.empoignade(actor))
|
|
||||||
.concat(RdDItemArme.mainsNues(actor));
|
|
||||||
actions = RdDCombatManager.listActionsArmes(armes, competences, actor.system.carac);
|
|
||||||
|
|
||||||
if (actor.system.attributs.hautrevant.value) {
|
|
||||||
actions.push({ name: "Draconic", action: 'haut-reve', system: { initOnly: true, competence: "Draconic" } });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return RdDCombatManager._indexActions(actions);
|
|
||||||
}
|
|
||||||
|
|
||||||
static listActionsCreature(competences) {
|
|
||||||
return competences
|
|
||||||
.filter(it => RdDItemCompetenceCreature.isCompetenceAttaque(it))
|
|
||||||
.map(it => RdDItemCompetenceCreature.armeCreature(it))
|
|
||||||
.filter(it => it != undefined);
|
|
||||||
}
|
|
||||||
|
|
||||||
static listActionsPossessions(actor) {
|
|
||||||
return RdDCombatManager._indexActions(actor.getPossessions().map(p => {
|
|
||||||
return {
|
|
||||||
name: p.name,
|
|
||||||
action: 'possession',
|
|
||||||
system: {
|
|
||||||
competence: p.name,
|
|
||||||
possessionid: p.system.possessionid,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
static _indexActions(actions) {
|
|
||||||
for (let index = 0; index < actions.length; index++) {
|
|
||||||
actions[index].index = index;
|
|
||||||
}
|
|
||||||
return actions;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static processPremierRoundInit() {
|
static processPremierRoundInit() {
|
||||||
// Check if we have the whole init !
|
// Check if we have the whole init !
|
||||||
@ -314,7 +252,7 @@ export class RdDCombatManager extends Combat {
|
|||||||
if (action && action.type == "arme") {
|
if (action && action.type == "arme") {
|
||||||
for (let initData of premierRoundInit) {
|
for (let initData of premierRoundInit) {
|
||||||
if (Grammar.toLowerCaseNoAccentNoSpace(action.system.initpremierround).includes(initData.pattern)) {
|
if (Grammar.toLowerCaseNoAccentNoSpace(action.system.initpremierround).includes(initData.pattern)) {
|
||||||
let msg = `<h4>L'initiative de ${combatant.actor.name} a été modifiée !</h4>
|
let msg = `<h4>L'initiative de ${combatant.actor.getAlias()} a été modifiée !</h4>
|
||||||
<hr>
|
<hr>
|
||||||
<div>
|
<div>
|
||||||
Etant donné son ${action.name}, son initative pour ce premier round est désormais de ${initData.init}.
|
Etant donné son ${action.name}, son initative pour ce premier round est désormais de ${initData.init}.
|
||||||
@ -339,13 +277,13 @@ export class RdDCombatManager extends Combat {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static pushInitiativeOptions(html, options) {
|
static pushInitiativeOptions(html, options) {
|
||||||
for (let i = 0; i < options.length; i++) {
|
for (let i = 0; i < options.length; i++) {
|
||||||
let option = options[i];
|
let option = options[i]
|
||||||
if (option.name == 'COMBAT.CombatantReroll') { // Replace !
|
if (option.name == 'COMBAT.CombatantReroll') { // Replace !
|
||||||
option.name = "Sélectionner l'initiative...";
|
option.name = "Sélectionner l'initiative..."
|
||||||
option.condition = true;
|
option.condition = true
|
||||||
option.icon = '<i class="far fa-question-circle"></i>';
|
option.icon = '<i class="far fa-question-circle"></i>'
|
||||||
option.callback = target => {
|
option.callback = target => {
|
||||||
RdDCombatManager.displayInitiativeMenu(html, target.data('combatant-id'));
|
RdDCombatManager.displayInitiativeMenu(html, target.data('combatant-id'))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -356,96 +294,83 @@ export class RdDCombatManager extends Combat {
|
|||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static rollInitiativeAction(combatantId, action) {
|
static rollInitiativeAction(combatantId, action) {
|
||||||
const combatant = game.combat.combatants.get(combatantId);
|
const combatant = game.combat.combatants.get(combatantId)
|
||||||
if (combatant.actor == undefined) {
|
const actor = RdDCombatManager.getActorCombatant(combatant)
|
||||||
ui.notifications.warn(`Le combatant ${combatant.name} n'est pas associé à un acteur, impossible de déterminer ses actions de combat!`)
|
if (actor == undefined) { return [] }
|
||||||
return [];
|
|
||||||
}
|
|
||||||
let initInfo = "";
|
|
||||||
let initOffset = 0;
|
|
||||||
let caracForInit = 0;
|
|
||||||
let compNiveau = 0;
|
|
||||||
let compData = { name: "Aucune" };
|
|
||||||
if (combatant.actor.getSurprise() == "totale") {
|
|
||||||
initOffset = -1; // To force 0
|
|
||||||
initInfo = "Surprise Totale"
|
|
||||||
} else if (combatant.actor.getSurprise() == "demi") {
|
|
||||||
initOffset = 0;
|
|
||||||
initInfo = "Demi Surprise"
|
|
||||||
} else if (action.action == 'possession') {
|
|
||||||
initOffset = 10;
|
|
||||||
caracForInit = combatant.actor.getReveActuel();
|
|
||||||
initInfo = "Possession"
|
|
||||||
} else if (action.action == 'autre') {
|
|
||||||
initOffset = 2;
|
|
||||||
initInfo = "Autre Action"
|
|
||||||
} else if (action.action == 'haut-reve') {
|
|
||||||
initOffset = 9;
|
|
||||||
initInfo = "Draconic"
|
|
||||||
} else {
|
|
||||||
compData = RdDItemCompetence.findCompetence(combatant.actor.items, action.system.competence);
|
|
||||||
compNiveau = compData.system.niveau;
|
|
||||||
initInfo = action.name + " / " + action.system.competence;
|
|
||||||
|
|
||||||
if (combatant.actor.type == 'creature' || combatant.actor.type == 'entite') {
|
|
||||||
caracForInit = compData.system.carac_value;
|
|
||||||
} else {
|
|
||||||
caracForInit = combatant.actor.system.carac[compData.system.defaut_carac].value;
|
|
||||||
}
|
|
||||||
initOffset = RdDCombatManager._baseInitOffset(compData.system.categorie, action);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cas des créatures et entités vs personnages
|
|
||||||
const ajustement = RdDCombatManager.calculAjustementInit(combatant.actor, action)
|
|
||||||
let rollFormula = RdDCombatManager.formuleInitiative(initOffset, caracForInit, compNiveau, ajustement);
|
|
||||||
// Garder la trace de l'arme/compétence utilisée pour l'iniative
|
|
||||||
combatant.initiativeData = { arme: action } // pour reclasser l'init au round 0
|
combatant.initiativeData = { arme: action } // pour reclasser l'init au round 0
|
||||||
game.combat.rollInitiative(combatantId, rollFormula, { initInfo: initInfo });
|
|
||||||
|
const init = RdDCombatManager.getInitData(actor, action)
|
||||||
|
const ajustement = RdDCombatManager.calculAjustementInit(actor, action)
|
||||||
|
const rollFormula = RdDCombatManager.formuleInitiative(init.offset, init.carac, init.niveau, ajustement);
|
||||||
|
|
||||||
|
game.combat.rollInitRdD(combatantId, rollFormula, init);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
static getInitData(actor, action) {
|
||||||
static _baseInitOffset(categorie, arme) {
|
if (actor.getSurprise() == "totale") { return { offset: -1, info: "Surprise Totale", carac: 0, niveau: 0 } }
|
||||||
if (categorie == "tir") { // Offset de principe pour les armes de jet
|
if (actor.getSurprise() == "demi") { return { offset: 0, info: "Demi Surprise", carac: 0, niveau: 0 } }
|
||||||
return 8;
|
if (action.action == 'autre') { return { offset: 2, info: "Autre Action", carac: 0, niveau: 0 } }
|
||||||
|
if (action.action == 'possession') { return { offset: 10, info: "Possession", carac: actor.getReveActuel(), niveau: 0 } }
|
||||||
|
if (action.action == 'haut-reve') { return { offset: 9, info: "Draconic", carac: actor.getReveActuel(), niveau: 0 } }
|
||||||
|
|
||||||
|
const comp = RdDItemCompetence.findCompetence(actor.items, action.system.competence);
|
||||||
|
return {
|
||||||
|
offset: RdDCombatManager.initOffset(comp?.system.categorie, action),
|
||||||
|
info: action.name + " / " + action.system.competence,
|
||||||
|
carac: actor.getCaracInit(comp),
|
||||||
|
niveau: comp?.system.niveau ?? -8
|
||||||
}
|
}
|
||||||
if (categorie == "lancer") { // Offset de principe pour les armes de jet
|
}
|
||||||
return 7;
|
|
||||||
|
static initOffset(categorie, arme) {
|
||||||
|
switch (categorie) {
|
||||||
|
case "tir": return 8
|
||||||
|
case "lancer": return 7
|
||||||
|
default:
|
||||||
|
switch (arme.system.cac) {
|
||||||
|
case "empoignade": return 3
|
||||||
|
case "pugilat": return 4
|
||||||
|
case "naturelle": return 4
|
||||||
|
default: return 5
|
||||||
|
}
|
||||||
}
|
}
|
||||||
switch (arme.system.cac) {
|
|
||||||
case "empoignade":
|
|
||||||
return 3;
|
|
||||||
case "pugilat":
|
|
||||||
case "naturelle":
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
return 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static displayInitiativeMenu(html, combatantId) {
|
static displayInitiativeMenu(html, combatantId) {
|
||||||
console.log("Combatant ; ", combatantId);
|
const combatant = game.combat.combatants.get(combatantId)
|
||||||
const combatant = game.combat.combatants.get(combatantId);
|
const actor = RdDCombatManager.getActorCombatant(combatant, { warning: false })
|
||||||
if (!(combatant?.actor)) {
|
if (actor) {
|
||||||
ui.notifications.warn(`Le combatant ${combatant.name ?? combatantId} n'est pas associé à un acteur, impossible de déterminer ses actions de combat!`)
|
const actions = RdDCombatManager.listActionsActorCombatant(actor)
|
||||||
return;
|
// Build the relevant submenu
|
||||||
}
|
const menuItems = actions.map(action => {
|
||||||
|
return {
|
||||||
let actions = RdDCombatManager.listActionsCombat(combatant);
|
|
||||||
|
|
||||||
// Build the relevant submenu
|
|
||||||
if (actions) {
|
|
||||||
let menuItems = [];
|
|
||||||
for (let action of actions) {
|
|
||||||
menuItems.push({
|
|
||||||
name: action.system.competence,
|
name: action.system.competence,
|
||||||
icon: "<i class='fas fa-dice-d6'></i>",
|
icon: "<i class='fas fa-dice-d6'></i>",
|
||||||
callback: target => { RdDCombatManager.rollInitiativeAction(combatantId, action) }
|
callback: target => { RdDCombatManager.rollInitiativeAction(combatantId, action) }
|
||||||
});
|
}
|
||||||
|
})
|
||||||
|
if (menuItems.length > 0) {
|
||||||
|
new ContextMenu(html, ".directory-list", menuItems).render();
|
||||||
}
|
}
|
||||||
new ContextMenu(html, ".directory-list", menuItems).render();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static listActionsActorCombatant( actor) {
|
||||||
|
const possessions = actor.listActionsPossessions()
|
||||||
|
const actions = possessions.length > 0
|
||||||
|
? possessions
|
||||||
|
: actor.listActionsCombat()
|
||||||
|
|
||||||
|
for (let index = 0; index < actions.length; index++) {
|
||||||
|
actions[index].index = index
|
||||||
|
}
|
||||||
|
return actions
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -510,11 +435,10 @@ export class RdDCombat {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static onMsgEncaisser(msg) {
|
static onMsgEncaisser(msg) {
|
||||||
if (Misc.isOwnerPlayerOrUniqueConnectedGM()) {
|
let defender = canvas.tokens.get(msg.defenderToken.id).actor;
|
||||||
|
if (Misc.isOwnerPlayerOrUniqueConnectedGM(defender)) {
|
||||||
let attackerRoll = msg.attackerRoll;
|
let attackerRoll = msg.attackerRoll;
|
||||||
let attacker = msg.attackerId ? game.actors.get(msg.attackerId) : undefined;
|
let attacker = msg.attackerId ? game.actors.get(msg.attackerId) : undefined;
|
||||||
let defender = canvas.tokens.get(msg.defenderToken.id).actor;
|
|
||||||
|
|
||||||
defender.encaisserDommages(attackerRoll, attacker, msg.attackerToken);
|
defender.encaisserDommages(attackerRoll, attacker, msg.attackerToken);
|
||||||
const rddCombat = RdDCombat.rddCombatForAttackerAndDefender(msg.attackerId, msg.attackerToken.id, msg.defenderToken.id);
|
const rddCombat = RdDCombat.rddCombatForAttackerAndDefender(msg.attackerId, msg.attackerToken.id, msg.defenderToken.id);
|
||||||
rddCombat?.removeChatMessageActionsPasseArme(attackerRoll.passeArme);
|
rddCombat?.removeChatMessageActionsPasseArme(attackerRoll.passeArme);
|
||||||
@ -829,7 +753,7 @@ export class RdDCombat {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_prepareAttaque(competence, arme) {
|
_prepareAttaque(competence, arme) {
|
||||||
let rollData = {
|
let rollData = {
|
||||||
alias: this.attackerToken.name,
|
alias: this.attacker?.getAlias(),
|
||||||
passeArme: foundry.utils.randomID(16),
|
passeArme: foundry.utils.randomID(16),
|
||||||
mortalite: arme?.system.mortalite,
|
mortalite: arme?.system.mortalite,
|
||||||
competence: competence,
|
competence: competence,
|
||||||
@ -849,9 +773,9 @@ export class RdDCombat {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// sans armes: à mains nues
|
// sans armes: à mains nues
|
||||||
const niveau = competence.system.niveau;
|
rollData.arme = RdDItemArme.corpsACorps(this.attacker)
|
||||||
const init = RdDCombatManager.calculInitiative(niveau, this.attacker.system.carac['melee'].value);
|
rollData.arme.system.niveau = competence.system.niveau
|
||||||
rollData.arme = RdDItemArme.mainsNues({ niveau: niveau, initiative: init });
|
rollData.arme.system.initiative = RdDCombatManager.calculInitiative(competence.system.niveau, this.attacker.system.carac['melee'].value);
|
||||||
}
|
}
|
||||||
return rollData;
|
return rollData;
|
||||||
}
|
}
|
||||||
@ -878,10 +802,10 @@ export class RdDCombat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const choixParticuliere = await ChatMessage.create({
|
const choixParticuliere = await ChatMessage.create({
|
||||||
alias: this.attacker.name,
|
alias: this.attacker.getAlias(),
|
||||||
whisper: ChatUtility.getOwners(this.attacker),
|
whisper: ChatUtility.getOwners(this.attacker),
|
||||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-demande-attaque-particuliere.html', {
|
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-demande-attaque-particuliere.html', {
|
||||||
alias: this.attackerToken.name,
|
alias: this.attacker.getAlias(),
|
||||||
attackerId: this.attackerId,
|
attackerId: this.attackerId,
|
||||||
attackerToken: this.attackerToken,
|
attackerToken: this.attackerToken,
|
||||||
defenderToken: this.defenderToken,
|
defenderToken: this.defenderToken,
|
||||||
@ -901,7 +825,7 @@ export class RdDCombat {
|
|||||||
attackerRoll.dmg = RdDBonus.dmg(attackerRoll, this.attacker, this.defender.isEntite());
|
attackerRoll.dmg = RdDBonus.dmg(attackerRoll, this.attacker, this.defender.isEntite());
|
||||||
let defenderRoll = { attackerRoll: attackerRoll, passeArme: attackerRoll.passeArme, show: {} }
|
let defenderRoll = { attackerRoll: attackerRoll, passeArme: attackerRoll.passeArme, show: {} }
|
||||||
attackerRoll.show = {
|
attackerRoll.show = {
|
||||||
cible: this.defenderToken?.name ?? 'la cible',
|
cible: this.defender?.getAlias() ?? 'la cible',
|
||||||
isRecul: (attackerRoll.particuliere == 'force' || attackerRoll.tactique == 'charge')
|
isRecul: (attackerRoll.particuliere == 'force' || attackerRoll.tactique == 'charge')
|
||||||
}
|
}
|
||||||
await RdDResolutionTable.displayRollData(attackerRoll, this.attacker, 'chat-resultat-attaque.html');
|
await RdDResolutionTable.displayRollData(attackerRoll, this.attacker, 'chat-resultat-attaque.html');
|
||||||
@ -967,7 +891,7 @@ export class RdDCombat {
|
|||||||
const choixDefense = await ChatMessage.create({
|
const choixDefense = await ChatMessage.create({
|
||||||
// message privé: du défenseur à lui même (et aux GMs)
|
// message privé: du défenseur à lui même (et aux GMs)
|
||||||
speaker: ChatMessage.getSpeaker(this.defender, canvas.tokens.get(this.defenderTokenId)),
|
speaker: ChatMessage.getSpeaker(this.defender, canvas.tokens.get(this.defenderTokenId)),
|
||||||
alias: this.attackerToken.name,
|
alias: this.attacker?.getAlias(),
|
||||||
whisper: ChatUtility.getOwners(this.defender),
|
whisper: ChatUtility.getOwners(this.defender),
|
||||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-demande-defense.html', paramDemandeDefense),
|
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-demande-defense.html', paramDemandeDefense),
|
||||||
});
|
});
|
||||||
@ -992,13 +916,13 @@ export class RdDCombat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_filterArmesParade(defender, competence, arme) {
|
_filterArmesParade(defender, competence, armeAttaque) {
|
||||||
let defenses = defender.items.filter(it => RdDItemArme.isArmeUtilisable(it) || RdDItemCompetenceCreature.isCompetenceParade(it))
|
let defenses = defender.items.filter(it => RdDItemArme.isParade(it))
|
||||||
defenses = foundry.utils.duplicate(defenses)
|
defenses = foundry.utils.duplicate(defenses)
|
||||||
defenses.forEach(armeDefense => {
|
defenses.forEach(armeDefense => {
|
||||||
// Ajout du # d'utilisation ce round
|
// Ajout du # d'utilisation ce round
|
||||||
armeDefense.nbUsage = defender.getItemUse(armeDefense.id)
|
armeDefense.nbUsage = defender.getItemUse(armeDefense.id)
|
||||||
armeDefense.typeParade = RdDItemArme.defenseArmeParade(arme, armeDefense)
|
armeDefense.typeParade = RdDItemArme.defenseArmeParade(armeAttaque, armeDefense)
|
||||||
})
|
})
|
||||||
|
|
||||||
switch (competence.system.categorie) {
|
switch (competence.system.categorie) {
|
||||||
@ -1090,7 +1014,7 @@ export class RdDCombat {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_prepareParade(attackerRoll, armeParade, competenceParade) {
|
_prepareParade(attackerRoll, armeParade, competenceParade) {
|
||||||
let defenderRoll = {
|
let defenderRoll = {
|
||||||
alias: this.defenderToken?.name,
|
alias: this.defender?.getAlias(),
|
||||||
passeArme: attackerRoll.passeArme,
|
passeArme: attackerRoll.passeArme,
|
||||||
diffLibre: attackerRoll.diffLibre,
|
diffLibre: attackerRoll.diffLibre,
|
||||||
attackerToken: this.attackerToken,
|
attackerToken: this.attackerToken,
|
||||||
@ -1147,7 +1071,7 @@ export class RdDCombat {
|
|||||||
async esquive(attackerRoll, compId, compName) {
|
async esquive(attackerRoll, compId, compName) {
|
||||||
const esquive = this.defender.getCompetence(compId) ?? this.defender.getCompetence(compName)
|
const esquive = this.defender.getCompetence(compId) ?? this.defender.getCompetence(compName)
|
||||||
if (esquive == undefined) {
|
if (esquive == undefined) {
|
||||||
ui.notifications.error(this.defender.name + " n'a pas de compétence " + compName);
|
ui.notifications.error(this.defender.getAlias() + " n'a pas de compétence " + compName);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log("RdDCombat.esquive >>>", attackerRoll, esquive);
|
console.log("RdDCombat.esquive >>>", attackerRoll, esquive);
|
||||||
@ -1174,7 +1098,7 @@ export class RdDCombat {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_prepareEsquive(attackerRoll, competence) {
|
_prepareEsquive(attackerRoll, competence) {
|
||||||
let rollData = {
|
let rollData = {
|
||||||
alias: this.defenderToken?.name,
|
alias: this.defender.getAlias(),
|
||||||
passeArme: attackerRoll.passeArme,
|
passeArme: attackerRoll.passeArme,
|
||||||
diffLibre: attackerRoll.diffLibre,
|
diffLibre: attackerRoll.diffLibre,
|
||||||
attackerToken: this.attackerToken,
|
attackerToken: this.attackerToken,
|
||||||
@ -1353,9 +1277,10 @@ export class RdDCombat {
|
|||||||
if (!actor?.isActorCombat()) {
|
if (!actor?.isActorCombat()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let formData = {
|
const alias = token?.name ?? actor.getAlias();
|
||||||
|
const formData = {
|
||||||
combatId: combat._id,
|
combatId: combat._id,
|
||||||
alias: token.name ?? actor.name,
|
alias: alias,
|
||||||
etatGeneral: actor.getEtatGeneral(),
|
etatGeneral: actor.getEtatGeneral(),
|
||||||
isSonne: actor.isSonne(),
|
isSonne: actor.isSonne(),
|
||||||
blessuresStatus: actor.computeResumeBlessure(),
|
blessuresStatus: actor.computeResumeBlessure(),
|
||||||
@ -1368,12 +1293,12 @@ export class RdDCombat {
|
|||||||
}
|
}
|
||||||
await ChatMessage.create({
|
await ChatMessage.create({
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-acteur.hbs`, formData),
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-acteur.hbs`, formData),
|
||||||
alias: token.name ?? actor.name
|
alias: alias
|
||||||
})
|
})
|
||||||
await ChatMessage.create({
|
await ChatMessage.create({
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-sante.hbs`, formData),
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-actor-turn-sante.hbs`, formData),
|
||||||
whisper: ChatUtility.getOwners(actor),
|
whisper: ChatUtility.getOwners(actor),
|
||||||
alias: token.name ?? actor.name
|
alias: alias
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -360,13 +360,14 @@ export class RdDCommands {
|
|||||||
|
|
||||||
async getTMRAleatoire(msg, params) {
|
async getTMRAleatoire(msg, params) {
|
||||||
if (params.length < 2) {
|
if (params.length < 2) {
|
||||||
let type = params[0];
|
let type = params[0]
|
||||||
const tmr = await TMRUtility.getTMRAleatoire(type ? (it => it.type == type) : (it => true));
|
const solvedTerrain = TMRUtility.findTMRLike(type)?.type
|
||||||
return RdDCommands._chatAnswer(msg, `Case aléatoire: ${tmr.coord} - ${tmr.label}`);
|
if (solvedTerrain){
|
||||||
}
|
const tmr = await TMRUtility.getTMRAleatoire(type ? (it => it.type == solvedTerrain) : (it => true))
|
||||||
else {
|
return RdDCommands._chatAnswer(msg, `Case aléatoire: ${tmr.coord} - ${tmr.label}`)
|
||||||
return false;
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async findTMR(msg, params) {
|
async findTMR(msg, params) {
|
||||||
@ -384,11 +385,11 @@ export class RdDCommands {
|
|||||||
async tableRencontres(msg, params) {
|
async tableRencontres(msg, params) {
|
||||||
if (params && params.length > 0) {
|
if (params && params.length > 0) {
|
||||||
const search = Misc.join(params, ' ');
|
const search = Misc.join(params, ' ');
|
||||||
const solvedTerrain = TMRUtility.findTMRLike(search);
|
const solvedTerrain = TMRUtility.findTMRLike(search)
|
||||||
if (solvedTerrain == undefined) {
|
if (solvedTerrain == undefined) {
|
||||||
return RdDCommands._chatAnswer(msg, 'Aucune TMR correspondant à ' + search);
|
return RdDCommands._chatAnswer(msg, 'Aucune TMR correspondant à ' + search);
|
||||||
}
|
}
|
||||||
return await game.system.rdd.rencontresTMR.chatTable(solvedTerrain);
|
return await game.system.rdd.rencontresTMR.chatTable(solvedTMRType.name)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -28,9 +28,9 @@ export class RdDHerbes extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async addPotionFormData(formData) {
|
static calculFormData(formData, item) {
|
||||||
formData.isSoins = formData.system.categorie.includes('Soin');
|
formData.isSoins = item.system.categorie.includes('Soin');
|
||||||
formData.isRepos = formData.system.categorie.includes('Repos');
|
formData.isRepos = item.system.categorie.includes('Repos');
|
||||||
if (formData.isSoins) {
|
if (formData.isSoins) {
|
||||||
RdDHerbes.calculBonusHerbe(formData, this.herbesSoins, 12);
|
RdDHerbes.calculBonusHerbe(formData, this.herbesSoins, 12);
|
||||||
}
|
}
|
||||||
@ -40,7 +40,7 @@ export class RdDHerbes extends Item {
|
|||||||
formData.herbesSoins = RdDHerbes.buildHerbesList(this.herbesSoins, 12);
|
formData.herbesSoins = RdDHerbes.buildHerbesList(this.herbesSoins, 12);
|
||||||
formData.herbesRepos = RdDHerbes.buildHerbesList(this.herbesRepos, 7);
|
formData.herbesRepos = RdDHerbes.buildHerbesList(this.herbesRepos, 7);
|
||||||
formData.dateActuelle = game.system.rdd.calendrier.dateCourante();
|
formData.dateActuelle = game.system.rdd.calendrier.dateCourante();
|
||||||
formData.enchantement = RdDTimestamp.splitIndexDate(formData.system.prdate);
|
formData.enchantement = RdDTimestamp.splitIndexDate(item.system.prdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -121,7 +121,7 @@ export class RdDHotbar {
|
|||||||
if (item.isCorpsACorps()) {
|
if (item.isCorpsACorps()) {
|
||||||
switch (categorieArme) {
|
switch (categorieArme) {
|
||||||
case 'pugilat':
|
case 'pugilat':
|
||||||
return actor.rollArme(RdDItemArme.mainsNues(actor), 'competence');
|
return actor.rollArme(RdDItemArme.corpsACorps(actor), 'competence');
|
||||||
case 'empoignade':
|
case 'empoignade':
|
||||||
return actor.rollArme(RdDItemArme.empoignade(actor), 'competence');
|
return actor.rollArme(RdDItemArme.empoignade(actor), 'competence');
|
||||||
}
|
}
|
||||||
|
@ -69,6 +69,7 @@ import { ExportScriptarium } from "./actor/export-scriptarium/export-scriptarium
|
|||||||
import { AppPersonnageAleatoire } from "./actor/random/app-personnage-aleatoire.js"
|
import { AppPersonnageAleatoire } from "./actor/random/app-personnage-aleatoire.js"
|
||||||
import { RdDActorExportSheet } from "./actor/export-scriptarium/actor-encart-sheet.js"
|
import { RdDActorExportSheet } from "./actor/export-scriptarium/actor-encart-sheet.js"
|
||||||
import { RdDStatBlockParser } from "./apps/rdd-import-stats.js"
|
import { RdDStatBlockParser } from "./apps/rdd-import-stats.js"
|
||||||
|
import { RdDItemSort } from "./item-sort.js"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RdD system
|
* RdD system
|
||||||
@ -122,6 +123,7 @@ export class SystemReveDeDragon {
|
|||||||
// preload handlebars templates
|
// preload handlebars templates
|
||||||
RdDUtility.preloadHandlebarsTemplates()
|
RdDUtility.preloadHandlebarsTemplates()
|
||||||
AppPersonnageAleatoire.preloadHandlebars()
|
AppPersonnageAleatoire.preloadHandlebars()
|
||||||
|
RdDItemSort.preloadHandlebars()
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
ReglesOptionnelles.initSettings()
|
ReglesOptionnelles.initSettings()
|
||||||
@ -274,6 +276,16 @@ export class SystemReveDeDragon {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async setupAccueil() {
|
||||||
|
let exists = game.scenes.find(j => j.name == "Accueil RdD");
|
||||||
|
if (!exists) {
|
||||||
|
const scenes = await SystemCompendiums.loadCompendium("foundryvtt-reve-de-dragon.scenes-rdd")
|
||||||
|
let newDocuments = scenes.filter(i => i.name == "Accueil RdD");
|
||||||
|
await game.scenes.documentClass.create(newDocuments);
|
||||||
|
game.scenes.find(i => i.name == "Accueil RdD").activate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async onReady() {
|
async onReady() {
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -307,6 +319,8 @@ export class SystemReveDeDragon {
|
|||||||
user: game.user.id
|
user: game.user.id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SystemReveDeDragon.setupAccueil()
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
@ -7,6 +7,7 @@ import { RdDBonus } from "./rdd-bonus.js";
|
|||||||
import { RdDCarac } from "./rdd-carac.js";
|
import { RdDCarac } from "./rdd-carac.js";
|
||||||
import { RdDResolutionTable } from "./rdd-resolution-table.js";
|
import { RdDResolutionTable } from "./rdd-resolution-table.js";
|
||||||
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
import { ReglesOptionnelles } from "./settings/regles-optionnelles.js";
|
||||||
|
import { Grammar } from "./grammar.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend the base Dialog entity to select roll parameters
|
* Extend the base Dialog entity to select roll parameters
|
||||||
@ -32,7 +33,7 @@ export class RdDRoll extends Dialog {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static _setDefaultOptions(actor, rollData) {
|
static _setDefaultOptions(actor, rollData) {
|
||||||
let defaultRollData = {
|
let defaultRollData = {
|
||||||
alias: actor.name,
|
alias: actor.getAlias(),
|
||||||
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
|
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
|
||||||
difficultesLibres: CONFIG.RDD.difficultesLibres,
|
difficultesLibres: CONFIG.RDD.difficultesLibres,
|
||||||
etat: actor.getEtatGeneral(),
|
etat: actor.getEtatGeneral(),
|
||||||
@ -173,8 +174,8 @@ export class RdDRoll extends Dialog {
|
|||||||
this.html.find("[name='diffLibre']").val(this.rollData.diffLibre);
|
this.html.find("[name='diffLibre']").val(this.rollData.diffLibre);
|
||||||
});
|
});
|
||||||
this.html.find('.roll-carac-competence').change((event) => {
|
this.html.find('.roll-carac-competence').change((event) => {
|
||||||
const competence = event.currentTarget.value;
|
const competence = event.currentTarget.value
|
||||||
this.rollData.competence = this.rollData.competences.find(it => it.name == competence);
|
this.rollData.competence = this.rollData.competences.find(it => Grammar.equalsInsensitive(it.name, competence))
|
||||||
this.updateRollResult(html);
|
this.updateRollResult(html);
|
||||||
});
|
});
|
||||||
this.html.find('.select-suivant-coeur').change((event) => {
|
this.html.find('.select-suivant-coeur').change((event) => {
|
||||||
@ -345,24 +346,25 @@ export class RdDRoll extends Dialog {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
_getTitle(rollData) {
|
_getTitle(rollData) {
|
||||||
|
const alias = rollData.alias
|
||||||
const carac = rollData.selectedCarac.label;
|
const carac = rollData.selectedCarac.label;
|
||||||
if (!rollData.competence) {
|
if (!rollData.competence) {
|
||||||
return carac;
|
return `${alias}: ${carac}`
|
||||||
}
|
}
|
||||||
const compName = rollData.competence.name;
|
const compName = rollData.competence.name;
|
||||||
const niveau = Misc.toSignedString(rollData.competence.system.niveau)
|
const niveau = Misc.toSignedString(rollData.competence.system.niveau)
|
||||||
if (compName == carac) {
|
if (compName == carac) {
|
||||||
// cas des créatures
|
// cas des créatures
|
||||||
return `${carac} Niveau ${niveau}`
|
return `${alias}: ${carac} Niveau ${niveau}`
|
||||||
}
|
}
|
||||||
if (rollData.draconicList && rollData.selectedSort) {
|
if (rollData.draconicList && rollData.selectedSort) {
|
||||||
// cas de lancer de sort
|
// cas de lancer de sort
|
||||||
return `${rollData.competence.name} Niveau ${niveau} ${rollData.selectedSort.name}`
|
return `${alias}: ${rollData.competence.name} Niveau ${niveau} ${rollData.selectedSort.name}`
|
||||||
}
|
}
|
||||||
if (rollData.arme && rollData.arme.name != compName) {
|
if (rollData.arme && rollData.arme.name != compName) {
|
||||||
// ajouter l'arme au titre si son nom n'est pas la compétence
|
// ajouter l'arme au titre si son nom n'est pas la compétence
|
||||||
return `${carac} / ${compName} (${rollData.arme.name}) Niveau ${niveau}`
|
return `${alias}: ${carac} / ${compName} (${rollData.arme.name}) Niveau ${niveau}`
|
||||||
}
|
}
|
||||||
return `${carac} / ${compName} Niveau ${niveau}`
|
return `${alias}: ${carac} / ${compName} Niveau ${niveau}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import { Grammar } from "./grammar.js";
|
|
||||||
import { CompendiumTable, CompendiumTableHelpers, SystemCompendiums } from "./settings/system-compendiums.js";
|
import { CompendiumTable, CompendiumTableHelpers, SystemCompendiums } from "./settings/system-compendiums.js";
|
||||||
|
|
||||||
export class RdDRollTables {
|
export class RdDRollTables {
|
||||||
|
@ -460,7 +460,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
|
|
||||||
let rencontreData = {
|
let rencontreData = {
|
||||||
actor: this.actor,
|
actor: this.actor,
|
||||||
alias: this.actor.name,
|
alias: this.actor.getAlias(),
|
||||||
reveDepart: this.actor.getReveActuel(),
|
reveDepart: this.actor.getReveActuel(),
|
||||||
competence: this.actor.getBestDraconic(),
|
competence: this.actor.getBestDraconic(),
|
||||||
rencontre: this.currentRencontre,
|
rencontre: this.currentRencontre,
|
||||||
@ -641,7 +641,7 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
// simuler une rencontre
|
// simuler une rencontre
|
||||||
let rencontreData = {
|
let rencontreData = {
|
||||||
actor: this.actor,
|
actor: this.actor,
|
||||||
alias: this.actor.name,
|
alias: this.actor.getAlias(),
|
||||||
reveDepart: this.actor.getReveActuel(),
|
reveDepart: this.actor.getReveActuel(),
|
||||||
competence: this.actor.getBestDraconic(),
|
competence: this.actor.getBestDraconic(),
|
||||||
rencontre: this.currentRencontre,
|
rencontre: this.currentRencontre,
|
||||||
@ -1098,7 +1098,10 @@ export class RdDTMRDialog extends Dialog {
|
|||||||
if (!this.viewOnly && this.actor.isResonanceSigneDraconique(coord)) {
|
if (!this.viewOnly && this.actor.isResonanceSigneDraconique(coord)) {
|
||||||
ChatMessage.create({
|
ChatMessage.create({
|
||||||
whisper: ChatUtility.getOwners(this.actor),
|
whisper: ChatUtility.getOwners(this.actor),
|
||||||
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-resonance.html`, { alias: this.actor.name, typeTMR: TMRUtility.getTMRType(coord) })
|
content: await renderTemplate(`systems/foundryvtt-reve-de-dragon/templates/chat-signe-draconique-resonance.html`, {
|
||||||
|
alias: this.actor.getAlias(),
|
||||||
|
typeTMR: TMRUtility.getTMRType(coord)
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,16 +28,15 @@ export class RdDTokenHud {
|
|||||||
await RdDTokenHud.addExtensionHudSoins(html, actor);
|
await RdDTokenHud.addExtensionHudSoins(html, actor);
|
||||||
|
|
||||||
if (isCombat) {
|
if (isCombat) {
|
||||||
let combatant = game.combat.combatants.find(c => c.tokenId == tokenId);
|
const combatant = game.combat.combatants.find(c => c.tokenId == tokenId)
|
||||||
if (!(combatant?.actor)) {
|
const actor = RdDCombatManager.getActorCombatant(combatant, { warning: false })
|
||||||
ui.notifications.warn(`Le combatant ${token.name} n'est pas associé à un acteur, impossible de déterminer ses actions de combat!`)
|
if (actor) {
|
||||||
return;
|
let actions = RdDCombatManager.listActionsActorCombatant(actor)
|
||||||
|
// initiative
|
||||||
|
await RdDTokenHud.addExtensionHudInit(html, combatant, actions)
|
||||||
|
// combat
|
||||||
|
await RdDTokenHud.addExtensionHudCombat(html, combatant, token, actions)
|
||||||
}
|
}
|
||||||
let actions = RdDCombatManager.listActionsCombat(combatant);
|
|
||||||
// initiative
|
|
||||||
await RdDTokenHud.addExtensionHudInit(html, combatant, actions);
|
|
||||||
// combat
|
|
||||||
await RdDTokenHud.addExtensionHudCombat(html, combatant, token, actions);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,17 +15,17 @@ export const STATUSES = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const rddStatusEffects = [
|
const rddStatusEffects = [
|
||||||
{ rdd: true, id: STATUSES.StatusStunned, label: 'EFFECT.StatusStunned', icon: 'icons/svg/stoned.svg', "duration.rounds": 1 },
|
{ rdd: true, id: STATUSES.StatusStunned, name: 'EFFECT.StatusStunned', img: 'icons/svg/stoned.svg', "duration.rounds": 1 },
|
||||||
{ rdd: true, id: STATUSES.StatusBleeding, label: 'EFFECT.StatusBleeding', icon: 'icons/svg/blood.svg' },
|
{ rdd: true, id: STATUSES.StatusBleeding, name: 'EFFECT.StatusBleeding', img: 'icons/svg/blood.svg' },
|
||||||
{ rdd: true, id: STATUSES.StatusProne, label: 'EFFECT.StatusProne', icon: 'icons/svg/falling.svg' },
|
{ rdd: true, id: STATUSES.StatusProne, name: 'EFFECT.StatusProne', img: 'icons/svg/falling.svg' },
|
||||||
{ rdd: true, id: STATUSES.StatusGrappling, tint: '#33cc33', label: 'EFFECT.StatusGrappling', icon: 'systems/foundryvtt-reve-de-dragon/icons/empoignade.webp' },
|
{ rdd: true, id: STATUSES.StatusGrappling, tint: '#33cc33', name: 'EFFECT.StatusGrappling', img: 'systems/foundryvtt-reve-de-dragon/icons/empoignade.webp' },
|
||||||
{ rdd: true, id: STATUSES.StatusGrappled, tint: '#ff9900', label: 'EFFECT.StatusGrappled', icon: 'systems/foundryvtt-reve-de-dragon/icons/empoignade.webp' },
|
{ rdd: true, id: STATUSES.StatusGrappled, tint: '#ff9900', name: 'EFFECT.StatusGrappled', img: 'systems/foundryvtt-reve-de-dragon/icons/empoignade.webp' },
|
||||||
{ rdd: true, id: STATUSES.StatusRestrained, label: 'EFFECT.StatusRestrained', icon: 'icons/svg/net.svg' },
|
{ rdd: true, id: STATUSES.StatusRestrained, name: 'EFFECT.StatusRestrained', img: 'icons/svg/net.svg' },
|
||||||
{ rdd: true, id: STATUSES.StatusUnconscious, label: 'EFFECT.StatusUnconscious', icon: 'icons/svg/unconscious.svg' },
|
{ rdd: true, id: STATUSES.StatusUnconscious, name: 'EFFECT.StatusUnconscious', img: 'icons/svg/unconscious.svg' },
|
||||||
{ rdd: true, id: STATUSES.StatusBlind, label: 'EFFECT.StatusBlind', icon: 'icons/svg/blind.svg' },
|
{ rdd: true, id: STATUSES.StatusBlind, name: 'EFFECT.StatusBlind', img: 'icons/svg/blind.svg' },
|
||||||
{ rdd: true, id: STATUSES.StatusComma, label: 'EFFECT.StatusComma', icon: 'icons/svg/skull.svg' },
|
{ rdd: true, id: STATUSES.StatusComma, name: 'EFFECT.StatusComma', img: 'icons/svg/skull.svg' },
|
||||||
{ rdd: true, id: STATUSES.StatusDead, label: 'EFFECT.StatusDead', icon: 'icons/svg/skull.svg' },
|
{ rdd: true, id: STATUSES.StatusDead, name: 'EFFECT.StatusDead', img: 'icons/svg/skull.svg' },
|
||||||
{ rdd: true, id: STATUSES.StatusDemiReve, label: 'EFFECT.StatusDemiReve', icon: 'systems/foundryvtt-reve-de-dragon/icons/heures/hd12.svg' }
|
{ rdd: true, id: STATUSES.StatusDemiReve, name: 'EFFECT.StatusDemiReve', img: 'systems/foundryvtt-reve-de-dragon/icons/heures/hd12.svg' }
|
||||||
];
|
];
|
||||||
const demiReveStatusEffect = rddStatusEffects.find(it => it.id == STATUSES.StatusDemiReve);
|
const demiReveStatusEffect = rddStatusEffects.find(it => it.id == STATUSES.StatusDemiReve);
|
||||||
|
|
||||||
@ -57,7 +57,7 @@ export class StatusEffects extends FormApplication {
|
|||||||
restricted: true
|
restricted: true
|
||||||
});
|
});
|
||||||
|
|
||||||
CONFIG.RDD.allEffects = rddStatusEffects.concat(CONFIG.statusEffects.filter(it => !rddEffectIds.includes(it.id)));
|
CONFIG.RDD.allEffects = rddStatusEffects.concat(CONFIG.statusEffects.filter(it => !rddEffectIds.includes(it.id)))
|
||||||
|
|
||||||
StatusEffects._setUseStatusEffects(StatusEffects._getUseStatusEffects());
|
StatusEffects._setUseStatusEffects(StatusEffects._getUseStatusEffects());
|
||||||
console.log('statusEffects', CONFIG.statusEffects);
|
console.log('statusEffects', CONFIG.statusEffects);
|
||||||
|
@ -112,6 +112,19 @@ export class SystemCompendiums extends FormApplication {
|
|||||||
return elements;
|
return elements;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static async loadCompendiumData(compendium) {
|
||||||
|
const pack = game.packs.get(compendium);
|
||||||
|
return await pack?.getDocuments() ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static async loadCompendium(compendium, filter = item => true) {
|
||||||
|
let compendiumData = await SystemCompendiums.loadCompendiumData(compendium);
|
||||||
|
return compendiumData.filter(filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static async getDefaultItems(compendium) {
|
static async getDefaultItems(compendium) {
|
||||||
const pack = game.packs.get(SystemCompendiums._getDefaultCompendium(compendium));
|
const pack = game.packs.get(SystemCompendiums._getDefaultCompendium(compendium));
|
||||||
if (pack.metadata.type == 'Item') {
|
if (pack.metadata.type == 'Item') {
|
||||||
@ -271,23 +284,20 @@ export class CompendiumTableHelpers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async tableRowToChatMessage(row, type = 'Item') {
|
static async tableRowToChatMessage(row, type, options = {showSource: true}) {
|
||||||
if (!row) {
|
if (!row) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const percentages = (row.total == 100) ? '%' : ''
|
|
||||||
const flavorContent = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table-roll.hbs', {
|
const flavorContent = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-compendium-table-roll.hbs', {
|
||||||
roll: row.roll,
|
roll: row.roll,
|
||||||
document: row.document,
|
document: row.document,
|
||||||
percentages,
|
|
||||||
typeName: Misc.typeName(type, row.document?.type ?? 'objet'),
|
typeName: Misc.typeName(type, row.document?.type ?? 'objet'),
|
||||||
isGM: game.user.isGM,
|
isGM: game.user.isGM,
|
||||||
|
options
|
||||||
});
|
});
|
||||||
const messageData = {
|
const messageData = {
|
||||||
// flavor: flavorContent,
|
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
type: CONST.CHAT_MESSAGE_TYPES.ROLL,
|
rolls: [row.roll],
|
||||||
roll: row.roll,
|
|
||||||
sound: CONFIG.sounds.dice,
|
sound: CONFIG.sounds.dice,
|
||||||
content: flavorContent
|
content: flavorContent
|
||||||
};
|
};
|
||||||
|
@ -15,7 +15,7 @@ export class AutoAdjustDarkness {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async adjust(darkness) {
|
static async adjust(darkness) {
|
||||||
if (AutoAdjustDarkness.isAuto()) {
|
if (game.user.isGM && AutoAdjustDarkness.isAuto()) {
|
||||||
const scene = game.scenes.viewed;
|
const scene = game.scenes.viewed;
|
||||||
if (scene?.environment?.globalLight?.enabled && scene?.tokenVision) {
|
if (scene?.environment?.globalLight?.enabled && scene?.tokenVision) {
|
||||||
await scene.update({ darkness });
|
await scene.update({ darkness });
|
||||||
|
@ -26,22 +26,19 @@ export class TMRRencontres {
|
|||||||
* @param {*} forcedRoll
|
* @param {*} forcedRoll
|
||||||
*/
|
*/
|
||||||
async rollRencontre(terrain, forcedRoll) {
|
async rollRencontre(terrain, forcedRoll) {
|
||||||
terrain = TMRUtility.findTMRLike(terrain);
|
const tmrType = TMRUtility.findTMRLike(terrain)?.type
|
||||||
if (terrain == undefined) {
|
if (tmrType == undefined) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (forcedRoll && (forcedRoll <= 0 || forcedRoll > 100)) {
|
if (forcedRoll && (forcedRoll <= 0 || forcedRoll > 100)) {
|
||||||
forcedRoll = undefined;
|
forcedRoll = undefined;
|
||||||
}
|
}
|
||||||
const codeTerrain = Grammar.toLowerCaseNoAccent(terrain)
|
const filtreMauvaise = tmrType == 'mauvaise' ? it => it.system.mauvaiseRencontre : it => !it.system.mauvaiseRencontre;
|
||||||
const filtreMauvaise = codeTerrain == 'mauvaise' ? it => it.system.mauvaiseRencontre : it => !it.system.mauvaiseRencontre;
|
const frequence = it => it.system.frequence[tmrType];
|
||||||
const frequence = it => it.system.frequence[codeTerrain];
|
|
||||||
const row = await this.table.getRandom(frequence, filtreMauvaise, forcedRoll);
|
const row = await this.table.getRandom(frequence, filtreMauvaise, forcedRoll);
|
||||||
if (row) {
|
if (row) {
|
||||||
console.log("DORM", row);
|
await CompendiumTableHelpers.tableRowToChatMessage(row, 'Item', {showSource: false});
|
||||||
//row.document.system.computedForce = new Roll(row.document.system.formula).roll({async: false}).total;
|
|
||||||
await CompendiumTableHelpers.tableRowToChatMessage(row);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return row?.document;
|
return row?.document;
|
||||||
|
@ -2,228 +2,216 @@ import { Misc } from "./misc.js";
|
|||||||
import { Grammar } from "./grammar.js";
|
import { Grammar } from "./grammar.js";
|
||||||
import { RdDDice } from "./rdd-dice.js";
|
import { RdDDice } from "./rdd-dice.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
export const TMRType = {
|
||||||
const TMRMapping = {
|
cite: { type: 'cite', name: "cité", genre: "f" },
|
||||||
A1: { type: "cite", label: "Cité Vide" },
|
sanctuaire: { type: 'sanctuaire', name: "sanctuaire", genre: 'm' },
|
||||||
B1: { type: "plaines", label: "Plaines d’Assorh" },
|
plaines: { type: 'plaines', name: "plaines", genre: "fp" },
|
||||||
C1: { type: "necropole", label: "Nécropole de Kroak" },
|
pont: { type: 'pont', name: "pont", genre: "m" },
|
||||||
D1: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
collines: { type: 'collines', name: "collines", genre: "p" },
|
||||||
E1: { type: "monts", label: "Monts de Kanaï" },
|
foret: { type: 'foret', name: "forêt", genre: "f" },
|
||||||
F1: { type: "cite", label: "Cité Glauque" },
|
monts: { type: 'monts', name: "monts", genre: "p" },
|
||||||
G1: { type: "desolation", label: "Désolation de Jamais" },
|
desert: { type: 'desert', name: "désert", genre: "m" },
|
||||||
H1: { type: "lac", label: "Lac d’Anticalme" },
|
fleuve: { type: 'fleuve', name: "fleuve", genre: "m" },
|
||||||
I1: { type: "plaines", label: "Plaines Grises" },
|
lac: { type: 'lac', name: "lac", genre: "m" },
|
||||||
J1: { type: "monts", label: "Monts Fainéants" },
|
marais: { type: 'marais', name: "marais", genre: "m" },
|
||||||
K1: { type: "cite", label: "Cité d’Onkause" },
|
gouffre: { type: 'gouffre', name: "gouffre", genre: "m" },
|
||||||
L1: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
necropole: { type: 'necropole', name: "nécropole", genre: "f" },
|
||||||
M1: { type: "cite", label: "Cité Jalouse" },
|
desolation: { type: 'desolation', name: "désolation", genre: "f" }
|
||||||
|
|
||||||
A2: { type: "desert", label: "Désert de Mieux" },
|
|
||||||
B2: { type: "collines", label: "Collines de Dawell" },
|
|
||||||
C2: { type: "marais", label: "Marais Glignants" },
|
|
||||||
D2: { type: "cite", label: "Cité de Frost" },
|
|
||||||
E2: { type: "plaines", label: "Plaines de Fiask" },
|
|
||||||
F2: { type: "lac", label: "Lac de Misère" },
|
|
||||||
G2: { type: "marais", label: "Marais Nuisants" },
|
|
||||||
H2: { type: "collines", label: "Collines de Parta" },
|
|
||||||
I2: { type: "foret", label: "Forêt Fade" },
|
|
||||||
J2: { type: "desert", label: "Désert de Poly" },
|
|
||||||
K2: { type: "foret", label: "Forêt Tamée" },
|
|
||||||
L2: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
M2: { type: "necropole", label: "Nécropole de Logos" },
|
|
||||||
|
|
||||||
A3: { type: "desolation", label: "Désolation de Demain" },
|
|
||||||
B3: { type: "plaines", label: "Plaines de Rubéga" },
|
|
||||||
C3: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
D3: { type: "gouffre", label: "Gouffre d’Oki" },
|
|
||||||
E3: { type: "foret", label: "Forêt d’Estoubh" },
|
|
||||||
F3: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
G3: { type: "gouffre", label: "Gouffre de Sun" },
|
|
||||||
H3: { type: "foret", label: "Forêt de Ganna" },
|
|
||||||
I3: { type: "monts", label: "Monts Grinçants" },
|
|
||||||
J3: { type: "cite", label: "Cité Venin" },
|
|
||||||
K3: { type: "plaines", label: "Plaines de Dois" },
|
|
||||||
L3: { type: "lac", label: "Lac Laineux" },
|
|
||||||
M3: { type: "monts", label: "Monts de Vdah" },
|
|
||||||
|
|
||||||
A4: { type: "foret", label: "Forêt de Falconax" },
|
|
||||||
B4: { type: "monts", label: "Monts Crâneurs" },
|
|
||||||
C4: { type: "pont", label: "Pont de Giolii" },
|
|
||||||
D4: { type: "lac", label: "Lac de Foam" },
|
|
||||||
E4: { type: "plaines", label: "Plaines d’Orti" },
|
|
||||||
F4: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
G4: { type: "sanctuaire", label: "Sanctuaire Blanc" },
|
|
||||||
H4: { type: "plaines", label: "Plaines de Psark" },
|
|
||||||
I4: { type: "plaines", label: "Plaines de Xiax" },
|
|
||||||
J4: { type: "collines", label: "Collines d’Encre" },
|
|
||||||
K4: { type: "pont", label: "Pont de Fah" },
|
|
||||||
L4: { type: "sanctuaire", label: "Sanctuaire Mauve" },
|
|
||||||
M4: { type: "gouffre", label: "Gouffre Grisant" },
|
|
||||||
|
|
||||||
A5: { type: "plaines", label: "Plaines de Trilkh" },
|
|
||||||
B5: { type: "collines", label: "Collines de Tanegy" },
|
|
||||||
C5: { type: "marais", label: "Marais Flouants" },
|
|
||||||
D5: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
E5: { type: "monts", label: "Monts Brûlants" },
|
|
||||||
F5: { type: "cite", label: "Cité de Panople" },
|
|
||||||
G5: { type: "pont", label: "Pont d’Ik" },
|
|
||||||
H5: { type: "desert", label: "Désert de Krane" },
|
|
||||||
I5: { type: "desolation", label: "Désolation de Toujours" },
|
|
||||||
J5: { type: "marais", label: "Marais de Jab" },
|
|
||||||
K5: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
L5: { type: "collines", label: "Collines Suaves" },
|
|
||||||
M5: { type: "cite", label: "Cité Rimarde" },
|
|
||||||
|
|
||||||
A6: { type: "necropole", label: "Nécropole de Zniak" },
|
|
||||||
B6: { type: "foret", label: "Forêt de Bust" },
|
|
||||||
C6: { type: "cite", label: "Cité Pavois" },
|
|
||||||
D6: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
E6: { type: "sanctuaire", label: "Sanctuaire de Plaine" },
|
|
||||||
F6: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
G6: { type: "marais", label: "Marais Glutants" },
|
|
||||||
H6: { type: "monts", label: "Monts Gurdes" },
|
|
||||||
I6: { type: "necropole", label: "Nécropole de Xotar" },
|
|
||||||
J6: { type: "lac", label: "Lac d’Iaupe" },
|
|
||||||
K6: { type: "desolation", label: "Désolation de Poor" },
|
|
||||||
L6: { type: "foret", label: "Forêt Gueuse" },
|
|
||||||
M6: { type: "desolation", label: "Désolation de Presque" },
|
|
||||||
|
|
||||||
A7: { type: "plaines", label: "Plaines de l’Arc" },
|
|
||||||
B7: { type: "marais", label: "Marais Bluants" },
|
|
||||||
C7: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
D7: { type: "plaines", label: "Plaines d’Affa" },
|
|
||||||
E7: { type: "foret", label: "Forêt de Glusks" },
|
|
||||||
F7: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
G7: { type: "cite", label: "Cité de Terwa" },
|
|
||||||
H7: { type: "gouffre", label: "Gouffre de Kapfa" },
|
|
||||||
I7: { type: "plaines", label: "Plaines de Troo" },
|
|
||||||
J7: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
K7: { type: "cite", label: "Cité de Kolix" },
|
|
||||||
L7: { type: "gouffre", label: "Gouffre d’Episophe" },
|
|
||||||
M7: { type: "desert", label: "Désert de Lave" },
|
|
||||||
|
|
||||||
A8: { type: "gouffre", label: "Gouffre de Shok" },
|
|
||||||
B8: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
C8: { type: "foret", label: "Forêt Turmide" },
|
|
||||||
D8: { type: "cite", label: "Cité d’Olak" },
|
|
||||||
E8: { type: "plaines", label: "Plaines d’Iolise" },
|
|
||||||
F8: { type: "lac", label: "Lac des Chats" },
|
|
||||||
G8: { type: "plaines", label: "Plaines Sans Joie" },
|
|
||||||
H8: { type: "foret", label: "Forêt d’Ourf" },
|
|
||||||
I8: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
J8: { type: "monts", label: "Monts Barask" },
|
|
||||||
K8: { type: "desert", label: "Désert de Fumée" },
|
|
||||||
L8: { type: "monts", label: "Monts Tavelés" },
|
|
||||||
M8: { type: "plaines", label: "Plaines Lavées" },
|
|
||||||
|
|
||||||
A9: { type: "collines", label: "Collines de Korrex" },
|
|
||||||
B9: { type: "lac", label: "Lac de Lucre" },
|
|
||||||
C9: { type: "monts", label: "Monts Tuméfiés" },
|
|
||||||
D9: { type: "pont", label: "Pont d’Orx" },
|
|
||||||
E9: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
F9: { type: "plaines", label: "Plaines de Foe" },
|
|
||||||
G9: { type: "desolation", label: "Désolation de Sel" },
|
|
||||||
H9: { type: "collines", label: "Collines de Noirseul" },
|
|
||||||
I9: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
J9: { type: "marais", label: "Marais Gronchants" },
|
|
||||||
K9: { type: "sanctuaire", label: "Sanctuaire Noir" },
|
|
||||||
L9: { type: "collines", label: "Collines Cornues" },
|
|
||||||
M9: { type: "necropole", label: "Nécropole de Zonar" },
|
|
||||||
|
|
||||||
A10: { type: "sanctuaire", label: "Sanctuaire d’Olis" },
|
|
||||||
B10: { type: "monts", label: "Monts Salés" },
|
|
||||||
C10: { type: "marais", label: "Marais de Dom" },
|
|
||||||
D10: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
E10: { type: "gouffre", label: "Gouffre de Junk" },
|
|
||||||
F10: { type: "marais", label: "Marais Zultants" },
|
|
||||||
G10: { type: "cite", label: "Cité de Sergal" },
|
|
||||||
H10: { type: "plaines", label: "Plaines Noires" },
|
|
||||||
I10: { type: "lac", label: "Lac Wanito" },
|
|
||||||
J10: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
K10: { type: "plaines", label: "Plaines Jaunes" },
|
|
||||||
L10: { type: "desert", label: "Désert de Nicrop" },
|
|
||||||
M10: { type: "foret", label: "Forêt de Jajou" },
|
|
||||||
|
|
||||||
A11: { type: "desolation", label: "Désolation d’Hier" },
|
|
||||||
B11: { type: "cite", label: "Cité de Brilz" },
|
|
||||||
C11: { type: "pont", label: "Pont de Roï" },
|
|
||||||
D11: { type: "desolation", label: "Désolation de Partout" },
|
|
||||||
E11: { type: "lac", label: "Lac de Glinster" },
|
|
||||||
F11: { type: "cite", label: "Cité de Noape" },
|
|
||||||
G11: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
H11: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
I11: { type: "pont", label: "Pont de Yalm" },
|
|
||||||
J11: { type: "plaines", label: "Plaines de Miltiar" },
|
|
||||||
K11: { type: "cite", label: "Cité Tonnerre" },
|
|
||||||
L11: { type: "collines", label: "Collines de Kol" },
|
|
||||||
M11: { type: "cite", label: "Cité Crapaud" },
|
|
||||||
|
|
||||||
A12: { type: "plaines", label: "Plaines Sages" },
|
|
||||||
B12: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
C12: { type: "lac", label: "Lac de Fricassa" },
|
|
||||||
D12: { type: "collines", label: "Collines d’Huaï" },
|
|
||||||
E12: { type: "monts", label: "Monts Ajourés" },
|
|
||||||
F12: { type: "necropole", label: "Nécropole de Throat" },
|
|
||||||
G12: { type: "plaines", label: "Plaines de Lufmil" },
|
|
||||||
H12: { type: "collines", label: "Collines de Tooth" },
|
|
||||||
I12: { type: "gouffre", label: "Gouffre Abimeux" },
|
|
||||||
J12: { type: "cite", label: "Cité Folle" },
|
|
||||||
K12: { type: "desolation", label: "Désolation d’Amour" },
|
|
||||||
L12: { type: "plaines", label: "Plaines Venteuses" },
|
|
||||||
M12: { type: "collines", label: "Collines Révulsantes" },
|
|
||||||
|
|
||||||
A13: { type: "fleuve", label: "Fleuve de l'Oubli" },
|
|
||||||
B13: { type: "gouffre", label: "Gouffre des Litiges" },
|
|
||||||
C13: { type: "desert", label: "Désert de Neige" },
|
|
||||||
D13: { type: "cite", label: "Cité Sordide" },
|
|
||||||
E13: { type: "plaines", label: "Plaines de Xnez" },
|
|
||||||
F13: { type: "foret", label: "Forêt des Cris" },
|
|
||||||
G13: { type: "plaines", label: "Plaines Calcaires" },
|
|
||||||
H13: { type: "desolation", label: "Désolation de Rien" },
|
|
||||||
I13: { type: "monts", label: "Monts Bigleux" },
|
|
||||||
J13: { type: "gouffre", label: "Gouffre de Gromph" },
|
|
||||||
K13: { type: "foret", label: "Forêt de Kluth" },
|
|
||||||
L13: { type: "monts", label: "Monts Dormants" },
|
|
||||||
M13: { type: "plaines", label: "Plaines d’Anjou" },
|
|
||||||
|
|
||||||
A14: { type: "collines", label: "Collines de Stolis" },
|
|
||||||
B14: { type: "necropole", label: "Nécropole de Gorlo" },
|
|
||||||
C14: { type: "foret", label: "Forêt de Bissam" },
|
|
||||||
D14: { type: "sanctuaire", label: "Sanctuaire Plat" },
|
|
||||||
E14: { type: "monts", label: "Monts de Quath" },
|
|
||||||
F14: { type: "plaines", label: "Plaines Brisées" },
|
|
||||||
G14: { type: "desert", label: "Désert de Sek" },
|
|
||||||
H14: { type: "plaines", label: "Plaines Blanches" },
|
|
||||||
I14: { type: "cite", label: "Cité Destituée" },
|
|
||||||
J14: { type: "desert", label: "Désert de Sank" },
|
|
||||||
K14: { type: "necropole", label: "Nécropole d’Antinéar" },
|
|
||||||
L14: { type: "plaines", label: "Plaines de Jislith" },
|
|
||||||
M14: { type: "desolation", label: "Désolation d’Après" },
|
|
||||||
|
|
||||||
A15: { type: "cite", label: "Cité de Mielh" },
|
|
||||||
C15: { type: "plaines", label: "Plaines de Toué" },
|
|
||||||
E15: { type: "foret", label: "Forêt des Furies" },
|
|
||||||
G15: { type: "plaines", label: "Plaines des Soupirs" },
|
|
||||||
I15: { type: "monts", label: "Monts des Dragées" },
|
|
||||||
K15: { type: "collines", label: "Collines Pourpres" },
|
|
||||||
M15: { type: "cite", label: "Cité de Klana" }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const TMRType = {
|
export const FLEUVE_COORD = 'Fleuve'
|
||||||
cite: { name: "cité", genre: "f" },
|
|
||||||
sanctuaire: { name: "sanctuaire", genre: 'm' },
|
const TMRMapping = {
|
||||||
plaines: { name: "plaines", genre: "fp" },
|
Fleuve: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
pont: { name: "pont", genre: "m" },
|
A1: { type: TMRType.cite.type, label: "Cité Vide" },
|
||||||
collines: { name: "collines", genre: "p" },
|
B1: { type: TMRType.plaines.type, label: "Plaines d’Assorh" },
|
||||||
foret: { name: "forêt", genre: "f" },
|
C1: { type: TMRType.necropole.type, label: "Nécropole de Kroak" },
|
||||||
monts: { name: "monts", genre: "p" },
|
D1: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
desert: { name: "désert", genre: "m" },
|
E1: { type: TMRType.monts.type, label: "Monts de Kanaï" },
|
||||||
fleuve: { name: "fleuve", genre: "m" },
|
F1: { type: TMRType.cite.type, label: "Cité Glauque" },
|
||||||
lac: { name: "lac", genre: "m" },
|
G1: { type: TMRType.desolation.type, label: "Désolation de Jamais" },
|
||||||
marais: { name: "marais", genre: "m" },
|
H1: { type: TMRType.lac.type, label: "Lac d’Anticalme" },
|
||||||
gouffre: { name: "gouffre", genre: "m" },
|
I1: { type: TMRType.plaines.type, label: "Plaines Grises" },
|
||||||
necropole: { name: "nécropole", genre: "f" },
|
J1: { type: TMRType.monts.type, label: "Monts Fainéants" },
|
||||||
desolation: { name: "désolation", genre: "f" }
|
K1: { type: TMRType.cite.type, label: "Cité d’Onkause" },
|
||||||
|
L1: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
M1: { type: TMRType.cite.type, label: "Cité Jalouse" },
|
||||||
|
A2: { type: TMRType.desert.type, label: "Désert de Mieux" },
|
||||||
|
B2: { type: TMRType.collines.type, label: "Collines de Dawell" },
|
||||||
|
C2: { type: TMRType.marais.type, label: "Marais Glignants" },
|
||||||
|
D2: { type: TMRType.cite.type, label: "Cité de Frost" },
|
||||||
|
E2: { type: TMRType.plaines.type, label: "Plaines de Fiask" },
|
||||||
|
F2: { type: TMRType.lac.type, label: "Lac de Misère" },
|
||||||
|
G2: { type: TMRType.marais.type, label: "Marais Nuisants" },
|
||||||
|
H2: { type: TMRType.collines.type, label: "Collines de Parta" },
|
||||||
|
I2: { type: TMRType.foret.type, label: "Forêt Fade" },
|
||||||
|
J2: { type: TMRType.desert.type, label: "Désert de Poly" },
|
||||||
|
K2: { type: TMRType.foret.type, label: "Forêt Tamée" },
|
||||||
|
L2: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
M2: { type: TMRType.necropole.type, label: "Nécropole de Logos" },
|
||||||
|
A3: { type: TMRType.desolation.type, label: "Désolation de Demain" },
|
||||||
|
B3: { type: TMRType.plaines.type, label: "Plaines de Rubéga" },
|
||||||
|
C3: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
D3: { type: TMRType.gouffre.type, label: "Gouffre d’Oki" },
|
||||||
|
E3: { type: TMRType.foret.type, label: "Forêt d’Estoubh" },
|
||||||
|
F3: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
G3: { type: TMRType.gouffre.type, label: "Gouffre de Sun" },
|
||||||
|
H3: { type: TMRType.foret.type, label: "Forêt de Ganna" },
|
||||||
|
I3: { type: TMRType.monts.type, label: "Monts Grinçants" },
|
||||||
|
J3: { type: TMRType.cite.type, label: "Cité Venin" },
|
||||||
|
K3: { type: TMRType.plaines.type, label: "Plaines de Dois" },
|
||||||
|
L3: { type: TMRType.lac.type, label: "Lac Laineux" },
|
||||||
|
M3: { type: TMRType.monts.type, label: "Monts de Vdah" },
|
||||||
|
A4: { type: TMRType.foret.type, label: "Forêt de Falconax" },
|
||||||
|
B4: { type: TMRType.monts.type, label: "Monts Crâneurs" },
|
||||||
|
C4: { type: TMRType.pont.type, label: "Pont de Giolii" },
|
||||||
|
D4: { type: TMRType.lac.type, label: "Lac de Foam" },
|
||||||
|
E4: { type: TMRType.plaines.type, label: "Plaines d’Orti" },
|
||||||
|
F4: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
G4: { type: TMRType.sanctuaire.type, label: "Sanctuaire Blanc" },
|
||||||
|
H4: { type: TMRType.plaines.type, label: "Plaines de Psark" },
|
||||||
|
I4: { type: TMRType.plaines.type, label: "Plaines de Xiax" },
|
||||||
|
J4: { type: TMRType.collines.type, label: "Collines d’Encre" },
|
||||||
|
K4: { type: TMRType.pont.type, label: "Pont de Fah" },
|
||||||
|
L4: { type: TMRType.sanctuaire.type, label: "Sanctuaire Mauve" },
|
||||||
|
M4: { type: TMRType.gouffre.type, label: "Gouffre Grisant" },
|
||||||
|
A5: { type: TMRType.plaines.type, label: "Plaines de Trilkh" },
|
||||||
|
B5: { type: TMRType.collines.type, label: "Collines de Tanegy" },
|
||||||
|
C5: { type: TMRType.marais.type, label: "Marais Flouants" },
|
||||||
|
D5: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
E5: { type: TMRType.monts.type, label: "Monts Brûlants" },
|
||||||
|
F5: { type: TMRType.cite.type, label: "Cité de Panople" },
|
||||||
|
G5: { type: TMRType.pont.type, label: "Pont d’Ik" },
|
||||||
|
H5: { type: TMRType.desert.type, label: "Désert de Krane" },
|
||||||
|
I5: { type: TMRType.desolation.type, label: "Désolation de Toujours" },
|
||||||
|
J5: { type: TMRType.marais.type, label: "Marais de Jab" },
|
||||||
|
K5: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
L5: { type: TMRType.collines.type, label: "Collines Suaves" },
|
||||||
|
M5: { type: TMRType.cite.type, label: "Cité Rimarde" },
|
||||||
|
A6: { type: TMRType.necropole.type, label: "Nécropole de Zniak" },
|
||||||
|
B6: { type: TMRType.foret.type, label: "Forêt de Bust" },
|
||||||
|
C6: { type: TMRType.cite.type, label: "Cité Pavois" },
|
||||||
|
D6: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
E6: { type: TMRType.sanctuaire.type, label: "Sanctuaire de Plaine" },
|
||||||
|
F6: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
G6: { type: TMRType.marais.type, label: "Marais Glutants" },
|
||||||
|
H6: { type: TMRType.monts.type, label: "Monts Gurdes" },
|
||||||
|
I6: { type: TMRType.necropole.type, label: "Nécropole de Xotar" },
|
||||||
|
J6: { type: TMRType.lac.type, label: "Lac d’Iaupe" },
|
||||||
|
K6: { type: TMRType.desolation.type, label: "Désolation de Poor" },
|
||||||
|
L6: { type: TMRType.foret.type, label: "Forêt Gueuse" },
|
||||||
|
M6: { type: TMRType.desolation.type, label: "Désolation de Presque" },
|
||||||
|
A7: { type: TMRType.plaines.type, label: "Plaines de l’Arc" },
|
||||||
|
B7: { type: TMRType.marais.type, label: "Marais Bluants" },
|
||||||
|
C7: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
D7: { type: TMRType.plaines.type, label: "Plaines d’Affa" },
|
||||||
|
E7: { type: TMRType.foret.type, label: "Forêt de Glusks" },
|
||||||
|
F7: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
G7: { type: TMRType.cite.type, label: "Cité de Terwa" },
|
||||||
|
H7: { type: TMRType.gouffre.type, label: "Gouffre de Kapfa" },
|
||||||
|
I7: { type: TMRType.plaines.type, label: "Plaines de Troo" },
|
||||||
|
J7: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
K7: { type: TMRType.cite.type, label: "Cité de Kolix" },
|
||||||
|
L7: { type: TMRType.gouffre.type, label: "Gouffre d’Episophe" },
|
||||||
|
M7: { type: TMRType.desert.type, label: "Désert de Lave" },
|
||||||
|
A8: { type: TMRType.gouffre.type, label: "Gouffre de Shok" },
|
||||||
|
B8: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
C8: { type: TMRType.foret.type, label: "Forêt Turmide" },
|
||||||
|
D8: { type: TMRType.cite.type, label: "Cité d’Olak" },
|
||||||
|
E8: { type: TMRType.plaines.type, label: "Plaines d’Iolise" },
|
||||||
|
F8: { type: TMRType.lac.type, label: "Lac des Chats" },
|
||||||
|
G8: { type: TMRType.plaines.type, label: "Plaines Sans Joie" },
|
||||||
|
H8: { type: TMRType.foret.type, label: "Forêt d’Ourf" },
|
||||||
|
I8: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
J8: { type: TMRType.monts.type, label: "Monts Barask" },
|
||||||
|
K8: { type: TMRType.desert.type, label: "Désert de Fumée" },
|
||||||
|
L8: { type: TMRType.monts.type, label: "Monts Tavelés" },
|
||||||
|
M8: { type: TMRType.plaines.type, label: "Plaines Lavées" },
|
||||||
|
A9: { type: TMRType.collines.type, label: "Collines de Korrex" },
|
||||||
|
B9: { type: TMRType.lac.type, label: "Lac de Lucre" },
|
||||||
|
C9: { type: TMRType.monts.type, label: "Monts Tuméfiés" },
|
||||||
|
D9: { type: TMRType.pont.type, label: "Pont d’Orx" },
|
||||||
|
E9: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
F9: { type: TMRType.plaines.type, label: "Plaines de Foe" },
|
||||||
|
G9: { type: TMRType.desolation.type, label: "Désolation de Sel" },
|
||||||
|
H9: { type: TMRType.collines.type, label: "Collines de Noirseul" },
|
||||||
|
I9: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
J9: { type: TMRType.marais.type, label: "Marais Gronchants" },
|
||||||
|
K9: { type: TMRType.sanctuaire.type, label: "Sanctuaire Noir" },
|
||||||
|
L9: { type: TMRType.collines.type, label: "Collines Cornues" },
|
||||||
|
M9: { type: TMRType.necropole.type, label: "Nécropole de Zonar" },
|
||||||
|
A10: { type: TMRType.sanctuaire.type, label: "Sanctuaire d’Olis" },
|
||||||
|
B10: { type: TMRType.monts.type, label: "Monts Salés" },
|
||||||
|
C10: { type: TMRType.marais.type, label: "Marais de Dom" },
|
||||||
|
D10: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
E10: { type: TMRType.gouffre.type, label: "Gouffre de Junk" },
|
||||||
|
F10: { type: TMRType.marais.type, label: "Marais Zultants" },
|
||||||
|
G10: { type: TMRType.cite.type, label: "Cité de Sergal" },
|
||||||
|
H10: { type: TMRType.plaines.type, label: "Plaines Noires" },
|
||||||
|
I10: { type: TMRType.lac.type, label: "Lac Wanito" },
|
||||||
|
J10: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
K10: { type: TMRType.plaines.type, label: "Plaines Jaunes" },
|
||||||
|
L10: { type: TMRType.desert.type, label: "Désert de Nicrop" },
|
||||||
|
M10: { type: TMRType.foret.type, label: "Forêt de Jajou" },
|
||||||
|
A11: { type: TMRType.desolation.type, label: "Désolation d’Hier" },
|
||||||
|
B11: { type: TMRType.cite.type, label: "Cité de Brilz" },
|
||||||
|
C11: { type: TMRType.pont.type, label: "Pont de Roï" },
|
||||||
|
D11: { type: TMRType.desolation.type, label: "Désolation de Partout" },
|
||||||
|
E11: { type: TMRType.lac.type, label: "Lac de Glinster" },
|
||||||
|
F11: { type: TMRType.cite.type, label: "Cité de Noape" },
|
||||||
|
G11: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
H11: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
I11: { type: TMRType.pont.type, label: "Pont de Yalm" },
|
||||||
|
J11: { type: TMRType.plaines.type, label: "Plaines de Miltiar" },
|
||||||
|
K11: { type: TMRType.cite.type, label: "Cité Tonnerre" },
|
||||||
|
L11: { type: TMRType.collines.type, label: "Collines de Kol" },
|
||||||
|
M11: { type: TMRType.cite.type, label: "Cité Crapaud" },
|
||||||
|
A12: { type: TMRType.plaines.type, label: "Plaines Sages" },
|
||||||
|
B12: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
C12: { type: TMRType.lac.type, label: "Lac de Fricassa" },
|
||||||
|
D12: { type: TMRType.collines.type, label: "Collines d’Huaï" },
|
||||||
|
E12: { type: TMRType.monts.type, label: "Monts Ajourés" },
|
||||||
|
F12: { type: TMRType.necropole.type, label: "Nécropole de Throat" },
|
||||||
|
G12: { type: TMRType.plaines.type, label: "Plaines de Lufmil" },
|
||||||
|
H12: { type: TMRType.collines.type, label: "Collines de Tooth" },
|
||||||
|
I12: { type: TMRType.gouffre.type, label: "Gouffre Abimeux" },
|
||||||
|
J12: { type: TMRType.cite.type, label: "Cité Folle" },
|
||||||
|
K12: { type: TMRType.desolation.type, label: "Désolation d’Amour" },
|
||||||
|
L12: { type: TMRType.plaines.type, label: "Plaines Venteuses" },
|
||||||
|
M12: { type: TMRType.collines.type, label: "Collines Révulsantes" },
|
||||||
|
A13: { type: TMRType.fleuve.type, label: "Fleuve de l'Oubli" },
|
||||||
|
B13: { type: TMRType.gouffre.type, label: "Gouffre des Litiges" },
|
||||||
|
C13: { type: TMRType.desert.type, label: "Désert de Neige" },
|
||||||
|
D13: { type: TMRType.cite.type, label: "Cité Sordide" },
|
||||||
|
E13: { type: TMRType.plaines.type, label: "Plaines de Xnez" },
|
||||||
|
F13: { type: TMRType.foret.type, label: "Forêt des Cris" },
|
||||||
|
G13: { type: TMRType.plaines.type, label: "Plaines Calcaires" },
|
||||||
|
H13: { type: TMRType.desolation.type, label: "Désolation de Rien" },
|
||||||
|
I13: { type: TMRType.monts.type, label: "Monts Bigleux" },
|
||||||
|
J13: { type: TMRType.gouffre.type, label: "Gouffre de Gromph" },
|
||||||
|
K13: { type: TMRType.foret.type, label: "Forêt de Kluth" },
|
||||||
|
L13: { type: TMRType.monts.type, label: "Monts Dormants" },
|
||||||
|
M13: { type: TMRType.plaines.type, label: "Plaines d’Anjou" },
|
||||||
|
A14: { type: TMRType.collines.type, label: "Collines de Stolis" },
|
||||||
|
B14: { type: TMRType.necropole.type, label: "Nécropole de Gorlo" },
|
||||||
|
C14: { type: TMRType.foret.type, label: "Forêt de Bissam" },
|
||||||
|
D14: { type: TMRType.sanctuaire.type, label: "Sanctuaire Plat" },
|
||||||
|
E14: { type: TMRType.monts.type, label: "Monts de Quath" },
|
||||||
|
F14: { type: TMRType.plaines.type, label: "Plaines Brisées" },
|
||||||
|
G14: { type: TMRType.desert.type, label: "Désert de Sek" },
|
||||||
|
H14: { type: TMRType.plaines.type, label: "Plaines Blanches" },
|
||||||
|
I14: { type: TMRType.cite.type, label: "Cité Destituée" },
|
||||||
|
J14: { type: TMRType.desert.type, label: "Désert de Sank" },
|
||||||
|
K14: { type: TMRType.necropole.type, label: "Nécropole d’Antinéar" },
|
||||||
|
L14: { type: TMRType.plaines.type, label: "Plaines de Jislith" },
|
||||||
|
M14: { type: TMRType.desolation.type, label: "Désolation d’Après" },
|
||||||
|
A15: { type: TMRType.cite.type, label: "Cité de Mielh" },
|
||||||
|
C15: { type: TMRType.plaines.type, label: "Plaines de Toué" },
|
||||||
|
E15: { type: TMRType.foret.type, label: "Forêt des Furies" },
|
||||||
|
G15: { type: TMRType.plaines.type, label: "Plaines des Soupirs" },
|
||||||
|
I15: { type: TMRType.monts.type, label: "Monts des Dragées" },
|
||||||
|
K15: { type: TMRType.collines.type, label: "Collines Pourpres" },
|
||||||
|
M15: { type: TMRType.cite.type, label: "Cité de Klana" }
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
@ -251,13 +239,16 @@ const TMR_MOVE = {
|
|||||||
*/
|
*/
|
||||||
export class TMRUtility {
|
export class TMRUtility {
|
||||||
static init() {
|
static init() {
|
||||||
|
|
||||||
for (let coord in TMRMapping) {
|
for (let coord in TMRMapping) {
|
||||||
const tmr = TMRMapping[coord];
|
const tmr = TMRMapping[coord]
|
||||||
tmr.coord = coord;
|
tmr.coord = coord
|
||||||
tmr.oddq = TMRUtility.coordTMRToOddq(coord);
|
tmr.genre = TMRType[tmr.type].genre
|
||||||
tmr.genre = TMRType[tmr.type].genre;
|
if (coord != FLEUVE_COORD) {
|
||||||
|
tmr.oddq = TMRUtility.coordTMRToOddq(coord)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let tmrByType = Misc.classify(Object.values(TMRMapping));
|
let tmrByType = Misc.classify(Object.values(TMRMapping).filter(it => it.coord != FLEUVE_COORD))
|
||||||
for (const [type, list] of Object.entries(tmrByType)) {
|
for (const [type, list] of Object.entries(tmrByType)) {
|
||||||
TMRType[type].list = list;
|
TMRType[type].list = list;
|
||||||
}
|
}
|
||||||
@ -265,14 +256,17 @@ export class TMRUtility {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static verifyTMRCoord(coord) {
|
static verifyTMRCoord(coord) {
|
||||||
return Grammar.equalsInsensitive(coord, 'Fleuve') || TMRUtility.getTMR(coord);
|
return Grammar.equalsInsensitive(coord, FLEUVE_COORD) || TMRUtility.getTMR(coord);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getTMR(coord) {
|
static getTMR(coord) {
|
||||||
return coord == 'Fleuve' ? TMRMapping['D1'] : TMRMapping[coord];
|
return coord == FLEUVE_COORD ? TMRMapping['D1'] : TMRMapping[coord];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static isFleuve(coord) {
|
||||||
|
return TMRMapping[coord]?.type == TMRType.fleuve.type
|
||||||
|
}
|
||||||
static getTMRLabel(coord) {
|
static getTMRLabel(coord) {
|
||||||
return TMRUtility.getTMR(coord)?.label ?? (coord + ": case inconnue");
|
return TMRUtility.getTMR(coord)?.label ?? (coord + ": case inconnue");
|
||||||
}
|
}
|
||||||
@ -290,18 +284,18 @@ export class TMRUtility {
|
|||||||
static findTMRLike(type, options = { inclusMauvaise: true }) {
|
static findTMRLike(type, options = { inclusMauvaise: true }) {
|
||||||
const choix = [...Object.values(TMRType)]
|
const choix = [...Object.values(TMRType)]
|
||||||
if (options.inclusMauvaise) {
|
if (options.inclusMauvaise) {
|
||||||
choix.push({ name: 'Mauvaise' });
|
choix.push({ name: 'Mauvaise', type: 'mauvaise'});
|
||||||
}
|
}
|
||||||
const selection = Misc.findAllLike(type, choix).map(it => it.name);
|
const selection = Misc.findAllLike(type, choix)
|
||||||
if (selection.length == 0) {
|
if (selection.length == 0) {
|
||||||
ui.notifications.warn(`Un type de TMR doit être indiqué, '${type}' n'est pas trouvé dans ${choix}`);
|
ui.notifications.warn(`Un type de TMR doit être indiqué, '${type}' n'est pas trouvé dans ${choix}`);
|
||||||
return undefined;
|
return undefined
|
||||||
}
|
}
|
||||||
if (selection.length > 1) {
|
if (selection.length > 1) {
|
||||||
ui.notifications.warn(`Plusieurs types de TMR pourraient correspondre à '${type}': ${selection}`);
|
ui.notifications.warn(`Plusieurs types de TMR pourraient correspondre à '${type}': ${selection.map(it => it.name)}`);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
return selection[0];
|
return selection[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
static typeTmrName(type) {
|
static typeTmrName(type) {
|
||||||
@ -326,7 +320,7 @@ export class TMRUtility {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static deplacement(coordOrig, moveName) {
|
static deplacement(coordOrig, moveName) {
|
||||||
const tmrMove = TMR_MOVE[moveName];
|
const tmrMove = TMR_MOVE[moveName];
|
||||||
if (! tmrMove) {
|
if (!tmrMove) {
|
||||||
ui.notifications.error(`Le déplacement dans les TMR '${moveName}' est inconnu`)
|
ui.notifications.error(`Le déplacement dans les TMR '${moveName}' est inconnu`)
|
||||||
return coordOrig
|
return coordOrig
|
||||||
}
|
}
|
||||||
|
BIN
pack_ref/animaux/000005.ldb
Normal file
BIN
pack_ref/animaux/000005.ldb
Normal file
Binary file not shown.
0
pack_ref/animaux/000023.log
Normal file
0
pack_ref/animaux/000023.log
Normal file
1
pack_ref/animaux/CURRENT
Normal file
1
pack_ref/animaux/CURRENT
Normal file
@ -0,0 +1 @@
|
|||||||
|
MANIFEST-000022
|
0
pack_ref/animaux/LOCK
Normal file
0
pack_ref/animaux/LOCK
Normal file
3
pack_ref/animaux/LOG
Normal file
3
pack_ref/animaux/LOG
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
2024/11/10-18:39:00.183093 7fed63e006c0 Recovering log #21
|
||||||
|
2024/11/10-18:39:00.195436 7fed63e006c0 Delete type=0 #21
|
||||||
|
2024/11/10-18:39:00.195482 7fed63e006c0 Delete type=3 #20
|
3
pack_ref/animaux/LOG.old
Normal file
3
pack_ref/animaux/LOG.old
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
2024/11/10-18:38:41.533242 7f4c0b8006c0 Recovering log #19
|
||||||
|
2024/11/10-18:38:41.547823 7f4c0b8006c0 Delete type=0 #19
|
||||||
|
2024/11/10-18:38:41.547917 7f4c0b8006c0 Delete type=3 #18
|
BIN
pack_ref/animaux/MANIFEST-000022
Normal file
BIN
pack_ref/animaux/MANIFEST-000022
Normal file
Binary file not shown.
BIN
pack_ref/archetypes/000005.ldb
Normal file
BIN
pack_ref/archetypes/000005.ldb
Normal file
Binary file not shown.
0
pack_ref/archetypes/000011.log
Normal file
0
pack_ref/archetypes/000011.log
Normal file
1
pack_ref/archetypes/CURRENT
Normal file
1
pack_ref/archetypes/CURRENT
Normal file
@ -0,0 +1 @@
|
|||||||
|
MANIFEST-000010
|
0
pack_ref/archetypes/LOCK
Normal file
0
pack_ref/archetypes/LOCK
Normal file
3
pack_ref/archetypes/LOG
Normal file
3
pack_ref/archetypes/LOG
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
2024/11/10-18:39:00.253481 7fed62a006c0 Recovering log #8
|
||||||
|
2024/11/10-18:39:00.263751 7fed62a006c0 Delete type=3 #6
|
||||||
|
2024/11/10-18:39:00.263866 7fed62a006c0 Delete type=0 #8
|
8
pack_ref/archetypes/LOG.old
Normal file
8
pack_ref/archetypes/LOG.old
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
2024/11/08-19:40:34.139501 7f9d7f4006c0 Recovering log #4
|
||||||
|
2024/11/08-19:40:34.182207 7f9d7f4006c0 Delete type=3 #2
|
||||||
|
2024/11/08-19:40:34.182311 7f9d7f4006c0 Delete type=0 #4
|
||||||
|
2024/11/08-19:56:45.129455 7f9d7d6006c0 Level-0 table #9: started
|
||||||
|
2024/11/08-19:56:45.129487 7f9d7d6006c0 Level-0 table #9: 0 bytes OK
|
||||||
|
2024/11/08-19:56:45.135738 7f9d7d6006c0 Delete type=0 #7
|
||||||
|
2024/11/08-19:56:45.142639 7f9d7d6006c0 Manual compaction at level-0 from '!actors!1Nng9d8r6lrPHCaJ' @ 72057594037927935 : 1 .. '!actors.items!ryUZTa17LzNv25UY.zyNYa3hYtrOcF2jA' @ 0 : 0; will stop at (end)
|
||||||
|
2024/11/08-19:56:45.142697 7f9d7d6006c0 Manual compaction at level-1 from '!actors!1Nng9d8r6lrPHCaJ' @ 72057594037927935 : 1 .. '!actors.items!ryUZTa17LzNv25UY.zyNYa3hYtrOcF2jA' @ 0 : 0; will stop at (end)
|
BIN
pack_ref/archetypes/MANIFEST-000010
Normal file
BIN
pack_ref/archetypes/MANIFEST-000010
Normal file
Binary file not shown.
BIN
pack_ref/arts-et-divertissements/000005.ldb
Normal file
BIN
pack_ref/arts-et-divertissements/000005.ldb
Normal file
Binary file not shown.
0
pack_ref/arts-et-divertissements/000011.log
Normal file
0
pack_ref/arts-et-divertissements/000011.log
Normal file
1
pack_ref/arts-et-divertissements/CURRENT
Normal file
1
pack_ref/arts-et-divertissements/CURRENT
Normal file
@ -0,0 +1 @@
|
|||||||
|
MANIFEST-000010
|
0
pack_ref/arts-et-divertissements/LOCK
Normal file
0
pack_ref/arts-et-divertissements/LOCK
Normal file
3
pack_ref/arts-et-divertissements/LOG
Normal file
3
pack_ref/arts-et-divertissements/LOG
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
2024/11/10-18:39:00.448675 7fed63e006c0 Recovering log #8
|
||||||
|
2024/11/10-18:39:00.460061 7fed63e006c0 Delete type=3 #6
|
||||||
|
2024/11/10-18:39:00.460115 7fed63e006c0 Delete type=0 #8
|
8
pack_ref/arts-et-divertissements/LOG.old
Normal file
8
pack_ref/arts-et-divertissements/LOG.old
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
2024/11/08-19:40:32.605216 7f9d7fe006c0 Recovering log #4
|
||||||
|
2024/11/08-19:40:32.664872 7f9d7fe006c0 Delete type=3 #2
|
||||||
|
2024/11/08-19:40:32.665020 7f9d7fe006c0 Delete type=0 #4
|
||||||
|
2024/11/08-19:56:44.948429 7f9d7d6006c0 Level-0 table #9: started
|
||||||
|
2024/11/08-19:56:44.948495 7f9d7d6006c0 Level-0 table #9: 0 bytes OK
|
||||||
|
2024/11/08-19:56:44.954943 7f9d7d6006c0 Delete type=0 #7
|
||||||
|
2024/11/08-19:56:44.975424 7f9d7d6006c0 Manual compaction at level-0 from '!items!240HPtZsgZQERFMF' @ 72057594037927935 : 1 .. '!items!zRQ5WnPI483CKm9Q' @ 0 : 0; will stop at (end)
|
||||||
|
2024/11/08-19:56:44.975473 7f9d7d6006c0 Manual compaction at level-1 from '!items!240HPtZsgZQERFMF' @ 72057594037927935 : 1 .. '!items!zRQ5WnPI483CKm9Q' @ 0 : 0; will stop at (end)
|
BIN
pack_ref/arts-et-divertissements/MANIFEST-000010
Normal file
BIN
pack_ref/arts-et-divertissements/MANIFEST-000010
Normal file
Binary file not shown.
BIN
pack_ref/competences-creatures/000005.ldb
Normal file
BIN
pack_ref/competences-creatures/000005.ldb
Normal file
Binary file not shown.
0
pack_ref/competences-creatures/000011.log
Normal file
0
pack_ref/competences-creatures/000011.log
Normal file
1
pack_ref/competences-creatures/CURRENT
Normal file
1
pack_ref/competences-creatures/CURRENT
Normal file
@ -0,0 +1 @@
|
|||||||
|
MANIFEST-000010
|
0
pack_ref/competences-creatures/LOCK
Normal file
0
pack_ref/competences-creatures/LOCK
Normal file
3
pack_ref/competences-creatures/LOG
Normal file
3
pack_ref/competences-creatures/LOG
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
2024/11/10-18:39:00.493027 7fed63e006c0 Recovering log #8
|
||||||
|
2024/11/10-18:39:00.503119 7fed63e006c0 Delete type=3 #6
|
||||||
|
2024/11/10-18:39:00.503242 7fed63e006c0 Delete type=0 #8
|
8
pack_ref/competences-creatures/LOG.old
Normal file
8
pack_ref/competences-creatures/LOG.old
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
2024/11/08-19:40:32.670029 7f9d7ea006c0 Recovering log #4
|
||||||
|
2024/11/08-19:40:32.734322 7f9d7ea006c0 Delete type=3 #2
|
||||||
|
2024/11/08-19:40:32.734474 7f9d7ea006c0 Delete type=0 #4
|
||||||
|
2024/11/08-19:56:44.968549 7f9d7d6006c0 Level-0 table #9: started
|
||||||
|
2024/11/08-19:56:44.968601 7f9d7d6006c0 Level-0 table #9: 0 bytes OK
|
||||||
|
2024/11/08-19:56:44.975299 7f9d7d6006c0 Delete type=0 #7
|
||||||
|
2024/11/08-19:56:44.975466 7f9d7d6006c0 Manual compaction at level-0 from '!items!0zRL8bOpCXNQnIR4' @ 72057594037927935 : 1 .. '!items!yDHZfK4RmwQW4YaW' @ 0 : 0; will stop at (end)
|
||||||
|
2024/11/08-19:56:44.975488 7f9d7d6006c0 Manual compaction at level-1 from '!items!0zRL8bOpCXNQnIR4' @ 72057594037927935 : 1 .. '!items!yDHZfK4RmwQW4YaW' @ 0 : 0; will stop at (end)
|
BIN
pack_ref/competences-creatures/MANIFEST-000010
Normal file
BIN
pack_ref/competences-creatures/MANIFEST-000010
Normal file
Binary file not shown.
BIN
pack_ref/competences-entites/000005.ldb
Normal file
BIN
pack_ref/competences-entites/000005.ldb
Normal file
Binary file not shown.
0
pack_ref/competences-entites/000011.log
Normal file
0
pack_ref/competences-entites/000011.log
Normal file
1
pack_ref/competences-entites/CURRENT
Normal file
1
pack_ref/competences-entites/CURRENT
Normal file
@ -0,0 +1 @@
|
|||||||
|
MANIFEST-000010
|
0
pack_ref/competences-entites/LOCK
Normal file
0
pack_ref/competences-entites/LOCK
Normal file
3
pack_ref/competences-entites/LOG
Normal file
3
pack_ref/competences-entites/LOG
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
2024/11/10-18:39:00.509122 7fed634006c0 Recovering log #8
|
||||||
|
2024/11/10-18:39:00.519320 7fed634006c0 Delete type=3 #6
|
||||||
|
2024/11/10-18:39:00.519377 7fed634006c0 Delete type=0 #8
|
8
pack_ref/competences-entites/LOG.old
Normal file
8
pack_ref/competences-entites/LOG.old
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
2024/11/08-19:40:32.738419 7f9d7f4006c0 Recovering log #4
|
||||||
|
2024/11/08-19:40:32.795459 7f9d7f4006c0 Delete type=3 #2
|
||||||
|
2024/11/08-19:40:32.795589 7f9d7f4006c0 Delete type=0 #4
|
||||||
|
2024/11/08-19:56:44.996588 7f9d7d6006c0 Level-0 table #9: started
|
||||||
|
2024/11/08-19:56:44.996618 7f9d7d6006c0 Level-0 table #9: 0 bytes OK
|
||||||
|
2024/11/08-19:56:45.003008 7f9d7d6006c0 Delete type=0 #7
|
||||||
|
2024/11/08-19:56:45.003203 7f9d7d6006c0 Manual compaction at level-0 from '!items!0Ms9iKxqigNNpZEx' @ 72057594037927935 : 1 .. '!items!wDHR5UHWq568lfGa' @ 0 : 0; will stop at (end)
|
||||||
|
2024/11/08-19:56:45.003226 7f9d7d6006c0 Manual compaction at level-1 from '!items!0Ms9iKxqigNNpZEx' @ 72057594037927935 : 1 .. '!items!wDHR5UHWq568lfGa' @ 0 : 0; will stop at (end)
|
BIN
pack_ref/competences-entites/MANIFEST-000010
Normal file
BIN
pack_ref/competences-entites/MANIFEST-000010
Normal file
Binary file not shown.
BIN
pack_ref/competences/000005.ldb
Normal file
BIN
pack_ref/competences/000005.ldb
Normal file
Binary file not shown.
0
pack_ref/competences/000011.log
Normal file
0
pack_ref/competences/000011.log
Normal file
1
pack_ref/competences/CURRENT
Normal file
1
pack_ref/competences/CURRENT
Normal file
@ -0,0 +1 @@
|
|||||||
|
MANIFEST-000010
|
0
pack_ref/competences/LOCK
Normal file
0
pack_ref/competences/LOCK
Normal file
3
pack_ref/competences/LOG
Normal file
3
pack_ref/competences/LOG
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
2024/11/10-18:39:00.471288 7fed63e006c0 Recovering log #8
|
||||||
|
2024/11/10-18:39:00.481737 7fed63e006c0 Delete type=3 #6
|
||||||
|
2024/11/10-18:39:00.481786 7fed63e006c0 Delete type=0 #8
|
8
pack_ref/competences/LOG.old
Normal file
8
pack_ref/competences/LOG.old
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
2024/11/08-19:40:32.544114 7f9d7e0006c0 Recovering log #4
|
||||||
|
2024/11/08-19:40:32.600711 7f9d7e0006c0 Delete type=3 #2
|
||||||
|
2024/11/08-19:40:32.600809 7f9d7e0006c0 Delete type=0 #4
|
||||||
|
2024/11/08-19:56:44.962085 7f9d7d6006c0 Level-0 table #9: started
|
||||||
|
2024/11/08-19:56:44.962125 7f9d7d6006c0 Level-0 table #9: 0 bytes OK
|
||||||
|
2024/11/08-19:56:44.968340 7f9d7d6006c0 Delete type=0 #7
|
||||||
|
2024/11/08-19:56:44.975455 7f9d7d6006c0 Manual compaction at level-0 from '!items!2JLK5e97WbTM5WxX' @ 72057594037927935 : 1 .. '!items!zyNYa3hYtrOcF2jA' @ 0 : 0; will stop at (end)
|
||||||
|
2024/11/08-19:56:44.975495 7f9d7d6006c0 Manual compaction at level-1 from '!items!2JLK5e97WbTM5WxX' @ 72057594037927935 : 1 .. '!items!zyNYa3hYtrOcF2jA' @ 0 : 0; will stop at (end)
|
BIN
pack_ref/competences/MANIFEST-000010
Normal file
BIN
pack_ref/competences/MANIFEST-000010
Normal file
Binary file not shown.
BIN
pack_ref/entites-de-cauchemar/000005.ldb
Normal file
BIN
pack_ref/entites-de-cauchemar/000005.ldb
Normal file
Binary file not shown.
0
pack_ref/entites-de-cauchemar/000011.log
Normal file
0
pack_ref/entites-de-cauchemar/000011.log
Normal file
1
pack_ref/entites-de-cauchemar/CURRENT
Normal file
1
pack_ref/entites-de-cauchemar/CURRENT
Normal file
@ -0,0 +1 @@
|
|||||||
|
MANIFEST-000010
|
0
pack_ref/entites-de-cauchemar/LOCK
Normal file
0
pack_ref/entites-de-cauchemar/LOCK
Normal file
3
pack_ref/entites-de-cauchemar/LOG
Normal file
3
pack_ref/entites-de-cauchemar/LOG
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
2024/11/10-18:39:00.523722 7fed690006c0 Recovering log #8
|
||||||
|
2024/11/10-18:39:00.533930 7fed690006c0 Delete type=3 #6
|
||||||
|
2024/11/10-18:39:00.533977 7fed690006c0 Delete type=0 #8
|
8
pack_ref/entites-de-cauchemar/LOG.old
Normal file
8
pack_ref/entites-de-cauchemar/LOG.old
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
2024/11/08-19:40:34.274388 7f9d7f4006c0 Recovering log #4
|
||||||
|
2024/11/08-19:40:34.331636 7f9d7f4006c0 Delete type=3 #2
|
||||||
|
2024/11/08-19:40:34.331841 7f9d7f4006c0 Delete type=0 #4
|
||||||
|
2024/11/08-19:56:45.135878 7f9d7d6006c0 Level-0 table #9: started
|
||||||
|
2024/11/08-19:56:45.135910 7f9d7d6006c0 Level-0 table #9: 0 bytes OK
|
||||||
|
2024/11/08-19:56:45.142458 7f9d7d6006c0 Delete type=0 #7
|
||||||
|
2024/11/08-19:56:45.142680 7f9d7d6006c0 Manual compaction at level-0 from '!actors!47YUryMgpq1UnLuB' @ 72057594037927935 : 1 .. '!actors.items!xngqS9HtwWOLf3Vo.iwfr7ekbLFzDCayP' @ 0 : 0; will stop at (end)
|
||||||
|
2024/11/08-19:56:45.142706 7f9d7d6006c0 Manual compaction at level-1 from '!actors!47YUryMgpq1UnLuB' @ 72057594037927935 : 1 .. '!actors.items!xngqS9HtwWOLf3Vo.iwfr7ekbLFzDCayP' @ 0 : 0; will stop at (end)
|
BIN
pack_ref/entites-de-cauchemar/MANIFEST-000010
Normal file
BIN
pack_ref/entites-de-cauchemar/MANIFEST-000010
Normal file
Binary file not shown.
@ -64,8 +64,8 @@
|
|||||||
{"_id":"MGvyXFQJpv6nNynl","name":"Masse lourde","type":"arme","img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/masse_lourde.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.MGvyXFQJpv6nNynl"}},"system":{"description":"","descriptionmj":"","equipe":false,"encombrement":3,"quantite":1,"qualite":0,"cout":4,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Rare","frequence":6},{"milieu":"Villes","rarete":"Frequente","frequence":18}],"resistance":10,"categorie_parade":"","dommages":"3/4","penetration":0,"force":"12/11","competence":"Masse à 1 main","lancer":"","tir":"","portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"magique":false,"ecaille_efficacite":0,"resistance_magique":0,"rapide":false,"deuxmains":true,"unemain":true,"initpremierround":"masse"},"ownership":{"default":0,"Q4cUvqxCxMoTJXDL":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
{"_id":"MGvyXFQJpv6nNynl","name":"Masse lourde","type":"arme","img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/masse_lourde.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.MGvyXFQJpv6nNynl"}},"system":{"description":"","descriptionmj":"","equipe":false,"encombrement":3,"quantite":1,"qualite":0,"cout":4,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Rare","frequence":6},{"milieu":"Villes","rarete":"Frequente","frequence":18}],"resistance":10,"categorie_parade":"","dommages":"3/4","penetration":0,"force":"12/11","competence":"Masse à 1 main","lancer":"","tir":"","portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"magique":false,"ecaille_efficacite":0,"resistance_magique":0,"rapide":false,"deuxmains":true,"unemain":true,"initpremierround":"masse"},"ownership":{"default":0,"Q4cUvqxCxMoTJXDL":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
||||||
{"_id":"MQxgfYTEQEUhG116","name":"Épée bâtarde","type":"arme","img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_batarde.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.MQxgfYTEQEUhG116"}},"system":{"description":"<p>Comme son nom l’indique, c’est une <em>bâtarde </em>de l'épée longue et de l'épée sorde, à la fois longue et large, pouvant s’utiliser à une ou deux mains.</p>","descriptionmj":"","equipe":false,"encombrement":3,"quantite":1,"qualite":0,"cout":30,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Rarissime","frequence":2},{"milieu":"Villes","rarete":"Rare","frequence":6}],"resistance":14,"categorie_parade":"epees-lourdes","dommages":"4/5","penetration":0,"force":"13/12","competence":"Epée à 1 main","lancer":"","tir":"","portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"magique":false,"ecaille_efficacite":null,"resistance_magique":null,"rapide":false,"deuxmains":true,"unemain":true,"initpremierround":"epeebatarde"},"ownership":{"default":0,"Q4cUvqxCxMoTJXDL":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
{"_id":"MQxgfYTEQEUhG116","name":"Épée bâtarde","type":"arme","img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/epee_batarde.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.MQxgfYTEQEUhG116"}},"system":{"description":"<p>Comme son nom l’indique, c’est une <em>bâtarde </em>de l'épée longue et de l'épée sorde, à la fois longue et large, pouvant s’utiliser à une ou deux mains.</p>","descriptionmj":"","equipe":false,"encombrement":3,"quantite":1,"qualite":0,"cout":30,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Rarissime","frequence":2},{"milieu":"Villes","rarete":"Rare","frequence":6}],"resistance":14,"categorie_parade":"epees-lourdes","dommages":"4/5","penetration":0,"force":"13/12","competence":"Epée à 1 main","lancer":"","tir":"","portee_courte":0,"portee_moyenne":0,"portee_extreme":0,"magique":false,"ecaille_efficacite":null,"resistance_magique":null,"rapide":false,"deuxmains":true,"unemain":true,"initpremierround":"epeebatarde"},"ownership":{"default":0,"Q4cUvqxCxMoTJXDL":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
||||||
{"_id":"Mbh2M8JS1Rf0vxEX","name":"Harpe","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/harpe.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.Mbh2M8JS1Rf0vxEX"}},"system":{"description":"","descriptionmj":"","encombrement":1,"quantite":1,"qualite":0,"cout":5,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Rarissime","frequence":2},{"milieu":"Villes","rarete":"Rare","frequence":6}],"equipe":false,"resistance":1},"ownership":{"default":0,"rYShh2P1DNavdoBD":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
{"_id":"Mbh2M8JS1Rf0vxEX","name":"Harpe","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/harpe.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.Mbh2M8JS1Rf0vxEX"}},"system":{"description":"","descriptionmj":"","encombrement":1,"quantite":1,"qualite":0,"cout":5,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Rarissime","frequence":2},{"milieu":"Villes","rarete":"Rare","frequence":6}],"equipe":false,"resistance":1},"ownership":{"default":0,"rYShh2P1DNavdoBD":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
||||||
{"_id":"NCp2kdTKmQGyAh1U","name":"Dague","type":"arme","img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/dague.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sheetClass":"","sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.NCp2kdTKmQGyAh1U"}},"system":{"description":"","descriptionmj":"","equipe":false,"encombrement":0.5,"quantite":1,"qualite":0,"cout":3,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Frequente","frequence":18},{"milieu":"Villes","rarete":"Frequente","frequence":18}],"resistance":8,"categorie_parade":"dagues","dommages":"1","penetration":0,"force":"7","competence":"Dague","lancer":"Dague de jet","tir":"","portee_courte":3,"portee_moyenne":8,"portee_extreme":15,"magique":false,"ecaille_efficacite":null,"resistance_magique":null,"rapide":true,"deuxmains":false,"unemain":true,"initpremierround":"dague"},"ownership":{"default":0,"Q4cUvqxCxMoTJXDL":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
|
||||||
{"_id":"NCp2kdTKmJVdFuit","name":"Dague mêlée","type":"arme","img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/dague.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sheetClass":"","sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.NCp2kdTKmQGyAh1U"}},"system":{"description":"","descriptionmj":"","equipe":false,"encombrement":0.5,"quantite":1,"qualite":0,"cout":3,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Frequente","frequence":18},{"milieu":"Villes","rarete":"Frequente","frequence":18}],"resistance":8,"categorie_parade":"dagues","dommages":"1","penetration":0,"force":"7","competence":"Dague","lancer":"Dague de jet","tir":"","portee_courte":3,"portee_moyenne":8,"portee_extreme":15,"magique":false,"ecaille_efficacite":null,"resistance_magique":null,"rapide":true,"deuxmains":false,"unemain":true,"initpremierround":"dague"},"ownership":{"default":0,"Q4cUvqxCxMoTJXDL":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
{"_id":"NCp2kdTKmJVdFuit","name":"Dague mêlée","type":"arme","img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/dague.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sheetClass":"","sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.NCp2kdTKmQGyAh1U"}},"system":{"description":"","descriptionmj":"","equipe":false,"encombrement":0.5,"quantite":1,"qualite":0,"cout":3,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Frequente","frequence":18},{"milieu":"Villes","rarete":"Frequente","frequence":18}],"resistance":8,"categorie_parade":"dagues","dommages":"1","penetration":0,"force":"7","competence":"Dague","lancer":"Dague de jet","tir":"","portee_courte":3,"portee_moyenne":8,"portee_extreme":15,"magique":false,"ecaille_efficacite":null,"resistance_magique":null,"rapide":true,"deuxmains":false,"unemain":true,"initpremierround":"dague"},"ownership":{"default":0,"Q4cUvqxCxMoTJXDL":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
||||||
|
{"_id":"NCp2kdTKmQGyAh1U","name":"Dague","type":"arme","img":"systems/foundryvtt-reve-de-dragon/icons/armes_armures/dague.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sheetClass":"","sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.NCp2kdTKmQGyAh1U"}},"system":{"description":"","descriptionmj":"","equipe":false,"encombrement":0.5,"quantite":1,"qualite":0,"cout":3,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Frequente","frequence":18},{"milieu":"Villes","rarete":"Frequente","frequence":18}],"resistance":8,"categorie_parade":"dagues","dommages":"1","penetration":0,"force":"7","competence":"Dague","lancer":"Dague de jet","tir":"","portee_courte":3,"portee_moyenne":8,"portee_extreme":15,"magique":false,"ecaille_efficacite":null,"resistance_magique":null,"rapide":true,"deuxmains":false,"unemain":true,"initpremierround":"dague"},"ownership":{"default":0,"Q4cUvqxCxMoTJXDL":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
||||||
{"_id":"NNLhxjFsoJVdFuit","name":"Bouteille de verre (1 litre)","type":"conteneur","img":"systems/foundryvtt-reve-de-dragon/icons/objets/bouteille_verre.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.NNLhxjFsoJVdFuit"}},"system":{"description":"","descriptionmj":"","encombrement":0.2,"quantite":1,"qualite":0,"cout":0.7,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Rare","frequence":6},{"milieu":"Villes","rarete":"Frequente","frequence":18}],"contenu":[],"capacite":0.5,"equipe":false},"ownership":{"default":0,"rYShh2P1DNavdoBD":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
{"_id":"NNLhxjFsoJVdFuit","name":"Bouteille de verre (1 litre)","type":"conteneur","img":"systems/foundryvtt-reve-de-dragon/icons/objets/bouteille_verre.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.NNLhxjFsoJVdFuit"}},"system":{"description":"","descriptionmj":"","encombrement":0.2,"quantite":1,"qualite":0,"cout":0.7,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Rare","frequence":6},{"milieu":"Villes","rarete":"Frequente","frequence":18}],"contenu":[],"capacite":0.5,"equipe":false},"ownership":{"default":0,"rYShh2P1DNavdoBD":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
||||||
{"_id":"OXFFRZOqlhZDJas3","name":"Béret de velours","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/beret_velours.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.OXFFRZOqlhZDJas3"}},"system":{"description":"","descriptionmj":"","encombrement":0.05,"quantite":1,"qualite":0,"cout":3,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Rare","frequence":6},{"milieu":"Villes","rarete":"Frequente","frequence":18}],"equipe":false,"resistance":1},"ownership":{"default":0,"rYShh2P1DNavdoBD":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
{"_id":"OXFFRZOqlhZDJas3","name":"Béret de velours","type":"objet","img":"systems/foundryvtt-reve-de-dragon/icons/objets/beret_velours.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.OXFFRZOqlhZDJas3"}},"system":{"description":"","descriptionmj":"","encombrement":0.05,"quantite":1,"qualite":0,"cout":3,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Rare","frequence":6},{"milieu":"Villes","rarete":"Frequente","frequence":18}],"equipe":false,"resistance":1},"ownership":{"default":0,"rYShh2P1DNavdoBD":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
||||||
{"_id":"OYWzXiQUFsjU5AF2","name":"Perles de Bjwal","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/perles_bjwal.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.OYWzXiQUFsjU5AF2"}},"system":{"description":"<p>Petits granulés translucides.</p>","descriptionmj":"","encombrement":0.1,"quantite":1,"qualite":0,"cout":1,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Rarissime","frequence":2},{"milieu":"Villes","rarete":"Rare","frequence":6}],"temporel":{"debut":{"indexDate":-1,"indexMinute":0},"fin":{"indexDate":-1,"indexMinute":0}},"rarete":"","categorie":"Remede","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"soinherbe":"","soinherbebonus":0},"ownership":{"default":0,"rYShh2P1DNavdoBD":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
{"_id":"OYWzXiQUFsjU5AF2","name":"Perles de Bjwal","type":"potion","img":"systems/foundryvtt-reve-de-dragon/icons/objets/perles_bjwal.webp","effects":[],"folder":null,"sort":0,"flags":{"core":{"sourceId":"Compendium.foundryvtt-reve-de-dragon.equipement.OYWzXiQUFsjU5AF2"}},"system":{"description":"<p>Petits granulés translucides.</p>","descriptionmj":"","encombrement":0.1,"quantite":1,"qualite":0,"cout":1,"milieu":"","environnement":[{"milieu":"Villages","rarete":"Rarissime","frequence":2},{"milieu":"Villes","rarete":"Rare","frequence":6}],"temporel":{"debut":{"indexDate":-1,"indexMinute":0},"fin":{"indexDate":-1,"indexMinute":0}},"rarete":"","categorie":"Remede","herbe":"","herbebrins":0,"herbebonus":0,"reposalchimique":false,"pr":0,"prpermanent":false,"prdate":0,"soinherbe":"","soinherbebonus":0},"ownership":{"default":0,"rYShh2P1DNavdoBD":3},"_stats":{"systemId":"foundryvtt-reve-de-dragon","systemVersion":"10.6.15","coreVersion":"10.291","createdTime":1668808206023,"modifiedTime":1676074487966,"lastModifiedBy":"Hp9ImM4o9YRTSdfu"}}
|
BIN
pack_ref/equipement/000005.ldb
Normal file
BIN
pack_ref/equipement/000005.ldb
Normal file
Binary file not shown.
0
pack_ref/equipement/000011.log
Normal file
0
pack_ref/equipement/000011.log
Normal file
1
pack_ref/equipement/CURRENT
Normal file
1
pack_ref/equipement/CURRENT
Normal file
@ -0,0 +1 @@
|
|||||||
|
MANIFEST-000010
|
0
pack_ref/equipement/LOCK
Normal file
0
pack_ref/equipement/LOCK
Normal file
3
pack_ref/equipement/LOG
Normal file
3
pack_ref/equipement/LOG
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
2024/11/10-18:39:00.544474 7fed690006c0 Recovering log #8
|
||||||
|
2024/11/10-18:39:00.555177 7fed690006c0 Delete type=3 #6
|
||||||
|
2024/11/10-18:39:00.555255 7fed690006c0 Delete type=0 #8
|
8
pack_ref/equipement/LOG.old
Normal file
8
pack_ref/equipement/LOG.old
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
2024/11/08-19:40:33.076530 7f9d7e0006c0 Recovering log #4
|
||||||
|
2024/11/08-19:40:33.128870 7f9d7e0006c0 Delete type=3 #2
|
||||||
|
2024/11/08-19:40:33.128972 7f9d7e0006c0 Delete type=0 #4
|
||||||
|
2024/11/08-19:56:45.003377 7f9d7d6006c0 Level-0 table #9: started
|
||||||
|
2024/11/08-19:56:45.003402 7f9d7d6006c0 Level-0 table #9: 0 bytes OK
|
||||||
|
2024/11/08-19:56:45.009778 7f9d7d6006c0 Delete type=0 #7
|
||||||
|
2024/11/08-19:56:45.031135 7f9d7d6006c0 Manual compaction at level-0 from '!items!0I30m9qcYJk6UR6o' @ 72057594037927935 : 1 .. '!items!zlDa1vwmls6Uf4pt' @ 0 : 0; will stop at (end)
|
||||||
|
2024/11/08-19:56:45.031185 7f9d7d6006c0 Manual compaction at level-1 from '!items!0I30m9qcYJk6UR6o' @ 72057594037927935 : 1 .. '!items!zlDa1vwmls6Uf4pt' @ 0 : 0; will stop at (end)
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user