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

Add conditionals to martial art techniques and audit techs to use them #66034

Merged
merged 5 commits into from
Jun 9, 2023

Conversation

Venera3
Copy link
Member

@Venera3 Venera3 commented Jun 6, 2023

Summary

Features "Rework MA tech requirements"

Purpose of change

Martial art techniques are using a lot of hardcoded booly logic that could be done better, and techs trigger on a lot of enemies they shouldn't affect.

Describe the solution

  • Added support for dialog conditionals to martial art techniques
  • Expanded dialog conditionals to handle creature size (u/npc_val: size), monster grab strength (npc_val: grab_strength), bodytype (u/npc_bodytype), species (u/npc_has_species) and allowed monster::has_flag to automatically convert strings to monster flags
  • Expanded debugmode messaging to give a readout of the technique choice logic (DF_MELEE) and the new talker functions (DF_TALKER)
  • Audited all current in-repo martial art techniques to use reasonable attack conditions (see Additional Context)
  • Deprecated human_target, requires_stun and requires_downed

TODO:

  • Add unit tests

Describe alternatives you've considered

Completely deprecate ma_reqs, but this is already pretty big and there are some weird special cases where I didn't have the time to dig into and ensure parity.

Testing

Beat a poor fat zombie a lot, noticed them not getting stunned by techs but do getting stunned by weakpoint hits, tech conditionals triggered as expected.

Added a unit test for the most common condition setups, passed all.

Additional context

The technique conditionals are as follows:

  • Stunning techs are restricted to non-zombie terrestrial animals of at most 1 size category above you
  • Knockback techniques are restricted to monsters of the same size category, if they are grabbing you you need to succeed in a d20 + STR vs grab strength roll (knockback grab removal will be handled by Grab fixes and drag overhaul #65774
  • Downing techniques are restricted to monsters with human or angel bodytype at most 1 size category above you, provided they can't fly
  • Uppercut and similar techs are restricted to +- 1 size category and a bodytype with an elevated head
  • Judo throws are restricted to non-flier human bodytypes of +1 size category
  • Reworked Krav Maga's Bone Breaker to add a maimed arm status effect instead of stun+down, disabling grabs and scratches for the affected monsters (requires human bodytype, stun and down as before)

@Venera3 Venera3 added Melee Melee weapons, tactics, techniques, reach attack Martial Arts Arts, Techniques, weapons and anything touching martial arts. Mods: MMA Mythical Martial Arts mod labels Jun 6, 2023
@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 EOC: Effects On Condition Anything concerning Effects On Condition Mods Issues related to mods or modding NPC / Factions NPCs, AI, Speech, Factions, Ownership <Enhancement / Feature> New features, or enhancements on existing labels Jun 6, 2023
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

JSON & C++ formatters

data/json/techniques.json|484|
data/json/techniques.json|531|
data/json/techniques.json|535|
data/json/techniques.json|566|
data/json/techniques.json|571|
data/json/techniques.json|670|
data/json/techniques.json|673|
data/json/techniques.json|715|
data/json/techniques.json|719|
data/json/techniques.json|728|
data/json/techniques.json|807|
data/json/techniques.json|810|
data/json/techniques.json|829|
data/json/techniques.json|838|
data/json/techniques.json|897|
data/json/techniques.json|906|
data/json/techniques.json|933|
data/json/techniques.json|968|
data/json/techniques.json|971|
data/json/techniques.json|1016|
data/json/techniques.json|1019|
data/json/techniques.json|1065|
data/json/techniques.json|1074|
data/json/techniques.json|1163|
data/json/techniques.json|1166|
data/json/techniques.json|1199|
data/json/techniques.json|1203|
data/json/techniques.json|1285|
data/json/techniques.json|1288|
data/json/techniques.json|1328|
data/json/techniques.json|1332|
data/json/techniques.json|1401|
data/json/techniques.json|1405|
data/json/techniques.json|1454|
data/json/techniques.json|1459|
data/json/techniques.json|1482|
data/json/techniques.json|1487|
data/json/techniques.json|1511|
data/json/techniques.json|1516|
data/json/techniques.json|1552|
data/json/techniques.json|1555|
data/json/techniques.json|1633|
data/json/techniques.json|1637|
data/json/techniques.json|1683|
data/json/techniques.json|1687|
data/json/techniques.json|1696|
data/json/techniques.json|1713|
data/json/techniques.json|1759|
data/json/techniques.json|1762|
data/json/techniques.json|1794|
data/json/techniques.json|1797|
data/json/techniques.json|1847|
data/json/techniques.json|1850|
data/json/techniques.json|1884|
data/json/techniques.json|1887|
data/json/techniques.json|1914|
data/json/techniques.json|1965|
data/json/techniques.json|1968|
data/json/techniques.json|2025|
data/json/techniques.json|2028|
data/json/techniques.json|2060|
data/json/techniques.json|2063|
data/json/techniques.json|2144|
data/json/techniques.json|2147|
data/json/techniques.json|2218|
data/json/techniques.json|2221|
data/json/techniques.json|2258|
data/json/techniques.json|2261|
data/json/techniques.json|2272|
data/json/techniques.json|2319|
data/json/techniques.json|2322|
data/json/techniques.json|2347|
data/json/techniques.json|2350|
data/json/techniques.json|2388|
data/json/techniques.json|2391|
data/json/techniques.json|2452|
data/json/techniques.json|2455|
data/json/techniques.json|2531|
data/json/techniques.json|2534|
data/json/techniques.json|2545|
data/json/techniques.json|2577|
data/json/techniques.json|2580|
data/json/techniques.json|2623|
data/json/techniques.json|2626|
data/json/techniques.json|2712|
data/json/techniques.json|2715|
data/json/techniques.json|2752|
data/json/techniques.json|2754|
data/json/techniques.json|2783|
data/json/techniques.json|2786|
data/json/techniques.json|2843|
data/json/techniques.json|2846|
data/json/techniques.json|2882|
data/json/techniques.json|2884|
data/json/techniques.json|2911|
data/json/techniques.json|2914|
data/json/techniques.json|2973|
data/json/techniques.json|2975|
data/json/techniques.json|3007|
data/json/techniques.json|3010|
data/json/techniques.json|3042|
data/json/techniques.json|3045|
data/json/techniques.json|3069|
data/json/techniques.json|3104|
data/json/techniques.json|3107|
data/json/techniques.json|3153|
data/json/techniques.json|3156|
data/json/techniques.json|3223|
data/json/techniques.json|3225|
data/json/techniques.json|3257|
data/json/techniques.json|3260|
data/json/techniques.json|3292|
data/json/techniques.json|3305|
data/mods/MMA/techniques.json|139|
data/mods/MMA/techniques.json|142|
data/mods/MMA/techniques.json|179|
data/mods/MMA/techniques.json|182|
data/mods/MMA/techniques.json|265|
data/mods/MMA/techniques.json|268|
data/mods/MMA/techniques.json|369|
data/mods/MMA/techniques.json|372|
data/mods/MMA/techniques.json|398|
data/mods/MMA/techniques.json|401|
data/mods/MMA/techniques.json|434|
data/mods/MMA/techniques.json|437|
data/mods/MMA/techniques.json|443|
data/mods/MMA/techniques.json|470|
data/mods/MMA/techniques.json|473|
data/mods/MMA/techniques.json|479|
data/mods/MMA/techniques.json|547|
data/mods/MMA/techniques.json|550|
src/item.cpp|5224|

data/json/effects.json Outdated Show resolved Hide resolved
data/json/monster_special_attacks/monster_attacks.json Outdated Show resolved Hide resolved
data/json/monster_special_attacks/monster_attacks.json Outdated Show resolved Hide resolved
data/json/monster_special_attacks/monster_attacks.json Outdated Show resolved Hide resolved
data/json/techniques.json Outdated Show resolved Hide resolved
data/json/techniques.json Outdated Show resolved Hide resolved
data/json/techniques.json Outdated Show resolved Hide resolved
data/json/techniques.json Outdated Show resolved Hide resolved
data/json/techniques.json Outdated Show resolved Hide resolved
data/json/techniques.json Outdated Show resolved Hide resolved
src/item.cpp Outdated Show resolved Hide resolved
@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Jun 6, 2023
@anoobindisguise
Copy link
Contributor

Turns out martial arts designed to fight humans weren't actually that good for fighting bears, who knew? Nice work!

@github-actions github-actions bot added Code: Tests Measurement, self-control, statistics, balancing. Monsters Monsters both friendly and unfriendly. labels Jun 7, 2023
@Venera3 Venera3 marked this pull request as ready for review June 7, 2023 14:08
Venera3 and others added 3 commits June 7, 2023 19:26
Conditions, in-repo tech conditioning, documentation

lint

Update src/item.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Missions Quests and missions Mods: Innawood 🌲 Anything to do with Innawood mod SDL: Tiles / Sound Tiles visual interface and sounds. Spawn Creatures, items, vehicles, locations appearing on map Vehicles Vehicles, parts, mechanics & interactions labels Jun 7, 2023
@Venera3 Venera3 force-pushed the martialart_conditioning branch from 1097f7a to cb054c6 Compare June 7, 2023 18:08
@Venera3 Venera3 removed the NPC / Factions NPCs, AI, Speech, Factions, Ownership label Jun 7, 2023
@Venera3 Venera3 removed Mods Issues related to mods or modding Missions Quests and missions Vehicles Vehicles, parts, mechanics & interactions SDL: Tiles / Sound Tiles visual interface and sounds. Crafting / Construction / Recipes Includes: Uncrafting / Disassembling Spawn Creatures, items, vehicles, locations appearing on map Mods: Innawood 🌲 Anything to do with Innawood mod labels Jun 7, 2023
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jun 7, 2023
@github-actions github-actions bot added the NPC / Factions NPCs, AI, Speech, Factions, Ownership label Jun 8, 2023
@Venera3 Venera3 removed the NPC / Factions NPCs, AI, Speech, Factions, Ownership label Jun 8, 2023
@Venera3 Venera3 mentioned this pull request Jun 8, 2023
5 tasks
@bombasticSlacks
Copy link
Contributor

Unreal ammount of work lol

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 [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 EOC: Effects On Condition Anything concerning Effects On Condition [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Martial Arts Arts, Techniques, weapons and anything touching martial arts. Melee Melee weapons, tactics, techniques, reach attack Mods: MMA Mythical Martial Arts mod Monsters Monsters both friendly and unfriendly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants