[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] | 42 | namespace orxonox |
---|
| 43 | { |
---|
[11099] | 44 | /** |
---|
| 45 | @brief |
---|
| 46 | Short Gaming Manual: |
---|
| 47 | There are three different parties a player can belong to: victim, chaser or killer |
---|
| 48 | Every player starts as chaser. As long as there are not enough victims and killers, you can change your and other player's parties by shooting them. |
---|
| 49 | In order to win you have to earn as much points as possible: |
---|
| 50 | - as victim by escaping the chasers |
---|
| 51 | - as chaser by shooting the victim |
---|
| 52 | - as killer by killing the chasers |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | What you shouldn't do is shooting at players of your own party. By doing so your score will decrease. |
---|
| 56 | P.S: If you don't want to be a victim: Get rid of your part by shooting a chaser. |
---|
| 57 | |
---|
| 58 | @todo: |
---|
| 59 | pig punkte vergeben pro Zeit! |
---|
| 60 | killerfarbe schwarz; evtl. eigenes Raumfahrzeug; |
---|
| 61 | Low; Codeoptimierung und Dokumentation |
---|
| 62 | */ |
---|
[6586] | 63 | class _OrxonoxExport Dynamicmatch : public Gametype |
---|
| 64 | { |
---|
| 65 | public: |
---|
[9667] | 66 | Dynamicmatch(Context* context); |
---|
[11052] | 67 | virtual ~Dynamicmatch(); |
---|
[7076] | 68 | |
---|
[6812] | 69 | bool notEnoughPigs; |
---|
| 70 | bool notEnoughKillers; |
---|
| 71 | bool notEnoughChasers; |
---|
[6921] | 72 | |
---|
[7076] | 73 | //three different parties |
---|
[6921] | 74 | int chaser; |
---|
| 75 | int piggy; |
---|
| 76 | int killer; |
---|
| 77 | |
---|
[6812] | 78 | virtual void evaluatePlayerParties(); |
---|
| 79 | int getParty(PlayerInfo* player); |
---|
| 80 | void setPlayerColour(PlayerInfo* player);//own function |
---|
| 81 | void setConfigValues();//done |
---|
[7076] | 82 | |
---|
[6921] | 83 | bool friendlyfire; //goal: player can switch it on/off |
---|
[7149] | 84 | bool tutorial; //goal: new players receive messages how the new gametype works - later it can be switched off. |
---|
[7076] | 85 | |
---|
[11071] | 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 |
---|
[7076] | 94 | |
---|
[6921] | 95 | /*virtual void instructions(); |
---|
| 96 | virtual void furtherInstructions();*/ |
---|
[6812] | 97 | virtual void rewardPig(); |
---|
[8727] | 98 | void grantPigBoost(SpaceShip* spaceship); // Grant the piggy a boost. |
---|
[11052] | 99 | void resetSpeedFactor(SpaceShip* spaceship, Timer* timer); |
---|
[11071] | 100 | virtual void tick (float dt) override;// used to end the game |
---|
| 101 | virtual SpawnPoint* getBestSpawnPoint(PlayerInfo* player) const override; |
---|
[7076] | 102 | |
---|
[9348] | 103 | |
---|
[6812] | 104 | protected: |
---|
[9676] | 105 | inline unsigned int getPlayerCount() const |
---|
[9348] | 106 | { return this->numberOf[chaser] + numberOf[piggy] + this->numberOf[killer]; } |
---|
[6921] | 107 | |
---|
[6812] | 108 | std::map< PlayerInfo*, int > playerParty_; //player's parties are recorded here |
---|
| 109 | std::vector<ColourValue> partyColours_; //aus TeamDeathmatch |
---|
[11052] | 110 | std::set<Timer*> piggyTimers_; |
---|
[6812] | 111 | unsigned int numberOf[3]; //array to count number of chasers, pigs, killers |
---|
| 112 | float pointsPerTime; |
---|
[6848] | 113 | float gameTime_; // from UnderAttack |
---|
[6812] | 114 | bool gameEnded_; // true if game is over |
---|
| 115 | int timesequence_; //used for countdown |
---|
[6921] | 116 | //Timer callInstructions_; |
---|
[6586] | 117 | }; |
---|
| 118 | } |
---|
| 119 | |
---|
| 120 | #endif /* _Dynamicmatch_H__ */ |
---|