mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
parent
09aafd0999
commit
ab7ea03d84
2 changed files with 11 additions and 9 deletions
|
|
@ -164,14 +164,13 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
getRollData(data = {}) {
|
getRollData(data = {}) {
|
||||||
const actorData = this.actor ? this.actor.getRollData(false) : {};
|
const actorData = this.actor ? this.actor.getRollData(false) : {};
|
||||||
|
|
||||||
return {
|
actorData.result = data.roll?.total ?? 1;
|
||||||
...actorData,
|
actorData.scale = data.costs?.length // Right now only return the first scalable cost.
|
||||||
result: data.roll?.total ?? 1,
|
|
||||||
scale: data.costs?.length // Right now only return the first scalable cost.
|
|
||||||
? (data.costs.find(c => c.scalable)?.total ?? 1)
|
? (data.costs.find(c => c.scalable)?.total ?? 1)
|
||||||
: 1,
|
: 1;
|
||||||
roll: {}
|
actorData.roll = {};
|
||||||
};
|
|
||||||
|
return actorData;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -539,7 +539,10 @@ export default class DhpActor extends Actor {
|
||||||
|
|
||||||
/**@inheritdoc */
|
/**@inheritdoc */
|
||||||
getRollData() {
|
getRollData() {
|
||||||
const rollData = super.getRollData().clone();
|
const rollData = foundry.utils.deepClone(super.getRollData());
|
||||||
|
/* system gets repeated infinately which causes issues when trying to use the data for document creation */
|
||||||
|
delete rollData.system;
|
||||||
|
|
||||||
rollData.name = this.name;
|
rollData.name = this.name;
|
||||||
rollData.system = this.system.getRollData();
|
rollData.system = this.system.getRollData();
|
||||||
rollData.prof = this.system.proficiency ?? 1;
|
rollData.prof = this.system.proficiency ?? 1;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue