mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
[Feature] Countdown Actions (#1302)
* Added countdown actions * Added a CountdownAutomation setting to enable/disable countdown automation * Added Looping * Added characterSpotlight automation * Countdown max as formula to enable random countdowns * Updated compendiums with countdowns * . * Fixed lightmode colouration * Raised system version * Added automation for ActionRolls on countdowns * Added automation on fear to countdowns * Corrected attackAction countdown automation * Added initial countdown upon creating a CountdownAction * Improved ActionCountdown initial name to be 'Start Countdown'
This commit is contained in:
parent
0233979a9f
commit
207220ff7b
54 changed files with 1742 additions and 635 deletions
|
|
@ -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,22 @@ 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);
|
||||
|
||||
if (config.roll.result.duality === -1) {
|
||||
await updateCountdowns(CONFIG.DH.GENERAL.countdownProgressionTypes.fear.id);
|
||||
}
|
||||
}
|
||||
|
||||
const hopeFearAutomation = automationSettings.hopeFear;
|
||||
if (
|
||||
!config.source?.actor ||
|
||||
(game.user.isGM ? !hopeFearAutomation.gm : !hopeFearAutomation.players) ||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue