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