Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/orxonox/gametypes/Dynamicmatch.h @ 11071

Last change on this file since 11071 was 11071, checked in by landauf, 8 years ago

merged branch cpp11_v3 back to trunk

  • Property svn:eol-style set to native
File size: 3.8 KB
RevLine 
[6586]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 *      Johannes Ritz
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _Dynamicmatch_H__
30#define _Dynamicmatch_H__
31
[8727]32#include "OrxonoxPrereqs.h"
33
[6686]34#include <map>
[11052]35#include <set>
[6686]36#include <vector>
[8727]37
[6586]38#include "tools/Timer.h"
39
[8727]40#include "Gametype.h"
41
[6586]42namespace orxonox
43{
44    class _OrxonoxExport Dynamicmatch : public Gametype
45    {
46        public:
[9667]47            Dynamicmatch(Context* context);
[11052]48            virtual ~Dynamicmatch();
[7076]49
[6812]50            bool notEnoughPigs;
51            bool notEnoughKillers;
52            bool notEnoughChasers;
[6921]53
[7076]54            //three different parties
[6921]55            int chaser;
56            int piggy;
57            int killer;
58
[6812]59            virtual void evaluatePlayerParties();
60            int getParty(PlayerInfo* player);
61            void setPlayerColour(PlayerInfo* player);//own function
62            void setConfigValues();//done
[7076]63
[6921]64            bool friendlyfire; //goal: player can switch it on/off
[7149]65            bool tutorial; //goal: new players receive messages how the new gametype works - later it can be switched off.
[7076]66
[11071]67            virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = nullptr) override; //ok - score function and management of parties
68            virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = nullptr) override; //ok - simple
69            virtual void start() override;
70            virtual void end() override; //Wie geht das mit der Punkteausgabe aendern? Z.B: Persoenliche Nachricht?
71            virtual void playerEntered(PlayerInfo* player) override;
72            virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn) override;//is used to initialize the player's party and colour
73            virtual bool playerLeft(PlayerInfo* player) override;
74            virtual bool playerChangedName(PlayerInfo* player) override;//unchanged
[7076]75
[6921]76            /*virtual void instructions();
77            virtual void furtherInstructions();*/
[6812]78            virtual void rewardPig();
[8727]79            void grantPigBoost(SpaceShip* spaceship); // Grant the piggy a boost.
[11052]80            void resetSpeedFactor(SpaceShip* spaceship, Timer* timer);
[11071]81            virtual void tick (float dt) override;// used to end the game
82            virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const override;
[7076]83
[9348]84
[6812]85        protected:
[9676]86            inline unsigned int getPlayerCount() const
[9348]87                 { return this->numberOf[chaser] + numberOf[piggy] + this->numberOf[killer]; }
[6921]88
[6812]89            std::map< PlayerInfo*, int > playerParty_; //player's parties are recorded here
90            std::vector<ColourValue> partyColours_; //aus TeamDeathmatch
[11052]91            std::set<Timer*> piggyTimers_;
[6812]92            unsigned int numberOf[3]; //array to count number of chasers, pigs, killers
93            float pointsPerTime;
[6848]94            float gameTime_;   // from UnderAttack
[6812]95            bool gameEnded_; // true if game is over
96            int timesequence_; //used for countdown
[6921]97            //Timer callInstructions_;
[6586]98    };
99}
100
101#endif /* _Dynamicmatch_H__ */
Note: See TracBrowser for help on using the repository browser.