Orxonox  0.0.5 Codename: Arcturus
Dynamicmatch.h
Go to the documentation of this file.
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 
32 #include "OrxonoxPrereqs.h"
33 
34 #include <map>
35 #include <set>
36 #include <vector>
37 
38 #include "tools/Timer.h"
39 
40 #include "Gametype.h"
41 
42 namespace orxonox
43 {
64  {
65  public:
66  Dynamicmatch(Context* context);
67  virtual ~Dynamicmatch();
68 
72 
73  //three different parties
74  int chaser;
75  int piggy;
76  int killer;
77 
78  virtual void evaluatePlayerParties();
79  int getParty(PlayerInfo* player);
80  void setPlayerColour(PlayerInfo* player);//own function
81  void setConfigValues();//done
82 
83  bool friendlyfire; //goal: player can switch it on/off
84  bool tutorial; //goal: new players receive messages how the new gametype works - later it can be switched off.
85 
86  virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = nullptr) override; //ok - score function and management of parties
87  virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = nullptr) override; //ok - simple
88  virtual void start() override;
89  virtual void end() override; //Wie geht das mit der Punkteausgabe aendern? Z.B: Persoenliche Nachricht?
90  virtual void playerEntered(PlayerInfo* player) override;
91  virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn) override;//is used to initialize the player's party and colour
92  virtual bool playerLeft(PlayerInfo* player) override;
93  virtual bool playerChangedName(PlayerInfo* player) override;//unchanged
94 
95  /*virtual void instructions();
96  virtual void furtherInstructions();*/
97  virtual void rewardPig();
98  void grantPigBoost(SpaceShip* spaceship); // Grant the piggy a boost.
99  void resetSpeedFactor(SpaceShip* spaceship, Timer* timer);
100  virtual void tick (float dt) override;// used to end the game
101  virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const override;
102 
103 
104  protected:
105  inline unsigned int getPlayerCount() const
106  { return this->numberOf[chaser] + numberOf[piggy] + this->numberOf[killer]; }
107 
108  std::map< PlayerInfo*, int > playerParty_; //player's parties are recorded here
109  std::vector<ColourValue> partyColours_; //aus TeamDeathmatch
110  std::set<Timer*> piggyTimers_;
111  unsigned int numberOf[3]; //array to count number of chasers, pigs, killers
113  float gameTime_; // from UnderAttack
114  bool gameEnded_; // true if game is over
115  int timesequence_; //used for countdown
116  //Timer callInstructions_;
117  };
118 }
119 
120 #endif /* _Dynamicmatch_H__ */
Everything in Orxonox that has a health attribute is a Pawn.
Definition: Pawn.h:56
bool tutorial
Definition: Dynamicmatch.h:84
Definition: SpawnPoint.h:40
std::vector< ColourValue > partyColours_
Definition: Dynamicmatch.h:109
bool notEnoughKillers
Definition: Dynamicmatch.h:70
Short Gaming Manual: There are three different parties a player can belong to: victim, chaser or killer Every player starts as chaser.
Definition: Dynamicmatch.h:63
float pointsPerTime
Definition: Dynamicmatch.h:112
int piggy
Definition: Dynamicmatch.h:75
The SpaceShip is the principal entity through which the player interacts with the game...
Definition: SpaceShip.h:90
Declaration of the Timer class, used to call functions after a given time-interval.
std::map< PlayerInfo *, int > playerParty_
Definition: Dynamicmatch.h:108
int chaser
Definition: Dynamicmatch.h:74
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
float gameTime_
Definition: Dynamicmatch.h:113
Definition: Gametype.h:63
Shared library macros, enums, constants and forward declarations for the orxonox library ...
Definition: Context.h:45
#define _OrxonoxExport
Definition: OrxonoxPrereqs.h:60
bool notEnoughPigs
Definition: Dynamicmatch.h:69
bool friendlyfire
Definition: Dynamicmatch.h:83
bool gameEnded_
Definition: Dynamicmatch.h:114
std::set< Timer * > piggyTimers_
Definition: Dynamicmatch.h:110
Definition: PlayerInfo.h:39
Timer is a helper class that executes a function after a given amount of seconds in game-time...
Definition: Timer.h:105
int killer
Definition: Dynamicmatch.h:76
unsigned int getPlayerCount() const
Definition: Dynamicmatch.h:105
bool notEnoughChasers
Definition: Dynamicmatch.h:71
int timesequence_
Definition: Dynamicmatch.h:115