WriteEntity(MSG_ONE, self);
}
- if(g_lms)
- {
- // Only if the player cannot play at all
- if(PlayerScore_Add(self, SP_LMS_RANK, 0) == 666)
- self.frags = FRAGS_SPECTATOR;
- else
- self.frags = FRAGS_LMS_LOSER;
- }
- else if((g_race && g_race_qualifying) || g_cts)
+ if((g_race && g_race_qualifying) || g_cts)
{
if(PlayerScore_Add(self, SP_RACE_FASTEST, 0))
self.frags = FRAGS_LMS_LOSER;
// reset player keys
self.itemkeys = 0;
- // player is dead and becomes observer
- // FIXME fix LMS scoring for new system
- if(g_lms)
- {
- if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0)
- self.classname = "observer";
- }
-
MUTATOR_CALLHOOK(PutClientInServer);
if(gameover)
self.colormod = '1 1 1' * autocvar_g_player_brightness;
self.exteriorweaponentity.alpha = default_weapon_alpha;
- self.lms_nextcheck = time + autocvar_g_lms_campcheck_interval*2;
- self.lms_traveled_distance = 0;
self.speedrunning = FALSE;
race_PostSpawn(spot);
else
self.respawn_countdown = -1; // do not count down
- if(g_lms || g_cts || autocvar_g_forced_respawn)
+ if(g_cts || autocvar_g_forced_respawn)
self.respawn_flags = self.respawn_flags | RESPAWN_FORCE;
self.death_time = time;
race_ReadyRestart();
else MUTATOR_CALLHOOK(reset_map_global);
- lms_lowest_lives = 999;
- lms_next_place = player_count;
-
for(self = world; (self = nextent(self)); )
if(clienttype(self) == CLIENTTYPE_NOTACLIENT)
{
//NEW: changed behaviour so that it prevents that previous spectators/observers suddenly spawn as players
if (IS_PLAYER(self)) {
//PlayerScore_Clear(self);
- if(g_lms)
- PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives());
self.killcount = 0;
//stop the player from moving so that he stands still once he gets respawned
self.velocity = '0 0 0';
.float spawnshieldtime;
-.float lms_nextcheck;
-.float lms_traveled_distance;
-
.entity flagcarried;
.float playerid;
g_pinata = 0; // incompatible
g_weapon_stay = 0; // incompatible
WEPSET_COPY_AA(start_weapons, g_weaponarena_weapons);
- if(!g_ca)
- start_items |= IT_UNLIMITED_AMMO;
+ start_items |= IT_UNLIMITED_AMMO;
}
else if (g_minstagib)
{
}
else
{
- if(g_ca)
- {
- start_ammo_shells = cvar("g_lms_start_ammo_shells");
- start_ammo_nails = cvar("g_lms_start_ammo_nails");
- start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
- start_ammo_cells = cvar("g_lms_start_ammo_cells");
- start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
- }
- else
- {
- start_ammo_shells = cvar("g_start_ammo_shells");
- start_ammo_nails = cvar("g_start_ammo_nails");
- start_ammo_rockets = cvar("g_start_ammo_rockets");
- start_ammo_cells = cvar("g_start_ammo_cells");
- start_ammo_fuel = cvar("g_start_ammo_fuel");
- }
- }
-
- if (g_ca)
- {
- start_health = cvar("g_lms_start_health");
- start_armorvalue = cvar("g_lms_start_armor");
+ start_ammo_shells = cvar("g_start_ammo_shells");
+ start_ammo_nails = cvar("g_start_ammo_nails");
+ start_ammo_rockets = cvar("g_start_ammo_rockets");
+ start_ammo_cells = cvar("g_start_ammo_cells");
+ start_ammo_fuel = cvar("g_start_ammo_fuel");
}
if (inWarmupStage)
return 1;
}
+MUTATOR_HOOKFUNCTION(ca_SetStartItems)
+{
+ start_health = cvar("g_lms_start_health");
+ start_armorvalue = cvar("g_lms_start_armor");
+
+ start_ammo_shells = cvar("g_lms_start_ammo_shells");
+ start_ammo_nails = cvar("g_lms_start_ammo_nails");
+ start_ammo_rockets = cvar("g_lms_start_ammo_rockets");
+ start_ammo_cells = cvar("g_lms_start_ammo_cells");
+ start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
+
+ start_items &~= IT_UNLIMITED_AMMO;
+
+ return 0;
+}
+
void ca_Initialize()
{
allowed_to_spawn = TRUE;
MUTATOR_HOOK(ForbidPlayerScore_Clear, ca_ForbidPlayerScore_Clear, CBC_ORDER_ANY);
MUTATOR_HOOK(ForbidThrowCurrentWeapon, ca_ForbidThrowCurrentWeapon, CBC_ORDER_ANY);
MUTATOR_HOOK(GiveFragsForKill, ca_GiveFragsForKill, CBC_ORDER_FIRST);
+ MUTATOR_HOOK(SetStartItems, ca_SetStartItems, CBC_ORDER_ANY);
MUTATOR_ONADD
{
}
// mutator hooks
-MUTATOR_HOOKFUNCTION(lms_PlayerSpawn)
+MUTATOR_HOOKFUNCTION(lms_ResetMap)
+{
+ lms_lowest_lives = 999;
+ lms_next_place = player_count;
+
+ return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(lms_ResetPlayers)
{
- if(IS_PLAYER(self))
if(restart_mapalreadyrestarted || (time < game_starttime))
+ FOR_EACH_CLIENT(self)
+ if(IS_PLAYER(self))
PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives());
+
+ return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(lms_PlayerPreSpawn)
+{
+ // player is dead and becomes observer
+ // FIXME fix LMS scoring for new system
+ if(PlayerScore_Add(self, SP_LMS_RANK, 0) > 0)
+ self.classname = "observer";
+
+ return FALSE;
+}
+
+MUTATOR_HOOKFUNCTION(lms_PlayerSpawn)
+{
+ self.lms_nextcheck = time + autocvar_g_lms_campcheck_interval*2;
+ self.lms_traveled_distance = 0;
return FALSE;
}
+MUTATOR_HOOKFUNCTION(lms_PlayerDies)
+{
+ self.respawn_flags |= RESPAWN_FORCE;
+
+ return FALSE;
+}
+
MUTATOR_HOOKFUNCTION(lms_RemovePlayer)
{
// Only if the player cannot play at all
return FALSE;
}
-MUTATOR_HOOKFUNCTION(lms_BotSpawn)
-{
- // temporary hack to give bots lives
- if(PlayerScore_Add(self, SP_LMS_LIVES, LMS_NewPlayerLives()) <= 0)
- {
- PlayerScore_Add(self, SP_LMS_RANK, 666);
- self.frags = FRAGS_SPECTATOR;
- }
-
- return FALSE;
-}
-
// scoreboard stuff
void lms_ScoreRules()
{
MUTATOR_DEFINITION(gamemode_lms)
{
+ MUTATOR_HOOK(reset_map_global, lms_ResetMap, CBC_ORDER_ANY);
+ MUTATOR_HOOK(reset_map_players, lms_ResetPlayers, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PutClientInServer, lms_PlayerPreSpawn, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerSpawn, lms_PlayerSpawn, CBC_ORDER_ANY);
+ MUTATOR_HOOK(PlayerDies, lms_PlayerDies, CBC_ORDER_ANY);
MUTATOR_HOOK(MakePlayerObserver, lms_RemovePlayer, CBC_ORDER_ANY);
MUTATOR_HOOK(ClientConnect, lms_ClientConnect, CBC_ORDER_ANY);
MUTATOR_HOOK(PlayerPreThink, lms_PlayerThink, CBC_ORDER_ANY);
MUTATOR_HOOK(ForbidPlayerScore_Clear, lms_KeepScore, CBC_ORDER_ANY);
MUTATOR_HOOK(FilterItem, lms_FilterItem, CBC_ORDER_ANY);
MUTATOR_HOOK(ItemTouch, lms_ItemTouch, CBC_ORDER_ANY);
- MUTATOR_HOOK(HavocBot_ChooseRule, lms_BotSpawn, CBC_ORDER_ANY);
MUTATOR_ONADD
{
// lives related defs
float lms_lowest_lives;
float lms_next_place;
-float LMS_NewPlayerLives();
\ No newline at end of file
+float LMS_NewPlayerLives();
+
+// camp check
+.float lms_nextcheck;
+.float lms_traveled_distance;
\ No newline at end of file