@@ -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")
|
||||
|
||||
@@ -290,12 +290,10 @@ export default class CthulhuEternalRoll extends Roll {
|
||||
let era = game.settings.get("fvtt-cthulhu-eternal", "settings-era")
|
||||
if (era !== options.rollItem.system.settings) {
|
||||
ui.notifications.error(game.i18n.localize("CTHULHUETERNAL.Notifications.WrongEra"))
|
||||
console.log("WP Wrong Era", era, options.rollItem.system.weaponType)
|
||||
return
|
||||
}
|
||||
if (!SYSTEM.WEAPON_SKILL_MAPPING[era]?.[options.rollItem.system.weaponType]) {
|
||||
ui.notifications.error(game.i18n.localize("CTHULHUETERNAL.Notifications.NoWeaponType"))
|
||||
console.log("WP Not found", era, options.rollItem.system.weaponType)
|
||||
return
|
||||
}
|
||||
/*if (!target) {
|
||||
@@ -442,8 +440,6 @@ export default class CthulhuEternalRoll extends Roll {
|
||||
rollData.rollMode = rollContext.visibility
|
||||
|
||||
// Update target score
|
||||
console.log("Rolldata", rollData)
|
||||
|
||||
if (options.rollType === "resource") {
|
||||
rollData.targetScore = options.initialScore * Number(rollContext.multiplier)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user