From b3061ff0f66d1527ee72d6b728f25e0d3c0e1e05 Mon Sep 17 00:00:00 2001 From: Fris0uman <41293484+Fris0uman@users.noreply.github.com> Date: Fri, 20 Dec 2019 19:59:01 +0100 Subject: [PATCH] Only apply speed penalty from heat to main body parts (#36289) * Only apply speed penalty from heat to torso and head * Only apply penalty to main parts --- data/json/effects.json | 22 ++++++++++++---------- src/character.cpp | 10 ++++++++++ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/data/json/effects.json b/data/json/effects.json index d4ee92de7dfd6..0aa3d56dd07c7 100644 --- a/data/json/effects.json +++ b/data/json/effects.json @@ -926,11 +926,9 @@ "id": "hot", "name": [ "Warm", "Hot", "Scorching" ], "desc": [ "Your %s feels warm.", "Your %s is sweating from the heat.", "Your %s is sweating profusely!" ], - "speed_name": "Hot", "max_intensity": 3, "part_descs": true, "base_mods": { - "speed_mod": [ -2 ], "thirst_tick": [ 2400 ], "thirst_chance": [ 2 ], "pain_min": [ 1 ], @@ -940,14 +938,18 @@ "hurt_chance": [ -300 ], "stamina_chance": [ 2 ] }, - "scaling_mods": { - "speed_mod": [ -4 ], - "thirst_min": [ 1 ], - "thirst_tick": [ -600 ], - "pain_max_val": [ 10 ], - "hurt_chance": [ 200 ], - "stamina_min": [ -1 ] - } + "scaling_mods": { "thirst_min": [ 1 ], "thirst_tick": [ -600 ], "pain_max_val": [ 10 ], "hurt_chance": [ 200 ], "stamina_min": [ -1 ] } + }, + { + "type": "effect_type", + "id": "hot_speed", + "name": [ "Slowdown", "Hampered", "Crushed" ], + "desc": [ "The heat slows you down.", "You struggle to move in this heat.", "The heat is crushing you." ], + "speed_name": "Heat slowdown", + "max_intensity": 3, + "part_descs": true, + "base_mods": { "speed_mod": [ -2 ] }, + "scaling_mods": { "speed_mod": [ -4 ] } }, { "type": "effect_type", diff --git a/src/character.cpp b/src/character.cpp index 7bcab04cb9c01..fe61dfb87017f 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -119,6 +119,7 @@ static const efftype_id effect_grabbing( "grabbing" ); static const efftype_id effect_harnessed( "harnessed" ); static const efftype_id effect_heavysnare( "heavysnare" ); static const efftype_id effect_hot( "hot" ); +static const efftype_id effect_hot_speed( "hot_speed" ); static const efftype_id effect_infected( "infected" ); static const efftype_id effect_in_pit( "in_pit" ); static const efftype_id effect_lightsnare( "lightsnare" ); @@ -3788,10 +3789,19 @@ void Character::update_bodytemp() add_effect( effect_cold, 1_turns, bp, true, 1 ); } else if( temp_cur[bp] > BODYTEMP_SCORCHING ) { add_effect( effect_hot, 1_turns, bp, true, 3 ); + if( mutate_to_main_part( bp ) == bp ) { + add_effect( effect_hot_speed, 1_turns, bp, true, 3 ); + } } else if( temp_cur[bp] > BODYTEMP_VERY_HOT ) { add_effect( effect_hot, 1_turns, bp, true, 2 ); + if( mutate_to_main_part( bp ) == bp ) { + add_effect( effect_hot_speed, 1_turns, bp, true, 2 ); + } } else if( temp_cur[bp] > BODYTEMP_HOT ) { add_effect( effect_hot, 1_turns, bp, true, 1 ); + if( mutate_to_main_part( bp ) == bp ) { + add_effect( effect_hot_speed, 1_turns, bp, true, 1 ); + } } else { if( temp_cur[bp] >= BODYTEMP_COLD ) { remove_effect( effect_cold, bp );