Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 4, 2015, 10:21:28 PM (10 years ago)
Author:
landauf
Message:

merged storymodeHS14

Location:
code/branches/presentationHS14merge
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationHS14merge

  • code/branches/presentationHS14merge/src/orxonox/LevelManager.cc

    r9667 r10255  
    8989        SetConfigValue(defaultLevelName_, "missionOne.oxw")
    9090            .description("Sets the pre selection of the level in the main menu.");
     91        SetConfigValue(lastFinishedCampaignMission_,  "")
     92            .description("The last finished mission of a campaign");
     93        SetConfigValue(campaignMissions_,  std::vector<std::string>())
     94            .description("The list of missions in the campaign");
     95    }
     96
     97    /**
     98     * @brief Stores the argument in the corresponding config value.
     99     */
     100    void LevelManager::setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission)
     101    {
     102        ModifyConfigValue(lastFinishedCampaignMission_, set, lastFinishedCampaignMission);
    91103    }
    92104
  • code/branches/presentationHS14merge/src/orxonox/LevelManager.h

    r9667 r10255  
    9191            LevelInfoItem* getAvailableLevelListItem(unsigned int index); //!< Get the LevelInfoItem at the given index in the list of available Levels.
    9292
     93            void setLastFinishedCampaignMission(const std::string& lastFinishedCampaignMission);
     94            inline const std::string& getLastFinishedCampaignMission() const
     95                { return this->lastFinishedCampaignMission_; }
     96
     97            inline unsigned int getNumberOfCampaignMissions()
     98                { return this->campaignMissions_.size(); }
     99            inline const std::string& getCampaignMission(unsigned int index)
     100                { return this->campaignMissions_[index]; }
     101
    93102            /**
    94103            @brief Get the instance of the LevelManager.
     
    116125            // config values
    117126            std::string defaultLevelName_;
     127            std::string lastFinishedCampaignMission_;
     128            std::vector<std::string> campaignMissions_;
    118129
    119130            static LevelManager* singletonPtr_s;
  • code/branches/presentationHS14merge/src/orxonox/gametypes/Mission.cc

    r9986 r10255  
    2828
    2929#include "Mission.h"
     30
    3031#include "items/Engine.h"
    3132#include "controllers/ArtificialController.h"
     
    3637#include "network/Host.h"
    3738#include "worldentities/pawns/Pawn.h"
    38 
     39#include "LevelManager.h"
    3940
    4041namespace orxonox
     
    7071    void Mission::pawnKilled(Pawn* victim, Pawn* killer)
    7172    {
    72         if (victim && victim->getPlayer() && victim->getPlayer()->isHumanPlayer() )
     73        if (victim && victim->getPlayer() && victim->getPlayer()->isHumanPlayer())
    7374        {
    7475            this->lives_--;
     
    8788    {
    8889        if (this->missionAccomplished_ && !this->gtinfo_->hasEnded())
     90        {
    8991            this->gtinfo_->sendAnnounceMessage("Mission accomplished!");
     92
     93            LevelManager::getInstance().setLastFinishedCampaignMission(this->getFilename());
     94        }
    9095        else if (!this->gtinfo_->hasEnded())
    9196            this->gtinfo_->sendAnnounceMessage("Mission failed!");
     97
    9298        Gametype::end();
    9399    }
    94100
    95101    void Mission::setTeams()
    96     {//Set pawn-colours
     102    { //Set pawn-colours
    97103        for (ObjectList<Pawn>::iterator it = ObjectList<Pawn>::begin(); it != ObjectList<Pawn>::end(); ++it)
    98104        {
    99105            Pawn* pawn = static_cast<Pawn*>(*it);
    100             if(!pawn) continue;
    101                 this->setDefaultObjectColour(pawn);
     106            if (!pawn)
     107                continue;
     108            this->setDefaultObjectColour(pawn);
    102109        }
    103110    }
     
    105112    {
    106113        for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it)
    107         {//TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!
     114        { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!
    108115            it->setMissionAccomplished(accomplished);
    109116            it->end();
    110117        }
    111118    }
    112    
     119
    113120    void Mission::setLivesWrapper(unsigned int amount)
    114121    {
    115122        for (ObjectList<Mission>::iterator it = ObjectList<Mission>::begin(); it != ObjectList<Mission>::end(); ++it)
    116         {//TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions!
     123        { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions!
    117124            it->setLives(amount);
    118125        }
    119126    }
    120 
    121 
    122127}
Note: See TracChangeset for help on using the changeset viewer.