Skip to content

Commit

Permalink
Improvements to feral survivor and Mycus experience (cataclysmbnteam#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chaosvolt authored Jun 1, 2023
1 parent 7d3c092 commit 9e8a806
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/avatar_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,11 @@ bool avatar_action::move( avatar &you, map &m, const tripoint &d )

if( monster *const mon_ptr = g->critter_at<monster>( dest_loc, true ) ) {
monster &critter = *mon_ptr;
// Additional checking to make sure we won't take a swing at friendly monsters.
Character &u = get_player_character();
monster_attitude att = critter.attitude( const_cast<Character *>( &u ) );
if( critter.friendly == 0 &&
!critter.has_effect( effect_pet ) ) {
!critter.has_effect( effect_pet ) && att != MATT_FRIEND ) {
if( you.is_auto_moving() ) {
add_msg( m_warning, _( "Monster in the way. Auto-move canceled." ) );
add_msg( m_info, _( "Move into the monster to attack." ) );
Expand Down
9 changes: 9 additions & 0 deletions src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2967,6 +2967,15 @@ void monster::hear_sound( const tripoint &source, const int vol, const int dist
return;
}

static const string_id<monfaction> faction_zombie( "zombie" );
const bool feral_friend = ( faction == faction_zombie || !type->in_species( ZOMBIE ) ) &&
g->u.has_trait( trait_PROF_FERAL ) && !g->u.has_effect( effect_feral_infighting_punishment );

// Hackery: If player is currently a feral and you're a zombie, ignore any sounds close to their position.
if( feral_friend && rl_dist( g->u.pos(), source ) <= 10 ) {
return;
}

const bool goodhearing = has_flag( MF_GOODHEARING );
const int volume = goodhearing ? 2 * vol - dist : vol - dist;
// Error is based on volume, louder sound = less error
Expand Down

0 comments on commit 9e8a806

Please sign in to comment.