Snapshot pre-AE data on actors (closes #178)
This commit is contained in:
parent
d479ef7559
commit
ec6378092f
3 changed files with 28 additions and 13 deletions
|
|
@ -74,7 +74,7 @@ export class PlayerSheetv2 extends GenericActorSheet {
|
|||
/** @type {ActorHandler} */
|
||||
const actor = this.actor;
|
||||
|
||||
ctx.original = actor.toObject().system;
|
||||
ctx.preAE = actor.preAE;
|
||||
ctx.system = actor.system;
|
||||
ctx.flags = actor.flags;
|
||||
ctx.items = this.actor.itemTypes;
|
||||
|
|
@ -93,13 +93,12 @@ export class PlayerSheetv2 extends GenericActorSheet {
|
|||
|
||||
get #statData() {
|
||||
const stats = [];
|
||||
const original = this.actor.toObject().system;
|
||||
const usedDice = new Set(Object.values(original.stats));
|
||||
for (const statName in original.stats) {
|
||||
const usedDice = new Set(Object.values(this.actor.system.stats));
|
||||
for (const statName in this.actor.system.stats) {
|
||||
const stat = {
|
||||
key: statName,
|
||||
name: localizer(`dotdungeon.stat.${statName}`),
|
||||
original: original.stats[statName],
|
||||
original: this.actor.preAE.stats[statName],
|
||||
value: this.actor.system.stats[statName],
|
||||
};
|
||||
|
||||
|
|
@ -114,7 +113,7 @@ export class PlayerSheetv2 extends GenericActorSheet {
|
|||
return {
|
||||
value: die,
|
||||
label: localizer(`dotdungeon.die.${die}`, { stat: statName }),
|
||||
disabled: usedDice.has(die) && original.stats[statName] !== die,
|
||||
disabled: usedDice.has(die) && this.actor.preAE.stats[statName] !== die,
|
||||
};
|
||||
})
|
||||
];
|
||||
|
|
@ -130,9 +129,9 @@ export class PlayerSheetv2 extends GenericActorSheet {
|
|||
key: skill,
|
||||
name: game.i18n.format(`dotdungeon.skills.${skill}`),
|
||||
value,
|
||||
original: original.skills[statName][skill],
|
||||
original: this.actor.preAE.skills[statName][skill],
|
||||
formula: `1` + stat.value + modifierToString(value, { spaces: true }),
|
||||
rollDisabled: value === -1,
|
||||
rollDisabled: this.actor.preAE.skills[statName][skill] === -1,
|
||||
});
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue