Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 81dfd3a
Merge: d195323 4ad1388
Author: Dan1ss1mo <[email protected]>
Date:   Thu Mar 23 20:46:11 2023 +0300

    Merge branch 'master' into painres

commit d195323
Merge: d0292a7 53f9146
Author: Dan1ss1mo <[email protected]>
Date:   Thu Mar 16 10:58:40 2023 +0300

    Merge branch 'CleverRaven:master' into painres

commit d0292a7
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 15 22:30:19 2023 +0300

    Update MUTATIONS.md

commit a09ce31
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 15 22:27:34 2023 +0300

    docs

commit d240fd4
Author: Dan1ss1mo <[email protected]>
Date:   Tue Mar 14 15:33:11 2023 +0300

    Update src/activity_handlers.cpp

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

commit f2a3a63
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 8 22:51:44 2023 +0300

    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 (CleverRaven#63895)

        Recipe for freezer and disassemble functionality for it

commit 07827cf
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 8 17:54:34 2023 +0300

    Update character.cpp

commit fb28325
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 8 17:53:54 2023 +0300

    Update character.cpp

commit cd96311
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 8 17:14:20 2023 +0300

    Update src/character.cpp

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

commit b53ea93
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 8 17:13:30 2023 +0300

    more fixes

commit bab702c
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 8 17:07:41 2023 +0300

    some fixes

commit f3ab69d
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 8 16:56:55 2023 +0300

    Update character.cpp

commit f178740
Merge: 9e352aa 2579396
Author: Dan1ss1mo <[email protected]>
Date:   Wed Mar 8 16:44:50 2023 +0300

    Merge branch 'master' into painres

commit 9e352aa
Author: Dan1ss1mo <[email protected]>
Date:   Sun Feb 19 20:01:10 2023 +0300

    Update character.cpp

commit 460e05a
Author: Dan1ss1mo <[email protected]>
Date:   Sun Feb 19 15:04:24 2023 +0300

    linting linting

commit eab3f07
Author: Dan1ss1mo <[email protected]>
Date:   Sun Feb 19 14:58:40 2023 +0300

    Update character.cpp

commit 684d174
Merge: 4e5a4cf 19cdc74
Author: Dan1ss1mo <[email protected]>
Date:   Fri Feb 17 22:03:13 2023 +0300

    Merge branch 'painres' of https://github.com/Dan1ss1mo/Cataclysm-DDA into painres

commit 4e5a4cf
Author: Dan1ss1mo <[email protected]>
Date:   Fri Feb 17 22:02:25 2023 +0300

    more linting

commit 19cdc74
Author: Dan1ss1mo <[email protected]>
Date:   Fri Feb 17 21:48:31 2023 +0300

    linting

commit db14729
Merge: 53d2559 17a7444
Author: Dan1ss1mo <[email protected]>
Date:   Fri Feb 17 21:41:05 2023 +0300

    Merge branch 'painres' of https://github.com/Dan1ss1mo/Cataclysm-DDA into painres

commit 53d2559
Author: Dan1ss1mo <[email protected]>
Date:   Fri Feb 17 21:40:26 2023 +0300

    jsonized suffering
  • Loading branch information
Dan1ss1mo committed Mar 23, 2023
1 parent 5cdee93 commit 98e6019
Show file tree
Hide file tree
Showing 19 changed files with 58 additions and 37 deletions.
4 changes: 4 additions & 0 deletions data/json/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,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 @@ -4462,7 +4462,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 @@ -238,6 +238,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".
}
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 @@ -2860,7 +2860,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 @@ -163,6 +163,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 @@ -190,7 +191,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 @@ -1800,7 +1800,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 @@ -1887,7 +1887,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 @@ -1940,7 +1940,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 @@ -1954,7 +1954,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 @@ -2562,7 +2562,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 @@ -313,6 +313,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 @@ -435,7 +436,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 @@ -4653,7 +4653,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 @@ -4797,7 +4797,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 @@ -5797,6 +5797,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 @@ -11022,7 +11023,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 @@ -11032,6 +11033,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 @@ -69,6 +69,8 @@ static const activity_id ACT_EAT_MENU( "ACT_EAT_MENU" );
static const bionic_id bio_fitnessband( "bio_fitnessband" );
static const bionic_id bio_painkiller( "bio_painkiller" );

static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );

static const flag_id json_flag_CALORIES_INTAKE( "CALORIES_INTAKE" );

static const itype_id itype_fitness_band( "fitness_band" );
Expand All @@ -78,7 +80,6 @@ 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 @@ -2227,7 +2228,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 @@ -5178,7 +5178,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
9 changes: 5 additions & 4 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ static const efftype_id effect_weak_antibiotic_visible( "weak_antibiotic_visible
static const efftype_id effect_webbed( "webbed" );
static const efftype_id effect_weed_high( "weed_high" );

static const json_character_flag json_flag_PAIN_IMMUNE( "PAIN_IMMUNE" );

static const flag_id json_flag_POWER_CORD( "POWER_CORD" );

static const furn_str_id furn_f_translocator_buoy( "f_translocator_buoy" );
Expand Down Expand Up @@ -376,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 @@ -772,7 +773,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 @@ -789,7 +790,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 @@ -799,7 +800,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
3 changes: 2 additions & 1 deletion src/mutation.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ struct mutation_branch {
std::optional<float> healing_awake = std::nullopt;
std::optional<float> healing_multiplier = std::nullopt;
// Limb mending bonus
std::optional<float> mending_modifier = std::nullopt;
std::optional<float> mending_modifier = cata::nullopt;
std::optional<float> pain_modifier = cata::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 98e6019

Please sign in to comment.