- Timestamp:
- Nov 30, 2011, 4:09:25 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/formation/src/orxonox/controllers/AIController.cc
r8729 r8953 116 116 } 117 117 118 if (this->state_ == SLAVE) 119 { 118 if (this->state_ == SLAVE && this->mode_==ATTACK) 119 { 120 if (!this->target_) 121 { 122 this->searchNewTarget(); 123 } 124 125 // shoot 126 random = rnd(maxrand); 127 if (!(this->passive_) && random < 75 && (this->target_ && !this->bShooting_)) 128 this->bShooting_ = true; 129 130 // stop shooting 131 random = rnd(maxrand); 132 if (random < 25 && (this->bShooting_)) 133 this->bShooting_ = false; 120 134 121 135 } … … 142 156 this->spinInit(); 143 157 144 / / follow a randomly chosen human - a specific Master Action158 /*// follow a randomly chosen human - a specific Master Action 145 159 random = rnd(1000.0f); 146 160 if (random < 1) 147 161 this->followRandomHumanInit(); 148 162 */ 149 163 // lose master status (only if less than 4 slaves in formation) 150 164 random = rnd(maxrand); … … 233 247 } 234 248 235 if (this->state_ == SLAVE )249 if (this->state_ == SLAVE && this->mode_!=ATTACK) 236 250 { 237 251 … … 241 255 } 242 256 243 if (this->state_ == FREE )257 if (this->state_ == FREE || (this->state_==SLAVE && this->mode_==ATTACK) ) 244 258 { 245 259 if (this->target_)
Note: See TracChangeset
for help on using the changeset viewer.