void br_LastPlayerForSquad_Notify(entity squad);
void br_RemovePlayer(entity player);
void br_Revive(entity player);
+void br_Start();
+bool br_CheckPlayers();
int br_WinningCondition();
entity ring;
const float br_drop_time_secs = 1;
const float drop_speed_vertical_max = 0.9;
+bool br_started = false;
.bool br_ring_warned;
.float br_drop_time;
.float br_force_drop_distance;
MUTATOR_HOOKFUNCTION(br, CheckRules_World)
{
+ if(!br_started && !warmup_stage && (time > game_starttime) && br_CheckPlayers())
+ br_Start();
+
M_ARGV(0, float) = br_WinningCondition();
return true;
}
{
entity player = M_ARGV(0, entity);
- if (!(round_handler_IsActive() && round_handler_IsRoundStarted()))
+ if (!br_started)
return false;
if (IN_SQUAD(player))
MUTATOR_HOOKFUNCTION(br, ForbidSpawn)
{
- return (round_handler_IsActive() && round_handler_IsRoundStarted());
+ return br_started;
}
MUTATOR_HOOKFUNCTION(br, SetStartItems)
MUTATOR_HOOKFUNCTION(br, PlayerDied)
{
entity player = M_ARGV(0, entity);
- if(round_handler_IsActive() && round_handler_IsRoundStarted())
+ if(br_started)
+ {
br_LastPlayerForSquad_Notify(player.br_squad);
- br_SquadUpdateInfo();
+ br_SquadUpdateInfo();
+ }
}
MUTATOR_HOOKFUNCTION(br, ClientObituary)
{
entity player = M_ARGV(0, entity);
- if(round_handler_IsActive() && round_handler_IsRoundStarted())
+ if(br_started)
{
// no forfeiting once the game started
Send_Notification(NOTIF_ONE_ONLY, player, MSG_CENTER, CENTER_BR_FORFEIT);
{
entity player = M_ARGV(0, entity);
- if(round_handler_IsActive() && round_handler_IsRoundStarted())
+ if(br_started)
{
// no forfeiting once the game started
Send_Notification(NOTIF_ONE_ONLY, player, MSG_CENTER, CENTER_BR_FORFEIT);
{
int total_squads = br_SquadUpdateInfo();
- if ((total_squads > 1) || !(round_handler_IsActive() && round_handler_IsRoundStarted()))
+ if ((total_squads > 1) || !br_started)
return WINNING_NEVER;
entity winner_squad = NULL;
return (IN_SQUAD(e) && (IS_DEAD(e) || IS_SPEC(e) || IS_OBSERVER(e)));
}
-bool br_CheckWinner()
-{
- return false;
-}
-
bool br_CheckPlayers()
{
total_players = 0;
return false;
}
-void br_RoundStart(){
+void br_Start(){
ring = ring_initialize();
dropship = dropship_initialize();
else
it.br_force_drop_distance = min_distance + random() * max(dropship_path_length - (min_distance + dropship_speed * br_drop_time_secs), 0);
});
+
+ br_started = true;
}
void br_Initialize()
{
+ br_started = false;
squads_colored = autocvar_g_br_squad_colors;
- // TODO: remove round handler
- round_handler_Spawn(br_CheckPlayers, br_CheckWinner, br_RoundStart);
- round_handler_Init(5, 0, 0); // no warmup or timelimit in battle royale
-
EliminatedPlayers_Init(br_isEliminated);
}