Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 10, 2008, 4:19:44 PM (15 years ago)
Author:
dafrick
Message:

Merged questsystem3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/orxonox/objects/quest/LocalQuest.cc

    r2371 r2385  
    2929/**
    3030    @file LocalQuest.cc
    31     @brief
    32     Implementation of the LocalQuest class.
     31    @brief Implementation of the LocalQuest class.
    3332*/
    3433
     
    3736
    3837#include "core/CoreIncludes.h"
     38#include "core/Super.h"
    3939#include "util/Exception.h"
    4040
     
    8686    bool LocalQuest::fail(PlayerInfo* player)
    8787    {
    88         if(this->isFailable(player)) //!< Checks whether the quest can be failed.
    89         {
    90             this->setStatus(player, questStatus::failed);
    91             QuestEffect::invokeEffects(player, this->getFailEffectList()); //!< Invoke the failEffects.
    92             return true;
    93         }
    94        
    95         COUT(4) << "A non-failable quest was trying to be failed." << std::endl;
    96         return false;
     88        if(!this->isFailable(player)) //!< Checks whether the quest can be failed.
     89        {
     90            COUT(4) << "A non-failable quest was trying to be failed." << std::endl;
     91            return false;
     92        }
     93       
     94        Quest::fail(player);
     95       
     96        QuestEffect::invokeEffects(player, this->getFailEffectList()); //!< Invoke the failEffects.
     97        return true;
    9798    }
    9899
     
    108109    bool LocalQuest::complete(PlayerInfo* player)
    109110    {
    110         if(this->isCompletable(player)) //!< Checks whether the Quest can be completed.
    111         {
    112             this->setStatus(player, questStatus::completed);
    113             QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete QuestEffects.
    114             return true;
    115         }
    116        
    117         COUT(4) << "A non-completable quest was trying to be completed." << std::endl;
    118         return false;
     111        if(!this->isCompletable(player)) //!< Checks whether the Quest can be completed.
     112        {
     113            COUT(4) << "A non-completable quest was trying to be completed." << std::endl;
     114            return false;
     115        }
     116       
     117        Quest::complete(player);
     118       
     119        QuestEffect::invokeEffects(player, this->getCompleteEffectList()); //!< Invoke the complete QuestEffects.
     120        return true;
    119121    }
    120122
Note: See TracChangeset for help on using the changeset viewer.