Throwing items while piloting mechs (with the mech's assist) #77403
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Features "Throwing items while piloting mechs (with the mech's assist)"
Purpose of change
Using mech's arms to throw items is plausible and useful feature, especially if we have existing infrastructure for that kind of throwing.
Describe the solution
Added check for being in a mech in
avatar_action::plthrow
. Bypass check for whether we can wield an item prior to throwing, and don't wield that item at all if we're in a mech.Describe alternatives you've considered
Remove existing code for mech's assist in throwing range calculations. But that would be terrible in my opinion.
Testing
Got a can of cola in my inventory. Pressed
t
to open the throwing menu, checked maximum distance I can throw the can (5 tiles). Confirmed throwing, can flew to the target tile, no errors observed.Got the same can of cola in my inventory. Piloted a lifting mech. Pressed
t
to open the throwing menu, checked maximum distance I can throw the can (92 tiles). Confirmed throwing, can flew to the target tile, no errors observed.Additional context
We might need to make some adjustments to throwing accuracy calculations as well, but that can wait, I guess.