Changeset 1996 for code/branches/questsystem/src/orxonox/objects/Quest.cc
- Timestamp:
- Oct 22, 2008, 4:03:10 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem/src/orxonox/objects/Quest.cc
r1992 r1996 71 71 /** 72 72 @brief 73 Sets the parent quest of the quest. 74 @param quest 75 A pointer to the quest to be set as parent quest. 76 */ 77 bool setParentQuest(Quest* quest) 78 { 79 this->parentQuest_ = quest; 80 return true; 81 } 82 83 /** 84 @brief 85 Adds a sub quest to the quest. 86 @param quest 87 A pointer to the quest to be set as sub quest. 88 */ 89 bool addSubQuest(Quest & quest) 90 { 91 this->subQuests_.push_back = quest; 92 return true; 93 } 94 95 /** 96 @brief 73 97 Adds a Hint to the list of hints 74 98 @param hint … … 93 117 @param player 94 118 The player. 119 @return 120 Returns true if the quest could be started, false if not. 95 121 */ 96 voidQuest::start(const Player & player)122 bool Quest::start(const Player & player) 97 123 { 98 if(this->is Inactive(player))124 if(this->isStartable(player)) 99 125 { 100 126 this->setStatus(player, questStatus::active); 127 return true; 101 128 } 102 else 103 { 104 COUT(2) << "A non-inactive quest was trying to be started." << std::endl; 105 } 129 COUT(2) << "A non-startable quest was trying to be started." << std::endl; 130 return false; 106 131 } 107 132 … … 111 136 @param player 112 137 The player. 138 @return 139 Returns true if the quest could be failed, false if not. 113 140 */ 114 141 void Quest::fail(Player & player) 115 142 { 116 if(this->is Active(player))143 if(this->isFailable(player)) 117 144 { 118 145 this->setStatus(player, questStatus::failed); 119 146 QuestEffect::invokeEffects(player, this->failEffects_); 147 return true; 120 148 } 121 else 122 { 123 COUT(2) << "A non-pending quest was trying to be failed." << std::endl; 124 } 149 COUT(2) << "A non-failable quest was trying to be failed." << std::endl; 150 return false; 125 151 } 126 152 … … 130 156 @param player 131 157 The player. 158 @return 159 Returns true if the quest could be completed, false if not. 132 160 */ 133 161 void Quest::complete(Player & player) 134 162 { 135 if(this->is Active(player))163 if(this->isCompletable(player)) 136 164 { 137 165 this->setStatus(player, questStatus::completed); 138 166 QuestEffect::invokeEffects(player, this->completeEffects_); 167 return true; 139 168 } 140 else 141 { 142 COUT(2) << "A non-pending quest was trying to be completed." << std::endl; 143 } 169 COUT(2) << "A non-completable quest was trying to be completed." << std::endl; 170 return false; 144 171 } 145 172
Note: See TracChangeset
for help on using the changeset viewer.