Meilleure gestion blessures graves vs endurance
This commit is contained in:
@ -221,16 +221,33 @@ export class RdDCalendrier extends Application {
|
||||
this.updateDisplay();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
checkMaladie( periode) {
|
||||
for (let actor of game.actors) {
|
||||
if (actor.type == 'personnage') {
|
||||
let maladies = actor.filterItems( item => (item.type == 'maladie' || item.type == 'poison') && item.data.periodicite.toLowerCase().includes(periode) );
|
||||
for (let maladie of maladies) {
|
||||
ChatMessage.create({ content: `${actor.name} souffre de ${maladie.name} (${maladie.type}): vérifiez que les effets ne se sont pas aggravés !` });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async incrementTime(minutes = 0) {
|
||||
this.calendrier.minutesRelative += minutes;
|
||||
this.checkMaladie("round");
|
||||
this.checkMaladie("minute");
|
||||
if (this.calendrier.minutesRelative >= RDD_MINUTES_PAR_HEURES) {
|
||||
this.calendrier.minutesRelative -= RDD_MINUTES_PAR_HEURES;
|
||||
this.calendrier.heureRdD += 1;
|
||||
}
|
||||
this.checkMaladie("heure");
|
||||
}
|
||||
if (this.calendrier.heureRdD >= RDD_HEURES_PAR_JOUR) {
|
||||
this.calendrier.heureRdD -= RDD_HEURES_PAR_JOUR;
|
||||
await this.incrementerJour();
|
||||
this.checkMaladie("heure");
|
||||
this.checkMaladie("jour");
|
||||
}
|
||||
game.settings.set("foundryvtt-reve-de-dragon", "calendrier", duplicate(this.calendrier));
|
||||
// Notification aux joueurs
|
||||
|
Reference in New Issue
Block a user