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

Grab fixes and drag overhaul #65774

Merged
merged 17 commits into from
Jun 25, 2023
Merged

Conversation

Venera3
Copy link
Member

@Venera3 Venera3 commented May 21, 2023

Summary

Features "Unhardcode dragging, grab fixes"

Purpose of change

Unhardcode GRAB_DRAG and move it over to the new grab mattacks.
Fix some problems with the grab rework.

Describe the solution

  • Added the following values to grab_data:
    • exclusive_grab - handles attempting to remove any existing grabs not originating from the base mob
    • respect_seatbelts - if the pull/drag in question is disabled by the target (character) being on a seat with a seatbelt part
    • drag_distance - number of tiles the attack will drag you
    • drag_deviation - squiggliness of the drag path
    • drag_movecost_mod - modifier on the movecost of the entire drag movement
    • drag_grab_break_distance - number of drag movements between automatic grab break attempts by the target
  • Reworked the grab logic and moved most of it into its own function. It could still be prettier but it works well enough for now.
  • Added an extra check to monsters to automatically remove grabs when no grabbers are found (came up on reddit, no issue for now)
  • Added a new DF_MONMOVE debug mode filter because those are always handy (pretty barebones for now, but I didn't need much more)
  • Removed the hardcoded grab/ranged pull/grab_drag attacks and reworked the monsters using the functions to route through the JSON specials

TODO:

Describe alternatives you've considered

Use dragging to flip monster pathing to drag you away on subsequent moves, but ran into dragged_enemy being character-only and monsters not having unique ids among other things.
Advance turns or burn moves for longer drags - this would make them feel less jank, but the followup attack cycle is close enough and leaves you more options to resist.

Testing

Got dragged a lot by things, worked about right.
Got a nursebot to operate on a bionic survivor. Also got repeat removals (in different sittings) after fixing the grabbing removal.

Additional context

Drags are set up with the following logic: initial grab_drag attack as an exclusive grab disallowing previous grabs that drags, and a low-cooldown drag_followup attack that requires an existing grab by the monster to trigger (and tries removing all other grabs).

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [C++] Changes (can be) made in C++. Previously named `Code` [JSON] Changes (can be) made in JSON [Markdown] Markdown issues and PRs Mods Issues related to mods or modding Mods: Aftershock Anything to do with the Aftershock mod Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) Mods: Xedra Evolved Anything to do with Xedra Evolved <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 May 21, 2023
@github-actions github-actions bot added Code: Tests Measurement, self-control, statistics, balancing. <Bugfix> This is a fix for a bug (or closes open issue) labels May 27, 2023
@github-actions github-actions bot added the Melee Melee weapons, tactics, techniques, reach attack label Jun 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2023

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • debug dragger
  • debug draggers

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

@Venera3 Venera3 marked this pull request as ready for review June 8, 2023 13:21
@github-actions github-actions bot added the Monsters Monsters both friendly and unfriendly. label Jun 11, 2023
@LyleSY
Copy link
Contributor

LyleSY commented Jun 12, 2023

Overall logic makes sense to me

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 13, 2023
@bombasticSlacks
Copy link
Contributor

You have a conflict now, sorry I thought this was already merged lol

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 15, 2023
src/monattack.cpp Outdated Show resolved Hide resolved
src/mattack_actors.cpp Outdated Show resolved Hide resolved
src/mattack_actors.cpp Outdated Show resolved Hide resolved
src/melee.cpp Outdated Show resolved Hide resolved
@andrei8l
Copy link
Contributor

Can you also check whether this fixes #64918?

tests/monster_attack_test.cpp Outdated Show resolved Hide resolved
tests/monster_attack_test.cpp Outdated Show resolved Hide resolved
tests/monster_attack_test.cpp Outdated Show resolved Hide resolved
tests/monster_attack_test.cpp Outdated Show resolved Hide resolved
tests/monster_attack_test.cpp Outdated Show resolved Hide resolved
tests/monster_attack_test.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the astyled astyled PR, label is assigned by github actions label Jun 18, 2023
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Jun 18, 2023
@Venera3
Copy link
Member Author

Venera3 commented Jun 18, 2023

Can you also check whether this fixes #64918?

Confirmed fixed

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 18, 2023
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 23, 2023
@kevingranade kevingranade merged commit 0bdd97d into CleverRaven:master Jun 25, 2023
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` Code: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Melee Melee weapons, tactics, techniques, reach attack Mods: Aftershock Anything to do with the Aftershock mod Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) Mods: Xedra Evolved Anything to do with Xedra Evolved Mods Issues related to mods or modding Monsters Monsters both friendly and unfriendly.
Projects
None yet
6 participants