Changeset 10618 in orxonox.OLD for trunk/src/world_entities/weapons
- Timestamp:
- Apr 4, 2007, 12:13:53 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 16 16 OrxonoxPlayability.kdevses 17 17 OrxonoxPlayability.kdevelop.pcs 18 orxonox.backtrace 19 orxonox.kdevses 20 orxonox.kdevelop.pcs
-
- Property svn:ignore
-
trunk/src/world_entities/weapons/acid_launcher.cc
r10539 r10618 29 29 #include "util/state.h" 30 30 31 #include "math/quaternion.h"32 33 31 #include "util/loading/factory.h" 34 32 … … 39 37 using namespace std; 40 38 41 ObjectListDefinition (AcidLauncher);42 CREATE_FACTORY (AcidLauncher);39 ObjectListDefinition ( AcidLauncher ); 40 CREATE_FACTORY ( AcidLauncher ); 43 41 44 42 /** … … 48 46 */ 49 47 AcidLauncher::AcidLauncher() 50 : Weapon()48 : Weapon() 51 49 { 52 50 this->init(); … … 56 54 * creates a new AcidLauncher from a TiXmlElement 57 55 */ 58 AcidLauncher::AcidLauncher (const TiXmlElement* root)56 AcidLauncher::AcidLauncher ( const TiXmlElement* root ) 59 57 { 60 58 this->init(); 61 if ( root != NULL)62 this->loadParams (root);59 if ( root != NULL ) 60 this->loadParams ( root ); 63 61 } 64 62 … … 73 71 void AcidLauncher::init() 74 72 { 75 this->registerObject (this, AcidLauncher::_objectList);76 /*77 Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this);78 Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this);73 this->registerObject ( this, AcidLauncher::_objectList ); 74 /* 75 Animation3D* animation1 = this->getAnimation(WS_ACTIVATING, this); 76 Animation3D* animation2 = this->getAnimation(WS_DEACTIVATING, this); 79 77 80 animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);81 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);82 animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);83 animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT);78 animation1->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 79 animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 80 animation2->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 81 animation2->addKeyFrame(Vector(0, -.5, 0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_CONSTANT); 84 82 85 animation1->setInfinity(ANIM_INF_CONSTANT);86 animation2->setInfinity(ANIM_INF_CONSTANT);87 */88 this->setStateDuration (WS_SHOOTING, 1.0f);83 animation1->setInfinity(ANIM_INF_CONSTANT); 84 animation2->setInfinity(ANIM_INF_CONSTANT); 85 */ 86 this->setStateDuration ( WS_SHOOTING, 1.0f ); 89 87 90 this->setStateDuration (WS_RELOADING, 1.0f);91 this->setStateDuration (WS_ACTIVATING, .4);92 this->setStateDuration (WS_DEACTIVATING, .4);88 this->setStateDuration ( WS_RELOADING, 1.0f ); 89 this->setStateDuration ( WS_ACTIVATING, .4 ); 90 this->setStateDuration ( WS_DEACTIVATING, .4 ); 93 91 94 this->setEnergyMax (100);95 this->increaseEnergy (100);92 this->setEnergyMax ( 100 ); 93 this->increaseEnergy ( 100 ); 96 94 //this->minCharge = 2; 97 95 98 this->setCapability (WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT);99 this->setProjectileTypeC ("AcidSplash");96 this->setCapability ( WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT ); 97 this->setProjectileTypeC ( "AcidSplash" ); 100 98 // this->loadModel("models/guns/turret1.obj", 1.0); 101 99 102 this->setEmissionPoint (2.0, 0, 0);103 this->getProjectileFactory()->prepare (10);100 this->setEmissionPoint ( 2.0, 0, 0 ); 101 this->getProjectileFactory()->prepare ( 10 ); 104 102 105 this->setActionSound (WA_SHOOT, "sounds/explosions/explosion_1.wav");106 this->setActionSound (WA_ACTIVATE, "sounds/voices/rockets.wav");107 this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");103 this->setActionSound ( WA_SHOOT, "sounds/explosions/explosion_1.wav" ); 104 this->setActionSound ( WA_ACTIVATE, "sounds/voices/rockets.wav" ); 105 // this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav"); 108 106 109 107 } 110 108 111 void AcidLauncher::loadParams (const TiXmlElement* root)109 void AcidLauncher::loadParams ( const TiXmlElement* root ) 112 110 { 113 Weapon::loadParams (root);111 Weapon::loadParams ( root ); 114 112 } 115 113 116 114 void AcidLauncher::activate() 117 { 118 } 115 {} 119 116 120 117 void AcidLauncher::deactivate() 118 {} 119 120 void AcidLauncher::tick ( float dt ) 121 121 { 122 } 123 124 void AcidLauncher::tick(float dt) 125 { 126 if (!Weapon::tickW(dt)) 122 if ( !Weapon::tickW ( dt ) ) 127 123 return; 128 if (this->energyWidget != NULL && !this->isEnergyWidgetInitialized) 129 { 130 this->energyWidget->setDisplayedImage("textures/gui/gui_acid.png"); 124 if ( this->energyWidget != NULL && !this->isEnergyWidgetInitialized ) { 125 this->energyWidget->setDisplayedImage ( "textures/gui/gui_acid.png" ); 131 126 this->isEnergyWidgetInitialized = true; 132 127 } … … 157 152 158 153 Projectile* pj = NULL; 159 for( int i=0; i < 1; i++) 160 { 161 pj = this->getProjectile(); 162 if (pj == NULL) 163 return; 154 for ( int i=0; i < 1; i++ ) { 155 pj = this->getProjectile(); 156 if ( pj == NULL ) 157 return; 164 158 165 166 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*165.0 + VECTOR_RAND(10)));159 fired = true; 160 pj->setVelocity ( this->getVelocity() + ( this->getAbsDir().apply ( Vector ( 1,0,0 ) ) *165.0 + VECTOR_RAND ( 10 ) ) ); 167 161 168 pj->setParent(PNode::getNullParent());169 pj->setAbsCoor(this->getEmissionPoint() + VECTOR_RAND(.1));170 pj->setAbsDir(this->getAbsDir()+Quaternion(0,VECTOR_RAND(5)));171 162 pj->setParent ( PNode::getNullParent() ); 163 pj->setAbsCoor ( this->getEmissionPoint() + VECTOR_RAND ( .1 ) ); 164 pj->setAbsDir ( this->getAbsDir() +Quaternion ( 0,VECTOR_RAND ( 5 ) ) ); 165 pj->activate(); 172 166 } 173 167 } -
trunk/src/world_entities/weapons/acid_launcher.h
r10368 r10618 12 12 13 13 class AcidLauncher : public Weapon 14 15 ObjectListDeclaration(AcidLauncher);14 { 15 ObjectListDeclaration ( AcidLauncher ); 16 16 public: 17 17 AcidLauncher (); 18 AcidLauncher (const TiXmlElement* root);18 AcidLauncher ( const TiXmlElement* root ); 19 19 virtual ~AcidLauncher (); 20 20 21 21 void init(); 22 virtual void loadParams (const TiXmlElement* root);22 virtual void loadParams ( const TiXmlElement* root ); 23 23 24 24 virtual void activate(); 25 25 virtual void deactivate(); 26 26 27 virtual void tick (float dt);27 virtual void tick ( float dt ); 28 28 virtual void fire(); 29 29 30 30 31 31 private: 32 32 }; 33 33 34 34 #endif /* _ACID_LAUNCHER_H */ -
trunk/src/world_entities/weapons/aiming_turret.cc
r10419 r10618 100 100 this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_3.wav"); 101 101 this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav"); 102 this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");102 // this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav"); 103 103 104 104 } -
trunk/src/world_entities/weapons/boomerang_gun.cc
r10419 r10618 96 96 this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_3.wav"); 97 97 this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav"); 98 this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");98 // this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav"); 99 99 100 100 } -
trunk/src/world_entities/weapons/heavy_blaster.cc
r10548 r10618 1 /* 2 orxonox - the future of 3D-vertical-scrollers 3 4 Copyright (C) 2004-2006 orx 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 ### File Specific 12 main-programmer: Marc Schaerrer, Nicolas Schlumberger 13 co-programmer: 14 15 */ 16 1 17 #include "heavy_blaster.h" 2 18 #include "world_entities/projectiles/projectile.h" -
trunk/src/world_entities/weapons/light_blaster.cc
r10539 r10618 1 /* 2 orxonox - the future of 3D-vertical-scrollers 3 4 Copyright (C) 2004-2006 orx 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 ### File Specific 12 main-programmer: Marc Schaerrer, Nicolas Schlumberger 13 co-programmer: 14 15 */ 16 1 17 #include "light_blaster.h" 2 18 #include "world_entities/projectiles/projectile.h" … … 39 55 for (int i = 0; i < this->getBarrels(); i++) 40 56 { 41 delete [] this->shootAnim[i];57 //delete [] this->shootAnim[i]; 42 58 delete [] this->objComp[i]; 43 59 } 44 60 delete [] this->emissionPoint; 45 delete [] this->shootAnim;61 //delete [] this->shootAnim; 46 62 delete [] this->objComp; 47 63 … … 82 98 this->objComp = new PNode**[this->getBarrels()]; 83 99 this->emissionPoint = new PNode*[this->getBarrels()]; 84 this->shootAnim = new Animation3D**[this->getBarrels()];100 // this->shootAnim = new Animation3D**[this->getBarrels()]; 85 101 for (int i = 0; i < this->getBarrels(); i++) 86 102 { 87 103 this->objComp[i] = new PNode* [this->getSegs()]; 88 104 this->emissionPoint[i] = new PNode; 89 this->emissionPoint[i]->setParent(this); //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles105 this->emissionPoint[i]->setParent(this); 90 106 this->emissionPoint[i]->setName("EmissionPoint"); 91 107 this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 92 this->shootAnim[i] = new Animation3D* [this->getSegs()];108 // this->shootAnim[i] = new Animation3D* [this->getSegs()]; 93 109 for(int j = 0; j < this->getSegs(); j++) 94 110 { 95 111 this->objComp[i][j] = new PNode; 96 this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]);97 this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT);112 // this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]); 113 // this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT); 98 114 } 99 115 } 100 101 for (int i = 0; i < this->getBarrels(); i++ ) 102 this->emissionPoint[i]->setRelCoor(Vector(1.19, 0.0, 0.1)); 116 /* 117 this->emissionPoint[0]->setRelCoor(Vector(1.19, 0.0, 0.1)); 118 this->emissionPoint[1]->setRelCoor(Vector(1.19, -0.07, -0.05)); 119 this->emissionPoint[2]->setRelCoor(Vector(1.19, 0.07, -0.05));*/ 120 121 this->emissionPoint[0]->setRelCoor(Vector(2.2, 0.0, 0.1)); 122 this->emissionPoint[1]->setRelCoor(Vector(2.2, -0.07, -0.05)); 123 this->emissionPoint[2]->setRelCoor(Vector(2.2, 0.07, -0.05)); 103 124 104 125 // Animation3D* animation1 = this->getAnimation(WS_SHOOTING, this); … … 112 133 // this->setEmissionPoint(3.8, 1.2, 0); 113 134 114 for (int i = 0; i < this->getBarrels(); i++){115 this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion(i * 120, Vector(1.0, 0.0, 0.0)), 0.049, ANIM_NULL, ANIM_LINEAR);116 this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion((i+1)*120, Vector(1.0, 0.0, 0.0)), 0.001, ANIM_NULL, ANIM_LINEAR);117 }135 // for (int i = 0; i < this->getBarrels(); i++){ 136 // this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion(i * 120, Vector(1.0, 0.0, 0.0)), 0.049, ANIM_NULL, ANIM_LINEAR); 137 // this->shootAnim[i][0]->addKeyFrame(Vector(), Quaternion((i+1)*120, Vector(1.0, 0.0, 0.0)), 0.001, ANIM_NULL, ANIM_LINEAR); 138 // } 118 139 119 140 … … 144 165 pj->activate(); 145 166 146 for (int i = 0; i < this->getSegs(); i++)147 this->shootAnim[this->activeBarrel][i]->replay();167 // for (int i = 0; i < this->getSegs(); i++) 168 // this->shootAnim[this->activeBarrel][i]->replay(); 148 169 149 170 // switch barrel -
trunk/src/world_entities/weapons/medium_blaster.cc
r10548 r10618 1 /* 2 orxonox - the future of 3D-vertical-scrollers 3 4 Copyright (C) 2004-2006 orx 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2, or (at your option) 9 any later version. 10 11 ### File Specific 12 main-programmer: Marc Schaerrer, Nicolas Schlumberger 13 co-programmer: 14 15 */ 16 1 17 #include "medium_blaster.h" 2 18 #include "world_entities/projectiles/projectile.h" -
trunk/src/world_entities/weapons/spike_thrower.cc
r10516 r10618 10 10 11 11 ### File Specific 12 main-programmer: Marc Schaerrer 12 main-programmer: Marc Schaerrer, Nicolas Schlumberger 13 13 co-programmer: 14 14 */ … … 28 28 29 29 #include <list> 30 #include <iterator>31 30 #include "util/state.h" 32 33 #include "math/quaternion.h"34 31 35 32 #include "util/loading/factory.h" … … 108 105 this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_1.wav"); 109 106 this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav"); 110 this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");107 // this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav"); 111 108 112 109 } -
trunk/src/world_entities/weapons/swarm_launcher.cc
r10545 r10618 30 30 #include <iterator> 31 31 #include "util/state.h" 32 33 #include "math/quaternion.h"34 32 35 33 #include "util/loading/factory.h" … … 100 98 this->setProjectileTypeC("SwarmProjectile"); 101 99 102 this->loadModel("models/guns/turret1.obj", 1.0);100 // this->loadModel("models/guns/turret1.obj", 1.0); 103 101 104 102 this->setEmissionPoint(1.684, 0.472, 0); 105 this->getProjectileFactory()->prepare( 50);103 this->getProjectileFactory()->prepare(10); 106 104 107 105 this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_1.wav"); 108 this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav");109 this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");106 // this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav"); 107 // this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav"); 110 108 111 109 } -
trunk/src/world_entities/weapons/targeting_turret.cc
r10419 r10618 94 94 this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_3.wav"); 95 95 this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav"); 96 this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");96 // this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav"); 97 97 } 98 98 -
trunk/src/world_entities/weapons/turret.cc
r10419 r10618 95 95 this->setActionSound(WA_SHOOT, "sounds/explosions/explosion_3.wav"); 96 96 this->setActionSound(WA_ACTIVATE, "sounds/voices/rockets.wav"); 97 this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav");97 // this->setActionSound(WA_RELOAD, "sounds/voices/reload.wav"); 98 98 99 99 }
Note: See TracChangeset
for help on using the changeset viewer.