mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-08 06:56:12 +01:00
Added an automation setting for chat command resources
This commit is contained in:
parent
6321c7c508
commit
1e62131a7c
5 changed files with 19 additions and 5 deletions
|
|
@ -18,6 +18,11 @@ export default class DhAutomation extends foundry.abstract.DataModel {
|
|||
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.hopeFear.players.label'
|
||||
})
|
||||
}),
|
||||
chatCommandAutomation: new fields.BooleanField({
|
||||
required: true,
|
||||
initial: false,
|
||||
label: 'DAGGERHEART.SETTINGS.Automation.FIELDS.chatCommandAutomation.label'
|
||||
}),
|
||||
countdownAutomation: new fields.BooleanField({
|
||||
required: true,
|
||||
initial: true,
|
||||
|
|
|
|||
|
|
@ -86,6 +86,9 @@ export const enrichedDualityRoll = async (
|
|||
{ reaction, traitValue, target, difficulty, title, label, advantage, grantResources, customConfig },
|
||||
event
|
||||
) => {
|
||||
const { chatCommandAutomation } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation);
|
||||
const shouldGrantResources = grantResources === undefined ? chatCommandAutomation : grantResources;
|
||||
|
||||
const config = {
|
||||
event: event ?? {},
|
||||
title: title,
|
||||
|
|
@ -94,12 +97,12 @@ export const enrichedDualityRoll = async (
|
|||
roll: {
|
||||
trait: traitValue && target ? traitValue : null,
|
||||
difficulty: difficulty,
|
||||
advantage,
|
||||
// type: reaction ? 'reaction' : null //not needed really but keeping it for troubleshooting
|
||||
advantage
|
||||
// type: reaction ? 'reaction' : null //not needed really but keeping it for troubleshooting
|
||||
},
|
||||
skips: {
|
||||
resources: !grantResources,
|
||||
triggers: !grantResources
|
||||
resources: !shouldGrantResources,
|
||||
triggers: !shouldGrantResources
|
||||
},
|
||||
type: 'trait',
|
||||
hasRoll: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue