From ff8a5d7ba396fe7a1fd25605017e4c7df5801a08 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 5 Sep 2024 23:43:37 +0200 Subject: [PATCH 1/5] Fix tooltip initiative --- changelog.md | 4 ++++ templates/actor/combat.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index b358b54c..a3382c08 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,8 @@ # 12.0 +## 12.0.8 - La quincaillerie d'Astrobazzarh +- Corrections + - le tooltip de l'initiative affiche correctement l'initiative + ## 12.0.7 - La propriété d'Astrobazzarh - correction des opérations faites à la création d'un Item: - la durée des queues/rencontres/souffles diff --git a/templates/actor/combat.html b/templates/actor/combat.html index f9ec0ac2..1e4ba241 100644 --- a/templates/actor/combat.html +++ b/templates/actor/combat.html @@ -25,7 +25,7 @@ {{plusMoins arme.system.niveau}} {{plusMoins arme.system.dommagesReels}} - {{arme.system.initiative}} + {{arme.system.initiative}} {{/each}} {{#each esquives as |esq key|}} -- 2.35.3 From 3b18e0b919faa07d2bcf4ef9b54e5ba708ce2733 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Thu, 5 Sep 2024 23:44:12 +0200 Subject: [PATCH 2/5] =?UTF-8?q?Ajout=20du=20propri=C3=A9taire=20sur=20les?= =?UTF-8?q?=20Items?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + module/item-sheet.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index a3382c08..50d9b931 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 12.0 ## 12.0.8 - La quincaillerie d'Astrobazzarh +- le propriétaire est indiqué dans les feuilles d'équipements/compétences/... - Corrections - le tooltip de l'initiative affiche correctement l'initiative diff --git a/module/item-sheet.js b/module/item-sheet.js index 2bfc34b0..fd8b90e3 100644 --- a/module/item-sheet.js +++ b/module/item-sheet.js @@ -53,7 +53,8 @@ export class RdDItemSheet extends ItemSheet { } get title() { - return `${Misc.typeName('Item', this.item.type)}: ${this.item.name}`; + const owner = (this.item.parent instanceof Actor) ? `(${this.item.parent.name})` : ''; + return `${Misc.typeName('Item', this.item.type)}: ${this.item.name} ${owner}`; } /* -------------------------------------------- */ -- 2.35.3 From a7b20bdd35f195310a400cbc795047cdf438b638 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 6 Sep 2024 00:45:49 +0200 Subject: [PATCH 3/5] =?UTF-8?q?Ecaille=20d'efficacit=C3=A9=20sans=20cible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit L'écaille d'efficacité est prise en compte si on n'utilise pas l'automatisation de combat avec une cible --- changelog.md | 2 ++ module/actor/base-actor-reve.js | 8 ++++---- module/rolldata-ajustements.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/changelog.md b/changelog.md index 50d9b931..997d3178 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,8 @@ # 12.0 ## 12.0.8 - La quincaillerie d'Astrobazzarh - le propriétaire est indiqué dans les feuilles d'équipements/compétences/... +- Ecaille d'efficacité + - l'écaille d'efficacité est prise en compte même si on n'utilise pas le ciblage en combat - Corrections - le tooltip de l'initiative affiche correctement l'initiative diff --git a/module/actor/base-actor-reve.js b/module/actor/base-actor-reve.js index f2a9205c..7938e58a 100644 --- a/module/actor/base-actor-reve.js +++ b/module/actor/base-actor-reve.js @@ -318,10 +318,10 @@ export class RdDBaseActorReve extends RdDBaseActor { } /* -------------------------------------------- */ - async rollCompetence(idOrName, options = { tryTarget: true }) { + async rollCompetence(idOrName, options = { tryTarget: true, arme: undefined }) { RdDEmpoignade.checkEmpoignadeEnCours(this) const competence = this.getCompetence(idOrName); - let rollData = { carac: this.system.carac, competence: competence } + let rollData = { carac: this.system.carac, competence: competence, arme: options.arme } if (competence.type == TYPES.competencecreature) { const arme = RdDItemCompetenceCreature.armeCreature(competence) if (arme && options.tryTarget && Targets.hasTargets()) { @@ -361,7 +361,7 @@ export class RdDBaseActorReve extends RdDBaseActor { * @returns */ rollArme(arme, categorieArme = "competence") { - let compToUse = this.$getCompetenceArme(arme, categorieArme) + const compToUse = this.$getCompetenceArme(arme, categorieArme) if (!RdDItemArme.isArmeUtilisable(arme)) { ui.notifications.warn(`Arme inutilisable: ${arme.name} a une résistance de 0 ou moins`) return @@ -375,7 +375,7 @@ export class RdDBaseActorReve extends RdDBaseActor { title: 'Ne pas utiliser les automatisation de combat', buttonLabel: "Pas d'automatisation", onAction: async () => { - this.rollCompetence(compToUse, { tryTarget: false }) + this.rollCompetence(compToUse, { tryTarget: false, arme: arme }) } }); return diff --git a/module/rolldata-ajustements.js b/module/rolldata-ajustements.js index eb3b3078..d37685b9 100644 --- a/module/rolldata-ajustements.js +++ b/module/rolldata-ajustements.js @@ -111,7 +111,7 @@ export const referenceAjustements = { isVisible: (rollData, actor) => rollData.arme?.system.magique && Number(rollData.arme?.system.ecaille_efficacite) > 0, isUsed: (rollData, actor) => rollData.arme?.system.magique && Number(rollData.arme?.system.ecaille_efficacite) > 0, getLabel: (rollData, actor) => "Ecaille d'Efficacité: ", - getValue: (rollData, actor) => Math.max(Number(rollData.arme?.system.ecaille_efficacite), 0), + getValue: (rollData, actor) => rollData.arme?.system.magique ? Math.max(Number(rollData.arme?.system.ecaille_efficacite), 0) : 0, }, finesse: { isUsed: (rollData, actor) => RdDBonus.isDefenseAttaqueFinesse(rollData), -- 2.35.3 From 427a950954460e838e67a4087ff1b6a31e78d232 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 6 Sep 2024 00:47:32 +0200 Subject: [PATCH 4/5] =?UTF-8?q?L'initiative=20utilise=20l'=C3=A9caille=20d?= =?UTF-8?q?'efficacit=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 2 ++ module/rdd-combat.js | 30 ++++++++++++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/changelog.md b/changelog.md index 997d3178..f830ae20 100644 --- a/changelog.md +++ b/changelog.md @@ -3,7 +3,9 @@ - le propriétaire est indiqué dans les feuilles d'équipements/compétences/... - Ecaille d'efficacité - l'écaille d'efficacité est prise en compte même si on n'utilise pas le ciblage en combat + - l'écaille d'efficacité est prise en compte pour l'initiative - Corrections + - l'état général est pris en compte pour les initiatives - le tooltip de l'initiative affiche correctement l'initiative ## 12.0.7 - La propriété d'Astrobazzarh diff --git a/module/rdd-combat.js b/module/rdd-combat.js index 014f4e7b..66cbe453 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -75,6 +75,12 @@ export class RdDCombatManager extends Combat { } } } + static calculAjustementInit(actor, arme) { + const efficacite = (arme?.system.magique) ? arme.system.ecaille_efficacite : 0 + const etatGeneral = actor.getEtatGeneral() ?? 0 + return efficacite + etatGeneral + + } /************************************************************************************/ async rollInitiative(ids, formula = undefined, messageOptions = {}) { @@ -84,12 +90,14 @@ export class RdDCombatManager extends Combat { // calculate initiative for (let cId = 0; cId < ids.length; cId++) { const combatant = this.combatants.get(ids[cId]); - let rollFormula = formula ?? RdDCombatManager.formuleInitiative(2, 10, 0, 0); + const ajustement = RdDCombatManager.calculAjustementInit(combatant.actor, undefined); + 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, 0); + rollFormula = RdDCombatManager.formuleInitiative(2, competence.system.carac_value, competence.system.niveau, etatGeneral); } } else { const armeCombat = combatant.actor.itemTypes['arme'].find(it => it.system.equipe) @@ -109,9 +117,9 @@ export class RdDCombatManager extends Combat { if (competence && competence.system.defaut_carac) { const carac = combatant.actor.system.carac[competence.system.defaut_carac].value; const niveau = competence.system.niveau; - const bonusEcaille = (armeCombat?.system.magique) ? armeCombat.system.ecaille_efficacite : 0; - //console.log("RollInitiative", competence, carac, niveau, bonusEcaille); - rollFormula = RdDCombatManager.formuleInitiative(2, carac, niveau, bonusEcaille); + + 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`); } @@ -215,13 +223,16 @@ export class RdDCombatManager extends Combat { static $prepareAttaqueArme(infoAttaque) { const comp = infoAttaque.competences.find(c => c.name == infoAttaque.competence); - const attaque = foundry.utils.duplicate(infoAttaque.arme); + const arme = infoAttaque.arme; + const attaque = foundry.utils.duplicate(arme); attaque.action = 'attaque'; attaque.system.competence = infoAttaque.competence; attaque.system.dommagesReels = infoAttaque.dommagesReel; attaque.system.infoMain = infoAttaque.infoMain; attaque.system.niveau = comp.system.niveau; - attaque.system.initiative = RdDCombatManager.calculInitiative(comp.system.niveau, infoAttaque.carac[comp.system.defaut_carac].value); + + const ajustement = (arme?.parent?.getEtatGeneral() ?? 0) + (arme?.system.magique) ? arme.system.ecaille_efficacite : 0; + attaque.system.initiative = RdDCombatManager.calculInitiative(comp.system.niveau, infoAttaque.carac[comp.system.defaut_carac].value, ajustement); return attaque; } @@ -336,7 +347,6 @@ export class RdDCombatManager extends Combat { ui.notifications.warn(`Le combatant ${combatant.name} n'est pas associé à un acteur, impossible de déterminer ses actions de combat!`) return []; } - let initInfo = ""; let initOffset = 0; let caracForInit = 0; @@ -371,9 +381,9 @@ export class RdDCombatManager extends Combat { initOffset = RdDCombatManager._baseInitOffset(compData.system.categorie, action); } - let malus = combatant.actor.getEtatGeneral(); // Prise en compte état général // Cas des créatures et entités vs personnages - let rollFormula = RdDCombatManager.formuleInitiative(initOffset, caracForInit, compNiveau, malus); + 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 game.combat.rollInitiative(combatantId, rollFormula, { initInfo: initInfo }); -- 2.35.3 From 16e40b0ed84a7eec21073229b0ea1afcdb61eedd Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Fri, 6 Sep 2024 00:49:39 +0200 Subject: [PATCH 5/5] 12.0.8 - La quincaillerie d'Astrobazzarh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - le propriétaire est indiqué dans les feuilles d'équipements/ compétences/... - Ecaille d'efficacité - l'écaille d'efficacité est prise en compte même si on n'utilise pas le ciblage en combat - l'écaille d'efficacité est prise en compte pour l'initiative - Corrections - l'état général est pris en compte pour les initiatives - le tooltip de l'initiative affiche correctement l'initiative --- system.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system.json b/system.json index d35e1070..0d611bc6 100644 --- a/system.json +++ b/system.json @@ -1,8 +1,8 @@ { "id": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", - "version": "12.0.7", - "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-12.0.7.zip", + "version": "12.0.8", + "download": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/archive/foundryvtt-reve-de-dragon-12.0.8.zip", "manifest": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/v11/system.json", "changelog": "https://www.uberwald.me/gitea/public/foundryvtt-reve-de-dragon/raw/branch/v11/changelog.md", "compatibility": { -- 2.35.3