forked from public/foundryvtt-reve-de-dragon
Récupération de rêve optionnelle
This commit is contained in:
@ -700,11 +700,20 @@ export class RdDActor extends RdDBaseActor {
|
||||
jetsReve.push(-1);
|
||||
return 'eveil';
|
||||
}
|
||||
else {
|
||||
if (!ReglesOptionnelles.isUsing("recuperation-reve")) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(this.name),
|
||||
content: `Pas de récupération de rêve (${reve} points ignorés)`
|
||||
});
|
||||
jetsReve.push(0);
|
||||
}
|
||||
else {
|
||||
await this.reveActuelIncDec(reve);
|
||||
jetsReve.push(reve);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 'dort';
|
||||
}
|
||||
|
||||
@ -1353,7 +1362,7 @@ export class RdDActor extends RdDBaseActor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async reveActuelIncDec(value) {
|
||||
let reve = Math.max(this.system.reve.reve.value + value, 0);
|
||||
const reve = Math.max(this.system.reve.reve.value + value, 0);
|
||||
await this.update({ "system.reve.reve.value": reve });
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user