mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Added automation for ActionRolls on countdowns
This commit is contained in:
parent
0c6b022e49
commit
498e6b9aa2
16 changed files with 134 additions and 44 deletions
|
|
@ -931,6 +931,7 @@
|
|||
}
|
||||
},
|
||||
"CountdownType": {
|
||||
"actionRoll": "Action Roll",
|
||||
"characterSpotlight": "Character Spotlight",
|
||||
"spotlight": "Spotlight",
|
||||
"custom": "Custom",
|
||||
|
|
|
|||
|
|
@ -232,7 +232,8 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
|||
hasRoll: true,
|
||||
skips: {
|
||||
createMessage: true,
|
||||
resources: !isLeader
|
||||
resources: !isLeader,
|
||||
updateCountdowns: !isLeader
|
||||
}
|
||||
};
|
||||
const result = await actor.diceRoll({
|
||||
|
|
@ -291,7 +292,8 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
|||
},
|
||||
hasRoll: true,
|
||||
skips: {
|
||||
createMessage: true
|
||||
createMessage: true,
|
||||
updateCountdowns: true
|
||||
}
|
||||
};
|
||||
const result = await actor.diceRoll({
|
||||
|
|
|
|||
|
|
@ -612,6 +612,10 @@ export const abilityCosts = {
|
|||
};
|
||||
|
||||
export const countdownProgressionTypes = {
|
||||
actionRoll: {
|
||||
id: 'actionRoll',
|
||||
label: 'DAGGERHEART.CONFIG.CountdownType.actionRoll'
|
||||
},
|
||||
spotlight: {
|
||||
id: 'spotlight',
|
||||
label: 'DAGGERHEART.CONFIG.CountdownType.spotlight'
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ export default class DHRoll extends Roll {
|
|||
const actorIdSplit = config.source?.actor?.split('.');
|
||||
if (actorIdSplit) {
|
||||
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) {
|
||||
|
|
@ -239,7 +239,18 @@ export default class DHRoll extends Roll {
|
|||
|
||||
export const registerRollDiceHooks = () => {
|
||||
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 (
|
||||
!config.source?.actor ||
|
||||
(game.user.isGM ? !hopeFearAutomation.gm : !hopeFearAutomation.players) ||
|
||||
|
|
|
|||
|
|
@ -737,7 +737,7 @@
|
|||
"img": "icons/magic/air/fog-gas-smoke-purple.webp",
|
||||
"progress": {
|
||||
"looping": "looping",
|
||||
"type": "custom",
|
||||
"type": "actionRoll",
|
||||
"max": "1d6",
|
||||
"current": 1
|
||||
},
|
||||
|
|
@ -768,9 +768,9 @@
|
|||
"exportSource": null,
|
||||
"coreVersion": "13.351",
|
||||
"systemId": "daggerheart",
|
||||
"systemVersion": "1.2.3",
|
||||
"systemVersion": "1.2.4",
|
||||
"createdTime": 1754122030308,
|
||||
"modifiedTime": 1763488778150,
|
||||
"modifiedTime": 1763599149242,
|
||||
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
|
||||
},
|
||||
"_key": "!actors.items!G7jiltRjgvVhZewm.49cIxZRFiAM6jDva"
|
||||
|
|
|
|||
|
|
@ -793,7 +793,7 @@
|
|||
"img": "icons/magic/unholy/hand-claw-fire-green.webp",
|
||||
"progress": {
|
||||
"looping": "looping",
|
||||
"type": "custom",
|
||||
"type": "actionRoll",
|
||||
"max": "2d6",
|
||||
"current": 1
|
||||
},
|
||||
|
|
@ -824,9 +824,9 @@
|
|||
"exportSource": null,
|
||||
"coreVersion": "13.351",
|
||||
"systemId": "daggerheart",
|
||||
"systemVersion": "1.2.3",
|
||||
"systemVersion": "1.2.4",
|
||||
"createdTime": 1754132668836,
|
||||
"modifiedTime": 1763489422778,
|
||||
"modifiedTime": 1763599179169,
|
||||
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
|
||||
},
|
||||
"_key": "!actors.items!WPEOIGfclNJxWb87.FKcuCo0v2U7fVkqq"
|
||||
|
|
|
|||
|
|
@ -578,7 +578,7 @@
|
|||
"img": "icons/magic/unholy/strike-hand-glow-pink.webp",
|
||||
"progress": {
|
||||
"looping": "looping",
|
||||
"type": "custom",
|
||||
"type": "actionRoll",
|
||||
"max": "2d6",
|
||||
"current": 1
|
||||
},
|
||||
|
|
@ -656,9 +656,9 @@
|
|||
"exportSource": null,
|
||||
"coreVersion": "13.351",
|
||||
"systemId": "daggerheart",
|
||||
"systemVersion": "1.2.3",
|
||||
"systemVersion": "1.2.4",
|
||||
"createdTime": 1754133847132,
|
||||
"modifiedTime": 1763489509026,
|
||||
"modifiedTime": 1763599235251,
|
||||
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
|
||||
},
|
||||
"_key": "!actors.items!PELRry1vqjBzSAlr.gwSgBhkcekCGvXxz"
|
||||
|
|
|
|||
|
|
@ -622,7 +622,7 @@
|
|||
"img": "icons/magic/control/fear-fright-monster-grin-red-orange.webp",
|
||||
"progress": {
|
||||
"looping": "decreasing",
|
||||
"type": "custom",
|
||||
"type": "actionRoll",
|
||||
"max": "8",
|
||||
"current": 1
|
||||
},
|
||||
|
|
@ -653,9 +653,9 @@
|
|||
"exportSource": null,
|
||||
"coreVersion": "13.351",
|
||||
"systemId": "daggerheart",
|
||||
"systemVersion": "1.2.3",
|
||||
"systemVersion": "1.2.4",
|
||||
"createdTime": 1754134694918,
|
||||
"modifiedTime": 1763489601633,
|
||||
"modifiedTime": 1763599267846,
|
||||
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
|
||||
},
|
||||
"_key": "!actors.items!hxZ0sgoFJubh5aj6.48tIwFQr64IQ5LaY"
|
||||
|
|
|
|||
|
|
@ -578,7 +578,7 @@
|
|||
"name": "Circle of Defilement",
|
||||
"type": "feature",
|
||||
"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,
|
||||
"actions": {
|
||||
"mHeYZ8e8MbkGz22d": {
|
||||
|
|
@ -612,7 +612,7 @@
|
|||
"type": "countdown",
|
||||
"_id": "4x13WyksHU0u0j20",
|
||||
"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,
|
||||
"originItem": {
|
||||
"type": "itemCollection"
|
||||
|
|
@ -633,7 +633,7 @@
|
|||
"img": "icons/magic/unholy/barrier-fire-pink.webp",
|
||||
"progress": {
|
||||
"looping": "noLooping",
|
||||
"type": "custom",
|
||||
"type": "actionRoll",
|
||||
"max": "1d8",
|
||||
"current": 1
|
||||
},
|
||||
|
|
@ -711,9 +711,9 @@
|
|||
"exportSource": null,
|
||||
"coreVersion": "13.351",
|
||||
"systemId": "daggerheart",
|
||||
"systemVersion": "1.2.3",
|
||||
"systemVersion": "1.2.4",
|
||||
"createdTime": 1754135646248,
|
||||
"modifiedTime": 1763489679922,
|
||||
"modifiedTime": 1763599314892,
|
||||
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
|
||||
},
|
||||
"_key": "!actors.items!RXkZTwBRi4dJ3JE5.55P7ZijSbQeVHCw4"
|
||||
|
|
|
|||
|
|
@ -639,7 +639,7 @@
|
|||
"img": "icons/magic/air/fog-gas-smoke-purple.webp",
|
||||
"progress": {
|
||||
"looping": "looping",
|
||||
"type": "custom",
|
||||
"type": "actionRoll",
|
||||
"max": "1d6",
|
||||
"current": 1
|
||||
},
|
||||
|
|
@ -670,9 +670,9 @@
|
|||
"exportSource": null,
|
||||
"coreVersion": "13.351",
|
||||
"systemId": "daggerheart",
|
||||
"systemVersion": "1.2.3",
|
||||
"systemVersion": "1.2.4",
|
||||
"createdTime": 1754080402680,
|
||||
"modifiedTime": 1763488392319,
|
||||
"modifiedTime": 1763599059605,
|
||||
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
|
||||
},
|
||||
"_key": "!actors.items!MYXmTx2FHcIjdfYZ.EjfM83eVCdcVGC3c"
|
||||
|
|
|
|||
|
|
@ -624,7 +624,7 @@
|
|||
"img": "icons/magic/movement/trail-streak-zigzag-yellow.webp",
|
||||
"progress": {
|
||||
"looping": "looping",
|
||||
"type": "custom",
|
||||
"type": "actionRoll",
|
||||
"max": "1d6",
|
||||
"current": 1
|
||||
},
|
||||
|
|
@ -655,9 +655,9 @@
|
|||
"exportSource": null,
|
||||
"coreVersion": "13.351",
|
||||
"systemId": "daggerheart",
|
||||
"systemVersion": "1.2.3",
|
||||
"systemVersion": "1.2.4",
|
||||
"createdTime": 1754082669471,
|
||||
"modifiedTime": 1763488527913,
|
||||
"modifiedTime": 1763599508803,
|
||||
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
|
||||
},
|
||||
"_key": "!actors.items!mVV7a7KQAORoPMgZ.IOCG3J20wUHvyvvh"
|
||||
|
|
|
|||
|
|
@ -516,6 +516,42 @@
|
|||
"name": "Roll Save",
|
||||
"img": "icons/magic/sonic/projectile-sound-rings-wave.webp",
|
||||
"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,
|
||||
|
|
@ -535,12 +571,12 @@
|
|||
"compendiumSource": null,
|
||||
"duplicateSource": null,
|
||||
"exportSource": null,
|
||||
"coreVersion": "13.350",
|
||||
"coreVersion": "13.351",
|
||||
"systemId": "daggerheart",
|
||||
"systemVersion": "0.0.1",
|
||||
"systemVersion": "1.2.4",
|
||||
"createdTime": 1754085059319,
|
||||
"modifiedTime": 1761503879335,
|
||||
"lastModifiedBy": "fBcTgyTzoARBvohY"
|
||||
"modifiedTime": 1763599582935,
|
||||
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
|
||||
},
|
||||
"_key": "!actors.items!3aAS2Qm3R6cgaYfE.9Z0i0uURfBMVIapJ"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -36,6 +36,42 @@
|
|||
"name": "Cast",
|
||||
"img": "icons/skills/social/diplomacy-unity-alliance.webp",
|
||||
"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": {
|
||||
|
|
@ -49,12 +85,12 @@
|
|||
"compendiumSource": null,
|
||||
"duplicateSource": null,
|
||||
"exportSource": null,
|
||||
"coreVersion": "13.347",
|
||||
"coreVersion": "13.351",
|
||||
"systemId": "daggerheart",
|
||||
"systemVersion": "1.0.5",
|
||||
"systemVersion": "1.2.4",
|
||||
"createdTime": 1753922784480,
|
||||
"modifiedTime": 1755429370519,
|
||||
"lastModifiedBy": "VZIeX2YDvX338Zvr"
|
||||
"modifiedTime": 1763599737574,
|
||||
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
|
||||
},
|
||||
"_id": "dT95m0Jam8sWbeuC",
|
||||
"sort": 3400000,
|
||||
|
|
|
|||
|
|
@ -544,7 +544,7 @@
|
|||
"img": "icons/magic/air/fog-gas-smoke-brown.webp",
|
||||
"progress": {
|
||||
"looping": "looping",
|
||||
"type": "custom",
|
||||
"type": "actionRoll",
|
||||
"max": "6",
|
||||
"current": 1
|
||||
},
|
||||
|
|
@ -575,9 +575,9 @@
|
|||
"exportSource": null,
|
||||
"coreVersion": "13.351",
|
||||
"systemId": "daggerheart",
|
||||
"systemVersion": "1.2.3",
|
||||
"systemVersion": "1.2.4",
|
||||
"createdTime": 1754217910442,
|
||||
"modifiedTime": 1763493849742,
|
||||
"modifiedTime": 1763599784561,
|
||||
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
|
||||
},
|
||||
"_key": "!actors.items!oY69NN4rYxoRE4hl.kYxuTZjH7HDUGeWh"
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@
|
|||
"img": "icons/magic/control/sihouette-hold-beam-green.webp",
|
||||
"progress": {
|
||||
"looping": "looping",
|
||||
"type": "custom",
|
||||
"type": "actionRoll",
|
||||
"max": "4",
|
||||
"current": 1
|
||||
},
|
||||
|
|
@ -371,9 +371,9 @@
|
|||
"exportSource": null,
|
||||
"coreVersion": "13.351",
|
||||
"systemId": "daggerheart",
|
||||
"systemVersion": "1.2.3",
|
||||
"systemVersion": "1.2.4",
|
||||
"createdTime": 1754219142956,
|
||||
"modifiedTime": 1763494178457,
|
||||
"modifiedTime": 1763599839181,
|
||||
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
|
||||
},
|
||||
"_key": "!actors.items!2Z1mKc65LxNk2PqR.0OYHJZqT0DlVz5be"
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@
|
|||
"img": "icons/magic/water/snowflake-ice-blue-white.webp",
|
||||
"progress": {
|
||||
"looping": "looping",
|
||||
"type": "custom",
|
||||
"type": "actionRoll",
|
||||
"max": "4",
|
||||
"current": 1
|
||||
},
|
||||
|
|
@ -434,9 +434,9 @@
|
|||
"exportSource": null,
|
||||
"coreVersion": "13.351",
|
||||
"systemId": "daggerheart",
|
||||
"systemVersion": "1.2.3",
|
||||
"systemVersion": "1.2.4",
|
||||
"createdTime": 1754217155443,
|
||||
"modifiedTime": 1763493758044,
|
||||
"modifiedTime": 1763599993797,
|
||||
"lastModifiedBy": "Q4RzhhaPfvLUzzbw"
|
||||
},
|
||||
"_key": "!actors.items!acMu9wJrMZZzLSTJ.K8ld4m5yTA6WZwUs"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue