Changeset 5826 for code/branches
- Timestamp:
- Sep 28, 2009, 9:05:56 PM (15 years ago)
- Location:
- code/branches/core5/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/modules/overlays/hud/HUDHealthBar.cc
r5800 r5826 85 85 this->textoverlay_->setCaption(multi_cast<std::string>(static_cast<int>(this->owner_->getHealth()))); 86 86 } 87 else 88 { 89 this->setValue(0); 90 this->textoverlay_->setCaption("0"); 91 } 87 92 88 93 if (this->bUseBarColour_) -
code/branches/core5/src/modules/overlays/hud/HUDHealthBar.h
r5738 r5826 111 111 112 112 private: 113 Pawn*owner_;113 WeakPtr<Pawn> owner_; 114 114 OverlayText* textoverlay_; 115 115 bool bUseBarColour_; -
code/branches/core5/src/orxonox/gametypes/UnderAttack.cc
r5806 r5826 46 46 this->teams_ = 2; 47 47 this->destroyer_ = 0; 48 this->destroyer_.addCallback(createFunctor(&UnderAttack::killedDestroyer)->setObject(this)); 48 49 this->gameEnded_ = false; 49 50 … … 65 66 66 67 67 void UnderAttack:: destroyedPawn(Pawn* pawn)68 void UnderAttack::killedDestroyer() 68 69 { 69 if (pawn == this->destroyer_) 70 this->end(); //end gametype 71 std::string message = "Ship destroyed! Team 0 has won!"; 72 COUT(0) << message << std::endl; 73 Host::Broadcast(message); 74 this->gameEnded_ = true; 75 76 for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it) 70 77 { 71 this->end(); //end gametype 72 std::string message = "Ship destroyed! Team 0 has won!"; 73 COUT(0) << message << std::endl; 74 Host::Broadcast(message); 75 this->gameEnded_ = true; 78 if (it->first->getClientID() == CLIENTID_UNKNOWN) 79 continue; 76 80 77 for (std::map<PlayerInfo*, int>::iterator it = this->teamnumbers_.begin(); it != this->teamnumbers_.end(); ++it) 78 { 79 if (it->first->getClientID() == CLIENTID_UNKNOWN) 80 continue; 81 82 if (it->second == 0) 83 this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID()); 84 else 85 this->gtinfo_->sendAnnounceMessage("You have lost the match!", it->first->getClientID()); 86 } 81 if (it->second == 0) 82 this->gtinfo_->sendAnnounceMessage("You have won the match!", it->first->getClientID()); 83 else 84 this->gtinfo_->sendAnnounceMessage("You have lost the match!", it->first->getClientID()); 87 85 } 88 86 } -
code/branches/core5/src/orxonox/gametypes/UnderAttack.h
r5738 r5826 32 32 #include "OrxonoxPrereqs.h" 33 33 34 #include "interfaces/PawnListener.h"35 34 #include "TeamDeathmatch.h" 36 35 37 36 namespace orxonox 38 37 { 39 class _OrxonoxExport UnderAttack : public TeamDeathmatch , public PawnListener38 class _OrxonoxExport UnderAttack : public TeamDeathmatch 40 39 { 41 40 public: … … 54 53 55 54 protected: 56 virtual void destroyedPawn(Pawn* pawn);55 virtual void killedDestroyer(); 57 56 58 Destroyer*destroyer_;57 WeakPtr<Destroyer> destroyer_; 59 58 unsigned int teams_; 60 59 float gameTime_;
Note: See TracChangeset
for help on using the changeset viewer.