From dc67c36b0aca1ec92ee66e42236aa73f2c5e9950 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Tue, 15 Dec 2020 08:40:07 +0100 Subject: [PATCH] =?UTF-8?q?#36=20et=20#70=20:=20corrections=20sur=20XP=20e?= =?UTF-8?q?t=20ajout=20premi=C3=A8re=20version=20des=20taches?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/module/actor.js b/module/actor.js index bfd91b91..85315ada 100644 --- a/module/actor.js +++ b/module/actor.js @@ -1624,22 +1624,15 @@ export class RdDActor extends Actor { let xp = Math.abs(rolled.finalLevel); let xpCarac = Math.floor(xp / 2); // impair: arrondi inférieur en carac - let xpComp; - if (competenceName) { - xpComp = xp - xpCarac; - } - else { - xpComp = 0; - xpCarac = Math.max(xpCarac, 1); - } - + let xpComp = 0; if ( competenceName ) { + xpComp = xp - xpCarac; let competence = duplicate( RdDUtility.findCompetence( this.data.items, competenceName ) ); competence.data.xp += xpComp; await this.updateEmbeddedEntity( "OwnedItem", competence); } else { - xpCarac = 1; // Si pas de competence, le max d'XP en carac est de 1 (cf p. 144) - } + xpCarac = Math.max(xpCarac, 1); + } if ( !carac[caracName].isderivee) { carac[caracName].xp += xpCarac; await this.update( {"data.carac": carac } );