Changeset 7072 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Feb 7, 2006, 3:06:34 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/playable.cc
r7044 r7072 125 125 void Playable::collidesWith(WorldEntity* entity, const Vector& location) 126 126 { 127 if (entity->isA(CL_PROJECTILE) && !State::isOnline() ) 128 { 129 this->decreaseHealth(entity->getHealth()); 127 if (entity == collider) 128 return; 129 collider = entity; 130 131 if (entity->isA(CL_PROJECTILE)) 132 { 133 this->decreaseHealth(entity->getHealth() *(float)rand()/(float)RAND_MAX); 130 134 // EXTREME HACK 131 if (this->getHealth() == 0.0f)135 if (this->getHealth() <= 0.0f) 132 136 { 133 137 this->die(); … … 157 161 PRINTF(0)("Playable dies\n"); 158 162 // only if this is the spaceship of the player 163 if (State::isOnline()) 164 { 159 165 if( this == State::getPlayer()->getPlayable()) 160 166 State::getGameRules()->onPlayerDeath(); … … 168 174 this->setAbsCoor(0, 0, 0); 169 175 this->emitter->setSystem(NULL); 176 } 170 177 } 171 178 -
trunk/src/world_entities/playable.h
r7044 r7072 88 88 DotEmitter* emitter; 89 89 SpriteParticles* explosionParticles; 90 91 WorldEntity* collider; 90 92 }; 91 93 -
trunk/src/world_entities/projectiles/guided_missile.cc
r6825 r7072 43 43 this->setHealthMax(10); 44 44 this->lifeSpan = 10.0; 45 this->agility = 1 0;45 this->agility = 1; 46 46 this->maxVelocity = 75; 47 47 … … 117 117 this->emitter->setEmissionRate(45.0); 118 118 this->emitter->setEmissionVelocity(0.0); 119 120 this->setHealth(10.0* (float)rand()/(float)RAND_MAX); 119 121 } 120 122 -
trunk/src/world_entities/space_ships/hover.cc
r7014 r7072 226 226 */ 227 227 void Hover::collidesWith(WorldEntity* entity, const Vector& location) 228 {} 228 { 229 Playable::collidesWith(entity, location); 230 } 229 231 230 232 -
trunk/src/world_entities/space_ships/hover.h
r6999 r7072 67 67 float airViscosity; 68 68 69 WorldEntity* hitEntity; 69 70 }; 70 71 -
trunk/src/world_entities/space_ships/turbine_hover.cc
r7067 r7072 116 116 this->acceleration = 10.0f; 117 117 this->airFriction = 2.0f; 118 119 this->setHealthMax(100); 120 this->setHealth(100); 121 118 122 119 123 // camera - issue … … 256 260 */ 257 261 void TurbineHover::collidesWith(WorldEntity* entity, const Vector& location) 258 {} 262 { 263 Playable::collidesWith(entity, location); 264 } 259 265 260 266 -
trunk/src/world_entities/weapons/targeting_turret.cc
r7070 r7072 76 76 animation2->setInfinity(ANIM_INF_CONSTANT); 77 77 78 this->setStateDuration(WS_SHOOTING, . 1);79 this->setStateDuration(WS_RELOADING, .1);78 this->setStateDuration(WS_SHOOTING, .5); 79 this->setStateDuration(WS_RELOADING, 1.0); 80 80 this->setStateDuration(WS_ACTIVATING, .4); 81 81 this->setStateDuration(WS_DEACTIVATING, .4); 82 82 83 this->setEnergyMax(100 00);84 this->increaseEnergy(100 000);83 this->setEnergyMax(100); 84 this->increaseEnergy(100); 85 85 86 86 this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
Note: See TracChangeset
for help on using the changeset viewer.