forked from public/bol
Fix and +/-
This commit is contained in:
@ -60,6 +60,12 @@ export class BoLActorSheet extends ActorSheet {
|
||||
const li = $(ev.currentTarget).parents(".item");
|
||||
this.actor.spendAlchemyPoint(li.data("itemId"), 1)
|
||||
})
|
||||
html.find(".inc-dec-btns-resource").click((ev) => {
|
||||
const dataset = ev.currentTarget.dataset;
|
||||
const target = dataset.target
|
||||
const incr = parseInt(dataset.incr)
|
||||
this.actor.incDecResources(target, incr)
|
||||
})
|
||||
|
||||
// Incr./Decr. career ranks
|
||||
html.find(".inc-dec-btns").click((ev) => {
|
||||
|
@ -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