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:
@ -183,7 +183,7 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
|
||||
// Equip Inventory Item
|
||||
this.html.find('.item-equip').click(async event => this.actor.equiperObjet(RdDSheetUtility.getItemId(event)))
|
||||
this.html.find('.chance-actuelle').click(async event => this.actor.rollCarac('chance-actuelle'))
|
||||
this.html.find('.roll-chance-actuelle').click(async event => this.actor.rollCarac('chance-actuelle'))
|
||||
|
||||
this.html.find('.button-appel-chance').click(async event => this.actor.rollAppelChance())
|
||||
|
||||
@ -284,6 +284,8 @@ export class RdDActorSheet extends RdDBaseActorSangSheet {
|
||||
|
||||
this.html.find('.ptreve-actuel-plus').click(async event => this.actor.reveActuelIncDec(1))
|
||||
this.html.find('.ptreve-actuel-moins').click(async event => this.actor.reveActuelIncDec(-1))
|
||||
this.html.find('.chance-actuelle-plus').click(async event => this.actor.chanceActuelleIncDec(1))
|
||||
this.html.find('.chance-actuelle-moins').click(async event => this.actor.chanceActuelleIncDec(-1))
|
||||
this.html.find('.fatigue-plus').click(async event => this.actor.santeIncDec("fatigue", 1))
|
||||
this.html.find('.fatigue-moins').click(async event => this.actor.santeIncDec("fatigue", -1))
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -83,6 +83,7 @@ const MAPPING_BASE = [
|
||||
{ column: "protectionarmure", colName: 'Protection', getter: (actor, context) => Mapping.getProtectionArmure(actor, context) },
|
||||
{ column: "malus_armure", getter: (actor, context) => Mapping.getMalusArmure(actor, context) },
|
||||
{ column: "reve_actuel", rollClass: 'roll-reve-actuel', colName: 'Rêve actuel', getter: (actor, context) => actor.system.reve.reve.value },
|
||||
{ column: "chance_actuel", rollClass: 'roll-chance-actuelle', colName: 'Chance actuelle', getter: (actor, context) => actor.system.compteurs.chance.value },
|
||||
{ column: "vie_actuel", rollClass: 'jet-vie', getter: (actor, context) => actor.system.sante.vie.value },
|
||||
{ column: "endurance_actuel", rollClass: 'jet-endurance', getter: (actor, context) => actor.system.sante.endurance.value },
|
||||
{ column: "esquive", getter: (actor, context) => Mapping.getEsquive(context) },
|
||||
|
Reference in New Issue
Block a user