This commit is contained in:
WBHarry 2025-07-10 13:10:47 +02:00
parent 09f5fbcc28
commit 301a040da2
3 changed files with 4 additions and 23 deletions

View file

@ -1,19 +1,6 @@
import DHAdversaryRoll from './adversaryRoll.mjs'; import DHAdversaryRoll from './adversaryRoll.mjs';
export default class DHDualityRoll extends DHAdversaryRoll { export default class DHDualityRoll extends DHAdversaryRoll {
static defineSchema() {
const fields = foundry.data.fields;
return {
...super.defineSchema(),
result: new fields.SchemaField({
duality: new fields.NumberField({ integer: true }),
label: new fields.StringField(),
total: new fields.NumberField({ integer: true })
})
};
}
get messageTemplate() { get messageTemplate() {
return 'systems/daggerheart/templates/ui/chat/duality-roll.hbs'; return 'systems/daggerheart/templates/ui/chat/duality-roll.hbs';
} }

View file

@ -143,12 +143,6 @@ export default class DualityRoll extends D20Roll {
label: roll.totalLabel label: roll.totalLabel
}; };
const advantageState = setDiceSoNiceForDualityRoll(roll, config.roll.advantage);
config.roll.advantage == this.ADV_MODE.ADVANTAGE
? true
: config.roll.advantage == this.ADV_MODE.DISADVANTAGE
? false
: null;
setDiceSoNiceForDualityRoll(roll, advantageState);
} }
} }

View file

@ -122,14 +122,14 @@ export const getCommandTarget = () => {
return target; return target;
}; };
export const setDiceSoNiceForDualityRoll = (rollResult, advantageState) => { export const setDiceSoNiceForDualityRoll = (rollResult, advantage) => {
const diceSoNicePresets = getDiceSoNicePresets(); const diceSoNicePresets = getDiceSoNicePresets();
rollResult.dice[0].options = { appearance: diceSoNicePresets.hope }; rollResult.dice[0].options = { appearance: diceSoNicePresets.hope };
rollResult.dice[1].options = { appearance: diceSoNicePresets.fear }; //diceSoNicePresets.fear; rollResult.dice[1].options = { appearance: diceSoNicePresets.fear }; //diceSoNicePresets.fear;
if (rollResult.dice[2]) { if (rollResult.dice[2]) {
if (advantageState === true) { if (advantage.type === 1) {
rollResult.dice[2].options = { appearance: diceSoNicePresets.advantage }; rollResult.dice[2].options = { appearance: diceSoNicePresets.advantage };
} else if (advantageState === false) { } else if (advantage.type === -1) {
rollResult.dice[2].options = { appearance: diceSoNicePresets.disadvantage }; rollResult.dice[2].options = { appearance: diceSoNicePresets.disadvantage };
} }
} }