Skip to content

Commit

Permalink
change "p" to "guy"
Browse files Browse the repository at this point in the history
  • Loading branch information
KorGgenT committed Oct 15, 2019
1 parent 6eb96c1 commit 20dd2db
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
46 changes: 23 additions & 23 deletions src/mutation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1339,10 +1339,10 @@ mutagen_attempt mutagen_common_checks( player &p, const item &it, bool strong,
return mutagen_attempt( true, 0 );
}

void test_crossing_threshold( Character &p, const mutation_category_trait &m_category )
void test_crossing_threshold( Character &guy, const mutation_category_trait &m_category )
{
// Threshold-check. You only get to cross once!
if( p.crossed_threshold() ) {
if( guy.crossed_threshold() ) {
return;
}

Expand All @@ -1355,11 +1355,11 @@ void test_crossing_threshold( Character &p, const mutation_category_trait &m_cat
std::string mutation_category = m_category.id;
int total = 0;
for( const auto &iter : mutation_category_trait::get_all() ) {
total += p.mutation_category_level[ iter.first ];
total += guy.mutation_category_level[ iter.first ];
}
// Threshold-breaching
const std::string &primary = p.get_highest_category();
int breach_power = p.mutation_category_level[primary];
const std::string &primary = guy.get_highest_category();
int breach_power = guy.mutation_category_level[primary];
// Only if you were pushing for more in your primary category.
// You wanted to be more like it and less human.
// That said, you're required to have hit third-stage dreams first.
Expand All @@ -1374,33 +1374,33 @@ void test_crossing_threshold( Character &p, const mutation_category_trait &m_cat
}
int breacher = breach_power + booster;
if( x_in_y( breacher, total ) ) {
p.add_msg_if_player( m_good,
_( "Something strains mightily for a moment... and then... you're... FREE!" ) );
p.set_mutation( mutation_thresh );
g->events().send<event_type::crosses_mutation_threshold>( p.getID(), m_category.id );
guy.add_msg_if_player( m_good,
_( "Something strains mightily for a moment... and then... you're... FREE!" ) );
guy.set_mutation( mutation_thresh );
g->events().send<event_type::crosses_mutation_threshold>( guy.getID(), m_category.id );
// Manually removing Carnivore, since it tends to creep in
// This is because carnivore is a prerequisite for the
// predator-style post-threshold mutations.
if( mutation_category == "URSINE" && p.has_trait( trait_CARNIVORE ) ) {
p.unset_mutation( trait_CARNIVORE );
p.add_msg_if_player( _( "Your appetite for blood fades." ) );
if( mutation_category == "URSINE" && guy.has_trait( trait_CARNIVORE ) ) {
guy.unset_mutation( trait_CARNIVORE );
guy.add_msg_if_player( _( "Your appetite for blood fades." ) );
}
}
} else if( p.has_trait( trait_NOPAIN ) ) {
} else if( guy.has_trait( trait_NOPAIN ) ) {
//~NOPAIN is a post-Threshold trait, so you shouldn't
//~legitimately have it and get here!
p.add_msg_if_player( m_bad, _( "You feel extremely Bugged." ) );
guy.add_msg_if_player( m_bad, _( "You feel extremely Bugged." ) );
} else if( breach_power > 100 ) {
p.add_msg_if_player( m_bad, _( "You stagger with a piercing headache!" ) );
p.mod_pain_noresist( 8 );
p.add_effect( effect_stunned, rng( 3_turns, 5_turns ) );
guy.add_msg_if_player( m_bad, _( "You stagger with a piercing headache!" ) );
guy.mod_pain_noresist( 8 );
guy.add_effect( effect_stunned, rng( 3_turns, 5_turns ) );
} else if( breach_power > 80 ) {
p.add_msg_if_player( m_bad,
_( "Your head throbs with memories of your life, before all this..." ) );
p.mod_pain_noresist( 6 );
p.add_effect( effect_stunned, rng( 2_turns, 4_turns ) );
guy.add_msg_if_player( m_bad,
_( "Your head throbs with memories of your life, before all this..." ) );
guy.mod_pain_noresist( 6 );
guy.add_effect( effect_stunned, rng( 2_turns, 4_turns ) );
} else if( breach_power > 60 ) {
p.add_msg_if_player( m_bad, _( "Images of your past life flash before you." ) );
p.add_effect( effect_stunned, rng( 2_turns, 3_turns ) );
guy.add_msg_if_player( m_bad, _( "Images of your past life flash before you." ) );
guy.add_effect( effect_stunned, rng( 2_turns, 3_turns ) );
}
}
2 changes: 1 addition & 1 deletion src/mutation.h
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,6 @@ struct mutagen_attempt {
mutagen_attempt mutagen_common_checks( player &p, const item &it, bool strong,
mutagen_technique technique );

void test_crossing_threshold( Character &p, const mutation_category_trait &m_category );
void test_crossing_threshold( Character &guy, const mutation_category_trait &m_category );

#endif

0 comments on commit 20dd2db

Please sign in to comment.