Minor fixes
This commit is contained in:
@ -820,6 +820,15 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
incDecNRG( value) {
|
||||
let nrg = duplicate(this.data.data.nrg)
|
||||
nrg.value += value
|
||||
if (nrg.value >= 0 && nrg.value <= nrg.max) {
|
||||
this.update({ 'data.nrg': nrg })
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async updatePerkStatus(itemId, status) {
|
||||
let item = this.items.get(itemId)
|
||||
@ -871,8 +880,7 @@ export class PegasusActor extends Actor {
|
||||
this.disableWeaverPerk(item)
|
||||
PegasusUtility.createChatWithRollMode(item.name, {
|
||||
content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-ready.html`, { name: this.name, perk: item })
|
||||
});
|
||||
|
||||
})
|
||||
}
|
||||
if (status == "activated") {
|
||||
// Add effects linked to the perk
|
||||
@ -916,6 +924,9 @@ export class PegasusActor extends Actor {
|
||||
nrg.max += Number(item.data.data.features.bonusnrg.value) || 0
|
||||
await this.update({ 'data.nrg': nrg })
|
||||
}
|
||||
PegasusUtility.createChatWithRollMode(item.name, {
|
||||
content: await renderTemplate(`systems/fvtt-pegasus-rpg/templates/chat-perk-activated.html`, { name: this.name, perk: item })
|
||||
})
|
||||
this.enableWeaverPerk(item)
|
||||
}
|
||||
if (updateOK) {
|
||||
@ -1029,8 +1040,7 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
|
||||
|
||||
let moralitythreshold = Number(PegasusUtility.getDiceValue(this.data.data.statistics.foc.value)) + Number(this.data.data.statistics.foc.mod)
|
||||
moralitythreshold = (moralitythreshold < 1) ? 1 : moralitythreshold;
|
||||
let moralitythreshold = - (Number(PegasusUtility.getDiceValue(this.data.data.statistics.foc.value)) + Number(this.data.data.statistics.foc.mod) )
|
||||
if (moralitythreshold != this.data.data.biodata.moralitythreshold) {
|
||||
updates['data.biodata.moralitythreshold'] = moralitythreshold
|
||||
}
|
||||
|
Reference in New Issue
Block a user