Changeset 10180 in orxonox.OLD for branches/playability
- Timestamp:
- Jan 4, 2007, 10:29:09 PM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 2 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/WorldEntities.am
r10179 r10180 42 42 world_entities/weapons/swarm_launcher.cc \ 43 43 world_entities/weapons/spike_launcher.cc \ 44 world_entities/weapons/spike_thrower.cc \ 44 45 world_entities/weapons/acid_launcher.cc \ 45 46 \ … … 160 161 weapons/swarm_launcher.h \ 161 162 weapons/spike_launcher.h \ 163 weapons/spike_thrower.h \ 162 164 weapons/acid_launcher.h \ 163 165 \ -
branches/playability/src/world_entities/projectiles/hbolt.cc
r10159 r10180 113 113 } 114 114 115 115 /* 116 116 void HBolt::collidesWith(WorldEntity* entity, const Vector& location) 117 117 { … … 122 122 dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage()); 123 123 this->deactivate(); 124 } 124 }*/ 125 125 126 126 -
branches/playability/src/world_entities/projectiles/hbolt.h
r10104 r10180 27 27 virtual void deactivate(); 28 28 29 virtual void collidesWith(WorldEntity* entity, const Vector& location);29 // virtual void collidesWith(WorldEntity* entity, const Vector& location); 30 30 31 31 virtual void destroy (WorldEntity* killer); -
branches/playability/src/world_entities/projectiles/lbolt.cc
r10117 r10180 115 115 } 116 116 117 117 /* 118 118 void LBolt::collidesWith(WorldEntity* entity, const Vector& location) 119 119 { … … 124 124 dynamic_cast<SpaceShip*>(entity)->damage(this->getDamage(),0); 125 125 // this->deactivate(); 126 } 126 }*/ 127 127 128 128 /** -
branches/playability/src/world_entities/projectiles/lbolt.h
r10074 r10180 27 27 virtual void deactivate(); 28 28 29 virtual void collidesWith(WorldEntity* entity, const Vector& location);29 // virtual void collidesWith(WorldEntity* entity, const Vector& location); 30 30 31 31 virtual void destroy (WorldEntity* killer); -
branches/playability/src/world_entities/projectiles/mbolt.cc
r10170 r10180 141 141 } 142 142 143 143 /* 144 144 void MBolt::collidesWith(WorldEntity* entity, const Vector& location) 145 145 { … … 157 157 //entity->destroy(this); 158 158 //this->deactivate(); 159 } 159 }*/ 160 160 161 161 /** -
branches/playability/src/world_entities/projectiles/mbolt.h
r10117 r10180 28 28 virtual void deactivate(); 29 29 30 virtual void collidesWith(WorldEntity* entity, const Vector& location);30 // virtual void collidesWith(WorldEntity* entity, const Vector& location); 31 31 32 32 virtual void destroy (WorldEntity* killer); -
branches/playability/src/world_entities/projectiles/spike_ball.cc
r10170 r10180 30 30 31 31 #include "space_ships/space_ship.h" 32 33 #include "weapons/weapon.h" 32 34 33 35 … … 58 60 59 61 this->angle = 0; 60 this->rotationSpeed = 130;62 this->rotationSpeed = 0; 61 63 /* 62 64 this->halo = new Billboard(); -
branches/playability/src/world_entities/weapons/spike_launcher.cc
r10170 r10180 67 67 SpikeLauncher::~SpikeLauncher () 68 68 { 69 delete this->launcher; 70 69 71 // model will be deleted from WorldEntity-destructor 70 72 } … … 95 97 96 98 this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET | WTYPE_DIRECTIONAL | WTYPE_LIGHT); 97 this->setProjectileTypeC("Spike Ball");99 this->setProjectileTypeC("Spike"); 98 100 99 this->loadModel("models/guns/turret1.obj", 1.0); 101 // this->loadModel("models/guns/turret1.obj", 1.0); 102 this->size = 2.5; 100 103 101 this->setEmissionPoint(1.684, 0.472, 0); 102 this->getProjectileFactory()->prepare(50); 104 this->spikes = 26; 105 this->launcher = new Vector [this->spikes]; 106 107 this->launcher[0] = Vector(1.0, 0.0, 0.0); 108 this->launcher[1] = Vector(0.0, 1.0, 0.0); 109 this->launcher[2] = Vector(0.0, 0.0, 1.0); 110 111 this->launcher[3] = Vector(1.0, 1.0, 0.0); 112 this->launcher[4] = Vector(0.0, 1.0, 1.0); 113 this->launcher[5] = Vector(1.0, 0.0, 1.0); 114 this->launcher[6] = Vector(1.0, -1.0, 0.0); 115 this->launcher[7] = Vector(0.0, 1.0, -1.0); 116 this->launcher[8] = Vector(-1.0, 0.0, 1.0); 117 118 this->launcher[9] = Vector(-1.0, 1.0, 1.0); 119 this->launcher[10] = Vector(1.0, 1.0, 1.0); 120 this->launcher[11] = Vector(1.0, -1.0, 1.0); 121 this->launcher[12] = Vector(-1.0, -1.0, 1.0); 122 123 int tmp = this->spikes / 2; 124 for (int i = 0; i < tmp; i++) 125 { 126 this->launcher[i].normalize(); 127 this->launcher[tmp + i] = this->launcher[i] * (-1); 128 } 129 130 // this->setEmissionPoint(1.684, 0.472, 0); 131 this->getProjectileFactory()->prepare(this->spikes); //we don't need more... 103 132 104 133 this->setActionSound(WA_SHOOT, "sound/explosions/explosion_1.wav"); … … 145 174 void SpikeLauncher::fire() 146 175 { 147 bool fired = false; 176 Projectile* pj = NULL; 177 // for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++) 178 for (int i = 0; i < this->spikes; i++) 179 { 180 pj = this->getProjectile(); 181 if (pj == NULL) // if true, we do have a problem!! 182 return; 148 183 149 Projectile* pj = NULL; 150 for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++) 151 { 152 if( ((*eIterator)->getOMListNumber() == OM_GROUP_00) && ((*eIterator)->getClassCName() != "Weapon") && ((*eIterator)->getClassCName() != "Projectile") && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 300) 153 { 154 pj = this->getProjectile(); 155 if (pj == NULL) 156 return; 157 158 fired = true; 159 pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*115.0 + VECTOR_RAND(10))); 184 // pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*115.0 + VECTOR_RAND(10))); 185 pj->setVelocity(this->launcher[i] * 200.0); 160 186 161 pj->setParent(PNode::getNullParent()); 162 pj->setAbsCoor(this->getEmissionPoint()); 163 pj->setAbsDir(this->getAbsDir()); 164 // dynamic_cast<SpikeProjectile*>(pj)->setTarget( (PNode*)(*eIterator) ); 165 pj->toList(OM_GROUP_01_PROJ); 166 pj->activate(); 167 } 187 pj->setParent(PNode::getNullParent()); 188 pj->setAbsCoor(this->getAbsCoor() + this->launcher[i] * this->size); 189 pj->setAbsDir(Quaternion(this->launcher[i], 0)); 190 pj->activate(); 168 191 } 169 if( !fired)170 this->increaseEnergy( this->getProjectile()->getMinEnergy());171 192 } -
branches/playability/src/world_entities/weapons/spike_launcher.h
r10170 r10180 30 30 31 31 private: 32 33 int spikes; 34 Vector* launcher; 35 float size; 32 36 }; 33 37
Note: See TracChangeset
for help on using the changeset viewer.