bool mtype::same_species( const mtype &other ) const { for( int s : species_id ) { if( other.in_species( s ) ) { return true; } } return false; }
bool mtype::same_species( const mtype &other ) const { for( auto &s : species_ptrs ) { if( other.in_species( *s ) ) { return true; } } return false; }
void monster_adjustment::apply( mtype &mon ) { if( !mon.in_species( species ) ) { return; } if( !stat.empty() ) { if( stat == "speed" ) { mon.speed *= stat_adjust; } else if( stat == "hp" ) { mon.hp *= stat_adjust; } } if( !flag.empty() ) { mon.set_flag( io::string_to_enum<m_flag>( flag ), flag_val ); } if( !special.empty() ) { if( special == "nightvision" ) { mon.vision_night = mon.vision_day; } } }