- Timestamp:
- Nov 30, 2015, 9:34:54 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc
r10903 r10906 53 53 this->squaredaccuracy_ = 2500; 54 54 this->bFirstTick_ = true; 55 55 this->bStartedDodging_ = false; 56 this->timeDodged_ = 0; 56 57 RegisterObject(ActionpointController); 57 58 … … 78 79 this->timeout_ -= dt; 79 80 } 81 if (this->bStartedDodging_) 82 { 83 this->timeDodged_ += dt; 84 if (this->timeDodged_ > 2.0f) 85 { 86 this->bStartedDodging_ = false; 87 this->timeDodged_ = 0; 88 } 89 } 90 maneuverCounter_ += dt; 91 if (maneuverCounter_ > 6.0f) 92 maneuverCounter_ = 0; 80 93 if (timeout_ <= 0) 81 94 this->bFiredRocket_ = false; … … 110 123 this->bFirstTick_ = false; 111 124 } 112 125 if (this->hasTarget()) 126 { 127 this->maneuver(); 128 if (static_cast<int>(this->maneuverCounter_*100) % 3 == 0) 129 this->bShooting_ = this->canFire(); 130 } 113 131 SUPER(ActionpointController, tick, dt); 114 132 } … … 123 141 this->deltaHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth() - this->previousHp; 124 142 this->previousHp = orxonox_cast<Pawn*> (this->getControllableEntity())->getHealth(); 143 125 144 // if (this->actionCounter_ % 2 == 0) 126 145 //No action -> pop one from stack … … 236 255 } 237 256 } 238 if (this->hasTarget()) 239 { 240 this->maneuver(); 241 this->bShooting_ = this->canFire(); 257 242 258 // Vector3 healthPosition = bestHealthPickup((this->target_->getWorldPosition() - this->getControllableEntity()->getWorldPosition()).length()); 243 259 // if ((this->getControllableEntity()->getWorldPosition() - healthPosition).length() < this->tolerance_) … … 252 268 // //----fire if you can---- 253 269 // this->bShooting_ = this->canFire(); 254 }270 255 271 this->actionCounter_ += this->actionCounter_ < 100000 ? 1 : -this->actionCounter_ ; 256 272
Note: See TracChangeset
for help on using the changeset viewer.