mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
[Feature] 460 - Reaction Rolls (#481)
* Added a toggle in D20RollDialog for ReactionRolls * DualityRollEnrichment can now use reaction * Added flavor for DualityRollEnrichment
This commit is contained in:
parent
243630878b
commit
e168e3e7ec
10 changed files with 103 additions and 31 deletions
|
|
@ -187,12 +187,15 @@ Hooks.on('renderHandlebarsApplication', (_, element) => {
|
|||
|
||||
Hooks.on('chatMessage', (_, message) => {
|
||||
if (message.startsWith('/dr')) {
|
||||
const rollCommand = rollCommandToJSON(message.replace(/\/dr\s?/, ''));
|
||||
if (!rollCommand) {
|
||||
const result = rollCommandToJSON(message.replace(/\/dr\s?/, ''));
|
||||
if (!result) {
|
||||
ui.notifications.error(game.i18n.localize('DAGGERHEART.UI.Notifications.dualityParsing'));
|
||||
return false;
|
||||
}
|
||||
|
||||
const { result: rollCommand, flavor } = result;
|
||||
|
||||
const reaction = rollCommand.reaction;
|
||||
const traitValue = rollCommand.trait?.toLowerCase();
|
||||
const advantage = rollCommand.advantage
|
||||
? CONFIG.DH.ACTIONS.advantageState.advantage.value
|
||||
|
|
@ -208,7 +211,16 @@ Hooks.on('chatMessage', (_, message) => {
|
|||
})
|
||||
: game.i18n.localize('DAGGERHEART.GENERAL.duality');
|
||||
|
||||
enrichedDualityRoll({ traitValue, target, difficulty, title, label: 'test', actionType: null, advantage });
|
||||
enrichedDualityRoll({
|
||||
reaction,
|
||||
traitValue,
|
||||
target,
|
||||
difficulty,
|
||||
title,
|
||||
label: 'test',
|
||||
actionType: null,
|
||||
advantage
|
||||
});
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue