- wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
- wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
- make
- - EXPECT=4eb3a666f96bd7ac7d84d0019237d23c
+ - EXPECT=0a8b491cd50a1e77d930b048c98da88f
- HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
| tee /dev/stderr
| grep '^:'
set g_balance_blaster_primary_damage 20
set g_balance_blaster_primary_delay 0
set g_balance_blaster_primary_edgedamage 10
-set g_balance_blaster_primary_force 300
-set g_balance_blaster_primary_force_zscale 1.25
+set g_balance_blaster_primary_force 375
+set g_balance_blaster_primary_force_zscale 1
set g_balance_blaster_primary_lifetime 5
set g_balance_blaster_primary_radius 60
set g_balance_blaster_primary_refire 0.7
set g_balance_blaster_secondary_damage 25
set g_balance_blaster_secondary_delay 0
set g_balance_blaster_secondary_edgedamage 12.5
-set g_balance_blaster_secondary_force 300
-set g_balance_blaster_secondary_force_zscale 1.2
+set g_balance_blaster_secondary_force 360
+set g_balance_blaster_secondary_force_zscale 1
set g_balance_blaster_secondary_lifetime 5
set g_balance_blaster_secondary_radius 70
set g_balance_blaster_secondary_refire 0.7
set g_balance_vaporizer_secondary_damage 25
set g_balance_vaporizer_secondary_delay 0
set g_balance_vaporizer_secondary_edgedamage 12.5
-set g_balance_vaporizer_secondary_force 400
-set g_balance_vaporizer_secondary_force_zscale 1.2
+set g_balance_vaporizer_secondary_force 480
+set g_balance_vaporizer_secondary_force_zscale 1
set g_balance_vaporizer_secondary_lifetime 5
set g_balance_vaporizer_secondary_radius 70
set g_balance_vaporizer_secondary_refire 0.7
set g_balance_blaster_primary_damage 20
set g_balance_blaster_primary_delay 0
set g_balance_blaster_primary_edgedamage 10
-set g_balance_blaster_primary_force 300
-set g_balance_blaster_primary_force_zscale 1.25
+set g_balance_blaster_primary_force 375
+set g_balance_blaster_primary_force_zscale 1
set g_balance_blaster_primary_lifetime 5
set g_balance_blaster_primary_radius 60
set g_balance_blaster_primary_refire 0.7
set g_balance_blaster_secondary_damage 25
set g_balance_blaster_secondary_delay 0
set g_balance_blaster_secondary_edgedamage 12.5
-set g_balance_blaster_secondary_force 300
-set g_balance_blaster_secondary_force_zscale 1.2
+set g_balance_blaster_secondary_force 360
+set g_balance_blaster_secondary_force_zscale 1
set g_balance_blaster_secondary_lifetime 5
set g_balance_blaster_secondary_radius 70
set g_balance_blaster_secondary_refire 0.7
set g_balance_vaporizer_secondary_damage 25
set g_balance_vaporizer_secondary_delay 0
set g_balance_vaporizer_secondary_edgedamage 12.5
-set g_balance_vaporizer_secondary_force 400
-set g_balance_vaporizer_secondary_force_zscale 1.2
+set g_balance_vaporizer_secondary_force 480
+set g_balance_vaporizer_secondary_force_zscale 1
set g_balance_vaporizer_secondary_lifetime 5
set g_balance_vaporizer_secondary_radius 70
set g_balance_vaporizer_secondary_refire 0.7
set g_balance_blaster_primary_damage 20
set g_balance_blaster_primary_delay 0
set g_balance_blaster_primary_edgedamage 10
-set g_balance_blaster_primary_force 300
-set g_balance_blaster_primary_force_zscale 1.25
+set g_balance_blaster_primary_force 375
+set g_balance_blaster_primary_force_zscale 1
set g_balance_blaster_primary_lifetime 5
set g_balance_blaster_primary_radius 60
set g_balance_blaster_primary_refire 0.7
set g_balance_blaster_secondary_damage 25
set g_balance_blaster_secondary_delay 0
set g_balance_blaster_secondary_edgedamage 12.5
-set g_balance_blaster_secondary_force 300
-set g_balance_blaster_secondary_force_zscale 1.2
+set g_balance_blaster_secondary_force 360
+set g_balance_blaster_secondary_force_zscale 1
set g_balance_blaster_secondary_lifetime 5
set g_balance_blaster_secondary_radius 70
set g_balance_blaster_secondary_refire 0.7
set g_balance_vaporizer_secondary_damage 25
set g_balance_vaporizer_secondary_delay 0
set g_balance_vaporizer_secondary_edgedamage 12.5
-set g_balance_vaporizer_secondary_force 400
-set g_balance_vaporizer_secondary_force_zscale 1.2
+set g_balance_vaporizer_secondary_force 480
+set g_balance_vaporizer_secondary_force_zscale 1
set g_balance_vaporizer_secondary_lifetime 5
set g_balance_vaporizer_secondary_radius 70
set g_balance_vaporizer_secondary_refire 0.7
set g_balance_blaster_primary_damage 20
set g_balance_blaster_primary_delay 0
set g_balance_blaster_primary_edgedamage 10
-set g_balance_blaster_primary_force 300
-set g_balance_blaster_primary_force_zscale 1.25
+set g_balance_blaster_primary_force 375
+set g_balance_blaster_primary_force_zscale 1
set g_balance_blaster_primary_lifetime 5
set g_balance_blaster_primary_radius 60
set g_balance_blaster_primary_refire 0.7
set g_balance_blaster_secondary_damage 25
set g_balance_blaster_secondary_delay 0
set g_balance_blaster_secondary_edgedamage 12.5
-set g_balance_blaster_secondary_force 300
-set g_balance_blaster_secondary_force_zscale 1.2
+set g_balance_blaster_secondary_force 360
+set g_balance_blaster_secondary_force_zscale 1
set g_balance_blaster_secondary_lifetime 5
set g_balance_blaster_secondary_radius 70
set g_balance_blaster_secondary_refire 0.7
set g_balance_vaporizer_secondary_damage 25
set g_balance_vaporizer_secondary_delay 0
set g_balance_vaporizer_secondary_edgedamage 12.5
-set g_balance_vaporizer_secondary_force 400
-set g_balance_vaporizer_secondary_force_zscale 1.2
+set g_balance_vaporizer_secondary_force 480
+set g_balance_vaporizer_secondary_force_zscale 1
set g_balance_vaporizer_secondary_lifetime 5
set g_balance_vaporizer_secondary_radius 70
set g_balance_vaporizer_secondary_refire 0.7
alias hud "qc_cmd_cl hud ${* ?}" // Commands regarding/controlling the HUD system
alias localprint "qc_cmd_cl localprint ${* ?}" // Create your own centerprint sent to yourself
//alias mv_download "qc_cmd_cl mv_download ${* ?}" // Retrieve mapshot picture from the server
-alias sendcvar "qc_cmd_cl sendcvar ${* ?}" // Send a cvar to the server (like weaponpriority)
+alias sendcvar "qc_cmd_cl sendcvar ${* ?}" // Send a cvar to the server (like cl_weaponpriority)
alias weapon_find "qc_cmd_cl weapon_find ${* ?}" // Show spawn locations of a weapon
alias exit "quit"
alias scoreboard_columns_help "qc_cmd_cl hud scoreboard_columns_help"
alias scoreboard_columns_set "qc_cmd_cl hud scoreboard_columns_set ${* ?}"
-// changes a cvar and reports it to the server (for the client to notify the server about changes)
-alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
-
// ========================================================
// cmd (client-to-server command) - server/command/cmd.qc
// side-scrolling crosshair
seta crosshair_2d 54 "selects crosshair to use in side-scrolling mode (\"\" uses regular crosshair and 0 is none)"
+// third person chase-camera crosshair
+seta crosshair_chase 1 "adjust the crosshair while in third person mode to where the shot will actually hit"
+seta crosshair_chase_playeralpha 0.25 "opacity of the player while they obstruct the view when crosshair_chase is enabled, can be a value between 0 and 1"
+
// =========================
// Crosshair ring settings
seta g_ca_teams_override 0
set g_ca_team_spawns 0 "when 1, players spawn from the team spawnpoints of the map, if any"
set g_ca_teams 0
+set g_ca_weaponarena "most" "starting weapons - takes the same options as g_weaponarena"
// ==================
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"
set g_freezetag_teams 0
+set g_freezetag_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena"
// ==========
set g_lms_regenerate 0
set g_lms_last_join 3 "if g_lms_join_anytime is false, new players can only join if the worst active player has more than (fraglimit - g_lms_last_join) lives"
set g_lms_join_anytime 1 "if true, new players can join, but get same amount of lives as the worst player"
+set g_lms_weaponarena "most_available" "starting weapons - takes the same options as g_weaponarena"
// =========
float autocvar_crosshair_ring_reload_alpha;
float autocvar_crosshair_ring_reload_size;
float autocvar_crosshair_size;
+bool autocvar_crosshair_chase = true;
+float crosshair_chase_playeralpha = 0.25;
int autocvar_ekg;
float autocvar_fov;
bool autocvar_hud_cursormode = true;
case CMD_REQUEST_USAGE:
{
LOG_INFO("Usage:^3 cl_cmd sendcvar <cvar>");
- LOG_INFO(" Where 'cvar' is the cvar plus arguments to send to the server.");
+ LOG_INFO(" Where 'cvar' is the cvar to send to the server.");
return;
}
}
CLIENT_COMMAND(hud, "Commands regarding/controlling the HUD system") { LocalCommand_hud(request, arguments); }
CLIENT_COMMAND(localprint, "Create your own centerprint sent to yourself") { LocalCommand_localprint(request, arguments); }
CLIENT_COMMAND(mv_download, "Retrieve mapshot picture from the server") { LocalCommand_mv_download(request, arguments); }
-CLIENT_COMMAND(sendcvar, "Send a cvar to the server (like weaponpriority)") { LocalCommand_sendcvar(request, arguments); }
+CLIENT_COMMAND(sendcvar, "Send a cvar to the server (like cl_weaponpriority)") { LocalCommand_sendcvar(request, arguments); }
void LocalCommand_macro_help()
{
float w_issilent, w_random;
vector w_org, w_backoff;
+float autoswitch;
+bool cvar_cl_allow_uid2name;
+float cvar_cl_autoscreenshot;
+float cvar_cl_autotaunt;
+float cvar_cl_clippedspectating;
+float cvar_cl_handicap;
+float cvar_cl_jetpack_jump;
+float cvar_cl_movement_track_canjump;
+float cvar_cl_noantilag;
+string cvar_cl_physics;
+float cvar_cl_voice_directional;
+float cvar_cl_voice_directional_taunt_attenuation;
+float cvar_cl_weaponimpulsemode;
+string cvar_g_xonoticversion;
+float cvar_cl_cts_noautoswitch;
+bool cvar_cl_weapon_switch_reload;
+bool cvar_cl_weapon_switch_fallback_to_impulse;
+
+REPLICATE(autoswitch, bool, "cl_autoswitch");
+REPLICATE(cvar_cl_allow_uid2name, bool, "cl_allow_uid2name");
+REPLICATE(cvar_cl_autoscreenshot, int, "cl_autoscreenshot");
+REPLICATE(cvar_cl_autotaunt, float, "cl_autotaunt");
+REPLICATE(cvar_cl_clippedspectating, bool, "cl_clippedspectating");
+REPLICATE(cvar_cl_handicap, float, "cl_handicap");
+REPLICATE(cvar_cl_jetpack_jump, bool, "cl_jetpack_jump");
+REPLICATE(cvar_cl_movement_track_canjump, bool, "cl_movement_track_canjump");
+REPLICATE(cvar_cl_noantilag, bool, "cl_noantilag");
+REPLICATE(cvar_cl_physics, string, "cl_physics");
+REPLICATE(cvar_cl_voice_directional, int, "cl_voice_directional");
+REPLICATE(cvar_cl_voice_directional_taunt_attenuation, float, "cl_voice_directional_taunt_attenuation");
+REPLICATE(cvar_cl_weaponimpulsemode, int, "cl_weaponimpulsemode");
+REPLICATE(cvar_g_xonoticversion, string, "g_xonoticversion");
+REPLICATE(cvar_cl_cts_noautoswitch, bool, "cl_cts_noautoswitch");
+REPLICATE(cvar_cl_weapon_switch_reload, bool, "cl_weapon_switch_reload");
+REPLICATE(cvar_cl_weapon_switch_fallback_to_impulse, bool, "cl_weapon_switch_fallback_to_impulse");
+/*
+// this is also a STAT
+// pointless sending this cvars since server can't change gun alignment during the match
+int cvar_cl_gunalign;
+REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
+
+// cvar cl_newusekeysupported doesn't exist
+float cvar_cl_newusekeysupported;
+REPLICATE(cvar_cl_newusekeysupported, bool, "cl_newusekeysupported");
+*/
+string cvar_cl_allow_uidtracking;
+REPLICATE(cvar_cl_allow_uidtracking, string, "cl_allow_uidtracking");
+
+string cvar_cl_weaponpriority;
+REPLICATE(cvar_cl_weaponpriority, string, "cl_weaponpriority");
+
+string cvar_cl_weaponpriorities[10];
+REPLICATE(cvar_cl_weaponpriorities[0], string, "cl_weaponpriority0");
+REPLICATE(cvar_cl_weaponpriorities[1], string, "cl_weaponpriority1");
+REPLICATE(cvar_cl_weaponpriorities[2], string, "cl_weaponpriority2");
+REPLICATE(cvar_cl_weaponpriorities[3], string, "cl_weaponpriority3");
+REPLICATE(cvar_cl_weaponpriorities[4], string, "cl_weaponpriority4");
+REPLICATE(cvar_cl_weaponpriorities[5], string, "cl_weaponpriority5");
+REPLICATE(cvar_cl_weaponpriorities[6], string, "cl_weaponpriority6");
+REPLICATE(cvar_cl_weaponpriorities[7], string, "cl_weaponpriority7");
+REPLICATE(cvar_cl_weaponpriorities[8], string, "cl_weaponpriority8");
+REPLICATE(cvar_cl_weaponpriorities[9], string, "cl_weaponpriority9");
+
float bgmtime;
string weaponorder_byimpulse;
deactivate_minigame();
HUD_MinigameMenu_Close(NULL, NULL, NULL);
+
+ ReplicateVars(true); // destroy
}
.float has_team;
return;
int mask = (intermission || (STAT(HEALTH) <= 0) || autocvar_chase_active) ? 0 : MASK_NORMAL;
float a = ((autocvar_cl_viewmodel_alpha) ? bound(-1, autocvar_cl_viewmodel_alpha, this.m_alpha) : this.m_alpha);
+ int wepskin = this.m_skin;
bool invehicle = player_localentnum > maxclients;
if (invehicle) a = -1;
Weapon wep = this.activeweapon;
{
e.drawmask = mask;
e.alpha = a;
+ e.skin = wepskin;
e.colormap = 256 + c; // colormap == 0 is black, c == 0 is white
e.glowmod = g;
e.csqcmodel_effects = fx;
// wcross_origin = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;
if(csqcplayer.viewloc && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))
wcross_origin = viewloc_mousepos;
+ else if(autocvar_chase_active > 0 && autocvar_crosshair_chase)
+ {
+ vector player_org = ((csqcplayer) ? csqcplayer.origin + csqcplayer.view_ofs : view_origin);
+ if(csqcplayer && crosshair_chase_playeralpha && crosshair_chase_playeralpha < 1)
+ {
+ traceline(view_origin, view_origin + max_shot_distance * view_forward, MOVE_NORMAL, NULL);
+ if(trace_ent == csqcplayer)
+ csqcplayer.alpha = crosshair_chase_playeralpha;
+ else
+ csqcplayer.alpha = csqcplayer.m_alpha;
+ }
+ traceline(player_org, player_org + max_shot_distance * view_forward, MOVE_WORLDONLY, NULL);
+ wcross_origin = project_3d_to_2d(trace_endpos);
+ }
else
wcross_origin = project_3d_to_2d(view_origin + max_shot_distance * view_forward);
wcross_origin.z = 0;
lasthud = hud;
+ ReplicateVars(false);
+ if (ReplicateVars_NOT_SENDING())
+ ReplicateVars_DELAY(0.8 + random() * 0.4); // no need to check cvars every frame
+
HUD_Scale_Disable();
if(autocvar__hud_showbinds_reload) // menu can set this one
# define TAG_VIEWLOC_NAME tag_networkviewloc
# define TAG_VIEWLOC_TYPE int
.float tag_networkviewloc;
+
+# define ALPHA m_alpha
+.float m_alpha;
#else
# define TAG_ENTITY_NAME tag_entity
# define TAG_ENTITY_TYPE entity
# define TAG_VIEWLOC_NAME viewloc
# define TAG_VIEWLOC_TYPE entity
+
+# define ALPHA alpha
#endif
// add properties you want networked to CSQC here
CSQCMODEL_PROPERTY(BIT(0), int, ReadShort, WriteShort, colormap) \
CSQCMODEL_PROPERTY(BIT(1), int, ReadInt24_t, WriteInt24_t, effects) \
CSQCMODEL_PROPERTY(BIT(2), int, ReadByte, WriteByte, modelflags) \
- CSQCMODEL_PROPERTY_SCALED(BIT(3), float, ReadByte, WriteByte, alpha, 254, -1, 254) \
+ CSQCMODEL_PROPERTY_SCALED(BIT(3), float, ReadByte, WriteByte, ALPHA, 254, -1, 254) \
CSQCMODEL_PROPERTY(BIT(4), int, ReadByte, WriteByte, skin) \
CSQCMODEL_PROPERTY(BIT(5), float, ReadApproxPastTime, WriteApproxPastTime, death_time) \
CSQCMODEL_PROPERTY(BIT(6), float, ReadByte, WriteByte, solid) \
REGISTER_NET_TEMP(casings)
-#ifdef SVQC
-
+#if defined(SVQC)
.bool cvar_cl_casings;
+#elif defined(CSQC)
+bool cvar_cl_casings;
+#endif
REPLICATE(cvar_cl_casings, bool, "cl_casings");
+#ifdef SVQC
void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float randomavel, int casingtype, entity casingowner, .entity weaponentity)
{
if (!(CS(casingowner).cvar_cl_casings))
return MUT_SPECCMD_CONTINUE;
}
-MUTATOR_HOOKFUNCTION(ca, WantWeapon)
-{
- M_ARGV(2, bool) = true; // all weapons
-}
-
MUTATOR_HOOKFUNCTION(ca, HideTeamNagger)
{
return true; // doesn't work well with the whole spectator as player thing
MUTATOR_HOOKFUNCTION(ca, SetWeaponArena)
{
- // most weapons arena
- if (M_ARGV(0, string) == "0" || M_ARGV(0, string) == "") M_ARGV(0, string) = "most";
+ if (M_ARGV(0, string) == "0" || M_ARGV(0, string) == "")
+ M_ARGV(0, string) = autocvar_g_ca_weaponarena;
}
MUTATOR_HOOKFUNCTION(ca, SV_ParseServerCommand)
//int autocvar_g_ca_teams;
int autocvar_g_ca_teams_override;
float autocvar_g_ca_warmup;
+string autocvar_g_ca_weaponarena = "most";
int ca_teams;
MUTATOR_HOOKFUNCTION(ft, SetWeaponArena)
{
- // most weapons arena
if(M_ARGV(0, string) == "0" || M_ARGV(0, string) == "")
- M_ARGV(0, string) = "most";
+ M_ARGV(0, string) = autocvar_g_freezetag_weaponarena;
}
MUTATOR_HOOKFUNCTION(ft, FragCenterMessage)
int autocvar_g_freezetag_point_limit;
int autocvar_g_freezetag_point_leadlimit;
bool autocvar_g_freezetag_team_spawns;
+string autocvar_g_freezetag_weaponarena = "most_available";
+
void freezetag_Initialize();
REGISTER_MUTATOR(ft, false)
return true;
}
-MUTATOR_HOOKFUNCTION(lms, WantWeapon)
+MUTATOR_HOOKFUNCTION(lms, SetWeaponArena)
{
- M_ARGV(2, bool) = true; // all weapons
+ if(M_ARGV(0, string) == "0" || M_ARGV(0, string) == "")
+ M_ARGV(0, string) = autocvar_g_lms_weaponarena;
}
MUTATOR_HOOKFUNCTION(lms, GetPlayerStatus)
#include <common/mutators/base.qh>
#include <common/scores.qh>
+
.float lms_spectate_warning;
+
#define autocvar_g_lms_lives_override cvar("g_lms_lives_override")
+string autocvar_g_lms_weaponarena = "most_available";
+
void lms_Initialize();
REGISTER_MUTATOR(lms, false)
#pragma once
CLASS(BallStealer, PortoLaunch)
-/* flags */ ATTRIB(BallStealer, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_SPECIALATTACK | WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_NOTRUEAIM);
+/* flags */ ATTRIB(BallStealer, spawnflags, int, WEP_TYPE_OTHER | WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_NOTRUEAIM);
/* impulse */ ATTRIB(BallStealer, impulse, int, 0);
/* refname */ ATTRIB(BallStealer, netname, string, "ballstealer");
/* wepname */ ATTRIB(BallStealer, m_name, string, _("Ball Stealer"));
{
}
else
+ {
objerror (this, "^3Teleport destination without a targetname");
+ return; // don't link it to CSQC in this case!
+ }
teleport_dest_link(this);
}
if(n == 0)
{
// no dest!
- objerror (this, "Teleporter with nonexistant target");
+ objerror (this, "Teleporter with nonexistent target");
return;
}
else if(n == 1)
if(!autocvar_g_monsters) { Monster_Remove(this); return false; }
- if(!(this.spawnflags & MONSTERFLAG_RESPAWNED))
+ if(!(this.spawnflags & MONSTERFLAG_RESPAWNED) && !(this.flags & FL_MONSTER))
{
IL_PUSH(g_monsters, this);
if(this.mdl && this.mdl != "")
#pragma once
#include "buffs.qh"
+
+float cvar_cl_buffs_autoreplace;
+REPLICATE(cvar_cl_buffs_autoreplace, bool, "cl_buffs_autoreplace");
// generated file; do not modify
+#ifdef CSQC
+ #include <common/mutators/mutator/dodging/cl_dodging.qc>
+#endif
#ifdef SVQC
#include <common/mutators/mutator/dodging/sv_dodging.qc>
#endif
// generated file; do not modify
+#ifdef CSQC
+ #include <common/mutators/mutator/dodging/cl_dodging.qh>
+#endif
#ifdef SVQC
#include <common/mutators/mutator/dodging/sv_dodging.qh>
#endif
--- /dev/null
+#include "cl_dodging.qh"
--- /dev/null
+#pragma once
+
+float cvar_cl_dodging_timeout;
+REPLICATE(cvar_cl_dodging_timeout, float, "cl_dodging_timeout");
#endif
#ifdef CSQC
+ float cvar_cl_dodging_timeout;
#define PHYS_DODGING_FRAMETIME (1 / (frametime <= 0 ? 60 : frametime))
#define PHYS_DODGING_TIMEOUT(s) STAT(DODGING_TIMEOUT)
#define PHYS_DODGING_PRESSED_KEYS(s) (s).pressedkeys
#elif defined(SVQC)
+ .float cvar_cl_dodging_timeout;
#define PHYS_DODGING_FRAMETIME sys_frametime
#define PHYS_DODGING_TIMEOUT(s) CS(s).cvar_cl_dodging_timeout
#define PHYS_DODGING_PRESSED_KEYS(s) CS(s).pressedkeys
#include <common/animdecide.qh>
#include <common/physics/player.qh>
-.float cvar_cl_dodging_timeout;
-
REGISTER_MUTATOR(dodging, cvar("g_dodging"))
{
// this just turns on the cvar.
.bool multijump_ready;
#ifdef CSQC
+bool cvar_cl_multijump;
bool autocvar_cl_multijump = true;
#define PHYS_MULTIJUMP_CLIENT(s) autocvar_cl_multijump
}
}
-#ifdef SVQC
-
REPLICATE(cvar_cl_multijump, bool, "cl_multijump");
+#ifdef SVQC
+
MUTATOR_HOOKFUNCTION(multijump, BuildMutatorsString)
{
M_ARGV(0, string) = strcat(M_ARGV(0, string), ":multijump");
REGISTER_STAT(NADES_SMALL, int, autocvar_g_nades_nade_small)
#ifdef GAMEQC
+REPLICATE(cvar_cl_nade_type, int, "cl_nade_type");
+REPLICATE(cvar_cl_pokenade_type, string, "cl_pokenade_type");
+
entity Nade_TrailEffect(int proj, int nade_team)
{
switch (proj)
STAT(VEIL_ORB_ALPHA, client) = STAT(VEIL_ORB_ALPHA, spectatee);
}
-REPLICATE(cvar_cl_nade_type, int, "cl_nade_type");
-REPLICATE(cvar_cl_pokenade_type, string, "cl_pokenade_type");
-
MUTATOR_HOOKFUNCTION(nades, BuildMutatorsString)
{
M_ARGV(0, string) = strcat(M_ARGV(0, string), ":Nades");
#endif
#ifdef CSQC
+float cvar_cl_nade_type;
+string cvar_cl_pokenade_type;
bool Projectile_isnade(int proj); // TODO: remove
void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expand_time); // TODO: mutator
// generated file; do not modify
+#ifdef CSQC
+ #include <common/mutators/mutator/spawn_near_teammate/cl_spawn_near_teammate.qc>
+#endif
#ifdef SVQC
#include <common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc>
#endif
// generated file; do not modify
+#ifdef CSQC
+ #include <common/mutators/mutator/spawn_near_teammate/cl_spawn_near_teammate.qh>
+#endif
#ifdef SVQC
#include <common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qh>
#endif
--- /dev/null
+#include "cl_spawn_near_teammate.qh"
--- /dev/null
+#pragma once
+
+float cvar_cl_spawn_near_teammate;
+REPLICATE(cvar_cl_spawn_near_teammate, bool, "cl_spawn_near_teammate");
LOG_SEVERE("Notification initialization failed! Read above and fix the errors!");
}
+#ifdef CSQC
+.int cvar_value;
+void ReplicateVars(bool would_destroy)
+{
+ if (!would_destroy)
+ FOREACH(Notifications, it.nent_type == MSG_CHOICE, {
+ string cvarname = sprintf("notification_%s", Get_Notif_CvarName(it));
+ // NOTE: REPLICATE_SIMPLE can return;
+ REPLICATE_SIMPLE(it.cvar_value, cvarname);
+ });
+}
+#endif
+
#include "all.inc"
{
_Movetype_PushEntityTrace(this, push);
+ // NOTE: this is a workaround for the QC's lack of a worldstartsolid trace parameter
if(trace_startsolid && failonstartsolid)
{
int oldtype = this.move_nomonsters;
- this.move_nomonsters = MOVE_NOMONSTERS;
+ this.move_nomonsters = MOVE_WORLDONLY;
_Movetype_PushEntityTrace(this, push);
this.move_nomonsters = oldtype;
if(trace_startsolid)
_Movetype_LinkEdict(this, true);
if(trace_fraction < 1)
- if(this.solid >= SOLID_TRIGGER && (!IS_ONGROUND(this) || (this.groundentity != trace_ent)))
+ if(this.solid >= SOLID_TRIGGER && trace_ent && (!IS_ONGROUND(this) || (this.groundentity != trace_ent)))
_Movetype_Impact(this, trace_ent);
return (this.origin == last_origin); // false if teleported by touch
void PlayerState_attach(entity this)
{
+ if (PS(this))
+ return;
+
this._ps = NEW(PlayerState, this);
Inventory_new(PS(this));
{
this._cs = NEW(ClientState, this);
- GetCvars(this, CS(this), 0); // get other cvars from player
-
// TODO: fold all of these into ClientState
DecodeLevelParms(this);
#endif
#ifdef SVQC
+/// all the weapons actually spawned in the map, does not include filtered items
vector weaponsInMap;
+/// all the weapons placed by the mapper (weaponreplace applied), ignores most filters
+vector weaponsInMapAll;
#endif
+
REGISTER_STAT(WEAPONS, vectori)
REGISTER_STAT(WEAPONSINMAP, vectori, weaponsInMap)
#endif
#ifdef SVQC
.int cvar_cl_gunalign;
-REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
#endif
+
REGISTER_STAT(GUNALIGN, int)
#ifdef SVQC
SPECTATE_COPYFIELD(_STAT(GUNALIGN))
{
WriteShort(MSG_ENTITY, this.colormap);
WriteByte(MSG_ENTITY, this.glowmod.x * 255.0);
- WriteByte(MSG_ENTITY, this.glowmod.y * 255.0);
- WriteByte(MSG_ENTITY, this.glowmod.z * 255.0);
+ WriteByte(MSG_ENTITY, this.glowmod.y * 255.0);
+ WriteByte(MSG_ENTITY, this.glowmod.z * 255.0);
}
if(sf & ISF_DROP)
return true;
}
-void Item_Show (entity e, int mode)
+void Item_Show(entity e, int mode)
{
e.effects &= ~(EF_ADDITIVE | EF_STARDUST | EF_FULLBRIGHT | EF_NODEPTHTEST);
e.ItemStatus &= ~ITS_STAYWEP;
void Item_ItemsTime_SetTime(entity e, float t);
void Item_ItemsTime_SetTimesForAllPlayers();
-void Item_Respawn (entity this)
+void Item_Respawn(entity this)
{
Item_Show(this, 1);
sound(this, CH_TRIGGER, this.itemdef.m_respawnsound, VOL_BASE, ATTEN_NORM); // play respawn sound
setorigin(this, this.origin);
- if (Item_ItemsTime_Allow(this.itemdef) || (STAT(WEAPONS, this) & WEPSET_SUPERWEAPONS))
+ if (Item_ItemsTime_Allow(this.itemdef) || (STAT(WEAPONS, this) & WEPSET_SUPERWEAPONS))
{
float t = Item_ItemsTime_UpdateTime(this, 0);
Item_ItemsTime_SetTime(this, t);
Send_Effect(EFFECT_ITEM_RESPAWN, CENTER_OR_VIEWOFS(this), '0 0 0', 1);
}
-void Item_RespawnCountdown (entity this)
+void Item_RespawnCountdown(entity this)
{
if(this.item_respawncounter >= ITEM_RESPAWN_TICKS)
{
}
}
TeamBalance_Destroy(balance);
-
+
if (players >= 2) {
return normal_respawntime * (r / (players + o) + l);
} else {
});
e = RandomSelection_chosen_ent;
- e.state = 0;
- Item_Show(e, 1);
+ if (!e)
+ return;
IL_EACH(g_items, it.team == this.team,
{
Item_Show(it, -1);
it.state = 1; // state 1 = initially hidden item, apparently
}
+ else
+ Item_Reset(it);
it.effects &= ~EF_NODRAW;
}
});
-
- Item_Reset(this);
}
}
{
string itemname = def.m_name;
Model itemmodel = def.m_model;
- Sound pickupsound = def.m_sound;
+ Sound pickupsound = def.m_sound;
float(entity player, entity item) pickupevalfunc = def.m_pickupevalfunc;
float pickupbasevalue = def.m_botvalue;
int itemflags = def.m_itemflags;
startitem_failed = false;
this.item_model_ent = itemmodel;
- this.item_pickupsound_ent = pickupsound;
+ this.item_pickupsound_ent = pickupsound;
- if(def.m_iteminit)
- def.m_iteminit(def, this);
+ if(def.m_iteminit)
+ def.m_iteminit(def, this);
if(!this.respawntime) // both need to be set
{
|| (def.instanceOfHealth && def != ITEM_HealthSmall)
|| (def.instanceOfArmor && def != ITEM_ArmorSmall)
|| (itemid & (IT_KEY1 | IT_KEY2))
- )
+ )
{
if(!this.target || this.target == "")
this.target = "###item###"; // for finding the nearest item using findnearest
}
this.state = 0;
- if(this.team) // broken, no idea why.
+ if(this.team)
{
if(!this.cnt)
this.cnt = 1; // item probability weight
for(int j = 0; j < n; ++j)
{
FOREACH(Weapons, it != WEP_Null && W_UndeprecateName(argv(j)) == it.netname, {
- it.wr_init(it);
- break;
+ it.wr_init(it);
+ break;
});
}
}
vector shotorg_adjust_values(vector vecs, bool y_is_right, bool visual, int algn);
void CL_WeaponEntity_SetModel(entity this, string name, bool _anim);
+#ifdef CSQC
+bool cvar_cl_accuracy_data_share;
+REPLICATE(cvar_cl_accuracy_data_share, bool, "cl_accuracy_data_share");
+bool cvar_cl_accuracy_data_receive;
+REPLICATE(cvar_cl_accuracy_data_receive, bool, "cl_accuracy_data_receive");
+#endif
+
#ifdef SVQC
void wframe_send(entity actor, entity weaponentity, vector a, bool restartanim);
#endif
PROP(false, clip_size, WEPENT_SET_NORMAL, \
{ WriteShort(chan, this.clip_size); }, \
{ (viewmodels[this.m_wepent_slot]).clip_size = ReadShort(); }) \
+ \
+ PROP(false, skin, WEPENT_SET_NORMAL, \
+ { WriteShort(chan, this.skin); }, \
+ { (viewmodels[this.m_wepent_slot]).m_skin = ReadShort(); }) \
\
/**/
.float m_alpha;
+ .int m_skin;
+
// only for Porto
.bool angles_held_status;
.vector angles_held;
this.csqcmodel_teleported = 1;
}
+ if(sf & BIT(3))
+ this.alpha = this.m_alpha;
+
if(sf & BIT(14))
viewloc_SetTags(this);
#define CSQCMODEL_ENDIF
#define CSQCMODEL_PROPERTY(flag,t,r,w,f) \
.t f;
-#define CSQCMODEL_PROPERTY_SCALED(flag,t,r,w,f,s,mi,ma) CSQCMODEL_PROPERTY(flag,t,r,w,f)
+#define CSQCMODEL_PROPERTY_SCALED(flag,t,r,w,f,s,mi,ma) \
+ .t f;
ALLPROPERTIES
#undef CSQCMODEL_PROPERTY_SCALED
#undef CSQCMODEL_PROPERTY
{ \
w(MSG_ENTITY, this.csqcmodel_##f); \
}
-#define CSQCMODEL_PROPERTY_SCALED(flag,t,r,w,f,s,mi,ma) CSQCMODEL_PROPERTY(flag,t,r,w,f)
+#define CSQCMODEL_PROPERTY_SCALED(flag,t,r,w,f,s,mi,ma) \
+ if(sf & flag) \
+ { \
+ w(MSG_ENTITY, this.csqcmodel_##f); \
+ }
ALLPROPERTIES
#undef CSQCMODEL_PROPERTY_SCALED
#undef CSQCMODEL_PROPERTY
#define CSQCMODEL_PROPERTY(flag,t,r,w,f) \
.t f; \
.t csqcmodel_##f;
-#define CSQCMODEL_PROPERTY_SCALED(flag,t,r,w,f,s,mi,ma) CSQCMODEL_PROPERTY(flag,t,r,w,f)
+#define CSQCMODEL_PROPERTY_SCALED(flag,t,r,w,f,s,mi,ma) \
+ .t f; \
+ .t csqcmodel_##f;
ALLPROPERTIES
#undef CSQCMODEL_PROPERTY_SCALED
#undef CSQCMODEL_PROPERTY
#define REPLICATE(...) EVAL_REPLICATE(OVERLOAD(REPLICATE, __VA_ARGS__))
#define EVAL_REPLICATE(...) __VA_ARGS__
+ #if defined(SVQC)
ACCUMULATE void ReplicateVars(entity this, entity store, string thisname, int i) {}
+ #elif defined(CSQC)
+ ACCUMULATE void ReplicateVars(bool would_destroy) {}
+ #endif
#define REPLICATE_3(fld, type, var) REPLICATE_4(fld, type, var, )
#define REPLICATE_4(fld, type, var, func) REPLICATE_##type(fld, var, func)
- #define REPLICATE_string(fld, var, func) \
- REPLICATE_7(fld, string, var, , \
- { strcpy(field, it); }, \
- { strfree(field); }, \
- { \
- /* also initialize to the default value of func when requesting cvars */ \
- string s = func(field); \
- if (s != field) \
+ #if defined(SVQC)
+ #define REPLICATE_string(fld, var, func) \
+ REPLICATE_7(fld, string, var, , \
+ { strcpy(field, it); }, \
+ { strfree(field); }, \
{ \
- strcpy(field, s); \
- } \
- })
- #define REPLICATE_float(fld, var, func) REPLICATE_7(fld, float, var, func, { field = stof(it); }, , )
- #define REPLICATE_bool(fld, var, func) REPLICATE_7(fld, bool, var, func, { field = boolean(stoi(it)); }, , )
- #define REPLICATE_int(fld, var, func) REPLICATE_7(fld, int, var, func, { field = stoi(it); }, , )
+ /* also initialize to the default value of func when requesting cvars */ \
+ string s = func(field); \
+ if (s != field) \
+ { \
+ strcpy(field, s); \
+ } \
+ })
+ #define REPLICATE_float(fld, var, func) REPLICATE_7(fld, float, var, func, { field = stof(it); }, , )
+ #define REPLICATE_bool(fld, var, func) REPLICATE_7(fld, bool, var, func, { field = boolean(stoi(it)); }, , )
+ #define REPLICATE_int(fld, var, func) REPLICATE_7(fld, int, var, func, { field = stoi(it); }, , )
- #if defined(SVQC)
#define REPLICATE_7(fld, type, var, func, create, destroy, after) \
void ReplicateVars(entity this, entity store, string thisname, int i) \
{ \
} \
else \
{ \
- stuffcmd(this, "cl_cmd sendcvar " var "\n"); \
+ stuffcmd(this, strcat("cl_cmd sendcvar ", var, "\n")); \
} \
if (current) { after } \
} \
store.fld = field; \
}
#elif defined(CSQC)
- // TODO
- #define REPLICATE_7(fld, type, var, func, create, destroy, after)
+ float ReplicateVars_time;
+ #define ReplicateVars_NOT_SENDING() (time > ReplicateVars_time)
+ #define ReplicateVars_DELAY(t) ReplicateVars_time = time + t
+ #define ReplicateVars_DELAY_1FRAME() ReplicateVars_time = time
+ #define REPLICATE_string(fld, var, func) REPLICATE_7(fld, float, var, func, (fld != cvar_string(var)), { strcpy(fld, cvar_string(var)); }, { strfree(fld); })
+ #define REPLICATE_float(fld, var, func) REPLICATE_7(fld, float, var, func, (fld != cvar(var)), { fld = cvar(var); }, )
+ #define REPLICATE_bool(fld, var, func) REPLICATE_7(fld, bool, var, func, (fld != cvar(var)), { fld = cvar(var); }, )
+ #define REPLICATE_int(fld, var, func) REPLICATE_7(fld, int, var, func, (fld != cvar(var)), { fld = cvar(var); }, )
+
+ #define REPLICATE_7(fld, type, var, func, check, update, destroy) \
+ void ReplicateVars(bool would_destroy) \
+ { \
+ if (would_destroy) { destroy } \
+ else if (ReplicateVars_NOT_SENDING() && check) \
+ { \
+ localcmd(strcat("cl_cmd sendcvar ", var, "\n")); \
+ ReplicateVars_DELAY_1FRAME(); \
+ update \
+ return; \
+ } \
+ }
+
+ #define REPLICATE_SIMPLE(field, cvarname) MACRO_BEGIN \
+ if (ReplicateVars_NOT_SENDING() && field != cvar(cvarname)) \
+ { \
+ localcmd(strcat("cl_cmd sendcvar ", cvarname, "\n")); \
+ ReplicateVars_DELAY_1FRAME(); \
+ field = cvar(cvarname); \
+ return; \
+ } \
+ MACRO_END
#endif
#endif
FIELD_SCALAR(fld, target_range) \
FIELD_SCALAR(fld, team) \
FIELD_SCALAR(fld, trigger_reverse) \
+ FIELD_SCALAR(fld, turret_scale_aim) \
+ FIELD_SCALAR(fld, turret_scale_ammo) \
+ FIELD_SCALAR(fld, turret_scale_damage) \
FIELD_SCALAR(fld, turret_scale_health) \
FIELD_SCALAR(fld, turret_scale_range) \
+ FIELD_SCALAR(fld, turret_scale_refire) \
FIELD_SCALAR(fld, turret_scale_respawn) \
FIELD_SCALAR(fld, volume) \
FIELD_SCALAR(fld, wait) \
me.gotoRC(me, 0, 3.1);
me.TD(me, 1, 1.9, e = makeXonoticCheckBoxEx(2, 1, "cl_autoscreenshot", _("Auto screenshot scoreboard")));
+ e.sendCvars = true;
me.TD(me, 1, 1, e = makeXonoticButton(_("Refresh"), '0 0 0'));
e.onClick = ScreenshotList_Refresh_Click;
e.onClickEntity = slist;
"name \"$_cl_name\";"
"playermodel $_cl_playermodel;"
"playerskin $_cl_playerskin;"
- "sendcvar cl_allow_uidtracking;"
- "sendcvar cl_allow_uid2name;"
, COMMANDBUTTON_APPLY);
profileApplyButton.disableOnClick = true;
me.TR(me);
me.TDempty(me, 0.25);
me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uidtracking", _("Allow player statistics to track your client")));
- e.applyButton = profileApplyButton;
+ e.sendCvars = true;
me.TR(me);
me.TDempty(me, 0.25);
me.TD(me, 1, 2.5, e = makeXonoticCheckBox(0, "cl_allow_uid2name", _("Allow player statistics to use your nickname")));
- e.applyButton = profileApplyButton;
+ e.sendCvars = true;
setDependent(e, "cl_allow_uidtracking", 1, 1);
me.gotoRC(me, 4, 3.1); // TOP RIGHT
//me.gotoRC(me, 12.5, 3.1); // BOTTOM RIGHT
me.TR(me);
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_clippedspectating", _("Allow passing through walls while spectating")));
+ e.sendCvars = true;
me.gotoRC(me, 0, 3.2); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 1, e = makeXonoticTextLabel(0, _("Field of view:")));
{
entity e;
entity weaponsApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0',
- "sendcvar cl_autoswitch;"
"sendcvar cl_weaponpriority;"
- "sendcvar cl_weaponimpulsemode;"
, COMMANDBUTTON_APPLY);
weaponsApplyButton.disableOnClick = true;
_("Make use of the list above when cycling through weapons with the mouse wheel")));
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(1, "cl_weaponimpulsemode", _("Cycle through only usable weapon selections")));
- e.applyButton = weaponsApplyButton;
+ e.sendCvars = true;
me.TR(me);
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox_T(0, "cl_autoswitch", _("Auto switch weapons on pickup"),
_("Automatically switch to newly picked up weapons if they are better than what you are carrying")));
- e.applyButton = weaponsApplyButton;
+ e.sendCvars = true;
me.TR(me);
me.TD(me, 1, 3, e = makeXonoticCheckBox(0, "cl_unpress_attack_on_weapon_switch", _("Release attack buttons when you switch weapons")));
me.TR(me);
void XonoticUserSettingsTab_fill(entity me)
{
entity e, sk;
- entity userApplyButton = makeXonoticCommandButton(_("Apply immediately"), '0 0 0', "sendcvar cl_gentle;", COMMANDBUTTON_APPLY);
- userApplyButton.disableOnClick = true;
me.TR(me);
me.TDempty(me, 0.25);
me.gotoRC(me, 11.5, 3.25); me.setFirstColumn(me, me.currentColumn);
me.TD(me, 1, 2.5, e = makeXonoticCheckBox_T(0, "cl_gentle", _("Disable gore effects and harsh language"),
_("Replace blood and gibs with content that does not have any gore effects")));
- e.applyButton = userApplyButton;
-
- me.gotoRC(me, me.rows - 1, 0);
- me.TD(me, 1, 6, userApplyButton);
-
+ e.sendCvars = true;
}
this.effects = spectatee.effects & EFMASK_CHEAP; // eat performance
SetResourceExplicit(this, RES_HEALTH, GetResource(spectatee, RES_HEALTH));
CS(this).impulse = 0;
+ this.disableclientprediction = 1; // no need to run prediction on a spectator
this.items = spectatee.items;
STAT(LAST_PICKUP, this) = STAT(LAST_PICKUP, spectatee);
STAT(HIT_TIME, this) = STAT(HIT_TIME, spectatee);
if (Physics_Valid(command) || command == "default")
{
- stuffcmd(caller, strcat("\nseta cl_physics ", command, "\nsendcvar cl_physics\n"));
+ stuffcmd(caller, strcat("\nseta cl_physics ", command, "\n"));
sprint(caller, strcat("^2Physics set successfully changed to ^3", command, "\n"));
return;
}
case "prespawn": break; // handled by engine in host_cmd.c
case "sentcvar": break; // handled by server in this file
case "spawn": break; // handled by engine in host_cmd.c
+ case "color": case "topcolor": case "bottomcolor": if(teamplay) return; else break; // handled by engine in host_cmd.c
case "c2s": Net_ClientCommand(this, command); return; // handled by net.qh
default:
void FixIntermissionClient(entity e);
void FixClientCvars(entity e);
-// WEAPONTODO: remove this
-//WepSet weaponsInMap;
-
.float respawn_countdown; // next number to count
float bot_waypoints_for_items;
BADCVAR("g_race_qualifying_timelimit");
BADCVAR("g_race_qualifying_timelimit_override");
BADCVAR("g_runematch");
+ BADCVAR("g_shootfromeye");
BADCVAR("g_snafu");
BADCVAR("g_tdm");
BADCVAR("g_tdm_teams");
BADCVAR("g_physics_predictall");
BADCVAR("g_piggyback");
BADCVAR("g_playerclip_collisions");
+ BADCVAR("g_spawn_alloweffects");
BADCVAR("g_tdm_point_leadlimit");
BADCVAR("g_tdm_point_limit");
BADCVAR("leadlimit_and_fraglimit");
BADCVAR("g_grappling_hook");
BADCVAR("g_jetpack");
+ // temporary for testing
+ // TODO remove before 0.8.3 release
+ BADCVAR("g_ca_weaponarena");
+ BADCVAR("g_freezetag_weaponarena");
+ BADCVAR("g_lms_weaponarena");
+
#undef BADPRESUFFIX
#undef BADPREFIX
#undef BADCVAR
{
string s = string_null;
+ if (f == 0)
+ LOG_INFO("Warning: requesting cvar values is deprecated. Client should send them automatically using REPLICATE.\n");
+
if (f > 0)
s = strcat1(argv(f));
return p.netname;
}
-float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still needs done?
+float want_weapon(entity weaponinfo, float allguns)
{
- int i = weaponinfo.m_id;
int d = 0;
bool allow_mutatorblocked = false;
- if(!i)
+ if(!weaponinfo.m_id)
return 0;
bool mutator_returnvalue = MUTATOR_CALLHOOK(WantWeapon, weaponinfo, d, allguns, allow_mutatorblocked);
float t = weaponinfo.weaponstartoverride;
- //print(strcat("want_weapon: ", weaponinfo.netname, " - d: ", ftos(d), ", t: ", ftos(t), ". \n"));
+ //LOG_INFOF("want_weapon: %s - d: %d t: %d\n", weaponinfo.netname, d, t);
// bit order in t:
// 1: want or not
return t;
}
+/// Weapons the player normally starts with outside weapon arena.
+WepSet weapons_start()
+{
+ WepSet ret = '0 0 0';
+ FOREACH(Weapons, it != WEP_Null, {
+ int w = want_weapon(it, false);
+ if (w & 1)
+ ret |= it.m_wepset;
+ });
+ return ret;
+}
+
+WepSet weapons_all()
+{
+ WepSet ret = '0 0 0';
+ FOREACH(Weapons, it != WEP_Null, {
+ if (!(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_SPECIALATTACK)))
+ ret |= it.m_wepset;
+ });
+ return ret;
+}
+
+WepSet weapons_devall()
+{
+ WepSet ret = '0 0 0';
+ FOREACH(Weapons, it != WEP_Null,
+ {
+ ret |= it.m_wepset;
+ });
+ return ret;
+}
+
+WepSet weapons_most()
+{
+ WepSet ret = '0 0 0';
+ FOREACH(Weapons, it != WEP_Null, {
+ if ((it.spawnflags & WEP_FLAG_NORMAL) && !(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK)))
+ ret |= it.m_wepset;
+ });
+ return ret;
+}
+
+void weaponarena_available_all_update(entity this)
+{
+ if (weaponsInMapAll)
+ {
+ start_weapons = warmup_start_weapons = g_weaponarena_weapons = weapons_start() | (weaponsInMapAll & weapons_all());
+ }
+ else
+ {
+ // if no weapons are available on the map, just fall back to all weapons arena
+ start_weapons = warmup_start_weapons = g_weaponarena_weapons = weapons_all();
+ }
+}
+
+void weaponarena_available_devall_update(entity this)
+{
+ if (weaponsInMapAll)
+ {
+ start_weapons = warmup_start_weapons = g_weaponarena_weapons = weapons_start() | weaponsInMapAll;
+ }
+ else
+ {
+ // if no weapons are available on the map, just fall back to devall weapons arena
+ start_weapons = warmup_start_weapons = g_weaponarena_weapons = weapons_devall();
+ }
+}
+
+void weaponarena_available_most_update(entity this)
+{
+ if (weaponsInMapAll)
+ {
+ start_weapons = warmup_start_weapons = g_weaponarena_weapons = weapons_start() | (weaponsInMapAll & weapons_most());
+ }
+ else
+ {
+ // if no weapons are available on the map, just fall back to most weapons arena
+ start_weapons = warmup_start_weapons = g_weaponarena_weapons = weapons_most();
+ }
+}
+
void readplayerstartcvars()
{
float i, t;
- string s;
// initialize starting values for players
start_weapons = '0 0 0';
g_weaponarena = 0;
g_weaponarena_weapons = '0 0 0';
- s = cvar_string("g_weaponarena");
+ string s = cvar_string("g_weaponarena");
MUTATOR_CALLHOOK(SetWeaponArena, s);
s = M_ARGV(0, string);
{
g_weaponarena = 1;
g_weaponarena_list = "All Weapons";
- FOREACH(Weapons, it != WEP_Null, {
- if(!(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_SPECIALATTACK)))
- g_weaponarena_weapons |= (it.m_wepset);
- });
+ g_weaponarena_weapons = weapons_all();
}
else if (s == "devall")
{
g_weaponarena = 1;
- g_weaponarena_list = "All Weapons"; // TODO: report as more than just all weapons?
- FOREACH(Weapons, it != WEP_Null,
- {
- g_weaponarena_weapons |= (it.m_wepset);
- });
+ g_weaponarena_list = "Dev All Weapons";
+ g_weaponarena_weapons = weapons_devall();
}
else if (s == "most")
{
g_weaponarena = 1;
g_weaponarena_list = "Most Weapons";
- FOREACH(Weapons, it != WEP_Null, {
- if ((it.spawnflags & WEP_FLAG_NORMAL) && !(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK)))
- g_weaponarena_weapons |= (it.m_wepset);
- });
+ g_weaponarena_weapons = weapons_most();
+ }
+ else if (s == "all_available")
+ {
+ g_weaponarena = 1;
+ g_weaponarena_list = "All Available Weapons";
+
+ // this needs to run after weaponsInMapAll is initialized
+ InitializeEntity(NULL, weaponarena_available_all_update, INITPRIO_FINDTARGET);
+ }
+ else if (s == "devall_available")
+ {
+ g_weaponarena = 1;
+ g_weaponarena_list = "Dev All Available Weapons";
+
+ // this needs to run after weaponsInMapAll is initialized
+ InitializeEntity(NULL, weaponarena_available_devall_update, INITPRIO_FINDTARGET);
+ }
+ else if (s == "most_available")
+ {
+ g_weaponarena = 1;
+ g_weaponarena_list = "Most Available Weapons";
+
+ // this needs to run after weaponsInMapAll is initialized
+ InitializeEntity(NULL, weaponarena_available_most_update, INITPRIO_FINDTARGET);
}
else if (s == "none")
{
start_ammo_plasma = cvar("g_start_ammo_plasma");
start_ammo_fuel = cvar("g_start_ammo_fuel");
random_start_weapons_count = cvar("g_random_start_weapons_count");
- SetResource(random_start_ammo, RES_SHELLS, cvar(
- "g_random_start_shells"));
- SetResource(random_start_ammo, RES_BULLETS, cvar(
- "g_random_start_bullets"));
- SetResource(random_start_ammo, RES_ROCKETS,
- cvar("g_random_start_rockets"));
- SetResource(random_start_ammo, RES_CELLS, cvar(
- "g_random_start_cells"));
- SetResource(random_start_ammo, RES_PLASMA, cvar(
- "g_random_start_plasma"));
+ SetResource(random_start_ammo, RES_SHELLS, cvar("g_random_start_shells"));
+ SetResource(random_start_ammo, RES_BULLETS, cvar("g_random_start_bullets"));
+ SetResource(random_start_ammo, RES_ROCKETS,cvar("g_random_start_rockets"));
+ SetResource(random_start_ammo, RES_CELLS, cvar("g_random_start_cells"));
+ SetResource(random_start_ammo, RES_PLASMA, cvar("g_random_start_plasma"));
}
- if (warmup_stage)
+ warmup_start_ammo_shells = start_ammo_shells;
+ warmup_start_ammo_nails = start_ammo_nails;
+ warmup_start_ammo_rockets = start_ammo_rockets;
+ warmup_start_ammo_cells = start_ammo_cells;
+ warmup_start_ammo_plasma = start_ammo_plasma;
+ warmup_start_ammo_fuel = start_ammo_fuel;
+ warmup_start_health = start_health;
+ warmup_start_armorvalue = start_armorvalue;
+ warmup_start_weapons = start_weapons;
+ warmup_start_weapons_default = start_weapons_default;
+ warmup_start_weapons_defaultmask = start_weapons_defaultmask;
+
+ if (!g_weaponarena)
{
- warmup_start_ammo_shells = start_ammo_shells;
- warmup_start_ammo_nails = start_ammo_nails;
- warmup_start_ammo_rockets = start_ammo_rockets;
- warmup_start_ammo_cells = start_ammo_cells;
- warmup_start_ammo_plasma = start_ammo_plasma;
- warmup_start_ammo_fuel = start_ammo_fuel;
- warmup_start_health = start_health;
- warmup_start_armorvalue = start_armorvalue;
- warmup_start_weapons = start_weapons;
- warmup_start_weapons_default = start_weapons_default;
- warmup_start_weapons_defaultmask = start_weapons_defaultmask;
-
- if (!g_weaponarena && !g_ca && !g_freezetag)
- {
- warmup_start_ammo_shells = cvar("g_warmup_start_ammo_shells");
- warmup_start_ammo_nails = cvar("g_warmup_start_ammo_nails");
- warmup_start_ammo_rockets = cvar("g_warmup_start_ammo_rockets");
- warmup_start_ammo_cells = cvar("g_warmup_start_ammo_cells");
- warmup_start_ammo_plasma = cvar("g_warmup_start_ammo_plasma");
- warmup_start_ammo_fuel = cvar("g_warmup_start_ammo_fuel");
- warmup_start_health = cvar("g_warmup_start_health");
- warmup_start_armorvalue = cvar("g_warmup_start_armor");
- warmup_start_weapons = '0 0 0';
- warmup_start_weapons_default = '0 0 0';
- warmup_start_weapons_defaultmask = '0 0 0';
- FOREACH(Weapons, it != WEP_Null, {
- int w = want_weapon(it, g_warmup_allguns);
- WepSet s = (it.m_wepset);
- if(w & 1)
- warmup_start_weapons |= s;
- if(w & 2)
- warmup_start_weapons_default |= s;
- if(w & 4)
- warmup_start_weapons_defaultmask |= s;
- });
- }
+ warmup_start_ammo_shells = cvar("g_warmup_start_ammo_shells");
+ warmup_start_ammo_nails = cvar("g_warmup_start_ammo_nails");
+ warmup_start_ammo_rockets = cvar("g_warmup_start_ammo_rockets");
+ warmup_start_ammo_cells = cvar("g_warmup_start_ammo_cells");
+ warmup_start_ammo_plasma = cvar("g_warmup_start_ammo_plasma");
+ warmup_start_ammo_fuel = cvar("g_warmup_start_ammo_fuel");
+ warmup_start_health = cvar("g_warmup_start_health");
+ warmup_start_armorvalue = cvar("g_warmup_start_armor");
+ warmup_start_weapons = '0 0 0';
+ warmup_start_weapons_default = '0 0 0';
+ warmup_start_weapons_defaultmask = '0 0 0';
+ FOREACH(Weapons, it != WEP_Null, {
+ int w = want_weapon(it, g_warmup_allguns);
+ WepSet s = it.m_wepset;
+ if(w & 1)
+ warmup_start_weapons |= s;
+ if(w & 2)
+ warmup_start_weapons_default |= s;
+ if(w & 4)
+ warmup_start_weapons_defaultmask |= s;
+ });
}
if (g_jetpack)
start_ammo_cells = max(0, start_ammo_cells);
start_ammo_plasma = max(0, start_ammo_plasma);
start_ammo_fuel = max(0, start_ammo_fuel);
- SetResource(random_start_ammo, RES_SHELLS, max(0,
- GetResource(random_start_ammo, RES_SHELLS)));
- SetResource(random_start_ammo, RES_BULLETS, max(0,
- GetResource(random_start_ammo, RES_BULLETS)));
- SetResource(random_start_ammo, RES_ROCKETS, max(0,
- GetResource(random_start_ammo, RES_ROCKETS)));
- SetResource(random_start_ammo, RES_CELLS, max(0,
- GetResource(random_start_ammo, RES_CELLS)));
- SetResource(random_start_ammo, RES_PLASMA, max(0,
- GetResource(random_start_ammo, RES_PLASMA)));
+ SetResource(random_start_ammo, RES_SHELLS,
+ max(0, GetResource(random_start_ammo, RES_SHELLS)));
+ SetResource(random_start_ammo, RES_BULLETS,
+ max(0, GetResource(random_start_ammo, RES_BULLETS)));
+ SetResource(random_start_ammo, RES_ROCKETS,
+ max(0, GetResource(random_start_ammo, RES_ROCKETS)));
+ SetResource(random_start_ammo, RES_CELLS,
+ max(0, GetResource(random_start_ammo, RES_CELLS)));
+ SetResource(random_start_ammo, RES_PLASMA,
+ max(0, GetResource(random_start_ammo, RES_PLASMA)));
warmup_start_ammo_shells = max(0, warmup_start_ammo_shells);
warmup_start_ammo_nails = max(0, warmup_start_ammo_nails);
float globhandle, i, n;
string f;
- if(substring(m, -9,5) == "_lod1")
+ if(substring(m, -9, 5) == "_lod1")
return;
- if(substring(m, -9,5) == "_lod2")
+ if(substring(m, -9, 5) == "_lod2")
return;
precache_model(m);
f = strcat(substring(m, 0, -5), "_lod1", substring(m, -4, -1));
MUTATOR_HOOKABLE(GetPressedKeys, EV_GetPressedKeys);
/** is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client */
+// NOTE: requesting cvar values (get_cvars_f 0) is deprecated
#define EV_GetCvars(i, o) \
/**/ i(float, get_cvars_f) \
/**/ i(string, get_cvars_s) \
return out;
}
-void weapon_defaultspawnfunc(entity this, Weapon e)
+void weapon_defaultspawnfunc(entity this, Weapon wpn)
{
- Weapon wpn = e;
- e = wpn = wpn.m_spawnfunc_hookreplace(wpn, this);
+ wpn = wpn.m_spawnfunc_hookreplace(wpn, this);
this.classname = wpn.m_canonical_spawnfunc;
if (!Item_IsLoot(this) && !this.m_isreplaced)
{
- if (e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
+ if (wpn.spawnflags & WEP_FLAG_MUTATORBLOCKED)
{
LOG_WARNF("Attempted to spawn a mutator-blocked weapon rejected: prvm_edict server %i", this);
startitem_failed = true;
return;
}
- string s = W_Apply_Weaponreplace(e.netname);
- MUTATOR_CALLHOOK(SetWeaponreplace, this, e, s);
+ string s = W_Apply_Weaponreplace(wpn.netname);
+ MUTATOR_CALLHOOK(SetWeaponreplace, this, wpn, s);
s = M_ARGV(2, string);
if (s == "")
{
}
}
+ if(!Item_IsLoot(this))
+ weaponsInMapAll |= WepSet_FromWeapon(wpn);
+
if (!Item_IsDefinitionAllowed(wpn.m_pickup))
{
delete(this);
Weapon wep = this.owner.(weaponentity).m_weapon;
if (wep) this.glowmod = weaponentity_glowmod(wep, this.owner, this.owner.clientcolors, this.owner.(weaponentity));
this.colormap = this.owner.colormap;
+ this.skin = w_ent.skin;
CSQCMODEL_AUTOUPDATE(this);
}
// if you want to reset your client to defaults, it's probably a better idea to delete (parts of) config.cfg and restart
-// changes a cvar and reports it to the server (for the menu to notify the
-// server about changes)
+// changes a cvar and reports it to the server (for the client to notify the server about changes)
+// DEPRECATED, cvars can be set in the client code to be sent automatically (using REPLICATE)
alias setreport "set \"$1\" \"$2\" ; sendcvar \"$1\""
seta cl_firststart "" "how many times the client has been run"
v_gamma 1
viewsize 100
bgmvolume 1
-volume 0.5
// fullscreen 1024x768x32bit
vid_bitsperpixel 32
vid_fullscreen 1
r_glsl_offsetmapping_reliefmapping 0
r_glsl_offsetmapping_scale 0.02
-scr_conalpha 1
-scr_conbrightness 0.2
scr_screenshot_jpeg 1
scr_screenshot_jpeg_quality 0.9
alias _gl_flashblend_update_11 "gl_flashblend 0"
alias gl_flashblend_update "_gl_flashblend_update_$r_shadow_realtime_dlight$r_showsurfaces"
-set cl_handicap 1 "multiplies damage received and divides damage dealt NOTE: reconnect or use 'sendcvar cl_handicap' to update the choice."
+set cl_handicap 1 "multiplies damage received and divides damage dealt"
-seta cl_clippedspectating 1 "movement collision for spectators so that you can't pass through walls and such. (client setting) NOTE: reconnect or use sendcvar command to update the choice."
+seta cl_clippedspectating 1 "movement collision for spectators so that you can't pass through walls and such"
seta cl_autoscreenshot 1 "Take a screenshot upon the end of a match... 0 = Disable completely, 1 = Allow sv_autoscreenshot to take a screenshot when requested, 2 = Always take an autoscreenshot anyway."
scr_conalpha3factor 1
scr_conalphafactor 0.8
scr_conbrightness 0.35
-scr_conforcewhiledisconnected 1
scr_conscroll2_x 0.11
scr_conscroll2_y 0.2
scr_conscroll3_x 0
set g_pickup_respawntime_scaling_reciprocal 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `reciprocal` (with `offset` and `linear` set to 0) can be used to achieve a constant number of items spawned *per player*"
set g_pickup_respawntime_scaling_offset 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `offset` offsets the curve left or right - the results are not intuitive and I recommend plotting the respawn time and the number of items per player to see what's happening"
set g_pickup_respawntime_scaling_linear 1 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `linear` can be used to simply scale the respawn time linearly"
-set g_weaponarena "0" "put in a list of weapons to enable a weapon arena mode, or try \"all\" or \"most\""
+set g_weaponarena "0" "put in a list of weapons to enable a weapon arena mode, or try \"all\", \"most\", \"all_available\" or \"most_available\" (available only gives the weapon if the map normally has it as a pickup item)"
set g_weaponarena_random "0" "if set to a number, only that weapon count is given on every spawn (randomly)"
set g_weaponarena_random_with_blaster "1" "additionally, always provide the blaster in random weapon arena games"
set g_spawnpoints_auto_move_out_of_solid 0 "if set to 1 you will see a warning if a spawn point was placed inside a solid"