mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 15:39:02 +01:00
PR fixes
This commit is contained in:
parent
09f5fbcc28
commit
301a040da2
3 changed files with 4 additions and 23 deletions
|
|
@ -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';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue