forked from public/bol
Fix and +/-
This commit is contained in:
@ -761,7 +761,7 @@ export class BoLActor extends Actor {
|
||||
async displayRecuperation() {
|
||||
let previousHP = this.getFlag("world", "vitalite-before-combat")
|
||||
let lossHP = previousHP.value - this.system.resources.hp.value
|
||||
console.log(">>>>> RECUP INFO", previousHP, this.system.resources.hp.value)
|
||||
//console.log(">>>>> RECUP INFO", previousHP, this.system.resources.hp.value)
|
||||
if (previousHP && lossHP > 0 && this.system.resources.hp.value > 0) {
|
||||
let msg = await ChatMessage.create({
|
||||
alias: this.name,
|
||||
@ -770,7 +770,7 @@ export class BoLActor extends Actor {
|
||||
name: this.name,
|
||||
actorId: this.id,
|
||||
lossHP: lossHP,
|
||||
recupHP: Math.floor(lossHP / 2)
|
||||
recupHP: Math.ceil(lossHP / 2)
|
||||
})
|
||||
})
|
||||
}
|
||||
@ -861,6 +861,11 @@ export class BoLActor extends Actor {
|
||||
await this.update({ 'system.resources.hero.value': newHeroP });
|
||||
}
|
||||
|
||||
/*-------------------------------------------- */
|
||||
incDecResources(target, value) {
|
||||
let newValue = this.system.resources[target].value + value
|
||||
this.update({ [`system.resources.${target}.value`]: newValue })
|
||||
}
|
||||
/*-------------------------------------------- */
|
||||
async sufferDamage(damage) {
|
||||
let newHP = this.system.resources.hp.value - damage
|
||||
|
Reference in New Issue
Block a user