- Timestamp:
- Dec 15, 2014, 3:58:14 PM (10 years ago)
- Location:
- code/branches/presentationHS14
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationHS14
- Property svn:mergeinfo changed
/code/branches/towerdefenseHS14 (added) merged: 10086,10091,10105-10106,10109,10123,10125-10126,10132,10134,10140-10142,10144,10146-10147,10151,10158-10159,10172
- Property svn:mergeinfo changed
-
code/branches/presentationHS14/src/modules/towerdefense/TowerDefenseEnemy.cc
r10180 r10181 30 30 //needed to keep track of the PlayerStats coded in TowerDefense.h 31 31 this->td = orxonox_cast<TowerDefense*>(this->getGametype().get()); 32 once_=false; 32 33 33 34 } 34 35 //add credit if enemy is destroyed 35 36 TowerDefenseEnemy::~TowerDefenseEnemy(){ 36 this->td->addCredit(1);37 //this->td->addCredit(1); 37 38 } 38 39 … … 48 49 } 49 50 51 WeakPtr<TowerDefense> TowerDefenseEnemy::getGame() 52 { 53 if (game == NULL) 54 { 55 for (ObjectList<TowerDefense>::iterator it = ObjectList<TowerDefense>::begin(); it != ObjectList<TowerDefense>::end(); ++it) 56 game = *it; 57 } 58 return game; 59 } 60 61 void TowerDefenseEnemy::damage(float damage, float healthdamage, float shielddamage, Pawn* originator) 62 { 63 Pawn::damage(damage, healthdamage, shielddamage, originator); 64 if (getGame() && once_ == false && getHealth() <= 0) 65 { 66 getGame()->addCredit(1); 67 once_ = true; 68 } 69 } 50 70 /* 51 71 void TowerDefenseEnemy::popWaypoint()
Note: See TracChangeset
for help on using the changeset viewer.