- Timestamp:
- Feb 14, 2011, 8:29:14 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/lastmanstanding2/src/orxonox/gametypes/LastTeamStanding.h
r7699 r7890 54 54 int lives; //!< Standard amount of lives. Each player starts a game with so many lives. 55 55 std::map< PlayerInfo*, int > playerLives_; //!< Each player's lives are stored here. 56 std::vector<int> eachTeamsPlayers; //!<Number of players in each team. 56 57 int teamsAlive; //!< Counter counting teams with more than one player remaining. 58 //Data for CamperPunishment 57 59 float timeRemaining; //!< Each player has a certain time where he or she has to hit an opponent or will be punished. 58 60 std::map<PlayerInfo*, float> timeToAct_; //!< Each player's time till she/he will be punished is stored here. 61 bool bNoPunishment; //!< Config value to switch off Punishment function if it is set to true. 62 bool bHardPunishment; //!< Switches between damage and death as punishment. 63 float punishDamageRate; //!< Makes Damage adjustable. 64 //Data for RespawnDelay 59 65 float respawnDelay; //!<Time in seconds when a player will respawn after death. 60 66 std::map<PlayerInfo*, float> playerDelayTime_; //!< Stores each Player's delay time. 61 67 std::map<PlayerInfo*, bool> inGame_; //!< Indicates each Player's state. 62 bool bNoPunishment; //!< Config value to switch off Punishment function if it is set to true. 63 bool b HardPunishment; //!< Switches between damage and death as punishment.64 float punishDamageRate; //!< Makes Damage adjustable. 68 69 bool bMinTeamsReached; //!< Lock. Game shouldn't end right at the beginning. 70 65 71 virtual void spawnDeadPlayersIfRequested(); //!< Prevents dead players to respawn. 66 72 virtual int getMinLives(); //!< Returns minimum of each player's lives; players with 0 lives are skipped; 67 int * eachTeamsPlayers; //!<Each teams player's alive.68 bool bMinPlayersReached;69 73 70 74 public: 71 75 LastTeamStanding(BaseObject* creator); //!< Default Constructor. 72 76 virtual ~LastTeamStanding(); //!< Default Destructor. 77 78 virtual void playerEntered(PlayerInfo* player); //!< Initializes values. 79 virtual bool playerLeft(PlayerInfo* player); //!< Manages all local variables. 80 81 virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0); //!< Manages each player's lost lives. 82 virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0); //!< If a player shoot's an opponent, his punishment countdown will be resetted. 83 virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn); //!< Resets punishment time and respawn delay. 84 void tick (float dt); //!< used to end the game 85 virtual void end(); //!< Sends an end message. 86 void punishPlayer(PlayerInfo* player); //!< Function in order to kill a player. Punishment for hiding longer than "timeRemaining". 87 int playerGetLives(PlayerInfo* player); //!< getFunction for the map "playerLives_". 88 inline int getNumTeamsAlive() const//!< Returns the number of players that are still alive. 89 {return this->teamsAlive;} 73 90 void setConfigValues(); //!< Makes values configurable. 74 91 75 virtual bool allowPawnDamage(Pawn* victim, Pawn* originator = 0); //!< If a player shoot's an opponent, his punishment countdown will be resetted.76 virtual bool allowPawnDeath(Pawn* victim, Pawn* originator = 0); //!< Manages each players lives.77 78 virtual void end(); //!< Sends an end message.79 int playerGetLives(PlayerInfo* player); //!< getFunction for the map "playerLives_".80 int getNumTeamsAlive() const; //!< Returns the number of players that are still alive.81 virtual void playerEntered(PlayerInfo* player); //!< Initializes values.82 virtual bool playerLeft(PlayerInfo* player); //!< Manages all local variables.83 virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn); //!< Resets punishment time and respawn delay.84 85 void punishPlayer(PlayerInfo* player); //!< Function in order to kill a player. Punishment for hiding longer than "timeRemaining".86 void tick (float dt); //!< used to end the game87 92 }; 88 93 }
Note: See TracChangeset
for help on using the changeset viewer.