From 08a9ab4a247cc1ce7197a34f5e9e4d0281ff8d0e Mon Sep 17 00:00:00 2001 From: GalacticApple <87950676+GalacticApple@users.noreply.github.com> Date: Tue, 18 Jun 2024 08:37:17 -0400 Subject: [PATCH] Moving quadrupedally through acid or fire damages both your hands and feet (#74639) * fixed quadruped_full effect * Update src/map_field.cpp Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * efftype_id order fix --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- data/json/enchantments.json | 2 +- data/json/mutations/mutations.json | 3 +-- src/map_field.cpp | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/data/json/enchantments.json b/data/json/enchantments.json index 67a8be0747817..2dc3e6047f84a 100644 --- a/data/json/enchantments.json +++ b/data/json/enchantments.json @@ -164,7 +164,7 @@ ] }, "values": [ { "value": "MOVE_COST", "multiply": -0.15 }, { "value": "CARRY_WEIGHT", "multiply": 0.35 } ], - "ench_effects": [ { "effect": "natural_stance", "intensity": 1 } ] + "ench_effects": [ { "effect": "natural_stance", "intensity": 1 }, { "effect": "quadruped_full", "intensity": 1 } ] }, { "id": "ench_quadruped_movement_half", diff --git a/data/json/mutations/mutations.json b/data/json/mutations/mutations.json index 3f33425c83232..2f4dfeea1dbd0 100644 --- a/data/json/mutations/mutations.json +++ b/data/json/mutations/mutations.json @@ -4425,8 +4425,7 @@ "ench_quadruped_movement_full", { "condition": { "and": [ { "u_has_move_mode": "crouch" }, { "not": "u_can_drop_weapon" }, { "u_has_flag": "QUADRUPED_CROUCH" } ] }, - "values": [ { "value": "MOVE_COST", "multiply": -0.35 } ], - "ench_effects": [ { "effect": "natural_stance", "intensity": 1 } ] + "values": [ { "value": "MOVE_COST", "multiply": -0.35 } ] }, { "values": [ { "value": "CARRY_WEIGHT", "multiply": -0.2 } ] } ] diff --git a/src/map_field.cpp b/src/map_field.cpp index 1bc906d813706..0868d1cea4bd2 100644 --- a/src/map_field.cpp +++ b/src/map_field.cpp @@ -78,6 +78,7 @@ static const efftype_id effect_corroding( "corroding" ); static const efftype_id effect_fungus( "fungus" ); static const efftype_id effect_onfire( "onfire" ); static const efftype_id effect_poison( "poison" ); +static const efftype_id effect_quadruped_full( "quadruped_full" ); static const efftype_id effect_stunned( "stunned" ); static const efftype_id effect_teargas( "teargas" ); @@ -1472,13 +1473,19 @@ void map::player_in_field( Character &you ) int total_damage = 0; total_damage += burn_body_part( you, cur, bodypart_id( "foot_l" ), 2 ); total_damage += burn_body_part( you, cur, bodypart_id( "foot_r" ), 2 ); + if( you.has_effect( effect_quadruped_full ) ) { + total_damage += burn_body_part( you, cur, bodypart_id( "hand_l" ), 2 ); + total_damage += burn_body_part( you, cur, bodypart_id( "hand_r" ), 2 ); + } const bool on_ground = you.is_on_ground(); if( on_ground ) { // Apply the effect to the remaining body parts total_damage += burn_body_part( you, cur, bodypart_id( "leg_l" ), 2 ); total_damage += burn_body_part( you, cur, bodypart_id( "leg_r" ), 2 ); - total_damage += burn_body_part( you, cur, bodypart_id( "hand_l" ), 2 ); - total_damage += burn_body_part( you, cur, bodypart_id( "hand_r" ), 2 ); + if( !you.has_effect( effect_quadruped_full ) ) { + total_damage += burn_body_part( you, cur, bodypart_id( "hand_l" ), 2 ); + total_damage += burn_body_part( you, cur, bodypart_id( "hand_r" ), 2 ); + } total_damage += burn_body_part( you, cur, bodypart_id( "torso" ), 2 ); // Less arms = less ability to keep upright if( ( !you.has_two_arms_lifting() && one_in( 4 ) ) || one_in( 2 ) ) { @@ -1578,6 +1585,11 @@ void map::player_in_field( Character &you ) parts_burned.emplace_back( "leg_l" ); parts_burned.emplace_back( "leg_r" ); } + } else if( you.has_effect( effect_quadruped_full ) ) { + // Moving on all-fours through a fire is a bad idea, hits every body part. + msg_num = 3; + const std::vector all_parts = you.get_all_body_parts(); + parts_burned.assign( all_parts.begin(), all_parts.end() ); } else { // Lying in the fire is BAAAD news, hits every body part. msg_num = 3;