Minor fixes
This commit is contained in:
@ -198,7 +198,7 @@ export class PegasusActor extends Actor {
|
||||
await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async activatePower(itemId) {
|
||||
let item = this.data.items.find(item => item.id == itemId);
|
||||
@ -488,16 +488,16 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getShieldDice() {
|
||||
let shields = this.data.items.filter( item => item.type == "shield" && item.data.data.equipped)
|
||||
let shields = this.data.items.filter(item => item.type == "shield" && item.data.data.equipped)
|
||||
let def = 0
|
||||
for ( let sh of shields) {
|
||||
for (let sh of shields) {
|
||||
def += sh.data.data.level
|
||||
}
|
||||
return def
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
rollPool(statKey, useShield=false) {
|
||||
rollPool(statKey, useShield = false) {
|
||||
let stat = this.getStat(statKey);
|
||||
if (stat) {
|
||||
let rollData = this.getCommonRollData()
|
||||
@ -505,7 +505,7 @@ export class PegasusActor extends Actor {
|
||||
rollData.specList = this.getRelevantSpec(statKey)
|
||||
rollData.selectedSpec = "0"
|
||||
rollData.stat = stat;
|
||||
|
||||
|
||||
if (useShield) {
|
||||
rollData.otherDicesLevel = this.getShieldDice()
|
||||
}
|
||||
@ -572,9 +572,9 @@ export class PegasusActor extends Actor {
|
||||
rollData.mode = "MR"
|
||||
rollData.stat = mr
|
||||
rollData.activePerks = duplicate(this.getActivePerks()),
|
||||
rollData.specList = this.getRelevantSpec('mr'),
|
||||
rollData.specList = this.getRelevantSpec('mr'),
|
||||
|
||||
this.startRoll(rollData);
|
||||
this.startRoll(rollData);
|
||||
} else {
|
||||
ui.notifications.warn("MR not found !");
|
||||
}
|
||||
@ -596,7 +596,7 @@ export class PegasusActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
async computeNRGHealth() {
|
||||
if ( this.isOwner || game.user.isGM) {
|
||||
if (this.isOwner || game.user.isGM) {
|
||||
let updates = {}
|
||||
let phyDiceValue = PegasusUtility.getDiceValue(this.data.data.statistics.phy.value) + this.data.data.secondary.health.bonus + this.data.data.statistics.phy.mod;
|
||||
if (phyDiceValue != this.data.data.secondary.health.max) {
|
||||
@ -608,18 +608,18 @@ export class PegasusActor extends Actor {
|
||||
updates['data.secondary.delirium.max'] = mndDiceValue
|
||||
updates['data.secondary.delirium.value'] = mndDiceValue
|
||||
}
|
||||
let stlDiceValue = PegasusUtility.getDiceValue(this.data.data.statistics.stl.value) + this.data.data.secondary.stealthhealth.bonus + this.data.data.statistics.stl.mod;
|
||||
let stlDiceValue = PegasusUtility.getDiceValue(this.data.data.statistics.stl.value) + this.data.data.secondary.stealthhealth.bonus + this.data.data.statistics.stl.mod;
|
||||
if (stlDiceValue != this.data.data.secondary.stealthhealth.max) {
|
||||
updates['data.secondary.stealthhealth.max'] = stlDiceValue
|
||||
updates['data.secondary.stealthhealth.value'] = stlDiceValue
|
||||
updates['data.secondary.stealthhealth.max'] = stlDiceValue
|
||||
updates['data.secondary.stealthhealth.value'] = stlDiceValue
|
||||
}
|
||||
|
||||
|
||||
let socDiceValue = PegasusUtility.getDiceValue(this.data.data.statistics.soc.value) + this.data.data.secondary.socialhealth.bonus + this.data.data.statistics.soc.mod;
|
||||
if (socDiceValue != this.data.data.secondary.socialhealth.max) {
|
||||
updates['data.secondary.socialhealth.max'] = socDiceValue
|
||||
updates['data.secondary.socialhealth.value'] = socDiceValue
|
||||
updates['data.secondary.socialhealth.value'] = socDiceValue
|
||||
}
|
||||
|
||||
|
||||
let nrgValue = PegasusUtility.getDiceValue(this.data.data.statistics.foc.value) + this.data.data.nrg.mod + this.data.data.statistics.foc.mod;
|
||||
if (nrgValue != this.data.data.nrg.max) {
|
||||
updates['data.nrg.max'] = nrgValue
|
||||
@ -627,21 +627,27 @@ export class PegasusActor extends Actor {
|
||||
}
|
||||
nrgValue = PegasusUtility.getDiceValue(this.data.data.statistics.foc.value) + this.data.data.statistics.foc.mod;
|
||||
if (nrgValue != this.data.data.combat.stunthreshold) {
|
||||
updates['data.combat.stunthreshold'] = nrgValue
|
||||
updates['data.combat.stunthreshold'] = nrgValue
|
||||
}
|
||||
|
||||
|
||||
let momentum = PegasusUtility.getDiceValue(this.data.data.statistics.foc.value) + this.data.data.statistics.foc.mod
|
||||
if (momentum != this.data.data.momentum.max) {
|
||||
updates['data.momentum.value'] = momentum
|
||||
updates['data.momentum.max'] = momentum
|
||||
updates['data.momentum.value'] = 0
|
||||
updates['data.momentum.max'] = momentum
|
||||
}
|
||||
|
||||
let mrLevel = (this.data.data.statistics.agi.value + this.data.data.statistics.str.value) - this.data.data.statistics.phy.value
|
||||
mrLevel = (mrLevel < 1) ? 1 : mrLevel;
|
||||
if (mrLevel != this.data.data.mr.value) {
|
||||
updates['data.mr.value'] = mrLevel
|
||||
}
|
||||
|
||||
let race = this.getRace()
|
||||
if ( race && race.name && (race.name != this.data.data.biodata.racename) ) {
|
||||
if (race && race.name && (race.name != this.data.data.biodata.racename)) {
|
||||
updates['data.biodata.racename'] = race.name
|
||||
}
|
||||
let role = this.getRole()
|
||||
if ( role && role.name && (role.name != this.data.data.biodata.rolename)) {
|
||||
if (role && role.name && (role.name != this.data.data.biodata.rolename)) {
|
||||
updates['data.biodata.rolename'] = role.name
|
||||
}
|
||||
//console.log("UPD", updates, this.data.data.biodata)
|
||||
@ -844,7 +850,7 @@ export class PegasusActor extends Actor {
|
||||
rollData.specList = this.getRelevantSpec(weapon.data.statistic)
|
||||
rollData.activePerks = duplicate(this.getActivePerks())
|
||||
if (damage) {
|
||||
rollData.stat = this.getStat(weapon.data.damagestatistic)
|
||||
rollData.stat = this.getStat(weapon.data.damagestatistic)
|
||||
rollData.isDamage = true;
|
||||
rollData.otherDicesLevel = weapon.data.damage
|
||||
} else {
|
||||
@ -878,5 +884,5 @@ export class PegasusActor extends Actor {
|
||||
ui.notifications.warn("Power not found !", powerId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user