Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 20, 2012, 4:06:09 PM (12 years ago)
Author:
lkevin
Message:

Found a way to implement damage modifiers by
adding a flag to the pawn and then using this
flag in pawn::damage().

More compilation errors to be fixed though, a tick
function seems to be missing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pickup2012/src/orxonox/worldentities/pawns/Pawn.cc

    r9016 r9099  
    7575        this->lastHitOriginator_ = 0;
    7676
     77        // set damage multiplier to default value 1, meaning nominal damage
     78        this->damageMultiplier_ = 1;
     79
    7780        this->spawnparticleduration_ = 3.0f;
    7881
     
    228231    void Pawn::damage(float damage, float healthdamage, float shielddamage, Pawn* originator)
    229232    {
    230         if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
     233        // apply multiplier
     234        damage *= originator->getDamageMultiplier();
     235
     236        if (this->getGametype() && this->getGametype()->allowPawnDamage(this, originator))
    231237        {
    232238            if (shielddamage >= this->getShieldHealth())
Note: See TracChangeset for help on using the changeset viewer.