Sonné est un StatusEffect
This commit is contained in:
@ -38,6 +38,9 @@ export class RdDCombatManager extends Combat {
|
||||
Hooks.on("getCombatTrackerEntryContext", (html, options) => {
|
||||
RdDCombatManager.pushInitiativeOptions(html, options);
|
||||
});
|
||||
Hooks.on("preDeleteCombat", (combat, html, id) => {
|
||||
combat.onPreDeleteCombat()
|
||||
});
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -48,10 +51,22 @@ export class RdDCombatManager extends Combat {
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
cleanSonne() {
|
||||
async nextRound() {
|
||||
this.cleanItemUse();
|
||||
await this.finDeRound();
|
||||
return await super.nextRound();
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async onPreDeleteCombat() {
|
||||
await this.finDeRound({ terminer: true });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async finDeRound(options = { terminer: false }) {
|
||||
for (let combatant of this.data.combatants) {
|
||||
if (combatant.actor) {
|
||||
combatant.actor.verifierSonneRound(this.current.round);
|
||||
await combatant.actor.finDeRound(options);
|
||||
}
|
||||
else {
|
||||
ui.notifications.warn(`Le combatant ${combatant.name} n'est pas associé à un acteur!`)
|
||||
@ -59,14 +74,6 @@ export class RdDCombatManager extends Combat {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async nextRound() {
|
||||
//console.log('New round !');s
|
||||
this.cleanItemUse();
|
||||
this.cleanSonne();
|
||||
return super.nextRound();
|
||||
}
|
||||
|
||||
/************************************************************************************/
|
||||
async rollInitiative(ids, formula = undefined, messageOptions = {}) {
|
||||
console.log(`${game.data.system.data.title} | Combat.rollInitiative()`, ids, formula, messageOptions);
|
||||
|
Reference in New Issue
Block a user