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/SimpleRocket.cc

    r8579 r8580  
    2323 *      Oliver Scheuss
    2424 *   Co-authors:
    25  *      ...
     25 *      simonmie
    2626 *
    2727 */
     
    4848    CreateFactory(SimpleRocket);
    4949
    50     SimpleRocket::SimpleRocket(BaseObject* creator) : ControllableEntity(creator)
     50    SimpleRocket::SimpleRocket(BaseObject* creator) : ControllableEntity(creator), BasicProjectile()
    5151    {
    5252        RegisterObject(SimpleRocket);// - register the SimpleRocket class to the core
    5353
    5454        this->localAngularVelocity_ = 0;
    55         this->bDestroy_ = false;
    5655        this->lifetime_ = 120;
    5756
    5857        this->setMass(15);
    59         COUT(4) << "simplerocket constructed\n";
     58//        COUT(4) << "simplerocket constructed\n";
    6059
    6160        if (GameMode::isMaster())
     
    115114                this->disableFire();
    116115
    117             if( this->bDestroy_ )
     116            if( this->getBDestroy() )
    118117                this->destroy();
    119118        }
     
    159158    {
    160159        this->owner_ = owner;
    161         this->player_ = this->owner_->getPlayer();
    162     }
    163 
    164 
    165 
    166 
     160        this->player_ = this->getOwner()->getPlayer();
     161    }
     162
     163
     164    /* Calls the collidesAgainst function of BasicProjectile
     165     */
    167166    bool SimpleRocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
    168167    {
    169         if (!this->bDestroy_ && GameMode::isMaster())
    170         {
    171             if (otherObject == this->owner_)
    172                 return false;
    173 
    174             this->bDestroy_ = true;
    175 
    176             if (this->owner_)
    177             {
    178                 {
    179                     ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
    180                     effect->setPosition(this->getPosition());
    181                     effect->setOrientation(this->getOrientation());
    182                     effect->setDestroyAfterLife(true);
    183                     effect->setSource("Orxonox/explosion4");
    184                     effect->setLifetime(2.0f);
    185                 }
    186 
    187                 {
    188                     ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
    189                     effect->setPosition(this->getPosition());
    190                     effect->setOrientation(this->getOrientation());
    191                     effect->setDestroyAfterLife(true);
    192                     effect->setSource("Orxonox/smoke4");
    193                     effect->setLifetime(3.0f);
    194                 }
    195             }
    196 
    197             float dmg = this->damage_;
    198 //             if (this->owner_)
    199 //                 dmg = this->owner_->getPickups().processModifiers(ModifierType::Damage, dmg, false);
    200 
    201             Pawn* victim = orxonox_cast<Pawn*>(otherObject);
    202             if (victim)
    203                 victim->hit(this->owner_, contactPoint, dmg);
    204         }
    205         return false;
     168        return BasicProjectile::basicCollidesAgainst(otherObject,contactPoint,this->getOwner(),this);
    206169    }
    207170
Note: See TracChangeset for help on using the changeset viewer.