ddnet/src/game/server/gamemodes/tdm.cpp

31 lines
765 B
C++
Raw Normal View History

2007-11-25 19:42:40 +00:00
/* copyright (c) 2007 magnus auvinen, see licence.txt for more info */
#include <engine/e_server_interface.h>
#include <game/server/entities/character.hpp>
#include <game/server/player.hpp>
#include "tdm.hpp"
GAMECONTROLLER_TDM::GAMECONTROLLER_TDM()
{
gametype = "TDM";
2008-08-31 14:37:35 +00:00
game_flags = GAMEFLAG_TEAMS;
}
int GAMECONTROLLER_TDM::on_character_death(class CHARACTER *victim, class PLAYER *killer, int weapon)
2007-11-26 19:18:49 +00:00
{
GAMECONTROLLER::on_character_death(victim, killer, weapon);
2007-11-26 19:18:49 +00:00
// do team scoring
if(killer == victim->player || killer->team == victim->player->team)
teamscore[killer->team&1]--; // klant arschel
else
teamscore[killer->team&1]++; // good shit
2007-11-26 19:18:49 +00:00
return 0;
}
void GAMECONTROLLER_TDM::tick()
{
2008-01-17 23:09:49 +00:00
do_team_score_wincheck();
GAMECONTROLLER::tick();
}