Sync bol for module releas

This commit is contained in:
2025-01-25 20:12:00 +01:00
parent 89bcc47b11
commit 69b34669b0
92 changed files with 317 additions and 310 deletions

View File

@ -22,6 +22,9 @@ export class BoLActor extends Actor {
if (data.type == 'encounter') {
data.system = { resources: { hero : { max : 0, value: 0 } } }
}
if (data.type == 'character') {
data.system = { resources: { hp : { max : 10, value: 10 } } }
}
if (data.type == 'horde') {
let weapon = {
@ -161,12 +164,16 @@ export class BoLActor extends Actor {
let newVitality = 10 + this.system.attributes.vigor.value + this.system.resources.hp.bonus
if (this.system.resources.hp.max != newVitality) {
let actor = this
setTimeout(function () { actor.update({ 'system.resources.hp.max': newVitality }) }, 800)
let newHP = foundry.utils.duplicate(this.system.resources.hp)
newHP.max = newVitality
setTimeout(function () { actor.update({ 'system.resources.hp': newHP }) }, 800)
}
let newPower = 10 + this.system.attributes.mind.value + this.system.resources.power.bonus
if (this.system.resources.power.max != newPower) {
let maxPower = 10 + this.system.attributes.mind.value + this.system.resources.power.bonus
if (this.system.resources.power.max != maxPower) {
let actor = this
setTimeout(function () { actor.update({ 'system.resources.power.max': newPower }) }, 800)
let newPower = foundry.utils.duplicate(this.system.resources.power)
newPower.max = maxPower
setTimeout(function () { actor.update({ 'system.resources.power': newPower }) }, 800)
}
}
}