From 0136cc1bd4d0ed9c0fe8852b183a33ce1e302028 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Fri, 21 May 2021 07:36:59 +0200 Subject: [PATCH] Add XP log message --- module/actor.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/actor.js b/module/actor.js index 181b1830..1b0a41e1 100644 --- a/module/actor.js +++ b/module/actor.js @@ -837,6 +837,7 @@ export class RdDActor extends Actor { this.checkCompetenceXP(compName, compValue); const update = { _id: comp.id, 'data.xp': compValue }; await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity + this.updateExperienceLog("XP Compétence", compValue, "XP attribués en " + compName); } else { console.log("Competence not found", compName); } @@ -850,6 +851,7 @@ export class RdDActor extends Actor { compValue = compValue ?? 0; const update = { _id: comp.id, 'data.xp_sort': compValue }; await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity + this.updateExperienceLog("XP Sort", compValue, "XP attribués en " + compName); } else { console.log("Competence not found", compName); } @@ -2044,9 +2046,11 @@ export class RdDActor extends Actor { } if (xpResult && xpResult.xpComp > 0 && rollData.competence) { this.checkCompetenceXP(rollData.competence.name); + this.updateExperienceLog("XP", xpResult.xpComp,"XP en compétence "+rollData.competence.name); } if (xpResult && xpResult.xpCarac > 0 && rollData.selectedCarac) { this.checkCaracXP(rollData.selectedCarac.name); + this.updateExperienceLog("XP", xpResult.xpCarac,"XP en carac "+rollData.selectedCarac.name); } }