Skip to content

[Feature] Reload Check#2051

Open
WBHarry wants to merge 13 commits into
mainfrom
feature/reload-check
Open

[Feature] Reload Check#2051
WBHarry wants to merge 13 commits into
mainfrom
feature/reload-check

Conversation

@WBHarry

@WBHarry WBHarry commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Added support for reload rules. The automation settings has a setting for how it's done. Either None so we do nothing, button so that we display a button for the roll in the chat message or auto so that it's immediately rolled upon doing the attack.

For easy testing it's currently set to always count as needing a reload regardless of the dice roll

The actual visual in the chat message could definately be improved. Currently:
Auto
image

Button
image

image

if (!item || !item.system.resource?.max)
return;

await item.update({ 'system.resource.value':

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw this come up in the damage roll code, but same line key in an object always seems a bit odd to me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah, it's not ideal, changed it.
Think I've done it a few times when I dislike how the line length limit forces things to be formated.

Comment thread module/applications/ui/chatLog.mjs Outdated
Comment thread module/config/settingsConfig.mjs Outdated
export const reloadChoices = {
off: {
id: 'off',
label: 'Don\'t Use'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be localized. Guessing these are settings?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed localization 👍

Yeah, it's the setting deciding if reload behavior should be used, and if it is whether you want a button to click or to just automatically do it on attacks.
image

Comment thread module/data/action/attackAction.mjs Outdated
}

const needsToReload = true;
// const needsToReload = roll.total === 1;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's happening here? Testing stuff?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, annoying to try and get a 1 on a d6 to test it, so it's hardcoded until we're ready to merge 😆

Comment thread module/data/chat-message/actorRoll.mjs Outdated
hasEffect: new fields.BooleanField({ initial: false }),
hasSave: new fields.BooleanField({ initial: false }),
hasTarget: new fields.BooleanField({ initial: false }),
needReload: new fields.BooleanField({ initial: false }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should probably be "needsReload" to match the weapons getter. Or vice versa!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, corrected to needsReload for consistance 👍

WBHarry and others added 3 commits July 19, 2026 11:43
Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
Comment thread module/dice/dhRoll.mjs Outdated
speaker: cls.getSpeaker({ actor: roll.data?.parent }),
sound: config.mute ? null : CONFIG.sounds.dice,
system: { ...config, actionDescription },
system: { ...config, actionDescription, needReload },

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this needReload need to be needsReload as well, or separate?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dang it. Yup, import change there. ⭐

Fixed, and searched the project so there's no more remaining instances of needReoad

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants