mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
Compare commits
No commits in common. "27eb4a14302ec2353e78f14bd6d5f990fd79784c" and "e2414b167a9d73553bbd3b63b36d38223ed4686a" have entirely different histories.
27eb4a1430
...
e2414b167a
7 changed files with 12 additions and 16 deletions
|
|
@ -1326,11 +1326,6 @@
|
|||
"short": "V. Far"
|
||||
}
|
||||
},
|
||||
"ReloadChoices": {
|
||||
"off": { "label": "Don't Use" },
|
||||
"button": { "label": "Use button" },
|
||||
"auto": { "label": "Automatic" }
|
||||
},
|
||||
"RollTypes": {
|
||||
"trait": {
|
||||
"name": "Trait"
|
||||
|
|
|
|||
|
|
@ -964,9 +964,8 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
if (!item || !item.system.resource?.max)
|
||||
return;
|
||||
|
||||
await item.update({
|
||||
'system.resource.value': item.system.needsReload ?
|
||||
itemAbleRollParse(item.system.resource.max, this.document, item) : 0
|
||||
await item.update({ 'system.resource.value':
|
||||
item.system.needsReload ? itemAbleRollParse(item.system.resource.max, this.document, item) : 0
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -282,6 +282,8 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
|||
async onRollReloadCheck(_event, messageData) {
|
||||
const message = game.messages.get(messageData._id);
|
||||
const needReload = await message.system.action.handleReload?.({ awaitRoll: true });
|
||||
await message.update({ 'system.needsReload': needReload });
|
||||
await message.update({
|
||||
'system.needReload': needReload
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,14 +63,14 @@ export const actionAutomationChoices = {
|
|||
export const reloadChoices = {
|
||||
off: {
|
||||
id: 'off',
|
||||
label: 'DAGGERHEART.CONFIG.ReloadChoices.off.label'
|
||||
label: 'Don\'t Use'
|
||||
},
|
||||
button: {
|
||||
id: 'button',
|
||||
label: 'DAGGERHEART.CONFIG.ReloadChoices.button.label'
|
||||
label: 'Use Button'
|
||||
},
|
||||
auto: {
|
||||
id: 'auto',
|
||||
label: 'DAGGERHEART.CONFIG.ReloadChoices.auto.label'
|
||||
label: 'Automatic'
|
||||
}
|
||||
};
|
||||
|
|
@ -53,7 +53,7 @@ export default class DHAttackAction extends DHDamageAction {
|
|||
|
||||
async use(event, options) {
|
||||
if (this.item?.system.needsReload) {
|
||||
return ui.notifications.error(_loc('DAGGERHEART.UI.Notifications.reloadRequired', { weapon: this.item.name }));
|
||||
return ui.notifications.error(game.i18n.format('DAGGERHEART.UI.Notifications.reloadRequired', { weapon: this.item.name }));
|
||||
}
|
||||
|
||||
const result = await super.use(event, options);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
|
|||
hasEffect: new fields.BooleanField({ initial: false }),
|
||||
hasSave: new fields.BooleanField({ initial: false }),
|
||||
hasTarget: new fields.BooleanField({ initial: false }),
|
||||
needsReload: new fields.BooleanField({ initial: false }),
|
||||
needReload: new fields.BooleanField({ initial: false }),
|
||||
isDirect: new fields.BooleanField({ initial: false }),
|
||||
onSave: new fields.StringField(),
|
||||
source: new fields.SchemaField({
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
<div class="roll-part-title"><span>{{title}}</span></div>
|
||||
|
||||
{{#if (eq action.type 'attack')}}
|
||||
{{#if needsReload}}
|
||||
{{#if needReload}}
|
||||
<div class="roll-reload-container">
|
||||
{{#if needsReload}}
|
||||
{{#if needReload}}
|
||||
<p class='reload-warning'>{{localize "DAGGERHEART.ACTIONS.Reload.reloadRequired"}}</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue