Skip to content

Commit

Permalink
Rework grabs (most of them, at any rate) (CleverRaven#64999)
Browse files Browse the repository at this point in the history
* Grabs the first

C++ and documentation

* Tests, Tweaks, Docs

* Rebase fixes

* Update src/mattack_actors.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Src tweaks

Mattack proper, was_loaded

* JSON changes

Including WIP second grabs, mods, but no dinos

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Src oopsie

* Update src/mattack_actors.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update src/mattack_actors.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Src Oopsie 2

* Backup WIP (don't ask)

* Dinomod part 1

* Dinomod Part Two

* Final?

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Clang

* Ampersin

* We used to talk, Basic Build

You could complain about more than a single file at once, back then

* Mamaaaa

* Update monster_attack_test.cpp

* Armor

* Teleport oopsie

* Clang?

* Plop

* Clang me up, Scotty

* Un-complexify the grab test

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: David Seguin <[email protected]>
  • Loading branch information
3 people authored May 4, 2023
1 parent ef6dedc commit f9caeb7
Show file tree
Hide file tree
Showing 81 changed files with 2,596 additions and 759 deletions.
14 changes: 14 additions & 0 deletions data/json/body_parts.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"hit_difficulty": 1,
"side": "both",
"legacy_id": "TORSO",
"grabbing_effect": "grabbing_torso",
"stylish_bonus": 6,
"hot_morale_mod": 2,
"cold_morale_mod": 2,
Expand Down Expand Up @@ -128,6 +129,7 @@
"hit_difficulty": 1.2,
"side": "both",
"legacy_id": "HEAD",
"grabbing_effect": "grabbing_head",
"stylish_bonus": 3,
"hot_morale_mod": 2,
"cold_morale_mod": 2,
Expand Down Expand Up @@ -217,6 +219,8 @@
"limb_scores": [ [ "vision", 1.0 ], [ "night_vis", 1.0 ], [ "reaction", 0.7 ] ],
"side": "both",
"legacy_id": "EYES",
"//": "Shouldn't happen, but consistency is nice",
"grabbing_effect": "grabbing_eyes",
"stylish_bonus": 2,
"squeamish_penalty": 8,
"base_hp": 60,
Expand Down Expand Up @@ -254,6 +258,7 @@
"limb_scores": [ [ "breathing", 1.0 ], [ "manip", 0.05, 0.2 ] ],
"side": "both",
"legacy_id": "MOUTH",
"grabbing_effect": "grabbing_mouth",
"stylish_bonus": 2,
"hot_morale_mod": 2,
"cold_morale_mod": 2,
Expand Down Expand Up @@ -290,6 +295,7 @@
"limb_scores": [ [ "manip", 0.1, 0.2 ], [ "lift", 0.5 ], [ "balance", 0.15 ], [ "block", 1.0 ], [ "swim", 0.1 ], [ "crawl", 0.3 ] ],
"side": "left",
"legacy_id": "ARM_L",
"grabbing_effect": "grabbing_arm_l",
"hot_morale_mod": 0.5,
"cold_morale_mod": 0.5,
"fire_warmth_bonus": 600,
Expand Down Expand Up @@ -374,6 +380,7 @@
"limb_scores": [ [ "manip", 0.1, 0.2 ], [ "lift", 0.5 ], [ "balance", 0.15 ], [ "block", 1.0 ], [ "swim", 0.1 ], [ "crawl", 0.3 ] ],
"side": "right",
"legacy_id": "ARM_R",
"grabbing_effect": "grabbing_arm_r",
"hot_morale_mod": 0.5,
"cold_morale_mod": 0.5,
"fire_warmth_bonus": 600,
Expand Down Expand Up @@ -455,6 +462,7 @@
"limb_scores": [ [ "grip", 0.5 ], [ "manip", 0.5, 1.0 ], [ "swim", 0.15 ] ],
"side": "left",
"legacy_id": "HAND_L",
"grabbing_effect": "grabbing_hand_l",
"stylish_bonus": 0.5,
"hot_morale_mod": 0.5,
"cold_morale_mod": 0.5,
Expand Down Expand Up @@ -486,6 +494,7 @@
"limb_scores": [ [ "grip", 0.5 ], [ "manip", 0.5, 1.0 ], [ "swim", 0.15 ] ],
"side": "right",
"legacy_id": "HAND_R",
"grabbing_effect": "grabbing_hand_r",
"stylish_bonus": 0.5,
"hot_morale_mod": 0.5,
"cold_morale_mod": 0.5,
Expand Down Expand Up @@ -520,6 +529,7 @@
"limb_scores": [ [ "manip", 0.1, 0.2 ], [ "move_speed", 0.5 ], [ "swim", 0.15 ], [ "block", 1 ], [ "crawl", 0.2 ] ],
"side": "left",
"legacy_id": "LEG_L",
"grabbing_effect": "grabbing_leg_l",
"stylish_bonus": 1,
"hot_morale_mod": 0.5,
"cold_morale_mod": 0.5,
Expand Down Expand Up @@ -613,6 +623,7 @@
"limb_scores": [ [ "manip", 0.1, 0.2 ], [ "move_speed", 0.5 ], [ "swim", 0.15 ], [ "block", 1 ], [ "crawl", 0.2 ] ],
"side": "right",
"legacy_id": "LEG_R",
"grabbing_effect": "grabbing_leg_r",
"stylish_bonus": 1,
"hot_morale_mod": 0.5,
"cold_morale_mod": 0.5,
Expand Down Expand Up @@ -704,6 +715,7 @@
"limb_scores": [ [ "manip", 0.1, 0.2 ], [ "footing", 0.5 ], [ "swim", 0.1 ] ],
"side": "left",
"legacy_id": "FOOT_L",
"grabbing_effect": "grabbing_foot_l",
"stylish_bonus": 0.5,
"hot_morale_mod": 0.5,
"cold_morale_mod": 0.5,
Expand Down Expand Up @@ -737,6 +749,7 @@
"limb_scores": [ [ "manip", 0.1, 0.2 ], [ "footing", 0.5 ], [ "swim", 0.1 ] ],
"side": "right",
"legacy_id": "FOOT_R",
"grabbing_effect": "grabbing_foot_r",
"stylish_bonus": 0.5,
"hot_morale_mod": 0.5,
"cold_morale_mod": 0.5,
Expand Down Expand Up @@ -773,6 +786,7 @@
"accusative": { "ctxt": "bodypart_accusative", "str": "debug tail" },
"hp_bar_ui_text": "DBG TAIL",
"base_hp": 20,
"grabbing_effect": "grabbing_tail",
"flags": [ "ALWAYS_BLOCK", "NONSTANDARD_BLOCK", "MEND_LIMB", "WALL_CLING" ],
"armor": { "bash": 10 },
"unarmed_damage": [ { "damage_type": "acid", "amount": 10 }, { "damage_type": "bullet", "amount": 5, "armor_penetration": 100 } ],
Expand Down
8 changes: 8 additions & 0 deletions data/json/character_modifiers.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@
"mod_type": "x",
"value": { "builtin": "move_mode_move_cost_modifier" }
},
{
"id": "grab_break_limb_mod",
"type": "character_mod",
"description": "Grab break success modifier",
"mod_type": "x",
"//": "Major limb scores - grip would be nice but unless",
"value": { "limb_score": [ "balance", [ "lift", 2 ], "move_speed", "grip" ], "limb_score_op": "x", "min": 0.1, "max": 0.9 }
},
{
"type": "character_mod",
"id": "stamina_move_cost_mod",
Expand Down
197 changes: 179 additions & 18 deletions data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,160 @@
"desc": [ "AI tag used for robot monsters losing mechanical fluid. This is a bug if you have it." ],
"show_in_info": true
},
{
"type": "effect_type",
"id": "grabbing_head",
"name": [ "Grabbing Head" ],
"show_in_info": true,
"//": "Grab filter effect for dedicated removal, per-bptype",
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You're grabbing the head of somebody." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_eyes",
"name": [ "Grabbing Eyes" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You've caught the eye of somebody." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_mouth",
"name": [ "Grabbing Mouth" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You're grabbing the mouth of somebody. Somehow." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_torso",
"name": [ "Grabbing Torso" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You're hugging somebody." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_arm_l",
"name": [ "Grabbing Left Arm" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You're grabbing the left arm of somebody." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_arm_r",
"name": [ "Grabbing Right Arm" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You're grabbing the right arm of somebody." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_hand_l",
"name": [ "Grabbing Left Hand" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You're holding hands(left)." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_hand_r",
"name": [ "Grabbing Right Hand" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You're holding hands(right)." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_leg_l",
"name": [ "Grabbing Left Leg" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You're grabbing the left leg of somebody." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_leg_r",
"name": [ "Grabbing Right Leg" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You're grabbing the right leg of somebody." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_foot_l",
"name": [ "Grabbing Left Foot" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You're grabbing the left foot of somebody." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_foot_r",
"name": [ "Grabbing Right Foot" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You're grabbing the right foot of somebody." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_tail",
"name": [ "Grabbing Tail" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"desc": [ "You're grabbing the tail of somebody." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_appendix",
"name": [ "Grabbing" ],
"show_in_info": true,
"base_mods": { "dodge_mod": [ -8 ] },
"//": "Null-BP grabbing effect for safety and monsters",
"desc": [ "This sounds pretty invasive." ],
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "staggered",
"name": [ "Staggered" ],
"//": "Mainly for monsters",
"desc": [ "You've been knocked off-balance by an attack." ],
"apply_message": "You're staggered off-balance.",
"max_duration": "5 s",
"base_mods": { "speed_mod": [ -20 ] },
"removes_effects": [ "grabbing" ],
"removes_effects": [
"grabbing",
"grabbing_2",
"grabbing_head",
"grabbing_eyes",
"grabbing_mouth",
"grabbing_hand_l",
"grabbing_hand_r",
"grabbing_arm_l",
"grabbing_arm_r",
"grabbing_leg_l",
"grabbing_leg_r",
"grabbing_foot_l",
"grabbing_foot_r",
"grabbing_appendix",
"grabbing_tail"
],
"rating": "bad",
"show_in_info": true
},
Expand Down Expand Up @@ -3073,34 +3218,50 @@
"type": "effect_type",
"id": "grabbed",
"name": [ "Grabbed" ],
"desc": [ "You have been grabbed by an attack.\nYou are being held in place, and dodging and blocking are very difficult." ],
"desc": [
"You have been grabbed and held in place by an attack. You're not able to move until breaking the grab, and depending on the strength of your opponent using this limb is difficult to impossible.\nWait in place or attempt to move without attacking to try and remove this effect."
],
"rating": "bad",
"max_duration": "2 s",
"max_intensity": 15,
"base_mods": { "speed_mod": [ -15 ] },
"scaling_mods": { "speed_mod": [ -5 ] },
"//": "Removal handled in code, so no max duration needed, intensity set by the grab_strength, all effects are local-only",
"max_intensity": 100,
"show_in_info": true,
"show_intensity": true,
"//": "Monster attacks only grab the torso to keep the intensity check consistent, but assume limbs getting grabbed as well",
"//mods": "No swimmin' or manipulatin' with a held limb, other scores start severly debilitated and reach useless at about 50 grab strength",
"base_mods": { "dodge_mod": [ -10 ] },
"limb_score_mods": [
{ "limb_score": "manip", "modifier": 0.8, "scaling": -0.05 },
{ "limb_score": "lift", "modifier": 0.9, "scaling": -0.1 },
{ "limb_score": "block", "modifier": 0.7, "scaling": -0.1 },
{ "limb_score": "breathing", "modifier": 0.8, "scaling": -0.1 },
{ "limb_score": "reaction", "modifier": 0.9, "scaling": -0.1 },
{ "limb_score": "balance", "modifier": 0.655, "scaling": -0.07 },
{ "limb_score": "swim", "modifier": 0.8, "scaling": -0.2 }
{ "limb_score": "manip", "modifier": 0.0 },
{ "limb_score": "grip", "modifier": 0.0 },
{ "limb_score": "lift", "modifier": 0.6, "scaling": -0.01 },
{ "limb_score": "block", "modifier": 0.25, "scaling": -0.01 },
{ "limb_score": "breathing", "modifier": 0.75, "scaling": -0.005 },
{ "limb_score": "balance", "modifier": 0.6, "scaling": -0.01 },
{ "limb_score": "move_speed", "modifier": 0.6, "scaling": -0.01 },
{ "limb_score": "footing", "modifier": 0.6, "scaling": -0.01 },
{ "limb_score": "swim", "modifier": 0.0 }
],
"flags": [ "EFFECT_LIMB_SCORE_MOD" ]
"flags": [ "EFFECT_LIMB_SCORE_MOD_LOCAL", "GRAB" ]
},
{
"type": "effect_type",
"id": "grabbing",
"name": [ "Grabbing" ],
"desc": [ "Grabbing another creature and holding them in place." ],
"max_duration": "2 s",
"max_intensity": 15,
"show_in_info": true
"max_intensity": 1,
"show_in_info": true,
"//": "-dodge (can't really miss something holding you)",
"base_mods": { "dodge_mod": [ -8 ] },
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
"id": "grabbing_2",
"name": [ "Grabbing" ],
"desc": [ "Grabbing another creature and holding them in place with a second appendage." ],
"max_intensity": 1,
"show_in_info": true,
"//": "-dodge (can't really miss something holding you)",
"base_mods": { "dodge_mod": [ -8 ] },
"flags": [ "GRAB_FILTER" ]
},
{
"type": "effect_type",
Expand Down
Loading

0 comments on commit f9caeb7

Please sign in to comment.