mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-24 03:19:55 +02:00
.
This commit is contained in:
parent
3115e96c17
commit
9eeadba046
3 changed files with 42 additions and 41 deletions
|
|
@ -481,8 +481,8 @@ export default class GroupRollDialog extends HandlebarsApplicationMixin(Applicat
|
||||||
|
|
||||||
await cls.create(msgData);
|
await cls.create(msgData);
|
||||||
|
|
||||||
if (!shouldUseHopeFearAutomation()) return this.cancelRoll({ confirm: false });
|
/* Handle resource updates for the finished GroupRoll */
|
||||||
|
if (shouldUseHopeFearAutomation({ gmAsPlayer: true })) {
|
||||||
const resourceMap = new ResourceUpdateMap(actor);
|
const resourceMap = new ResourceUpdateMap(actor);
|
||||||
if (totalRoll.isCritical) {
|
if (totalRoll.isCritical) {
|
||||||
resourceMap.addResources([
|
resourceMap.addResources([
|
||||||
|
|
@ -496,6 +496,7 @@ export default class GroupRollDialog extends HandlebarsApplicationMixin(Applicat
|
||||||
}
|
}
|
||||||
|
|
||||||
resourceMap.updateResources();
|
resourceMap.updateResources();
|
||||||
|
}
|
||||||
|
|
||||||
/* Fin */
|
/* Fin */
|
||||||
this.cancelRoll({ confirm: false });
|
this.cancelRoll({ confirm: false });
|
||||||
|
|
|
||||||
|
|
@ -750,9 +750,8 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
|
|
||||||
await cls.create(msgData);
|
await cls.create(msgData);
|
||||||
|
|
||||||
if (!shouldUseHopeFearAutomation()) return this.cancelRoll({ confirm: false });
|
|
||||||
|
|
||||||
/* Handle resource updates from the finished TagTeamRoll */
|
/* Handle resource updates from the finished TagTeamRoll */
|
||||||
|
if (shouldUseHopeFearAutomation({ gmAsPlayer: true })) {
|
||||||
const tagTeamData = this.party.system.tagTeam;
|
const tagTeamData = this.party.system.tagTeam;
|
||||||
const fearUpdate = { key: 'fear', value: null, total: null, enabled: true };
|
const fearUpdate = { key: 'fear', value: null, total: null, enabled: true };
|
||||||
for (let memberId in tagTeamData.members) {
|
for (let memberId in tagTeamData.members) {
|
||||||
|
|
@ -780,6 +779,7 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
if (fearUpdate.value) {
|
if (fearUpdate.value) {
|
||||||
mainActor.modifyResource([fearUpdate]);
|
mainActor.modifyResource([fearUpdate]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Fin */
|
/* Fin */
|
||||||
this.cancelRoll({ confirm: false });
|
this.cancelRoll({ confirm: false });
|
||||||
|
|
|
||||||
|
|
@ -886,7 +886,7 @@ export async function triggerChatRollFx(rolls, options = { whisper: false, blind
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function shouldUseHopeFearAutomation() {
|
export function shouldUseHopeFearAutomation(options = { gmAsPlayer: true }) {
|
||||||
const { hopeFear } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation);
|
const { hopeFear } = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation);
|
||||||
return game.user.isGM ? hopeFear.gm : hopeFear.players;
|
return (!game.user.isGM || options.gmAsPlayer) ? hopeFear.players : hopeFear.gm;
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue