Skip to content

Commit

Permalink
Pain immunity flag + flat pain modifier (#63636)
Browse files Browse the repository at this point in the history
* jsonized suffering

* linting

* more linting

* Update character.cpp

* linting linting

* Update character.cpp

* Update character.cpp

* some fixes

* more fixes

* Update src/character.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update character.cpp

* Update character.cpp

* Squashed commit of the following:

commit c6d7d31
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 8 19:34:50 2023 +0300

    Update torso_armor.json

commit 6d44c3a
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 8 19:34:02 2023 +0300

    Update torso_armor.json

commit f153105
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 8 19:29:10 2023 +0300

    Update suits_protection.json

commit 2f71c08
Author: KHeket <[email protected]>
Date:   Wed Mar 8 18:12:52 2023 +0300

    Freezer recipe and disassemble (#63895)

    Recipe for freezer and disassemble functionality for it

* Update src/activity_handlers.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* docs

* Update MUTATIONS.md

* Update mutation.h

* fix constant ordering

* ordering

* Update iuse.cpp

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kevin Granade <[email protected]>
  • Loading branch information
3 people authored Apr 15, 2023
1 parent d65be5a commit 13f8d81
Show file tree
Hide file tree
Showing 19 changed files with 56 additions and 36 deletions.
4 changes: 4 additions & 0 deletions data/json/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -1725,6 +1725,10 @@
"id": "TOUGH_FEET",
"type": "json_flag"
},
{
"id": "PAIN_IMMUNE",
"type": "json_flag"
},
{
"id": "TOURNIQUET",
"type": "json_flag"
Expand Down
3 changes: 2 additions & 1 deletion data/json/mutations/mutations.json
Original file line number Diff line number Diff line change
Expand Up @@ -4464,7 +4464,8 @@
"prereqs2": [ "PAINREC3" ],
"threshreq": [ "THRESH_MEDICAL" ],
"//": "MASOCHIST_MED, CENOBITE, and NOPAIN don't cancel each other. By design. Poor painless people...",
"category": [ "MEDICAL" ]
"category": [ "MEDICAL" ],
"flags": [ "PAIN_IMMUNE" ]
},
{
"type": "mutation",
Expand Down
1 change: 1 addition & 0 deletions doc/MUTATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ Note that **all new traits that can be obtained through mutation must be purifia
"deactivated_eocs": [ "eoc_id_1" ], // List of effect_on_conditions that attempt to activate when this mutation is successfully deactivated.
"enchantments": [ "ench_id_1" ], // List of enchantments granted by this mutation. Can be either IDs or an inline definition of the enchantment (see MAGIC.md)
"temperature_speed_modifier": 0.5, // If nonzero, become slower when cold, and faster when hot (1.0 gives +/-1% speed for each degree above or below 65 F).
"pain_modifier": 5, // Flat increase (for positive numbers)\ reduction (for negative) to the amount of pain recived. Reduction can go all the way to 0. Applies after pain enchantment. (so if you have Pain Resistant trait along with 5 flat pain reduction and recive 20 pain, you would gain 20*(1-0.25)-5=10 pain)
"mana_modifier": 100, // Positive or negative change to total mana pool.
"flags": [ "UNARMED_BONUS" ], // List of flag_IDs and json_flag_IDs granted by the mutation. Note: trait_IDs can be set and generate no errors, but they're not actually "active".
"moncams": [ [ "mon_player_blob", 16 ] ] // Monster cameras, ability to use friendly monster's from the list as additional source of vision. Max view distance is equal to monster's daytime vision. The number specifies the range at which it can "transmit" vision to the avatar.
Expand Down
5 changes: 3 additions & 2 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ static const itype_id itype_burnt_out_bionic( "burnt_out_bionic" );
static const itype_id itype_muscle( "muscle" );

static const json_character_flag json_flag_CANNIBAL( "CANNIBAL" );
static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );
static const json_character_flag json_flag_PSYCHOPATH( "PSYCHOPATH" );
static const json_character_flag json_flag_SAPIOVORE( "SAPIOVORE" );

Expand All @@ -208,7 +209,6 @@ static const species_id species_HUMAN( "HUMAN" );
static const species_id species_ZOMBIE( "ZOMBIE" );

static const trait_id trait_DEBUG_HS( "DEBUG_HS" );
static const trait_id trait_NOPAIN( "NOPAIN" );
static const trait_id trait_SPIRITUAL( "SPIRITUAL" );
static const trait_id trait_STOCKY_TROGLO( "STOCKY_TROGLO" );

Expand Down Expand Up @@ -2857,7 +2857,8 @@ void activity_handlers::operation_do_turn( player_activity *act, Character *you
Character &player_character = get_player_character();
const bool u_see = player_character.sees( you->pos() ) &&
( !player_character.has_effect( effect_narcosis ) ||
player_character.has_bionic( bio_painkiller ) || player_character.has_trait( trait_NOPAIN ) );
player_character.has_bionic( bio_painkiller ) ||
player_character.has_flag( json_flag_PAIN_IMMUNE ) );

const int difficulty = act->values.front();

Expand Down
4 changes: 2 additions & 2 deletions src/avatar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ static const itype_id itype_guidebook( "guidebook" );
static const itype_id itype_mut_longpull( "mut_longpull" );

static const json_character_flag json_flag_ALARMCLOCK( "ALARMCLOCK" );
static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );
static const json_character_flag json_flag_WEBBED_HANDS( "WEBBED_HANDS" );

static const move_mode_id move_mode_crouch( "crouch" );
Expand All @@ -129,7 +130,6 @@ static const trait_id trait_DEBUG_CLOAK( "DEBUG_CLOAK" );
static const trait_id trait_INSECT_ARMS( "INSECT_ARMS" );
static const trait_id trait_INSECT_ARMS_OK( "INSECT_ARMS_OK" );
static const trait_id trait_M_SKIN3( "M_SKIN3" );
static const trait_id trait_NOPAIN( "NOPAIN" );
static const trait_id trait_PROF_DICEMASTER( "PROF_DICEMASTER" );
static const trait_id trait_SHELL2( "SHELL2" );
static const trait_id trait_SHELL3( "SHELL3" );
Expand Down Expand Up @@ -1793,7 +1793,7 @@ void avatar::reassign_item( item &it, int invlet )

void avatar::add_pain_msg( int val, const bodypart_id &bp ) const
{
if( has_trait( trait_NOPAIN ) ) {
if( has_flag( json_flag_PAIN_IMMUNE ) ) {
return;
}
if( bp == bodypart_id( "bp_null" ) ) {
Expand Down
12 changes: 6 additions & 6 deletions src/bionics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ static const json_character_flag json_flag_BIONIC_POWER_SOURCE( "BIONIC_POWER_SO
static const json_character_flag json_flag_BIONIC_TOGGLED( "BIONIC_TOGGLED" );
static const json_character_flag json_flag_BIONIC_WEAPON( "BIONIC_WEAPON" );
static const json_character_flag json_flag_ENHANCED_VISION( "ENHANCED_VISION" );
static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );

static const material_id fuel_type_metabolism( "metabolism" );
static const material_id fuel_type_sun_light( "sunlight" );
Expand Down Expand Up @@ -189,7 +190,6 @@ static const trait_id trait_DEBUG_BIONICS( "DEBUG_BIONICS" );
static const trait_id trait_MASOCHIST( "MASOCHIST" );
static const trait_id trait_MASOCHIST_MED( "MASOCHIST_MED" );
static const trait_id trait_NONE( "NONE" );
static const trait_id trait_NOPAIN( "NOPAIN" );
static const trait_id trait_PROF_AUTODOC( "PROF_AUTODOC" );
static const trait_id trait_PROF_MED( "PROF_MED" );
static const trait_id trait_PYROMANIA( "PYROMANIA" );
Expand Down Expand Up @@ -1807,7 +1807,7 @@ void Character::bionics_uninstall_failure( int difficulty, int success, float ad
std::set<bodypart_id> bp_hurt;
switch( fail_type ) {
case 1:
if( !has_trait( trait_NOPAIN ) ) {
if( !has_flag( json_flag_PAIN_IMMUNE ) ) {
add_msg_if_player( m_bad, _( "It really hurts!" ) );
mod_pain( rng( 10, 30 ) );
}
Expand Down Expand Up @@ -1894,7 +1894,7 @@ void Character::bionics_uninstall_failure( monster &installer, Character &patien
std::set<bodypart_id> bp_hurt;
switch( fail_type ) {
case 1:
if( !has_trait( trait_NOPAIN ) ) {
if( !has_flag( json_flag_PAIN_IMMUNE ) ) {
patient.add_msg_if_player( m_bad, _( "It really hurts!" ) );
patient.mod_pain( rng( 10, 30 ) );
}
Expand Down Expand Up @@ -1947,7 +1947,7 @@ bool Character::has_enough_anesth( const itype &cbm, Character &patient ) const
return false;
}

if( patient.has_bionic( bio_painkiller ) || patient.has_trait( trait_NOPAIN ) ||
if( patient.has_bionic( bio_painkiller ) || patient.has_flag( json_flag_PAIN_IMMUNE ) ||
has_trait( trait_DEBUG_BIONICS ) ) {
return true;
}
Expand All @@ -1961,7 +1961,7 @@ bool Character::has_enough_anesth( const itype &cbm, Character &patient ) const

bool Character::has_enough_anesth( const itype &cbm ) const
{
if( has_bionic( bio_painkiller ) || has_trait( trait_NOPAIN ) ||
if( has_bionic( bio_painkiller ) || has_flag( json_flag_PAIN_IMMUNE ) ||
has_trait( trait_DEBUG_BIONICS ) ) {
return true;
}
Expand Down Expand Up @@ -2569,7 +2569,7 @@ void Character::bionics_install_failure( const bionic_id &bid, const std::string
switch( fail_type ) {

case 1:
if( !has_trait( trait_NOPAIN ) ) {
if( !has_flag( json_flag_PAIN_IMMUNE ) ) {
add_msg_if_player( m_bad, _( "It really hurts!" ) );
mod_pain( rng( 10, 30 ) );
}
Expand Down
15 changes: 11 additions & 4 deletions src/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ static const json_character_flag json_flag_NON_THRESH( "NON_THRESH" );
static const json_character_flag json_flag_NO_DISEASE( "NO_DISEASE" );
static const json_character_flag json_flag_NO_RADIATION( "NO_RADIATION" );
static const json_character_flag json_flag_NO_THIRST( "NO_THIRST" );
static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );
static const json_character_flag json_flag_PRED2( "PRED2" );
static const json_character_flag json_flag_PRED3( "PRED3" );
static const json_character_flag json_flag_PRED4( "PRED4" );
Expand Down Expand Up @@ -437,7 +438,6 @@ static const trait_id trait_NIGHTVISION3( "NIGHTVISION3" );
static const trait_id trait_NOMAD( "NOMAD" );
static const trait_id trait_NOMAD2( "NOMAD2" );
static const trait_id trait_NOMAD3( "NOMAD3" );
static const trait_id trait_NOPAIN( "NOPAIN" );
static const trait_id trait_PACIFIST( "PACIFIST" );
static const trait_id trait_PADDED_FEET( "PADDED_FEET" );
static const trait_id trait_PARAIMMUNE( "PARAIMMUNE" );
Expand Down Expand Up @@ -4662,7 +4662,7 @@ void Character::update_needs( int rate_multiplier )

// Huge folks take penalties for cramming themselves in vehicles
if( in_vehicle && get_size() == creature_size::huge &&
!( has_trait( trait_NOPAIN ) || has_effect( effect_narcosis ) ) ) {
!( has_flag( json_flag_PAIN_IMMUNE ) || has_effect( effect_narcosis ) ) ) {
vehicle *veh = veh_pointer_or_null( get_map().veh_at( pos() ) );
// it's painful to work the controls, but passengers in open topped vehicles are fine
if( veh && ( veh->enclosed_at( pos() ) || veh->player_in_control( *this ) ) ) {
Expand Down Expand Up @@ -4806,7 +4806,7 @@ void Character::check_needs_extremes()
get_event_bus().send<event_type::dies_from_drug_overdose>( getID(), efftype_id() );
set_part_hp_cur( body_part_torso, 0 );
} else if( has_effect( effect_jetinjector ) && get_effect_dur( effect_jetinjector ) > 40_minutes ) {
if( !has_trait( trait_NOPAIN ) ) {
if( !has_flag( json_flag_PAIN_IMMUNE ) ) {
add_msg_player_or_npc( m_bad,
_( "Your heart spasms painfully and stops." ),
_( "<npcname>'s heart spasms painfully and stops." ) );
Expand Down Expand Up @@ -5806,6 +5806,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 = {
{ "healing_awake", calc_mutation_value<&mutation_branch::healing_awake> },
{ "pain_modifier", calc_mutation_value<&mutation_branch::pain_modifier> },
{ "healing_multiplier", calc_mutation_value_multiplicative<&mutation_branch::healing_multiplier> },
{ "mending_modifier", calc_mutation_value_multiplicative<&mutation_branch::mending_modifier> },
{ "hp_modifier", calc_mutation_value<&mutation_branch::hp_modifier> },
Expand Down Expand Up @@ -11160,7 +11161,7 @@ void Character::mod_pain( int npain )
{
if( npain > 0 ) {
double mult = enchantment_cache->get_value_multiply( enchant_vals::mod::PAIN );
if( has_trait( trait_NOPAIN ) || has_effect( effect_narcosis ) ) {
if( has_flag( json_flag_PAIN_IMMUNE ) || has_effect( effect_narcosis ) ) {
return;
}
// if there is a positive multiplier we always want to add at least 1 pain
Expand All @@ -11170,6 +11171,12 @@ void Character::mod_pain( int npain )
if( mult < 0 ) {
npain = roll_remainder( npain * ( 1 + mult ) );
}
if( mutation_value( "pain_modifier" ) != 0 ) {
npain = roll_remainder( npain + mutation_value( "pain_modifier" ) );
if( npain < 0 ) {
return;
}
}
npain += enchantment_cache->get_value_add( enchant_vals::mod::PAIN );

// no matter how powerful the enchantment if we are gaining pain we always gain at least a little/don't lose any
Expand Down
4 changes: 2 additions & 2 deletions src/character_body.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ static const json_character_flag json_flag_HEAT_IMMUNE( "HEAT_IMMUNE" );
static const json_character_flag json_flag_IGNORE_TEMP( "IGNORE_TEMP" );
static const json_character_flag json_flag_LIMB_LOWER( "LIMB_LOWER" );
static const json_character_flag json_flag_NO_THIRST( "NO_THIRST" );
static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );

static const trait_id trait_BARK( "BARK" );
static const trait_id trait_CHITIN_FUR( "CHITIN_FUR" );
Expand All @@ -74,7 +75,6 @@ static const trait_id trait_FUR( "FUR" );
static const trait_id trait_LIGHTFUR( "LIGHTFUR" );
static const trait_id trait_LUPINE_FUR( "LUPINE_FUR" );
static const trait_id trait_M_DEPENDENT( "M_DEPENDENT" );
static const trait_id trait_NOPAIN( "NOPAIN" );
static const trait_id trait_PYROMANIA( "PYROMANIA" );
static const trait_id trait_SLIMY( "SLIMY" );
static const trait_id trait_URSINE_FUR( "URSINE_FUR" );
Expand Down Expand Up @@ -1100,7 +1100,7 @@ bodypart_id Character::body_window( const std::string &menu_header,

// If this is an NPC, the player is the one examining them and so the fact
// that they can't self-diagnose effectively doesn't matter
bool no_feeling = is_avatar() && has_trait( trait_NOPAIN );
bool no_feeling = is_avatar() && has_flag( json_flag_PAIN_IMMUNE );

for( size_t i = 0; i < parts.size(); i++ ) {
const healable_bp &e = parts[i];
Expand Down
1 change: 1 addition & 0 deletions src/flag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ const flag_id flag_ORGANIC( "ORGANIC" );
const flag_id flag_OUTER( "OUTER" );
const flag_id flag_OVERSIZE( "OVERSIZE" );
const flag_id flag_PADDED( "PADDED" );
const flag_id flag_PAIN_IMMUNE( "PAIN_IMMUNE" );
const flag_id flag_PALS_LARGE( "PALS_LARGE" );
const flag_id flag_PALS_MEDIUM( "PALS_MEDIUM" );
const flag_id flag_PALS_SMALL( "PALS_SMALL" );
Expand Down
1 change: 1 addition & 0 deletions src/flag.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ extern const flag_id flag_ORGANIC;
extern const flag_id flag_OUTER;
extern const flag_id flag_OVERSIZE;
extern const flag_id flag_PADDED;
extern const flag_id flag_PAIN_IMMUNE;
extern const flag_id flag_PALS_SMALL;
extern const flag_id flag_PALS_MEDIUM;
extern const flag_id flag_PALS_LARGE;
Expand Down
5 changes: 3 additions & 2 deletions src/game_inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,13 @@ static const flag_id json_flag_CALORIES_INTAKE( "CALORIES_INTAKE" );

static const itype_id itype_fitness_band( "fitness_band" );

static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );

static const quality_id qual_ANESTHESIA( "ANESTHESIA" );

static const requirement_id requirement_data_anesthetic( "anesthetic" );

static const trait_id trait_DEBUG_BIONICS( "DEBUG_BIONICS" );
static const trait_id trait_NOPAIN( "NOPAIN" );
static const trait_id trait_SAPROPHAGE( "SAPROPHAGE" );
static const trait_id trait_SAPROVORE( "SAPROVORE" );

Expand Down Expand Up @@ -2231,7 +2232,7 @@ static item_location autodoc_internal( Character &you, Character &patient,
int drug_count = 0;

if( !surgeon ) {//surgeon use their own anesthetic, player just need money
if( patient.has_trait( trait_NOPAIN ) ) {
if( patient.has_flag( json_flag_PAIN_IMMUNE ) ) {
hint = _( "<color_yellow>Patient has deadened nerves. Anesthesia unneeded.</color>" );
} else if( patient.has_bionic( bio_painkiller ) ) {
hint = _( "<color_yellow>Patient has Sensory Dulling CBM installed. Anesthesia unneeded.</color>" );
Expand Down
4 changes: 2 additions & 2 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ static const itype_id itype_unfinished_cac2( "unfinished_cac2" );
static const itype_id itype_unfinished_charcoal( "unfinished_charcoal" );

static const json_character_flag json_flag_ATTUNEMENT( "ATTUNEMENT" );
static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );
static const json_character_flag json_flag_SUPER_HEARING( "SUPER_HEARING" );
static const json_character_flag json_flag_WALL_CLING( "WALL_CLING" );

Expand Down Expand Up @@ -237,7 +238,6 @@ static const trait_id trait_M_DEFENDER( "M_DEFENDER" );
static const trait_id trait_M_DEPENDENT( "M_DEPENDENT" );
static const trait_id trait_M_FERTILE( "M_FERTILE" );
static const trait_id trait_M_SPORES( "M_SPORES" );
static const trait_id trait_NOPAIN( "NOPAIN" );
static const trait_id trait_PROBOSCIS( "PROBOSCIS" );
static const trait_id trait_PYROMANIA( "PYROMANIA" );
static const trait_id trait_SHELL2( "SHELL2" );
Expand Down Expand Up @@ -5174,7 +5174,7 @@ void iexamine::autodoc( Character &you, const tripoint &examp )
bool needs_anesthesia = true;
std::vector<tool_comp> anesth_kit;

if( patient.has_trait( trait_NOPAIN ) || patient.has_bionic( bio_painkiller ) ||
if( patient.has_flag( json_flag_PAIN_IMMUNE ) || patient.has_bionic( bio_painkiller ) ||
amenu.ret > 1 ) {
needs_anesthesia = false;
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ static const json_character_flag json_flag_ENHANCED_VISION( "ENHANCED_VISION" );
static const json_character_flag json_flag_HYPEROPIC( "HYPEROPIC" );
static const json_character_flag json_flag_MYOPIC( "MYOPIC" );
static const json_character_flag json_flag_MYOPIC_IN_LIGHT( "MYOPIC_IN_LIGHT" );
static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );

static const mongroup_id GROUP_FISH( "GROUP_FISH" );

Expand Down Expand Up @@ -377,7 +378,6 @@ static const trait_id trait_MARLOSS_AVOID( "MARLOSS_AVOID" );
static const trait_id trait_MARLOSS_BLUE( "MARLOSS_BLUE" );
static const trait_id trait_MARLOSS_YELLOW( "MARLOSS_YELLOW" );
static const trait_id trait_M_DEPENDENT( "M_DEPENDENT" );
static const trait_id trait_NOPAIN( "NOPAIN" );
static const trait_id trait_PSYCHOPATH( "PSYCHOPATH" );
static const trait_id trait_PYROMANIA( "PYROMANIA" );
static const trait_id trait_SPIRITUAL( "SPIRITUAL" );
Expand Down Expand Up @@ -769,7 +769,7 @@ std::optional<int> iuse::antiparasitic( Character *p, item *, bool, const tripoi
if( p->has_effect( effect_tapeworm ) ) {
p->remove_effect( effect_tapeworm );
p->guts.mod_nutr( -1 ); // You just digested the tapeworm.
if( p->has_trait( trait_NOPAIN ) ) {
if( p->has_flag( json_flag_PAIN_IMMUNE ) ) {
p->add_msg_if_player( m_good, _( "Your bowels clench as something inside them dies." ) );
} else {
p->add_msg_if_player( m_mixed, _( "Your bowels spasm painfully as something inside them dies." ) );
Expand All @@ -786,7 +786,7 @@ std::optional<int> iuse::antiparasitic( Character *p, item *, bool, const tripoi
}
if( p->has_effect( effect_brainworms ) ) {
p->remove_effect( effect_brainworms );
if( p->has_trait( trait_NOPAIN ) ) {
if( p->has_flag( json_flag_PAIN_IMMUNE ) ) {
p->add_msg_if_player( m_good, _( "The pressure inside your head feels better already." ) );
} else {
p->add_msg_if_player( m_mixed,
Expand All @@ -796,7 +796,7 @@ std::optional<int> iuse::antiparasitic( Character *p, item *, bool, const tripoi
}
if( p->has_effect( effect_paincysts ) ) {
p->remove_effect( effect_paincysts );
if( p->has_trait( trait_NOPAIN ) ) {
if( p->has_flag( json_flag_PAIN_IMMUNE ) ) {
p->add_msg_if_player( m_good, _( "The stiffness in your joints goes away." ) );
} else {
p->add_msg_if_player( m_good, _( "The pain in your joints goes away." ) );
Expand Down
4 changes: 2 additions & 2 deletions src/medical_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ static const efftype_id effect_infected( "infected" );
static const efftype_id effect_mending( "mending" );

static const json_character_flag json_flag_ECTOTHERM( "ECTOTHERM" );
static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );

static const trait_id trait_NOPAIN( "NOPAIN" );
static const trait_id trait_SUNLIGHT_DEPENDENT( "SUNLIGHT_DEPENDENT" );
static const trait_id trait_TROGLO( "TROGLO" );
static const trait_id trait_TROGLO2( "TROGLO2" );
Expand Down Expand Up @@ -353,7 +353,7 @@ static medical_column draw_health_summary( const int column_count, avatar *playe
const bool bleeding = bleed_intensity > 0;
const bool bitten = player->has_effect( effect_bite, part.id() );
const bool infected = player->has_effect( effect_infected, part.id() );
const bool no_feeling = player->has_trait( trait_NOPAIN );
const bool no_feeling = player->has_flag( json_flag_PAIN_IMMUNE );
const int maximal_hp = player->get_part_hp_max( part );
const int current_hp = player->get_part_hp_cur( part );
const bool limb_is_broken = player->is_limb_broken( part );
Expand Down
1 change: 1 addition & 0 deletions src/mutation.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ struct mutation_branch {
std::optional<float> healing_multiplier = std::nullopt;
// Limb mending bonus
std::optional<float> mending_modifier = std::nullopt;
std::optional<float> pain_modifier = std::nullopt;
// Bonus HP multiplier. That is, 1.0 doubles hp, -0.5 halves it.
std::optional<float> hp_modifier = std::nullopt;
// Second HP modifier that stacks with first but is otherwise identical.
Expand Down
Loading

0 comments on commit 13f8d81

Please sign in to comment.