Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9959 in orxonox.OLD for branches/playability/src


Ignore:
Timestamp:
Nov 26, 2006, 11:44:49 AM (18 years ago)
Author:
nicolasc
Message:

moved damage attr to proteced; collidesWith checks against SpaceShip and does some damage

Location:
branches/playability/src/world_entities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/projectiles/projectile.cc

    r9958 r9959  
    122122
    123123
    124 
    125 void Projectile::collidesWith (WorldEntity* entity, const Vector& location)
     124void Projectile::collidesWith (SpaceShip* target, const Vector& location)
    126125{
    127   //if (entity->isA(CL_SPACE_SHIP)) /* FIXME make sure that entity is a spaceship*/
    128   //  entity->damage(this->physDamage, this->elecDamage); /* and do some damage*/
    129   this->destroy(entity);
     126  target->damage(this->physDamage, this->elecDamage);
     127  this->destroy(target);
    130128}
    131129
  • branches/playability/src/world_entities/projectiles/projectile.h

    r9958 r9959  
    1212#include "world_entity.h"
    1313#include "loading/fast_factory.h"
     14#include "space_ships/space_ship.h"
    1415
    1516#include "sound_source.h"
     
    4445    virtual void destroy (WorldEntity* killer);
    4546
    46     virtual void collidesWith (WorldEntity* entity, const Vector& location);   //!< collision handler as used in diverse weapons
     47    virtual void collidesWith (SpaceShip* target, const Vector& location);  //!< collision handler; used against SpaceShip as most target will be
     48
    4749
    4850    virtual void tick (float dt);
     
    6365    float                  lifeSpan;                  //!< The entire lifespan of the Shoot. in seconds
    6466
     67    float                   physDamage;               //!< damage to shield and armor
     68    float                   elecDamage;               //!< damage to elctronic
     69
    6570    Vector                 flightDirection;           //!< DOF direction in which the shoot flighs
    6671
     
    7378    OrxSound::SoundBuffer  explosionBuffer;
    7479    OrxSound::SoundBuffer  engineBuffer;
    75 
    76     int                     physDamage;               //!< damage to shield and armor
    77     int                     elecDamage;               //!< damage to elctronic
    7880};
    7981
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r9958 r9959  
    5050// #include "lib/gui/gl_gui/glgui_bar.h"
    5151// #include "lib/gui/gl_gui/glgui_pushbutton.h"
    52 
    5352
    5453
Note: See TracChangeset for help on using the changeset viewer.