Added automation for ActionRolls on countdowns

This commit is contained in:
WBHarry 2025-11-20 01:54:06 +01:00
parent 0c6b022e49
commit 498e6b9aa2
16 changed files with 134 additions and 44 deletions

View file

@ -931,6 +931,7 @@
} }
}, },
"CountdownType": { "CountdownType": {
"actionRoll": "Action Roll",
"characterSpotlight": "Character Spotlight", "characterSpotlight": "Character Spotlight",
"spotlight": "Spotlight", "spotlight": "Spotlight",
"custom": "Custom", "custom": "Custom",

View file

@ -232,7 +232,8 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
hasRoll: true, hasRoll: true,
skips: { skips: {
createMessage: true, createMessage: true,
resources: !isLeader resources: !isLeader,
updateCountdowns: !isLeader
} }
}; };
const result = await actor.diceRoll({ const result = await actor.diceRoll({
@ -291,7 +292,8 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
}, },
hasRoll: true, hasRoll: true,
skips: { skips: {
createMessage: true createMessage: true,
updateCountdowns: true
} }
}; };
const result = await actor.diceRoll({ const result = await actor.diceRoll({

View file

@ -612,6 +612,10 @@ export const abilityCosts = {
}; };
export const countdownProgressionTypes = { export const countdownProgressionTypes = {
actionRoll: {
id: 'actionRoll',
label: 'DAGGERHEART.CONFIG.CountdownType.actionRoll'
},
spotlight: { spotlight: {
id: 'spotlight', id: 'spotlight',
label: 'DAGGERHEART.CONFIG.CountdownType.spotlight' label: 'DAGGERHEART.CONFIG.CountdownType.spotlight'

View file

@ -32,7 +32,7 @@ export default class DHRoll extends Roll {
const actorIdSplit = config.source?.actor?.split('.'); const actorIdSplit = config.source?.actor?.split('.');
if (actorIdSplit) { if (actorIdSplit) {
const tagTeamSettings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.TagTeamRoll); const tagTeamSettings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.TagTeamRoll);
config.tagTeamSelected = tagTeamSettings.members[actorIdSplit[actorIdSplit.length - 1]]; config.tagTeamSelected = Boolean(tagTeamSettings.members[actorIdSplit[actorIdSplit.length - 1]]);
} }
for (const hook of config.hooks) { for (const hook of config.hooks) {
@ -239,7 +239,18 @@ export default class DHRoll extends Roll {
export const registerRollDiceHooks = () => { export const registerRollDiceHooks = () => {
Hooks.on(`${CONFIG.DH.id}.postRollDuality`, async (config, message) => { Hooks.on(`${CONFIG.DH.id}.postRollDuality`, async (config, message) => {
const hopeFearAutomation = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).hopeFear; const automationSettings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation);
if (
automationSettings.countdownAutomation &&
config.actionType !== CONFIG.DH.ITEM.actionTypes.reaction.id &&
!config.tagTeamSelected &&
!config.skips?.updateCountdowns
) {
const { updateCountdowns } = game.system.api.applications.ui.DhCountdowns;
await updateCountdowns(CONFIG.DH.GENERAL.countdownProgressionTypes.actionRoll.id);
}
const hopeFearAutomation = automationSettings.hopeFear;
if ( if (
!config.source?.actor || !config.source?.actor ||
(game.user.isGM ? !hopeFearAutomation.gm : !hopeFearAutomation.players) || (game.user.isGM ? !hopeFearAutomation.gm : !hopeFearAutomation.players) ||

View file

@ -737,7 +737,7 @@
"img": "icons/magic/air/fog-gas-smoke-purple.webp", "img": "icons/magic/air/fog-gas-smoke-purple.webp",
"progress": { "progress": {
"looping": "looping", "looping": "looping",
"type": "custom", "type": "actionRoll",
"max": "1d6", "max": "1d6",
"current": 1 "current": 1
}, },
@ -768,9 +768,9 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.351", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.2.3", "systemVersion": "1.2.4",
"createdTime": 1754122030308, "createdTime": 1754122030308,
"modifiedTime": 1763488778150, "modifiedTime": 1763599149242,
"lastModifiedBy": "Q4RzhhaPfvLUzzbw" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!actors.items!G7jiltRjgvVhZewm.49cIxZRFiAM6jDva" "_key": "!actors.items!G7jiltRjgvVhZewm.49cIxZRFiAM6jDva"

View file

@ -793,7 +793,7 @@
"img": "icons/magic/unholy/hand-claw-fire-green.webp", "img": "icons/magic/unholy/hand-claw-fire-green.webp",
"progress": { "progress": {
"looping": "looping", "looping": "looping",
"type": "custom", "type": "actionRoll",
"max": "2d6", "max": "2d6",
"current": 1 "current": 1
}, },
@ -824,9 +824,9 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.351", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.2.3", "systemVersion": "1.2.4",
"createdTime": 1754132668836, "createdTime": 1754132668836,
"modifiedTime": 1763489422778, "modifiedTime": 1763599179169,
"lastModifiedBy": "Q4RzhhaPfvLUzzbw" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!actors.items!WPEOIGfclNJxWb87.FKcuCo0v2U7fVkqq" "_key": "!actors.items!WPEOIGfclNJxWb87.FKcuCo0v2U7fVkqq"

View file

@ -578,7 +578,7 @@
"img": "icons/magic/unholy/strike-hand-glow-pink.webp", "img": "icons/magic/unholy/strike-hand-glow-pink.webp",
"progress": { "progress": {
"looping": "looping", "looping": "looping",
"type": "custom", "type": "actionRoll",
"max": "2d6", "max": "2d6",
"current": 1 "current": 1
}, },
@ -656,9 +656,9 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.351", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.2.3", "systemVersion": "1.2.4",
"createdTime": 1754133847132, "createdTime": 1754133847132,
"modifiedTime": 1763489509026, "modifiedTime": 1763599235251,
"lastModifiedBy": "Q4RzhhaPfvLUzzbw" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!actors.items!PELRry1vqjBzSAlr.gwSgBhkcekCGvXxz" "_key": "!actors.items!PELRry1vqjBzSAlr.gwSgBhkcekCGvXxz"

View file

@ -622,7 +622,7 @@
"img": "icons/magic/control/fear-fright-monster-grin-red-orange.webp", "img": "icons/magic/control/fear-fright-monster-grin-red-orange.webp",
"progress": { "progress": {
"looping": "decreasing", "looping": "decreasing",
"type": "custom", "type": "actionRoll",
"max": "8", "max": "8",
"current": 1 "current": 1
}, },
@ -653,9 +653,9 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.351", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.2.3", "systemVersion": "1.2.4",
"createdTime": 1754134694918, "createdTime": 1754134694918,
"modifiedTime": 1763489601633, "modifiedTime": 1763599267846,
"lastModifiedBy": "Q4RzhhaPfvLUzzbw" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!actors.items!hxZ0sgoFJubh5aj6.48tIwFQr64IQ5LaY" "_key": "!actors.items!hxZ0sgoFJubh5aj6.48tIwFQr64IQ5LaY"

View file

@ -578,7 +578,7 @@
"name": "Circle of Defilement", "name": "Circle of Defilement",
"type": "feature", "type": "feature",
"system": { "system": {
"description": "<p><em>Countdown (1d8)</em>. When the Undefeated Champion is in the spotlight for the fi rst time, activate the countdown. When it triggers, activate a magical circle covering an area within Far range of the Champion. A target within that area is Vulnerable until they leave the circle. The circle can be removed by dealing Severe damage to the Undefeated Champion.</p>", "description": "<p><em>Countdown (1d8)</em>. When the Undefeated Champion is in the spotlight for the first time, activate the countdown. When it triggers, activate a magical circle covering an area within Far range of the Champion. A target within that area is Vulnerable until they leave the circle. The circle can be removed by dealing Severe damage to the Undefeated Champion.</p>",
"resource": null, "resource": null,
"actions": { "actions": {
"mHeYZ8e8MbkGz22d": { "mHeYZ8e8MbkGz22d": {
@ -612,7 +612,7 @@
"type": "countdown", "type": "countdown",
"_id": "4x13WyksHU0u0j20", "_id": "4x13WyksHU0u0j20",
"systemPath": "actions", "systemPath": "actions",
"description": "<p><em>Countdown (1d8)</em>. When the Undefeated Champion is in the spotlight for the fi rst time, activate the countdown.</p>", "description": "<p><em>Countdown (1d8)</em>. When the Undefeated Champion is in the spotlight for the first time, activate the countdown.</p>",
"chatDisplay": true, "chatDisplay": true,
"originItem": { "originItem": {
"type": "itemCollection" "type": "itemCollection"
@ -633,7 +633,7 @@
"img": "icons/magic/unholy/barrier-fire-pink.webp", "img": "icons/magic/unholy/barrier-fire-pink.webp",
"progress": { "progress": {
"looping": "noLooping", "looping": "noLooping",
"type": "custom", "type": "actionRoll",
"max": "1d8", "max": "1d8",
"current": 1 "current": 1
}, },
@ -711,9 +711,9 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.351", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.2.3", "systemVersion": "1.2.4",
"createdTime": 1754135646248, "createdTime": 1754135646248,
"modifiedTime": 1763489679922, "modifiedTime": 1763599314892,
"lastModifiedBy": "Q4RzhhaPfvLUzzbw" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!actors.items!RXkZTwBRi4dJ3JE5.55P7ZijSbQeVHCw4" "_key": "!actors.items!RXkZTwBRi4dJ3JE5.55P7ZijSbQeVHCw4"

View file

@ -639,7 +639,7 @@
"img": "icons/magic/air/fog-gas-smoke-purple.webp", "img": "icons/magic/air/fog-gas-smoke-purple.webp",
"progress": { "progress": {
"looping": "looping", "looping": "looping",
"type": "custom", "type": "actionRoll",
"max": "1d6", "max": "1d6",
"current": 1 "current": 1
}, },
@ -670,9 +670,9 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.351", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.2.3", "systemVersion": "1.2.4",
"createdTime": 1754080402680, "createdTime": 1754080402680,
"modifiedTime": 1763488392319, "modifiedTime": 1763599059605,
"lastModifiedBy": "Q4RzhhaPfvLUzzbw" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!actors.items!MYXmTx2FHcIjdfYZ.EjfM83eVCdcVGC3c" "_key": "!actors.items!MYXmTx2FHcIjdfYZ.EjfM83eVCdcVGC3c"

View file

@ -624,7 +624,7 @@
"img": "icons/magic/movement/trail-streak-zigzag-yellow.webp", "img": "icons/magic/movement/trail-streak-zigzag-yellow.webp",
"progress": { "progress": {
"looping": "looping", "looping": "looping",
"type": "custom", "type": "actionRoll",
"max": "1d6", "max": "1d6",
"current": 1 "current": 1
}, },
@ -655,9 +655,9 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.351", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.2.3", "systemVersion": "1.2.4",
"createdTime": 1754082669471, "createdTime": 1754082669471,
"modifiedTime": 1763488527913, "modifiedTime": 1763599508803,
"lastModifiedBy": "Q4RzhhaPfvLUzzbw" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!actors.items!mVV7a7KQAORoPMgZ.IOCG3J20wUHvyvvh" "_key": "!actors.items!mVV7a7KQAORoPMgZ.IOCG3J20wUHvyvvh"

View file

@ -516,6 +516,42 @@
"name": "Roll Save", "name": "Roll Save",
"img": "icons/magic/sonic/projectile-sound-rings-wave.webp", "img": "icons/magic/sonic/projectile-sound-rings-wave.webp",
"range": "close" "range": "close"
},
"UurIzyyMRAJc2DUX": {
"type": "countdown",
"_id": "UurIzyyMRAJc2DUX",
"systemPath": "actions",
"description": "<p>The rubble can be cleared with a <em>Progress Countdown (8)</em>.</p>",
"chatDisplay": false,
"originItem": {
"type": "itemCollection"
},
"actionType": "action",
"cost": [],
"uses": {
"value": null,
"max": "",
"recovery": null,
"consumeOnSuccess": false
},
"countdown": [
{
"name": "Avalanche Roar",
"type": "encounter",
"defaultOwnership": -1,
"img": "icons/magic/sonic/projectile-sound-rings-wave.webp",
"progress": {
"looping": "noLooping",
"type": "custom",
"max": "8",
"current": 1
},
"ownership": {}
}
],
"name": "Start Countdown",
"img": "icons/magic/sonic/projectile-sound-rings-wave.webp",
"range": ""
} }
}, },
"originItemType": null, "originItemType": null,
@ -535,12 +571,12 @@
"compendiumSource": null, "compendiumSource": null,
"duplicateSource": null, "duplicateSource": null,
"exportSource": null, "exportSource": null,
"coreVersion": "13.350", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "0.0.1", "systemVersion": "1.2.4",
"createdTime": 1754085059319, "createdTime": 1754085059319,
"modifiedTime": 1761503879335, "modifiedTime": 1763599582935,
"lastModifiedBy": "fBcTgyTzoARBvohY" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!actors.items!3aAS2Qm3R6cgaYfE.9Z0i0uURfBMVIapJ" "_key": "!actors.items!3aAS2Qm3R6cgaYfE.9Z0i0uURfBMVIapJ"
}, },

View file

@ -36,6 +36,42 @@
"name": "Cast", "name": "Cast",
"img": "icons/skills/social/diplomacy-unity-alliance.webp", "img": "icons/skills/social/diplomacy-unity-alliance.webp",
"range": "close" "range": "close"
},
"ZM96wFu3YuAeUXel": {
"type": "countdown",
"_id": "ZM96wFu3YuAeUXel",
"systemPath": "actions",
"description": "<p>Activate a <em>Countdown (8)</em>. It ticks down as a consequence the GM chooses. When it triggers, the disguise drops.</p>",
"chatDisplay": false,
"originItem": {
"type": "itemCollection"
},
"actionType": "action",
"cost": [],
"uses": {
"value": null,
"max": "",
"recovery": null,
"consumeOnSuccess": false
},
"countdown": [
{
"name": "Mass Disguise",
"type": "encounter",
"defaultOwnership": -1,
"img": "icons/magic/time/hourglass-brown-orange.webp",
"progress": {
"looping": "noLooping",
"type": "custom",
"max": "8",
"current": 1
},
"ownership": {}
}
],
"name": "Start Countdown",
"img": "icons/magic/time/hourglass-brown-orange.webp",
"range": ""
} }
}, },
"attribution": { "attribution": {
@ -49,12 +85,12 @@
"compendiumSource": null, "compendiumSource": null,
"duplicateSource": null, "duplicateSource": null,
"exportSource": null, "exportSource": null,
"coreVersion": "13.347", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.0.5", "systemVersion": "1.2.4",
"createdTime": 1753922784480, "createdTime": 1753922784480,
"modifiedTime": 1755429370519, "modifiedTime": 1763599737574,
"lastModifiedBy": "VZIeX2YDvX338Zvr" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_id": "dT95m0Jam8sWbeuC", "_id": "dT95m0Jam8sWbeuC",
"sort": 3400000, "sort": 3400000,

View file

@ -544,7 +544,7 @@
"img": "icons/magic/air/fog-gas-smoke-brown.webp", "img": "icons/magic/air/fog-gas-smoke-brown.webp",
"progress": { "progress": {
"looping": "looping", "looping": "looping",
"type": "custom", "type": "actionRoll",
"max": "6", "max": "6",
"current": 1 "current": 1
}, },
@ -575,9 +575,9 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.351", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.2.3", "systemVersion": "1.2.4",
"createdTime": 1754217910442, "createdTime": 1754217910442,
"modifiedTime": 1763493849742, "modifiedTime": 1763599784561,
"lastModifiedBy": "Q4RzhhaPfvLUzzbw" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!actors.items!oY69NN4rYxoRE4hl.kYxuTZjH7HDUGeWh" "_key": "!actors.items!oY69NN4rYxoRE4hl.kYxuTZjH7HDUGeWh"

View file

@ -340,7 +340,7 @@
"img": "icons/magic/control/sihouette-hold-beam-green.webp", "img": "icons/magic/control/sihouette-hold-beam-green.webp",
"progress": { "progress": {
"looping": "looping", "looping": "looping",
"type": "custom", "type": "actionRoll",
"max": "4", "max": "4",
"current": 1 "current": 1
}, },
@ -371,9 +371,9 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.351", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.2.3", "systemVersion": "1.2.4",
"createdTime": 1754219142956, "createdTime": 1754219142956,
"modifiedTime": 1763494178457, "modifiedTime": 1763599839181,
"lastModifiedBy": "Q4RzhhaPfvLUzzbw" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!actors.items!2Z1mKc65LxNk2PqR.0OYHJZqT0DlVz5be" "_key": "!actors.items!2Z1mKc65LxNk2PqR.0OYHJZqT0DlVz5be"

View file

@ -403,7 +403,7 @@
"img": "icons/magic/water/snowflake-ice-blue-white.webp", "img": "icons/magic/water/snowflake-ice-blue-white.webp",
"progress": { "progress": {
"looping": "looping", "looping": "looping",
"type": "custom", "type": "actionRoll",
"max": "4", "max": "4",
"current": 1 "current": 1
}, },
@ -434,9 +434,9 @@
"exportSource": null, "exportSource": null,
"coreVersion": "13.351", "coreVersion": "13.351",
"systemId": "daggerheart", "systemId": "daggerheart",
"systemVersion": "1.2.3", "systemVersion": "1.2.4",
"createdTime": 1754217155443, "createdTime": 1754217155443,
"modifiedTime": 1763493758044, "modifiedTime": 1763599993797,
"lastModifiedBy": "Q4RzhhaPfvLUzzbw" "lastModifiedBy": "Q4RzhhaPfvLUzzbw"
}, },
"_key": "!actors.items!acMu9wJrMZZzLSTJ.K8ld4m5yTA6WZwUs" "_key": "!actors.items!acMu9wJrMZZzLSTJ.K8ld4m5yTA6WZwUs"