mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Fixes (#1774)
This commit is contained in:
parent
331f1ebf75
commit
7057504a9e
6 changed files with 46 additions and 16 deletions
|
|
@ -1,9 +1,13 @@
|
|||
import DualityDie from './dualityDie.mjs';
|
||||
import HopeDie from './hopeDie.mjs';
|
||||
import FearDie from './fearDie.mjs';
|
||||
import AdvantageDie from './advantageDie.mjs';
|
||||
import DisadvantageDie from './disadvantageDie.mjs';
|
||||
|
||||
export const diceTypes = {
|
||||
DualityDie,
|
||||
HopeDie,
|
||||
FearDie,
|
||||
AdvantageDie,
|
||||
DisadvantageDie
|
||||
};
|
||||
|
|
|
|||
|
|
@ -43,9 +43,10 @@ export default class DualityDie extends foundry.dice.terms.Die {
|
|||
options: { appearance: {} }
|
||||
};
|
||||
|
||||
const preset = await getDiceSoNicePreset(diceSoNice[key], faces);
|
||||
diceSoNiceRoll.dice[0].options.appearance = preset.appearance;
|
||||
diceSoNiceRoll.dice[0].options.modelFile = preset.modelFile;
|
||||
const diceAppearance = await this.getDiceSoNiceAppearance(options.liveRoll.roll);
|
||||
diceSoNiceRoll.dice[0].options.appearance = diceAppearance.appearance;
|
||||
diceSoNiceRoll.dice[0].options.modelFile = diceAppearance.modelFile;
|
||||
diceSoNiceRoll.dice[0].results = diceSoNiceRoll.dice[0].results.filter(x => x.active);
|
||||
|
||||
await game.dice3d.showForRoll(diceSoNiceRoll, game.user, true);
|
||||
} else {
|
||||
|
|
@ -59,4 +60,11 @@ export default class DualityDie extends foundry.dice.terms.Die {
|
|||
this.#updateResources(oldDuality, newDuality, options.liveRoll.actor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Overridden by extending classes HopeDie and FearDie
|
||||
*/
|
||||
async getDiceSoNiceAppearance() {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
9
module/dice/die/fearDie.mjs
Normal file
9
module/dice/die/fearDie.mjs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { getDiceSoNicePresets } from '../../config/generalConfig.mjs';
|
||||
import DualityDie from './dualityDie.mjs';
|
||||
|
||||
export default class FearDie extends DualityDie {
|
||||
async getDiceSoNiceAppearance(roll) {
|
||||
const { fear } = await getDiceSoNicePresets(roll, this.denomination, this.denomination);
|
||||
return fear;
|
||||
}
|
||||
}
|
||||
9
module/dice/die/hopeDie.mjs
Normal file
9
module/dice/die/hopeDie.mjs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import { getDiceSoNicePresets } from '../../config/generalConfig.mjs';
|
||||
import DualityDie from './dualityDie.mjs';
|
||||
|
||||
export default class HopeDie extends DualityDie {
|
||||
async getDiceSoNiceAppearance(roll) {
|
||||
const { hope } = await getDiceSoNicePresets(roll, this.denomination, this.denomination);
|
||||
return hope;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue