Changeset 8758 for code/branches/ai2/src
- Timestamp:
- Jul 14, 2011, 10:29:18 PM (13 years ago)
- Location:
- code/branches/ai2/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ai2/src/modules/weapons/weaponmodes/FusionFire.cc
r8757 r8758 52 52 53 53 this->setMunitionName("FusionMunition"); 54 this->setName("FUSION_FIRE");55 54 } 56 55 -
code/branches/ai2/src/orxonox/controllers/AIController.cc
r8736 r8758 196 196 this->bShooting_ = false; 197 197 198 //boost 199 random = rnd(maxrand); 200 if (random < botlevel_*100 ) 201 this->boostControl(); //TEST 198 202 } 199 203 } … … 205 209 if (!this->isActive()) 206 210 return; 207 if(this->bDeathFlag_)//If a bot died recently, make him check his weaponsystem. 208 { 209 this->bSetupWorked = false; 210 this->numberOfWeapons = 0; 211 this->resetDeathFlag(); 212 } 213 this->boostControl();//TEST 211 214 212 float random; 215 213 float maxrand = 100.0f / ACTION_INTERVAL; … … 229 227 random = rnd(maxrand); 230 228 if(this->botlevel_*100 > random) 231 this->follow(); //If a bot is shooting a player, it shouldn't let him go away easily.229 this->follow(); //If a bot is shooting a player, it shouldn't let him go away easily. 232 230 } 233 231 } … … 277 275 else if (this->mode_ == ROCKET)//Rockets do not belong to a group of bots -> bot states are not relevant. 278 276 { //Vector-implementation: mode_.back() == ROCKET; 279 ControllableEntity *controllable = this->getControllableEntity(); 277 ControllableEntity *controllable = this->getControllableEntity(); 280 278 if(controllable) 281 279 { -
code/branches/ai2/src/orxonox/controllers/ArtificialController.cc
r8757 r8758 317 317 if (!this->getControllableEntity()) 318 318 this->removeFromFormation(); 319 this->bSetupWorked = false; // reset weapon information 320 this->numberOfWeapons = 0; 321 COUT(0)<<"ArtificialController::changedControllableEntity()"<<endl; //why is this function called more than once ?? 319 322 } 320 323 … … 1135 1138 { 1136 1139 int max=10, i=0, j=0, k=0; 1137 if(!pawn) {COUT(0)<<"NO PAWN"<<std::endl; return;}1140 if(!pawn) return; 1138 1141 while(i<max) 1139 1142 { … … 1151 1154 k++; 1152 1155 if(wMode==NULL) continue; 1153 COUT(0)<<wMode->get Name()<<": weaponpack "+multi_cast<std::string>(i-1)<<", weapon "<<multi_cast<std::string>(j-1)<<", weaponmode "<<multi_cast<std::string>(k-1)<<std::endl;1156 COUT(0)<<wMode->getIdentifier()->getName()<<": weaponpack "+multi_cast<std::string>(i-1)<<", weapon "<<multi_cast<std::string>(j-1)<<", weaponmode "<<multi_cast<std::string>(k-1)<<std::endl; 1154 1157 } 1155 1158 } -
code/branches/ai2/src/orxonox/controllers/Controller.cc
r8735 r8758 42 42 this->controllableEntity_ = 0; 43 43 this->bGodMode_ = false; 44 this->bDeathFlag_ = false;45 44 } 46 45 -
code/branches/ai2/src/orxonox/controllers/Controller.h
r8735 r8758 63 63 inline ControllableEntity* getControllableEntity() const 64 64 { return this->controllableEntity_; } 65 inline void setDeathFlag()66 { this->bDeathFlag_ = true; }67 inline void resetDeathFlag()68 { this->bDeathFlag_ = false; }69 65 virtual void changedControllableEntity() {} 70 66 … … 83 79 PlayerInfo* player_; 84 80 ControllableEntity* controllableEntity_; 85 bool bDeathFlag_; //<! Signal, when a controlled entity died. Flag is set in Pawn.cc and used in AIController.86 81 private: 87 82 bool bGodMode_; -
code/branches/ai2/src/orxonox/worldentities/pawns/Pawn.cc
r8735 r8758 94 94 95 95 this->isHumanShip_ = this->hasLocalController(); 96 96 97 97 this->setSyncMode(ObjectDirection::Bidirectional); // needed to synchronise e.g. aimposition 98 98 } … … 304 304 if (this->getGametype() && this->getGametype()->allowPawnDeath(this, this->lastHitOriginator_)) 305 305 { 306 if ( this->getController()&& (!this->isHumanShip_) ) //announce death to the ai307 {308 this->getController()->setDeathFlag();309 }310 306 // Set bAlive_ to false and wait for PawnManager to do the destruction 311 307 this->bAlive_ = false;
Note: See TracChangeset
for help on using the changeset viewer.