Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 6, 2013, 3:09:30 PM (10 years ago)
Author:
zifloria
Message:

best game eva

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/invaders/src/modules/invader/InvaderShip.cc

    r9868 r9874  
    138138        // orxout() << "touch!!! " << endl; //<< otherObject << " at " << contactPoint;
    139139        WeakPtr<InvaderEnemy> enemy = orxonox_cast<InvaderEnemy*>(otherObject);
     140        WeakPtr<Projectile> shot = orxonox_cast<Projectile*>(otherObject);
    140141        // ensure that this gets only called once per enemy.
    141142        if (enemy != NULL && lastEnemy != enemy)
     
    146147            if (getGame())
    147148            {
    148                 getGame()->multiplier = 1;
    149                 if (getHealth() <= 0)
    150                     getGame()->costLife();                   
     149                getGame()->multiplier = 1;                   
    151150            }
    152             return false;
     151        }
     152        // was shot, decrease multiplier
     153        else if (shot != NULL  && lastShot != shot)
     154        {
     155            if (getGame() && orxonox_cast<InvaderEnemy*>(shot->getShooter()) != NULL)
     156            {
     157                if (getGame()->multiplier > 1)
     158                {
     159                    lastShot = shot;
     160                    getGame()->multiplier -= 1;     
     161                }
     162            }
    153163        }
    154164        return false;
     
    165175        return game;
    166176    }
     177
     178    void InvaderShip::death()
     179    {
     180        getGame()->costLife();
     181        SpaceShip::death();
     182    }
    167183}
Note: See TracChangeset for help on using the changeset viewer.