mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-08 06:56:12 +01:00
Remove success condition for duality roll gain
This commit is contained in:
parent
8c83c6cac8
commit
09b97592c2
1 changed files with 7 additions and 4 deletions
|
|
@ -138,12 +138,10 @@ export default class DHRoll extends Roll {
|
|||
|
||||
export const registerRollDiceHooks = () => {
|
||||
Hooks.on(`${CONFIG.DH.id}.postRollDuality`, async(config, message) => {
|
||||
if(!game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).hope || config.roll.type !== 'action' || (!config.roll.hasOwnProperty('success') && !config.targets.length)) return;
|
||||
if(!game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).hope || config.roll.type !== 'action') return;
|
||||
|
||||
const actor = await fromUuid(config.source.actor),
|
||||
rollResult = config.roll.success || config.targets.some(t => t.hit),
|
||||
updates = [];
|
||||
let looseSpotlight = false;
|
||||
if(!actor) return;
|
||||
if(config.roll.isCritical || config.roll.result.duality === 1)
|
||||
updates.push(
|
||||
|
|
@ -157,10 +155,15 @@ export const registerRollDiceHooks = () => {
|
|||
updates.push(
|
||||
{ type: 'fear', value: 1 }
|
||||
);
|
||||
if(!rollResult || config.roll.result.duality === -1) looseSpotlight = true;
|
||||
|
||||
if(updates.length)
|
||||
actor.modifyResource(updates);
|
||||
|
||||
if(!config.roll.hasOwnProperty('success') && !config.targets.length) return;
|
||||
|
||||
const rollResult = config.roll.success || config.targets.some(t => t.hit),
|
||||
looseSpotlight = !rollResult || config.roll.result.duality === -1;
|
||||
|
||||
if(looseSpotlight && game.combat?.active) {
|
||||
const currentCombatant = game.combat.combatants.get(game.combat.current?.combatantId);
|
||||
if(currentCombatant?.actorId == actor.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue