Fix #101 current level for rolls
This commit is contained in:
parent
45332702dc
commit
f4a8aa7927
@ -912,12 +912,16 @@ export class PegasusActor extends Actor {
|
||||
getStat(statKey) {
|
||||
let stat
|
||||
if (this.type == "character" && statKey == 'mr') {
|
||||
stat = duplicate(this.system.mr);
|
||||
stat = duplicate(this.system.mr)
|
||||
} else {
|
||||
stat = duplicate(this.system.statistics[statKey]);
|
||||
stat = duplicate(this.system.statistics[statKey])
|
||||
}
|
||||
stat.dice = PegasusUtility.getDiceFromLevel(stat.value || stat.level);
|
||||
return stat;
|
||||
if ( stat.currentlevel) {
|
||||
stat.dice = PegasusUtility.getDiceFromLevel(stat.currentlevel)
|
||||
} else {
|
||||
stat.dice = PegasusUtility.getDiceFromLevel(stat.value || stat.level)
|
||||
}
|
||||
return stat
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -1828,8 +1832,12 @@ export class PegasusActor extends Actor {
|
||||
rollData.stat = this.getStat(statKey)
|
||||
if (rollData.stat.value != undefined) {
|
||||
rollData.stat.level = rollData.stat.value // Normalize
|
||||
}
|
||||
rollData.statDicesLevel = rollData.stat.level + rollData.stat.bonuseffect
|
||||
}
|
||||
if (rollData.stat.currentlevel) {
|
||||
rollData.stat.level = rollData.stat.currentlevel
|
||||
rollData.statDicesLevel = rollData.stat.currentlevel
|
||||
}
|
||||
rollData.statMod = rollData.stat.mod
|
||||
if (vehicle) {
|
||||
rollData.vehicle = duplicate(vehicle)
|
||||
@ -2009,7 +2017,7 @@ export class PegasusActor extends Actor {
|
||||
|
||||
/*-------------------------------------------- */
|
||||
rollStat(statKey) {
|
||||
let stat = this.getStat(statKey);
|
||||
let stat = this.getStat(statKey)
|
||||
if (stat) {
|
||||
let rollData = this.getCommonRollData(statKey)
|
||||
rollData.mode = "stat"
|
||||
|
Loading…
Reference in New Issue
Block a user