Changeset 10256
- Timestamp:
- Feb 5, 2015, 11:21:35 PM (10 years ago)
- Location:
- code/branches/presentationHS14merge/src/modules
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentationHS14merge/src/modules/mini4dgame/Mini4DgamePrereqs.h
r10227 r10256 30 30 @file 31 31 @brief 32 Shared library macros, enums, constants and forward declarations for the pongmodule32 Shared library macros, enums, constants and forward declarations for the mini4dgame module 33 33 */ 34 34 … … 72 72 } 73 73 74 #endif /* _ PongPrereqs_H__ */74 #endif /* _Mini4DgamePrereqs_H__ */ -
code/branches/presentationHS14merge/src/modules/towerdefense/TowerDefenseEnemy.cc
r10248 r10256 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() -
code/branches/presentationHS14merge/src/modules/towerdefense/TowerDefenseEnemy.h
r10248 r10256 43 43 TDCoordinate peekWaypoint(); 44 44 45 virtual void damage(float damage, float healthdamage, float shielddamage, Pawn* originator); 46 45 47 46 48 private: 49 WeakPtr<TowerDefense> getGame(); 50 WeakPtr<TowerDefense> game; 47 51 TowerDefense* td; 48 52 bool once_;
Note: See TracChangeset
for help on using the changeset viewer.