Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2011, 9:41:29 PM (13 years ago)
Author:
dafrick
Message:

Merging game immersion branch into presentation branch.

Location:
code/branches/presentation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation

  • code/branches/presentation/src/modules/weapons/projectiles/Projectile.cc

    r8579 r8580  
    2323 *      Fabian 'x3n' Landau
    2424 *   Co-authors:
    25  *      ...
     25 *      simonmie
    2626 *
    2727 */
     
    4141    CreateFactory(Projectile);
    4242
    43     Projectile::Projectile(BaseObject* creator) : MovableEntity(creator)
     43    Projectile::Projectile(BaseObject* creator) : MovableEntity(creator), BasicProjectile()
    4444    {
    4545        RegisterObject(Projectile);
    4646
    4747        this->setConfigValues();
    48         this->bDestroy_ = false;
    4948        this->owner_ = 0;
    50         this->damage_ = 15;
    5149
    5250        // Get notification about collisions
    53 
    5451        if (GameMode::isMaster())
    5552        {
     
    8481            return;
    8582
    86         if (this->bDestroy_)
     83        if (this->getBDestroy())
    8784            this->destroy(); // TODO: use a scheduler instead of deleting the object right here in tick()
    8885    }
     
    9491    }
    9592
     93    /* Calls the collidesAgainst function of BasicProjectile
     94     */
    9695    bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
    9796    {
    98         if (!this->bDestroy_ && GameMode::isMaster())
    99         {
    100             if (otherObject == this->owner_)
    101                 return false;
    102 
    103             this->bDestroy_ = true;
    104 
    105             if (this->owner_)
    106             {
    107                 {
    108                     ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
    109                     effect->setPosition(this->getPosition());
    110                     effect->setOrientation(this->getOrientation());
    111                     effect->setDestroyAfterLife(true);
    112                     effect->setSource("Orxonox/explosion3");
    113                     effect->setLifetime(2.0f);
    114                 }
    115                 {
    116                     ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
    117                     effect->setPosition(this->getPosition());
    118                     effect->setOrientation(this->getOrientation());
    119                     effect->setDestroyAfterLife(true);
    120                     effect->setSource("Orxonox/smoke4");
    121                     effect->setLifetime(3.0f);
    122                 }
    123             }
    124 
    125             Pawn* victim = orxonox_cast<Pawn*>(otherObject);
    126             if (victim)
    127                 victim->hit(this->owner_, contactPoint, this->damage_);
    128         }
    129         return false;
     97        return BasicProjectile::basicCollidesAgainst(otherObject,contactPoint,this->getOwner(),this);
    13098    }
    13199
Note: See TracChangeset for help on using the changeset viewer.