forked from public/foundryvtt-reve-de-dragon
correction des raffraîchissement lors du sommeil
On peut de nouveau dormir plusieurs heures # Conflicts: # changelog.md
This commit is contained in:
@ -279,30 +279,34 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
/* -------------------------------------------- */
|
||||
async dormirChateauDormant() {
|
||||
if (!ReglesOptionnelles.isUsing("chateau-dormant-gardien") || !this.system.sommeil || this.system.sommeil.nouveaujour) {
|
||||
const message = {
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: ""
|
||||
};
|
||||
|
||||
await this._recuperationSante(message)
|
||||
await this._recupereMoralChateauDormant(message)
|
||||
await this._recupereChance()
|
||||
await this.transformerStress()
|
||||
await this.retourSeuilDeReve(message)
|
||||
await this.setBonusPotionSoin(0)
|
||||
await this.retourSust(message)
|
||||
await this.$perteReveEnchantementsChateauDormants()
|
||||
await this.$suppressionLancementsSort()
|
||||
await RdDCoeur.applyCoeurChateauDormant(this, message)
|
||||
if (message.content != "") {
|
||||
message.content = `A la fin Chateau Dormant, ${message.content}<br>Un nouveau jour se lève`;
|
||||
ChatMessage.create(message);
|
||||
}
|
||||
await this.resetInfoSommeil();
|
||||
await this.$dormirChateauDormant();
|
||||
setTimeout(() => this.sheet.render(), 20)
|
||||
}
|
||||
}
|
||||
|
||||
async $dormirChateauDormant() {
|
||||
const message = {
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: ""
|
||||
};
|
||||
|
||||
await this._recuperationSante(message);
|
||||
await this._recupereMoralChateauDormant(message);
|
||||
await this._recupereChance();
|
||||
await this.transformerStress();
|
||||
await this.retourSeuilDeReve(message);
|
||||
await this.setBonusPotionSoin(0);
|
||||
await this.retourSust(message);
|
||||
await this.$perteReveEnchantementsChateauDormants();
|
||||
await this.$suppressionLancementsSort();
|
||||
await RdDCoeur.applyCoeurChateauDormant(this, message);
|
||||
if (message.content != "") {
|
||||
message.content = `A la fin Chateau Dormant, ${message.content}<br>Un nouveau jour se lève`;
|
||||
ChatMessage.create(message);
|
||||
}
|
||||
await this.resetInfoSommeil();
|
||||
}
|
||||
|
||||
async resetInfoSommeil() {
|
||||
await this.update({
|
||||
'system.sommeil': {
|
||||
@ -457,11 +461,9 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
ChatMessage.create(message);
|
||||
}
|
||||
if (options.chateauDormant) {
|
||||
await this.dormirChateauDormant();
|
||||
}
|
||||
else {
|
||||
setTimeout(() => this.sheet.render(), 20)
|
||||
await this.$dormirChateauDormant();
|
||||
}
|
||||
setTimeout(() => this.sheet.render(), 20)
|
||||
}
|
||||
|
||||
async reveilReveDeDragon(message, heures) {
|
||||
@ -541,7 +543,6 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
max = Math.floor(max / 2);
|
||||
}
|
||||
const manquant = max - this.system.sante.endurance.value;
|
||||
|
||||
if (manquant > 0) {
|
||||
await this.santeIncDec("endurance", manquant);
|
||||
message.content += `Vous récuperez ${manquant} points d'endurance. `;
|
||||
@ -558,7 +559,6 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
}
|
||||
fatigue = Math.max(fatigueMin, this._calculRecuperationSegment(fatigue))
|
||||
await this.update({ 'system.sante.fatigue.value': fatigue });
|
||||
await new Promise(resolve => setTimeout(resolve, 200));
|
||||
if (fatigue == 0) {
|
||||
message.content += "Vous êtes complêtement reposé. ";
|
||||
}
|
||||
|
Reference in New Issue
Block a user