void FragTrap::vaulhunter_dot_exe( std::string const & target ) { if (_energy >= 25) { int i = rand() % 10; if (i > 5) i /= 2; if ( i == 1) meleeAttack( target ); else if ( i == 2) rangedAttack( target ); else if (i == 3) blablaAttack( target ); else if (i == 4 ) footAttack( target ); else if ( i == 5 ) beatchAttack( target ); } else std::cout << "You don't have enough energy's Points" << std::endl; }
void GameObj::update(SoundManager &sm, b2Vec2 nearest) { // this->elapsedTime = elapsedTime; if(!body->IsActive()) { return; } bool doRanged = true; if(isAlive()) { move(sm); // Melee Attacks for(std::list<GameObj*>::iterator it = enemies.begin(); it != enemies.end(); ++it) { if((*it)->isAlive()) { attack((*it), sm); doRanged = false; } } // Ranged attacks if(doRanged) { if(goSettings._LAUNCH_MAX_VEL) { rangedAttack(nearest); } } // Proccess ground contact if(groundContact) { // BULLETS - disappear after striking the ground. if(goSettings.getType() == Settings::OBJ_T_BULLET) { goSettings.setHP(0); // body->SetActive(false); } } } else { // body->SetTransform(b2Vec2(-5000, -5000), 0.0); } // Special Behavior (defined in derived classes) updateSpecial(sm); }