@@ -42,6 +42,12 @@ export default class CthulhuEternalActor extends Actor {
|
||||
type: CONST.CHAT_MESSAGE_STYLES.OTHER
|
||||
})
|
||||
}
|
||||
if (this.type === "protagonist" && changed?.system?.hp !== undefined) {
|
||||
const hp = this.system.hp
|
||||
this.toggleStatusEffect("dead", { active: !!hp.dead })
|
||||
this.toggleStatusEffect("unconscious", { active: !!hp.unconscious && !hp.dead })
|
||||
this.toggleStatusEffect("stun", { active: !!hp.stunned && !hp.dead && !hp.unconscious })
|
||||
}
|
||||
return super._onUpdate(changed, options, userId)
|
||||
}
|
||||
|
||||
@@ -69,7 +75,6 @@ export default class CthulhuEternalActor extends Actor {
|
||||
if (this.system.hp.value !== hp) {
|
||||
this.update({ "system.hp.value": hp })
|
||||
}
|
||||
console.log("Applying wounds", { woundData, totalArmor, effectiveWounds })
|
||||
// Chat message for GM only
|
||||
if (game.user.isGM) {
|
||||
let armorText = totalArmor > 0 ? game.i18n.format("CTHULHUETERNAL.Chat.armorAbsorbed", { armor: totalArmor }) : game.i18n.localize("CTHULHUETERNAL.Chat.noArmor")
|
||||
|
||||
Reference in New Issue
Block a user