Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7037 in orxonox.OLD for trunk


Ignore:
Timestamp:
Feb 6, 2006, 12:05:23 AM (19 years ago)
Author:
patrick
Message:

trunk: game rules definitions added

Location:
trunk/src/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/util/multiplayer_team_deathmatch.cc

    r7035 r7037  
    3535  this->setClassID(CL_MULTIPLAYER_TEAM_DEATHMATCH, "MultiplayerTeamDeathmatch");
    3636
     37  this->bLocalPlayerDead = false;
     38  this->deathTimeout = 10.0f;     // 5 seconds
     39
    3740  if( root != NULL)
    3841    this->loadParams(root);
     
    5053{
    5154  GameRules::loadParams(root);
     55
     56  LoadParam(root, "death-penalty-timeout", this, MultiplayerTeamDeathmatch, setDeathPenaltyTimeout)
     57      .describe("sets the time in seconds a player has to wait for respawn");
     58
     59  LoadParam(root, "max-kills", this, MultiplayerTeamDeathmatch, setMaxKills)
     60      .describe("sets the maximal kills for winning condition");
    5261}
    5362
     
    7483 */
    7584void MultiplayerTeamDeathmatch::tick(float dt)
    76 {}
     85{
     86
     87}
    7788
    7889
  • trunk/src/util/multiplayer_team_deathmatch.h

    r7035 r7037  
    22/*!
    33 * @file multiplayer_team_deathmatch.h
    4  * Defines game rules for this game
     4 * Defines game rules for team deathmatch games
     5 *
     6 * currently there are only two teams supported
    57 */
    68
     
    3335    void draw();
    3436
     37    inline void setDeathPenaltyTimeout(float time) { this->deathTimeout = time; }
     38    inline void setMaxKills(int kills) { this->maxKills = kills; }
    3539
    3640  protected:
    3741    virtual void checkGameRules();
     42
     43  private:
     44    bool               bLocalPlayerDead;           //!< true if the local player is dead
     45    float              deathTimeout;               //!< timeout a player cannot play if he/she dies
     46    int                maxKills;                   //!< max kills for winning condition
     47
     48    int                teamAKills;                 //!< kills of team A
     49    int                teamBKills;                 //!< kills of team B
    3850};
    3951
Note: See TracChangeset for help on using the changeset viewer.