Destinée et Appel à la chance exclusifs

This commit is contained in:
Vincent Vandemeulebrouck 2021-01-08 22:55:00 +01:00
parent 02beb4ee37
commit c9cc1de16e
2 changed files with 20 additions and 16 deletions

View File

@ -136,7 +136,6 @@ export class RdDCombat {
}
const defenderTokenId = event.currentTarget.attributes['data-defenderTokenId'].value;
let defenderRoll = this._getDefense(attackerRoll.passeArme);
const armeParadeId = event.currentTarget.attributes['data-armeid']?.value;
switch (button) {
@ -150,13 +149,13 @@ export class RdDCombat {
() => this.attaqueChanceuse(attackerRoll),
() => this._onEchecTotal(attackerRoll));
case '#appel-chance-defense': return this.defender.rollAppelChance(
() => this.defenseChanceuse(attackerRoll, defenderRoll),
() => this.defenseChanceuse(attackerRoll),
() => this.afficherOptionsDefense(attackerRoll, { defenseChance: true }));
case '#appel-destinee-attaque': return this.attacker.appelDestinee(
() => this.attaqueSignificative(attackerRoll),
() => { });
case '#appel-destinee-defense': return this.defender.appelDestinee(
() => this.defenseDestinee(defenderRoll),
() => this.defenseDestinee(attackerRoll),
() => { });
}
}
@ -194,7 +193,7 @@ export class RdDCombat {
}
/* -------------------------------------------- */
defenseChanceuse(attackerRoll, defenderRoll) {
defenseChanceuse(attackerRoll) {
ui.notifications.info("La défense est rejouée grâce à la chance")
attackerRoll.essais.defenseChance = true;
attackerRoll.essais.defense = false;
@ -203,15 +202,21 @@ export class RdDCombat {
}
/* -------------------------------------------- */
defenseDestinee(defenderRoll) {
ui.notifications.info('Défense significative grâce à la destinée')
RdDResolutionTable.forceSignificative(defenderRoll.rolled);
this.removeChatMessageActionsPasseArme(defenderRoll.passeArme);
if (defenderRoll.arme) {
this._onParadeNormale(defenderRoll);
defenseDestinee(attackerRoll) {
let defenderRoll = this._getDefense(attackerRoll.passeArme);
if (defenderRoll) {
ui.notifications.info('Défense significative grâce à la destinée')
RdDResolutionTable.forceSignificative(defenderRoll.rolled);
this.removeChatMessageActionsPasseArme(defenderRoll.passeArme);
if (defenderRoll.arme) {
this._onParadeNormale(defenderRoll);
}
else {
this._onEsquiveNormale(defenderRoll);
}
}
else {
this._onEsquiveNormale(defenderRoll);
ui.notifications.warn("Appel à la destinée impossible, la passe d'armes est déjà terminée!")
}
}

View File

@ -2,7 +2,7 @@
{{#if (eq surprise 'totale')}}
<span><strong>{{defender.name}}</strong> est totalement surpris</span>
{{else if essais.defense}}
<span><strong>{{defender.name}}</strong> doit</span>
<span><strong>{{defender.name}}</strong> doit :</span>
{{else}}
<span><strong>{{defender.name}}</strong> doit se défendre
{{#if (eq surprise 'demi')}} avec une significative {{/if}} :
@ -12,7 +12,6 @@
<br>
{{#unless (eq surprise 'totale')}}
{{#if essais.defense}}
<br>
{{#unless essais.defenseChance}}
{{#if (eq defender.data.type 'personnage')}}
<a class='chat-card-button' id='appel-chance-defense' data-attackerId='{{attackerId}}'
@ -20,15 +19,15 @@
</a>
<br>
{{/if}}
{{/unless}}
{{#if (eq defender.data.type 'personnage')}}
{{#if (eq defender.data.type 'personnage')}}
{{#if (gt defender.data.data.compteurs.destinee.value 0)}}
<a class='chat-card-button' id='appel-destinee-defense' data-attackerId='{{attackerId}}'
data-defenderTokenId='{{defenderTokenId}}'>Utiliser la destinée</a>
</a>
<br>
{{/if}}
{{/if}}
{{/if}}
{{/unless}}
{{else}}
{{#each armes as |arme key|}}
<a class='chat-card-button' id='parer-button' data-attackerId='{{../attackerId}}' data-defenderTokenId='{{../defenderTokenId}}' data-armeid='{{arme._id }}'>