From bf66db92c362cea61d1168b6a833d93bffc63dc8 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Thu, 14 Jan 2021 20:51:32 +0100 Subject: [PATCH] Verification FORCE vs TAILLE+4 --- module/actor.js | 9 ++++++++- system.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/module/actor.js b/module/actor.js index f8ff181b..c4c6574f 100644 --- a/module/actor.js +++ b/module/actor.js @@ -557,6 +557,13 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async updateCarac(caracName, caracValue) { let caracpath = "data.carac." + caracName + ".value" + if (caracName == "force") { + let caracTaille = this.data.data.carac.taille; + if ( Number(caracValue) > Number(caracTaille.value)+4) { + ui.notifications.warn("Votre FORCE doit être au maximum de TAILLE+4"); + return; + } + } if (caracName == "reve") { if (caracValue > Misc.toInt(this.data.data.reve.seuil.value)) { this.setPointsDeSeuil(caracValue); @@ -1474,7 +1481,7 @@ export class RdDActor extends Actor { let newCompetence = duplicate(competence); newCompetence.data.niveau += 1; newCompetence.data.xp = newXP; - + let xpData = { alias: this.name, competence: newCompetence.name, diff --git a/system.json b/system.json index a9778227..1fd18dc5 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.20", + "version": "1.2.21", "manifestPlusVersion": "1.0.0", "minimumCoreVersion": "0.7.5", "compatibleCoreVersion": "0.7.8",