Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

Location:
code/branches/sagerjFS16/src/orxonox/controllers
Files:
6 edited

Legend:

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

    r11071 r11175  
    197197                    if (this->bHasTargetPosition_)
    198198                        this->moveToTargetPosition();
    199                     this->doFire();
     199                    this->doPush();
    200200                }
    201201
     
    227227                    this->moveToTargetPosition();
    228228
    229                     this->doFire();
     229                    this->doPush();
    230230            }
    231231        }
     
    241241                    if((timeout_< 0)||(!target_))//Check if the timeout is over or target died.
    242242                    {
    243                        controllable->fire(0);//kill the rocket
     243                       controllable->push(0);//kill the rocket
    244244                       this->setPreviousMode();//get out of rocket mode
    245245                    }
  • 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    }
  • code/branches/sagerjFS16/src/orxonox/controllers/ArtificialController.h

    r11071 r11175  
    4848            virtual void changedControllableEntity() override;
    4949
    50             virtual void doFire();
     50            virtual void doPush();
    5151            void setBotLevel(float level=1.0f);
    5252            inline float getBotLevel() const
  • code/branches/sagerjFS16/src/orxonox/controllers/DroneController.cc

    r11071 r11175  
    130130                       this->aimAtTarget();
    131131                       if(!this->friendlyFire())
    132                            this->getDrone()->fire(0);
     132                           this->getDrone()->push(0);
    133133                    }
    134134               }
  • code/branches/sagerjFS16/src/orxonox/controllers/FightingController.cc

    r11083 r11175  
    318318        }
    319319             
    320         this->getControllableEntity()->fire(firemode);
     320        this->getControllableEntity()->push(firemode);
    321321       
    322322    }
  • code/branches/sagerjFS16/src/orxonox/controllers/WaypointPatrolController.cc

    r11071 r11175  
    6969
    7070            if (this->getControllableEntity() && this->isCloseAtTarget(this->attackradius_) && this->isLookingAtTarget(math::pi / 20.0f))
    71                 this->getControllableEntity()->fire(0);
     71                this->getControllableEntity()->push(0);
    7272        }
    7373        else
Note: See TracChangeset for help on using the changeset viewer.