- Timestamp:
- Dec 6, 2013, 3:09:30 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/invaders/src/modules/invader/InvaderShip.cc
r9868 r9874 138 138 // orxout() << "touch!!! " << endl; //<< otherObject << " at " << contactPoint; 139 139 WeakPtr<InvaderEnemy> enemy = orxonox_cast<InvaderEnemy*>(otherObject); 140 WeakPtr<Projectile> shot = orxonox_cast<Projectile*>(otherObject); 140 141 // ensure that this gets only called once per enemy. 141 142 if (enemy != NULL && lastEnemy != enemy) … … 146 147 if (getGame()) 147 148 { 148 getGame()->multiplier = 1; 149 if (getHealth() <= 0) 150 getGame()->costLife(); 149 getGame()->multiplier = 1; 151 150 } 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 } 153 163 } 154 164 return false; … … 165 175 return game; 166 176 } 177 178 void InvaderShip::death() 179 { 180 getGame()->costLife(); 181 SpaceShip::death(); 182 } 167 183 }
Note: See TracChangeset
for help on using the changeset viewer.