Changeset 10117 in orxonox.OLD for branches/playability/src/world_entities
- Timestamp:
- Dec 20, 2006, 12:31:27 AM (18 years ago)
- Location:
- branches/playability/src/world_entities
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/projectiles/lbolt.cc
r10104 r10117 47 47 this->setMinEnergy(1); 48 48 this->setHealthMax(0); 49 this->lifeSpan = 5.0;49 this->lifeSpan = 2.0; 50 50 51 51 this->emitter = new DotEmitter(100, 5, M_2_PI); -
branches/playability/src/world_entities/projectiles/mbolt.cc
r10113 r10117 53 53 this->setMinEnergy(4); 54 54 this->setHealthMax(0); 55 this->lifeSpan = 5.0;55 this->lifeSpan = 3.0; 56 56 this->angle = 0; 57 57 … … 137 137 this->lifeCycle = 0.0; 138 138 139 //this->toList(OM_NULL);140 139 this->toList(OM_DEAD); 141 //this->removeNode();140 this->removeNode(); 142 141 MBolt::fastFactory->kill(this); 143 142 } … … 146 145 void MBolt::collidesWith(WorldEntity* entity, const Vector& location) 147 146 { 148 PRINTF(0)("MBolt collides pretest\n"); 149 150 if( entity == NULL) 147 148 if (this->hitEntity != entity) 149 this->destroy( entity ); 150 this->hitEntity = entity; 151 dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage()); 152 this->destroy(this); 153 154 return; 155 156 if( entity == NULL || dynamic_cast<SpaceShip*>(entity) == NULL) 151 157 return; 152 158 153 PRINTF(0)("MBolt collides\n");154 159 dynamic_cast<SpaceShip*>(entity)->damage( this->getPhysDamage(), this->getElecDamage()); 155 160 //entity->destroy(this); … … 179 184 void MBolt::destroy (WorldEntity* killer) 180 185 { 186 //this->deactivate(); 181 187 Projectile::destroy( killer ); 182 188 PRINTF(5)("DESTROY MBolt\n"); … … 211 217 212 218 } 213 -
branches/playability/src/world_entities/projectiles/mbolt.h
r10081 r10117 35 35 virtual void draw () const; 36 36 37 38 37 private: 39 38 static FastFactory* fastFactory; -
branches/playability/src/world_entities/projectiles/swarm_projectile.cc
r10109 r10117 136 136 this->destroy( entity ); 137 137 this->hitEntity = entity; 138 dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage());138 //dynamic_cast<SpaceShip*>(entity)->damage(this->getPhysDamage(),this->getElecDamage()); 139 139 this->destroy(this); 140 140 } -
branches/playability/src/world_entities/space_ships/space_ship.cc
r10113 r10117 147 147 Weapon* wpRight1 = new LightBlaster (); 148 148 wpRight1->setName( "LightBlaster"); 149 wpRight1->setParent( this);149 //wpRight1->setParent( this); 150 150 Weapon* wpLeft1 = new LightBlaster (); 151 151 wpLeft1->setName( "LightBlaster"); 152 wpLeft1->setParent( this);152 //wpLeft1->setParent( this); 153 153 154 154 Weapon* wpRight2 = new MediumBlaster (); 155 155 wpRight2->setName( "MediumBlaster"); 156 wpRight2->setParent( this);156 //wpRight2->setParent( this); 157 157 Weapon* wpLeft2 = new MediumBlaster (); 158 158 wpLeft2->setName( "MediumBlaster"); 159 wpLeft2->setParent( this);159 //wpLeft2->setParent( this); 160 160 161 161 Weapon* wpRight3 = new HeavyBlaster (); 162 162 wpRight3->setName( "HeavyBlaster"); 163 wpRight3->setParent( this);163 //wpRight3->setParent( this); 164 164 Weapon* wpLeft3 = new HeavyBlaster (); 165 165 wpLeft3->setName( "HeavyBlaster"); 166 wpLeft3->setParent( this);166 //wpLeft3->setParent( this); 167 167 168 168 Weapon* cannon = new SwarmLauncher(); 169 169 cannon->setName( "SwarmLauncher"); 170 cannon->setParent( this);170 //cannon->setParent( this); 171 171 172 172 … … 180 180 this->secWeaponMan.addWeapon( cannon, 0, 0); 181 181 182 182 /* 183 183 wpRight1->requestAction(WA_ACTIVATE); 184 184 wpLeft1->requestAction(WA_ACTIVATE); … … 190 190 191 191 cannon->requestAction(WA_ACTIVATE); 192 192 */ 193 193 194 194 this->weaponMan.changeWeaponConfig(1); … … 418 418 void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location) 419 419 { 420 PRINTF(0)("SPACESHIP COLLIDED WITH %s\n",entity->getCName());421 420 } 422 421 … … 669 668 670 669 void SpaceShip::damage(float pDamage, float eDamage){ 671 PRINTF( 0)("ship hit for (%f,%f) \n",pDamage,eDamage);670 PRINTF(5)("ship hit for (%f,%f) \n",pDamage,eDamage); 672 671 673 672 if( this->shieldActive) { … … 968 967 void SpaceShip::nextWeaponConfig() 969 968 { 970 971 this->curWeaponPrimary = (curWeaponPrimary + 1) % 3; 972 this->weaponMan.changeWeaponConfig(this->curWeaponPrimary); 969 PRINTF(0)("Requested next weapon config!\n"); 970 this->weaponMan.nextWeaponConfig(); 973 971 Playable::weaponConfigChanged(); 974 972 } … … 979 977 void SpaceShip::previousWeaponConfig() 980 978 { 981 this->curWeaponPrimary = ( curWeaponPrimary + 1) % 3;979 this->curWeaponPrimary = (this->curWeaponPrimary + 1) % 3; 982 980 this->weaponMan.changeWeaponConfig(this->curWeaponPrimary); 983 981 Playable::weaponConfigChanged(); 984 982 } 983 984 void SpaceShip::hit(float damage, WorldEntity* killer) 985 { 986 this->damage(killer->getDamage(),0); 987 killer->collidesWith( this, this->getAbsCoor()); 988 //this->collidesWith(killer, this->getAbsCoor()); 989 } -
branches/playability/src/world_entities/space_ships/space_ship.h
r10113 r10117 82 82 void previousWeaponConfig(); 83 83 84 inline void hit(float damage, WorldEntity* killer) { this->collidesWith(killer, this->getAbsCoor()); killer->collidesWith(this, this->getAbsCoor()); };84 virtual void hit(float damage, WorldEntity* killer); 85 85 86 86 private: -
branches/playability/src/world_entities/weapons/medium_blaster.cc
r10109 r10117 11 11 #include "loading/fast_factory.h" 12 12 13 //#include "class_id_DEPRECATED.h" 14 //ObjectListDefinition(MediumBlaster); 13 15 CREATE_FACTORY(MediumBlaster); 14 16 /** … … 67 69 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT); 68 70 this->setProjectileTypeC("MBolt"); // FIXME temp project type until the blaste class exist 69 this->prepareProjectiles( 20);71 this->prepareProjectiles(100); 70 72 71 73 Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this); … … 100 102 pj->setAbsCoor(this->getEmissionPoint()); 101 103 pj->setAbsDir(this->getAbsDir()); 102 pj->toList(OM_GROUP_01_PROJ);103 104 pj->activate(); 104 105 }
Note: See TracChangeset
for help on using the changeset viewer.