Changeset 10516 in orxonox.OLD for trunk/src/world_entities/weapons
- Timestamp:
- Jan 30, 2007, 9:17:21 PM (18 years ago)
- Location:
- trunk/src/world_entities/weapons
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/weapons/acid_launcher.cc
r10419 r10516 32 32 33 33 #include "util/loading/factory.h" 34 35 #include "elements/glgui_energywidgetvertical.h" 34 36 35 37 … … 122 124 void AcidLauncher::tick(float dt) 123 125 { 126 if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized) 127 { 128 this->energyWidget->setDisplayedImage("textures/gui/gui_acid.png"); 129 this->isEnergyWidgetInitialized = true; 130 } 131 124 132 if (!Weapon::tickW(dt)) 125 133 return; -
trunk/src/world_entities/weapons/heavy_blaster.cc
r10499 r10516 10 10 11 11 #include "loading/fast_factory.h" 12 13 #include "elements/glgui_energywidgetvertical.h" 12 14 13 15 CREATE_FACTORY(HeavyBlaster); … … 93 95 94 96 this->setActionSound(WA_SHOOT, "sounds/guns/laser.wav"); 95 this->setActionSound(WA_ACTIVATE, "sounds/voices/lasers.wav");97 // this->setActionSound(WA_ACTIVATE, "sounds/voices/lasers.wav"); 96 98 this->setActionSound(WA_RELOAD, "sounds/spawn/alien_generator.wav"); 97 99 98 100 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT); 99 this->setProjectileTypeC("HBolt"); // FIXME temp project type until the blaste class exist 100 // this->setProjectileTypeC("SpikeBall"); // FIXME temp project type until the blaste class exist 101 this->setProjectileTypeC("HBolt"); 101 102 this->prepareProjectiles(5); 102 103 … … 104 105 this->setSegs(2); 105 106 this->activeBarrel = 0; 106 // this->init2();107 107 108 108 … … 239 239 glPushMatrix(); 240 240 glTranslatef (this->objComp[0][0]->getAbsCoor().x, this->objComp[0][0]->getAbsCoor().y, this->objComp[0][0]->getAbsCoor().z); 241 static_cast<StaticModel*>(this->getModel())->draw(2); 242 glPopMatrix(); 243 244 glPushMatrix(); 245 glTranslatef (this->objComp[1][0]->getAbsCoor().x, this->objComp[1][0]->getAbsCoor().y, this->objComp[1][0]->getAbsCoor().z); 246 static_cast<StaticModel*>(this->getModel())->draw(3); 247 glPopMatrix(); 248 249 glPushMatrix(); 250 glTranslatef (this->objComp[2][0]->getAbsCoor().x, this->objComp[2][0]->getAbsCoor().y, this->objComp[2][0]->getAbsCoor().z); 241 251 static_cast<StaticModel*>(this->getModel())->draw(1); 242 glPopMatrix();243 244 glPushMatrix();245 glTranslatef (this->objComp[1][0]->getAbsCoor().x, this->objComp[1][0]->getAbsCoor().y, this->objComp[1][0]->getAbsCoor().z);246 static_cast<StaticModel*>(this->getModel())->draw(2);247 glPopMatrix();248 249 glPushMatrix();250 glTranslatef (this->objComp[2][0]->getAbsCoor().x, this->objComp[2][0]->getAbsCoor().y, this->objComp[2][0]->getAbsCoor().z);251 static_cast<StaticModel*>(this->getModel())->draw(0);252 252 glPopMatrix(); 253 253 … … 264 264 glPushMatrix(); 265 265 glTranslatef (this->objComp[2][1]->getAbsCoor().x, this->objComp[2][1]->getAbsCoor().y, this->objComp[2][1]->getAbsCoor().z); 266 static_cast<StaticModel*>(this->getModel())->draw(3); 267 glPopMatrix(); 268 269 glPopMatrix(); 270 } 266 static_cast<StaticModel*>(this->getModel())->draw(0); 267 glPopMatrix(); 268 269 glPopMatrix(); 270 } 271 272 void HeavyBlaster::tick(float dt) 273 { 274 if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized) 275 { 276 this->energyWidget->setDisplayedImage("textures/gui/gui_heavy_bolt.png"); 277 this->setEnergyWidgetInitialized(true); 278 } 279 } -
trunk/src/world_entities/weapons/heavy_blaster.h
r10499 r10516 29 29 virtual void fire(); 30 30 31 virtual void tick(float dt); 32 31 33 virtual void draw() const; 32 34 -
trunk/src/world_entities/weapons/light_blaster.cc
r10471 r10516 10 10 11 11 #include "loading/fast_factory.h" 12 13 #include "elements/glgui_energywidgetvertical.h" 12 14 13 15 CREATE_FACTORY(LightBlaster); … … 43 45 delete [] this->shootAnim; 44 46 delete [] this->objComp; 45 /*46 for(int j = 0; j < this->getSegs(); j++)47 {48 delete this->shootAnim[i][j];49 delete this->objComp[i][j];50 }51 delete this->shootAnim[i];52 delete this->objComp[i];53 delete this->emissionPoint[i];54 }*/55 47 56 // this->deconstr();57 // model will be deleted from WorldEntity-destructor58 48 } 59 49 … … 79 69 80 70 this->setActionSound(WA_SHOOT, "sounds/guns/laser.wav"); 81 this->setActionSound(WA_ACTIVATE, "sounds/voices/lasers.wav");71 // this->setActionSound(WA_ACTIVATE, "sounds/voices/lasers.wav"); 82 72 this->setActionSound(WA_RELOAD, "sounds/spawn/alien_generator.wav"); 83 73 84 74 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT); 85 //this->setProjectileTypeC("RailProjectile"); // FIXME temp project type until the blaste class exist 86 this->setProjectileTypeC("LBolt"); // Working; FIXME: add textures 87 // this->setProjectileTypeC("Spike"); // Working; FIXME: add textures 75 this->setProjectileTypeC("LBolt"); 88 76 this->prepareProjectiles(100); 89 77 … … 137 125 } 138 126 139 140 127 void LightBlaster::fire() 141 128 { … … 187 174 static_cast<StaticModel*>(this->getModel())->draw(); 188 175 glPopMatrix(); 176 189 177 } 178 179 void LightBlaster::tick(float dt) 180 { 181 if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized) 182 { 183 this->energyWidget->setDisplayedImage("textures/gui/gui_light_bolt.png"); 184 this->setEnergyWidgetInitialized(true); 185 } 186 } -
trunk/src/world_entities/weapons/light_blaster.h
r10368 r10516 26 26 virtual void fire(); 27 27 28 virtual void tick(float dt); 29 28 30 virtual void draw() const; 29 31 -
trunk/src/world_entities/weapons/medium_blaster.cc
r10415 r10516 10 10 11 11 #include "loading/fast_factory.h" 12 13 #include "elements/glgui_energywidgetvertical.h" 12 14 13 15 // … … 138 140 } 139 141 142 140 143 /** 141 144 * this activates the weapon … … 158 161 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 159 162 160 static_cast<StaticModel*>(this->getModel())->draw( 2);163 static_cast<StaticModel*>(this->getModel())->draw(0); 161 164 162 165 glPushMatrix(); … … 167 170 glPushMatrix(); 168 171 glTranslatef (this->objComp[0][1]->getAbsCoor().x, this->objComp[0][1]->getAbsCoor().y, this->objComp[0][1]->getAbsCoor().z); 169 static_cast<StaticModel*>(this->getModel())->draw( 0);172 static_cast<StaticModel*>(this->getModel())->draw(2); 170 173 glPopMatrix(); 171 174 172 175 glPopMatrix(); 173 176 } 177 178 void MediumBlaster::tick(float dt) 179 { 180 if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized) 181 { 182 this->energyWidget->setDisplayedImage("textures/gui/gui_medium_bold.png"); 183 this->setEnergyWidgetInitialized(true); 184 } 185 } -
trunk/src/world_entities/weapons/medium_blaster.h
r10368 r10516 26 26 virtual void fire(); 27 27 28 virtual void tick(float dt); 29 28 30 virtual void draw() const; 29 31 -
trunk/src/world_entities/weapons/spike_thrower.cc
r10419 r10516 34 34 35 35 #include "util/loading/factory.h" 36 37 #include "elements/glgui_energywidgetvertical.h" 36 38 37 39 … … 125 127 void SpikeThrower::tick(float dt) 126 128 { 129 if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized) 130 { 131 this->energyWidget->setDisplayedImage("textures/gui/gui_spikeball.png"); 132 this->isEnergyWidgetInitialized = true; 133 } 134 127 135 if (!Weapon::tickW(dt)) 128 136 return; -
trunk/src/world_entities/weapons/swarm_launcher.cc
r10419 r10516 33 33 34 34 #include "util/loading/factory.h" 35 36 #include "elements/glgui_energywidgetvertical.h" 35 37 36 38 … … 141 143 142 144 this->setAbsDirSoft(quat, 5); 145 146 if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized) 147 { 148 this->energyWidget->setDisplayedImage("textures/gui/gui_swarm_missiles.png"); 149 this->setEnergyWidgetInitialized(true); 150 } 143 151 } 144 152 -
trunk/src/world_entities/weapons/weapon.cc
r10443 r10516 154 154 155 155 this->energyWidget = NULL; 156 isEnergyWidgetInitialized = false; 156 157 157 158 // set this object to be synchronized over network -
trunk/src/world_entities/weapons/weapon.h
r10443 r10516 190 190 inline int getPreferedSlot() { return this->preferedSlot; } 191 191 192 inline void setEnergyWidgetInitialized(bool b) {this->isEnergyWidgetInitialized = b;}; 193 192 194 193 195 protected: … … 207 209 208 210 void setPreferedSlot(int slot, int side) { this->preferedSlot = slot; this->preferedSide = side; } 211 212 //gui 213 OrxGui::GLGuiEnergyWidgetVertical* energyWidget; 214 bool isEnergyWidgetInitialized; 209 215 210 216 … … 238 244 float maxCharge; //!< The maximal energy to be loaded onto one projectile (this is only availible if chargeable is enabled) 239 245 240 OrxGui::GLGuiEnergyWidgetVertical* energyWidget;246 //OrxGui::GLGuiEnergyWidgetVertical* energyWidget; 241 247 242 248 PNode* defaultTarget; //!< A target for targeting Weapons.
Note: See TracChangeset
for help on using the changeset viewer.