Changeset 10934
- Timestamp:
- Dec 7, 2015, 2:49:46 PM (9 years ago)
- Location:
- code/branches/campaignHS15/src/orxonox/controllers
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.cc
r10927 r10934 40 40 ActionpointController::ActionpointController(Context* context) : FightingController(context) 41 41 { 42 this->actionpointControllerId_ = 0; 43 ActionpointController::sTicks_ = 0; 44 ActionpointController::nextActionpointControllerId_ = 0; 42 45 this->ticks_ = 0; 43 46 this->bPatrolling_ = false; … … 48 51 parsedActionpoints_.clear(); 49 52 actionpoints_.clear(); 50 51 53 this->bTakenOver_ = false; 52 54 this->action_ = Action::NONE; … … 92 94 parsedActionpoints_.clear(); 93 95 actionpoints_.clear(); 94 ActionpointController::nextActionpointControllerId_--; 96 this->actionpointControllerId_ = 0; 97 /*ActionpointController::nextActionpointControllerId_--; 95 98 if (ActionpointController::nextActionpointControllerId_ < 0) 96 ActionpointController::nextActionpointControllerId_ = 0; 99 ActionpointController::nextActionpointControllerId_ = 0;*/ 97 100 } 98 101 void ActionpointController::tick(float dt) … … 121 124 this->action_ = Action::FIGHTALL; 122 125 } 126 //orxout (internal_error) << "first tick was called by id = " << this->actionpointControllerId_ << ", total = " << ActionpointController::nextActionpointControllerId_ << endl; 123 127 } 124 128 if (ActionpointController::sTicks_ == 1) 125 129 { 126 this->timeOffset_ = 0.0f;127 130 this->bActionCalled_ = false; 128 131 … … 152 155 return; 153 156 154 this->timeOffset_ += dt; 155 if (this->timeOffset_ >= 2.4f) 156 this->timeOffset_ = 0.0f; 157 157 158 if (timeout_ <= 0) 158 159 this->bFiredRocket_ = false; … … 163 164 if (this->timeout_ > 0 && this->bFiredRocket_) 164 165 { 165 this->timeout_ -= dt;166 --this->timeout_; 166 167 } 167 168 … … 188 189 if (!this || !this->getControllableEntity()) 189 190 return; 190 191 if (this->hasTarget() && ActionpointController::sTicks_ % (ActionpointController::nextActionpointControllerId_ + 1) == (this->actionpointControllerId_)) 191 /* orxout (internal_error) << "id = " << this->actionpointControllerId_ << ", in total # ids = " << ActionpointController::nextActionpointControllerId_ 192 << ", I " << (this->hasTarget() ? "have" : "don't have") << " a target, my team is " << this->getControllableEntity()->getTeam() << endl; 193 */ if (this->hasTarget() && ActionpointController::sTicks_ % (ActionpointController::nextActionpointControllerId_ + 1) == (this->actionpointControllerId_)) 192 194 { 193 195 -
code/branches/campaignHS15/src/orxonox/controllers/ActionpointController.h
r10923 r10934 252 252 std::multimap <int, std::pair<PickupSpawner*, bool> > speedSpawners_; 253 253 */ 254 float timeOffset_;255 254 bool bActionCalled_; 256 255 bool bManeuverCalled_; -
code/branches/campaignHS15/src/orxonox/controllers/FightingController.cc
r10927 r10934 336 336 if (firemode == getFiremode("RocketFire")) 337 337 { 338 this->timeout_ = 0.5f;338 this->timeout_ = 5; 339 339 this->rocketsLeft_--; 340 340 this->bFiredRocket_ = true; -
code/branches/campaignHS15/src/orxonox/controllers/FightingController.h
r10927 r10934 91 91 //WEAPONSYSTEM DATA 92 92 int rocketsLeft_; 93 float timeout_;93 int timeout_; 94 94 bool bFiredRocket_; 95 95 std::map<std::string, int> weaponModes_; //<! Links each "weapon" to it's weaponmode - managed by setupWeapons()
Note: See TracChangeset
for help on using the changeset viewer.