- Timestamp:
- Dec 10, 2008, 4:19:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/orxonox/objects/quest/GlobalQuest.cc
r2371 r2385 29 29 /** 30 30 @file GlobalQuest.cc 31 @brief 32 Implementation of the GlobalQuest class. 31 @brief Implementation of the GlobalQuest class. 33 32 */ 34 33 … … 38 37 #include "orxonox/objects/infos/PlayerInfo.h" 39 38 #include "core/CoreIncludes.h" 39 #include "core/Super.h" 40 40 #include "util/Exception.h" 41 41 … … 88 88 bool GlobalQuest::fail(PlayerInfo* player) 89 89 { 90 if( this->isFailable(player)) //!< Check whether the Quest can be failed.91 { 92 this->setStatus(player, questStatus::failed);93 94 //! Iterate through all players possessing this Quest.95 for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)96 {97 QuestEffect::invokeEffects(*it, this->getFailEffectList());98 }99 100 return true;101 }102 103 COUT(4) << "A non-completable quest was trying to be failed." << std::endl; 104 return false;90 if(!this->isFailable(player)) //!< Check whether the Quest can be failed. 91 { 92 COUT(4) << "A non-completable quest was trying to be failed." << std::endl; 93 return false; 94 } 95 96 Quest::fail(player); 97 98 //! Iterate through all players possessing this Quest. 99 for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++) 100 { 101 QuestEffect::invokeEffects(*it, this->getFailEffectList()); 102 } 103 104 return true; 105 105 } 106 106 … … 117 117 bool GlobalQuest::complete(PlayerInfo* player) 118 118 { 119 if( this->isCompletable(player)) //!< Check whether the Quest can be completed.120 { 121 this->setStatus(player, questStatus::completed);122 123 //! Iterate through all players possessing the Quest.124 for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++)125 {126 QuestEffect::invokeEffects(*it, this->getCompleteEffectList());127 }128 129 QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward QuestEffects on the player completing the Quest.130 return true;131 }132 133 COUT(4) << "A non-completable quest was trying to be completed." << std::endl;134 return false;119 if(!this->isCompletable(player)) //!< Check whether the Quest can be completed. 120 { 121 COUT(4) << "A non-completable quest was trying to be completed." << std::endl; 122 return false; 123 } 124 125 //! Iterate through all players possessing the Quest. 126 for(std::set<PlayerInfo*>::const_iterator it = players_.begin(); it != players_.end(); it++) 127 { 128 QuestEffect::invokeEffects(*it, this->getCompleteEffectList()); 129 } 130 131 Quest::complete(player); 132 133 QuestEffect::invokeEffects(player, this->rewards_); //!< Invoke reward QuestEffects on the player completing the Quest. 134 return true; 135 135 } 136 136 … … 207 207 } 208 208 209 return questStatus::inactive;209 return questStatus::inactive; 210 210 } 211 211
Note: See TracChangeset
for help on using the changeset viewer.