Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2016, 3:09:26 PM (8 years ago)
Author:
sagerj
Message:

overwritten many fire functions now only need to implement timer/charges

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/sagerjFS16/src/orxonox/controllers/ArtificialController.cc

    r11099 r11175  
    132132        @brief DoFire is called when a bot should shoot and decides which weapon is used and whether the bot shoots at all.
    133133    */
    134     void ArtificialController::doFire()
     134    void ArtificialController::doPush()
    135135    {
    136136        if(!this->bSetupWorked)//setup: find out which weapons are active ! hard coded: laser is "0", lens flare is "1", ...
     
    144144            if (this->isCloseAtTarget(130) && (firemode = getFiremode("LightningGun")) > -1 )
    145145            {//LENSFLARE: short range weapon
    146                 this->getControllableEntity()->fire(firemode); //ai uses lens flare if they're close enough to the target
     146                this->getControllableEntity()->push(firemode); //ai uses lens flare if they're close enough to the target
    147147            }
    148148            else if( this->isCloseAtTarget(400) && (random < this->botlevel_) && (firemode = getFiremode("RocketFire")) > -1 )
    149149            {//ROCKET: mid range weapon
    150150                this->mode_ = ROCKET; //Vector-implementation: mode_.push_back(ROCKET);
    151                 this->getControllableEntity()->fire(firemode); //launch rocket
     151                this->getControllableEntity()->push(firemode); //launch rocket
    152152                if(this->getControllableEntity() && this->target_) //after fire(3) is called, getControllableEntity() refers to the rocket!
    153153                {
     
    161161            }
    162162            else if ((firemode = getFiremode("HsW01")) > -1 ) //LASER: default weapon
    163                 this->getControllableEntity()->fire(firemode);
     163                this->getControllableEntity()->push(firemode);
    164164        }
    165165    }
Note: See TracChangeset for help on using the changeset viewer.