- Timestamp:
- Jun 9, 2011, 11:40:54 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ai/src/orxonox/controllers/ArtificialController.cc
r8239 r8701 88 88 this->numberOfWeapons = 0; 89 89 this->botlevel_ = 1.0f; 90 this->mode_ = DEFAULT; 90 91 } 91 92 … … 1034 1035 else if(this->getControllableEntity()&&(numberOfWeapons>0)&&this->bShooting_ && this->isCloseAtTarget((1 + 2*botlevel_)*1000) && this->isLookingAtTarget(math::pi / 20.0f)) 1035 1036 { 1036 if (this->isCloseAtTarget(130) && this->isLookingAtTarget(math::pi / 20.0f)&&(weapons[1]==1) ) 1037 /*if (this->isCloseAtTarget(130) && this->isLookingAtTarget(math::pi / 20.0f)&&(weapons[1]==1) ) 1038 {//LENSFLARE: short range weapon 1037 1039 this->getControllableEntity()->fire(1); //ai uses lens flare if they're close enough to the target 1038 1039 //default fire (laser) 1040 else if ((weapons[0]==0)) 1041 this->getControllableEntity()->fire(0); 1040 } 1041 else if(this->isLookingAtTarget(math::pi / 20.0f)&&(weapons[3]==3)&& this->isCloseAtTarget(260) &&projectiles[3] )*/ 1042 {//ROCKET: mid range weapon 1043 //TODO: Which weapon is the rocket? How many rockets are available? 1044 this->mode_ = ROCKET; 1045 //TODO: this->rockettimer->start() 1046 this->getControllableEntity()->fire(3);//launch rocket 1047 this->projectiles[3]-=1;//decrease ammo !! 1048 } 1049 1050 /*else if ((weapons[0]==0))//LASER: default weapon 1051 this->getControllableEntity()->fire(0);*/ 1042 1052 } 1043 1053 } … … 1045 1055 @brief Information gathering: Which weapons are ready to use? 1046 1056 */ 1047 void ArtificialController::setupWeapons() 1057 void ArtificialController::setupWeapons() //TODO: Make this function generic!! (at the moment is is based on conventions) 1048 1058 { 1049 1059 if(this->getControllableEntity()) … … 1057 1067 { 1058 1068 weapons[i]=i; 1069 projectiles[i]=1;//TODO: how to express infinite ammo? how to get data?? 1059 1070 numberOfWeapons++; 1060 1071 } … … 1062 1073 weapons[i]=-1; 1063 1074 } 1075 //pawn->weaponSystem_->getMunition(SubclassIdentifier< Munition > *identifier)->getNumMunition (WeaponMode *user); 1064 1076 } 1065 1077 } … … 1070 1082 { 1071 1083 if (level < 0.0f) 1072 1073 1074 1075 1084 this->botlevel_ = 0.0f; 1085 else if (level > 1.0f) 1086 this->botlevel_ = 1.0f; 1087 else 1076 1088 this->botlevel_ = level; 1077 1089 } … … 1084 1096 1085 1097 } 1098
Note: See TracChangeset
for help on using the changeset viewer.