Fix spec dice

This commit is contained in:
2022-03-14 14:09:26 +01:00
parent 27f81e2e9d
commit 2353912e91
6 changed files with 27 additions and 19 deletions

View File

@ -301,8 +301,8 @@ export class PegasusActor extends Actor {
for(let key of statThreatLevel) { // Init with concerned stats
tl += PegasusUtility.getDiceValue( this.data.data.statistics[key].value )
}
let powers = this.getPowers()
if ( powers && powers.length > 0 ) { // Then add some mental ones of powers
let powers = duplicate( this.getPowers() || [])
if ( powers.length > 0 ) { // Then add some mental ones of powers
tl += PegasusUtility.getDiceValue( this.data.data.statistics.foc.value )
tl += PegasusUtility.getDiceValue( this.data.data.statistics.mnd.value )
}
@ -326,7 +326,10 @@ export class PegasusActor extends Actor {
for(let shield of shields) {
tl += PegasusUtility.getDiceValue(shield.data.level)
}
let abilities = duplicate(this.getAbilities())
for (let ability of abilities) {
tl += ability.data.threatlevel
}
let equipments = this.getEquipmentsOnly()
for (let equip of equipments) {
tl += equip.data.threatlevel
@ -1133,7 +1136,7 @@ export class PegasusActor extends Actor {
rollData.actorId = this.id
rollData.img = this.img
rollData.activePerks = duplicate(this.getActivePerks())
if (statKey) {
rollData.statKey = statKey
rollData.stat = this.getStat(statKey)