Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/StoryModeMap_HS16/src/orxonox/gametypes/StoryMode.cc @ 11242

Last change on this file since 11242 was 11242, checked in by marvinh, 8 years ago

new gametype StoryMode created, new level created

File size: 2.9 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Marvin Haeberle & Julian Huwyler
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#include "StoryMode.h"
30
31#include "items/Engine.h"
32#include "controllers/ArtificialController.h"
33
34#include "core/CoreIncludes.h"
35#include "core/command/ConsoleCommandIncludes.h"
36#include "infos/PlayerInfo.h"
37#include "network/Host.h"
38#include "worldentities/pawns/Pawn.h"
39#include "LevelManager.h"
40
41namespace orxonox
42{
43
44    RegisterUnloadableClass(StoryMode);
45   
46    StoryMode::StoryMode(Context* context) : Gametype(context)
47    {
48        RegisterObject(StoryMode);
49
50        this->gtinfo_ = new GametypeInfo(context);
51        this->bAutoStart_ = true;
52        this->bForceSpawn_ = true;
53    }
54
55   
56   
57    /*void StoryMode::start()
58    {
59        Gametype::start();
60
61        this->gtinfo_->sendAnnounceMessage("Marvin isch Chef");
62    }
63
64   void StoryMode::end()
65    {
66        if (this->missionAccomplished_ && !this->gtinfo_->hasEnded())
67        {
68            this->gtinfo_->sendAnnounceMessage("StoryMode accomplished!");
69
70            LevelManager::getInstance().setLastFinishedCampaignMission(this->getFilename());
71        }
72        else if (!this->gtinfo_->hasEnded())
73            this->gtinfo_->sendAnnounceMessage("StoryMode failed!");
74
75        Gametype::end();
76    }
77
78    void Mission::setTeams()
79    { //Set pawn-colours
80        for (Pawn* pawn : ObjectList<Pawn>())
81        {
82            if (!pawn)
83                continue;
84            this->setDefaultObjectColour(pawn);
85        }
86    }
87    void Mission::endMission(bool accomplished)
88    {
89        for (Mission* mission : ObjectList<Mission>())
90        { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would end ALL missions!
91            mission->setMissionAccomplished(accomplished);
92            mission->end();
93        }
94    }
95
96    void Mission::setLivesWrapper(unsigned int amount)
97    {
98        for (Mission* mission : ObjectList<Mission>())
99        { //TODO: make sure that only the desired mission is ended !! This is a dirty HACK, that would affect ALL missions!
100            mission->setLives(amount);
101        }
102    }*/
103}
Note: See TracBrowser for help on using the repository browser.