Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 25, 2007, 12:48:13 PM (18 years ago)
Author:
patrick
Message:

merged the playability branche. working

Location:
branches/playability.merge
Files:
3 edited
16 copied

Legend:

Unmodified
Added
Removed
  • branches/playability.merge

    • Property svn:ignore
      •  

        old new  
        1010autom4te.cache
        1111aclocal.m4
         12tags
         13test.bmp
         14config.sub
         15config.guess
         16OrxonoxPlayability.kdevses
         17OrxonoxPlayability.kdevelop.pcs
  • branches/playability.merge/src/world_entities/projectiles/acid_splash.cc

    r10365 r10366  
    3232
    3333
    34 #include "class_id_DEPRECATED.h"
     34
    3535ObjectListDefinition(AcidSplash);
    3636CREATE_FAST_FACTORY_STATIC(AcidSplash);
  • branches/playability.merge/src/world_entities/projectiles/hbolt.cc

    r10365 r10366  
    2929// #include "effects/billboard.h"
    3030#include "space_ships/space_ship.h"
     31#include "npcs/npc.h"
    3132
    32 #include "class_id_DEPRECATED.h"
    3333ObjectListDefinition(HBolt);
    3434CREATE_FAST_FACTORY_STATIC(HBolt);
     
    121121{
    122122  printf("Collision with HBolt\n");
    123   if (this->hitEntity != entity && entity->isA(CL_NPC) || entity == this->target)
     123  if (this->hitEntity != entity && entity->isA(NPC::staticClassID()) || entity == this->target)
    124124    this->destroy( entity );
    125125  this->hitEntity = entity;
  • branches/playability.merge/src/world_entities/projectiles/lbolt.cc

    r10365 r10366  
    2525#include "particles/dot_emitter.h"
    2626#include "particles/sprite_particles.h"
     27#include "npcs/npc.h"
    2728
    2829#include <cassert>
     
    3233
    3334
    34 #include "class_id_DEPRECATED.h"
     35
    3536ObjectListDefinition(LBolt);
    3637CREATE_FAST_FACTORY_STATIC(LBolt);
     
    123124{
    124125  PRINTF(0)("Collision with LBolt\n");
    125   if (this->hitEntity != entity && entity->isA(CL_NPC))
     126  if (this->hitEntity != entity && entity->isA(NPC::staticClassID()))
    126127    this->destroy( entity );
    127128  this->hitEntity = entity;
  • branches/playability.merge/src/world_entities/projectiles/mbolt.cc

    r10365 r10366  
    3636
    3737
    38 #include "class_id_DEPRECATED.h"
     38
    3939ObjectListDefinition(MBolt);
    4040CREATE_FAST_FACTORY_STATIC(MBolt);
     
    4848  this->loadModel("models/projectiles/mbolt.obj",4);
    4949
    50  
     50
    5151  //this->loadModel("models/projectiles/laser.obj");
    5252
     
    7171  this->mat->setDiffuseMap("laser.png",1);
    7272
    73   dynamic_cast<StaticModel*>(this->getModel())->addMaterial(this->mat);
     73  dynamic_cast<StaticModel*>(this->getModel())->addMaterial(*this->mat);
    7474  dynamic_cast<StaticModel*>(this->getModel())->finalize();
    7575
    7676  dynamic_cast<StaticModel*>(this->getModel())->rebuild();
    7777  //this->buildObbTree(4);
    78  
     78
    7979  this->trail = new Trail(6, 4, .1, this);
    8080  //this->trail->setParent( this);
     
    155155  //this->destroy(this);
    156156  this->deactivate();
    157  
     157
    158158  return;
    159159
  • branches/playability.merge/src/world_entities/projectiles/projectile.cc

    r10013 r10366  
    2525#include "playable.h"
    2626
     27#include <cmath>
     28
    2729#include "debug.h"
    2830
     
    4648  this->subscribeReaction( CoRe::CREngine::CR_PHYSICS_FULL_WALK, Playable::staticClassID());
    4749
     50  this->physDamage = 0.0f;
     51  this->elecDamage = 0.0f;
    4852  //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
    4953}
     
    6064  */
    6165  //delete this->projectileModel;
     66}
     67
     68Projectile::Projectile (float pDamage, float eDamage, PNode* target) : WorldEntity()
     69{
     70  this->registerObject(this, Projectile::_objectList);
     71
     72  this->lifeCycle = 0.0;
     73  this->lifeSpan = 1.0f; /* sec */
     74  this->removeNode();
     75
     76  /* character attributes */
     77  this->setHealth(1.0f);
     78  this->setDamage(1.0f); // default damage of a projectile set to 100.0 damage points
     79
     80  this->physDamage = pDamage;
     81  this->elecDamage = eDamage;
     82  this->target = target;
     83
     84  //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
     85}
     86
     87void Projectile::initialize(float pDamage, float eDamage, PNode* target)
     88{
     89  /* character attributes*/
     90  this->physDamage = pDamage;
     91  this->elecDamage = eDamage;
     92  this->target = target;
    6293}
    6394
     
    124155
    125156
     157void Projectile::collidesWith (WorldEntity* target, const Vector& location)
     158{
     159  dynamic_cast<SpaceShip*>(target)->damage(this->getPhysDamage(),this->getElecDamage());
     160//   this->destroy(NULL);
     161  this->destroy(target);
     162}
     163
     164
     165
    126166/**
    127167 * signal tick, time dependent things will be handled here
     
    130170void Projectile::tick (float dt)
    131171{
    132   Vector v = this->velocity * (dt);
    133   this->shiftCoor(v);
    134 
    135172  if (this->tickLifeCycle(dt))
    136173    this->destroy( NULL );
  • branches/playability.merge/src/world_entities/projectiles/projectile.h

    r9869 r10366  
    1212#include "world_entity.h"
    1313#include "loading/fast_factory.h"
     14#include "space_ships/space_ship.h"
    1415
    1516#include "sound_source.h"
     
    2223    Projectile ();
    2324    virtual ~Projectile ();
     25
     26    /** @brief Constructor with variable passing*/
     27    Projectile (float pDamage, float eDamage, PNode* target);
     28    /** @brief for void construction; setting values later - needed for FastFactory*/
     29    virtual void initialize(float pDamage, float eDamage, PNode* target);
    2430
    2531    void setFlightDirection(const Quaternion& flightDirection);
     
    4450    virtual void destroy (WorldEntity* killer);
    4551
     52    virtual void collidesWith (WorldEntity* target, const Vector& location);  //!< collision handler; used against SpaceShip as most target will be
     53
     54
    4655    virtual void tick (float dt);
    4756    /** @brief convenience function
     
    5059    inline bool tickLifeCycle(float dt ) { this->lifeCycle += dt/this->lifeSpan;  return(unlikely(this->lifeCycle >= 1)); }
    5160
     61    inline float getPhysDamage() { return this->physDamage; };
     62    inline float getElecDamage() { return this->elecDamage; };
     63
     64    inline void setPhysDamage( float dmg) {this->physDamage = dmg; };
     65    inline void setElecDamage( float dmg) {this->elecDamage = dmg; };
    5266
    5367  protected:
    5468    // energy
    55     float                  energyMin;                 //!< The minimal Energy a Projectile needs to be emitted.
    56     bool                   bChargeable;               //!< if the Projectile is Charegeable
     69    int                origList;                        //!< FIXME currently a fix around the collision seg fault
     70    float                   energyMin;                //!< The minimal Energy a Projectile needs to be emitted.
     71    bool                    bChargeable;              //!< if the Projectile is Charegeable
    5772
    58     float                  lifeCycle;                 //!< The percentage of the Lifetime done [0-1]
    59     float                  lifeSpan;                  //!< The entire lifespan of the Shoot. in seconds
     73    float                   lifeCycle;                //!< The percentage of the Lifetime done [0-1]
     74    float                   lifeSpan;                 //!< The entire lifespan of the Shoot. in seconds
    6075
    61     Vector                 flightDirection;           //!< DOF direction in which the shoot flighs
     76    float                   physDamage;               //!< damage to shield and armor
     77    float                   elecDamage;               //!< damage to elctronic
     78    float                   turningSpeed;             //!< degrees per tick
    6279
    63     Vector                 velocity;                  //!< velocity of the projectile.
     80    Vector                  flightDirection;          //!< DOF direction in which the shoot flighs
    6481
    65     PNode*                 target;                    //!< A target for guided Weapons.
     82    Vector                  velocity;                 //!< velocity of the projectile.
     83
     84    PNode*                  target;                   //!< A target for guided Weapons.
    6685
    6786    OrxSound::SoundSource  soundSource;
  • branches/playability.merge/src/world_entities/projectiles/spike.cc

    r10365 r10366  
    3232
    3333
    34 #include "class_id_DEPRECATED.h"
     34
    3535ObjectListDefinition(Spike);
    3636CREATE_FAST_FACTORY_STATIC(Spike);
  • branches/playability.merge/src/world_entities/projectiles/spike_ball.cc

    r10365 r10366  
    3232
    3333
    34 #include "class_id_DEPRECATED.h"
     34
    3535ObjectListDefinition(SpikeBall);
    3636CREATE_FAST_FACTORY_STATIC(SpikeBall);
  • branches/playability.merge/src/world_entities/projectiles/swarm_projectile.cc

    r10365 r10366  
    2727#include "debug.h"
    2828
    29 #include "class_id_DEPRECATED.h"
     29
    3030
    3131#include "math/vector.h"
    3232
    33 ObjectListDefinitionID(SwarmProjectile, CL_SWARM_PROJECTILE);
     33ObjectListDefinition(SwarmProjectile);
    3434CREATE_FAST_FACTORY_STATIC(SwarmProjectile);
    3535
     
    167167//   printf("turning angle: %f\ntemp: %f\n", angle, tmp);
    168168
    169   if( fabsf(angle) >  fabsf(tmp) ) 
     169  if( fabsf(angle) >  fabsf(tmp) )
    170170    angle = tmp;
    171171  else
Note: See TracChangeset for help on using the changeset viewer.