Skip to content

Commit

Permalink
increase decay rate when outdoors
Browse files Browse the repository at this point in the history
  • Loading branch information
nornagon committed Jun 6, 2024
1 parent bd3f457 commit ef4250c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions data/json/items/comestibles/drink.json
Original file line number Diff line number Diff line change
Expand Up @@ -1524,9 +1524,10 @@
"description": "Fresh, clean water. Truly the best thing to quench your thirst.",
"container": "bottle_plastic",
"sealed": true,
"revert_to": "water",
"color": "light_cyan",
"//": "Clean water becomes regular water in about 4 weeks if exposed to air (1 week if outdoors).",
"properties": { "max_air_exposure_hours": "720" },
"color": "light_cyan"
"revert_to": "water"
},
{
"id": "water_spring",
Expand Down
5 changes: 3 additions & 2 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8025,12 +8025,13 @@ void item::calc_rot_while_processing( time_duration processing_duration )
last_temp_check += processing_duration;
}

bool item::process_decay_in_air( Character *carrier, int max_air_exposure_hours,
bool item::process_decay_in_air( map& here, Character *carrier, const tripoint& pos, int max_air_exposure_hours,
time_duration time_delta )
{
if( !has_own_flag( flag_FROZEN ) ) {
double environment_multiplier = here.is_outside(pos) ? 2.0 : 1.0;
time_duration new_air_exposure = time_duration::from_seconds( item_counter ) + time_delta *
rng_normal( 0.9, 1.1 );
rng_normal( 0.9, 1.1 ) * environment_multiplier;
if( new_air_exposure >= time_duration::from_hours( max_air_exposure_hours ) ) {
convert( *type->revert_to, carrier );
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -3074,7 +3074,7 @@ class item : public visitable
bool process_blackpowder_fouling( Character *carrier );
bool process_gun_cooling( Character *carrier );
bool process_tool( Character *carrier, const tripoint &pos );
bool process_decay_in_air( Character *carrier, int max_air_exposure_hours,
bool process_decay_in_air( map& here, Character *carrier, const tripoint& pos, int max_air_exposure_hours,
time_duration time_delta );


Expand Down

0 comments on commit ef4250c

Please sign in to comment.