From d9840e8da1163a8ee4a440c4e3a7326e4fee5a9d Mon Sep 17 00:00:00 2001 From: Dillon Matchett Date: Fri, 25 Feb 2022 22:27:14 -0400 Subject: [PATCH] untested sweat multiplier implementation (#55676) --- data/mods/My_Sweet_Cataclysm/sweet_mutations.json | 1 + src/character.cpp | 5 +++-- src/mutation.h | 2 ++ src/mutation_data.cpp | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/data/mods/My_Sweet_Cataclysm/sweet_mutations.json b/data/mods/My_Sweet_Cataclysm/sweet_mutations.json index cde5f15fa76d9..80bfbd747ee65 100644 --- a/data/mods/My_Sweet_Cataclysm/sweet_mutations.json +++ b/data/mods/My_Sweet_Cataclysm/sweet_mutations.json @@ -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" ], diff --git a/src/character.cpp b/src/character.cpp index 0f3c67b405417..1105796106ede 100644 --- a/src/character.cpp +++ b/src/character.cpp @@ -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 @@ -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 ) ); diff --git a/src/mutation.h b/src/mutation.h index 6528536f8b383..2e60be5bf6f32 100644 --- a/src/mutation.h +++ b/src/mutation.h @@ -233,6 +233,8 @@ struct mutation_branch { cata::optional stomach_size_multiplier = cata::nullopt; // the modifier for the vomit chance cata::optional vomit_multiplier = cata::nullopt; + // the modifier for sweat ammount + cata::optional sweat_multiplier = cata::nullopt; // Adjusts sight range on the overmap. Positives make it farther, negatives make it closer. cata::optional overmap_sight = cata::nullopt; diff --git a/src/mutation_data.cpp b/src/mutation_data.cpp index c4aebd020c26b..fe1288eef782b 100644 --- a/src/mutation_data.cpp +++ b/src/mutation_data.cpp @@ -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 );