-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Moving quadrupedally through certain traps now applies appropriate damage to arms/hands #74662
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Venera3 Do you have any advice on how to have this use less hardcoded bodypart id checks? |
Well. Otherwise you're stuck with the ugly I'd be thankful if you took the high road and tackled the first solution but I'm not gonna be a stick in the mud if you go with the second if that's too much. |
I think tackling the former would be a future pull request for me. Also, wouldn't the former require a total rework of how traps apply damage? Each trap pretty much applies damage in a unique way. |
Unhardcoding traps is long overdue, but having a common target bp selector is preferable to twelve counts of hardcoded effect checks into hardcoded bp assignments even without that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should make a function, something like std::vector<bodypart_id> Creature::get_ground_contact_bodyparts() const
, which does this effect check, and returns the appropriate bodyparts.
This would use Creature::get_all_body_parts_of_type
to return either foot body parts or foot and hand body parts, depending on the result of the effect check.
This would then replace everywhere here that you are manually specifying bodypart ids.
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Co-authored-by: anothersimulacrum <[email protected]>
Do I need it to pass all the checks? |
Only the required checks. If it fails the others and it's not the fault of this PR, it's okay. |
Summary
Bugfixes "Updates trapfunc.cpp to consider quadrupedal movement"
Purpose of change
This is something of a follow-up to #74639. I realized that certain traps, namely lava, goo pits, caltrops and bear traps don't damage your arms/hands when moving through them quadrupedally. I also noticed that there's a "quadruped_half" effect which was meant to be for when you only have Paws and Digitigrade, so I updated enchantments.json to make use of it.
Describe the solution
I updated the functions in trapfunc.cpp to consider if a character has either the quadruped_full or quadruped_half effects. I also updated the functions changed in #74639 to consider quadruped_half.
As an example, beartraps can now snag your arm if you move over them on all-fours.
Describe alternatives you've considered
I may or may not come across other situations where you should hurt your hands when moving like that.
Testing
Compiled and tested on my personal copy of CDDA.
Additional context