diff --git a/changelog.md b/changelog.md index 037737e1..50e13b3a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,8 @@ # 12.0 +## 12.0.40 - Les mains d'Astrobazzarh +- correction des attaques particulières en combat +- correction de message sur les min/max liés aux modificateurs de races (s'applique uniquement sur la taille) + ## 12.0.39 - Les mains d'Astrobazzarh - les armes à 1 ou 2 mains fonctionnent dans les liens de jets de dés - commande `/jet` pour poster une demande de jet de dés diff --git a/module/item/race.js b/module/item/race.js index e1685185..327ce850 100644 --- a/module/item/race.js +++ b/module/item/race.js @@ -19,10 +19,12 @@ export class RdDItemRace extends RdDItem { return false } } - const carac = RdDCarac.carac(code) - if (race.isMax(actor, code, value - 1)) { - ui.notifications.warn(`${value} est supérieure au maximum de ${carac.label}`) - return false + if (code == LIST_CARAC_PERSONNAGE.taille.code) { + const carac = RdDCarac.carac(code) + if (race.isMax(actor, code, value - 1)) { + ui.notifications.warn(`${value} est supérieure au maximum de ${carac.label}`) + return false + } } return true } @@ -59,7 +61,8 @@ export class RdDItemRace extends RdDItem { if (code == LIST_CARAC_PERSONNAGE.force.code) { return value >= this.getForceMax(actor) } - const max = foundry.utils.getProperty(this, path) ?? -1 + const pathMax = path.replace(".value", ".max"); + const max = foundry.utils.getProperty(this, pathMax) ?? -1 return (max > 0 && value >= max) } diff --git a/module/rdd-combat.js b/module/rdd-combat.js index 231bf7a8..a5193169 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -776,7 +776,7 @@ export class RdDCombat { if (this.attacker.isCreatureEntite()) { RdDItemCompetenceCreature.setRollDataCreature(rollData); - } + } else if (arme) { // Usual competence rollData.arme = RdDItemArme.armeUneOuDeuxMains(arme, RdDItemCompetence.isArmeUneMain(competence)); @@ -832,7 +832,10 @@ export class RdDCombat { /* -------------------------------------------- */ async _onAttaqueNormale(attackerRoll) { - if (!RdDCombat.isReussite(attackerRoll) || RdDCombat.isParticuliere(attackerRoll)) { + if (!RdDCombat.isReussite(attackerRoll)) { + return + } + if (RdDCombat.isParticuliere(attackerRoll) && attackerRoll.particuliere == undefined) { return } console.log("RdDCombat.onAttaqueNormale >>>", attackerRoll); @@ -849,7 +852,7 @@ export class RdDCombat { return; } - if (this.target) { + if (this.defender) { await this._sendMessageDefense(attackerRoll, defenderRoll); } } @@ -999,7 +1002,7 @@ export class RdDCombat { this.removeChatMessageActionsPasseArme(rollData.passeArme); rollData.particuliere = choix; - await this._onAttaqueNormale(rollData); + await this._onAttaqueNormale(rollData) } /* -------------------------------------------- */ diff --git a/templates/chat-demande-attaque-particuliere.hbs b/templates/chat-demande-attaque-particuliere.hbs index 031d4c5b..f9ec0fbb 100644 --- a/templates/chat-demande-attaque-particuliere.hbs +++ b/templates/chat-demande-attaque-particuliere.hbs @@ -2,19 +2,22 @@

{{alias}} réussit une attaque particulière!

{{#if isForce}}
- + Attaquer en Force {{/if}} {{#if isRapide}}
- + Attaquer en Rapidité {{/if}} {{#if isFinesse}}
- + Attaquer en Finesse {{/if}}