Changeset 9869 in orxonox.OLD for trunk/src/world_entities/npcs/space_turret.cc
- Timestamp:
- Oct 3, 2006, 12:19:30 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npcs/space_turret.cc
r9656 r9869 29 29 #include "effects/explosion.h" 30 30 31 CREATE_FACTORY(SpaceTurret, CL_SPACE_TURRET); 31 #include "class_id_DEPRECATED.h" 32 ObjectListDefinitionID(SpaceTurret, CL_SPACE_TURRET); 33 CREATE_FACTORY(SpaceTurret); 32 34 33 35 /** … … 36 38 */ 37 39 SpaceTurret::SpaceTurret(const TiXmlElement* root) 38 : NPC(root)40 : NPC(root) 39 41 { 40 42 this->init(); … … 48 50 */ 49 51 SpaceTurret::~SpaceTurret () 50 { 51 52 } 52 {} 53 53 54 54 … … 59 59 void SpaceTurret::init() 60 60 { 61 this-> setClassID(CL_SPACE_TURRET, "SpaceTurret");61 this->registerObject(this, SpaceTurret::_objectList); 62 62 this->loadModel("models/ground_turret_#.obj", 7.5); 63 63 this->loadModel("models/comet.obj", 1.0f, 3); … … 98 98 99 99 element = root->FirstChildElement("weapon-left"); 100 if (element != NULL) element = element->FirstChildElement(); 101 this->left = dynamic_cast<Weapon*>( Factory::fabricate( element) ); 100 if (element != NULL) 101 element = element->FirstChildElement(); 102 if (element != NULL) 103 this->left = dynamic_cast<Weapon*>( Factory::fabricate( element) ); 102 104 if (this->left) 103 105 { … … 112 114 113 115 element = root->FirstChildElement("weapon-right"); 114 if (element != NULL) if (element != NULL) element = element->FirstChildElement(); 115 this->right = dynamic_cast<Weapon*>( Factory::fabricate( element) ); 116 if (element != NULL) 117 element = element->FirstChildElement(); 118 if (element != NULL) 119 this->right = dynamic_cast<Weapon*>( Factory::fabricate( element) ); 116 120 if (this->right) 117 121 { … … 132 136 */ 133 137 void SpaceTurret::setWeaponLeft(const std::string& wLeft) 134 { 135 136 } 138 {} 137 139 138 140 /** … … 150 152 { 151 153 if(this->getHealth() > 0.0f && State::getPlayer() && 152 State::getPlayer()->getPlayable() &&153 State::getPlayer()->getPlayable()->distance(this) < 300) // HACK154 { 155 if (likely(this->left != NULL))156 {157 // this->left->tickW(dt);158 this->left->requestAction(WA_SHOOT);159 }160 if (likely(this->right != NULL))161 {162 // this->right->tickW(dt);163 this->right->requestAction(WA_SHOOT);164 }154 State::getPlayer()->getPlayable() && 155 State::getPlayer()->getPlayable()->distance(this) < 300) // HACK 156 { 157 if (likely(this->left != NULL)) 158 { 159 // this->left->tickW(dt); 160 this->left->requestAction(WA_SHOOT); 161 } 162 if (likely(this->right != NULL)) 163 { 164 // this->right->tickW(dt); 165 this->right->requestAction(WA_SHOOT); 166 } 165 167 } 166 168 } … … 183 185 this->getModel(3)->draw(); 184 186 glPopMatrix(); 185 /*186 if (this->left != NULL)187 this->left->draw();188 if (this->right != NULL)189 this->right->draw();*/187 /* 188 if (this->left != NULL) 189 this->left->draw(); 190 if (this->right != NULL) 191 this->right->draw();*/ 190 192 } 191 193 … … 197 199 */ 198 200 void SpaceTurret::postSpawn () 199 { 200 201 } 201 {} 202 202 203 203 /** … … 206 206 */ 207 207 void SpaceTurret::leftWorld () 208 { 209 210 } 208 {} 211 209 212 210 void SpaceTurret::destroy(WorldEntity* killer)
Note: See TracChangeset
for help on using the changeset viewer.