void Character::mod_stat( const std::string &stat, int modifier ) { if( stat == "str" ) { mod_str_bonus( modifier ); } else if( stat == "dex" ) { mod_dex_bonus( modifier ); } else if( stat == "per" ) { mod_per_bonus( modifier ); } else if( stat == "int" ) { mod_int_bonus( modifier ); } else if( stat == "healthy" ) { mod_healthy( modifier ); } else if( stat == "hunger" ) { mod_hunger( modifier ); } else if( stat == "speed" ) { mod_speed_bonus( modifier ); } else if( stat == "dodge" ) { mod_dodge_bonus( modifier ); } else if( stat == "block" ) { mod_block_bonus( modifier ); } else if( stat == "hit" ) { mod_hit_bonus( modifier ); } else if( stat == "bash" ) { mod_bash_bonus( modifier ); } else if( stat == "cut" ) { mod_cut_bonus( modifier ); } else if( stat == "pain" ) { mod_pain( modifier ); } else if( stat == "moves" ) { mod_moves( modifier ); } else { Creature::mod_stat( stat, modifier ); } }
void Creature::mod_stat( std::string stat, int modifier ) { if( stat == "str" ) { mod_str_bonus( modifier ); } else if( stat == "dex" ) { mod_dex_bonus( modifier ); } else if( stat == "per" ) { mod_per_bonus( modifier ); } else if( stat == "int" ) { mod_int_bonus( modifier ); } else if( stat == "speed" ) { mod_speed_bonus( modifier ); } else if( stat == "dodge" ) { mod_dodge_bonus( modifier ); } else if( stat == "block" ) { mod_block_bonus( modifier ); } else if( stat == "hit" ) { mod_hit_bonus( modifier ); } else if( stat == "bash" ) { mod_bash_bonus( modifier ); } else if( stat == "cut" ) { mod_cut_bonus( modifier ); } else if( stat == "pain" ) { mod_pain( modifier ); } else if( stat == "moves" ) { mod_moves( modifier ); } else { add_msg( "Tried to modify a nonexistent stat %s.", stat.c_str() ); } }