Add XP log message

This commit is contained in:
sladecraven 2021-05-21 07:36:59 +02:00
parent a77c285ee4
commit 0136cc1bd4

View File

@ -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);
}
}