Changeset 6997 for code/branches/ai/src/orxonox/controllers/AIController.cc
- Timestamp:
- May 27, 2010, 10:47:23 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ai/src/orxonox/controllers/AIController.cc
r6978 r6997 128 128 if (this->specificMasterAction_ != NONE) 129 129 { 130 if (this->specificMasterAction_ == HOLD)131 130 this->specificMasterActionHold(); 132 131 133 if (this->specificMasterAction_ == TURN180)134 this->turn180();135 136 if (this->specificMasterAction_ == SPIN)137 this->spin();132 // if (this->specificMasterAction_ == TURN180) 133 // this->turn180Init(); 134 135 // if (this->specificMasterAction_ == SPIN) 136 // this->spinInit(); 138 137 139 138 // if (this->specificMasterAction_ == FOLLOWHUMAN) … … 144 143 145 144 // make 180 degree turn - a specific Master Action 146 random = rnd( maxrand);145 random = rnd(1000.0f); 147 146 if (random < 5) 148 this-> specificMasterAction_ = TURN180;147 this->turn180Init(); 149 148 150 149 // spin around - a specific Master Action 151 random = rnd( maxrand);150 random = rnd(1000.0f); 152 151 if (random < 5) 153 this->sp ecificMasterAction_ = SPIN;152 this->spinInit(); 154 153 155 154 // lose master status (only if less than 4 slaves in formation) … … 191 190 // shoot 192 191 random = rnd(maxrand); 193 if (!(this->passive_) && random < 15&& (this->target_ && !this->bShooting_))192 if (!(this->passive_) && random < 9 && (this->target_ && !this->bShooting_)) 194 193 { 195 194 this->bShooting_ = true; … … 214 213 if (this->state_ == MASTER) 215 214 { 215 if (this->specificMasterAction_ == NONE) 216 { 217 if (this->target_) 218 this->aimAtTarget(); 219 220 if (this->bHasTargetPosition_) 221 this->moveToTargetPosition(); 222 223 if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f)) 224 this->getControllableEntity()->fire(0); 225 } 226 227 if (this->specificMasterAction_ == TURN180) 228 this->turn180(); 229 230 if (this->specificMasterAction_ == SPIN) 231 this->spin(); 232 } 233 234 if (this->state_ == SLAVE) 235 { 236 237 if (this->bHasTargetPosition_) 238 this->moveToTargetPosition(); 239 240 } 241 242 if (this->state_ == FREE) 243 { 216 244 if (this->target_) 217 245 this->aimAtTarget(); … … 219 247 if (this->bHasTargetPosition_) 220 248 this->moveToTargetPosition(); 221 if (this->specificMasterAction_ == NONE)222 {223 if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))224 this->getControllableEntity()->fire(0);225 }226 }227 228 if (this->state_ == SLAVE)229 {230 231 if (this->bHasTargetPosition_)232 this->moveToTargetPosition();233 234 }235 236 if (this->state_ == FREE)237 {238 if (this->target_)239 this->aimAtTarget();240 241 if (this->bHasTargetPosition_)242 this->moveToTargetPosition();243 249 244 250 if (this->getControllableEntity() && this->bShooting_ && this->isCloseAtTarget(1000) && this->isLookingAtTarget(Ogre::Math::PI / 20.0f))
Note: See TracChangeset
for help on using the changeset viewer.