bool monster::bash_at( const tripoint &p ) { if( p.z != posz() ) { return false; // TODO: Remove this } if( has_effect( "pacified" ) ) { return false; } //Hallucinations can't bash stuff. if( is_hallucination() ) { return false; } bool try_bash = !can_move_to( p ) || one_in( 3 ); bool can_bash = g->m.is_bashable( p ) && ( has_flag( MF_BASHES ) || has_flag( MF_BORES ) ); if( try_bash && can_bash ) { int bashskill = group_bash_skill( p ); g->m.bash( p, bashskill ); moves -= 100; return true; } return false; }
int monster::bash_at(int x, int y) { if (has_effect("pacified")) return 0; //Hallucinations can't bash stuff. if(is_hallucination()) { return 0; } bool try_bash = !can_move_to(x, y) || one_in(3); bool can_bash = g->m.is_bashable(x, y) && (has_flag(MF_BASHES) || has_flag(MF_BORES)); if( try_bash && can_bash ) { int bashskill = group_bash_skill( point(x, y) ); g->m.bash( x, y, bashskill ); moves -= 100; return 1; } return 0; }
bool monster::bash_at( const tripoint &p ) { if( p.z != posz() ) { return false; // TODO: Remove this } //Hallucinations can't bash stuff. if( is_hallucination() ) { return false; } bool try_bash = !can_move_to( p ) || one_in( 3 ); bool can_bash = g->m.is_bashable( p ) && bash_skill() > 0; if( try_bash && can_bash ) { int bashskill = group_bash_skill( p ); g->m.bash( p, bashskill ); moves -= 100; return true; } return false; }