Gestion attaques v2 et initiative

This commit is contained in:
2025-09-30 01:33:08 +02:00
parent d0ba1ebf99
commit 7370b633db
44 changed files with 1033 additions and 515 deletions

View File

@@ -10,15 +10,15 @@ export class RdDItemCompetenceCreature extends RdDItem {
static get defaultIcon() { return "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp" }
isAttaque() { return this.getCategorieAttaque() != undefined }
isParade() { return this.system.iscombat && (this.system.categorie_parade ?? '') != '' }
isBouclier() { return this.system.categorie_parade.includes('bouclier') }
attaqueCreature() {
const categorieAttaque = this.getCategorieAttaque()
if (categorieAttaque != undefined) {
const initative = RdDInitiative.calculInitiative(this.system.niveau, this.system.carac_value);
const initative = RdDInitiative.getRollInitiative(this.system.carac_value, this.system.niveau);
const attaque = {
name: this.name,
label: this.name,
action: this.isCompetencePossession() ? 'possession' : 'attaque',
initOnly: false,
arme: new RdDItemArme({
@@ -51,10 +51,6 @@ export class RdDItemCompetenceCreature extends RdDItem {
return undefined;
}
isAttaque() {
return this.getCategorieAttaque() != undefined
}
getCategorieAttaque() {
switch (this.system.categorie) {
case "melee":