mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Fix async/await roll postEvaluate (#417)
* Fix async/await roll postEvaluate * Fixed DualityReroll DiceSoNice * Add chatDisplay: false to actors base attack * Add chatDisplay: false to downtime actions * Add Action Type Select item name in header --------- Co-authored-by: WBHarry <williambjrklund@gmail.com>
This commit is contained in:
parent
01f5173aa4
commit
e6bfe08d83
9 changed files with 36 additions and 20 deletions
|
|
@ -166,8 +166,20 @@ export default class DualityRoll extends D20Roll {
|
|||
return modifiers;
|
||||
}
|
||||
|
||||
static async postEvaluate(roll, config = {}) {
|
||||
const data = await super.postEvaluate(roll, config);
|
||||
static async buildEvaluate(roll, config = {}, message = {}) {
|
||||
await super.buildEvaluate(roll, config, message);
|
||||
|
||||
await setDiceSoNiceForDualityRoll(
|
||||
roll,
|
||||
config.roll.advantage.type,
|
||||
config.roll.hope.dice,
|
||||
config.roll.fear.dice,
|
||||
config.roll.advantage.dice
|
||||
);
|
||||
}
|
||||
|
||||
static postEvaluate(roll, config = {}) {
|
||||
const data = super.postEvaluate(roll, config);
|
||||
|
||||
data.hope = {
|
||||
dice: roll.dHope.denomination,
|
||||
|
|
@ -198,14 +210,6 @@ export default class DualityRoll extends D20Roll {
|
|||
if (roll._rallyIndex && roll.data?.parent)
|
||||
roll.data.parent.deleteEmbeddedDocuments('ActiveEffect', [roll._rallyIndex]);
|
||||
|
||||
await setDiceSoNiceForDualityRoll(
|
||||
roll,
|
||||
data.advantage.type,
|
||||
data.hope.dice,
|
||||
data.fear.dice,
|
||||
data.advantage.dice
|
||||
);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
|
@ -226,7 +230,7 @@ export default class DualityRoll extends D20Roll {
|
|||
options: { appearance: {} }
|
||||
};
|
||||
|
||||
const diceSoNicePresets = await getDiceSoNicePresets();
|
||||
const diceSoNicePresets = await getDiceSoNicePresets(`d${term._faces}`, `d${term._faces}`);
|
||||
const type = target.dataset.type;
|
||||
if (diceSoNicePresets[type]) {
|
||||
diceSoNiceRoll.dice[0].options = diceSoNicePresets[type];
|
||||
|
|
@ -237,7 +241,7 @@ export default class DualityRoll extends D20Roll {
|
|||
|
||||
await parsedRoll.evaluate();
|
||||
|
||||
const newRoll = await game.system.api.dice.DualityRoll.postEvaluate(parsedRoll, {
|
||||
const newRoll = game.system.api.dice.DualityRoll.postEvaluate(parsedRoll, {
|
||||
targets: message.system.targets,
|
||||
roll: {
|
||||
advantage: message.system.roll.advantage?.type,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue