Verification FORCE vs TAILLE+4

This commit is contained in:
sladecraven 2021-01-14 20:51:32 +01:00
parent 4f236adbec
commit bf66db92c3
2 changed files with 9 additions and 2 deletions

View File

@ -557,6 +557,13 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */ /* -------------------------------------------- */
async updateCarac(caracName, caracValue) { async updateCarac(caracName, caracValue) {
let caracpath = "data.carac." + caracName + ".value" 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 (caracName == "reve") {
if (caracValue > Misc.toInt(this.data.data.reve.seuil.value)) { if (caracValue > Misc.toInt(this.data.data.reve.seuil.value)) {
this.setPointsDeSeuil(caracValue); this.setPointsDeSeuil(caracValue);
@ -1474,7 +1481,7 @@ export class RdDActor extends Actor {
let newCompetence = duplicate(competence); let newCompetence = duplicate(competence);
newCompetence.data.niveau += 1; newCompetence.data.niveau += 1;
newCompetence.data.xp = newXP; newCompetence.data.xp = newXP;
let xpData = { let xpData = {
alias: this.name, alias: this.name,
competence: newCompetence.name, competence: newCompetence.name,

View File

@ -2,7 +2,7 @@
"name": "foundryvtt-reve-de-dragon", "name": "foundryvtt-reve-de-dragon",
"title": "Rêve de Dragon", "title": "Rêve de Dragon",
"description": "Rêve de Dragon RPG for FoundryVTT", "description": "Rêve de Dragon RPG for FoundryVTT",
"version": "1.2.20", "version": "1.2.21",
"manifestPlusVersion": "1.0.0", "manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "0.7.5", "minimumCoreVersion": "0.7.5",
"compatibleCoreVersion": "0.7.8", "compatibleCoreVersion": "0.7.8",