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

[wip do not merge] encapsulate character mutation data into a new class, character_mutations #34807

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9362af1
create character_mutations and change scope
KorGgenT Oct 13, 2019
910d733
remove Creature::has_trait()
KorGgenT Oct 13, 2019
4ee35bf
player::has_trait to player:::mutations::has_trait
KorGgenT Oct 13, 2019
bd4df5b
get_trait_data
KorGgenT Oct 14, 2019
aa76cee
add Character to function parameters
KorGgenT Oct 14, 2019
bef01c7
add character to function parameters
KorGgenT Oct 16, 2019
b484134
add mutations. to get members
KorGgenT Oct 16, 2019
e08341d
astyle mutation.cpp
KorGgenT Oct 16, 2019
5a2276a
fix try_reject_mutagen()
KorGgenT Oct 16, 2019
c891bc5
fix mutagen_common_checks()
KorGgenT Oct 16, 2019
25a32ea
remove accidentally re-added function declaration
KorGgenT Oct 17, 2019
d71cdc5
fix includes
KorGgenT Oct 17, 2019
a8de1ab
fix call to get_mutations()
KorGgenT Oct 17, 2019
a73a60b
fix get_trait_data()
KorGgenT Oct 17, 2019
e9bb02d
get_trait_data
KorGgenT Oct 17, 2019
b17060a
fix function calls
KorGgenT Oct 17, 2019
0397d5d
get_cat_level()
KorGgenT Oct 17, 2019
e05b17f
fix function calls
KorGgenT Oct 17, 2019
052faee
on_mutation_loss()
KorGgenT Oct 17, 2019
d028958
fix function calls
KorGgenT Oct 17, 2019
8b413e7
astyle
KorGgenT Oct 17, 2019
7add60c
save/load mutations
KorGgenT Oct 17, 2019
eb480b6
fix function calls
KorGgenT Oct 18, 2019
5a33e08
water tolerance
KorGgenT Oct 18, 2019
52cff4a
fix function calls
KorGgenT Oct 18, 2019
8174887
fix function calls
KorGgenT Oct 18, 2019
864474e
fix bad rebase
KorGgenT Oct 18, 2019
555e54e
add Character parameter to mutation_attacks()
KorGgenT Oct 18, 2019
7c9b653
astyle - mutation_attacks
KorGgenT Oct 18, 2019
7d30db8
fix function calls
KorGgenT Oct 18, 2019
61e534b
fix function calls
KorGgenT Oct 18, 2019
a3bd2b8
add Character::resists_effect override
KorGgenT Oct 19, 2019
4c314b5
debug - print_cat_levels()
KorGgenT Oct 19, 2019
bb543d2
remov override on resists_effect
KorGgenT Oct 19, 2019
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
11 changes: 6 additions & 5 deletions src/activity_handlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,9 @@ static void set_up_butchery( player_activity &act, player &u, butcher_type actio
// applies to all butchery actions
const bool is_human = corpse.id == mtype_id::NULL_ID() || ( corpse.in_species( HUMAN ) &&
!corpse.in_species( ZOMBIE ) );
if( is_human && !( u.has_trait_flag( "CANNIBAL" ) || u.has_trait_flag( "PSYCHOPATH" ) ||
u.has_trait_flag( "SAPIOVORE" ) ) ) {
if( is_human && !( u.mutations.has_trait_flag( "CANNIBAL" ) ||
u.mutations.has_trait_flag( "PSYCHOPATH" ) ||
u.mutations.has_trait_flag( "SAPIOVORE" ) ) ) {

if( u.is_player() ) {
if( query_yn( _( "Would you dare desecrate the mortal remains of a fellow human being?" ) ) ) {
Expand Down Expand Up @@ -1696,7 +1697,7 @@ void activity_handlers::pickaxe_finish( player_activity *act, player *p )
// Betcha wish you'd opted for the J-Hammer ;P
p->mod_stored_nutr( 15 - ( helpersize * 3 ) );
p->mod_thirst( 15 - ( helpersize * 3 ) );
if( p->has_trait( trait_id( "STOCKY_TROGLO" ) ) ) {
if( p->mutations.has_trait( trait_id( "STOCKY_TROGLO" ) ) ) {
p->mod_fatigue( 20 - ( helpersize * 3 ) ); // Yep, dwarves can dig longer before tiring
} else {
p->mod_fatigue( 30 - ( helpersize * 3 ) );
Expand Down Expand Up @@ -4161,7 +4162,7 @@ void activity_handlers::tree_communion_do_turn( player_activity *act, player *p
if( act->values.front() > 0 ) {
act->values.front() -= 1;
if( act->values.front() == 0 ) {
if( p->has_trait( trait_id( "SPIRITUAL" ) ) ) {
if( p->mutations.has_trait( trait_id( "SPIRITUAL" ) ) ) {
p->add_msg_if_player( m_good, _( "The ancient tree spirits answer your call." ) );
} else {
p->add_msg_if_player( m_good, _( "Your communion with the trees has begun." ) );
Expand All @@ -4185,7 +4186,7 @@ void activity_handlers::tree_communion_do_turn( player_activity *act, player *p
while( !q.empty() ) {
tripoint tpt = q.front();
if( overmap_buffer.reveal( tpt, 3, filter ) ) {
if( p->has_trait( trait_id( "SPIRITUAL" ) ) ) {
if( p->mutations.has_trait( trait_id( "SPIRITUAL" ) ) ) {
p->add_morale( MORALE_TREE_COMMUNION, 2, 30, 8_hours, 6_hours );
} else {
p->add_morale( MORALE_TREE_COMMUNION, 1, 15, 2_hours, 1_hours );
Expand Down
2 changes: 1 addition & 1 deletion src/addiction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ void addict_effect( player &u, addiction &add )
}

case ADD_MUTAGEN:
if( u.has_trait( trait_id( "MUT_JUNKIE" ) ) ) {
if( u.mutations.has_trait( trait_id( "MUT_JUNKIE" ) ) ) {
if( one_in( 600 - 50 * in ) ) {
u.add_msg_if_player( m_warning, rng( 0,
6 ) < in ? _( "You so miss the exquisite rainbow of post-humanity." ) :
Expand Down
2 changes: 1 addition & 1 deletion src/advanced_inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,7 @@ bool advanced_inventory::query_charges( aim_location destarea, const advanced_in
// Inventory has a weight capacity, map and vehicle don't have that
if( destarea == AIM_INVENTORY || destarea == AIM_WORN ) {
const units::mass unitweight = it.weight() / ( by_charges ? it.charges : 1 );
const units::mass max_weight = g->u.has_trait( trait_id( "DEBUG_STORAGE" ) ) ?
const units::mass max_weight = g->u.mutations.has_trait( trait_id( "DEBUG_STORAGE" ) ) ?
units::mass_max : g->u.weight_capacity() * 4 - g->u.weight_carried();
if( unitweight > 0_gram && unitweight * amount > max_weight ) {
const int weightmax = max_weight / unitweight;
Expand Down
46 changes: 24 additions & 22 deletions src/avatar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ size_t avatar::max_memorized_tiles() const
if( current_map_memory_turn != calendar::turn ) {
current_map_memory_turn = calendar::turn;
float map_memory_capacity_multiplier =
mutation_value( "map_memory_capacity_multiplier" );
mutations.mutation_value( "map_memory_capacity_multiplier" );
if( has_active_bionic( bio_memory ) ) {
map_memory_capacity_multiplier = 50;
}
Expand Down Expand Up @@ -272,9 +272,9 @@ const player *avatar::get_book_reader( const item &book, std::vector<std::string
}

// Check for conditions that disqualify us only if no NPCs can read to us
if( type->intel > 0 && has_trait( trait_ILLITERATE ) ) {
if( type->intel > 0 && mutations.has_trait( trait_ILLITERATE ) ) {
reasons.emplace_back( _( "You're illiterate!" ) );
} else if( has_trait( trait_HYPEROPIC ) && !worn_with_flag( "FIX_FARSIGHT" ) &&
} else if( mutations.has_trait( trait_HYPEROPIC ) && !worn_with_flag( "FIX_FARSIGHT" ) &&
!has_effect( effect_contacts ) && !has_bionic( bio_eye_optic ) ) {
reasons.emplace_back( _( "Your eyes won't focus without reading glasses." ) );
} else if( fine_detail_vision_mod() > 4 ) {
Expand All @@ -297,14 +297,15 @@ const player *avatar::get_book_reader( const item &book, std::vector<std::string

for( const npc *elem : candidates ) {
// Check for disqualifying factors:
if( type->intel > 0 && elem->has_trait( trait_ILLITERATE ) ) {
if( type->intel > 0 && elem->mutations.has_trait( trait_ILLITERATE ) ) {
reasons.push_back( string_format( _( "%s is illiterate!" ),
elem->disp_name() ) );
} else if( skill && elem->get_skill_level( skill ) < type->req &&
has_identified( book.typeId() ) ) {
reasons.push_back( string_format( _( "%s %d needed to understand. %s has %d" ),
skill.obj().name(), type->req, elem->disp_name(), elem->get_skill_level( skill ) ) );
} else if( elem->has_trait( trait_HYPEROPIC ) && !elem->worn_with_flag( "FIX_FARSIGHT" ) &&
} else if( elem->mutations.has_trait( trait_HYPEROPIC ) &&
!elem->worn_with_flag( "FIX_FARSIGHT" ) &&
!elem->has_effect( effect_contacts ) ) {
reasons.push_back( string_format( _( "%s needs reading glasses!" ),
elem->disp_name() ) );
Expand Down Expand Up @@ -347,7 +348,7 @@ int avatar::time_to_read( const item &book, const player &reader, const player *
retval *= std::min( fine_detail_vision_mod(), reader.fine_detail_vision_mod() );

const int effective_int = std::min( { get_int(), reader.get_int(), learner ? learner->get_int() : INT_MAX } );
if( type->intel > effective_int && !reader.has_trait( trait_PROF_DICEMASTER ) ) {
if( type->intel > effective_int && !reader.mutations.has_trait( trait_PROF_DICEMASTER ) ) {
retval += type->time * ( type->intel - effective_int ) * 100;
}
if( !has_identified( book.typeId() ) ) {
Expand Down Expand Up @@ -602,7 +603,7 @@ bool avatar::read( int inventory_position, const bool continuous )

const int intelligence = get_int();
const bool complex_penalty = type->intel > std::min( intelligence, reader->get_int() ) &&
!reader->has_trait( trait_PROF_DICEMASTER );
!reader->mutations.has_trait( trait_PROF_DICEMASTER );
const player *complex_player = reader->get_int() < intelligence ? reader : this;
if( complex_penalty && !continuous ) {
add_msg( m_warning,
Expand Down Expand Up @@ -806,7 +807,7 @@ void avatar::do_read( item &book )
}

if( ( skill_level == reading->level || !skill_level.can_train() ) ||
( ( learner->has_trait( trait_id( "SCHIZOPHRENIC" ) ) ||
( ( learner->mutations.has_trait( trait_id( "SCHIZOPHRENIC" ) ) ||
learner->has_artifact_with( AEP_SCHIZO ) ) && one_in( 25 ) ) ) {
if( learner->is_player() ) {
add_msg( m_info, _( "You can no longer learn from %s." ), book.type_name() );
Expand Down Expand Up @@ -962,7 +963,7 @@ void avatar::disp_morale()
}

int pain_penalty = 0;
if( get_perceived_pain() && !has_trait( trait_CENOBITE ) ) {
if( get_perceived_pain() && !mutations.has_trait( trait_CENOBITE ) ) {
pain_penalty = calc_focus_equilibrium( true ) - equilibrium - fatigue_penalty;
}

Expand All @@ -988,7 +989,7 @@ int avatar::calc_focus_equilibrium( bool ignore_pain ) const
int eff_morale = get_morale_level();
// Factor in perceived pain, since it's harder to rest your mind while your body hurts.
// Cenobites don't mind, though
if( !ignore_pain && !has_trait( trait_CENOBITE ) ) {
if( !ignore_pain && !mutations.has_trait( trait_CENOBITE ) ) {
eff_morale = eff_morale - get_perceived_pain();
}

Expand Down Expand Up @@ -1086,33 +1087,34 @@ void avatar::update_mental_focus()
void avatar::reset_stats()
{
// Trait / mutation buffs
if( has_trait( trait_THICK_SCALES ) ) {
if( mutations.has_trait( trait_THICK_SCALES ) ) {
add_miss_reason( _( "Your thick scales get in the way." ), 2 );
}
if( has_trait( trait_CHITIN2 ) || has_trait( trait_CHITIN3 ) || has_trait( trait_CHITIN_FUR3 ) ) {
if( mutations.has_trait( trait_CHITIN2 ) || mutations.has_trait( trait_CHITIN3 ) ||
mutations.has_trait( trait_CHITIN_FUR3 ) ) {
add_miss_reason( _( "Your chitin gets in the way." ), 1 );
}
if( has_trait( trait_COMPOUND_EYES ) && !wearing_something_on( bp_eyes ) ) {
if( mutations.has_trait( trait_COMPOUND_EYES ) && !wearing_something_on( bp_eyes ) ) {
mod_per_bonus( 1 );
}
if( has_trait( trait_INSECT_ARMS ) ) {
if( mutations.has_trait( trait_INSECT_ARMS ) ) {
add_miss_reason( _( "Your insect limbs get in the way." ), 2 );
}
if( has_trait( trait_INSECT_ARMS_OK ) ) {
if( mutations.has_trait( trait_INSECT_ARMS_OK ) ) {
if( !wearing_something_on( bp_torso ) ) {
mod_dex_bonus( 1 );
} else {
mod_dex_bonus( -1 );
add_miss_reason( _( "Your clothing restricts your insect arms." ), 1 );
}
}
if( has_trait( trait_WEBBED ) ) {
if( mutations.has_trait( trait_WEBBED ) ) {
add_miss_reason( _( "Your webbed hands get in the way." ), 1 );
}
if( has_trait( trait_ARACHNID_ARMS ) ) {
if( mutations.has_trait( trait_ARACHNID_ARMS ) ) {
add_miss_reason( _( "Your arachnid limbs get in the way." ), 4 );
}
if( has_trait( trait_ARACHNID_ARMS_OK ) ) {
if( mutations.has_trait( trait_ARACHNID_ARMS_OK ) ) {
if( !wearing_something_on( bp_torso ) ) {
mod_dex_bonus( 2 );
} else if( !exclusive_flag_coverage( "OVERSIZE" ).test( bp_torso ) ) {
Expand Down Expand Up @@ -1159,7 +1161,7 @@ void avatar::reset_stats()
// Stimulants
set_fake_effect_dur( effect_stim, 1_turns * stim );
set_fake_effect_dur( effect_depressants, 1_turns * -stim );
if( has_trait( trait_STIMBOOST ) ) {
if( mutations.has_trait( trait_STIMBOOST ) ) {
set_fake_effect_dur( effect_stim_overdose, 1_turns * ( stim - 60 ) );
} else {
set_fake_effect_dur( effect_stim_overdose, 1_turns * ( stim - 30 ) );
Expand Down Expand Up @@ -1194,10 +1196,10 @@ void avatar::reset_stats()
mod_dodge_bonus( mabuff_dodge_bonus() -
( encumb( bp_leg_l ) + encumb( bp_leg_r ) ) / 20.0f - encumb( bp_torso ) / 10.0f );
// Whiskers don't work so well if they're covered
if( has_trait( trait_WHISKERS ) && !wearing_something_on( bp_mouth ) ) {
if( mutations.has_trait( trait_WHISKERS ) && !wearing_something_on( bp_mouth ) ) {
mod_dodge_bonus( 1 );
}
if( has_trait( trait_WHISKERS_RAT ) && !wearing_something_on( bp_mouth ) ) {
if( mutations.has_trait( trait_WHISKERS_RAT ) && !wearing_something_on( bp_mouth ) ) {
mod_dodge_bonus( 2 );
}
// depending on mounts size, attacks will hit the mount and use their dodge rating.
Expand All @@ -1206,7 +1208,7 @@ void avatar::reset_stats()
mod_dodge_bonus( -4 );
}
// Spider hair is basically a full-body set of whiskers, once you get the brain for it
if( has_trait( trait_CHITIN_FUR3 ) ) {
if( mutations.has_trait( trait_CHITIN_FUR3 ) ) {
static const std::array<body_part, 5> parts{ { bp_head, bp_arm_r, bp_arm_l, bp_leg_r, bp_leg_l } };
for( auto bp : parts ) {
if( !wearing_something_on( bp ) ) {
Expand Down
8 changes: 4 additions & 4 deletions src/avatar_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ static const efftype_id effect_harnessed( "harnessed" );

bool avatar_action::move( avatar &you, map &m, int dx, int dy, int dz )
{
if( ( !g->check_safe_mode_allowed() ) || you.has_active_mutation( trait_SHELL2 ) ) {
if( you.has_active_mutation( trait_SHELL2 ) ) {
if( ( !g->check_safe_mode_allowed() ) || you.mutations.has_active_mutation( trait_SHELL2 ) ) {
if( you.mutations.has_active_mutation( trait_SHELL2 ) ) {
add_msg( m_warning, _( "You can't move while in your shell. Deactivate it to go mobile." ) );
}
return false;
Expand Down Expand Up @@ -104,7 +104,7 @@ bool avatar_action::move( avatar &you, map &m, int dx, int dy, int dz )
return true;
}
}
if( you.has_trait( trait_BURROW ) ) {
if( you.mutations.has_trait( trait_BURROW ) ) {
item burrowing_item( itype_id( "fake_burrowing" ) );
you.invoke_item( &burrowing_item, "BURROW", dest_loc );
you.defer_move( dest_loc ); // don't move into the tile until done mining
Expand Down Expand Up @@ -831,7 +831,7 @@ bool avatar_action::fire( avatar &you, map &m, item &weapon, int bp_cost )
void avatar_action::plthrow( avatar &you, int pos,
const cata::optional<tripoint> &blind_throw_from_pos )
{
if( you.has_active_mutation( trait_SHELL2 ) ) {
if( you.mutations.has_active_mutation( trait_SHELL2 ) ) {
add_msg( m_info, _( "You can't effectively throw while you're in your shell." ) );
return;
}
Expand Down
31 changes: 16 additions & 15 deletions src/bionics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ void player::bionics_uninstall_failure( int difficulty, int success, float adjus
add_msg( m_neutral, _( "The removal is a failure." ) );
switch( fail_type ) {
case 1:
if( !has_trait( trait_id( "NOPAIN" ) ) ) {
if( !mutations.has_trait( trait_id( "NOPAIN" ) ) ) {
add_msg_if_player( m_bad, _( "It really hurts!" ) );
mod_pain( rng( failure_level * 3, failure_level * 6 ) );
}
Expand Down Expand Up @@ -1177,7 +1177,7 @@ void player::bionics_uninstall_failure( monster &installer, player &patient, int
}
switch( fail_type ) {
case 1:
if( !has_trait( trait_id( "NOPAIN" ) ) ) {
if( !mutations.has_trait( trait_id( "NOPAIN" ) ) ) {
patient.add_msg_if_player( m_bad, _( "It really hurts!" ) );
patient.mod_pain( rng( failure_level * 3, failure_level * 6 ) );
}
Expand Down Expand Up @@ -1219,8 +1219,8 @@ bool player::has_enough_anesth( const itype *cbm, player &patient )
return false;
}

if( has_bionic( bionic_id( "bio_painkiller" ) ) || has_trait( trait_NOPAIN ) ||
has_trait( trait_id( "DEBUG_BIONICS" ) ) ) {
if( has_bionic( bionic_id( "bio_painkiller" ) ) || mutations.has_trait( trait_NOPAIN ) ||
mutations.has_trait( trait_id( "DEBUG_BIONICS" ) ) ) {
return true;
}

Expand Down Expand Up @@ -1266,14 +1266,14 @@ int player::bionics_pl_skill( const skill_id &most_important_skill, const skill_
}

// Medical residents have some idea what they're doing
if( has_trait( trait_PROF_MED ) ) {
if( mutations.has_trait( trait_PROF_MED ) ) {
pl_skill += 3;
add_msg_player_or_npc( m_neutral, _( "You prep to begin surgery." ),
_( "<npcname> prepares for surgery." ) );
}

// People trained in bionics gain an additional advantage towards using it
if( has_trait( trait_PROF_AUTODOC ) ) {
if( mutations.has_trait( trait_PROF_AUTODOC ) ) {
pl_skill += 7;
add_msg( m_neutral, _( "A lifetime of augmentation has taught %s a thing or two…" ),
disp_name() );
Expand All @@ -1285,7 +1285,7 @@ int player::bionics_pl_skill( const skill_id &most_important_skill, const skill_
int bionic_manip_cos( float adjusted_skill, bool autodoc, int bionic_difficulty )
{
if( ( autodoc && get_option < bool > ( "SAFE_AUTODOC" ) ) ||
g->u.has_trait( trait_id( "DEBUG_BIONICS" ) ) ) {
g->u.mutations.has_trait( trait_id( "DEBUG_BIONICS" ) ) ) {
return 100;
}

Expand Down Expand Up @@ -1698,7 +1698,8 @@ bool player::install_bionics( const itype &type, player &installer, bool autodoc
activity.str_values.push_back( "" );
activity.str_values.push_back( "" );
}
if( installer.has_trait( trait_PROF_MED ) || installer.has_trait( trait_PROF_AUTODOC ) ) {
if( installer.mutations.has_trait( trait_PROF_MED ) ||
installer.mutations.has_trait( trait_PROF_AUTODOC ) ) {
activity.str_values.push_back( installer.disp_name( true ) );
} else {
activity.str_values.push_back( "NOT_MED" );
Expand All @@ -1713,7 +1714,7 @@ bool player::install_bionics( const itype &type, player &installer, bool autodoc
add_effect( effect_under_op, difficulty * 20_minutes, elem.first, true, difficulty );
}
for( const trait_id &mid : bioid->canceled_mutations ) {
if( has_trait( mid ) ) {
if( mutations.has_trait( mid ) ) {
activity.str_values.push_back( mid.c_str() );
}
}
Expand All @@ -1740,7 +1741,7 @@ void player::perform_install( bionic_id bid, bionic_id upbid, int difficulty, in

if( !trait_to_rem.empty() ) {
for( trait_id tid : trait_to_rem ) {
remove_mutation( tid );
mutations.remove_mutation( *this, tid );
}
}

Expand Down Expand Up @@ -1790,7 +1791,7 @@ void player::bionics_install_failure( bionic_id bid, std::string installer, int
switch( fail_type ) {

case 1:
if( !( has_trait( trait_id( "NOPAIN" ) ) ) ) {
if( !( mutations.has_trait( trait_id( "NOPAIN" ) ) ) ) {
add_msg_if_player( m_bad, _( "It really hurts!" ) );
mod_pain( rng( failure_level * 3, failure_level * 6 ) );
}
Expand Down Expand Up @@ -2274,7 +2275,7 @@ void player::introduce_into_anesthesia( const time_duration &duration, player &i
_( "<npcname> settles into position, sliding their wrist into the couch's strap." ) );
if( needs_anesthesia ) {
//post-threshold medical mutants do not fear operations.
if( has_trait( trait_THRESH_MEDICAL ) ) {
if( mutations.has_trait( trait_THRESH_MEDICAL ) ) {
add_msg_if_player( m_mixed,
_( "You feel excited as the operation starts." ) );
}
Expand All @@ -2285,7 +2286,7 @@ void player::introduce_into_anesthesia( const time_duration &duration, player &i
//post-threshold medical mutants with Deadened don't need anesthesia due to their inability to feel pain
} else {
//post-threshold medical mutants do not fear operations.
if( has_trait( trait_THRESH_MEDICAL ) ) {
if( mutations.has_trait( trait_THRESH_MEDICAL ) ) {
add_msg_if_player( m_mixed,
_( "You feel excited as the Autodoc slices painlessly into you. You enjoy the sight of scalpels slicing you apart, but as operation proceeds you suddenly feel tired and pass out." ) );
} else {
Expand All @@ -2295,8 +2296,8 @@ void player::introduce_into_anesthesia( const time_duration &duration, player &i
}

//Pain junkies feel sorry about missed pain from operation.
if( has_trait( trait_MASOCHIST ) || has_trait( trait_MASOCHIST_MED ) ||
has_trait( trait_CENOBITE ) ) {
if( mutations.has_trait( trait_MASOCHIST ) || mutations.has_trait( trait_MASOCHIST_MED ) ||
mutations.has_trait( trait_CENOBITE ) ) {
add_msg_if_player( m_mixed,
_( "As your conciousness slips away, you feel regret that you won't be able to enjoy the operation." ) );
}
Expand Down
Loading