From 37cc5a60d83c1e6d18fc42a67ab246588e470f52 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Tue, 15 Dec 2020 02:26:28 +0100 Subject: [PATCH] #70 Minimum d'xp en carac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le min de 1 en carac ne s'applique qu'en l'absence de compétence (p144) --- module/actor.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/module/actor.js b/module/actor.js index dbd479eb..140371c4 100644 --- a/module/actor.js +++ b/module/actor.js @@ -1569,8 +1569,15 @@ export class RdDActor extends Actor { let xp = Math.abs(rolled.finalLevel); let xpCarac = Math.floor(xp / 2); // impair: arrondi inférieur en carac - xpCarac = Math.max(xpCarac, 1); - let xpComp = xp - xpCarac; + + let xpComp; + if (competenceName) { + xpComp = xp - xpCarac; + } + else { + xpComp = 0; + xpCarac = Math.max(xpCarac, 1); + } if ( competenceName ) { let competence = duplicate( RdDUtility.findCompetence( this.data.items, competenceName ) );