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

Throwing items while piloting mechs (with the mech's assist) #77403

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

Night-Pryanik
Copy link

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.

@Night-Pryanik Night-Pryanik added [C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact Mechanics: Character / Player Character / Player mechanics labels Oct 28, 2024
@github-actions github-actions bot added <Bugfix> This is a fix for a bug (or closes open issue) <Enhancement / Feature> New features, or enhancements on existing astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Oct 28, 2024
@PatrikLundell
Copy link
Contributor

What happens if you try to throw it out of the reality bubble (since the max distance is larger)? For starters, it shouldn't crash the game, and secondly, it ought to land at the destination (i.e. the actual destination after errors are taken into consideration), rather than vanishing from existence.

A work around would be to cut the maximum range down to 60 tiles, to ensure it is within the shortest reality bubble range, but then errors mustn't cause the resulting range to exceed 60.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Oct 28, 2024
@Night-Pryanik
Copy link
Author

What happens if you try to throw it out of the reality bubble (since the max distance is larger)?

My testing showed that game puts the throwable at the edge of the bubble. E.g. I aimed at max 92 tiles, but all my 10 cans of cola landed at 60 tiles.

For starters, it shouldn't crash the game

It doesn't crash the game.

secondly, it ought to land at the destination (i.e. the actual destination after errors are taken into consideration), rather than vanishing from existence.

It doesn't vanish from existence, it lands at 60 tiles from the mech.

@Maleclypse Maleclypse merged commit 8e4bfe3 into CleverRaven:master Oct 31, 2024
22 of 28 checks passed
@Night-Pryanik Night-Pryanik deleted the mech-throwing branch October 31, 2024 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` <Enhancement / Feature> New features, or enhancements on existing Items / Item Actions / Item Qualities Items and how they work and interact json-styled JSON lint passed, label assigned by github actions Mechanics: Character / Player Character / Player mechanics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can't use throwing weapons while inside mechsuits
3 participants