From 41e63cd7e085f1951784592234e21399aef8df59 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sat, 23 Jan 2021 18:04:49 +0100 Subject: [PATCH] Gere recul pour creature --- module/rdd-combat.js | 14 +++++++++++--- system.json | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/module/rdd-combat.js b/module/rdd-combat.js index fff177b3..95827deb 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -794,9 +794,17 @@ export class RdDCombat { if (this._isAttaqueCauseRecul(attackerRoll)) { let impactRecul = this._computeImpactRecul(attackerRoll); - const agilite = this.defender.isEntiteCauchemar() - ? this.defender.data.data.carac.reve.value - : this.defender.data.data.carac.agilite.value; + const agilite = 10; + if ( this.defender.data.data.carac.agilite ) { + agilite = this.defender.data.data.carac.agilite.value; + } else if ( this.defender.data.data.carac.force) { + agilite = this.defender.data.data.carac.force.value; + } else if ( this.defender.isEntiteCauchemar()) { + agilite = this.defender.data.data.carac.reve.value; + } else + ui.notifications.warn("Recul impossible pour cette créature/entité"); + return; + } let rollRecul = await RdDResolutionTable.rollData({ caracValue: 10, finalLevel: impactRecul, showDice: false }); diff --git a/system.json b/system.json index 56881e3e..8c2d166c 100644 --- a/system.json +++ b/system.json @@ -2,7 +2,7 @@ "name": "foundryvtt-reve-de-dragon", "title": "Rêve de Dragon", "description": "Rêve de Dragon RPG for FoundryVTT", - "version": "1.2.36", + "version": "1.2.37", "manifestPlusVersion": "1.0.0", "minimumCoreVersion": "0.7.5", "compatibleCoreVersion": "0.7.8",