Changeset 10224 in orxonox.OLD for branches/playability
- Timestamp:
- Jan 10, 2007, 5:33:19 PM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/projectiles/spike_ball.cc
r10217 r10224 68 68 this->weaponMan = new WeaponManager(dynamic_cast<WorldEntity*>(this)); 69 69 this->weaponMan->setParentEntity(this); 70 this->weaponMan->setSlotCount(1); 71 this->weaponMan->setSlotPosition(0, Vector(0, 0, 0)); 72 this->weaponMan->setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 70 73 71 74 Weapon* cannon = new SpikeLauncher(); … … 73 76 this->weaponMan->addWeapon(cannon, 0, 0); 74 77 this->weaponMan->changeWeaponConfig(0); 75 76 this->ttd = false;77 78 } 78 79 … … 176 177 this->shiftCoor(v); 177 178 178 if (this->tickLifeCycle(dt)){ 179 this->weaponMan->getWeapon(0)->requestAction(WA_SHOOT); 180 if (this->ttd) 179 if(this->lifeCycle > .9){ 180 printf("called by spikeball "); 181 this->weaponMan->fire(); 182 } 183 184 if (this->tickLifeCycle(dt)) 181 185 this->deactivate(); 182 this->ttd = true;183 }184 186 185 187 angle += rotationSpeed * dt; -
branches/playability/src/world_entities/projectiles/spike_ball.h
r10217 r10224 64 64 65 65 WeaponManager* weaponMan; 66 67 bool ttd;68 66 }; 69 67 -
branches/playability/src/world_entities/space_ships/space_ship.cc
r10217 r10224 175 175 cannon->setName( "SwarmLauncher"); 176 176 177 Weapon* spike = new Spike Launcher();177 Weapon* spike = new SpikeThrower(); 178 178 spike->setName( "SpikeThrower" ); 179 179 180 Weapon* spike2 = new SpikeLauncher(); 181 spike->setName( "SpikeLauncher" ); 180 182 181 183 this->weaponMan.addWeapon( wpLeft1, 0, 0); … … 199 201 this->secWeaponMan.addWeapon( cannon, 0, 0); 200 202 this->secWeaponMan.addWeapon( spike, 1, 1); 203 this->secWeaponMan.addWeapon( spike2, 2, 2); 201 204 202 205 … … 205 208 206 209 curWeaponPrimary = 3; 207 curWeaponSecondary = 0;210 curWeaponSecondary = 2; 208 211 209 212 Playable::weaponConfigChanged(); -
branches/playability/src/world_entities/weapons/spike_launcher.cc
r10217 r10224 219 219 float x, y, z; 220 220 for (int i = 0; i < this->spikes;i++){ 221 221 printf("%i ", i); 222 222 x = m[0][0] * this->launcher[i].x + m[0][1] * this->launcher[i].y + m[0][2] * this->launcher[i].z; 223 223 y = m[1][0] * this->launcher[i].x + m[1][1] * this->launcher[i].y + m[1][2] * this->launcher[i].z; … … 229 229 this->launcher[i] = Vector (x, y, z); 230 230 } 231 printf("\n"); 231 232 232 233 for( int i = 0; i < 3 ; i++) … … 241 242 updateFireDir(VECTOR_RAND(1), 20); 242 243 243 printf("fir eing spikes\n");244 printf("firing spikes\n"); 244 245 Projectile* pj = NULL; 245 246 for (int i = 0; i < this->spikes; i++) … … 250 251 251 252 // pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*115.0 + VECTOR_RAND(10))); 252 pj->setVelocity(this->launcher[i] * 300.0);253 pj->setVelocity(this->launcher[i].getNormalized() * 300.0); 253 254 254 255 pj->setParent(PNode::getNullParent()); 255 256 pj->setAbsCoor(this->getAbsCoor() + this->launcher[i] * this->size); 256 //Quaternion q;257 //pj->setRelDir(q.lookAt(Vector(), this->launcher[i], VECTOR_RAND(1)));258 pj->setRelDir(90, this->launcher[i].x, this->launcher[i].y, this->launcher[i].z);259 260 pj->toList(this->getOMListNumber()); 257 Quaternion q; 258 pj->setRelDir(q.lookAt(Vector(), this->launcher[i], VECTOR_RAND(1))); 259 // pj->setRelDir(90, this->launcher[i].x, this->launcher[i].y, this->launcher[i].z); 260 261 /* pj->toList(this->getOMListNumber());*/ 261 262 pj->activate(); 262 263 } -
branches/playability/src/world_entities/weapons/spike_thrower.cc
r10196 r10224 157 157 pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*150); 158 158 pj->setAbsCoor(this->getEmissionPoint()); 159 pj->toList(this->getOMListNumber()); 159 160 160 161 pj->setAbsDir(this->getAbsDir()); -
branches/playability/src/world_entities/weapons/weapon_manager.cc
r10132 r10224 431 431 void WeaponManager::fire() 432 432 { 433 printf("firing WM: "); 433 434 Weapon* firingWeapon; 434 435 for(int i = 0; i < this->slotCount; i++) 435 436 { 437 printf("%i ", i); 436 438 firingWeapon = this->currentSlotConfig[i].currentWeapon; 437 439 if( firingWeapon != NULL && firingWeapon->getCurrentState() == WS_SHOOTING) continue; 438 440 if( firingWeapon != NULL) firingWeapon->requestAction(WA_SHOOT); 439 441 } 440 442 printf("\n"); 441 443 /* 442 444 this->crosshair->setRotationSpeed(500);
Note: See TracChangeset
for help on using the changeset viewer.