forked from public/foundryvtt-reve-de-dragon
Chance actuelle sur feuille simplifiée
- Affichages boutons +/- - Jet de chance actuelle - Correction de la détermination de chance actuelle parfois vide/undefined
This commit is contained in:
@ -95,11 +95,14 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
isHautRevant() { return this.system.attributs.hautrevant.value != "" }
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getAgilite() { return this.system.carac.agilite?.value ?? 0 }
|
||||
getChance() { return this.system.carac.chance?.value ?? 0 }
|
||||
getAgilite() { return Misc.toInt(this.system.carac.agilite?.value ?? 0) }
|
||||
getChance() { return Misc.toInt(this.system.carac.chance?.value ?? 0) }
|
||||
|
||||
getReveActuel() { return this.system.reve?.reve?.value ?? this.carac.reve.value ?? 0 }
|
||||
getChanceActuel() { return this.system.compteurs.chance?.value ?? 10 }
|
||||
getReveActuel() { return Misc.toInt(this.system.reve?.reve?.value) ?? this.carac.reve.value ?? 0 }
|
||||
getChanceActuel() {
|
||||
return Number.isNumeric(this.system.compteurs.chance.value) ?
|
||||
Misc.toInt(this.system.compteurs.chance.value) : this.getChance()
|
||||
}
|
||||
getMoralTotal() { return this.system.compteurs.moral?.value ?? 0 }
|
||||
|
||||
getEnduranceMax() { return Math.max(1, Math.max(this.getTaille() + this.getConstitution(), this.getVieMax() + this.getVolonte())) }
|
||||
@ -1080,6 +1083,11 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
await this.update({ "system.reve.reve.value": reve });
|
||||
}
|
||||
|
||||
async chanceActuelleIncDec(value) {
|
||||
const chance = Math.min(this.getChance(), Math.max(this.getChanceActuel() + value, 0));
|
||||
await this.update({ "system.compteurs.chance.value": chance });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async regainPointDeSeuil() {
|
||||
const seuil = Misc.toInt(this.system.reve.seuil.value);
|
||||
@ -2264,12 +2272,6 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async chanceActuelleIncDec(value) {
|
||||
const chance = Math.min(this.getChance(), Math.max(this.getChanceActuel() + value, 0));
|
||||
await this.updateCompteurValue("chance", chance);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async appelDestinee(onSuccess = () => { }, onEchec = () => { }) {
|
||||
let destinee = this.system.compteurs.destinee?.value ?? 0;
|
||||
|
Reference in New Issue
Block a user