Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7072 in orxonox.OLD


Ignore:
Timestamp:
Feb 7, 2006, 3:06:34 PM (14 years ago)
Author:
bensch
Message:

collision stuff

Location:
trunk/src/world_entities
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/playable.cc

    r7044 r7072  
    125125void Playable::collidesWith(WorldEntity* entity, const Vector& location)
    126126{
    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);
    130134    // EXTREME HACK
    131     if (this->getHealth() == 0.0f)
     135    if (this->getHealth() <= 0.0f)
    132136    {
    133137      this->die();
     
    157161  PRINTF(0)("Playable dies\n");
    158162  // only if this is the spaceship of the player
     163  if (State::isOnline())
     164  {
    159165  if( this == State::getPlayer()->getPlayable())
    160166    State::getGameRules()->onPlayerDeath();
     
    168174  this->setAbsCoor(0, 0, 0);
    169175  this->emitter->setSystem(NULL);
     176  }
    170177}
    171178
  • trunk/src/world_entities/playable.h

    r7044 r7072  
    8888    DotEmitter*           emitter;
    8989    SpriteParticles*      explosionParticles;
     90
     91    WorldEntity* collider;
    9092};
    9193
  • trunk/src/world_entities/projectiles/guided_missile.cc

    r6825 r7072  
    4343  this->setHealthMax(10);
    4444  this->lifeSpan = 10.0;
    45   this->agility = 10;
     45  this->agility = 1;
    4646  this->maxVelocity = 75;
    4747
     
    117117  this->emitter->setEmissionRate(45.0);
    118118  this->emitter->setEmissionVelocity(0.0);
     119
     120  this->setHealth(10.0* (float)rand()/(float)RAND_MAX);
    119121}
    120122
  • trunk/src/world_entities/space_ships/hover.cc

    r7014 r7072  
    226226 */
    227227void Hover::collidesWith(WorldEntity* entity, const Vector& location)
    228 {}
     228{
     229  Playable::collidesWith(entity, location);
     230}
    229231
    230232
  • trunk/src/world_entities/space_ships/hover.h

    r6999 r7072  
    6767    float                 airViscosity;
    6868
     69    WorldEntity* hitEntity;
    6970};
    7071
  • trunk/src/world_entities/space_ships/turbine_hover.cc

    r7067 r7072  
    116116  this->acceleration = 10.0f;
    117117  this->airFriction = 2.0f;
     118
     119  this->setHealthMax(100);
     120  this->setHealth(100);
     121
    118122
    119123  // camera - issue
     
    256260 */
    257261void TurbineHover::collidesWith(WorldEntity* entity, const Vector& location)
    258 {}
     262{
     263  Playable::collidesWith(entity, location);
     264}
    259265
    260266
  • trunk/src/world_entities/weapons/targeting_turret.cc

    r7070 r7072  
    7676  animation2->setInfinity(ANIM_INF_CONSTANT);
    7777
    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);
    8080  this->setStateDuration(WS_ACTIVATING, .4);
    8181  this->setStateDuration(WS_DEACTIVATING, .4);
    8282
    83   this->setEnergyMax(10000);
    84   this->increaseEnergy(100000);
     83  this->setEnergyMax(100);
     84  this->increaseEnergy(100);
    8585
    8686  this->setCapability(WTYPE_ALLDIRS | WTYPE_TURRET);
Note: See TracChangeset for help on using the changeset viewer.