Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pain Recovery Deobsoletion #1820

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions data/json/mutations/mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -3201,6 +3201,16 @@
"category": [ "URSINE", "CATTLE", "CHIMERA", "BEAST", "LIZARD", "MEDICAL" ],
"hp_modifier_secondary": 0.2
},
{
"type": "mutation",
"id": "PAINREC1",
"name": { "str": "Pain Recovery" },
"points": 1,
"description": "You recover from pain slightly faster than normal.",
"starting_trait": true,
"changes_to": [ "NOPAIN" ],
"pain_recovery": 1.0
},
{
"type": "mutation",
"id": "MUT_TOUGH2",
Expand Down Expand Up @@ -3240,7 +3250,7 @@
"description": "You've developed a serious appetite for pain, and take pride in your scars.",
"valid": false,
"prereqs": [ "MASOCHIST", "PAINRESIST", "ADDICTIVE" ],
"prereqs2": [ "PAINREC2", "PAINREC3" ],
"prereqs2": [ "PAINREC1", "ADDICTIVE" ],
"threshreq": [ "THRESH_MEDICAL" ],
"leads_to": [ "MUT_TOUGH" ],
"changes_to": [ "CENOBITE" ],
Expand All @@ -3258,7 +3268,6 @@
"valid": false,
"purifiable": false,
"prereqs": [ "MASOCHIST_MED" ],
"prereqs2": [ "PAINREC3", "ADDICTIVE" ],
"threshreq": [ "THRESH_MEDICAL" ],
"category": [ "MEDICAL" ]
},
Expand All @@ -3271,7 +3280,7 @@
"valid": false,
"purifiable": false,
"prereqs": [ "MASOCHIST", "PAINRESIST" ],
"prereqs2": [ "PAINREC3" ],
"prereqs2": [ "PAINREC1" ],
"cancels": [ "MORE_PAIN", "MORE_PAIN2", "MORE_PAIN3" ],
"threshreq": [ "THRESH_MEDICAL" ],
"category": [ "MEDICAL" ]
Expand Down
9 changes: 0 additions & 9 deletions data/json/obsoletion/mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@
"valid": false,
"player_display": false
},
{
"type": "mutation",
"id": "PAINREC1",
"name": { "str": "Pain Recovery" },
"points": 0,
"description": "You recover from pain slightly faster than normal. DUMMIED OUT because it wasn't actually functional…",
"valid": false,
"player_display": false
},
{
"type": "mutation",
"id": "PAINREC2",
Expand Down
4 changes: 3 additions & 1 deletion src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4562,7 +4562,8 @@ void Character::regen( int rate_multiplier )
{
int pain_ticks = rate_multiplier;
while( get_pain() > 0 && pain_ticks-- > 0 ) {
mod_pain( -roll_remainder( 0.2f + get_pain() / 50.0f ) );
mod_pain( -roll_remainder( ( 0.2f + get_pain() / 50.0f ) * ( 1.0f +
mutation_value( "pain_recovery" ) ) ) );
}

float rest = rest_quality();
Expand Down Expand Up @@ -6723,6 +6724,7 @@ float calc_mutation_value_multiplicative( const std::vector<const mutation_branc

static const std::map<std::string, std::function <float( std::vector<const mutation_branch *> )>>
mutation_value_map = {
{ "pain_recovery", calc_mutation_value<&mutation_branch::pain_recovery> },
{ "healing_awake", calc_mutation_value<&mutation_branch::healing_awake> },
{ "healing_resting", calc_mutation_value<&mutation_branch::healing_resting> },
{ "mending_modifier", calc_mutation_value<&mutation_branch::mending_modifier> },
Expand Down
1 change: 0 additions & 1 deletion src/character.h
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,6 @@ class Character : public Creature, public visitable<Character>
void suffer_from_chemimbalance();
void suffer_from_schizophrenia();
void suffer_from_asthma( int current_stim );
void suffer_from_pain();
void suffer_in_sunlight();
void suffer_from_sunburn();
void suffer_from_other_mutations();
Expand Down
2 changes: 2 additions & 0 deletions src/mutation.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ struct mutation_branch {
int bodytemp_min = 0;
int bodytemp_max = 0;
int bodytemp_sleep = 0;
// Pain Recovery per turn:
float pain_recovery = 0.0f;
// Healing per turn
float healing_awake = 0.0f;
float healing_resting = 0.0f;
Expand Down
1 change: 1 addition & 0 deletions src/mutation_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ void mutation_branch::load( const JsonObject &jo, const std::string & )
vitamin_absorb_multi.emplace( material_id( pair.get_string( 0 ) ), vit );
}

optional( jo, was_loaded, "pain_recovery", pain_recovery, 0.0f );
optional( jo, was_loaded, "healing_awake", healing_awake, 0.0f );
optional( jo, was_loaded, "healing_resting", healing_resting, 0.0f );
optional( jo, was_loaded, "mending_modifier", mending_modifier, 1.0f );
Expand Down
5 changes: 0 additions & 5 deletions src/suffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1460,10 +1460,6 @@ void Character::suffer_without_sleep( const int sleep_deprivation )
}
}

void Character::suffer_from_pain()
{
}

void Character::suffer()
{
const int current_stim = get_stim();
Expand Down Expand Up @@ -1520,7 +1516,6 @@ void Character::suffer()
}

suffer_without_sleep( sleep_deprivation );
suffer_from_pain();
//Suffer from enchantments
enchantment_cache->activate_passive( *this );

Expand Down