Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9960 in orxonox.OLD


Ignore:
Timestamp:
Nov 26, 2006, 1:29:09 PM (18 years ago)
Author:
nicolasc
Message:

fixed get*Damage() return values

Location:
branches/playability/src/world_entities/projectiles
Files:
2 edited

Legend:

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

    r9959 r9960  
    4444  this->setDamage(1.0f); // default damage of a projectile set to 100.0 damage points
    4545
     46  this->physDamage = 0.0f;
     47  this->elecDamage = 0.0f;
    4648  //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
    4749}
     
    5860  */
    5961  //delete this->projectileModel;
     62}
     63
     64Projectile::Projectile (float pDamage, float eDamage, PNode* target) : WorldEntity()
     65{
     66  this->registerObject(this, Projectile::_objectList);
     67
     68  this->lifeCycle = 0.0;
     69  this->lifeSpan = 1.0f; /* sec */
     70  this->removeNode();
     71
     72  /* character attributes */
     73  this->setHealth(1.0f);
     74  this->setDamage(1.0f); // default damage of a projectile set to 100.0 damage points
     75
     76  this->physDamage = pDamage;
     77  this->elecDamage = eDamage;
     78  this->target = target;
     79
     80  //this->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);
     81}
     82
     83void Projectile::initialize(float pDamage, float eDamage, PNode* target)
     84{
     85  /* character attributes*/
     86  this->physDamage = pDamage;
     87  this->elecDamage = eDamage;
     88  this->target = target;
    6089}
    6190
  • branches/playability/src/world_entities/projectiles/projectile.h

    r9959 r9960  
    2323    Projectile ();
    2424    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);
    2530
    2631    void setFlightDirection(const Quaternion& flightDirection);
     
    5459    inline bool tickLifeCycle(float dt ) { this->lifeCycle += dt/this->lifeSpan;  return(unlikely(this->lifeCycle >= 1)); }
    5560
    56     inline int getPhysDamage() { return this->physDamage; };
    57     inline int getElecDamage() { return this->elecDamage; };
     61    inline float getPhysDamage() { return this->physDamage; };
     62    inline float getElecDamage() { return this->elecDamage; };
    5863
    5964  protected:
Note: See TracChangeset for help on using the changeset viewer.