Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow spell circles to access player inventory #734

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

vgskye
Copy link
Contributor

@vgskye vgskye commented Aug 23, 2024

fixes #638

@SamsTheNerd
Copy link
Member

this code looks basically copy pasted from the player casting env, maybe it should just be abstracted into a shared method somewhere?

@vgskye
Copy link
Contributor Author

vgskye commented Aug 24, 2024

it is based off of that, but there are some behavioural changes(e.g. pull mainhand first then offhand, rather than other-hand-first or other-hand-only since spell circles are hands-free) that I'm not sure makes sense to unify into one set of methods

@vgskye vgskye force-pushed the circle-player-inv branch 2 times, most recently from 923e92c to 2111328 Compare November 2, 2024 06:03
Copy link
Member

@SamsTheNerd SamsTheNerd left a comment

Choose a reason for hiding this comment

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

i think pulling it out and unifying still makes the most sense. can have it just take a list of hands or something and that should handle that behavior? That seemed like the main thing, was there another issue with unifying it ?

Copy link
Member

@SamsTheNerd SamsTheNerd left a comment

Choose a reason for hiding this comment

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

other than comment I left (which I'm not sure about), code looks fine. Should probably be tested a bit more before merging but I'm not doing that rn

if (!offhand.isEmpty()) {
out.add(offhand);
}
} else {
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this case check both hands, just prioritizing otherhand. for stuff like self refilling artifacts and whatnot.

Copy link
Member

Choose a reason for hiding this comment

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

i think having this method take a list of hands to check may be better? that way callers can prioritize whichever hand they want while also being able to decide if they want the other hand used also. then just loop over that list, would probably be neater too.

Copy link
Member

Choose a reason for hiding this comment

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

not sure that this would ever actually be used in a case like that though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

iiuc this is used for Place Block&co, not Recharge&co? I was just retaining previous behaviour when provided with a casting hand though

@SamsTheNerd SamsTheNerd merged commit 8b3e267 into FallingColors:main Nov 12, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Spell Circle Unable to use Recharge
2 participants