Statut inconscient pour les créatures
This commit is contained in:
@@ -2931,15 +2931,6 @@ export class RdDActor extends RdDBaseActorSang {
|
||||
await this.diminuerQuantiteObjet(potion.id, 1, { supprimerSiZero: potion.supprimer });
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async onUpdateActor(update, options, actorId) {
|
||||
const updatedEndurance = update?.system?.sante?.endurance
|
||||
if (updatedEndurance && options.diff) {
|
||||
await this.setEffect(STATUSES.StatusUnconscious, updatedEndurance.value == 0)
|
||||
}
|
||||
await super.onUpdateActor(update, options, actorId)
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async onPreUpdateItem(item, change, options, id) {
|
||||
if (item.isCompetencePersonnage() && item.system.defaut_carac && item.system.xp) {
|
||||
|
||||
@@ -242,6 +242,14 @@ export class RdDBaseActorSang extends RdDBaseActorReve {
|
||||
return Math.max(0, Math.min(maxEndVie, maxEndGraves, maxEndCritiques));
|
||||
}
|
||||
|
||||
async onUpdateActor(update, options, actorId) {
|
||||
const updatedEndurance = update?.system?.sante?.endurance
|
||||
if (updatedEndurance && options.diff) {
|
||||
await this.setEffect(STATUSES.StatusUnconscious, updatedEndurance.value == 0)
|
||||
}
|
||||
await super.onUpdateActor(update, options, actorId)
|
||||
}
|
||||
|
||||
async onCreateItem(item, options, id) {
|
||||
await this.changeItemEffects(item)
|
||||
await super.onCreateItem(item, options, id)
|
||||
|
||||
Reference in New Issue
Block a user