Changeset 11175 for code/branches/sagerjFS16/src/orxonox/controllers
- Timestamp:
- Apr 28, 2016, 3:09:26 PM (9 years ago)
- Location:
- code/branches/sagerjFS16/src/orxonox/controllers
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/sagerjFS16/src/orxonox/controllers/AIController.cc
r11071 r11175 197 197 if (this->bHasTargetPosition_) 198 198 this->moveToTargetPosition(); 199 this->do Fire();199 this->doPush(); 200 200 } 201 201 … … 227 227 this->moveToTargetPosition(); 228 228 229 this->do Fire();229 this->doPush(); 230 230 } 231 231 } … … 241 241 if((timeout_< 0)||(!target_))//Check if the timeout is over or target died. 242 242 { 243 controllable-> fire(0);//kill the rocket243 controllable->push(0);//kill the rocket 244 244 this->setPreviousMode();//get out of rocket mode 245 245 } -
code/branches/sagerjFS16/src/orxonox/controllers/ArtificialController.cc
r11099 r11175 132 132 @brief DoFire is called when a bot should shoot and decides which weapon is used and whether the bot shoots at all. 133 133 */ 134 void ArtificialController::do Fire()134 void ArtificialController::doPush() 135 135 { 136 136 if(!this->bSetupWorked)//setup: find out which weapons are active ! hard coded: laser is "0", lens flare is "1", ... … … 144 144 if (this->isCloseAtTarget(130) && (firemode = getFiremode("LightningGun")) > -1 ) 145 145 {//LENSFLARE: short range weapon 146 this->getControllableEntity()-> fire(firemode); //ai uses lens flare if they're close enough to the target146 this->getControllableEntity()->push(firemode); //ai uses lens flare if they're close enough to the target 147 147 } 148 148 else if( this->isCloseAtTarget(400) && (random < this->botlevel_) && (firemode = getFiremode("RocketFire")) > -1 ) 149 149 {//ROCKET: mid range weapon 150 150 this->mode_ = ROCKET; //Vector-implementation: mode_.push_back(ROCKET); 151 this->getControllableEntity()-> fire(firemode); //launch rocket151 this->getControllableEntity()->push(firemode); //launch rocket 152 152 if(this->getControllableEntity() && this->target_) //after fire(3) is called, getControllableEntity() refers to the rocket! 153 153 { … … 161 161 } 162 162 else if ((firemode = getFiremode("HsW01")) > -1 ) //LASER: default weapon 163 this->getControllableEntity()-> fire(firemode);163 this->getControllableEntity()->push(firemode); 164 164 } 165 165 } -
code/branches/sagerjFS16/src/orxonox/controllers/ArtificialController.h
r11071 r11175 48 48 virtual void changedControllableEntity() override; 49 49 50 virtual void do Fire();50 virtual void doPush(); 51 51 void setBotLevel(float level=1.0f); 52 52 inline float getBotLevel() const -
code/branches/sagerjFS16/src/orxonox/controllers/DroneController.cc
r11071 r11175 130 130 this->aimAtTarget(); 131 131 if(!this->friendlyFire()) 132 this->getDrone()-> fire(0);132 this->getDrone()->push(0); 133 133 } 134 134 } -
code/branches/sagerjFS16/src/orxonox/controllers/FightingController.cc
r11083 r11175 318 318 } 319 319 320 this->getControllableEntity()-> fire(firemode);320 this->getControllableEntity()->push(firemode); 321 321 322 322 } -
code/branches/sagerjFS16/src/orxonox/controllers/WaypointPatrolController.cc
r11071 r11175 69 69 70 70 if (this->getControllableEntity() && this->isCloseAtTarget(this->attackradius_) && this->isLookingAtTarget(math::pi / 20.0f)) 71 this->getControllableEntity()-> fire(0);71 this->getControllableEntity()->push(0); 72 72 } 73 73 else
Note: See TracChangeset
for help on using the changeset viewer.