mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 10:29:54 +02:00
Added support for reload rules
This commit is contained in:
parent
70388dbd73
commit
3817469e35
11 changed files with 99 additions and 3 deletions
|
|
@ -61,6 +61,24 @@ export default class DHAttackAction extends DHDamageAction {
|
|||
return result;
|
||||
}
|
||||
|
||||
async handleReload(options = { awaitRoll: false }) {
|
||||
const roll = await new Roll('1d6').evaluate();
|
||||
if (game.modules.get('dice-so-nice')?.active) {
|
||||
if (options.awaitRoll)
|
||||
await game.dice3d.showForRoll(roll, game.user, true);
|
||||
else
|
||||
game.dice3d.showForRoll(roll, game.user, true);
|
||||
}
|
||||
|
||||
const needsToReload = roll.total === 1;
|
||||
if (needsToReload) {
|
||||
// TODO: Update item resource value when the functionality has been added to the system
|
||||
// this.item.update({ 'system.resource.value': 0 });
|
||||
}
|
||||
return true;
|
||||
return needsToReload;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a localized label array for this item subtype.
|
||||
* @returns {(string | { value: string, icons: string[] })[]} An array of localized strings and damage label objects.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue