Skip to content

Commit

Permalink
Only apply speed penalty from heat to main body parts (#36289)
Browse files Browse the repository at this point in the history
* Only apply speed penalty from heat to torso and head

* Only apply penalty to main parts
  • Loading branch information
Fris0uman authored and ZhilkinSerg committed Dec 20, 2019
1 parent b6c4937 commit b3061ff
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
22 changes: 12 additions & 10 deletions data/json/effects.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ],
Expand All @@ -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",
Expand Down
10 changes: 10 additions & 0 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit b3061ff

Please sign in to comment.