mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 21:21:08 +01:00
Fixed so leader in group roll gains resourcse
This commit is contained in:
parent
cd8e9f5f12
commit
196ec07e79
1 changed files with 3 additions and 1 deletions
|
|
@ -192,6 +192,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
|
|
||||||
async groupRollButton(event, message) {
|
async groupRollButton(event, message) {
|
||||||
const path = event.currentTarget.dataset.path;
|
const path = event.currentTarget.dataset.path;
|
||||||
|
const isLeader = path === 'leader';
|
||||||
const { actor: actorData, trait } = foundry.utils.getProperty(message.system, path);
|
const { actor: actorData, trait } = foundry.utils.getProperty(message.system, path);
|
||||||
const actor = game.actors.get(actorData._id);
|
const actor = game.actors.get(actorData._id);
|
||||||
|
|
||||||
|
|
@ -222,7 +223,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
hasRoll: true,
|
hasRoll: true,
|
||||||
skips: {
|
skips: {
|
||||||
createMessage: true,
|
createMessage: true,
|
||||||
resources: true
|
resources: !isLeader
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const result = await actor.diceRoll({
|
const result = await actor.diceRoll({
|
||||||
|
|
@ -234,6 +235,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!result) return;
|
if (!result) return;
|
||||||
|
await game.system.api.fields.ActionFields.CostField.execute.call({ actor }, result);
|
||||||
|
|
||||||
const newMessageData = foundry.utils.deepClone(message.system);
|
const newMessageData = foundry.utils.deepClone(message.system);
|
||||||
foundry.utils.setProperty(newMessageData, `${path}.result`, result.roll);
|
foundry.utils.setProperty(newMessageData, `${path}.result`, result.roll);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue