Fix #81
This commit is contained in:
@@ -1344,6 +1344,7 @@ export class PegasusActor extends Actor {
|
||||
this.getTraumaState()
|
||||
this.cleanupPerksIfTrauma()
|
||||
this.parseStatEffects()
|
||||
this.parseStatusEffects()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1365,6 +1366,37 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
parseStatusEffects() {
|
||||
let effects = this.items.filter(effect => effect.type == "effect" && effect.system.affectstatus && (Number(effect.system.effectlevel) > 0) )
|
||||
for (let statusKey in this.system.secondary) {
|
||||
let status = duplicate(this.system.secondary[statusKey])
|
||||
let bonus = 0
|
||||
for (let effect of effects) {
|
||||
if ( effect.system.affectedstatus && effect.system.affectedstatus == statusKey) {
|
||||
bonus += Number(effect.system.effectlevel)
|
||||
}
|
||||
}
|
||||
if ( bonus != status.bonus) {
|
||||
status.bonus = bonus
|
||||
this.update( { [`system.secondary.${statusKey}`]: status} )
|
||||
}
|
||||
}
|
||||
|
||||
let nrg = duplicate(this.system.nrg)
|
||||
let bonus = 0
|
||||
for (let effect of effects) {
|
||||
if ( effect.system.affectedstatus && effect.system.affectedstatus == "nrg") {
|
||||
bonus += Number(effect.system.effectlevel)
|
||||
}
|
||||
}
|
||||
if ( bonus != nrg.mod) {
|
||||
nrg.mod = bonus
|
||||
this.update( { [`system.nrg`]: nrg} )
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async modStat(key, inc = 1) {
|
||||
let stat = duplicate(this.system.statistics[key])
|
||||
|
Reference in New Issue
Block a user