Skip to content

Commit

Permalink
untested sweat multiplier implementation (CleverRaven#55676)
Browse files Browse the repository at this point in the history
  • Loading branch information
bombasticSlacks authored Feb 26, 2022
1 parent bc4b99c commit d9840e8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions data/mods/My_Sweet_Cataclysm/sweet_mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"healthy_rate": 0.0,
"bleed_resist": 1000,
"fat_to_max_hp": 0.1,
"sweat_multiplier": 0.0,
"anger_relations": [ [ "MARSHMALLOW", 20 ], [ "GUMMY", 5 ], [ "CHEWGUM", 20 ] ],
"allowed_category": [ "SUGAR" ],
"no_cbm_on_bp": [ "torso", "head", "eyes", "mouth", "arm_l", "arm_r", "hand_l", "hand_r", "leg_l", "leg_r", "foot_l", "foot_r" ],
Expand Down
5 changes: 3 additions & 2 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5748,7 +5748,8 @@ mutation_value_map = {
{ "obtain_cost_multiplier", calc_mutation_value_multiplicative<&mutation_branch::obtain_cost_multiplier> },
{ "stomach_size_multiplier", calc_mutation_value_multiplicative<&mutation_branch::stomach_size_multiplier> },
{ "vomit_multiplier", calc_mutation_value_multiplicative<&mutation_branch::vomit_multiplier> },
{ "consume_time_modifier", calc_mutation_value_multiplicative<&mutation_branch::consume_time_modifier> }
{ "consume_time_modifier", calc_mutation_value_multiplicative<&mutation_branch::consume_time_modifier> },
{ "sweat_multiplier", calc_mutation_value_multiplicative<&mutation_branch::sweat_multiplier> },
};

float Character::mutation_value( const std::string &val ) const
Expand Down Expand Up @@ -9397,7 +9398,7 @@ void Character::process_one_effect( effect &it, bool is_new )
mod = 1;
if( is_new || it.activated( calendar::turn, "PERSPIRATION", val, reduced, mod ) ) {
// multiplier to balance values aroud drench capacity of different body parts
int mult = get_part_drench_capacity( bp ) / 100;
int mult = mutation_value( "sweat_multiplier" ) * get_part_drench_capacity( bp ) / 100;
mod_part_wetness( bp, bound_mod_to_vals( get_part_wetness( bp ), val * mult,
it.get_max_val( "PERSPIRATION", reduced ) * mult,
it.get_min_val( "PERSPIRATION", reduced ) * mult ) );
Expand Down
2 changes: 2 additions & 0 deletions src/mutation.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ struct mutation_branch {
cata::optional<float> stomach_size_multiplier = cata::nullopt;
// the modifier for the vomit chance
cata::optional<float> vomit_multiplier = cata::nullopt;
// the modifier for sweat ammount
cata::optional<float> sweat_multiplier = cata::nullopt;

// Adjusts sight range on the overmap. Positives make it farther, negatives make it closer.
cata::optional<float> overmap_sight = cata::nullopt;
Expand Down
1 change: 1 addition & 0 deletions src/mutation_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ void mutation_branch::load( const JsonObject &jo, const std::string & )
optional( jo, was_loaded, "obtain_cost_multiplier", obtain_cost_multiplier, cata::nullopt );
optional( jo, was_loaded, "stomach_size_multiplier", stomach_size_multiplier, cata::nullopt );
optional( jo, was_loaded, "vomit_multiplier", vomit_multiplier, cata::nullopt );
optional( jo, was_loaded, "sweat_multiplier", sweat_multiplier, cata::nullopt );
optional( jo, was_loaded, "overmap_sight", overmap_sight, cata::nullopt );
optional( jo, was_loaded, "overmap_multiplier", overmap_multiplier, cata::nullopt );
optional( jo, was_loaded, "reading_speed_multiplier", reading_speed_multiplier, cata::nullopt );
Expand Down

0 comments on commit d9840e8

Please sign in to comment.