Update fight options
All checks were successful
Release Creation / build (release) Successful in 53s
All checks were successful
Release Creation / build (release) Successful in 53s
This commit is contained in:
@@ -25,7 +25,7 @@ export default class CthulhuEternalActor extends Actor {
|
||||
}
|
||||
data.items.push({
|
||||
type: "weapon", img: "systems/fvtt-cthulhu-eternal/assets/icons/icon_fist.svg",
|
||||
name: game.i18n.localize("CTHULHUETERNAL.Label.Unarmed"), system: { damage: "1d4-1", weaponType: "unarmed" }
|
||||
name: game.i18n.localize("CTHULHUETERNAL.Label.Unarmed"), system: { damage: "1d4-1", weaponType: "unarmed", applyDamageBonus: true }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -45,8 +45,15 @@ export default class CthulhuEternalActor extends Actor {
|
||||
return super._onUpdate(changed, options, userId)
|
||||
}
|
||||
|
||||
setLastDefenseRoll(rollData) {
|
||||
this.setFlag("fvtt-cthulhu-eternal", "last-defense-roll", rollData)
|
||||
}
|
||||
|
||||
getLastDefenseRoll() {
|
||||
return this.getFlag("fvtt-cthulhu-eternal", "last-defense-roll")
|
||||
}
|
||||
|
||||
applyWounds(woundData) {
|
||||
let updates = {}
|
||||
// Get available armor
|
||||
let armors = this.items.filter(i => i.type === "armor" && i.system.equipped)
|
||||
let totalArmor = 0
|
||||
@@ -60,10 +67,7 @@ export default class CthulhuEternalActor extends Actor {
|
||||
// Apply armor reduction
|
||||
let hp = Math.max(this.system.hp.value - effectiveWounds, 0)
|
||||
if (this.system.hp.value !== hp) {
|
||||
updates[`system.hp.value`] = hp
|
||||
}
|
||||
if (Object.keys(updates).length > 0) {
|
||||
this.update(updates)
|
||||
this.update({ "system.hp.value": hp })
|
||||
}
|
||||
// Chat message for GM only
|
||||
if (game.user.isGM) {
|
||||
|
||||
Reference in New Issue
Block a user