Skip to content

Commit

Permalink
Moving quadrupedally through acid or fire damages both your hands and…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
GalacticApple and github-actions[bot] authored Jun 18, 2024
1 parent d3ae4fd commit 08a9ab4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data/json/enchantments.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions data/json/mutations/mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 } ] }
]
Expand Down
16 changes: 14 additions & 2 deletions src/map_field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" );

Expand Down Expand Up @@ -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 ) ) {
Expand Down Expand Up @@ -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<bodypart_id> 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;
Expand Down

0 comments on commit 08a9ab4

Please sign in to comment.