|
|
|
@ -1349,21 +1349,21 @@ export class PegasusActor extends Actor {
|
|
|
|
|
|
|
|
|
|
if (this.isOwner || game.user.isGM) {
|
|
|
|
|
let updates = {}
|
|
|
|
|
let phyDiceValue = PegasusUtility.getDiceValue(this.system.statistics.phy.value) + this.system.secondary.health.bonus + this.system.statistics.phy.mod;
|
|
|
|
|
let phyDiceValue = PegasusUtility.getDiceValue(this.system.statistics.phy.value) + this.system.secondary.health.bonus + this.system.statistics.phy.mod + PegasusUtility.getDiceValue(this.system.phy.bonuseffect);
|
|
|
|
|
if (phyDiceValue != this.system.secondary.health.max) {
|
|
|
|
|
updates['system.secondary.health.max'] = phyDiceValue
|
|
|
|
|
}
|
|
|
|
|
if (this.computeValue) {
|
|
|
|
|
updates['system.secondary.health.value'] = phyDiceValue
|
|
|
|
|
}
|
|
|
|
|
let mndDiceValue = PegasusUtility.getDiceValue(this.system.statistics.mnd.value) + this.system.secondary.delirium.bonus + this.system.statistics.mnd.mod;
|
|
|
|
|
let mndDiceValue = PegasusUtility.getDiceValue(this.system.statistics.mnd.value) + this.system.secondary.delirium.bonus + this.system.statistics.mnd.mod + PegasusUtility.getDiceValue(this.system.mnd.bonuseffect);
|
|
|
|
|
if (mndDiceValue != this.system.secondary.delirium.max) {
|
|
|
|
|
updates['system.secondary.delirium.max'] = mndDiceValue
|
|
|
|
|
}
|
|
|
|
|
if (this.computeValue) {
|
|
|
|
|
updates['system.secondary.delirium.value'] = mndDiceValue
|
|
|
|
|
}
|
|
|
|
|
let stlDiceValue = PegasusUtility.getDiceValue(this.system.statistics.stl.value) + this.system.secondary.stealthhealth.bonus + this.system.statistics.stl.mod;
|
|
|
|
|
let stlDiceValue = PegasusUtility.getDiceValue(this.system.statistics.stl.value) + this.system.secondary.stealthhealth.bonus + this.system.statistics.stl.mod + PegasusUtility.getDiceValue(this.system.stl.bonuseffect);
|
|
|
|
|
if (stlDiceValue != this.system.secondary.stealthhealth.max) {
|
|
|
|
|
updates['system.secondary.stealthhealth.max'] = stlDiceValue
|
|
|
|
|
}
|
|
|
|
@ -1371,7 +1371,7 @@ export class PegasusActor extends Actor {
|
|
|
|
|
updates['system.secondary.stealthhealth.value'] = stlDiceValue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let socDiceValue = PegasusUtility.getDiceValue(this.system.statistics.soc.value) + this.system.secondary.socialhealth.bonus + this.system.statistics.soc.mod;
|
|
|
|
|
let socDiceValue = PegasusUtility.getDiceValue(this.system.statistics.soc.value) + this.system.secondary.socialhealth.bonus + this.system.statistics.soc.mod + PegasusUtility.getDiceValue(this.system.soc.bonuseffect);
|
|
|
|
|
if (socDiceValue != this.system.secondary.socialhealth.max) {
|
|
|
|
|
updates['system.secondary.socialhealth.max'] = socDiceValue
|
|
|
|
|
}
|
|
|
|
@ -1379,7 +1379,7 @@ export class PegasusActor extends Actor {
|
|
|
|
|
updates['system.secondary.socialhealth.value'] = socDiceValue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let nrgValue = PegasusUtility.getDiceValue(this.system.statistics.foc.value) + this.system.nrg.mod + this.system.statistics.foc.mod
|
|
|
|
|
let nrgValue = PegasusUtility.getDiceValue(this.system.statistics.foc.value) + this.system.nrg.mod + this.system.statistics.foc.mod + PegasusUtility.getDiceValue(this.system.foc.bonuseffect)
|
|
|
|
|
if (nrgValue != this.system.nrg.absolutemax) {
|
|
|
|
|
updates['system.nrg.absolutemax'] = nrgValue
|
|
|
|
|
}
|
|
|
|
@ -1459,17 +1459,27 @@ export class PegasusActor extends Actor {
|
|
|
|
|
if (this.system.biodata.noautobonus) { // If we are in "no-bonus mode
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let effects = this.items.filter(effect => effect.type == "effect" && effect.system.genre == "positive" && effect.system.statdice)
|
|
|
|
|
let effectsPlus = this.items.filter(effect => effect.type == "effect" && effect.system.genre == "positive" && effect.system.statdice)
|
|
|
|
|
let effectsMinus = this.items.filter(effect => effect.type == "effect" && effect.system.genre == "negative" && effect.system.reducedicevalue)
|
|
|
|
|
for (let statKey in this.system.statistics) {
|
|
|
|
|
let stat = duplicate(this.system.statistics[statKey])
|
|
|
|
|
let bonus = 0
|
|
|
|
|
for (let effect of effects) {
|
|
|
|
|
for (let effect of effectsPlus) {
|
|
|
|
|
if (effect.system.stataffected == statKey) {
|
|
|
|
|
bonus += Number(effect.system.effectlevel)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (let effect of effectsMinus) {
|
|
|
|
|
if (effect.system.stataffected == statKey) {
|
|
|
|
|
bonus -= Number(effect.system.effectlevel)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (bonus != stat.bonuseffect) {
|
|
|
|
|
stat.bonuseffect = bonus
|
|
|
|
|
if ( stat.bonuseffect + stat.value < 1) {
|
|
|
|
|
stat.value = 1
|
|
|
|
|
stat.bonuseffect = 0
|
|
|
|
|
}
|
|
|
|
|
this.update({ [`system.statistics.${statKey}`]: stat })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1744,7 +1754,7 @@ export class PegasusActor extends Actor {
|
|
|
|
|
let effects = this.items.filter(item => item.type == 'effect')
|
|
|
|
|
for (let effect of effects) {
|
|
|
|
|
effect = duplicate(effect)
|
|
|
|
|
if (!effect.system.hindrance && !effect.system.statdice
|
|
|
|
|
if (!effect.system.hindrance && !effect.system.statdice && !effect.system.reducedicevalue
|
|
|
|
|
&& (effect.system.stataffected != "notapplicable" || effect.system.specaffected.length > 0)
|
|
|
|
|
&& effect.system.stataffected != "special"
|
|
|
|
|
&& effect.system.stataffected != "powerroll"
|
|
|
|
@ -2214,19 +2224,32 @@ export class PegasusActor extends Actor {
|
|
|
|
|
}
|
|
|
|
|
/* -------------------------------------------- */
|
|
|
|
|
processVehicleStatEffects() {
|
|
|
|
|
let effects = this.items.filter(effect => effect.type == "effect" && effect.system.genre == "positive" && effect.system.statdice)
|
|
|
|
|
let effectsPlus = this.items.filter(effect => effect.type == "effect" && effect.system.genre == "positive" && effect.system.statdice)
|
|
|
|
|
let effectsMinus = this.items.filter(effect => effect.type == "effect" && effect.system.genre == "negative" && effect.system.reducedicevalue)
|
|
|
|
|
for (let statKey in this.system.statistics) {
|
|
|
|
|
let stat = duplicate(this.system.statistics[statKey])
|
|
|
|
|
let bonus = 0
|
|
|
|
|
for (let effect of effects) {
|
|
|
|
|
for (let effect of effectsPlus) {
|
|
|
|
|
if (effect.system.stataffected == statKey) {
|
|
|
|
|
bonus += Number(effect.system.effectlevel)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
for (let effect of effectsMinus) {
|
|
|
|
|
if (effect.system.stataffected == statKey) {
|
|
|
|
|
bonus -= Number(effect.system.effectlevel)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (bonus != stat.bonuseffect) {
|
|
|
|
|
stat.bonuseffect = bonus
|
|
|
|
|
if ( stat.bonuseffect + stat.level < 1) {
|
|
|
|
|
stat.level = 1
|
|
|
|
|
stat.bonuseffect = 0
|
|
|
|
|
}
|
|
|
|
|
if (stat.currentlevel > stat.bonuseffect+stat.level) {
|
|
|
|
|
stat.currentlevel = stat.bonuseffect+stat.level
|
|
|
|
|
}
|
|
|
|
|
this.update({ [`system.statistics.${statKey}`]: stat })
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|