[7034] | 1 | /* |
---|
| 2 | orxonox - the future of 3D-vertical-scrollers |
---|
| 3 | |
---|
| 4 | Copyright (C) 2004 orx |
---|
| 5 | |
---|
| 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
| 10 | |
---|
| 11 | ### File Specific: |
---|
| 12 | main-programmer: Patrick Boenzli |
---|
| 13 | */ |
---|
| 14 | |
---|
| 15 | #define DEBUG_MODULE_GAME_RULES |
---|
| 16 | |
---|
| 17 | #include "multiplayer_team_deathmatch.h" |
---|
| 18 | |
---|
| 19 | #include "load_param.h" |
---|
[7035] | 20 | #include "factory.h" |
---|
[7034] | 21 | |
---|
| 22 | |
---|
| 23 | using namespace std; |
---|
| 24 | |
---|
| 25 | |
---|
[7035] | 26 | CREATE_FACTORY(MultiplayerTeamDeathmatch, CL_MULTIPLAYER_TEAM_DEATHMATCH); |
---|
| 27 | |
---|
| 28 | |
---|
[7034] | 29 | /** |
---|
| 30 | * constructor |
---|
| 31 | */ |
---|
[7035] | 32 | MultiplayerTeamDeathmatch::MultiplayerTeamDeathmatch(const TiXmlElement* root) |
---|
[7034] | 33 | : GameRules(root) |
---|
[7035] | 34 | { |
---|
| 35 | this->setClassID(CL_MULTIPLAYER_TEAM_DEATHMATCH, "MultiplayerTeamDeathmatch"); |
---|
[7034] | 36 | |
---|
[7037] | 37 | this->bLocalPlayerDead = false; |
---|
| 38 | this->deathTimeout = 10.0f; // 5 seconds |
---|
| 39 | |
---|
[7035] | 40 | if( root != NULL) |
---|
| 41 | this->loadParams(root); |
---|
| 42 | } |
---|
| 43 | |
---|
[7034] | 44 | /** |
---|
| 45 | * decontsructor |
---|
| 46 | */ |
---|
| 47 | MultiplayerTeamDeathmatch::~MultiplayerTeamDeathmatch() |
---|
| 48 | {} |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | void MultiplayerTeamDeathmatch::loadParams(const TiXmlElement* root) |
---|
[7035] | 53 | { |
---|
| 54 | GameRules::loadParams(root); |
---|
[7037] | 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"); |
---|
[7035] | 61 | } |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | /** |
---|
| 65 | * called when the player enters the game |
---|
| 66 | * @param player the spawned player |
---|
| 67 | */ |
---|
| 68 | void MultiplayerTeamDeathmatch::onPlayerSpawn(Player* player) |
---|
[7034] | 69 | {} |
---|
| 70 | |
---|
[7035] | 71 | |
---|
| 72 | /** |
---|
| 73 | * when the player is killed |
---|
| 74 | * @param player the killed player |
---|
| 75 | */ |
---|
| 76 | void MultiplayerTeamDeathmatch::onPlayerDeath(Player* player) |
---|
| 77 | {} |
---|
| 78 | |
---|
| 79 | |
---|
| 80 | /** |
---|
| 81 | * time tick |
---|
| 82 | * @param dt time |
---|
| 83 | */ |
---|
| 84 | void MultiplayerTeamDeathmatch::tick(float dt) |
---|
[7037] | 85 | { |
---|
[7035] | 86 | |
---|
[7037] | 87 | } |
---|
[7035] | 88 | |
---|
[7037] | 89 | |
---|
[7035] | 90 | /** |
---|
| 91 | * draws the stuff |
---|
| 92 | */ |
---|
| 93 | void MultiplayerTeamDeathmatch::draw() |
---|
| 94 | {} |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | /** |
---|
| 98 | * check the game rules for consistency |
---|
| 99 | */ |
---|
| 100 | void MultiplayerTeamDeathmatch::checkGameRules() |
---|
| 101 | {} |
---|
| 102 | |
---|
| 103 | |
---|
| 104 | |
---|
| 105 | |
---|
| 106 | |
---|
| 107 | |
---|