alias cl_hook_gamestart_ft
alias cl_hook_gamestart_inv
alias cl_hook_gamestart_duel
-alias cl_hook_gamestart_surv
+alias cl_hook_gamestart_sv
alias cl_hook_gameend "rpn /cl_matchcount dup load 1 + =" // increase match count every time a game ends
alias cl_hook_shutdown
alias cl_hook_activeweapon
alias sv_hook_gamestart_ft
alias sv_hook_gamestart_inv
alias sv_hook_gamestart_duel
-alias sv_hook_gamestart_surv
+alias sv_hook_gamestart_sv
// 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_rc
alias sv_vote_gametype_hook_tdm
alias sv_vote_gametype_hook_duel
-alias sv_vote_gametype_hook_surv
+alias sv_vote_gametype_hook_sv
// 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_duel_respawn_delay_max 0
set g_duel_respawn_waves 0
set g_duel_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
+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
// =========
// survival
// ==========
set g_survival 0 "Survival: identify and eliminate all the hunters before all your allies are gone"
-set g_survival_not_dm_maps 0 "when this is set, DM maps will NOT be listed in survival"
+set g_survival_not_lms_maps 0 "when this is set, LMS maps will NOT be listed in survival"
set g_survival_hunter_count 0.25 "number of players who will become hunters, set between 0 and 0.9 to use a multiplier of the current players, or 1 and above to specify an exact number of players"
set g_survival_punish_teamkill 1 "kill the player when they kill an ally"
set g_survival_reward_survival 1 "give a point to all surviving players if the round timelimit is reached, in addition to the points given for kills"
// e.g. -teams,rc,cts,lms/kills ?+rc/kills
#define SCOREBOARD_DEFAULT_COLUMNS \
"ping pl fps name |" \
-" -teams,rc,cts,inv,lms,surv/kills +ft,tdm/kills ?+rc,inv/kills" \
-" -teams,lms,surv/deaths +ft,tdm/deaths" \
+" -teams,rc,cts,inv,lms,sv/kills +ft,tdm/kills ?+rc,inv/kills" \
+" -teams,lms,sv/deaths +ft,tdm/deaths" \
" +tdm/sum" \
-" -teams,lms,rc,cts,inv,ka,surv/suicides +ft,tdm/suicides ?+rc,inv/suicides" \
-" -cts,dm,tdm,ka,ft,surv/frags" /* tdm already has this in "score" */ \
+" -teams,lms,rc,cts,inv,ka,sv/suicides +ft,tdm/suicides ?+rc,inv/suicides" \
+" -cts,dm,tdm,ka,ft,sv/frags" /* tdm already has this in "score" */ \
" +tdm,ft,dom,ons,as/teamkills"\
-" -rc,cts,nb,surv/dmg -rc,cts,nb,surv/dmgtaken" \
+" -rc,cts,nb,sv/dmg -rc,cts,nb,sv/dmgtaken" \
" +ctf/pickups +ctf/fckills +ctf/returns +ctf/caps +ons/takes +ons/caps" \
" +lms/lives +lms/rank" \
" +kh/kckills +kh/losses +kh/caps" \
" +as/objectives +nb/faults +nb/goals" \
" +ka/pickups +ka/bckills +ka/bctime +ft/revivals" \
" +dom/ticks +dom/takes" \
-" +surv/survivals +surv/hunts" \
+" +sv/survivals +sv/hunts" \
" -lms,rc,cts,inv,nb/score"
void Cmd_Scoreboard_SetFields(int argc)
string player_text = "";
vector player_color = '1 1 1';
//string player_icon = "";
- if(mystatus == SURV_STATUS_HUNTER)
+ if(mystatus == SV_STATUS_HUNTER)
{
player_text = _("Hunter");
player_color = '1 0 0';
//player_icon = "player_red";
}
- else if(mystatus == SURV_STATUS_PREY)
+ else if(mystatus == SV_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_surv, true);
+REGISTER_MUTATOR(cl_sv, true);
-MUTATOR_HOOKFUNCTION(cl_surv, ForcePlayercolors_Skip, CBC_ORDER_LAST)
+MUTATOR_HOOKFUNCTION(cl_sv, 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 = SURV_COLOR_PREY; // default to survivor
- if((mystatus == SURV_STATUS_HUNTER || intermission || STAT(GAME_STOPPED)) && surv_status == SURV_STATUS_HUNTER)
- plcolor = SURV_COLOR_HUNTER;
+ 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;
player.colormap = 1024 + plcolor;
return true;
// shared state signalling the player's survival status
.int survival_status;
-const int SURV_STATUS_PREY = 1;
-const int SURV_STATUS_HUNTER = 2;
+const int SV_STATUS_PREY = 1;
+const int SV_STATUS_HUNTER = 2;
// hardcoded player colors for survival
-const int SURV_COLOR_PREY = 51; // green
-const int SURV_COLOR_HUNTER = 68; // red
+const int SV_COLOR_PREY = 51; // green
+const int SV_COLOR_HUNTER = 68; // red
// player survived the round
if(IS_PLAYER(it) && !IS_DEAD(it))
{
- if(autocvar_g_survival_reward_survival && timed_out && it.survival_status == SURV_STATUS_PREY)
+ if(autocvar_g_survival_reward_survival && timed_out && it.survival_status == SV_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 == 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);
+ 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);
}
});
}
int survivor_count = 0, hunter_count = 0;
FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
{
- if(it.survival_status == SURV_STATUS_PREY)
+ if(it.survival_status == SV_STATUS_PREY)
survivor_count++;
- else if(it.survival_status == SURV_STATUS_HUNTER)
+ else if(it.survival_status == SV_STATUS_HUNTER)
hunter_count++;
});
if(survivor_count > 0 && hunter_count > 0)
if(IS_PLAYER(it) && !IS_DEAD(it))
{
++playercount;
- it.survival_status = SURV_STATUS_PREY;
+ it.survival_status = SV_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 = SURV_STATUS_HUNTER;
+ it.survival_status = SV_STATUS_HUNTER;
});
FOREACH_CLIENT(IS_PLAYER(it) && !IS_DEAD(it),
{
- if(it.survival_status == SURV_STATUS_PREY)
+ if(it.survival_status == SV_STATUS_PREY)
Send_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CENTER_SURVIVAL_SURVIVOR);
- else if(it.survival_status == SURV_STATUS_HUNTER)
+ else if(it.survival_status == SV_STATUS_HUNTER)
Send_Notification(NOTIF_ONE_ONLY, it, MSG_CENTER, CENTER_SURVIVAL_HUNTER);
surv_FakeTimeLimit(it, round_handler_GetEndTime());
void surv_Initialize() // run at the start of a match, initiates game mode
{
GameRules_scoring(0, SFL_SORT_PRIO_PRIMARY, 0, {
- field(SP_SURV_SURVIVALS, "survivals", 0);
- field(SP_SURV_HUNTS, "hunts", SFL_SORT_PRIO_SECONDARY);
+ field(SP_SV_SURVIVALS, "survivals", 0);
+ field(SP_SV_HUNTS, "hunts", SFL_SORT_PRIO_SECONDARY);
});
allowed_to_spawn = true;
// Hook Functions
// ==============
-MUTATOR_HOOKFUNCTION(surv, ClientObituary)
+MUTATOR_HOOKFUNCTION(sv, ClientObituary)
{
// in survival, announcing a frag would tell everyone who the hunter is
entity frag_attacker = M_ARGV(1, entity);
M_ARGV(5, bool) = true; // anonymous attacker
}
-MUTATOR_HOOKFUNCTION(surv, PlayerPreThink)
+MUTATOR_HOOKFUNCTION(sv, 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 = SURV_COLOR_PREY;
- if(player.survival_status == SURV_STATUS_HUNTER && game_stopped)
- plcolor = SURV_COLOR_HUNTER;
+ int plcolor = SV_COLOR_PREY;
+ if(player.survival_status == SV_STATUS_HUNTER && game_stopped)
+ plcolor = SV_COLOR_HUNTER;
setcolor(player, plcolor);
}
}
-MUTATOR_HOOKFUNCTION(surv, PlayerSpawn)
+MUTATOR_HOOKFUNCTION(sv, PlayerSpawn)
{
entity player = M_ARGV(0, entity);
eliminatedPlayers.SendFlags |= 1;
}
-MUTATOR_HOOKFUNCTION(surv, ForbidSpawn)
+MUTATOR_HOOKFUNCTION(sv, ForbidSpawn)
{
entity player = M_ARGV(0, entity);
return false;
}
-MUTATOR_HOOKFUNCTION(surv, PutClientInServer)
+MUTATOR_HOOKFUNCTION(sv, PutClientInServer)
{
entity player = M_ARGV(0, entity);
}
}
-MUTATOR_HOOKFUNCTION(surv, reset_map_players)
+MUTATOR_HOOKFUNCTION(sv, reset_map_players)
{
FOREACH_CLIENT(true, {
CS(it).killcount = 0;
return true;
}
-MUTATOR_HOOKFUNCTION(surv, reset_map_global)
+MUTATOR_HOOKFUNCTION(sv, reset_map_global)
{
allowed_to_spawn = true;
return true;
}
}
-MUTATOR_HOOKFUNCTION(surv, PlayerDies)
+MUTATOR_HOOKFUNCTION(sv, PlayerDies)
{
entity frag_attacker = M_ARGV(1, entity);
entity frag_target = M_ARGV(2, entity);
return true;
}
-MUTATOR_HOOKFUNCTION(surv, ClientDisconnect)
+MUTATOR_HOOKFUNCTION(sv, ClientDisconnect)
{
entity player = M_ARGV(0, entity);
return true;
}
-MUTATOR_HOOKFUNCTION(surv, MakePlayerObserver)
+MUTATOR_HOOKFUNCTION(sv, MakePlayerObserver)
{
entity player = M_ARGV(0, entity);
return true; // prevent team reset
}
-MUTATOR_HOOKFUNCTION(surv, Scores_CountFragsRemaining)
+MUTATOR_HOOKFUNCTION(sv, Scores_CountFragsRemaining)
{
// announce remaining frags?
return true;
}
-MUTATOR_HOOKFUNCTION(surv, GiveFragsForKill, CBC_ORDER_FIRST)
+MUTATOR_HOOKFUNCTION(sv, GiveFragsForKill, CBC_ORDER_FIRST)
{
entity frag_attacker = M_ARGV(0, entity);
if(!warmup_stage && round_handler_IsActive() && round_handler_IsRoundStarted())
return true;
}
-MUTATOR_HOOKFUNCTION(surv, AddPlayerScore)
+MUTATOR_HOOKFUNCTION(sv, 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(surv, CalculateRespawnTime)
+MUTATOR_HOOKFUNCTION(sv, CalculateRespawnTime)
{
// no respawn calculations needed, player is forced to spectate anyway
return true;
}
-MUTATOR_HOOKFUNCTION(surv, Bot_FixCount, CBC_ORDER_EXCLUSIVE)
+MUTATOR_HOOKFUNCTION(sv, Bot_FixCount, CBC_ORDER_EXCLUSIVE)
{
FOREACH_CLIENT(IS_REAL_CLIENT(it), {
if (IS_PLAYER(it) || it.caplayer == 1)
return true;
}
-MUTATOR_HOOKFUNCTION(surv, ClientCommand_Spectate)
+MUTATOR_HOOKFUNCTION(sv, ClientCommand_Spectate)
{
entity player = M_ARGV(0, entity);
return MUT_SPECCMD_CONTINUE;
}
-MUTATOR_HOOKFUNCTION(surv, GetPlayerStatus)
+MUTATOR_HOOKFUNCTION(sv, GetPlayerStatus)
{
entity player = M_ARGV(0, entity);
return player.caplayer == 1;
}
-MUTATOR_HOOKFUNCTION(surv, BotShouldAttack)
+MUTATOR_HOOKFUNCTION(sv, BotShouldAttack)
{
entity bot = M_ARGV(0, entity);
entity targ = M_ARGV(1, entity);
#include <common/scores.qh>
void surv_Initialize();
-REGISTER_MUTATOR(surv, false)
+REGISTER_MUTATOR(sv, false)
{
MUTATOR_STATIC();
MUTATOR_ONADD
CLASS(Survival, Gametype)
INIT(Survival)
{
- this.gametype_init(this, _("Survival"),"surv","g_survival",false,true,"","timelimit=20 pointlimit=20",_("Identify and eliminate all the hunters before all your allies are gone"));
+ this.gametype_init(this, _("Survival"),"sv","g_survival",false,true,"","timelimit=20 pointlimit=20",_("Identify and eliminate all the hunters before all your allies are gone"));
}
METHOD(Survival, m_isAlwaysSupported, bool(Gametype this, int spawnpoints, float diameter))
{
}
METHOD(Survival, m_isForcedSupported, bool(Gametype this))
{
- if(!cvar("g_survival_not_dm_maps"))
+ if(!cvar("g_survival_not_lms_maps"))
{
- // if this is set, all DM maps support Survival too
- if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags))
+ // if this is unset, all LMS maps support Survival too
+ if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_LMS.m_flags))
return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
}
return false;
REGISTER_SP(ONS_TAKES);
REGISTER_SP(ONS_CAPS);
-REGISTER_SP(SURV_SURVIVALS);
-REGISTER_SP(SURV_HUNTS);
+REGISTER_SP(SV_SURVIVALS);
+REGISTER_SP(SV_HUNTS);
#endif
BADCVAR("g_shootfromeye");
BADCVAR("g_snafu");
BADCVAR("g_survival");
- BADCVAR("g_survival_not_dm_maps");
+ BADCVAR("g_survival_not_lms_maps");
BADCVAR("g_tdm");
BADCVAR("g_tdm_on_dm_maps");
BADCVAR("g_tdm_teams");