Fix: boutons de parade

Utiliser la compétence associée à l'arme pour la parade
This commit is contained in:
Vincent Vandemeulebrouck 2021-12-08 23:22:37 +01:00
parent 427613c606
commit d87b1affd0
2 changed files with 11 additions and 7 deletions

View File

@ -631,7 +631,7 @@ export class RdDCombat {
switch (button) { switch (button) {
case '#particuliere-attaque': return await this.choixParticuliere(attackerRoll, event.currentTarget.attributes['data-mode'].value); case '#particuliere-attaque': return await this.choixParticuliere(attackerRoll, event.currentTarget.attributes['data-mode'].value);
case '#parer-button': return this.parade(attackerRoll, armeParadeId, competence); case '#parer-button': return this.parade(attackerRoll, armeParadeId);
case '#esquiver-button': return this.esquive(attackerRoll, compId, competence); case '#esquiver-button': return this.esquive(attackerRoll, compId, competence);
case '#encaisser-button': return this.encaisser(attackerRoll, defenderTokenId); case '#encaisser-button': return this.encaisser(attackerRoll, defenderTokenId);
case '#echec-total-attaque': return this._onEchecTotal(attackerRoll); case '#echec-total-attaque': return this._onEchecTotal(attackerRoll);
@ -1016,10 +1016,15 @@ export class RdDCombat {
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async parade(attackerRoll, armeParadeId, competence) { async parade(attackerRoll, armeParadeId) {
let arme = this.defender.getArmeParade(armeParadeId); const arme = this.defender.getArmeParade(armeParadeId);
console.log("RdDCombat.parade >>>", attackerRoll, armeParadeId, arme); console.log("RdDCombat.parade >>>", attackerRoll, armeParadeId, arme);
const competence = Misc.templateData(arme)?.competence;
if (competence == undefined)
{
console.error("Pas de compétence de parade associée à ", arme) ;
return;
}
let rollData = this._prepareParade(attackerRoll, arme, competence); let rollData = this._prepareParade(attackerRoll, arme, competence);
@ -1052,7 +1057,7 @@ export class RdDCombat {
competence: Misc.data(this.defender.getCompetence(competenceParade)), competence: Misc.data(this.defender.getCompetence(competenceParade)),
arme: armeParade, arme: armeParade,
surprise: this.defender.getSurprise(true), surprise: this.defender.getSurprise(true),
needParadeSignificative: ReglesOptionelles.isUsing('categorieParade') && RdDItemArme.needParadeSignificative(armeAttaque, armeParade), needParadeSignificative: ReglesOptionelles.isUsing('categorieParade') && RdDItemArme.needParadeSignificative(attackerRoll.arme, armeParade),
needResist: RdDItemArme.needArmeResist(attackerRoll.arme, armeParade), needResist: RdDItemArme.needArmeResist(attackerRoll.arme, armeParade),
carac: Misc.templateData(this.defender).carac, carac: Misc.templateData(this.defender).carac,
show: {} show: {}
@ -1185,7 +1190,6 @@ export class RdDCombat {
const dmg = attackerRoll.dmg.dmgArme + attackerRoll.dmg.dmgActor; const dmg = attackerRoll.dmg.dmgArme + attackerRoll.dmg.dmgActor;
let arme = defenderRoll.arme; let arme = defenderRoll.arme;
let msg = "";
let resistance = Misc.toInt(arme.data.resistance); let resistance = Misc.toInt(arme.data.resistance);
if (arme.data.magique) { if (arme.data.magique) {
defenderRoll.show.deteriorationArme = 'resiste'; // Par défaut defenderRoll.show.deteriorationArme = 'resiste'; // Par défaut

View File

@ -17,7 +17,7 @@
</div> </div>
</span> </span>
{{#if ajustements.facteurSign.used}} {{#if ajustements.facteurSign.used}}
<span> <br><span>
Significative requise <span class="rdd-diviseur">&times;{{{ajustements.facteurSign.label}}}</span>! Significative requise <span class="rdd-diviseur">&times;{{{ajustements.facteurSign.label}}}</span>!
</span> </span>
{{/if}} {{/if}}