// use default physics
set sv_friction_on_land 0
+set sv_friction_slick 0.5
set sv_player_viewoffset "0 0 35" "view offset of the player model"
set sv_player_mins "-16 -16 -24" "playermodel mins"
set g_grappling_hook 0 "let players spawn with the grappling hook which allows them to pull themselves up"
set g_spawn_alloweffects 1 "allow clients to enable spawn point and event effects such as particles and sounds, see cl_spawn_ cvars for more info"
- set g_spawn_furthest 0.5 "this amount of the spawns shall be far away from any players"
+ set g_spawn_furthest 1.0 "this amount of the spawns shall be far away from any players"
set g_spawn_useallspawns 0 "use all spawns, e.g. also team spawns in non-teamplay, and all spawns, even enemy spawns, in teamplay"
// respawn delay
set g_respawn_delay_small 2 "small game number of seconds you have to wait before you can respawn again"
../../csprogs.dat
../common/util-pre.qh
- sys-pre.qh
../dpdefs/csprogsdefs.qh
- sys-post.qh
announcer.qc
bgmscript.qc
../common/nades.qc
../common/net_notice.qc
../common/notifications.qc
+../common/physics.qc
../common/playerstats.qc
../common/test.qc
../common/urllib.qc
../csqcmodellib/interpolate.qc
../server/movelib.qc
+../server/t_halflife.qc
../server/t_items.qc
+../server/t_jumppads.qc
+../server/t_plats.qc
+
+../server/mutators/mutator_multijump.qc
+
../server/vehicles/bumblebee.qc
../warpzonelib/anglestransform.qc
//#define CSQCMODEL_SUPPORT_GETTAGINFO_BEFORE_DRAW
// server decides crouching, this lags, but so be it
-#define CSQCMODEL_SERVERSIDE_CROUCH
+//#define CSQCMODEL_SERVERSIDE_CROUCH
// a hack for Xonotic
#ifdef CSQC
#define CSQCPLAYER_HOOK_POSTCAMERASETUP
// force updates of player entities that often even if unchanged
- const float CSQCPLAYER_FORCE_UPDATES = 0.25;
+ #define CSQCPLAYER_FORCE_UPDATES 0.25
// mod must define:
//vector PL_MIN = ...;
#ifndef CSPROGSDEFS_H
#define CSPROGSDEFS_H
+
+ #pragma noref 1
+
/*
==============================================================================
float( float b, ... ) max = #95;
float(float minimum, float val, float maximum) bound = #96;
float(float f, float f) pow = #97;
+entity(entity start, .entity fld, entity match) findentity = #98;
entity(entity start, .float fld, float match) findfloat = #98;
float(string s) checkextension = #99;
// FrikaC and Telejano range #100-#199
float(string s) isfunction = #607;
void(entity e, string s) parseentitydata = #608;
+ //DP_COVERAGE
+ //idea: divVerent
+ //darkplaces implementation: divVerent
+ //function definitions:
+ void coverage() = #642; // Reports a coverage event. The engine counts for each of the calls to this builtin whether it has been called.
+
// assorted builtins
//const int STAT_MOVEVARS_TICRATE = 240;
//const int STAT_MOVEVARS_TIMESCALE = 241;
vector gettaginfo_right;
vector gettaginfo_up;
float checkpvs(vector viewpos, entity viewee) = #240;
+
+ #pragma noref 0
+
#endif
#include "weapons/weaponsystem.qh"
#include "../common/net_notice.qh"
+#include "../common/physics.qh"
#include "../common/monsters/sv_monsters.qh"
float n, i;
string s;
- // NOTE: we do NOT check crypto_keyfp here, an unsigned ID is fine too for this
+ // NOTE: we do NOT check crypto_idfp_signed here, an unsigned ID is fine too for this
if (!p.crypto_idfp)
return 0;
void GetPressedKeys(void) {
MUTATOR_CALLHOOK(GetPressedKeys);
- if (self.movement.x > 0) // get if movement keys are pressed
- { // forward key pressed
- self.pressedkeys |= KEY_FORWARD;
- self.pressedkeys &= ~KEY_BACKWARD;
- }
- else if (self.movement.x < 0)
- { // backward key pressed
- self.pressedkeys |= KEY_BACKWARD;
- self.pressedkeys &= ~KEY_FORWARD;
- }
- else
- { // no x input
- self.pressedkeys &= ~KEY_FORWARD;
- self.pressedkeys &= ~KEY_BACKWARD;
- }
-
- if (self.movement.y > 0)
- { // right key pressed
- self.pressedkeys |= KEY_RIGHT;
- self.pressedkeys &= ~KEY_LEFT;
- }
- else if (self.movement.y < 0)
- { // left key pressed
- self.pressedkeys |= KEY_LEFT;
- self.pressedkeys &= ~KEY_RIGHT;
- }
- else
- { // no y input
- self.pressedkeys &= ~KEY_RIGHT;
- self.pressedkeys &= ~KEY_LEFT;
- }
-
- if (self.BUTTON_JUMP) // get if jump and crouch keys are pressed
- self.pressedkeys |= KEY_JUMP;
- else
- self.pressedkeys &= ~KEY_JUMP;
- if (self.BUTTON_CROUCH)
- self.pressedkeys |= KEY_CROUCH;
- else
- self.pressedkeys &= ~KEY_CROUCH;
-
- if (self.BUTTON_ATCK)
- self.pressedkeys |= KEY_ATCK;
- else
- self.pressedkeys &= ~KEY_ATCK;
- if (self.BUTTON_ATCK2)
- self.pressedkeys |= KEY_ATCK2;
- else
- self.pressedkeys &= ~KEY_ATCK2;
+ #define X(var,bit,flag) (flag ? var |= bit : var &= ~bit)
+ X(self.pressedkeys, KEY_FORWARD, PHYS_INPUT_MOVEVALUES(self)_x > 0);
+ X(self.pressedkeys, KEY_BACKWARD, PHYS_INPUT_MOVEVALUES(self)_x < 0);
+ X(self.pressedkeys, KEY_RIGHT, PHYS_INPUT_MOVEVALUES(self)_y > 0);
+ X(self.pressedkeys, KEY_LEFT, PHYS_INPUT_MOVEVALUES(self)_y < 0);
+
+ X(self.pressedkeys, KEY_JUMP, PHYS_INPUT_BUTTON_JUMP(self));
+ X(self.pressedkeys, KEY_CROUCH, PHYS_INPUT_BUTTON_CROUCH(self));
+ X(self.pressedkeys, KEY_ATCK, PHYS_INPUT_BUTTON_ATCK(self));
+ X(self.pressedkeys, KEY_ATCK2, PHYS_INPUT_BUTTON_ATCK2(self));
+ #undef X
}
/*
#define PROJECTILE_TOUCH if(WarpZone_Projectile_Touch()) return
-#define move_out_of_solid(e) WarpZoneLib_MoveOutOfSolid(e)
-
const string STR_PLAYER = "player";
const string STR_SPECTATOR = "spectator";
const string STR_OBSERVER = "observer";
float warmup_start_armorvalue;
float g_weapon_stay;
- float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still needs done?
- {
- int i = weaponinfo.weapon;
- int d = 0;
-
- if (!i)
- return 0;
-
- if (g_lms || g_ca || allguns)
- {
- if(weaponinfo.spawnflags & WEP_FLAG_NORMAL)
- d = true;
- else
- d = false;
- }
- else if (g_cts)
- d = (i == WEP_SHOTGUN);
- else if (g_nexball)
- d = 0; // weapon is set a few lines later
- else
- d = !(!weaponinfo.weaponstart);
-
- if(g_grappling_hook) // if possible, redirect off-hand hook to on-hand hook
- d |= (i == WEP_HOOK);
- if(!g_cts && (weaponinfo.spawnflags & WEP_FLAG_MUTATORBLOCKED)) // never default mutator blocked guns
- d = 0;
-
- float t = weaponinfo.weaponstartoverride;
-
- //print(strcat("want_weapon: ", weaponinfo.netname, " - d: ", ftos(d), ", t: ", ftos(t), ". \n"));
-
- // bit order in t:
- // 1: want or not
- // 2: is default?
- // 4: is set by default?
- if(t < 0)
- t = 4 | (3 * d);
- else
- t |= (2 * d);
-
- return t;
- }
-
- void readplayerstartcvars()
- {
- entity e;
- float i, j, t;
- string s;
-
- // initialize starting values for players
- start_weapons = '0 0 0';
- start_weapons_default = '0 0 0';
- start_weapons_defaultmask = '0 0 0';
- start_items = 0;
- start_ammo_shells = 0;
- start_ammo_nails = 0;
- start_ammo_rockets = 0;
- start_ammo_cells = 0;
- start_ammo_plasma = 0;
- start_health = cvar("g_balance_health_start");
- start_armorvalue = cvar("g_balance_armor_start");
-
- g_weaponarena = 0;
- g_weaponarena_weapons = '0 0 0';
-
- s = cvar_string("g_weaponarena");
- if (s == "0" || s == "")
- {
- if(g_ca)
- s = "most";
- }
-
- if (s == "0" || s == "")
- {
- // no arena
- }
- else if (s == "off")
- {
- // forcibly turn off weaponarena
- }
- else if (s == "all" || s == "1")
- {
- g_weaponarena = 1;
- g_weaponarena_list = "All Weapons";
- for (j = WEP_FIRST; j <= WEP_LAST; ++j)
- {
- e = get_weaponinfo(j);
- if (!(e.spawnflags & WEP_FLAG_MUTATORBLOCKED))
- g_weaponarena_weapons |= WepSet_FromWeapon(j);
- }
- }
- else if (s == "most")
- {
- g_weaponarena = 1;
- g_weaponarena_list = "Most Weapons";
- for (j = WEP_FIRST; j <= WEP_LAST; ++j)
- {
- e = get_weaponinfo(j);
- if (!(e.spawnflags & WEP_FLAG_MUTATORBLOCKED))
- if (e.spawnflags & WEP_FLAG_NORMAL)
- g_weaponarena_weapons |= WepSet_FromWeapon(j);
- }
- }
- else if (s == "none")
- {
- g_weaponarena = 1;
- g_weaponarena_list = "No Weapons";
- }
- else
- {
- g_weaponarena = 1;
- t = tokenize_console(s);
- g_weaponarena_list = "";
- for (i = 0; i < t; ++i)
- {
- s = argv(i);
- for (j = WEP_FIRST; j <= WEP_LAST; ++j)
- {
- e = get_weaponinfo(j);
- if (e.netname == s)
- {
- g_weaponarena_weapons |= WepSet_FromWeapon(j);
- g_weaponarena_list = strcat(g_weaponarena_list, e.message, " & ");
- break;
- }
- }
- if (j > WEP_LAST)
- {
- print("The weapon mutator list contains an unknown weapon ", s, ". Skipped.\n");
- }
- }
- g_weaponarena_list = strzone(substring(g_weaponarena_list, 0, strlen(g_weaponarena_list) - 3));
- }
-
- if(g_weaponarena)
- g_weaponarena_random = cvar("g_weaponarena_random");
- else
- g_weaponarena_random = 0;
- g_weaponarena_random_with_blaster = cvar("g_weaponarena_random_with_blaster");
-
- if (g_weaponarena)
- {
- g_weapon_stay = 0; // incompatible
- start_weapons = g_weaponarena_weapons;
- start_items |= IT_UNLIMITED_AMMO;
- }
- else
- {
- for (i = WEP_FIRST; i <= WEP_LAST; ++i)
- {
- e = get_weaponinfo(i);
- int w = want_weapon(e, false);
- if(w & 1)
- start_weapons |= WepSet_FromWeapon(i);
- if(w & 2)
- start_weapons_default |= WepSet_FromWeapon(i);
- if(w & 4)
- start_weapons_defaultmask |= WepSet_FromWeapon(i);
- }
- }
-
- if(!cvar("g_use_ammunition"))
- start_items |= IT_UNLIMITED_AMMO;
-
- if(start_items & IT_UNLIMITED_WEAPON_AMMO)
- {
- start_ammo_shells = 999;
- start_ammo_nails = 999;
- start_ammo_rockets = 999;
- start_ammo_cells = 999;
- start_ammo_plasma = 999;
- start_ammo_fuel = 999;
- }
- else
- {
- start_ammo_shells = cvar("g_start_ammo_shells");
- start_ammo_nails = cvar("g_start_ammo_nails");
- start_ammo_rockets = cvar("g_start_ammo_rockets");
- start_ammo_cells = cvar("g_start_ammo_cells");
- start_ammo_plasma = cvar("g_start_ammo_plasma");
- start_ammo_fuel = cvar("g_start_ammo_fuel");
- }
-
- 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 && !g_ca)
- {
- 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';
- for (i = WEP_FIRST; i <= WEP_LAST; ++i)
- {
- e = get_weaponinfo(i);
- int w = want_weapon(e, g_warmup_allguns);
- if(w & 1)
- warmup_start_weapons |= WepSet_FromWeapon(i);
- if(w & 2)
- warmup_start_weapons_default |= WepSet_FromWeapon(i);
- if(w & 4)
- warmup_start_weapons_defaultmask |= WepSet_FromWeapon(i);
- }
- }
- }
-
- if (g_jetpack)
- start_items |= IT_JETPACK;
-
- MUTATOR_CALLHOOK(SetStartItems);
-
- if ((start_items & IT_JETPACK) || (g_grappling_hook && (start_weapons & WEPSET_HOOK)))
- {
- start_items |= IT_FUEL_REGEN;
- start_ammo_fuel = max(start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
- warmup_start_ammo_fuel = max(warmup_start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
- }
-
- WepSet precache_weapons = start_weapons;
- if (g_warmup_allguns != 1)
- precache_weapons |= warmup_start_weapons;
- for (i = WEP_FIRST; i <= WEP_LAST; ++i)
- {
- e = get_weaponinfo(i);
- if(precache_weapons & WepSet_FromWeapon(i))
- WEP_ACTION(i, WR_INIT);
- }
-
- start_ammo_shells = max(0, start_ammo_shells);
- start_ammo_nails = max(0, start_ammo_nails);
- start_ammo_rockets = max(0, start_ammo_rockets);
- start_ammo_cells = max(0, start_ammo_cells);
- start_ammo_plasma = max(0, start_ammo_plasma);
- start_ammo_fuel = max(0, start_ammo_fuel);
-
- warmup_start_ammo_shells = max(0, warmup_start_ammo_shells);
- warmup_start_ammo_nails = max(0, warmup_start_ammo_nails);
- warmup_start_ammo_rockets = max(0, warmup_start_ammo_rockets);
- warmup_start_ammo_cells = max(0, warmup_start_ammo_cells);
- warmup_start_ammo_plasma = max(0, warmup_start_ammo_plasma);
- warmup_start_ammo_fuel = max(0, warmup_start_ammo_fuel);
- }
+ float want_weapon(entity weaponinfo, float allguns); // WEAPONTODO: what still needs done?
+ void readplayerstartcvars();
float g_bugrigs;
float g_bugrigs_planar_movement;
if (!warmup_stage)
game_starttime = time + cvar("g_start_delay");
- for(int i = WEP_FIRST; i <= WEP_LAST; ++i)
- WEP_ACTION(i, WR_INIT);
+ for(int i = WEP_FIRST; i <= WEP_LAST; ++i)
+ WEP_ACTION(i, WR_INIT);
readplayerstartcvars();
}
#include "../csqcmodellib/sv_model.qh"
#endif
+#ifdef SVQC
+
.float dmgtime2;
void generic_plat_blocked()
{
else // Z
self.movedir = '0 1 0';
- if (self.angles.y ==0) self.angles.y = 90;
+ if (self.angles.y ==0) self.angles_y = 90;
self.movedir = self.movedir * self.angles.y;
self.angles = '0 0 0';
InitializeEntity(self, func_vectormamamam_findtarget, INITPRIO_FINDTARGET);
}
+#endif
+
void conveyor_think()
{
+#ifdef CSQC
+ float dt = time - self.move_time;
+ self.move_time = time;
+ if(dt <= 0) { return; }
+#endif
entity e;
// set myself as current conveyor where possible
{
for(e = findradius((self.absmin + self.absmax) * 0.5, vlen(self.absmax - self.absmin) * 0.5 + 1); e; e = e.chain)
if(!e.conveyor.state)
+#ifdef SVQC
if(isPushable(e))
+#elif defined(CSQC)
+ if(e.isplayermodel)
+#endif
{
vector emin = e.absmin;
vector emax = e.absmax;
for(e = world; (e = findentity(e, conveyor, self)); )
{
+#ifdef SVQC
if(IS_CLIENT(e)) // doing it via velocity has quite some advantages
continue; // done in SV_PlayerPhysics
+#elif defined(CSQC)
+ if(e.isplayermodel)
+ continue;
+#endif
- setorigin(e, e.origin + self.movedir * sys_frametime);
+ setorigin(e, e.origin + self.movedir * PHYS_INPUT_FRAMETIME);
move_out_of_solid(e);
+#ifdef SVQC
UpdateCSQCProjectile(e);
+#endif
/*
// stupid conveyor code
tracebox(e.origin, e.mins, e.maxs, e.origin + self.movedir * sys_frametime, MOVE_NORMAL, e);
}
}
+#ifdef SVQC
self.nextthink = time;
+#endif
}
+#ifdef SVQC
+
void conveyor_use()
{
self.state = !self.state;
+
+ self.SendFlags |= 2;
}
void conveyor_reset()
{
self.state = (self.spawnflags & 1);
+
+ self.SendFlags |= 2;
+}
+
+float conveyor_send(entity to, float sf)
+{
+ WriteByte(MSG_ENTITY, ENT_CLIENT_CONVEYOR);
+ WriteByte(MSG_ENTITY, sf);
+
+ if(sf & 1)
+ {
+ WriteByte(MSG_ENTITY, self.warpzone_isboxy);
+ WriteCoord(MSG_ENTITY, self.origin_x);
+ WriteCoord(MSG_ENTITY, self.origin_y);
+ WriteCoord(MSG_ENTITY, self.origin_z);
+
+ WriteCoord(MSG_ENTITY, self.mins_x);
+ WriteCoord(MSG_ENTITY, self.mins_y);
+ WriteCoord(MSG_ENTITY, self.mins_z);
+ WriteCoord(MSG_ENTITY, self.maxs_x);
+ WriteCoord(MSG_ENTITY, self.maxs_y);
+ WriteCoord(MSG_ENTITY, self.maxs_z);
+
+ WriteCoord(MSG_ENTITY, self.movedir_x);
+ WriteCoord(MSG_ENTITY, self.movedir_y);
+ WriteCoord(MSG_ENTITY, self.movedir_z);
+
+ WriteByte(MSG_ENTITY, self.speed);
+ WriteByte(MSG_ENTITY, self.state);
+
+ WriteString(MSG_ENTITY, self.targetname);
+ WriteString(MSG_ENTITY, self.target);
+ }
+
+ if(sf & 2)
+ WriteByte(MSG_ENTITY, self.state);
+
+ return true;
}
void conveyor_init()
}
else
self.state = 1;
+
+ Net_LinkEntity(self, 0, false, conveyor_send);
+
+ self.SendFlags |= 1;
}
void spawnfunc_trigger_conveyor()
self.movetype = MOVETYPE_NONE;
conveyor_init();
}
+
+#elif defined(CSQC)
+
+void conveyor_init()
+{
+ self.draw = conveyor_think;
+ self.drawmask = MASK_NORMAL;
+
+ self.movetype = MOVETYPE_NONE;
+ self.model = "";
+ self.solid = SOLID_TRIGGER;
+ self.move_origin = self.origin;
+ self.move_time = time;
+}
+
+void ent_conveyor()
+{
+ float sf = ReadByte();
+
+ if(sf & 1)
+ {
+ self.warpzone_isboxy = ReadByte();
+ self.origin_x = ReadCoord();
+ self.origin_y = ReadCoord();
+ self.origin_z = ReadCoord();
+ setorigin(self, self.origin);
+
+ self.mins_x = ReadCoord();
+ self.mins_y = ReadCoord();
+ self.mins_z = ReadCoord();
+ self.maxs_x = ReadCoord();
+ self.maxs_y = ReadCoord();
+ self.maxs_z = ReadCoord();
+ setsize(self, self.mins, self.maxs);
+
+ self.movedir_x = ReadCoord();
+ self.movedir_y = ReadCoord();
+ self.movedir_z = ReadCoord();
+
+ self.speed = ReadByte();
+ self.state = ReadByte();
+
+ self.targetname = strzone(ReadString());
+ self.target = strzone(ReadString());
+
+ conveyor_init();
+ }
+
+ if(sf & 2)
+ self.state = ReadByte();
+}
+
+#endif