Skip to content

Commit

Permalink
Make "best fire" bonus heat apply in 6 tile radius
Browse files Browse the repository at this point in the history
Before, you'd have to be next to it and not asleep. Now it applies the full bonus heat at range and applies it to all body parts equally.
The best fire bonus is roughly equal to ~17.5 item warmth, for size 1 fire.
  • Loading branch information
Coolthulhu committed Oct 2, 2020
1 parent f387fb6 commit 0bd599f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 41 deletions.
38 changes: 1 addition & 37 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5020,12 +5020,10 @@ void Character::update_bodytemp()
// Let's cache this not to check it num_bp times
const bool has_bark = has_trait( trait_BARK );
const bool has_sleep = has_effect( effect_sleep );
const bool has_sleep_state = has_sleep || in_sleep_state();
const bool has_heatsink = has_bionic( bio_heatsink ) || is_wearing( "rm13_armor_on" ) ||
has_trait( trait_M_SKIN2 ) || has_trait( trait_M_SKIN3 );
const bool has_climate_control = in_climate_control();
const bool use_floor_warmth = can_use_floor_warmth();
const furn_id furn_at_pos = g->m.furn( pos() );
const cata::optional<vpart_reference> boardable = vp.part_with_feature( "BOARDABLE", true );
// Temperature norms
// Ambient normal temperature is lower while asleep
Expand Down Expand Up @@ -5202,41 +5200,7 @@ void Character::update_bodytemp()
}

// FINAL CALCULATION : Increments current body temperature towards convergent.
int bonus_fire_warmth = 0;
if( !has_sleep_state && best_fire > 0 ) {
// Warming up over a fire
// Extremities are easier to extend over a fire
switch( bp ) {
case bp_head:
case bp_torso:
case bp_mouth:
case bp_leg_l:
case bp_leg_r:
bonus_fire_warmth = best_fire * best_fire * 150; // Not much
break;
case bp_arm_l:
case bp_arm_r:
bonus_fire_warmth = best_fire * 600; // A fair bit
break;
case bp_foot_l:
case bp_foot_r:
if( furn_at_pos != f_null ) {
// Can sit on something to lift feet up to the fire
bonus_fire_warmth = best_fire * furn_at_pos.obj().bonus_fire_warmth_feet;
} else if( boardable ) {
bonus_fire_warmth = best_fire * boardable->info().bonus_fire_warmth_feet;
} else {
// Has to stand
bonus_fire_warmth = best_fire * 300;
}
break;
case bp_hand_l:
case bp_hand_r:
bonus_fire_warmth = best_fire * 1500; // A lot
default:
break;
}
}
int bonus_fire_warmth = best_fire * 500;

const int comfortable_warmth = bonus_fire_warmth + lying_warmth;
const int bonus_warmth = comfortable_warmth + metabolism_warmth + mutation_heat_bonus;
Expand Down
5 changes: 1 addition & 4 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1867,10 +1867,7 @@ int get_heat_radiation( const tripoint &location, bool direct )
// Ensure fire_dist >= 1 to avoid divide-by-zero errors.
const int fire_dist = std::max( 1, square_dist( dest, location ) );
temp_mod += 6 * heat_intensity * heat_intensity / fire_dist;
if( fire_dist <= 1 ) {
// Extend limbs/lean over a single adjacent fire to warm up
best_fire = std::max( best_fire, heat_intensity );
}
best_fire = std::max( best_fire, heat_intensity );
}
if( direct ) {
return best_fire;
Expand Down

0 comments on commit 0bd599f

Please sign in to comment.