set g_weapon_charge_colormod_green_full -0.5
set g_weapon_charge_colormod_blue_full -1
+// frozen
+set g_frozen_revive_falldamage 0 "Enable reviving from this amount of fall damage"
+set g_frozen_revive_falldamage_health 40 "Amount of health player has if they revived from falling"
+set g_frozen_damage_trigger 1 "if 1, frozen players falling into the void will die instead of teleporting to spawn"
+set g_frozen_force 0.6 "How much to multiply the force on a frozen player with"
+
// player statistics server URI
set g_playerstats_uri "" "Output player statistics information to either: URL (with ://), console (with a dash like this: -), or supply a filename to output to data directory."
set g_freezetag_revive_extra_size 100 "Distance in qu that you can stand from a frozen teammate to keep reviving him"
set g_freezetag_revive_nade 1 "Enable reviving from own nade explosion"
set g_freezetag_revive_nade_health 40 "Amount of health player has if they revived from their own nade explosion"
-set g_freezetag_revive_falldamage 0 "Enable reviving from this amount of fall damage"
-set g_freezetag_revive_falldamage_health 40 "Amount of health player has if they revived from falling"
set g_freezetag_round_timelimit 180 "round time limit in seconds"
-set g_freezetag_frozen_damage_trigger 1 "if 1, frozen players falling into the void will die instead of teleporting to spawn"
-set g_freezetag_frozen_force 0.6 "How much to multiply the force on a frozen player with"
set g_freezetag_frozen_maxtime 60 "frozen players will be automatically unfrozen after this time in seconds"
seta g_freezetag_teams_override 0
set g_freezetag_team_spawns 0 "when 1, players spawn from the team spawnpoints of the map, if any"
#ifdef IMPLEMENTATION
#ifdef SVQC
+int autocvar_g_nexball_goalleadlimit;
+#define autocvar_g_nexball_goallimit cvar("g_nexball_goallimit")
+
float autocvar_g_nexball_basketball_bouncefactor;
float autocvar_g_nexball_basketball_bouncestop;
float autocvar_g_nexball_basketball_carrier_highspeed;
bool autocvar_g_banned_list_idmode;
bool autocvar_g_botclip_collisions;
bool autocvar_g_bugrigs;
-float autocvar_g_ca_damage2score_multiplier;
-int autocvar_g_ca_point_leadlimit;
-int autocvar_g_ca_point_limit;
-float autocvar_g_ca_round_timelimit;
-bool autocvar_g_ca_spectate_enemies;
-int autocvar_g_ca_teams;
-int autocvar_g_ca_teams_override;
-bool autocvar_g_ca_team_spawns;
-float autocvar_g_ca_warmup;
bool autocvar_g_campaign;
#define autocvar_g_campaign_forceteam cvar("g_campaign_forceteam")
int autocvar_g_campaign_skill;
int autocvar_g_chat_nospectators;
bool autocvar_g_chat_teamcolors;
bool autocvar_g_chat_tellprivacy;
-bool autocvar_g_ctf_allow_vehicle_carry;
-bool autocvar_g_ctf_allow_vehicle_touch;
-bool autocvar_g_ctf_allow_monster_touch;
-bool autocvar_g_ctf_throw;
-float autocvar_g_ctf_throw_angle_max;
-float autocvar_g_ctf_throw_angle_min;
-int autocvar_g_ctf_throw_punish_count;
-float autocvar_g_ctf_throw_punish_delay;
-float autocvar_g_ctf_throw_punish_time;
-float autocvar_g_ctf_throw_strengthmultiplier;
-float autocvar_g_ctf_throw_velocity_forward;
-float autocvar_g_ctf_throw_velocity_up;
-float autocvar_g_ctf_drop_velocity_up;
-float autocvar_g_ctf_drop_velocity_side;
-bool autocvar_g_ctf_oneflag_reverse;
-bool autocvar_g_ctf_portalteleport;
-bool autocvar_g_ctf_pass;
-float autocvar_g_ctf_pass_arc;
-float autocvar_g_ctf_pass_arc_max;
-float autocvar_g_ctf_pass_directional_max;
-float autocvar_g_ctf_pass_directional_min;
-float autocvar_g_ctf_pass_radius;
-float autocvar_g_ctf_pass_wait;
-bool autocvar_g_ctf_pass_request;
-float autocvar_g_ctf_pass_turnrate;
-float autocvar_g_ctf_pass_timelimit;
-float autocvar_g_ctf_pass_velocity;
-bool autocvar_g_ctf_dynamiclights;
-float autocvar_g_ctf_flag_collect_delay;
-float autocvar_g_ctf_flag_damageforcescale;
-bool autocvar_g_ctf_flag_dropped_waypoint;
-bool autocvar_g_ctf_flag_dropped_floatinwater;
-bool autocvar_g_ctf_flag_glowtrails;
-int autocvar_g_ctf_flag_health;
-bool autocvar_g_ctf_flag_return;
-float autocvar_g_ctf_flag_return_carried_radius;
-float autocvar_g_ctf_flag_return_time;
-bool autocvar_g_ctf_flag_return_when_unreachable;
-float autocvar_g_ctf_flag_return_damage;
-float autocvar_g_ctf_flag_return_damage_delay;
-float autocvar_g_ctf_flag_return_dropped;
-float autocvar_g_ctf_flagcarrier_auto_helpme_damage;
-float autocvar_g_ctf_flagcarrier_auto_helpme_time;
-float autocvar_g_ctf_flagcarrier_selfdamagefactor;
-float autocvar_g_ctf_flagcarrier_selfforcefactor;
-float autocvar_g_ctf_flagcarrier_damagefactor;
-float autocvar_g_ctf_flagcarrier_forcefactor;
-//float autocvar_g_ctf_flagcarrier_waypointforenemy_spotting;
-bool autocvar_g_ctf_fullbrightflags;
-bool autocvar_g_ctf_ignore_frags;
-int autocvar_g_ctf_score_capture;
-int autocvar_g_ctf_score_capture_assist;
-int autocvar_g_ctf_score_kill;
-int autocvar_g_ctf_score_penalty_drop;
-int autocvar_g_ctf_score_penalty_returned;
-int autocvar_g_ctf_score_pickup_base;
-int autocvar_g_ctf_score_pickup_dropped_early;
-int autocvar_g_ctf_score_pickup_dropped_late;
-int autocvar_g_ctf_score_return;
-float autocvar_g_ctf_shield_force;
-float autocvar_g_ctf_shield_max_ratio;
-int autocvar_g_ctf_shield_min_negscore;
-bool autocvar_g_ctf_stalemate;
-int autocvar_g_ctf_stalemate_endcondition;
-float autocvar_g_ctf_stalemate_time;
-bool autocvar_g_ctf_reverse;
-float autocvar_g_ctf_dropped_capture_delay;
-float autocvar_g_ctf_dropped_capture_radius;
-float autocvar_g_cts_finish_kill_delay;
-bool autocvar_g_cts_selfdamage;
bool autocvar_g_debug_bot_commands;
-int autocvar_g_domination_default_teams;
-bool autocvar_g_domination_disable_frags;
-int autocvar_g_domination_point_amt;
-bool autocvar_g_domination_point_fullbright;
-int autocvar_g_domination_point_leadlimit;
-bool autocvar_g_domination_roundbased;
-int autocvar_g_domination_roundbased_point_limit;
-float autocvar_g_domination_round_timelimit;
-float autocvar_g_domination_warmup;
-#define autocvar_g_domination_point_limit cvar("g_domination_point_limit")
-float autocvar_g_domination_point_rate;
-int autocvar_g_domination_teams_override;
bool autocvar_g_forced_respawn;
string autocvar_g_forced_team_blue;
string autocvar_g_forced_team_otherwise;
string autocvar_g_forced_team_pink;
string autocvar_g_forced_team_red;
string autocvar_g_forced_team_yellow;
-bool autocvar_g_freezetag_frozen_damage_trigger;
-float autocvar_g_freezetag_frozen_force;
-float autocvar_g_freezetag_frozen_maxtime;
-float autocvar_g_freezetag_revive_falldamage;
-float autocvar_g_freezetag_revive_falldamage_health;
-bool autocvar_g_freezetag_revive_nade;
-float autocvar_g_freezetag_revive_nade_health;
-int autocvar_g_freezetag_point_leadlimit;
-int autocvar_g_freezetag_point_limit;
-float autocvar_g_freezetag_revive_extra_size;
-float autocvar_g_freezetag_revive_speed;
-float autocvar_g_freezetag_revive_clearspeed;
-float autocvar_g_freezetag_round_timelimit;
-int autocvar_g_freezetag_teams;
-int autocvar_g_freezetag_teams_override;
-bool autocvar_g_freezetag_team_spawns;
-float autocvar_g_freezetag_warmup;
#define autocvar_g_friendlyfire cvar("g_friendlyfire")
#define autocvar_g_friendlyfire_virtual cvar("g_friendlyfire_virtual")
#define autocvar_g_friendlyfire_virtual_force cvar("g_friendlyfire_virtual_force")
int autocvar_g_jetpack_fuel;
float autocvar_g_jetpack_maxspeed_side;
float autocvar_g_jetpack_maxspeed_up;
-int autocvar_g_keepaway_ballcarrier_effects;
-float autocvar_g_keepaway_ballcarrier_damage;
-float autocvar_g_keepaway_ballcarrier_force;
-float autocvar_g_keepaway_ballcarrier_highspeed;
-float autocvar_g_keepaway_ballcarrier_selfdamage;
-float autocvar_g_keepaway_ballcarrier_selfforce;
-float autocvar_g_keepaway_noncarrier_damage;
-float autocvar_g_keepaway_noncarrier_force;
-float autocvar_g_keepaway_noncarrier_selfdamage;
-float autocvar_g_keepaway_noncarrier_selfforce;
-bool autocvar_g_keepaway_noncarrier_warn;
-int autocvar_g_keepaway_score_bckill;
-int autocvar_g_keepaway_score_killac;
-int autocvar_g_keepaway_score_timepoints;
-float autocvar_g_keepaway_score_timeinterval;
-float autocvar_g_keepawayball_damageforcescale;
-int autocvar_g_keepawayball_effects;
-float autocvar_g_keepawayball_respawntime;
-int autocvar_g_keepawayball_trail_color;
-int autocvar_g_keyhunt_point_leadlimit;
-bool autocvar_g_keyhunt_team_spawns;
-#define autocvar_g_keyhunt_point_limit cvar("g_keyhunt_point_limit")
-int autocvar_g_keyhunt_teams;
-int autocvar_g_keyhunt_teams_override;
-int autocvar_g_lms_extra_lives;
-bool autocvar_g_lms_join_anytime;
-int autocvar_g_lms_last_join;
-#define autocvar_g_lms_lives_override cvar("g_lms_lives_override")
-bool autocvar_g_lms_regenerate;
#define autocvar_g_maplist cvar_string("g_maplist")
bool autocvar_g_maplist_check_waypoints;
int autocvar_g_maplist_index;
float autocvar_g_multijump_maxspeed;
float autocvar_g_multijump_dodging = 1;
string autocvar_g_mutatormsg;
-int autocvar_g_nexball_goalleadlimit;
-#define autocvar_g_nexball_goallimit cvar("g_nexball_goallimit")
//float autocvar_g_nick_flood_penalty;
int autocvar_g_nick_flood_penalty_red;
int autocvar_g_nick_flood_penalty_yellow;
float autocvar_g_projectiles_newton_style_2_maxfactor;
float autocvar_g_projectiles_newton_style_2_minfactor;
int autocvar_g_projectiles_spread_style;
-#define autocvar_g_race_laps_limit cvar("g_race_laps_limit")
-float autocvar_g_race_qualifying_timelimit;
-float autocvar_g_race_qualifying_timelimit_override;
-int autocvar_g_race_teams;
float autocvar_g_respawn_delay_small;
int autocvar_g_respawn_delay_small_count;
float autocvar_g_respawn_delay_large;
bool autocvar_g_spawn_useallspawns;
bool autocvar_g_spawnpoints_auto_move_out_of_solid;
#define autocvar_g_spawnshieldtime cvar("g_spawnshieldtime")
-bool autocvar_g_tdm_team_spawns;
-int autocvar_g_tdm_point_limit;
-int autocvar_g_tdm_point_leadlimit;
-int autocvar_g_tdm_teams;
-int autocvar_g_tdm_teams_override;
float autocvar_g_teamdamage_resetspeed;
float autocvar_g_teamdamage_threshold;
bool autocvar_g_telefrags;
float autocvar_g_touchexplode_damage;
float autocvar_g_touchexplode_edgedamage;
float autocvar_g_touchexplode_force;
-float autocvar_g_invasion_round_timelimit;
-int autocvar_g_invasion_teams;
-bool autocvar_g_invasion_team_spawns;
-float autocvar_g_invasion_spawnpoint_spawn_delay;
-#define autocvar_g_invasion_point_limit cvar("g_invasion_point_limit")
-float autocvar_g_invasion_warmup;
-int autocvar_g_invasion_monster_count;
-bool autocvar_g_invasion_zombies_only;
-float autocvar_g_invasion_spawn_delay;
#define autocvar_g_bloodloss cvar("g_bloodloss")
float autocvar_g_random_gravity_negative_chance;
float autocvar_g_random_gravity_min;
int autocvar_g_spawn_near_teammate_ignore_spawnpoint;
float autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay;
float autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death;
-float autocvar_g_onslaught_debug;
-float autocvar_g_onslaught_teleport_wait;
-bool autocvar_g_onslaught_spawn_at_controlpoints;
-bool autocvar_g_onslaught_spawn_at_generator;
-float autocvar_g_onslaught_cp_proxydecap;
-float autocvar_g_onslaught_cp_proxydecap_distance = 512;
-float autocvar_g_onslaught_cp_proxydecap_dps = 100;
-float autocvar_g_onslaught_spawn_at_controlpoints_chance = 0.5;
-float autocvar_g_onslaught_spawn_at_controlpoints_random;
-float autocvar_g_onslaught_spawn_at_generator_chance;
-float autocvar_g_onslaught_spawn_at_generator_random;
-float autocvar_g_onslaught_cp_buildhealth;
-float autocvar_g_onslaught_cp_buildtime;
-float autocvar_g_onslaught_cp_health;
-float autocvar_g_onslaught_cp_regen;
-float autocvar_g_onslaught_gen_health;
-float autocvar_g_onslaught_shield_force = 100;
-float autocvar_g_onslaught_allow_vehicle_touch;
-float autocvar_g_onslaught_round_timelimit;
-float autocvar_g_onslaught_point_limit;
-float autocvar_g_onslaught_warmup;
-float autocvar_g_onslaught_teleport_radius;
-float autocvar_g_onslaught_spawn_choose;
-float autocvar_g_onslaught_click_radius;
int autocvar_g_spawn_near_teammate_ignore_spawnpoint_check_health;
bool autocvar_g_spawn_near_teammate_ignore_spawnpoint_closetodeath;
bool autocvar_g_physics_clientselect;
float autocvar_g_rm_laser_rapid_delay;
float autocvar_g_rm_laser_radius;
float autocvar_g_rm_laser_force;
+float autocvar_g_frozen_revive_falldamage;
+int autocvar_g_frozen_revive_falldamage_health;
+bool autocvar_g_frozen_damage_trigger;
+float autocvar_g_frozen_force;
#endif
if(g_race_qualifying || g_cts)
killtime = 0;
- if(g_cts && self.killindicator && self.killindicator.health == 1) // self.killindicator.health == 1 means that the kill indicator was spawned by CTS_ClientKill
- {
- remove(self.killindicator);
- self.killindicator = world;
-
- ClientKill_Now(); // allow instant kill in this case
- return;
- }
+ if(MUTATOR_CALLHOOK(ClientKill, self, killtime))
+ return;
self.killindicator_teamchange = targetteam;
ClientKill_TeamChange(0);
}
-void CTS_ClientKill (entity e) // silent version of ClientKill, used when player finishes a CTS run. Useful to prevent cheating by running back to the start line and starting out with more speed
-{
- e.killindicator = spawn();
- e.killindicator.owner = e;
- e.killindicator.think = KillIndicator_Think;
- e.killindicator.nextthink = time + (e.lip) * 0.05;
- e.killindicator.cnt = ceil(autocvar_g_cts_finish_kill_delay);
- e.killindicator.health = 1; // this is used to indicate that it should be silent
- e.lip = 0;
-}
-
void FixClientCvars(entity e)
{
// send prediction settings to the client
stuffcmd(e, "\nin_bindmap 0 0\n");
- if(g_race || g_cts)
- stuffcmd(e, "cl_cmd settemp cl_movecliptokeyboard 2\n");
if(autocvar_g_antilag == 3) // client side hitscan
stuffcmd(e, "cl_cmd settemp cl_prydoncursor_notrace 0\n");
if(autocvar_sv_gentle)
bool Spectate(entity pl)
{SELFPARAM();
- if(g_ca && !autocvar_g_ca_spectate_enemies && self.caplayer)
- if(DIFF_TEAM(pl, self))
+ if(MUTATOR_CALLHOOK(SpectateSet, self, pl))
return false;
+ pl = spec_player;
SetSpectator(self, pl);
return SpectateSet();
}
-// Returns next available player to spectate if g_ca_spectate_enemies == 0
-entity CA_SpectateNext(entity start)
-{SELFPARAM();
- if(SAME_TEAM(start, self))
- return start;
-
- other = start;
- // continue from current player
- while(other && DIFF_TEAM(other, self))
- other = find(other, classname, "player");
-
- if (!other)
- {
- // restart from begining
- other = find(other, classname, "player");
- while(other && DIFF_TEAM(other, self))
- other = find(other, classname, "player");
- }
-
- return other;
-}
-
bool SpectateNext()
{SELFPARAM();
other = find(self.enemy, classname, "player");
- if (g_ca && !autocvar_g_ca_spectate_enemies && self.caplayer)
- // CA and ca players when spectating enemies is forbidden
- other = CA_SpectateNext(other);
- else
- {
- // other modes and ca spectators or spectating enemies is allowed
- if (!other)
- other = find(other, classname, "player");
- }
+ bool mutator_returnvalue = MUTATOR_CALLHOOK(SpectateNext, self, other);
+ other = spec_player;
+
+ if(!mutator_returnvalue && !other)
+ other = find(other, classname, "player");
if(other) { SetSpectator(self, other); }
while(other && other != self.enemy)
other = other.chain;
- if (g_ca && !autocvar_g_ca_spectate_enemies && self.caplayer)
- {
- do { other = other.chain; }
- while(other && DIFF_TEAM(other, self));
+ int mutator_returnvalue = MUTATOR_CALLHOOK(SpectatePrev, self, other, first);
+ other = spec_player;
- if (!other)
+ switch(mutator_returnvalue)
+ {
+ case MUT_SPECPREV_FOUND: break;
+ case MUT_SPECPREV_RETURN: return true;
+ case MUT_SPECPREV_CONTINUE:
+ default:
{
- other = first;
- while(other && DIFF_TEAM(other, self))
+ if(other.chain)
other = other.chain;
- if(other == self.enemy)
- return true;
+ else
+ other = first;
+ break;
}
}
- else
- {
- if(other.chain)
- other = other.chain;
- else
- other = first;
- }
+
SetSpectator(self, other);
return SpectateSet();
}
float Spectate(entity pl);
-void CTS_ClientKill (entity e);
-
#endif
if(targ.frozen)
if(deathtype != DEATH_HURTTRIGGER.m_id && deathtype != DEATH_TEAMCHANGE.m_id && deathtype != DEATH_AUTOTEAMCHANGE.m_id)
{
- if(autocvar_g_freezetag_revive_falldamage > 0)
+ if(autocvar_g_frozen_revive_falldamage > 0)
if(deathtype == DEATH_FALL.m_id)
- if(damage >= autocvar_g_freezetag_revive_falldamage)
+ if(damage >= autocvar_g_frozen_revive_falldamage)
{
Unfreeze(targ);
- targ.health = autocvar_g_freezetag_revive_falldamage_health;
+ targ.health = autocvar_g_frozen_revive_falldamage_health;
Send_Effect(EFFECT_ICEORGLASS, targ.origin, '0 0 0', 3);
Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED_FALL, targ.netname);
Send_Notification(NOTIF_ONE, targ, MSG_CENTER, CENTER_FREEZETAG_REVIVE_SELF);
}
damage = 0;
- force *= autocvar_g_freezetag_frozen_force;
+ force *= autocvar_g_frozen_force;
}
- if(targ.frozen && deathtype == DEATH_HURTTRIGGER.m_id && !autocvar_g_freezetag_frozen_damage_trigger)
+ if(targ.frozen && deathtype == DEATH_HURTTRIGGER.m_id && !autocvar_g_frozen_damage_trigger)
{
Send_Effect(EFFECT_TELEPORT, targ.origin, '0 0 0', 1);
/**/
int record_page;
MUTATOR_HOOKABLE(GetRecords, EV_GetRecords);
+
+#define EV_Race_FinalCheckpoint(i, o) \
+ /**/ i(entity, race_player) \
+ /**/
+entity race_player;
+MUTATOR_HOOKABLE(Race_FinalCheckpoint, EV_Race_FinalCheckpoint);
+
+/** called when player triggered kill (or is changing teams), return error to not do anything */
+#define EV_ClientKill(i, o) \
+ /** player */ i(entity, __self) \
+ /* kill delay */ i(float, ret_float) \
+ /* kill delay */ o(float, ret_float) \
+ /**/
+MUTATOR_HOOKABLE(ClientKill, EV_ClientKill);
+
+#define EV_FixClientCvars(i, o) \
+ /**/ i(entity, fix_client) \
+ /**/
+entity fix_client;
+MUTATOR_HOOKABLE(FixClientCvars, EV_FixClientCvars);
+
+#define EV_SpectateSet(i, o) \
+ /**/ i(entity, __self) \
+ /**/ i(entity, spec_player) \
+ /**/
+entity spec_player;
+MUTATOR_HOOKABLE(SpectateSet, EV_SpectateSet);
+
+#define EV_SpectateNext(i, o) \
+ /**/ i(entity, __self) \
+ /**/ i(entity, spec_player) \
+ /**/
+MUTATOR_HOOKABLE(SpectateNext, EV_SpectateNext);
+
+#define EV_SpectatePrev(i, o) \
+ /**/ i(entity, __self) \
+ /**/ i(entity, spec_player) \
+ /**/ i(entity, spec_first) \
+ /**/
+entity spec_first;
+MUTATOR_HOOKABLE(SpectatePrev, EV_SpectatePrev);
+
+enum {
+ MUT_SPECPREV_CONTINUE, // return this flag to make the function continue as normal
+ MUT_SPECPREV_RETURN, // return this flag to make the function return (handled entirely by mutator)
+ MUT_SPECPREV_FOUND // return this flag to make the function continue without default functions (handled mostly by mutator)
+};
#endif
#include "gamemode.qh"
+float autocvar_g_ca_damage2score_multiplier;
+int autocvar_g_ca_point_leadlimit;
+int autocvar_g_ca_point_limit;
+float autocvar_g_ca_round_timelimit;
+bool autocvar_g_ca_spectate_enemies;
+int autocvar_g_ca_teams;
+int autocvar_g_ca_teams_override;
+bool autocvar_g_ca_team_spawns;
+float autocvar_g_ca_warmup;
+
float ca_teams;
float allowed_to_spawn;
return false;
}
+// Returns next available player to spectate if g_ca_spectate_enemies == 0
+entity CA_SpectateNext(entity player, entity start)
+{
+ if(SAME_TEAM(start, player))
+ return start;
+
+ entity spec_other = start;
+ // continue from current player
+ while(spec_other && DIFF_TEAM(spec_other, player))
+ spec_other = find(spec_other, classname, "player");
+
+ if (!spec_other)
+ {
+ // restart from begining
+ spec_other = find(spec_other, classname, "player");
+ while(spec_other && DIFF_TEAM(spec_other, player))
+ spec_other = find(spec_other, classname, "player");
+ }
+
+ return spec_other;
+}
+
MUTATOR_HOOKFUNCTION(ca, PlayerSpawn)
{SELFPARAM();
self.caplayer = 1;
return true;
}
+MUTATOR_HOOKFUNCTION(ca, SpectateSet)
+{
+ if(!autocvar_g_ca_spectate_enemies && self.caplayer)
+ if(DIFF_TEAM(spec_player, self))
+ return true;
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(ca, SpectateNext)
+{SELFPARAM();
+ if(!autocvar_g_ca_spectate_enemies && self.caplayer)
+ {
+ spec_player = CA_SpectateNext(self, spec_player);
+ return true;
+ }
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(ca, SpectatePrev)
+{SELFPARAM();
+ if(!autocvar_g_ca_spectate_enemies && self.caplayer)
+ {
+ do { spec_player = spec_player.chain; }
+ while(spec_player && DIFF_TEAM(spec_player, self));
+
+ if (!spec_player)
+ {
+ spec_player = spec_first;
+ while(spec_player && DIFF_TEAM(spec_player, self))
+ spec_player = spec_player.chain;
+ if(spec_player == self.enemy)
+ return MUT_SPECPREV_RETURN;
+ }
+ }
+
+ return MUT_SPECPREV_FOUND;
+}
+
void ca_Initialize()
{
allowed_to_spawn = true;
#include "../../lib/warpzone/common.qh"
+bool autocvar_g_ctf_allow_vehicle_carry;
+bool autocvar_g_ctf_allow_vehicle_touch;
+bool autocvar_g_ctf_allow_monster_touch;
+bool autocvar_g_ctf_throw;
+float autocvar_g_ctf_throw_angle_max;
+float autocvar_g_ctf_throw_angle_min;
+int autocvar_g_ctf_throw_punish_count;
+float autocvar_g_ctf_throw_punish_delay;
+float autocvar_g_ctf_throw_punish_time;
+float autocvar_g_ctf_throw_strengthmultiplier;
+float autocvar_g_ctf_throw_velocity_forward;
+float autocvar_g_ctf_throw_velocity_up;
+float autocvar_g_ctf_drop_velocity_up;
+float autocvar_g_ctf_drop_velocity_side;
+bool autocvar_g_ctf_oneflag_reverse;
+bool autocvar_g_ctf_portalteleport;
+bool autocvar_g_ctf_pass;
+float autocvar_g_ctf_pass_arc;
+float autocvar_g_ctf_pass_arc_max;
+float autocvar_g_ctf_pass_directional_max;
+float autocvar_g_ctf_pass_directional_min;
+float autocvar_g_ctf_pass_radius;
+float autocvar_g_ctf_pass_wait;
+bool autocvar_g_ctf_pass_request;
+float autocvar_g_ctf_pass_turnrate;
+float autocvar_g_ctf_pass_timelimit;
+float autocvar_g_ctf_pass_velocity;
+bool autocvar_g_ctf_dynamiclights;
+float autocvar_g_ctf_flag_collect_delay;
+float autocvar_g_ctf_flag_damageforcescale;
+bool autocvar_g_ctf_flag_dropped_waypoint;
+bool autocvar_g_ctf_flag_dropped_floatinwater;
+bool autocvar_g_ctf_flag_glowtrails;
+int autocvar_g_ctf_flag_health;
+bool autocvar_g_ctf_flag_return;
+float autocvar_g_ctf_flag_return_carried_radius;
+float autocvar_g_ctf_flag_return_time;
+bool autocvar_g_ctf_flag_return_when_unreachable;
+float autocvar_g_ctf_flag_return_damage;
+float autocvar_g_ctf_flag_return_damage_delay;
+float autocvar_g_ctf_flag_return_dropped;
+float autocvar_g_ctf_flagcarrier_auto_helpme_damage;
+float autocvar_g_ctf_flagcarrier_auto_helpme_time;
+float autocvar_g_ctf_flagcarrier_selfdamagefactor;
+float autocvar_g_ctf_flagcarrier_selfforcefactor;
+float autocvar_g_ctf_flagcarrier_damagefactor;
+float autocvar_g_ctf_flagcarrier_forcefactor;
+//float autocvar_g_ctf_flagcarrier_waypointforenemy_spotting;
+bool autocvar_g_ctf_fullbrightflags;
+bool autocvar_g_ctf_ignore_frags;
+int autocvar_g_ctf_score_capture;
+int autocvar_g_ctf_score_capture_assist;
+int autocvar_g_ctf_score_kill;
+int autocvar_g_ctf_score_penalty_drop;
+int autocvar_g_ctf_score_penalty_returned;
+int autocvar_g_ctf_score_pickup_base;
+int autocvar_g_ctf_score_pickup_dropped_early;
+int autocvar_g_ctf_score_pickup_dropped_late;
+int autocvar_g_ctf_score_return;
+float autocvar_g_ctf_shield_force;
+float autocvar_g_ctf_shield_max_ratio;
+int autocvar_g_ctf_shield_min_negscore;
+bool autocvar_g_ctf_stalemate;
+int autocvar_g_ctf_stalemate_endcondition;
+float autocvar_g_ctf_stalemate_time;
+bool autocvar_g_ctf_reverse;
+float autocvar_g_ctf_dropped_capture_delay;
+float autocvar_g_ctf_dropped_capture_radius;
+
void ctf_FakeTimeLimit(entity e, float t)
{
msg_entity = e;
#include "../race.qh"
+float autocvar_g_cts_finish_kill_delay;
+bool autocvar_g_cts_selfdamage;
+
// legacy bot roles
.float race_checkpoint;
void havocbot_role_cts()
GameLogEcho(strcat(":cts:", mode, ":", ((actor != world) ? (strcat(":", ftos(actor.playerid))) : "")));
}
+void CTS_ClientKill(entity e) // silent version of ClientKill, used when player finishes a CTS run. Useful to prevent cheating by running back to the start line and starting out with more speed
+{
+ e.killindicator = spawn();
+ e.killindicator.owner = e;
+ e.killindicator.think = KillIndicator_Think;
+ e.killindicator.nextthink = time + (e.lip) * 0.05;
+ e.killindicator.cnt = ceil(autocvar_g_cts_finish_kill_delay);
+ e.killindicator.health = 1; // this is used to indicate that it should be silent
+ e.lip = 0;
+}
+
MUTATOR_HOOKFUNCTION(cts, PlayerPhysics)
{SELFPARAM();
// force kbd movement for fairness
return false;
}
+MUTATOR_HOOKFUNCTION(cts, ClientKill)
+{
+ ret_float = 0;
+
+ if(self.killindicator && self.killindicator.health == 1) // self.killindicator.health == 1 means that the kill indicator was spawned by CTS_ClientKill
+ {
+ remove(self.killindicator);
+ self.killindicator = world;
+
+ ClientKill_Now(); // allow instant kill in this case
+ return;
+ }
+
+}
+
+MUTATOR_HOOKFUNCTION(cts, Race_FinalCheckpoint)
+{
+ if(autocvar_g_cts_finish_kill_delay)
+ CTS_ClientKill(self);
+
+ return false;
+}
+
+MUTATOR_HOOKFUNCTION(cts, FixClientCvars)
+{
+ stuffcmd(fix_client, "cl_cmd settemp cl_movecliptokeyboard 2\n");
+ return false;
+}
+
void cts_Initialize()
{
cts_ScoreRules();
#include "../teamplay.qh"
+int autocvar_g_domination_default_teams;
+bool autocvar_g_domination_disable_frags;
+int autocvar_g_domination_point_amt;
+bool autocvar_g_domination_point_fullbright;
+int autocvar_g_domination_point_leadlimit;
+bool autocvar_g_domination_roundbased;
+int autocvar_g_domination_roundbased_point_limit;
+float autocvar_g_domination_round_timelimit;
+float autocvar_g_domination_warmup;
+#define autocvar_g_domination_point_limit cvar("g_domination_point_limit")
+float autocvar_g_domination_point_rate;
+int autocvar_g_domination_teams_override;
+
void dom_EventLog(string mode, float team_before, entity actor) // use an alias for easy changing and quick editing later
{
if(autocvar_sv_eventlog)
#include "gamemode.qh"
+float autocvar_g_freezetag_frozen_maxtime;
+bool autocvar_g_freezetag_revive_nade;
+float autocvar_g_freezetag_revive_nade_health;
+int autocvar_g_freezetag_point_leadlimit;
+int autocvar_g_freezetag_point_limit;
+float autocvar_g_freezetag_revive_extra_size;
+float autocvar_g_freezetag_revive_speed;
+float autocvar_g_freezetag_revive_clearspeed;
+float autocvar_g_freezetag_round_timelimit;
+int autocvar_g_freezetag_teams;
+int autocvar_g_freezetag_teams_override;
+bool autocvar_g_freezetag_team_spawns;
+float autocvar_g_freezetag_warmup;
+
const float SP_FREEZETAG_REVIVALS = 4;
void freezetag_ScoreRules(float teams)
{
#include "../teamplay.qh"
+float autocvar_g_invasion_round_timelimit;
+int autocvar_g_invasion_teams;
+bool autocvar_g_invasion_team_spawns;
+float autocvar_g_invasion_spawnpoint_spawn_delay;
+#define autocvar_g_invasion_point_limit cvar("g_invasion_point_limit")
+float autocvar_g_invasion_warmup;
+int autocvar_g_invasion_monster_count;
+bool autocvar_g_invasion_zombies_only;
+float autocvar_g_invasion_spawn_delay;
+
spawnfunc(invasion_spawnpoint)
{
if(!g_invasion) { remove(self); return; }
#include "gamemode.qh"
-// ===========================================================
-// Keepaway game mode coding, written by Samual and Diabolik
-// Last updated: September, 2012
-// ===========================================================
+int autocvar_g_keepaway_ballcarrier_effects;
+float autocvar_g_keepaway_ballcarrier_damage;
+float autocvar_g_keepaway_ballcarrier_force;
+float autocvar_g_keepaway_ballcarrier_highspeed;
+float autocvar_g_keepaway_ballcarrier_selfdamage;
+float autocvar_g_keepaway_ballcarrier_selfforce;
+float autocvar_g_keepaway_noncarrier_damage;
+float autocvar_g_keepaway_noncarrier_force;
+float autocvar_g_keepaway_noncarrier_selfdamage;
+float autocvar_g_keepaway_noncarrier_selfforce;
+bool autocvar_g_keepaway_noncarrier_warn;
+int autocvar_g_keepaway_score_bckill;
+int autocvar_g_keepaway_score_killac;
+int autocvar_g_keepaway_score_timepoints;
+float autocvar_g_keepaway_score_timeinterval;
+float autocvar_g_keepawayball_damageforcescale;
+int autocvar_g_keepawayball_effects;
+float autocvar_g_keepawayball_respawntime;
+int autocvar_g_keepawayball_trail_color;
float ka_ballcarrier_waypointsprite_visible_for_player(entity e) // runs on waypoints which are attached to ballcarriers, updates once per frame
{
#include "gamemode.qh"
+int autocvar_g_keyhunt_point_leadlimit;
+bool autocvar_g_keyhunt_team_spawns;
+#define autocvar_g_keyhunt_point_limit cvar("g_keyhunt_point_limit")
+int autocvar_g_keyhunt_teams;
+int autocvar_g_keyhunt_teams_override;
// #define KH_PLAYER_USE_ATTACHMENT
// #define KH_PLAYER_USE_CARRIEDMODEL
#include "../campaign.qh"
#include "../command/cmd.qh"
+int autocvar_g_lms_extra_lives;
+bool autocvar_g_lms_join_anytime;
+int autocvar_g_lms_last_join;
+#define autocvar_g_lms_lives_override cvar("g_lms_lives_override")
+bool autocvar_g_lms_regenerate;
+
// main functions
float LMS_NewPlayerLives()
{
-
#include "gamemode.qh"
#include "../controlpoint.qh"
#include "../generator.qh"
+float autocvar_g_onslaught_debug;
+float autocvar_g_onslaught_teleport_wait;
+bool autocvar_g_onslaught_spawn_at_controlpoints;
+bool autocvar_g_onslaught_spawn_at_generator;
+float autocvar_g_onslaught_cp_proxydecap;
+float autocvar_g_onslaught_cp_proxydecap_distance = 512;
+float autocvar_g_onslaught_cp_proxydecap_dps = 100;
+float autocvar_g_onslaught_spawn_at_controlpoints_chance = 0.5;
+float autocvar_g_onslaught_spawn_at_controlpoints_random;
+float autocvar_g_onslaught_spawn_at_generator_chance;
+float autocvar_g_onslaught_spawn_at_generator_random;
+float autocvar_g_onslaught_cp_buildhealth;
+float autocvar_g_onslaught_cp_buildtime;
+float autocvar_g_onslaught_cp_health;
+float autocvar_g_onslaught_cp_regen;
+float autocvar_g_onslaught_gen_health;
+float autocvar_g_onslaught_shield_force = 100;
+float autocvar_g_onslaught_allow_vehicle_touch;
+float autocvar_g_onslaught_round_timelimit;
+float autocvar_g_onslaught_point_limit;
+float autocvar_g_onslaught_warmup;
+float autocvar_g_onslaught_teleport_radius;
+float autocvar_g_onslaught_spawn_choose;
+float autocvar_g_onslaught_click_radius;
+
void FixSize(entity e);
// =======================
#include "../race.qh"
+#define autocvar_g_race_laps_limit cvar("g_race_laps_limit")
+float autocvar_g_race_qualifying_timelimit;
+float autocvar_g_race_qualifying_timelimit_override;
+int autocvar_g_race_teams;
+
// legacy bot roles
.float race_checkpoint;
void havocbot_role_race()
return false;
}
+MUTATOR_HOOKFUNCTION(rc, FixClientCvars)
+{
+ stuffcmd(fix_client, "cl_cmd settemp cl_movecliptokeyboard 2\n");
+ return false;
+}
+
void race_Initialize()
{
race_ScoreRules();
-
#include "gamemode.qh"
+bool autocvar_g_tdm_team_spawns;
+int autocvar_g_tdm_point_limit;
+int autocvar_g_tdm_point_leadlimit;
+int autocvar_g_tdm_teams;
+int autocvar_g_tdm_teams_override;
+
/*QUAKED spawnfunc_tdm_team (0 .5 .8) (-16 -16 -24) (16 16 32)
Team declaration for TDM gameplay, this allows you to decide what team names and control point models are used in your map.
Note: If you use spawnfunc_tdm_team entities you must define at least 2! However, unlike domination, you don't need to make a blank one too.
if(cp == race_timed_checkpoint)
{
race_setTime(GetMapname(), t, e.crypto_idfp, e.netname, e);
- if(g_cts && autocvar_g_cts_finish_kill_delay)
- {
- CTS_ClientKill(e);
- }
+ MUTATOR_CALLHOOK(Race_FinalCheckpoint, e);
}
if(t < recordtime || recordtime == 0)
{
spawnfunc(trigger_race_penalty)
{
+ // TODO: find out why this wasnt done:
+ //if(!g_cts && !g_race) { remove(self); return; }
+
EXACTTRIGGER_INIT;
self.use = penalty_use;