Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10927


Ignore:
Timestamp:
Dec 7, 2015, 1:56:45 PM (8 years ago)
Author:
gania
Message:

fixed?

Location:
code/branches/campaignHS15/src/orxonox/controllers
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc

    r10925 r10927  
    4242        this->ticks_ = 0;
    4343        this->bPatrolling_ = false;
    44         this->maneuverCounter_ = 0;
    4544        this->bInLoop_ = false;
    4645        this->bLoop_ = false;
     
    5554        this->bFirstTick_ = true;
    5655        this->bStartedDodging_ = false;
    57         this->timeDodged_ = 0;
    5856        this->bDefaultPatrol_ = true;
    5957        this->bDefaultFightAll_ = true;
     
    10098    void ActionpointController::tick(float dt)
    10199    {
    102         if (!this || !this->getControllableEntity())
     100        if (!this || !this->getControllableEntity() || !this->isActive())
    103101            return;
    104102        ++this->ticks_;
     
    113111            return;
    114112
    115         if (this->ticks_ == 1)
     113        if (ActionpointController::sTicks_ == 1)
    116114        {
    117115
     
    124122            }
    125123        }
    126         if (this->ticks_ == 1)
     124        if (ActionpointController::sTicks_ == 1)
    127125        {   
    128126            this->timeOffset_ = 0.0f;
     
    167165            this->timeout_ -= dt;
    168166        }
    169         if (this->bStartedDodging_)
    170         {
    171             this->timeDodged_ += dt;
    172         }
    173         maneuverCounter_ += dt;
     167   
    174168
    175169        if (!this || !this->getControllableEntity())
     
    177171        //maneuver every 0.25 sec ->
    178172        int step =  4;
     173        if (ActionpointController::sTicks_ % 100 <= 10)
     174        {
     175            this->bDodge_ = false;
     176        }
     177        else
     178        {
     179            this->bDodge_ = true;
     180        }
    179181        if (ActionpointController::sTicks_ % 100 == step * this->actionpointControllerId_ + 1)
    180182        {
     
    189191        if (this->hasTarget() &&  ActionpointController::sTicks_ % (ActionpointController::nextActionpointControllerId_ + 1) == (this->actionpointControllerId_))
    190192        {
    191             if (maneuverCounter_ > 6.0f)
    192                 this->maneuverCounter_ = 0;
    193             if (this->bStartedDodging_ &&  this->timeDodged_ > 4.0f)
    194             {
    195                 this->bStartedDodging_ = false;
    196                 this->timeDodged_ = 0;
    197             }
     193
     194         
    198195            if (!this || !this->getControllableEntity())
    199196                return;
  • code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc

    r10925 r10927  
    150150                return;
    151151            // if (this->actionCounter_ % 3 == 0)
    152             if (maneuverCounter_ <= 1.2)
     152            if (!this->bDodge_)
    153153            {
    154154                // orxout(internal_error) << "attacking" << endl;
     155                this->bStartedDodging_ = false;
     156
    155157                this->setTargetPosition(this->positionOfTarget_ - diffUnit * 50.0f);   
    156158                return;
  • code/branches/campaignHS15/src/orxonox/controllers/FightingController.h

    r10906 r10927  
    8282            Pawn* closestTarget() const;
    8383
     84            bool bDodge_;
    8485            int attackRange_;
    8586            bool bShooting_;
    86             float maneuverCounter_;   
    8787            bool bLookAtTarget_;
    8888            float deltaHp;
    8989            float previousHp;
    9090            bool bStartedDodging_;
    91             float timeDodged_;
    9291            //WEAPONSYSTEM DATA
    9392            int rocketsLeft_;
Note: See TracChangeset for help on using the changeset viewer.