Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8152


Ignore:
Timestamp:
Mar 28, 2011, 4:43:18 PM (13 years ago)
Author:
simonmie
Message:

added nice particleEffect if shield is hit

Location:
code/branches/gameimmersion
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gameimmersion/data/levels/test-immersion-shield-01.oxw

    r8146 r8152  
    5656<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
    5757
    58 <Model mesh="hs-w01.mesh" scale=10 position="0,0,-100" />
    59 <Model mesh="hs-w01s.mesh" scale=10 position="0,0,-100" />
    6058
    6159    <?lua
  • code/branches/gameimmersion/src/modules/weapons/projectiles/Projectile.cc

    r7284 r8152  
    103103            this->bDestroy_ = true;
    104104
     105            Pawn* victim = orxonox_cast<Pawn*>(otherObject);
     106
    105107            if (this->owner_)
    106108            {
     109                if (victim && !victim->hasShield())
    107110                {
    108111                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
     
    113116                    effect->setLifetime(2.0f);
    114117                }
     118                if (victim && !victim->hasShield())
    115119                {
    116120                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
     
    121125                    effect->setLifetime(3.0f);
    122126                }
     127                if (victim && victim->hasShield())
     128                {
     129                    ParticleSpawner* effect = new ParticleSpawner(this->owner_->getCreator());
     130                    effect->setPosition(this->getPosition());
     131                    effect->setOrientation(this->getOrientation());
     132                    effect->setDestroyAfterLife(true);
     133                    effect->setSource("Orxonox/engineglow");
     134                    effect->setLifetime(0.5f);
     135                }
    123136            }
    124137
    125             Pawn* victim = orxonox_cast<Pawn*>(otherObject);
    126138            if (victim)
    127139                victim->hit(this->owner_, contactPoint, this->damage_);
  • code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.cc

    r8145 r8152  
    145145////////me
    146146        this->addShieldHealth(this->getReloadRate() * dt);
     147        // TODO max. shield hinzufuegen
    147148////////end me
    148149        if (GameMode::isMaster())
  • code/branches/gameimmersion/src/orxonox/worldentities/pawns/Pawn.h

    r8145 r8152  
    6161            inline void addShieldHealth(float amount)
    6262            { this->setShieldHealth(this->shieldHealth_ + amount); }
     63
     64            inline bool hasShield()
     65            { return (this->getShieldHealth() > 0); }
    6366
    6467///////////////////////////////// end me
Note: See TracChangeset for help on using the changeset viewer.