alias sv_hook_gamestart_duel
alias sv_hook_gamestart_mayhem
alias sv_hook_gamestart_tmayhem
-alias sv_hook_gamestart_sv
+alias sv_hook_gamestart_surv
// there is currently no hook for when the match is restarted
// see sv_hook_readyrestart for previous uses of this hook
//alias sv_hook_gamerestart
alias sv_vote_gametype_hook_duel
alias sv_vote_gametype_hook_mayhem
alias sv_vote_gametype_hook_tmayhem
-alias sv_vote_gametype_hook_sv
+alias sv_vote_gametype_hook_surv
// Example preset to allow 1v1ctf to be used for the gametype voting screen.
// Aliases can have max 31 chars so the gametype can have max 9 chars.
set g_tmayhem_respawn_delay_max 0
set g_tmayhem_respawn_waves 0
set g_tmayhem_weapon_stay 0
-set g_sv_respawn_delay_small 0
-set g_sv_respawn_delay_small_count 0
-set g_sv_respawn_delay_large 0
-set g_sv_respawn_delay_large_count 0
-set g_sv_respawn_delay_max 0
-set g_sv_respawn_waves 0
-set g_sv_weapon_stay 0
+set g_surv_respawn_delay_small 0
+set g_surv_respawn_delay_small_count 0
+set g_surv_respawn_delay_large 0
+set g_surv_respawn_delay_large_count 0
+set g_surv_respawn_delay_max 0
+set g_surv_respawn_waves 0
+set g_surv_weapon_stay 0
// =========
string player_text = "";
vector player_color = '1 1 1';
//string player_icon = "";
- if(mystatus == SV_STATUS_HUNTER)
+ if(mystatus == SURV_STATUS_HUNTER)
{
player_text = _("Hunter");
player_color = '1 0 0';
//player_icon = "player_red";
}
- else if(mystatus == SV_STATUS_PREY)
+ else if(mystatus == SURV_STATUS_PREY)
{
player_text = _("Survivor");
player_color = '0 1 0';
drawstring_aspect(pos, player_text, vec2(mySize.x, mySize.y), player_color, panel_fg_alpha, DRAWFLAG_NORMAL);
}
-REGISTER_MUTATOR(cl_sv, true);
+REGISTER_MUTATOR(cl_surv, true);
-MUTATOR_HOOKFUNCTION(cl_sv, ForcePlayercolors_Skip, CBC_ORDER_LAST)
+MUTATOR_HOOKFUNCTION(cl_surv, ForcePlayercolors_Skip, CBC_ORDER_LAST)
{
if(!ISGAMETYPE(SURVIVAL))
return false;
int surv_status = ((e) ? e.survival_status : 0);
int mystatus = entcs_receiver(player_localnum).survival_status;
- int plcolor = SV_COLOR_PREY; // default to survivor
- if((mystatus == SV_STATUS_HUNTER || intermission || STAT(GAME_STOPPED)) && surv_status == SV_STATUS_HUNTER)
- plcolor = SV_COLOR_HUNTER;
+ int plcolor = SURV_COLOR_PREY; // default to survivor
+ if((mystatus == SURV_STATUS_HUNTER || intermission || STAT(GAME_STOPPED)) && surv_status == SURV_STATUS_HUNTER)
+ plcolor = SURV_COLOR_HUNTER;
player.colormap = 1024 + plcolor;
return true;
}
-MUTATOR_HOOKFUNCTION(cl_sv, DrawScoreboard_Force)
+MUTATOR_HOOKFUNCTION(cl_surv, DrawScoreboard_Force)
{
// show the scoreboard when the round ends, so players can see who the hunter was
return STAT(GAME_STOPPED);
// player survived the round
if(IS_PLAYER(it) && !IS_DEAD(it))
{
- if(autocvar_g_survival_reward_survival && timed_out && it.survival_status == SV_STATUS_PREY)
+ if(autocvar_g_survival_reward_survival && timed_out && it.survival_status == SURV_STATUS_PREY)
GameRules_scoring_add(it, SCORE, 1); // reward survivors who make it to the end of the round time limit
- if(it.survival_status == SV_STATUS_PREY)
- GameRules_scoring_add(it, SV_SURVIVALS, 1);
- else if(it.survival_status == SV_STATUS_HUNTER)
- GameRules_scoring_add(it, SV_HUNTS, 1);
+ if(it.survival_status == SURV_STATUS_PREY)
+ GameRules_scoring_add(it, SURV_SURVIVALS, 1);
+ else if(it.survival_status == SURV_STATUS_HUNTER)
+ GameRules_scoring_add(it, SURV_HUNTS, 1);
}
});
}
int survivor_count = 0, hunter_count = 0;
FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
{
- if(it.survival_status == SV_STATUS_PREY)
+ if(it.survival_status == SURV_STATUS_PREY)
survivor_count++;
- else if(it.survival_status == SV_STATUS_HUNTER)
+ else if(it.survival_status == SURV_STATUS_HUNTER)
hunter_count++;
});
if(survivor_count > 0 && hunter_count > 0)
if(IS_PLAYER(it) && !IS_DEAD(it))
{
++playercount;
- it.survival_status = SV_STATUS_PREY;
+ it.survival_status = SURV_STATUS_PREY;
}
else
it.survival_status = 0; // this is mostly a safety check; if a client manages to somehow maintain a survival status, clear it before the round starts!
if(total_hunters >= hunter_count)
break;
total_hunters++;
- it.survival_status = SV_STATUS_HUNTER;
+ it.survival_status = SURV_STATUS_HUNTER;
});
FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
{
- if(it.survival_status == SV_STATUS_PREY)
+ if(it.survival_status == SURV_STATUS_PREY)
Send_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CENTER_SURVIVAL_SURVIVOR);
- else if(it.survival_status == SV_STATUS_HUNTER)
+ else if(it.survival_status == SURV_STATUS_HUNTER)
Send_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CENTER_SURVIVAL_HUNTER);
});
}
void surv_Initialize() // run at the start of a match, initiates game mode
{
GameRules_scoring(0, SFL_SORT_PRIO_PRIMARY, 0, {
- field(SP_SV_SURVIVALS, "survivals", 0);
- field(SP_SV_HUNTS, "hunts", SFL_SORT_PRIO_SECONDARY);
+ field(SP_SURV_SURVIVALS, "survivals", 0);
+ field(SP_SURV_HUNTS, "hunts", SFL_SORT_PRIO_SECONDARY);
});
allowed_to_spawn = true;
// Hook Functions
// ==============
-MUTATOR_HOOKFUNCTION(sv, ClientObituary)
+MUTATOR_HOOKFUNCTION(surv, ClientObituary)
{
// in survival, announcing a frag would tell everyone who the hunter is
entity frag_attacker = M_ARGV(1, entity);
GiveFrags(frag_attacker, frag_target, ((autocvar_g_survival_punish_teamkill) ? -1 : -2), frag_deathtype, wep_ent.weaponentity_fld);
}
- if(frag_attacker.survival_status == SV_STATUS_HUNTER)
+ if(frag_attacker.survival_status == SURV_STATUS_HUNTER)
M_ARGV(5, bool) = true; // anonymous attacker
}
-MUTATOR_HOOKFUNCTION(sv, PlayerPreThink)
+MUTATOR_HOOKFUNCTION(surv, PlayerPreThink)
{
entity player = M_ARGV(0, entity);
{
// update the scoreboard colour display to out the real killer at the end of the round
// running this every frame to avoid cheats
- int plcolor = SV_COLOR_PREY;
- if(player.survival_status == SV_STATUS_HUNTER && game_stopped)
- plcolor = SV_COLOR_HUNTER;
+ int plcolor = SURV_COLOR_PREY;
+ if(player.survival_status == SURV_STATUS_HUNTER && game_stopped)
+ plcolor = SURV_COLOR_HUNTER;
setcolor(player, plcolor);
}
}
-MUTATOR_HOOKFUNCTION(sv, PlayerSpawn)
+MUTATOR_HOOKFUNCTION(surv, PlayerSpawn)
{
entity player = M_ARGV(0, entity);
eliminatedPlayers.SendFlags |= 1;
}
-MUTATOR_HOOKFUNCTION(sv, ForbidSpawn)
+MUTATOR_HOOKFUNCTION(surv, ForbidSpawn)
{
entity player = M_ARGV(0, entity);
return false;
}
-MUTATOR_HOOKFUNCTION(sv, PutClientInServer)
+MUTATOR_HOOKFUNCTION(surv, PutClientInServer)
{
entity player = M_ARGV(0, entity);
}
}
-MUTATOR_HOOKFUNCTION(sv, reset_map_players)
+MUTATOR_HOOKFUNCTION(surv, reset_map_players)
{
FOREACH_CLIENT(true, {
CS(it).killcount = 0;
return true;
}
-MUTATOR_HOOKFUNCTION(sv, reset_map_global)
+MUTATOR_HOOKFUNCTION(surv, reset_map_global)
{
allowed_to_spawn = true;
return true;
}
}
-MUTATOR_HOOKFUNCTION(sv, PlayerDies)
+MUTATOR_HOOKFUNCTION(surv, PlayerDies)
{
entity frag_attacker = M_ARGV(1, entity);
entity frag_target = M_ARGV(2, entity);
return true;
}
-MUTATOR_HOOKFUNCTION(sv, ClientDisconnect)
+MUTATOR_HOOKFUNCTION(surv, ClientDisconnect)
{
entity player = M_ARGV(0, entity);
return true;
}
-MUTATOR_HOOKFUNCTION(sv, MakePlayerObserver)
+MUTATOR_HOOKFUNCTION(surv, MakePlayerObserver)
{
entity player = M_ARGV(0, entity);
bool is_forced = M_ARGV(1, bool);
return true; // prevent team reset
}
-MUTATOR_HOOKFUNCTION(sv, Scores_CountFragsRemaining)
+MUTATOR_HOOKFUNCTION(surv, Scores_CountFragsRemaining)
{
// announce remaining frags?
return true;
}
-MUTATOR_HOOKFUNCTION(sv, GiveFragsForKill, CBC_ORDER_FIRST)
+MUTATOR_HOOKFUNCTION(surv, GiveFragsForKill, CBC_ORDER_FIRST)
{
entity frag_attacker = M_ARGV(0, entity);
if(!warmup_stage && round_handler_IsActive() && round_handler_IsRoundStarted())
return true;
}
-MUTATOR_HOOKFUNCTION(sv, AddPlayerScore)
+MUTATOR_HOOKFUNCTION(surv, AddPlayerScore)
{
entity scorefield = M_ARGV(0, entity);
if(scorefield == SP_KILLS || scorefield == SP_DEATHS || scorefield == SP_SUICIDES || scorefield == SP_DMG || scorefield == SP_DMGTAKEN)
M_ARGV(1, float) = 0; // don't report that the player has killed or been killed, that would out them as a hunter!
}
-MUTATOR_HOOKFUNCTION(sv, CalculateRespawnTime)
+MUTATOR_HOOKFUNCTION(surv, CalculateRespawnTime)
{
// no respawn calculations needed, player is forced to spectate anyway
return true;
}
-MUTATOR_HOOKFUNCTION(sv, Bot_FixCount, CBC_ORDER_EXCLUSIVE)
+MUTATOR_HOOKFUNCTION(surv, Bot_FixCount, CBC_ORDER_EXCLUSIVE)
{
FOREACH_CLIENT(IS_REAL_CLIENT(it), {
if (IS_PLAYER(it) || INGAME_JOINED(it))
return true;
}
-MUTATOR_HOOKFUNCTION(sv, ClientCommand_Spectate)
+MUTATOR_HOOKFUNCTION(surv, ClientCommand_Spectate)
{
entity player = M_ARGV(0, entity);
return MUT_SPECCMD_CONTINUE;
}
-MUTATOR_HOOKFUNCTION(sv, BotShouldAttack)
+MUTATOR_HOOKFUNCTION(surv, BotShouldAttack)
{
entity bot = M_ARGV(0, entity);
entity targ = M_ARGV(1, entity);