set g_balance_electro_primary_lifetime 5
set g_balance_electro_primary_midaircombo_explode 1
set g_balance_electro_primary_midaircombo_interval 0.1
-set g_balance_electro_primary_midaircombo_radius 50
+set g_balance_electro_primary_midaircombo_radius 150
set g_balance_electro_primary_radius 100
set g_balance_electro_primary_refire 0.6
set g_balance_electro_primary_speed 2500
set g_balance_electro_primary_lifetime 5
set g_balance_electro_primary_midaircombo_explode 1
set g_balance_electro_primary_midaircombo_interval 0.1
-set g_balance_electro_primary_midaircombo_radius 50
+set g_balance_electro_primary_midaircombo_radius 150
set g_balance_electro_primary_radius 100
set g_balance_electro_primary_refire 0.6
set g_balance_electro_primary_speed 2500
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 1.0 "this amount of the spawns shall be far away from any players"
+set g_spawn_furthest 0.5 "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"
-Werror -fno-bail-on-werror -Wall \
-fftepp -fftepp-predefs -Wcpp -futf8 \
$(QCCFLAGS_WTFS) \
+ $(QCCFLAGS_FEATURES) \
$(QCCFLAGS_EXTRA) $(QCCFLAGS_WATERMARK)
+QCCFLAGS_FEATURES ?= \
+ -DVEHICLES_ENABLED=1 \
+ -DVEHICLES_USE_ODE=0
+
# xonotic build system overrides this by command line argument to turn off the update-cvarcount step
XON_BUILDSYSTEM =
--- /dev/null
+#ifndef CLIENT___H
+#define CLIENT___H
+
+#include "autocvars.qh"
+#include "defs.qh"
+#include "main.qh"
+#include "miscfunctions.qh"
+
+#include "../dpdefs/csprogsdefs.qh"
+
+#endif
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "../common/stats.qh"
- #include "../common/util.qh"
- #include "autocvars.qh"
- #include "../common/notifications.qh"
- #include "main.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "announcer.qh"
+#include "_all.qh"
+
+#include "../common/notifications.qh"
+#include "../common/stats.qh"
+#include "../common/util.qh"
bool announcer_1min;
bool announcer_5min;
--- /dev/null
+#ifndef ANNOUNCER_H
+#define ANNOUNCER_H
+
+void Announcer();
+
+#endif
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "defs.qh"
- #include "../common/util.qh"
- #include "autocvars.qh"
- #include "bgmscript.qh"
- #include "main.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "bgmscript.qh"
+#include "_all.qh"
+
+#include "../common/util.qh"
#define CONSTANT_SPEED_DECAY
float bgmscriptbufsize;
float bgmscriptbufloaded;
-.float bgmscriptline;
-.float bgmscriptline0;
-.float bgmscriptvolume;
-.float bgmscripttime;
-.float bgmscriptstate;
-.float bgmscriptstatetime;
+class(BGMScript) .float bgmscriptline;
+class(BGMScript) .float bgmscriptline0;
+class(BGMScript) .float bgmscriptvolume;
+class(BGMScript) .float bgmscripttime;
+class(BGMScript) .float bgmscriptstate;
+class(BGMScript) .float bgmscriptstatetime;
float GetAttackDecaySustainAmplitude(float a, float d, float s, float t)
{
}
}
-float BGMScript(entity e)
+float doBGMScript(entity e)
{
float amp, vel;
#ifndef BGMSCRIPT_H
#define BGMSCRIPT_H
-.string bgmscript;
-.float bgmscriptattack;
-.float bgmscriptdecay;
-.float bgmscriptsustain;
-.float bgmscriptrelease;
+entityclass(BGMScript);
+class(BGMScript) .string bgmscript;
+class(BGMScript) .float bgmscriptattack;
+class(BGMScript) .float bgmscriptdecay;
+class(BGMScript) .float bgmscriptsustain;
+class(BGMScript) .float bgmscriptrelease;
-.float just_toggled;
+class(BGMScript) .float just_toggled;
void BGMScript_InitEntity(entity e);
-float BGMScript(entity e);
+float doBGMScript(entity e);
#endif
-#if defined(CSQC)
- #include "movetypes.qh"
- #include "prandom.qh"
- #include "rubble.qh"
+#include "casings.qh"
+#include "_all.qh"
- .float cnt;
- .float alpha;
- .int state;
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "movetypes.qh"
+#include "prandom.qh"
+#include "rubble.qh"
+#include "../common/util.qh"
-.bool silent;
+.float cnt;
+.float alpha;
+.int state;
+
+entityclass(Casing);
+class(Casing) .bool silent;
void Casing_Delete()
{
--- /dev/null
+#ifndef CASINGS_H
+#define CASINGS_H
+
+void Casings_Precache();
+
+void Ent_Casing(float isNew);
+
+#endif
// Last updated: December 28th, 2011
// ==============================================
+#include "../../common/command/command.qh"
+#include "cl_cmd.qh"
+
+#include "../autocvars.qh"
+#include "../defs.qh"
+#include "../hud.qh"
+#include "../hud_config.qh"
+#include "../main.qh"
+#include "../mapvoting.qh"
+#include "../miscfunctions.qh"
+
+#include "../../common/mapinfo.qh"
+
#include "../../common/command/generic.qh"
-#include "../../common/command/shared_defs.qh"
void DrawDebugModel()
{
--- /dev/null
+#include "../_all.qh"
+
+#include "../../common/command/commands.qc"
+
+#include "cl_cmd.qc"
--- /dev/null
+#ifndef CLIENT_COMMANDS_H
+#define CLIENT_COMMANDS_H
+
+#include "../../common/command/commands.qh"
+
+#include "cl_cmd.qh"
+
+#endif
+++ /dev/null
-// MenuQC redefines world, change define it here to be safe
-#define world world
-
-// Mask Constants (set .drawmask on entities; use R_AddEntities to add all entities based on mask)
-const int MASK_ENGINE = 1;
-const int MASK_ENGINEVIEWMODELS = 2;
-const int MASK_NORMAL = 4;
-
-// Renderflag Constants (used for CSQC entities)
-const int RF_VIEWMODEL = 1;
-const int RF_EXTERNALMODEL = 2;
-const int RF_DEPTHHACK = 4;
-const int RF_ADDITIVE = 8;
-const int RF_USEAXIS = 16;
-
-// Viewflag Constants (use with R_SetView)
-const int VF_MIN = 1; //(vector)
-const int VF_MIN_X = 2; //(float)
-const int VF_MIN_Y = 3; //(float)
-const int VF_SIZE = 4; //(vector) (viewport size)
-const int VF_SIZE_Y = 5; //(float)
-const int VF_SIZE_X = 6; //(float)
-const int VF_VIEWPORT = 7; //(vector, vector)
-const int VF_FOV = 8; //(vector)
-const int VF_FOVX = 9; //(float)
-const int VF_FOVY = 10; //(float)
-const int VF_ORIGIN = 11; //(vector)
-const int VF_ORIGIN_X = 12; //(float)
-const int VF_ORIGIN_Y = 13; //(float)
-const int VF_ORIGIN_Z = 14; //(float)
-const int VF_ANGLES = 15; //(vector)
-const int VF_ANGLES_X = 16; //(float)
-const int VF_ANGLES_Y = 17; //(float)
-const int VF_ANGLES_Z = 18; //(float)
-const int VF_DRAWWORLD = 19; //(float)
-const int VF_DRAWENGINEHUD = 20; //(float)
-const int VF_DRAWCROSSHAIR = 21; //(float)
-const int VF_PERSPECTIVE = 200; //(float)
-
-const int VF_CL_VIEWANGLES = 33; //(vector)
-const int VF_CL_VIEWANGLES_X = 34; //(float)
-const int VF_CL_VIEWANGLES_Y = 35; //(float)
-const int VF_CL_VIEWANGLES_Z = 36; //(float)
-
-// Quake-style Point Contents
-const int CONTENT_EMPTY = -1;
-const int CONTENT_SOLID = -2;
-const int CONTENT_WATER = -3;
-const int CONTENT_SLIME = -4;
-const int CONTENT_LAVA = -5;
-const int CONTENT_SKY = -6;
-
-// Vector / Hull Constants
-const vector VEC_1 = '1 1 1';
-const vector VEC_0 = '0 0 0';
-const vector VEC_M1 = '-1 -1 -1';
-
-const vector VEC_HULL_MIN = '-16 -16 -24';
-const vector VEC_HULL_MAX = '16 16 32';
-
-// Effect Constants
-const int EF_NODRAW = 16;
-const int EF_ADDITIVE = 32;
-const int EF_BLUE = 64;
-const int EF_RED = 128;
-const int EF_FULLBRIGHT = 512;
-const int EF_FLAME = 1024;
-const int EF_STARDUST = 2048;
-const int EF_NOSHADOW = 4096;
-const int EF_NODEPTHTEST = 8192;
-
-// Quake Player Flag Constants
-const int PFL_ONGROUND = 1;
-const int PFL_CROUCH = 2;
-const int PFL_DEAD = 4;
-const int PFL_GIBBED = 8;
-
-// Quake Temporary Entity Constants
-const int TE_SPIKE = 0;
-const int TE_SUPERSPIKE = 1;
-const int TE_GUNSHOT = 2;
-const int TE_EXPLOSION = 3;
-const int TE_TAREXPLOSION = 4;
-const int TE_LIGHTNING1 = 5;
-const int TE_LIGHTNING2 = 6;
-const int TE_WIZSPIKE = 7;
-const int TE_KNIGHTSPIKE = 8;
-const int TE_LIGHTNING3 = 9;
-const int TE_LAVASPLASH = 10;
-const int TE_TELEPORT = 11;
-const int TE_EXPLOSION2 = 12;
-// Darkplaces Additions
-const int TE_EXPLOSIONRGB = 53;
-const int TE_GUNSHOTQUAD = 57;
-const int TE_EXPLOSIONQUAD = 70;
-
-// Math Constants
-const int EXTRA_LOW = -99999999;
-const int EXTRA_HIGH = 99999999;
-
-// Frik File Constants
-const int FILE_READ = 0;
-const int FILE_APPEND = 1;
-const int FILE_WRITE = 2;
-
-// Button values used by input_buttons
-const int BUTTON_ATTACK = 1;
-const int BUTTON_JUMP = 2;
-const int BUTTON_3 = 4;
-const int BUTTON_4 = 8;
-const int BUTTON_5 = 16;
-const int BUTTON_6 = 32;
-const int BUTTON7 = 64;
-const int BUTTON8 = 128;
-const int BUTTON_USE = 256;
-const int BUTTON_CHAT = 512;
-const int BUTTON_PRYDONCURSOR = 1024;
-const int BUTTON_9 = 2048;
-const int BUTTON_10 = 4096;
-const int BUTTON_11 = 8192;
-const int BUTTON_12 = 16384;
-const int BUTTON_13 = 32768;
-const int BUTTON_14 = 65536;
-const int BUTTON_15 = 131072;
-const int BUTTON_16 = 262144;
-
-const int SOLID_NOT = 0; // no interaction with other objects
-const int SOLID_TRIGGER = 1; // touch on edge, but not blocking
-const int SOLID_BBOX = 2; // touch on edge, block
-const int SOLID_SLIDEBOX = 3; // touch on edge, but not an onground
-const int SOLID_BSP = 4; // bsp clip, touch on edge, block
-const int SOLID_CORPSE = 5; // same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
-
-const int MOVE_NORMAL = 0; // same as false
-const int MOVE_NOMONSTERS = 1; // same as true
-const int MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
-const int MOVE_HITMODEL = 4;
-const int MOVE_WORLDONLY = 3;
-
-const int CAMERA_FREE = 1;
-const int CAMERA_CHASE = 2;
-
-const int EF_NOMODELFLAGS = 8388608;
--- /dev/null
+#ifndef CSQC_CONSTANTS
+#define CSQC_CONSTANTS
+
+// MenuQC redefines world, change define it here to be safe
+#define world world
+
+// Mask Constants (set .drawmask on entities; use R_AddEntities to add all entities based on mask)
+const int MASK_ENGINE = 1;
+const int MASK_ENGINEVIEWMODELS = 2;
+const int MASK_NORMAL = 4;
+
+// Renderflag Constants (used for CSQC entities)
+const int RF_VIEWMODEL = 1;
+const int RF_EXTERNALMODEL = 2;
+const int RF_DEPTHHACK = 4;
+const int RF_ADDITIVE = 8;
+const int RF_USEAXIS = 16;
+
+// Viewflag Constants (use with R_SetView)
+const int VF_MIN = 1; //(vector)
+const int VF_MIN_X = 2; //(float)
+const int VF_MIN_Y = 3; //(float)
+const int VF_SIZE = 4; //(vector) (viewport size)
+const int VF_SIZE_Y = 5; //(float)
+const int VF_SIZE_X = 6; //(float)
+const int VF_VIEWPORT = 7; //(vector, vector)
+const int VF_FOV = 8; //(vector)
+const int VF_FOVX = 9; //(float)
+const int VF_FOVY = 10; //(float)
+const int VF_ORIGIN = 11; //(vector)
+const int VF_ORIGIN_X = 12; //(float)
+const int VF_ORIGIN_Y = 13; //(float)
+const int VF_ORIGIN_Z = 14; //(float)
+const int VF_ANGLES = 15; //(vector)
+const int VF_ANGLES_X = 16; //(float)
+const int VF_ANGLES_Y = 17; //(float)
+const int VF_ANGLES_Z = 18; //(float)
+const int VF_DRAWWORLD = 19; //(float)
+const int VF_DRAWENGINEHUD = 20; //(float)
+const int VF_DRAWCROSSHAIR = 21; //(float)
+const int VF_PERSPECTIVE = 200; //(float)
+
+const int VF_CL_VIEWANGLES = 33; //(vector)
+const int VF_CL_VIEWANGLES_X = 34; //(float)
+const int VF_CL_VIEWANGLES_Y = 35; //(float)
+const int VF_CL_VIEWANGLES_Z = 36; //(float)
+
+// Quake-style Point Contents
+const int CONTENT_EMPTY = -1;
+const int CONTENT_SOLID = -2;
+const int CONTENT_WATER = -3;
+const int CONTENT_SLIME = -4;
+const int CONTENT_LAVA = -5;
+const int CONTENT_SKY = -6;
+
+// Vector / Hull Constants
+const vector VEC_1 = '1 1 1';
+const vector VEC_0 = '0 0 0';
+const vector VEC_M1 = '-1 -1 -1';
+
+const vector VEC_HULL_MIN = '-16 -16 -24';
+const vector VEC_HULL_MAX = '16 16 32';
+
+// Effect Constants
+const int EF_NODRAW = 16;
+const int EF_ADDITIVE = 32;
+const int EF_BLUE = 64;
+const int EF_RED = 128;
+const int EF_FULLBRIGHT = 512;
+const int EF_FLAME = 1024;
+const int EF_STARDUST = 2048;
+const int EF_NOSHADOW = 4096;
+const int EF_NODEPTHTEST = 8192;
+
+// Quake Player Flag Constants
+const int PFL_ONGROUND = 1;
+const int PFL_CROUCH = 2;
+const int PFL_DEAD = 4;
+const int PFL_GIBBED = 8;
+
+// Quake Temporary Entity Constants
+const int TE_SPIKE = 0;
+const int TE_SUPERSPIKE = 1;
+const int TE_GUNSHOT = 2;
+const int TE_EXPLOSION = 3;
+const int TE_TAREXPLOSION = 4;
+const int TE_LIGHTNING1 = 5;
+const int TE_LIGHTNING2 = 6;
+const int TE_WIZSPIKE = 7;
+const int TE_KNIGHTSPIKE = 8;
+const int TE_LIGHTNING3 = 9;
+const int TE_LAVASPLASH = 10;
+const int TE_TELEPORT = 11;
+const int TE_EXPLOSION2 = 12;
+// Darkplaces Additions
+const int TE_EXPLOSIONRGB = 53;
+const int TE_GUNSHOTQUAD = 57;
+const int TE_EXPLOSIONQUAD = 70;
+
+// Math Constants
+const int EXTRA_LOW = -99999999;
+const int EXTRA_HIGH = 99999999;
+
+// Frik File Constants
+const int FILE_READ = 0;
+const int FILE_APPEND = 1;
+const int FILE_WRITE = 2;
+
+// Button values used by input_buttons
+const int BUTTON_ATTACK = 1;
+const int BUTTON_JUMP = 2;
+const int BUTTON_3 = 4;
+const int BUTTON_4 = 8;
+const int BUTTON_5 = 16;
+const int BUTTON_6 = 32;
+const int BUTTON7 = 64;
+const int BUTTON8 = 128;
+const int BUTTON_USE = 256;
+const int BUTTON_CHAT = 512;
+const int BUTTON_PRYDONCURSOR = 1024;
+const int BUTTON_9 = 2048;
+const int BUTTON_10 = 4096;
+const int BUTTON_11 = 8192;
+const int BUTTON_12 = 16384;
+const int BUTTON_13 = 32768;
+const int BUTTON_14 = 65536;
+const int BUTTON_15 = 131072;
+const int BUTTON_16 = 262144;
+
+const int SOLID_NOT = 0; // no interaction with other objects
+const int SOLID_TRIGGER = 1; // touch on edge, but not blocking
+const int SOLID_BBOX = 2; // touch on edge, block
+const int SOLID_SLIDEBOX = 3; // touch on edge, but not an onground
+const int SOLID_BSP = 4; // bsp clip, touch on edge, block
+const int SOLID_CORPSE = 5; // same as SOLID_BBOX, except it behaves as SOLID_NOT against SOLID_SLIDEBOX objects (players/monsters)
+
+const int MOVE_NORMAL = 0; // same as false
+const int MOVE_NOMONSTERS = 1; // same as true
+const int MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
+const int MOVE_HITMODEL = 4;
+const int MOVE_WORLDONLY = 3;
+
+const int CAMERA_FREE = 1;
+const int CAMERA_CHASE = 2;
+
+const int EF_NOMODELFLAGS = 8388608;
+
+#endif
-#if defined(CSQC)
- #include "gibs.qh"
- #include "miscfunctions.qh"
- #include "player_skeleton.qh"
- #include "sortlist.qh"
+#include "csqcmodel_hooks.qh"
+#include "_all.qh"
- #include "../client/weapons/projectile.qh"
+#include "gibs.qh"
+#include "player_skeleton.qh"
+#include "sortlist.qh"
- #include "../common/animdecide.qh"
- #include "../common/csqcmodel_settings.qh"
+#include "weapons/projectile.qh"
- #include "../csqcmodellib/cl_model.qh"
- #include "../csqcmodellib/cl_player.qh"
- #include "../csqcmodellib/interpolate.qh"
+#include "../common/animdecide.qh"
+#include "../common/csqcmodel_settings.qh"
+#include "../common/teams.qh"
- #include "../warpzonelib/mathlib.qh"
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/cl_player.qh"
+#include "../csqcmodellib/interpolate.qh"
- .float death_time;
- .int modelflags;
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "../warpzonelib/mathlib.qh"
+.float death_time;
+.int modelflags;
void CSQCModel_Hook_PreDraw(bool isplayer);
--- /dev/null
+#ifndef CSQCMODEL_HOOKS
+#define CSQCMODEL_HOOKS
+
+void CSQCPlayer_Precache();
+
+#endif
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "defs.qh"
- #include "../common/constants.qh"
- #include "../common/util.qh"
- #include "../common/weapons/weapons.qh"
- #include "autocvars.qh"
- #include "../common/deathtypes.qh"
- #include "damage.qh"
- #include "movetypes.qh"
- #include "prandom.qh"
- #include "vehicles/vehicles.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "damage.qh"
+#include "_all.qh"
+
+#include "gibs.qh"
+#include "movetypes.qh"
+#include "prandom.qh"
+
+#include "vehicles/vehicles.qh"
+
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/util.qh"
+
+#include "../common/weapons/weapons.qh"
+
+.entity tag_entity;
+
+.float cnt;
+.int state;
+.bool isplayermodel;
void DamageEffect_Think()
{
#define DAMAGE_H
.float total_damages; // number of effects which currently are attached to a player
+
+void Ent_DamageInfo(float isNew);
+
#endif
-#ifndef DEFS_H
-#define DEFS_H
+#ifndef CLIENT_DEFS_H
+#define CLIENT_DEFS_H
// Additional OPTIONAL Fields and Globals
//float intermission;
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "autocvars.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "effects.qh"
+#include "_all.qh"
/*
.vector fx_start;
--- /dev/null
+#ifndef EFFECTS_H
+#define EFFECTS_H
+
+void Net_ReadArc();
+
+#endif
#include "gibs.qh"
+#include "_all.qh"
+
+#include "movetypes.qh"
+#include "prandom.qh"
+#include "rubble.qh"
+
+#include "../common/constants.qh"
+#include "../common/util.qh"
+
+.float scale;
+.float alpha;
+.float cnt;
+.float gravity;
void Gib_Delete()
{
+#include "hook.qh"
+#include "_all.qh"
+
#include "hud.qh"
#include "noise.qh"
+
+#include "../common/teams.qh"
+
+#include "../csqcmodellib/interpolate.qh"
+
#include "../warpzonelib/common.qh"
+#include "../warpzonelib/mathlib.qh"
-.float HookType; // ENT_CLIENT_*
-.vector origin;
-.vector velocity;
-.float HookSilent;
-.float HookRange;
+entityclass(Hook);
+class(Hook) .float HookType; // ENT_CLIENT_*
+class(Hook) .vector origin;
+class(Hook) .vector velocity;
+class(Hook) .float HookSilent;
+class(Hook) .float HookRange;
void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg)
{
Draw_GrapplingHook_trace_callback_rnd += 0.25 * vlen(hit - start) / 8;
}
-.float teleport_time;
+class(Hook) .float teleport_time;
void Draw_GrapplingHook()
{
vector a, b, atrans;
--- /dev/null
+#ifndef HOOK_H
+#define HOOK_H
+
+void Draw_CylindricLine(vector from, vector to, float thickness, string texture, float aspect, float shift, vector rgb, float theAlpha, float drawflag, vector vieworg);
+void Hook_Precache();
+
+void Ent_ReadHook(float bIsNew, float type);
+
+#endif
+#include "hud.qh"
+#include "_all.qh"
+
+#include "hud_config.qh"
#include "scoreboard.qh"
+#include "sortlist.qh"
#include "teamradar.qh"
+#include "t_items.qh"
+
#include "../common/buffs.qh"
+#include "../common/constants.qh"
#include "../common/counting.qh"
+#include "../common/deathtypes.qh"
#include "../common/mapinfo.qh"
#include "../common/nades.qh"
-#include "../server/t_items.qh"
+#include "../common/stats.qh"
+
+#include "../csqcmodellib/cl_player.qh"
+
+#include "../warpzonelib/mathlib.qh"
/*
==================
return color;
}
-float HUD_GetRowCount(float item_count, vector size, float item_aspect)
+float HUD_GetRowCount(int item_count, vector size, float item_aspect)
{
float aspect = size_y / size_x;
return bound(1, floor((sqrt(4 * item_aspect * aspect * item_count + aspect * aspect) + aspect + 0.5) / 2), item_count);
}
-vector HUD_GetTableSize(float item_count, vector psize, float item_aspect)
+vector HUD_GetTableSize(int item_count, vector psize, float item_aspect)
{
float columns, rows;
float ratio, best_ratio = 0;
return stringwidth(s, false, theSize);
}
-void drawstringright(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag)
+void drawstringright(vector position, string text, vector theScale, vector rgb, float theAlpha, int flag)
{
position.x -= 2 / 3 * strlen(text) * theScale.x;
drawstring(position, text, theScale, rgb, theAlpha, flag);
}
-void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, float flag)
+void drawstringcenter(vector position, string text, vector theScale, vector rgb, float theAlpha, int flag)
{
position.x = 0.5 * (vid_conwidth - 0.6025 * strlen(text) * theScale.x);
drawstring(position, text, theScale, rgb, theAlpha, flag);
}
// return the string of the onscreen race timer
-string MakeRaceString(float cp, float mytime, float histime, float lapdelta, string hisname)
+string MakeRaceString(int cp, float mytime, float theirtime, float lapdelta, string theirname)
{
string col;
string timestr;
string lapstr;
lapstr = "";
- if(histime == 0) // goal hit
+ if(theirtime == 0) // goal hit
{
if(mytime > 0)
{
col = "^1";
}
}
- else if(histime > 0) // anticipation
+ else if(theirtime > 0) // anticipation
{
- if(mytime >= histime)
- timestr = strcat("+", ftos_decimals(mytime - histime, TIME_DECIMALS));
+ if(mytime >= theirtime)
+ timestr = strcat("+", ftos_decimals(mytime - theirtime, TIME_DECIMALS));
else
- timestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(histime));
+ timestr = TIME_ENCODED_TOSTRING(TIME_ENCODE(theirtime));
col = "^3";
}
else
else
cpname = _("Finish line");
- if(histime < 0)
+ if(theirtime < 0)
return strcat(col, cpname);
- else if(hisname == "")
+ else if(theirname == "")
return strcat(col, sprintf("%s (%s)", cpname, timestr));
else
- return strcat(col, sprintf("%s (%s %s)", cpname, timestr, strcat(hisname, col, lapstr)));
+ return strcat(col, sprintf("%s (%s %s)", cpname, timestr, strcat(theirname, col, lapstr)));
}
// Check if the given name already exist in race rankings? In that case, where? (otherwise return 0)
-float race_CheckName(string net_name) {
- float i;
+int race_CheckName(string net_name)
+{
+ int i;
for (i=RANKINGS_CNT-1;i>=0;--i)
if(grecordholder[i] == net_name)
return i+1;
return 0;
}
-float GetPlayerColorForce(int i)
+int GetPlayerColorForce(int i)
{
if(!teamplay)
return 0;
return stof(getplayerkeyvalue(i, "colors")) & 15;
}
-float GetPlayerColor(int i)
+int GetPlayerColor(int i)
{
if(!playerslots[i].gotscores) // unconnected
return NUM_SPECTATOR;
} while(0)
//basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
-void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, float vertical, float baralign, vector theColor, float theAlpha, float drawflag)
+void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
{
if(!length_ratio || !theAlpha)
return;
}
}
-void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, float drawflag)
+void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, int drawflag)
{
if(!theAlpha)
return;
}
string weaponorder_cmp_str;
-float weaponorder_cmp(float i, float j, entity pass)
+int weaponorder_cmp(int i, int j, entity pass)
{
- float ai, aj;
+ int ai, aj;
ai = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[i].weapon), 0);
aj = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[j].weapon), 0);
return aj - ai; // the string is in REVERSE order (higher prio at the right is what we want, but higher prio first is the string)
{
// declarations
WepSet weapons_stat = WepSet_GetFromStat();
- float i, f, a;
+ int i;
+ float f, a;
float screen_ar;
vector center = '0 0 0';
- float weapon_count, weapon_id;
- float row, column, rows = 0, columns = 0;
+ int weapon_count, weapon_id;
+ int row, column, rows = 0, columns = 0;
bool vertical_order = true;
float aspect = autocvar_hud_panel_weapons_aspect;
if(padded_panel_size.x / padded_panel_size.y < aspect)
{
// maximum number of rows that allows to display items with the desired aspect ratio
- float max_rows = floor(padded_panel_size.y / (weapon_size.x / aspect));
+ int max_rows = floor(padded_panel_size.y / (weapon_size.x / aspect));
columns = min(columns, ceil(weapon_count / max_rows));
rows = ceil(weapon_count / columns);
weapon_size.y = min(padded_panel_size.y / rows, weapon_size.x / aspect);
}
else
{
- float max_columns = floor(padded_panel_size.x / (weapon_size.y * aspect));
+ int max_columns = floor(padded_panel_size.x / (weapon_size.y * aspect));
rows = min(rows, ceil(weapon_count / max_columns));
columns = ceil(weapon_count / rows);
weapon_size.x = min(padded_panel_size.x / columns, aspect * weapon_size.y);
}
-void DrawAmmoNades(vector myPos, vector mySize, float draw_expanding, float expand_time)
+void DrawAmmoNades(vector myPos, vector mySize, bool draw_expanding, float expand_time)
{
float theAlpha = 1, a, b;
vector nade_color, picpos, numpos;
}
}
-void DrawAmmoItem(vector myPos, vector mySize, .float ammoType, float isCurrent, float isInfinite)
+void DrawAmmoItem(vector myPos, vector mySize, .int ammoType, bool isCurrent, bool isInfinite)
{
if(ammoType == ammo_none)
return;
// Initialize variables
- float ammo;
+ int ammo;
if(autocvar__hud_configure)
{
isCurrent = (ammoType == ammo_rockets); // Rockets always current
textPos = myPos + eX * mySize.y;
}
- float isShadowed = (ammo <= 0 && !isCurrent && !isInfinite);
+ bool isShadowed = (ammo <= 0 && !isCurrent && !isInfinite);
vector iconColor = isShadowed ? '0 0 0' : '1 1 1';
vector textColor;
drawpic_aspect_skin(iconPos, GetAmmoPicture(ammoType), '1 1 0' * mySize.y, iconColor, alpha, DRAWFLAG_NORMAL);
}
-float nade_prevstatus;
-float nade_prevframe;
+int nade_prevstatus;
+int nade_prevframe;
float nade_statuschange_time;
void HUD_Ammo(void)
{
mySize -= '2 2 0' * panel_bg_padding;
}
- float rows = 0, columns, row, column;
+ int rows = 0, columns, row, column;
float nade_cnt = getstatf(STAT_NADE_BONUS), nade_score = getstatf(STAT_NADE_BONUS_SCORE);
- float draw_nades = (nade_cnt > 0 || nade_score > 0), nade_statuschange_elapsedtime;
- float total_ammo_count;
+ bool draw_nades = (nade_cnt > 0 || nade_score > 0);
+ float nade_statuschange_elapsedtime;
+ int total_ammo_count;
vector ammo_size;
if (autocvar_hud_panel_ammo_onlycurrent)
ammo_size.y = newSize;
}
- float i;
- float infinite_ammo = (getstati(STAT_ITEMS, 0, 24) & IT_UNLIMITED_WEAPON_AMMO);
+ int i;
+ bool infinite_ammo = (getstati(STAT_ITEMS, 0, 24) & IT_UNLIMITED_WEAPON_AMMO);
row = column = 0;
if(autocvar_hud_panel_ammo_onlycurrent)
{
}
else
{
- .float ammotype;
+ .int ammotype;
row = column = 0;
for(i = 0; i < AMMO_COUNT; ++i)
{
draw_endBoldFont();
}
-void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float theAlpha, float fadelerp)
+void DrawNumIcon_expanding(vector myPos, vector mySize, float x, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha, float fadelerp)
{
vector newPos = '0 0 0', newSize = '0 0 0';
vector picpos, numpos;
drawpic_aspect_skin_expanding(picpos, icon, '1 1 0' * newSize.y, '1 1 1', panel_fg_alpha * theAlpha, DRAWFLAG_NORMAL, fadelerp);
}
-void DrawNumIcon(vector myPos, vector mySize, float x, string icon, float vertical, float icon_right_align, vector color, float theAlpha)
+void DrawNumIcon(vector myPos, vector mySize, float x, string icon, bool vertical, bool icon_right_align, vector color, float theAlpha)
{
DrawNumIcon_expanding(myPos, mySize, x, icon, vertical, icon_right_align, color, theAlpha, 0);
}
}
float panel_ar = mySize.x/mySize.y;
- float is_vertical = (panel_ar < 1);
+ bool is_vertical = (panel_ar < 1);
vector shield_offset = '0 0 0', strength_offset = '0 0 0', superweapons_offset = '0 0 0';
- float superweapons_is = -1;
+ int superweapons_is = -1;
if(superweapons_time)
{
}
}
- float shield_baralign, strength_baralign, superweapons_baralign;
- float shield_iconalign, strength_iconalign, superweapons_iconalign;
+ bool shield_baralign, strength_baralign, superweapons_baralign;
+ bool shield_iconalign, strength_iconalign, superweapons_iconalign;
if (autocvar_hud_panel_powerups_flip)
{
// Health/armor (#3)
//
-// prev_* vars contain the health/armor at the previous FRAME
-// set to -1 when player is dead or was not playing
-float prev_health, prev_armor;
-float health_damagetime, armor_damagetime;
-float health_beforedamage, armor_beforedamage;
-// old_p_* vars keep track of previous values when smoothing value changes of the progressbar
-float old_p_health, old_p_armor;
-float old_p_healthtime, old_p_armortime;
-// prev_p_* vars contain the health/armor progressbar value at the previous FRAME
-// set to -1 to forcedly stop effects when we switch spectated player (e.g. from playerX: 70h to playerY: 50h)
-float prev_p_health, prev_p_armor;
void HUD_HealthArmor(void)
{
- float armor, health, fuel;
+ int armor, health, fuel;
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_healtharmor) return;
mySize -= '2 2 0' * panel_bg_padding;
}
- float baralign = autocvar_hud_panel_healtharmor_baralign;
- float iconalign = autocvar_hud_panel_healtharmor_iconalign;
+ int baralign = autocvar_hud_panel_healtharmor_baralign;
+ int iconalign = autocvar_hud_panel_healtharmor_iconalign;
- float maxhealth = autocvar_hud_panel_healtharmor_maxhealth;
- float maxarmor = autocvar_hud_panel_healtharmor_maxarmor;
+ int maxhealth = autocvar_hud_panel_healtharmor_maxhealth;
+ int maxarmor = autocvar_hud_panel_healtharmor_maxarmor;
if(autocvar_hud_panel_healtharmor == 2) // combined health and armor display
{
vector v;
else
{
float panel_ar = mySize.x/mySize.y;
- float is_vertical = (panel_ar < 1);
+ bool is_vertical = (panel_ar < 1);
vector health_offset = '0 0 0', armor_offset = '0 0 0';
if (panel_ar >= 4 || (panel_ar >= 1/4 && panel_ar < 1))
{
armor_offset.y = mySize.y;
}
- float health_baralign, armor_baralign, fuel_baralign;
- float health_iconalign, armor_iconalign;
+ bool health_baralign, armor_baralign, fuel_baralign;
+ bool health_iconalign, armor_iconalign;
if (autocvar_hud_panel_healtharmor_flip)
{
armor_baralign = (autocvar_hud_panel_healtharmor_baralign == 2 || autocvar_hud_panel_healtharmor_baralign == 1);
float fade_time = max(0, autocvar_hud_panel_notify_fadetime);
float icon_aspect = max(1, autocvar_hud_panel_notify_icon_aspect);
- float entry_count = bound(1, floor(NOTIFY_MAX_ENTRIES * size.y / size.x), NOTIFY_MAX_ENTRIES);
+ int entry_count = bound(1, floor(NOTIFY_MAX_ENTRIES * size.y / size.x), NOTIFY_MAX_ENTRIES);
float entry_height = size.y / entry_count;
float panel_width_half = size.x * 0.5;
vector attacker_pos, victim_pos, icon_pos;
string attacker, victim, icon;
- float i, j, count, step, limit, alpha;
+ int i, j, count, step, limit;
+ float alpha;
if (autocvar_hud_panel_notify_flip)
{
mySize -= '2 2 0' * panel_bg_padding;
}
- float color2;
+ int color2;
entity tm;
float scale2d, normalsize, bigsize;
{
float score;
entity tm = world, pl;
- float SCOREPANEL_MAX_ENTRIES = 6;
+ int SCOREPANEL_MAX_ENTRIES = 6;
float SCOREPANEL_ASPECTRATIO = 2;
- float entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize.y/mySize.x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
+ int entries = bound(1, floor(SCOREPANEL_MAX_ENTRIES * mySize.y/mySize.x * SCOREPANEL_ASPECTRATIO), SCOREPANEL_MAX_ENTRIES);
vector fontsize = '1 1 0' * (mySize.y/entries);
vector rgb, score_color;
float name_size = mySize.x*0.75;
float spacing_size = mySize.x*0.04;
const float highlight_alpha = 0.2;
- float i = 0, me_printed = 0, first_pl = 0;
+ int i = 0, first_pl = 0;
+ bool me_printed = false;
string s;
if (autocvar__hud_configure)
{
{
if (i == first_pl)
rgb = '0 1 0'; //first: green
- me_printed = 1;
+ me_printed = true;
drawfill(pos, eX * mySize.x + eY * fontsize.y, rgb, highlight_alpha * panel_fg_alpha, DRAWFLAG_NORMAL);
}
if (team_count)
// Vote window (#9)
//
-float vote_yescount;
-float vote_nocount;
-float vote_needed;
-float vote_highlighted; // currently selected vote
-
-float vote_active; // is there an active vote?
-float vote_prev; // previous state of vote_active to check for a change
-float vote_alpha;
-float vote_change; // "time" when vote_active changed
void HUD_Vote(void)
{
// Mod icons panel (#10)
//
-float mod_active; // is there any active mod icon?
+bool mod_active; // is there any active mod icon?
-void DrawCAItem(vector myPos, vector mySize, float aspect_ratio, int layout, float i)
+void DrawCAItem(vector myPos, vector mySize, float aspect_ratio, int layout, int i)
{
- float stat = -1;
+ int stat = -1;
string pic = "";
vector color = '0 0 0';
switch(i)
layout = autocvar_hud_panel_modicons_ca_layout;
else //if(gametype == MAPINFO_TYPE_FREEZETAG)
layout = autocvar_hud_panel_modicons_freezetag_layout;
- float rows, columns, aspect_ratio;
+ int rows, columns;
+ float aspect_ratio;
aspect_ratio = (layout) ? 2 : 1;
rows = HUD_GetRowCount(team_count, mySize, aspect_ratio);
columns = ceil(team_count/rows);
// CTF HUD modicon section
float redflag_prevframe, blueflag_prevframe; // status during previous frame
-float redflag_prevstatus, blueflag_prevstatus; // last remembered status
+int redflag_prevstatus, blueflag_prevstatus; // last remembered status
float redflag_statuschange_time, blueflag_statuschange_time; // time when the status changed
void HUD_Mod_CTF_Reset(void)
vector flag_size;
float f; // every function should have that
- float redflag, blueflag; // current status
+ int redflag, blueflag; // current status
float redflag_statuschange_elapsedtime, blueflag_statuschange_elapsedtime; // time since the status changed
- float stat_items;
+ int stat_items;
stat_items = getstati(STAT_ITEMS, 0, 24);
redflag = (stat_items/IT_RED_FLAG_TAKEN) & 3;
// Read current state
- float state = getstati(STAT_KH_KEYS);
- float i, key_state;
- float all_keys, team1_keys, team2_keys, team3_keys, team4_keys, dropped_keys, carrying_keys;
+ int state = getstati(STAT_KH_KEYS);
+ int i, key_state;
+ int all_keys, team1_keys, team2_keys, team3_keys, team4_keys, dropped_keys, carrying_keys;
all_keys = team1_keys = team2_keys = team3_keys = team4_keys = dropped_keys = carrying_keys = 0;
for(i = 0; i < 4; ++i)
}
// Keepaway HUD mod icon
-float kaball_prevstatus; // last remembered status
+int kaball_prevstatus; // last remembered status
float kaball_statuschange_time; // time when the status changed
// we don't need to reset for keepaway since it immediately
float BLINK_FREQ = 5;
float kaball_alpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
- float stat_items = getstati(STAT_ITEMS, 0, 24);
- float kaball = (stat_items/IT_KEY1) & 1;
+ int stat_items = getstati(STAT_ITEMS, 0, 24);
+ int kaball = (stat_items/IT_KEY1) & 1;
if(kaball != kaball_prevstatus)
{
// Nexball HUD mod icon
void HUD_Mod_NexBall(vector pos, vector mySize)
{
- float stat_items, nb_pb_starttime, dt, p;
+ float nb_pb_starttime, dt, p;
+ int stat_items;
stat_items = getstati(STAT_ITEMS, 0, 24);
nb_pb_starttime = getstatf(STAT_NB_METERSTART);
float srecordtime_change_time; // time when srecordtime last changed
float race_status_time;
-float race_status_prev;
+int race_status_prev;
string race_status_name_prev;
void HUD_Mod_Race(vector pos, vector mySize)
{
}
}
-void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, int layout, float i)
+void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, int layout, int i)
{
float stat = -1;
string pic = "";
mod_active = 1; // required in each mod function that always shows something
int layout = autocvar_hud_panel_modicons_dom_layout;
- float rows, columns, aspect_ratio;
+ int rows, columns;
+ float aspect_ratio;
aspect_ratio = (layout) ? 3 : 1;
rows = HUD_GetRowCount(team_count, mySize, aspect_ratio);
columns = ceil(team_count/rows);
}
}
-float mod_prev; // previous state of mod_active to check for a change
+int mod_prev; // previous state of mod_active to check for a change
float mod_alpha;
float mod_change; // "time" when mod_active changed
//
float prevfps;
float prevfps_time;
-float framecounter;
+int framecounter;
float frametimeavg;
float frametimeavg1; // 1 frame ago
else
acceleration_offset.y = panel_size.y;
}
- float speed_baralign, acceleration_baralign;
+ int speed_baralign, acceleration_baralign;
if (autocvar_hud_panel_physics_baralign == 1)
acceleration_baralign = speed_baralign = 1;
else if(autocvar_hud_panel_physics_baralign == 4)
// CenterPrint (#16)
//
-const float CENTERPRINT_MAX_MSGS = 10;
-const float CENTERPRINT_MAX_ENTRIES = 50;
+const int CENTERPRINT_MAX_MSGS = 10;
+const int CENTERPRINT_MAX_ENTRIES = 50;
const float CENTERPRINT_SPACING = 0.7;
-float cpm_index;
+int cpm_index;
string centerprint_messages[CENTERPRINT_MAX_MSGS];
-float centerprint_msgID[CENTERPRINT_MAX_MSGS];
+int centerprint_msgID[CENTERPRINT_MAX_MSGS];
float centerprint_time[CENTERPRINT_MAX_MSGS];
float centerprint_expire_time[CENTERPRINT_MAX_MSGS];
-float centerprint_countdown_num[CENTERPRINT_MAX_MSGS];
-float centerprint_showing;
+int centerprint_countdown_num[CENTERPRINT_MAX_MSGS];
+bool centerprint_showing;
-void centerprint_generic(float new_id, string strMessage, float duration, float countdown_num)
+void centerprint_generic(int new_id, string strMessage, float duration, int countdown_num)
{
//printf("centerprint_generic(%d, '%s^7', %d, %d);\n", new_id, strMessage, duration, countdown_num);
- float i, j;
+ int i, j;
if(strMessage == "" && new_id == 0)
return;
void reset_centerprint_messages(void)
{
- float i;
+ int i;
for (i=0; i<CENTERPRINT_MAX_MSGS; ++i)
{
centerprint_expire_time[i] = 0;
panel_size -= '2 2 0' * panel_bg_padding;
}
- float entries, height;
+ int entries;
+ float height;
vector fontsize;
// entries = bound(1, floor(CENTERPRINT_MAX_ENTRIES * 4 * panel_size_y/panel_size_x), CENTERPRINT_MAX_ENTRIES);
// height = panel_size_y/entries;
fontsize = '1 1 0' * height;
entries = bound(1, floor(panel_size.y/height), CENTERPRINT_MAX_ENTRIES);
- float i, j, k, n, g;
+ int i, j, k, n, g;
float a, sz, align, current_msg_posY = 0, msg_size;
vector pos;
string ts;
- float all_messages_expired = true;
+ bool all_messages_expired = true;
pos = panel_pos;
if (autocvar_hud_panel_centerprint_flip)
//
void HUD_Buffs(void)
{
- float buffs = getstati(STAT_BUFFS, 0, 24);
+ int buffs = getstati(STAT_BUFFS, 0, 24);
if(!autocvar__hud_configure)
{
if(!autocvar_hud_panel_buffs) return;
buffs = Buff_Type_first.items; // force first buff
}
- float b = 0; // counter to tell other functions that we have buffs
+ int b = 0; // counter to tell other functions that we have buffs
entity e;
string s = "";
for(e = Buff_Type_first; e; e = e.enemy) if(buffs & e.items)
}
//float panel_ar = mySize_x/mySize_y;
- //float is_vertical = (panel_ar < 1);
+ //bool is_vertical = (panel_ar < 1);
//float buff_iconalign = autocvar_hud_panel_buffs_iconalign;
vector buff_offset = '0 0 0';
// draw the dock
if(autocvar_hud_dock != "" && autocvar_hud_dock != "0")
{
- float f;
+ int f;
vector color;
float hud_dock_color_team = autocvar_hud_dock_color_team;
if((teamplay) && hud_dock_color_team) {
for(i = 0; i < HUD_PANEL_NUM; ++i)
panel_order[i] = -1;
string s = "";
- float p_num, warning = false;
- float argc = tokenize_console(autocvar__hud_panelorder);
+ int p_num;
+ bool warning = false;
+ int argc = tokenize_console(autocvar__hud_panelorder);
if (argc > HUD_PANEL_NUM)
warning = true;
//first detect wrong/missing panel numbers
for(i = 0; i < HUD_PANEL_NUM; ++i) {
- p_num = stof(argv(i));
+ p_num = stoi(argv(i));
if (p_num >= 0 && p_num < HUD_PANEL_NUM) { //correct panel number?
if (panel_order[p_num] == -1) //found for the first time?
s = strcat(s, ftos(p_num), " ");
int panel_order[HUD_PANEL_MAX];
string hud_panelorder_prev;
+void HUD_Reset (void);
+void HUD_Main (void);
+
+int vote_yescount;
+int vote_nocount;
+int vote_needed;
+int vote_highlighted; // currently selected vote
+
+int vote_active; // is there an active vote?
+int vote_prev; // previous state of vote_active to check for a change
+float vote_alpha;
+float vote_change; // "time" when vote_active changed
+
float hud_draw_maximized;
float hud_panel_radar_maximized;
float chat_panel_modified;
vector panel_size_copied;
entity panel;
-.string panel_name;
-.int panel_id;
-.vector current_panel_pos;
-.vector current_panel_size;
-.string current_panel_bg;
-.float current_panel_bg_alpha;
-.float current_panel_bg_border;
-.vector current_panel_bg_color;
-.float current_panel_bg_color_team;
-.float current_panel_bg_padding;
-.float current_panel_fg_alpha;
-.float update_time;
+entityclass(HUDPanel);
+class(HUDPanel) .string panel_name;
+class(HUDPanel) .int panel_id;
+class(HUDPanel) .vector current_panel_pos;
+class(HUDPanel) .vector current_panel_size;
+class(HUDPanel) .string current_panel_bg;
+class(HUDPanel) .float current_panel_bg_alpha;
+class(HUDPanel) .float current_panel_bg_border;
+class(HUDPanel) .vector current_panel_bg_color;
+class(HUDPanel) .float current_panel_bg_color_team;
+class(HUDPanel) .float current_panel_bg_padding;
+class(HUDPanel) .float current_panel_fg_alpha;
+class(HUDPanel) .float update_time;
float panel_enabled;
vector panel_pos;
vector panel_size;
float panel_bg_padding;
string panel_bg_padding_str;
-.void() panel_draw;
+class(HUDPanel) .void() panel_draw;
float current_player;
float GetPlayerColorForce(int i);
+float stringwidth_colors(string s, vector theSize);
+int GetPlayerColor(int i);
+string GetPlayerName(int i);
+float stringwidth_nocolors(string s, vector theSize);
+void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag);
+
+
+// prev_* vars contain the health/armor at the previous FRAME
+// set to -1 when player is dead or was not playing
+int prev_health, prev_armor;
+float health_damagetime, armor_damagetime;
+int health_beforedamage, armor_beforedamage;
+// old_p_* vars keep track of previous values when smoothing value changes of the progressbar
+int old_p_health, old_p_armor;
+float old_p_healthtime, old_p_armortime;
+// prev_p_* vars contain the health/armor progressbar value at the previous FRAME
+// set to -1 to forcedly stop effects when we switch spectated player (e.g. from playerX: 70h to playerY: 50h)
+int prev_p_health, prev_p_armor;
+
#define HUD_PANELS(HUD_PANEL) \
HUD_PANEL(WEAPONS , HUD_Weapons , weapons) \
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "defs.qh"
- #include "../dpdefs/keycodes.qh"
- #include "../common/constants.qh"
- #include "autocvars.qh"
- #include "hud.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "hud_config.qh"
+#include "_all.qh"
+
+#include "hud.qh"
+
+#include "../common/constants.qh"
+
+#include "../dpdefs/keycodes.qh"
#define HUD_Write(s) fputs(fh, s)
--- /dev/null
+#ifndef HUD_CONFIG_H
+#define HUD_CONFIG_H
+
+void HUD_Panel_ExportCfg(string cfgname);
+
+void HUD_Panel_Mouse();
+
+void HUD_Configure_Frame();
+
+void HUD_Configure_PostDraw();
+
+float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary);
+
+#endif
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "../common/buffs.qh"
- #include "../csqcmodellib/interpolate.qh"
- #include "main.qh"
- #include "../csqcmodellib/cl_model.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "laser.qh"
+#include "_all.qh"
+#include "hook.qh"
+
+#include "../common/buffs.qh"
+
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/interpolate.qh"
// a laser goes from origin in direction angles
// it has color 'colormod'
// and stops when something is in the way
-.int cnt; // end effect
-.vector colormod;
-.int state; // on-off
-.int count; // flags for the laser
-.vector velocity;
-.float alpha;
-.float scale; // scaling factor of the thickness
-.float modelscale; // scaling factor of the dlight
+entityclass(Laser);
+class(Laser) .int cnt; // end effect
+class(Laser) .vector colormod;
+class(Laser) .int state; // on-off
+class(Laser) .int count; // flags for the laser
+class(Laser) .vector velocity;
+class(Laser) .float alpha;
+class(Laser) .float scale; // scaling factor of the thickness
+class(Laser) .float modelscale; // scaling factor of the dlight
void Draw_Laser()
{
--- /dev/null
+#ifndef LASER_H
+#define LASER_H
+
+void Ent_Laser();
+
+#endif
+#include "main.qh"
+#include "_all.qh"
+
+#include "casings.qh"
+#include "csqcmodel_hooks.qh"
+#include "damage.qh"
+#include "effects.qh"
+#include "gibs.qh"
+#include "hook.qh"
+#include "hud.qh"
+#include "hud_config.qh"
+#include "laser.qh"
#include "mapvoting.qh"
#include "modeleffects.qh"
#include "particles.qh"
+#include "prandom.qh"
#include "scoreboard.qh"
#include "shownames.qh"
+#include "sortlist.qh"
#include "target_music.qh"
#include "tturrets.qh"
#include "tuba.qh"
+#include "t_items.qh"
#include "wall.qh"
#include "waypointsprites.qh"
+#include "vehicles/bumblebee.qh"
#include "vehicles/vehicles.qh"
-#include "../server/vehicles/bumblebee.qh"
+#include "weapons/projectile.qh"
+#include "../common/buffs.qh"
+#include "../common/deathtypes.qh"
+#include "../common/mapinfo.qh"
+#include "../common/monsters/monsters.qh"
+#include "../common/nades.qh"
#include "../common/net_notice.qh"
+#include "../common/notifications.qh"
+#include "../common/stats.qh"
+#include "../common/teams.qh"
-#include "../common/monsters/monsters.qh"
+#include "../common/weapons/weapons.qh"
+
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/interpolate.qh"
#include "../warpzonelib/client.qh"
#ifndef MAIN_H
#define MAIN_H
+#include "../common/constants.qh"
+
// --------------------------------------------------------------------------
// MENU Functionality
float zoomin_effect;
float warmup_stage;
+void Fog_Force();
+
string getcommandkey(string text, string command);
string vote_called_vote;
#include "mapvoting.qh"
+#include "_all.qh"
+
+#include "hud.qh"
#include "scoreboard.qh"
+#include "../common/mapinfo.qh"
+#include "../common/util.qh"
+
+#include "../dpdefs/keycodes.qh"
+
string MapVote_FormatMapItem(int id, string map, float _count, float maxwidth, vector fontsize)
{
string pre, post;
#ifndef MAPVOTING_H
#define MAPVOTING_H
+#include "../common/constants.qh"
+
int mv_num_maps;
float mv_active;
#include "miscfunctions.qh"
+#include "_all.qh"
-#include "../common/urllib.qh"
+#include "hud.qh"
+#include "sortlist.qh"
#include "../common/command/generic.qh"
+#include "../common/teams.qh"
+#include "../common/urllib.qh"
+#include "../common/util.qh"
+
+#include "../csqcmodellib/cl_model.qh"
+
+#include "../warpzonelib/mathlib.qh"
+
void AuditLists()
{
entity e;
#include "modeleffects.qh"
+#include "_all.qh"
+
+.float cnt;
+.float scale;
+.float alpha;
void ModelEffect_Draw()
{
#ifndef MODELEFFECTS_H
#define MODELEFFECTS_H
-.float frame1time;
-.float lifetime, fadetime;
-.float teleport_time;
-.float scale1, scale2;
+entityclass(ModelEffect);
+class(ModelEffect) .float frame1time;
+class(ModelEffect) .float lifetime, fadetime;
+class(ModelEffect) .float teleport_time;
+class(ModelEffect) .float scale1, scale2;
void ModelEffect_Draw();
--- /dev/null
+#include "../server/movelib.qc"
--- /dev/null
+#include "../server/movelib.qh"
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "defs.qh"
- #include "../common/stats.qh"
- #include "../common/util.qh"
- #include "movetypes.qh"
- #include "../csqcmodellib/common.qh"
- #include "../server/t_items.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "movetypes.qh"
+#include "_all.qh"
+
+#include "t_items.qh"
+
+#include "../common/stats.qh"
+#include "../common/util.qh"
+
+#include "../csqcmodellib/common.qh"
const int MOVEFLAG_GRAVITYUNAFFECTEDBYTICRATE = 4;
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "noise.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "noise.qh"
+#include "_all.qh"
+
+entityclass(Noise);
+class(Noise) .float noise_baccum;
+class(Noise) .float noise_paccum;
+class(Noise) .float noise_paccum2;
+class(Noise) .float noise_paccum3;
+class(Noise) .float noise_bstate;
-.float noise_baccum;
-.float noise_paccum;
-.float noise_paccum2;
-.float noise_paccum3;
-.float noise_bstate;
float Noise_Brown(entity e, float dt)
{
e.noise_baccum += random() * sqrt(dt); // same stddev for all dt
#include "particles.qh"
+#include "_all.qh"
+
+#include "bgmscript.qh"
+
+#include "../common/stats.qh"
+#include "../common/util.qh"
+
+#include "../warpzonelib/common.qh"
void Draw_PointParticles()
{
vector o;
o = self.origin;
sz = self.maxs - self.mins;
- n = BGMScript(self);
+ n = doBGMScript(self);
if(self.absolute == 2)
{
if(n >= 0)
.int dphitcontentsmask;
-.int cnt; // effect number
-.vector velocity; // particle velocity
-.float waterlevel; // direction jitter
-.int count; // count multiplier
-.int impulse; // density
-.string noise; // sound
-.float atten;
-.float volume;
-.float absolute; // 1 = count per second is absolute, 2 = only spawn at toggle
-.vector movedir; // trace direction
+entityclass(PointParticles);
+class(PointParticles) .int cnt; // effect number
+class(PointParticles) .vector velocity; // particle velocity
+class(PointParticles) .float waterlevel; // direction jitter
+class(PointParticles) .int count; // count multiplier
+class(PointParticles) .int impulse; // density
+class(PointParticles) .string noise; // sound
+class(PointParticles) .float atten;
+class(PointParticles) .float volume;
+class(PointParticles) .float absolute; // 1 = count per second is absolute, 2 = only spawn at toggle
+class(PointParticles) .vector movedir; // trace direction
void Draw_PointParticles();
void Ent_PointParticles();
-.float glow_color; // palette index
+class(PointParticles) .float glow_color; // palette index
void Draw_Rain();
#include "player_skeleton.qh"
+#include "../common/csqcmodel_settings.qh"
+
#include "../warpzonelib/anglestransform.qh"
-.float skeleton_info_modelindex;
-.float skeleton_info_skin;
+class(Skeleton) .float skeleton_info_modelindex;
+class(Skeleton) .float skeleton_info_skin;
const int BONETYPE_LOWER = 0;
const int BONETYPE_UPPER = 1;
const int MAX_BONES = 128;
-.float skeleton_bonetype[MAX_BONES];
-.float skeleton_numbones;
+class(Skeleton) .float skeleton_bonetype[MAX_BONES];
+class(Skeleton) .float skeleton_numbones;
void skeleton_loadinfo(entity e)
{
#ifndef PLAYER_SKELETON
#define PLAYER_SKELETON
+#include "../common/util.qh"
+
void free_skeleton_from_frames(entity e);
void skeleton_from_frames(entity e, float is_dead);
void skeleton_loadinfo(entity e);
-.float bone_upperbody;
-.int bone_weapon;
-.float bone_aim[MAX_AIM_BONES];
-.float bone_aimweight[MAX_AIM_BONES];
-.float fixbone;
+entityclass(Skeleton);
+class(Skeleton) .float bone_upperbody;
+class(Skeleton) .int bone_weapon;
+class(Skeleton) .float bone_aim[MAX_AIM_BONES];
+class(Skeleton) .float bone_aimweight[MAX_AIM_BONES];
+class(Skeleton) .float fixbone;
#endif
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "../warpzonelib/mathlib.qh"
- #include "prandom.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "prandom.qh"
+#include "_all.qh"
+
+#include "../warpzonelib/mathlib.qh"
// prandom - PREDICTABLE random number generator (not seeded yet)
effects.qc
gibs.qc
hook.qc
-hud_config.qc
hud.qc
+hud_config.qc
laser.qc
main.qc
mapvoting.qc
miscfunctions.qc
modeleffects.qc
+movelib.qc
movetypes.qc
noise.qc
particles.qc
teamradar.qc
tturrets.qc
tuba.qc
-vehicles/vehicles.qc
+t_items.qc
view.qc
wall.qc
waypointsprites.qc
-command/cl_cmd.qc
+command/commands.qc
+
+vehicles/bumblebee.qc
+vehicles/vehicles.qc
weapons/projectile.qc // TODO
../common/urllib.qc
../common/util.qc
-../common/command/generic.qc
-../common/command/markup.qc
-../common/command/rpn.qc
-
../common/monsters/monsters.qc
../common/weapons/weapons.qc // TODO
../csqcmodellib/cl_player.qc
../csqcmodellib/interpolate.qc
-../server/movelib.qc
-../server/t_items.qc
-../server/vehicles/bumblebee.qc
-
../warpzonelib/anglestransform.qc
../warpzonelib/client.qc
../warpzonelib/common.qc
-#if defined(CSQC)
- #include "rubble.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "rubble.qh"
// LordHavoc: rewrote this file, it was really bad code
#ifndef RUBBLE_H
#define RUBBLE_H
-.float creationtime;
+entityclass(Rubble);
+class(Rubble) .float creationtime;
void RubbleLimit(string cname, float limit, void() deleteproc);
entity RubbleNew(string cname);
#endif
#include "scoreboard.qh"
+#include "_all.qh"
+
+#include "hud.qh"
+#include "sortlist.qh"
+
+#include "../common/constants.qh"
+#include "../common/counting.qh"
+#include "../common/mapinfo.qh"
+#include "../common/stats.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
float scoreboard_alpha_bg;
float scoreboard_alpha_fg;
float scoreboard_fade_alpha;
void Cmd_HUD_SetFields(float argc);
+void HUD_DrawScoreboard();
void HUD_InitScores();
void HUD_UpdatePlayerPos(entity pl);
void HUD_UpdateTeamPos(entity Team);
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "defs.qh"
- #include "../common/constants.qh"
- #include "../common/teams.qh"
- #include "../common/util.qh"
- #include "../common/mapinfo.qh"
- #include "autocvars.qh"
- #include "main.qh"
- #include "../csqcmodellib/cl_model.qh"
- #include "shownames.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "shownames.qh"
+#include "_all.qh"
+#include "hud.qh"
+
+#include "../common/constants.qh"
+#include "../common/mapinfo.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+
+#include "../csqcmodellib/cl_model.qh"
// self.isactive = player is in range and coordinates/status (health and armor) are up to date
// self.origin = player origin TODO: should maybe move this so it's the origin of the shownames tag already in SSQC for culling?
#ifndef SHOWNAMES_H
#define SHOWNAMES_H
-.float healthvalue;
-.float armorvalue;
-.float sameteam;
-.float fadedelay;
-.float pointtime;
+entityclass(ShowNames);
+class(ShowNames) .float healthvalue;
+class(ShowNames) .float armorvalue;
+class(ShowNames) .float sameteam;
+class(ShowNames) .float fadedelay;
+class(ShowNames) .float pointtime;
+
+void Draw_ShowNames_All();
+
#endif
#ifndef SORTLIST_H
#define SORTLIST_H
+entityclass(Sort);
//.float(entity,entity) sort_cmp;
-.entity sort_next, sort_prev;
+class(Sort) .entity sort_next, sort_prev;
entity Sort_Spawn();
--- /dev/null
+#include "_all.qh"
+
+#include "movetypes.qh"
+#include "../common/buffs.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
+#include "../csqcmodellib/cl_model.qh"
+#include "../csqcmodellib/common.qh"
+
+#include "../server/t_items.qc"
--- /dev/null
+#include "../server/t_items.qh"
#include "target_music.qh"
+#include "_all.qh"
+
+#include "../common/constants.qh"
+#include "../common/util.qh"
+
+#include "../warpzonelib/common.qh"
+
+.string noise;
+.float cnt;
+.float count;
+.float fade_time;
+.float fade_rate;
+.float lifetime;
+.float volume;
void TargetMusic_Advance()
{
entity music_trigger;
// FIXME also control bgmvolume here, to not require a target_music for the default track.
-.int state;
-.float lastvol;
+entityclass(TargetMusic);
+class(TargetMusic) .int state;
+class(TargetMusic) .float lastvol;
void TargetMusic_Advance();
-#if defined(CSQC)
- #include "teamradar.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "teamradar.qh"
+#include "_all.qh"
+
+#include "hud.qh"
+
+#include "../common/util.qh"
+
+#include "../csqcmodellib/interpolate.qh"
float vlen2d(vector v)
{
const int MAX_TEAMRADAR_TIMES = 32;
+entityclass(TeamRadar);
// to make entities have dots on the team radar
-.float teamradar_icon;
-.float teamradar_times[MAX_TEAMRADAR_TIMES];
-.int teamradar_time_index;
-.vector teamradar_color;
+class(TeamRadar) .float teamradar_icon;
+class(TeamRadar) .float teamradar_times[MAX_TEAMRADAR_TIMES];
+class(TeamRadar) .int teamradar_time_index;
+class(TeamRadar) .vector teamradar_color;
float teamradar_angle; // player yaw angle
vector teamradar_origin3d_in_texcoord; // player origin
#include "tturrets.qh"
+#include "_all.qh"
+
+#include "hud.qh"
+#include "movelib.qh"
+#include "movetypes.qh"
+#include "prandom.qh"
+#include "teamradar.qh"
#include "waypointsprites.qh"
-#include "../server/movelib.qh"
+#include "../common/teams.qh"
+
+#include "../server/tturrets/include/turrets_early.qh"
+
+#include "../warpzonelib/anglestransform.qh"
+#include "../warpzonelib/mathlib.qh"
+
+.vector colormod;
+.float cnt;
+.float alpha;
+.float gravity;
string tid2info_base;
string tid2info_head;
precache_model ("models/turrets/head-gib2.md3");
precache_model ("models/turrets/head-gib3.md3");
precache_model ("models/turrets/head-gib4.md3");
- precache_model ("models/turrets/terrainbase.md3");
precache_model ("models/turrets/base.md3");
precache_model ("models/turrets/rocket.md3");
}
self.tur_head = world;
}
-.vector glowmod;
+class(Turret) .vector glowmod;
void turret_changeteam()
{
switch(self.team - 1)
#ifndef TTURRETS_H
#define TTURRETS_H
-#include "../server/tturrets/include/turrets_early.qh"
-
void ent_turret();
void turrets_precache();
-.entity tur_head;
+entityclass(Turret);
+class(Turret) .entity tur_head;
#endif
#include "tuba.qh"
+#include "_all.qh"
+
+#include "../common/constants.qh"
+#include "../common/util.qh"
+
+#include "../warpzonelib/mathlib.qh"
#define TUBA_STARTNOTE(i, n) strcat("weapons/tuba", (i ? ftos(i) : ""), "_loopnote", ftos(n), ".wav")
const int TUBA_MAX = 27;
const int TUBA_INSTRUMENTS = 3;
-.int note;
-.bool tuba_attenuate;
-.float tuba_volume;
-.float tuba_volume_initial;
-.int tuba_instrument;
+class(Tuba) .int note;
+class(Tuba) .bool tuba_attenuate;
+class(Tuba) .float tuba_volume;
+class(Tuba) .float tuba_volume_initial;
+class(Tuba) .int tuba_instrument;
int Tuba_PitchStep;
#define TUBA_H
void Ent_TubaNote(bool isNew);
void Tuba_Precache();
+
+entityclass(Tuba);
+
#endif
--- /dev/null
+#include "../damage.qh"
+#include "../defs.qh"
+#include "../gibs.qh"
+#include "../hook.qh"
+#include "../main.qh"
+#include "../movetypes.qh"
+#include "../wall.qh"
+
+#include "../weapons/projectile.qh"
+
+#include "../../server/vehicles/bumblebee.qc"
--- /dev/null
+#include "../../server/vehicles/bumblebee.qh"
-#if defined(CSQC)
- #include "../../dpdefs/csprogsdefs.qh"
- #include "../defs.qh"
- #include "../../common/constants.qh"
- #include "../../common/stats.qh"
- #include "../../common/util.qh"
- #include "../../common/buffs.qh"
- #include "../autocvars.qh"
- #include "../movetypes.qh"
- #include "../prandom.qh"
- #include "../main.qh"
- #include "vehicles.qh"
- #include "../../csqcmodellib/cl_model.qh"
- #include "../../server/t_items.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "vehicles.qh"
+#include "../_all.qh"
+
+#include "../movetypes.qh"
+#include "../movetypes.qh"
+#include "../prandom.qh"
+#include "../scoreboard.qh"
+#include "../t_items.qh"
+
+#include "../../common/buffs.qh"
+#include "../../common/constants.qh"
+#include "../../common/stats.qh"
+#include "../../common/util.qh"
+
+#include "../../csqcmodellib/cl_model.qh"
+
+.float cnt;
const string hud_bg = "gfx/vehicles/frame.tga";
const string hud_sh = "gfx/vehicles/vh-shield.tga";
const string raptor_drop = "gfx/vehicles/axh-dropcross.tga";
string raptor_xhair;
-void CSQC_WAKIZASHI_HUD();
-void CSQC_SPIDER_HUD();
-void CSQC_RAPTOR_HUD();
-void CSQC_BUMBLE_HUD();
-void CSQC_BUMBLE_GUN_HUD();
+
const int MAX_AXH = 4;
-entity AuxiliaryXhair[MAX_AXH];
+entity AuxiliaryXhairs[MAX_AXH];
-.string axh_image;
-.float axh_fadetime;
-.float axh_drawflag;
-.float axh_scale;
+entityclass(AuxiliaryXhair);
+class(AuxiliaryXhair) .string axh_image;
+class(AuxiliaryXhair) .float axh_fadetime;
+class(AuxiliaryXhair) .float axh_drawflag;
+class(AuxiliaryXhair) .float axh_scale;
const string bumb_ico = "gfx/vehicles/bumb.tga";
const string bumb_lgun = "gfx/vehicles/bumb_lgun.tga";
void Net_AuXair2(bool bIsNew)
{
int axh_id = bound(0, ReadByte(), MAX_AXH);
- entity axh = AuxiliaryXhair[axh_id];
+ entity axh = AuxiliaryXhairs[axh_id];
if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
{
axh.axh_image = "gfx/vehicles/axh-ring.tga";
axh.axh_scale = 1;
axh.alpha = 1;
- AuxiliaryXhair[axh_id] = axh;
+ AuxiliaryXhairs[axh_id] = axh;
}
axh.move_origin_x = ReadCoord();
int i;
for(i = 0; i < MAX_AXH; ++i)
{
- entity axh = AuxiliaryXhair[i];
+ entity axh = AuxiliaryXhairs[i];
if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
remove(axh);
axh.axh_image = "gfx/vehicles/axh-ring.tga";
axh.axh_scale = 1;
axh.alpha = 1;
- AuxiliaryXhair[i] = axh;
+ AuxiliaryXhairs[i] = axh;
}
switch(hud_id)
{
case HUD_SPIDERBOT:
// Minigun1
- AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-ring.tga";
- AuxiliaryXhair[0].axh_scale = 0.25;
+ AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-ring.tga";
+ AuxiliaryXhairs[0].axh_scale = 0.25;
// Minigun2
- AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-ring.tga";
- AuxiliaryXhair[1].axh_scale = 0.25;
+ AuxiliaryXhairs[1].axh_image = "gfx/vehicles/axh-ring.tga";
+ AuxiliaryXhairs[1].axh_scale = 0.25;
// Rocket
- AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-special1.tga";
- AuxiliaryXhair[2].axh_scale = 0.5;
+ AuxiliaryXhairs[2].axh_image = "gfx/vehicles/axh-special1.tga";
+ AuxiliaryXhairs[2].axh_scale = 0.5;
break;
case HUD_WAKIZASHI:
- AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
- AuxiliaryXhair[0].axh_scale = 0.25;
+ AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-bracket.tga";
+ AuxiliaryXhairs[0].axh_scale = 0.25;
break;
case HUD_RAPTOR:
- AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-special2.tga";
- AuxiliaryXhair[0].axh_scale = 0.5;
+ AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-special2.tga";
+ AuxiliaryXhairs[0].axh_scale = 0.5;
//AuxiliaryXhair[0].alpha = 0.5;
- AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
- AuxiliaryXhair[1].axh_scale = 0.25;
+ AuxiliaryXhairs[1].axh_image = "gfx/vehicles/axh-bracket.tga";
+ AuxiliaryXhairs[1].axh_scale = 0.25;
//AuxiliaryXhair[1].alpha = 0.75;
//AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL;
break;
case HUD_BUMBLEBEE:
// Raygun-locked
- AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
- AuxiliaryXhair[0].axh_scale = 0.5;
+ AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-bracket.tga";
+ AuxiliaryXhairs[0].axh_scale = 0.5;
// Gunner1
- AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-target.tga";
- AuxiliaryXhair[1].axh_scale = 0.75;
+ AuxiliaryXhairs[1].axh_image = "gfx/vehicles/axh-target.tga";
+ AuxiliaryXhairs[1].axh_scale = 0.75;
// Gunner2
- AuxiliaryXhair[2].axh_image = "gfx/vehicles/axh-target.tga";
- AuxiliaryXhair[2].axh_scale = 0.75;
+ AuxiliaryXhairs[2].axh_image = "gfx/vehicles/axh-target.tga";
+ AuxiliaryXhairs[2].axh_scale = 0.75;
break;
case HUD_BUMBLEBEE_GUN:
// Plasma cannons
- AuxiliaryXhair[0].axh_image = "gfx/vehicles/axh-bracket.tga";
- AuxiliaryXhair[0].axh_scale = 0.25;
+ AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-bracket.tga";
+ AuxiliaryXhairs[0].axh_scale = 0.25;
// Raygun
- AuxiliaryXhair[1].axh_image = "gfx/vehicles/axh-bracket.tga";
- AuxiliaryXhair[1].axh_scale = 0.25;
+ AuxiliaryXhairs[1].axh_image = "gfx/vehicles/axh-bracket.tga";
+ AuxiliaryXhairs[1].axh_scale = 0.25;
break;
}
}
drawresetcliparea();
// Right gunner slot occupied?
- if(!AuxiliaryXhair[1].draw2d)
+ if(!AuxiliaryXhairs[1].draw2d)
{
shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL);
drawresetcliparea();
// Left gunner slot occupied?
- if(!AuxiliaryXhair[2].draw2d)
+ if(!AuxiliaryXhairs[2].draw2d)
{
shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y));
drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL);
void Vehicles_Precache();
void Net_AuXair2(bool bIsNew);
void Net_VehicleSetup();
+
+void CSQC_WAKIZASHI_HUD();
+void CSQC_SPIDER_HUD();
+void CSQC_RAPTOR_HUD();
+void CSQC_BUMBLE_HUD();
+void CSQC_BUMBLE_GUN_HUD();
+
#endif
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "defs.qh"
- #include "../common/constants.qh"
- #include "../common/stats.qh"
- #include "../warpzonelib/mathlib.qh"
- #include "../warpzonelib/common.qh"
- #include "../warpzonelib/client.qh"
- #include "../common/teams.qh"
- #include "../common/util.qh"
- #include "../common/nades.qh"
- #include "../common/weapons/weapons.qh"
- #include "../common/mapinfo.qh"
- #include "autocvars.qh"
- #include "hud.qh"
- #include "scoreboard.qh"
- #include "noise.qh"
- #include "main.qh"
- #include "../csqcmodellib/cl_player.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "_all.qh"
+
+#include "announcer.qh"
+#include "hook.qh"
+#include "hud.qh"
+#include "hud_config.qh"
+#include "mapvoting.qh"
+#include "noise.qh"
+#include "scoreboard.qh"
+#include "shownames.qh"
+#include "target_music.qh"
+#include "vehicles/vehicles.qh"
+#include "waypointsprites.qh"
+
+#include "../common/constants.qh"
+#include "../common/mapinfo.qh"
+#include "../common/nades.qh"
+#include "../common/stats.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+
+#include "../common/weapons/weapons.qh"
+
+#include "../csqcmodellib/cl_player.qh"
+
+#include "../warpzonelib/client.qh"
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/mathlib.qh"
entity porto;
vector polyline[16];
#include "wall.qh"
+#include "_all.qh"
+
+#include "bgmscript.qh"
+
+#include "../common/util.qh"
+
+#include "../csqcmodellib/interpolate.qh"
+
+.float alpha;
+.float scale;
+.vector movedir;
void Ent_Wall_Draw()
{
fld = angles;
else
fld = origin;
- self.fld = self.saved;
+ self.(fld) = self.saved;
if(self.lodmodelindex1)
{
InterpolateOrigin_Do();
- self.saved = self.fld;
+ self.saved = self.(fld);
- f = BGMScript(self);
+ f = doBGMScript(self);
if(f >= 0)
{
if(self.lip < 0) // < 0: alpha goes from 1 to 1-|lip| when toggled (toggling subtracts lip)
self.alpha = 1 + self.lip * f;
else // > 0: alpha goes from 1-|lip| to 1 when toggled (toggling adds lip)
self.alpha = 1 - self.lip * (1 - f);
- self.fld = self.fld + self.movedir * f;
+ self.(fld) = self.(fld) + self.movedir * f;
}
else
self.alpha = 1;
fld = angles;
else
fld = origin;
- self.fld = self.saved;
+ self.(fld) = self.saved;
f = ReadByte();
InterpolateOrigin_Note();
- self.saved = self.fld;
+ self.saved = self.(fld);
self.entremove = Ent_Wall_Remove;
self.draw = Ent_Wall_Draw;
#ifndef WALL_H
#define WALL_H
-.float lip;
-.float bgmscriptangular;
-.int lodmodelindex0, lodmodelindex1, lodmodelindex2;
-.float loddistance1, loddistance2;
-.vector saved;
+entityclass(Wall);
+class(Wall) .float lip;
+class(Wall) .float bgmscriptangular;
+class(Wall) .int lodmodelindex0, lodmodelindex1, lodmodelindex2;
+class(Wall) .float loddistance1, loddistance2;
+class(Wall) .vector saved;
void Ent_Wall_Draw();
#include "waypointsprites.qh"
+#include "_all.qh"
+
+#include "hud.qh"
+#include "teamradar.qh"
+
+#include "../common/buffs.qh"
+#include "../common/constants.qh"
+#include "../common/teams.qh"
+
+#include "../common/weapons/weapons.qh"
+
+#include "../csqcmodellib/interpolate.qh"
+
+#include "../warpzonelib/mathlib.qh"
+
+.float alpha;
void drawrotpic(vector org, float rot, string pic, vector sz, vector hotspot, vector rgb, float a, float f)
{
float waypointsprite_distancefadedistance;
float waypointsprite_alpha;
-.float helpme;
-.float rule;
-.string netname; // primary picture
-.string netname2; // secondary picture
-.string netname3; // tertiary picture
-.float team; // team that gets netname2
-.float lifetime;
-.float fadetime;
-.float maxdistance;
-.int hideflags;
-.float spawntime;
-.float health;
-.float build_started;
-.float build_starthealth;
-.float build_finished;
+entityclass(WaypointSprite);
+class(WaypointSprite) .float helpme;
+class(WaypointSprite) .float rule;
+class(WaypointSprite) .string netname; // primary picture
+class(WaypointSprite) .string netname2; // secondary picture
+class(WaypointSprite) .string netname3; // tertiary picture
+class(WaypointSprite) .int team; // team that gets netname2
+class(WaypointSprite) .float lifetime;
+class(WaypointSprite) .float fadetime;
+class(WaypointSprite) .float maxdistance;
+class(WaypointSprite) .int hideflags;
+class(WaypointSprite) .float spawntime;
+class(WaypointSprite) .float health;
+class(WaypointSprite) .float build_started;
+class(WaypointSprite) .float build_starthealth;
+class(WaypointSprite) .float build_finished;
const float SPRITE_HEALTHBAR_WIDTH = 144;
const float SPRITE_HEALTHBAR_HEIGHT = 9;
#include "projectile.qh"
+#include "../autocvars.qh"
+#include "../defs.qh"
+#include "../main.qh"
+#include "../movetypes.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/nades.qh"
+#include "../../common/util.qh"
+
+#include "../../csqcmodellib/interpolate.qh"
+
+#include "../../warpzonelib/anglestransform.qh"
+
+.float alpha;
+.float scale;
+.vector colormod;
+
void SUB_Stop()
{
self.move_velocity = self.move_avelocity = '0 0 0';
#ifndef PROJECTILE_H
#define PROJECTILE_H
-.int traileffect;
-
-.vector iorigin1, iorigin2;
-.float spawntime;
-.vector trail_oldorigin;
-.float trail_oldtime;
-.float fade_time, fade_rate;
-
-.float alphamod;
-.int count; // set if clientside projectile
-.int cnt; // sound index
-.float gravity;
-.int snd_looping;
-.bool silent;
+entityclass(Projectile);
+class(Projectile) .int traileffect;
+
+class(Projectile) .vector iorigin1, iorigin2;
+class(Projectile) .float spawntime;
+class(Projectile) .vector trail_oldorigin;
+class(Projectile) .float trail_oldtime;
+class(Projectile) .float fade_time, fade_rate;
+
+class(Projectile) .float alphamod;
+class(Projectile) .int count; // set if clientside projectile
+class(Projectile) .int cnt; // sound index
+class(Projectile) .float gravity;
+class(Projectile) .int snd_looping;
+class(Projectile) .bool silent;
void SUB_Stop();
upper = lower;
if(e.frame1time != upper.y || e.frame2time != lower.y)
BITXOR_ASSIGN(e.effects, EF_RESTARTANIM_BIT);
- e.fld_frame = upper.x;
- e.fld_frame1time = upper.y;
- e.fld_frame2 = lower.x;
- e.fld_frame2time = lower.y;
+ e.(fld_frame) = upper.x;
+ e.(fld_frame1time) = upper.y;
+ e.(fld_frame2) = lower.x;
+ e.(fld_frame2time) = lower.y;
}
else
{
upper = lower;
if(e.frame1time != upper.y)
BITXOR_ASSIGN(e.effects, EF_RESTARTANIM_BIT);
- e.fld_frame = upper.x;
- e.fld_frame1time = upper.y;
+ e.(fld_frame) = upper.x;
+ e.(fld_frame1time) = upper.y;
}
}
#ifndef BUFFS_H
#define BUFFS_H
+#include "teams.qh"
+#include "util.qh"
+
entity Buff_Type_first;
entity Buff_Type_last;
.entity enemy; // internal next pointer
--- /dev/null
+#ifndef COMMAND_H
+#define COMMAND_H
+
+// =========================================================
+// Shared declarations for all commands, written by Samual
+// Last updated: December 13th, 2011
+// =========================================================
+
+// identifiers for subfunction requests by the command code structure
+const int CMD_REQUEST_COMMAND = 1;
+const int CMD_REQUEST_USAGE = 2;
+#endif
--- /dev/null
+#include "generic.qc"
+#include "markup.qc"
+#include "rpn.qc"
--- /dev/null
+#ifndef COMMON_COMMANDS_H
+#define COMMON_COMMANDS_H
+
+#include "generic.qh"
+#include "markup.qh"
+#include "rpn.qh"
+
+#endif
+#include "command.qh"
#include "generic.qh"
-#include "shared_defs.qh"
+
+#include "markup.qh"
+#include "rpn.qh"
+
+#include "../mapinfo.qh"
+#include "../test.qh"
+
+#ifndef MENUQC
+ #include "../notifications.qh"
+#endif
+
+#ifdef CSQC
+ #include "../../client/command/cl_cmd.qh"
+#endif
+
+#ifdef SVQC
+ #include "../../server/command/banning.qh"
+ #include "../../server/command/cmd.qh"
+ #include "../../server/command/common.qh"
+ #include "../../server/command/sv_cmd.qh"
+
+ #include "../../common/weapons/config.qh"
+#endif
// =========================================================
// Generic program common command code, written by Samual
-#ifndef GENERIC_H
-#define GENERIC_H
+#ifndef COMMAND_GENERIC_H
+#define COMMAND_GENERIC_H
-#include "markup.qh"
-#include "rpn.qh"
+#include "../constants.qh"
// =========================================================
// Declarations for common command code, written by Samual
+#include "command.qh"
#include "markup.qh"
// =========================================================
-#ifndef MARKUP_H
-#define MARKUP_H
+#ifndef COMMAND_MARKUP_H
+#define COMMAND_MARKUP_H
// ==========================================================
// Declarations for markup command code, reworked by Samual
+#include "command.qh"
#include "rpn.qh"
+#include "../../warpzonelib/mathlib.qh"
+
// ========================================
// RPN command code, written by divVerent
// Last updated: December 28th, 2011
-#ifndef RPN_H
-#define RPN_H
+#ifndef COMMAND_RPN_H
+#define COMMAND_RPN_H
// =========================================================
// Declarations for RPN command code, written by divVerent
+++ /dev/null
-#ifndef SHARED_DEFS_H
-#define SHARED_DEFS_H
-
-// =========================================================
-// Shared declarations for all commands, written by Samual
-// Last updated: December 13th, 2011
-// =========================================================
-
-// identifiers for subfunction requests by the command code structure
-const int CMD_REQUEST_COMMAND = 1;
-const int CMD_REQUEST_USAGE = 2;
-#endif
#ifndef COUNTING_H
#define COUNTING_H
+#include "util.qh"
+
// ===============================================
// Time processing and counting functions/macros
// ===============================================
#ifndef MAPINFO_H
#define MAPINFO_H
+#include "util.qh"
+
int MAPINFO_TYPE_ALL;
entity MapInfo_Type_first;
entity MapInfo_Type_last;
.string netname; // game type name as in cvar (with g_ prefix)
.string mdl; // game type short name
.string message; // human readable name
-.float team; // does this gametype support teamplay?
+.int team; // does this gametype support teamplay?
.string model2; // game type defaults
.string gametype_description; // game type description
--- /dev/null
+#include "monster/zombie.qc"
+#include "monster/spider.qc"
+#include "monster/mage.qc"
+#include "monster/wyvern.qc"
+#include "monster/shambler.qc"
+++ /dev/null
-// TODO: include once
-//#ifndef MONSTERS_ALL_H
-//#define MONSTERS_ALL_H
-
-#include "monster/zombie.qc"
-#include "monster/spider.qc"
-#include "monster/mage.qc"
-#include "monster/wyvern.qc"
-#include "monster/shambler.qc"
-
-//#endif
self.nextthink = time + 0.2;
}
-void shambler_lightning_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void shambler_lightning_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if (self.health <= 0)
return;
#include "monsters.qh"
-#include "all.qh"
+#include "all.inc"
// MONSTER PLUGIN SYSTEM
entity monster_info[MON_MAXCOUNT];
#ifndef MONSTERS_H
#define MONSTERS_H
+#include "../util.qh"
+
// monster requests
const int MR_SETUP = 1; // (SERVER) setup monster data
const int MR_THINK = 2; // (SERVER) logic to run every frame
REGISTER_MONSTER_2(MON_##id,func,monsterflags,min_s,max_s,modelname,shortname,mname)
#endif
-#include "all.qh"
+#include "all.inc"
#undef REGISTER_MONSTER
ACCUMULATE_FUNCTION(RegisterMonsters, register_monsters_done);
#include "../deathtypes.qh"
#include "../../server/mutators/mutators_include.qh"
#include "../../server/tturrets/include/turrets_early.qh"
- #include "../../server/vehicles/vehicles_def.qh"
+ #include "../../server/vehicles/vehicle.qh"
#include "../../server/campaign.qh"
#include "../../server/command/common.qh"
#include "../../server/command/cmd.qh"
field = GetMonsterSoundSampleField(argv(0));
if(GetMonsterSoundSampleField_notFound)
continue;
- if(self.field)
- strunzone(self.field);
- self.field = strzone(strcat(argv(1), " ", argv(2)));
+ if (self.(field))
+ strunzone(self.(field));
+ self.(field) = strzone(strcat(argv(1), " ", argv(2)));
}
fclose(fh);
return 1;
if(delaytoo)
if(time < self.msound_delay)
return; // too early
- GlobalSound(self.samplefield, chan, VOICETYPE_PLAYERSOUND);
+ GlobalSound(self.(samplefield), chan, VOICETYPE_PLAYERSOUND);
self.msound_delay = time + sound_delay;
}
makevectors(self.v_angle);
}
-float monster_melee(entity targ, float damg, float anim, float er, float anim_finished, float deathtype, float dostop)
+float monster_melee(entity targ, float damg, float anim, float er, float anim_finished, int deathtype, float dostop)
{
if (self.health <= 0)
return false; // attacking while dead?!
self.moveto = self.origin;
}
-void monsters_corpse_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void monsters_corpse_damage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
self.health -= damage;
MON_ACTION(self.monsterid, MR_DEATH);
}
-void monsters_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void monsters_damage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.frozen && deathtype != DEATH_KILL && deathtype != DEATH_NADE_ICE_FREEZE)
return;
float monster_initialize(float mon_id);
float monster_leap (float anm, void() touchfunc, vector vel, float anim_finished);
void monster_makevectors(entity e);
-float monster_melee(entity targ, float damg, float anim, float er, float anim_finished, float deathtype, float dostop);
+float monster_melee(entity targ, float damg, float anim, float er, float anim_finished, int deathtype, float dostop);
void monster_move(float runspeed, float walkspeed, float stopspeed, float manim_run, float manim_walk, float manim_idle);
void monster_setupcolors(entity mon);
float Monster_SkillModifier();
#ifndef NADES_H
#define NADES_H
+#include "teams.qh"
+
.float healer_lifetime;
.float healer_radius;
}
#ifdef SVQC
-float healer_send(entity to, float sf);
+float healer_send(entity to, int sf);
#endif
#ifdef CSQC
#ifdef SVQC
void Notification_GetCvars(void)
{
- float i;
- for(i = 0; i <= NOTIF_CHOICE_COUNT; ++i)
+ for(int i = 0; i <= NOTIF_CHOICE_COUNT; ++i)
{
GetCvars_handleFloat(
get_cvars_s,
if(notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2)))
{
- switch(cvar_string(sprintf("notification_%s", notif.nent_name)))
+ switch(cvar(sprintf("notification_%s", notif.nent_name)))
{
case 1: found_choice = notif.nent_optiona; break;
case 2: found_choice = notif.nent_optionb; break;
));
#endif
- float i;
- for(i = 0; i < 4; ++i) { if(self.nent_strings[i]) { strunzone(self.nent_strings[i]); } }
+ for(int i = 0; i < 4; ++i) { if(self.nent_strings[i]) { strunzone(self.nent_strings[i]); } }
remove(self);
}
-float Net_Write_Notification(entity client, float sf)
+float Net_Write_Notification(entity client, int sf)
{
if(Notification_ShouldSend(self.nent_broadcast, client, self.nent_client))
{
- float i;
WriteByte(MSG_ENTITY, ENT_CLIENT_NOTIFICATION);
WriteByte(MSG_ENTITY, self.nent_net_type);
WriteShort(MSG_ENTITY, self.nent_net_name);
- for(i = 0; i < self.nent_stringcount; ++i) { WriteString(MSG_ENTITY, self.nent_strings[i]); }
- for(i = 0; i < self.nent_floatcount; ++i) { WriteLong(MSG_ENTITY, self.nent_floats[i]); }
+ for(int i = 0; i < self.nent_stringcount; ++i) { WriteString(MSG_ENTITY, self.nent_strings[i]); }
+ for(int i = 0; i < self.nent_floatcount; ++i) { WriteLong(MSG_ENTITY, self.nent_floats[i]); }
return true;
}
else { return false; }
net_notif.nent_stringcount = notif.nent_stringcount;
net_notif.nent_floatcount = notif.nent_floatcount;
- float i;
- for(i = 0; i < net_notif.nent_stringcount; ++i)
+ for(int i = 0; i < net_notif.nent_stringcount; ++i)
{ net_notif.nent_strings[i] = strzone(...(i, string)); }
- for(i = 0; i < net_notif.nent_floatcount; ++i)
+ for(int i = 0; i < net_notif.nent_floatcount; ++i)
{ net_notif.nent_floats[i] = ...((net_notif.nent_stringcount + i), float); }
net_notif.think = Net_Notification_Remove;
#include "constants.qh"
#include "teams.qh"
+#include "util.qh"
// ================================================
// Unified notification system, written by Samual
// 255 is the current limit (MAX_CL_STATS - 1), engine will need to be modified if you wish to add more stats
const int MAX_CL_STATS = 256;
-const int STAT_HEALTH = 0;
+// -Wdouble-declaration
+// const int STAT_HEALTH = 0;
// 1 empty?
const int STAT_WEAPON = 2;
-const int STAT_AMMO = 3;
-const int STAT_ARMOR = 4;
-const int STAT_WEAPONFRAME = 5;
-const int STAT_SHELLS = 6;
-const int STAT_NAILS = 7;
-const int STAT_ROCKETS = 8;
-const int STAT_CELLS = 9;
-const int STAT_ACTIVEWEAPON = 10;
-const int STAT_TOTALSECRETS = 11;
-const int STAT_TOTALMONSTERS = 12;
-const int STAT_SECRETS = 13;
-const int STAT_MONSTERS = 14;
-const int STAT_ITEMS = 15;
-const int STAT_VIEWHEIGHT = 16;
+// -Wdouble-declaration
+// const int STAT_AMMO = 3;
+// -Wdouble-declaration
+// const int STAT_ARMOR = 4;
+// -Wdouble-declaration
+// const int STAT_WEAPONFRAME = 5;
+// -Wdouble-declaration
+// const int STAT_SHELLS = 6;
+// -Wdouble-declaration
+// const int STAT_NAILS = 7;
+// -Wdouble-declaration
+// const int STAT_ROCKETS = 8;
+// -Wdouble-declaration
+// const int STAT_CELLS = 9;
+// -Wdouble-declaration
+// const int STAT_ACTIVEWEAPON = 10;
+// -Wdouble-declaration
+// const int STAT_TOTALSECRETS = 11;
+// -Wdouble-declaration
+// const int STAT_TOTALMONSTERS = 12;
+// -Wdouble-declaration
+// const int STAT_SECRETS = 13;
+// -Wdouble-declaration
+// const int STAT_MONSTERS = 14;
+// -Wdouble-declaration
+// const int STAT_ITEMS = 15;
+// -Wdouble-declaration
+// const int STAT_VIEWHEIGHT = 16;
// 17 empty?
// 18 empty?
// 19 empty?
const int STAT_MOVEVARS_AIRSTRAFEACCELERATE = 232;
const int STAT_MOVEVARS_MAXAIRSTRAFESPEED = 233;
const int STAT_MOVEVARS_AIRCONTROL = 234;
-const int STAT_FRAGLIMIT = 235;
-const int STAT_TIMELIMIT = 236;
+// -Wdouble-declaration
+// const int STAT_FRAGLIMIT = 235;
+// -Wdouble-declaration
+// const int STAT_TIMELIMIT = 236;
const int STAT_MOVEVARS_WALLFRICTION = 237;
const int STAT_MOVEVARS_FRICTION = 238;
const int STAT_MOVEVARS_WATERFRICTION = 239;
-const int STAT_MOVEVARS_TICRATE = 240;
-const int STAT_MOVEVARS_TIMESCALE = 241;
-const int STAT_MOVEVARS_GRAVITY = 242;
+// -Wdouble-declaration
+// const int STAT_MOVEVARS_TICRATE = 240;
+// -Wdouble-declaration
+// const int STAT_MOVEVARS_TIMESCALE = 241;
+// -Wdouble-declaration
+// const int STAT_MOVEVARS_GRAVITY = 242;
const int STAT_MOVEVARS_STOPSPEED = 243;
const int STAT_MOVEVARS_MAXSPEED = 244;
const int STAT_MOVEVARS_SPECTATORMAXSPEED = 245;
#define int float
#define stoi(s) stof(s)
- #define itos(s) ftos(s)
+ #define stob(s) stof(s)
+ #define itos(i) ftos(i)
+#else
+ #define stoi(s) ((int) stof(s))
+ #define stob(s) ((bool) stof(s))
+ #define itos(i) ftos(i)
#endif
#ifndef QCC_SUPPORT_BOOL
const int false = 0;
#endif
+#ifndef QCC_SUPPORT_ENTITYCLASS
+ #define entityclass(name) typedef entity name
+ #define class(name)
+ #define new(class) spawn()
+#else
+ #define entityclass(name) entityclass name {}
+ #define class(name) [[class(name)]]
+ #define new(class) ((class) spawn())
+#endif
+
// Transitional aliases
[[deprecated("use true")]] [[alias("true")]] const bool TRUE;
[[deprecated("use false")]] [[alias("false")]] const bool FALSE;
+#define BIT(n) (1 << (n))
+#define BITSET(var, mask, flag) (flag ? (var) | (mask) : (var) &~ (mask))
+
#endif
entity e;
e = start;
funcPre(pass, e);
- while(e.downleft)
+ while (e.(downleft))
{
- e = e.downleft;
+ e = e.(downleft);
funcPre(pass, e);
}
funcPost(pass, e);
while(e != start)
{
- if(e.right)
+ if (e.(right))
{
- e = e.right;
+ e = e.(right);
funcPre(pass, e);
- while(e.downleft)
+ while (e.(downleft))
{
- e = e.downleft;
+ e = e.(downleft);
funcPre(pass, e);
}
}
else
- e = e.up;
+ e = e.(up);
funcPost(pass, e);
}
}
}
#ifndef MENUQC
-vector healtharmor_maxdamage(float h, float a, float armorblock, float deathtype)
+vector healtharmor_maxdamage(float h, float a, float armorblock, int deathtype)
{
// NOTE: we'll always choose the SMALLER value...
float healthdamage, armordamage, armorideal;
return v;
}
-vector healtharmor_applydamage(float a, float armorblock, float deathtype, float damage)
+vector healtharmor_applydamage(float a, float armorblock, int deathtype, float damage)
{
vector v;
if (deathtype == DEATH_DROWN) // Why should armor help here...
return ((a * 22 + b) * 22 + c) * 22 + d;
}
-float lowestbit(int f)
+int lowestbit(int f)
{
f &= ~(f * 2);
f &= ~(f * 4);
// start with a 1-element queue
queue_start = queue_end = e;
- queue_end.fld = world;
+ queue_end.(fld) = world;
queue_end.FindConnectedComponent_processing = 1;
// for each queued item:
- for (; queue_start; queue_start = queue_start.fld)
+ for (; queue_start; queue_start = queue_start.(fld))
{
// find all neighbors of queue_start
entity t;
if(iscon(t, queue_start, pass))
{
// it is connected? ADD IT. It will look for neighbors soon too.
- queue_end.fld = t;
+ queue_end.(fld) = t;
queue_end = t;
- queue_end.fld = world;
+ queue_end.(fld) = world;
queue_end.FindConnectedComponent_processing = 1;
}
}
}
// unmark
- for(queue_start = e; queue_start; queue_start = queue_start.fld)
+ for (queue_start = e; queue_start; queue_start = queue_start.(fld))
queue_start.FindConnectedComponent_processing = 0;
}
void RandomSelection_Add(entity e, float f, string s, float weight, float priority);
#ifndef MENUQC
-vector healtharmor_maxdamage(float h, float a, float armorblock, float deathtype); // returns vector: maxdamage, armorideal, 1 if fully armored
-vector healtharmor_applydamage(float a, float armorblock, float deathtype, float damage); // returns vector: take, save, 0
+vector healtharmor_maxdamage(float h, float a, float armorblock, int deathtype); // returns vector: maxdamage, armorideal, 1 if fully armored
+vector healtharmor_applydamage(float a, float armorblock, int deathtype, float damage); // returns vector: take, save, 0
#endif
string getcurrentmod();
// Otherwise, channels 8 to 15 would be blocked for a weird QW feature.
#define sound(e,c,s,v,a) sound7(e,c,s,v,a,0,0)
-float lowestbit(float f);
+int lowestbit(float f);
#ifdef CSQC
entity ReadCSQCEntity();
string CCR(string input);
#ifndef MENUQC
-#ifdef CSQC
-#define GENTLE (autocvar_cl_gentle || autocvar_cl_gentle_messages)
-#else
-#define GENTLE autocvar_sv_gentle
-#endif
-#define normal_or_gentle(normal,gentle) (GENTLE ? ((gentle != "") ? gentle : normal) : normal)
+ #ifdef CSQC
+ #define GENTLE (autocvar_cl_gentle || autocvar_cl_gentle_messages)
+ #else
+ #define GENTLE autocvar_sv_gentle
+ #endif
+ #define normal_or_gentle(normal, gentle) (GENTLE ? ((gentle != "") ? gentle : normal) : normal)
#endif
// allow writing to also pass through to spectators (like so spectators see the same centerprints as players for example)
--- /dev/null
+// ONLY EVER ADD NEW WEAPONS AT THE END. IF YOU REMOVE ONE, PUT THE LAST ONE ON
+// ITS PLACE. THIS IS TO AVOID UNNECESSARY RENUMBERING OF WEAPON IMPULSES.
+// IF YOU DISREGARD THIS NOTICE, I'LL KILL YOU WITH THE @!#%'N TUBA
+
+// core weapons
+#include "w_blaster.qc"
+#include "w_shotgun.qc"
+#include "w_machinegun.qc"
+#include "w_mortar.qc"
+#include "w_minelayer.qc"
+#include "w_electro.qc"
+#include "w_crylink.qc"
+#include "w_vortex.qc"
+#include "w_hagar.qc"
+#include "w_devastator.qc"
+
+// other weapons
+#include "w_porto.qc"
+#include "w_vaporizer.qc"
+#include "w_hook.qc"
+#include "w_hlac.qc"
+#include "w_tuba.qc"
+#include "w_rifle.qc"
+#include "w_fireball.qc"
+#include "w_seeker.qc"
+#include "w_shockwave.qc"
+#include "w_arc.qc"
+#include "w_hmg.qc"
+#include "w_rpc.qc"
+++ /dev/null
-// TODO: include once
-//#ifndef WEAPONS_ALL_H
-//#define WEAPONS_ALL_H
-
-#include "../util.qh"
-
-#ifdef SVQC
-# include "config.qh"
-# include "../../server/bot/aim.qh"
-#endif
-
-// ONLY EVER ADD NEW WEAPONS AT THE END. IF YOU REMOVE ONE, PUT THE LAST ONE ON
-// ITS PLACE. THIS IS TO AVOID UNNECESSARY RENUMBERING OF WEAPON IMPULSES.
-// IF YOU DISREGARD THIS NOTICE, I'LL KILL YOU WITH THE @!#%'N TUBA
-
-// core weapons
-#include "w_blaster.qc"
-#include "w_shotgun.qc"
-#include "w_machinegun.qc"
-#include "w_mortar.qc"
-#include "w_minelayer.qc"
-#include "w_electro.qc"
-#include "w_crylink.qc"
-#include "w_vortex.qc"
-#include "w_hagar.qc"
-#include "w_devastator.qc"
-
-// other weapons
-#include "w_porto.qc"
-#include "w_vaporizer.qc"
-#include "w_hook.qc"
-#include "w_hlac.qc"
-#include "w_tuba.qc"
-#include "w_rifle.qc"
-#include "w_fireball.qc"
-#include "w_seeker.qc"
-#include "w_shockwave.qc"
-#include "w_arc.qc"
-#include "w_hmg.qc"
-#include "w_rpc.qc"
-
-//#endif
#ifdef SVQC
void spawnfunc_weapon_arc(void) { weapon_defaultspawnfunc(WEP_ARC); }
-float W_Arc_Beam_Send(entity to, float sf)
+float W_Arc_Beam_Send(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_ARC_BEAM);
||
self.owner.frozen
||
+ self.owner.vehicle
+ ||
(WEP_CVAR(arc, overheat_max) > 0 && self.beam_heat >= WEP_CVAR(arc, overheat_max))
)
{
entity oldself = self;
self = self.owner;
if(!WEP_ACTION(WEP_ARC, WR_CHECKAMMO1) && !WEP_ACTION(WEP_ARC, WR_CHECKAMMO2))
+ if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
// note: this doesn't force the switch
W_SwitchToOtherWeapon(self);
}
}
-float W_Arc(float req)
+bool W_Arc(int req)
{
switch(req)
{
}
}
-float W_Arc(float req)
+bool W_Arc(int req)
{
switch(req)
{
self = oldself;
}
}
-float W_Blaster(float request)
+bool W_Blaster(int request)
{
switch(request)
{
}
#endif
#ifdef CSQC
-float W_Blaster(float request)
+bool W_Blaster(int request)
{
switch(request)
{
}
}
-float W_Crylink(float req)
+bool W_Crylink(int req)
{
float ammo_amount;
switch(req)
}
#endif
#ifdef CSQC
-float W_Crylink(float req)
+bool W_Crylink(int req)
{
switch(req)
{
if(self.realowner.weapon == WEP_DEVASTATOR)
{
if(self.realowner.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo))
+ if(!(self.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
{
self.realowner.cnt = WEP_DEVASTATOR;
ATTACK_FINISHED(self.realowner) = time;
if(self.realowner.weapon == WEP_DEVASTATOR)
{
if(self.realowner.WEP_AMMO(DEVASTATOR) < WEP_CVAR(devastator, ammo))
+ if(!(self.realowner.items & IT_UNLIMITED_WEAPON_AMMO))
{
self.realowner.cnt = WEP_DEVASTATOR;
ATTACK_FINISHED(self.realowner) = time;
W_Devastator_Explode();
}
-void W_Devastator_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Devastator_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.health <= 0)
return;
other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
-float W_Devastator(float req)
+bool W_Devastator(int req)
{
entity rock;
float rockfound;
}
#endif
#ifdef CSQC
-float W_Devastator(float req)
+bool W_Devastator(int req)
{
switch(req)
{
}
}
-void W_Electro_Orb_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Electro_Orb_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.health <= 0)
return;
}
.float bot_secondary_electromooth;
-float W_Electro(float req)
+bool W_Electro(int req)
{
float ammo_amount;
switch(req)
}
#endif
#ifdef CSQC
-float W_Electro(float req)
+bool W_Electro(int req)
{
switch(req)
{
self.nextthink = time + 0.1;
}
-void W_Fireball_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Fireball_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.health <= 0)
return;
other = proj; MUTATOR_CALLHOOK(EditProjectile);
}
-float W_Fireball(float req)
+bool W_Fireball(int req)
{
switch(req)
{
}
#endif
#ifdef CSQC
-float W_Fireball(float req)
+bool W_Fireball(int req)
{
switch(req)
{
remove(self);
}
-void W_Hagar_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Hagar_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.health <= 0)
return;
loaded = self.hagar_load >= WEP_CVAR_SEC(hagar, load_max);
// this is different than WR_CHECKAMMO when it comes to reloading
- if(autocvar_g_balance_hagar_reload_ammo)
+ if(self.items & IT_UNLIMITED_WEAPON_AMMO)
+ enough_ammo = true;
+ else if(autocvar_g_balance_hagar_reload_ammo)
enough_ammo = self.(weapon_load[WEP_HAGAR]) >= WEP_CVAR_SEC(hagar, ammo);
else
enough_ammo = self.WEP_AMMO(HAGAR) >= WEP_CVAR_SEC(hagar, ammo);
// we aren't checking ammo during an attack, so we must do it here
if(!(WEP_ACTION(self.weapon, WR_CHECKAMMO1) + WEP_ACTION(self.weapon, WR_CHECKAMMO2)))
+ if(!(self.items & IT_UNLIMITED_WEAPON_AMMO))
{
// note: this doesn't force the switch
W_SwitchToOtherWeapon(self);
}
}
-float W_Hagar(float req)
+bool W_Hagar(int req)
{
float ammo_amount;
switch(req)
}
#endif
#ifdef CSQC
-float W_Hagar(float req)
+bool W_Hagar(int req)
{
switch(req)
{
}
}
-float W_HLAC(float req)
+bool W_HLAC(int req)
{
float ammo_amount;
switch(req)
}
#endif
#ifdef CSQC
-float W_HLAC(float req)
+bool W_HLAC(int req)
{
switch(req)
{
weapon_thinkf(WFRAME_FIRE1, WEP_CVAR(hmg, refire), W_HeavyMachineGun_Attack_Auto);
}
-float W_HeavyMachineGun(float req)
+bool W_HeavyMachineGun(int req)
{
float ammo_amount;
switch(req)
}
#endif
#ifdef CSQC
-float W_HeavyMachineGun(float req)
+bool W_HeavyMachineGun(int req)
{
switch(req)
{
self.movetype = MOVETYPE_NONE;
}
-void W_Hook_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Hook_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.health <= 0)
return;
other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
-float W_Hook(float req)
+bool W_Hook(int req)
{
float hooked_time_max, hooked_fuel;
}
#endif
#ifdef CSQC
-float W_Hook(float req)
+bool W_Hook(int req)
{
switch(req)
{
self.muzzle_flash.owner = self.muzzle_flash.realowner = self;
}
-void W_MachineGun_Attack(float deathtype)
+void W_MachineGun_Attack(int deathtype)
{
W_SetupShot(self, true, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, ((self.misc_bulletcounter == 1) ? WEP_CVAR(machinegun, first_damage) : WEP_CVAR(machinegun, sustained_damage)));
if(!autocvar_g_norecoil)
}
-float W_MachineGun(float req)
+bool W_MachineGun(int req)
{
float ammo_amount;
switch(req)
}
#endif
#ifdef CSQC
-float W_MachineGun(float req)
+bool W_MachineGun(int req)
{
switch(req)
{
W_MineLayer_Explode();
}
-float W_MineLayer_Count(entity e)
+int W_MineLayer_Count(entity e)
{
- float minecount = 0;
+ int minecount = 0;
entity mine;
for(mine = world; (mine = find(mine, classname, "mine")); ) if(mine.realowner == e)
minecount += 1;
}
}
-void W_MineLayer_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_MineLayer_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.health <= 0)
return;
return minfound;
}
-float W_MineLayer(float req)
+bool W_MineLayer(int req)
{
entity mine;
float ammo_amount;
}
#endif
#ifdef CSQC
-float W_MineLayer(float req)
+bool W_MineLayer(int req)
{
switch(req)
{
}
-void W_Mortar_Grenade_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Mortar_Grenade_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.health <= 0)
return;
}
.float bot_secondary_grenademooth;
-float W_Mortar(float req)
+bool W_Mortar(int req)
{
entity nade;
float nadefound;
}
#endif
#ifdef CSQC
-float W_Mortar(float req)
+bool W_Mortar(int req)
{
switch(req)
{
other = gren; MUTATOR_CALLHOOK(EditProjectile);
}
-float w_nexball_weapon(float req); // WEAPONTODO
-float W_Porto(float req)
+bool w_nexball_weapon(int req); // WEAPONTODO
+bool W_Porto(int req)
{
//vector v_angle_save;
}
#endif
#ifdef CSQC
-float W_Porto(float req)
+bool W_Porto(int req)
{
switch(req)
{
void spawnfunc_weapon_campingrifle(void) { spawnfunc_weapon_rifle(); }
void spawnfunc_weapon_sniperrifle(void) { spawnfunc_weapon_rifle(); }
-void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSolidPenetration, float pAmmo, float deathtype, float pTracer, float pShots, string pSound)
+void W_Rifle_FireBullet(float pSpread, float pDamage, float pForce, float pSolidPenetration, float pAmmo, int deathtype, float pTracer, float pShots, string pSound)
{
float i;
}
.float bot_secondary_riflemooth;
-float W_Rifle(float req)
+bool W_Rifle(int req)
{
float ammo_amount;
}
#endif
#ifdef CSQC
-float W_Rifle(float req)
+bool W_Rifle(int req)
{
switch(req)
{
W_RocketPropelledChainsaw_Explode();
}
-void W_RocketPropelledChainsaw_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_RocketPropelledChainsaw_Damage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if (self.health <= 0)
return;
other = missile; MUTATOR_CALLHOOK(EditProjectile);
}
-float W_RocketPropelledChainsaw(float req)
+bool W_RocketPropelledChainsaw(int req)
{
float ammo_amount = false;
switch(req)
#endif
#ifdef CSQC
-float W_RocketPropelledChainsaw(float req)
+bool W_RocketPropelledChainsaw(int req)
{
switch(req)
{
-void W_Seeker_Missile_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Seeker_Missile_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.health <= 0)
return;
remove(self);
}
-void W_Seeker_Tag_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void W_Seeker_Tag_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.health <= 0)
return;
// Begin: Genereal weapon functions
// ============================
-float W_Seeker(float req)
+bool W_Seeker(int req)
{
float ammo_amount;
}
#endif
#ifdef CSQC
-float W_Seeker(float req)
+bool W_Seeker(int req)
{
switch(req)
{
}
}
-float W_Shockwave(float req)
+bool W_Shockwave(int req)
{
switch(req)
{
shockwave.sw_time = time;
}
-float W_Shockwave(float req)
+bool W_Shockwave(int req)
{
switch(req)
{
#ifdef SVQC
void spawnfunc_weapon_tuba(void) { weapon_defaultspawnfunc(WEP_TUBA); }
-float W_Tuba_HasPlayed(entity pl, string melody, float instrument, float ignorepitch, float mintempo, float maxtempo)
+bool W_Tuba_HasPlayed(entity pl, string melody, int instrument, bool ignorepitch, float mintempo, float maxtempo)
{
float i, j, mmin, mmax, nolength;
float n = tokenize_console(melody);
remove(self);
}
-float W_Tuba_GetNote(entity pl, float hittype)
+int W_Tuba_GetNote(entity pl, int hittype)
{
float movestate = 5;
if (pl.movement.x < 0) movestate -= 3;
if (pl.movement.y < 0) movestate -= 1;
else if (pl.movement.y > 0) movestate += 1;
- float note = 0;
+ int note = 0;
switch(movestate)
{
// layout: originally I wanted
return note;
}
-float W_Tuba_NoteSendEntity(entity to, float sf)
+bool W_Tuba_NoteSendEntity(entity to, int sf)
{
- float f;
+ int f;
msg_entity = to;
if(!sound_allowed(MSG_ONE, self.realowner))
}
}
-float W_Tuba(float req)
+bool W_Tuba(int req)
{
switch(req)
{
}
#endif
#ifdef CSQC
-float W_Tuba(float req)
+bool W_Tuba(int req)
{
// nothing to do here; particles of tuba are handled differently
// WEAPONTODO
#ifdef SVQC
VORTEX_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
+
+.float vortex_lasthit;
#endif
#else
#ifdef SVQC
}
yoda = 0;
+ damage_goodhits = 0;
FireRailgunBullet(w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, mydmg, myforce, mymindist, mymaxdist, myhalflife, myforcehalflife, WEP_VORTEX);
if(yoda && flying)
Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_YODA);
+ if(damage_goodhits && self.vortex_lasthit)
+ {
+ Send_Notification(NOTIF_ONE, self, MSG_ANNCE, ANNCE_ACHIEVEMENT_IMPRESSIVE);
+ damage_goodhits = 0; // only every second time
+ }
+
+ self.vortex_lasthit = damage_goodhits;
//beam and muzzle flash done on client
SendCSQCVortexBeamParticle(charge);
void spawnfunc_weapon_vortex(void); // defined in t_items.qc
.float vortex_chargepool_pauseregen_finished;
-float W_Vortex(float req)
+bool W_Vortex(int req)
{
float dt;
float ammo_amount;
VORTEX_SETTINGS(WEP_SKIP_CVAR, WEP_SET_PROP);
return true;
}
+ case WR_SETUP:
+ {
+ self.vortex_lasthit = 0;
+ return true;
+ }
case WR_CHECKAMMO1:
{
ammo_amount = self.WEP_AMMO(VORTEX) >= WEP_CVAR_PRI(vortex, ammo);
VORTEX_SETTINGS(WEP_CONFIG_WRITE_CVARS, WEP_CONFIG_WRITE_PROPS);
return true;
}
+ case WR_RESETPLAYER:
+ {
+ self.vortex_lasthit = 0;
+ return true;
+ }
case WR_RELOAD:
{
W_Reload(min(WEP_CVAR_PRI(vortex, ammo), WEP_CVAR_SEC(vortex, ammo)), "weapons/reload.wav");
#endif
#ifdef CSQC
float autocvar_g_balance_vortex_secondary = 0; // WEAPONTODO
-float W_Vortex(float req)
+bool W_Vortex(int req)
{
switch(req)
{
#ifndef MENUQC
#include "calculations.qc"
#endif
-#include "all.qh"
+#include "all.inc"
// WEAPON PLUGIN SYSTEM
entity weapon_info[WEP_MAXCOUNT];
# error Kein Weltraum links auf dem Gerät
#endif
-WepSet WepSet_FromWeapon(float a) {
+WepSet WepSet_FromWeapon(int a) {
a -= WEP_FIRST;
#if WEP_MAXCOUNT > 24
if(a >= 24) {
void register_weapon(
int id,
WepSet bit,
- float(float) func,
- .float ammotype,
- float i,
- float weapontype,
+ bool(int) func,
+ .int ammotype,
+ int i,
+ int weapontype,
float pickupbasevalue,
vector clr,
string modelname,
func(WR_INIT);
#endif
}
-float w_null(float dummy)
+bool w_null(int dummy)
{
return 0;
}
}
string W_NumberWeaponOrder_MapFunc(string s)
{
- float i;
+ int i;
if(s == "0" || stof(s))
return s;
s = W_UndeprecateName(s);
void W_RandomWeapons(entity e, float n)
{
- float i, j;
+ int i, j;
WepSet remaining;
WepSet result;
remaining = e.weapons;
e.weapons = result;
}
-string GetAmmoPicture(.float ammotype)
+string GetAmmoPicture(.int ammotype)
{
switch(ammotype)
{
}
#ifdef CSQC
-.float GetAmmoFieldFromNum(int i)
+.int GetAmmoFieldFromNum(int i)
{
switch(i)
{
}
}
-int GetAmmoStat(.float ammotype)
+int GetAmmoStat(.int ammotype)
{
switch(ammotype)
{
#include "calculations.qh"
#endif
+#include "../util.qh"
+#ifdef SVQC
+#include "../../server/bot/aim.qh"
+#endif
const int MAX_SHOT_DISTANCE = 32768;
// weapon pickup ratings for bot logic
// weapon sets
typedef vector WepSet;
-WepSet WepSet_FromWeapon(float a);
+WepSet WepSet_FromWeapon(int a);
#ifdef SVQC
void WepSet_AddStat();
void WriteWepSet(float dest, WepSet w);
WepSet WEPSET_SUPERWEAPONS;
// functions:
-entity get_weaponinfo(float id);
+entity get_weaponinfo(int id);
string W_FixWeaponOrder(string order, float complete);
string W_UndeprecateName(string s);
string W_NameWeaponOrder(string order);
string W_FixWeaponOrder_ForceComplete(string order);
void W_RandomWeapons(entity e, float n);
-string GetAmmoPicture(.float ammotype);
+string GetAmmoPicture(.int ammotype);
#ifdef CSQC
-.float GetAmmoFieldFromNum(int i);
-int GetAmmoStat(.float ammotype);
+.int GetAmmoFieldFromNum(int i);
+int GetAmmoStat(.int ammotype);
#endif
// ammo types
-.float ammo_shells;
-.float ammo_nails;
-.float ammo_rockets;
-.float ammo_cells;
-.float ammo_plasma;
-.float ammo_fuel;
-.float ammo_none;
+.int ammo_shells;
+.int ammo_nails;
+.int ammo_rockets;
+.int ammo_cells;
+.int ammo_plasma;
+.int ammo_fuel;
+.int ammo_none;
// other useful macros
#define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest)
// Weapon Registration
// =====================
-float w_null(float dummy);
+bool w_null(int dummy);
void register_weapon(
- float id,
+ int id,
WepSet bit,
- float(float) func,
- .float ammotype,
- float i,
- float weapontype,
+ bool(int) func,
+ .int ammotype,
+ int i,
+ int weapontype,
float pickupbasevalue,
vector clr,
string modelname,
.int weapon; // M: WEP_id // WEP_...
.WepSet weapons; // A: WEPSET_id // WEPSET_...
.float(float) weapon_func; // M: function // w_...
-..float ammo_field; // M: ammotype // main ammo field
+..int ammo_field; // M: ammotype // main ammo field
.int impulse; // M: impulse // weapon impulse
.int spawnflags; // M: flags // WEPSPAWNFLAG_... combined
.float bot_pickupbasevalue; // M: rating // bot weapon priority
#define REGISTER_WEAPON_2(id,bit,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) \
int id; \
WepSet bit; \
- float function(float); \
+ bool function(int); \
void RegisterWeapons_##id() \
{ \
WEP_LAST = (id = WEP_FIRST + WEP_COUNT); \
REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname)
#endif
-#include "all.qh"
+#include "all.inc"
#undef WEP_ADD_CVAR_MO_PRI
#undef WEP_ADD_CVAR_MO_SEC
self.frame2time = self.frame1time;
}
}
-void CSQCModel_InterpolateAnimation_PreNote(float sf)
+void CSQCModel_InterpolateAnimation_PreNote(int sf)
{
#ifdef CSQCMODEL_HAVE_TWO_FRAMES
CSQCModel_InterpolateAnimation_2To4_PreNote(sf);
self.frame1time = time;
}
}
-void CSQCModel_InterpolateAnimation_Note(float sf)
+void CSQCModel_InterpolateAnimation_Note(int sf)
{
#ifdef CSQCMODEL_HAVE_TWO_FRAMES
CSQCModel_InterpolateAnimation_2To4_Note(sf, true);
// this is exported for custom frame animation code. Use with care.
// to update frames, first call this:
-void CSQCModel_InterpolateAnimation_2To4_PreNote(float sf);
-void CSQCModel_InterpolateAnimation_1To2_PreNote(float sf);
+void CSQCModel_InterpolateAnimation_2To4_PreNote(int sf);
+void CSQCModel_InterpolateAnimation_1To2_PreNote(int sf);
// then update frame, frame1time (and possibly frame2, frame2time, lerpfrac)
// if set_times is not set, caller is responsible for frame1time, frame2time, csqcmodel_lerpfractime!
-void CSQCModel_InterpolateAnimation_2To4_Note(float sf, float set_times);
-void CSQCModel_InterpolateAnimation_1To2_Note(float sf, float set_times);
+void CSQCModel_InterpolateAnimation_2To4_Note(int sf, float set_times);
+void CSQCModel_InterpolateAnimation_1To2_Note(int sf, float set_times);
// to retrieve animation state, call this
void CSQCModel_InterpolateAnimation_2To4_Do();
void CSQCModel_InterpolateAnimation_1To2_Do();
// generic CSQC model code
-float CSQCModel_Send(entity to, int sf)
+bool CSQCModel_Send(entity to, int sf)
{
// some nice flags for CSQCMODEL_IF
float isplayer = (IS_CLIENT(self));
#pragma noref 1
-/*
-==============================================================================
+#define true _true
+#define false _false
+#define TRUE _TRUE
+#define FALSE _FALSE
- SOURCE FOR GLOBALVARS_T C STRUCTURE
- MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
+#include "upstream/csprogsdefs.qc"
-==============================================================================
-*/
-
-//
-// system globals
-//
-entity self;
-entity other;
-entity world;
-float time;
-float frametime;
-
-int player_localentnum; //the entnum
-int player_localnum; //the playernum
-float maxclients; //a constant filled in by the engine. gah, portability eh?
-
-float clientcommandframe; //player movement
-float servercommandframe; //clientframe echoed off the server
-
-string mapname;
-
-//
-// global variables set by built in functions
-//
-vector v_forward, v_up, v_right; // set by makevectors()
-
-// set by traceline / tracebox
-float trace_allsolid;
-float trace_startsolid;
-float trace_fraction;
-vector trace_endpos;
-vector trace_plane_normal;
-float trace_plane_dist;
-entity trace_ent;
-float trace_inopen;
-float trace_inwater;
-
-//
-// required prog functions
-//
-void() CSQC_Init;
-void() CSQC_Shutdown;
-float(float f, float t, float n) CSQC_InputEvent;
-void(float w, float h) CSQC_UpdateView;
-bool(string s) CSQC_ConsoleCommand;
-
-//these fields are read and set by the default player physics
-vector pmove_org;
-vector pmove_vel;
-vector pmove_mins;
-vector pmove_maxs;
-//retrieved from the current movement commands (read by player physics)
-float input_timelength;
-vector input_angles;
-vector input_movevalues; //forwards, right, up.
-int input_buttons; //attack, use, jump (default physics only uses jump)
-
-float movevar_gravity;
-float movevar_stopspeed;
-float movevar_maxspeed;
-float movevar_spectatormaxspeed; //used by NOCLIP movetypes.
-float movevar_accelerate;
-float movevar_airaccelerate;
-float movevar_wateraccelerate;
-float movevar_friction;
-float movevar_waterfriction;
-float movevar_entgravity; //the local player's gravity field. Is a multiple (1 is the normal value)
-
-//================================================
-void end_sys_globals; // flag for structure dumping
-//================================================
-
-/*
-==============================================================================
-
- SOURCE FOR ENTVARS_T C STRUCTURE
- MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
-
-==============================================================================
-*/
-
-//
-// system fields (*** = do not set in prog code, maintained by C code)
-//
-.int modelindex; // *** model index in the precached list
-.vector absmin, absmax; // *** origin + mins / maxs
-
-.int entnum; // *** the ent number as on the server
-.float drawmask;
-.void() predraw;
-
-.float movetype;
-.float solid;
-
-.vector origin; // ***
-.vector oldorigin; // ***
-.vector velocity;
-.vector angles;
-.vector avelocity;
-
-.string classname; // spawn function
-.string model;
-.int frame;
-.int skin;
-.int effects;
-
-.vector mins, maxs; // bounding box extents reletive to origin
-.vector size; // maxs - mins
-
-.void() touch;
-.void() use;
-.void() think;
-.void() blocked; // for doors or plats, called when can't push other
-
-.float nextthink;
-
-.entity chain;
-
-.string netname;
-
-.entity enemy;
-
-.int flags;
-
-.int colormap;
-
-.entity owner; // who launched a missile
-
-//================================================
-void end_sys_fields; // flag for structure dumping
-//================================================
-
-/*
-==============================================================================
-
- OPTIONAL FIELDS AND GLOBALS
-
-==============================================================================
-*/
-
-// Additional OPTIONAL Fields and Globals
-float intermission; // indicates intermission state (0 = normal, 1 = scores, 2 = finale text)
-
-vector view_angles; // same as input_angles
-vector view_punchangle; // from server
-vector view_punchvector; // from server
-
-/*
-==============================================================================
-
- CONSTANT DEFINITIONS
-
-==============================================================================
-*/
-
-const int MASK_ENGINE = 1;
-const int MASK_ENGINEVIEWMODELS = 2;
-const int MASK_NORMAL = 4;
-
-const int RF_VIEWMODEL = 1;
-const int RF_EXTERNALMODEL = 2;
-const int RF_DEPTHHACK = 4;
-const int RF_ADDITIVE = 8;
-const int RF_USEAXIS = 16;
-
-const int VF_MIN = 1; //(vector)
-const int VF_MIN_X = 2; //(float)
-const int VF_MIN_Y = 3; //(float)
-const int VF_SIZE = 4; //(vector) (viewport size)
-const int VF_SIZE_Y = 5; //(float)
-const int VF_SIZE_X = 6; //(float)
-const int VF_VIEWPORT = 7; //(vector, vector)
-const int VF_FOV = 8; //(vector)
-const int VF_FOVX = 9; //(float)
-const int VF_FOVY = 10; //(float)
-const int VF_ORIGIN = 11; //(vector)
-const int VF_ORIGIN_X = 12; //(float)
-const int VF_ORIGIN_Y = 13; //(float)
-const int VF_ORIGIN_Z = 14; //(float)
-const int VF_ANGLES = 15; //(vector)
-const int VF_ANGLES_X = 16; //(float)
-const int VF_ANGLES_Y = 17; //(float)
-const int VF_ANGLES_Z = 18; //(float)
-const int VF_DRAWWORLD = 19; //(float)
-const int VF_DRAWENGINESBAR = 20; //(float)
-const int VF_DRAWCROSSHAIR = 21; //(float)
-
-const int VF_CL_VIEWANGLES = 33; //(vector)
-const int VF_CL_VIEWANGLES_X = 34; //(float)
-const int VF_CL_VIEWANGLES_Y = 35; //(float)
-const int VF_CL_VIEWANGLES_Z = 36; //(float)
-
-const int VF_PERSPECTIVE = 200;
-
-//const int STAT_HEALTH = 0;
-//const int STAT_WEAPONMODEL = 2;
-//const int STAT_AMMO = 3;
-//const int STAT_ARMOR = 4;
-//const int STAT_WEAPONFRAME = 5;
-//const int STAT_SHELLS = 6;
-//const int STAT_NAILS = 7;
-//const int STAT_ROCKETS = 8;
-//const int STAT_CELLS = 9;
-//const int STAT_ACTIVEWEAPON = 10;
-//const int STAT_TOTALSECRETS = 11;
-//const int STAT_TOTALMONSTERS = 12;
-//const int STAT_SECRETS = 13;
-//const int STAT_MONSTERS = 14;
-//const int STAT_ITEMS = 15;
-//const int STAT_VIEWHEIGHT = 16;
-
-// Quake Sound Constants
-const int CHAN_AUTO = 0;
-const int CHAN_WEAPON = 1;
-const int CHAN_VOICE = 2;
-const int CHAN_ITEM = 3;
-const int CHAN_BODY = 4;
-
-const int ATTN_NONE = 0;
-const int ATTN_NORM = 1;
-const int ATTN_IDLE = 2;
-const int ATTN_STATIC = 3;
-
-// Frik File Constants
-const int FILE_READ = 0;
-const int FILE_APPEND = 1;
-const int FILE_WRITE = 2;
-
-// Quake Point Contents
-const int CONTENT_EMPTY = -1;
-const int CONTENT_SOLID = -2;
-const int CONTENT_WATER = -3;
-const int CONTENT_SLIME = -4;
-const int CONTENT_LAVA = -5;
-const int CONTENT_SKY = -6;
-
-// Quake Solid Constants
-const int SOLID_NOT = 0;
-const int SOLID_TRIGGER = 1;
-const int SOLID_BBOX = 2;
-const int SOLID_SLIDEBOX = 3;
-const int SOLID_BSP = 4;
-const int SOLID_CORPSE = 5;
-
-// Quake Move Constants
-const int MOVE_NORMAL = 0;
-const int MOVE_NOMONSTERS = 1;
-const int MOVE_MISSILE = 2;
-
-const float EXTRA_LOW = -99999999;
-const float EXTRA_HIGH = 99999999;
-
-const vector VEC_1 = '1 1 1';
-const vector VEC_0 = '0 0 0';
-const vector VEC_M1 = '-1 -1 -1';
-
-//const float M_PI = 3.14159265358979323846;
-
-vector VEC_HULL_MIN = '-16 -16 -24';
-vector VEC_HULL_MAX = '16 16 32';
-
-// Quake Temporary Entity Constants
-const int TE_SPIKE = 0;
-const int TE_SUPERSPIKE = 1;
-const int TE_GUNSHOT = 2;
-const int TE_EXPLOSION = 3;
-const int TE_TAREXPLOSION = 4;
-const int TE_LIGHTNING1 = 5;
-const int TE_LIGHTNING2 = 6;
-const int TE_WIZSPIKE = 7;
-const int TE_KNIGHTSPIKE = 8;
-const int TE_LIGHTNING3 = 9;
-const int TE_LAVASPLASH = 10;
-const int TE_TELEPORT = 11;
-const int TE_EXPLOSION2 = 12;
-
-// Darkplaces Additions
-const int TE_EXPLOSIONRGB = 53;
-const int TE_GUNSHOTQUAD = 57;
-const int TE_EXPLOSIONQUAD = 70;
-const int TE_SPIKEQUAD = 58;
-const int TE_SUPERSPIKEQUAD = 59;
-
-// PFlags for Dynamic Lights
-const int PFLAGS_NOSHADOW = 1;
-const int PFLAGS_CORONA = 2;
-const int PFLAGS_FULLDYNAMIC = 128;
-
-const int EF_ADDITIVE = 32;
-const int EF_BLUE = 64;
-const int EF_FLAME = 1024;
-const int EF_FULLBRIGHT = 512;
-const int EF_NODEPTHTEST = 8192;
-const int EF_NODRAW = 16;
-const int EF_NOSHADOW = 4096;
-const int EF_RED = 128;
-const int EF_STARDUST = 2048;
-const int EF_SELECTABLE = 16384;
-
-const int PFL_ONGROUND = 1;
-const int PFL_CROUCH = 2;
-const int PFL_DEAD = 4;
-const int PFL_GIBBED = 8;
-
-// draw flags
-const int DRAWFLAG_NORMAL = 0;
-const int DRAWFLAG_ADDITIVE = 1;
-const int DRAWFLAG_MODULATE = 2;
-const int DRAWFLAG_2XMODULATE = 3;
-const int DRAWFLAG_SCREEN = 4;
-const int DRAWFLAG_MIPMAP = 0x100; // only for R_BeginPolygon
-
-/*
-==============================================================================
-
- BUILTIN DEFINITIONS
- EXTENSIONS ARE NOT ADDED HERE, BUT BELOW!
-
-==============================================================================
-*/
-
-void(vector ang) makevectors = #1;
-void(entity e, vector o) setorigin = #2;
-void(entity e, string m) setmodel = #3;
-void(entity e, vector min, vector max) setsize = #4;
-
-void() break_to_debugger = #6;
-float() random = #7;
-void(entity e, float chan, string samp) sound = #8;
-vector(vector v) normalize = #9;
-void(string e) error = #10;
-void(string e) objerror = #11;
-float(vector v) vlen = #12;
-float(vector v) vectoyaw = #13;
-entity() spawn = #14;
-void(entity e) remove = #15;
-float(vector v1, vector v2, float tryents, entity ignoreentity) traceline = #16;
-
-entity(entity start, .string fld, string match) find = #18;
-void(string s) precache_sound = #19;
-void(string s) precache_model = #20;
-
-entity(vector org, float rad) findradius = #22;
-
-void(string s, ...) dprint = #25;
-string(float f) ftos = #26;
-string(vector v) vtos = #27;
-void() coredump = #28;
-void() traceon = #29;
-void() traceoff = #30;
-void(entity e) eprint = #31;
-// settrace optional
-float(float yaw, float dist, float settrace) walkmove = #32;
-
-float() droptofloor = #34;
-void(float style, string value) lightstyle = #35;
-int(float v) rint = #36;
-int(float v) floor = #37;
-int(float v) ceil = #38;
-
-float(entity e) checkbottom = #40;
-float(vector v) pointcontents = #41;
-
-float(float f) fabs = #43;
-
-float(string s) cvar = #45;
-void(string s, ...) localcmd = #46;
-entity(entity e) nextent = #47;
-void(vector o, vector d, float color, float count) particle = #48;
-void() ChangeYaw = #49;
-
-vector(vector v) vectoangles = #51;
-vector(vector v, vector w) vectoangles2 = #51;
-
-float(float f) sin = #60;
-float(float f) cos = #61;
-float(float f) sqrt = #62;
-void(entity ent) changepitch = #63;
-void(entity e, entity ignore) tracetoss = #64;
-string(entity ent) etos = #65;
-
-string(string s) precache_file = #68;
-void(entity e) makestatic = #69;
-
-void(string name, string value) cvar_set = #72;
-
-void(vector pos, string samp, float vol, float atten) ambientsound = #74;
-string(string s) precache_model2 = #75;
-string(string s) precache_sound2 = #76;
-string(string s) precache_file2 = #77;
-
-float(string s) stof = #81;
-
-
-void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
-vector() randomvec = #91;
-vector(vector org) getlight = #92;
-vector(vector org, float lpflags) getlight2 = #92;
-vector getlight_dir;
-vector getlight_ambient;
-vector getlight_diffuse;
-const float LP_LIGHTMAP = 1;
-const float LP_RTWORLD = 2;
-const float LP_DYNLIGHT = 4;
-const float LP_COMPLETE = 7;
-
-float(string name, string value) registercvar = #93;
-float( float a, ... ) min = #94;
-float( float b, ... ) max = #95;
-float(float minimum, float val, float maximum) bound = #96;
-float(float f, float f) pow = #97;
-entity(entity start, .float fld, float match) findfloat = #98;
-float(string s) checkextension = #99;
-// FrikaC and Telejano range #100-#199
-
-int(string filename, int mode) fopen = #110;
-void(float fhandle) fclose = #111;
-string(float fhandle) fgets = #112;
-void(float fhandle, string s) fputs = #113;
-float(string s) strlen = #114;
-string(...) strcat = #115;
-string(string s, float start, float length) substring = #116;
-vector(string) stov = #117;
-string(string s) strzone = #118;
-void(string s) strunzone = #119;
-
-// FTEQW range #200-#299
-
-float(float number, float quantity) bitshift = #218;
-
-//float(string str, string sub[, float startpos]) strstrofs = #221;
-int(string str, string sub, float startpos) strstrofs = #221;
-int(string str, float ofs) str2chr = #222;
-string(int c, ...) chr2str = #223;
-string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
-string(float chars, string s, ...) strpad = #225;
-string(string info, string key, string value, ...) infoadd = #226;
-string(string info, string key) infoget = #227;
-int(string s1, string s2) strcmp = #228;
-int(string s1, string s2, float len) strncmp = #228;
-int(string s1, string s2) strcasecmp = #229;
-int(string s1, string s2, float len) strncasecmp = #230;
-
-// CSQC range #300-#399
-void() clearscene = #300;
-void(float mask) addentities = #301;
-void(entity ent) addentity = #302;
-float(float property, ...) setproperty = #303;
-float(float property) getproperty = #309;
-vector(float property) getpropertyvec = #309;
-void() renderscene = #304;
-void(vector org, float radius, vector lightcolours) adddynamiclight = #305;
-void(vector org, float radius, vector lightcolours, float style, string cubemapname, float pflags) adddynamiclight2 = #305;
-//void(string texturename, float flag[, float is2d, float lines]) R_BeginPolygon = #306;
-void(string texturename, float flag, ...) R_BeginPolygon = #306;
-void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307;
-void() R_EndPolygon = #308;
-vector (vector v) cs_unproject = #310;
-vector (vector v) cs_project = #311;
-
-void(float width, vector pos1, vector pos2, float flag) drawline = #315;
-float(string name) iscachedpic = #316;
-string(string name, ...) precache_pic = #317;
-string(string name) precache_cubemap = #317;
-vector(string picname) draw_getimagesize = #318;
-void(string name) freepic = #319;
-float(vector position, float character, vector scale, vector rgb, float alpha, float flag) drawcharacter = #320;
-float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring = #321;
-float(vector position, string pic, vector size, vector rgb, float alpha, float flag) drawpic = #322;
-float(vector position, vector size, vector rgb, float alpha, float flag) drawfill = #323;
-void(float x, float y, float width, float height) drawsetcliparea = #324;
-void(void) drawresetcliparea = #325;
-float(vector position, string text, vector scale, float alpha, float flag) drawcolorcodedstring = #326;
-vector(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawcolorcodedstring2 = #326;
-
-float(int stnum) getstatf = #330;
-int(int stnum, ...) getstati = #331; // can optionally take first bit and count
-string(float firststnum) getstats = #332;
-void(entity e, float mdlindex) setmodelindex = #333;
-string(float mdlindex) modelnameforindex = #334;
-int(string effectname) particleeffectnum = #335;
-void(entity ent, float effectnum, vector start, vector end) trailparticles = #336;
-//void(float effectnum, vector origin [, vector dir, float count]) pointparticles = #337;
-void(float effectnum, vector origin , vector dir, float count) pointparticles = #337;
-void(string s, ...) centerprint = #338;
-void(string s, ...) print = #339;
-string(float keynum) keynumtostring = #340;
-float(string keyname) stringtokeynum = #341;
-string(float keynum) getkeybind = #342;
-void(float usecursor) setcursormode = #343;
-vector() getmousepos = #344;
-float(float framenum) getinputstate = #345;
-void(float sens) setsensitivityscale = #346;
-void(...) runstandardplayerphysics = #347; // this may or may not take a player ent
-string(float playernum, string keyname) getplayerkeyvalue = #348;
-float() isdemo = #349;
-float() isserver = #350;
-void(vector origin, vector forward, vector right, vector up) SetListener = #351;
-void(string cmdname) registercommand = #352;
-float(entity ent) wasfreed = #353;
-string(string key) serverkey = #354;
-
-// Use proper case; refer to the id1 Write* functions!
-int() ReadByte = #360;
-int() ReadChar = #361;
-int() ReadShort = #362;
-int() ReadLong = #363;
-float() ReadCoord = #364;
-float() ReadAngle = #365;
-string() ReadString = #366;
-float() ReadFloat = #367;
-
-// LordHavoc's range #400-#499
-void(entity from, entity to) copyentity = #400;
-
-entity(.string fld, string match) findchain = #402;
-entity(.float fld, float match) findchainfloat = #403;
-void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
-void(vector org, vector velocity, float howmany) te_blood = #405;
-void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
-void(vector org, vector color) te_explosionrgb = #407;
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
-void(vector org, vector vel, float howmany) te_spark = #411;
-void(vector org) te_gunshotquad = #412;
-void(vector org) te_spikequad = #413;
-void(vector org) te_superspikequad = #414;
-void(vector org) te_explosionquad = #415;
-void(vector org) te_smallflash = #416;
-void(vector org, float radius, float lifetime, vector color) te_customflash = #417;
-void(vector org) te_gunshot = #418;
-void(vector org) te_spike = #419;
-void(vector org) te_superspike = #420;
-void(vector org) te_explosion = #421;
-void(vector org) te_tarexplosion = #422;
-void(vector org) te_wizspike = #423;
-void(vector org) te_knightspike = #424;
-void(vector org) te_lavasplash = #425;
-void(vector org) te_teleport = #426;
-void(vector org, float colorstart, float colorlength) te_explosion2 = #427;
-void(entity own, vector start, vector end) te_lightning1 = #428;
-void(entity own, vector start, vector end) te_lightning2 = #429;
-void(entity own, vector start, vector end) te_lightning3 = #430;
-void(entity own, vector start, vector end) te_beam = #431;
-void(vector dir) vectorvectors = #432;
-void(vector org) te_plasmaburn = #433;
-//float(entity e, float s) getsurfacenumpoints = #434;
-//vector(entity e, float s, float n) getsurfacepoint = #435;
-//vector(entity e, float s) getsurfacenormal = #436;
-//string(entity e, float s) getsurfacetexture = #437;
-//float(entity e, vector p) getsurfacenearpoint = #438;
-//vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
-
-int(string s) tokenize = #441;
-string(float n) argv = #442;
-void(entity e, entity tagentity, string tagname) setattachment = #443;
-float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
-void(float handle) search_end = #445;
-float(float handle) search_getsize = #446;
-string(float handle, float num) search_getfilename = #447;
-string(string s) cvar_string = #448;
-entity(entity start, .float fld, float match) findflags = #449;
-entity(.float fld, float match) findchainflags = #450;
-int(entity ent, string tagname) gettagindex = #451;
-vector(entity ent, float tagindex) gettaginfo = #452;
-
-void(vector org, vector vel, float howmany) te_flamejet = #457;
-
-entity(float num) entitybyindex = #459;
-int() buf_create = #460;
-void(float bufhandle) buf_del = #461;
-float(float bufhandle) buf_getsize = #462;
-void(float bufhandle_from, float bufhandle_to) buf_copy = #463;
-void(float bufhandle, float sortpower, float backward) buf_sort = #464;
-string(float bufhandle, string glue) buf_implode = #465;
-string(float bufhandle, float string_index) bufstr_get = #466;
-void(float bufhandle, float string_index, string str) bufstr_set = #467;
-float(float bufhandle, string str, float order) bufstr_add = #468;
-void(float bufhandle, float string_index) bufstr_free = #469;
-
-//float(float s) asin = #471;
-//float(float c) acos = #472;
-//float(float t) atan = #473;
-//float(float c, float s) atan2 = #474;
-//float(float a) tan = #475;
-float(string s) strippedstringlen = #476;
-float(string s) strlennocol = #476; // This is the correct name for the function, but not removing the decolorizedstring mapping.
-string(string s) decolorizedstring = #477;
-string(string s) strdecolorize = #477; // This is the correct name for the function, but not removing the decolorizedstring mapping.
-string(float uselocaltime, string format, ...) strftime = #478;
-string(string s) strtolower = #480;
-string(string s) strtoupper = #481;
-string(string s) cvar_defstring = #482;
-void(vector origin, string sample, float volume, float attenuation) pointsound = #483;
-string(string search, string replace, string subject) strreplace = #484;
-string(string search, string replace, string subject) strireplace = #485;
-//vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
-#ifdef SUPPORT_GECKO
-float gecko_create( string name ) = #487;
-void gecko_destroy( string name ) = #488;
-void gecko_navigate( string name, string URI ) = #489;
-float gecko_keyevent( string name, float key, float eventtype ) = #490;
-void gecko_mousemove( string name, float x, float y ) = #491;
-void gecko_resize( string name, float w, float h ) = #492;
-vector gecko_get_texture_extent( string name ) = #493;
-#else
-
-#endif
-
-/*
-==============================================================================
-
- EXTENSION DEFINITIONS
-
-==============================================================================
-*/
-
-// DP_CSQC_SPAWNPARTICLE
-// idea: VorteX
-// darkplaces implementation: VorteX
-// constant definitions:
-// particle base behavior:
-float PT_ALPHASTATIC = 1;
-float PT_STATIC = 2;
-float PT_SPARK = 3;
-float PT_BEAM = 4;
-float PT_RAIN = 5;
-float PT_RAINDECAL = 6;
-float PT_SNOW = 7;
-float PT_BUBBLE = 8;
-float PT_BLOOD = 9;
-float PT_SMOKE = 10;
-float PT_DECAL = 11;
-float PT_ENTITYPARTICLE = 12;
-// particle blendtypes:
-float PBLEND_ALPHA = 0;
-float PBLEND_ADD = 1;
-float PBLEND_INVMOD = 2;
-// particle orientation:
-float PARTICLE_BILLBOARD = 0;
-float PARTICLE_SPARK = 1;
-float PARTICLE_ORIENTED_DOUBLESIDED = 2;
-float PARTICLE_BEAM = 3;
-// global definitions:
-float particle_type; // one of PT_
-float particle_blendmode; // one of PBLEND_ values
-float particle_orientation; // one of PARTICLE_ values
-vector particle_color1;
-vector particle_color2;
-float particle_tex; // number of chunk in particlefont
-float particle_size;
-float particle_sizeincrease;
-float particle_alpha;
-float particle_alphafade;
-float particle_time;
-float particle_gravity;
-float particle_bounce;
-float particle_airfriction;
-float particle_liquidfriction;
-float particle_originjitter;
-float particle_velocityjitter;
-float particle_qualityreduction; // enable culling of this particle when FPS is low
-float particle_stretch;
-vector particle_staincolor1;
-vector particle_staincolor2;
-float particle_staintex;
-float particle_stainalpha;
-float particle_stainsize;
-float particle_delayspawn;
-float particle_delaycollision;
-float particle_angle;
-float particle_spin;
-// builtin definitions:
-float(float max_themes) initparticlespawner = #522; // check fields/globals for integration and enable particle spawner, return 1 is succeded, otherwise returns 0
-void() resetparticle = #523; // reset p_ globals to default theme #0
-void(float theme) particletheme = #524; // restore p_ globals from saved theme
-float() particlethemesave = #525; // save p_ globals to new particletheme and return it's index
-void(float theme) particlethemeupdate = #525; // save p_ globals to new particletheme and return it's index
-void(float theme) particlethemefree = #526; // delete a particle theme
-float(vector org, vector vel) spawnparticle = #527; // returns 0 when failed, 1 when spawned
-float(vector org, vector vel, float theme) quickparticle = #527; // not reading globals, just theme, returns 0 when failed, 1 when spawned
-float(vector org, vector vel, float delay, float collisiondelay) delayedparticle = #528;
-float(vector org, vector vel, float delay, float collisiondelay, float theme) quickdelayedparticle = #528;
-// description: this builtin provides an easy and flexible way to spawn particles,
-// it is not created as replace for DP_SV_POINTPARTICLES but as an addition to it.
-// With this extension you can create a specific particles like rain particles, or entity particles
-// notes:
-// 1) 0 is default particle template, it could be changed
-// 2) color vectors could have value 0-255 of each component
-// restrictions: max themes could be between 4 and 2048
-// warning: you should call initparticlespawner() at very beginning BEFORE all other particle spawner functions
-// function to query particle info
-// don't remove this function as it protects all particle_ globals from FTEQCC/FRIKQCC non-referenced removal optimisation
-void() printparticle =
-{
- // vortex: this also protects from 'non-referenced' optimisation on some compilers
- print("PARTICLE:\n");
- print(strcat(" type: ", ftos(particle_type), "\n"));
- print(strcat(" blendmode: ", ftos(particle_blendmode), "\n"));
- print(strcat(" orientation: ", ftos(particle_orientation), "\n"));
- print(strcat(" color1: ", vtos(particle_color1), "\n"));
- print(strcat(" color2: ", vtos(particle_color2), "\n"));
- print(strcat(" tex: ", ftos(particle_tex), "\n"));
- print(strcat(" size: ", ftos(particle_size), "\n"));
- print(strcat(" sizeincrease: ", ftos(particle_sizeincrease), "\n"));
- print(strcat(" alpha: ", ftos(particle_alpha), "\n"));
- print(strcat(" alphafade: ", ftos(particle_alphafade), "\n"));
- print(strcat(" time: ", ftos(particle_time), "\n"));
- print(strcat(" gravity: ", ftos(particle_gravity), "\n"));
- print(strcat(" bounce: ", ftos(particle_bounce), "\n"));
- print(strcat(" airfriction: ", ftos(particle_airfriction), "\n"));
- print(strcat(" liquidfriction: ", ftos(particle_liquidfriction), "\n"));
- print(strcat(" originjitter: ", ftos(particle_originjitter), "\n"));
- print(strcat(" velocityjitter: ", ftos(particle_velocityjitter), "\n"));
- print(strcat(" qualityreduction: ", ftos(particle_qualityreduction), "\n"));
- print(strcat(" stretch: ", ftos(particle_stretch), "\n"));
- print(strcat(" staincolor1: ", vtos(particle_staincolor1), "\n"));
- print(strcat(" staincolor2: ", vtos(particle_staincolor2), "\n"));
- print(strcat(" staintex: ", ftos(particle_staintex), "\n"));
- print(strcat(" stainalpha: ", ftos(particle_stainalpha), "\n"));
- print(strcat(" stainsize: ", ftos(particle_stainsize), "\n"));
- print(strcat(" delayspawn: ", ftos(particle_delayspawn), "\n"));
- print(strcat(" delaycollision: ", ftos(particle_delaycollision), "\n"));
- print(strcat(" angle: ", ftos(particle_angle), "\n"));
- print(strcat(" spin: ", ftos(particle_spin), "\n"));
-}
-
-// DP_CSQC_ENTITYTRANSPARENTSORTING_OFFSET
-// idea: VorteX
-// darkplaces implementation: VorteX
-float RF_USETRANSPARENTOFFSET = 64; // enables transparent origin offsetting
-// global definitions
-float transparent_offset; // should be set before entity is added
-// description: offset a model's meshes origin used for transparent sorting. Could be used to tweak sorting bugs on very large transparent entities or hacking transparent sorting order for certain objects
-// example: transparent_offset = 1000000; // entity always appear on background of other transparents
-// note: offset is done in view forward axis
-
-// DP_CSQC_ENTITYWORLDOBJECT
-// idea: VorteX
-// darkplaces implementation: VorteX
-const float RF_WORLDOBJECT = 128;
-// description: when renderflag is set, engine will not use culling methods for this entity, e.g. it will always be drawn
-// useful for large outdoor objects (like asteroids on sky horizon or sky models)
-
-// DP_CSQC_ENTITYMODELLIGHT
-// idea: VorteX
-// darkplaces implementation: VorteX
-const float RF_MODELLIGHT = 4096;
-.vector modellight_ambient;
-.vector modellight_diffuse;
-.vector modellight_dir;
-// description: allows CSQC to override directional model lightning on entity
-
-// DP_CSQC_SETPAUSE
-// idea: VorteX
-// darkplaces implementation: VorteX
-// builtin definitions:
-void(float ispaused) setpause = #531;
-// description: provides ability to set pause in local games (similar to one set once console is activated)
-// not stopping sound/cd track, useful for inventory screens, ingame menus with input etc.
-
-// DP_CSQC_QUERYRENDERENTITY
-// idea: VorteX
-// darkplaces implementation: VorteX
-// constant definitions:
-// render entity fields:
-float E_ACTIVE = 0; // float 0/1
-float E_ORIGIN = 1; // vector
-float E_FORWARD = 2; // vector
-float E_RIGHT = 3; // vector
-float E_UP = 4; // vector
-float E_SCALE = 5; // float
-float E_ORIGINANDVECTORS = 6; // returns origin, + sets v_* vectors to orientation
-float E_ALPHA = 7; // float
-float E_COLORMOD = 8; // vector
-float E_PANTSCOLOR = 9; // vector
-float E_SHIRTCOLOR = 10; // vector
-float E_SKIN = 11; // float
-float E_MINS = 12; // vector
-float E_MAXS = 13; // vector
-float E_ABSMIN = 14; // vector
-float E_ABSMAX = 15; // vector
-float E_LIGHT = 16; // vector - modellight
-// builtin definitions:
-float(float entitynum, float fldnum) getentity = #504;
-vector(float entitynum, float fldnum) getentityvec = #504;
-// description: allows to query parms from render entities, especially useful with attaching CSQC ents to
-// server entities networked and interpolated by engine (monsters, players), number of entity is it's SVQC number
-// you can send it via tempentity/CSQC entity message. Note that this builtin doesnt know about entity removing/reallocating
-// so it's meaning to work for short period of time, dont use it on missiles/grenades whatever will be removed next five seconds
-
-//DP_GFX_FONTS
-//idea: Blub\0, divVerent
-//darkplaces implementation: Blub\0
-//console commands:
-// loadfont fontname fontmaps size1 size2 ...
-// A font can simply be gfx/tgafile (freetype fonts doent need extension),
-// or alternatively you can specify multiple fonts and faces
-// Like this: gfx/vera-sans:2,gfx/fallback:1
-// to load face 2 of the font gfx/vera-sans and use face 1
-// of gfx/fallback as fallback font
-// You can also specify a list of font sizes to load, like this:
-// loadfont console gfx/conchars,gfx/fallback 8 12 16 24 32
-// In many cases, 8 12 16 24 32 should be a good choice.
-// for slots see:
-//constant definitions:
-float drawfont; // set it before drawstring()/drawchar() calls
-float FONT_DEFAULT = 0; // 'default'
-float FONT_CONSOLE = 1; // 'console', REALLY should be fixed width (ls!)
-float FONT_SBAR = 2; // 'sbar', used on hud, must be fixed width
-float FONT_NOTIFY = 3; // 'notify', used on sprint/bprint
-float FONT_CHAT = 4; // 'chat'
-float FONT_CENTERPRINT = 5;// 'centerprint'
-float FONT_INFOBAR = 6; // 'infobar'
-float FONT_MENU = 7; // 'menu', should be fixed width
-float FONT_USER0 = 8; // 'user0', userdefined fonts
-float FONT_USER1 = 9; // 'user1', userdefined fonts
-float FONT_USER2 = 10; // 'user2', userdefined fonts
-float FONT_USER3 = 11; // 'user3', userdefined fonts
-float FONT_USER4 = 12; // 'user4', userdefined fonts
-float FONT_USER5 = 13; // 'user5', userdefined fonts
-float FONT_USER6 = 14; // 'user6', userdefined fonts
-float FONT_USER7 = 15; // 'user7' slot, userdefined fonts
-//builtin definitions:
-float findfont(string s) = #356; // find font by fontname and return it's index
-float loadfont(string fontname, string fontmaps, string sizes, float slot, float fix_scale, float fix_voffset) = #357;
-// loads font immediately so stringwidth() function can be used just after builtin call
-// returns a font slotnum (which is used to set drawfont to)
-// first 3 parms are identical to "loadfont" console command ones
-// slot could be one of FONT_ constants or result of findfont() or -1 to not use it
-// if slot is given, font will be loaded to this slotnum and fontname become new title for it
-// this way you can rename user* fonts to something more usable
-// fix_* parms let you fix badly made fonts by applying some transformations to them
-// fix_scale : per-character center-oriented scale (doesn't change line height at all)
-// fix_voffset : vertical offset for each character, it's a multiplier to character height
-float stringwidth(string text, float allowColorCodes, vector size) = #327; // get a width of string with given font and char size
-float stringwidth_menu(string text, float allowColorCodes, vector size) = #468; // in menu.dat it has different builtin #
-//description: engine support for custom fonts in console, hud, qc etc.
-// limits:
-// max 128 chars for font name
-// max 3 font fallbacks
-// max 8 sizes per font
-
-//DP_GFX_FONTS_FREETYPE
-//idea: Blub\0, divVerent
-//darkplaces implementation: Blub\0
-//cvar definitions:
-// r_font_disable_freetype 0/1 : disable freetype fonts loading (uttetly disables freetype library initialization)
-// r_font_antialias 0/1 : antialiasing when loading font
-// r_font_hint 0/1/2/3 : hinting when loading font, 0 is no hinting, 1 light autohinting , 2 full autohinting, 3 full hinting
-// r_font_postprocess_blur X : font outline blur amount
-// r_font_postprocess_outline X : font outline width
-// r_font_postprocess_shadow_x X : font outline shadow x shift amount, applied during outlining
-// r_font_postprocess_shadow_y X : font outline shadow y shift amount, applied during outlining
-// r_font_postprocess_shadow_z X : font outline shadow z shift amount, applied during blurring
-//description: engine support for truetype/freetype fonts
-//so .AFM+.PFB/.OTF/.TTF files could be stuffed as fontmaps in loadfont()
-//(console command version will support them as well)
-
-//DP_CSQC_BINDMAPS
-//idea: daemon, motorsep
-//darkplaces implementation: divVerent
-//builtin definitions:
-string(float key, float bindmap) getkeybind_bindmap = #342;
-float(float key, string bind, float bindmap) setkeybind_bindmap = #630;
-vector(void) getbindmaps = #631;
-float(vector bm) setbindmaps = #632;
-string(string command, float bindmap) findkeysforcommand = #610;
-//<already in EXT_CSQC> float(string key) stringtokeynum = #341;
-//<already in EXT_CSQC> string(float keynum) keynumtostring = #340;
-//description: key bind setting/getting including support for switchable
-//bindmaps.
-
-//DP_CRYPTO
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions: (CSQC)
-float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
-//description:
-//use -1 as buffer handle to justs end delim as postdata
-
-//DP_CSQC_MAINVIEW
-//idea: divVerent
-//darkplaces implementation: divVerent
-//constant definitions:
-const int VF_MAINVIEW = 400;
-//use setproperty(VF_MAINVIEW, 1); before calling R_RenderView for the render
-//that shall become the "main" view, which is e.g. used by PRYDON_CLIENTCURSOR
-//this flag is set for the first scene, and not cleared by R_ClearScene
-//this flag is automatically cleared by R_RenderView
-//so when not using this extension, the first view rendered is the main view
-
-//DP_CSQC_MINFPS_QUALITY
-//idea: divVerent
-//darkplaces implementation: divVerent
-//constant definitions:
-const int VF_MINFPS_QUALITY = 401;
-//use getproperty(VF_MINFPS_QUALITY); to do CSQC based LOD based on cl_minfps
-//1 should lead to an unmodified view
-
-//DP_CSQC_V_CALCREFDEF_WIP1
-//DP_CSQC_V_CALCREFDEF_WIP2
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-void(entity e, float refdefflags) V_CalcRefdef = #640;
-//constant definitions:
-const int PMF_DUCKED = 4;
-const int PMF_ONGROUND = 8;
-const int REFDEFFLAG_TELEPORTED = 1;
-const int REFDEFFLAG_JUMPING = 2;
-const int REFDEFFLAG_DEAD = 4;
-const int REFDEFFLAG_INTERMISSION = 8;
-//- use this on the player entity after performing prediction
-//- pass REFDEFFLAG_TELEPORTED if the player teleported since last frame
-//- pass REFDEFFLAG_JUMPING if jump button is pressed
-//- pass REFDEFFLAG_DEAD if dead (DP_CSQC_V_CALCREFDEF_WIP2)
-//- pass REFDEFFLAG_INTERMISSION if in intermission (DP_CSQC_V_CALCREFDEF_WIP2)
-//- the player entity needs to have origin, velocity, pmove_flags set according
-// to prediction (the above two PMF_ flags are used in the player's pmove_flags)
-//- NOTE: to check for this, ALSO OR a check with DP_CSQC_V_CALCREFDEF to also support
-// the finished extension once done
-
-// assorted builtins
-float drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #328;
-vector drawgetimagesize(string pic) = #318;
-const float SPA_POSITION = 0;
-const float SPA_S_AXIS = 1;
-const float SPA_T_AXIS = 2;
-const float SPA_R_AXIS = 3;
-const float SPA_TEXCOORDS0 = 4;
-const float SPA_LIGHTMAP0_TEXCOORDS = 5;
-const float SPA_LIGHTMAP_COLOR = 6;
-float (entity e, float s) getsurfacenumpoints = #434;
-vector (entity e, float s, float n) getsurfacepoint = #435;
-vector (entity e, float s) getsurfacenormal = #436;
-string (entity e, float s) getsurfacetexture = #437;
-float (entity e, vector p) getsurfacenearpoint = #438;
-vector (entity e, float s, vector p) getsurfaceclippedpoint = #439;
-vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
-float(entity e, float s) getsurfacenumtriangles = #628;
-vector(entity e, float s, float n) getsurfacetriangle = #629;
-
-//DP_QC_ASINACOSATANATAN2TAN
-//idea: Urre
-//darkplaces implementation: LordHavoc
-//constant definitions:
-float DEG2RAD = 0.0174532925199432957692369076848861271344287188854172545609719144;
-float RAD2DEG = 57.2957795130823208767981548141051703324054724665643215491602438612;
-float PI = 3.1415926535897932384626433832795028841971693993751058209749445923;
-//builtin definitions:
-float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5
-float(float c) acos = #472; // returns angle in radians for a given cos() value, the result is in the range 0 to PI
-float(float t) atan = #473; // returns angle in radians for a given tan() value, the result is in the range -PI*0.5 to PI*0.5
-float(float c, float s) atan2 = #474; // returns angle in radians for a given cos() and sin() value pair, the result is in the range -PI to PI (this is identical to vectoyaw except it returns radians rather than degrees)
-float(float a) tan = #475; // returns tangent value (which is simply sin(a)/cos(a)) for the given angle in radians, the result is in the range -infinity to +infinity
-//description:
-//useful math functions for analyzing vectors, note that these all use angles in radians (just like the cos/sin functions) not degrees unlike makevectors/vectoyaw/vectoangles, so be sure to do the appropriate conversions (multiply by DEG2RAD or RAD2DEG as needed).
-//note: atan2 can take unnormalized vectors (just like vectoyaw), and the function was included only for completeness (more often you want vectoyaw or vectoangles), atan2(v_x,v_y) * RAD2DEG gives the same result as vectoyaw(v)
-
-//DP_QC_SPRINTF
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-string(string format, ...) sprintf = #627;
-//description:
-//you know sprintf :P
-//supported stuff:
-// %
-// optional: <argpos>$ for the argument to format
-// flags: #0- +
-// optional: <width>, *, or *<argpos>$ for the field width
-// optional: .<precision>, .*, or .*<argpos>$ for the precision
-// length modifiers: h for forcing a float, l for forcing an int/entity (by default, %d etc. cast a float to int)
-// conversions:
-// d takes a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an int
-// i takes an int/entity if no length is specified or i is, and a float if h is specified as length, and cast it to an int
-// ouxXc take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an unsigned int
-// eEfFgG take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to a double
-// s takes a string
-// vV takes a vector, and processes the three components as if it were a gG for all three components, separated by space
-// For conversions s and c, the flag # makes precision and width interpreted
-// as byte count, by default it is interpreted as character count in UTF-8
-// enabled engines. No other conversions can create wide characters, and #
-// has another meaning in these.
-
-//DP_QC_GETTIME
-//idea: tZork
-//darkplaces implementation: tZork, divVerent
-//constant definitions:
-float GETTIME_FRAMESTART = 0; // time of start of frame
-float GETTIME_REALTIME = 1; // current time (may be OS specific)
-float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision
-float GETTIME_UPTIME = 3; // time since start of the engine
-//builtin definitions:
-float(float tmr) gettime = #519;
-//description:
-//some timers to query...
-
-//DP_QC_GETTIME_CDTRACK
-//idea: divVerent
-//darkplaces implementation: divVerent
-//constant definitions:
-float GETTIME_CDTRACK = 4;
-//description:
-//returns the playing time of the current cdtrack when passed to gettime()
-//see DP_END_GETSOUNDTIME for similar functionality but for entity sound channels
-
-//DP_QC_TOKENIZEBYSEPARATOR
-//idea: Electro, SavageX, LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-int(string s, string separator1, ...) tokenizebyseparator = #479;
-//description:
-//this function returns tokens separated by any of the supplied separator strings, example:
-//numnumbers = tokenizebyseparator("10.2.3.4", ".");
-//returns 4 and the tokens are "10" "2" "3" "4"
-//possibly useful for parsing IPv4 addresses (such as "1.2.3.4") and IPv6 addresses (such as "[1234:5678:9abc:def0:1234:5678:9abc:def0]:26000")
-
-//DP_QC_TOKENIZE_CONSOLE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-int(string s) tokenize_console = #514;
-int(float i) argv_start_index = #515;
-int(float i) argv_end_index = #516;
-//description:
-//this function returns tokens separated just like the console does
-//also, functions are provided to get the index of the first and last character of each token in the original string
-//Passing negative values to them, or to argv, will be treated as indexes from the LAST token (like lists work in Perl). So argv(-1) will return the LAST token.
-
-//DP_SND_SOUND7_WIP1
-//DP_SND_SOUND7_WIP2
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-void(entity e, float chan, string samp, float vol, float atten, float speed, float flags) sound7 = #8;
-float SOUNDFLAG_RELIABLE = 1;
-//description:
-//plays a sound, with some more flags
-//extensions to sound():
-//- channel may be in the range from -128 to 127; channels -128 to 0 are "auto",
-// i.e. support multiple sounds at once, but cannot be stopped/restarted
-//- a value 0 in the speed parameter means no change; otherwise, it is a
-// percentage of playback speed ("pitch shifting"). 100 is normal pitch, 50 is
-// half speed, 200 is double speed, etc. (DP_SND_SOUND7_WIP2)
-//- the flag SOUNDFLAG_RELIABLE can be specified, which makes the sound send
-// to MSG_ALL (reliable) instead of MSG_BROADCAST (unreliable, default);
-// similarily, SOUNDFLAG_RELIABLE_TO_ONE sends to MSG_ONE
-//- channel 0 is controlled by snd_channel0volume; channel 1 and -1 by
-// snd_channel1volume, etc. (so, a channel shares the cvar with its respective
-// auto-channel); however, the mod MUST define snd_channel8volume and upwards
-// in default.cfg if they are to be used, as the engine does not create them
-// to not litter the cvar list
-//- this extension applies to CSQC as well; CSQC_Event_Sound will get speed and
-// flags as extra 7th and 8th argument
-//- WIP2 ideas: SOUNDFLAG_RELIABLE_TO_ONE, SOUNDFLAG_NOPHS, SOUNDFLAG_FORCELOOP
-//- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support
-// the finished extension once done
-
-//DP_PRECACHE_PIC_FLAGS
-//idea: divVerent
-//darkplaces implementation: divVerent
-//constant definitions:
-float PRECACHE_PIC_FROMWAD = 1; // this one actually is part of EXT_CSQC
-float PRECACHE_PIC_NOTPERSISTENT = 2; // picture may get deallocated when unused
-float PRECACHE_PIC_MIPMAP = 8; // mipmap the texture for possibly better downscaling at memory expense
-//notes: these constants are given as optional second argument to precache_pic()
-
-//DP_QC_TRACE_MOVETYPE_WORLDONLY
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//constant definitions:
-float MOVE_WORLDONLY = 3;
-//description:
-//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions
-
-//DP_SND_GETSOUNDTIME
-//idea: VorteX
-//darkplaces implementation: VorteX
-//constant definitions:
-float(entity e, float channel) getsoundtime = #533; // get currently sound playing position on entity channel, -1 if not playing or error
-float(string sample) soundlength = #534; // returns length of sound sample in seconds, -1 on error (sound not precached, sound system not initialized etc.)
-//description: provides opportunity to query length of sound samples and realtime tracking of sound playing on entities (similar to DP_GETTIME_CDTRACK)
-//note: beware dedicated server not running sound engine at all, so in dedicated mode this builtins will not work in server progs
-//note also: menu progs not supporting getsoundtime() (will give a warning) since it has no sound playing on entities
-//examples of use:
-// - QC-driven looped sounds
-// - QC events when sound playing is finished
-// - toggleable ambientsounds
-// - subtitles
-
-//DP_QC_NUM_FOR_EDICT
-//idea: Blub\0
-//darkplaces implementation: Blub\0
-//Function to get the number of an entity - a clean way.
-float(entity num) num_for_edict = #512;
-
-//DP_TRACE_HITCONTENTSMASK_SURFACEINFO
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//globals:
-.int dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
-float trace_dpstartcontents; // DPCONTENTS_ value at start position of trace
-int trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
-int trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
-string trace_dphittexturename; // texture name of impacted surface
-//constants:
-const int DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box
-const int DPCONTENTS_WATER = 2;
-const int DPCONTENTS_SLIME = 4;
-const int DPCONTENTS_LAVA = 8;
-const int DPCONTENTS_SKY = 16;
-const int DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel
-const int DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity
-const int DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn
-const int DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
-const int DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement
-const int DPCONTENTS_DONOTENTER = 1024; // AI hint brush
-const int DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA
-const int DPCONTENTS_BOTCLIP = 2048; // AI hint brush
-const int DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks)
-const int Q3SURFACEFLAG_NODAMAGE = 1;
-const int Q3SURFACEFLAG_SLICK = 2; // low friction surface
-const int Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
-const int Q3SURFACEFLAG_LADDER = 8; // climbable surface
-const int Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
-const int Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky)
-const int Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact
-const int Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc)
-const int Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds
-const int Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds
-const int Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_DUST = 262144; // translucent 'light beam' effect (not important to qc)
-//description:
-//adds additional information after a traceline/tracebox/tracetoss call.
-//also (very important) sets trace_* globals before calling .touch functions,
-//this allows them to inspect the nature of the collision (for example
-//determining if a projectile hit sky), clears trace_* variables for the other
-//object in a touch event (that is to say, a projectile moving will see the
-//trace results in its .touch function, but the player it hit will see very
-//little information in the trace_ variables as it was not moving at the time)
-
-//DP_QC_CVAR_TYPE
-//idea: divVerent
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-float(string name) cvar_type = #495;
-const int CVAR_TYPEFLAG_EXISTS = 1;
-const int CVAR_TYPEFLAG_SAVED = 2;
-const int CVAR_TYPEFLAG_PRIVATE = 4;
-const int CVAR_TYPEFLAG_ENGINE = 8;
-const int CVAR_TYPEFLAG_HASDESCRIPTION = 16;
-const int CVAR_TYPEFLAG_READONLY = 32;
-
-//DP_QC_CRC16
-//idea: divVerent
-//darkplaces implementation: divVerent
-//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
-//When caseinsensitive is set, the CRC is calculated of the lower cased string.
-int(bool caseinsensitive, string s, ...) crc16 = #494;
-
-//DP_QC_URI_ESCAPE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//URI::Escape's functionality
-string(string in) uri_escape = #510;
-string(string in) uri_unescape = #511;
-
-//DP_QC_DIGEST
-//idea: motorsep, Spike
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-string(string digest, string data, ...) digest_hex = #639;
-//description:
-//returns a given hex digest of given data
-//the returned digest is always encoded in hexadecimal
-//only the "MD4" digest is always supported!
-//if the given digest is not supported, string_null is returned
-//the digest string is matched case sensitively, use "MD4", not "md4"!
-
-//DP_QC_DIGEST_SHA256
-//idea: motorsep, Spike
-//DarkPlaces implementation: divVerent
-//description:
-//"SHA256" is also an allowed digest type
-
-//DP_QC_LOG
-//darkplaces implementation: divVerent
-//builtin definitions:
-float log(float f) = #532;
-//description:
-//logarithm
-
-//FTE_CSQC_SKELETONOBJECTS
-//idea: Spike, LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-// all skeleton numbers are 1-based (0 being no skeleton)
-// all bone numbers are 1-based (0 being invalid)
-float(float modlindex) skel_create = #263; // create a skeleton (be sure to assign this value into .skeletonindex for use), returns skeleton index (1 or higher) on success, returns 0 on failure (for example if the modelindex is not skeletal), it is recommended that you create a new skeleton if you change modelindex, as the skeleton uses the hierarchy from the model.
-float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
-float(float skel) skel_get_numbones = #265; // returns how many bones exist in the created skeleton, 0 if skeleton does not exist
-string(float skel, float bonenum) skel_get_bonename = #266; // returns name of bone (as a tempstring), "" if invalid bonenum (< 1 for example) or skeleton does not exist
-int(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
-int(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity
-vector(float skel, float bonenum) skel_get_bonerel = #269; // get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone)
-vector(float skel, float bonenum) skel_get_boneabs = #270; // get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity)
-void(float skel, float bonenum, vector org) skel_set_bone = #271; // set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
-void(float skel, float bonenum, vector org) skel_mul_bone = #272; // transform bone matrix (relative to its parent) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
-void(float skel, float startbone, float endbone, vector org) skel_mul_bones = #273; // transform bone matrices (relative to their parents) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bones)
-void(float skeldst, float skelsrc, float startbone, float endbone) skel_copybones = #274; // copy bone matrices (relative to their parents) from one skeleton to another, useful for copying a skeleton to a corpse
-void(float skel) skel_delete = #275; // deletes skeleton at the beginning of the next frame (you can add the entity, delete the skeleton, renderscene, and it will still work)
-float(float modlindex, string framename) frameforname = #276; // finds number of a specified frame in the animation, returns -1 if no match found
-float(float modlindex, float framenum) frameduration = #277; // returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0.
-//fields:
-.float skeletonindex; // active skeleton overriding standard animation on model
-.int frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
-.int frame2; // secondary framegroup animation (strength = lerpfrac)
-.int frame3; // tertiary framegroup animation (strength = lerpfrac3)
-.int frame4; // quaternary framegroup animation (strength = lerpfrac4)
-.float lerpfrac; // strength of framegroup blend
-.float lerpfrac3; // strength of framegroup blend
-.float lerpfrac4; // strength of framegroup blend
-.float frame1time; // start time of framegroup animation
-.float frame2time; // start time of framegroup animation
-.float frame3time; // start time of framegroup animation
-.float frame4time; // start time of framegroup animation
-//description:
-//this extension provides a way to do complex skeletal animation on an entity.
-//
-//see also DP_SKELETONOBJECTS (this extension implemented on server as well as client)
-//
-//notes:
-//each model contains its own skeleton, reusing a skeleton with incompatible models will yield garbage (or not render).
-//each model contains its own animation data, you can use animations from other model files (for example saving out all character animations as separate model files).
-//if an engine supports loading an animation-only file format such as .md5anim in FTEQW, it can be used to animate any model with a compatible skeleton.
-//proper use of this extension may require understanding matrix transforms (v_forward, v_right, v_up, origin), and you must keep in mind that v_right is negative for this purpose.
-//
-//features include:
-//multiple animations blended together.
-//animating a model with animations from another model with a compatible skeleton.
-//restricting animation blends to certain bones of a model - for example independent animation of legs, torso, head.
-//custom bone controllers - for example making eyes track a target location.
-//
-//
-//
-//example code follows...
-//
-//this helper function lets you identify (by parentage) what group a bone
-//belongs to - for example "torso", "leftarm", would return 1 ("torso") for
-//all children of the bone named "torso", unless they are children of
-//"leftarm" (which is a child of "torso") which would return 2 instead...
-float(float skel, float bonenum, string g1, string g2, string g3, string g4, string g5, string g6) example_skel_findbonegroup =
-{
- string bonename;
- while (bonenum >= 0)
- {
- bonename = skel_get_bonename(skel, bonenum);
- if (bonename == g1) return 1;
- if (bonename == g2) return 2;
- if (bonename == g3) return 3;
- if (bonename == g4) return 4;
- if (bonename == g5) return 5;
- if (bonename == g6) return 6;
- bonenum = skel_get_boneparent(skel, bonenum);
- }
- return 0;
-};
-// create a skeletonindex for our player using current modelindex
-void() example_skel_player_setup =
-{
- self.skeletonindex = skel_create(self.modelindex);
-};
-// setup bones of skeleton based on an animation
-// note: animmodelindex can be a different model than self.modelindex
-void(float animmodelindex, float framegroup, float framegroupstarttime) example_skel_player_update_begin =
-{
- // start with our standard animation
- self.frame = framegroup;
- self.frame2 = 0;
- self.frame3 = 0;
- self.frame4 = 0;
- self.frame1time = framegroupstarttime;
- self.frame2time = 0;
- self.frame3time = 0;
- self.frame4time = 0;
- self.lerpfrac = 0;
- self.lerpfrac3 = 0;
- self.lerpfrac4 = 0;
- skel_build(self.skeletonindex, self, animmodelindex, 0, 0, 100000);
-};
-// apply a different framegroup animation to bones with a specified parent
-void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride =
-{
- self.frame = framegroup;
- self.frame2 = 0;
- self.frame3 = 0;
- self.frame4 = 0;
- self.frame1time = framegroupstarttime;
- self.frame2time = 0;
- self.frame3time = 0;
- self.frame4time = 0;
- self.lerpfrac = 0;
- self.lerpfrac3 = 0;
- self.lerpfrac4 = 0;
- float bonenum = 0;
- float numbones = skel_get_numbones(self.skeletonindex);
- while (bonenum < numbones)
- {
- if (example_skel_findbonegroup(self.skeletonindex, bonenum, groupbonename, excludegroupname1, excludegroupname2, "", "", "") == 1)
- skel_build(self.skeletonindex, self, animmodelindex, 1 - blendalpha, bonenum, bonenum + 1);
- bonenum = bonenum + 1;
- }
-};
-// make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling
-void(vector eyetarget, string bonename) example_skel_player_update_eyetarget =
-{
- float bonenum = skel_find_bone(self.skeletonindex, bonename) - 1;
- if (bonenum < 0)
- return;
- vector oldforward = v_forward;
- vector oldright = v_right;
- vector oldup = v_up;
- vector v = eyetarget - self.origin;
- vector modeleyetarget;
- modeleyetarget.x = v * v_forward;
- modeleyetarget.y = 0-v * v_right;
- modeleyetarget.z = v * v_up;
- // this is an eyeball, make it point at the target location
- // first get all the data we can...
- vector relorg = skel_get_bonerel(self.skeletonindex, bonenum);
- vector relforward = v_forward;
- vector relright = v_right;
- vector relup = v_up;
- vector boneorg = skel_get_boneabs(self.skeletonindex, bonenum);
- vector boneforward = v_forward;
- vector boneright = v_right;
- vector boneup = v_up;
- vector parentorg = skel_get_boneabs(self.skeletonindex, skel_get_boneparent(self.skeletonindex, bonenum));
- vector parentforward = v_forward;
- vector parentright = v_right;
- vector parentup = v_up;
- // get the vector from the eyeball to the target
- vector u = modeleyetarget - boneorg;
- // now transform it inversely by the parent matrix to produce new rel vectors
- v.x = u * parentforward;
- v.y = u * parentright;
- v.z = u * parentup;
- vector ang = vectoangles2(v, relup);
- ang.x = 0 - ang.x;
- makevectors(ang);
- // set the relative bone matrix
- skel_set_bone(self.skeletonindex, bonenum, relorg);
- // restore caller's v_ vectors
- v_forward = oldforward;
- v_right = oldright;
- v_up = oldup;
-};
-// delete skeleton when we're done with it
-// note: skeleton remains valid until next frame when it is really deleted
-void() example_skel_player_delete =
-{
- skel_delete(self.skeletonindex);
- self.skeletonindex = 0;
-};
-//
-// END OF EXAMPLES FOR FTE_CSQC_SKELETONOBJECTS
-//
-
-//DP_QC_ENTITYDATA
-//idea: KrimZon
-//darkplaces implementation: KrimZon
-//builtin definitions:
-float() numentityfields = #496;
-string(float fieldnum) entityfieldname = #497;
-float(float fieldnum) entityfieldtype = #498;
-string(float fieldnum, entity ent) getentityfieldstring = #499;
-float(float fieldnum, entity ent, string s) putentityfieldstring = #500;
-//constants:
-//Returned by entityfieldtype
-float FIELD_STRING = 1;
-float FIELD_FLOAT = 2;
-float FIELD_VECTOR = 3;
-float FIELD_ENTITY = 4;
-float FIELD_FUNCTION = 6;
-//description:
-//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.
-//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.
-//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
-//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.
-//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.
-//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
-//putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
-
-//DP_QC_ENTITYSTRING
-void(string s) loadfromdata = #529;
-void(string s) loadfromfile = #530;
-void(string s) callfunction = #605;
-void(float fh, entity e) writetofile = #606;
-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;
-//const int STAT_FRAGLIMIT = 235;
-//const int STAT_TIMELIMIT = 236;
-//const int STAT_MOVEVARS_GRAVITY = 242;
-string(void) ReadPicture = #501;
-const int PARTICLES_USEALPHA = 1;
-float particles_alphamin, particles_alphamax;
-const int PARTICLES_USECOLOR = 2;
-vector particles_colormin, particles_colormax;
-const int PARTICLES_USEFADE = 4; // fades the COUNT (fade alpha using alphamin/alphamax)
-float particles_fade;
-const int PARTICLES_DRAWASTRAIL = 128;
-void(float effectindex, entity own, vector org_from, vector org_to, vector dir_from, vector dir_to, float countmultiplier, float flags) boxparticles = #502;
-float trace_networkentity;
-const int RF_FULLBRIGHT = 256;
-const int RF_NOSHADOW = 512;
-const int RF_DYNAMICMODELLIGHT = 8192;
-
-float gettaginfo_parent;
-string gettaginfo_name;
-vector gettaginfo_offset;
-vector gettaginfo_forward;
-vector gettaginfo_right;
-vector gettaginfo_up;
-float checkpvs(vector viewpos, entity viewee) = #240;
+#undef true
+#undef false
+#undef TRUE
+#undef FALSE
#pragma noref 0
#ifndef DPEXTENSIONS_H
#define DPEXTENSIONS_H
-//DarkPlaces supported extension list, draft version 1.04
-//things that don't have extensions yet:
-.float disableclientprediction;
+#pragma noref 1
-//definitions that id Software left out:
-//these are passed as the 'nomonsters' parameter to traceline/tracebox (yes really this was supported in all quake engines, nomonsters is misnamed)
-float MOVE_NORMAL = 0; // same as false
-float MOVE_NOMONSTERS = 1; // same as true
-float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
+#include "upstream/dpextensions.qc"
-//checkextension function
-//idea: expected by almost everyone
-//darkplaces implementation: LordHavoc
-float(string s) checkextension = #99;
-//description:
-//check if (cvar("pr_checkextension")) before calling this, this is the only
-//guaranteed extension to be present in the extension system, it allows you
-//to check if an extension is available, by name, to check for an extension
-//use code like this:
-//// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere)
-//if (cvar("pr_checkextension"))
-//if (checkextension("DP_SV_SETCOLOR"))
-// ext_setcolor = true;
-//from then on you can check ext_setcolor to know if that extension is available
+int(entity ent, string tagname) _gettagindex = #451;
+#define gettagindex _gettagindex
-//BX_WAL_SUPPORT
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//description:
-//indicates the engine supports .wal textures for filenames in the textures/ directory
-//(note: DarkPlaces has supported this since 2001 or 2002, but did not advertise it as an extension, then I noticed Betwix was advertising it and added the extension accordingly)
+int(string effectname) _particleeffectnum = #335;
+#define particleeffectnum _particleeffectnum
-//DP_BUTTONCHAT
-//idea: Vermeulen
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float buttonchat;
-//description:
-//true if the player is currently chatting (in messagemode, menus or console)
+int(string s, string separator1, ...) _tokenizebyseparator = #479;
+#define tokenizebyseparator _tokenizebyseparator
-//DP_BUTTONUSE
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float buttonuse;
-//client console commands:
-//+use
-//-use
-//description:
-//made +use and -use commands work, they now control the .buttonuse field (.button1 was used by many mods for other purposes).
+int(string s) _tokenize_console = #514;
+#define tokenize_console _tokenize_console
-//DP_CL_LOADSKY
-//idea: Nehahra, LordHavoc
-//darkplaces implementation: LordHavoc
-//client console commands:
-//"loadsky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, use "" to revert to quake sky, note: this is the same as Quake2 skybox naming)
-//description:
-//sets global skybox for the map for this client (can be stuffed to a client by QC), does not hurt much to repeatedly execute this command, please don't use this in mods if it can be avoided (only if changing skybox is REALLY needed, otherwise please use DP_GFX_SKYBOX).
+int(int i) _argv_start_index = #515;
+#define argv_start_index _argv_start_index
-//DP_CON_SET
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//description:
-//indicates this engine supports the "set" console command which creates or sets a non-archived cvar (not saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
+int(int i) _argv_end_index = #516;
+#define argv_end_index _argv_end_index
-//DP_CON_SETA
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//description:
-//indicates this engine supports the "seta" console command which creates or sets an archived cvar (saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
+int(string s) _strlen = #114;
+#define strlen _strlen
-//DP_CON_ALIASPARAMETERS
-//idea: many
-//darkplaces implementation: Black
-//description:
-//indicates this engine supports aliases containing $1 through $9 parameter macros (which when called will expand to the parameters passed to the alias, for example alias test "say $2 $1", then you can type test hi there and it will execute say there hi), as well as $0 (name of the alias) and $* (all parameters $1 onward).
+float(float skel, float bonenum) _skel_get_boneparent = #267;
+#define skel_get_boneparent _skel_get_boneparent
-//DP_CON_EXPANDCVAR
-//idea: many, PHP
-//darkplaces implementation: Black
-//description:
-//indicates this engine supports console commandlines containing $cvarname which will expand to the contents of that cvar as a parameter, for instance say my fov is $fov, will say "my fov is 90", or similar.
+float(float skel, string tagname) _skel_find_bone = #268;
+#define skel_find_bone _skel_find_bone
-//DP_CON_STARTMAP
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//adds two engine-called aliases named startmap_sp and startmap_dm which are called when the engine tries to start a singleplayer game from the menu (startmap_sp) or the -listen or -dedicated options are used or the engine is a dedicated server (uses startmap_dm), these allow a mod or game to specify their own map instead of start, and also distinguish between singleplayer and -listen/-dedicated, also these need not be a simple "map start" command, they can do other things if desired, startmap_sp and startmap_dm both default to "map start".
+float(string str, string sub, float startpos) _strstrofs = #221;
+#define strstrofs _strstrofs
-//DP_EF_ADDITIVE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_ADDITIVE = 32;
-//description:
-//additive blending when this object is rendered
+float(string str, float ofs) _str2chr = #222;
+#define str2chr _str2chr
-//DP_EF_BLUE
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_BLUE = 64;
-//description:
-//entity emits blue light (used for quad)
+string(int c, ...) _chr2str = #223;
+#define chr2str _chr2str
-//DP_EF_DOUBLESIDED
-//idea: LordHavoc
-//darkplaces implementation: [515] and LordHavoc
-//effects bit:
-const int EF_DOUBLESIDED = 32768;
-//description:
-//render entity as double sided (backfaces are visible, I.E. you see the 'interior' of the model, rather than just the front), can be occasionally useful on transparent stuff.
+int(string s1, string s2) _strcmp = #228;
+#define strcmp _strcmp
-//DP_EF_DYNAMICMODELLIGHT
-//idea: C.Brutail, divVerent, maikmerten
-//darkplaces implementation: divVerent
-//effects bit:
-const int EF_DYNAMICMODELLIGHT = 131072;
-//description:
-//force dynamic model light on the entity, even if it's a BSP model (or anything else with lightmaps or light colors)
+int(string s1, string s2, int len) _strncmp = #228;
+#define strncmp _strncmp
-//DP_EF_FLAME
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_FLAME = 1024;
-//description:
-//entity is on fire
+int(string s1, string s2) _strcasecmp = #229;
+#define strcasecmp _strcasecmp
-//DP_EF_FULLBRIGHT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_FULLBRIGHT = 512;
-//description:
-//entity is always brightly lit
+int(string s1, string s2, int len) _strncasecmp = #230;
+#define strncasecmp _strncasecmp
-//DP_EF_NODEPTHTEST
-//idea: Supa
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_NODEPTHTEST = 8192;
-//description:
-//makes entity show up to client even through walls, useful with EF_ADDITIVE for special indicators like where team bases are in a map, so that people don't get lost
+int() _buf_create = #460;
+#define buf_create _buf_create
-//DP_EF_NODRAW
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_NODRAW = 16;
-//description:
-//prevents server from sending entity to client (forced invisible, even if it would have been a light source or other such things)
+#pragma noref 0
-//DP_EF_NOGUNBOB
-//idea: Chris Page, Dresk
-//darkplaces implementation: LordHAvoc
-//effects bit:
-const int EF_NOGUNBOB = 256;
-//description:
-//this has different meanings depending on the entity it is used on:
-//player entity - prevents gun bobbing on player.viewmodel
-//viewmodelforclient entity - prevents gun bobbing on an entity attached to the player's view
-//other entities - no effect
-//uses:
-//disabling gun bobbing on a diving mask or other model used as a .viewmodel.
-//disabling gun bobbing on view-relative models meant to be part of the heads up display. (note: if fov is changed these entities may be off-screen, or too near the center of the screen, so use fov 90 in this case)
-
-//DP_EF_NOSHADOW
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_NOSHADOW = 4096;
-//description:
-//realtime lights will not cast shadows from this entity (but can still illuminate it)
-
-//DP_EF_RED
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_RED = 128;
-//description:
-//entity emits red light (used for invulnerability)
-
-//DP_EF_RESTARTANIM_BIT
-//idea: id software
-//darkplaces implementation: divVerent
-//effects bit:
-const int EF_RESTARTANIM_BIT = 1048576;
-//description:
-//when toggled, the current animation is restarted. Useful for weapon animation.
-//to toggle this bit in QC, you can do:
-// self.effects += (EF_RESTARTANIM_BIT - 2 * (self.effects & EF_RESTARTANIM_BIT));
-
-//DP_EF_STARDUST
-//idea: MythWorks Inc
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_STARDUST = 2048;
-//description:
-//entity emits bouncing sparkles in every direction
-
-//DP_EF_TELEPORT_BIT
-//idea: id software
-//darkplaces implementation: divVerent
-//effects bit:
-const int EF_TELEPORT_BIT = 2097152;
-//description:
-//when toggled, interpolation of the entity is skipped for one frame. Useful for teleporting.
-//to toggle this bit in QC, you can do:
-// self.effects += (EF_TELEPORT_BIT - 2 * (self.effects & EF_TELEPORT_BIT));
-
-//DP_ENT_ALPHA
-//idea: Nehahra
-//darkplaces implementation: LordHavoc
-//fields:
-.float alpha;
-//description:
-//controls opacity of the entity, 0.0 is forced to be 1.0 (otherwise everything would be invisible), use -1 if you want to make something invisible, 1.0 is solid (like normal).
-
-//DP_ENT_COLORMOD
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definition:
-.vector colormod;
-//description:
-//controls color of the entity, '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, for instance using '1 0.6 0.4' on an ogre would give you an orange ogre (order is red green blue), note the colors can go up to '8 8 8' (8x as bright as normal).
-
-//DP_ENT_CUSTOMCOLORMAP
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//if .colormap is set to 1024 + pants + shirt * 16, those colors will be used for colormapping the entity, rather than looking up a colormap by player number.
-
-/*
-//NOTE: no longer supported by darkplaces because all entities are delta compressed now
-//DP_ENT_DELTACOMPRESS // no longer supported
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-float EF_DELTA = 8388608;
-//description:
-//(obsolete) applies delta compression to the network updates of the entity, making updates smaller, this might cause some unreliable behavior in packet loss situations, so it should only be used on numerous (nails/plasma shots/etc) or unimportant objects (gibs/shell casings/bullet holes/etc).
-*/
-
-//DP_ENT_EXTERIORMODELTOCLIENT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//fields:
-.entity exteriormodeltoclient;
-//description:
-//the entity is visible to all clients with one exception: if the specified client is using first person view (not using chase_active) the entity will not be shown. Also if tag attachments are supported any entities attached to the player entity will not be drawn in first person.
-
-//DP_ENT_GLOW
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float glow_color;
-.float glow_size;
-.float glow_trail;
-//description:
-//customizable glowing light effect on the entity, glow_color is a paletted (8bit) color in the range 0-255 (note: 0 and 254 are white), glow_size is 0 or higher (up to the engine what limit to cap it to, darkplaces imposes a 1020 limit), if glow_trail is true it will leave a trail of particles of the same color as the light.
-
-//DP_ENT_GLOWMOD
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definition:
-.vector glowmod;
-//description:
-//controls color of the entity's glow texture (fullbrights), '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, see colormod (same color restrictions apply).
-
-//DP_ENT_LOWPRECISION
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_LOWPRECISION = 4194304;
-//description:
-//uses low quality origin coordinates, reducing network traffic compared to the default high precision, intended for numerous objects (projectiles/gibs/bullet holes/etc).
-
-//DP_ENT_SCALE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float scale;
-//description:
-//controls rendering scale of the object, 0 is forced to be 1, darkplaces uses 1/16th accuracy and a limit of 15.9375, can be used to make an object larger or smaller.
-
-//DP_ENT_TRAILEFFECTNUM
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float traileffectnum;
-//description:
-//use a custom effectinfo.txt effect on this entity, assign it like this:
-//self.traileffectnum = particleeffectnum("mycustomeffect");
-//this will do both the dlight and particle trail as described in the effect, basically equivalent to trailparticles() in CSQC but performed on a server entity.
-
-//DP_ENT_VIEWMODEL
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.entity viewmodelforclient;
-//description:
-//this is a very special capability, attachs the entity to the view of the client specified, origin and angles become relative to the view of that client, all effects can be used (multiple skins on a weapon model etc)... the entity is not visible to any other client.
-
-//DP_GFX_EXTERNALTEXTURES
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//loads external textures found in various directories (tenebrae compatible)...
-/*
-in all examples .tga is merely the base texture, it can be any of these:
-.tga (base texture)
-_glow.tga (fullbrights or other glowing overlay stuff, NOTE: this is done using additive blend, not alpha)
-_pants.tga (pants overlay for colormapping on models, this should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend)
-_shirt.tga (same idea as pants, but for shirt color)
-_diffuse.tga (this may be used instead of base texture for per pixel lighting)
-_gloss.tga (specular texture for per pixel lighting, note this can be in color (tenebrae only supports greyscale))
-_norm.tga (normalmap texture for per pixel lighting)
-_bump.tga (bumpmap, converted to normalmap at load time, supported only for reasons of tenebrae compatibility)
-_luma.tga (same as _glow but supported only for reasons of tenebrae compatibility)
-
-due to glquake's incomplete Targa(r) loader, this section describes
-required Targa(r) features support:
-types:
-type 1 (uncompressed 8bit paletted with 24bit/32bit palette)
-type 2 (uncompressed 24bit/32bit true color, glquake supported this)
-type 3 (uncompressed 8bit greyscale)
-type 9 (RLE compressed 8bit paletted with 24bit/32bit palette)
-type 10 (RLE compressed 24bit/32bit true color, glquake supported this)
-type 11 (RLE compressed 8bit greyscale)
-attribute bit 0x20 (Origin At Top Left, top to bottom, left to right)
-
-image formats guaranteed to be supported: tga, pcx, lmp
-image formats that are optional: png, jpg
-
-mdl/spr/spr32 examples:
-skins are named _A (A being a number) and skingroups are named like _A_B
-these act as suffixes on the model name...
-example names for skin _2_1 of model "progs/armor.mdl":
-game/override/progs/armor.mdl_2_1.tga
-game/textures/progs/armor.mdl_2_1.tga
-game/progs/armor.mdl_2_1.tga
-example names for skin _0 of the model "progs/armor.mdl":
-game/override/progs/armor.mdl_0.tga
-game/textures/progs/armor.mdl_0.tga
-game/progs/armor.mdl_0.tga
-note that there can be more skins files (of the _0 naming) than the mdl
-contains, this is only useful to save space in the .mdl file if classic quake
-compatibility is not a concern.
-
-bsp/md2/md3 examples:
-example names for the texture "quake" of model "maps/start.bsp":
-game/override/quake.tga
-game/textures/quake.tga
-game/quake.tga
-
-sbar/menu/console textures: for example the texture "conchars" (console font) in gfx.wad
-game/override/gfx/conchars.tga
-game/textures/gfx/conchars.tga
-game/gfx/conchars.tga
-*/
-
-//DP_GFX_EXTERNALTEXTURES_PERMAPTEXTURES
-//idea: Fuh?
-//darkplaces implementation: LordHavoc
-//description:
-//Q1BSP and HLBSP map loading loads external textures found in textures/<mapname>/ as well as textures/.
-//Where mapname is the bsp filename minus the extension (typically .bsp) and minus maps/ if it is in maps/ (any other path is not removed)
-//example:
-//maps/e1m1.bsp uses textures in the directory textures/e1m1/ and falls back to textures/
-//maps/b_batt0.bsp uses textures in the directory textures/b_batt0.bsp and falls back to textures/
-//as a more extreme example:
-//progs/something/blah.bsp uses textures in the directory textures/progs/something/blah/ and falls back to textures/
-
-//DP_GFX_FOG
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//worldspawn fields:
-//"fog" (parameters: "density red green blue", example: "0.1 0.3 0.3 0.3")
-//description:
-//global fog for the map, can not be changed by QC
-
-//DP_GFX_QUAKE3MODELTAGS
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//field definitions:
-.entity tag_entity; // entity this is attached to (call setattachment to set this)
-.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any) (call setattachment to set this)
-//builtin definitions:
-void(entity e, entity tagentity, string tagname) setattachment = #443; // attachs e to a tag on tagentity (note: use "" to attach to entity origin/angles instead of a tag)
-//description:
-//allows entities to be visually attached to model tags (which follow animations perfectly) on other entities, for example attaching a weapon to a player's hand, or upper body attached to lower body, allowing it to change angles and frame separately (note: origin and angles are relative to the tag, use '0 0 0' for both if you want it to follow exactly, this is similar to viewmodelforclient's behavior).
-//note 2: if the tag is not found, it defaults to "" (attach to origin/angles of entity)
-//note 3: attaching to world turns off attachment
-//note 4: the entity that this is attached to must be visible for this to work
-//note 5: if an entity is attached to the player entity it will not be drawn in first person.
-
-//DP_GFX_SKINFILES
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//alias models (mdl, md2, md3) can have .skin files to replace conventional texture naming, these have a naming format such as:
-//progs/test.md3_0.skin
-//progs/test.md3_1.skin
-//...
-//
-//these files contain replace commands (replace meshname shadername), example:
-//replace "helmet" "progs/test/helmet1.tga" // this is a mesh shader replacement
-//replace "teamstripes" "progs/test/redstripes.tga"
-//replace "visor" "common/nodraw" // this makes the visor mesh invisible
-////it is not possible to rename tags using this format
-//
-//Or the Quake3 syntax (100% compatible with Quake3's .skin files):
-//helmet,progs/test/helmet1.tga // this is a mesh shader replacement
-//teamstripes,progs/test/redstripes.tga
-//visor,common/nodraw // this makes the visor mesh invisible
-//tag_camera, // this defines that the first tag in the model is called tag_camera
-//tag_test, // this defines that the second tag in the model is called tag_test
-//
-//any names that are not replaced are automatically show up as a grey checkerboard to indicate the error status, and "common/nodraw" is a special case that is invisible.
-//this feature is intended to allow multiple skin sets on md3 models (which otherwise only have one skin set).
-//other commands might be added someday but it is not expected.
-
-//DP_GFX_SKYBOX
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//worldspawn fields:
-//"sky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, note: "sky" is also used the same way by Quake2)
-//description:
-//global skybox for the map, can not be changed by QC
-
-//DP_UTF8
-//idea: Blub\0, divVerent
-//darkplaces implementation: Blub\0
-//cvar definitions:
-// utf8_enable: enable utf8 encoding
-//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc.,
-//and count as 1 char for string functions like strlen, substring, etc.
-// note: utf8_enable is run-time cvar, could be changed during execution
-// note: beware that str2chr() could return value bigger than 255 once utf8 is enabled
-
-//DP_HALFLIFE_MAP
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//simply indicates that the engine supports HalfLife maps (BSP version 30, NOT the QER RGBA ones which are also version 30).
-
-//DP_HALFLIFE_MAP_CVAR
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//cvars:
-//halflifebsp 0/1
-//description:
-//engine sets this cvar when loading a map to indicate if it is halflife format or not.
-
-//DP_HALFLIFE_SPRITE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//simply indicates that the engine supports HalfLife sprites.
-
-//DP_INPUTBUTTONS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float button3;
-.float button4;
-.float button5;
-.float button6;
-.float button7;
-.float button8;
-.float button9;
-.float button10;
-.float button11;
-.float button12;
-.float button13;
-.float button14;
-.float button15;
-.float button16;
-//description:
-//set to the state of the +button3, +button4, +button5, +button6, +button7, and +button8 buttons from the client, this does not involve protocol changes (the extra 6 button bits were simply not used).
-//the exact mapping of protocol button bits on the server is:
-//self.button0 = (bits & 1) != 0;
-///* button1 is skipped because mods abuse it as a variable, and accordingly it has no bit */
-//self.button2 = (bits & 2) != 0;
-//self.button3 = (bits & 4) != 0;
-//self.button4 = (bits & 8) != 0;
-//self.button5 = (bits & 16) != 0;
-//self.button6 = (bits & 32) != 0;
-//self.button7 = (bits & 64) != 0;
-//self.button8 = (bits & 128) != 0;
-
-// DP_LIGHTSTYLE_STATICVALUE
-// idea: VorteX
-// darkplaces implementation: VorteX
-// description: allows alternative 'static' lightstyle syntax : "=value"
-// examples: "=0.5", "=2.0", "=2.75"
-// could be used to control switchable lights or making styled lights with brightness > 2
-// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact
-// that other engines (which do not support this extension) could connect to a game and misunderstand this kind of lightstyle syntax
-
-//DP_LITSPRITES
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//indicates this engine supports lighting on sprites, any sprite with ! in its filename (both on disk and in the qc) will be lit rather than having forced EF_FULLBRIGHT (EF_FULLBRIGHT on the entity can still force these sprites to not be lit).
-
-//DP_LITSUPPORT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//indicates this engine loads .lit files for any quake1 format .bsp files it loads to enhance maps with colored lighting.
-//implementation description: these files begin with the header QLIT followed by version number 1 (as little endian 32bit), the rest of the file is a replacement lightmaps lump, except being 3x as large as the lightmaps lump of the map it matches up with (and yes the between-lightmap padding is expanded 3x to keep this consistent), so the lightmap offset in each surface is simply multiplied by 3 during loading to properly index the lit data, and the lit file is loaded instead of the lightmap lump, other renderer changes are needed to display these of course... see the litsupport.zip sample code (almost a tutorial) at http://icculus.org/twilight/darkplaces for more information.
-
-//DP_MONSTERWALK
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//MOVETYPE_WALK is permitted on non-clients, so bots can move smoothly, run off ledges, etc, just like a real player.
-
-//DP_MOVETYPEBOUNCEMISSILE
-//idea: id Software
-//darkplaces implementation: id Software
-//movetype definitions:
-//float MOVETYPE_BOUNCEMISSILE = 11; // already in defs.qc
-//description:
-//MOVETYPE_BOUNCE but without gravity, and with full reflection (no speed loss like grenades have), in other words - bouncing laser bolts.
-
-//DP_MOVETYPEFLYWORLDONLY
-//idea: Samual
-//darkplaces implementation: Samual
-//movetype definitions:
-float MOVETYPE_FLY_WORLDONLY = 33;
-//description:
-//like MOVETYPE_FLY, but does all traces with MOVE_WORLDONLY, and is ignored by MOVETYPE_PUSH. Should only be combined with SOLID_NOT and SOLID_TRIGGER.
-
-//DP_NULL_MODEL
-//idea: Chris
-//darkplaces implementation: divVerent
-//definitions:
-//string dp_null_model = "null";
-//description:
-//setmodel(e, "null"); makes an entity invisible, have a zero bbox, but
-//networked. useful for shared CSQC entities.
-
-//DP_MOVETYPEFOLLOW
-//idea: id Software, LordHavoc (redesigned)
-//darkplaces implementation: LordHavoc
-//movetype definitions:
-float MOVETYPE_FOLLOW = 12;
-//description:
-//MOVETYPE_FOLLOW implemented, this uses existing entity fields in unusual ways:
-//aiment - the entity this is attached to.
-//punchangle - the original angles when the follow began.
-//view_ofs - the relative origin (note that this is un-rotated by punchangle, and that is actually the only purpose of punchangle).
-//v_angle - the relative angles.
-//here's an example of how you would set a bullet hole sprite to follow a bmodel it was created on, even if the bmodel rotates:
-//hole.movetype = MOVETYPE_FOLLOW; // make the hole follow
-//hole.solid = SOLID_NOT; // MOVETYPE_FOLLOW is always non-solid
-//hole.aiment = bmodel; // make the hole follow bmodel
-//hole.punchangle = bmodel.angles; // the original angles of bmodel
-//hole.view_ofs = hole.origin - bmodel.origin; // relative origin
-//hole.v_angle = hole.angles - bmodel.angles; // relative angles
-
-//DP_QC_ASINACOSATANATAN2TAN
-//idea: Urre
-//darkplaces implementation: LordHavoc
-//constant definitions:
-float DEG2RAD = 0.0174532925199432957692369076848861271344287188854172545609719144;
-float RAD2DEG = 57.2957795130823208767981548141051703324054724665643215491602438612;
-float PI = 3.1415926535897932384626433832795028841971693993751058209749445923;
-//builtin definitions:
-float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5
-float(float c) acos = #472; // returns angle in radians for a given cos() value, the result is in the range 0 to PI
-float(float t) atan = #473; // returns angle in radians for a given tan() value, the result is in the range -PI*0.5 to PI*0.5
-float(float c, float s) atan2 = #474; // returns angle in radians for a given cos() and sin() value pair, the result is in the range -PI to PI (this is identical to vectoyaw except it returns radians rather than degrees)
-float(float a) tan = #475; // returns tangent value (which is simply sin(a)/cos(a)) for the given angle in radians, the result is in the range -infinity to +infinity
-//description:
-//useful math functions for analyzing vectors, note that these all use angles in radians (just like the cos/sin functions) not degrees unlike makevectors/vectoyaw/vectoangles, so be sure to do the appropriate conversions (multiply by DEG2RAD or RAD2DEG as needed).
-//note: atan2 can take unnormalized vectors (just like vectoyaw), and the function was included only for completeness (more often you want vectoyaw or vectoangles), atan2(v_x,v_y) * RAD2DEG gives the same result as vectoyaw(v)
-
-//DP_QC_AUTOCVARS
-//idea: divVerent
-//darkplaces implementation: divVerent
-//description:
-//allows QC variables to be bound to cvars
-//(works for float, string, vector types)
-//example:
-// float autocvar_developer;
-// float autocvar_registered;
-// string autocvar__cl_name;
-//NOTE: copying a string-typed autocvar to another variable/field, and then
-//changing the cvar or returning from progs is UNDEFINED. Writing to autocvar
-//globals is UNDEFINED. Accessing autocvar globals after changing that cvar in
-//the same frame by any means other than cvar_set() from the same QC VM is
-//IMPLEMENTATION DEFINED (an implementation may either yield the previous, or
-//the current, value). Changing them via cvar_set() in the same QC VM
-//immediately must reflect on the autocvar globals. Whether autocvar globals,
-//after restoring a savegame, have the cvar's current value, or the original
-//value at time of saving, is UNDEFINED. Restoring a savegame however must not
-//restore the cvar values themselves.
-//In case the cvar does NOT exist, then it is automatically created with the
-//value of the autocvar initializer, if given. This is possible with e.g.
-//frikqcc and fteqcc the following way:
-// var float autocvar_whatever = 42;
-//If no initializer is given, the cvar will be initialized to a string
-//equivalent to the NULL value of the given data type, that is, the empty
-//string, 0, or '0 0 0'. However, when automatic cvar creation took place, a
-//warning is printed to the game console.
-//NOTE: to prevent an ambiguity with float names for vector types, autocvar
-//names MUST NOT end with _x, _y or _z!
-
-//DP_QC_CHANGEPITCH
-//idea: id Software
-//darkplaces implementation: id Software
-//field definitions:
-.float idealpitch;
-.float pitch_speed;
-//builtin definitions:
-void(entity ent) changepitch = #63;
-//description:
-//equivalent to changeyaw, ent is normally self. (this was a Q2 builtin)
-
-//DP_QC_COPYENTITY
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(entity from, entity to) copyentity = #400;
-//description:
-//copies all data in the entity to another entity.
-
-//DP_QC_CRC16
-//idea: divVerent
-//darkplaces implementation: divVerent
-//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
-//When caseinsensitive is set, the CRC is calculated of the lower cased string.
-float(float caseinsensitive, string s, ...) crc16 = #494;
-
-//DP_QC_CVAR_DEFSTRING
-//idea: id Software (Doom3), LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-string(string s) cvar_defstring = #482;
-//description:
-//returns the default value of a cvar, as a tempstring.
-
-//DP_QC_CVAR_DESCRIPTION
-//idea: divVerent
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-string(string name) cvar_description = #518;
-//description:
-//returns the description of a cvar
-
-//DP_QC_CVAR_STRING
-//idea: VorteX
-//DarkPlaces implementation: VorteX, LordHavoc
-//builtin definitions:
-string(string s) cvar_string = #448;
-//description:
-//returns the value of a cvar, as a tempstring.
-
-//DP_QC_CVAR_TYPE
-//idea: divVerent
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-float(string name) cvar_type = #495;
-float CVAR_TYPEFLAG_EXISTS = 1;
-float CVAR_TYPEFLAG_SAVED = 2;
-float CVAR_TYPEFLAG_PRIVATE = 4;
-float CVAR_TYPEFLAG_ENGINE = 8;
-float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
-float CVAR_TYPEFLAG_READONLY = 32;
-
-//DP_QC_DIGEST
-//idea: motorsep, Spike
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-string(string digest, string data, ...) digest_hex = #639;
-//description:
-//returns a given hex digest of given data
-//the returned digest is always encoded in hexadecimal
-//only the "MD4" digest is always supported!
-//if the given digest is not supported, string_null is returned
-//the digest string is matched case sensitively, use "MD4", not "md4"!
-
-//DP_QC_DIGEST_SHA256
-//idea: motorsep, Spike
-//DarkPlaces implementation: divVerent
-//description:
-//"SHA256" is also an allowed digest type
-
-//DP_QC_EDICT_NUM
-//idea: 515
-//DarkPlaces implementation: LordHavoc
-//builtin definitions:
-entity(float entnum) edict_num = #459;
-float(entity ent) wasfreed = #353; // same as in EXT_CSQC extension
-//description:
-//edict_num returns the entity corresponding to a given number, this works even for freed entities, but you should call wasfreed(ent) to see if is currently active.
-//wasfreed returns whether an entity slot is currently free (entities that have never spawned are free, entities that have had remove called on them are also free).
-
-//DP_QC_ENTITYDATA
-//idea: KrimZon
-//darkplaces implementation: KrimZon
-//builtin definitions:
-float() numentityfields = #496;
-string(float fieldnum) entityfieldname = #497;
-float(float fieldnum) entityfieldtype = #498;
-string(float fieldnum, entity ent) getentityfieldstring = #499;
-float(float fieldnum, entity ent, string s) putentityfieldstring = #500;
-//constants:
-//Returned by entityfieldtype
-float FIELD_STRING = 1;
-float FIELD_FLOAT = 2;
-float FIELD_VECTOR = 3;
-float FIELD_ENTITY = 4;
-float FIELD_FUNCTION = 6;
-//description:
-//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.
-//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.
-//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
-//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.
-//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.
-//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
-//putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
-
-//DP_QC_ENTITYSTRING
-void(string s) loadfromdata = #529;
-void(string s) loadfromfile = #530;
-void(string s) callfunction = #605;
-void(float fh, entity e) writetofile = #606;
-float(string s) isfunction = #607;
-void(entity e, string s) parseentitydata = #608;
-
-//DP_QC_ETOS
-//idea: id Software
-//darkplaces implementation: id Software
-//builtin definitions:
-string(entity ent) etos = #65;
-//description:
-//prints "entity 1" or similar into a string. (this was a Q2 builtin)
-
-//DP_QC_EXTRESPONSEPACKET
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-string(void) getextresponse = #624;
-//description:
-//returns a string of the form "\"ipaddress:port\" data...", or the NULL string
-//if no packet was found. Packets can be queued into the client/server by
-//sending a packet starting with "\xFF\xFF\xFF\xFFextResponse " to the
-//listening port.
-
-//DP_QC_FINDCHAIN
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(.string fld, string match) findchain = #402;
-//description:
-//similar to find() but returns a chain of entities like findradius.
-
-//DP_QC_FINDCHAIN_TOFIELD
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-entity(.string fld, float match, .entity tofield) findradius_tofield = #22;
-entity(.string fld, string match, .entity tofield) findchain_tofield = #402;
-entity(.string fld, float match, .entity tofield) findchainflags_tofield = #450;
-entity(.string fld, float match, .entity tofield) findchainfloat_tofield = #403;
-//description:
-//similar to findchain() etc, but stores the chain into .tofield instead of .chain
-//actually, the .entity tofield is an optional field of the the existing findchain* functions
-
-//DP_QC_FINDCHAINFLAGS
-//idea: Sajt
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(.float fld, float match) findchainflags = #450;
-//description:
-//similar to findflags() but returns a chain of entities like findradius.
-
-//DP_QC_FINDCHAINFLOAT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(.entity fld, entity match) findchainentity = #403;
-entity(.float fld, float match) findchainfloat = #403;
-//description:
-//similar to findentity()/findfloat() but returns a chain of entities like findradius.
-
-//DP_QC_FINDFLAGS
-//idea: Sajt
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(entity start, .float fld, float match) findflags = #449;
-//description:
-//finds an entity with the specified flag set in the field, similar to find()
-
-//DP_QC_FINDFLOAT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-entity(entity start, .entity fld, entity match) findentity = #98;
-entity(entity start, .float fld, float match) findfloat = #98;
-//description:
-//finds an entity or float field value, similar to find(), but for entity and float fields.
-
-//DP_QC_FS_SEARCH
-//idea: Black
-//darkplaces implementation: Black
-//builtin definitions:
-float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
-void(float handle) search_end = #445;
-float(float handle) search_getsize = #446;
-string(float handle, float num) search_getfilename = #447;
-//description:
-//search_begin performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload).
-//search_end frees a search slot (also done at progs reload).
-//search_getsize returns how many filenames were found.
-//search_getfilename returns a filename from the search.
-
-//DP_QC_GETLIGHT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-vector(vector org) getlight = #92;
-//description:
-//returns the lighting at the requested location (in color), 0-255 range (can exceed 255).
-
-//DP_QC_GETSURFACE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-float(entity e, float s) getsurfacenumpoints = #434;
-vector(entity e, float s, float n) getsurfacepoint = #435;
-vector(entity e, float s) getsurfacenormal = #436;
-string(entity e, float s) getsurfacetexture = #437;
-float(entity e, vector p) getsurfacenearpoint = #438;
-vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
-//description:
-//functions to query surface information.
-
-//DP_QC_GETSURFACEPOINTATTRIBUTE
-//idea: BlackHC
-//darkplaces implementation: BlackHC
-// constants
-float SPA_POSITION = 0;
-float SPA_S_AXIS = 1;
-float SPA_T_AXIS = 2;
-float SPA_R_AXIS = 3; // same as SPA_NORMAL
-float SPA_TEXCOORDS0 = 4;
-float SPA_LIGHTMAP0_TEXCOORDS = 5;
-float SPA_LIGHTMAP0_COLOR = 6;
-//builtin definitions:
-vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
-
-//description:
-//function to query extended information about a point on a certain surface
-
-//DP_QC_GETSURFACETRIANGLE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-float(entity e, float s) getsurfacenumtriangles = #628;
-vector(entity e, float s, float n) getsurfacetriangle = #629;
-//description:
-//function to query triangles of a surface
-
-//DP_QC_GETTAGINFO
-//idea: VorteX, LordHavoc
-//DarkPlaces implementation: VorteX
-//builtin definitions:
-int(entity ent, string tagname) gettagindex = #451;
-vector(entity ent, float tagindex) gettaginfo = #452;
-//description:
-//gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index).
-//gettaginfo returns the origin of the tag in worldspace and sets v_forward, v_right, and v_up to the current orientation of the tag in worldspace, this automatically resolves all dependencies (attachments, including viewmodelforclient), this means you could fire a shot from a tag on a gun entity attached to the view for example.
-
-//DP_QC_GETTAGINFO_BONEPROPERTIES
-//idea: daemon
-//DarkPlaces implementation: divVerent
-//global definitions:
-float gettaginfo_parent;
-string gettaginfo_name;
-vector gettaginfo_offset;
-vector gettaginfo_forward;
-vector gettaginfo_right;
-vector gettaginfo_up;
-//description:
-//when this extension is present, gettaginfo fills in some globals with info about the bone that had been queried
-//gettaginfo_parent is set to the number of the parent bone, or 0 if it is a root bone
-//gettaginfo_name is set to the name of the bone whose index had been specified in gettaginfo
-//gettaginfo_offset, gettaginfo_forward, gettaginfo_right, gettaginfo_up contain the transformation matrix of the bone relative to its parent. Note that the matrix may contain a scaling component.
-
-//DP_QC_GETTIME
-//idea: tZork
-//darkplaces implementation: tZork, divVerent
-//constant definitions:
-float GETTIME_FRAMESTART = 0; // time of start of frame
-float GETTIME_REALTIME = 1; // current time (may be OS specific)
-float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision
-float GETTIME_UPTIME = 3; // time since start of the engine
-//builtin definitions:
-float(float tmr) gettime = #519;
-//description:
-//some timers to query...
-
-//DP_QC_GETTIME_CDTRACK
-//idea: divVerent
-//darkplaces implementation: divVerent
-//constant definitions:
-float GETTIME_CDTRACK = 4;
-//description:
-//returns the playing time of the current cdtrack when passed to gettime()
-//see DP_END_GETSOUNDTIME for similar functionality but for entity sound channels
-
-//DP_QC_I18N
-//idea: divVerent
-//darkplaces implementation: divVerent
-//description:
-//
-//The engine supports translating by gettext compatible .po files.
-//progs.dat uses progs.dat.<LANGUAGE>.po
-//menu.dat uses menu.dat.<LANGUAGE>.po
-//csprogs.dat uses csprogs.dat.<LANGUAGE>.po
-//
-//To create a string that can be translated, define it as
-// string dotranslate_FILENOTFOUND = "File not found";
-//Note: if the compiler does constant folding, this will only work if there is
-//no other "File not found" string in the progs!
-//
-//Alternatively, if using the Xonotic patched fteqcc compiler, you can simplify
-//this by using _("File not found") directly in the source code.
-//
-//The language is set by the "prvm_language" cvar: if prvm_language is set to
-//"de", it will read progs.dat.de.po for translating strings in progs.dat.
-//
-//If prvm_language is set to the special name "dump", progs.dat.pot will be
-//written, which is a translation template to be edited by filling out the
-//msgstr entries.
-
-//DP_QC_LOG
-//darkplaces implementation: divVerent
-//builtin definitions:
-float log(float f) = #532;
-//description:
-//logarithm
-
-//DP_QC_MINMAXBOUND
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-float(float a, float b, ...) min = #94;
-float(float a, float b, float c) min3 = #94;
-float(float a, float b, float c, float d) min4 = #94;
-float(float a, float b, float c, float d, float e) min5 = #94;
-float(float a, float b, float c, float d, float e, float f) min6 = #94;
-float(float a, float b, float c, float d, float e, float f, float g) min7 = #94;
-float(float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94;
-float(float a, float b, ...) max = #95;
-float(float a, float b, float c) max3 = #95;
-float(float a, float b, float c, float d) max4 = #95;
-float(float a, float b, float c, float d, float e) max5 = #95;
-float(float a, float b, float c, float d, float e, float f) max6 = #95;
-float(float a, float b, float c, float d, float e, float f, float g) max7 = #95;
-float(float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95;
-float(float minimum, float val, float maximum) bound = #96;
-//description:
-//min returns the lowest of all the supplied numbers.
-//max returns the highest of all the supplied numbers.
-//bound clamps the value to the range and returns it.
-
-//DP_QC_MULTIPLETEMPSTRINGS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//this extension makes all builtins returning tempstrings (ftos for example)
-//cycle through a pool of multiple tempstrings (at least 16), allowing
-//multiple ftos results to be gathered before putting them to use, normal
-//quake only had 1 tempstring, causing many headaches.
-//
-//Note that for longer term storage (or compatibility on engines having
-//FRIK_FILE but not this extension) the FRIK_FILE extension's
-//strzone/strunzone builtins provide similar functionality (slower though).
-//
-//NOTE: this extension is superseded by DP_QC_UNLIMITEDTEMPSTRINGS
-
-//DP_QC_NUM_FOR_EDICT
-//idea: Blub\0
-//darkplaces implementation: Blub\0
-//Function to get the number of an entity - a clean way.
-float(entity num) num_for_edict = #512;
-
-//DP_QC_RANDOMVEC
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-vector() randomvec = #91;
-//description:
-//returns a vector of length < 1, much quicker version of this QC: do {v_x = random()*2-1;v_y = random()*2-1;v_z = random()*2-1;} while(vlen(v) > 1)
-
-//DP_QC_SINCOSSQRTPOW
-//idea: id Software, LordHavoc
-//darkplaces implementation: id Software, LordHavoc
-//builtin definitions:
-float(float val) sin = #60;
-float(float val) cos = #61;
-float(float val) sqrt = #62;
-float(float a, float b) pow = #97;
-//description:
-//useful math functions, sine of val, cosine of val, square root of val, and raise a to power b, respectively.
-
-//DP_QC_SPRINTF
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-string(string format, ...) sprintf = #627;
-//description:
-//you know sprintf :P
-//supported stuff:
-// %
-// optional: <argpos>$ for the argument to format
-// flags: #0- +
-// optional: <width>, *, or *<argpos>$ for the field width
-// optional: .<precision>, .*, or .*<argpos>$ for the precision
-// length modifiers: h for forcing a float, l for forcing an int/entity (by default, %d etc. cast a float to int)
-// conversions:
-// d takes a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an int
-// i takes an int/entity if no length is specified or i is, and a float if h is specified as length, and cast it to an int
-// ouxXc take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an unsigned int
-// eEfFgG take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to a double
-// s takes a string
-// vV takes a vector, and processes the three components as if it were a gG for all three components, separated by space
-// For conversions s and c, the flag # makes precision and width interpreted
-// as byte count, by default it is interpreted as character count in UTF-8
-// enabled engines. No other conversions can create wide characters, and #
-// has another meaning in these. When in character count mode, color codes
-// are ignored. To get UTF-8 semantics WITHOUT color code parsing, use
-// the + flag.
-
-//DP_QC_STRFTIME
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-string(float uselocaltime, string format, ...) strftime = #478;
-//description:
-//provides the ability to get the local (in your timezone) or world (Universal Coordinated Time) time as a string using the formatting of your choice:
-//example: "%Y-%m-%d %H:%M:%S" (result looks like: 2007-02-08 01:03:15)
-//note: "%F %T" gives the same result as "%Y-%m-%d %H:%M:%S" (ISO 8601 date format and 24-hour time)
-//for more format codes please do a web search for strftime 3 and you should find the man(3) pages for this standard C function.
-//
-//practical uses:
-//changing day/night cycle (shops closing, monsters going on the prowl) in an RPG, for this you probably want to use s = strftime(true, "%H");hour = stof(s);
-//printing current date/time for competitive multiplayer games, such as the beginning/end of each round in real world time.
-//activating eastereggs in singleplayer games on certain dates.
-//
-//note: some codes such as %x and %X use your locale settings and thus may not make sense to international users, it is not advisable to use these as the server and clients may be in different countries.
-//note: if you display local time to a player, it would be a good idea to note whether it is local time using a string like "%F %T (local)", and otherwise use "%F %T (UTC)".
-//note: be aware that if the game is saved and reloaded a week later the date and time will be different, so if activating eastereggs in a singleplayer game or something you may want to only check when a level is loaded and then keep the same easteregg state throughout the level so that the easteregg does not deactivate when reloading from a savegame (also be aware that precaches should not depend on such date/time code because reloading a savegame often scrambles the precaches if so!).
-//note: this function can return a NULL string (you can check for it with if (!s)) if the localtime/gmtime functions returned NULL in the engine code, such as if those functions don't work on this platform (consoles perhaps?), so be aware that this may return nothing.
-
-//DP_QC_STRINGCOLORFUNCTIONS
-//idea: Dresk
-//darkplaces implementation: Dresk
-//builtin definitions:
-float(string s) strlennocol = #476; // returns how many characters are in a string, minus color codes
-string(string s) strdecolorize = #477; // returns a string minus the color codes of the string provided
-//description:
-//provides additional functionality to strings by supporting functions that isolate and identify strings with color codes
-
-//DP_QC_STRING_CASE_FUNCTIONS
-//idea: Dresk
-//darkplaces implementation: LordHavoc / Dresk
-//builtin definitions:
-string(string s) strtolower = #480; // returns the passed in string in pure lowercase form
-string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form
-//description:
-//provides simple string uppercase and lowercase functions
-
-//DP_QC_TOKENIZEBYSEPARATOR
-//idea: Electro, SavageX, LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-int(string s, string separator1, ...) tokenizebyseparator = #479;
-//description:
-//this function returns tokens separated by any of the supplied separator strings, example:
-//numnumbers = tokenizebyseparator("10.2.3.4", ".");
-//returns 4 and the tokens are "10" "2" "3" "4"
-//possibly useful for parsing IPv4 addresses (such as "1.2.3.4") and IPv6 addresses (such as "[1234:5678:9abc:def0:1234:5678:9abc:def0]:26000")
-
-//DP_QC_TOKENIZE_CONSOLE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-int(string s) tokenize_console = #514;
-int(float i) argv_start_index = #515;
-int(float i) argv_end_index = #516;
-//description:
-//this function returns tokens separated just like the console does
-//also, functions are provided to get the index of the first and last character of each token in the original string
-//Passing negative values to them, or to argv, will be treated as indexes from the LAST token (like lists work in Perl). So argv(-1) will return the LAST token.
-
-//DP_QC_TRACEBOX
-//idea: id Software
-//darkplaces implementation: id Software
-//builtin definitions:
-void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
-//description:
-//similar to traceline but much more useful, traces a box of the size specified (technical note: in quake1 and halflife bsp maps the mins and maxs will be rounded up to one of the hull sizes, quake3 bsp does not have this problem, this is the case with normal moving entities as well).
-
-//DP_QC_TRACETOSS
-//idea: id Software
-//darkplaces implementation: id Software
-//builtin definitions:
-void(entity ent, entity ignore) tracetoss = #64;
-//description:
-//simulates movement of the entity as if it is MOVETYPE_TOSS and starting with it's current state (location, velocity, etc), returns relevant trace_ variables (trace_fraction is always 0, all other values are supported - trace_ent, trace_endpos, trace_plane_normal), does not actually alter the entity.
-
-//DP_QC_TRACE_MOVETYPE_HITMODEL
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//constant definitions:
-float MOVE_HITMODEL = 4;
-//description:
-//allows traces to hit alias models (not sprites!) instead of entity boxes, use as the nomonsters parameter to trace functions, note that you can hit invisible model entities (alpha < 0 or EF_NODRAW or model "", it only checks modelindex)
-
-//DP_QC_TRACE_MOVETYPE_WORLDONLY
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//constant definitions:
-float MOVE_WORLDONLY = 3;
-//description:
-//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions
-
-//DP_QC_UNLIMITEDTEMPSTRINGS
-//idea: divVerent
-//darkplaces implementation: LordHavoc
-//description:
-//this extension alters Quake behavior such that instead of reusing a single
-//tempstring (or multiple) there are an unlimited number of tempstrings, which
-//are removed only when a QC function invoked by the engine returns,
-//eliminating almost all imaginable concerns with string handling in QuakeC.
-//
-//in short:
-//you can now use and abuse tempstrings as much as you like, you still have to
-//use strzone (FRIK_FILE) for permanent storage however.
-//
-//
-//
-//implementation notes for other engine coders:
-//these tempstrings are expected to be stored in a contiguous buffer in memory
-//which may be fixed size or controlled by a cvar, or automatically grown on
-//demand (in the case of DarkPlaces).
-//
-//this concept is similar to quake's Zone system, however these are all freed
-//when the QC interpreter returns.
-//
-//this is basically a poor man's garbage collection system for strings.
-
-//DP_QC_VECTOANGLES_WITH_ROLL
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-vector(vector forward, vector up) vectoangles2 = #51; // same number as vectoangles
-//description:
-//variant of vectoangles that takes an up vector to calculate roll angle (also uses this to calculate yaw correctly if the forward is straight up or straight down)
-//note: just like normal vectoangles you need to negate the pitch of the returned angles if you want to feed them to makevectors or assign to self.v_angle
-
-//DP_QC_VECTORVECTORS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector dir) vectorvectors = #432;
-//description:
-//creates v_forward, v_right, and v_up vectors given a forward vector, similar to makevectors except it takes a forward direction vector instead of angles.
-
-//DP_QC_WHICHPACK
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-string(string filename) whichpack = #503;
-//description:
-//returns the name of the pak/pk3/whatever containing the given file, in the same path space as FRIK_FILE functions use (that is, possibly with a path name prefix)
-
-//DP_QC_URI_ESCAPE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//URI::Escape's functionality
-string(string in) uri_escape = #510;
-string(string in) uri_unescape = #511;
-
-//DP_QC_URI_GET
-//idea: divVerent
-//darkplaces implementation: divVerent
-//loads text from an URL into a string
-//returns 1 on success of initiation, 0 if there are too many concurrent
-//connections already or if the URL is invalid
-//the following callback will receive the data and MUST exist!
-// void(float id, float status, string data) URI_Get_Callback;
-//status is either
-// negative for an internal error,
-// 0 for success, or
-// the HTTP response code on server error (e.g. 404)
-//if 1 is returned by uri_get, the callback will be called in the future
-float(string url, float id) uri_get = #513;
-
-//DP_QC_URI_POST
-//idea: divVerent
-//darkplaces implementation: divVerent
-//loads text from an URL into a string after POSTing via HTTP
-//works like uri_get, but uri_post sends data with Content-Type: content_type to the server
-//and uri_post sends the string buffer buf, joined using the delimiter delim
-float(string url, float id, string content_type, string data) uri_post = #513;
-float(string url, float id, string content_type, string delim, float buf) uri_postbuf = #513;
-
-//DP_SKELETONOBJECTS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//this extension indicates that FTE_CSQC_SKELETONOBJECTS functionality is available in server QC (as well as CSQC).
-
-//DP_SV_SPAWNFUNC_PREFIX
-//idea: divVerent
-//darkplaces implementation: divVerent
-//Make functions whose name start with spawnfunc_ take precedence as spawn function for loading entities.
-//Useful if you have a field ammo_shells (required in any Quake mod) but want to support spawn functions called ammo_shells (like in Q3A).
-//Optionally, you can declare a global "float require_spawnfunc_prefix;" which will require ANY spawn function to start with that prefix.
-
-
-//DP_QUAKE2_MODEL
-//idea: quake community
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports Quake2 .md2 files.
-
-//DP_QUAKE2_SPRITE
-//idea: LordHavoc
-//darkplaces implementation: Elric
-//description:
-//shows that the engine supports Quake2 .sp2 files.
-
-//DP_QUAKE3_MAP
-//idea: quake community
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports Quake3 .bsp files.
-
-//DP_QUAKE3_MODEL
-//idea: quake community
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports Quake3 .md3 files.
-
-//DP_REGISTERCVAR
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-float(string name, string value) registercvar = #93;
-//description:
-//adds a new console cvar to the server console (in singleplayer this is the player's console), the cvar exists until the mod is unloaded or the game quits.
-//NOTE: DP_CON_SET is much better.
-
-//DP_SND_DIRECTIONLESSATTNNONE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//make sounds with ATTN_NONE have no spatialization (enabling easy use as music sources).
-
-//DP_SND_FAKETRACKS
-//idea: requested
-
-//darkplaces implementation: Elric
-//description:
-//the engine plays sound/cdtracks/track001.wav instead of cd track 1 and so on if found, this allows games and mods to have music tracks without using ambientsound.
-//Note: also plays .ogg with DP_SND_OGGVORBIS extension.
-
-//DP_SND_SOUND7_WIP1
-//DP_SND_SOUND7_WIP2
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-void(entity e, float chan, string samp, float vol, float atten, float speed, float flags) sound7 = #8;
-float SOUNDFLAG_RELIABLE = 1;
-//description:
-//plays a sound, with some more flags
-//extensions to sound():
-//- channel may be in the range from -128 to 127; channels -128 to 0 are "auto",
-// i.e. support multiple sounds at once, but cannot be stopped/restarted
-//- a value 0 in the speed parameter means no change; otherwise, it is a
-// percentage of playback speed ("pitch shifting"). 100 is normal pitch, 50 is
-// half speed, 200 is double speed, etc. (DP_SND_SOUND7_WIP2)
-//- the flag SOUNDFLAG_RELIABLE can be specified, which makes the sound send
-// to MSG_ALL (reliable) instead of MSG_BROADCAST (unreliable, default);
-// similarily, SOUNDFLAG_RELIABLE_TO_ONE sends to MSG_ONE
-//- channel 0 is controlled by snd_channel0volume; channel 1 and -1 by
-// snd_channel1volume, etc. (so, a channel shares the cvar with its respective
-// auto-channel); however, the mod MUST define snd_channel8volume and upwards
-// in default.cfg if they are to be used, as the engine does not create them
-// to not litter the cvar list
-//- this extension applies to CSQC as well; CSQC_Event_Sound will get speed and
-// flags as extra 7th and 8th argument
-//- WIP2 ideas: SOUNDFLAG_RELIABLE_TO_ONE, SOUNDFLAG_NOPHS, SOUNDFLAG_FORCELOOP
-//- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support
-// the finished extension once done
-
-//DP_SND_OGGVORBIS
-//idea: Transfusion
-//darkplaces implementation: Elric
-//description:
-//the engine supports loading Ogg Vorbis sound files. Use either the .ogg filename directly, or a .wav of the same name (will try to load the .wav first and then .ogg).
-
-//DP_SND_STEREOWAV
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//the engine supports stereo WAV files. (useful with DP_SND_DIRECTIONLESSATTNNONE for music)
-
-//DP_SND_GETSOUNDTIME
-//idea: VorteX
-//darkplaces implementation: VorteX
-//constant definitions:
-float(entity e, float channel) getsoundtime = #533; // get currently sound playing position on entity channel, -1 if not playing or error
-float(string sample) soundlength = #534; // returns length of sound sample in seconds, -1 on error (sound not precached, sound system not initialized etc.)
-//description: provides opportunity to query length of sound samples and realtime tracking of sound playing on entities (similar to DP_GETTIME_CDTRACK)
-//note: beware dedicated server not running sound engine at all, so in dedicated mode this builtins will not work in server progs
-//note also: menu progs not supporting getsoundtime() (will give a warning) since it has no sound playing on entities
-//examples of use:
-// - QC-driven looped sounds
-// - QC events when sound playing is finished
-// - toggleable ambientsounds
-// - subtitles
-
-//DP_VIDEO_DPV
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//console commands:
-// playvideo <videoname> - start playing video
-// stopvideo - stops current video
-//description: indicated that engine support playing videos in DPV format
-
-//DP_VIDEO_SUBTITLES
-//idea: VorteX
-//darkplaces implementation: VorteX
-//cvars:
-// cl_video_subtitles - toggles subtitles showing
-// cl_video_subtitles_lines - how many lines to reserve for subtitles
-// cl_video_subtitles_textsize - font size
-//console commands:
-// playvideo <videoname> <custom_subtitles_file> - start playing video
-// stopvideo - stops current video
-//description: indicates that engine support subtitles on videos
-//subtitles stored in external text files, each video file has it's default subtitles file ( <videoname>.dpsubs )
-//example: for video/act1.dpv default subtitles file will be video/act1.dpsubs
-//also video could be played with custom subtitles file by utilizing second parm of playvideo command
-//syntax of .dpsubs files: each line in .dpsubs file defines 1 subtitle, there are three tokens:
-// <start> <end> "string"
-// start: subtitle start time in seconds
-// end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started,
-// if below 0 - show until next subtitles minus this number of seconds
-// text: subtitle text, color codes (Q3-style and ^xRGB) are allowed
-//example of subtitle file:
-// 3 0 "Vengeance! Vengeance for my eternity of suffering!"
-// 9 0 "Whelp! As if you knew what eternity was!"
-// 13 0 "Grovel before your true master."
-// 17 0 "Never!"
-// 18 7 "I'll hack you from crotch to gizzard and feed what's left of you to your brides..."
-
-//DP_SOLIDCORPSE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//solid definitions:
-float SOLID_CORPSE = 5;
-//description:
-//the entity will not collide with SOLID_CORPSE and SOLID_SLIDEBOX entities (and likewise they will not collide with it), this is useful if you want dead bodies that are shootable but do not obstruct movement by players and monsters, note that if you traceline with a SOLID_SLIDEBOX entity as the ignoreent, it will ignore SOLID_CORPSE entities, this is desirable for visibility and movement traces, but not for bullets, for the traceline to hit SOLID_CORPSE you must temporarily force the player (or whatever) to SOLID_BBOX and then restore to SOLID_SLIDEBOX after the traceline.
-
-//DP_SPRITE32
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//the engine supports .spr32 sprites.
-
-//DP_SV_BOTCLIENT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//constants:
-float CLIENTTYPE_DISCONNECTED = 0;
-float CLIENTTYPE_REAL = 1;
-float CLIENTTYPE_BOT = 2;
-float CLIENTTYPE_NOTACLIENT = 3;
-//builtin definitions:
-entity() spawnclient = #454; // like spawn but for client slots (also calls relevant connect/spawn functions), returns world if no clients available
-float(entity clent) clienttype = #455; // returns one of the CLIENTTYPE_* constants
-//description:
-//spawns a client with no network connection, to allow bots to use client slots with no hacks.
-//How to use:
-/*
- // to spawn a bot
- local entity oldself;
- oldself = self;
- self = spawnclient();
- if (!self)
- {
- bprint("Can not add bot, server full.\n");
- self = oldself;
- return;
- }
- self.netname = "Yoyobot";
- self.clientcolors = 12 * 16 + 4; // yellow (12) shirt and red (4) pants
- ClientConnect();
- PutClientInServer();
- self = oldself;
-
- // to remove all bots
- local entity head;
- head = find(world, classname, "player");
- while (head)
- {
- if (clienttype(head) == CLIENTTYPE_BOT)
- dropclient(head);
- head = find(head, classname, "player");
- }
-
- // to identify if a client is a bot (for example in PlayerPreThink)
- if (clienttype(self) == CLIENTTYPE_BOT)
- botthink();
-*/
-//see also DP_SV_CLIENTCOLORS DP_SV_CLIENTNAME DP_SV_DROPCLIENT
-//How it works:
-//creates a new client, calls SetNewParms and stores the parms, and returns the client.
-//this intentionally does not call SV_SendServerinfo to allow the QuakeC a chance to set the netname and clientcolors fields before actually spawning the bot by calling ClientConnect and PutClientInServer manually
-//on level change ClientConnect and PutClientInServer are called by the engine to spawn in the bot (this is why clienttype() exists to tell you on the next level what type of client this is).
-//parms work the same on bot clients as they do on real clients, and do carry from level to level
-
-//DP_SV_BOUNCEFACTOR
-//idea: divVerent
-//darkplaces implementation: divVerent
-//field definitions:
-.float bouncefactor; // velocity multiplier after a bounce
-.float bouncestop; // bounce stops if velocity to bounce plane is < bouncestop * gravity AFTER the bounce
-//description:
-//allows qc to customize MOVETYPE_BOUNCE a bit
-
-//DP_SV_CLIENTCAMERA
-//idea: LordHavoc, others
-//darkplaces implementation: Black
-//field definitions:
-.entity clientcamera; // override camera entity
-//description:
-//allows another entity to be the camera for a client, for example a remote camera, this is similar to sending svc_setview manually except that it also changes the network culling appropriately.
-
-//DP_SV_CLIENTCOLORS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float clientcolors; // colors of the client (format: pants + shirt * 16)
-//description:
-//allows qc to read and modify the client colors associated with a client entity (not particularly useful on other entities), and automatically sends out any appropriate network updates if changed
-
-//DP_SV_CLIENTNAME
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//description:
-//allows qc to modify the client's .netname, and automatically sends out any appropriate network updates if changed
-
-//DP_SV_CUSTOMIZEENTITYFORCLIENT
-//idea: LordHavoc
-//darkplaces implementation: [515] and LordHavoc
-//field definitions:
-.float() customizeentityforclient; // self = this entity, other = client entity
-//description:
-//allows qc to modify an entity before it is sent to each client, the function returns true if it should send, false if it should not, and is fully capable of editing the entity's fields, this allows cloaked players to appear less transparent to their teammates, navigation markers to only show to their team, etc
-//tips on writing customize functions:
-//it is a good idea to return false early in the function if possible to reduce cpu usage, because this function may be called many thousands of times per frame if there are many customized entities on a 64+ player server.
-//you are free to change anything in self, but please do not change any other entities (the results may be very inconsistent).
-//example ideas for use of this extension:
-//making icons over teammates' heads which are only visible to teammates. for exasmple: float() playericon_customizeentityforclient = {return self.owner.team == other.team;};
-//making cloaked players more visible to their teammates than their enemies. for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return true;};
-//making explosion models that face the viewer (does not work well with chase_active). for example: float() explosion_customizeentityforclient = {self.angles = vectoangles(other.origin + other.view_ofs - self.origin);self.angles_x = 0 - self.angles_x;};
-//implementation notes:
-//entity customization is done before per-client culling (visibility for instance) because the entity may be doing setorigin to display itself in different locations on different clients, may be altering its .modelindex, .effects and other fields important to culling, so customized entities increase cpu usage (non-customized entities can use all the early culling they want however, as they are not changing on a per client basis).
-
-//DP_SV_DISCARDABLEDEMO
-//idea: parasti
-//darkplaces implementation: parasti
-//field definitions:
-.float discardabledemo;
-//description:
-//when this field is set to a non-zero value on a player entity, a possibly recorded server-side demo for the player is discarded
-//Note that this extension only works if:
-// auto demos are enabled (the cvar sv_autodemo_perclient is set)
-// discarding demos is enabled (the cvar sv_autodemo_perclient_discardable is set)
-
-//DP_SV_DRAWONLYTOCLIENT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.entity drawonlytoclient;
-//description:
-//the entity is only visible to the specified client.
-
-//DP_SV_DROPCLIENT
-//idea: FrikaC
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(entity clent) dropclient = #453;
-//description:
-//causes the server to immediately drop the client, more reliable than stuffcmd(clent, "disconnect\n"); which could be intentionally ignored by the client engine
-
-//DP_SV_EFFECT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
-//SVC definitions:
-//float svc_effect = #52; // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate
-//float svc_effect2 = #53; // [vector] org [short] modelindex [byte] startframe [byte] framecount [byte] framerate
-//description:
-//clientside playback of simple custom sprite effects (explosion sprites, etc).
-
-//DP_SV_ENTITYCONTENTSTRANSITION
-//idea: Dresk
-//darkplaces implementation: Dresk
-//field definitions:
-.void(float nOriginalContents, float nNewContents) contentstransition;
-//description:
-//This field function, when provided, is triggered on an entity when the contents (ie. liquid / water / etc) is changed.
-//The first parameter provides the entities original contents, prior to the transition. The second parameter provides the new contents.
-//NOTE: If this field function is provided on an entity, the standard watersplash sound IS SUPPRESSED to allow for authors to create their own transition sounds.
-
-//DP_SV_MOVETYPESTEP_LANDEVENT
-//idea: Dresk
-//darkplaces implementation: Dresk
-//field definitions:
-.void(vector vImpactVelocity) movetypesteplandevent;
-//description:
-//This field function, when provided, is triggered on a MOVETYPE_STEP entity when it experiences "land event".
-// The standard engine behavior for this event is to play the sv_sound_land CVar sound.
-//The parameter provides the velocity of the entity at the time of the impact. The z value may therefore be used to calculate how "hard" the entity struck the surface.
-//NOTE: If this field function is provided on a MOVETYPE_STEP entity, the standard sv_sound_land sound IS SUPPRESSED to allow for authors to create their own feedback.
-
-//DP_SV_POINTSOUND
-//idea: Dresk
-//darkplaces implementation: Dresk
-//builtin definitions:
-void(vector origin, string sample, float volume, float attenuation) pointsound = #483;
-//description:
-//Similar to the standard QC sound function, this function takes an origin instead of an entity and omits the channel parameter.
-// This allows sounds to be played at arbitrary origins without spawning entities.
-
-//DP_SV_ONENTITYNOSPAWNFUNCTION
-//idea: Dresk
-//darkplaces implementation: Dresk
-//engine-called QC prototypes:
-//void() SV_OnEntityNoSpawnFunction;
-//description:
-// This function is called whenever an entity on the server has no spawn function, and therefore has no defined QC behavior.
-// You may as such dictate the behavior as to what happens to the entity.
-// To mimic the engine's default behavior, simply call remove(self).
-
-//DP_SV_ONENTITYPREPOSTSPAWNFUNCTION
-//idea: divVerent
-//darkplaces implementation: divVerent
-//engine-called QC prototypes:
-//void() SV_OnEntityPreSpawnFunction;
-//void() SV_OnEntityPostSpawnFunction;
-//description:
-// These functions are called BEFORE or AFTER an entity is spawned the regular way.
-// You may as such dictate the behavior as to what happens to the entity.
-// SV_OnEntityPreSpawnFunction is called before even looking for the spawn function, so you can even change its classname in there. If it remove()s the entity, the spawn function will not be looked for.
-// SV_OnEntityPostSpawnFunction is called ONLY after its spawn function or SV_OnEntityNoSpawnFunction was called, and skipped if the entity got removed by either.
-
-//DP_SV_MODELFLAGS_AS_EFFECTS
-//idea: LordHavoc, Dresk
-//darkplaces implementation: LordHavoc
-//field definitions:
-.int modelflags;
-//constant definitions:
-float EF_NOMODELFLAGS = 8388608; // ignore any effects in a model file and substitute your own
-float MF_ROCKET = 1; // leave a trail
-float MF_GRENADE = 2; // leave a trail
-float MF_GIB = 4; // leave a trail
-float MF_ROTATE = 8; // rotate (bonus items)
-float MF_TRACER = 16; // green split trail
-float MF_ZOMGIB = 32; // small blood trail
-float MF_TRACER2 = 64; // orange split trail
-float MF_TRACER3 = 128; // purple trail
-//description:
-//this extension allows model flags to be specified on entities so you can add a rocket trail and glow to any entity, etc.
-//setting any of these will override the flags the model already has, to disable the model's flags without supplying any of your own you must use EF_NOMODELFLAGS.
-//
-//silly example modification #1 to W_FireRocket in weapons.qc:
-//missile.effects = EF_NOMODELFLAGS; // rocket without a glow/fire trail
-//silly example modification #2 to W_FireRocket in weapons.qc:
-//missile.modelflags = MF_GIB; // leave a blood trail instead of glow/fire trail
-//
-//note: you can not combine multiple kinds of trail, only one of them will be active, you can combine MF_ROTATE and the other MF_ flags however, and using EF_NOMODELFLAGS along with these does no harm.
-//
-//note to engine coders: they are internally encoded in the protocol as extra EF_ flags (shift the values left 24 bits and send them in the protocol that way), so no protocol change was required (however 32bit effects is a protocol extension itself), within the engine they are referred to as EF_ for the 24bit shifted values.
-
-//DP_SV_NETADDRESS
-//idea: Dresk
-//darkplaces implementation: Dresk
-//field definitions:
-.string netaddress;
-//description:
-// provides the netaddress of the associated entity (ie. 127.0.0.1) and "null/botclient" if the netconnection of the entity is invalid
-
-//DP_SV_NODRAWTOCLIENT
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.entity nodrawtoclient;
-//description:
-//the entity is not visible to the specified client.
-
-//DP_SV_PING
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float ping;
-//description:
-//continuously updated field indicating client's ping (based on average of last 16 packet time differences).
-
-//DP_SV_PING_PACKETLOSS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float ping_packetloss;
-.float ping_movementloss;
-//description:
-//continuously updated field indicating client's packet loss, and movement loss (i.e. packet loss affecting player movement).
-
-//DP_SV_POINTPARTICLES
-//idea: Spike
-//darkplaces implementation: LordHavoc
-//function definitions:
-int(string effectname) particleeffectnum = #335; // same as in CSQC
-void(entity ent, float effectnum, vector start, vector end) trailparticles = #336; // same as in CSQC
-void(float effectnum, vector org, vector vel, float howmany) pointparticles = #337; // same as in CSQC
-//SVC definitions:
-//float svc_trailparticles = 60; // [short] entnum [short] effectnum [vector] start [vector] end
-//float svc_pointparticles = 61; // [short] effectnum [vector] start [vector] velocity [short] count
-//float svc_pointparticles1 = 62; // [short] effectnum [vector] start, same as svc_pointparticles except velocity is zero and count is 1
-//description:
-//provides the ability to spawn non-standard particle effects, typically these are defined in a particle effect information file such as effectinfo.txt in darkplaces.
-//this is a port of particle effect features from clientside QC (EXT_CSQC) to server QC, as these effects are potentially useful to all games even if they do not make use of EXT_CSQC.
-//warning: server must have same order of effects in effectinfo.txt as client does or the numbers would not match up, except for standard quake effects which are always the same numbers.
-
-//DP_SV_PUNCHVECTOR
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.vector punchvector;
-//description:
-//offsets client view in worldspace, similar to view_ofs but all 3 components are used and are sent with at least 8 bits of fraction, this allows the view to be kicked around by damage or hard landings or whatever else, note that unlike punchangle this is not faded over time, it is up to the mod to fade it (see also DP_SV_PLAYERPHYSICS).
-
-//DP_SV_PLAYERPHYSICS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.vector movement;
-//cvar definitions:
-//"sv_playerphysicsqc" (0/1, default 1, allows user to disable qc player physics)
-//engine-called QC prototypes:
-//void() SV_PlayerPhysics;
-//description:
-//.movement vector contains the movement input from the player, allowing QC to do as it wishs with the input, and SV_PlayerPhysics will completely replace the player physics if present (works for all MOVETYPE's), see darkplaces mod source for example of this function (in playermovement.qc, adds HalfLife ladders support, as well as acceleration/deceleration while airborn (rather than the quake sudden-stop while airborn), and simplifies the physics a bit)
-
-//DP_PHYSICS_ODE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//globals:
-//new movetypes:
-const float MOVETYPE_PHYSICS = 32; // need to be set before any physics_* builtins applied
-//new solid types (deprecated):
-const float SOLID_PHYSICS_BOX = 32;
-const float SOLID_PHYSICS_SPHERE = 33;
-const float SOLID_PHYSICS_CAPSULE = 34;
-const float SOLID_PHYSICS_TRIMESH = 35;
-const float SOLID_PHYSICS_CYLINDER = 36;
-//geometry types:
-const float GEOMTYPE_NONE = -1; // entity will be entirely skipped by ODE
-const float GEOMTYPE_SOLID = 0; // geometry type will be set based on .solid field
-const float GEOMTYPE_BOX = 1; // entity bound box
-const float GEOMTYPE_SPHERE = 2; // sphere with radius picked from x axis of entity bound box
-const float GEOMTYPE_CAPSULE = 3; // with leading axis automatically determined from longest one, radius is picked as minimal of the rest 2 axes
-const float GEOMTYPE_TRIMESH = 4; // triangle mesh
-const float GEOMTYPE_CYLINDER = 5; // like capsule but not capped
- // note that ODE's builtin cylinder support is experimental, somewhat bugged and unfinished (no cylinder-cylinder collision)
- // to use properly working cylinder should build ODE with LIBCCD extension
-const float GEOMTYPE_CAPSULE_X = 6; // capsule with fixed leading axis
-const float GEOMTYPE_CAPSULE_Y = 7;
-const float GEOMTYPE_CAPSULE_Z = 8;
-const float GEOMTYPE_CYLINDER_X = 9; // cylinder with fixed leading axis
-const float GEOMTYPE_CYLINDER_Y = 10;
-const float GEOMTYPE_CYLINDER_Z = 11;
-//joint types:
-const float JOINTTYPE_NONE = 0;
-const float JOINTTYPE_POINT = 1;
-const float JOINTTYPE_HINGE = 2;
-const float JOINTTYPE_SLIDER = 3;
-const float JOINTTYPE_UNIVERSAL = 4;
-const float JOINTTYPE_HINGE2 = 5;
-const float JOINTTYPE_FIXED = -1;
-//force types:
-const float FORCETYPE_NONE = 0;
-const float FORCETYPE_FORCE = 1; // applied at center of mass
-const float FORCETYPE_FORCEATPOS = 2;
-const float FORCETYPE_TORQUE = 3;
-// common joint properties:
-// .entity aiment; // connected objects
-// .entity enemy; // connected objects, forces
-// .vector movedir;
-// for a spring:
-// movedir_x = spring constant (force multiplier, must be > 0)
-// movedir_y = spring dampening constant to prevent oscillation (must be > 0)
-// movedir_z = spring stop position (+/-)
-// for a motor:
-// movedir_x = desired motor velocity
-// movedir_y = -1 * max motor force to use
-// movedir_z = stop position (+/-), set to 0 for no stop
-// note that ODE does not support both in one anyway
-// for a force:
-// force vector to apply
-//field definitions:
-.float geomtype; // see GEOMTYPE_*, a more correct way to set collision shape, allows to set SOLID_CORPSE and trimesh collisions
-.float maxcontacts; // maximum number of contacts to make for this object, lesser = faster (but setting it too low will could make object pass though walls), default is 16, maximum is 32
-.float mass; // ODE mass, standart value is 1
-.vector massofs; // offsets a mass center out of object center, if not set a center of model bounds is used
-.float friction; // a friction of object, get multiplied by second objects's friction on contact
-.float bouncefactor;
-.float bouncestop;
-.float jointtype; // type of joint
-.float forcetype; // type of force
-.float erp; // error restitution parameter, makes ODE solver attempt to fix errors in contacts,
- // bringing together 2 joints or fixing object being stuch in other object,
- // a value of 0.1 will fix slightly, a value of 1.0 attempts to fix whole error in one frame
- // use with care as high values makes system unstable and likely to explode
-//builtin definitions:
-void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
-void(entity e, vector force, vector force_pos) physics_addforce = #541; // deprecated, apply a force from certain origin, length of force vector is power of force
-void(entity e, vector torque) physics_addtorque = #542; // deprecated, add relative torque
-//description: provides Open Dynamics Engine support, requires extenal dll to be present or engine compiled with statical link option
-//be sure to checkextension for it to know if library is loaded and ready, also to enable physics set "physics_ode" cvar to 1
-//note: this extension is highly experimental and may be unstable
-
-//DP_SV_PRINT
-//idea: id Software (QuakeWorld Server)
-//darkplaces implementation: Black, LordHavoc
-void(string s, ...) print = #339; // same number as in EXT_CSQC
-//description:
-//this is identical to dprint except that it always prints regardless of the developer cvar.
-
-//DP_SV_PRECACHEANYTIME
-//idea: id Software (Quake2)
-//darkplaces implementation: LordHavoc
-//description:
-//this extension allows precache_model and precache_sound (and any variants) to be used during the game (with automatic messages to clients to precache the new model/sound indices), also setmodel/sound/ambientsound can be called without precaching first (they will cause an automatic precache).
-
-//DP_SV_QCSTATUS
-//idea: divVerent
-//darkplaces implementation: divVerent
-//1. A global variable
-string worldstatus;
-//Its content is set as "qcstatus" field in the rules.
-//It may be at most 255 characters, and must not contain newlines or backslashes.
-//2. A per-client field
-.string clientstatus;
-//It is sent instead of the "frags" in status responses.
-//It should always be set in a way so that stof(player.clientstatus) is a meaningful score value. Other info may be appended. If used this way, the cvar sv_status_use_qcstatus may be set to 1, and then this value will replace the frags in "status".
-//Currently, qstat does not support this and will not show player info if used and set to anything other than ftos(some integer).
-
-//DP_SV_ROTATINGBMODEL
-//idea: id Software
-//darkplaces implementation: LordHavoc
-//description:
-//this extension merely indicates that MOVETYPE_PUSH supports avelocity, allowing rotating brush models to be created, they rotate around their origin (needs rotation supporting qbsp/light utilities because id ones expected bmodel entity origins to be '0 0 0', recommend setting "origin" key in the entity fields in the map before compiling, there may be other methods depending on your qbsp, most are more complicated however).
-//tip: level designers can create a func_wall with an origin, and avelocity (for example "avelocity" "0 90 0"), and "nextthink" "99999999" to make a rotating bmodel without any qc modifications, such entities will be solid in stock quake but will not rotate)
-
-//DP_SV_SETCOLOR
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(entity ent, float colors) setcolor = #401;
-//engine called QC functions (optional):
-//void(float color) SV_ChangeTeam;
-//description:
-//setcolor sets the color on a client and updates internal color information accordingly (equivalent to stuffing a "color" command but immediate)
-//SV_ChangeTeam is called by the engine whenever a "color" command is recieved, it may decide to do anything it pleases with the color passed by the client, including rejecting it (by doing nothing), or calling setcolor to apply it, preventing team changes is one use for this.
-//the color format is pants + shirt * 16 (0-255 potentially)
-
-//DP_SV_SLOWMO
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//cvars:
-//"slowmo" (0+, default 1)
-//description:
-//sets the time scale of the server, mainly intended for use in singleplayer by the player, however potentially useful for mods, so here's an extension for it.
-//range is 0 to infinite, recommended values to try are 0.1 (very slow, 10% speed), 1 (normal speed), 5 (500% speed).
-
-//DP_SV_WRITEPICTURE
-//idea: divVerent
-//darkplaces implementation: divVerent
-//builtin definitions:
-void(float to, string s, float sz) WritePicture = #501;
-//description:
-//writes a picture to the data stream so CSQC can read it using ReadPicture, which has the definition
-// string(void) ReadPicture = #501;
-//The picture data is sent as at most sz bytes, by compressing to low quality
-//JPEG. The data being sent will be equivalent to:
-// WriteString(to, s);
-// WriteShort(to, imagesize);
-// for(i = 0; i < imagesize; ++i)
-// WriteByte(to, [the i-th byte of the compressed JPEG image]);
-
-//DP_SV_WRITEUNTERMINATEDSTRING
-//idea: FrikaC
-//darkplaces implementation: Sajt
-//builtin definitions:
-void(float to, string s) WriteUnterminatedString = #456;
-//description:
-//like WriteString, but does not write a terminating 0 after the string. This means you can include things like a player's netname in the middle of a string sent over the network. Just be sure to end it up with either a call to WriteString (which includes the trailing 0) or WriteByte(0) to terminate it yourself.
-//A historical note: this extension was suggested by FrikaC years ago, more recently Shadowalker has been badmouthing LordHavoc and Spike for stealing 'his' extension writestring2 which does exactly the same thing but uses a different builtin number and name and extension string, this argument hinges on the idea that it was his idea in the first place, which is incorrect as FrikaC first suggested it and used a rough equivalent of it in his FrikBot mod years ago involving WriteByte calls on each character.
-
-//DP_TE_BLOOD
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, vector velocity, float howmany) te_blood = #405;
-//temp entity definitions:
-float TE_BLOOD = 50;
-//protocol:
-//vector origin
-//byte xvelocity (-128 to +127)
-//byte yvelocity (-128 to +127)
-//byte zvelocity (-128 to +127)
-//byte count (0 to 255, how much blood)
-//description:
-//creates a blood effect.
-
-//DP_TE_BLOODSHOWER
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
-//temp entity definitions:
-//float TE_BLOODSHOWER = 52;
-//protocol:
-//vector mins (minimum corner of the cube)
-//vector maxs (maximum corner of the cube)
-//coord explosionspeed (velocity of blood particles flying out of the center)
-//short count (number of blood particles)
-//description:
-//creates an exploding shower of blood, for making gibbings more convincing.
-
-//DP_TE_CUSTOMFLASH
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, float radius, float lifetime, vector color) te_customflash = #417;
-//temp entity definitions:
-//float TE_CUSTOMFLASH = 73;
-//protocol:
-//vector origin
-//byte radius ((MSG_ReadByte() + 1) * 8, meaning 8-2048 unit radius)
-//byte lifetime ((MSG_ReadByte() + 1) / 256.0, meaning approximately 0-1 second lifetime)
-//byte red (0.0 to 1.0 converted to 0-255)
-//byte green (0.0 to 1.0 converted to 0-255)
-//byte blue (0.0 to 1.0 converted to 0-255)
-//description:
-//creates a customized light flash.
-
-//DP_TE_EXPLOSIONRGB
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, vector color) te_explosionrgb = #407;
-//temp entity definitions:
-//float TE_EXPLOSIONRGB = 53;
-//protocol:
-//vector origin
-//byte red (0.0 to 1.0 converted to 0 to 255)
-//byte green (0.0 to 1.0 converted to 0 to 255)
-//byte blue (0.0 to 1.0 converted to 0 to 255)
-//description:
-//creates a colored explosion effect.
-
-//DP_TE_FLAMEJET
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, vector vel, float howmany) te_flamejet = #457;
-//temp entity definitions:
-//float TE_FLAMEJET = 74;
-//protocol:
-//vector origin
-//vector velocity
-//byte count (0 to 255, how many flame particles)
-//description:
-//creates a single puff of flame particles. (not very useful really)
-
-//DP_TE_PARTICLECUBE
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
-//temp entity definitions:
-//float TE_PARTICLECUBE = 54;
-//protocol:
-//vector mins (minimum corner of the cube)
-//vector maxs (maximum corner of the cube)
-//vector velocity
-//short count
-//byte color (palette color)
-//byte gravity (true or false, FIXME should this be a scaler instead?)
-//coord randomvel (how much to jitter the velocity)
-//description:
-//creates a cloud of particles, useful for forcefields but quite customizable.
-
-//DP_TE_PARTICLERAIN
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
-//temp entity definitions:
-//float TE_PARTICLERAIN = 55;
-//protocol:
-//vector mins (minimum corner of the cube)
-//vector maxs (maximum corner of the cube)
-//vector velocity (velocity of particles)
-//short count (number of particles)
-//byte color (8bit palette color)
-//description:
-//creates a shower of rain, the rain will appear either at the top (if falling down) or bottom (if falling up) of the cube.
-
-//DP_TE_PARTICLESNOW
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
-//temp entity definitions:
-//float TE_PARTICLERAIN = 56;
-//protocol:
-//vector mins (minimum corner of the cube)
-//vector maxs (maximum corner of the cube)
-//vector velocity (velocity of particles)
-//short count (number of particles)
-//byte color (8bit palette color)
-//description:
-//creates a shower of snow, the snow will appear either at the top (if falling down) or bottom (if falling up) of the cube, low velocities are advisable for convincing snow.
-
-//DP_TE_PLASMABURN
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_plasmaburn = #433;
-//temp entity definitions:
-//float TE_PLASMABURN = 75;
-//protocol:
-//vector origin
-//description:
-//creates a small light flash (radius 200, time 0.2) and marks the walls.
-
-//DP_TE_QUADEFFECTS1
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_gunshotquad = #412;
-void(vector org) te_spikequad = #413;
-void(vector org) te_superspikequad = #414;
-void(vector org) te_explosionquad = #415;
-//temp entity definitions:
-//float TE_GUNSHOTQUAD = 57; // [vector] origin
-//float TE_SPIKEQUAD = 58; // [vector] origin
-//float TE_SUPERSPIKEQUAD = 59; // [vector] origin
-//float TE_EXPLOSIONQUAD = 70; // [vector] origin
-//protocol:
-//vector origin
-//description:
-//all of these just take a location, and are equivalent in function (but not appearance :) to the original TE_GUNSHOT, etc.
-
-//DP_TE_SMALLFLASH
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_smallflash = #416;
-//temp entity definitions:
-//float TE_SMALLFLASH = 72;
-//protocol:
-//vector origin
-//description:
-//creates a small light flash (radius 200, time 0.2).
-
-//DP_TE_SPARK
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org, vector vel, float howmany) te_spark = #411;
-//temp entity definitions:
-//float TE_SPARK = 51;
-//protocol:
-//vector origin
-//byte xvelocity (-128 to 127)
-//byte yvelocity (-128 to 127)
-//byte zvelocity (-128 to 127)
-//byte count (number of sparks)
-//description:
-//creates a shower of sparks and a smoke puff.
-
-//DP_TE_STANDARDEFFECTBUILTINS
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_gunshot = #418;
-void(vector org) te_spike = #419;
-void(vector org) te_superspike = #420;
-void(vector org) te_explosion = #421;
-void(vector org) te_tarexplosion = #422;
-void(vector org) te_wizspike = #423;
-void(vector org) te_knightspike = #424;
-void(vector org) te_lavasplash = #425;
-void(vector org) te_teleport = #426;
-void(vector org, float color, float colorlength) te_explosion2 = #427;
-void(entity own, vector start, vector end) te_lightning1 = #428;
-void(entity own, vector start, vector end) te_lightning2 = #429;
-void(entity own, vector start, vector end) te_lightning3 = #430;
-void(entity own, vector start, vector end) te_beam = #431;
-//description:
-//to make life easier on mod coders.
-
-//DP_TRACE_HITCONTENTSMASK_SURFACEINFO
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//globals:
-.int dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
-int trace_dpstartcontents; // DPCONTENTS_ value at start position of trace
-int trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
-int trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
-string trace_dphittexturename; // texture name of impacted surface
-//constants:
-const int DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box
-const int DPCONTENTS_WATER = 2;
-const int DPCONTENTS_SLIME = 4;
-const int DPCONTENTS_LAVA = 8;
-const int DPCONTENTS_SKY = 16;
-const int DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel
-const int DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity
-const int DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn
-const int DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
-const int DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement
-const int DPCONTENTS_DONOTENTER = 1024; // AI hint brush
-const int DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA
-const int DPCONTENTS_BOTCLIP = 2048; // AI hint brush
-const int DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks)
-const int Q3SURFACEFLAG_NODAMAGE = 1;
-const int Q3SURFACEFLAG_SLICK = 2; // low friction surface
-const int Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
-const int Q3SURFACEFLAG_LADDER = 8; // climbable surface
-const int Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
-const int Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky)
-const int Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact
-const int Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc)
-const int Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds
-const int Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds
-const int Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc)
-//float Q3SURFACEFLAG_DUST = 262144; // translucent 'light beam' effect (not important to qc)
-//description:
-//adds additional information after a traceline/tracebox/tracetoss call.
-//also (very important) sets trace_* globals before calling .touch functions,
-//this allows them to inspect the nature of the collision (for example
-//determining if a projectile hit sky), clears trace_* variables for the other
-//object in a touch event (that is to say, a projectile moving will see the
-//trace results in its .touch function, but the player it hit will see very
-//little information in the trace_ variables as it was not moving at the time)
-
-//DP_VIEWZOOM
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//field definitions:
-.float viewzoom;
-//description:
-//scales fov and sensitivity of player, valid range is 0 to 1 (intended for sniper rifle zooming, and such)
-
-//EXT_BITSHIFT
-//idea: Spike
-//darkplaces implementation: [515]
-//builtin definitions:
-float(float number, float quantity) bitshift = #218;
-//description:
-//multiplies number by a power of 2 corresponding to quantity (0 = *1, 1 = *2, 2 = *4, 3 = *8, -1 = /2, -2 = /4x, etc), and rounds down (due to integer math) like other bit operations do (& and | and the like).
-//note: it is faster to use multiply if you are shifting by a constant, avoiding the quakec function call cost, however that does not do a floor for you.
-
-//FRIK_FILE
-//idea: FrikaC
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-float(string s) stof = #81; // get numerical value from a string
-float(string filename, float mode) fopen = #110; // opens a file inside quake/gamedir/data/ (mode is FILE_READ, FILE_APPEND, or FILE_WRITE), returns fhandle >= 0 if successful, or fhandle < 0 if unable to open file for any reason
-void(float fhandle) fclose = #111; // closes a file
-string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring
-void(float fhandle, string s, ...) fputs = #113; // writes a line of text to the end of the file
-int(string s) strlen = #114; // returns how many characters are in a string
-string(string s1, string s2, ...) strcat = #115; // concatenates two or more strings (for example "abc", "def" would return "abcdef") and returns as a tempstring
-string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring - see FTE_STRINGS for enhanced version
-vector(string s) stov = #117; // returns vector value from a string
-string(string s, ...) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often)
-void(string s) strunzone = #119; // removes a copy of a string from the string zone (you can not use that string again or it may crash!!!)
-//constants:
-float FILE_READ = 0;
-float FILE_APPEND = 1;
-float FILE_WRITE = 2;
-//cvars:
-//pr_zone_min_strings : default 64 (64k), min 64 (64k), max 8192 (8mb)
-//description:
-//provides text file access functions and string manipulation functions, note that you may want to set pr_zone_min_strings in the worldspawn function if 64k is not enough string zone space.
-//
-//NOTE: strzone functionality is partially superseded by
-//DP_QC_UNLIMITEDTEMPSTRINGS when longterm storage is not needed
-//NOTE: substring is upgraded by FTE_STRINGS extension with negative start/length handling identical to php 5.2.0
-
-//FTE_CSQC_SKELETONOBJECTS
-//idea: Spike, LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-// all skeleton numbers are 1-based (0 being no skeleton)
-// all bone numbers are 1-based (0 being invalid)
-float(float modlindex) skel_create = #263; // create a skeleton (be sure to assign this value into .skeletonindex for use), returns skeleton index (1 or higher) on success, returns 0 on failure (for example if the modelindex is not skeletal), it is recommended that you create a new skeleton if you change modelindex, as the skeleton uses the hierarchy from the model.
-float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
-float(float skel) skel_get_numbones = #265; // returns how many bones exist in the created skeleton, 0 if skeleton does not exist
-string(float skel, float bonenum) skel_get_bonename = #266; // returns name of bone (as a tempstring), "" if invalid bonenum (< 1 for example) or skeleton does not exist
-int(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
-int(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity
-vector(float skel, float bonenum) skel_get_bonerel = #269; // get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone)
-vector(float skel, float bonenum) skel_get_boneabs = #270; // get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity)
-void(float skel, float bonenum, vector org) skel_set_bone = #271; // set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
-void(float skel, float bonenum, vector org) skel_mul_bone = #272; // transform bone matrix (relative to its parent) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
-void(float skel, float startbone, float endbone, vector org) skel_mul_bones = #273; // transform bone matrices (relative to their parents) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bones)
-void(float skeldst, float skelsrc, float startbone, float endbone) skel_copybones = #274; // copy bone matrices (relative to their parents) from one skeleton to another, useful for copying a skeleton to a corpse
-void(float skel) skel_delete = #275; // deletes skeleton at the beginning of the next frame (you can add the entity, delete the skeleton, renderscene, and it will still work)
-float(float modlindex, string framename) frameforname = #276; // finds number of a specified frame in the animation, returns -1 if no match found
-float(float modlindex, float framenum) frameduration = #277; // returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0.
-//fields:
-.int skeletonindex; // active skeleton overriding standard animation on model
-.int frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
-.int frame2; // secondary framegroup animation (strength = lerpfrac)
-.float frame3; // tertiary framegroup animation (strength = lerpfrac3)
-.float frame4; // quaternary framegroup animation (strength = lerpfrac4)
-.float lerpfrac; // strength of framegroup blend
-.float lerpfrac3; // strength of framegroup blend
-.float lerpfrac4; // strength of framegroup blend
-.float frame1time; // start time of framegroup animation
-.float frame2time; // start time of framegroup animation
-.float frame3time; // start time of framegroup animation
-.float frame4time; // start time of framegroup animation
-//description:
-//this extension provides a way to do complex skeletal animation on an entity.
-//
-//see also DP_SKELETONOBJECTS (this extension implemented on server as well as client)
-//
-//notes:
-//each model contains its own skeleton, reusing a skeleton with incompatible models will yield garbage (or not render).
-//each model contains its own animation data, you can use animations from other model files (for example saving out all character animations as separate model files).
-//if an engine supports loading an animation-only file format such as .md5anim in FTEQW, it can be used to animate any model with a compatible skeleton.
-//proper use of this extension may require understanding matrix transforms (v_forward, v_right, v_up, origin), and you must keep in mind that v_right is negative for this purpose.
-//
-//features include:
-//multiple animations blended together.
-//animating a model with animations from another model with a compatible skeleton.
-//restricting animation blends to certain bones of a model - for example independent animation of legs, torso, head.
-//custom bone controllers - for example making eyes track a target location.
-//
-//
-//
-//example code follows...
-//
-//this helper function lets you identify (by parentage) what group a bone
-//belongs to - for example "torso", "leftarm", would return 1 ("torso") for
-//all children of the bone named "torso", unless they are children of
-//"leftarm" (which is a child of "torso") which would return 2 instead...
-float(float skel, float bonenum, string g1, string g2, string g3, string g4, string g5, string g6) example_skel_findbonegroup =
-{
- while (bonenum >= 0)
- {
- string bonename = skel_get_bonename(skel, bonenum);
- if (bonename == g1) return 1;
- if (bonename == g2) return 2;
- if (bonename == g3) return 3;
- if (bonename == g4) return 4;
- if (bonename == g5) return 5;
- if (bonename == g6) return 6;
- bonenum = skel_get_boneparent(skel, bonenum);
- }
- return 0;
-};
-// create a skeletonindex for our player using current modelindex
-void() example_skel_player_setup =
-{
- self.skeletonindex = skel_create(self.modelindex);
-};
-// setup bones of skeleton based on an animation
-// note: animmodelindex can be a different model than self.modelindex
-void(float animmodelindex, float framegroup, float framegroupstarttime) example_skel_player_update_begin =
-{
- // start with our standard animation
- self.frame = framegroup;
- self.frame2 = 0;
- self.frame3 = 0;
- self.frame4 = 0;
- self.frame1time = framegroupstarttime;
- self.frame2time = 0;
- self.frame3time = 0;
- self.frame4time = 0;
- self.lerpfrac = 0;
- self.lerpfrac3 = 0;
- self.lerpfrac4 = 0;
- skel_build(self.skeletonindex, self, animmodelindex, 0, 0, 100000);
-};
-// apply a different framegroup animation to bones with a specified parent
-void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride =
-{
- self.frame = framegroup;
- self.frame2 = 0;
- self.frame3 = 0;
- self.frame4 = 0;
- self.frame1time = framegroupstarttime;
- self.frame2time = 0;
- self.frame3time = 0;
- self.frame4time = 0;
- self.lerpfrac = 0;
- self.lerpfrac3 = 0;
- self.lerpfrac4 = 0;
- float bonenum = 0;
- float numbones = skel_get_numbones(self.skeletonindex);
- while (bonenum < numbones)
- {
- if (example_skel_findbonegroup(self.skeletonindex, bonenum, groupbonename, excludegroupname1, excludegroupname2, "", "", "") == 1)
- skel_build(self.skeletonindex, self, animmodelindex, 1 - blendalpha, bonenum, bonenum + 1);
- bonenum = bonenum + 1;
- }
-};
-// make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling
-void(vector eyetarget, string bonename) example_skel_player_update_eyetarget =
-{
- float bonenum = skel_find_bone(self.skeletonindex, bonename) - 1;
- if (bonenum < 0)
- return;
- vector oldforward = v_forward;
- vector oldright = v_right;
- vector oldup = v_up;
- vector v = eyetarget - self.origin;
- vector modeleyetarget;
- modeleyetarget.x = v * v_forward;
- modeleyetarget.y = 0-v * v_right;
- modeleyetarget.z = v * v_up;
- // this is an eyeball, make it point at the target location
- // first get all the data we can...
- vector relorg = skel_get_bonerel(self.skeletonindex, bonenum);
- vector relforward = v_forward;
- vector relright = v_right;
- vector relup = v_up;
- vector boneorg = skel_get_boneabs(self.skeletonindex, bonenum);
- vector boneforward = v_forward;
- vector boneright = v_right;
- vector boneup = v_up;
- vector parentorg = skel_get_boneabs(self.skeletonindex, skel_get_boneparent(self.skeletonindex, bonenum));
- vector parentforward = v_forward;
- vector parentright = v_right;
- vector parentup = v_up;
- // get the vector from the eyeball to the target
- vector u = modeleyetarget - boneorg;
- // now transform it inversely by the parent matrix to produce new rel vectors
- v.x = u * parentforward;
- v.y = u * parentright;
- v.z = u * parentup;
- vector ang = vectoangles2(v, relup);
- ang.x = 0 - ang.x;
- makevectors(ang);
- // set the relative bone matrix
- skel_set_bone(self.skeletonindex, bonenum, relorg);
- // restore caller's v_ vectors
- v_forward = oldforward;
- v_right = oldright;
- v_up = oldup;
-};
-// delete skeleton when we're done with it
-// note: skeleton remains valid until next frame when it is really deleted
-void() example_skel_player_delete =
-{
- skel_delete(self.skeletonindex);
- self.skeletonindex = 0;
-};
-//
-// END OF EXAMPLES FOR FTE_CSQC_SKELETONOBJECTS
-//
-
-//KRIMZON_SV_PARSECLIENTCOMMAND
-//idea: KrimZon
-//darkplaces implementation: KrimZon, LordHavoc
-//engine-called QC prototypes:
-//void(string s) SV_ParseClientCommand;
-//builtin definitions:
-void(entity e, string s) clientcommand = #440;
-int(string s) tokenize = #441;
-string(float n) argv = #442;
-//description:
-//provides QC the ability to completely control server interpretation of client commands ("say" and "color" for example, clientcommand is necessary for this and substring (FRIK_FILE) is useful) as well as adding new commands (tokenize, argv, and stof (FRIK_FILE) are useful for this)), whenever a clc_stringcmd is received the QC function is called, and it is up to the QC to decide what (if anything) to do with it
-
-//NEH_CMD_PLAY2
-//idea: Nehahra
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports the "play2" console command (plays a sound without spatialization).
-
-//NEH_RESTOREGAME
-//idea: Nehahra
-//darkplaces implementation: LordHavoc
-//engine-called QC prototypes:
-//void() RestoreGame;
-//description:
-//when a savegame is loaded, this function is called
-
-//NEXUIZ_PLAYERMODEL
-//idea: Nexuiz
-//darkplaces implementation: Black
-//console commands:
-//playermodel <name> - FIXME: EXAMPLE NEEDED
-//playerskin <name> - FIXME: EXAMPLE NEEDED
-//field definitions:
-.string playermodel; // name of player model sent by client
-.string playerskin; // name of player skin sent by client
-//description:
-//these client properties are used by Nexuiz.
-
-//NXQ_GFX_LETTERBOX
-//idea: nxQuake
-//darkplaces implementation: LordHavoc
-//description:
-//shows that the engine supports the "r_letterbox" console variable, set to values in the range 0-100 this restricts the view vertically (and turns off sbar and crosshair), value is a 0-100 percentage of how much to constrict the view, <=0 = normal view height, 25 = 75% of normal view height, 50 = 50%, 75 = 25%, >=100 = no view
-
-//PRYDON_CLIENTCURSOR
-//idea: FrikaC
-//darkplaces implementation: LordHavoc
-//effects bit:
-const int EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten)
-//field definitions:
-.float cursor_active; // true if cl_prydoncursor mode is on
-.vector cursor_screen; // screen position of cursor as -1 to +1 in _x and _y (_z unused)
-.vector cursor_trace_start; // position of camera
-.vector cursor_trace_endpos; // position of cursor in world (as traced from camera)
-.entity cursor_trace_ent; // entity the cursor is pointing at (server forces this to world if the entity is currently free at time of receipt)
-//cvar definitions:
-//cl_prydoncursor (0/1+, default 0, 1 and above use cursors named gfx/prydoncursor%03i.lmp - or .tga and such if DP_GFX_EXTERNALTEXTURES is implemented)
-//description:
-//shows that the engine supports the cl_prydoncursor cvar, this puts a clientside mouse pointer on the screen and feeds input to the server for the QuakeC to use as it sees fit.
-//the mouse pointer triggers button4 if cursor is at left edge of screen, button5 if at right edge of screen, button6 if at top edge of screen, button7 if at bottom edge of screen.
-//the clientside trace skips transparent entities (except those marked EF_SELECTABLE).
-//the selected entity highlights only if EF_SELECTABLE is set, a typical selection method would be doubling the brightness of the entity by some means (such as colormod[] *= 2).
-//intended to be used by Prydon Gate.
-
-//TENEBRAE_GFX_DLIGHTS
-//idea: Tenebrae
-//darkplaces implementation: LordHavoc
-//fields:
-.float light_lev; // radius (does not affect brightness), typical value 350
-.vector color; // color (does not affect radius), typical value '1 1 1' (bright white), can be up to '255 255 255' (nuclear blast)
-.float style; // light style (like normal light entities, flickering torches or switchable, etc)
-.float pflags; // flags (see PFLAGS_ constants)
-.vector angles; // orientation of the light
-.int skin; // cubemap filter number, can be 1-255 (0 is assumed to be none, and tenebrae only allows 16-255), this selects a projective light filter, a value of 1 loads cubemaps/1posx.tga and cubemaps/1negx.tga and posy, negy, posz, and negz, similar to skybox but some sides need to be rotated or flipped
-//constants:
-float PFLAGS_NOSHADOW = 1; // light does not cast shadows
-float PFLAGS_CORONA = 2; // light has a corona flare
-float PFLAGS_FULLDYNAMIC = 128; // light enable (without this set no light is produced!)
-//description:
-//more powerful dynamic light settings
-//warning: it is best not to use cubemaps on a light entity that has a model, as using a skin number that a model does not have will cause issues in glquake, and produce warnings in darkplaces (use developer 1 to see them)
-//changes compared to tenebrae (because they're too 'leet' for standards):
-//note: networking should send entities with PFLAGS_FULLDYNAMIC set even if they have no model (lights in general do not have a model, nor should they)
-//EF_FULLDYNAMIC effects flag replaced by PFLAGS_FULLDYNAMIC flag (EF_FULLDYNAMIC conflicts with EF_NODRAW)
-
-//TW_SV_STEPCONTROL
-//idea: Transfusion
-//darkplaces implementation: LordHavoc
-//cvars:
-//sv_jumpstep (0/1, default 1)
-//sv_stepheight (default 18)
-//description:
-//sv_jumpstep allows stepping up onto stairs while airborn, sv_stepheight controls how high a single step can be.
-
-//FTE_QC_CHECKPVS
-//idea: Urre
-//darkplaces implementation: divVerent
-//builtin definitions:
-float checkpvs(vector viewpos, entity viewee) = #240;
-//description:
-//returns true if viewee can be seen from viewpos according to PVS data
-
-//FTE_STRINGS
-//idea: many
-//darkplaces implementation: KrimZon
-//builtin definitions:
-int(string str, string sub, float startpos) strstrofs = #221; // returns the offset into a string of the matching text, or -1 if not found, case sensitive
-int(string str, float ofs) str2chr = #222; // returns the character at the specified offset as an integer, or 0 if an invalid index, or byte value - 256 if the engine supports UTF8 and the byte is part of an extended character
-string(int c, ...) chr2str = #223; // returns a string representing the character given, if the engine supports UTF8 this may be a multi-byte sequence (length may be more than 1) for characters over 127.
-string(float ccase, float calpha, float cnum, string s, ...) strconv = #224; // reformat a string with special color characters in the font, DO NOT USE THIS ON UTF8 ENGINES (if you are lucky they will emit ^4 and such color codes instead), the parameter values are 0=same/1=lower/2=upper for ccase, 0=same/1=white/2=red/5=alternate/6=alternate-alternate for redalpha, 0=same/1=white/2=red/3=redspecial/4=whitespecial/5=alternate/6=alternate-alternate for rednum.
-string(float chars, string s, ...) strpad = #225; // pad string with spaces to a specified length, < 0 = left padding, > 0 = right padding
-string(string info, string key, string value, ...) infoadd = #226; // sets or adds a key/value pair to an infostring - note: forbidden characters are \ and "
-string(string info, string key) infoget = #227; // gets a key/value pair in an infostring, returns value or null if not found
-int(string s1, string s2) strcmp = #228; // compare two strings
-int(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character.
-int(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar
-int(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp
-//string(string s, float start, float length) substring = #116; // see note below
-//description:
-//various string manipulation functions
-//note: substring also exists in FRIK_FILE but this extension adds negative start and length as valid cases (see note above), substring is consistent with the php 5.2.0 substr function (not 5.2.3 behavior)
-//substring returns a section of a string as a tempstring, if given negative
-// start the start is measured back from the end of the string, if given a
-// negative length the length is the offset back from the end of the string to
-// stop at, rather than being relative to start, if start is negative and
-// larger than length it is treated as 0.
-// examples of substring:
-// substring("blah", -3, 3) returns "lah"
-// substring("blah", 3, 3) returns "h"
-// substring("blah", -10, 3) returns "bla"
-// substring("blah", -10, -3) returns "b"
-
-//DP_CON_BESTWEAPON
-//idea: many
-//darkplaces implementation: divVerent
-//description:
-//allows QC to register weapon properties for use by the bestweapon command, for mods that change required ammo count or type for the weapons
-//it is done using console commands sent via stuffcmd:
-// register_bestweapon quake
-// register_bestweapon clear
-// register_bestweapon <shortname> <impulse> <itemcode> <activeweaponcode> <ammostat> <ammomin>
-//for example, this is what Quake uses:
-// register_bestweapon 1 1 4096 4096 6 0 // STAT_SHELLS is 6
-// register_bestweapon 2 2 1 1 6 1
-// register_bestweapon 3 3 2 2 6 1
-// register_bestweapon 4 4 4 4 7 1 // STAT_NAILS is 7
-// register_bestweapon 5 5 8 8 7 1
-// register_bestweapon 6 6 16 16 8 1 // STAT_ROCKETS is 8
-// register_bestweapon 7 7 32 32 8 1
-// register_bestweapon 8 8 64 64 9 1 // STAT_CELLS is 9
-//after each map client initialization, this is reset back to Quake settings. So you should send these data in ClientConnect.
-//also, this extension introduces a new "cycleweapon" command to the user.
-
-//DP_QC_STRINGBUFFERS
-//idea: ??
-//darkplaces implementation: LordHavoc
-//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
-int() buf_create = #460;
-void(float bufhandle) buf_del = #461;
-float(float bufhandle) buf_getsize = #462;
-void(float bufhandle_from, float bufhandle_to) buf_copy = #463;
-void(float bufhandle, float sortpower, float backward) buf_sort = #464;
-string(float bufhandle, string glue) buf_implode = #465;
-string(float bufhandle, float string_index) bufstr_get = #466;
-void(float bufhandle, float string_index, string str) bufstr_set = #467;
-float(float bufhandle, string str, float order) bufstr_add = #468;
-void(float bufhandle, float string_index) bufstr_free = #469;
-
-//DP_QC_STRINGBUFFERS_CVARLIST
-//idea: divVerent
-//darkplaces implementation: divVerent
-//functions to list cvars and store their names into a stringbuffer
-//cvars that start with pattern but not with antipattern will be stored into the buffer
-void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517;
-
-//DP_QC_STRINGBUFFERS_EXT_WIP
-//idea: VorteX
-//darkplaces implementation: VorteX
-//constant definitions:
-const float MATCH_AUTO = 0;
-const float MATCH_WHOLE = 1;
-const float MATCH_LEFT = 2;
-const float MATCH_RIGHT = 3;
-const float MATCH_MIDDLE = 4;
-const float MATCH_PATTERN = 5;
-//builtin definitions:
-float(string filename, float bufhandle) buf_loadfile = #535; // append each line of file as new buffer string, return 1 if succesful
-float(float filehandle, float bufhandle, float startpos, float numstrings) buf_writefile = #536; // writes buffer strings as lines, returns 1 if succesful
-float(float bufhandle, string match, float matchrule, float startpos, float step) bufstr_find = #537; // returns string index
-float(string s, string pattern, float matchrule) matchpattern = #538; // returns 0/1
-float(string s, string pattern, float matchrule, float pos) matchpatternofs = #538;
-//description:
-//provides a set of functions to manipulate with string buffers
-//pattern wildcards: * - any character (or no characters), ? - any 1 character
-//Warning: This extension is work-in-progress, it may be changed/revamped/removed at any time, dont use it if you dont want any trouble
-//wip note: UTF8 is not supported yet
-
-//DP_QC_STRREPLACE
-//idea: Sajt
-//darkplaces implementation: Sajt
-//builtin definitions:
-string(string search, string replace, string subject) strreplace = #484;
-string(string search, string replace, string subject) strireplace = #485;
-//description:
-//strreplace replaces all occurrences of 'search' with 'replace' in the string 'subject', and returns the result as a tempstring.
-//strireplace does the same but uses case-insensitive matching of the 'search' term
-
-//DP_SV_SHUTDOWN
-//idea: divVerent
-//darkplaces implementation: divVerent
-//A function that gets called just before progs exit. To save persistent data from.
-//It is not called on a crash or error.
-//void SV_Shutdown();
-
-//EXT_CSQC
-// #232 void(float index, float type, .void field) SV_AddStat (EXT_CSQC)
-void(float index, float type, ...) addstat = #232;
-
-//ZQ_PAUSE
-//idea: ZQuake
-//darkplaces implementation: GreEn`mArine
-//builtin definitions:
-void(float pause) setpause = #531;
-//function definitions:
-//void(float elapsedtime) SV_PausedTic;
-//description:
-//during pause the world is not updated (time does not advance), SV_PausedTic is the only function you can be sure will be called at regular intervals during the pause, elapsedtime is the current system time in seconds since the pause started (not affected by slowmo or anything else).
-//
-//calling setpause(0) will end a pause immediately.
-//
-//Note: it is worth considering that network-related functions may be called during the pause (including customizeentityforclient for example), and it is also important to consider the continued use of the KRIMZON_SV_PARSECLIENTCOMMAND extension while paused (chatting players, etc), players may also join/leave during the pause. In other words, the only things that are not called are think and other time-related functions.
-
-//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.
-
-
-// EXPERIMENTAL (not finalized) EXTENSIONS:
-
-//DP_CRYPTO
-//idea: divVerent
-//darkplaces implementation: divVerent
-//field definitions: (SVQC)
-.string crypto_keyfp; // fingerprint of CA key the player used to authenticate
-.string crypto_mykeyfp; // fingerprint of CA key the server used to authenticate to the player
-.string crypto_idfp; // fingerprint of ID used by the player entity, or string_null if not identified
-.float crypto_idfp_signed; // set if the player's ID has been signed
-.string crypto_encryptmethod; // the string "AES128" if encrypting, and string_null if plaintext
-.string crypto_signmethod; // the string "HMAC-SHA256" if signing, and string_null if plaintext
-// there is no field crypto_myidfp, as that info contains no additional information the QC may have a use for
-//builtin definitions: (SVQC)
-float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
-//description:
-//use -1 as buffer handle to justs end delim as postdata
#endif
#pragma noref 1
-///////////////////////////
-// key constants
+//#define float const int
-//
-// these are the key numbers that should be passed to Key_Event
-//
-int K_TAB = 9;
-int K_ENTER = 13;
-int K_ESCAPE = 27;
-int K_SPACE = 32;
+#include "upstream/keycodes.qc"
-// normal keys should be passed as lowercased ascii
-
-int K_BACKSPACE = 127;
-int K_UPARROW = 128;
-int K_DOWNARROW = 129;
-int K_LEFTARROW = 130;
-int K_RIGHTARROW = 131;
-
-int K_ALT = 132;
-int K_CTRL = 133;
-int K_SHIFT = 134;
-
-int K_F1 = 135;
-int K_F2 = 136;
-int K_F3 = 137;
-int K_F4 = 138;
-int K_F5 = 139;
-int K_F6 = 140;
-int K_F7 = 141;
-int K_F8 = 142;
-int K_F9 = 143;
-int K_F10 = 144;
-int K_F11 = 145;
-int K_F12 = 146;
-
-int K_INS = 147;
-int K_DEL = 148;
-int K_PGDN = 149;
-int K_PGUP = 150;
-int K_HOME = 151;
-int K_END = 152;
-
-int K_NUMLOCK = 154;
-int K_CAPSLOCK = 155;
-int K_SCROLLLOCK = 156;
-
-int K_KP_0 = 157;
-int K_KP_INS = 157; // same as K_KP_0
-int K_KP_1 = 158;
-int K_KP_END = 158; // same as K_KP_1
-int K_KP_2 = 159;
-int K_KP_DOWNARROW = 159; // same as K_KP_2
-int K_KP_3 = 160;
-int K_KP_PGDN = 160; // same as K_KP_3
-int K_KP_4 = 161;
-int K_KP_LEFTARROW = 161; // same as K_KP_4
-int K_KP_5 = 162;
-int K_KP_6 = 163;
-int K_KP_RIGHTARROW = 163; // same as K_KP_6
-int K_KP_7 = 164;
-int K_KP_HOME = 164; // same as K_KP_7
-int K_KP_8 = 165;
-int K_KP_UPARROW = 165; // same as K_KP_8
-int K_KP_9 = 166;
-int K_KP_PGUP = 166; // same as K_KP_9
-int K_KP_PERIOD = 167;
-int K_KP_DEL = 167; // same as K_KP_PERIOD
-int K_KP_DIVIDE = 168;
-int K_KP_SLASH = 168; // same as K_KP_DIVIDE
-int K_KP_MULTIPLY = 169;
-int K_KP_MINUS = 170;
-int K_KP_PLUS = 171;
-int K_KP_ENTER = 172;
-int K_KP_EQUALS = 173;
-
-// mouse buttons generate virtual keys
-int K_PAUSE = 153;
-
-//
-// joystick buttons
-//
-int K_JOY1 = 768;
-int K_JOY2 = 769;
-int K_JOY3 = 770;
-int K_JOY4 = 771;
-
-//
-//
-// aux keys are for multi-buttoned joysticks to generate so they can use
-// the normal binding process
-//
-int K_AUX1 = 772;
-int K_AUX2 = 773;
-int K_AUX3 = 774;
-int K_AUX4 = 775;
-int K_AUX5 = 776;
-int K_AUX6 = 777;
-int K_AUX7 = 778;
-int K_AUX8 = 779;
-int K_AUX9 = 780;
-int K_AUX10 = 781;
-int K_AUX11 = 782;
-int K_AUX12 = 783;
-int K_AUX13 = 784;
-int K_AUX14 = 785;
-int K_AUX15 = 786;
-int K_AUX16 = 787;
-int K_AUX17 = 788;
-int K_AUX18 = 789;
-int K_AUX19 = 790;
-int K_AUX20 = 791;
-int K_AUX21 = 792;
-int K_AUX22 = 793;
-int K_AUX23 = 794;
-int K_AUX24 = 795;
-int K_AUX25 = 796;
-int K_AUX26 = 797;
-int K_AUX27 = 798;
-int K_AUX28 = 799;
-int K_AUX29 = 800;
-int K_AUX30 = 801;
-int K_AUX31 = 802;
-int K_AUX32 = 803;
-
-//
-// mouse buttons generate virtual keys
-//
-int K_MOUSE1 = 512;
-int K_MOUSE2 = 513;
-int K_MOUSE3 = 514;
-int K_MWHEELUP = 515;
-int K_MWHEELDOWN = 516;
-int K_MOUSE4 = 517;
-int K_MOUSE5 = 518;
-int K_MOUSE6 = 519;
-int K_MOUSE7 = 520;
-int K_MOUSE8 = 521;
-int K_MOUSE9 = 522;
-int K_MOUSE10 = 523;
-int K_MOUSE11 = 524;
-int K_MOUSE12 = 525;
-int K_MOUSE13 = 526;
-int K_MOUSE14 = 527;
-int K_MOUSE15 = 528;
-int K_MOUSE16 = 529;
+//#undef float
#pragma noref 0
#pragma noref 1
-//////////////////////////////////////////////////////////
-// sys globals
-
-entity self;
-
-/////////////////////////////////////////////////////////
-void end_sys_globals;
-/////////////////////////////////////////////////////////
-// sys fields
-
-/////////////////////////////////////////////////////////
-void end_sys_fields;
-/////////////////////////////////////////////////////////
-// sys functions
-
-void() m_init;
-void(float keynr, float ascii) m_keydown;
-void(float width, float height) m_draw;
-void(float mode) m_toggle;
-void() m_shutdown;
-// optional: float(float) m_gethostcachecategory;
-
-/////////////////////////////////////////////////////////
-// sys constants
-///////////////////////////
-// key dest constants
-
-float KEY_UNKNOWN = -1;
-float KEY_GAME = 0;
-float KEY_MENU = 2;
-float KEY_MENU_GRABBED = 3;
-
-///////////////////////////
-// file constants
-
-float FILE_READ = 0;
-float FILE_APPEND = 1;
-float FILE_WRITE = 2;
-
-///////////////////////////
-// msg constants
-
-float MSG_BROADCAST = 0; // unreliable to all
-float MSG_ONE = 1; // reliable to one (msg_entity)
-float MSG_ALL = 2; // reliable to all
-float MSG_INIT = 3; // write to the init string
-
-/////////////////////////////
-// mouse target constants
-
-float MT_MENU = 1;
-float MT_CLIENT = 2;
-
-/////////////////////////
-// client state constants
-
-float CS_DEDICATED = 0;
-float CS_DISCONNECTED = 1;
-float CS_CONNECTED = 2;
-
-///////////////////////////
-// blend flags
-
-float DRAWFLAG_NORMAL = 0;
-float DRAWFLAG_ADDITIVE = 1;
-float DRAWFLAG_MODULATE = 2;
-float DRAWFLAG_2XMODULATE = 3;
-
-///////////////////////////
-// null entity (actually it is the same like the world entity)
-
-entity null_entity;
-
-///////////////////////////
-// error constants
-
-// file handling
-float ERR_CANNOTOPEN = -1; // fopen
-float ERR_NOTENOUGHFILEHANDLES = -2; // fopen
-float ERR_INVALIDMODE = -3; // fopen
-float ERR_BADFILENAME = -4; // fopen
-
-// drawing functions
-
-float ERR_NULLSTRING = -1;
-float ERR_BADDRAWFLAG = -2;
-float ERR_BADSCALE = -3;
-float ERR_BADSIZE = -3; // same as ERR_BADSCALE
-float ERR_NOTCACHED = -4;
-
-// server list stuff
-float SLIST_HOSTCACHEVIEWCOUNT = 0;
-float SLIST_HOSTCACHETOTALCOUNT = 1;
-float SLIST_MASTERQUERYCOUNT = 2;
-float SLIST_MASTERREPLYCOUNT = 3;
-float SLIST_SERVERQUERYCOUNT = 4;
-float SLIST_SERVERREPLYCOUNT = 5;
-float SLIST_SORTFIELD = 6;
-float SLIST_SORTDESCENDING = 7;
-float SLIST_LEGACY_LINE1 = 1024;
-float SLIST_LEGACY_LINE2 = 1025;
-float SLIST_TEST_CONTAINS = 0;
-float SLIST_TEST_NOTCONTAIN = 1;
-float SLIST_TEST_LESSEQUAL = 2;
-float SLIST_TEST_LESS = 3;
-float SLIST_TEST_EQUAL = 4;
-float SLIST_TEST_GREATER = 5;
-float SLIST_TEST_GREATEREQUAL = 6;
-float SLIST_TEST_NOTEQUAL = 7;
-float SLIST_TEST_STARTSWITH = 8;
-float SLIST_TEST_NOTSTARTSWITH = 9;
-float SLIST_MASK_AND = 0;
-float SLIST_MASK_OR = 512;
-
-// font stuff
-float FONT_DEFAULT = 0;
-float FONT_CONSOLE = 1;
-float FONT_SBAR = 2;
-float FONT_NOTIFY = 3;
-float FONT_CHAT = 4;
-float FONT_CENTERPRINT = 5;
-float FONT_INFOBAR = 6;
-float FONT_MENU = 7;
-float FONT_USER = 8; // add to this the index, like FONT_USER+3 = user3. At least 8 of them are supported.
-float drawfont;
-
-/* not supported at the moment
-///////////////////////////
-// os constants
-
-float OS_WINDOWS = 0;
-float OS_LINUX = 1;
-float OS_MAC = 2;
-*/
-
-
-
-
-
-
-
-
-
-
-//////////////////////////////////////////////////
-// common cmd
-//////////////////////////////////////////////////
-// AK FIXME: Create perhaps a special builtin file for the common cmds
-
-void checkextension(string ext) = #1;
-
-// error cmds
-void error(string err,...) = #2;
-void objerror(string err,...) = #3;
-
-// print
-
-void print(string text,...) = #4;
-void bprint(string text,...) = #5;
-void sprint(float clientnum, string text,...) = #6;
-void centerprint(string text,...) = #7;
-
-// vector stuff
-
-vector normalize(vector v) = #8;
-float vlen(vector v) = #9;
-float vectoyaw(vector v) = #10;
-vector vectoangles(vector v) = #11;
-
-float random(void) = #12;
-
-void cmd(string command, ...) = #13;
-
-// cvar cmds
-
-float cvar(string name) = #14;
-const string str_cvar(string name) = #71;
-void cvar_set(string name, string value) = #15;
-
-void dprint(string text,...) = #16;
-
-// conversion functions
-
-string ftos(float f) = #17;
-float fabs(float f) = #18;
-string vtos(vector v) = #19;
-string etos(entity e) = #20;
-
-float stof(string val,...) = #21;
-
-entity spawn(void) = #22;
-void remove(entity e) = #23;
-
-entity find(entity start, .string field, string match) = #24;
-entity findfloat(entity start, .float field, float match) = #25;
-entity findentity(entity start, .entity field, entity match) = #25;
-
-entity findchainstring(.string field, string match) = #26;
-entity findchainfloat(.float field, float match) = #27;
-entity findchainentity(.entity field, entity match) = #27;
-
-string precache_file(string file) = #28;
-string precache_sound(string sample) = #29;
-
-void crash(void) = #72;
-void coredump(void) = #30;
-void stackdump(void) = #73;
-void traceon(void) = #31;
-void traceoff(void) = #32;
-
-void eprint(entity e) = #33;
-float rint(float f) = #34;
-float floor(float f) = #35;
-float ceil(float f) = #36;
-entity nextent(entity e) = #37;
-float sin(float f) = #38;
-float cos(float f) = #39;
-float sqrt(float f) = #40;
-vector randomvec(void) = #41;
-
-float registercvar(string name, string value, float flags) = #42; // returns 1 if success
-
-float min(float f,...) = #43;
-float max(float f,...) = #44;
-
-float bound(float min,float value, float max) = #45;
-float pow(float a, float b) = #46;
-
-void copyentity(entity src, entity dst) = #47;
-
-float fopen(string filename, float mode) = #48;
-void fclose(float fhandle) = #49;
-string fgets(float fhandle) = #50;
-void fputs(float fhandle, string s) = #51;
-
-float strlen(string s) = #52;
-string strcat(string s1,string s2,...) = #53;
-string substring(string s, float start, float length) = #54;
-
-vector stov(string s) = #55;
-
-string strzone(string s) = #56;
-void strunzone(string s) = #57;
-
-float tokenize(string s) = #58;
-string argv(float n) = #59;
-
-float isserver(void) = #60;
-float clientcount(void) = #61;
-float clientstate(void) = #62;
-void clientcommand(float client, string s) = #63;
-void changelevel(string map) = #64;
-void localsound(string sample) = #65;
-vector getmousepos(void) = #66;
-float gettime(void) = #67;
-void loadfromdata(string data) = #68;
-void loadfromfile(string file) = #69;
-
-float mod(float val, float m) = #70;
-
-float search_begin(string pattern, float caseinsensitive, float quiet) = #74;
-void search_end(float handle) = #75;
-float search_getsize(float handle) = #76;
-string search_getfilename(float handle, float num) = #77;
-
-string chr(float ascii) = #78;
-
-/////////////////////////////////////////////////
-// Write* Functions
-/////////////////////////////////////////////////
-void WriteByte(float data, float dest, float desto) = #401;
-void WriteChar(float data, float dest, float desto) = #402;
-void WriteShort(float data, float dest, float desto) = #403;
-void WriteLong(float data, float dest, float desto) = #404;
-void WriteAngle(float data, float dest, float desto) = #405;
-void WriteCoord(float data, float dest, float desto) = #406;
-void WriteString(string data, float dest, float desto)= #407;
-void WriteEntity(entity data, float dest, float desto) = #408;
-
-//////////////////////////////////////////////////
-// Draw funtions
-//////////////////////////////////////////////////
-
-float iscachedpic(string name) = #451;
-string precache_pic(string name, ...) = #452;
-void freepic(string name) = #453;
-
-float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454;
-
-float drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #455;
-
-float drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #467;
-
-vector drawcolorcodedstring2(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #467;
-
-float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
-
-float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
-
-void drawsetcliparea(float x, float y, float width, float height) = #458;
-
-void drawresetcliparea(void) = #459;
-
-vector drawgetimagesize(string pic) = #460;
-
-////////////////////////////////////////////////
-// Menu functions
-////////////////////////////////////////////////
-
-void setkeydest(float dest) = #601;
-float getkeydest(void) = #602;
-
-void setmousetarget(float trg) = #603;
-float getmousetarget(void) = #604;
-
-float isfunction(string function_name) = #607;
-void callfunction(...) = #605;
-void writetofile(float fhandle, entity ent) = #606;
-vector getresolution(float number) = #608;
-string keynumtostring(float keynum) = #609;
-
-float gethostcachevalue(float type) = #611;
-string gethostcachestring(float type, float hostnr) = #612;
-
-//DP_CSQC_BINDMAPS
-//idea: daemon, motorsep
-//darkplaces implementation: divVerent
-//builtin definitions:
-string(float key, float bindmap) getkeybind_bindmap = #342;
-float(float key, string bind, float bindmap) setkeybind_bindmap = #630;
-vector(void) getbindmaps = #631;
-float(vector bm) setbindmaps = #632;
-string(string command, float bindmap) findkeysforcommand = #610;
-float(string key) stringtokeynum = #341;
-//<also allowed builtin number to match EXT_CSQC> string(float keynum) keynumtostring = #340;
-//description: key bind setting/getting including support for switchable
-//bindmaps.
-
-//DP_CRYPTO
-//idea: divVerent
-//darkplaces implementation: divVerent
-//field definitions: (MENUQC)
-string(string serveraddress) crypto_getkeyfp = #633; // retrieves the cached host key's CA fingerprint of a server given by IP address
-string(string serveraddress) crypto_getidfp = #634; // retrieves the cached host key fingerprint of a server given by IP address
-float(string serveraddress) crypto_getidstatus = #643; // retrieves the cached host key's key status. See below for CRYPTO_IDSTATUS_ defines.
-string(string serveraddress) crypto_getencryptlevel = #635; // 0 if never encrypting, 1 supported, 2 requested, 3 required, appended by list of allowed methods in order of preference ("AES128"), preceded by a space each
-string(float i) crypto_getmykeyfp = #636; // retrieves the CA key fingerprint of a given CA slot, or "" if slot is unused but more to come, or string_null if end of list
-string(float i) crypto_getmyidfp = #637; // retrieves the ID fingerprint of a given CA slot, or "" if slot is unused but more to come, or string_null if end of list
-float CRYPTO_IDSTATUS_OUTOFRANGE = -1;
-float CRYPTO_IDSTATUS_EMPTY = 0;
-float CRYPTO_IDSTATUS_UNSIGNED = 1;
-float CRYPTO_IDSTATUS_SIGNED = 2;
-float(float i) crypto_getmyidstatus = #641; // retrieves the ID's status of a given CA slot, or 0 if slot is unused but more to come, or -1 if end of list
-float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
-//description:
-//use -1 as buffer handle to justs end delim as postdata
-
-//DP_GECKO_SUPPORT
-//idea: Res2k, BlackHC
-//darkplaces implementation: Res2k, BlackHC
-//constant definitions:
-float GECKO_BUTTON_DOWN = 0;
-float GECKO_BUTTON_UP = 1;
-// either use down and up or just press but not all of them!
-float GECKO_BUTTON_PRESS = 2;
-// use this for mouse events if needed?
-float GECKO_BUTTON_DOUBLECLICK = 3;
-//builtin definitions:
-float gecko_create( string name ) = #487;
-void gecko_destroy( string name ) = #488;
-void gecko_navigate( string name, string URI ) = #489;
-float gecko_keyevent( string name, float key, float eventtype ) = #490;
-void gecko_mousemove( string name, float x, float y ) = #491;
-void gecko_resize( string name, float w, float h ) = #492;
-vector gecko_get_texture_extent( string name ) = #493;
-//engine-called QC prototypes:
-//string(string name, string query) Qecko_Query;
-//description:
-//provides an interface to the offscreengecko library and allows for internet browsing in games
-
-//FTE_STRINGS
-//idea: many
-//darkplaces implementation: KrimZon
-//description:
-//various string manipulation functions
-int(string str, string sub, float startpos) strstrofs = #221;
-int(string str, float ofs) str2chr = #222;
-string(int c, ...) chr2str = #223;
-string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
-string(float chars, string s, ...) strpad = #225;
-string(string info, string key, string value, ...) infoadd = #226;
-string(string info, string key) infoget = #227;
-int(string s1, string s2) strcmp = #228;
-int(string s1, string s2, float len) strncmp = #228;
-int(string s1, string s2) strcasecmp = #229;
-int(string s1, string s2, float len) strncasecmp = #230;
-
-//DP_PRECACHE_PIC_FLAGS
-//idea: divVerent
-//darkplaces implementation: divVerent
-//constant definitions:
-float PRECACHE_PIC_FROMWAD = 1; // this one actually is part of EXT_CSQC
-float PRECACHE_PIC_NOTPERSISTENT = 2; // picture may get deallocated when unused
-float PRECACHE_PIC_MIPMAP = 8; // mipmap the texture for possibly better downscaling at memory expense
-//notes: these constants are given as optional second argument to precache_pic()
-
-//DP_QC_CRC16
-//idea: div0
-//darkplaces implementation: div0
-//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
-//When caseinsensitive is set, the CRC is calculated of the lower cased string.
-float(float caseinsensitive, string s, ...) crc16 = #494;
-
-//DP_QC_CVAR_TYPE
-float(string name) cvar_type = #495;
-float CVAR_TYPEFLAG_EXISTS = 1;
-float CVAR_TYPEFLAG_SAVED = 2;
-float CVAR_TYPEFLAG_PRIVATE = 4;
-float CVAR_TYPEFLAG_ENGINE = 8;
-float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
-float CVAR_TYPEFLAG_READONLY = 32;
-
-//DP_QC_STRINGBUFFERS
-//idea: ??
-//darkplaces implementation: LordHavoc
-//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
-int() buf_create = #440;
-void(float bufhandle) buf_del = #441;
-float(float bufhandle) buf_getsize = #442;
-void(float bufhandle_from, float bufhandle_to) buf_copy = #443;
-void(float bufhandle, float sortpower, float backward) buf_sort = #444;
-string(float bufhandle, string glue) buf_implode = #445;
-string(float bufhandle, float string_index) bufstr_get = #446;
-void(float bufhandle, float string_index, string str) bufstr_set = #447;
-float(float bufhandle, string str, float order) bufstr_add = #448;
-void(float bufhandle, float string_index) bufstr_free = #449;
-void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517;
-
-//DP_QC_STRING_CASE_FUNCTIONS
-//idea: Dresk
-//darkplaces implementation: LordHavoc / Dresk
-//builtin definitions:
-string(string s) strtolower = #480; // returns the passed in string in pure lowercase form
-string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form
-//description:
-//provides simple string uppercase and lowercase functions
-
-//DP_QC_CVAR_DESCRIPTION
-//idea: divVerent
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-string(string name) cvar_description = #518;
-//description:
-//returns the description of a cvar
-
-//DP_QC_DIGEST
-//idea: motorsep, Spike
-//DarkPlaces implementation: divVerent
-//builtin definitions:
-string(string digest, string data, ...) digest_hex = #639;
-//description:
-//returns a given hex digest of given data
-//the returned digest is always encoded in hexadecimal
-//only the "MD4" digest is always supported!
-//if the given digest is not supported, string_null is returned
-//the digest string is matched case sensitively, use "MD4", not "md4"!
-
-//DP_QC_URI_ESCAPE
-//idea: div0
-//darkplaces implementation: div0
-//URI::Escape's functionality
-string(string in) uri_escape = #510;
-string(string in) uri_unescape = #511;
-
-//DP_QC_URI_GET
-//idea: divVerent
-//darkplaces implementation: divVerent
-//loads text from an URL into a string
-//returns 1 on success of initiation, 0 if there are too many concurrent
-//connections already or if the URL is invalid
-//the following callback will receive the data and MUST exist!
-// void(float id, float status, string data) URI_Get_Callback;
-//status is either
-// negative for an internal error,
-// 0 for success, or
-// the HTTP response code on server error (e.g. 404)
-//if 1 is returned by uri_get, the callback will be called in the future
-float(string url, float id) uri_get = #513;
-//DP_QC_URI_POST
-//idea: divVerent
-//darkplaces implementation: divVerent
-//loads text from an URL into a string after POSTing via HTTP
-//works like uri_get, but uri_post sends data with Content-Type: content_type to the server
-//and uri_post sends the string buffer buf, joined using the delimiter delim
-float(string url, float id, string content_type, string data) uri_post = #513;
-float(string url, float id, string content_type, string delim, float buf) uri_postbuf = #513;
-
-//DP_QC_ENTITYDATA
-//idea: KrimZon
-//darkplaces implementation: KrimZon
-//builtin definitions:
-float() numentityfields = #496;
-string(float fieldnum) entityfieldname = #497;
-float(float fieldnum) entityfieldtype = #498;
-string(float fieldnum, entity ent) getentityfieldstring = #499;
-float(float fieldnum, entity ent, string s) putentityfieldstring = #500;
-//constants:
-//Returned by entityfieldtype
-float FIELD_STRING = 1;
-float FIELD_FLOAT = 2;
-float FIELD_VECTOR = 3;
-float FIELD_ENTITY = 4;
-float FIELD_FUNCTION = 6;
-//description:
-//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.
-//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.
-//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
-//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.
-//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.
-//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
-//putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
-
-//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 undocumented extensions
-string(string, float) netaddress_resolve = #625;
-string(string search, string replace, string subject) strreplace = #484;
-string(float uselocaltime, string format, ...) strftime = #478;
-float(string s) tokenize_console = #514;
-float(float i) argv_start_index = #515;
-float(float i) argv_end_index = #516;
-string(float, float) getgamedirinfo = #626;
-const float GETGAMEDIRINFO_NAME = 0;
-const float GETGAMEDIRINFO_DESCRIPTION = 1;
-float log(float f) = #532;
-string(string format, ...) sprintf = #627;
-string(string s) strdecolorize = #477;
-entity findflags(entity start, .float field, float match) = #87;
-entity findchainflags(.float field, float match) = #88;
-float(string s, string separator1, ...) tokenizebyseparator = #479;
-float etof(entity ent) = #79;
-entity ftoe(float num) = #80;
-float validstring(string str) = #81;
-float altstr_count(string str) = #82;
-string altstr_prepare(string str) = #83;
-string altstr_get(string str, float num) = #84;
-string altstr_set(string str, float num, string set) = #85;
-string altstr_ins(string str, float num, string set) = #86;
-float isdemo() = #349;
-float drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #469;
-//vector getresolution(float number, ...) = #608; // optional argument "isfullscreen"
-void parseentitydata(entity ent, string data) = #613;
-void resethostcachemasks(void) = #615;
-void sethostcachemaskstring(float mask, float fld, string str, float op) = #616;
-void sethostcachemasknumber(float mask, float fld, float num, float op) = #617;
-void resorthostcache(void) = #618;
-float SLSF_DESCENDING = 1;
-float SLSF_FAVORITES = 2;
-float SLSF_CATEGORIES = 4;
-void sethostcachesort(float fld, float slsf) = #619;
-void refreshhostcache(...) = #620; // optional boolean argument "clear_list"
-float gethostcachenumber(float fld, float hostnr) = #621;
-float gethostcacheindexforkey(string key) = #622;
-void addwantedhostcachekey(string key) = #623;
-string getextresponse(void) = #624;
-const string cvar_string(string name) = #71;
-const string cvar_defstring(string name) = #89;
-float stringwidth(string text, float handleColors, vector size) = #468;
+#define true _true
+#define false _false
+#define TRUE _TRUE
+#define FALSE _FALSE
+
+#include "upstream/menudefs.qc"
+
+#undef true
+#undef false
+#undef TRUE
+#undef FALSE
+
+int(string str, string sub, int startpos) _strstrofs = #221;
+#define strstrofs _strstrofs
+int(string str, int ofs) _str2chr = #222;
+#define str2chr _str2chr
+string(int c, ...) _chr2str = #223;
+#define chr2str _chr2str
+
+int(string s1, string s2) _strcmp = #228;
+#define strcmp _strcmp
+int(string s1, string s2, int len) _strncmp = #228;
+#define strncmp _strncmp
+int(string s1, string s2) _strcasecmp = #229;
+#define strcasecmp _strcasecmp
+int(string s1, string s2, int len) _strncasecmp = #230;
+#define strncasecmp _strncasecmp
+
+int() _buf_create = #440;
+#define buf_create _buf_create
#pragma noref 0
#ifndef PROGSDEFS_H
#define PROGSDEFS_H
-/*
-==============================================================================
+#pragma noref 1
- SOURCE FOR GLOBALVARS_T C STRUCTURE
- MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
+#define true _true
+#define false _false
+#define TRUE _TRUE
+#define FALSE _FALSE
-==============================================================================
-*/
+#include "upstream/progsdefs.qc"
-//
-// system globals
-//
-entity self;
-entity other;
-entity world;
-float time;
-float frametime;
+#undef true
+#undef false
+#undef TRUE
+#undef FALSE
-float force_retouch; // force all entities to touch triggers
- // next frame. this is needed because
- // non-moving things don't normally scan
- // for triggers, and when a trigger is
- // created (like a teleport trigger), it
- // needs to catch everything.
- // decremented each frame, so set to 2
- // to guarantee everything is touched
-string mapname;
+#pragma noref 0
-float deathmatch;
-float coop;
-float teamplay;
-
-int serverflags; // propagated from level to level, used to
- // keep track of completed episodes
-
-float total_secrets;
-float total_monsters;
-
-float found_secrets; // number of secrets found
-float killed_monsters; // number of monsters killed
-
-
-// spawnparms are used to encode information about clients across server
-// level changes
-float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
-
-//
-// global variables set by built in functions
-//
-vector v_forward, v_up, v_right; // set by makevectors()
-
-// set by traceline / tracebox
-float trace_allsolid;
-float trace_startsolid;
-float trace_fraction;
-vector trace_endpos;
-vector trace_plane_normal;
-float trace_plane_dist;
-entity trace_ent;
-float trace_inopen;
-float trace_inwater;
-
-entity msg_entity; // destination of single entity writes
-
-//
-// required prog functions
-//
-void() main; // only for testing
-
-void() StartFrame;
-
-void() PlayerPreThink;
-void() PlayerPostThink;
-
-void() ClientKill;
-#ifdef DP_EXT_PRECONNECT
-void() ClientPreConnect;
-#endif
-void() ClientConnect;
-void() PutClientInServer; // call after setting the parm1... parms
-void() ClientDisconnect;
-
-void() SetNewParms; // called when a client first connects to
- // a server. sets parms so they can be
- // saved off for restarts
-
-void() SetChangeParms; // call to set parms for self so they can
- // be saved for a level transition
-
-
-//================================================
-void end_sys_globals; // flag for structure dumping
-//================================================
-
-/*
-==============================================================================
-
- SOURCE FOR ENTVARS_T C STRUCTURE
- MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
-
-==============================================================================
-*/
-
-//
-// system fields (*** = do not set in prog code, maintained by C code)
-//
-.int modelindex; // *** model index in the precached list
-.vector absmin, absmax; // *** origin + mins / maxs
-
-.float ltime; // local time for entity
-.float movetype;
-.float solid;
-
-.vector origin; // ***
-.vector oldorigin; // ***
-.vector velocity;
-.vector angles;
-.vector avelocity;
-
-.vector punchangle; // temp angle adjust from damage or recoil
-
-.string classname; // spawn function
-.string model;
-.int frame;
-.int skin;
-.int effects;
-
-.vector mins, maxs; // bounding box extents reletive to origin
-.vector size; // maxs - mins
-
-.void() touch;
-.void() use;
-.void() think;
-.void() blocked; // for doors or plats, called when can't push other
-
-.float nextthink;
-.entity groundentity;
-
-// stats
-.float health;
-.float frags;
-.int weapon; // one of the IT_SHOTGUN, etc flags
-.string weaponmodel;
-.float weaponframe;
-.float currentammo;
-.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
-
-.int items; // bit flags
-
-.float takedamage;
-.entity chain;
-.float deadflag;
-
-.vector view_ofs; // add to origin to get eye point
-
-
-.float button0; // fire
-.float button1; // use
-.float button2; // jump
-
-.float impulse; // weapon changes
-
-.float fixangle;
-.vector v_angle; // view / targeting angle for players
-.float idealpitch; // calculated pitch angle for lookup up slopes
-
-
-.string netname;
-
-.entity enemy;
-
-.int flags;
-
-.int colormap;
-.float team;
-
-.float max_health; // players maximum health is stored here
-
-.float teleport_time; // don't back up
-
-.float armortype; // save this fraction of incoming damage
-.float armorvalue;
-
-.float waterlevel; // 0 = not in, 1 = feet, 2 = wast, 3 = eyes
-.float watertype; // a contents value
-
-.float ideal_yaw;
-.float yaw_speed;
-
-.entity aiment;
-
-.entity goalentity; // a movetarget or an enemy
-
-.int spawnflags;
-
-.string target;
-.string targetname;
-
-// damage is accumulated through a frame. and sent as one single
-// message, so the super shotgun doesn't generate huge messages
-.float dmg_take;
-.float dmg_save;
-.entity dmg_inflictor;
-
-.entity owner; // who launched a missile
-.vector movedir; // mostly for doors, but also used for waterjump
-
-.string message; // trigger messages
-
-.float sounds; // either a cd track number or sound number
-
-.string noise, noise1, noise2, noise3; // contains names of wavs to play
-
-//================================================
-void end_sys_fields; // flag for structure dumping
-//================================================
-
-/*
-==============================================================================
-
- CONSTANT DEFINITIONS
-
-==============================================================================
-*/
-
-
-//
-// constants
-//
-
-// edict.flags
-const int FL_FLY = 1;
-const int FL_SWIM = 2;
-const int FL_CLIENT = 8; // set for all client edicts
-const int FL_INWATER = 16; // for enter / leave water splash
-const int FL_MONSTER = 32;
-const int FL_GODMODE = 64; // player cheat
-const int FL_NOTARGET = 128; // player cheat
-const int FL_ITEM = 256; // extra wide size for bonus items
-const int FL_ONGROUND = 512; // standing on something
-const int FL_PARTIALGROUND = 1024; // not all corners are valid
-const int FL_WATERJUMP = 2048; // player jumping out of water
-const int FL_JUMPRELEASED = 4096; // for jump debouncing
-
-// edict.movetype values
-const int MOVETYPE_NONE = 0; // never moves
-//const int MOVETYPE_ANGLENOCLIP= 1;
-//const int MOVETYPE_ANGLECLIP = 2;
-const int MOVETYPE_WALK = 3; // players only
-const int MOVETYPE_STEP = 4; // discrete, not real time unless fall
-const int MOVETYPE_FLY = 5;
-const int MOVETYPE_TOSS = 6; // gravity
-const int MOVETYPE_PUSH = 7; // no clip to world, push and crush
-const int MOVETYPE_NOCLIP = 8;
-const int MOVETYPE_FLYMISSILE = 9; // fly with extra size against monsters
-const int MOVETYPE_BOUNCE = 10;
-const int MOVETYPE_BOUNCEMISSILE= 11; // bounce with extra size
-
-// edict.solid values
-const int SOLID_NOT = 0; // no interaction with other objects
-const int SOLID_TRIGGER = 1; // touch on edge, but not blocking
-const int SOLID_BBOX = 2; // touch on edge, block
-const int SOLID_SLIDEBOX = 3; // touch on edge, but not an onground
-const int SOLID_BSP = 4; // bsp clip, touch on edge, block
-
-// range values
-const int RANGE_MELEE = 0;
-const int RANGE_NEAR = 1;
-const int RANGE_MID = 2;
-const int RANGE_FAR = 3;
-
-// deadflag values
-
-const int DEAD_NO = 0;
-const int DEAD_DYING = 1;
-const int DEAD_DEAD = 2;
-const int DEAD_RESPAWNABLE = 3;
-const int DEAD_RESPAWNING = 4; // dead, waiting for buttons to be released
-
-// takedamage values
-
-const int DAMAGE_NO = 0;
-const int DAMAGE_YES = 1;
-const int DAMAGE_AIM = 2;
-
-// items
-const int IT_AXE = 4096;
-const int IT_SHOTGUN = 1;
-const int IT_SUPER_SHOTGUN = 2;
-const int IT_NAILGUN = 4;
-const int IT_SUPER_NAILGUN = 8;
-const int IT_GRENADE_LAUNCHER = 16;
-const int IT_ROCKET_LAUNCHER = 32;
-const int IT_LIGHTNING = 64;
-const int IT_EXTRA_WEAPON = 128;
-
-//const int IT_SHELLS = 256;
-//const int IT_NAILS = 512;
-//const int IT_ROCKETS = 1024;
-//const int IT_CELLS = 2048;
-
-const int IT_ARMOR1 = 8192;
-const int IT_ARMOR2 = 16384;
-const int IT_ARMOR3 = 32768;
-const int IT_SUPERHEALTH = 65536;
-
-//const int IT_KEY1 = 131072;
-//const int IT_KEY2 = 262144;
-
-const int IT_INVISIBILITY = 524288;
-const int IT_INVULNERABILITY = 1048576;
-const int IT_SUIT = 2097152;
-const int IT_QUAD = 4194304;
-
-// point content values
-
-const int CONTENT_EMPTY = -1;
-const int CONTENT_SOLID = -2;
-const int CONTENT_WATER = -3;
-const int CONTENT_SLIME = -4;
-const int CONTENT_LAVA = -5;
-const int CONTENT_SKY = -6;
-
-const int STATE_TOP = 0;
-const int STATE_BOTTOM = 1;
-const int STATE_UP = 2;
-const int STATE_DOWN = 3;
-
-const vector VEC_ORIGIN = '0 0 0';
-const vector VEC_HULL_MIN = '-16 -16 -24';
-const vector VEC_HULL_MAX = '16 16 32';
-
-const vector VEC_HULL2_MIN = '-32 -32 -24';
-const vector VEC_HULL2_MAX = '32 32 64';
-
-// protocol bytes
-const int SVC_TEMPENTITY = 23;
-const int SVC_KILLEDMONSTER = 27;
-const int SVC_FOUNDSECRET = 28;
-const int SVC_INTERMISSION = 30;
-const int SVC_FINALE = 31;
-const int SVC_CDTRACK = 32;
-const int SVC_SELLSCREEN = 33;
-
-
-const int TE_SPIKE = 0;
-const int TE_SUPERSPIKE = 1;
-const int TE_GUNSHOT = 2;
-const int TE_EXPLOSION = 3;
-const int TE_TAREXPLOSION = 4;
-const int TE_LIGHTNING1 = 5;
-const int TE_LIGHTNING2 = 6;
-const int TE_WIZSPIKE = 7;
-const int TE_KNIGHTSPIKE = 8;
-const int TE_LIGHTNING3 = 9;
-const int TE_LAVASPLASH = 10;
-const int TE_TELEPORT = 11;
-
-// sound channels
-// channel 0 never willingly overrides
-// other channels (1-7) allways override a playing sound on that channel
-const int CHAN_AUTO = 0;
-const int CHAN_WEAPON = 1;
-const int CHAN_VOICE = 2;
-const int CHAN_ITEM = 3;
-const int CHAN_BODY = 4;
-
-const int ATTN_NONE = 0;
-const int ATTN_NORM = 1;
-const int ATTN_IDLE = 2;
-const int ATTN_STATIC = 3;
-
-// update types
-
-const int UPDATE_GENERAL = 0;
-const int UPDATE_STATIC = 1;
-const int UPDATE_BINARY = 2;
-const int UPDATE_TEMP = 3;
-
-// entity effects
-
-const int EF_BRIGHTFIELD = 1;
-const int EF_MUZZLEFLASH = 2;
-const int EF_BRIGHTLIGHT = 4;
-const int EF_DIMLIGHT = 8;
-
-
-// messages
-const int MSG_BROADCAST = 0; // unreliable to all
-const int MSG_ONE = 1; // reliable to one (msg_entity)
-const int MSG_ALL = 2; // reliable to all
-const int MSG_INIT = 3; // write to the init string
-
-//===========================================================================
-
-//
-// builtin functions
-//
-
-void(vector ang) makevectors = #1; // sets v_forward, etc globals
-void(entity e, vector o) setorigin = #2;
-void(entity e, string m) setmodel = #3; // set movetype and solid first
-void(entity e, vector min, vector max) setsize = #4;
-// #5 was removed
-void() break_to_debugger = #6;
-float() random = #7; // returns 0 - 1
-void(entity e, float chan, string samp, float vol, float atten) sound = #8;
-vector(vector v) normalize = #9;
-void(string e, ...) error = #10;
-void(string e, ...) objerror = #11;
-float(vector v) vlen = #12;
-float(vector v) vectoyaw = #13;
-entity() spawn = #14;
-void(entity e) remove = #15;
-
-// sets trace_* globals
-// nomonsters can be:
-// An entity will also be ignored for testing if forent == test,
-// forent->owner == test, or test->owner == forent
-// a forent of world is ignored
-void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
-
-entity() checkclient = #17; // returns a client to look for
-entity(entity start, .string fld, string match) find = #18;
-string(string s) precache_sound = #19;
-string(string s) precache_model = #20;
-void(entity client, string s, ...)stuffcmd = #21;
-entity(vector org, float rad) findradius = #22;
-void(string s, ...) bprint = #23;
-void(entity client, string s, ...) sprint = #24;
-void(string s, ...) dprint = #25;
-string(float f) ftos = #26;
-string(vector v) vtos = #27;
-void() coredump = #28; // prints all edicts
-void() traceon = #29; // turns statment trace on
-void() traceoff = #30;
-void(entity e) eprint = #31; // prints an entire edict
-float(float yaw, float dist) walkmove = #32; // returns true or false
-// #33 was removed
-float() droptofloor= #34; // true if landed on floor
-void(float style, string value) lightstyle = #35;
-float(float v) rint = #36; // round to nearest int
-float(float v) floor = #37; // largest integer <= v
-float(float v) ceil = #38; // smallest integer >= v
-// #39 was removed
-float(entity e) checkbottom = #40; // true if self is on ground
-float(vector v) pointcontents = #41; // returns a CONTENT_*
-// #42 was removed
-float(float f) fabs = #43;
-vector(entity e, float speed) aim = #44; // returns the shooting vector
-float(string s) cvar = #45; // return cvar.value
-void(string s, ...) localcmd = #46; // put string into local que
-entity(entity e) nextent = #47; // for looping through all ents
-void(vector o, vector d, float color, float count) particle = #48;// start a particle effect
-void() ChangeYaw = #49; // turn towards self.ideal_yaw
- // at self.yaw_speed
-// #50 was removed
-vector(vector v) vectoangles = #51;
-
-//
-// direct client message generation
-//
-void(float to, float f) WriteByte = #52;
-void(float to, float f) WriteChar = #53;
-void(float to, float f) WriteShort = #54;
-void(float to, float f) WriteLong = #55;
-void(float to, float f) WriteCoord = #56;
-void(float to, float f) WriteAngle = #57;
-void(float to, string s, ...) WriteString = #58;
-void(float to, entity s) WriteEntity = #59;
-
-//
-// broadcast client message generation
-//
-
-// void(float f) bWriteByte = #59;
-// void(float f) bWriteChar = #60;
-// void(float f) bWriteShort = #61;
-// void(float f) bWriteLong = #62;
-// void(float f) bWriteCoord = #63;
-// void(float f) bWriteAngle = #64;
-// void(string s) bWriteString = #65;
-// void(entity e) bWriteEntity = #66;
-
-void(float step) movetogoal = #67;
-
-string(string s) precache_file = #68; // no effect except for -copy
-void(entity e) makestatic = #69;
-void(string s) changelevel = #70;
-
-//#71 was removed
-
-void(string name, string value) cvar_set = #72; // sets cvar.value
-
-void(entity client, string s, ...) centerprint = #73; // sprint, but in middle
-
-void(vector pos, string samp, float vol, float atten) ambientsound = #74;
-
-string(string s) precache_model2 = #75; // registered version only
-string(string s) precache_sound2 = #76; // registered version only
-string(string s) precache_file2 = #77; // registered version only
-
-void(entity e) setspawnparms = #78; // set parm1... to the
- // values at level start
- // for coop respawn
-
-//============================================================================
#endif
--- /dev/null
+/*
+==============================================================================
+
+ SOURCE FOR GLOBALVARS_T C STRUCTURE
+ MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
+
+==============================================================================
+*/
+
+//
+// system globals
+//
+entity self;
+entity other;
+entity world;
+float time;
+float frametime;
+
+float player_localentnum; //the entnum
+float player_localnum; //the playernum
+float maxclients; //a constant filled in by the engine. gah, portability eh?
+
+float clientcommandframe; //player movement
+float servercommandframe; //clientframe echoed off the server
+
+string mapname;
+
+//
+// global variables set by built in functions
+//
+vector v_forward, v_up, v_right; // set by makevectors()
+
+// set by traceline / tracebox
+float trace_allsolid;
+float trace_startsolid;
+float trace_fraction;
+vector trace_endpos;
+vector trace_plane_normal;
+float trace_plane_dist;
+entity trace_ent;
+float trace_inopen;
+float trace_inwater;
+
+//
+// required prog functions
+//
+void() CSQC_Init;
+void() CSQC_Shutdown;
+float(float f, float t, float n) CSQC_InputEvent;
+void(float w, float h) CSQC_UpdateView;
+float(string s) CSQC_ConsoleCommand;
+
+//these fields are read and set by the default player physics
+vector pmove_org;
+vector pmove_vel;
+vector pmove_mins;
+vector pmove_maxs;
+//retrieved from the current movement commands (read by player physics)
+float input_timelength;
+vector input_angles;
+vector input_movevalues; //forwards, right, up.
+float input_buttons; //attack, use, jump (default physics only uses jump)
+
+float movevar_gravity;
+float movevar_stopspeed;
+float movevar_maxspeed;
+float movevar_spectatormaxspeed; //used by NOCLIP movetypes.
+float movevar_accelerate;
+float movevar_airaccelerate;
+float movevar_wateraccelerate;
+float movevar_friction;
+float movevar_waterfriction;
+float movevar_entgravity; //the local player's gravity field. Is a multiple (1 is the normal value)
+
+//================================================
+void end_sys_globals; // flag for structure dumping
+//================================================
+
+/*
+==============================================================================
+
+ SOURCE FOR ENTVARS_T C STRUCTURE
+ MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
+
+==============================================================================
+*/
+
+//
+// system fields (*** = do not set in prog code, maintained by C code)
+//
+.float modelindex; // *** model index in the precached list
+.vector absmin, absmax; // *** origin + mins / maxs
+
+.float entnum; // *** the ent number as on the server
+.float drawmask;
+.void() predraw;
+
+.float movetype;
+.float solid;
+
+.vector origin; // ***
+.vector oldorigin; // ***
+.vector velocity;
+.vector angles;
+.vector avelocity;
+
+.string classname; // spawn function
+.string model;
+.float frame;
+.float skin;
+.float effects;
+
+.vector mins, maxs; // bounding box extents reletive to origin
+.vector size; // maxs - mins
+
+.void() touch;
+.void() use;
+.void() think;
+.void() blocked; // for doors or plats, called when can't push other
+
+.float nextthink;
+
+.entity chain;
+
+.string netname;
+
+.entity enemy;
+
+.float flags;
+
+.float colormap;
+
+.entity owner; // who launched a missile
+
+//================================================
+void end_sys_fields; // flag for structure dumping
+//================================================
+
+/*
+==============================================================================
+
+ OPTIONAL FIELDS AND GLOBALS
+
+==============================================================================
+*/
+
+// Additional OPTIONAL Fields and Globals
+float intermission; // indicates intermission state (0 = normal, 1 = scores, 2 = finale text)
+
+vector view_angles; // same as input_angles
+vector view_punchangle; // from server
+vector view_punchvector; // from server
+
+/*
+==============================================================================
+
+ CONSTANT DEFINITIONS
+
+==============================================================================
+*/
+
+const float MASK_ENGINE = 1;
+const float MASK_ENGINEVIEWMODELS = 2;
+const float MASK_NORMAL = 4;
+
+const float RF_VIEWMODEL = 1;
+const float RF_EXTERNALMODEL = 2;
+const float RF_DEPTHHACK = 4;
+const float RF_ADDITIVE = 8;
+const float RF_USEAXIS = 16;
+
+const float VF_MIN = 1; //(vector)
+const float VF_MIN_X = 2; //(float)
+const float VF_MIN_Y = 3; //(float)
+const float VF_SIZE = 4; //(vector) (viewport size)
+const float VF_SIZE_Y = 5; //(float)
+const float VF_SIZE_X = 6; //(float)
+const float VF_VIEWPORT = 7; //(vector, vector)
+const float VF_FOV = 8; //(vector)
+const float VF_FOVX = 9; //(float)
+const float VF_FOVY = 10; //(float)
+const float VF_ORIGIN = 11; //(vector)
+const float VF_ORIGIN_X = 12; //(float)
+const float VF_ORIGIN_Y = 13; //(float)
+const float VF_ORIGIN_Z = 14; //(float)
+const float VF_ANGLES = 15; //(vector)
+const float VF_ANGLES_X = 16; //(float)
+const float VF_ANGLES_Y = 17; //(float)
+const float VF_ANGLES_Z = 18; //(float)
+const float VF_DRAWWORLD = 19; //(float)
+const float VF_DRAWENGINESBAR = 20; //(float)
+const float VF_DRAWCROSSHAIR = 21; //(float)
+
+const float VF_CL_VIEWANGLES = 33; //(vector)
+const float VF_CL_VIEWANGLES_X = 34; //(float)
+const float VF_CL_VIEWANGLES_Y = 35; //(float)
+const float VF_CL_VIEWANGLES_Z = 36; //(float)
+
+const float VF_PERSPECTIVE = 200;
+
+const float STAT_HEALTH = 0;
+const float STAT_WEAPONMODEL = 2;
+const float STAT_AMMO = 3;
+const float STAT_ARMOR = 4;
+const float STAT_WEAPONFRAME = 5;
+const float STAT_SHELLS = 6;
+const float STAT_NAILS = 7;
+const float STAT_ROCKETS = 8;
+const float STAT_CELLS = 9;
+const float STAT_ACTIVEWEAPON = 10;
+const float STAT_TOTALSECRETS = 11;
+const float STAT_TOTALMONSTERS = 12;
+const float STAT_SECRETS = 13;
+const float STAT_MONSTERS = 14;
+const float STAT_ITEMS = 15;
+const float STAT_VIEWHEIGHT = 16;
+
+// Quake Sound Constants
+const float CHAN_AUTO = 0;
+const float CHAN_WEAPON = 1;
+const float CHAN_VOICE = 2;
+const float CHAN_ITEM = 3;
+const float CHAN_BODY = 4;
+
+const float ATTN_NONE = 0;
+const float ATTN_NORM = 1;
+const float ATTN_IDLE = 2;
+const float ATTN_STATIC = 3;
+
+// Frik File Constants
+const float FILE_READ = 0;
+const float FILE_APPEND = 1;
+const float FILE_WRITE = 2;
+
+// Quake Point Contents
+const float CONTENT_EMPTY = -1;
+const float CONTENT_SOLID = -2;
+const float CONTENT_WATER = -3;
+const float CONTENT_SLIME = -4;
+const float CONTENT_LAVA = -5;
+const float CONTENT_SKY = -6;
+
+// Quake Solid Constants
+const float SOLID_NOT = 0;
+const float SOLID_TRIGGER = 1;
+const float SOLID_BBOX = 2;
+const float SOLID_SLIDEBOX = 3;
+const float SOLID_BSP = 4;
+const float SOLID_CORPSE = 5;
+
+// Quake Move Constants
+const float MOVE_NORMAL = 0;
+const float MOVE_NOMONSTERS = 1;
+const float MOVE_MISSILE = 2;
+
+// Boolean Constants
+const float true = 1;
+const float false = 0;
+const float TRUE = 1;
+const float FALSE = 0;
+
+const float EXTRA_LOW = -99999999;
+const float EXTRA_HIGH = 99999999;
+
+const vector VEC_1 = '1 1 1';
+const vector VEC_0 = '0 0 0';
+const vector VEC_M1 = '-1 -1 -1';
+
+const float M_PI = 3.14159265358979323846;
+
+vector VEC_HULL_MIN = '-16 -16 -24';
+vector VEC_HULL_MAX = '16 16 32';
+
+// Quake Temporary Entity Constants
+const float TE_SPIKE = 0;
+const float TE_SUPERSPIKE = 1;
+const float TE_GUNSHOT = 2;
+const float TE_EXPLOSION = 3;
+const float TE_TAREXPLOSION = 4;
+const float TE_LIGHTNING1 = 5;
+const float TE_LIGHTNING2 = 6;
+const float TE_WIZSPIKE = 7;
+const float TE_KNIGHTSPIKE = 8;
+const float TE_LIGHTNING3 = 9;
+const float TE_LAVASPLASH = 10;
+const float TE_TELEPORT = 11;
+const float TE_EXPLOSION2 = 12;
+ // Darkplaces Additions
+ const float TE_EXPLOSIONRGB = 53;
+ const float TE_GUNSHOTQUAD = 57;
+ const float TE_EXPLOSIONQUAD = 70;
+ const float TE_SPIKEQUAD = 58;
+ const float TE_SUPERSPIKEQUAD = 59;
+
+// PFlags for Dynamic Lights
+const float PFLAGS_NOSHADOW = 1;
+const float PFLAGS_CORONA = 2;
+const float PFLAGS_FULLDYNAMIC = 128;
+
+const float EF_ADDITIVE = 32;
+const float EF_BLUE = 64;
+const float EF_FLAME = 1024;
+const float EF_FULLBRIGHT = 512;
+const float EF_NODEPTHTEST = 8192;
+const float EF_NODRAW = 16;
+const float EF_NOSHADOW = 4096;
+const float EF_RED = 128;
+const float EF_STARDUST = 2048;
+const float EF_SELECTABLE = 16384;
+
+const float PFL_ONGROUND = 1;
+const float PFL_CROUCH = 2;
+const float PFL_DEAD = 4;
+const float PFL_GIBBED = 8;
+
+// draw flags
+const float DRAWFLAG_NORMAL = 0;
+const float DRAWFLAG_ADDITIVE = 1;
+const float DRAWFLAG_MODULATE = 2;
+const float DRAWFLAG_2XMODULATE = 3;
+const float DRAWFLAG_SCREEN = 4;
+const float DRAWFLAG_MIPMAP = 0x100; // only for R_BeginPolygon
+
+/*
+==============================================================================
+
+ BUILTIN DEFINITIONS
+ EXTENSIONS ARE NOT ADDED HERE, BUT BELOW!
+
+==============================================================================
+*/
+
+void(vector ang) makevectors = #1;
+void(entity e, vector o) setorigin = #2;
+void(entity e, string m) setmodel = #3;
+void(entity e, vector min, vector max) setsize = #4;
+
+void() break_to_debugger = #6;
+float() random = #7;
+void(entity e, float chan, string samp) sound = #8;
+vector(vector v) normalize = #9;
+void(string e) error = #10;
+void(string e) objerror = #11;
+float(vector v) vlen = #12;
+float(vector v) vectoyaw = #13;
+entity() spawn = #14;
+void(entity e) remove = #15;
+float(vector v1, vector v2, float tryents, entity ignoreentity) traceline = #16;
+
+entity(entity start, .string fld, string match) find = #18;
+void(string s) precache_sound = #19;
+void(string s) precache_model = #20;
+
+entity(vector org, float rad) findradius = #22;
+
+void(string s, ...) dprint = #25;
+string(float f) ftos = #26;
+string(vector v) vtos = #27;
+void() coredump = #28;
+void() traceon = #29;
+void() traceoff = #30;
+void(entity e) eprint = #31;
+// settrace optional
+float(float yaw, float dist, float settrace) walkmove = #32;
+
+float() droptofloor = #34;
+void(float style, string value) lightstyle = #35;
+float(float v) rint = #36;
+float(float v) floor = #37;
+float(float v) ceil = #38;
+
+float(entity e) checkbottom = #40;
+float(vector v) pointcontents = #41;
+
+float(float f) fabs = #43;
+
+float(string s) cvar = #45;
+void(string s, ...) localcmd = #46;
+entity(entity e) nextent = #47;
+void(vector o, vector d, float color, float count) particle = #48;
+void() ChangeYaw = #49;
+
+vector(vector v) vectoangles = #51;
+vector(vector v, vector w) vectoangles2 = #51;
+
+float(float f) sin = #60;
+float(float f) cos = #61;
+float(float f) sqrt = #62;
+void(entity ent) changepitch = #63;
+void(entity e, entity ignore) tracetoss = #64;
+string(entity ent) etos = #65;
+
+string(string s) precache_file = #68;
+void(entity e) makestatic = #69;
+
+void(string var, string val) cvar_set = #72;
+
+void(vector pos, string samp, float vol, float atten) ambientsound = #74;
+string(string s) precache_model2 = #75;
+string(string s) precache_sound2 = #76;
+string(string s) precache_file2 = #77;
+
+float(string s) stof = #81;
+
+
+void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
+vector() randomvec = #91;
+vector(vector org) getlight = #92;
+vector(vector org, float lpflags) getlight2 = #92;
+vector getlight_dir;
+vector getlight_ambient;
+vector getlight_diffuse;
+const float LP_LIGHTMAP = 1;
+const float LP_RTWORLD = 2;
+const float LP_DYNLIGHT = 4;
+const float LP_COMPLETE = 7;
+
+float(string name, string value) registercvar = #93;
+float( float a, ... ) min = #94;
+float( float b, ... ) max = #95;
+float(float minimum, float val, float maximum) bound = #96;
+float(float f, float f) pow = #97;
+entity(entity start, .float fld, float match) findfloat = #98;
+float(string s) checkextension = #99;
+// FrikaC and Telejano range #100-#199
+
+float(string filename, float mode) fopen = #110;
+void(float fhandle) fclose = #111;
+string(float fhandle) fgets = #112;
+void(float fhandle, string s) fputs = #113;
+float(string s) strlen = #114;
+string(...) strcat = #115;
+string(string s, float start, float length) substring = #116;
+vector(string) stov = #117;
+string(string s) strzone = #118;
+void(string s) strunzone = #119;
+
+// FTEQW range #200-#299
+
+float(float number, float quantity) bitshift = #218;
+
+//float(string str, string sub[, float startpos]) strstrofs = #221;
+float(string str, string sub, float startpos) strstrofs = #221;
+float(string str, float ofs) str2chr = #222;
+string(float c, ...) chr2str = #223;
+string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
+string(float chars, string s, ...) strpad = #225;
+string(string info, string key, string value, ...) infoadd = #226;
+string(string info, string key) infoget = #227;
+float(string s1, string s2) strcmp = #228;
+float(string s1, string s2, float len) strncmp = #228;
+float(string s1, string s2) strcasecmp = #229;
+float(string s1, string s2, float len) strncasecmp = #230;
+
+// CSQC range #300-#399
+void() clearscene = #300;
+void(float mask) addentities = #301;
+void(entity ent) addentity = #302;
+float(float property, ...) setproperty = #303;
+float(float property) getproperty = #309;
+vector(float property) getpropertyvec = #309;
+void() renderscene = #304;
+void(vector org, float radius, vector lightcolours) adddynamiclight = #305;
+void(vector org, float radius, vector lightcolours, float style, string cubemapname, float pflags) adddynamiclight2 = #305;
+//void(string texturename, float flag[, float is2d, float lines]) R_BeginPolygon = #306;
+void(string texturename, float flag, ...) R_BeginPolygon = #306;
+void(vector org, vector texcoords, vector rgb, float alpha) R_PolygonVertex = #307;
+void() R_EndPolygon = #308;
+vector (vector v) cs_unproject = #310;
+vector (vector v) cs_project = #311;
+
+void(float width, vector pos1, vector pos2, float flag) drawline = #315;
+float(string name) iscachedpic = #316;
+string(string name, ...) precache_pic = #317;
+string(string name) precache_cubemap = #317;
+vector(string picname) draw_getimagesize = #318;
+void(string name) freepic = #319;
+float(vector position, float character, vector scale, vector rgb, float alpha, float flag) drawcharacter = #320;
+float(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawstring = #321;
+float(vector position, string pic, vector size, vector rgb, float alpha, float flag) drawpic = #322;
+float(vector position, vector size, vector rgb, float alpha, float flag) drawfill = #323;
+void(float x, float y, float width, float height) drawsetcliparea = #324;
+void(void) drawresetcliparea = #325;
+float(vector position, string text, vector scale, float alpha, float flag) drawcolorcodedstring = #326;
+vector(vector position, string text, vector scale, vector rgb, float alpha, float flag) drawcolorcodedstring2 = #326;
+
+float(float stnum) getstatf = #330;
+float(float stnum, ...) getstati = #331; // can optionally take first bit and count
+string(float firststnum) getstats = #332;
+void(entity e, float mdlindex) setmodelindex = #333;
+string(float mdlindex) modelnameforindex = #334;
+float(string effectname) particleeffectnum = #335;
+void(entity ent, float effectnum, vector start, vector end) trailparticles = #336;
+//void(float effectnum, vector origin [, vector dir, float count]) pointparticles = #337;
+void(float effectnum, vector origin , vector dir, float count) pointparticles = #337;
+void(string s, ...) centerprint = #338;
+void(string s, ...) print = #339;
+string(float keynum) keynumtostring = #340;
+float(string keyname) stringtokeynum = #341;
+string(float keynum) getkeybind = #342;
+void(float usecursor) setcursormode = #343;
+vector() getmousepos = #344;
+float(float framenum) getinputstate = #345;
+void(float sens) setsensitivityscale = #346;
+void(...) runstandardplayerphysics = #347; // this may or may not take a player ent
+string(float playernum, string keyname) getplayerkeyvalue = #348;
+float() isdemo = #349;
+float() isserver = #350;
+void(vector origin, vector forward, vector right, vector up) SetListener = #351;
+void(string cmdname) registercommand = #352;
+float(entity ent) wasfreed = #353;
+string(string key) serverkey = #354;
+
+// Use proper case; refer to the id1 Write* functions!
+float() ReadByte = #360;
+float() ReadChar = #361;
+float() ReadShort = #362;
+float() ReadLong = #363;
+float() ReadCoord = #364;
+float() ReadAngle = #365;
+string() ReadString = #366;
+float() ReadFloat = #367;
+
+// LordHavoc's range #400-#499
+void(entity from, entity to) copyentity = #400;
+
+entity(.string fld, string match) findchain = #402;
+entity(.float fld, float match) findchainfloat = #403;
+void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
+void(vector org, vector velocity, float howmany) te_blood = #405;
+void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
+void(vector org, vector color) te_explosionrgb = #407;
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
+void(vector org, vector vel, float howmany) te_spark = #411;
+void(vector org) te_gunshotquad = #412;
+void(vector org) te_spikequad = #413;
+void(vector org) te_superspikequad = #414;
+void(vector org) te_explosionquad = #415;
+void(vector org) te_smallflash = #416;
+void(vector org, float radius, float lifetime, vector color) te_customflash = #417;
+void(vector org) te_gunshot = #418;
+void(vector org) te_spike = #419;
+void(vector org) te_superspike = #420;
+void(vector org) te_explosion = #421;
+void(vector org) te_tarexplosion = #422;
+void(vector org) te_wizspike = #423;
+void(vector org) te_knightspike = #424;
+void(vector org) te_lavasplash = #425;
+void(vector org) te_teleport = #426;
+void(vector org, float colorstart, float colorlength) te_explosion2 = #427;
+void(entity own, vector start, vector end) te_lightning1 = #428;
+void(entity own, vector start, vector end) te_lightning2 = #429;
+void(entity own, vector start, vector end) te_lightning3 = #430;
+void(entity own, vector start, vector end) te_beam = #431;
+void(vector dir) vectorvectors = #432;
+void(vector org) te_plasmaburn = #433;
+float(entity e, float s) getsurfacenumpoints = #434;
+vector(entity e, float s, float n) getsurfacepoint = #435;
+vector(entity e, float s) getsurfacenormal = #436;
+string(entity e, float s) getsurfacetexture = #437;
+float(entity e, vector p) getsurfacenearpoint = #438;
+vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
+
+float(string s) tokenize = #441;
+string(float n) argv = #442;
+void(entity e, entity tagentity, string tagname) setattachment = #443;
+float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
+void(float handle) search_end = #445;
+float(float handle) search_getsize = #446;
+string(float handle, float num) search_getfilename = #447;
+string(string s) cvar_string = #448;
+entity(entity start, .float fld, float match) findflags = #449;
+entity(.float fld, float match) findchainflags = #450;
+float(entity ent, string tagname) gettagindex = #451;
+vector(entity ent, float tagindex) gettaginfo = #452;
+
+void(vector org, vector vel, float howmany) te_flamejet = #457;
+
+entity(float num) entitybyindex = #459;
+float() buf_create = #460;
+void(float bufhandle) buf_del = #461;
+float(float bufhandle) buf_getsize = #462;
+void(float bufhandle_from, float bufhandle_to) buf_copy = #463;
+void(float bufhandle, float sortpower, float backward) buf_sort = #464;
+string(float bufhandle, string glue) buf_implode = #465;
+string(float bufhandle, float string_index) bufstr_get = #466;
+void(float bufhandle, float string_index, string str) bufstr_set = #467;
+float(float bufhandle, string str, float order) bufstr_add = #468;
+void(float bufhandle, float string_index) bufstr_free = #469;
+
+float(float s) asin = #471;
+float(float c) acos = #472;
+float(float t) atan = #473;
+float(float c, float s) atan2 = #474;
+float(float a) tan = #475;
+float(string s) strippedstringlen = #476;
+float(string s) strlennocol = #476; // This is the correct name for the function, but not removing the decolorizedstring mapping.
+string(string s) decolorizedstring = #477;
+string(string s) strdecolorize = #477; // This is the correct name for the function, but not removing the decolorizedstring mapping.
+string(float uselocaltime, string format, ...) strftime = #478;
+string(string s) strtolower = #480;
+string(string s) strtoupper = #481;
+string(string s) cvar_defstring = #482;
+void(vector origin, string sample, float volume, float attenuation) pointsound = #483;
+string(string search, string replace, string subject) strreplace = #484;
+string(string search, string replace, string subject) strireplace = #485;
+vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
+#ifdef SUPPORT_GECKO
+float gecko_create( string name ) = #487;
+void gecko_destroy( string name ) = #488;
+void gecko_navigate( string name, string URI ) = #489;
+float gecko_keyevent( string name, float key, float eventtype ) = #490;
+void gecko_mousemove( string name, float x, float y ) = #491;
+void gecko_resize( string name, float w, float h ) = #492;
+vector gecko_get_texture_extent( string name ) = #493;
+#else
+
+#endif
+
+/*
+==============================================================================
+
+ EXTENSION DEFINITIONS
+
+==============================================================================
+*/
+
+// DP_CSQC_SPAWNPARTICLE
+// idea: VorteX
+// darkplaces implementation: VorteX
+// constant definitions:
+// particle base behavior:
+float PT_ALPHASTATIC = 1;
+float PT_STATIC = 2;
+float PT_SPARK = 3;
+float PT_BEAM = 4;
+float PT_RAIN = 5;
+float PT_RAINDECAL = 6;
+float PT_SNOW = 7;
+float PT_BUBBLE = 8;
+float PT_BLOOD = 9;
+float PT_SMOKE = 10;
+float PT_DECAL = 11;
+float PT_ENTITYPARTICLE = 12;
+// particle blendtypes:
+float PBLEND_ALPHA = 0;
+float PBLEND_ADD = 1;
+float PBLEND_INVMOD = 2;
+// particle orientation:
+float PARTICLE_BILLBOARD = 0;
+float PARTICLE_SPARK = 1;
+float PARTICLE_ORIENTED_DOUBLESIDED = 2;
+float PARTICLE_BEAM = 3;
+// global definitions:
+float particle_type; // one of PT_
+float particle_blendmode; // one of PBLEND_ values
+float particle_orientation; // one of PARTICLE_ values
+vector particle_color1;
+vector particle_color2;
+float particle_tex; // number of chunk in particlefont
+float particle_size;
+float particle_sizeincrease;
+float particle_alpha;
+float particle_alphafade;
+float particle_time;
+float particle_gravity;
+float particle_bounce;
+float particle_airfriction;
+float particle_liquidfriction;
+float particle_originjitter;
+float particle_velocityjitter;
+float particle_qualityreduction; // enable culling of this particle when FPS is low
+float particle_stretch;
+vector particle_staincolor1;
+vector particle_staincolor2;
+float particle_staintex;
+float particle_stainalpha;
+float particle_stainsize;
+float particle_delayspawn;
+float particle_delaycollision;
+float particle_angle;
+float particle_spin;
+// builtin definitions:
+float(float max_themes) initparticlespawner = #522; // check fields/globals for integration and enable particle spawner, return 1 is succeded, otherwise returns 0
+void() resetparticle = #523; // reset p_ globals to default theme #0
+void(float theme) particletheme = #524; // restore p_ globals from saved theme
+float() particlethemesave = #525; // save p_ globals to new particletheme and return it's index
+void(float theme) particlethemeupdate = #525; // save p_ globals to new particletheme and return it's index
+void(float theme) particlethemefree = #526; // delete a particle theme
+float(vector org, vector vel) spawnparticle = #527; // returns 0 when failed, 1 when spawned
+float(vector org, vector vel, float theme) quickparticle = #527; // not reading globals, just theme, returns 0 when failed, 1 when spawned
+float(vector org, vector vel, float delay, float collisiondelay) delayedparticle = #528;
+float(vector org, vector vel, float delay, float collisiondelay, float theme) quickdelayedparticle = #528;
+// description: this builtin provides an easy and flexible way to spawn particles,
+// it is not created as replace for DP_SV_POINTPARTICLES but as an addition to it.
+// With this extension you can create a specific particles like rain particles, or entity particles
+// notes:
+// 1) 0 is default particle template, it could be changed
+// 2) color vectors could have value 0-255 of each component
+// restrictions: max themes could be between 4 and 2048
+// warning: you should call initparticlespawner() at very beginning BEFORE all other particle spawner functions
+// function to query particle info
+// don't remove this function as it protects all particle_ globals from FTEQCC/FRIKQCC non-referenced removal optimisation
+void() printparticle =
+{
+ // vortex: this also protects from 'non-referenced' optimisation on some compilers
+ print("PARTICLE:\n");
+ print(strcat(" type: ", ftos(particle_type), "\n"));
+ print(strcat(" blendmode: ", ftos(particle_blendmode), "\n"));
+ print(strcat(" orientation: ", ftos(particle_orientation), "\n"));
+ print(strcat(" color1: ", vtos(particle_color1), "\n"));
+ print(strcat(" color2: ", vtos(particle_color2), "\n"));
+ print(strcat(" tex: ", ftos(particle_tex), "\n"));
+ print(strcat(" size: ", ftos(particle_size), "\n"));
+ print(strcat(" sizeincrease: ", ftos(particle_sizeincrease), "\n"));
+ print(strcat(" alpha: ", ftos(particle_alpha), "\n"));
+ print(strcat(" alphafade: ", ftos(particle_alphafade), "\n"));
+ print(strcat(" time: ", ftos(particle_time), "\n"));
+ print(strcat(" gravity: ", ftos(particle_gravity), "\n"));
+ print(strcat(" bounce: ", ftos(particle_bounce), "\n"));
+ print(strcat(" airfriction: ", ftos(particle_airfriction), "\n"));
+ print(strcat(" liquidfriction: ", ftos(particle_liquidfriction), "\n"));
+ print(strcat(" originjitter: ", ftos(particle_originjitter), "\n"));
+ print(strcat(" velocityjitter: ", ftos(particle_velocityjitter), "\n"));
+ print(strcat(" qualityreduction: ", ftos(particle_qualityreduction), "\n"));
+ print(strcat(" stretch: ", ftos(particle_stretch), "\n"));
+ print(strcat(" staincolor1: ", vtos(particle_staincolor1), "\n"));
+ print(strcat(" staincolor2: ", vtos(particle_staincolor2), "\n"));
+ print(strcat(" staintex: ", ftos(particle_staintex), "\n"));
+ print(strcat(" stainalpha: ", ftos(particle_stainalpha), "\n"));
+ print(strcat(" stainsize: ", ftos(particle_stainsize), "\n"));
+ print(strcat(" delayspawn: ", ftos(particle_delayspawn), "\n"));
+ print(strcat(" delaycollision: ", ftos(particle_delaycollision), "\n"));
+ print(strcat(" angle: ", ftos(particle_angle), "\n"));
+ print(strcat(" spin: ", ftos(particle_spin), "\n"));
+}
+
+// DP_CSQC_ENTITYTRANSPARENTSORTING_OFFSET
+// idea: VorteX
+// darkplaces implementation: VorteX
+float RF_USETRANSPARENTOFFSET = 64; // enables transparent origin offsetting
+// global definitions
+float transparent_offset; // should be set before entity is added
+// description: offset a model's meshes origin used for transparent sorting. Could be used to tweak sorting bugs on very large transparent entities or hacking transparent sorting order for certain objects
+// example: transparent_offset = 1000000; // entity always appear on background of other transparents
+// note: offset is done in view forward axis
+
+// DP_CSQC_ENTITYWORLDOBJECT
+// idea: VorteX
+// darkplaces implementation: VorteX
+const float RF_WORLDOBJECT = 128;
+// description: when renderflag is set, engine will not use culling methods for this entity, e.g. it will always be drawn
+// useful for large outdoor objects (like asteroids on sky horizon or sky models)
+
+// DP_CSQC_ENTITYMODELLIGHT
+// idea: VorteX
+// darkplaces implementation: VorteX
+const float RF_MODELLIGHT = 4096;
+.vector modellight_ambient;
+.vector modellight_diffuse;
+.vector modellight_dir;
+// description: allows CSQC to override directional model lightning on entity
+
+// DP_CSQC_SETPAUSE
+// idea: VorteX
+// darkplaces implementation: VorteX
+// builtin definitions:
+void(float ispaused) setpause = #531;
+// description: provides ability to set pause in local games (similar to one set once console is activated)
+// not stopping sound/cd track, useful for inventory screens, ingame menus with input etc.
+
+// DP_CSQC_QUERYRENDERENTITY
+// idea: VorteX
+// darkplaces implementation: VorteX
+// constant definitions:
+// render entity fields:
+float E_ACTIVE = 0; // float 0/1
+float E_ORIGIN = 1; // vector
+float E_FORWARD = 2; // vector
+float E_RIGHT = 3; // vector
+float E_UP = 4; // vector
+float E_SCALE = 5; // float
+float E_ORIGINANDVECTORS = 6; // returns origin, + sets v_* vectors to orientation
+float E_ALPHA = 7; // float
+float E_COLORMOD = 8; // vector
+float E_PANTSCOLOR = 9; // vector
+float E_SHIRTCOLOR = 10; // vector
+float E_SKIN = 11; // float
+float E_MINS = 12; // vector
+float E_MAXS = 13; // vector
+float E_ABSMIN = 14; // vector
+float E_ABSMAX = 15; // vector
+float E_LIGHT = 16; // vector - modellight
+// builtin definitions:
+float(float entitynum, float fldnum) getentity = #504;
+vector(float entitynum, float fldnum) getentityvec = #504;
+// description: allows to query parms from render entities, especially useful with attaching CSQC ents to
+// server entities networked and interpolated by engine (monsters, players), number of entity is it's SVQC number
+// you can send it via tempentity/CSQC entity message. Note that this builtin doesnt know about entity removing/reallocating
+// so it's meaning to work for short period of time, dont use it on missiles/grenades whatever will be removed next five seconds
+
+//DP_GFX_FONTS
+//idea: Blub\0, divVerent
+//darkplaces implementation: Blub\0
+//console commands:
+// loadfont fontname fontmaps size1 size2 ...
+// A font can simply be gfx/tgafile (freetype fonts doent need extension),
+// or alternatively you can specify multiple fonts and faces
+// Like this: gfx/vera-sans:2,gfx/fallback:1
+// to load face 2 of the font gfx/vera-sans and use face 1
+// of gfx/fallback as fallback font
+// You can also specify a list of font sizes to load, like this:
+// loadfont console gfx/conchars,gfx/fallback 8 12 16 24 32
+// In many cases, 8 12 16 24 32 should be a good choice.
+// for slots see:
+//constant definitions:
+float drawfont; // set it before drawstring()/drawchar() calls
+float FONT_DEFAULT = 0; // 'default'
+float FONT_CONSOLE = 1; // 'console', REALLY should be fixed width (ls!)
+float FONT_SBAR = 2; // 'sbar', used on hud, must be fixed width
+float FONT_NOTIFY = 3; // 'notify', used on sprint/bprint
+float FONT_CHAT = 4; // 'chat'
+float FONT_CENTERPRINT = 5;// 'centerprint'
+float FONT_INFOBAR = 6; // 'infobar'
+float FONT_MENU = 7; // 'menu', should be fixed width
+float FONT_USER0 = 8; // 'user0', userdefined fonts
+float FONT_USER1 = 9; // 'user1', userdefined fonts
+float FONT_USER2 = 10; // 'user2', userdefined fonts
+float FONT_USER3 = 11; // 'user3', userdefined fonts
+float FONT_USER4 = 12; // 'user4', userdefined fonts
+float FONT_USER5 = 13; // 'user5', userdefined fonts
+float FONT_USER6 = 14; // 'user6', userdefined fonts
+float FONT_USER7 = 15; // 'user7' slot, userdefined fonts
+//builtin definitions:
+float findfont(string s) = #356; // find font by fontname and return it's index
+float loadfont(string fontname, string fontmaps, string sizes, float slot, float fix_scale, float fix_voffset) = #357;
+// loads font immediately so stringwidth() function can be used just after builtin call
+// returns a font slotnum (which is used to set drawfont to)
+// first 3 parms are identical to "loadfont" console command ones
+// slot could be one of FONT_ constants or result of findfont() or -1 to not use it
+// if slot is given, font will be loaded to this slotnum and fontname become new title for it
+// this way you can rename user* fonts to something more usable
+// fix_* parms let you fix badly made fonts by applying some transformations to them
+// fix_scale : per-character center-oriented scale (doesn't change line height at all)
+// fix_voffset : vertical offset for each character, it's a multiplier to character height
+float stringwidth(string text, float allowColorCodes, vector size) = #327; // get a width of string with given font and char size
+float stringwidth_menu(string text, float allowColorCodes, vector size) = #468; // in menu.dat it has different builtin #
+//description: engine support for custom fonts in console, hud, qc etc.
+// limits:
+// max 128 chars for font name
+// max 3 font fallbacks
+// max 8 sizes per font
+
+//DP_GFX_FONTS_FREETYPE
+//idea: Blub\0, divVerent
+//darkplaces implementation: Blub\0
+//cvar definitions:
+// r_font_disable_freetype 0/1 : disable freetype fonts loading (uttetly disables freetype library initialization)
+// r_font_antialias 0/1 : antialiasing when loading font
+// r_font_hint 0/1/2/3 : hinting when loading font, 0 is no hinting, 1 light autohinting , 2 full autohinting, 3 full hinting
+// r_font_postprocess_blur X : font outline blur amount
+// r_font_postprocess_outline X : font outline width
+// r_font_postprocess_shadow_x X : font outline shadow x shift amount, applied during outlining
+// r_font_postprocess_shadow_y X : font outline shadow y shift amount, applied during outlining
+// r_font_postprocess_shadow_z X : font outline shadow z shift amount, applied during blurring
+//description: engine support for truetype/freetype fonts
+//so .AFM+.PFB/.OTF/.TTF files could be stuffed as fontmaps in loadfont()
+//(console command version will support them as well)
+
+//DP_CSQC_BINDMAPS
+//idea: daemon, motorsep
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(float key, float bindmap) getkeybind_bindmap = #342;
+float(float key, string bind, float bindmap) setkeybind_bindmap = #630;
+vector(void) getbindmaps = #631;
+float(vector bm) setbindmaps = #632;
+string(string command, float bindmap) findkeysforcommand = #610;
+//<already in EXT_CSQC> float(string key) stringtokeynum = #341;
+//<already in EXT_CSQC> string(float keynum) keynumtostring = #340;
+//description: key bind setting/getting including support for switchable
+//bindmaps.
+
+//DP_CRYPTO
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions: (CSQC)
+float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
+//description:
+//use -1 as buffer handle to justs end delim as postdata
+
+//DP_CSQC_MAINVIEW
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+const float VF_MAINVIEW = 400;
+//use setproperty(VF_MAINVIEW, 1); before calling R_RenderView for the render
+//that shall become the "main" view, which is e.g. used by PRYDON_CLIENTCURSOR
+//this flag is set for the first scene, and not cleared by R_ClearScene
+//this flag is automatically cleared by R_RenderView
+//so when not using this extension, the first view rendered is the main view
+
+//DP_CSQC_MINFPS_QUALITY
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+const float VF_MINFPS_QUALITY = 401;
+//use getproperty(VF_MINFPS_QUALITY); to do CSQC based LOD based on cl_minfps
+//1 should lead to an unmodified view
+
+//DP_CSQC_V_CALCREFDEF_WIP1
+//DP_CSQC_V_CALCREFDEF_WIP2
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+void(entity e, float refdefflags) V_CalcRefdef = #640;
+//constant definitions:
+float PMF_DUCKED = 4;
+float PMF_ONGROUND = 8;
+float REFDEFFLAG_TELEPORTED = 1;
+float REFDEFFLAG_JUMPING = 2;
+float REFDEFFLAG_DEAD = 4;
+float REFDEFFLAG_INTERMISSION = 8;
+//- use this on the player entity after performing prediction
+//- pass REFDEFFLAG_TELEPORTED if the player teleported since last frame
+//- pass REFDEFFLAG_JUMPING if jump button is pressed
+//- pass REFDEFFLAG_DEAD if dead (DP_CSQC_V_CALCREFDEF_WIP2)
+//- pass REFDEFFLAG_INTERMISSION if in intermission (DP_CSQC_V_CALCREFDEF_WIP2)
+//- the player entity needs to have origin, velocity, pmove_flags set according
+// to prediction (the above two PMF_ flags are used in the player's pmove_flags)
+//- NOTE: to check for this, ALSO OR a check with DP_CSQC_V_CALCREFDEF to also support
+// the finished extension once done
+
+// assorted builtins
+float drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #328;
+vector drawgetimagesize(string pic) = #318;
+#define SPA_POSITION 0
+#define SPA_S_AXIS 1
+#define SPA_T_AXIS 2
+#define SPA_R_AXIS 3
+#define SPA_TEXCOORDS0 4
+#define SPA_LIGHTMAP0_TEXCOORDS 5
+#define SPA_LIGHTMAP_COLOR 6
+// float (entity e, float s) getsurfacenumpoints = #434;
+// vector (entity e, float s, float n) getsurfacepoint = #435;
+// vector (entity e, float s) getsurfacenormal = #436;
+// string (entity e, float s) getsurfacetexture = #437;
+// float (entity e, vector p) getsurfacenearpoint = #438;
+// vector (entity e, float s, vector p) getsurfaceclippedpoint = #439;
+// vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
+float(entity e, float s) getsurfacenumtriangles = #628;
+vector(entity e, float s, float n) getsurfacetriangle = #629;
+
+//DP_QC_ASINACOSATANATAN2TAN
+//idea: Urre
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float DEG2RAD = 0.0174532925199432957692369076848861271344287188854172545609719144;
+float RAD2DEG = 57.2957795130823208767981548141051703324054724665643215491602438612;
+float PI = 3.1415926535897932384626433832795028841971693993751058209749445923;
+//builtin definitions:
+/* -Wdouble-declaration
+float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5
+float(float c) acos = #472; // returns angle in radians for a given cos() value, the result is in the range 0 to PI
+float(float t) atan = #473; // returns angle in radians for a given tan() value, the result is in the range -PI*0.5 to PI*0.5
+float(float c, float s) atan2 = #474; // returns angle in radians for a given cos() and sin() value pair, the result is in the range -PI to PI (this is identical to vectoyaw except it returns radians rather than degrees)
+float(float a) tan = #475; // returns tangent value (which is simply sin(a)/cos(a)) for the given angle in radians, the result is in the range -infinity to +infinity
+*/
+//description:
+//useful math functions for analyzing vectors, note that these all use angles in radians (just like the cos/sin functions) not degrees unlike makevectors/vectoyaw/vectoangles, so be sure to do the appropriate conversions (multiply by DEG2RAD or RAD2DEG as needed).
+//note: atan2 can take unnormalized vectors (just like vectoyaw), and the function was included only for completeness (more often you want vectoyaw or vectoangles), atan2(v_x,v_y) * RAD2DEG gives the same result as vectoyaw(v)
+
+//DP_QC_SPRINTF
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(string format, ...) sprintf = #627;
+//description:
+//you know sprintf :P
+//supported stuff:
+// %
+// optional: <argpos>$ for the argument to format (the arg counter then is not increased)
+// flags: #0- +
+// optional: <width>, *, or *<argpos>$ for the field width (width is read before value and precision)
+// optional: .<precision>, .*, or .*<argpos>$ for the precision (precision is read before value)
+// length modifiers: h for forcing a float, l for forcing an int/entity (by default, %d etc. cast a float to int)
+// conversions:
+// d takes a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an int
+// i takes an int/entity if no length is specified or i is, and a float if h is specified as length, and cast it to an int
+// ouxXc take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to an unsigned int
+// eEfFgG take a float if no length is specified or h is, and an int/entity if l is specified as length, and cast it to a double
+// s takes a string
+// vV takes a vector, and processes the three components as if it were a gG for all three components, separated by space
+// For conversions s and c, the flag # makes precision and width interpreted
+// as byte count, by default it is interpreted as character count in UTF-8
+// enabled engines. No other conversions can create wide characters, and #
+// has another meaning in these.
+
+//DP_QC_GETTIME
+//idea: tZork
+//darkplaces implementation: tZork, divVerent
+//constant definitions:
+float GETTIME_FRAMESTART = 0; // time of start of frame
+float GETTIME_REALTIME = 1; // current time (may be OS specific)
+float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision
+float GETTIME_UPTIME = 3; // time since start of the engine
+//builtin definitions:
+float(float tmr) gettime = #519;
+//description:
+//some timers to query...
+
+//DP_QC_GETTIME_CDTRACK
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+float GETTIME_CDTRACK = 4;
+//description:
+//returns the playing time of the current cdtrack when passed to gettime()
+//see DP_END_GETSOUNDTIME for similar functionality but for entity sound channels
+
+//DP_QC_TOKENIZEBYSEPARATOR
+//idea: Electro, SavageX, LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(string s, string separator1, ...) tokenizebyseparator = #479;
+//description:
+//this function returns tokens separated by any of the supplied separator strings, example:
+//numnumbers = tokenizebyseparator("10.2.3.4", ".");
+//returns 4 and the tokens are "10" "2" "3" "4"
+//possibly useful for parsing IPv4 addresses (such as "1.2.3.4") and IPv6 addresses (such as "[1234:5678:9abc:def0:1234:5678:9abc:def0]:26000")
+
+//DP_QC_TOKENIZE_CONSOLE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+float(string s) tokenize_console = #514;
+float(float i) argv_start_index = #515;
+float(float i) argv_end_index = #516;
+//description:
+//this function returns tokens separated just like the console does
+//also, functions are provided to get the index of the first and last character of each token in the original string
+//Passing negative values to them, or to argv, will be treated as indexes from the LAST token (like lists work in Perl). So argv(-1) will return the LAST token.
+
+//DP_SND_SOUND7_WIP1
+//DP_SND_SOUND7_WIP2
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+void(entity e, float chan, string samp, float vol, float atten, float speed, float flags) sound7 = #8;
+float SOUNDFLAG_RELIABLE = 1;
+//description:
+//plays a sound, with some more flags
+//extensions to sound():
+//- channel may be in the range from -128 to 127; channels -128 to 0 are "auto",
+// i.e. support multiple sounds at once, but cannot be stopped/restarted
+//- a value 0 in the speed parameter means no change; otherwise, it is a
+// percentage of playback speed ("pitch shifting"). 100 is normal pitch, 50 is
+// half speed, 200 is double speed, etc. (DP_SND_SOUND7_WIP2)
+//- the flag SOUNDFLAG_RELIABLE can be specified, which makes the sound send
+// to MSG_ALL (reliable) instead of MSG_BROADCAST (unreliable, default);
+// similarily, SOUNDFLAG_RELIABLE_TO_ONE sends to MSG_ONE
+//- channel 0 is controlled by snd_channel0volume; channel 1 and -1 by
+// snd_channel1volume, etc. (so, a channel shares the cvar with its respective
+// auto-channel); however, the mod MUST define snd_channel8volume and upwards
+// in default.cfg if they are to be used, as the engine does not create them
+// to not litter the cvar list
+//- this extension applies to CSQC as well; CSQC_Event_Sound will get speed and
+// flags as extra 7th and 8th argument
+//- WIP2 ideas: SOUNDFLAG_RELIABLE_TO_ONE, SOUNDFLAG_NOPHS, SOUNDFLAG_FORCELOOP
+//- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support
+// the finished extension once done
+
+//DP_PRECACHE_PIC_FLAGS
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+float PRECACHE_PIC_FROMWAD = 1; // this one actually is part of EXT_CSQC
+float PRECACHE_PIC_NOTPERSISTENT = 2; // picture may get deallocated when unused
+float PRECACHE_PIC_MIPMAP = 8; // mipmap the texture for possibly better downscaling at memory expense
+//notes: these constants are given as optional second argument to precache_pic()
+
+//DP_QC_TRACE_MOVETYPE_WORLDONLY
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float MOVE_WORLDONLY = 3;
+//description:
+//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions
+
+//DP_SND_GETSOUNDTIME
+//idea: VorteX
+//darkplaces implementation: VorteX
+//constant definitions:
+float(entity e, float channel) getsoundtime = #533; // get currently sound playing position on entity channel, -1 if not playing or error
+float(string sample) soundlength = #534; // returns length of sound sample in seconds, -1 on error (sound not precached, sound system not initialized etc.)
+//description: provides opportunity to query length of sound samples and realtime tracking of sound playing on entities (similar to DP_GETTIME_CDTRACK)
+//note: beware dedicated server not running sound engine at all, so in dedicated mode this builtins will not work in server progs
+//note also: menu progs not supporting getsoundtime() (will give a warning) since it has no sound playing on entities
+//examples of use:
+// - QC-driven looped sounds
+// - QC events when sound playing is finished
+// - toggleable ambientsounds
+// - subtitles
+
+//DP_QC_NUM_FOR_EDICT
+//idea: Blub\0
+//darkplaces implementation: Blub\0
+//Function to get the number of an entity - a clean way.
+float(entity num) num_for_edict = #512;
+
+//DP_TRACE_HITCONTENTSMASK_SURFACEINFO
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//globals:
+.float dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
+float trace_dpstartcontents; // DPCONTENTS_ value at start position of trace
+float trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
+float trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
+string trace_dphittexturename; // texture name of impacted surface
+//constants:
+float DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box
+float DPCONTENTS_WATER = 2;
+float DPCONTENTS_SLIME = 4;
+float DPCONTENTS_LAVA = 8;
+float DPCONTENTS_SKY = 16;
+float DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel
+float DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity
+float DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn
+float DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
+float DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement
+float DPCONTENTS_DONOTENTER = 1024; // AI hint brush
+float DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA
+float DPCONTENTS_BOTCLIP = 2048; // AI hint brush
+float DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks)
+float Q3SURFACEFLAG_NODAMAGE = 1;
+float Q3SURFACEFLAG_SLICK = 2; // low friction surface
+float Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
+float Q3SURFACEFLAG_LADDER = 8; // climbable surface
+float Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
+float Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky)
+float Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact
+float Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc)
+float Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds
+float Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds
+float Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_DUST = 262144; // translucent 'light beam' effect (not important to qc)
+//description:
+//adds additional information after a traceline/tracebox/tracetoss call.
+//also (very important) sets trace_* globals before calling .touch functions,
+//this allows them to inspect the nature of the collision (for example
+//determining if a projectile hit sky), clears trace_* variables for the other
+//object in a touch event (that is to say, a projectile moving will see the
+//trace results in its .touch function, but the player it hit will see very
+//little information in the trace_ variables as it was not moving at the time)
+
+//DP_QC_CVAR_TYPE
+//idea: divVerent
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+float(string name) cvar_type = #495;
+float CVAR_TYPEFLAG_EXISTS = 1;
+float CVAR_TYPEFLAG_SAVED = 2;
+float CVAR_TYPEFLAG_PRIVATE = 4;
+float CVAR_TYPEFLAG_ENGINE = 8;
+float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
+float CVAR_TYPEFLAG_READONLY = 32;
+
+//DP_QC_CRC16
+//idea: divVerent
+//darkplaces implementation: divVerent
+//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
+//When caseinsensitive is set, the CRC is calculated of the lower cased string.
+float(float caseinsensitive, string s, ...) crc16 = #494;
+
+//DP_QC_URI_ESCAPE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//URI::Escape's functionality
+string(string in) uri_escape = #510;
+string(string in) uri_unescape = #511;
+
+//DP_QC_DIGEST
+//idea: motorsep, Spike
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+string(string digest, string data, ...) digest_hex = #639;
+//description:
+//returns a given hex digest of given data
+//the returned digest is always encoded in hexadecimal
+//only the "MD4" digest is always supported!
+//if the given digest is not supported, string_null is returned
+//the digest string is matched case sensitively, use "MD4", not "md4"!
+
+//DP_QC_DIGEST_SHA256
+//idea: motorsep, Spike
+//DarkPlaces implementation: divVerent
+//description:
+//"SHA256" is also an allowed digest type
+
+//DP_QC_LOG
+//darkplaces implementation: divVerent
+//builtin definitions:
+float log(float f) = #532;
+//description:
+//logarithm
+
+//FTE_CSQC_SKELETONOBJECTS
+//idea: Spike, LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+// all skeleton numbers are 1-based (0 being no skeleton)
+// all bone numbers are 1-based (0 being invalid)
+float(float modlindex) skel_create = #263; // create a skeleton (be sure to assign this value into .skeletonindex for use), returns skeleton index (1 or higher) on success, returns 0 on failure (for example if the modelindex is not skeletal), it is recommended that you create a new skeleton if you change modelindex, as the skeleton uses the hierarchy from the model.
+float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
+float(float skel) skel_get_numbones = #265; // returns how many bones exist in the created skeleton, 0 if skeleton does not exist
+string(float skel, float bonenum) skel_get_bonename = #266; // returns name of bone (as a tempstring), "" if invalid bonenum (< 1 for example) or skeleton does not exist
+float(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
+float(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity
+vector(float skel, float bonenum) skel_get_bonerel = #269; // get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone)
+vector(float skel, float bonenum) skel_get_boneabs = #270; // get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity)
+void(float skel, float bonenum, vector org) skel_set_bone = #271; // set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
+void(float skel, float bonenum, vector org) skel_mul_bone = #272; // transform bone matrix (relative to its parent) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
+void(float skel, float startbone, float endbone, vector org) skel_mul_bones = #273; // transform bone matrices (relative to their parents) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bones)
+void(float skeldst, float skelsrc, float startbone, float endbone) skel_copybones = #274; // copy bone matrices (relative to their parents) from one skeleton to another, useful for copying a skeleton to a corpse
+void(float skel) skel_delete = #275; // deletes skeleton at the beginning of the next frame (you can add the entity, delete the skeleton, renderscene, and it will still work)
+float(float modlindex, string framename) frameforname = #276; // finds number of a specified frame in the animation, returns -1 if no match found
+float(float modlindex, float framenum) frameduration = #277; // returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0.
+//fields:
+.float skeletonindex; // active skeleton overriding standard animation on model
+.float frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
+.float frame2; // secondary framegroup animation (strength = lerpfrac)
+.float frame3; // tertiary framegroup animation (strength = lerpfrac3)
+.float frame4; // quaternary framegroup animation (strength = lerpfrac4)
+.float lerpfrac; // strength of framegroup blend
+.float lerpfrac3; // strength of framegroup blend
+.float lerpfrac4; // strength of framegroup blend
+.float frame1time; // start time of framegroup animation
+.float frame2time; // start time of framegroup animation
+.float frame3time; // start time of framegroup animation
+.float frame4time; // start time of framegroup animation
+//description:
+//this extension provides a way to do complex skeletal animation on an entity.
+//
+//see also DP_SKELETONOBJECTS (this extension implemented on server as well as client)
+//
+//notes:
+//each model contains its own skeleton, reusing a skeleton with incompatible models will yield garbage (or not render).
+//each model contains its own animation data, you can use animations from other model files (for example saving out all character animations as separate model files).
+//if an engine supports loading an animation-only file format such as .md5anim in FTEQW, it can be used to animate any model with a compatible skeleton.
+//proper use of this extension may require understanding matrix transforms (v_forward, v_right, v_up, origin), and you must keep in mind that v_right is negative for this purpose.
+//
+//features include:
+//multiple animations blended together.
+//animating a model with animations from another model with a compatible skeleton.
+//restricting animation blends to certain bones of a model - for example independent animation of legs, torso, head.
+//custom bone controllers - for example making eyes track a target location.
+//
+//
+//
+//example code follows...
+//
+//this helper function lets you identify (by parentage) what group a bone
+//belongs to - for example "torso", "leftarm", would return 1 ("torso") for
+//all children of the bone named "torso", unless they are children of
+//"leftarm" (which is a child of "torso") which would return 2 instead...
+float(float skel, float bonenum, string g1, string g2, string g3, string g4, string g5, string g6) example_skel_findbonegroup =
+{
+ local string bonename;
+ while (bonenum >= 0)
+ {
+ bonename = skel_get_bonename(skel, bonenum);
+ if (bonename == g1) return 1;
+ if (bonename == g2) return 2;
+ if (bonename == g3) return 3;
+ if (bonename == g4) return 4;
+ if (bonename == g5) return 5;
+ if (bonename == g6) return 6;
+ bonenum = skel_get_boneparent(skel, bonenum);
+ }
+ return 0;
+};
+// create a skeletonindex for our player using current modelindex
+void() example_skel_player_setup =
+{
+ self.skeletonindex = skel_create(self.modelindex);
+};
+// setup bones of skeleton based on an animation
+// note: animmodelindex can be a different model than self.modelindex
+void(float animmodelindex, float framegroup, float framegroupstarttime) example_skel_player_update_begin =
+{
+ // start with our standard animation
+ self.frame = framegroup;
+ self.frame2 = 0;
+ self.frame3 = 0;
+ self.frame4 = 0;
+ self.frame1time = framegroupstarttime;
+ self.frame2time = 0;
+ self.frame3time = 0;
+ self.frame4time = 0;
+ self.lerpfrac = 0;
+ self.lerpfrac3 = 0;
+ self.lerpfrac4 = 0;
+ skel_build(self.skeletonindex, self, animmodelindex, 0, 0, 100000);
+};
+// apply a different framegroup animation to bones with a specified parent
+void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride =
+{
+ local float bonenum;
+ local float numbones;
+ self.frame = framegroup;
+ self.frame2 = 0;
+ self.frame3 = 0;
+ self.frame4 = 0;
+ self.frame1time = framegroupstarttime;
+ self.frame2time = 0;
+ self.frame3time = 0;
+ self.frame4time = 0;
+ self.lerpfrac = 0;
+ self.lerpfrac3 = 0;
+ self.lerpfrac4 = 0;
+ bonenum = 0;
+ numbones = skel_get_numbones(self.skeletonindex);
+ while (bonenum < numbones)
+ {
+ if (example_skel_findbonegroup(self.skeletonindex, bonenum, groupbonename, excludegroupname1, excludegroupname2, "", "", "") == 1)
+ skel_build(self.skeletonindex, self, animmodelindex, 1 - blendalpha, bonenum, bonenum + 1);
+ bonenum = bonenum + 1;
+ }
+};
+// make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling
+void(vector eyetarget, string bonename) example_skel_player_update_eyetarget =
+{
+ local float bonenum;
+ local vector ang;
+ local vector oldforward, oldright, oldup;
+ local vector relforward, relright, relup, relorg;
+ local vector boneforward, boneright, boneup, boneorg;
+ local vector parentforward, parentright, parentup, parentorg;
+ local vector u, v;
+ local vector modeleyetarget;
+ bonenum = skel_find_bone(self.skeletonindex, bonename) - 1;
+ if (bonenum < 0)
+ return;
+ oldforward = v_forward;
+ oldright = v_right;
+ oldup = v_up;
+ v = eyetarget - self.origin;
+ modeleyetarget_x = v * v_forward;
+ modeleyetarget_y = 0-v * v_right;
+ modeleyetarget_z = v * v_up;
+ // this is an eyeball, make it point at the target location
+ // first get all the data we can...
+ relorg = skel_get_bonerel(self.skeletonindex, bonenum);
+ relforward = v_forward;
+ relright = v_right;
+ relup = v_up;
+ boneorg = skel_get_boneabs(self.skeletonindex, bonenum);
+ boneforward = v_forward;
+ boneright = v_right;
+ boneup = v_up;
+ parentorg = skel_get_boneabs(self.skeletonindex, skel_get_boneparent(self.skeletonindex, bonenum));
+ parentforward = v_forward;
+ parentright = v_right;
+ parentup = v_up;
+ // get the vector from the eyeball to the target
+ u = modeleyetarget - boneorg;
+ // now transform it inversely by the parent matrix to produce new rel vectors
+ v_x = u * parentforward;
+ v_y = u * parentright;
+ v_z = u * parentup;
+ ang = vectoangles2(v, relup);
+ ang_x = 0 - ang_x;
+ makevectors(ang);
+ // set the relative bone matrix
+ skel_set_bone(self.skeletonindex, bonenum, relorg);
+ // restore caller's v_ vectors
+ v_forward = oldforward;
+ v_right = oldright;
+ v_up = oldup;
+};
+// delete skeleton when we're done with it
+// note: skeleton remains valid until next frame when it is really deleted
+void() example_skel_player_delete =
+{
+ skel_delete(self.skeletonindex);
+ self.skeletonindex = 0;
+};
+//
+// END OF EXAMPLES FOR FTE_CSQC_SKELETONOBJECTS
+//
+
+//DP_QC_ENTITYDATA
+//idea: KrimZon
+//darkplaces implementation: KrimZon
+//builtin definitions:
+float() numentityfields = #496;
+string(float fieldnum) entityfieldname = #497;
+float(float fieldnum) entityfieldtype = #498;
+string(float fieldnum, entity ent) getentityfieldstring = #499;
+float(float fieldnum, entity ent, string s) putentityfieldstring = #500;
+//constants:
+//Returned by entityfieldtype
+float FIELD_STRING = 1;
+float FIELD_FLOAT = 2;
+float FIELD_VECTOR = 3;
+float FIELD_ENTITY = 4;
+float FIELD_FUNCTION = 6;
+//description:
+//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.
+//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.
+//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
+//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.
+//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.
+//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
+//putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
+
+//DP_QC_ENTITYSTRING
+void(string s) loadfromdata = #529;
+void(string s) loadfromfile = #530;
+void(string s) callfunction = #605;
+void(float fh, entity e) writetofile = #606;
+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 float STAT_MOVEVARS_TICRATE = 240;
+const float STAT_MOVEVARS_TIMESCALE = 241;
+const float STAT_FRAGLIMIT = 235;
+const float STAT_TIMELIMIT = 236;
+const float STAT_MOVEVARS_GRAVITY = 242;
+string(void) ReadPicture = #501;
+float PARTICLES_USEALPHA = 1;
+float particles_alphamin, particles_alphamax;
+float PARTICLES_USECOLOR = 2;
+vector particles_colormin, particles_colormax;
+float PARTICLES_USEFADE = 4; // fades the COUNT (fade alpha using alphamin/alphamax)
+float particles_fade;
+float PARTICLES_DRAWASTRAIL = 128;
+void(float effectindex, entity own, vector org_from, vector org_to, vector dir_from, vector dir_to, float countmultiplier, float flags) boxparticles = #502;
+float trace_networkentity;
+const float RF_FULLBRIGHT = 256;
+const float RF_NOSHADOW = 512;
+float RF_DYNAMICMODELLIGHT = 8192;
+
+float gettaginfo_parent;
+string gettaginfo_name;
+vector gettaginfo_offset;
+vector gettaginfo_forward;
+vector gettaginfo_right;
+vector gettaginfo_up;
+float checkpvs(vector viewpos, entity viewee) = #240;
--- /dev/null
+
+//DarkPlaces supported extension list, draft version 1.04
+
+//things that don't have extensions yet:
+.float disableclientprediction;
+
+//definitions that id Software left out:
+//these are passed as the 'nomonsters' parameter to traceline/tracebox (yes really this was supported in all quake engines, nomonsters is misnamed)
+float MOVE_NORMAL = 0; // same as FALSE
+float MOVE_NOMONSTERS = 1; // same as TRUE
+float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
+
+//checkextension function
+//idea: expected by almost everyone
+//darkplaces implementation: LordHavoc
+float(string s) checkextension = #99;
+//description:
+//check if (cvar("pr_checkextension")) before calling this, this is the only
+//guaranteed extension to be present in the extension system, it allows you
+//to check if an extension is available, by name, to check for an extension
+//use code like this:
+//// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere)
+//if (cvar("pr_checkextension"))
+//if (checkextension("DP_SV_SETCOLOR"))
+// ext_setcolor = TRUE;
+//from then on you can check ext_setcolor to know if that extension is available
+
+//BX_WAL_SUPPORT
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//indicates the engine supports .wal textures for filenames in the textures/ directory
+//(note: DarkPlaces has supported this since 2001 or 2002, but did not advertise it as an extension, then I noticed Betwix was advertising it and added the extension accordingly)
+
+//DP_BUTTONCHAT
+//idea: Vermeulen
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float buttonchat;
+//description:
+//true if the player is currently chatting (in messagemode, menus or console)
+
+//DP_BUTTONUSE
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float buttonuse;
+//client console commands:
+//+use
+//-use
+//description:
+//made +use and -use commands work, they now control the .buttonuse field (.button1 was used by many mods for other purposes).
+
+//DP_CL_LOADSKY
+//idea: Nehahra, LordHavoc
+//darkplaces implementation: LordHavoc
+//client console commands:
+//"loadsky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, use "" to revert to quake sky, note: this is the same as Quake2 skybox naming)
+//description:
+//sets global skybox for the map for this client (can be stuffed to a client by QC), does not hurt much to repeatedly execute this command, please don't use this in mods if it can be avoided (only if changing skybox is REALLY needed, otherwise please use DP_GFX_SKYBOX).
+
+//DP_CON_SET
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine supports the "set" console command which creates or sets a non-archived cvar (not saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
+
+//DP_CON_SETA
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine supports the "seta" console command which creates or sets an archived cvar (saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
+
+//DP_CON_ALIASPARAMETERS
+//idea: many
+//darkplaces implementation: Black
+//description:
+//indicates this engine supports aliases containing $1 through $9 parameter macros (which when called will expand to the parameters passed to the alias, for example alias test "say $2 $1", then you can type test hi there and it will execute say there hi), as well as $0 (name of the alias) and $* (all parameters $1 onward).
+
+//DP_CON_EXPANDCVAR
+//idea: many, PHP
+//darkplaces implementation: Black
+//description:
+//indicates this engine supports console commandlines containing $cvarname which will expand to the contents of that cvar as a parameter, for instance say my fov is $fov, will say "my fov is 90", or similar.
+
+//DP_CON_STARTMAP
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//adds two engine-called aliases named startmap_sp and startmap_dm which are called when the engine tries to start a singleplayer game from the menu (startmap_sp) or the -listen or -dedicated options are used or the engine is a dedicated server (uses startmap_dm), these allow a mod or game to specify their own map instead of start, and also distinguish between singleplayer and -listen/-dedicated, also these need not be a simple "map start" command, they can do other things if desired, startmap_sp and startmap_dm both default to "map start".
+
+//DP_EF_ADDITIVE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_ADDITIVE = 32;
+//description:
+//additive blending when this object is rendered
+
+//DP_EF_BLUE
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_BLUE = 64;
+//description:
+//entity emits blue light (used for quad)
+
+//DP_EF_DOUBLESIDED
+//idea: LordHavoc
+//darkplaces implementation: [515] and LordHavoc
+//effects bit:
+float EF_DOUBLESIDED = 32768;
+//description:
+//render entity as double sided (backfaces are visible, I.E. you see the 'interior' of the model, rather than just the front), can be occasionally useful on transparent stuff.
+
+//DP_EF_DYNAMICMODELLIGHT
+//idea: C.Brutail, divVerent, maikmerten
+//darkplaces implementation: divVerent
+//effects bit:
+float EF_DYNAMICMODELLIGHT = 131072;
+//description:
+//force dynamic model light on the entity, even if it's a BSP model (or anything else with lightmaps or light colors)
+
+//DP_EF_FLAME
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_FLAME = 1024;
+//description:
+//entity is on fire
+
+//DP_EF_FULLBRIGHT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_FULLBRIGHT = 512;
+//description:
+//entity is always brightly lit
+
+//DP_EF_NODEPTHTEST
+//idea: Supa
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_NODEPTHTEST = 8192;
+//description:
+//makes entity show up to client even through walls, useful with EF_ADDITIVE for special indicators like where team bases are in a map, so that people don't get lost
+
+//DP_EF_NODRAW
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_NODRAW = 16;
+//description:
+//prevents server from sending entity to client (forced invisible, even if it would have been a light source or other such things)
+
+//DP_EF_NOGUNBOB
+//idea: Chris Page, Dresk
+//darkplaces implementation: LordHAvoc
+//effects bit:
+float EF_NOGUNBOB = 256;
+//description:
+//this has different meanings depending on the entity it is used on:
+//player entity - prevents gun bobbing on player.viewmodel
+//viewmodelforclient entity - prevents gun bobbing on an entity attached to the player's view
+//other entities - no effect
+//uses:
+//disabling gun bobbing on a diving mask or other model used as a .viewmodel.
+//disabling gun bobbing on view-relative models meant to be part of the heads up display. (note: if fov is changed these entities may be off-screen, or too near the center of the screen, so use fov 90 in this case)
+
+//DP_EF_NOSHADOW
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_NOSHADOW = 4096;
+//description:
+//realtime lights will not cast shadows from this entity (but can still illuminate it)
+
+//DP_EF_RED
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_RED = 128;
+//description:
+//entity emits red light (used for invulnerability)
+
+//DP_EF_RESTARTANIM_BIT
+//idea: id software
+//darkplaces implementation: divVerent
+//effects bit:
+float EF_RESTARTANIM_BIT = 1048576;
+//description:
+//when toggled, the current animation is restarted. Useful for weapon animation.
+//to toggle this bit in QC, you can do:
+// self.effects += (EF_RESTARTANIM_BIT - 2 * (self.effects & EF_RESTARTANIM_BIT));
+
+//DP_EF_STARDUST
+//idea: MythWorks Inc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_STARDUST = 2048;
+//description:
+//entity emits bouncing sparkles in every direction
+
+//DP_EF_TELEPORT_BIT
+//idea: id software
+//darkplaces implementation: divVerent
+//effects bit:
+float EF_TELEPORT_BIT = 2097152;
+//description:
+//when toggled, interpolation of the entity is skipped for one frame. Useful for teleporting.
+//to toggle this bit in QC, you can do:
+// self.effects += (EF_TELEPORT_BIT - 2 * (self.effects & EF_TELEPORT_BIT));
+
+//DP_ENT_ALPHA
+//idea: Nehahra
+//darkplaces implementation: LordHavoc
+//fields:
+.float alpha;
+//description:
+//controls opacity of the entity, 0.0 is forced to be 1.0 (otherwise everything would be invisible), use -1 if you want to make something invisible, 1.0 is solid (like normal).
+
+//DP_ENT_COLORMOD
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definition:
+.vector colormod;
+//description:
+//controls color of the entity, '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, for instance using '1 0.6 0.4' on an ogre would give you an orange ogre (order is red green blue), note the colors can go up to '8 8 8' (8x as bright as normal).
+
+//DP_ENT_CUSTOMCOLORMAP
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//if .colormap is set to 1024 + pants + shirt * 16, those colors will be used for colormapping the entity, rather than looking up a colormap by player number.
+
+/*
+//NOTE: no longer supported by darkplaces because all entities are delta compressed now
+//DP_ENT_DELTACOMPRESS // no longer supported
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_DELTA = 8388608;
+//description:
+//(obsolete) applies delta compression to the network updates of the entity, making updates smaller, this might cause some unreliable behavior in packet loss situations, so it should only be used on numerous (nails/plasma shots/etc) or unimportant objects (gibs/shell casings/bullet holes/etc).
+*/
+
+//DP_ENT_EXTERIORMODELTOCLIENT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//fields:
+.entity exteriormodeltoclient;
+//description:
+//the entity is visible to all clients with one exception: if the specified client is using first person view (not using chase_active) the entity will not be shown. Also if tag attachments are supported any entities attached to the player entity will not be drawn in first person.
+
+//DP_ENT_GLOW
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float glow_color;
+.float glow_size;
+.float glow_trail;
+//description:
+//customizable glowing light effect on the entity, glow_color is a paletted (8bit) color in the range 0-255 (note: 0 and 254 are white), glow_size is 0 or higher (up to the engine what limit to cap it to, darkplaces imposes a 1020 limit), if glow_trail is true it will leave a trail of particles of the same color as the light.
+
+//DP_ENT_GLOWMOD
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definition:
+.vector glowmod;
+//description:
+//controls color of the entity's glow texture (fullbrights), '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, see colormod (same color restrictions apply).
+
+//DP_ENT_LOWPRECISION
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_LOWPRECISION = 4194304;
+//description:
+//uses low quality origin coordinates, reducing network traffic compared to the default high precision, intended for numerous objects (projectiles/gibs/bullet holes/etc).
+
+//DP_ENT_SCALE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float scale;
+//description:
+//controls rendering scale of the object, 0 is forced to be 1, darkplaces uses 1/16th accuracy and a limit of 15.9375, can be used to make an object larger or smaller.
+
+//DP_ENT_TRAILEFFECTNUM
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float traileffectnum;
+//description:
+//use a custom effectinfo.txt effect on this entity, assign it like this:
+//self.traileffectnum = particleeffectnum("mycustomeffect");
+//this will do both the dlight and particle trail as described in the effect, basically equivalent to trailparticles() in CSQC but performed on a server entity.
+
+//DP_ENT_VIEWMODEL
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.entity viewmodelforclient;
+//description:
+//this is a very special capability, attachs the entity to the view of the client specified, origin and angles become relative to the view of that client, all effects can be used (multiple skins on a weapon model etc)... the entity is not visible to any other client.
+
+//DP_GFX_EXTERNALTEXTURES
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//loads external textures found in various directories (tenebrae compatible)...
+/*
+in all examples .tga is merely the base texture, it can be any of these:
+.tga (base texture)
+_glow.tga (fullbrights or other glowing overlay stuff, NOTE: this is done using additive blend, not alpha)
+_pants.tga (pants overlay for colormapping on models, this should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend)
+_shirt.tga (same idea as pants, but for shirt color)
+_diffuse.tga (this may be used instead of base texture for per pixel lighting)
+_gloss.tga (specular texture for per pixel lighting, note this can be in color (tenebrae only supports greyscale))
+_norm.tga (normalmap texture for per pixel lighting)
+_bump.tga (bumpmap, converted to normalmap at load time, supported only for reasons of tenebrae compatibility)
+_luma.tga (same as _glow but supported only for reasons of tenebrae compatibility)
+
+due to glquake's incomplete Targa(r) loader, this section describes
+required Targa(r) features support:
+types:
+type 1 (uncompressed 8bit paletted with 24bit/32bit palette)
+type 2 (uncompressed 24bit/32bit true color, glquake supported this)
+type 3 (uncompressed 8bit greyscale)
+type 9 (RLE compressed 8bit paletted with 24bit/32bit palette)
+type 10 (RLE compressed 24bit/32bit true color, glquake supported this)
+type 11 (RLE compressed 8bit greyscale)
+attribute bit 0x20 (Origin At Top Left, top to bottom, left to right)
+
+image formats guaranteed to be supported: tga, pcx, lmp
+image formats that are optional: png, jpg
+
+mdl/spr/spr32 examples:
+skins are named _A (A being a number) and skingroups are named like _A_B
+these act as suffixes on the model name...
+example names for skin _2_1 of model "progs/armor.mdl":
+game/override/progs/armor.mdl_2_1.tga
+game/textures/progs/armor.mdl_2_1.tga
+game/progs/armor.mdl_2_1.tga
+example names for skin _0 of the model "progs/armor.mdl":
+game/override/progs/armor.mdl_0.tga
+game/textures/progs/armor.mdl_0.tga
+game/progs/armor.mdl_0.tga
+note that there can be more skins files (of the _0 naming) than the mdl
+contains, this is only useful to save space in the .mdl file if classic quake
+compatibility is not a concern.
+
+bsp/md2/md3 examples:
+example names for the texture "quake" of model "maps/start.bsp":
+game/override/quake.tga
+game/textures/quake.tga
+game/quake.tga
+
+sbar/menu/console textures: for example the texture "conchars" (console font) in gfx.wad
+game/override/gfx/conchars.tga
+game/textures/gfx/conchars.tga
+game/gfx/conchars.tga
+*/
+
+//DP_GFX_EXTERNALTEXTURES_PERMAPTEXTURES
+//idea: Fuh?
+//darkplaces implementation: LordHavoc
+//description:
+//Q1BSP and HLBSP map loading loads external textures found in textures/<mapname>/ as well as textures/.
+//Where mapname is the bsp filename minus the extension (typically .bsp) and minus maps/ if it is in maps/ (any other path is not removed)
+//example:
+//maps/e1m1.bsp uses textures in the directory textures/e1m1/ and falls back to textures/
+//maps/b_batt0.bsp uses textures in the directory textures/b_batt0.bsp and falls back to textures/
+//as a more extreme example:
+//progs/something/blah.bsp uses textures in the directory textures/progs/something/blah/ and falls back to textures/
+
+//DP_GFX_FOG
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//worldspawn fields:
+//"fog" (parameters: "density red green blue", example: "0.1 0.3 0.3 0.3")
+//description:
+//global fog for the map, can not be changed by QC
+
+//DP_GFX_QUAKE3MODELTAGS
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//field definitions:
+.entity tag_entity; // entity this is attached to (call setattachment to set this)
+.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any) (call setattachment to set this)
+//builtin definitions:
+void(entity e, entity tagentity, string tagname) setattachment = #443; // attachs e to a tag on tagentity (note: use "" to attach to entity origin/angles instead of a tag)
+//description:
+//allows entities to be visually attached to model tags (which follow animations perfectly) on other entities, for example attaching a weapon to a player's hand, or upper body attached to lower body, allowing it to change angles and frame separately (note: origin and angles are relative to the tag, use '0 0 0' for both if you want it to follow exactly, this is similar to viewmodelforclient's behavior).
+//note 2: if the tag is not found, it defaults to "" (attach to origin/angles of entity)
+//note 3: attaching to world turns off attachment
+//note 4: the entity that this is attached to must be visible for this to work
+//note 5: if an entity is attached to the player entity it will not be drawn in first person.
+
+//DP_GFX_SKINFILES
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//alias models (mdl, md2, md3) can have .skin files to replace conventional texture naming, these have a naming format such as:
+//progs/test.md3_0.skin
+//progs/test.md3_1.skin
+//...
+//
+//these files contain replace commands (replace meshname shadername), example:
+//replace "helmet" "progs/test/helmet1.tga" // this is a mesh shader replacement
+//replace "teamstripes" "progs/test/redstripes.tga"
+//replace "visor" "common/nodraw" // this makes the visor mesh invisible
+////it is not possible to rename tags using this format
+//
+//Or the Quake3 syntax (100% compatible with Quake3's .skin files):
+//helmet,progs/test/helmet1.tga // this is a mesh shader replacement
+//teamstripes,progs/test/redstripes.tga
+//visor,common/nodraw // this makes the visor mesh invisible
+//tag_camera, // this defines that the first tag in the model is called tag_camera
+//tag_test, // this defines that the second tag in the model is called tag_test
+//
+//any names that are not replaced are automatically show up as a grey checkerboard to indicate the error status, and "common/nodraw" is a special case that is invisible.
+//this feature is intended to allow multiple skin sets on md3 models (which otherwise only have one skin set).
+//other commands might be added someday but it is not expected.
+
+//DP_GFX_SKYBOX
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//worldspawn fields:
+//"sky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, note: "sky" is also used the same way by Quake2)
+//description:
+//global skybox for the map, can not be changed by QC
+
+//DP_UTF8
+//idea: Blub\0, divVerent
+//darkplaces implementation: Blub\0
+//cvar definitions:
+// utf8_enable: enable utf8 encoding
+//description: utf8 characters are allowed inside cvars, protocol strings, files, progs strings, etc.,
+//and count as 1 char for string functions like strlen, substring, etc.
+// note: utf8_enable is run-time cvar, could be changed during execution
+// note: beware that str2chr() could return value bigger than 255 once utf8 is enabled
+
+//DP_HALFLIFE_MAP
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//simply indicates that the engine supports HalfLife maps (BSP version 30, NOT the QER RGBA ones which are also version 30).
+
+//DP_HALFLIFE_MAP_CVAR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//cvars:
+//halflifebsp 0/1
+//description:
+//engine sets this cvar when loading a map to indicate if it is halflife format or not.
+
+//DP_HALFLIFE_SPRITE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//simply indicates that the engine supports HalfLife sprites.
+
+//DP_INPUTBUTTONS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float button3;
+.float button4;
+.float button5;
+.float button6;
+.float button7;
+.float button8;
+.float button9;
+.float button10;
+.float button11;
+.float button12;
+.float button13;
+.float button14;
+.float button15;
+.float button16;
+//description:
+//set to the state of the +button3, +button4, +button5, +button6, +button7, and +button8 buttons from the client, this does not involve protocol changes (the extra 6 button bits were simply not used).
+//the exact mapping of protocol button bits on the server is:
+//self.button0 = (bits & 1) != 0;
+///* button1 is skipped because mods abuse it as a variable, and accordingly it has no bit */
+//self.button2 = (bits & 2) != 0;
+//self.button3 = (bits & 4) != 0;
+//self.button4 = (bits & 8) != 0;
+//self.button5 = (bits & 16) != 0;
+//self.button6 = (bits & 32) != 0;
+//self.button7 = (bits & 64) != 0;
+//self.button8 = (bits & 128) != 0;
+
+// DP_LIGHTSTYLE_STATICVALUE
+// idea: VorteX
+// darkplaces implementation: VorteX
+// description: allows alternative 'static' lightstyle syntax : "=value"
+// examples: "=0.5", "=2.0", "=2.75"
+// could be used to control switchable lights or making styled lights with brightness > 2
+// Warning: this extension is experimental. It safely works in CSQC, but SVQC use is limited by the fact
+// that other engines (which do not support this extension) could connect to a game and misunderstand this kind of lightstyle syntax
+
+//DP_LITSPRITES
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine supports lighting on sprites, any sprite with ! in its filename (both on disk and in the qc) will be lit rather than having forced EF_FULLBRIGHT (EF_FULLBRIGHT on the entity can still force these sprites to not be lit).
+
+//DP_LITSUPPORT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine loads .lit files for any quake1 format .bsp files it loads to enhance maps with colored lighting.
+//implementation description: these files begin with the header QLIT followed by version number 1 (as little endian 32bit), the rest of the file is a replacement lightmaps lump, except being 3x as large as the lightmaps lump of the map it matches up with (and yes the between-lightmap padding is expanded 3x to keep this consistent), so the lightmap offset in each surface is simply multiplied by 3 during loading to properly index the lit data, and the lit file is loaded instead of the lightmap lump, other renderer changes are needed to display these of course... see the litsupport.zip sample code (almost a tutorial) at http://icculus.org/twilight/darkplaces for more information.
+
+//DP_MONSTERWALK
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//MOVETYPE_WALK is permitted on non-clients, so bots can move smoothly, run off ledges, etc, just like a real player.
+
+//DP_MOVETYPEBOUNCEMISSILE
+//idea: id Software
+//darkplaces implementation: id Software
+//movetype definitions:
+//float MOVETYPE_BOUNCEMISSILE = 11; // already in defs.qc
+//description:
+//MOVETYPE_BOUNCE but without gravity, and with full reflection (no speed loss like grenades have), in other words - bouncing laser bolts.
+
+//DP_MOVETYPEFLYWORLDONLY
+//idea: Samual
+//darkplaces implementation: Samual
+//movetype definitions:
+float MOVETYPE_FLY_WORLDONLY = 33;
+//description:
+//like MOVETYPE_FLY, but does all traces with MOVE_WORLDONLY, and is ignored by MOVETYPE_PUSH. Should only be combined with SOLID_NOT and SOLID_TRIGGER.
+
+//DP_NULL_MODEL
+//idea: Chris
+//darkplaces implementation: divVerent
+//definitions:
+//string dp_null_model = "null";
+//description:
+//setmodel(e, "null"); makes an entity invisible, have a zero bbox, but
+//networked. useful for shared CSQC entities.
+
+//DP_MOVETYPEFOLLOW
+//idea: id Software, LordHavoc (redesigned)
+//darkplaces implementation: LordHavoc
+//movetype definitions:
+float MOVETYPE_FOLLOW = 12;
+//description:
+//MOVETYPE_FOLLOW implemented, this uses existing entity fields in unusual ways:
+//aiment - the entity this is attached to.
+//punchangle - the original angles when the follow began.
+//view_ofs - the relative origin (note that this is un-rotated by punchangle, and that is actually the only purpose of punchangle).
+//v_angle - the relative angles.
+//here's an example of how you would set a bullet hole sprite to follow a bmodel it was created on, even if the bmodel rotates:
+//hole.movetype = MOVETYPE_FOLLOW; // make the hole follow
+//hole.solid = SOLID_NOT; // MOVETYPE_FOLLOW is always non-solid
+//hole.aiment = bmodel; // make the hole follow bmodel
+//hole.punchangle = bmodel.angles; // the original angles of bmodel
+//hole.view_ofs = hole.origin - bmodel.origin; // relative origin
+//hole.v_angle = hole.angles - bmodel.angles; // relative angles
+
+//DP_QC_ASINACOSATANATAN2TAN
+//idea: Urre
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float DEG2RAD = 0.0174532925199432957692369076848861271344287188854172545609719144;
+float RAD2DEG = 57.2957795130823208767981548141051703324054724665643215491602438612;
+float PI = 3.1415926535897932384626433832795028841971693993751058209749445923;
+//builtin definitions:
+float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5
+float(float c) acos = #472; // returns angle in radians for a given cos() value, the result is in the range 0 to PI
+float(float t) atan = #473; // returns angle in radians for a given tan() value, the result is in the range -PI*0.5 to PI*0.5
+float(float c, float s) atan2 = #474; // returns angle in radians for a given cos() and sin() value pair, the result is in the range -PI to PI (this is identical to vectoyaw except it returns radians rather than degrees)
+float(float a) tan = #475; // returns tangent value (which is simply sin(a)/cos(a)) for the given angle in radians, the result is in the range -infinity to +infinity
+//description:
+//useful math functions for analyzing vectors, note that these all use angles in radians (just like the cos/sin functions) not degrees unlike makevectors/vectoyaw/vectoangles, so be sure to do the appropriate conversions (multiply by DEG2RAD or RAD2DEG as needed).
+//note: atan2 can take unnormalized vectors (just like vectoyaw), and the function was included only for completeness (more often you want vectoyaw or vectoangles), atan2(v_x,v_y) * RAD2DEG gives the same result as vectoyaw(v)
+
+//DP_QC_AUTOCVARS
+//idea: divVerent
+//darkplaces implementation: divVerent
+//description:
+//allows QC variables to be bound to cvars
+//(works for float, string, vector types)
+//example:
+// float autocvar_developer;
+// float autocvar_registered;
+// string autocvar__cl_name;
+//NOTE: copying a string-typed autocvar to another variable/field, and then
+//changing the cvar or returning from progs is UNDEFINED. Writing to autocvar
+//globals is UNDEFINED. Accessing autocvar globals after changing that cvar in
+//the same frame by any means other than cvar_set() from the same QC VM is
+//IMPLEMENTATION DEFINED (an implementation may either yield the previous, or
+//the current, value). Changing them via cvar_set() in the same QC VM
+//immediately must reflect on the autocvar globals. Whether autocvar globals,
+//after restoring a savegame, have the cvar's current value, or the original
+//value at time of saving, is UNDEFINED. Restoring a savegame however must not
+//restore the cvar values themselves.
+//In case the cvar does NOT exist, then it is automatically created with the
+//value of the autocvar initializer, if given. This is possible with e.g.
+//frikqcc and fteqcc the following way:
+// var float autocvar_whatever = 42;
+//If no initializer is given, the cvar will be initialized to a string
+//equivalent to the NULL value of the given data type, that is, the empty
+//string, 0, or '0 0 0'. However, when automatic cvar creation took place, a
+//warning is printed to the game console.
+//NOTE: to prevent an ambiguity with float names for vector types, autocvar
+//names MUST NOT end with _x, _y or _z!
+
+//DP_QC_CHANGEPITCH
+//idea: id Software
+//darkplaces implementation: id Software
+//field definitions:
+.float idealpitch;
+.float pitch_speed;
+//builtin definitions:
+void(entity ent) changepitch = #63;
+//description:
+//equivalent to changeyaw, ent is normally self. (this was a Q2 builtin)
+
+//DP_QC_COPYENTITY
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(entity from, entity to) copyentity = #400;
+//description:
+//copies all data in the entity to another entity.
+
+//DP_QC_CRC16
+//idea: divVerent
+//darkplaces implementation: divVerent
+//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
+//When caseinsensitive is set, the CRC is calculated of the lower cased string.
+float(float caseinsensitive, string s, ...) crc16 = #494;
+
+//DP_QC_CVAR_DEFSTRING
+//idea: id Software (Doom3), LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+string(string s) cvar_defstring = #482;
+//description:
+//returns the default value of a cvar, as a tempstring.
+
+//DP_QC_CVAR_DESCRIPTION
+//idea: divVerent
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+string(string name) cvar_description = #518;
+//description:
+//returns the description of a cvar
+
+//DP_QC_CVAR_STRING
+//idea: VorteX
+//DarkPlaces implementation: VorteX, LordHavoc
+//builtin definitions:
+string(string s) cvar_string = #448;
+//description:
+//returns the value of a cvar, as a tempstring.
+
+//DP_QC_CVAR_TYPE
+//idea: divVerent
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+float(string name) cvar_type = #495;
+float CVAR_TYPEFLAG_EXISTS = 1;
+float CVAR_TYPEFLAG_SAVED = 2;
+float CVAR_TYPEFLAG_PRIVATE = 4;
+float CVAR_TYPEFLAG_ENGINE = 8;
+float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
+float CVAR_TYPEFLAG_READONLY = 32;
+
+//DP_QC_DIGEST
+//idea: motorsep, Spike
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+string(string digest, string data, ...) digest_hex = #639;
+//description:
+//returns a given hex digest of given data
+//the returned digest is always encoded in hexadecimal
+//only the "MD4" digest is always supported!
+//if the given digest is not supported, string_null is returned
+//the digest string is matched case sensitively, use "MD4", not "md4"!
+
+//DP_QC_DIGEST_SHA256
+//idea: motorsep, Spike
+//DarkPlaces implementation: divVerent
+//description:
+//"SHA256" is also an allowed digest type
+
+//DP_QC_EDICT_NUM
+//idea: 515
+//DarkPlaces implementation: LordHavoc
+//builtin definitions:
+entity(float entnum) edict_num = #459;
+float(entity ent) wasfreed = #353; // same as in EXT_CSQC extension
+//description:
+//edict_num returns the entity corresponding to a given number, this works even for freed entities, but you should call wasfreed(ent) to see if is currently active.
+//wasfreed returns whether an entity slot is currently free (entities that have never spawned are free, entities that have had remove called on them are also free).
+
+//DP_QC_ENTITYDATA
+//idea: KrimZon
+//darkplaces implementation: KrimZon
+//builtin definitions:
+float() numentityfields = #496;
+string(float fieldnum) entityfieldname = #497;
+float(float fieldnum) entityfieldtype = #498;
+string(float fieldnum, entity ent) getentityfieldstring = #499;
+float(float fieldnum, entity ent, string s) putentityfieldstring = #500;
+//constants:
+//Returned by entityfieldtype
+float FIELD_STRING = 1;
+float FIELD_FLOAT = 2;
+float FIELD_VECTOR = 3;
+float FIELD_ENTITY = 4;
+float FIELD_FUNCTION = 6;
+//description:
+//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.
+//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.
+//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
+//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.
+//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.
+//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
+//putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
+
+//DP_QC_ENTITYSTRING
+void(string s) loadfromdata = #529;
+void(string s) loadfromfile = #530;
+void(string s) callfunction = #605;
+void(float fh, entity e) writetofile = #606;
+float(string s) isfunction = #607;
+void(entity e, string s) parseentitydata = #608;
+
+//DP_QC_ETOS
+//idea: id Software
+//darkplaces implementation: id Software
+//builtin definitions:
+string(entity ent) etos = #65;
+//description:
+//prints "entity 1" or similar into a string. (this was a Q2 builtin)
+
+//DP_QC_EXTRESPONSEPACKET
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(void) getextresponse = #624;
+//description:
+//returns a string of the form "\"ipaddress:port\" data...", or the NULL string
+//if no packet was found. Packets can be queued into the client/server by
+//sending a packet starting with "\xFF\xFF\xFF\xFFextResponse " to the
+//listening port.
+
+//DP_QC_FINDCHAIN
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(.string fld, string match) findchain = #402;
+//description:
+//similar to find() but returns a chain of entities like findradius.
+
+//DP_QC_FINDCHAIN_TOFIELD
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+entity(.string fld, float match, .entity tofield) findradius_tofield = #22;
+entity(.string fld, string match, .entity tofield) findchain_tofield = #402;
+entity(.string fld, float match, .entity tofield) findchainflags_tofield = #450;
+entity(.string fld, float match, .entity tofield) findchainfloat_tofield = #403;
+//description:
+//similar to findchain() etc, but stores the chain into .tofield instead of .chain
+//actually, the .entity tofield is an optional field of the the existing findchain* functions
+
+//DP_QC_FINDCHAINFLAGS
+//idea: Sajt
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(.float fld, float match) findchainflags = #450;
+//description:
+//similar to findflags() but returns a chain of entities like findradius.
+
+//DP_QC_FINDCHAINFLOAT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(.entity fld, entity match) findchainentity = #403;
+entity(.float fld, float match) findchainfloat = #403;
+//description:
+//similar to findentity()/findfloat() but returns a chain of entities like findradius.
+
+//DP_QC_FINDFLAGS
+//idea: Sajt
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(entity start, .float fld, float match) findflags = #449;
+//description:
+//finds an entity with the specified flag set in the field, similar to find()
+
+//DP_QC_FINDFLOAT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(entity start, .entity fld, entity match) findentity = #98;
+entity(entity start, .float fld, float match) findfloat = #98;
+//description:
+//finds an entity or float field value, similar to find(), but for entity and float fields.
+
+//DP_QC_FS_SEARCH
+//idea: Black
+//darkplaces implementation: Black
+//builtin definitions:
+float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
+void(float handle) search_end = #445;
+float(float handle) search_getsize = #446;
+string(float handle, float num) search_getfilename = #447;
+//description:
+//search_begin performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload).
+//search_end frees a search slot (also done at progs reload).
+//search_getsize returns how many filenames were found.
+//search_getfilename returns a filename from the search.
+
+//DP_QC_GETLIGHT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+vector(vector org) getlight = #92;
+//description:
+//returns the lighting at the requested location (in color), 0-255 range (can exceed 255).
+
+//DP_QC_GETSURFACE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(entity e, float s) getsurfacenumpoints = #434;
+vector(entity e, float s, float n) getsurfacepoint = #435;
+vector(entity e, float s) getsurfacenormal = #436;
+string(entity e, float s) getsurfacetexture = #437;
+float(entity e, vector p) getsurfacenearpoint = #438;
+vector(entity e, float s, vector p) getsurfaceclippedpoint = #439;
+//description:
+//functions to query surface information.
+
+//DP_QC_GETSURFACEPOINTATTRIBUTE
+//idea: BlackHC
+//darkplaces implementation: BlackHC
+// constants
+float SPA_POSITION = 0;
+float SPA_S_AXIS = 1;
+float SPA_T_AXIS = 2;
+float SPA_R_AXIS = 3; // same as SPA_NORMAL
+float SPA_TEXCOORDS0 = 4;
+float SPA_LIGHTMAP0_TEXCOORDS = 5;
+float SPA_LIGHTMAP0_COLOR = 6;
+//builtin definitions:
+vector(entity e, float s, float n, float a) getsurfacepointattribute = #486;
+
+//description:
+//function to query extended information about a point on a certain surface
+
+//DP_QC_GETSURFACETRIANGLE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+float(entity e, float s) getsurfacenumtriangles = #628;
+vector(entity e, float s, float n) getsurfacetriangle = #629;
+//description:
+//function to query triangles of a surface
+
+//DP_QC_GETTAGINFO
+//idea: VorteX, LordHavoc
+//DarkPlaces implementation: VorteX
+//builtin definitions:
+float(entity ent, string tagname) gettagindex = #451;
+vector(entity ent, float tagindex) gettaginfo = #452;
+//description:
+//gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index).
+//gettaginfo returns the origin of the tag in worldspace and sets v_forward, v_right, and v_up to the current orientation of the tag in worldspace, this automatically resolves all dependencies (attachments, including viewmodelforclient), this means you could fire a shot from a tag on a gun entity attached to the view for example.
+
+//DP_QC_GETTAGINFO_BONEPROPERTIES
+//idea: daemon
+//DarkPlaces implementation: divVerent
+//global definitions:
+float gettaginfo_parent;
+string gettaginfo_name;
+vector gettaginfo_offset;
+vector gettaginfo_forward;
+vector gettaginfo_right;
+vector gettaginfo_up;
+//description:
+//when this extension is present, gettaginfo fills in some globals with info about the bone that had been queried
+//gettaginfo_parent is set to the number of the parent bone, or 0 if it is a root bone
+//gettaginfo_name is set to the name of the bone whose index had been specified in gettaginfo
+//gettaginfo_offset, gettaginfo_forward, gettaginfo_right, gettaginfo_up contain the transformation matrix of the bone relative to its parent. Note that the matrix may contain a scaling component.
+
+//DP_QC_GETTIME
+//idea: tZork
+//darkplaces implementation: tZork, divVerent
+//constant definitions:
+float GETTIME_FRAMESTART = 0; // time of start of frame relative to an arbitrary point in time
+float GETTIME_REALTIME = 1; // current absolute time (OS specific)
+float GETTIME_HIRES = 2; // like REALTIME, but may reset between QC invocations and thus can be higher precision
+float GETTIME_UPTIME = 3; // time of start of frame since start of the engine
+//builtin definitions:
+float(float tmr) gettime = #519;
+//description:
+//some timers to query...
+
+//DP_QC_GETTIME_CDTRACK
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+float GETTIME_CDTRACK = 4;
+//description:
+//returns the playing time of the current cdtrack when passed to gettime()
+//see DP_END_GETSOUNDTIME for similar functionality but for entity sound channels
+
+//DP_QC_I18N
+//idea: divVerent
+//darkplaces implementation: divVerent
+//description:
+//
+//The engine supports translating by gettext compatible .po files.
+//progs.dat uses progs.dat.<LANGUAGE>.po
+//menu.dat uses menu.dat.<LANGUAGE>.po
+//csprogs.dat uses csprogs.dat.<LANGUAGE>.po
+//
+//To create a string that can be translated, define it as
+// string dotranslate_FILENOTFOUND = "File not found";
+//Note: if the compiler does constant folding, this will only work if there is
+//no other "File not found" string in the progs!
+//
+//Alternatively, if using the Xonotic patched fteqcc compiler, you can simplify
+//this by using _("File not found") directly in the source code.
+//
+//The language is set by the "prvm_language" cvar: if prvm_language is set to
+//"de", it will read progs.dat.de.po for translating strings in progs.dat.
+//
+//If prvm_language is set to the special name "dump", progs.dat.pot will be
+//written, which is a translation template to be edited by filling out the
+//msgstr entries.
+
+//DP_QC_LOG
+//darkplaces implementation: divVerent
+//builtin definitions:
+float log(float f) = #532;
+//description:
+//logarithm
+
+//DP_QC_MINMAXBOUND
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(float a, float b, ...) min = #94;
+float(float a, float b, float c) min3 = #94;
+float(float a, float b, float c, float d) min4 = #94;
+float(float a, float b, float c, float d, float e) min5 = #94;
+float(float a, float b, float c, float d, float e, float f) min6 = #94;
+float(float a, float b, float c, float d, float e, float f, float g) min7 = #94;
+float(float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94;
+float(float a, float b, ...) max = #95;
+float(float a, float b, float c) max3 = #95;
+float(float a, float b, float c, float d) max4 = #95;
+float(float a, float b, float c, float d, float e) max5 = #95;
+float(float a, float b, float c, float d, float e, float f) max6 = #95;
+float(float a, float b, float c, float d, float e, float f, float g) max7 = #95;
+float(float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95;
+float(float minimum, float val, float maximum) bound = #96;
+//description:
+//min returns the lowest of all the supplied numbers.
+//max returns the highest of all the supplied numbers.
+//bound clamps the value to the range and returns it.
+
+//DP_QC_MULTIPLETEMPSTRINGS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//this extension makes all builtins returning tempstrings (ftos for example)
+//cycle through a pool of multiple tempstrings (at least 16), allowing
+//multiple ftos results to be gathered before putting them to use, normal
+//quake only had 1 tempstring, causing many headaches.
+//
+//Note that for longer term storage (or compatibility on engines having
+//FRIK_FILE but not this extension) the FRIK_FILE extension's
+//strzone/strunzone builtins provide similar functionality (slower though).
+//
+//NOTE: this extension is superseded by DP_QC_UNLIMITEDTEMPSTRINGS
+
+//DP_QC_NUM_FOR_EDICT
+//idea: Blub\0
+//darkplaces implementation: Blub\0
+//Function to get the number of an entity - a clean way.
+float(entity num) num_for_edict = #512;
+
+//DP_QC_RANDOMVEC
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+vector() randomvec = #91;
+//description:
+//returns a vector of length < 1, much quicker version of this QC: do {v_x = random()*2-1;v_y = random()*2-1;v_z = random()*2-1;} while(vlen(v) > 1)
+
+//DP_QC_SINCOSSQRTPOW
+//idea: id Software, LordHavoc
+//darkplaces implementation: id Software, LordHavoc
+//builtin definitions:
+float(float val) sin = #60;
+float(float val) cos = #61;
+float(float val) sqrt = #62;
+float(float a, float b) pow = #97;
+//description:
+//useful math functions, sine of val, cosine of val, square root of val, and raise a to power b, respectively.
+
+//DP_QC_SPRINTF
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(string format, ...) sprintf = #627;
+//description:
+//you know sprintf :P
+//supported stuff:
+// %
+// optional: <argpos>$ for the argument to format (the arg counter then is not increased)
+// flags: #0- +
+// optional: <width>, *, or *<argpos>$ for the field width (width is read before value and precision)
+// optional: .<precision>, .*, or .*<argpos>$ for the precision (precision is read before value)
+// length modifiers: h for forcing a float, l for forcing an entity (by default, %d etc. cast a float to int), ll for forcing an int
+// conversions:
+// d takes a float if no length is specified or h is, and an entity if l is specified as length, and an int if ll is specified as length, and cast it to an int
+// i takes an entity if no length is specified or l is, and a float if h is specified as length, and an int if ll is specified as length, and cast it to an int
+// ouxXc take a float if no length is specified or h is, and an entity if l is specified as length, and an int if ll is specified as length, and cast it to an unsigned int
+// eEfFgG take a float if no length is specified or h is, and an entity if l is specified as length, and an int if ll is specified as length, and cast it to a double
+// s takes a string
+// vV takes a vector, and processes the three components as if it were a gG for all three components, separated by space
+// For conversions s and c, the flag # makes precision and width interpreted
+// as byte count, by default it is interpreted as character count in UTF-8
+// enabled engines. No other conversions can create wide characters, and #
+// has another meaning in these. When in character count mode, color codes
+// are ignored. To get UTF-8 semantics WITHOUT color code parsing, use
+// the + flag.
+
+//DP_QC_STRFTIME
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+string(float uselocaltime, string format, ...) strftime = #478;
+//description:
+//provides the ability to get the local (in your timezone) or world (Universal Coordinated Time) time as a string using the formatting of your choice:
+//example: "%Y-%m-%d %H:%M:%S" (result looks like: 2007-02-08 01:03:15)
+//note: "%F %T" gives the same result as "%Y-%m-%d %H:%M:%S" (ISO 8601 date format and 24-hour time)
+//for more format codes please do a web search for strftime 3 and you should find the man(3) pages for this standard C function.
+//
+//practical uses:
+//changing day/night cycle (shops closing, monsters going on the prowl) in an RPG, for this you probably want to use s = strftime(TRUE, "%H");hour = stof(s);
+//printing current date/time for competitive multiplayer games, such as the beginning/end of each round in real world time.
+//activating eastereggs in singleplayer games on certain dates.
+//
+//note: some codes such as %x and %X use your locale settings and thus may not make sense to international users, it is not advisable to use these as the server and clients may be in different countries.
+//note: if you display local time to a player, it would be a good idea to note whether it is local time using a string like "%F %T (local)", and otherwise use "%F %T (UTC)".
+//note: be aware that if the game is saved and reloaded a week later the date and time will be different, so if activating eastereggs in a singleplayer game or something you may want to only check when a level is loaded and then keep the same easteregg state throughout the level so that the easteregg does not deactivate when reloading from a savegame (also be aware that precaches should not depend on such date/time code because reloading a savegame often scrambles the precaches if so!).
+//note: this function can return a NULL string (you can check for it with if (!s)) if the localtime/gmtime functions returned NULL in the engine code, such as if those functions don't work on this platform (consoles perhaps?), so be aware that this may return nothing.
+
+//DP_QC_STRINGCOLORFUNCTIONS
+//idea: Dresk
+//darkplaces implementation: Dresk
+//builtin definitions:
+float(string s) strlennocol = #476; // returns how many characters are in a string, minus color codes
+string(string s) strdecolorize = #477; // returns a string minus the color codes of the string provided
+//description:
+//provides additional functionality to strings by supporting functions that isolate and identify strings with color codes
+
+//DP_QC_STRING_CASE_FUNCTIONS
+//idea: Dresk
+//darkplaces implementation: LordHavoc / Dresk
+//builtin definitions:
+string(string s) strtolower = #480; // returns the passed in string in pure lowercase form
+string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form
+//description:
+//provides simple string uppercase and lowercase functions
+
+//DP_QC_TOKENIZEBYSEPARATOR
+//idea: Electro, SavageX, LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(string s, string separator1, ...) tokenizebyseparator = #479;
+//description:
+//this function returns tokens separated by any of the supplied separator strings, example:
+//numnumbers = tokenizebyseparator("10.2.3.4", ".");
+//returns 4 and the tokens are "10" "2" "3" "4"
+//possibly useful for parsing IPv4 addresses (such as "1.2.3.4") and IPv6 addresses (such as "[1234:5678:9abc:def0:1234:5678:9abc:def0]:26000")
+
+//DP_QC_TOKENIZE_CONSOLE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+float(string s) tokenize_console = #514;
+float(float i) argv_start_index = #515;
+float(float i) argv_end_index = #516;
+//description:
+//this function returns tokens separated just like the console does
+//also, functions are provided to get the index of the first and last character of each token in the original string
+//Passing negative values to them, or to argv, will be treated as indexes from the LAST token (like lists work in Perl). So argv(-1) will return the LAST token.
+
+//DP_QC_TRACEBOX
+//idea: id Software
+//darkplaces implementation: id Software
+//builtin definitions:
+void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
+//description:
+//similar to traceline but much more useful, traces a box of the size specified (technical note: in quake1 and halflife bsp maps the mins and maxs will be rounded up to one of the hull sizes, quake3 bsp does not have this problem, this is the case with normal moving entities as well).
+
+//DP_QC_TRACETOSS
+//idea: id Software
+//darkplaces implementation: id Software
+//builtin definitions:
+void(entity ent, entity ignore) tracetoss = #64;
+//description:
+//simulates movement of the entity as if it is MOVETYPE_TOSS and starting with it's current state (location, velocity, etc), returns relevant trace_ variables (trace_fraction is always 0, all other values are supported - trace_ent, trace_endpos, trace_plane_normal), does not actually alter the entity.
+
+//DP_QC_TRACE_MOVETYPE_HITMODEL
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float MOVE_HITMODEL = 4;
+//description:
+//allows traces to hit alias models (not sprites!) instead of entity boxes, use as the nomonsters parameter to trace functions, note that you can hit invisible model entities (alpha < 0 or EF_NODRAW or model "", it only checks modelindex)
+
+//DP_QC_TRACE_MOVETYPE_WORLDONLY
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float MOVE_WORLDONLY = 3;
+//description:
+//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions
+
+//DP_QC_UNLIMITEDTEMPSTRINGS
+//idea: divVerent
+//darkplaces implementation: LordHavoc
+//description:
+//this extension alters Quake behavior such that instead of reusing a single
+//tempstring (or multiple) there are an unlimited number of tempstrings, which
+//are removed only when a QC function invoked by the engine returns,
+//eliminating almost all imaginable concerns with string handling in QuakeC.
+//
+//in short:
+//you can now use and abuse tempstrings as much as you like, you still have to
+//use strzone (FRIK_FILE) for permanent storage however.
+//
+//
+//
+//implementation notes for other engine coders:
+//these tempstrings are expected to be stored in a contiguous buffer in memory
+//which may be fixed size or controlled by a cvar, or automatically grown on
+//demand (in the case of DarkPlaces).
+//
+//this concept is similar to quake's Zone system, however these are all freed
+//when the QC interpreter returns.
+//
+//this is basically a poor man's garbage collection system for strings.
+
+//DP_QC_VECTOANGLES_WITH_ROLL
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+vector(vector forward, vector up) vectoangles2 = #51; // same number as vectoangles
+//description:
+//variant of vectoangles that takes an up vector to calculate roll angle (also uses this to calculate yaw correctly if the forward is straight up or straight down)
+//note: just like normal vectoangles you need to negate the pitch of the returned angles if you want to feed them to makevectors or assign to self.v_angle
+
+//DP_QC_VECTORVECTORS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector dir) vectorvectors = #432;
+//description:
+//creates v_forward, v_right, and v_up vectors given a forward vector, similar to makevectors except it takes a forward direction vector instead of angles.
+
+//DP_QC_WHICHPACK
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(string filename) whichpack = #503;
+//description:
+//for files in a pak/pk3/whatever, returns the pack's file name in FRIK_FILE name space.
+//for physical files, returns "".
+//in case of error, returns string_null.
+
+//DP_QC_URI_ESCAPE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//URI::Escape's functionality
+string(string in) uri_escape = #510;
+string(string in) uri_unescape = #511;
+
+//DP_QC_URI_GET
+//idea: divVerent
+//darkplaces implementation: divVerent
+//loads text from an URL into a string
+//returns 1 on success of initiation, 0 if there are too many concurrent
+//connections already or if the URL is invalid
+//the following callback will receive the data and MUST exist!
+// void(float id, float status, string data) URI_Get_Callback;
+//status is either
+// negative for an internal error,
+// 0 for success, or
+// the HTTP response code on server error (e.g. 404)
+//if 1 is returned by uri_get, the callback will be called in the future
+float(string url, float id) uri_get = #513;
+
+//DP_QC_URI_POST
+//idea: divVerent
+//darkplaces implementation: divVerent
+//loads text from an URL into a string after POSTing via HTTP
+//works like uri_get, but uri_post sends data with Content-Type: content_type to the server
+//and uri_post sends the string buffer buf, joined using the delimiter delim
+float(string url, float id, string content_type, string data) uri_post = #513;
+float(string url, float id, string content_type, string delim, float buf) uri_postbuf = #513;
+
+//DP_SKELETONOBJECTS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//this extension indicates that FTE_CSQC_SKELETONOBJECTS functionality is available in server QC (as well as CSQC).
+
+//DP_SV_SPAWNFUNC_PREFIX
+//idea: divVerent
+//darkplaces implementation: divVerent
+//Make functions whose name start with spawnfunc_ take precedence as spawn function for loading entities.
+//Useful if you have a field ammo_shells (required in any Quake mod) but want to support spawn functions called ammo_shells (like in Q3A).
+//Optionally, you can declare a global "float require_spawnfunc_prefix;" which will require ANY spawn function to start with that prefix.
+
+
+//DP_QUAKE2_MODEL
+//idea: quake community
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports Quake2 .md2 files.
+
+//DP_QUAKE2_SPRITE
+//idea: LordHavoc
+//darkplaces implementation: Elric
+//description:
+//shows that the engine supports Quake2 .sp2 files.
+
+//DP_QUAKE3_MAP
+//idea: quake community
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports Quake3 .bsp files.
+
+//DP_QUAKE3_MODEL
+//idea: quake community
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports Quake3 .md3 files.
+
+//DP_REGISTERCVAR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(string name, string value) registercvar = #93;
+//description:
+//adds a new console cvar to the server console (in singleplayer this is the player's console), the cvar exists until the mod is unloaded or the game quits.
+//NOTE: DP_CON_SET is much better.
+
+//DP_SND_DIRECTIONLESSATTNNONE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//make sounds with ATTN_NONE have no spatialization (enabling easy use as music sources).
+
+//DP_SND_FAKETRACKS
+//idea: requested
+
+//darkplaces implementation: Elric
+//description:
+//the engine plays sound/cdtracks/track001.wav instead of cd track 1 and so on if found, this allows games and mods to have music tracks without using ambientsound.
+//Note: also plays .ogg with DP_SND_OGGVORBIS extension.
+
+//DP_SND_SOUND7_WIP1
+//DP_SND_SOUND7_WIP2
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+void(entity e, float chan, string samp, float vol, float atten, float speed, float flags) sound7 = #8;
+float SOUNDFLAG_RELIABLE = 1;
+//description:
+//plays a sound, with some more flags
+//extensions to sound():
+//- channel may be in the range from -128 to 127; channels -128 to 0 are "auto",
+// i.e. support multiple sounds at once, but cannot be stopped/restarted
+//- a value 0 in the speed parameter means no change; otherwise, it is a
+// percentage of playback speed ("pitch shifting"). 100 is normal pitch, 50 is
+// half speed, 200 is double speed, etc. (DP_SND_SOUND7_WIP2)
+//- the flag SOUNDFLAG_RELIABLE can be specified, which makes the sound send
+// to MSG_ALL (reliable) instead of MSG_BROADCAST (unreliable, default);
+// similarily, SOUNDFLAG_RELIABLE_TO_ONE sends to MSG_ONE
+//- channel 0 is controlled by snd_channel0volume; channel 1 and -1 by
+// snd_channel1volume, etc. (so, a channel shares the cvar with its respective
+// auto-channel); however, the mod MUST define snd_channel8volume and upwards
+// in default.cfg if they are to be used, as the engine does not create them
+// to not litter the cvar list
+//- this extension applies to CSQC as well; CSQC_Event_Sound will get speed and
+// flags as extra 7th and 8th argument
+//- WIP2 ideas: SOUNDFLAG_RELIABLE_TO_ONE, SOUNDFLAG_NOPHS, SOUNDFLAG_FORCELOOP
+//- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support
+// the finished extension once done
+
+//DP_SND_OGGVORBIS
+//idea: Transfusion
+//darkplaces implementation: Elric
+//description:
+//the engine supports loading Ogg Vorbis sound files. Use either the .ogg filename directly, or a .wav of the same name (will try to load the .wav first and then .ogg).
+
+//DP_SND_STEREOWAV
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//the engine supports stereo WAV files. (useful with DP_SND_DIRECTIONLESSATTNNONE for music)
+
+//DP_SND_GETSOUNDTIME
+//idea: VorteX
+//darkplaces implementation: VorteX
+//constant definitions:
+float(entity e, float channel) getsoundtime = #533; // get currently sound playing position on entity channel, -1 if not playing or error
+float(string sample) soundlength = #534; // returns length of sound sample in seconds, -1 on error (sound not precached, sound system not initialized etc.)
+//description: provides opportunity to query length of sound samples and realtime tracking of sound playing on entities (similar to DP_GETTIME_CDTRACK)
+//note: beware dedicated server not running sound engine at all, so in dedicated mode this builtins will not work in server progs
+//note also: menu progs not supporting getsoundtime() (will give a warning) since it has no sound playing on entities
+//examples of use:
+// - QC-driven looped sounds
+// - QC events when sound playing is finished
+// - toggleable ambientsounds
+// - subtitles
+
+//DP_VIDEO_DPV
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//console commands:
+// playvideo <videoname> - start playing video
+// stopvideo - stops current video
+//description: indicated that engine support playing videos in DPV format
+
+//DP_VIDEO_SUBTITLES
+//idea: VorteX
+//darkplaces implementation: VorteX
+//cvars:
+// cl_video_subtitles - toggles subtitles showing
+// cl_video_subtitles_lines - how many lines to reserve for subtitles
+// cl_video_subtitles_textsize - font size
+//console commands:
+// playvideo <videoname> <custom_subtitles_file> - start playing video
+// stopvideo - stops current video
+//description: indicates that engine support subtitles on videos
+//subtitles stored in external text files, each video file has it's default subtitles file ( <videoname>.dpsubs )
+//example: for video/act1.dpv default subtitles file will be video/act1.dpsubs
+//also video could be played with custom subtitles file by utilizing second parm of playvideo command
+//syntax of .dpsubs files: each line in .dpsubs file defines 1 subtitle, there are three tokens:
+// <start> <end> "string"
+// start: subtitle start time in seconds
+// end: subtitle time-to-show in seconds, if 0 - subtitle will be showed until next subtitle is started,
+// if below 0 - show until next subtitles minus this number of seconds
+// text: subtitle text, color codes (Q3-style and ^xRGB) are allowed
+//example of subtitle file:
+// 3 0 "Vengeance! Vengeance for my eternity of suffering!"
+// 9 0 "Whelp! As if you knew what eternity was!"
+// 13 0 "Grovel before your true master."
+// 17 0 "Never!"
+// 18 7 "I'll hack you from crotch to gizzard and feed what's left of you to your brides..."
+
+//DP_SOLIDCORPSE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//solid definitions:
+float SOLID_CORPSE = 5;
+//description:
+//the entity will not collide with SOLID_CORPSE and SOLID_SLIDEBOX entities (and likewise they will not collide with it), this is useful if you want dead bodies that are shootable but do not obstruct movement by players and monsters, note that if you traceline with a SOLID_SLIDEBOX entity as the ignoreent, it will ignore SOLID_CORPSE entities, this is desirable for visibility and movement traces, but not for bullets, for the traceline to hit SOLID_CORPSE you must temporarily force the player (or whatever) to SOLID_BBOX and then restore to SOLID_SLIDEBOX after the traceline.
+
+//DP_SPRITE32
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//the engine supports .spr32 sprites.
+
+//DP_SV_BOTCLIENT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constants:
+float CLIENTTYPE_DISCONNECTED = 0;
+float CLIENTTYPE_REAL = 1;
+float CLIENTTYPE_BOT = 2;
+float CLIENTTYPE_NOTACLIENT = 3;
+//builtin definitions:
+entity() spawnclient = #454; // like spawn but for client slots (also calls relevant connect/spawn functions), returns world if no clients available
+float(entity clent) clienttype = #455; // returns one of the CLIENTTYPE_* constants
+//description:
+//spawns a client with no network connection, to allow bots to use client slots with no hacks.
+//How to use:
+/*
+ // to spawn a bot
+ local entity oldself;
+ oldself = self;
+ self = spawnclient();
+ if (!self)
+ {
+ bprint("Can not add bot, server full.\n");
+ self = oldself;
+ return;
+ }
+ self.netname = "Yoyobot";
+ self.clientcolors = 12 * 16 + 4; // yellow (12) shirt and red (4) pants
+ ClientConnect();
+ PutClientInServer();
+ self = oldself;
+
+ // to remove all bots
+ local entity head;
+ head = find(world, classname, "player");
+ while (head)
+ {
+ if (clienttype(head) == CLIENTTYPE_BOT)
+ dropclient(head);
+ head = find(head, classname, "player");
+ }
+
+ // to identify if a client is a bot (for example in PlayerPreThink)
+ if (clienttype(self) == CLIENTTYPE_BOT)
+ botthink();
+*/
+//see also DP_SV_CLIENTCOLORS DP_SV_CLIENTNAME DP_SV_DROPCLIENT
+//How it works:
+//creates a new client, calls SetNewParms and stores the parms, and returns the client.
+//this intentionally does not call SV_SendServerinfo to allow the QuakeC a chance to set the netname and clientcolors fields before actually spawning the bot by calling ClientConnect and PutClientInServer manually
+//on level change ClientConnect and PutClientInServer are called by the engine to spawn in the bot (this is why clienttype() exists to tell you on the next level what type of client this is).
+//parms work the same on bot clients as they do on real clients, and do carry from level to level
+
+//DP_SV_BOUNCEFACTOR
+//idea: divVerent
+//darkplaces implementation: divVerent
+//field definitions:
+.float bouncefactor; // velocity multiplier after a bounce
+.float bouncestop; // bounce stops if velocity to bounce plane is < bouncestop * gravity AFTER the bounce
+//description:
+//allows qc to customize MOVETYPE_BOUNCE a bit
+
+//DP_SV_CLIENTCAMERA
+//idea: LordHavoc, others
+//darkplaces implementation: Black
+//field definitions:
+.entity clientcamera; // override camera entity
+//description:
+//allows another entity to be the camera for a client, for example a remote camera, this is similar to sending svc_setview manually except that it also changes the network culling appropriately.
+
+//DP_SV_CLIENTCOLORS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float clientcolors; // colors of the client (format: pants + shirt * 16)
+//description:
+//allows qc to read and modify the client colors associated with a client entity (not particularly useful on other entities), and automatically sends out any appropriate network updates if changed
+
+//DP_SV_CLIENTNAME
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//allows qc to modify the client's .netname, and automatically sends out any appropriate network updates if changed
+
+//DP_SV_CUSTOMIZEENTITYFORCLIENT
+//idea: LordHavoc
+//darkplaces implementation: [515] and LordHavoc
+//field definitions:
+.float() customizeentityforclient; // self = this entity, other = client entity
+//description:
+//allows qc to modify an entity before it is sent to each client, the function returns TRUE if it should send, FALSE if it should not, and is fully capable of editing the entity's fields, this allows cloaked players to appear less transparent to their teammates, navigation markers to only show to their team, etc
+//tips on writing customize functions:
+//it is a good idea to return FALSE early in the function if possible to reduce cpu usage, because this function may be called many thousands of times per frame if there are many customized entities on a 64+ player server.
+//you are free to change anything in self, but please do not change any other entities (the results may be very inconsistent).
+//example ideas for use of this extension:
+//making icons over teammates' heads which are only visible to teammates. for exasmple: float() playericon_customizeentityforclient = {return self.owner.team == other.team;};
+//making cloaked players more visible to their teammates than their enemies. for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return TRUE;};
+//making explosion models that face the viewer (does not work well with chase_active). for example: float() explosion_customizeentityforclient = {self.angles = vectoangles(other.origin + other.view_ofs - self.origin);self.angles_x = 0 - self.angles_x;};
+//implementation notes:
+//entity customization is done before per-client culling (visibility for instance) because the entity may be doing setorigin to display itself in different locations on different clients, may be altering its .modelindex, .effects and other fields important to culling, so customized entities increase cpu usage (non-customized entities can use all the early culling they want however, as they are not changing on a per client basis).
+
+//DP_SV_DISCARDABLEDEMO
+//idea: parasti
+//darkplaces implementation: parasti
+//field definitions:
+.float discardabledemo;
+//description:
+//when this field is set to a non-zero value on a player entity, a possibly recorded server-side demo for the player is discarded
+//Note that this extension only works if:
+// auto demos are enabled (the cvar sv_autodemo_perclient is set)
+// discarding demos is enabled (the cvar sv_autodemo_perclient_discardable is set)
+
+//DP_SV_DRAWONLYTOCLIENT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.entity drawonlytoclient;
+//description:
+//the entity is only visible to the specified client.
+
+//DP_SV_DROPCLIENT
+//idea: FrikaC
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(entity clent) dropclient = #453;
+//description:
+//causes the server to immediately drop the client, more reliable than stuffcmd(clent, "disconnect\n"); which could be intentionally ignored by the client engine
+
+//DP_SV_EFFECT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404;
+//SVC definitions:
+//float svc_effect = #52; // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate
+//float svc_effect2 = #53; // [vector] org [short] modelindex [byte] startframe [byte] framecount [byte] framerate
+//description:
+//clientside playback of simple custom sprite effects (explosion sprites, etc).
+
+//DP_SV_ENTITYCONTENTSTRANSITION
+//idea: Dresk
+//darkplaces implementation: Dresk
+//field definitions:
+.void(float nOriginalContents, float nNewContents) contentstransition;
+//description:
+//This field function, when provided, is triggered on an entity when the contents (ie. liquid / water / etc) is changed.
+//The first parameter provides the entities original contents, prior to the transition. The second parameter provides the new contents.
+//NOTE: If this field function is provided on an entity, the standard watersplash sound IS SUPPRESSED to allow for authors to create their own transition sounds.
+
+//DP_SV_MOVETYPESTEP_LANDEVENT
+//idea: Dresk
+//darkplaces implementation: Dresk
+//field definitions:
+.void(vector vImpactVelocity) movetypesteplandevent;
+//description:
+//This field function, when provided, is triggered on a MOVETYPE_STEP entity when it experiences "land event".
+// The standard engine behavior for this event is to play the sv_sound_land CVar sound.
+//The parameter provides the velocity of the entity at the time of the impact. The z value may therefore be used to calculate how "hard" the entity struck the surface.
+//NOTE: If this field function is provided on a MOVETYPE_STEP entity, the standard sv_sound_land sound IS SUPPRESSED to allow for authors to create their own feedback.
+
+//DP_SV_POINTSOUND
+//idea: Dresk
+//darkplaces implementation: Dresk
+//builtin definitions:
+void(vector origin, string sample, float volume, float attenuation) pointsound = #483;
+//description:
+//Similar to the standard QC sound function, this function takes an origin instead of an entity and omits the channel parameter.
+// This allows sounds to be played at arbitrary origins without spawning entities.
+
+//DP_SV_ONENTITYNOSPAWNFUNCTION
+//idea: Dresk
+//darkplaces implementation: Dresk
+//engine-called QC prototypes:
+//void() SV_OnEntityNoSpawnFunction;
+//description:
+// This function is called whenever an entity on the server has no spawn function, and therefore has no defined QC behavior.
+// You may as such dictate the behavior as to what happens to the entity.
+// To mimic the engine's default behavior, simply call remove(self).
+
+//DP_SV_ONENTITYPREPOSTSPAWNFUNCTION
+//idea: divVerent
+//darkplaces implementation: divVerent
+//engine-called QC prototypes:
+//void() SV_OnEntityPreSpawnFunction;
+//void() SV_OnEntityPostSpawnFunction;
+//description:
+// These functions are called BEFORE or AFTER an entity is spawned the regular way.
+// You may as such dictate the behavior as to what happens to the entity.
+// SV_OnEntityPreSpawnFunction is called before even looking for the spawn function, so you can even change its classname in there. If it remove()s the entity, the spawn function will not be looked for.
+// SV_OnEntityPostSpawnFunction is called ONLY after its spawn function or SV_OnEntityNoSpawnFunction was called, and skipped if the entity got removed by either.
+
+//DP_SV_MODELFLAGS_AS_EFFECTS
+//idea: LordHavoc, Dresk
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float modelflags;
+//constant definitions:
+float EF_NOMODELFLAGS = 8388608; // ignore any effects in a model file and substitute your own
+float MF_ROCKET = 1; // leave a trail
+float MF_GRENADE = 2; // leave a trail
+float MF_GIB = 4; // leave a trail
+float MF_ROTATE = 8; // rotate (bonus items)
+float MF_TRACER = 16; // green split trail
+float MF_ZOMGIB = 32; // small blood trail
+float MF_TRACER2 = 64; // orange split trail
+float MF_TRACER3 = 128; // purple trail
+//description:
+//this extension allows model flags to be specified on entities so you can add a rocket trail and glow to any entity, etc.
+//setting any of these will override the flags the model already has, to disable the model's flags without supplying any of your own you must use EF_NOMODELFLAGS.
+//
+//silly example modification #1 to W_FireRocket in weapons.qc:
+//missile.effects = EF_NOMODELFLAGS; // rocket without a glow/fire trail
+//silly example modification #2 to W_FireRocket in weapons.qc:
+//missile.modelflags = MF_GIB; // leave a blood trail instead of glow/fire trail
+//
+//note: you can not combine multiple kinds of trail, only one of them will be active, you can combine MF_ROTATE and the other MF_ flags however, and using EF_NOMODELFLAGS along with these does no harm.
+//
+//note to engine coders: they are internally encoded in the protocol as extra EF_ flags (shift the values left 24 bits and send them in the protocol that way), so no protocol change was required (however 32bit effects is a protocol extension itself), within the engine they are referred to as EF_ for the 24bit shifted values.
+
+//DP_SV_NETADDRESS
+//idea: Dresk
+//darkplaces implementation: Dresk
+//field definitions:
+.string netaddress;
+//description:
+// provides the netaddress of the associated entity (ie. 127.0.0.1) and "null/botclient" if the netconnection of the entity is invalid
+
+//DP_SV_NODRAWTOCLIENT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.entity nodrawtoclient;
+//description:
+//the entity is not visible to the specified client.
+
+//DP_SV_PING
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float ping;
+//description:
+//continuously updated field indicating client's ping (based on average of last 16 packet time differences).
+
+//DP_SV_PING_PACKETLOSS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float ping_packetloss;
+.float ping_movementloss;
+//description:
+//continuously updated field indicating client's packet loss, and movement loss (i.e. packet loss affecting player movement).
+
+//DP_SV_POINTPARTICLES
+//idea: Spike
+//darkplaces implementation: LordHavoc
+//function definitions:
+float(string effectname) particleeffectnum = #335; // same as in CSQC
+void(entity ent, float effectnum, vector start, vector end) trailparticles = #336; // same as in CSQC
+void(float effectnum, vector org, vector vel, float howmany) pointparticles = #337; // same as in CSQC
+//SVC definitions:
+//float svc_trailparticles = 60; // [short] entnum [short] effectnum [vector] start [vector] end
+//float svc_pointparticles = 61; // [short] effectnum [vector] start [vector] velocity [short] count
+//float svc_pointparticles1 = 62; // [short] effectnum [vector] start, same as svc_pointparticles except velocity is zero and count is 1
+//description:
+//provides the ability to spawn non-standard particle effects, typically these are defined in a particle effect information file such as effectinfo.txt in darkplaces.
+//this is a port of particle effect features from clientside QC (EXT_CSQC) to server QC, as these effects are potentially useful to all games even if they do not make use of EXT_CSQC.
+//warning: server must have same order of effects in effectinfo.txt as client does or the numbers would not match up, except for standard quake effects which are always the same numbers.
+
+//DP_SV_PUNCHVECTOR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.vector punchvector;
+//description:
+//offsets client view in worldspace, similar to view_ofs but all 3 components are used and are sent with at least 8 bits of fraction, this allows the view to be kicked around by damage or hard landings or whatever else, note that unlike punchangle this is not faded over time, it is up to the mod to fade it (see also DP_SV_PLAYERPHYSICS).
+
+//DP_SV_PLAYERPHYSICS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.vector movement;
+//cvar definitions:
+//"sv_playerphysicsqc" (0/1, default 1, allows user to disable qc player physics)
+//engine-called QC prototypes:
+//void() SV_PlayerPhysics;
+//description:
+//.movement vector contains the movement input from the player, allowing QC to do as it wishs with the input, and SV_PlayerPhysics will completely replace the player physics if present (works for all MOVETYPE's), see darkplaces mod source for example of this function (in playermovement.qc, adds HalfLife ladders support, as well as acceleration/deceleration while airborn (rather than the quake sudden-stop while airborn), and simplifies the physics a bit)
+
+//DP_PHYSICS_ODE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//globals:
+//new movetypes:
+const float MOVETYPE_PHYSICS = 32; // need to be set before any physics_* builtins applied
+//new solid types (deprecated):
+const float SOLID_PHYSICS_BOX = 32;
+const float SOLID_PHYSICS_SPHERE = 33;
+const float SOLID_PHYSICS_CAPSULE = 34;
+const float SOLID_PHYSICS_TRIMESH = 35;
+const float SOLID_PHYSICS_CYLINDER = 36;
+//geometry types:
+const float GEOMTYPE_NONE = -1; // entity will be entirely skipped by ODE
+const float GEOMTYPE_SOLID = 0; // geometry type will be set based on .solid field
+const float GEOMTYPE_BOX = 1; // entity bound box
+const float GEOMTYPE_SPHERE = 2; // sphere with radius picked from x axis of entity bound box
+const float GEOMTYPE_CAPSULE = 3; // with leading axis automatically determined from longest one, radius is picked as minimal of the rest 2 axes
+const float GEOMTYPE_TRIMESH = 4; // triangle mesh
+const float GEOMTYPE_CYLINDER = 5; // like capsule but not capped
+ // note that ODE's builtin cylinder support is experimental, somewhat bugged and unfinished (no cylinder-cylinder collision)
+ // to use properly working cylinder should build ODE with LIBCCD extension
+const float GEOMTYPE_CAPSULE_X = 6; // capsule with fixed leading axis
+const float GEOMTYPE_CAPSULE_Y = 7;
+const float GEOMTYPE_CAPSULE_Z = 8;
+const float GEOMTYPE_CYLINDER_X = 9; // cylinder with fixed leading axis
+const float GEOMTYPE_CYLINDER_Y = 10;
+const float GEOMTYPE_CYLINDER_Z = 11;
+//joint types:
+const float JOINTTYPE_NONE = 0;
+const float JOINTTYPE_POINT = 1;
+const float JOINTTYPE_HINGE = 2;
+const float JOINTTYPE_SLIDER = 3;
+const float JOINTTYPE_UNIVERSAL = 4;
+const float JOINTTYPE_HINGE2 = 5;
+const float JOINTTYPE_FIXED = -1;
+//force types:
+const float FORCETYPE_NONE = 0;
+const float FORCETYPE_FORCE = 1; // applied at center of mass
+const float FORCETYPE_FORCEATPOS = 2;
+const float FORCETYPE_TORQUE = 3;
+// common joint properties:
+// .entity aiment; // connected objects
+// .entity enemy; // connected objects, forces
+// .vector movedir;
+// for a spring:
+// movedir_x = spring constant (force multiplier, must be > 0)
+// movedir_y = spring dampening constant to prevent oscillation (must be > 0)
+// movedir_z = spring stop position (+/-)
+// for a motor:
+// movedir_x = desired motor velocity
+// movedir_y = -1 * max motor force to use
+// movedir_z = stop position (+/-), set to 0 for no stop
+// note that ODE does not support both in one anyway
+// for a force:
+// force vector to apply
+//field definitions:
+.float geomtype; // see GEOMTYPE_*, a more correct way to set collision shape, allows to set SOLID_CORPSE and trimesh collisions
+.float maxcontacts; // maximum number of contacts to make for this object, lesser = faster (but setting it too low will could make object pass though walls), default is 16, maximum is 32
+.float mass; // ODE mass, standart value is 1
+.vector massofs; // offsets a mass center out of object center, if not set a center of model bounds is used
+.float friction; // a friction of object, get multiplied by second objects's friction on contact
+.float bouncefactor;
+.float bouncestop;
+.float jointtype; // type of joint
+.float forcetype; // type of force
+.float erp; // error restitution parameter, makes ODE solver attempt to fix errors in contacts,
+ // bringing together 2 joints or fixing object being stuch in other object,
+ // a value of 0.1 will fix slightly, a value of 1.0 attempts to fix whole error in one frame
+ // use with care as high values makes system unstable and likely to explode
+//builtin definitions:
+void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
+void(entity e, vector force, vector force_pos) physics_addforce = #541; // deprecated, apply a force from certain origin, length of force vector is power of force
+void(entity e, vector torque) physics_addtorque = #542; // deprecated, add relative torque
+//description: provides Open Dynamics Engine support, requires extenal dll to be present or engine compiled with statical link option
+//be sure to checkextension for it to know if library is loaded and ready, also to enable physics set "physics_ode" cvar to 1
+//note: this extension is highly experimental and may be unstable
+
+//DP_SV_PRINT
+//idea: id Software (QuakeWorld Server)
+//darkplaces implementation: Black, LordHavoc
+void(string s, ...) print = #339; // same number as in EXT_CSQC
+//description:
+//this is identical to dprint except that it always prints regardless of the developer cvar.
+
+//DP_SV_PRECACHEANYTIME
+//idea: id Software (Quake2)
+//darkplaces implementation: LordHavoc
+//description:
+//this extension allows precache_model and precache_sound (and any variants) to be used during the game (with automatic messages to clients to precache the new model/sound indices), also setmodel/sound/ambientsound can be called without precaching first (they will cause an automatic precache).
+
+//DP_SV_QCSTATUS
+//idea: divVerent
+//darkplaces implementation: divVerent
+//1. A global variable
+string worldstatus;
+//Its content is set as "qcstatus" field in the rules.
+//It may be at most 255 characters, and must not contain newlines or backslashes.
+//2. A per-client field
+.string clientstatus;
+//It is sent instead of the "frags" in status responses.
+//It should always be set in a way so that stof(player.clientstatus) is a meaningful score value. Other info may be appended. If used this way, the cvar sv_status_use_qcstatus may be set to 1, and then this value will replace the frags in "status".
+//Currently, qstat does not support this and will not show player info if used and set to anything other than ftos(some integer).
+
+//DP_SV_ROTATINGBMODEL
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//this extension merely indicates that MOVETYPE_PUSH supports avelocity, allowing rotating brush models to be created, they rotate around their origin (needs rotation supporting qbsp/light utilities because id ones expected bmodel entity origins to be '0 0 0', recommend setting "origin" key in the entity fields in the map before compiling, there may be other methods depending on your qbsp, most are more complicated however).
+//tip: level designers can create a func_wall with an origin, and avelocity (for example "avelocity" "0 90 0"), and "nextthink" "99999999" to make a rotating bmodel without any qc modifications, such entities will be solid in stock quake but will not rotate)
+
+//DP_SV_SETCOLOR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(entity ent, float colors) setcolor = #401;
+//engine called QC functions (optional):
+//void(float color) SV_ChangeTeam;
+//description:
+//setcolor sets the color on a client and updates internal color information accordingly (equivalent to stuffing a "color" command but immediate)
+//SV_ChangeTeam is called by the engine whenever a "color" command is recieved, it may decide to do anything it pleases with the color passed by the client, including rejecting it (by doing nothing), or calling setcolor to apply it, preventing team changes is one use for this.
+//the color format is pants + shirt * 16 (0-255 potentially)
+
+//DP_SV_SLOWMO
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//cvars:
+//"slowmo" (0+, default 1)
+//description:
+//sets the time scale of the server, mainly intended for use in singleplayer by the player, however potentially useful for mods, so here's an extension for it.
+//range is 0 to infinite, recommended values to try are 0.1 (very slow, 10% speed), 1 (normal speed), 5 (500% speed).
+
+//DP_SV_WRITEPICTURE
+//idea: divVerent
+//darkplaces implementation: divVerent
+//builtin definitions:
+void(float to, string s, float sz) WritePicture = #501;
+//description:
+//writes a picture to the data stream so CSQC can read it using ReadPicture, which has the definition
+// string(void) ReadPicture = #501;
+//The picture data is sent as at most sz bytes, by compressing to low quality
+//JPEG. The data being sent will be equivalent to:
+// WriteString(to, s);
+// WriteShort(to, imagesize);
+// for(i = 0; i < imagesize; ++i)
+// WriteByte(to, [the i-th byte of the compressed JPEG image]);
+
+//DP_SV_WRITEUNTERMINATEDSTRING
+//idea: FrikaC
+//darkplaces implementation: Sajt
+//builtin definitions:
+void(float to, string s) WriteUnterminatedString = #456;
+//description:
+//like WriteString, but does not write a terminating 0 after the string. This means you can include things like a player's netname in the middle of a string sent over the network. Just be sure to end it up with either a call to WriteString (which includes the trailing 0) or WriteByte(0) to terminate it yourself.
+//A historical note: this extension was suggested by FrikaC years ago, more recently Shadowalker has been badmouthing LordHavoc and Spike for stealing 'his' extension writestring2 which does exactly the same thing but uses a different builtin number and name and extension string, this argument hinges on the idea that it was his idea in the first place, which is incorrect as FrikaC first suggested it and used a rough equivalent of it in his FrikBot mod years ago involving WriteByte calls on each character.
+
+//DP_TE_BLOOD
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector velocity, float howmany) te_blood = #405;
+//temp entity definitions:
+float TE_BLOOD = 50;
+//protocol:
+//vector origin
+//byte xvelocity (-128 to +127)
+//byte yvelocity (-128 to +127)
+//byte zvelocity (-128 to +127)
+//byte count (0 to 255, how much blood)
+//description:
+//creates a blood effect.
+
+//DP_TE_BLOODSHOWER
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406;
+//temp entity definitions:
+//float TE_BLOODSHOWER = 52;
+//protocol:
+//vector mins (minimum corner of the cube)
+//vector maxs (maximum corner of the cube)
+//coord explosionspeed (velocity of blood particles flying out of the center)
+//short count (number of blood particles)
+//description:
+//creates an exploding shower of blood, for making gibbings more convincing.
+
+//DP_TE_CUSTOMFLASH
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, float radius, float lifetime, vector color) te_customflash = #417;
+//temp entity definitions:
+//float TE_CUSTOMFLASH = 73;
+//protocol:
+//vector origin
+//byte radius ((MSG_ReadByte() + 1) * 8, meaning 8-2048 unit radius)
+//byte lifetime ((MSG_ReadByte() + 1) / 256.0, meaning approximately 0-1 second lifetime)
+//byte red (0.0 to 1.0 converted to 0-255)
+//byte green (0.0 to 1.0 converted to 0-255)
+//byte blue (0.0 to 1.0 converted to 0-255)
+//description:
+//creates a customized light flash.
+
+//DP_TE_EXPLOSIONRGB
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector color) te_explosionrgb = #407;
+//temp entity definitions:
+//float TE_EXPLOSIONRGB = 53;
+//protocol:
+//vector origin
+//byte red (0.0 to 1.0 converted to 0 to 255)
+//byte green (0.0 to 1.0 converted to 0 to 255)
+//byte blue (0.0 to 1.0 converted to 0 to 255)
+//description:
+//creates a colored explosion effect.
+
+//DP_TE_FLAMEJET
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector vel, float howmany) te_flamejet = #457;
+//temp entity definitions:
+//float TE_FLAMEJET = 74;
+//protocol:
+//vector origin
+//vector velocity
+//byte count (0 to 255, how many flame particles)
+//description:
+//creates a single puff of flame particles. (not very useful really)
+
+//DP_TE_PARTICLECUBE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408;
+//temp entity definitions:
+//float TE_PARTICLECUBE = 54;
+//protocol:
+//vector mins (minimum corner of the cube)
+//vector maxs (maximum corner of the cube)
+//vector velocity
+//short count
+//byte color (palette color)
+//byte gravity (TRUE or FALSE, FIXME should this be a scaler instead?)
+//coord randomvel (how much to jitter the velocity)
+//description:
+//creates a cloud of particles, useful for forcefields but quite customizable.
+
+//DP_TE_PARTICLERAIN
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409;
+//temp entity definitions:
+//float TE_PARTICLERAIN = 55;
+//protocol:
+//vector mins (minimum corner of the cube)
+//vector maxs (maximum corner of the cube)
+//vector velocity (velocity of particles)
+//short count (number of particles)
+//byte color (8bit palette color)
+//description:
+//creates a shower of rain, the rain will appear either at the top (if falling down) or bottom (if falling up) of the cube.
+
+//DP_TE_PARTICLESNOW
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410;
+//temp entity definitions:
+//float TE_PARTICLERAIN = 56;
+//protocol:
+//vector mins (minimum corner of the cube)
+//vector maxs (maximum corner of the cube)
+//vector velocity (velocity of particles)
+//short count (number of particles)
+//byte color (8bit palette color)
+//description:
+//creates a shower of snow, the snow will appear either at the top (if falling down) or bottom (if falling up) of the cube, low velocities are advisable for convincing snow.
+
+//DP_TE_PLASMABURN
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_plasmaburn = #433;
+//temp entity definitions:
+//float TE_PLASMABURN = 75;
+//protocol:
+//vector origin
+//description:
+//creates a small light flash (radius 200, time 0.2) and marks the walls.
+
+//DP_TE_QUADEFFECTS1
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_gunshotquad = #412;
+void(vector org) te_spikequad = #413;
+void(vector org) te_superspikequad = #414;
+void(vector org) te_explosionquad = #415;
+//temp entity definitions:
+//float TE_GUNSHOTQUAD = 57; // [vector] origin
+//float TE_SPIKEQUAD = 58; // [vector] origin
+//float TE_SUPERSPIKEQUAD = 59; // [vector] origin
+//float TE_EXPLOSIONQUAD = 70; // [vector] origin
+//protocol:
+//vector origin
+//description:
+//all of these just take a location, and are equivalent in function (but not appearance :) to the original TE_GUNSHOT, etc.
+
+//DP_TE_SMALLFLASH
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_smallflash = #416;
+//temp entity definitions:
+//float TE_SMALLFLASH = 72;
+//protocol:
+//vector origin
+//description:
+//creates a small light flash (radius 200, time 0.2).
+
+//DP_TE_SPARK
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector vel, float howmany) te_spark = #411;
+//temp entity definitions:
+//float TE_SPARK = 51;
+//protocol:
+//vector origin
+//byte xvelocity (-128 to 127)
+//byte yvelocity (-128 to 127)
+//byte zvelocity (-128 to 127)
+//byte count (number of sparks)
+//description:
+//creates a shower of sparks and a smoke puff.
+
+//DP_TE_STANDARDEFFECTBUILTINS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_gunshot = #418;
+void(vector org) te_spike = #419;
+void(vector org) te_superspike = #420;
+void(vector org) te_explosion = #421;
+void(vector org) te_tarexplosion = #422;
+void(vector org) te_wizspike = #423;
+void(vector org) te_knightspike = #424;
+void(vector org) te_lavasplash = #425;
+void(vector org) te_teleport = #426;
+void(vector org, float color, float colorlength) te_explosion2 = #427;
+void(entity own, vector start, vector end) te_lightning1 = #428;
+void(entity own, vector start, vector end) te_lightning2 = #429;
+void(entity own, vector start, vector end) te_lightning3 = #430;
+void(entity own, vector start, vector end) te_beam = #431;
+//description:
+//to make life easier on mod coders.
+
+//DP_TRACE_HITCONTENTSMASK_SURFACEINFO
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//globals:
+.float dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
+float trace_dpstartcontents; // DPCONTENTS_ value at start position of trace
+float trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
+float trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
+string trace_dphittexturename; // texture name of impacted surface
+//constants:
+float DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box
+float DPCONTENTS_WATER = 2;
+float DPCONTENTS_SLIME = 4;
+float DPCONTENTS_LAVA = 8;
+float DPCONTENTS_SKY = 16;
+float DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel
+float DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity
+float DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn
+float DPCONTENTS_PLAYERCLIP = 256; // blocks player movement
+float DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement
+float DPCONTENTS_DONOTENTER = 1024; // AI hint brush
+float DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA
+float DPCONTENTS_BOTCLIP = 2048; // AI hint brush
+float DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks)
+float Q3SURFACEFLAG_NODAMAGE = 1;
+float Q3SURFACEFLAG_SLICK = 2; // low friction surface
+float Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set)
+float Q3SURFACEFLAG_LADDER = 8; // climbable surface
+float Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky)
+float Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky)
+float Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact
+float Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc)
+float Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds
+float Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds
+float Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc)
+//float Q3SURFACEFLAG_DUST = 262144; // translucent 'light beam' effect (not important to qc)
+//description:
+//adds additional information after a traceline/tracebox/tracetoss call.
+//also (very important) sets trace_* globals before calling .touch functions,
+//this allows them to inspect the nature of the collision (for example
+//determining if a projectile hit sky), clears trace_* variables for the other
+//object in a touch event (that is to say, a projectile moving will see the
+//trace results in its .touch function, but the player it hit will see very
+//little information in the trace_ variables as it was not moving at the time)
+
+//DP_VIEWZOOM
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float viewzoom;
+//description:
+//scales fov and sensitivity of player, valid range is 0 to 1 (intended for sniper rifle zooming, and such)
+
+//EXT_BITSHIFT
+//idea: Spike
+//darkplaces implementation: [515]
+//builtin definitions:
+float(float number, float quantity) bitshift = #218;
+//description:
+//multiplies number by a power of 2 corresponding to quantity (0 = *1, 1 = *2, 2 = *4, 3 = *8, -1 = /2, -2 = /4x, etc), and rounds down (due to integer math) like other bit operations do (& and | and the like).
+//note: it is faster to use multiply if you are shifting by a constant, avoiding the quakec function call cost, however that does not do a floor for you.
+
+//FRIK_FILE
+//idea: FrikaC
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(string s) stof = #81; // get numerical value from a string
+float(string filename, float mode) fopen = #110; // opens a file inside quake/gamedir/data/ (mode is FILE_READ, FILE_APPEND, or FILE_WRITE), returns fhandle >= 0 if successful, or fhandle < 0 if unable to open file for any reason
+void(float fhandle) fclose = #111; // closes a file
+string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring
+void(float fhandle, string s, ...) fputs = #113; // writes a line of text to the end of the file
+float(string s) strlen = #114; // returns how many characters are in a string
+string(string s1, string s2, ...) strcat = #115; // concatenates two or more strings (for example "abc", "def" would return "abcdef") and returns as a tempstring
+string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring - see FTE_STRINGS for enhanced version
+vector(string s) stov = #117; // returns vector value from a string
+string(string s, ...) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often)
+void(string s) strunzone = #119; // removes a copy of a string from the string zone (you can not use that string again or it may crash!!!)
+//constants:
+float FILE_READ = 0;
+float FILE_APPEND = 1;
+float FILE_WRITE = 2;
+//cvars:
+//pr_zone_min_strings : default 64 (64k), min 64 (64k), max 8192 (8mb)
+//description:
+//provides text file access functions and string manipulation functions, note that you may want to set pr_zone_min_strings in the worldspawn function if 64k is not enough string zone space.
+//
+//NOTE: strzone functionality is partially superseded by
+//DP_QC_UNLIMITEDTEMPSTRINGS when longterm storage is not needed
+//NOTE: substring is upgraded by FTE_STRINGS extension with negative start/length handling identical to php 5.2.0
+
+//FTE_CSQC_SKELETONOBJECTS
+//idea: Spike, LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+// all skeleton numbers are 1-based (0 being no skeleton)
+// all bone numbers are 1-based (0 being invalid)
+float(float modlindex) skel_create = #263; // create a skeleton (be sure to assign this value into .skeletonindex for use), returns skeleton index (1 or higher) on success, returns 0 on failure (for example if the modelindex is not skeletal), it is recommended that you create a new skeleton if you change modelindex, as the skeleton uses the hierarchy from the model.
+float(float skel, entity ent, float modlindex, float retainfrac, float firstbone, float lastbone) skel_build = #264; // blend in a percentage of standard animation, 0 replaces entirely, 1 does nothing, 0.5 blends half, etc, and this only alters the bones in the specified range for which out of bounds values like 0,100000 are safe (uses .frame, .frame2, .frame3, .frame4, .lerpfrac, .lerpfrac3, .lerpfrac4, .frame1time, .frame2time, .frame3time, .frame4time), returns skel on success, 0 on failure
+float(float skel) skel_get_numbones = #265; // returns how many bones exist in the created skeleton, 0 if skeleton does not exist
+string(float skel, float bonenum) skel_get_bonename = #266; // returns name of bone (as a tempstring), "" if invalid bonenum (< 1 for example) or skeleton does not exist
+float(float skel, float bonenum) skel_get_boneparent = #267; // returns parent num for supplied bonenum, 0 if bonenum has no parent or bone does not exist (returned value is always less than bonenum, you can loop on this)
+float(float skel, string tagname) skel_find_bone = #268; // get number of bone with specified name, 0 on failure, bonenum (1-based) on success, same as using gettagindex but takes modelindex instead of entity
+vector(float skel, float bonenum) skel_get_bonerel = #269; // get matrix of bone in skeleton relative to its parent - sets v_forward, v_right, v_up, returns origin (relative to parent bone)
+vector(float skel, float bonenum) skel_get_boneabs = #270; // get matrix of bone in skeleton in model space - sets v_forward, v_right, v_up, returns origin (relative to entity)
+void(float skel, float bonenum, vector org) skel_set_bone = #271; // set matrix of bone relative to its parent, reads v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
+void(float skel, float bonenum, vector org) skel_mul_bone = #272; // transform bone matrix (relative to its parent) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bone)
+void(float skel, float startbone, float endbone, vector org) skel_mul_bones = #273; // transform bone matrices (relative to their parents) by the supplied matrix in v_forward, v_right, v_up, takes origin as parameter (relative to parent bones)
+void(float skeldst, float skelsrc, float startbone, float endbone) skel_copybones = #274; // copy bone matrices (relative to their parents) from one skeleton to another, useful for copying a skeleton to a corpse
+void(float skel) skel_delete = #275; // deletes skeleton at the beginning of the next frame (you can add the entity, delete the skeleton, renderscene, and it will still work)
+float(float modlindex, string framename) frameforname = #276; // finds number of a specified frame in the animation, returns -1 if no match found
+float(float modlindex, float framenum) frameduration = #277; // returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0.
+//fields:
+.float skeletonindex; // active skeleton overriding standard animation on model
+.float frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
+.float frame2; // secondary framegroup animation (strength = lerpfrac)
+.float frame3; // tertiary framegroup animation (strength = lerpfrac3)
+.float frame4; // quaternary framegroup animation (strength = lerpfrac4)
+.float lerpfrac; // strength of framegroup blend
+.float lerpfrac3; // strength of framegroup blend
+.float lerpfrac4; // strength of framegroup blend
+.float frame1time; // start time of framegroup animation
+.float frame2time; // start time of framegroup animation
+.float frame3time; // start time of framegroup animation
+.float frame4time; // start time of framegroup animation
+//description:
+//this extension provides a way to do complex skeletal animation on an entity.
+//
+//see also DP_SKELETONOBJECTS (this extension implemented on server as well as client)
+//
+//notes:
+//each model contains its own skeleton, reusing a skeleton with incompatible models will yield garbage (or not render).
+//each model contains its own animation data, you can use animations from other model files (for example saving out all character animations as separate model files).
+//if an engine supports loading an animation-only file format such as .md5anim in FTEQW, it can be used to animate any model with a compatible skeleton.
+//proper use of this extension may require understanding matrix transforms (v_forward, v_right, v_up, origin), and you must keep in mind that v_right is negative for this purpose.
+//
+//features include:
+//multiple animations blended together.
+//animating a model with animations from another model with a compatible skeleton.
+//restricting animation blends to certain bones of a model - for example independent animation of legs, torso, head.
+//custom bone controllers - for example making eyes track a target location.
+//
+//
+//
+//example code follows...
+//
+//this helper function lets you identify (by parentage) what group a bone
+//belongs to - for example "torso", "leftarm", would return 1 ("torso") for
+//all children of the bone named "torso", unless they are children of
+//"leftarm" (which is a child of "torso") which would return 2 instead...
+float(float skel, float bonenum, string g1, string g2, string g3, string g4, string g5, string g6) example_skel_findbonegroup =
+{
+ local string bonename;
+ while (bonenum >= 0)
+ {
+ bonename = skel_get_bonename(skel, bonenum);
+ if (bonename == g1) return 1;
+ if (bonename == g2) return 2;
+ if (bonename == g3) return 3;
+ if (bonename == g4) return 4;
+ if (bonename == g5) return 5;
+ if (bonename == g6) return 6;
+ bonenum = skel_get_boneparent(skel, bonenum);
+ }
+ return 0;
+};
+// create a skeletonindex for our player using current modelindex
+void() example_skel_player_setup =
+{
+ self.skeletonindex = skel_create(self.modelindex);
+};
+// setup bones of skeleton based on an animation
+// note: animmodelindex can be a different model than self.modelindex
+void(float animmodelindex, float framegroup, float framegroupstarttime) example_skel_player_update_begin =
+{
+ // start with our standard animation
+ self.frame = framegroup;
+ self.frame2 = 0;
+ self.frame3 = 0;
+ self.frame4 = 0;
+ self.frame1time = framegroupstarttime;
+ self.frame2time = 0;
+ self.frame3time = 0;
+ self.frame4time = 0;
+ self.lerpfrac = 0;
+ self.lerpfrac3 = 0;
+ self.lerpfrac4 = 0;
+ skel_build(self.skeletonindex, self, animmodelindex, 0, 0, 100000);
+};
+// apply a different framegroup animation to bones with a specified parent
+void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride =
+{
+ local float bonenum;
+ local float numbones;
+ self.frame = framegroup;
+ self.frame2 = 0;
+ self.frame3 = 0;
+ self.frame4 = 0;
+ self.frame1time = framegroupstarttime;
+ self.frame2time = 0;
+ self.frame3time = 0;
+ self.frame4time = 0;
+ self.lerpfrac = 0;
+ self.lerpfrac3 = 0;
+ self.lerpfrac4 = 0;
+ bonenum = 0;
+ numbones = skel_get_numbones(self.skeletonindex);
+ while (bonenum < numbones)
+ {
+ if (example_skel_findbonegroup(self.skeletonindex, bonenum, groupbonename, excludegroupname1, excludegroupname2, "", "", "") == 1)
+ skel_build(self.skeletonindex, self, animmodelindex, 1 - blendalpha, bonenum, bonenum + 1);
+ bonenum = bonenum + 1;
+ }
+};
+// make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling
+void(vector eyetarget, string bonename) example_skel_player_update_eyetarget =
+{
+ local float bonenum;
+ local vector ang;
+ local vector oldforward, oldright, oldup;
+ local vector relforward, relright, relup, relorg;
+ local vector boneforward, boneright, boneup, boneorg;
+ local vector parentforward, parentright, parentup, parentorg;
+ local vector u, v;
+ local vector modeleyetarget;
+ bonenum = skel_find_bone(self.skeletonindex, bonename) - 1;
+ if (bonenum < 0)
+ return;
+ oldforward = v_forward;
+ oldright = v_right;
+ oldup = v_up;
+ v = eyetarget - self.origin;
+ modeleyetarget_x = v * v_forward;
+ modeleyetarget_y = 0-v * v_right;
+ modeleyetarget_z = v * v_up;
+ // this is an eyeball, make it point at the target location
+ // first get all the data we can...
+ relorg = skel_get_bonerel(self.skeletonindex, bonenum);
+ relforward = v_forward;
+ relright = v_right;
+ relup = v_up;
+ boneorg = skel_get_boneabs(self.skeletonindex, bonenum);
+ boneforward = v_forward;
+ boneright = v_right;
+ boneup = v_up;
+ parentorg = skel_get_boneabs(self.skeletonindex, skel_get_boneparent(self.skeletonindex, bonenum));
+ parentforward = v_forward;
+ parentright = v_right;
+ parentup = v_up;
+ // get the vector from the eyeball to the target
+ u = modeleyetarget - boneorg;
+ // now transform it inversely by the parent matrix to produce new rel vectors
+ v_x = u * parentforward;
+ v_y = u * parentright;
+ v_z = u * parentup;
+ ang = vectoangles2(v, relup);
+ ang_x = 0 - ang_x;
+ makevectors(ang);
+ // set the relative bone matrix
+ skel_set_bone(self.skeletonindex, bonenum, relorg);
+ // restore caller's v_ vectors
+ v_forward = oldforward;
+ v_right = oldright;
+ v_up = oldup;
+};
+// delete skeleton when we're done with it
+// note: skeleton remains valid until next frame when it is really deleted
+void() example_skel_player_delete =
+{
+ skel_delete(self.skeletonindex);
+ self.skeletonindex = 0;
+};
+//
+// END OF EXAMPLES FOR FTE_CSQC_SKELETONOBJECTS
+//
+
+//KRIMZON_SV_PARSECLIENTCOMMAND
+//idea: KrimZon
+//darkplaces implementation: KrimZon, LordHavoc
+//engine-called QC prototypes:
+//void(string s) SV_ParseClientCommand;
+//builtin definitions:
+void(entity e, string s) clientcommand = #440;
+float(string s) tokenize = #441;
+string(float n) argv = #442;
+//description:
+//provides QC the ability to completely control server interpretation of client commands ("say" and "color" for example, clientcommand is necessary for this and substring (FRIK_FILE) is useful) as well as adding new commands (tokenize, argv, and stof (FRIK_FILE) are useful for this)), whenever a clc_stringcmd is received the QC function is called, and it is up to the QC to decide what (if anything) to do with it
+
+//NEH_CMD_PLAY2
+//idea: Nehahra
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports the "play2" console command (plays a sound without spatialization).
+
+//NEH_RESTOREGAME
+//idea: Nehahra
+//darkplaces implementation: LordHavoc
+//engine-called QC prototypes:
+//void() RestoreGame;
+//description:
+//when a savegame is loaded, this function is called
+
+//NEXUIZ_PLAYERMODEL
+//idea: Nexuiz
+//darkplaces implementation: Black
+//console commands:
+//playermodel <name> - FIXME: EXAMPLE NEEDED
+//playerskin <name> - FIXME: EXAMPLE NEEDED
+//field definitions:
+.string playermodel; // name of player model sent by client
+.string playerskin; // name of player skin sent by client
+//description:
+//these client properties are used by Nexuiz.
+
+//NXQ_GFX_LETTERBOX
+//idea: nxQuake
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports the "r_letterbox" console variable, set to values in the range 0-100 this restricts the view vertically (and turns off sbar and crosshair), value is a 0-100 percentage of how much to constrict the view, <=0 = normal view height, 25 = 75% of normal view height, 50 = 50%, 75 = 25%, >=100 = no view
+
+//PRYDON_CLIENTCURSOR
+//idea: FrikaC
+//darkplaces implementation: LordHavoc
+//effects bit:
+float EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten)
+//field definitions:
+.float cursor_active; // true if cl_prydoncursor mode is on
+.vector cursor_screen; // screen position of cursor as -1 to +1 in _x and _y (_z unused)
+.vector cursor_trace_start; // position of camera
+.vector cursor_trace_endpos; // position of cursor in world (as traced from camera)
+.entity cursor_trace_ent; // entity the cursor is pointing at (server forces this to world if the entity is currently free at time of receipt)
+//cvar definitions:
+//cl_prydoncursor (0/1+, default 0, 1 and above use cursors named gfx/prydoncursor%03i.lmp - or .tga and such if DP_GFX_EXTERNALTEXTURES is implemented)
+//description:
+//shows that the engine supports the cl_prydoncursor cvar, this puts a clientside mouse pointer on the screen and feeds input to the server for the QuakeC to use as it sees fit.
+//the mouse pointer triggers button4 if cursor is at left edge of screen, button5 if at right edge of screen, button6 if at top edge of screen, button7 if at bottom edge of screen.
+//the clientside trace skips transparent entities (except those marked EF_SELECTABLE).
+//the selected entity highlights only if EF_SELECTABLE is set, a typical selection method would be doubling the brightness of the entity by some means (such as colormod[] *= 2).
+//intended to be used by Prydon Gate.
+
+//TENEBRAE_GFX_DLIGHTS
+//idea: Tenebrae
+//darkplaces implementation: LordHavoc
+//fields:
+.float light_lev; // radius (does not affect brightness), typical value 350
+.vector color; // color (does not affect radius), typical value '1 1 1' (bright white), can be up to '255 255 255' (nuclear blast)
+.float style; // light style (like normal light entities, flickering torches or switchable, etc)
+.float pflags; // flags (see PFLAGS_ constants)
+.vector angles; // orientation of the light
+.float skin; // cubemap filter number, can be 1-255 (0 is assumed to be none, and tenebrae only allows 16-255), this selects a projective light filter, a value of 1 loads cubemaps/1posx.tga and cubemaps/1negx.tga and posy, negy, posz, and negz, similar to skybox but some sides need to be rotated or flipped
+//constants:
+float PFLAGS_NOSHADOW = 1; // light does not cast shadows
+float PFLAGS_CORONA = 2; // light has a corona flare
+float PFLAGS_FULLDYNAMIC = 128; // light enable (without this set no light is produced!)
+//description:
+//more powerful dynamic light settings
+//warning: it is best not to use cubemaps on a light entity that has a model, as using a skin number that a model does not have will cause issues in glquake, and produce warnings in darkplaces (use developer 1 to see them)
+//changes compared to tenebrae (because they're too 'leet' for standards):
+//note: networking should send entities with PFLAGS_FULLDYNAMIC set even if they have no model (lights in general do not have a model, nor should they)
+//EF_FULLDYNAMIC effects flag replaced by PFLAGS_FULLDYNAMIC flag (EF_FULLDYNAMIC conflicts with EF_NODRAW)
+
+//TW_SV_STEPCONTROL
+//idea: Transfusion
+//darkplaces implementation: LordHavoc
+//cvars:
+//sv_jumpstep (0/1, default 1)
+//sv_stepheight (default 18)
+//description:
+//sv_jumpstep allows stepping up onto stairs while airborn, sv_stepheight controls how high a single step can be.
+
+//FTE_QC_CHECKPVS
+//idea: Urre
+//darkplaces implementation: divVerent
+//builtin definitions:
+float checkpvs(vector viewpos, entity viewee) = #240;
+//description:
+//returns true if viewee can be seen from viewpos according to PVS data
+
+//FTE_STRINGS
+//idea: many
+//darkplaces implementation: KrimZon
+//builtin definitions:
+float(string str, string sub, float startpos) strstrofs = #221; // returns the offset into a string of the matching text, or -1 if not found, case sensitive
+float(string str, float ofs) str2chr = #222; // returns the character at the specified offset as an integer, or 0 if an invalid index, or byte value - 256 if the engine supports UTF8 and the byte is part of an extended character
+string(float c, ...) chr2str = #223; // returns a string representing the character given, if the engine supports UTF8 this may be a multi-byte sequence (length may be more than 1) for characters over 127.
+string(float ccase, float calpha, float cnum, string s, ...) strconv = #224; // reformat a string with special color characters in the font, DO NOT USE THIS ON UTF8 ENGINES (if you are lucky they will emit ^4 and such color codes instead), the parameter values are 0=same/1=lower/2=upper for ccase, 0=same/1=white/2=red/5=alternate/6=alternate-alternate for redalpha, 0=same/1=white/2=red/3=redspecial/4=whitespecial/5=alternate/6=alternate-alternate for rednum.
+string(float chars, string s, ...) strpad = #225; // pad string with spaces to a specified length, < 0 = left padding, > 0 = right padding
+string(string info, string key, string value, ...) infoadd = #226; // sets or adds a key/value pair to an infostring - note: forbidden characters are \ and "
+string(string info, string key) infoget = #227; // gets a key/value pair in an infostring, returns value or null if not found
+float(string s1, string s2) strcmp = #228; // compare two strings
+float(string s1, string s2, float len) strncmp = #228; // compare two strings up to the specified number of characters, if their length differs and is within the specified limit the result will be negative, otherwise it is the difference in value of their first non-matching character.
+float(string s1, string s2) strcasecmp = #229; // compare two strings with case-insensitive matching, characters a-z are considered equivalent to the matching A-Z character, no other differences, and this does not consider special characters equal even if they look similar
+float(string s1, string s2, float len) strncasecmp = #230; // same as strcasecmp but with a length limit, see strncmp
+//string(string s, float start, float length) substring = #116; // see note below
+//description:
+//various string manipulation functions
+//note: substring also exists in FRIK_FILE but this extension adds negative start and length as valid cases (see note above), substring is consistent with the php 5.2.0 substr function (not 5.2.3 behavior)
+//substring returns a section of a string as a tempstring, if given negative
+// start the start is measured back from the end of the string, if given a
+// negative length the length is the offset back from the end of the string to
+// stop at, rather than being relative to start, if start is negative and
+// larger than length it is treated as 0.
+// examples of substring:
+// substring("blah", -3, 3) returns "lah"
+// substring("blah", 3, 3) returns "h"
+// substring("blah", -10, 3) returns "bla"
+// substring("blah", -10, -3) returns "b"
+
+//DP_CON_BESTWEAPON
+//idea: many
+//darkplaces implementation: divVerent
+//description:
+//allows QC to register weapon properties for use by the bestweapon command, for mods that change required ammo count or type for the weapons
+//it is done using console commands sent via stuffcmd:
+// register_bestweapon quake
+// register_bestweapon clear
+// register_bestweapon <shortname> <impulse> <itemcode> <activeweaponcode> <ammostat> <ammomin>
+//for example, this is what Quake uses:
+// register_bestweapon 1 1 4096 4096 6 0 // STAT_SHELLS is 6
+// register_bestweapon 2 2 1 1 6 1
+// register_bestweapon 3 3 2 2 6 1
+// register_bestweapon 4 4 4 4 7 1 // STAT_NAILS is 7
+// register_bestweapon 5 5 8 8 7 1
+// register_bestweapon 6 6 16 16 8 1 // STAT_ROCKETS is 8
+// register_bestweapon 7 7 32 32 8 1
+// register_bestweapon 8 8 64 64 9 1 // STAT_CELLS is 9
+//after each map client initialization, this is reset back to Quake settings. So you should send these data in ClientConnect.
+//also, this extension introduces a new "cycleweapon" command to the user.
+
+//DP_QC_STRINGBUFFERS
+//idea: ??
+//darkplaces implementation: LordHavoc
+//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
+float() buf_create = #460;
+void(float bufhandle) buf_del = #461;
+float(float bufhandle) buf_getsize = #462;
+void(float bufhandle_from, float bufhandle_to) buf_copy = #463;
+void(float bufhandle, float sortpower, float backward) buf_sort = #464;
+string(float bufhandle, string glue) buf_implode = #465;
+string(float bufhandle, float string_index) bufstr_get = #466;
+void(float bufhandle, float string_index, string str) bufstr_set = #467;
+float(float bufhandle, string str, float order) bufstr_add = #468;
+void(float bufhandle, float string_index) bufstr_free = #469;
+
+//DP_QC_STRINGBUFFERS_CVARLIST
+//idea: divVerent
+//darkplaces implementation: divVerent
+//functions to list cvars and store their names into a stringbuffer
+//cvars that start with pattern but not with antipattern will be stored into the buffer
+void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517;
+
+//DP_QC_STRINGBUFFERS_EXT_WIP
+//idea: VorteX
+//darkplaces implementation: VorteX
+//constant definitions:
+const float MATCH_AUTO = 0;
+const float MATCH_WHOLE = 1;
+const float MATCH_LEFT = 2;
+const float MATCH_RIGHT = 3;
+const float MATCH_MIDDLE = 4;
+const float MATCH_PATTERN = 5;
+//builtin definitions:
+float(string filename, float bufhandle) buf_loadfile = #535; // append each line of file as new buffer string, return 1 if succesful
+float(float filehandle, float bufhandle, float startpos, float numstrings) buf_writefile = #536; // writes buffer strings as lines, returns 1 if succesful
+float(float bufhandle, string match, float matchrule, float startpos, float step) bufstr_find = #537; // returns string index
+float(string s, string pattern, float matchrule) matchpattern = #538; // returns 0/1
+float(string s, string pattern, float matchrule, float pos) matchpatternofs = #538;
+//description:
+//provides a set of functions to manipulate with string buffers
+//pattern wildcards: * - any character (or no characters), ? - any 1 character
+//Warning: This extension is work-in-progress, it may be changed/revamped/removed at any time, dont use it if you dont want any trouble
+//wip note: UTF8 is not supported yet
+
+//DP_QC_STRREPLACE
+//idea: Sajt
+//darkplaces implementation: Sajt
+//builtin definitions:
+string(string search, string replace, string subject) strreplace = #484;
+string(string search, string replace, string subject) strireplace = #485;
+//description:
+//strreplace replaces all occurrences of 'search' with 'replace' in the string 'subject', and returns the result as a tempstring.
+//strireplace does the same but uses case-insensitive matching of the 'search' term
+
+//DP_SV_SHUTDOWN
+//idea: divVerent
+//darkplaces implementation: divVerent
+//A function that gets called just before progs exit. To save persistent data from.
+//It is not called on a crash or error.
+//void SV_Shutdown();
+
+//EXT_CSQC
+// #232 void(float index, float type, .void field) SV_AddStat (EXT_CSQC)
+void(float index, float type, ...) addstat = #232;
+
+//ZQ_PAUSE
+//idea: ZQuake
+//darkplaces implementation: GreEn`mArine
+//builtin definitions:
+void(float pause) setpause = #531;
+//function definitions:
+//void(float elapsedtime) SV_PausedTic;
+//description:
+//during pause the world is not updated (time does not advance), SV_PausedTic is the only function you can be sure will be called at regular intervals during the pause, elapsedtime is the current system time in seconds since the pause started (not affected by slowmo or anything else).
+//
+//calling setpause(0) will end a pause immediately.
+//
+//Note: it is worth considering that network-related functions may be called during the pause (including customizeentityforclient for example), and it is also important to consider the continued use of the KRIMZON_SV_PARSECLIENTCOMMAND extension while paused (chatting players, etc), players may also join/leave during the pause. In other words, the only things that are not called are think and other time-related functions.
+
+//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.
+
+
+// EXPERIMENTAL (not finalized) EXTENSIONS:
+
+//DP_CRYPTO
+//idea: divVerent
+//darkplaces implementation: divVerent
+//field definitions: (SVQC)
+.string crypto_keyfp; // fingerprint of CA key the player used to authenticate
+.string crypto_mykeyfp; // fingerprint of CA key the server used to authenticate to the player
+.string crypto_idfp; // fingerprint of ID used by the player entity, or string_null if not identified
+.float crypto_idfp_signed; // set if the player's ID has been signed
+.string crypto_encryptmethod; // the string "AES128" if encrypting, and string_null if plaintext
+.string crypto_signmethod; // the string "HMAC-SHA256" if signing, and string_null if plaintext
+// there is no field crypto_myidfp, as that info contains no additional information the QC may have a use for
+//builtin definitions: (SVQC)
+float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
+//description:
+//use -1 as buffer handle to justs end delim as postdata
--- /dev/null
+///////////////////////////
+// key constants
+
+//
+// these are the key numbers that should be passed to Key_Event
+//
+float K_TAB = 9;
+float K_ENTER = 13;
+float K_ESCAPE = 27;
+float K_SPACE = 32;
+
+// normal keys should be passed as lowercased ascii
+
+float K_BACKSPACE = 127;
+float K_UPARROW = 128;
+float K_DOWNARROW = 129;
+float K_LEFTARROW = 130;
+float K_RIGHTARROW = 131;
+
+float K_ALT = 132;
+float K_CTRL = 133;
+float K_SHIFT = 134;
+
+float K_F1 = 135;
+float K_F2 = 136;
+float K_F3 = 137;
+float K_F4 = 138;
+float K_F5 = 139;
+float K_F6 = 140;
+float K_F7 = 141;
+float K_F8 = 142;
+float K_F9 = 143;
+float K_F10 = 144;
+float K_F11 = 145;
+float K_F12 = 146;
+
+float K_INS = 147;
+float K_DEL = 148;
+float K_PGDN = 149;
+float K_PGUP = 150;
+float K_HOME = 151;
+float K_END = 152;
+
+float K_NUMLOCK = 154;
+float K_CAPSLOCK = 155;
+float K_SCROLLOCK = 156;
+
+float K_KP_0 = 157;
+float K_KP_INS = 157; // same as K_KP_0
+float K_KP_1 = 158;
+float K_KP_END = 158; // same as K_KP_1
+float K_KP_2 = 159;
+float K_KP_DOWNARROW = 159; // same as K_KP_2
+float K_KP_3 = 160;
+float K_KP_PGDN = 160; // same as K_KP_3
+float K_KP_4 = 161;
+float K_KP_LEFTARROW = 161; // same as K_KP_4
+float K_KP_5 = 162;
+float K_KP_6 = 163;
+float K_KP_RIGHTARROW = 163; // same as K_KP_6
+float K_KP_7 = 164;
+float K_KP_HOME = 164; // same as K_KP_7
+float K_KP_8 = 165;
+float K_KP_UPARROW = 165; // same as K_KP_8
+float K_KP_9 = 166;
+float K_KP_PGUP = 166; // same as K_KP_9
+float K_KP_PERIOD = 167;
+float K_KP_DEL = 167; // same as K_KP_PERIOD
+float K_KP_DIVIDE = 168;
+float K_KP_SLASH = 168; // same as K_KP_DIVIDE
+float K_KP_MULTIPLY = 169;
+float K_KP_MINUS = 170;
+float K_KP_PLUS = 171;
+float K_KP_ENTER = 172;
+float K_KP_EQUALS = 173;
+
+// mouse buttons generate virtual keys
+float K_PAUSE = 153;
+
+//
+// joystick buttons
+//
+float K_JOY1 = 768;
+float K_JOY2 = 769;
+float K_JOY3 = 770;
+float K_JOY4 = 771;
+
+//
+//
+// aux keys are for multi-buttoned joysticks to generate so they can use
+// the normal binding process
+//
+float K_AUX1 = 772;
+float K_AUX2 = 773;
+float K_AUX3 = 774;
+float K_AUX4 = 775;
+float K_AUX5 = 776;
+float K_AUX6 = 777;
+float K_AUX7 = 778;
+float K_AUX8 = 779;
+float K_AUX9 = 780;
+float K_AUX10 = 781;
+float K_AUX11 = 782;
+float K_AUX12 = 783;
+float K_AUX13 = 784;
+float K_AUX14 = 785;
+float K_AUX15 = 786;
+float K_AUX16 = 787;
+float K_AUX17 = 788;
+float K_AUX18 = 789;
+float K_AUX19 = 790;
+float K_AUX20 = 791;
+float K_AUX21 = 792;
+float K_AUX22 = 793;
+float K_AUX23 = 794;
+float K_AUX24 = 795;
+float K_AUX25 = 796;
+float K_AUX26 = 797;
+float K_AUX27 = 798;
+float K_AUX28 = 799;
+float K_AUX29 = 800;
+float K_AUX30 = 801;
+float K_AUX31 = 802;
+float K_AUX32 = 803;
+
+//
+// mouse buttons generate virtual keys
+//
+float K_MOUSE1 = 512;
+float K_MOUSE2 = 513;
+float K_MOUSE3 = 514;
+float K_MWHEELUP = 515;
+float K_MWHEELDOWN = 516;
+float K_MOUSE4 = 517;
+float K_MOUSE5 = 518;
+float K_MOUSE6 = 519;
+float K_MOUSE7 = 520;
+float K_MOUSE8 = 521;
+float K_MOUSE9 = 522;
+float K_MOUSE10 = 523;
+float K_MOUSE11 = 524;
+float K_MOUSE12 = 525;
+float K_MOUSE13 = 526;
+float K_MOUSE14 = 527;
+float K_MOUSE15 = 528;
+float K_MOUSE16 = 529;
--- /dev/null
+//////////////////////////////////////////////////////////
+// sys globals
+
+entity self;
+
+/////////////////////////////////////////////////////////
+void end_sys_globals;
+/////////////////////////////////////////////////////////
+// sys fields
+
+/////////////////////////////////////////////////////////
+void end_sys_fields;
+/////////////////////////////////////////////////////////
+// sys functions
+
+void() m_init;
+void(float keynr, float ascii) m_keydown;
+void(float width, float height) m_draw;
+void(float mode) m_toggle;
+void() m_shutdown;
+// optional: float(float) m_gethostcachecategory;
+
+/////////////////////////////////////////////////////////
+// sys constants
+///////////////////////////
+// key dest constants
+
+float KEY_UNKNOWN = -1;
+float KEY_GAME = 0;
+float KEY_MENU = 2;
+float KEY_MENU_GRABBED = 3;
+
+///////////////////////////
+// file constants
+
+float FILE_READ = 0;
+float FILE_APPEND = 1;
+float FILE_WRITE = 2;
+
+///////////////////////////
+// logical constants (just for completeness)
+
+float TRUE = 1;
+float FALSE = 0;
+
+///////////////////////////
+// boolean constants
+
+float true = 1;
+float false = 0;
+
+///////////////////////////
+// msg constants
+
+float MSG_BROADCAST = 0; // unreliable to all
+float MSG_ONE = 1; // reliable to one (msg_entity)
+float MSG_ALL = 2; // reliable to all
+float MSG_INIT = 3; // write to the init string
+
+/////////////////////////////
+// mouse target constants
+
+float MT_MENU = 1;
+float MT_CLIENT = 2;
+
+/////////////////////////
+// client state constants
+
+float CS_DEDICATED = 0;
+float CS_DISCONNECTED = 1;
+float CS_CONNECTED = 2;
+
+///////////////////////////
+// blend flags
+
+float DRAWFLAG_NORMAL = 0;
+float DRAWFLAG_ADDITIVE = 1;
+float DRAWFLAG_MODULATE = 2;
+float DRAWFLAG_2XMODULATE = 3;
+
+///////////////////////////
+// null entity (actually it is the same like the world entity)
+
+entity null_entity;
+
+///////////////////////////
+// error constants
+
+// file handling
+float ERR_CANNOTOPEN = -1; // fopen
+float ERR_NOTENOUGHFILEHANDLES = -2; // fopen
+float ERR_INVALIDMODE = -3; // fopen
+float ERR_BADFILENAME = -4; // fopen
+
+// drawing functions
+
+float ERR_NULLSTRING = -1;
+float ERR_BADDRAWFLAG = -2;
+float ERR_BADSCALE = -3;
+float ERR_BADSIZE = -3; // same as ERR_BADSCALE
+float ERR_NOTCACHED = -4;
+
+// server list stuff
+float SLIST_HOSTCACHEVIEWCOUNT = 0;
+float SLIST_HOSTCACHETOTALCOUNT = 1;
+float SLIST_MASTERQUERYCOUNT = 2;
+float SLIST_MASTERREPLYCOUNT = 3;
+float SLIST_SERVERQUERYCOUNT = 4;
+float SLIST_SERVERREPLYCOUNT = 5;
+float SLIST_SORTFIELD = 6;
+float SLIST_SORTDESCENDING = 7;
+float SLIST_LEGACY_LINE1 = 1024;
+float SLIST_LEGACY_LINE2 = 1025;
+float SLIST_TEST_CONTAINS = 0;
+float SLIST_TEST_NOTCONTAIN = 1;
+float SLIST_TEST_LESSEQUAL = 2;
+float SLIST_TEST_LESS = 3;
+float SLIST_TEST_EQUAL = 4;
+float SLIST_TEST_GREATER = 5;
+float SLIST_TEST_GREATEREQUAL = 6;
+float SLIST_TEST_NOTEQUAL = 7;
+float SLIST_TEST_STARTSWITH = 8;
+float SLIST_TEST_NOTSTARTSWITH = 9;
+float SLIST_MASK_AND = 0;
+float SLIST_MASK_OR = 512;
+
+// font stuff
+float FONT_DEFAULT = 0;
+float FONT_CONSOLE = 1;
+float FONT_SBAR = 2;
+float FONT_NOTIFY = 3;
+float FONT_CHAT = 4;
+float FONT_CENTERPRINT = 5;
+float FONT_INFOBAR = 6;
+float FONT_MENU = 7;
+float FONT_USER = 8; // add to this the index, like FONT_USER+3 = user3. At least 8 of them are supported.
+float drawfont;
+
+/* not supported at the moment
+///////////////////////////
+// os constants
+
+float OS_WINDOWS = 0;
+float OS_LINUX = 1;
+float OS_MAC = 2;
+*/
+
+
+
+
+
+
+
+
+
+
+//////////////////////////////////////////////////
+// common cmd
+//////////////////////////////////////////////////
+// AK FIXME: Create perhaps a special builtin file for the common cmds
+
+void checkextension(string ext) = #1;
+
+// error cmds
+void error(string err,...) = #2;
+void objerror(string err,...) = #3;
+
+// print
+
+void print(string text,...) = #4;
+void bprint(string text,...) = #5;
+void sprint(float clientnum, string text,...) = #6;
+void centerprint(string text,...) = #7;
+
+// vector stuff
+
+vector normalize(vector v) = #8;
+float vlen(vector v) = #9;
+float vectoyaw(vector v) = #10;
+vector vectoangles(vector v) = #11;
+
+float random(void) = #12;
+
+void cmd(string command, ...) = #13;
+
+// cvar cmds
+
+float cvar(string name) = #14;
+const string str_cvar(string name) = #71;
+void cvar_set(string name, string value) = #15;
+
+void dprint(string text,...) = #16;
+
+// conversion functions
+
+string ftos(float f) = #17;
+float fabs(float f) = #18;
+string vtos(vector v) = #19;
+string etos(entity e) = #20;
+
+float stof(string val,...) = #21;
+
+entity spawn(void) = #22;
+void remove(entity e) = #23;
+
+entity find(entity start, .string field, string match) = #24;
+entity findfloat(entity start, .float field, float match) = #25;
+entity findentity(entity start, .entity field, entity match) = #25;
+
+entity findchainstring(.string field, string match) = #26;
+entity findchainfloat(.float field, float match) = #27;
+entity findchainentity(.entity field, entity match) = #27;
+
+string precache_file(string file) = #28;
+string precache_sound(string sample) = #29;
+
+void crash(void) = #72;
+void coredump(void) = #30;
+void stackdump(void) = #73;
+void traceon(void) = #31;
+void traceoff(void) = #32;
+
+void eprint(entity e) = #33;
+float rint(float f) = #34;
+float floor(float f) = #35;
+float ceil(float f) = #36;
+entity nextent(entity e) = #37;
+float sin(float f) = #38;
+float cos(float f) = #39;
+float sqrt(float f) = #40;
+vector randomvec(void) = #41;
+
+float registercvar(string name, string value, float flags) = #42; // returns 1 if success
+
+float min(float f,...) = #43;
+float max(float f,...) = #44;
+
+float bound(float min,float value, float max) = #45;
+float pow(float a, float b) = #46;
+
+void copyentity(entity src, entity dst) = #47;
+
+float fopen(string filename, float mode) = #48;
+void fclose(float fhandle) = #49;
+string fgets(float fhandle) = #50;
+void fputs(float fhandle, string s) = #51;
+
+float strlen(string s) = #52;
+string strcat(string s1,string s2,...) = #53;
+string substring(string s, float start, float length) = #54;
+
+vector stov(string s) = #55;
+
+string strzone(string s) = #56;
+void strunzone(string s) = #57;
+
+float tokenize(string s) = #58;
+string argv(float n) = #59;
+
+float isserver(void) = #60;
+float clientcount(void) = #61;
+float clientstate(void) = #62;
+void clientcommand(float client, string s) = #63;
+void changelevel(string map) = #64;
+void localsound(string sample) = #65;
+vector getmousepos(void) = #66;
+float gettime(void) = #67;
+void loadfromdata(string data) = #68;
+void loadfromfile(string file) = #69;
+
+float mod(float val, float m) = #70;
+
+float search_begin(string pattern, float caseinsensitive, float quiet) = #74;
+void search_end(float handle) = #75;
+float search_getsize(float handle) = #76;
+string search_getfilename(float handle, float num) = #77;
+
+string chr(float ascii) = #78;
+
+/////////////////////////////////////////////////
+// Write* Functions
+/////////////////////////////////////////////////
+void WriteByte(float data, float dest, float desto) = #401;
+void WriteChar(float data, float dest, float desto) = #402;
+void WriteShort(float data, float dest, float desto) = #403;
+void WriteLong(float data, float dest, float desto) = #404;
+void WriteAngle(float data, float dest, float desto) = #405;
+void WriteCoord(float data, float dest, float desto) = #406;
+void WriteString(string data, float dest, float desto)= #407;
+void WriteEntity(entity data, float dest, float desto) = #408;
+
+//////////////////////////////////////////////////
+// Draw funtions
+//////////////////////////////////////////////////
+
+float iscachedpic(string name) = #451;
+string precache_pic(string name, ...) = #452;
+void freepic(string name) = #453;
+
+float drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454;
+
+float drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #455;
+
+float drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #467;
+
+vector drawcolorcodedstring2(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #467;
+
+float drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
+
+float drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
+
+void drawsetcliparea(float x, float y, float width, float height) = #458;
+
+void drawresetcliparea(void) = #459;
+
+vector drawgetimagesize(string pic) = #460;
+
+////////////////////////////////////////////////
+// Menu functions
+////////////////////////////////////////////////
+
+void setkeydest(float dest) = #601;
+float getkeydest(void) = #602;
+
+void setmousetarget(float trg) = #603;
+float getmousetarget(void) = #604;
+
+float isfunction(string function_name) = #607;
+void callfunction(...) = #605;
+void writetofile(float fhandle, entity ent) = #606;
+vector getresolution(float number) = #608;
+string keynumtostring(float keynum) = #609;
+
+float gethostcachevalue(float type) = #611;
+string gethostcachestring(float type, float hostnr) = #612;
+
+//DP_CSQC_BINDMAPS
+//idea: daemon, motorsep
+//darkplaces implementation: divVerent
+//builtin definitions:
+string(float key, float bindmap) getkeybind_bindmap = #342;
+float(float key, string bind, float bindmap) setkeybind_bindmap = #630;
+vector(void) getbindmaps = #631;
+float(vector bm) setbindmaps = #632;
+string(string command, float bindmap) findkeysforcommand = #610;
+float(string key) stringtokeynum = #341;
+//<also allowed builtin number to match EXT_CSQC> string(float keynum) keynumtostring = #340;
+//description: key bind setting/getting including support for switchable
+//bindmaps.
+
+//DP_CRYPTO
+//idea: divVerent
+//darkplaces implementation: divVerent
+//field definitions: (MENUQC)
+string(string serveraddress) crypto_getkeyfp = #633; // retrieves the cached host key's CA fingerprint of a server given by IP address
+string(string serveraddress) crypto_getidfp = #634; // retrieves the cached host key fingerprint of a server given by IP address
+float(string serveraddress) crypto_getidstatus = #643; // retrieves the cached host key's key status. See below for CRYPTO_IDSTATUS_ defines.
+string(string serveraddress) crypto_getencryptlevel = #635; // 0 if never encrypting, 1 supported, 2 requested, 3 required, appended by list of allowed methods in order of preference ("AES128"), preceded by a space each
+string(float i) crypto_getmykeyfp = #636; // retrieves the CA key fingerprint of a given CA slot, or "" if slot is unused but more to come, or string_null if end of list
+string(float i) crypto_getmyidfp = #637; // retrieves the ID fingerprint of a given CA slot, or "" if slot is unused but more to come, or string_null if end of list
+float CRYPTO_IDSTATUS_OUTOFRANGE = -1;
+float CRYPTO_IDSTATUS_EMPTY = 0;
+float CRYPTO_IDSTATUS_UNSIGNED = 1;
+float CRYPTO_IDSTATUS_SIGNED = 2;
+float(float i) crypto_getmyidstatus = #641; // retrieves the ID's status of a given CA slot, or 0 if slot is unused but more to come, or -1 if end of list
+float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513;
+//description:
+//use -1 as buffer handle to justs end delim as postdata
+
+//DP_GECKO_SUPPORT
+//idea: Res2k, BlackHC
+//darkplaces implementation: Res2k, BlackHC
+//constant definitions:
+float GECKO_BUTTON_DOWN = 0;
+float GECKO_BUTTON_UP = 1;
+// either use down and up or just press but not all of them!
+float GECKO_BUTTON_PRESS = 2;
+// use this for mouse events if needed?
+float GECKO_BUTTON_DOUBLECLICK = 3;
+//builtin definitions:
+float gecko_create( string name ) = #487;
+void gecko_destroy( string name ) = #488;
+void gecko_navigate( string name, string URI ) = #489;
+float gecko_keyevent( string name, float key, float eventtype ) = #490;
+void gecko_mousemove( string name, float x, float y ) = #491;
+void gecko_resize( string name, float w, float h ) = #492;
+vector gecko_get_texture_extent( string name ) = #493;
+//engine-called QC prototypes:
+//string(string name, string query) Qecko_Query;
+//description:
+//provides an interface to the offscreengecko library and allows for internet browsing in games
+
+//FTE_STRINGS
+//idea: many
+//darkplaces implementation: KrimZon
+//description:
+//various string manipulation functions
+float(string str, string sub, float startpos) strstrofs = #221;
+float(string str, float ofs) str2chr = #222;
+string(float c, ...) chr2str = #223;
+string(float ccase, float calpha, float cnum, string s, ...) strconv = #224;
+string(float chars, string s, ...) strpad = #225;
+string(string info, string key, string value, ...) infoadd = #226;
+string(string info, string key) infoget = #227;
+float(string s1, string s2) strcmp = #228;
+float(string s1, string s2, float len) strncmp = #228;
+float(string s1, string s2) strcasecmp = #229;
+float(string s1, string s2, float len) strncasecmp = #230;
+
+//DP_PRECACHE_PIC_FLAGS
+//idea: divVerent
+//darkplaces implementation: divVerent
+//constant definitions:
+float PRECACHE_PIC_FROMWAD = 1; // this one actually is part of EXT_CSQC
+float PRECACHE_PIC_NOTPERSISTENT = 2; // picture may get deallocated when unused
+float PRECACHE_PIC_MIPMAP = 8; // mipmap the texture for possibly better downscaling at memory expense
+//notes: these constants are given as optional second argument to precache_pic()
+
+//DP_QC_CRC16
+//idea: div0
+//darkplaces implementation: div0
+//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol.
+//When caseinsensitive is set, the CRC is calculated of the lower cased string.
+float(float caseinsensitive, string s, ...) crc16 = #494;
+
+//DP_QC_CVAR_TYPE
+float(string name) cvar_type = #495;
+float CVAR_TYPEFLAG_EXISTS = 1;
+float CVAR_TYPEFLAG_SAVED = 2;
+float CVAR_TYPEFLAG_PRIVATE = 4;
+float CVAR_TYPEFLAG_ENGINE = 8;
+float CVAR_TYPEFLAG_HASDESCRIPTION = 16;
+float CVAR_TYPEFLAG_READONLY = 32;
+
+//DP_QC_STRINGBUFFERS
+//idea: ??
+//darkplaces implementation: LordHavoc
+//functions to manage string buffer objects - that is, arbitrary length string arrays that are handled by the engine
+float() buf_create = #440;
+void(float bufhandle) buf_del = #441;
+float(float bufhandle) buf_getsize = #442;
+void(float bufhandle_from, float bufhandle_to) buf_copy = #443;
+void(float bufhandle, float sortpower, float backward) buf_sort = #444;
+string(float bufhandle, string glue) buf_implode = #445;
+string(float bufhandle, float string_index) bufstr_get = #446;
+void(float bufhandle, float string_index, string str) bufstr_set = #447;
+float(float bufhandle, string str, float order) bufstr_add = #448;
+void(float bufhandle, float string_index) bufstr_free = #449;
+void(float bufhandle, string pattern, string antipattern) buf_cvarlist = #517;
+
+//DP_QC_STRING_CASE_FUNCTIONS
+//idea: Dresk
+//darkplaces implementation: LordHavoc / Dresk
+//builtin definitions:
+string(string s) strtolower = #480; // returns the passed in string in pure lowercase form
+string(string s) strtoupper = #481; // returns the passed in string in pure uppercase form
+//description:
+//provides simple string uppercase and lowercase functions
+
+//DP_QC_CVAR_DESCRIPTION
+//idea: divVerent
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+string(string name) cvar_description = #518;
+//description:
+//returns the description of a cvar
+
+//DP_QC_DIGEST
+//idea: motorsep, Spike
+//DarkPlaces implementation: divVerent
+//builtin definitions:
+string(string digest, string data, ...) digest_hex = #639;
+//description:
+//returns a given hex digest of given data
+//the returned digest is always encoded in hexadecimal
+//only the "MD4" digest is always supported!
+//if the given digest is not supported, string_null is returned
+//the digest string is matched case sensitively, use "MD4", not "md4"!
+
+//DP_QC_URI_ESCAPE
+//idea: div0
+//darkplaces implementation: div0
+//URI::Escape's functionality
+string(string in) uri_escape = #510;
+string(string in) uri_unescape = #511;
+
+//DP_QC_URI_GET
+//idea: divVerent
+//darkplaces implementation: divVerent
+//loads text from an URL into a string
+//returns 1 on success of initiation, 0 if there are too many concurrent
+//connections already or if the URL is invalid
+//the following callback will receive the data and MUST exist!
+// void(float id, float status, string data) URI_Get_Callback;
+//status is either
+// negative for an internal error,
+// 0 for success, or
+// the HTTP response code on server error (e.g. 404)
+//if 1 is returned by uri_get, the callback will be called in the future
+float(string url, float id) uri_get = #513;
+//DP_QC_URI_POST
+//idea: divVerent
+//darkplaces implementation: divVerent
+//loads text from an URL into a string after POSTing via HTTP
+//works like uri_get, but uri_post sends data with Content-Type: content_type to the server
+//and uri_post sends the string buffer buf, joined using the delimiter delim
+float(string url, float id, string content_type, string data) uri_post = #513;
+float(string url, float id, string content_type, string delim, float buf) uri_postbuf = #513;
+
+//DP_QC_ENTITYDATA
+//idea: KrimZon
+//darkplaces implementation: KrimZon
+//builtin definitions:
+float() numentityfields = #496;
+string(float fieldnum) entityfieldname = #497;
+float(float fieldnum) entityfieldtype = #498;
+string(float fieldnum, entity ent) getentityfieldstring = #499;
+float(float fieldnum, entity ent, string s) putentityfieldstring = #500;
+//constants:
+//Returned by entityfieldtype
+float FIELD_STRING = 1;
+float FIELD_FLOAT = 2;
+float FIELD_VECTOR = 3;
+float FIELD_ENTITY = 4;
+float FIELD_FUNCTION = 6;
+//description:
+//Versatile functions intended for storing data from specific entities between level changes, but can be customized for some kind of partial savegame.
+//WARNING: .entity fields cannot be saved and restored between map loads as they will leave dangling pointers.
+//numentityfields returns the number of entity fields. NOT offsets. Vectors comprise 4 fields: v, v_x, v_y and v_z.
+//entityfieldname returns the name as a string, eg. "origin" or "classname" or whatever.
+//entityfieldtype returns a value that the constants represent, but the field may be of another type in more exotic progs.dat formats or compilers.
+//getentityfieldstring returns data as would be written to a savegame, eg... "0.05" (float), "0 0 1" (vector), or "Hello World!" (string). Function names can also be returned.
+//putentityfieldstring puts the data returned by getentityfieldstring back into the entity.
+
+//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 undocumented extensions
+string(string, float) netaddress_resolve = #625;
+string(string search, string replace, string subject) strreplace = #484;
+string(float uselocaltime, string format, ...) strftime = #478;
+float(string s) tokenize_console = #514;
+float(float i) argv_start_index = #515;
+float(float i) argv_end_index = #516;
+string(float, float) getgamedirinfo = #626;
+#define GETGAMEDIRINFO_NAME 0
+#define GETGAMEDIRINFO_DESCRIPTION 1
+float log(float f) = #532;
+string(string format, ...) sprintf = #627;
+string(string s) strdecolorize = #477;
+entity findflags(entity start, .float field, float match) = #87;
+entity findchainflags(.float field, float match) = #88;
+float(string s, string separator1, ...) tokenizebyseparator = #479;
+float etof(entity ent) = #79;
+entity ftoe(float num) = #80;
+float validstring(string str) = #81;
+float altstr_count(string str) = #82;
+string altstr_prepare(string str) = #83;
+string altstr_get(string str, float num) = #84;
+string altstr_set(string str, float num, string set) = #85;
+string altstr_ins(string str, float num, string set) = #86;
+float isdemo() = #349;
+float drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #469;
+//vector getresolution(float number, ...) = #608; // optional argument "isfullscreen"
+void parseentitydata(entity ent, string data) = #613;
+void resethostcachemasks(void) = #615;
+void sethostcachemaskstring(float mask, float fld, string str, float op) = #616;
+void sethostcachemasknumber(float mask, float fld, float num, float op) = #617;
+void resorthostcache(void) = #618;
+float SLSF_DESCENDING = 1;
+float SLSF_FAVORITES = 2;
+float SLSF_CATEGORIES = 4;
+void sethostcachesort(float fld, float slsf) = #619;
+void refreshhostcache(...) = #620; // optional boolean argument "clear_list"
+float gethostcachenumber(float fld, float hostnr) = #621;
+float gethostcacheindexforkey(string key) = #622;
+void addwantedhostcachekey(string key) = #623;
+string getextresponse(void) = #624;
+const string cvar_string(string name) = #71;
+const string cvar_defstring(string name) = #89;
+float stringwidth(string text, float handleColors, vector size) = #468;
--- /dev/null
+/*
+==============================================================================
+
+ SOURCE FOR GLOBALVARS_T C STRUCTURE
+ MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
+
+==============================================================================
+*/
+
+//
+// system globals
+//
+entity self;
+entity other;
+entity world;
+float time;
+float frametime;
+
+float force_retouch; // force all entities to touch triggers
+ // next frame. this is needed because
+ // non-moving things don't normally scan
+ // for triggers, and when a trigger is
+ // created (like a teleport trigger), it
+ // needs to catch everything.
+ // decremented each frame, so set to 2
+ // to guarantee everything is touched
+string mapname;
+
+float deathmatch;
+float coop;
+float teamplay;
+
+float serverflags; // propagated from level to level, used to
+ // keep track of completed episodes
+
+float total_secrets;
+float total_monsters;
+
+float found_secrets; // number of secrets found
+float killed_monsters; // number of monsters killed
+
+
+// spawnparms are used to encode information about clients across server
+// level changes
+float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
+
+//
+// global variables set by built in functions
+//
+vector v_forward, v_up, v_right; // set by makevectors()
+
+// set by traceline / tracebox
+float trace_allsolid;
+float trace_startsolid;
+float trace_fraction;
+vector trace_endpos;
+vector trace_plane_normal;
+float trace_plane_dist;
+entity trace_ent;
+float trace_inopen;
+float trace_inwater;
+
+entity msg_entity; // destination of single entity writes
+
+//
+// required prog functions
+//
+void() main; // only for testing
+
+void() StartFrame;
+
+void() PlayerPreThink;
+void() PlayerPostThink;
+
+void() ClientKill;
+void() ClientConnect;
+void() PutClientInServer; // call after setting the parm1... parms
+void() ClientDisconnect;
+
+void() SetNewParms; // called when a client first connects to
+ // a server. sets parms so they can be
+ // saved off for restarts
+
+void() SetChangeParms; // call to set parms for self so they can
+ // be saved for a level transition
+
+
+//================================================
+void end_sys_globals; // flag for structure dumping
+//================================================
+
+/*
+==============================================================================
+
+ SOURCE FOR ENTVARS_T C STRUCTURE
+ MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
+
+==============================================================================
+*/
+
+//
+// system fields (*** = do not set in prog code, maintained by C code)
+//
+.float modelindex; // *** model index in the precached list
+.vector absmin, absmax; // *** origin + mins / maxs
+
+.float ltime; // local time for entity
+.float movetype;
+.float solid;
+
+.vector origin; // ***
+.vector oldorigin; // ***
+.vector velocity;
+.vector angles;
+.vector avelocity;
+
+.vector punchangle; // temp angle adjust from damage or recoil
+
+.string classname; // spawn function
+.string model;
+.float frame;
+.float skin;
+.float effects;
+
+.vector mins, maxs; // bounding box extents reletive to origin
+.vector size; // maxs - mins
+
+.void() touch;
+.void() use;
+.void() think;
+.void() blocked; // for doors or plats, called when can't push other
+
+.float nextthink;
+.entity groundentity;
+
+// stats
+.float health;
+.float frags;
+.float weapon; // one of the IT_SHOTGUN, etc flags
+.string weaponmodel;
+.float weaponframe;
+.float currentammo;
+.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
+
+.float items; // bit flags
+
+.float takedamage;
+.entity chain;
+.float deadflag;
+
+.vector view_ofs; // add to origin to get eye point
+
+
+.float button0; // fire
+.float button1; // use
+.float button2; // jump
+
+.float impulse; // weapon changes
+
+.float fixangle;
+.vector v_angle; // view / targeting angle for players
+.float idealpitch; // calculated pitch angle for lookup up slopes
+
+
+.string netname;
+
+.entity enemy;
+
+.float flags;
+
+.float colormap;
+.float team;
+
+.float max_health; // players maximum health is stored here
+
+.float teleport_time; // don't back up
+
+.float armortype; // save this fraction of incoming damage
+.float armorvalue;
+
+.float waterlevel; // 0 = not in, 1 = feet, 2 = wast, 3 = eyes
+.float watertype; // a contents value
+
+.float ideal_yaw;
+.float yaw_speed;
+
+.entity aiment;
+
+.entity goalentity; // a movetarget or an enemy
+
+.float spawnflags;
+
+.string target;
+.string targetname;
+
+// damage is accumulated through a frame. and sent as one single
+// message, so the super shotgun doesn't generate huge messages
+.float dmg_take;
+.float dmg_save;
+.entity dmg_inflictor;
+
+.entity owner; // who launched a missile
+.vector movedir; // mostly for doors, but also used for waterjump
+
+.string message; // trigger messages
+
+.float sounds; // either a cd track number or sound number
+
+.string noise, noise1, noise2, noise3; // contains names of wavs to play
+
+//================================================
+void end_sys_fields; // flag for structure dumping
+//================================================
+
+/*
+==============================================================================
+
+ CONSTANT DEFINITIONS
+
+==============================================================================
+*/
+
+
+//
+// constants
+//
+
+float FALSE = 0;
+float TRUE = 1;
+
+// edict.flags
+float FL_FLY = 1;
+float FL_SWIM = 2;
+float FL_CLIENT = 8; // set for all client edicts
+float FL_INWATER = 16; // for enter / leave water splash
+float FL_MONSTER = 32;
+float FL_GODMODE = 64; // player cheat
+float FL_NOTARGET = 128; // player cheat
+float FL_ITEM = 256; // extra wide size for bonus items
+float FL_ONGROUND = 512; // standing on something
+float FL_PARTIALGROUND = 1024; // not all corners are valid
+float FL_WATERJUMP = 2048; // player jumping out of water
+float FL_JUMPRELEASED = 4096; // for jump debouncing
+
+// edict.movetype values
+float MOVETYPE_NONE = 0; // never moves
+//float MOVETYPE_ANGLENOCLIP = 1;
+//float MOVETYPE_ANGLECLIP = 2;
+float MOVETYPE_WALK = 3; // players only
+float MOVETYPE_STEP = 4; // discrete, not real time unless fall
+float MOVETYPE_FLY = 5;
+float MOVETYPE_TOSS = 6; // gravity
+float MOVETYPE_PUSH = 7; // no clip to world, push and crush
+float MOVETYPE_NOCLIP = 8;
+float MOVETYPE_FLYMISSILE = 9; // fly with extra size against monsters
+float MOVETYPE_BOUNCE = 10;
+float MOVETYPE_BOUNCEMISSILE = 11; // bounce with extra size
+
+// edict.solid values
+float SOLID_NOT = 0; // no interaction with other objects
+float SOLID_TRIGGER = 1; // touch on edge, but not blocking
+float SOLID_BBOX = 2; // touch on edge, block
+float SOLID_SLIDEBOX = 3; // touch on edge, but not an onground
+float SOLID_BSP = 4; // bsp clip, touch on edge, block
+
+// range values
+float RANGE_MELEE = 0;
+float RANGE_NEAR = 1;
+float RANGE_MID = 2;
+float RANGE_FAR = 3;
+
+// deadflag values
+
+float DEAD_NO = 0;
+float DEAD_DYING = 1;
+float DEAD_DEAD = 2;
+float DEAD_RESPAWNABLE = 3;
+float DEAD_RESPAWNING = 4; // dead, waiting for buttons to be released
+
+// takedamage values
+
+float DAMAGE_NO = 0;
+float DAMAGE_YES = 1;
+float DAMAGE_AIM = 2;
+
+// items
+float IT_AXE = 4096;
+float IT_SHOTGUN = 1;
+float IT_SUPER_SHOTGUN = 2;
+float IT_NAILGUN = 4;
+float IT_SUPER_NAILGUN = 8;
+float IT_GRENADE_LAUNCHER = 16;
+float IT_ROCKET_LAUNCHER = 32;
+float IT_LIGHTNING = 64;
+float IT_EXTRA_WEAPON = 128;
+
+float IT_SHELLS = 256;
+float IT_NAILS = 512;
+float IT_ROCKETS = 1024;
+float IT_CELLS = 2048;
+
+float IT_ARMOR1 = 8192;
+float IT_ARMOR2 = 16384;
+float IT_ARMOR3 = 32768;
+float IT_SUPERHEALTH = 65536;
+
+float IT_KEY1 = 131072;
+float IT_KEY2 = 262144;
+
+float IT_INVISIBILITY = 524288;
+float IT_INVULNERABILITY = 1048576;
+float IT_SUIT = 2097152;
+float IT_QUAD = 4194304;
+
+// point content values
+
+float CONTENT_EMPTY = -1;
+float CONTENT_SOLID = -2;
+float CONTENT_WATER = -3;
+float CONTENT_SLIME = -4;
+float CONTENT_LAVA = -5;
+float CONTENT_SKY = -6;
+
+float STATE_TOP = 0;
+float STATE_BOTTOM = 1;
+float STATE_UP = 2;
+float STATE_DOWN = 3;
+
+vector VEC_ORIGIN = '0 0 0';
+vector VEC_HULL_MIN = '-16 -16 -24';
+vector VEC_HULL_MAX = '16 16 32';
+
+vector VEC_HULL2_MIN = '-32 -32 -24';
+vector VEC_HULL2_MAX = '32 32 64';
+
+// protocol bytes
+float SVC_TEMPENTITY = 23;
+float SVC_KILLEDMONSTER = 27;
+float SVC_FOUNDSECRET = 28;
+float SVC_INTERMISSION = 30;
+float SVC_FINALE = 31;
+float SVC_CDTRACK = 32;
+float SVC_SELLSCREEN = 33;
+
+
+float TE_SPIKE = 0;
+float TE_SUPERSPIKE = 1;
+float TE_GUNSHOT = 2;
+float TE_EXPLOSION = 3;
+float TE_TAREXPLOSION = 4;
+float TE_LIGHTNING1 = 5;
+float TE_LIGHTNING2 = 6;
+float TE_WIZSPIKE = 7;
+float TE_KNIGHTSPIKE = 8;
+float TE_LIGHTNING3 = 9;
+float TE_LAVASPLASH = 10;
+float TE_TELEPORT = 11;
+
+// sound channels
+// channel 0 never willingly overrides
+// other channels (1-7) allways override a playing sound on that channel
+float CHAN_AUTO = 0;
+float CHAN_WEAPON = 1;
+float CHAN_VOICE = 2;
+float CHAN_ITEM = 3;
+float CHAN_BODY = 4;
+
+float ATTN_NONE = 0;
+float ATTN_NORM = 1;
+float ATTN_IDLE = 2;
+float ATTN_STATIC = 3;
+
+// update types
+
+float UPDATE_GENERAL = 0;
+float UPDATE_STATIC = 1;
+float UPDATE_BINARY = 2;
+float UPDATE_TEMP = 3;
+
+// entity effects
+
+float EF_BRIGHTFIELD = 1;
+float EF_MUZZLEFLASH = 2;
+float EF_BRIGHTLIGHT = 4;
+float EF_DIMLIGHT = 8;
+
+
+// messages
+float MSG_BROADCAST = 0; // unreliable to all
+float MSG_ONE = 1; // reliable to one (msg_entity)
+float MSG_ALL = 2; // reliable to all
+float MSG_INIT = 3; // write to the init string
+
+//===========================================================================
+
+//
+// builtin functions
+//
+
+void(vector ang) makevectors = #1; // sets v_forward, etc globals
+void(entity e, vector o) setorigin = #2;
+void(entity e, string m) setmodel = #3; // set movetype and solid first
+void(entity e, vector min, vector max) setsize = #4;
+// #5 was removed
+void() break_to_debugger = #6;
+float() random = #7; // returns 0 - 1
+void(entity e, float chan, string samp, float vol, float atten) sound = #8;
+vector(vector v) normalize = #9;
+void(string e, ...) error = #10;
+void(string e, ...) objerror = #11;
+float(vector v) vlen = #12;
+float(vector v) vectoyaw = #13;
+entity() spawn = #14;
+void(entity e) remove = #15;
+
+// sets trace_* globals
+// nomonsters can be:
+// An entity will also be ignored for testing if forent == test,
+// forent->owner == test, or test->owner == forent
+// a forent of world is ignored
+void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
+
+entity() checkclient = #17; // returns a client to look for
+entity(entity start, .string fld, string match) find = #18;
+string(string s) precache_sound = #19;
+string(string s) precache_model = #20;
+void(entity client, string s, ...)stuffcmd = #21;
+entity(vector org, float rad) findradius = #22;
+void(string s, ...) bprint = #23;
+void(entity client, string s, ...) sprint = #24;
+void(string s, ...) dprint = #25;
+string(float f) ftos = #26;
+string(vector v) vtos = #27;
+void() coredump = #28; // prints all edicts
+void() traceon = #29; // turns statment trace on
+void() traceoff = #30;
+void(entity e) eprint = #31; // prints an entire edict
+float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE
+// #33 was removed
+float() droptofloor= #34; // TRUE if landed on floor
+void(float style, string value) lightstyle = #35;
+float(float v) rint = #36; // round to nearest int
+float(float v) floor = #37; // largest integer <= v
+float(float v) ceil = #38; // smallest integer >= v
+// #39 was removed
+float(entity e) checkbottom = #40; // true if self is on ground
+float(vector v) pointcontents = #41; // returns a CONTENT_*
+// #42 was removed
+float(float f) fabs = #43;
+vector(entity e, float speed) aim = #44; // returns the shooting vector
+float(string s) cvar = #45; // return cvar.value
+void(string s, ...) localcmd = #46; // put string into local que
+entity(entity e) nextent = #47; // for looping through all ents
+void(vector o, vector d, float color, float count) particle = #48;// start a particle effect
+void() ChangeYaw = #49; // turn towards self.ideal_yaw
+ // at self.yaw_speed
+// #50 was removed
+vector(vector v) vectoangles = #51;
+
+//
+// direct client message generation
+//
+void(float to, float f) WriteByte = #52;
+void(float to, float f) WriteChar = #53;
+void(float to, float f) WriteShort = #54;
+void(float to, float f) WriteLong = #55;
+void(float to, float f) WriteCoord = #56;
+void(float to, float f) WriteAngle = #57;
+void(float to, string s, ...) WriteString = #58;
+void(float to, entity s) WriteEntity = #59;
+
+//
+// broadcast client message generation
+//
+
+// void(float f) bWriteByte = #59;
+// void(float f) bWriteChar = #60;
+// void(float f) bWriteShort = #61;
+// void(float f) bWriteLong = #62;
+// void(float f) bWriteCoord = #63;
+// void(float f) bWriteAngle = #64;
+// void(string s) bWriteString = #65;
+// void(entity e) bWriteEntity = #66;
+
+void(float step) movetogoal = #67;
+
+string(string s) precache_file = #68; // no effect except for -copy
+void(entity e) makestatic = #69;
+void(string s) changelevel = #70;
+
+//#71 was removed
+
+void(string var, string val) cvar_set = #72; // sets cvar.value
+
+void(entity client, string s, ...) centerprint = #73; // sprint, but in middle
+
+void(vector pos, string samp, float vol, float atten) ambientsound = #74;
+
+string(string s) precache_model2 = #75; // registered version only
+string(string s) precache_sound2 = #76; // registered version only
+string(string s) precache_file2 = #77; // registered version only
+
+void(entity e) setspawnparms = #78; // set parm1... to the
+ // values at level start
+ // for coop respawn
+
+//============================================================================
--- /dev/null
+#ifndef CLIENT___H
+#define CLIENT___H
+
+#include "../dpdefs/menudefs.qh"
+#include "../dpdefs/keycodes.qh"
+
+#endif
-#ifdef INTERFACE
-CLASS(Animation) EXTENDS(Object)
+#ifndef ANIM_ANIMATION_H
+#define ANIM_ANIMATION_H
+#include "../oo/base.qh"
+void setterDummy(entity, float);
+CLASS(Animation, Object)
METHOD(Animation, configureAnimation, void(entity, entity, void(entity, float), float, float, float, float))
METHOD(Animation, setTimeStartEnd, void(entity, float, float))
METHOD(Animation, setTimeStartDuration, void(entity, float, float))
ATTRIB(Animation, stopped, float, false)
ATTRIB(Animation, finished, float, false)
ENDCLASS(Animation)
-void setterDummy(entity, float);
#endif
#ifdef IMPLEMENTATION
#include "../menu.qh"
-#ifdef INTERFACE
-CLASS(AnimHost) EXTENDS(Object)
+#ifndef ANIM_ANIMHOST_H
+#define ANIM_ANIMHOST_H
+#include "../oo/base.qh"
+CLASS(AnimHost, Object)
METHOD(AnimHost, addAnim, void(entity, entity))
METHOD(AnimHost, removeAnim, void(entity, entity))
METHOD(AnimHost, removeAllAnim, void(entity))
-#ifdef INTERFACE
-CLASS(Easing) EXTENDS(Animation)
- METHOD(Easing, calcValue, float(entity, float, float, float, float))
- METHOD(Easing, setMath, void(entity, float(float, float, float, float)))
- ATTRIB(Easing, math, float(float, float, float, float), easingLinear)
-ENDCLASS(Easing)
+#ifndef ANIM_EASING_H
+#define ANIM_EASING_H
+#include "animation.qc"
entity makeHostedEasing(entity, void(entity, float), float(float, float, float, float), float, float, float);
entity makeEasing(entity, void(entity, float), float(float, float, float, float), float, float, float, float);
float easingLinear(float, float, float, float);
float easingQuadIn(float, float, float, float);
float easingQuadOut(float, float, float, float);
float easingQuadInOut(float, float, float, float);
+CLASS(Easing, Animation)
+ METHOD(Easing, calcValue, float(entity, float, float, float, float))
+ METHOD(Easing, setMath, void(entity, float(float, float, float, float)))
+ ATTRIB(Easing, math, float(float, float, float, float), easingLinear)
+ENDCLASS(Easing)
#endif
#ifdef IMPLEMENTATION
entity makeEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animStartTime, float animDuration, float animStartValue, float animEnd)
{
entity me;
- me = spawnEasing();
+ me = NEW(Easing);
me.configureAnimation(me, obj, objSetter, animStartTime, animDuration, animStartValue, animEnd);
me.setMath(me, func);
return me;
-#ifdef INTERFACE
-CLASS(Keyframe) EXTENDS(Animation)
+#ifndef ANIM_KEYFRAME_H
+#define ANIM_KEYFRAME_H
+#include "animation.qc"
+CLASS(Keyframe, Animation)
METHOD(Keyframe, addEasing, entity(entity, float, float, float(float, float, float, float)))
METHOD(Keyframe, addAnim, void(entity, entity))
METHOD(Keyframe, calcValue, float(entity, float, float, float, float))
entity makeKeyframe(entity obj, void(entity, float) objSetter, float animDuration, float animStart, float animEnd)
{
entity me;
- me = spawnKeyframe();
+ me = NEW(Keyframe);
me.configureAnimation(me, obj, objSetter, time, animDuration, animStart, animEnd);
return me;
}
--- /dev/null
+#include "anim/animation.qc"
+#include "anim/animhost.qc"
+#include "anim/easing.qc"
+#include "anim/keyframe.qc"
+
+#include "item.qc"
+#include "item/borderimage.qc"
+#include "item/button.qc"
+#include "item/checkbox.qc"
+#include "item/container.qc"
+#include "item/dialog.qc"
+#include "item/image.qc"
+#include "item/inputbox.qc"
+#include "item/inputcontainer.qc"
+#include "item/label.qc"
+#include "item/listbox.qc"
+#include "item/modalcontroller.qc"
+#include "item/nexposee.qc"
+#include "item/radiobutton.qc"
+#include "item/slider.qc"
+#include "item/tab.qc"
+#include "item/textslider.qc"
+
+#include "xonotic/bigbutton.qc"
+#include "xonotic/bigcommandbutton.qc"
+#include "xonotic/button.qc"
+#include "xonotic/campaign.qc"
+#include "xonotic/charmap.qc"
+#include "xonotic/checkbox.qc"
+#include "xonotic/checkbox_slider_invalid.qc"
+#include "xonotic/checkbox_string.qc"
+#include "xonotic/colorbutton.qc"
+#include "xonotic/colorpicker.qc"
+#include "xonotic/colorpicker_string.qc"
+#include "xonotic/commandbutton.qc"
+#include "xonotic/credits.qc"
+#include "xonotic/crosshairbutton.qc"
+#include "xonotic/cvarlist.qc"
+#include "xonotic/demolist.qc"
+#include "xonotic/dialog.qc"
+#include "xonotic/dialog_credits.qc"
+#include "xonotic/dialog_firstrun.qc"
+#include "xonotic/dialog_hudpanel_ammo.qc"
+#include "xonotic/dialog_hudpanel_buffs.qc"
+#include "xonotic/dialog_hudpanel_centerprint.qc"
+#include "xonotic/dialog_hudpanel_chat.qc"
+#include "xonotic/dialog_hudpanel_engineinfo.qc"
+#include "xonotic/dialog_hudpanel_healtharmor.qc"
+#include "xonotic/dialog_hudpanel_infomessages.qc"
+#include "xonotic/dialog_hudpanel_modicons.qc"
+#include "xonotic/dialog_hudpanel_notification.qc"
+#include "xonotic/dialog_hudpanel_physics.qc"
+#include "xonotic/dialog_hudpanel_powerups.qc"
+#include "xonotic/dialog_hudpanel_pressedkeys.qc"
+#include "xonotic/dialog_hudpanel_racetimer.qc"
+#include "xonotic/dialog_hudpanel_radar.qc"
+#include "xonotic/dialog_hudpanel_score.qc"
+#include "xonotic/dialog_hudpanel_timer.qc"
+#include "xonotic/dialog_hudpanel_vote.qc"
+#include "xonotic/dialog_hudpanel_weapons.qc"
+#include "xonotic/dialog_hudsetup_exit.qc"
+#include "xonotic/dialog_monstertools.qc"
+#include "xonotic/dialog_multiplayer.qc"
+#include "xonotic/dialog_multiplayer_create.qc"
+#include "xonotic/dialog_multiplayer_create_mapinfo.qc"
+#include "xonotic/dialog_multiplayer_create_mutators.qc"
+#include "xonotic/dialog_multiplayer_join.qc"
+#include "xonotic/dialog_multiplayer_join_serverinfo.qc"
+#include "xonotic/dialog_multiplayer_media.qc"
+#include "xonotic/dialog_multiplayer_media_demo.qc"
+#include "xonotic/dialog_multiplayer_media_demo_startconfirm.qc"
+#include "xonotic/dialog_multiplayer_media_demo_timeconfirm.qc"
+#include "xonotic/dialog_multiplayer_media_musicplayer.qc"
+#include "xonotic/dialog_multiplayer_media_screenshot.qc"
+#include "xonotic/dialog_multiplayer_media_screenshot_viewer.qc"
+#include "xonotic/dialog_multiplayer_profile.qc"
+#include "xonotic/dialog_quit.qc"
+#include "xonotic/dialog_sandboxtools.qc"
+#include "xonotic/dialog_settings.qc"
+#include "xonotic/dialog_settings_audio.qc"
+#include "xonotic/dialog_settings_effects.qc"
+#include "xonotic/dialog_settings_game.qc"
+#include "xonotic/dialog_settings_game_crosshair.qc"
+#include "xonotic/dialog_settings_game_hudconfirm.qc"
+#include "xonotic/dialog_settings_game_hud.qc"
+#include "xonotic/dialog_settings_game_messages.qc"
+#include "xonotic/dialog_settings_game_model.qc"
+#include "xonotic/dialog_settings_game_view.qc"
+#include "xonotic/dialog_settings_game_weapons.qc"
+#include "xonotic/dialog_settings_input.qc"
+#include "xonotic/dialog_settings_input_userbind.qc"
+#include "xonotic/dialog_settings_misc.qc"
+#include "xonotic/dialog_settings_misc_cvars.qc"
+#include "xonotic/dialog_settings_misc_reset.qc"
+#include "xonotic/dialog_settings_user.qc"
+#include "xonotic/dialog_settings_user_languagewarning.qc"
+#include "xonotic/dialog_settings_video.qc"
+#include "xonotic/dialog_singleplayer.qc"
+#include "xonotic/dialog_singleplayer_winner.qc"
+#include "xonotic/dialog_teamselect.qc"
+#include "xonotic/gametypelist.qc"
+#include "xonotic/image.qc"
+#include "xonotic/inputbox.qc"
+#include "xonotic/keybinder.qc"
+#include "xonotic/languagelist.qc"
+#include "xonotic/listbox.qc"
+#include "xonotic/mainwindow.qc"
+#include "xonotic/maplist.qc"
+#include "xonotic/nexposee.qc"
+#include "xonotic/playerlist.qc"
+#include "xonotic/playermodel.qc"
+#include "xonotic/playlist.qc"
+#include "xonotic/radiobutton.qc"
+#include "xonotic/rootdialog.qc"
+#include "xonotic/screenshotimage.qc"
+#include "xonotic/screenshotlist.qc"
+#include "xonotic/serverlist.qc"
+#include "xonotic/skinlist.qc"
+#include "xonotic/slider.qc"
+#include "xonotic/slider_decibels.qc"
+#include "xonotic/slider_particles.qc"
+#include "xonotic/slider_picmip.qc"
+#include "xonotic/slider_resolution.qc"
+#include "xonotic/slider_sbfadetime.qc"
+#include "xonotic/soundlist.qc"
+#include "xonotic/statslist.qc"
+#include "xonotic/tabcontroller.qc"
+#include "xonotic/tab.qc"
+#include "xonotic/textlabel.qc"
+#include "xonotic/textslider.qc"
+#include "xonotic/weaponarenacheckbox.qc"
+#include "xonotic/weaponslist.qc"
+++ /dev/null
-#include "anim/animhost.qc"
-#include "anim/animation.qc"
-#include "anim/easing.qc"
-#include "anim/keyframe.qc"
-#include "item.qc"
-#include "item/container.qc"
-#include "item/inputcontainer.qc"
-#include "item/nexposee.qc"
-#include "item/modalcontroller.qc"
-#include "item/image.qc"
-#include "item/label.qc"
-#include "item/button.qc"
-#include "item/checkbox.qc"
-#include "item/radiobutton.qc"
-#include "item/borderimage.qc"
-#include "item/slider.qc"
-#include "item/dialog.qc"
-#include "item/tab.qc"
-#include "item/textslider.qc"
-#include "item/listbox.qc"
-#include "item/inputbox.qc"
-#include "xonotic/dialog.qc"
-#include "xonotic/tab.qc"
-#include "xonotic/mainwindow.qc"
-#include "xonotic/button.qc"
-#include "xonotic/bigbutton.qc"
-#include "xonotic/commandbutton.qc"
-#include "xonotic/bigcommandbutton.qc"
-#include "xonotic/textlabel.qc"
-#include "xonotic/dialog_firstrun.qc"
-#include "xonotic/dialog_teamselect.qc"
-#include "xonotic/dialog_sandboxtools.qc"
-#include "xonotic/dialog_monstertools.qc"
-#include "xonotic/dialog_settings.qc"
-#include "xonotic/dialog_settings_video.qc"
-#include "xonotic/dialog_settings_effects.qc"
-#include "xonotic/dialog_settings_audio.qc"
-#include "xonotic/dialog_settings_game.qc"
-#include "xonotic/dialog_settings_user.qc"
-#include "xonotic/dialog_settings_user_languagewarning.qc"
-#include "xonotic/dialog_settings_misc.qc"
-#include "xonotic/dialog_multiplayer.qc"
-#include "xonotic/dialog_multiplayer_profile.qc"
-#include "xonotic/tabcontroller.qc"
-#include "xonotic/slider.qc"
-#include "xonotic/slider_resolution.qc"
-#include "xonotic/checkbox.qc"
-#include "xonotic/checkbox_string.qc"
-#include "xonotic/weaponarenacheckbox.qc"
-#include "xonotic/radiobutton.qc"
-#include "xonotic/nexposee.qc"
-#include "xonotic/rootdialog.qc"
-#include "xonotic/textslider.qc"
-#include "xonotic/colorbutton.qc"
-#include "xonotic/dialog_multiplayer_join.qc"
-#include "xonotic/dialog_multiplayer_join_serverinfo.qc"
-#include "xonotic/playerlist.qc"
-#include "xonotic/listbox.qc"
-#include "xonotic/serverlist.qc"
-#include "xonotic/inputbox.qc"
-#include "xonotic/dialog_quit.qc"
-#include "xonotic/dialog_multiplayer_create.qc"
-#include "xonotic/dialog_multiplayer_create_mutators.qc"
-#include "xonotic/dialog_multiplayer_create_mapinfo.qc"
-#include "xonotic/gametypelist.qc"
-#include "xonotic/maplist.qc"
-#include "xonotic/skinlist.qc"
-#include "xonotic/languagelist.qc"
-#include "xonotic/image.qc"
-#include "xonotic/crosshairbutton.qc"
-#include "xonotic/playermodel.qc"
-#include "xonotic/checkbox_slider_invalid.qc"
-#include "xonotic/charmap.qc"
-#include "xonotic/keybinder.qc"
-#include "xonotic/dialog_settings_input.qc"
-#include "xonotic/dialog_settings_input_userbind.qc"
-#include "xonotic/slider_decibels.qc"
-#include "xonotic/dialog_singleplayer.qc"
-#include "xonotic/campaign.qc"
-#include "xonotic/dialog_singleplayer_winner.qc"
-#include "xonotic/dialog_credits.qc"
-#include "xonotic/credits.qc"
-#include "xonotic/dialog_settings_game_crosshair.qc"
-#include "xonotic/dialog_settings_game_hud.qc"
-#include "xonotic/dialog_settings_game_hudconfirm.qc"
-#include "xonotic/dialog_settings_game_model.qc"
-#include "xonotic/dialog_settings_game_messages.qc"
-#include "xonotic/dialog_settings_game_view.qc"
-#include "xonotic/dialog_settings_game_weapons.qc"
-#include "xonotic/weaponslist.qc"
-#include "xonotic/dialog_multiplayer_media.qc"
-#include "xonotic/dialog_multiplayer_media_demo.qc"
-#include "xonotic/dialog_multiplayer_media_demo_startconfirm.qc"
-#include "xonotic/dialog_multiplayer_media_demo_timeconfirm.qc"
-#include "xonotic/demolist.qc"
-#include "xonotic/screenshotimage.qc"
-#include "xonotic/dialog_multiplayer_media_screenshot.qc"
-#include "xonotic/dialog_multiplayer_media_screenshot_viewer.qc"
-#include "xonotic/screenshotlist.qc"
-#include "xonotic/statslist.qc"
-#include "xonotic/dialog_multiplayer_media_musicplayer.qc"
-#include "xonotic/soundlist.qc"
-#include "xonotic/playlist.qc"
-#include "xonotic/colorpicker.qc"
-#include "xonotic/colorpicker_string.qc"
-#include "xonotic/cvarlist.qc"
-#include "xonotic/dialog_settings_misc_cvars.qc"
-#include "xonotic/dialog_hudsetup_exit.qc"
-#include "xonotic/dialog_hudpanel_notification.qc"
-#include "xonotic/dialog_hudpanel_ammo.qc"
-#include "xonotic/dialog_hudpanel_healtharmor.qc"
-#include "xonotic/dialog_hudpanel_powerups.qc"
-#include "xonotic/dialog_hudpanel_racetimer.qc"
-#include "xonotic/dialog_hudpanel_pressedkeys.qc"
-#include "xonotic/dialog_hudpanel_radar.qc"
-#include "xonotic/dialog_hudpanel_score.qc"
-#include "xonotic/dialog_hudpanel_timer.qc"
-#include "xonotic/dialog_hudpanel_vote.qc"
-#include "xonotic/dialog_hudpanel_modicons.qc"
-#include "xonotic/dialog_hudpanel_chat.qc"
-#include "xonotic/dialog_hudpanel_engineinfo.qc"
-#include "xonotic/dialog_hudpanel_infomessages.qc"
-#include "xonotic/dialog_hudpanel_weapons.qc"
-#include "xonotic/dialog_hudpanel_physics.qc"
-#include "xonotic/dialog_hudpanel_centerprint.qc"
-#include "xonotic/dialog_hudpanel_buffs.qc"
-#include "xonotic/slider_picmip.qc"
-#include "xonotic/slider_particles.qc"
-#include "xonotic/slider_sbfadetime.qc"
-#include "xonotic/dialog_settings_misc_reset.qc"
--- /dev/null
+#include "../menu.qh"
+
+#include "../../common/command/commands.qc"
+
+#include "menu_cmd.qc"
--- /dev/null
+#ifndef MENU_COMMANDS_H
+#define MENU_COMMANDS_H
+
+#include "../../common/command/commands.qh"
+
+#include "menu_cmd.qh"
+
+#endif
#include "menu_cmd.qh"
+#include "../menu.qh"
+#include "../oo/classes.qc"
+
#include "../../common/command/generic.qh"
+.entity firstChild, nextSibling;
+
string _dumptree_space;
void _dumptree_open(entity pass, entity me)
{
}
}
+float updateConwidths(float width, float height, float pixelheight);
+
void GameCommand(string theCommand)
{
float argc;
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "draw.qh"
+#include "../common/util.qh"
+#include "../common/constants.qh"
string draw_mousepointer;
vector draw_mousepointer_offset;
-#ifdef INTERFACE
-CLASS(Item) EXTENDS(Object)
+#ifndef ITEM_H
+#define ITEM_H
+#include "skin.qh"
+#include "oo/base.qh"
+CLASS(Item, Object)
METHOD(Item, draw, void(entity))
METHOD(Item, keyDown, float(entity, float, float, float))
METHOD(Item, keyUp, float(entity, float, float, float))
-#ifdef INTERFACE
-CLASS(BorderImage) EXTENDS(Label)
+#ifndef ITEM_BORDERIMAGE_H
+#define ITEM_BORDERIMAGE_H
+#include "label.qc"
+CLASS(BorderImage, Label)
METHOD(BorderImage, configureBorderImage, void(entity, string, float, vector, string, float))
METHOD(BorderImage, resizeNotify, void(entity, vector, vector, vector, vector))
METHOD(BorderImage, recalcPositionWithText, void(entity, string))
-#ifdef INTERFACE
-CLASS(Button) EXTENDS(Label)
+#ifndef ITEM_BUTTON_H
+#define ITEM_BUTTON_H
+#include "label.qc"
+CLASS(Button, Label)
METHOD(Button, configureButton, void(entity, string, float, string))
METHOD(Button, draw, void(entity))
METHOD(Button, showNotify, void(entity))
-#ifdef INTERFACE
+#ifndef ITEM_CHECKBOX_H
+#define ITEM_CHECKBOX_H
+#include "button.qc"
void CheckBox_Click(entity me, entity other);
-CLASS(CheckBox) EXTENDS(Button)
+CLASS(CheckBox, Button)
METHOD(CheckBox, configureCheckBox, void(entity, string, float, string))
METHOD(CheckBox, draw, void(entity))
METHOD(CheckBox, playClickSound, void(entity))
-#ifdef INTERFACE
-CLASS(Container) EXTENDS(Item)
+#ifndef ITEM_CONTAINER_H
+#define ITEM_CONTAINER_H
+#include "../item.qc"
+CLASS(Container, Item)
METHOD(Container, draw, void(entity))
METHOD(Container, keyUp, float(entity, float, float, float))
METHOD(Container, keyDown, float(entity, float, float, float))
float d;
for(e = me.firstChild; e; e = e.nextSibling)
{
- o = e.originField;
- s = e.sizeField;
- me.enterLieSubitem(me, o, s, e.fontScaleField, e.Container_alpha);
+ o = e.(originField);
+ s = e.(sizeField);
+ me.enterLieSubitem(me, o, s, e.(fontScaleField), e.Container_alpha);
e.resizeNotify(e, o, s, boxToGlobal(o, absOrigin, absSize), boxToGlobalSize(s, absSize));
me.leaveSubitem(me);
}
{
e.resized = 0;
d = 1;
- o = e.originField;
- s = e.sizeField;
- me.enterLieSubitem(me, o, s, e.fontScaleField, e.Container_alpha);
+ o = e.(originField);
+ s = e.(sizeField);
+ me.enterLieSubitem(me, o, s, e.(fontScaleField), e.Container_alpha);
e.resizeNotify(e, o, s, boxToGlobal(o, absOrigin, absSize), boxToGlobalSize(s, absSize));
me.leaveSubitem(me);
}
//
// a subclass may help with using this as a tab
-#ifdef INTERFACE
-CLASS(Dialog) EXTENDS(InputContainer)
+#ifndef ITEM_DIALOG_H
+#define ITEM_DIALOG_H
+#include "inputcontainer.qc"
+CLASS(Dialog, InputContainer)
METHOD(Dialog, configureDialog, void(entity)) // no runtime configuration, all parameters are given in the code!
METHOD(Dialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
METHOD(Dialog, keyDown, float(entity, float, float, float))
{
float absWidth, absHeight;
- me.frame = spawnBorderImage();
+ me.frame = NEW(BorderImage);
me.frame.configureBorderImage(me.frame, me.title, me.titleFontSize, me.color, me.backgroundImage, me.borderLines * me.titleHeight);
me.frame.zoomedOutTitleBarPosition = me.zoomedOutTitleBarPosition;
me.frame.zoomedOutTitleBar = me.zoomedOutTitleBar;
if(me.closable && me.borderLines > 0)
{
entity closebutton;
- closebutton = me.closeButton = me.frame.closeButton = spawnButton();
+ closebutton = me.closeButton = me.frame.closeButton = NEW(Button);
closebutton.configureButton(closebutton, "", 0, me.closeButtonImage);
closebutton.onClick = Dialog_Close; closebutton.onClickEntity = me;
closebutton.srcMulti = 0;
-#ifdef INTERFACE
-CLASS(Image) EXTENDS(Item)
+#ifndef ITEM_IMAGE_H
+#define ITEM_IMAGE_H
+#include "../item.qc"
+CLASS(Image, Item)
METHOD(Image, configureImage, void(entity, string))
METHOD(Image, draw, void(entity))
METHOD(Image, toString, string(entity))
-#ifdef INTERFACE
-CLASS(InputBox) EXTENDS(Label)
+#ifndef ITEM_INPUTBOX_H
+#define ITEM_INPUTBOX_H
+#include "label.qc"
+CLASS(InputBox, Label)
METHOD(InputBox, configureInputBox, void(entity, string, float, float, string))
METHOD(InputBox, draw, void(entity))
METHOD(InputBox, setText, void(entity, string))
-#ifdef INTERFACE
-CLASS(InputContainer) EXTENDS(Container)
+#ifndef ITEM_INPUTCONTAINER_H
+#define ITEM_INPUTCONTAINER_H
+#include "container.qc"
+CLASS(InputContainer, Container)
METHOD(InputContainer, keyDown, float(entity, float, float, float))
METHOD(InputContainer, mouseMove, float(entity, vector))
METHOD(InputContainer, mousePress, float(entity, vector))
-#ifdef INTERFACE
-CLASS(Label) EXTENDS(Item)
+#ifndef ITEM_LABEL_H
+#define ITEM_LABEL_H
+#include "../item.qc"
+CLASS(Label, Item)
METHOD(Label, configureLabel, void(entity, string, float, float))
METHOD(Label, draw, void(entity))
METHOD(Label, resizeNotify, void(entity, vector, vector, vector, vector))
-#ifdef INTERFACE
-CLASS(ListBox) EXTENDS(Item)
+#ifndef ITEM_LISTBOX_H
+#define ITEM_LISTBOX_H
+#include "../item.qc"
+CLASS(ListBox, Item)
METHOD(ListBox, resizeNotify, void(entity, vector, vector, vector, vector))
METHOD(ListBox, configureListBox, void(entity, float, float))
METHOD(ListBox, draw, void(entity))
METHOD(ListBox, focusLeave, void(entity))
ATTRIB(ListBox, focusable, float, 1)
ATTRIB(ListBox, allowFocusSound, float, 1)
- ATTRIB(ListBox, selectedItem, float, 0)
+ ATTRIB(ListBox, selectedItem, int, 0)
ATTRIB(ListBox, size, vector, '0 0 0')
ATTRIB(ListBox, origin, vector, '0 0 0')
ATTRIB(ListBox, scrollPos, float, 0) // measured in window heights, fixed when needed
-#ifdef INTERFACE
-CLASS(ModalController) EXTENDS(Container)
+#ifndef ITEM_MODALCONTROLLER_H
+#define ITEM_MODALCONTROLLER_H
+#include "container.qc"
+CLASS(ModalController, Container)
METHOD(ModalController, resizeNotify, void(entity, vector, vector, vector, vector))
METHOD(ModalController, draw, void(entity))
METHOD(ModalController, showChild, void(entity, entity, vector, vector, float))
-#ifdef INTERFACE
-CLASS(Nexposee) EXTENDS(Container)
+#ifndef ITEM_NEXPOSEE_H
+#define ITEM_NEXPOSEE_H
+#include "container.qc"
+CLASS(Nexposee, Container)
METHOD(Nexposee, draw, void(entity))
METHOD(Nexposee, keyDown, float(entity, float, float, float))
METHOD(Nexposee, keyUp, float(entity, float, float, float))
ENDCLASS(Nexposee)
void ExposeeCloseButton_Click(entity button, entity other); // un-exposees the current state
-#endif
// animation states:
// 0 = thumbnails seen
// 2 = zoomed in
// 3 = zooming out
// animation factor: 0 = minimum theSize, 1 = maximum theSize
-
-#ifdef IMPLEMENTATION
-
.vector Nexposee_initialSize;
.vector Nexposee_initialFontScale;
.vector Nexposee_initialOrigin;
.vector Nexposee_align;
.float Nexposee_animationFactor;
+#endif
+
+#ifdef IMPLEMENTATION
void Nexposee_close(entity me)
{
// user must override this
-#ifdef INTERFACE
+#ifndef ITEM_RADIOBUTTON_H
+#define ITEM_RADIOBUTTON_H
+#include "checkbox.qc"
void RadioButton_Click(entity me, entity other);
-CLASS(RadioButton) EXTENDS(CheckBox)
+CLASS(RadioButton, CheckBox)
METHOD(RadioButton, configureRadioButton, void(entity, string, float, string, float, float))
ATTRIB(RadioButton, checked, float, 0)
ATTRIB(RadioButton, group, float, 0)
// Note:
// to use this, you FIRST call configureSliderVisuals, then configureSliderValues
-#ifdef INTERFACE
-CLASS(Slider) EXTENDS(Label)
+#ifndef ITEM_SLIDER_H
+#define ITEM_SLIDER_H
+#include "label.qc"
+CLASS(Slider, Label)
METHOD(Slider, resizeNotify, void(entity, vector, vector, vector, vector))
METHOD(Slider, configureSliderVisuals, void(entity, float, float, float, string))
METHOD(Slider, configureSliderValues, void(entity, float, float, float, float, float, float))
-#ifdef INTERFACE
-CLASS(Tab) EXTENDS(Dialog)
+#ifndef ITEM_TAB_H
+#define ITEM_TAB_H
+#include "dialog.qc"
+CLASS(Tab, Dialog)
ATTRIB(Tab, isTabRoot, float, 0)
ATTRIB(Tab, closable, float, 0)
ATTRIB(Tab, rootDialog, float, 0)
// Note:
// to use this, you FIRST call configureSliderVisuals, then multiple times addValue, then configureTextSlider
-#ifdef INTERFACE
-CLASS(TextSlider) EXTENDS(Slider)
+#ifndef ITEM_TEXTSLIDER_H
+#define ITEM_TEXTSLIDER_H
+#include "slider.qc"
+CLASS(TextSlider, Slider)
METHOD(TextSlider, valueToText, string(entity, float))
METHOD(TextSlider, valueToIdentifier, string(entity, float))
METHOD(TextSlider, setValueFromIdentifier, void(entity, string))
METHOD(TextSlider, configureTextSliderValues, void(entity, string))
ATTRIBARRAY(TextSlider, valueStrings, string, 256)
ATTRIBARRAY(TextSlider, valueIdentifiers, string, 256)
- ATTRIB(TextSlider, nValues, float, 0)
+ ATTRIB(TextSlider, nValues, int, 0)
ENDCLASS(TextSlider)
#endif
#ifdef IMPLEMENTATION
-string TextSlider_valueToIdentifier(entity me, float val)
+string TextSlider_valueToIdentifier(entity me, int val)
{
if(val >= me.nValues)
return "custom";
return "custom";
return me.(valueIdentifiers[val]);
}
-string TextSlider_valueToText(entity me, float val)
+string TextSlider_valueToText(entity me, int val)
{
if(val >= me.nValues)
return _("Custom");
}
void TextSlider_setValueFromIdentifier(entity me, string id)
{
- float i;
+ int i;
for(i = 0; i < me.nValues; ++i)
if(me.valueToIdentifier(me, i) == id)
{
me.(valueIdentifiers[me.nValues]) = theIdentifier;
me.nValues += 1;
}
-void TextSlider_insertValue(entity me, float pos, string theString, string theIdentifier)
+void TextSlider_insertValue(entity me, int pos, string theString, string theIdentifier)
{
- float i;
+ int i;
for (i = me.nValues; i > pos; --i)
{
me.(valueStrings[i]) = me.(valueStrings[i-1]);
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "menu.qh"
+#include "oo/classes.qc"
+#include "xonotic/util.qh"
+
+#include "../common/weapons/weapons.qh"
+#include "../common/mapinfo.qh"
///////////////////////////////////////////////
// Menu Source File
draw_setMousePointer(SKINGFX_CURSOR, SKINSIZE_CURSOR, SKINOFFSET_CURSOR);
loadTooltips();
- anim = spawnAnimHost();
- main = spawnMainWindow(); main.configureMainWindow(main);
+ anim = NEW(AnimHost);
+ main = NEW(MainWindow); main.configureMainWindow(main);
unloadTooltips();
main.resizeNotify(main, '0 0 0', eX * conwidth + eY * conheight, '0 0 0', eX * conwidth + eY * conheight);
menuMousePos = focus.origin + 0.5 * focus.size;
menuMousePos.x *= 1 / conwidth;
menuMousePos.y *= 1 / conheight;
- if(wnd.focused) // why does this never happen?
+ entity par = wnd.parent;
+ if(par.focused)
+ par.setFocus(par, wnd);
+ if(wnd.focused)
m_focus_item_chain(wnd, focus);
}
}
#define localcmd cmd
-#define NULL (null_entity)
-#define world NULL
-
// constants
const int GAME_ISSERVER = 1;
void m_sync();
+void draw_reset_cropped();
+
// sounds
const string MENU_SOUND_CLEAR = "sound/menu/clear.wav";
#ifndef BASE_H
#define BASE_H
+#include "../../common/util.qh"
+#include "../../dpdefs/keycodes.qh"
+
+#define NULL (null_entity)
+#define world NULL
+
.string classname;
-entity Object_vtbl;
.string vtblname;
.entity vtblbase;
-// THIS LINE INTENTIONALLY LEFT BLANK
-entity spawnVtbl(entity e, entity b)
+entity spawnVtbl(entity this, entity base)
{
- entity v;
- v = spawn();
- copyentity(e, v);
- v.vtblname = v.classname;
- v.classname = "vtbl";
- if(b)
- v.vtblbase = b;
- else
- v.vtblbase = v;
- return v;
+ entity vtbl = spawn();
+ copyentity(this, vtbl);
+ vtbl.vtblname = vtbl.classname;
+ vtbl.classname = "vtbl";
+ vtbl.vtblbase = base ? base : vtbl; // Top level objects use vtbl as base
+ return vtbl;
}
-entity spawnObject()
+
+entity Object_vtbl;
+entity spawnObject(entity this, entity)
{
- entity e;
- e = spawn();
- e.classname = "Object";
- if(!Object_vtbl)
- Object_vtbl = spawnVtbl(e, null_entity);
- return e;
+ this = spawn();
+ this.classname = "Object";
+ if (!Object_vtbl) Object_vtbl = spawnVtbl(this, null_entity);
+ return this;
+}
+
+// Classes have a `spawn##cname(entity, entity)` constructor
+// The parameters are used as locals for [[accumulate]]
+
+// Macro to hide this implementation detail
+#define NEW(cname) (spawn##cname(null_entity, null_entity))
+
+#define CLASS(cname, base) \
+entity spawn##cname(entity this, entity basevtbl) { \
+ this = NEW(base); basevtbl = base##_vtbl; \
}
-#endif
+
+#define METHOD(cname, name, prototype) \
+prototype cname##_##name; \
+.prototype name; \
+[[accumulate]] entity spawn##cname(entity this, entity basevtbl) { \
+ this.name = cname##_##name; \
+}
+
+#define ATTRIB(cname, name, type, val) \
+.type name; \
+[[accumulate]] entity spawn##cname(entity this, entity basevtbl) { \
+ this.name = val; \
+}
+
+#define ATTRIBARRAY(cname, name, type, cnt) \
+.type name[cnt];
+
+#define ENDCLASS(cname) \
+.bool instanceOf##cname; \
+entity cname##_vtbl; \
+[[last]] entity spawn##cname(entity this, entity basevtbl) { \
+ this.instanceOf##cname = true; \
+ this.classname = #cname; \
+ if (!cname##_vtbl) cname##_vtbl = spawnVtbl(this, basevtbl); \
+ return this; \
+}
+
+#define SUPER(cname) (cname##_vtbl.vtblbase)
+
+#endif
\ No newline at end of file
--- /dev/null
+#ifndef CLASSES_H
+#define CLASSES_H
+#include "base.qh"
+
+#include "../classes.inc"
+#define IMPLEMENTATION
+#include "../classes.inc"
+
+#endif
+++ /dev/null
-#ifndef IMPLEMENTATION_H
-#define IMPLEMENTATION_H
-
-#ifndef INTERFACE
-#define INTERFACE
-#endif
-
-#ifndef IMPLEMENTATION
-#define IMPLEMENTATION
-#endif
-
-#ifdef CLASS
-#undef CLASS
-#undef EXTENDS
-#undef METHOD
-#undef ATTRIB
-#undef ATTRIBARRAY
-#undef ENDCLASS
-#undef SUPER
-#endif
-
-// for the constructor
-#define CLASS(cname) entity spawn##cname() { entity me;
-#define EXTENDS(base) me = spawn##base (); entity basevtbl; basevtbl = base##_vtbl;
-#define METHOD(cname,name,prototype) me.name = cname##_##name;
-#define ATTRIB(cname,name,type,val) me.name = val;
-#define ATTRIBARRAY(cname,name,type,cnt)
-#define ENDCLASS(cname) me.instanceOf##cname = 1; me.classname = #cname; if(!cname##_vtbl) cname##_vtbl = spawnVtbl(me, basevtbl); return me; }
-
-// for the implementation
-#define SUPER(cname) (cname##_vtbl.vtblbase)
-#endif
+++ /dev/null
-#ifndef INTERFACE_H
-#define INTERFACE_H
-
-#ifndef INTERFACE
-#define INTERFACE
-#endif
-
-#ifdef IMPLEMENTATION
-#undef IMPLEMENTATION
-#endif
-
-#ifdef CLASS
-#undef CLASS
-#undef EXTENDS
-#undef METHOD
-#undef ATTRIB
-#undef ATTRIBARRAY
-#undef ENDCLASS
-#undef SUPER
-#endif
-
-#define CLASS(cname) entity spawn##cname(); entity cname##_vtbl;
-#define EXTENDS(base)
-#define METHOD(cname,name,prototype) prototype cname##_##name; .prototype name;
-#define ATTRIB(cname,name,type,val) .type name;
-#define ATTRIBARRAY(cname,name,type,cnt) .type name[cnt];
-#define ENDCLASS(cname) .float instanceOf##cname;
-#define SUPER(cname)
-#endif
../dpdefs/menudefs.qh
../dpdefs/keycodes.qh
-oo/interface.qh
- classes.qc
-oo/implementation.qh
- classes.qc
+oo/classes.qc
draw.qc
menu.qc
-command/menu_cmd.qc
+command/commands.qc
xonotic/util.qc
../common/urllib.qc
../common/util.qc
-../common/command/generic.qc
-../common/command/markup.qc
-../common/command/rpn.qc
-
../common/monsters/monsters.qc
../common/weapons/weapons.qc // TODO
#undef SKINFLOAT
#undef SKINVECTOR
-#define SKINBEGIN void Skin_ApplySetting(string key, string value) { switch(key) {
-#define SKINVECTOR(name,def) case #name: SKIN##name = stov(value); break
-#define SKINFLOAT(name,def) case #name: SKIN##name = stof(value); break
+#define SKINBEGIN void Skin_ApplySetting(string key, string _value) { switch(key) {
+#define SKINVECTOR(name,def) case #name: SKIN##name = stov(_value); break
+#define SKINFLOAT(name,def) case #name: SKIN##name = stof(_value); break
//#define SKINSTRING(name,def) case #name: break
-#define SKINSTRING(name,def) case #name: SKIN##name = strzone(value); break
+#define SKINSTRING(name,def) case #name: SKIN##name = strzone(_value); break
// I know this leaks memory when skin is read multiple times. Screw it.
#define SKINEND case "": break; case "//": break; default: dprint("Invalid key in skin file: ", key, "\n"); } }
#include "skin-customizables.inc"
-#ifdef INTERFACE
-CLASS(XonoticBigButton) EXTENDS(XonoticButton)
+#ifndef BIGBUTTON_H
+#define BIGBUTTON_H
+#include "button.qc"
+CLASS(XonoticBigButton, XonoticButton)
METHOD(XonoticBigButton, configureXonoticBigButton, void(entity, string, vector))
ATTRIB(XonoticBigButton, image, string, SKINGFX_BUTTON_BIG)
ATTRIB(XonoticBigButton, grayImage, string, SKINGFX_BUTTON_BIG_GRAY)
entity makeXonoticBigButton(string theText, vector theColor)
{
entity me;
- me = spawnXonoticBigButton();
+ me = NEW(XonoticBigButton);
me.configureXonoticBigButton(me, theText, theColor);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticBigCommandButton) EXTENDS(XonoticCommandButton)
+#ifndef BIGCOMMANDBUTTON_H
+#define BIGCOMMANDBUTTON_H
+#include "commandbutton.qc"
+CLASS(XonoticBigCommandButton, XonoticCommandButton)
METHOD(XonoticBigCommandButton, configureXonoticBigCommandButton, void(entity, string, vector, string, float))
ATTRIB(XonoticBigCommandButton, image, string, SKINGFX_BUTTON_BIG)
ATTRIB(XonoticBigCommandButton, grayImage, string, SKINGFX_BUTTON_BIG_GRAY)
entity makeXonoticBigCommandButton(string theText, vector theColor, string theCommand, float theFlags)
{
entity me;
- me = spawnXonoticBigCommandButton();
+ me = NEW(XonoticBigCommandButton);
me.configureXonoticBigCommandButton(me, theText, theColor, theCommand, theFlags);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticButton) EXTENDS(Button)
+#ifndef BUTTON_H
+#define BUTTON_H
+#include "../item/button.qc"
+CLASS(XonoticButton, Button)
METHOD(XonoticButton, configureXonoticButton, void(entity, string, vector))
ATTRIB(XonoticButton, fontSize, float, SKINFONTSIZE_NORMAL)
ATTRIB(XonoticButton, image, string, SKINGFX_BUTTON)
entity makeXonoticButton(string theText, vector theColor)
{
entity me;
- me = spawnXonoticButton();
+ me = NEW(XonoticButton);
me.configureXonoticButton(me, theText, theColor);
return me;
}
#include "../../common/campaign_common.qh"
-#ifdef INTERFACE
-CLASS(XonoticCampaignList) EXTENDS(XonoticListBox)
+#ifndef CAMPAIGN_H
+#define CAMPAIGN_H
+#include "listbox.qc"
+CLASS(XonoticCampaignList, XonoticListBox)
METHOD(XonoticCampaignList, configureXonoticCampaignList, void(entity))
ATTRIB(XonoticCampaignList, rowsPerItem, float, 10)
METHOD(XonoticCampaignList, draw, void(entity))
void rewrapCampaign(float w, float l0, float emptyheight, vector theFontSize)
{
- float i, j;
- float n, l;
+ int i, j;
+ int n;
+ float l;
string r, s;
for(i = 0; i < campaign_entries; ++i)
{
entity makeXonoticCampaignList()
{
entity me;
- me = spawnXonoticCampaignList();
+ me = NEW(XonoticCampaignList);
me.configureXonoticCampaignList(me);
return me;
}
{
CampaignList_LoadMap(me, me);
}
-void XonoticCampaignList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
+void XonoticCampaignList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected)
{
string s;
vector theColor;
-#ifdef INTERFACE
-CLASS(XonoticCharmap) EXTENDS(Item)
+#ifndef CHARMAP_H
+#define CHARMAP_H
+#include "../item.qc"
+CLASS(XonoticCharmap, Item)
METHOD(XonoticCharmap, configureXonoticCharmap, void(entity, entity))
METHOD(XonoticCharmap, mousePress, float(entity, vector))
METHOD(XonoticCharmap, mouseRelease, float(entity, vector))
entity makeXonoticCharmap(entity controlledInputBox)
{
entity me;
- me = spawnXonoticCharmap();
+ me = NEW(XonoticCharmap);
me.configureXonoticCharmap(me, controlledInputBox);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticCheckBox) EXTENDS(CheckBox)
+#ifndef CHECKBOX_H
+#define CHECKBOX_H
+#include "../item/checkbox.qc"
+CLASS(XonoticCheckBox, CheckBox)
METHOD(XonoticCheckBox, configureXonoticCheckBox, void(entity, float, float, string, string))
METHOD(XonoticCheckBox, setChecked, void(entity, float))
ATTRIB(XonoticCheckBox, fontSize, float, SKINFONTSIZE_NORMAL)
entity makeXonoticCheckBoxEx(float theYesValue, float theNoValue, string theCvar, string theText)
{
entity me;
- me = spawnXonoticCheckBox();
+ me = NEW(XonoticCheckBox);
me.configureXonoticCheckBox(me, theYesValue, theNoValue, theCvar, theText);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticSliderCheckBox) EXTENDS(CheckBox)
+#ifndef CHECKBOX_SLIDER_INVALID_H
+#define CHECKBOX_SLIDER_INVALID_H
+#include "../item/checkbox.qc"
+CLASS(XonoticSliderCheckBox, CheckBox)
METHOD(XonoticSliderCheckBox, configureXonoticSliderCheckBox, void(entity, float, float, entity, string))
METHOD(XonoticSliderCheckBox, setChecked, void(entity, float))
METHOD(XonoticSliderCheckBox, draw, void(entity))
entity makeXonoticSliderCheckBox(float theOffValue, float isInverted, entity theControlledSlider, string theText)
{
entity me;
- me = spawnXonoticSliderCheckBox();
+ me = NEW(XonoticSliderCheckBox);
me.configureXonoticSliderCheckBox(me, theOffValue, isInverted, theControlledSlider, theText);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticCheckBoxString) EXTENDS(CheckBox)
+#ifndef CHECKBOX_STRING_H
+#define CHECKBOX_STRING_H
+#include "../item/checkbox.qc"
+CLASS(XonoticCheckBoxString, CheckBox)
METHOD(XonoticCheckBoxString, configureXonoticCheckBoxString, void(entity, string, string, string, string))
METHOD(XonoticCheckBoxString, setChecked, void(entity, float))
ATTRIB(XonoticCheckBoxString, fontSize, float, SKINFONTSIZE_NORMAL)
entity makeXonoticCheckBoxString(string theYesValue, string theNoValue, string theCvar, string theText)
{
entity me;
- me = spawnXonoticCheckBoxString();
+ me = NEW(XonoticCheckBoxString);
me.configureXonoticCheckBoxString(me, theYesValue, theNoValue, theCvar, theText);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticColorButton) EXTENDS(RadioButton)
+#ifndef COLORBUTTON_H
+#define COLORBUTTON_H
+#include "../item/radiobutton.qc"
+CLASS(XonoticColorButton, RadioButton)
METHOD(XonoticColorButton, configureXonoticColorButton, void(entity, float, float, float))
METHOD(XonoticColorButton, setChecked, void(entity, float))
METHOD(XonoticColorButton, draw, void(entity))
entity makeXonoticColorButton(float theGroup, float theColor, float theValue)
{
entity me;
- me = spawnXonoticColorButton();
+ me = NEW(XonoticColorButton);
me.configureXonoticColorButton(me, theGroup, theColor, theValue);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticColorpicker) EXTENDS(Image)
+#ifndef COLORPICKER_H
+#define COLORPICKER_H
+#include "../item/image.qc"
+CLASS(XonoticColorpicker, Image)
METHOD(XonoticColorpicker, configureXonoticColorpicker, void(entity, entity))
METHOD(XonoticColorpicker, mousePress, float(entity, vector))
METHOD(XonoticColorpicker, mouseRelease, float(entity, vector))
entity makeXonoticColorpicker(entity theTextbox)
{
entity me;
- me = spawnXonoticColorpicker();
+ me = NEW(XonoticColorpicker);
me.configureXonoticColorpicker(me, theTextbox);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticColorpickerString) EXTENDS(Image)
+#ifndef COLORPICKER_STRING_H
+#define COLORPICKER_STRING_H
+#include "../item/image.qc"
+CLASS(XonoticColorpickerString, Image)
METHOD(XonoticColorpickerString, configureXonoticColorpickerString, void(entity, string, string))
METHOD(XonoticColorpickerString, mousePress, float(entity, vector))
METHOD(XonoticColorpickerString, mouseRelease, float(entity, vector))
METHOD(XonoticColorpickerString, mouseDrag, float(entity, vector))
ATTRIB(XonoticColorpickerString, cvarName, string, string_null)
- METHOD(XonoticColorPickerString, loadCvars, void(entity))
- METHOD(XonoticColorPickerString, saveCvars, void(entity))
+ METHOD(XonoticColorpickerString, loadCvars, void(entity))
+ METHOD(XonoticColorpickerString, saveCvars, void(entity))
ATTRIB(XonoticColorpickerString, prevcoords, vector, '0 0 0')
ATTRIB(XonoticColorpickerString, image, string, SKINGFX_COLORPICKER)
ATTRIB(XonoticColorpickerString, imagemargin, vector, SKINMARGIN_COLORPICKER)
entity makeXonoticColorpickerString(string theCvar, string theDefaultCvar)
{
entity me;
- me = spawnXonoticColorpickerString();
+ me = NEW(XonoticColorpickerString);
me.configureXonoticColorpickerString(me, theCvar, theDefaultCvar);
return me;
}
}
}
-void XonoticColorPickerString_loadCvars(entity me)
+void XonoticColorpickerString_loadCvars(entity me)
{
if (!me.cvarName)
return;
me.prevcoords = color_hslimage(stov(cvar_string(me.cvarName)), me.imagemargin);
}
-void XonoticColorPickerString_saveCvars(entity me)
+void XonoticColorpickerString_saveCvars(entity me)
{
if (!me.cvarName)
return;
//# define COMMANDBUTTON_REVERT 4
#endif
-#ifdef INTERFACE
-CLASS(XonoticCommandButton) EXTENDS(XonoticButton)
+#ifndef COMMANDBUTTON_H
+#define COMMANDBUTTON_H
+#include "button.qc"
+CLASS(XonoticCommandButton, XonoticButton)
METHOD(XonoticCommandButton, configureXonoticCommandButton, void(entity, string, vector, string, float))
ATTRIB(XonoticCommandButton, onClickCommand, string, string_null)
ATTRIB(XonoticCommandButton, flags, float, 0)
entity makeXonoticCommandButton(string theText, vector theColor, string theCommand, float theFlags)
{
entity me;
- me = spawnXonoticCommandButton();
+ me = NEW(XonoticCommandButton);
me.configureXonoticCommandButton(me, theText, theColor, theCommand, theFlags);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticCreditsList) EXTENDS(XonoticListBox)
+#ifndef CREDITS_H
+#define CREDITS_H
+#include "listbox.qc"
+CLASS(XonoticCreditsList, XonoticListBox)
METHOD(XonoticCreditsList, configureXonoticCreditsList, void(entity))
ATTRIB(XonoticCreditsList, rowsPerItem, float, 1)
METHOD(XonoticCreditsList, draw, void(entity))
ATTRIB(XonoticCreditsList, bufferIndex, float, 0)
ATTRIB(XonoticCreditsList, scrolling, float, 0)
- ATTRIB(XonoticListBox, alphaBG, float, 0)
+ ATTRIB(XonoticCreditsList, alphaBG, float, 0)
ENDCLASS(XonoticCreditsList)
entity makeXonoticCreditsList();
#endif
entity makeXonoticCreditsList()
{
entity me;
- me = spawnXonoticCreditsList();
+ me = NEW(XonoticCreditsList);
me.configureXonoticCreditsList(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticCrosshairButton) EXTENDS(RadioButton)
+#ifndef CROSSHAIRBUTTON_H
+#define CROSSHAIRBUTTON_H
+#include "../item/radiobutton.qc"
+CLASS(XonoticCrosshairButton, RadioButton)
METHOD(XonoticCrosshairButton, configureXonoticCrosshairButton, void(entity, float, float))
METHOD(XonoticCrosshairButton, setChecked, void(entity, float))
METHOD(XonoticCrosshairButton, draw, void(entity))
entity makeXonoticCrosshairButton(float theGroup, float theCrosshair)
{
entity me;
- me = spawnXonoticCrosshairButton();
+ me = NEW(XonoticCrosshairButton);
me.configureXonoticCrosshairButton(me, theGroup, theCrosshair);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticCvarList) EXTENDS(XonoticListBox)
+#ifndef CVARLIST_H
+#define CVARLIST_H
+#include "listbox.qc"
+CLASS(XonoticCvarList, XonoticListBox)
METHOD(XonoticCvarList, configureXonoticCvarList, void(entity))
ATTRIB(XonoticCvarList, rowsPerItem, float, 1)
METHOD(XonoticCvarList, drawListBoxItem, void(entity, float, vector, float))
entity makeXonoticCvarList()
{
entity me;
- me = spawnXonoticCvarList();
+ me = NEW(XonoticCvarList);
me.configureXonoticCvarList(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticDemoList) EXTENDS(XonoticListBox)
+#ifndef DEMOLIST_H
+#define DEMOLIST_H
+#include "listbox.qc"
+CLASS(XonoticDemoList, XonoticListBox)
METHOD(XonoticDemoList, configureXonoticDemoList, void(entity))
ATTRIB(XonoticDemoList, rowsPerItem, float, 1)
METHOD(XonoticDemoList, resizeNotify, void(entity, vector, vector, vector, vector))
entity makeXonoticDemoList()
{
entity me;
- me = spawnXonoticDemoList();
+ me = NEW(XonoticDemoList);
me.configureXonoticDemoList(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticDialog) EXTENDS(Dialog)
+#ifndef DIALOG_H
+#define DIALOG_H
+#include "../item/dialog.qc"
+CLASS(XonoticDialog, Dialog)
// still to be customized by user
/*
ATTRIB(XonoticDialog, closable, float, 1)
-#ifdef INTERFACE
-CLASS(XonoticCreditsDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_CREDITS_H
+#define DIALOG_CREDITS_H
+#include "dialog.qc"
+CLASS(XonoticCreditsDialog, XonoticDialog)
METHOD(XonoticCreditsDialog, fill, void(entity))
METHOD(XonoticCreditsDialog, focusEnter, void(entity))
ATTRIB(XonoticCreditsDialog, title, string, _("Credits"))
-#ifdef INTERFACE
-CLASS(XonoticFirstRunDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_FIRSTRUN_H
+#define DIALOG_FIRSTRUN_H
+#include "rootdialog.qc"
+CLASS(XonoticFirstRunDialog, XonoticRootDialog)
METHOD(XonoticFirstRunDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
ATTRIB(XonoticFirstRunDialog, title, string, _("Welcome"))
ATTRIB(XonoticFirstRunDialog, color, vector, SKINCOLOR_DIALOG_FIRSTRUN)
-#ifdef INTERFACE
-CLASS(XonoticHUDAmmoDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_AMMO_H
+#define DIALOG_HUDPANEL_AMMO_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDAmmoDialog, XonoticRootDialog)
METHOD(XonoticHUDAmmoDialog, fill, void(entity))
ATTRIB(XonoticHUDAmmoDialog, title, string, _("Ammo Panel"))
ATTRIB(XonoticHUDAmmoDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDBuffsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_BUFFS_H
+#define DIALOG_HUDPANEL_BUFFS_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDBuffsDialog, XonoticRootDialog)
METHOD(XonoticHUDBuffsDialog, fill, void(entity))
ATTRIB(XonoticHUDBuffsDialog, title, string, _("Buffs Panel"))
ATTRIB(XonoticHUDBuffsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDCenterprintDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_CENTERPRINT_H
+#define DIALOG_HUDPANEL_CENTERPRINT_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDCenterprintDialog, XonoticRootDialog)
METHOD(XonoticHUDCenterprintDialog, fill, void(entity))
ATTRIB(XonoticHUDCenterprintDialog, title, string, _("Centerprint Panel"))
ATTRIB(XonoticHUDCenterprintDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDChatDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_CHAT_H
+#define DIALOG_HUDPANEL_CHAT_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDChatDialog, XonoticRootDialog)
METHOD(XonoticHUDChatDialog, fill, void(entity))
ATTRIB(XonoticHUDChatDialog, title, string, _("Chat Panel"))
ATTRIB(XonoticHUDChatDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDEngineInfoDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_ENGINEINFO_H
+#define DIALOG_HUDPANEL_ENGINEINFO_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDEngineInfoDialog, XonoticRootDialog)
METHOD(XonoticHUDEngineInfoDialog, fill, void(entity))
ATTRIB(XonoticHUDEngineInfoDialog, title, string, _("Engine Info Panel"))
ATTRIB(XonoticHUDEngineInfoDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDHealthArmorDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_HEALTHARMOR_H
+#define DIALOG_HUDPANEL_HEALTHARMOR_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDHealthArmorDialog, XonoticRootDialog)
METHOD(XonoticHUDHealthArmorDialog, fill, void(entity))
ATTRIB(XonoticHUDHealthArmorDialog, title, string, _("Health/Armor Panel"))
ATTRIB(XonoticHUDHealthArmorDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDInfoMessagesDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_INFOMESSAGES_H
+#define DIALOG_HUDPANEL_INFOMESSAGES_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDInfoMessagesDialog, XonoticRootDialog)
METHOD(XonoticHUDInfoMessagesDialog, fill, void(entity))
ATTRIB(XonoticHUDInfoMessagesDialog, title, string, _("Info Messages Panel"))
ATTRIB(XonoticHUDInfoMessagesDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDModIconsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_MODICONS_H
+#define DIALOG_HUDPANEL_MODICONS_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDModIconsDialog, XonoticRootDialog)
METHOD(XonoticHUDModIconsDialog, fill, void(entity))
ATTRIB(XonoticHUDModIconsDialog, title, string, _("Mod Icons Panel"))
ATTRIB(XonoticHUDModIconsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDNotificationDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_NOTIFICATION_H
+#define DIALOG_HUDPANEL_NOTIFICATION_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDNotificationDialog, XonoticRootDialog)
METHOD(XonoticHUDNotificationDialog, fill, void(entity))
ATTRIB(XonoticHUDNotificationDialog, title, string, _("Notification Panel"))
ATTRIB(XonoticHUDNotificationDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDPhysicsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_PHYSICS_H
+#define DIALOG_HUDPANEL_PHYSICS_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDPhysicsDialog, XonoticRootDialog)
METHOD(XonoticHUDPhysicsDialog, fill, void(entity))
ATTRIB(XonoticHUDPhysicsDialog, title, string, _("Physics Panel"))
ATTRIB(XonoticHUDPhysicsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDPowerupsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_POWERUPS_H
+#define DIALOG_HUDPANEL_POWERUPS_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDPowerupsDialog, XonoticRootDialog)
METHOD(XonoticHUDPowerupsDialog, fill, void(entity))
ATTRIB(XonoticHUDPowerupsDialog, title, string, _("Powerups Panel"))
ATTRIB(XonoticHUDPowerupsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDPressedKeysDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_PRESSEDKEYS_H
+#define DIALOG_HUDPANEL_PRESSEDKEYS_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDPressedKeysDialog, XonoticRootDialog)
METHOD(XonoticHUDPressedKeysDialog, fill, void(entity))
ATTRIB(XonoticHUDPressedKeysDialog, title, string, _("Pressed Keys Panel"))
ATTRIB(XonoticHUDPressedKeysDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDRaceTimerDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_RACETIMER_H
+#define DIALOG_HUDPANEL_RACETIMER_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDRaceTimerDialog, XonoticRootDialog)
METHOD(XonoticHUDRaceTimerDialog, fill, void(entity))
ATTRIB(XonoticHUDRaceTimerDialog, title, string, _("Race Timer Panel"))
ATTRIB(XonoticHUDRaceTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDRadarDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_RADAR_H
+#define DIALOG_HUDPANEL_RADAR_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDRadarDialog, XonoticRootDialog)
METHOD(XonoticHUDRadarDialog, fill, void(entity))
ATTRIB(XonoticHUDRadarDialog, title, string, _("Radar Panel"))
ATTRIB(XonoticHUDRadarDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDScoreDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_SCORE_H
+#define DIALOG_HUDPANEL_SCORE_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDScoreDialog, XonoticRootDialog)
METHOD(XonoticHUDScoreDialog, fill, void(entity))
ATTRIB(XonoticHUDScoreDialog, title, string, _("Score Panel"))
ATTRIB(XonoticHUDScoreDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDTimerDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_TIMER_H
+#define DIALOG_HUDPANEL_TIMER_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDTimerDialog, XonoticRootDialog)
METHOD(XonoticHUDTimerDialog, fill, void(entity))
ATTRIB(XonoticHUDTimerDialog, title, string, _("Timer Panel"))
ATTRIB(XonoticHUDTimerDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDVoteDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_VOTE_H
+#define DIALOG_HUDPANEL_VOTE_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDVoteDialog, XonoticRootDialog)
METHOD(XonoticHUDVoteDialog, fill, void(entity))
ATTRIB(XonoticHUDVoteDialog, title, string, _("Vote Panel"))
ATTRIB(XonoticHUDVoteDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDWeaponsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDPANEL_WEAPONS_H
+#define DIALOG_HUDPANEL_WEAPONS_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDWeaponsDialog, XonoticRootDialog)
METHOD(XonoticHUDWeaponsDialog, fill, void(entity))
ATTRIB(XonoticHUDWeaponsDialog, title, string, _("Weapons Panel"))
ATTRIB(XonoticHUDWeaponsDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticHUDExitDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_HUDSETUP_EXIT_H
+#define DIALOG_HUDSETUP_EXIT_H
+#include "rootdialog.qc"
+CLASS(XonoticHUDExitDialog, XonoticRootDialog)
METHOD(XonoticHUDExitDialog, fill, void(entity))
ATTRIB(XonoticHUDExitDialog, title, string, _("Panel HUD Setup"))
ATTRIB(XonoticHUDExitDialog, color, vector, SKINCOLOR_DIALOG_TEAMSELECT)
-#ifdef INTERFACE
-CLASS(XonoticMonsterToolsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_MONSTERTOOLS_H
+#define DIALOG_MONSTERTOOLS_H
+#include "rootdialog.qc"
+CLASS(XonoticMonsterToolsDialog, XonoticRootDialog)
METHOD(XonoticMonsterToolsDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
ATTRIB(XonoticMonsterToolsDialog, title, string, _("Monster Tools"))
ATTRIB(XonoticMonsterToolsDialog, color, vector, SKINCOLOR_DIALOG_SANDBOXTOOLS)
-#ifdef INTERFACE
-CLASS(XonoticMultiplayerDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_H
+#define DIALOG_MULTIPLAYER_H
+#include "dialog.qc"
+CLASS(XonoticMultiplayerDialog, XonoticDialog)
METHOD(XonoticMultiplayerDialog, fill, void(entity))
ATTRIB(XonoticMultiplayerDialog, title, string, _("Multiplayer"))
ATTRIB(XonoticMultiplayerDialog, color, vector, SKINCOLOR_DIALOG_MULTIPLAYER)
-#ifdef INTERFACE
-CLASS(XonoticServerCreateTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_CREATE_H
+#define DIALOG_MULTIPLAYER_CREATE_H
+#include "tab.qc"
+CLASS(XonoticServerCreateTab, XonoticTab)
METHOD(XonoticServerCreateTab, fill, void(entity))
METHOD(XonoticServerCreateTab, gameTypeChangeNotify, void(entity))
METHOD(XonoticServerCreateTab, gameTypeSelectNotify, void(entity))
e.configureXonoticTextSlider(e, pCvar);
// clear old values
- float i;
+ int i;
for(i = 0; i <= e.nValues; ++i);
{
if(e.(valueStrings[i])) { strunzone(e.(valueStrings[i])); }
entity makeXonoticServerCreateTab()
{
entity me;
- me = spawnXonoticServerCreateTab();
+ me = NEW(XonoticServerCreateTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticMapInfoDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_CREATE_MAPINFO_H
+#define DIALOG_MULTIPLAYER_CREATE_MAPINFO_H
+#include "dialog.qc"
+CLASS(XonoticMapInfoDialog, XonoticDialog)
METHOD(XonoticMapInfoDialog, fill, void(entity))
METHOD(XonoticMapInfoDialog, loadMapInfo, void(entity, float, entity))
ATTRIB(XonoticMapInfoDialog, title, string, _("Map Information"))
#endif
#ifdef IMPLEMENTATION
-void XonoticMapInfoDialog_loadMapInfo(entity me, float i, entity mlb)
+void XonoticMapInfoDialog_loadMapInfo(entity me, int i, entity mlb)
{
me.currentMapIndex = i;
me.startButton.onClickEntity = mlb;
void XonoticMapInfoDialog_fill(entity me)
{
entity e;
- float w, wgt, i, n;
+ int i;
+ float w, wgt, n;
me.TR(me);
me.TDempty(me, 0.2);
me.TD(me, me.rows - 2, 3, e = makeXonoticImage(string_null, 4.0/3.0));
#include "../../common/weapons/weapons.qh"
-#ifdef INTERFACE
-CLASS(XonoticMutatorsDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_CREATE_MUTATORS_H
+#define DIALOG_MULTIPLAYER_CREATE_MUTATORS_H
+#include "dialog.qc"
+CLASS(XonoticMutatorsDialog, XonoticDialog)
METHOD(XonoticMutatorsDialog, toString, string(entity))
METHOD(XonoticMutatorsDialog, fill, void(entity))
METHOD(XonoticMutatorsDialog, showNotify, void(entity))
-#ifdef INTERFACE
-CLASS(XonoticServerListTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_JOIN_H
+#define DIALOG_MULTIPLAYER_JOIN_H
+#include "tab.qc"
+CLASS(XonoticServerListTab, XonoticTab)
METHOD(XonoticServerListTab, fill, void(entity))
ATTRIB(XonoticServerListTab, title, string, _("Join"))
ATTRIB(XonoticServerListTab, intendedWidth, float, 0.9)
entity makeXonoticServerListTab()
{
entity me;
- me = spawnXonoticServerListTab();
+ me = NEW(XonoticServerListTab);
me.configureDialog(me);
return me;
}
#include "../../common/mapinfo.qh"
-#ifdef INTERFACE
-CLASS(XonoticServerInfoDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_JOIN_SERVERINFO_H
+#define DIALOG_MULTIPLAYER_JOIN_SERVERINFO_H
+#include "dialog.qc"
+CLASS(XonoticServerInfoDialog, XonoticDialog)
METHOD(XonoticServerInfoDialog, fill, void(entity))
METHOD(XonoticServerInfoDialog, loadServerInfo, void(entity, float))
ATTRIB(XonoticServerInfoDialog, title, string, _("Server Information"))
-#ifdef INTERFACE
-CLASS(XonoticMediaTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_H
+#define DIALOG_MULTIPLAYER_MEDIA_H
+#include "tab.qc"
+CLASS(XonoticMediaTab, XonoticTab)
METHOD(XonoticMediaTab, fill, void(entity))
ATTRIB(XonoticMediaTab, title, string, _("Media"))
ATTRIB(XonoticMediaTab, intendedWidth, float, 0.9)
entity makeXonoticMediaTab()
{
entity me;
- me = spawnXonoticMediaTab();
+ me = NEW(XonoticMediaTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticDemoBrowserTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_DEMO_H
+#define DIALOG_MULTIPLAYER_MEDIA_DEMO_H
+#include "tab.qc"
+CLASS(XonoticDemoBrowserTab, XonoticTab)
METHOD(XonoticDemoBrowserTab, fill, void(entity))
ATTRIB(XonoticDemoBrowserTab, title, string, _("Demo"))
ATTRIB(XonoticDemoBrowserTab, intendedWidth, float, 0.9)
ATTRIB(XonoticDemoBrowserTab, democlicktype, float, 0)
ENDCLASS(XonoticDemoBrowserTab)
entity makeXonoticDemoBrowserTab();
-#ifdef IMPLEMENTATION
-// private:
-const float DMO_PLAY = 1;
-const float DMO_TIME = 2;
-#endif
#endif
#ifdef IMPLEMENTATION
+const float DMO_PLAY = 1;
+const float DMO_TIME = 2;
void DemoConfirm_Check_Gamestatus(entity btn, entity me)
{
if(!(gamestatus & (GAME_CONNECTED | GAME_ISSERVER))) // we're not in a match, lets watch the demo
entity makeXonoticDemoBrowserTab()
{
entity me;
- me = spawnXonoticDemoBrowserTab();
+ me = NEW(XonoticDemoBrowserTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticDemoStartConfirmDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_DEMO_STARTCONFIRM_H
+#define DIALOG_MULTIPLAYER_MEDIA_DEMO_STARTCONFIRM_H
+#include "dialog.qc"
+CLASS(XonoticDemoStartConfirmDialog, XonoticDialog)
METHOD(XonoticDemoStartConfirmDialog, fill, void(entity))
ATTRIB(XonoticDemoStartConfirmDialog, title, string, _("Disconnect"))
ATTRIB(XonoticDemoStartConfirmDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM)
-#ifdef INTERFACE
-CLASS(XonoticDemoTimeConfirmDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_DEMO_TIMECONFIRM_H
+#define DIALOG_MULTIPLAYER_MEDIA_DEMO_TIMECONFIRM_H
+#include "dialog.qc"
+CLASS(XonoticDemoTimeConfirmDialog, XonoticDialog)
METHOD(XonoticDemoTimeConfirmDialog, fill, void(entity))
ATTRIB(XonoticDemoTimeConfirmDialog, title, string, _("Disconnect"))
ATTRIB(XonoticDemoTimeConfirmDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM)
-#ifdef INTERFACE
-CLASS(XonoticMusicPlayerTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_MUSICPLAYER_H
+#define DIALOG_MULTIPLAYER_MEDIA_MUSICPLAYER_H
+#include "tab.qc"
+CLASS(XonoticMusicPlayerTab, XonoticTab)
METHOD(XonoticMusicPlayerTab, fill, void(entity))
ATTRIB(XonoticMusicPlayerTab, title, string, _("Music"))
ATTRIB(XonoticMusicPlayerTab, intendedWidth, float, 0.9)
entity makeXonoticMusicPlayerTab()
{
entity me;
- me = spawnXonoticMusicPlayerTab();
+ me = NEW(XonoticMusicPlayerTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticScreenshotBrowserTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_SCREENSHOT_H
+#define DIALOG_MULTIPLAYER_MEDIA_SCREENSHOT_H
+#include "tab.qc"
+CLASS(XonoticScreenshotBrowserTab, XonoticTab)
METHOD(XonoticScreenshotBrowserTab, fill, void(entity))
ATTRIB(XonoticScreenshotBrowserTab, title, string, "Screenshot")
ATTRIB(XonoticScreenshotBrowserTab, intendedWidth, float, 1)
entity makeXonoticScreenshotBrowserTab()
{
entity me;
- me = spawnXonoticScreenshotBrowserTab();
+ me = NEW(XonoticScreenshotBrowserTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticScreenshotViewerDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_MULTIPLAYER_MEDIA_SCREENSHOT_VIEWER_H
+#define DIALOG_MULTIPLAYER_MEDIA_SCREENSHOT_VIEWER_H
+#include "dialog.qc"
+CLASS(XonoticScreenshotViewerDialog, XonoticDialog)
METHOD(XonoticScreenshotViewerDialog, fill, void(entity))
METHOD(XonoticScreenshotViewerDialog, keyDown, float(entity, float, float, float))
METHOD(XonoticScreenshotViewerDialog, loadScreenshot, void(entity, string))
-#ifdef INTERFACE
-CLASS(XonoticProfileTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_MULTIPLAYER_PROFILE_H
+#define DIALOG_MULTIPLAYER_PROFILE_H
+#include "tab.qc"
+CLASS(XonoticProfileTab, XonoticTab)
METHOD(XonoticProfileTab, fill, void(entity))
METHOD(XonoticProfileTab, draw, void(entity))
ATTRIB(XonoticProfileTab, title, string, _("Profile"))
entity makeXonoticProfileTab()
{
entity me;
- me = spawnXonoticProfileTab();
+ me = NEW(XonoticProfileTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticQuitDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_QUIT_H
+#define DIALOG_QUIT_H
+#include "dialog.qc"
+CLASS(XonoticQuitDialog, XonoticDialog)
METHOD(XonoticQuitDialog, fill, void(entity))
ATTRIB(XonoticQuitDialog, title, string, _("Quit"))
ATTRIB(XonoticQuitDialog, color, vector, SKINCOLOR_DIALOG_QUIT)
-#ifdef INTERFACE
-CLASS(XonoticSandboxToolsDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_SANDBOXTOOLS_H
+#define DIALOG_SANDBOXTOOLS_H
+#include "rootdialog.qc"
+CLASS(XonoticSandboxToolsDialog, XonoticRootDialog)
METHOD(XonoticSandboxToolsDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
ATTRIB(XonoticSandboxToolsDialog, title, string, _("Sandbox Tools")) // ;)
ATTRIB(XonoticSandboxToolsDialog, color, vector, SKINCOLOR_DIALOG_SANDBOXTOOLS)
-#ifdef INTERFACE
-CLASS(XonoticSettingsDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SETTINGS_H
+#define DIALOG_SETTINGS_H
+#include "dialog.qc"
+CLASS(XonoticSettingsDialog, XonoticDialog)
METHOD(XonoticSettingsDialog, fill, void(entity))
ATTRIB(XonoticSettingsDialog, title, string, _("Settings"))
ATTRIB(XonoticSettingsDialog, color, vector, SKINCOLOR_DIALOG_SETTINGS)
-#ifdef INTERFACE
-CLASS(XonoticAudioSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_AUDIO_H
+#define DIALOG_SETTINGS_AUDIO_H
+#include "tab.qc"
+CLASS(XonoticAudioSettingsTab, XonoticTab)
METHOD(XonoticAudioSettingsTab, fill, void(entity))
ATTRIB(XonoticAudioSettingsTab, title, string, _("Audio"))
ATTRIB(XonoticAudioSettingsTab, intendedWidth, float, 0.9)
entity makeXonoticAudioSettingsTab()
{
entity me;
- me = spawnXonoticAudioSettingsTab();
+ me = NEW(XonoticAudioSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticEffectsSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_EFFECTS_H
+#define DIALOG_SETTINGS_EFFECTS_H
+#include "tab.qc"
+CLASS(XonoticEffectsSettingsTab, XonoticTab)
METHOD(XonoticEffectsSettingsTab, fill, void(entity))
ATTRIB(XonoticEffectsSettingsTab, title, string, _("Effects"))
ATTRIB(XonoticEffectsSettingsTab, intendedWidth, float, 0.9)
entity makeXonoticEffectsSettingsTab()
{
entity me;
- me = spawnXonoticEffectsSettingsTab();
+ me = NEW(XonoticEffectsSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticGameSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_H
+#define DIALOG_SETTINGS_GAME_H
+#include "tab.qc"
+CLASS(XonoticGameSettingsTab, XonoticTab)
METHOD(XonoticGameSettingsTab, fill, void(entity))
ATTRIB(XonoticGameSettingsTab, title, string, _("Game"))
ATTRIB(XonoticGameSettingsTab, intendedWidth, float, 0.9)
entity makeXonoticGameSettingsTab()
{
entity me;
- me = spawnXonoticGameSettingsTab();
+ me = NEW(XonoticGameSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticGameCrosshairSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_CROSSHAIR_H
+#define DIALOG_SETTINGS_GAME_CROSSHAIR_H
+#include "tab.qc"
+CLASS(XonoticGameCrosshairSettingsTab, XonoticTab)
//METHOD(XonoticGameCrosshairSettingsTab, toString, string(entity))
METHOD(XonoticGameCrosshairSettingsTab, fill, void(entity))
METHOD(XonoticGameCrosshairSettingsTab, showNotify, void(entity))
entity makeXonoticGameCrosshairSettingsTab()
{
entity me;
- me = spawnXonoticGameCrosshairSettingsTab();
+ me = NEW(XonoticGameCrosshairSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticGameHUDSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_HUD_H
+#define DIALOG_SETTINGS_GAME_HUD_H
+#include "tab.qc"
+CLASS(XonoticGameHUDSettingsTab, XonoticTab)
//METHOD(XonoticGameHUDSettingsTab, toString, string(entity))
METHOD(XonoticGameHUDSettingsTab, fill, void(entity))
METHOD(XonoticGameHUDSettingsTab, showNotify, void(entity))
entity makeXonoticGameHUDSettingsTab()
{
entity me;
- me = spawnXonoticGameHUDSettingsTab();
+ me = NEW(XonoticGameHUDSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticHUDConfirmDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SETTINGS_GAME_HUDCONFIRM_H
+#define DIALOG_SETTINGS_GAME_HUDCONFIRM_H
+#include "dialog.qc"
+CLASS(XonoticHUDConfirmDialog, XonoticDialog)
METHOD(XonoticHUDConfirmDialog, fill, void(entity))
ATTRIB(XonoticHUDConfirmDialog, title, string, _("Enter HUD editor"))
ATTRIB(XonoticHUDConfirmDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM)
-#ifdef INTERFACE
-CLASS(XonoticGameMessageSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_MESSAGES_H
+#define DIALOG_SETTINGS_GAME_MESSAGES_H
+#include "tab.qc"
+CLASS(XonoticGameMessageSettingsTab, XonoticTab)
//METHOD(XonoticGameWeaponsSettingsTab, toString, string(entity))
METHOD(XonoticGameMessageSettingsTab, fill, void(entity))
METHOD(XonoticGameMessageSettingsTab, showNotify, void(entity))
entity makeXonoticGameMessageSettingsTab()
{
entity me;
- me = spawnXonoticGameMessageSettingsTab();
+ me = NEW(XonoticGameMessageSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticGameModelSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_MODEL_H
+#define DIALOG_SETTINGS_GAME_MODEL_H
+#include "tab.qc"
+CLASS(XonoticGameModelSettingsTab, XonoticTab)
//METHOD(XonoticGameModelSettingsTab, toString, string(entity))
METHOD(XonoticGameModelSettingsTab, fill, void(entity))
METHOD(XonoticGameModelSettingsTab, showNotify, void(entity))
entity makeXonoticGameModelSettingsTab()
{
entity me;
- me = spawnXonoticGameModelSettingsTab();
+ me = NEW(XonoticGameModelSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticGameViewSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_VIEW_H
+#define DIALOG_SETTINGS_GAME_VIEW_H
+#include "tab.qc"
+CLASS(XonoticGameViewSettingsTab, XonoticTab)
//METHOD(XonoticGameCrosshairSettingsTab, toString, string(entity))
METHOD(XonoticGameViewSettingsTab, fill, void(entity))
METHOD(XonoticGameViewSettingsTab, showNotify, void(entity))
entity makeXonoticGameViewSettingsTab()
{
entity me;
- me = spawnXonoticGameViewSettingsTab();
+ me = NEW(XonoticGameViewSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticGameWeaponsSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_GAME_WEAPONS_H
+#define DIALOG_SETTINGS_GAME_WEAPONS_H
+#include "tab.qc"
+CLASS(XonoticGameWeaponsSettingsTab, XonoticTab)
//METHOD(XonoticGameWeaponsSettingsTab, toString, string(entity))
METHOD(XonoticGameWeaponsSettingsTab, fill, void(entity))
METHOD(XonoticGameWeaponsSettingsTab, showNotify, void(entity))
entity makeXonoticGameWeaponsSettingsTab()
{
entity me;
- me = spawnXonoticGameWeaponsSettingsTab();
+ me = NEW(XonoticGameWeaponsSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticInputSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_INPUT_H
+#define DIALOG_SETTINGS_INPUT_H
+#include "tab.qc"
+CLASS(XonoticInputSettingsTab, XonoticTab)
METHOD(XonoticInputSettingsTab, fill, void(entity))
ATTRIB(XonoticInputSettingsTab, title, string, _("Input"))
ATTRIB(XonoticInputSettingsTab, intendedWidth, float, 0.9)
entity makeXonoticInputSettingsTab()
{
entity me;
- me = spawnXonoticInputSettingsTab();
+ me = NEW(XonoticInputSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticUserbindEditDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SETTINGS_INPUT_USERBIND_H
+#define DIALOG_SETTINGS_INPUT_USERBIND_H
+#include "dialog.qc"
+CLASS(XonoticUserbindEditDialog, XonoticDialog)
METHOD(XonoticUserbindEditDialog, loadUserBind, void(entity, string, string, string))
METHOD(XonoticUserbindEditDialog, fill, void(entity))
ATTRIB(XonoticUserbindEditDialog, title, string, _("User defined key bind"))
-#ifdef INTERFACE
-CLASS(XonoticMiscSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_MISC_H
+#define DIALOG_SETTINGS_MISC_H
+#include "tab.qc"
+CLASS(XonoticMiscSettingsTab, XonoticTab)
METHOD(XonoticMiscSettingsTab, fill, void(entity))
ATTRIB(XonoticMiscSettingsTab, title, string, _("Misc"))
ATTRIB(XonoticMiscSettingsTab, intendedWidth, float, 0.9)
entity makeXonoticMiscSettingsTab()
{
entity me;
- me = spawnXonoticMiscSettingsTab();
+ me = NEW(XonoticMiscSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticCvarsDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SETTINGS_MISC_CVARS_H
+#define DIALOG_SETTINGS_MISC_CVARS_H
+#include "dialog.qc"
+CLASS(XonoticCvarsDialog, XonoticDialog)
METHOD(XonoticCvarsDialog, fill, void(entity))
METHOD(XonoticCvarsDialog, showNotify, void(entity))
ATTRIB(XonoticCvarsDialog, title, string, _("Advanced settings"))
-#ifdef INTERFACE
-CLASS(XonoticResetDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SETTINGS_MISC_RESET_H
+#define DIALOG_SETTINGS_MISC_RESET_H
+#include "dialog.qc"
+CLASS(XonoticResetDialog, XonoticDialog)
METHOD(XonoticResetDialog, fill, void(entity))
ATTRIB(XonoticResetDialog, title, string, _("Factory reset"))
ATTRIB(XonoticResetDialog, color, vector, SKINCOLOR_DIALOG_QUIT)
-#ifdef INTERFACE
-CLASS(XonoticUserSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_USER_H
+#define DIALOG_SETTINGS_USER_H
+#include "tab.qc"
+CLASS(XonoticUserSettingsTab, XonoticTab)
METHOD(XonoticUserSettingsTab, fill, void(entity))
ATTRIB(XonoticUserSettingsTab, title, string, _("User"))
ATTRIB(XonoticUserSettingsTab, intendedWidth, float, 0.9)
entity makeXonoticUserSettingsTab()
{
entity me;
- me = spawnXonoticUserSettingsTab();
+ me = NEW(XonoticUserSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticLanguageWarningDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SETTINGS_USER_LANGUAGEWARNING_H
+#define DIALOG_SETTINGS_USER_LANGUAGEWARNING_H
+#include "dialog.qc"
+CLASS(XonoticLanguageWarningDialog, XonoticDialog)
METHOD(XonoticLanguageWarningDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
ATTRIB(XonoticLanguageWarningDialog, title, string, _("Warning"))
ATTRIB(XonoticLanguageWarningDialog, color, vector, SKINCOLOR_DIALOG_HUDCONFIRM)
-#ifdef INTERFACE
-CLASS(XonoticVideoSettingsTab) EXTENDS(XonoticTab)
+#ifndef DIALOG_SETTINGS_VIDEO_H
+#define DIALOG_SETTINGS_VIDEO_H
+#include "tab.qc"
+CLASS(XonoticVideoSettingsTab, XonoticTab)
METHOD(XonoticVideoSettingsTab, fill, void(entity))
ATTRIB(XonoticVideoSettingsTab, title, string, _("Video"))
ATTRIB(XonoticVideoSettingsTab, intendedWidth, float, 0.9)
entity makeXonoticVideoSettingsTab()
{
entity me;
- me = spawnXonoticVideoSettingsTab();
+ me = NEW(XonoticVideoSettingsTab);
me.configureDialog(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticSingleplayerDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SINGLEPLAYER_H
+#define DIALOG_SINGLEPLAYER_H
+#include "dialog.qc"
+CLASS(XonoticSingleplayerDialog, XonoticDialog)
METHOD(XonoticSingleplayerDialog, fill, void(entity))
ATTRIB(XonoticSingleplayerDialog, title, string, _("Singleplayer"))
ATTRIB(XonoticSingleplayerDialog, color, vector, SKINCOLOR_DIALOG_SINGLEPLAYER)
-#ifdef INTERFACE
-CLASS(XonoticWinnerDialog) EXTENDS(XonoticDialog)
+#ifndef DIALOG_SINGLEPLAYER_WINNER_H
+#define DIALOG_SINGLEPLAYER_WINNER_H
+#include "dialog.qc"
+CLASS(XonoticWinnerDialog, XonoticDialog)
METHOD(XonoticWinnerDialog, fill, void(entity))
METHOD(XonoticWinnerDialog, focusEnter, void(entity))
ATTRIB(XonoticWinnerDialog, title, string, _("Winner"))
-#ifdef INTERFACE
-CLASS(XonoticTeamSelectDialog) EXTENDS(XonoticRootDialog)
+#ifndef DIALOG_TEAMSELECT_H
+#define DIALOG_TEAMSELECT_H
+#include "rootdialog.qc"
+CLASS(XonoticTeamSelectDialog, XonoticRootDialog)
METHOD(XonoticTeamSelectDialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
METHOD(XonoticTeamSelectDialog, showNotify, void(entity))
ATTRIB(XonoticTeamSelectDialog, title, string, _("Team Selection")) // ;)
-#ifdef INTERFACE
-CLASS(XonoticGametypeButton) EXTENDS(RadioButton)
+#ifndef GAMETYPEBUTTON_H
+#define GAMETYPEBUTTON_H
+#include "../item/radiobutton.qc"
+CLASS(XonoticGametypeButton, RadioButton)
METHOD(XonoticGametypeButton, configureXonoticGametypeButton, void(entity, float, string, string))
METHOD(XonoticGametypeButton, setChecked, void(entity, float))
ATTRIB(XonoticGametypeButton, fontSize, float, SKINFONTSIZE_NORMAL)
entity makeXonoticGametypeButton(float theGroup, string theCvar, string theText)
{
entity me;
- me = spawnXonoticGametypeButton();
+ me = NEW(XonoticGametypeButton);
me.configureXonoticGametypeButton(me, theGroup, theCvar, theText);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticGametypeList) EXTENDS(XonoticListBox)
+#ifndef GAMETYPELIST_H
+#define GAMETYPELIST_H
+#include "listbox.qc"
+CLASS(XonoticGametypeList, XonoticListBox)
METHOD(XonoticGametypeList, configureXonoticGametypeList, void(entity))
ATTRIB(XonoticGametypeList, rowsPerItem, float, 2)
METHOD(XonoticGametypeList, drawListBoxItem, void(entity, float, vector, float))
entity makeXonoticGametypeList(void)
{
entity me;
- me = spawnXonoticGametypeList();
+ me = NEW(XonoticGametypeList);
me.configureXonoticGametypeList(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticImage) EXTENDS(Image)
+#ifndef IMAGE_H
+#define IMAGE_H
+#include "../item/image.qc"
+CLASS(XonoticImage, Image)
METHOD(XonoticImage, configureXonoticImage, void(entity, string, float))
ENDCLASS(XonoticImage)
entity makeXonoticImage(string theImage, float theAspect);
entity makeXonoticImage(string theImage, float theAspect)
{
entity me;
- me = spawnXonoticImage();
+ me = NEW(XonoticImage);
me.configureXonoticImage(me, theImage, theAspect);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticInputBox) EXTENDS(InputBox)
+#ifndef INPUTBOX_H
+#define INPUTBOX_H
+#include "../item/inputbox.qc"
+CLASS(XonoticInputBox, InputBox)
METHOD(XonoticInputBox, configureXonoticInputBox, void(entity, float, string))
METHOD(XonoticInputBox, focusLeave, void(entity))
METHOD(XonoticInputBox, setText, void(entity, string))
entity makeXonoticInputBox(float doEditColorCodes, string theCvar)
{
entity me;
- me = spawnXonoticInputBox();
+ me = NEW(XonoticInputBox);
me.configureXonoticInputBox(me, doEditColorCodes, theCvar);
return me;
}
{
me.saveCvars(me);
}
-void XonoticInputBox_setText(entity me, string new)
+void XonoticInputBox_setText(entity me, string val)
{
- if(me.text != new)
+ if(me.text != val)
{
- SUPER(XonoticInputBox).setText(me, new);
+ SUPER(XonoticInputBox).setText(me, val);
if(me.onChange)
me.onChange(me, me.onChangeEntity);
if(me.saveImmediately)
me.saveCvars(me);
}
else
- SUPER(XonoticInputBox).setText(me, new);
+ SUPER(XonoticInputBox).setText(me, val);
}
void XonoticInputBox_loadCvars(entity me)
{
-#ifdef INTERFACE
-CLASS(XonoticKeyBinder) EXTENDS(XonoticListBox)
+#ifndef KEYBINDER_H
+#define KEYBINDER_H
+#include "listbox.qc"
+CLASS(XonoticKeyBinder, XonoticListBox)
METHOD(XonoticKeyBinder, configureXonoticKeyBinder, void(entity))
- ATTRIB(XonoticKeyBinder, rowsPerItem, float, 1)
+ ATTRIB(XonoticKeyBinder, rowsPerItem, int, 1)
METHOD(XonoticKeyBinder, drawListBoxItem, void(entity, float, vector, float))
METHOD(XonoticKeyBinder, doubleClickListBoxItem, void(entity, float, vector))
METHOD(XonoticKeyBinder, resizeNotify, void(entity, vector, vector, vector, vector))
ATTRIB(XonoticKeyBinder, columnKeysOrigin, float, 0)
ATTRIB(XonoticKeyBinder, columnKeysSize, float, 0)
- ATTRIB(XonoticKeyBinder, previouslySelected, float, -1)
+ ATTRIB(XonoticKeyBinder, previouslySelected, int, -1)
ATTRIB(XonoticKeyBinder, inMouseHandler, float, 0)
ATTRIB(XonoticKeyBinder, userbindEditButton, entity, NULL)
ATTRIB(XonoticKeyBinder, keyGrabButton, entity, NULL)
void KeyBinder_Bind_Change(entity btn, entity me);
void KeyBinder_Bind_Clear(entity btn, entity me);
void KeyBinder_Bind_Edit(entity btn, entity me);
+void KeyBinder_Bind_Reset_All(entity btn, entity me);
#endif
#ifdef IMPLEMENTATION
const string KEY_NOT_BOUND_CMD = "// not bound";
-const float MAX_KEYS_PER_FUNCTION = 2;
-const float MAX_KEYBINDS = 256;
+const int MAX_KEYS_PER_FUNCTION = 2;
+const int MAX_KEYBINDS = 256;
string Xonotic_KeyBinds_Functions[MAX_KEYBINDS];
string Xonotic_KeyBinds_Descriptions[MAX_KEYBINDS];
-float Xonotic_KeyBinds_Count = -1;
+int Xonotic_KeyBinds_Count = -1;
void Xonotic_KeyBinds_Read()
{
- float fh;
+ int fh;
string s;
Xonotic_KeyBinds_Count = 0;
entity makeXonoticKeyBinder()
{
entity me;
- me = spawnXonoticKeyBinder();
+ me = NEW(XonoticKeyBinder);
me.configureXonoticKeyBinder(me);
return me;
}
void replace_bind(string from, string to)
{
- float n, j, k;
+ int n, j;
+ float k; // not sure if float or int
n = tokenize(findkeysforcommand(from, 0)); // uses '...' strings
for(j = 0; j < n; ++j)
{
me.clearButton.disabled = 1;
keyGrabber = me;
}
-void XonoticKeyBinder_keyGrabbed(entity me, float key, float ascii)
+void XonoticKeyBinder_keyGrabbed(entity me, int key, bool ascii)
{
- float n, j, k, nvalid;
+ int n, j, nvalid;
+ float k;
string func;
me.keyGrabButton.forcePressed = 0;
{
KeyBinder_Bind_Change(NULL, me);
}
-void XonoticKeyBinder_setSelected(entity me, float i)
+void XonoticKeyBinder_setSelected(entity me, int i)
{
// handling of "unselectable" items
i = floor(0.5 + bound(0, i, me.nItems - 1));
me.userbindEditButton.disabled = (substring(Xonotic_KeyBinds_Descriptions[i], 0, 1) != "$");
SUPER(XonoticKeyBinder).setSelected(me, i);
}
-float XonoticKeyBinder_keyDown(entity me, float key, float ascii, float shift)
+float XonoticKeyBinder_keyDown(entity me, int key, bool ascii, float shift)
{
- float r;
- r = 1;
+ bool r = true;
switch(key)
{
case K_ENTER:
}
return r;
}
-void XonoticKeyBinder_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
+void XonoticKeyBinder_drawListBoxItem(entity me, int i, vector absSize, bool isSelected)
{
string s;
- float j, k, n;
+ int j, n;
+ float k;
vector theColor;
float theAlpha;
string func, descr;
-#ifdef INTERFACE
-CLASS(XonoticLanguageList) EXTENDS(XonoticListBox)
+#ifndef LANGUAGELIST_H
+#define LANGUAGELIST_H
+#include "listbox.qc"
+CLASS(XonoticLanguageList, XonoticListBox)
METHOD(XonoticLanguageList, configureXonoticLanguageList, void(entity))
ATTRIB(XonoticLanguageList, rowsPerItem, float, 1)
METHOD(XonoticLanguageList, drawListBoxItem, void(entity, float, vector, float))
entity makeXonoticLanguageList()
{
entity me;
- me = spawnXonoticLanguageList();
+ me = NEW(XonoticLanguageList);
me.configureXonoticLanguageList(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticListBox) EXTENDS(ListBox)
+#ifndef LISTBOX_H
+#define LISTBOX_H
+#include "../item/listbox.qc"
+CLASS(XonoticListBox, ListBox)
METHOD(XonoticListBox, configureXonoticListBox, void(entity))
ATTRIB(XonoticListBox, fontSize, float, SKINFONTSIZE_NORMAL)
ATTRIB(XonoticListBox, scrollbarWidth, float, SKINWIDTH_SCROLLBAR)
entity makeXonoticListBox()
{
entity me;
- me = spawnXonoticListBox();
+ me = NEW(XonoticListBox);
me.configureXonoticListBox(me);
return me;
}
-#ifdef INTERFACE
-CLASS(MainWindow) EXTENDS(ModalController)
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+#include "../item/modalcontroller.qc"
+CLASS(MainWindow, ModalController)
METHOD(MainWindow, configureMainWindow, void(entity))
METHOD(MainWindow, draw, void(entity))
ATTRIB(MainWindow, firstRunDialog, entity, NULL)
entity n, i;
// dialog run upon startup
- me.firstRunDialog = i = spawnXonoticFirstRunDialog();
+ me.firstRunDialog = i = NEW(XonoticFirstRunDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
// hud_configure dialogs
- i = spawnXonoticHUDExitDialog();
+ i = NEW(XonoticHUDExitDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDNotificationDialog();
+ i = NEW(XonoticHUDNotificationDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDAmmoDialog();
+ i = NEW(XonoticHUDAmmoDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDHealthArmorDialog();
+ i = NEW(XonoticHUDHealthArmorDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDChatDialog();
+ i = NEW(XonoticHUDChatDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDModIconsDialog();
+ i = NEW(XonoticHUDModIconsDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDPowerupsDialog();
+ i = NEW(XonoticHUDPowerupsDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDPressedKeysDialog();
+ i = NEW(XonoticHUDPressedKeysDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDRaceTimerDialog();
+ i = NEW(XonoticHUDRaceTimerDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDRadarDialog();
+ i = NEW(XonoticHUDRadarDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDScoreDialog();
+ i = NEW(XonoticHUDScoreDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDTimerDialog();
+ i = NEW(XonoticHUDTimerDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDVoteDialog();
+ i = NEW(XonoticHUDVoteDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDWeaponsDialog();
+ i = NEW(XonoticHUDWeaponsDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDEngineInfoDialog();
+ i = NEW(XonoticHUDEngineInfoDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDInfoMessagesDialog();
+ i = NEW(XonoticHUDInfoMessagesDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDPhysicsDialog();
+ i = NEW(XonoticHUDPhysicsDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- me.screenshotViewerDialog = i = spawnXonoticScreenshotViewerDialog();
+ me.screenshotViewerDialog = i = NEW(XonoticScreenshotViewerDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDCenterprintDialog();
+ i = NEW(XonoticHUDCenterprintDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticHUDBuffsDialog();
+ i = NEW(XonoticHUDBuffsDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
// dialogs used by settings
- me.userbindEditDialog = i = spawnXonoticUserbindEditDialog();
+ me.userbindEditDialog = i = NEW(XonoticUserbindEditDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- me.cvarsDialog = i = spawnXonoticCvarsDialog();
+ me.cvarsDialog = i = NEW(XonoticCvarsDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- me.resetDialog = i = spawnXonoticResetDialog();
+ me.resetDialog = i = NEW(XonoticResetDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- me.languageWarningDialog = i = spawnXonoticLanguageWarningDialog();
+ me.languageWarningDialog = i = NEW(XonoticLanguageWarningDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- me.hudconfirmDialog = i = spawnXonoticHUDConfirmDialog();
+ me.hudconfirmDialog = i = NEW(XonoticHUDConfirmDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
// dialog used by singleplayer
- me.winnerDialog = i = spawnXonoticWinnerDialog();
+ me.winnerDialog = i = NEW(XonoticWinnerDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
// dialog used by multiplayer/join
- me.serverInfoDialog = i = spawnXonoticServerInfoDialog();
+ me.serverInfoDialog = i = NEW(XonoticServerInfoDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- me.demostartconfirmDialog = i = spawnXonoticDemoStartConfirmDialog();
+ me.demostartconfirmDialog = i = NEW(XonoticDemoStartConfirmDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- me.demotimeconfirmDialog = i = spawnXonoticDemoTimeConfirmDialog();
+ me.demotimeconfirmDialog = i = NEW(XonoticDemoTimeConfirmDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
// dialogs used by multiplayer/create
- me.mapInfoDialog = i = spawnXonoticMapInfoDialog();
+ me.mapInfoDialog = i = NEW(XonoticMapInfoDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- me.mutatorsDialog = i = spawnXonoticMutatorsDialog();
+ me.mutatorsDialog = i = NEW(XonoticMutatorsDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
// mutator dialogs
- i = spawnXonoticSandboxToolsDialog();
+ i = NEW(XonoticSandboxToolsDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
// miscellaneous dialogs
- i = spawnXonoticTeamSelectDialog();
+ i = NEW(XonoticTeamSelectDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
- i = spawnXonoticMonsterToolsDialog();
+ i = NEW(XonoticMonsterToolsDialog);
i.configureDialog(i);
me.addItemCentered(me, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z * SKINALPHA_DIALOG_SANDBOXTOOLS);
// main dialogs/windows
- me.mainNexposee = n = spawnXonoticNexposee();
+ me.mainNexposee = n = NEW(XonoticNexposee);
/*
if(checkextension("DP_GECKO_SUPPORT"))
{
n.setNexposee(n, i, '0.1 0.1 0', SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
}
*/
- i = spawnXonoticSingleplayerDialog();
+ i = NEW(XonoticSingleplayerDialog);
i.configureDialog(i);
n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
n.setNexposee(n, i, SKINPOSITION_DIALOG_SINGLEPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
- i = spawnXonoticMultiplayerDialog();
+ i = NEW(XonoticMultiplayerDialog);
i.configureDialog(i);
n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
n.setNexposee(n, i, SKINPOSITION_DIALOG_MULTIPLAYER, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
- i = spawnXonoticSettingsDialog();
+ i = NEW(XonoticSettingsDialog);
i.configureDialog(i);
n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
n.setNexposee(n, i, SKINPOSITION_DIALOG_SETTINGS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
- i = spawnXonoticCreditsDialog();
+ i = NEW(XonoticCreditsDialog);
i.configureDialog(i);
n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
n.setNexposee(n, i, SKINPOSITION_DIALOG_CREDITS, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
n.pullNexposee(n, i, eY * (SKINHEIGHT_TITLE * SKINFONTSIZE_TITLE / conheight));
- i = spawnXonoticQuitDialog();
+ i = NEW(XonoticQuitDialog);
i.configureDialog(i);
n.addItemCentered(n, i, i.intendedWidth * eX + i.intendedHeight * eY, SKINALPHAS_MAINMENU_z);
n.setNexposee(n, i, SKINPOSITION_DIALOG_QUIT, SKINALPHAS_MAINMENU_x, SKINALPHAS_MAINMENU_y);
-#ifdef INTERFACE
-CLASS(XonoticMapList) EXTENDS(XonoticListBox)
+#ifndef MAPLIST_H
+#define MAPLIST_H
+#include "listbox.qc"
+CLASS(XonoticMapList, XonoticListBox)
METHOD(XonoticMapList, configureXonoticMapList, void(entity))
ATTRIB(XonoticMapList, rowsPerItem, float, 4)
METHOD(XonoticMapList, draw, void(entity))
METHOD(XonoticMapList, destroy, void(entity))
- ATTRIB(XonoticListBox, alphaBG, float, 0)
+ ATTRIB(XonoticMapList, alphaBG, float, 0)
ENDCLASS(XonoticMapList)
entity makeXonoticMapList();
entity makeXonoticMapListStringFilterBox(entity me, float doEditColorCodes, string theCvar);
entity makeXonoticMapList()
{
entity me;
- me = spawnXonoticMapList();
+ me = NEW(XonoticMapList);
me.configureXonoticMapList(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticNexposee) EXTENDS(Nexposee)
+#ifndef NEXPOSEE_H
+#define NEXPOSEE_H
+#include "../item/nexposee.qc"
+CLASS(XonoticNexposee, Nexposee)
METHOD(XonoticNexposee, configureXonoticNexposee, void(entity))
METHOD(XonoticNexposee, close, void(entity))
ENDCLASS(XonoticNexposee)
entity makeXonoticNexposee()
{
entity me;
- me = spawnXonoticNexposee();
+ me = NEW(XonoticNexposee);
me.configureXonoticNexposee(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticPlayerList) EXTENDS(XonoticListBox)
+#ifndef PLAYERLIST_H
+#define PLAYERLIST_H
+#include "listbox.qc"
+CLASS(XonoticPlayerList, XonoticListBox)
ATTRIB(XonoticPlayerList, rowsPerItem, float, 1)
METHOD(XonoticPlayerList, resizeNotify, void(entity, vector, vector, vector, vector))
METHOD(XonoticPlayerList, drawListBoxItem, void(entity, float, vector, float))
entity makeXonoticPlayerList()
{
entity me;
- me = spawnXonoticPlayerList();
+ me = NEW(XonoticPlayerList);
me.configureXonoticListBox(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticPlayerModelSelector) EXTENDS(XonoticImage)
+#ifndef PLAYERMODEL_H
+#define PLAYERMODEL_H
+#include "image.qc"
+CLASS(XonoticPlayerModelSelector, XonoticImage)
METHOD(XonoticPlayerModelSelector, configureXonoticPlayerModelSelector, void(entity))
METHOD(XonoticPlayerModelSelector, loadCvars, void(entity))
METHOD(XonoticPlayerModelSelector, saveCvars, void(entity))
entity makeXonoticPlayerModelSelector()
{
entity me;
- me = spawnXonoticPlayerModelSelector();
+ me = NEW(XonoticPlayerModelSelector);
me.configureXonoticPlayerModelSelector(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticPlayList) EXTENDS(XonoticListBox)
+#ifndef PLAYLIST_H
+#define PLAYLIST_H
+#include "listbox.qc"
+CLASS(XonoticPlayList, XonoticListBox)
METHOD(XonoticPlayList, configureXonoticPlayList, void(entity))
ATTRIB(XonoticPlayList, rowsPerItem, float, 1)
METHOD(XonoticPlayList, resizeNotify, void(entity, vector, vector, vector, vector))
entity makeXonoticPlayList()
{
entity me;
- me = spawnXonoticPlayList();
+ me = NEW(XonoticPlayList);
me.configureXonoticPlayList(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticRadioButton) EXTENDS(RadioButton)
+#ifndef RADIOBUTTON_H
+#define RADIOBUTTON_H
+#include "../item/radiobutton.qc"
+CLASS(XonoticRadioButton, RadioButton)
METHOD(XonoticRadioButton, configureXonoticRadioButton, void(entity, float, string, string, string))
METHOD(XonoticRadioButton, draw, void(entity))
METHOD(XonoticRadioButton, setChecked, void(entity, float))
entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, string theText)
{
entity me;
- me = spawnXonoticRadioButton();
+ me = NEW(XonoticRadioButton);
me.configureXonoticRadioButton(me, theGroup, theCvar, theValue, theText);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticRootDialog) EXTENDS(XonoticDialog)
+#ifndef ROOTDIALOG_H
+#define ROOTDIALOG_H
+#include "dialog.qc"
+CLASS(XonoticRootDialog, XonoticDialog)
// still to be customized by user
/*
ATTRIB(XonoticDialog, closable, float, 1)
-#ifdef INTERFACE
-CLASS(XonoticScreenshotImage) EXTENDS(XonoticImage)
+#ifndef SCREENSHOTIMAGE_H
+#define SCREENSHOTIMAGE_H
+#include "image.qc"
+CLASS(XonoticScreenshotImage, XonoticImage)
METHOD(XonoticScreenshotImage, configureXonoticScreenshotImage, void(entity))
METHOD(XonoticScreenshotImage, load, void(entity, string))
METHOD(XonoticScreenshotImage, draw, void(entity))
entity makeXonoticScreenshotImage()
{
entity me;
- me = spawnXonoticScreenshotImage();
+ me = NEW(XonoticScreenshotImage);
me.configureXonoticScreenshotImage(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticScreenshotList) EXTENDS(XonoticListBox)
+#ifndef SCREENSHOTLIST_H
+#define SCREENSHOTLIST_H
+#include "listbox.qc"
+CLASS(XonoticScreenshotList, XonoticListBox)
METHOD(XonoticScreenshotList, configureXonoticScreenshotList, void(entity))
ATTRIB(XonoticScreenshotList, rowsPerItem, float, 1)
METHOD(XonoticScreenshotList, resizeNotify, void(entity, vector, vector, vector, vector))
entity makeXonoticScreenshotList()
{
entity me;
- me = spawnXonoticScreenshotList();
+ me = NEW(XonoticScreenshotList);
me.configureXonoticScreenshotList(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticServerList) EXTENDS(XonoticListBox)
+#ifndef SERVERLIST_H
+#define SERVERLIST_H
+#include "listbox.qc"
+CLASS(XonoticServerList, XonoticListBox)
METHOD(XonoticServerList, configureXonoticServerList, void(entity))
ATTRIB(XonoticServerList, rowsPerItem, float, 1)
METHOD(XonoticServerList, draw, void(entity))
void ServerList_Update_favoriteButton(entity btn, entity me);
// fields for category entities
-const float MAX_CATEGORIES = 9;
-const float CATEGORY_FIRST = 1;
+const int MAX_CATEGORIES = 9;
+const int CATEGORY_FIRST = 1;
entity categories[MAX_CATEGORIES];
-float category_ent_count;
+int category_ent_count;
.string cat_name;
.string cat_string;
.string cat_enoverride_string;
.float cat_dioverride;
// fields for drawing categories
-float category_name[MAX_CATEGORIES];
-float category_item[MAX_CATEGORIES];
-float category_draw_count;
+int category_name[MAX_CATEGORIES];
+int category_item[MAX_CATEGORIES];
+int category_draw_count;
#define SLIST_CATEGORIES \
SLIST_CATEGORY(CAT_FAVORITED, "", "", ZCTX(_("SLCAT^Favorites"))) \
#define SLIST_CATEGORY_AUTOCVAR(name) autocvar_menu_slist_categories_##name##_override
#define SLIST_CATEGORY(name,enoverride,dioverride,str) \
- float name; \
+ int name; \
string SLIST_CATEGORY_AUTOCVAR(name) = enoverride;
SLIST_CATEGORIES
#undef SLIST_CATEGORY
SLIST_CATEGORIES
#undef SLIST_CATEGORY
- float i, x, catnum;
+ int i, x, catnum;
string s;
#define PROCESS_OVERRIDE(override_string,override_field) \
}
// Supporting Functions
-entity RetrieveCategoryEnt(float catnum)
+entity RetrieveCategoryEnt(int catnum)
{
if((catnum > 0) && (catnum <= category_ent_count))
{
}
}
-float IsServerInList(string list, string srv)
+bool IsServerInList(string list, string srv)
{
string p;
- float i, n;
+ int i, n;
if(srv == "")
return false;
srv = netaddress_resolve(srv, 26000);
return false;
}
-float CheckCategoryOverride(float cat)
+int CheckCategoryOverride(int cat)
{
entity catent = RetrieveCategoryEnt(cat);
if(catent)
{
- float override = (autocvar_menu_slist_categories ? catent.cat_enoverride : catent.cat_dioverride);
+ int override = (autocvar_menu_slist_categories ? catent.cat_enoverride : catent.cat_dioverride);
if(override) { return override; }
else { return cat; }
}
}
}
-float CheckCategoryForEntry(float entry)
+int CheckCategoryForEntry(int entry)
{
string s, k, v, modtype = "";
- float j, m, impure = 0, freeslots = 0, sflags = 0;
+ int j, m, impure = 0, freeslots = 0, sflags = 0;
s = gethostcachestring(SLIST_FIELD_QCSTATUS, entry);
m = tokenizebyseparator(s, ":");
void XonoticServerList_toggleFavorite(entity me, string srv)
{
string s, s0, s1, s2, srv_resolved, p;
- float i, n, f;
+ int i, n;
+ bool f = false;
srv_resolved = netaddress_resolve(srv, 26000);
p = crypto_getidfp(srv_resolved);
s = cvar_string("net_slist_favorites");
n = tokenize_console(s);
- f = 0;
for(i = 0; i < n; ++i)
{
if(substring(argv(i), 0, 1) != "[" && strlen(argv(i)) == 44 && strstrofs(argv(i), ".", 0) < 0)
cvar_set("net_slist_favorites", strcat(s0, s1, s2));
s = cvar_string("net_slist_favorites");
n = tokenize_console(s);
- f = 1;
+ f = true;
--i;
}
entity makeXonoticServerList()
{
entity me;
- me = spawnXonoticServerList();
+ me = NEW(XonoticServerList);
me.configureXonoticServerList(me);
return me;
}
// clear list
me.nItems = 0;
}
-void XonoticServerList_setSelected(entity me, float i)
+void XonoticServerList_setSelected(entity me, int i)
{
- float save;
- save = me.selectedItem;
+ //int save = me.selectedItem;
SUPER(XonoticServerList).setSelected(me, i);
/*
if(me.selectedItem == save)
me.ipAddressBox.cursorPos = strlen(me.selectedServer);
me.ipAddressBoxFocused = -1;
}
-void XonoticServerList_refreshServerList(entity me, float mode)
+void XonoticServerList_refreshServerList(entity me, int mode)
{
//print("refresh of type ", ftos(mode), "\n");
if(mode >= REFRESHSERVERLIST_REFILTER)
{
- float m, i, n;
- float listflags = 0;
+ float m;
+ int i, n;
+ int listflags = 0;
string s, typestr, modstr;
s = me.filterString;
void XonoticServerList_draw(entity me)
{
- float i, found, owned;
+ int i;
+ bool found = false, owned;
if(_Nex_ExtResponseSystem_BannedServersNeedsRefresh)
{
me.infoButton.disabled = ((me.nItems == 0) || !owned);
me.favoriteButton.disabled = ((me.nItems == 0) && (me.ipAddressBox.text == ""));
- found = 0;
if(me.selectedServer)
{
for(i = 0; i < me.nItems; ++i)
if(gethostcachestring(SLIST_FIELD_CNAME, i) == me.selectedServer)
{
me.selectedItem = i;
- found = 1;
+ found = true;
break;
}
}
me.ipAddressBox.cursorPos = 0;
me.ipAddressBoxFocused = -1;
}
-void XonoticServerList_setSortOrder(entity me, float fld, float direction)
+void XonoticServerList_setSortOrder(entity me, int fld, int direction)
{
if(me.currentSortField == fld)
direction = -me.currentSortOrder;
me.positionSortButton(me, me.sortButton4, me.columnTypeOrigin, me.columnTypeSize, _("Type"), ServerList_TypeSort_Click);
me.positionSortButton(me, me.sortButton5, me.columnPlayersOrigin, me.columnPlayersSize, _("Players"), ServerList_PlayerSort_Click);
- float f;
- f = me.currentSortField;
+ int f = me.currentSortField;
if(f >= 0)
{
me.currentSortField = -1;
vector sz = boxToGlobalSize(eY * me.itemHeight + eX * (1 - me.controlWidth), me.size);
DialogOpenButton_Click_withCoords(me, main.serverInfoDialog, org, sz);
}
-void XonoticServerList_doubleClickListBoxItem(entity me, float i, vector where)
+void XonoticServerList_doubleClickListBoxItem(entity me, int i, vector where)
{
ServerList_Connect_Click(NULL, me);
}
-void XonoticServerList_drawListBoxItem(entity me, float i, vector absSize, float isSelected)
+void XonoticServerList_drawListBoxItem(entity me, int i, vector absSize, bool isSelected)
{
// layout: Ping, Server name, Map name, NP, TP, MP
- float p, q;
- float isv4, isv6;
+ float p;
+ int q;
+ bool isv4, isv6;
vector theColor;
float theAlpha;
- float m, pure, freeslots, j, sflags;
+ bool pure = false;
+ int freeslots = -1, sflags = -1, j, m;
string s, typestr, versionstr, k, v, modname;
//printf("time: %f, i: %d, item: %d, nitems: %d\n", time, i, item, me.nItems);
versionstr = argv(1);
}
freeslots = -1;
- sflags = -1;
modname = "";
- pure = 0;
for(j = 2; j < m; ++j)
{
if(argv(j) == "")
k = substring(argv(j), 0, 1);
v = substring(argv(j), 1, -1);
if(k == "P")
- pure = stof(v);
+ pure = stob(v);
else if(k == "S")
freeslots = stof(v);
else if(k == "F")
- sflags = stof(v);
+ sflags = stoi(v);
else if(k == "M")
modname = v;
}
if(modname != "CTS")
if(modname != "NIX")
if(modname != "NewToys")
- pure = 0;
+ pure = false;
if(gethostcachenumber(SLIST_FIELD_FREESLOTS, i) <= 0)
theAlpha = SKINALPHA_SERVERLIST_FULL;
theAlpha = 1;
p = gethostcachenumber(SLIST_FIELD_PING, i);
- const float PING_LOW = 75;
- const float PING_MED = 200;
- const float PING_HIGH = 500;
+ const int PING_LOW = 75;
+ const int PING_MED = 200;
+ const int PING_HIGH = 500;
if(p < PING_LOW)
theColor = SKINCOLOR_SERVERLIST_LOWPING + (SKINCOLOR_SERVERLIST_MEDPING - SKINCOLOR_SERVERLIST_LOWPING) * (p / PING_LOW);
else if(p < PING_MED)
s = gethostcachestring(SLIST_FIELD_CNAME, i);
- isv4 = isv6 = 0;
+ isv4 = isv6 = false;
if(substring(s, 0, 1) == "[")
{
- isv6 = 1;
+ isv6 = true;
me.seenIPv6 += 1;
}
else if(strstrofs("0123456789", substring(s, 0, 1), 0) >= 0)
{
- isv4 = 1;
+ isv4 = true;
me.seenIPv4 += 1;
}
draw_Text(me.realUpperMargin * eY + (me.columnPlayersOrigin + (me.columnPlayersSize - draw_TextWidth(s, 0, me.realFontSize)) * 0.5) * eX, s, me.realFontSize, theColor, theAlpha, 0);
}
-float XonoticServerList_keyDown(entity me, float scan, float ascii, float shift)
+bool XonoticServerList_keyDown(entity me, int scan, bool ascii, bool shift)
{
vector org, sz;
if(scan == K_ENTER || scan == K_KP_ENTER)
{
ServerList_Connect_Click(NULL, me);
- return 1;
+ return true;
}
else if(scan == K_MOUSE2 || scan == K_SPACE)
{
m_play_click_sound(MENU_SOUND_OPEN);
main.serverInfoDialog.loadServerInfo(main.serverInfoDialog, me.selectedItem);
DialogOpenButton_Click_withCoords(me, main.serverInfoDialog, org, sz);
- return 1;
+ return true;
}
- return 0;
+ return false;
}
else if(scan == K_INS || scan == K_MOUSE3 || scan == K_KP_INS)
{
{
me.toggleFavorite(me, me.selectedServer);
me.ipAddressBoxFocused = -1;
- return 1;
+ return true;
}
- return 0;
+ return false;
}
else if(SUPER(XonoticServerList).keyDown(me, scan, ascii, shift))
- return 1;
+ return true;
else if(!me.controlledTextbox)
- return 0;
+ return false;
else
return me.controlledTextbox.keyDown(me.controlledTextbox, scan, ascii, shift);
}
-float XonoticServerList_getTotalHeight(entity me) {
+float XonoticServerList_getTotalHeight(entity me)
+{
float num_normal_rows = me.nItems;
- float num_headers = category_draw_count;
+ int num_headers = category_draw_count;
return me.itemHeight * (num_normal_rows + me.categoriesHeight * num_headers);
}
-float XonoticServerList_getItemAtPos(entity me, float pos) {
+int XonoticServerList_getItemAtPos(entity me, float pos)
+{
pos = pos / me.itemHeight;
- float i;
+ int i;
for (i = category_draw_count - 1; i >= 0; --i) {
- float itemidx = category_item[i];
+ int itemidx = category_item[i];
float itempos = i * me.categoriesHeight + category_item[i];
if (pos >= itempos + me.categoriesHeight + 1)
return itemidx + 1 + floor(pos - (itempos + me.categoriesHeight + 1));
// No category matches? Note that category 0 is... 0. Therefore no headings exist at all.
return floor(pos);
}
-float XonoticServerList_getItemStart(entity me, float item) {
- float i;
+float XonoticServerList_getItemStart(entity me, int item)
+{
+ int i;
for (i = category_draw_count - 1; i >= 0; --i) {
- float itemidx = category_item[i];
+ int itemidx = category_item[i];
float itempos = i * me.categoriesHeight + category_item[i];
if (item >= itemidx + 1)
return (itempos + me.categoriesHeight + 1 + item - (itemidx + 1)) * me.itemHeight;
// No category matches? Note that category 0 is... 0. Therefore no headings exist at all.
return item * me.itemHeight;
}
-float XonoticServerList_getItemHeight(entity me, float item) {
- float i;
+float XonoticServerList_getItemHeight(entity me, int item)
+{
+ int i;
for (i = 0; i < category_draw_count; ++i) {
// Matches exactly the headings with increased height.
if (item == category_item[i])
-#ifdef INTERFACE
-CLASS(XonoticSkinList) EXTENDS(XonoticListBox)
+#ifndef SKINLIST_H
+#define SKINLIST_H
+#include "listbox.qc"
+CLASS(XonoticSkinList, XonoticListBox)
METHOD(XonoticSkinList, configureXonoticSkinList, void(entity))
ATTRIB(XonoticSkinList, rowsPerItem, float, 4)
METHOD(XonoticSkinList, resizeNotify, void(entity, vector, vector, vector, vector))
entity makeXonoticSkinList()
{
entity me;
- me = spawnXonoticSkinList();
+ me = NEW(XonoticSkinList);
me.configureXonoticSkinList(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticSlider) EXTENDS(Slider)
+#ifndef SLIDER_H
+#define SLIDER_H
+#include "../item/slider.qc"
+CLASS(XonoticSlider, Slider)
METHOD(XonoticSlider, configureXonoticSlider, void(entity, float, float, float, string))
METHOD(XonoticSlider, setValue, void(entity, float))
ATTRIB(XonoticSlider, fontSize, float, SKINFONTSIZE_NORMAL)
entity makeXonoticSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
{
entity me;
- me = spawnXonoticSlider();
+ me = NEW(XonoticSlider);
me.configureXonoticSlider(me, theValueMin, theValueMax, theValueStep, theCvar);
return me;
}
#include "../../warpzonelib/mathlib.qh"
-#ifdef INTERFACE
-CLASS(XonoticDecibelsSlider) EXTENDS(XonoticSlider)
+#ifndef SLIDER_DECIBELS_H
+#define SLIDER_DECIBELS_H
+#include "slider.qc"
+CLASS(XonoticDecibelsSlider, XonoticSlider)
METHOD(XonoticDecibelsSlider, loadCvars, void(entity))
METHOD(XonoticDecibelsSlider, saveCvars, void(entity))
METHOD(XonoticDecibelsSlider, valueToText, string(entity, float))
entity makeXonoticDecibelsSlider(float theValueMin, float theValueMax, float theValueStep, string theCvar)
{
entity me;
- me = spawnXonoticDecibelsSlider();
+ me = NEW(XonoticDecibelsSlider);
me.configureXonoticSlider(me, theValueMin, theValueMax, theValueStep, theCvar);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticParticlesSlider) EXTENDS(XonoticTextSlider)
+#ifndef SLIDER_PARTICLES_H
+#define SLIDER_PARTICLES_H
+#include "textslider.qc"
+CLASS(XonoticParticlesSlider, XonoticTextSlider)
METHOD(XonoticParticlesSlider, configureXonoticParticlesSlider, void(entity))
METHOD(XonoticParticlesSlider, loadCvars, void(entity))
METHOD(XonoticParticlesSlider, saveCvars, void(entity))
entity makeXonoticParticlesSlider()
{
entity me;
- me = spawnXonoticParticlesSlider();
+ me = NEW(XonoticParticlesSlider);
me.configureXonoticParticlesSlider(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticPicmipSlider) EXTENDS(XonoticTextSlider)
+#ifndef SLIDER_PICMIP_H
+#define SLIDER_PICMIP_H
+#include "textslider.qc"
+CLASS(XonoticPicmipSlider, XonoticTextSlider)
METHOD(XonoticPicmipSlider, configureXonoticPicmipSlider, void(entity))
METHOD(XonoticPicmipSlider, draw, void(entity))
METHOD(XonoticPicmipSlider, autofix, void(entity))
entity makeXonoticPicmipSlider()
{
entity me;
- me = spawnXonoticPicmipSlider();
+ me = NEW(XonoticPicmipSlider);
me.configureXonoticPicmipSlider(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticResolutionSlider) EXTENDS(XonoticTextSlider)
+#ifndef SLIDER_RESOLUTION_H
+#define SLIDER_RESOLUTION_H
+#include "textslider.qc"
+CLASS(XonoticResolutionSlider, XonoticTextSlider)
METHOD(XonoticResolutionSlider, configureXonoticResolutionSlider, void(entity))
METHOD(XonoticResolutionSlider, loadResolutions, void(entity, float))
METHOD(XonoticResolutionSlider, addResolution, void(entity, float, float, float))
entity makeXonoticResolutionSlider()
{
entity me;
- me = spawnXonoticResolutionSlider();
+ me = NEW(XonoticResolutionSlider);
me.configureXonoticResolutionSlider(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticScoreboardFadeTimeSlider) EXTENDS(XonoticTextSlider)
+#ifndef SLIDER_SBFADETIME_H
+#define SLIDER_SBFADETIME_H
+#include "textslider.qc"
+CLASS(XonoticScoreboardFadeTimeSlider, XonoticTextSlider)
METHOD(XonoticScoreboardFadeTimeSlider, configureXonoticScoreboardFadeTimeSlider, void(entity))
METHOD(XonoticScoreboardFadeTimeSlider, loadCvars, void(entity))
METHOD(XonoticScoreboardFadeTimeSlider, saveCvars, void(entity))
entity makeXonoticScoreboardFadeTimeSlider()
{
entity me;
- me = spawnXonoticScoreboardFadeTimeSlider();
+ me = NEW(XonoticScoreboardFadeTimeSlider);
me.configureXonoticScoreboardFadeTimeSlider(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticSoundList) EXTENDS(XonoticListBox)
+#ifndef SOUNDLIST_H
+#define SOUNDLIST_H
+#include "listbox.qc"
+CLASS(XonoticSoundList, XonoticListBox)
METHOD(XonoticSoundList, configureXonoticSoundList, void(entity))
ATTRIB(XonoticSoundList, rowsPerItem, float, 1)
METHOD(XonoticSoundList, resizeNotify, void(entity, vector, vector, vector, vector))
entity makeXonoticSoundList()
{
entity me;
- me = spawnXonoticSoundList();
+ me = NEW(XonoticSoundList);
me.configureXonoticSoundList(me);
return me;
}
#include "../../common/counting.qh"
#include "../../common/playerstats.qh"
-#ifdef INTERFACE
-CLASS(XonoticStatsList) EXTENDS(XonoticListBox)
+#ifndef STATSLIST_H
+#define STATSLIST_H
+#include "listbox.qc"
+CLASS(XonoticStatsList, XonoticListBox)
METHOD(XonoticStatsList, configureXonoticStatsList, void(entity))
ATTRIB(XonoticStatsList, rowsPerItem, float, 1.4)
METHOD(XonoticStatsList, resizeNotify, void(entity, vector, vector, vector, vector))
entity makeXonoticStatsList()
{
entity me;
- me = spawnXonoticStatsList();
+ me = NEW(XonoticStatsList);
me.configureXonoticStatsList(me);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticTab) EXTENDS(Tab)
+#ifndef TAB_H
+#define TAB_H
+#include "../item/tab.qc"
+CLASS(XonoticTab, Tab)
// still to be customized by user
/*
ATTRIB(XonoticTab, intendedWidth, float, 0)
-#ifdef INTERFACE
-CLASS(XonoticTabController) EXTENDS(ModalController)
+#ifndef TABCONTROLLER_H
+#define TABCONTROLLER_H
+#include "../item/modalcontroller.qc"
+CLASS(XonoticTabController, ModalController)
METHOD(XonoticTabController, configureXonoticTabController, void(entity, float))
METHOD(XonoticTabController, makeTabButton, entity(entity, string, entity))
ATTRIB(XonoticTabController, rows, float, 0)
entity makeXonoticTabController(float theRows)
{
entity me;
- me = spawnXonoticTabController();
+ me = NEW(XonoticTabController);
me.configureXonoticTabController(me, theRows);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticTextLabel) EXTENDS(Label)
+#ifndef TEXTLABEL_H
+#define TEXTLABEL_H
+#include "../item/label.qc"
+CLASS(XonoticTextLabel, Label)
METHOD(XonoticTextLabel, configureXonoticTextLabel, void(entity, float, string))
METHOD(XonoticTextLabel, draw, void(entity))
ATTRIB(XonoticTextLabel, fontSize, float, SKINFONTSIZE_NORMAL)
ATTRIB(XonoticTextLabel, disabledAlpha, float, SKINALPHA_DISABLED)
ENDCLASS(XonoticTextLabel)
entity makeXonoticTextLabel(float theAlign, string theText);
+entity makeXonoticHeaderLabel(string theText);
#endif
#ifdef IMPLEMENTATION
entity makeXonoticTextLabel(float theAlign, string theText)
{
entity me;
- me = spawnXonoticTextLabel();
+ me = NEW(XonoticTextLabel);
me.configureXonoticTextLabel(me, theAlign, theText);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticTextSlider) EXTENDS(TextSlider)
+#ifndef TEXTSLIDER_H
+#define TEXTSLIDER_H
+#include "../item/textslider.qc"
+CLASS(XonoticTextSlider, TextSlider)
METHOD(XonoticTextSlider, configureXonoticTextSlider, void(entity, string))
METHOD(XonoticTextSlider, setValue, void(entity, float))
METHOD(XonoticTextSlider, configureXonoticTextSliderValues, void(entity))
entity makeXonoticTextSlider(string theCvar)
{
entity me;
- me = spawnXonoticTextSlider();
+ me = NEW(XonoticTextSlider);
me.configureXonoticTextSlider(me, theCvar);
return me;
}
+#include "util.qh"
+#include "../menu.qh"
+#include "../oo/base.qh"
+#include "../../common/campaign_common.qh"
+#include "../../common/constants.qh"
+#include "../../common/mapinfo.qh"
#include "../../common/urllib.qh"
+#include "../../common/util.qh"
+#include "../../common/command/generic.qh"
float GL_CheckExtension(string ext)
{
return string_null;
}
+.entity parent, firstChild, nextSibling;
void forAllDescendants(entity root, void(entity, entity) funcPre, void(entity, entity) funcPost, entity pass)
{
depthfirst(root, parent, firstChild, nextSibling, funcPre, funcPost, pass);
void SUB_Null_ee(entity e1, entity e2)
{
}
+
+.void(entity) saveCvars;
void saveCvarsOf(entity ignore, entity e)
{
if(e.saveCvars)
e.saveCvars(e);
}
+
+.void(entity) loadCvars;
void loadCvarsOf(entity ignore, entity e)
{
if(e.loadCvars)
.string cvarString_setDependent;
.string cvarValue_setDependent;
.float(entity) func_setDependent;
+.bool disabled;
void setDependent_Check(entity e)
{
float f;
setDependent_Check(e);
e.draw_setDependent(e);
}
+.void(entity) draw;
void setDependent(entity e, string theCvarName, float theCvarMin, float theCvarMax)
{
e.draw_setDependent = e.draw;
draw_CenterText('0.5 0.1 0', sprintf(_("^1%s TEST BUILD"), autocvar_menu_watermark), globalToBoxSize('32 32 0', draw_scale), '1 1 1', 0.05, 1);
}
}
+void DialogOpenButton_Click_withCoords(entity button, entity tab, vector theOrigin, vector theSize);
+.entity winnerDialog;
void preMenuDraw()
{
vector fs, sz = '0 0 0', line, mid;
return "";
}
+.void(entity) TR;
+.void(entity, float, float, entity) TD;
+.void(entity, float) TDempty;
+entity makeXonoticTextLabel(float theAlign, string theText);
+entity makeXonoticTextSlider(string);
+.void(entity, string, string) addValue;
+.void(entity) configureXonoticTextSliderValues;
+entity makeXonoticColorpickerString(string theCvar, string theDefaultCvar);
+entity makeXonoticCheckBoxString(string, string, string, string);
+entity makeXonoticCheckBox(float, string, string);
+.bool sendCvars;
+
void dialog_hudpanel_common_notoggle(entity me, string panelname)
{
float i;
-#ifdef INTERFACE
-CLASS(XonoticWeaponarenaCheckBox) EXTENDS(CheckBox)
+#ifndef WEAPONARENACHECKBOX_H
+#define WEAPONARENACHECKBOX_H
+#include "../item/checkbox.qc"
+CLASS(XonoticWeaponarenaCheckBox, CheckBox)
METHOD(XonoticWeaponarenaCheckBox, configureXonoticWeaponarenaCheckBox, void(entity, string, string))
METHOD(XonoticWeaponarenaCheckBox, setChecked, void(entity, float))
ATTRIB(XonoticWeaponarenaCheckBox, fontSize, float, SKINFONTSIZE_NORMAL)
entity makeXonoticWeaponarenaCheckBox(string theWeapon, string theText)
{
entity me;
- me = spawnXonoticWeaponarenaCheckBox();
+ me = NEW(XonoticWeaponarenaCheckBox);
me.configureXonoticWeaponarenaCheckBox(me, theWeapon, theText);
return me;
}
-#ifdef INTERFACE
-CLASS(XonoticWeaponsList) EXTENDS(XonoticListBox)
+#ifndef WEAPONSLIST_H
+#define WEAPONSLIST_H
+#include "listbox.qc"
+CLASS(XonoticWeaponsList, XonoticListBox)
METHOD(XonoticWeaponsList, configureXonoticWeaponsList, void(entity))
METHOD(XonoticWeaponsList, toString, string(entity))
ATTRIB(XonoticWeaponsList, rowsPerItem, float, 1)
entity makeXonoticWeaponsList()
{
entity me;
- me = spawnXonoticWeaponsList();
+ me = NEW(XonoticWeaponsList);
me.configureXonoticWeaponsList(me);
return me;
}
}
float XonoticWeaponsList_mouseDrag(entity me, vector pos)
{
- float f, i;
- i = me.selectedItem;
- f = SUPER(XonoticWeaponsList).mouseDrag(me, pos);
+ int i = me.selectedItem;
+ float f = SUPER(XonoticWeaponsList).mouseDrag(me, pos);
if(me.pressed != 1) // don't change priority if the person is just scrolling
{
--- /dev/null
+#ifndef SERVER___H
+#define SERVER___H
+
+#include "autocvars.qh"
+#include "constants.qh"
+#include "defs.qh"
+#include "miscfunctions.qh"
+
+#include "../dpdefs/progsdefs.qh"
+#include "../dpdefs/dpextensions.qh"
+
+#endif
void mean_accumulate(entity e, .float a, .float c, float mean, float value, float weight)
{
- if(weight == 0)
+ if (weight == 0)
return;
- if(mean == 0)
- e.a *= pow(value, weight);
+ if (mean == 0)
+ e.(a) *= pow(value, weight);
else
- e.a += pow(value, mean) * weight;
- e.c += weight;
+ e.(a) += pow(value, mean) * weight;
+ e.(c) += weight;
}
float mean_evaluate(entity e, .float a, .float c, float mean)
{
- if(e.c == 0)
+ if (e.(c) == 0)
return 0;
- if(mean == 0)
- return pow(e.a, 1.0 / e.c);
+ if (mean == 0)
+ return pow(e.(a), 1.0 / e.(c));
else
- return pow(e.a / e.c, 1.0 / mean);
+ return pow(e.(a) / e.(c), 1.0 / mean);
}
#define MEAN_ACCUMULATE(prefix,v,w) mean_accumulate(self,prefix##_accumulator,prefix##_count,prefix##_mean,v,w)
#elif defined(SVQC)
#include "../dpdefs/progsdefs.qh"
#include "../dpdefs/dpextensions.qh"
- #include "vehicles/vehicles_def.qh"
+ #include "vehicles/vehicle.qh"
#include "antilag.qh"
#endif
vector antilag_takebackorigin(entity e, float t)
{
- float i0, i1;
-
- i0 = antilag_find(e, t);
- if(i0 < 0)
+ int i0 = antilag_find(e, t);
+ if (i0 < 0)
{
// IN THE PRESENT
if(e.antilag_takenback)
else
return e.origin;
}
- i1 = i0 + 1;
- if(i1 >= ANTILAG_MAX_ORIGINS)
+ int i1 = i0 + 1;
+ if (i1 >= ANTILAG_MAX_ORIGINS)
i1 = 0;
return lerpv(e.(antilag_times[i0]), e.(antilag_origins[i0]), e.(antilag_times[i1]), e.(antilag_origins[i1]), t);
void antilag_clear(entity e)
{
- float i;
-
antilag_restore(e);
- for(i = 0; i < ANTILAG_MAX_ORIGINS; ++i)
+ for (int i = 0; i < ANTILAG_MAX_ORIGINS; ++i)
{
e.(antilag_times[i]) = -2342;
e.(antilag_origins[i]) = e.origin;
float autocvar_g_balance_keyhunt_dropvelocity;
float autocvar_g_balance_keyhunt_maxdist;
float autocvar_g_balance_keyhunt_protecttime;
-float autocvar_g_balance_keyhunt_score_capture;
-float autocvar_g_balance_keyhunt_score_carrierfrag;
-float autocvar_g_balance_keyhunt_score_collect;
-float autocvar_g_balance_keyhunt_score_destroyed;
-float autocvar_g_balance_keyhunt_score_destroyed_ownfactor;
-float autocvar_g_balance_keyhunt_score_push;
+int autocvar_g_balance_keyhunt_score_capture;
+int autocvar_g_balance_keyhunt_score_carrierfrag;
+int autocvar_g_balance_keyhunt_score_collect;
+int autocvar_g_balance_keyhunt_score_destroyed;
+int autocvar_g_balance_keyhunt_score_destroyed_ownfactor;
+int autocvar_g_balance_keyhunt_score_push;
float autocvar_g_balance_keyhunt_throwvelocity;
float autocvar_g_balance_kill_delay;
float autocvar_g_balance_kill_antispam;
float autocvar_g_balance_nexball_secondary_lifetime;
float autocvar_g_balance_nexball_secondary_refire;
float autocvar_g_balance_nexball_secondary_speed;
-float autocvar_g_balance_nix_ammo_cells;
-float autocvar_g_balance_nix_ammo_plasma;
-float autocvar_g_balance_nix_ammo_fuel;
-float autocvar_g_balance_nix_ammo_nails;
-float autocvar_g_balance_nix_ammo_rockets;
-float autocvar_g_balance_nix_ammo_shells;
-float autocvar_g_balance_nix_ammoincr_cells;
-float autocvar_g_balance_nix_ammoincr_plasma;
-float autocvar_g_balance_nix_ammoincr_fuel;
-float autocvar_g_balance_nix_ammoincr_nails;
-float autocvar_g_balance_nix_ammoincr_rockets;
-float autocvar_g_balance_nix_ammoincr_shells;
+int autocvar_g_balance_nix_ammo_cells;
+int autocvar_g_balance_nix_ammo_plasma;
+int autocvar_g_balance_nix_ammo_fuel;
+int autocvar_g_balance_nix_ammo_nails;
+int autocvar_g_balance_nix_ammo_rockets;
+int autocvar_g_balance_nix_ammo_shells;
+int autocvar_g_balance_nix_ammoincr_cells;
+int autocvar_g_balance_nix_ammoincr_plasma;
+int autocvar_g_balance_nix_ammoincr_fuel;
+int autocvar_g_balance_nix_ammoincr_nails;
+int autocvar_g_balance_nix_ammoincr_rockets;
+int autocvar_g_balance_nix_ammoincr_shells;
float autocvar_g_balance_nix_incrtime;
float autocvar_g_balance_nix_roundtime;
float autocvar_g_balance_pause_armor_rot;
float autocvar_g_balance_powerup_strength_time;
float autocvar_g_balance_superweapons_time;
float autocvar_g_balance_selfdamagepercent;
-float autocvar_g_balance_teams;
-float autocvar_g_balance_teams_prevent_imbalance;
+bool autocvar_g_balance_teams;
+bool autocvar_g_balance_teams_prevent_imbalance;
float autocvar_g_balance_teams_scorefactor;
float autocvar_g_ballistics_density_corpse;
float autocvar_g_ballistics_density_player;
float autocvar_g_ban_sync_interval;
float autocvar_g_ban_sync_timeout;
string autocvar_g_ban_sync_trusted_servers;
-float autocvar_g_ban_sync_trusted_servers_verify;
+bool autocvar_g_ban_sync_trusted_servers_verify;
string autocvar_g_ban_sync_uri;
string autocvar_g_banned_list;
-float autocvar_g_banned_list_idmode;
-float autocvar_g_bastet;
-float autocvar_g_botclip_collisions;
-float autocvar_g_bugrigs;
+bool autocvar_g_banned_list_idmode;
+bool autocvar_g_bastet;
+bool autocvar_g_botclip_collisions;
+bool autocvar_g_bugrigs;
float autocvar_g_ca_damage2score_multiplier;
-float autocvar_g_ca_point_leadlimit;
-float autocvar_g_ca_point_limit;
+int autocvar_g_ca_point_leadlimit;
+int autocvar_g_ca_point_limit;
float autocvar_g_ca_round_timelimit;
-float autocvar_g_ca_spectate_enemies;
-float autocvar_g_ca_teams;
-float autocvar_g_ca_teams_override;
-float autocvar_g_ca_team_spawns;
+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 autocvar_g_campaign;
+bool autocvar_g_campaign;
#define autocvar_g_campaign_forceteam cvar("g_campaign_forceteam")
-float autocvar_g_campaign_skill;
-float autocvar_g_casings;
-float autocvar_g_changeteam_banned;
+int autocvar_g_campaign_skill;
+int autocvar_g_casings;
+bool autocvar_g_changeteam_banned;
float autocvar_g_chat_flood_burst;
float autocvar_g_chat_flood_burst_team;
float autocvar_g_chat_flood_burst_tell;
float autocvar_g_chat_flood_lmax;
float autocvar_g_chat_flood_lmax_team;
float autocvar_g_chat_flood_lmax_tell;
-float autocvar_g_chat_flood_notify_flooder;
+bool autocvar_g_chat_flood_notify_flooder;
float autocvar_g_chat_flood_spl;
float autocvar_g_chat_flood_spl_team;
float autocvar_g_chat_flood_spl_tell;
-float autocvar_g_chat_nospectators;
-float autocvar_g_chat_teamcolors;
-float autocvar_g_chat_tellprivacy;
-float autocvar_g_ctf_allow_vehicle_carry;
-float autocvar_g_ctf_allow_vehicle_touch;
-float autocvar_g_ctf_allow_monster_touch;
-float autocvar_g_ctf_throw;
+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;
-float autocvar_g_ctf_throw_punish_count;
+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_up;
float autocvar_g_ctf_drop_velocity_up;
float autocvar_g_ctf_drop_velocity_side;
-float autocvar_g_ctf_portalteleport;
-float autocvar_g_ctf_pass;
+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;
-float autocvar_g_ctf_pass_request;
+bool autocvar_g_ctf_pass_request;
float autocvar_g_ctf_pass_turnrate;
float autocvar_g_ctf_pass_timelimit;
float autocvar_g_ctf_pass_velocity;
-float autocvar_g_ctf_dynamiclights;
+bool autocvar_g_ctf_dynamiclights;
string autocvar_g_ctf_flag_blue_model;
-float autocvar_g_ctf_flag_blue_skin;
+int autocvar_g_ctf_flag_blue_skin;
float autocvar_g_ctf_flag_collect_delay;
float autocvar_g_ctf_flag_damageforcescale;
-float autocvar_g_ctf_flag_dropped_waypoint;
+int autocvar_g_ctf_flag_dropped_waypoint;
float autocvar_g_ctf_flag_dropped_floatinwater;
-float autocvar_g_ctf_flag_glowtrails;
+bool autocvar_g_ctf_flag_glowtrails;
float autocvar_g_ctf_flag_health;
string autocvar_g_ctf_flag_red_model;
-float autocvar_g_ctf_flag_red_skin;
+int autocvar_g_ctf_flag_red_skin;
float autocvar_g_ctf_flag_return_time;
-float autocvar_g_ctf_flag_return_when_unreachable;
+bool autocvar_g_ctf_flag_return_when_unreachable;
float autocvar_g_ctf_flag_return_damage;
float autocvar_g_ctf_flag_return_dropped;
float autocvar_g_ctf_flagcarrier_auto_helpme_damage;
float autocvar_g_ctf_flagcarrier_damagefactor;
float autocvar_g_ctf_flagcarrier_forcefactor;
//float autocvar_g_ctf_flagcarrier_waypointforenemy_spotting;
-float autocvar_g_ctf_fullbrightflags;
-float autocvar_g_ctf_ignore_frags;
-float autocvar_g_ctf_score_capture;
-float autocvar_g_ctf_score_capture_assist;
-float autocvar_g_ctf_score_kill;
-float autocvar_g_ctf_score_penalty_drop;
-//float autocvar_g_ctf_score_penalty_suicidedrop;
-float autocvar_g_ctf_score_penalty_returned;
-float autocvar_g_ctf_score_pickup_base;
-float autocvar_g_ctf_score_pickup_dropped_early;
-float autocvar_g_ctf_score_pickup_dropped_late;
-float autocvar_g_ctf_score_return;
+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_suicidedrop;
+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;
-float autocvar_g_ctf_shield_min_negscore;
-float autocvar_g_ctf_stalemate;
-float autocvar_g_ctf_stalemate_endcondition;
+int autocvar_g_ctf_shield_min_negscore;
+bool autocvar_g_ctf_stalemate;
+int autocvar_g_ctf_stalemate_endcondition;
float autocvar_g_ctf_stalemate_time;
-float autocvar_g_ctf_reverse;
+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;
-float autocvar_g_cts_selfdamage;
-float autocvar_g_debug_bot_commands;
-float autocvar_g_domination_default_teams;
-float autocvar_g_domination_disable_frags;
-float autocvar_g_domination_point_amt;
-float autocvar_g_domination_point_fullbright;
-float autocvar_g_domination_point_leadlimit;
-float autocvar_g_domination_roundbased;
-float autocvar_g_domination_roundbased_point_limit;
+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;
-float autocvar_g_domination_teams_override;
-float autocvar_g_forced_respawn;
+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;
-float autocvar_g_freezetag_frozen_damage_trigger;
+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;
-float autocvar_g_freezetag_revive_nade;
+bool autocvar_g_freezetag_revive_nade;
float autocvar_g_freezetag_revive_nade_health;
-float autocvar_g_freezetag_point_leadlimit;
-float autocvar_g_freezetag_point_limit;
+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;
-float autocvar_g_freezetag_teams;
-float autocvar_g_freezetag_teams_override;
-float autocvar_g_freezetag_team_spawns;
+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")
-float autocvar_g_full_getstatus_responses;
-float autocvar_g_fullbrightitems;
-float autocvar_g_fullbrightplayers;
+bool autocvar_g_full_getstatus_responses;
+bool autocvar_g_fullbrightitems;
+bool autocvar_g_fullbrightplayers;
#define autocvar_g_grappling_hook cvar("g_grappling_hook")
-float autocvar_g_grappling_hook_tarzan;
-float autocvar_g_hitplots;
+int autocvar_g_grappling_hook_tarzan;
+bool autocvar_g_hitplots;
string autocvar_g_hitplots_individuals;
float autocvar_g_jetpack_acceleration_side;
float autocvar_g_jetpack_acceleration_up;
float autocvar_g_jetpack_antigravity;
-float autocvar_g_jetpack_fuel;
+int autocvar_g_jetpack_fuel;
float autocvar_g_jetpack_maxspeed_side;
float autocvar_g_jetpack_maxspeed_up;
-float autocvar_g_keepaway_ballcarrier_effects;
+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_noncarrier_force;
float autocvar_g_keepaway_noncarrier_selfdamage;
float autocvar_g_keepaway_noncarrier_selfforce;
-float autocvar_g_keepaway_noncarrier_warn;
-float autocvar_g_keepaway_score_bckill;
-float autocvar_g_keepaway_score_killac;
-float autocvar_g_keepaway_score_timepoints;
+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;
-float autocvar_g_keepawayball_effects;
+int autocvar_g_keepawayball_effects;
float autocvar_g_keepawayball_respawntime;
-float autocvar_g_keepawayball_trail_color;
-float autocvar_g_keyhunt_point_leadlimit;
+int autocvar_g_keepawayball_trail_color;
+int autocvar_g_keyhunt_point_leadlimit;
#define autocvar_g_keyhunt_point_limit cvar("g_keyhunt_point_limit")
-float autocvar_g_keyhunt_teams;
-float autocvar_g_keyhunt_teams_override;
-float autocvar_g_lms_extra_lives;
-float autocvar_g_lms_join_anytime;
-float autocvar_g_lms_last_join;
+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")
-float autocvar_g_lms_regenerate;
+bool autocvar_g_lms_regenerate;
#define autocvar_g_maplist cvar_string("g_maplist")
-float autocvar_g_maplist_check_waypoints;
-float autocvar_g_maplist_index;
+bool autocvar_g_maplist_check_waypoints;
+int autocvar_g_maplist_index;
string autocvar_g_maplist_mostrecent;
-float autocvar_g_maplist_mostrecent_count;
-float autocvar_g_maplist_selectrandom;
+int autocvar_g_maplist_mostrecent_count;
+bool autocvar_g_maplist_selectrandom;
float autocvar_g_maplist_shuffle;
#define autocvar_g_maplist_votable cvar("g_maplist_votable")
-float autocvar_g_maplist_votable_abstain;
+bool autocvar_g_maplist_votable_abstain;
float autocvar_g_maplist_votable_keeptwotime;
-float autocvar_g_maplist_votable_nodetail;
+bool autocvar_g_maplist_votable_nodetail;
string autocvar_g_maplist_votable_screenshot_dir;
-float autocvar_g_maplist_votable_suggestions;
-float autocvar_g_maplist_votable_suggestions_override_mostrecent;
+bool autocvar_g_maplist_votable_suggestions;
+bool autocvar_g_maplist_votable_suggestions_override_mostrecent;
float autocvar_g_maplist_votable_timeout;
-float autocvar_g_maxplayers;
+int autocvar_g_maxplayers;
float autocvar_g_maxplayers_spectator_blocktime;
float autocvar_g_maxpushtime;
float autocvar_g_maxspeed;
float autocvar_g_midair_shieldtime;
#define autocvar_g_instagib cvar("g_instagib")
-float autocvar_g_instagib_ammo_drop;
-float autocvar_g_instagib_extralives;
+int autocvar_g_instagib_ammo_drop;
+int autocvar_g_instagib_extralives;
float autocvar_g_instagib_speed_highspeed;
float autocvar_g_instagib_invis_alpha;
#define autocvar_g_mirrordamage cvar("g_mirrordamage")
#define autocvar_g_mirrordamage_virtual cvar("g_mirrordamage_virtual")
float autocvar_g_movement_highspeed = 1;
-float autocvar_g_multijump;
+int autocvar_g_multijump;
float autocvar_g_multijump_add;
float autocvar_g_multijump_speed;
string autocvar_g_mutatormsg;
float autocvar_g_nexball_basketball_bouncefactor;
float autocvar_g_nexball_basketball_bouncestop;
float autocvar_g_nexball_basketball_carrier_highspeed;
-float autocvar_g_nexball_basketball_meter;
+bool autocvar_g_nexball_basketball_meter;
float autocvar_g_nexball_basketball_meter_maxpower;
float autocvar_g_nexball_basketball_meter_minpower;
float autocvar_g_nexball_delay_collect;
float autocvar_g_nexball_delay_start;
float autocvar_g_nexball_football_bouncefactor;
float autocvar_g_nexball_football_bouncestop;
-float autocvar_g_nexball_goalleadlimit;
+int autocvar_g_nexball_goalleadlimit;
#define autocvar_g_nexball_goallimit cvar("g_nexball_goallimit")
-float autocvar_g_nexball_radar_showallplayers;
-float autocvar_g_nexball_sound_bounce;
-float autocvar_g_nexball_trail_color;
+bool autocvar_g_nexball_radar_showallplayers;
+bool autocvar_g_nexball_sound_bounce;
+int autocvar_g_nexball_trail_color;
//float autocvar_g_nick_flood_penalty;
-float autocvar_g_nick_flood_penalty_red;
-float autocvar_g_nick_flood_penalty_yellow;
+int autocvar_g_nick_flood_penalty_red;
+int autocvar_g_nick_flood_penalty_yellow;
//float autocvar_g_nick_flood_timeout;
-float autocvar_g_nix_with_healtharmor;
-float autocvar_g_nix_with_blaster;
-float autocvar_g_nix_with_powerups;
-float autocvar_g_nodepthtestitems;
-float autocvar_g_nodepthtestplayers;
-float autocvar_g_norecoil;
+bool autocvar_g_nix_with_healtharmor;
+bool autocvar_g_nix_with_blaster;
+bool autocvar_g_nix_with_powerups;
+bool autocvar_g_nodepthtestitems;
+bool autocvar_g_nodepthtestplayers;
+bool autocvar_g_norecoil;
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_pickup_cells_max;
-float autocvar_g_pickup_plasma_max;
-float autocvar_g_pickup_fuel_max;
-float autocvar_g_pickup_items;
-float autocvar_g_pickup_nails_max;
-float autocvar_g_pickup_rockets_max;
-float autocvar_g_pickup_shells_max;
+int autocvar_g_pickup_cells_max;
+int autocvar_g_pickup_plasma_max;
+int autocvar_g_pickup_fuel_max;
+int autocvar_g_pickup_items;
+int autocvar_g_pickup_nails_max;
+int autocvar_g_pickup_rockets_max;
+int autocvar_g_pickup_shells_max;
float autocvar_g_player_alpha;
float autocvar_g_player_brightness;
-float autocvar_g_playerclip_collisions;
-float autocvar_g_powerups;
-float autocvar_g_projectiles_damage;
-float autocvar_g_projectiles_keep_owner;
-float autocvar_g_projectiles_newton_style;
+bool autocvar_g_playerclip_collisions;
+int autocvar_g_powerups;
+int autocvar_g_projectiles_damage;
+bool autocvar_g_projectiles_keep_owner;
+int autocvar_g_projectiles_newton_style;
float autocvar_g_projectiles_newton_style_2_maxfactor;
float autocvar_g_projectiles_newton_style_2_minfactor;
-float autocvar_g_projectiles_spread_style;
+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;
-float autocvar_g_race_teams;
+int autocvar_g_race_teams;
float autocvar_g_respawn_delay_small;
-float autocvar_g_respawn_delay_small_count;
+int autocvar_g_respawn_delay_small_count;
float autocvar_g_respawn_delay_large;
-float autocvar_g_respawn_delay_large_count;
+int autocvar_g_respawn_delay_large_count;
float autocvar_g_respawn_delay_max;
-float autocvar_g_respawn_ghosts;
+bool autocvar_g_respawn_ghosts;
float autocvar_g_respawn_ghosts_maxtime;
float autocvar_g_respawn_ghosts_speed;
-float autocvar_g_respawn_waves;
-float autocvar_g_running_guns;
-float autocvar_g_shootfromcenter;
-float autocvar_g_shootfromclient;
-float autocvar_g_shootfromeye;
+int autocvar_g_respawn_waves;
+bool autocvar_g_running_guns;
+bool autocvar_g_shootfromcenter;
+int autocvar_g_shootfromclient;
+bool autocvar_g_shootfromeye;
string autocvar_g_shootfromfixedorigin;
-float autocvar_g_showweaponspawns;
-float autocvar_g_spawn_alloweffects;
+int autocvar_g_showweaponspawns;
+bool autocvar_g_spawn_alloweffects;
float autocvar_g_spawn_furthest;
-float autocvar_g_spawn_useallspawns;
-float autocvar_g_spawnpoints_auto_move_out_of_solid;
+bool autocvar_g_spawn_useallspawns;
+bool autocvar_g_spawnpoints_auto_move_out_of_solid;
#define autocvar_g_spawnshieldtime cvar("g_spawnshieldtime")
-float autocvar_g_tdm_team_spawns;
-float autocvar_g_tdm_point_limit;
-float autocvar_g_tdm_point_leadlimit;
-float autocvar_g_tdm_teams;
-float autocvar_g_tdm_teams_override;
+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;
-float autocvar_g_telefrags;
-float autocvar_g_telefrags_avoid;
-float autocvar_g_telefrags_teamplay;
+bool autocvar_g_telefrags;
+bool autocvar_g_telefrags_avoid;
+bool autocvar_g_telefrags_teamplay;
float autocvar_g_teleport_maxspeed;
-float autocvar_g_throughfloor_debug;
+bool autocvar_g_throughfloor_debug;
float autocvar_g_throughfloor_damage;
float autocvar_g_throughfloor_force;
float autocvar_g_throughfloor_damage_max_stddev;
float autocvar_g_triggerimpulse_accel_power;
float autocvar_g_triggerimpulse_directional_multiplier;
float autocvar_g_triggerimpulse_radial_multiplier;
-float autocvar_g_turrets;
+bool autocvar_g_turrets;
float autocvar_g_turrets_aimidle_delay;
-float autocvar_g_turrets_nofire;
-float autocvar_g_turrets_reloadcvars;
+bool autocvar_g_turrets_nofire;
+bool autocvar_g_turrets_reloadcvars;
float autocvar_g_turrets_targetscan_maxdelay;
float autocvar_g_turrets_targetscan_mindelay;
float autocvar_g_turrets_unit_ewheel_speed_fast;
float autocvar_g_turrets_unit_walker_turn_run;
float autocvar_g_turrets_unit_walker_turn_strafe;
float autocvar_g_turrets_unit_walker_turn_swim;
-float autocvar_g_use_ammunition;
-float autocvar_g_waypointeditor;
-float autocvar_g_waypointeditor_auto;
-float autocvar_g_waypoints_for_items;
+bool autocvar_g_use_ammunition;
+bool autocvar_g_waypointeditor;
+int autocvar_g_waypointeditor_auto;
+int autocvar_g_waypoints_for_items;
float autocvar_g_weapon_charge_colormod_blue_full;
float autocvar_g_weapon_charge_colormod_blue_half;
float autocvar_g_weapon_charge_colormod_green_full;
float autocvar_g_weapon_charge_colormod_red_full;
float autocvar_g_weapon_charge_colormod_red_half;
#define autocvar_g_weapon_stay cvar("g_weapon_stay")
-float autocvar_g_weapon_throwable;
+bool autocvar_g_weapon_throwable;
#define autocvar_g_weaponarena cvar_string("g_weaponarena")
string autocvar_g_xonoticversion;
float autocvar_gameversion;
float autocvar_gameversion_min;
float autocvar_gameversion_max;
string autocvar_hostname;
-float autocvar_lastlevel;
-float autocvar_leadlimit;
-float autocvar_leadlimit_and_fraglimit;
-float autocvar_leadlimit_override;
-float autocvar_loddebug;
-float autocvar_minplayers;
+bool autocvar_lastlevel;
+int autocvar_leadlimit;
+int autocvar_leadlimit_and_fraglimit;
+int autocvar_leadlimit_override;
+int autocvar_loddebug;
+int autocvar_minplayers;
string autocvar_nextmap;
-float autocvar_prvm_backtraceforwarnings;
+bool autocvar_prvm_backtraceforwarnings;
string autocvar_quit_and_redirect;
float autocvar_quit_and_redirect_timer;
-float autocvar_quit_when_empty;
+bool autocvar_quit_when_empty;
float autocvar_r_showbboxes;
-float autocvar_rescan_pending;
-float autocvar_samelevel;
+int autocvar_rescan_pending;
+bool autocvar_samelevel;
string autocvar_sessionid;
#define autocvar_skill cvar("skill")
float autocvar_skill_auto;
#define autocvar_slowmo cvar("slowmo")
float autocvar_snd_soundradius;
-float autocvar_spawn_debug;
-float autocvar_speedmeter;
+int autocvar_spawn_debug;
+bool autocvar_speedmeter;
float autocvar_sv_accelerate;
float autocvar_sv_accuracy_data_share = 1;
string autocvar_sv_adminnick;
float autocvar_sv_airstopaccelerate;
float autocvar_sv_airstrafeaccel_qw;
float autocvar_sv_airstrafeaccelerate;
-float autocvar_sv_autoscreenshot;
-float autocvar_sv_cheats;
+bool autocvar_sv_autoscreenshot;
+int autocvar_sv_cheats;
float autocvar_sv_clientcommand_antispam_time;
-float autocvar_sv_clientcommand_antispam_count;
-float autocvar_sv_curl_serverpackages_auto;
-float autocvar_sv_db_saveasdump;
-float autocvar_sv_defaultcharacter;
+int autocvar_sv_clientcommand_antispam_count;
+bool autocvar_sv_curl_serverpackages_auto;
+bool autocvar_sv_db_saveasdump;
+bool autocvar_sv_defaultcharacter;
string autocvar_sv_defaultplayercolors;
string autocvar_sv_defaultplayermodel;
string autocvar_sv_defaultplayermodel_blue;
string autocvar_sv_defaultplayermodel_pink;
string autocvar_sv_defaultplayermodel_red;
string autocvar_sv_defaultplayermodel_yellow;
-float autocvar_sv_defaultplayerskin;
+int autocvar_sv_defaultplayerskin;
float autocvar_sv_dodging_delay;
float autocvar_sv_dodging_height_threshold;
float autocvar_sv_dodging_horiz_speed;
float autocvar_sv_dodging_horiz_speed_frozen;
float autocvar_sv_dodging_ramp_time;
-float autocvar_sv_dodging_sound;
+bool autocvar_sv_dodging_sound;
float autocvar_sv_dodging_up_speed;
float autocvar_sv_dodging_wall_distance_threshold;
-float autocvar_sv_dodging_wall_dodging;
-float autocvar_sv_dodging_frozen;
-float autocvar_sv_dodging_frozen_doubletap;
-float autocvar_sv_doublejump;
-float autocvar_sv_eventlog;
-float autocvar_sv_eventlog_console;
-float autocvar_sv_eventlog_files;
-float autocvar_sv_eventlog_files_counter;
+bool autocvar_sv_dodging_wall_dodging;
+bool autocvar_sv_dodging_frozen;
+bool autocvar_sv_dodging_frozen_doubletap;
+bool autocvar_sv_doublejump;
+bool autocvar_sv_eventlog;
+bool autocvar_sv_eventlog_console;
+bool autocvar_sv_eventlog_files;
+int autocvar_sv_eventlog_files_counter;
string autocvar_sv_eventlog_files_nameprefix;
string autocvar_sv_eventlog_files_namesuffix;
-float autocvar_sv_eventlog_files_timestamps;
+bool autocvar_sv_eventlog_files_timestamps;
float autocvar_sv_friction;
float autocvar_sv_friction_on_land;
float autocvar_sv_gameplayfix_q2airaccelerate;
-float autocvar_sv_gentle;
+int autocvar_sv_gentle;
#define autocvar_sv_gravity cvar("sv_gravity")
string autocvar_sv_intermission_cdtrack;
string autocvar_sv_jumpspeedcap_max;
float autocvar_sv_jumpspeedcap_max_disable_on_ramps;
string autocvar_sv_jumpspeedcap_min;
float autocvar_sv_jumpvelocity;
-float autocvar_sv_logscores_bots;
-float autocvar_sv_logscores_console;
-float autocvar_sv_logscores_file;
+bool autocvar_sv_logscores_bots;
+bool autocvar_sv_logscores_console;
+bool autocvar_sv_logscores_file;
string autocvar_sv_logscores_filename;
float autocvar_sv_mapchange_delay;
float autocvar_sv_maxairspeed;
float autocvar_sv_maxairstrafespeed;
float autocvar_sv_maxspeed;
string autocvar_sv_motd;
-float autocvar_sv_precacheplayermodels;
+bool autocvar_sv_precacheplayermodels;
//float autocvar_sv_precacheweapons; // WEAPONTODO?
-float autocvar_sv_q3acompat_machineshotgunswap;
-float autocvar_sv_ready_restart;
-float autocvar_sv_ready_restart_after_countdown;
-float autocvar_sv_ready_restart_repeatable;
-float autocvar_sv_servermodelsonly;
-float autocvar_sv_spectate;
+bool autocvar_sv_q3acompat_machineshotgunswap;
+bool autocvar_sv_ready_restart;
+bool autocvar_sv_ready_restart_after_countdown;
+bool autocvar_sv_ready_restart_repeatable;
+bool autocvar_sv_servermodelsonly;
+int autocvar_sv_spectate;
float autocvar_sv_spectator_speed_multiplier;
-float autocvar_sv_status_privacy;
+bool autocvar_sv_status_privacy;
float autocvar_sv_stepheight;
float autocvar_sv_stopspeed;
float autocvar_sv_strengthsound_antispam_refire_threshold;
float autocvar_sv_strengthsound_antispam_time;
-float autocvar_sv_teamnagger;
-float autocvar_sv_timeout;
+bool autocvar_sv_teamnagger;
+bool autocvar_sv_timeout;
float autocvar_sv_timeout_leadtime;
float autocvar_sv_timeout_length;
-float autocvar_sv_timeout_number;
+int autocvar_sv_timeout_number;
float autocvar_sv_timeout_resumetime;
-float autocvar_sv_vote_call;
-float autocvar_sv_vote_change;
+bool autocvar_sv_vote_call;
+bool autocvar_sv_vote_change;
string autocvar_sv_vote_commands;
-float autocvar_sv_vote_gametype;
+bool autocvar_sv_vote_gametype;
float autocvar_sv_vote_gametype_timeout;
string autocvar_sv_vote_gametype_options;
float autocvar_sv_vote_gametype_keeptwotime;
-float autocvar_sv_vote_gametype_default_current;
-float autocvar_sv_vote_limit;
+bool autocvar_sv_vote_gametype_default_current;
+int autocvar_sv_vote_limit;
float autocvar_sv_vote_majority_factor;
float autocvar_sv_vote_majority_factor_of_voted;
-float autocvar_sv_vote_master;
-float autocvar_sv_vote_master_callable;
+bool autocvar_sv_vote_master;
+bool autocvar_sv_vote_master_callable;
string autocvar_sv_vote_master_commands;
string autocvar_sv_vote_master_password;
-float autocvar_sv_vote_master_playerlimit;
-float autocvar_sv_vote_no_stops_vote;
-float autocvar_sv_vote_nospectators;
+int autocvar_sv_vote_master_playerlimit;
+bool autocvar_sv_vote_no_stops_vote;
+int autocvar_sv_vote_nospectators;
//string autocvar_sv_vote_only_commands;
-float autocvar_sv_vote_override_mostrecent;
-float autocvar_sv_vote_singlecount;
+bool autocvar_sv_vote_override_mostrecent;
+bool autocvar_sv_vote_singlecount;
float autocvar_sv_vote_stop;
float autocvar_sv_vote_timeout;
float autocvar_sv_vote_wait;
-float autocvar_sv_vote_gamestart;
+bool autocvar_sv_vote_gamestart;
float autocvar_sv_warsowbunny_accel;
float autocvar_sv_warsowbunny_airforwardaccel;
float autocvar_sv_warsowbunny_backtosideratio;
string autocvar_sv_weaponstats_file;
float autocvar_sv_gibhealth;
float autocvar_sys_ticrate;
-float autocvar_teamplay_lockonrestart;
-float autocvar_teamplay_mode;
+bool autocvar_teamplay_lockonrestart;
+int autocvar_teamplay_mode;
#define autocvar_timelimit cvar("timelimit")
#define autocvar_timelimit_override cvar("timelimit_override")
float autocvar_timelimit_increment;
float autocvar_timelimit_min;
float autocvar_timelimit_max;
float autocvar_timelimit_overtime;
-float autocvar_timelimit_overtimes;
+int autocvar_timelimit_overtimes;
float autocvar_timelimit_suddendeath;
#define autocvar_utf8_enable cvar("utf8_enable")
-float autocvar_waypoint_benchmark;
-float autocvar_sv_gameplayfix_gravityunaffectedbyticrate;
+bool autocvar_waypoint_benchmark;
+bool autocvar_sv_gameplayfix_gravityunaffectedbyticrate;
float autocvar_g_trueaim_minrange;
-float autocvar_g_debug_defaultsounds;
+bool autocvar_g_debug_defaultsounds;
float autocvar_g_grab_range;
-float autocvar_g_sandbox_info;
-float autocvar_g_sandbox_readonly;
+int autocvar_g_sandbox_info;
+bool autocvar_g_sandbox_readonly;
string autocvar_g_sandbox_storage_name;
float autocvar_g_sandbox_storage_autosave;
-float autocvar_g_sandbox_storage_autoload;
+bool autocvar_g_sandbox_storage_autoload;
float autocvar_g_sandbox_editor_flood;
-float autocvar_g_sandbox_editor_maxobjects;
-float autocvar_g_sandbox_editor_free;
+int autocvar_g_sandbox_editor_maxobjects;
+int autocvar_g_sandbox_editor_free;
float autocvar_g_sandbox_editor_distance_spawn;
float autocvar_g_sandbox_editor_distance_edit;
float autocvar_g_sandbox_object_scale_min;
float autocvar_g_sandbox_object_scale_max;
float autocvar_g_sandbox_object_material_velocity_min;
float autocvar_g_sandbox_object_material_velocity_factor;
-float autocvar_g_max_info_autoscreenshot;
-float autocvar_physics_ode;
-float autocvar_g_physical_items;
+int autocvar_g_max_info_autoscreenshot;
+bool autocvar_physics_ode;
+int autocvar_g_physical_items;
float autocvar_g_physical_items_damageforcescale;
float autocvar_g_physical_items_reset;
float autocvar_g_monsters;
-float autocvar_g_monsters_edit;
-float autocvar_g_monsters_sounds;
+bool autocvar_g_monsters_edit;
+bool autocvar_g_monsters_sounds;
float autocvar_g_monsters_think_delay;
-float autocvar_g_monsters_max;
-float autocvar_g_monsters_max_perplayer;
+int autocvar_g_monsters_max;
+int autocvar_g_monsters_max_perplayer;
float autocvar_g_monsters_target_range;
-float autocvar_g_monsters_target_infront;
+bool autocvar_g_monsters_target_infront;
float autocvar_g_monsters_attack_range;
-float autocvar_g_monsters_score_kill;
-float autocvar_g_monsters_score_spawned;
-float autocvar_g_monsters_typefrag;
-float autocvar_g_monsters_owners;
+int autocvar_g_monsters_score_kill;
+int autocvar_g_monsters_score_spawned;
+bool autocvar_g_monsters_typefrag;
+bool autocvar_g_monsters_owners;
float autocvar_g_monsters_miniboss_chance;
float autocvar_g_monsters_miniboss_healthboost;
float autocvar_g_monsters_drop_time;
float autocvar_g_monsters_spawnshieldtime;
-float autocvar_g_monsters_teams;
+bool autocvar_g_monsters_teams;
float autocvar_g_monsters_respawn_delay;
-float autocvar_g_monsters_respawn;
+bool autocvar_g_monsters_respawn;
float autocvar_g_monsters_armor_blockpercent;
float autocvar_g_touchexplode_radius;
float autocvar_g_touchexplode_damage;
float autocvar_g_touchexplode_edgedamage;
float autocvar_g_touchexplode_force;
float autocvar_g_invasion_round_timelimit;
-float autocvar_g_invasion_teams;
-float autocvar_g_invasion_team_spawns;
+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;
-float autocvar_g_invasion_monster_count;
-float autocvar_g_invasion_zombies_only;
+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_positive;
float autocvar_g_random_gravity_negative;
float autocvar_g_random_gravity_delay;
-float autocvar_g_nades;
+bool autocvar_g_nades;
vector autocvar_g_nades_throw_offset;
-float autocvar_g_nades_spawn;
-float autocvar_g_nades_spawn_count;
-float autocvar_g_nades_client_select;
+bool autocvar_g_nades_spawn;
+int autocvar_g_nades_spawn_count;
+bool autocvar_g_nades_client_select;
float autocvar_g_nades_nade_lifetime;
float autocvar_g_nades_nade_minforce;
float autocvar_g_nades_nade_maxforce;
float autocvar_g_nades_nade_edgedamage;
float autocvar_g_nades_nade_radius;
float autocvar_g_nades_nade_force;
-float autocvar_g_nades_nade_newton_style;
+int autocvar_g_nades_nade_newton_style;
int autocvar_g_nades_napalm_ball_count;
float autocvar_g_nades_napalm_ball_spread;
float autocvar_g_nades_napalm_ball_damage;
float autocvar_g_nades_napalm_ball_damageforcescale;
float autocvar_g_nades_napalm_ball_lifetime;
float autocvar_g_nades_napalm_ball_radius;
-float autocvar_g_nades_napalm_blast;
+bool autocvar_g_nades_napalm_blast;
float autocvar_g_nades_napalm_fountain_lifetime;
float autocvar_g_nades_napalm_fountain_delay;
float autocvar_g_nades_napalm_fountain_radius;
float autocvar_g_nades_napalm_fountain_damage;
float autocvar_g_nades_napalm_fountain_edgedamage;
float autocvar_g_nades_napalm_burntime;
-float autocvar_g_nades_napalm_selfdamage;
-float autocvar_g_nades_nade_type;
-float autocvar_g_nades_bonus_type;
-float autocvar_g_nades_bonus;
-float autocvar_g_nades_bonus_onstrength;
-float autocvar_g_nades_bonus_client_select;
-float autocvar_g_nades_bonus_max;
-float autocvar_g_nades_bonus_score_max;
-float autocvar_g_nades_bonus_score_time;
-float autocvar_g_nades_bonus_score_time_flagcarrier;
-float autocvar_g_nades_bonus_score_minor;
-float autocvar_g_nades_bonus_score_low;
-float autocvar_g_nades_bonus_score_high;
-float autocvar_g_nades_bonus_score_medium;
-float autocvar_g_nades_bonus_score_spree;
+bool autocvar_g_nades_napalm_selfdamage;
+int autocvar_g_nades_nade_type;
+int autocvar_g_nades_bonus_type;
+bool autocvar_g_nades_bonus;
+bool autocvar_g_nades_bonus_onstrength;
+bool autocvar_g_nades_bonus_client_select;
+int autocvar_g_nades_bonus_max;
+int autocvar_g_nades_bonus_score_max;
+int autocvar_g_nades_bonus_score_time;
+int autocvar_g_nades_bonus_score_time_flagcarrier;
+int autocvar_g_nades_bonus_score_minor;
+int autocvar_g_nades_bonus_score_low;
+int autocvar_g_nades_bonus_score_high;
+int autocvar_g_nades_bonus_score_medium;
+int autocvar_g_nades_bonus_score_spree;
float autocvar_g_nades_ice_freeze_time;
float autocvar_g_nades_ice_health;
-float autocvar_g_nades_ice_explode;
-float autocvar_g_nades_ice_teamcheck;
+bool autocvar_g_nades_ice_explode;
+bool autocvar_g_nades_ice_teamcheck;
float autocvar_g_nades_heal_time;
float autocvar_g_nades_heal_rate;
float autocvar_g_nades_heal_friend;
float autocvar_g_campcheck_damage;
float autocvar_g_campcheck_distance;
float autocvar_g_campcheck_interval;
-float autocvar_g_jump_grunt;
-float autocvar_g_overkill_powerups_replace;
+bool autocvar_g_jump_grunt;
+bool autocvar_g_overkill_powerups_replace;
float autocvar_g_overkill_superguns_respawn_time;
-float autocvar_g_overkill_100h_anyway;
-float autocvar_g_overkill_100a_anyway;
-float autocvar_g_overkill_ammo_charge;
+bool autocvar_g_overkill_100h_anyway;
+bool autocvar_g_overkill_100a_anyway;
+bool autocvar_g_overkill_ammo_charge;
float autocvar_g_overkill_ammo_charge_notice;
float autocvar_g_overkill_ammo_charge_limit;
float autocvar_g_spawn_near_teammate_distance;
-float autocvar_g_spawn_near_teammate_ignore_spawnpoint;
+bool 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_spawn_near_teammate_ignore_spawnpoint_check_health;
-float autocvar_g_spawn_near_teammate_ignore_spawnpoint_closetodeath;
+int autocvar_g_spawn_near_teammate_ignore_spawnpoint_check_health;
+bool autocvar_g_spawn_near_teammate_ignore_spawnpoint_closetodeath;
float autocvar_g_buffs_waypoint_distance;
-float autocvar_g_buffs_randomize;
+bool autocvar_g_buffs_randomize;
float autocvar_g_buffs_random_lifetime;
-float autocvar_g_buffs_random_location;
-float autocvar_g_buffs_random_location_attempts;
-float autocvar_g_buffs_spawn_count;
-float autocvar_g_buffs_replace_powerups;
+bool autocvar_g_buffs_random_location;
+int autocvar_g_buffs_random_location_attempts;
+int autocvar_g_buffs_spawn_count;
+bool autocvar_g_buffs_replace_powerups;
float autocvar_g_buffs_cooldown_activate;
float autocvar_g_buffs_cooldown_respawn;
float autocvar_g_buffs_resistance_blockpercent;
+#include "aim.qh"
+#include "../_all.qh"
+
+#include "bot.qh"
+
+#include "../mutators/mutators_include.qh"
// traces multiple trajectories to find one that will impact the target
// 'end' vector is the place it aims for,
* Functions
*/
+float lag_additem(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4);
void lag_update();
void bot_lagfunc(float t, float f1, float f2, entity e1, vector v1, vector v2, vector v3, vector v4);
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../warpzonelib/common.qh"
- #include "../../warpzonelib/util_server.qh"
- #include "../../common/constants.qh"
- #include "../../common/teams.qh"
- #include "../../common/util.qh"
- #include "../../common/weapons/weapons.qh"
- #include "../weapons/accuracy.qh"
- #include "../t_items.qh"
- #include "../autocvars.qh"
- #include "../constants.qh"
- #include "../defs.qh"
- #include "../mutators/mutators_include.qh"
- #include "../campaign.qh"
- #include "../../common/mapinfo.qh"
- #include "../../csqcmodellib/sv_model.qh"
- #include "../antilag.qh"
-#endif
-
#include "bot.qh"
+#include "../_all.qh"
+
#include "aim.qh"
#include "navigation.qh"
+#include "scripting.qh"
#include "waypoints.qh"
-#include "aim.qc"
-#include "navigation.qc"
-#include "waypoints.qc"
-#include "scripting.qc"
+#include "havocbot/havocbot.qh"
+#include "havocbot/scripting.qh"
+
+#include "../antilag.qh"
+#include "../autocvars.qh"
+#include "../campaign.qh"
+#include "../cl_client.qh"
+#include "../constants.qh"
+#include "../defs.qh"
+#include "../race.qh"
+#include "../t_items.qh"
+
+#include "../mutators/mutators_include.qh"
+
+#include "../weapons/accuracy.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/teams.qh"
+#include "../../common/util.qh"
+
+#include "../../common/weapons/weapons.qh"
+
+#include "../../csqcmodellib/sv_model.qh"
+
+#include "../../dpdefs/dpextensions.qh"
+#include "../../dpdefs/progsdefs.qh"
-#include "havocbot/havocbot.qc"
+#include "../../warpzonelib/common.qh"
+#include "../../warpzonelib/util_server.qh"
entity bot_spawn()
{
*/
entity bot_spawn();
+float bot_fixcount();
void bot_think();
void bot_setnameandstuff();
#include "havocbot.qh"
-#include "role_onslaught.qc"
-#include "role_keyhunt.qc"
-#include "roles.qc"
+#include "../../_all.qh"
+
+#include "../aim.qh"
+#include "../bot.qh"
+#include "../navigation.qh"
+#include "../scripting.qh"
+#include "../waypoints.qh"
+
+#include "../../../common/constants.qh"
+
+#include "../../../warpzonelib/common.qh"
void havocbot_ai()
{
// if the bot is not attacking, consider reloading weapons
if (!(self.aistatus & AI_STATUS_ATTACKING))
{
- float i;
- entity e;
-
// we are currently holding a weapon that's not fully loaded, reload it
if(skill >= 2) // bots can only reload the held weapon on purpose past this skill
if(self.clip_load < self.clip_size)
if(skill >= 5) // bots can only look for unloaded weapons past this skill
if(self.clip_load >= 0) // only if we're not reloading a weapon already
{
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+ for (int i = WEP_FIRST; i <= WEP_LAST; ++i)
{
- e = get_weaponinfo(i);
+ entity e = get_weaponinfo(i);
if ((self.weapons & WepSet_FromWeapon(i)) && (e.spawnflags & WEP_FLAG_RELOADABLE) && (self.weapon_load[i] < e.reloading_ammo))
self.switchweapon = i;
}
+#include "role_keyhunt.qh"
+#include "../../_all.qh"
+
+#include "havocbot.qh"
+
+#include "../bot.qh"
+#include "../navigation.qh"
+
+#include "../../mutators/mutators_include.qh"
+
void() havocbot_role_kh_carrier;
void() havocbot_role_kh_defense;
void() havocbot_role_kh_offense;
void() havocbot_role_kh_freelancer;
-entity kh_worldkeylist;
-.entity kh_worldkeynext;
void havocbot_goalrating_kh(float ratingscale_team, float ratingscale_dropped, float ratingscale_enemy)
{
--- /dev/null
+#ifndef ROLE_KEYHUNT_H
+#define ROLE_KEYHUNT_H
+
+entity kh_worldkeylist;
+.entity kh_worldkeynext;
+
+void havocbot_chooserole_kh();
+#endif
+#include "../../_all.qh"
+
+#include "havocbot.qh"
+
+#include "../bot.qh"
+#include "../navigation.qh"
+#include "../waypoints.qh"
+
+#include "../../mutators/mutators_include.qh"
+
+#include "../../../common/teams.qh"
+
const int HAVOCBOT_ONS_ROLE_NONE = 0;
const int HAVOCBOT_ONS_ROLE_DEFENSE = 2;
const int HAVOCBOT_ONS_ROLE_ASSISTANT = 4;
--- /dev/null
+#ifndef ROLE_ONSLAUGHT_H
+#define ROLE_ONSLAUGHT_H
+void havocbot_chooserole_ons();
+#endif
+#include "../../_all.qh"
+
+#include "havocbot.qh"
+#include "role_keyhunt.qh"
+#include "role_onslaught.qh"
+
+#include "../bot.qh"
+#include "../navigation.qh"
.float max_armorvalue;
.float havocbot_role_timeout;
--- /dev/null
+#ifndef ROLES_H
+#define ROLES_H
+void havocbot_goalrating_controlpoints(float ratingscale, vector org, float sradius);
+#endif
--- /dev/null
+#ifndef HAVOCBOT_SCRIPTING_H
+#define HAVOCBOT_SCRIPTING_H
+
+void bot_clearqueue(entity bot);
+#endif
+#include "navigation.qh"
+#include "../_all.qh"
+
+#include "bot.qh"
+#include "waypoints.qh"
+
+#include "../t_items.qh"
+
+#include "../../common/constants.qh"
+
void bot_debug(string input)
{
switch(autocvar_bot_debug)
void botframe_updatedangerousobjects(float maxupdate);
entity navigation_findnearestwaypoint(entity ent, float walkfromwp);
+float navigation_waypoint_will_link(vector v, vector org, entity ent, float walkfromwp, float bestdist);
#endif
+#include "scripting.qh"
+#include "../_all.qh"
+
+#include "bot.qh"
+
.float bot_cmdqueuebuf_allocated;
.float bot_cmdqueuebuf;
.float bot_cmdqueuebuf_start;
}
-// NOTE: New commands should be added here. Do not forget to update BOT_CMD_COUNTER
-const int BOT_CMD_NULL = 0;
-const int BOT_CMD_PAUSE = 1;
-const int BOT_CMD_CONTINUE = 2;
-const int BOT_CMD_WAIT = 3;
-const int BOT_CMD_TURN = 4;
-const int BOT_CMD_MOVETO = 5;
-const int BOT_CMD_RESETGOAL = 6; // Not implemented yet
-const int BOT_CMD_CC = 7;
-const int BOT_CMD_IF = 8;
-const int BOT_CMD_ELSE = 9;
-const int BOT_CMD_FI = 10;
-const int BOT_CMD_RESETAIM = 11;
-const int BOT_CMD_AIM = 12;
-const int BOT_CMD_PRESSKEY = 13;
-const int BOT_CMD_RELEASEKEY = 14;
-const int BOT_CMD_SELECTWEAPON = 15;
-const int BOT_CMD_IMPULSE = 16;
-const int BOT_CMD_WAIT_UNTIL = 17;
-const int BOT_CMD_MOVETOTARGET = 18;
-const int BOT_CMD_AIMTARGET = 19;
-const int BOT_CMD_BARRIER = 20;
-const int BOT_CMD_CONSOLE = 21;
-const int BOT_CMD_SOUND = 22;
-const int BOT_CMD_DEBUG_ASSERT_CANFIRE = 23;
-const int BOT_CMD_WHILE = 24; // TODO: Not implemented yet
-const int BOT_CMD_WEND = 25; // TODO: Not implemented yet
-const int BOT_CMD_CHASE = 26; // TODO: Not implemented yet
-
-const int BOT_CMD_COUNTER = 24; // Update this value if you add/remove a command
-
-// NOTE: Following commands should be implemented on the bot ai
-// If a new command should be handled by the target ai(s) please declare it here
-.float(vector) cmd_moveto;
-.float() cmd_resetgoal;
-
-//
-const int BOT_CMD_PARAMETER_NONE = 0;
-const int BOT_CMD_PARAMETER_FLOAT = 1;
-const int BOT_CMD_PARAMETER_STRING = 2;
-const int BOT_CMD_PARAMETER_VECTOR = 3;
-
-float bot_cmds_initialized;
-int bot_cmd_parm_type[BOT_CMD_COUNTER];
-string bot_cmd_string[BOT_CMD_COUNTER];
-
-// Bots command queue
-entity bot_cmd; // global current command
-.entity bot_cmd_current; // current command of this bot
-
-.float is_bot_cmd; // Tells if the entity is a bot command
-.float bot_cmd_index; // Position of the command in the queue
-.int bot_cmd_type; // If of command (see the BOT_CMD_* defines)
-.float bot_cmd_parm_float; // Field to store a float parameter
-.string bot_cmd_parm_string; // Field to store a string parameter
-.vector bot_cmd_parm_vector; // Field to store a vector parameter
-
-float bot_barriertime;
-.float bot_barrier;
-
-.float bot_cmd_execution_index; // Position in the queue of the command to be executed
-
// Initialize global commands list
// NOTE: New commands should be initialized here
void bot_commands_init()
// Commands code
.int bot_exec_status;
-#define BOT_EXEC_STATUS_IDLE 0
-#define BOT_EXEC_STATUS_PAUSED 1
-#define BOT_EXEC_STATUS_WAITING 2
-
-#define CMD_STATUS_EXECUTING 0
-#define CMD_STATUS_FINISHED 1
-#define CMD_STATUS_ERROR 2
-
void SV_ParseClientCommand(string s);
float bot_cmd_cc()
{
void bot_resetqueues()
{
entity cl;
- float i;
FOR_EACH_CLIENT(cl) if(cl.isbot)
{
bot_clearqueue(cl);
// also, cancel all barriers
cl.bot_barrier = 0;
- for(i = 0; i < cl.bot_places_count; ++i)
+ for(int i = 0; i < cl.bot_places_count; ++i)
{
strunzone(cl.(bot_placenames[i]));
cl.(bot_placenames[i]) = string_null;
--- /dev/null
+#ifndef BOT_SCRIPTING_H
+#define BOT_SCRIPTING_H
+
+#define BOT_EXEC_STATUS_IDLE 0
+#define BOT_EXEC_STATUS_PAUSED 1
+#define BOT_EXEC_STATUS_WAITING 2
+
+#define CMD_STATUS_EXECUTING 0
+#define CMD_STATUS_FINISHED 1
+#define CMD_STATUS_ERROR 2
+
+
+// NOTE: New commands should be added here. Do not forget to update BOT_CMD_COUNTER
+const int BOT_CMD_NULL = 0;
+const int BOT_CMD_PAUSE = 1;
+const int BOT_CMD_CONTINUE = 2;
+const int BOT_CMD_WAIT = 3;
+const int BOT_CMD_TURN = 4;
+const int BOT_CMD_MOVETO = 5;
+const int BOT_CMD_RESETGOAL = 6; // Not implemented yet
+const int BOT_CMD_CC = 7;
+const int BOT_CMD_IF = 8;
+const int BOT_CMD_ELSE = 9;
+const int BOT_CMD_FI = 10;
+const int BOT_CMD_RESETAIM = 11;
+const int BOT_CMD_AIM = 12;
+const int BOT_CMD_PRESSKEY = 13;
+const int BOT_CMD_RELEASEKEY = 14;
+const int BOT_CMD_SELECTWEAPON = 15;
+const int BOT_CMD_IMPULSE = 16;
+const int BOT_CMD_WAIT_UNTIL = 17;
+const int BOT_CMD_MOVETOTARGET = 18;
+const int BOT_CMD_AIMTARGET = 19;
+const int BOT_CMD_BARRIER = 20;
+const int BOT_CMD_CONSOLE = 21;
+const int BOT_CMD_SOUND = 22;
+const int BOT_CMD_DEBUG_ASSERT_CANFIRE = 23;
+const int BOT_CMD_WHILE = 24; // TODO: Not implemented yet
+const int BOT_CMD_WEND = 25; // TODO: Not implemented yet
+const int BOT_CMD_CHASE = 26; // TODO: Not implemented yet
+
+const int BOT_CMD_COUNTER = 24; // Update this value if you add/remove a command
+
+// NOTE: Following commands should be implemented on the bot ai
+// If a new command should be handled by the target ai(s) please declare it here
+.float(vector) cmd_moveto;
+.float() cmd_resetgoal;
+
+//
+const int BOT_CMD_PARAMETER_NONE = 0;
+const int BOT_CMD_PARAMETER_FLOAT = 1;
+const int BOT_CMD_PARAMETER_STRING = 2;
+const int BOT_CMD_PARAMETER_VECTOR = 3;
+
+float bot_cmds_initialized;
+int bot_cmd_parm_type[BOT_CMD_COUNTER];
+string bot_cmd_string[BOT_CMD_COUNTER];
+
+// Bots command queue
+entity bot_cmd; // global current command
+.entity bot_cmd_current; // current command of this bot
+
+.float is_bot_cmd; // Tells if the entity is a bot command
+.float bot_cmd_index; // Position of the command in the queue
+.int bot_cmd_type; // If of command (see the BOT_CMD_* defines)
+.float bot_cmd_parm_float; // Field to store a float parameter
+.string bot_cmd_parm_string; // Field to store a string parameter
+.vector bot_cmd_parm_vector; // Field to store a vector parameter
+
+float bot_barriertime;
+.float bot_barrier;
+
+.float bot_cmd_execution_index; // Position in the queue of the command to be executed
+
+
+void bot_resetqueues();
+void bot_queuecommand(entity bot, string cmdstring);
+void bot_cmdhelp(string scmd);
+void bot_list_commands();
+float bot_execute_commands();
+entity find_bot_by_name(string name);
+entity find_bot_by_number(float number);
+#endif
+#include "waypoints.qh"
+#include "../_all.qh"
+
+#include "bot.qh"
+#include "navigation.qh"
+
+#include "../antilag.qh"
+
+#include "../../common/constants.qh"
+
+#include "../../warpzonelib/util_server.qh"
+
// create a new spawnfunc_waypoint and automatically link it to other waypoints, and link
// them back to it as well
// (suitable for spawnfunc_waypoint editor)
w = find(w, classname, "waypoint");
}
- waypoint_schedulerelink(p.fld = waypoint_spawn(v, v, f));
+ waypoint_schedulerelink(p.(fld) = waypoint_spawn(v, v, f));
return 1;
}
if(navigation_waypoint_will_link(w.origin, porg, p, walkfromwp, 1050))
{
bestdist = d;
- p.fld = w;
+ p.(fld) = w;
}
}
w = find(w, classname, "waypoint");
}
if(bestdist < maxdist)
{
- print("update chain to new nearest WP ", etos(p.fld), "\n");
+ print("update chain to new nearest WP ", etos(p.(fld)), "\n");
return 0;
}
// we know maxdist < 2100
// so wp -> porg is still valid
// all is good
- p.fld = wp;
+ p.(fld) = wp;
return 0;
}
setorigin(p, save);
if(w)
{
- p.fld = w;
+ p.(fld) = w;
return 0;
}
}
.entity botframe_autowaypoints_lastwp0, botframe_autowaypoints_lastwp1;
void botframe_autowaypoints_fix(entity p, float walkfromwp, .entity fld)
{
- float r;
- r = botframe_autowaypoints_fix_from(p, walkfromwp, p.fld, fld);
+ float r = botframe_autowaypoints_fix_from(p, walkfromwp, p.(fld), fld);
if(r != -1)
return;
r = botframe_autowaypoints_fix_from(p, walkfromwp, world, fld);
#include "cheats.qh"
+#include "_all.qh"
+
#include "g_damage.qh"
#include "race.qh"
#include "t_teleporters.qh"
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../warpzonelib/anglestransform.qh"
- #include "../warpzonelib/util_server.qh"
- #include "../common/constants.qh"
- #include "../common/util.qh"
- #include "../common/monsters/monsters.qh"
- #include "../common/weapons/weapons.qh"
- #include "weapons/tracing.qh"
- #include "autocvars.qh"
- #include "defs.qh"
- #include "../common/deathtypes.qh"
- #include "mutators/mutators_include.qh"
- #include "../csqcmodellib/sv_model.qh"
-#endif
+#include "mutators/mutators_include.qh"
+
+#include "weapons/tracing.qh"
+
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/util.qh"
+
+#include "../common/monsters/monsters.qh"
+
+#include "../common/weapons/weapons.qh"
+
+#include "../csqcmodellib/sv_model.qh"
+
+#include "../warpzonelib/anglestransform.qh"
+#include "../warpzonelib/util_server.qh"
void CopyBody(float keepvelocity);
.float maycheat;
float gamestart_sv_cheats;
-const float CHIMPULSE_SPEEDRUN_INIT = 30;
-const float CHIMPULSE_GIVE_ALL = 99;
-const float CHIMPULSE_CLONE_MOVING = 140;
-const float CHIMPULSE_SPEEDRUN = 141;
-const float CHIMPULSE_CLONE_STANDING = 142;
-const float CHIMPULSE_TELEPORT = 143;
-const float CHIMPULSE_R00T = 148;
-const float CHRAME_DRAG = 8;
void CheatInit()
{
float CheatCommand(float argc);
float CheatFrame();
+const float CHIMPULSE_SPEEDRUN_INIT = 30;
+const float CHIMPULSE_GIVE_ALL = 99;
+const float CHIMPULSE_CLONE_MOVING = 140;
+const float CHIMPULSE_SPEEDRUN = 141;
+const float CHIMPULSE_CLONE_STANDING = 142;
+const float CHIMPULSE_TELEPORT = 143;
+const float CHIMPULSE_R00T = 148;
+
+const float CHRAME_DRAG = 8;
+
void Drag_MoveDrag(entity from, entity to); // call this from CopyBody
#endif
+#include "cl_client.qh"
+
#include "waypointsprites.qh"
+#include "anticheat.qh"
#include "cl_impulse.qh"
#include "cl_player.qh"
#include "ent_cs.qh"
#include "teamplay.qh"
#include "playerdemo.qh"
#include "secret.qh"
+#include "spawnpoints.qh"
+#include "g_damage.qh"
+#include "g_hook.qh"
+#include "t_teleporters.qh"
+#include "command/common.qh"
+#include "cheats.qh"
+#include "g_world.qh"
+#include "race.qh"
+#include "antilag.qh"
+#include "campaign.qh"
+#include "command/common.qh"
#include "bot/bot.qh"
#include "bot/navigation.qh"
+#include "vehicles/vehicle.qh"
+
#include "weapons/hitplot.qh"
#include "weapons/weaponsystem.qh"
#include "../warpzonelib/server.qh"
-float c1, c2, c3, c4;
void send_CSQC_teamnagger() {
WriteByte(MSG_BROADCAST, SVC_TEMPENTITY);
defaultskin = 0;
chmdl = false;
- if(autocvar_sv_defaultcharacter == 1)
+ if(autocvar_sv_defaultcharacter)
{
if(teamplay)
{
if(IS_PLAYER(self))
{
entity spot, oldself;
- float j;
accuracy_resend(self);
target_voicescript_clear(self);
// reset fields the weapons may use
- for (j = WEP_FIRST; j <= WEP_LAST; ++j)
+ for (int j = WEP_FIRST; j <= WEP_LAST; ++j)
{
WEP_ACTION(j, WR_RESETPLAYER);
// all weapons must be fully loaded when we spawn
entity e = get_weaponinfo(j);
- if(e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
+ if (e.spawnflags & WEP_FLAG_RELOADABLE) // prevent accessing undefined cvars
self.(weapon_load[j]) = e.reloading_ammo;
}
.float ebouncefactor, ebouncestop; // electro's values
// TODO do we need all these fields, or should we stop autodetecting runtime
// changes and just have a console command to update this?
-float ClientInit_SendEntity(entity to, float sf)
+float ClientInit_SendEntity(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_INIT);
WriteByte(MSG_ENTITY, g_nexball_meter_period * 32);
--- /dev/null
+#ifndef CL_CLIENT_H
+#define CL_CLIENT_H
+float c1, c2, c3, c4;
+
+void play_countdown(float finished, string samp);
+
+float CalcRotRegen(float current, float regenstable, float regenfactor, float regenlinear, float regenframetime, float rotstable, float rotfactor, float rotlinear, float rotframetime, float limit);
+
+float Spectate(entity pl);
+
+void CTS_ClientKill (entity e);
+
+#endif
+#include "_all.qh"
#include "round_handler.qh"
#include "bot/waypoints.qh"
#include "weapons/throwing.qh"
+#include "command/common.qh"
+#include "cheats.qh"
+#include "bot/navigation.qh"
+#include "weapons/selection.qh"
+#include "weapons/tracing.qh"
+#include "weapons/weaponsystem.qh"
+#include "vehicles/vehicle.qh"
+#include "waypointsprites.qh"
#include "../common/weapons/weapons.qh"
if(self.deadflag == DEAD_NO)
{
// custom order weapon cycling
- i = imp % 10;
+ int i = imp % 10;
m = (imp - (210 + i)); // <0 for prev, =0 for best, >0 for next
W_CycleWeapon(self.(cvar_cl_weaponpriorities[i]), m);
}
+#include "_all.qh"
+#include "bot/bot.qh"
+#include "g_damage.qh"
+
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
#endif
}
-float speedaward_speed;
-string speedaward_holder;
-string speedaward_uid;
-void race_send_speedaward(float msg)
-{
- // send the best speed of the round
- WriteByte(msg, SVC_TEMPENTITY);
- WriteByte(msg, TE_CSQC_RACE);
- WriteByte(msg, RACE_NET_SPEED_AWARD);
- WriteInt24_t(msg, floor(speedaward_speed+0.5));
- WriteString(msg, speedaward_holder);
-}
-
-float speedaward_alltimebest;
-string speedaward_alltimebest_holder;
-string speedaward_alltimebest_uid;
-void race_send_speedaward_alltimebest(float msg)
-{
- // send the best speed
- WriteByte(msg, SVC_TEMPENTITY);
- WriteByte(msg, TE_CSQC_RACE);
- WriteByte(msg, RACE_NET_SPEED_AWARD_BEST);
- WriteInt24_t(msg, floor(speedaward_alltimebest+0.5));
- WriteString(msg, speedaward_alltimebest_holder);
-}
-
string GetMapname(void);
float speedaward_lastupdate;
float speedaward_lastsent;
#include "cl_player.qh"
+#include "_all.qh"
+
+#include "bot/bot.qh"
+#include "cheats.qh"
+#include "g_damage.qh"
+#include "g_subs.qh"
#include "g_triggers.qh"
#include "g_violence.qh"
#include "miscfunctions.qh"
+#include "portals.qh"
+#include "teamplay.qh"
+#include "waypointsprites.qh"
+#include "weapons/throwing.qh"
+#include "command/common.qh"
+#include "../common/animdecide.qh"
+#include "../common/csqcmodel_settings.qh"
+#include "../common/deathtypes.qh"
+#include "../common/playerstats.qh"
+#include "../csqcmodellib/sv_model.qh"
#include "weapons/weaponstats.qh"
}
}
-void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
float take, save;
vector v;
flood = 2;
}
- if(time >= source.flood_field)
+ if (time >= source.(flood_field))
{
- source.flood_field = max(time - flood_burst * flood_spl, source.flood_field) + lines * flood_spl;
+ source.(flood_field) = max(time - flood_burst * flood_spl, source.(flood_field)) + lines * flood_spl;
}
else
{
}
else
{
- if(time >= source.flood_field)
- source.flood_field = max(time - flood_burst * flood_spl, source.flood_field) + flood_spl;
+ if (time >= source.(flood_field))
+ source.(flood_field) = max(time - flood_burst * flood_spl, source.(flood_field)) + flood_spl;
else
flood = 1;
}
if (timeout_status == TIMEOUT_ACTIVE) // when game is paused, no flood protection
- source.flood_field = flood = 0;
+ source.(flood_field) = flood = 0;
}
if(flood == 2) // cannot happen for empty msgstr
}
else if(flood == 1)
{
- if(autocvar_g_chat_flood_notify_flooder)
+ if (autocvar_g_chat_flood_notify_flooder)
{
- sprint(source, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(source.flood_field - time), "^3 seconds\n"));
+ sprint(source, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(source.(flood_field) - time), "^3 seconds\n"));
ret = 0;
}
else
field = GetVoiceMessageSampleField(argv(0));
if(GetPlayerSoundSampleField_notFound)
continue;
- if(self.field)
- strunzone(self.field);
- self.field = strzone(strcat(argv(1), " ", argv(2)));
+ if (self.(field))
+ strunzone(self.(field));
+ self.(field) = strzone(strcat(argv(1), " ", argv(2)));
}
fclose(fh);
return 1;
void PlayerSound(.string samplefield, float chan, float voicetype)
{
- GlobalSound(self.samplefield, chan, voicetype);
+ GlobalSound(self.(samplefield), chan, voicetype);
}
void VoiceMessage(string type, string msg)
flood = Say(self, ownteam, world, msg, 1);
- if(IS_SPEC(self) || IS_OBSERVER(self) || flood < 0)
- FakeGlobalSound(self.sample, CH_VOICE, voicetype);
+ if (IS_SPEC(self) || IS_OBSERVER(self) || flood < 0)
+ FakeGlobalSound(self.(sample), CH_VOICE, voicetype);
else if (flood > 0)
- GlobalSound(self.sample, CH_VOICE, voicetype);
+ GlobalSound(self.(sample), CH_VOICE, voicetype);
}
void MoveToTeam(entity client, float team_colour, float type)
void player_anim (void);
-void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
+void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
// g_<gametype>_str:
// If 0, default is used.
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/dpextensions.qh"
- #include "../../common/util.qh"
- #include "../../common/command/shared_defs.qh"
- #include "../autocvars.qh"
- #include "common.qh"
- #include "banning.qh"
- #include "../ipban.qh"
-#endif
+#include "../../common/command/command.qh"
+#include "banning.qh"
+#include "../_all.qh"
+
+#include "common.qh"
+
+#include "../cl_player.qh"
+#include "../ipban.qh"
+
+#include "../../common/util.qh"
+
// =====================================================
// Banning and kicking command code, written by Samual
// Last updated: December 29th, 2011
// used by common/command/generic.qc:GenericCommand_dumpcommands to list all commands into a .txt file
void BanCommand_macro_write_aliases(float fh);
+
+void BanCommand_macro_help();
+float BanCommand_macro_usage(float argc);
+
#endif
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../warpzonelib/common.qh"
- #include "../../common/constants.qh"
- #include "../../common/teams.qh"
- #include "../../common/util.qh"
- #include "../../common/command/shared_defs.qh"
- #include "../../common/monsters/monsters.qh"
- #include "../../common/monsters/sv_monsters.qh"
- #include "../../common/monsters/spawn.qh"
- #include "../autocvars.qh"
- #include "../defs.qh"
- #include "../../common/notifications.qh"
- #include "../../common/deathtypes.qh"
- #include "../mutators/mutators_include.qh"
- #include "../vehicles/vehicles_def.qh"
- #include "../campaign.qh"
- #include "../../common/mapinfo.qh"
- #include "common.qh"
- #include "vote.qh"
- #include "cmd.qh"
- #include "../cheats.qh"
- #include "../scores.qh"
- #include "../ipban.qh"
+#include "../../common/command/command.qh"
+#include "cmd.qh"
+#include "../_all.qh"
+
+#include "common.qh"
+#include "vote.qh"
+
+#include "../campaign.qh"
+#include "../cheats.qh"
+#include "../cl_player.qh"
+#include "../g_triggers.qh"
+#include "../ipban.qh"
+#include "../mapvoting.qh"
+#include "../scores.qh"
+#include "../teamplay.qh"
+
+#include "../mutators/mutators_include.qh"
+
+#ifdef SVQC
+ #include "../vehicles/vehicle.qh"
#endif
+#include "../../common/constants.qh"
+#include "../../common/deathtypes.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/notifications.qh"
+#include "../../common/teams.qh"
+#include "../../common/util.qh"
+
+#include "../../common/monsters/monsters.qh"
+#include "../../common/monsters/spawn.qh"
+#include "../../common/monsters/sv_monsters.qh"
+
+#include "../../warpzonelib/common.qh"
+
+void ClientKill_TeamChange (float targetteam); // 0 = don't change, -1 = auto, -2 = spec
+
// =========================================================
// Server side networked commands code, reworked by Samual
// Last updated: December 28th, 2011
--- /dev/null
+#include "../../common/command/commands.qc"
+
+#include "sv_cmd.qc"
+
+#include "banning.qc"
+#include "cmd.qc"
+#include "common.qc"
+#include "getreplies.qc"
+#include "radarmap.qc"
+#include "vote.qc"
--- /dev/null
+#ifndef SERVER_COMMANDS_H
+#define SERVER_COMMANDS_H
+
+#include "../../common/command/commands.qh"
+
+#include "sv_cmd.qh"
+
+#include "banning.qh"
+#include "cmd.qh"
+#include "common.qh"
+#include "getreplies.qh"
+#include "radarmap.qh"
+#include "vote.qh"
+
+#endif
+#include "../../common/command/command.qh"
#include "common.qh"
+#include "../_all.qh"
+#include "../scores.qh"
+
+#include "../../common/notifications.qh"
#include "../../common/counting.qh"
#include "vote.qh"
#include "../../common/command/generic.qh"
-#include "../../common/command/shared_defs.qh"
+#include "../../common/command/command.qh"
// ============================================================
// Shared declarations for server commands, written by Samual
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../common/constants.qh"
- #include "../../common/util.qh"
- #include "../../common/counting.qh"
- #include "../../common/monsters/monsters.qh"
- #include "../defs.qh"
- #include "../../common/mapinfo.qh"
- #include "getreplies.qh"
- #include "../race.qh"
-#endif
+#include "../../common/command/command.qh"
+#include "getreplies.qh"
+#include "../_all.qh"
+
+#include "../race.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/counting.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/util.qh"
+
+#include "../../common/monsters/monsters.qh"
// =========================================================
// Reply messages for common commands, re-worked by Samual
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../common/util.qh"
- #include "../defs.qh"
- #include "radarmap.qh"
- #include "../../csqcmodellib/sv_model.qh"
-#endif
+#include "../../common/command/command.qh"
+#include "radarmap.qh"
+#include "../_all.qh"
+
+#include "../g_subs.qh"
+#include "../g_world.qh"
+
+#include "../../common/util.qh"
+
+#include "../../csqcmodellib/sv_model.qh"
// ===============================================
// Generates radar map images for use in the HUD
{
sharpen_buffer[x + 2 * RADAR_WIDTH_MAX] = v;
}
-float sharpen_getpixel(float x, float y)
+float sharpen_getpixel(int x, int y)
{
if(x < 0)
return 0;
string doublehex = "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAABACADAEAFB0B1B2B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD0D1D2D3D4D5D6D7D8D9DADBDCDDDEDFE0E1E2E3E4E5E6E7E8E9EAEBECEDEEEFF0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFFFF";
// FF is contained twice, to map 256 to FF too
// removes the need to bound()
+
+float RadarMap_Make(float argc);
+
+
#endif
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../warpzonelib/mathlib.qh"
- #include "../../common/constants.qh"
- #include "../../common/teams.qh"
- #include "../../common/util.qh"
- #include "../../common/command/shared_defs.qh"
- #include "../../common/monsters/sv_monsters.qh"
- #include "../autocvars.qh"
- #include "../defs.qh"
- #include "../../common/notifications.qh"
- #include "../mutators/mutators_include.qh"
- #include "../../common/mapinfo.qh"
- #include "common.qh"
- #include "cmd.qh"
- #include "sv_cmd.qh"
- #include "../anticheat.qh"
- #include "../playerdemo.qh"
-#endif
+#include "../../common/command/command.qh"
+#include "sv_cmd.qh"
+#include "../_all.qh"
+
+#include "banning.qh"
+#include "cmd.qh"
+#include "common.qh"
+#include "getreplies.qh"
+#include "radarmap.qh"
+
+#include "../anticheat.qh"
+#include "../campaign.qh"
+#include "../cl_client.qh"
+#include "../cl_player.qh"
+#include "../g_world.qh"
+#include "../ipban.qh"
+#include "../playerdemo.qh"
+#include "../teamplay.qh"
+
+#include "../bot/bot.qh"
+#include "../bot/navigation.qh"
+#include "../bot/scripting.qh"
+
+#include "../mutators/mutators_include.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/notifications.qh"
+#include "../../common/teams.qh"
+#include "../../common/util.qh"
+
+#include "../../common/monsters/sv_monsters.qh"
+
+#include "../../warpzonelib/mathlib.qh"
+
+void PutObserverInServer (void);
// =====================================================
// Server side game commands code, reworked by Samual
void changematchtime(float delta, float mi, float ma)
{
float cur;
- float new;
+ float update;
float lim;
if(delta == 0)
if(lim == 0)
return; // cannot increase any further
else if(lim < ma)
- new = min(ma, lim + delta);
+ update = min(ma, lim + delta);
else // already above maximum: FAIL
return;
}
else
{
if(lim == 0) // infinite: try reducing to max, if we are allowed to
- new = max(mi, ma);
+ update = max(mi, ma);
else if(lim > mi) // above minimum: decrease
- new = max(mi, lim + delta);
+ update = max(mi, lim + delta);
else // already below minimum: FAIL
return;
}
- cvar_set("timelimit", ftos(new / 60));
+ cvar_set("timelimit", ftos(update / 60));
}
{
entity tmp_player;
int i;
- float x, z, t_teams, t_players, team_color;
+ float x, t_teams, t_players, team_color;
// count the total amount of players and total amount of teams
t_players = 0;
}
// finally, from the list made earlier, re-join the players in different order.
- for(i = 1; i <= t_teams; ++i)
+ for (int i = 1; i <= t_teams; ++i)
{
// find out how many players to assign to this team
x = (t_players / t_teams);
team_color = Team_NumberToTeam(i);
// sort through the random list of players made earlier
- for(z = 1; z <= maxclients; ++z)
+ for (int z = 1; z <= maxclients; ++z)
{
if (!(shuffleteams_teams[i] >= x))
{
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../common/constants.qh"
- #include "../../common/util.qh"
- #include "../../common/command/shared_defs.qh"
- #include "../autocvars.qh"
- #include "../constants.qh"
- #include "../defs.qh"
- #include "../../common/notifications.qh"
- #include "../mutators/mutators_include.qh"
- #include "../../common/mapinfo.qh"
- #include "common.qh"
- #include "vote.qh"
- #include "../../common/playerstats.qh"
- #include "../scores.qh"
- #include "../race.qh"
- #include "../round_handler.qh"
-#endif
+#include "../../common/command/command.qh"
+#include "vote.qh"
+#include "../_all.qh"
+
+#include "common.qh"
+
+#include "../g_damage.qh"
+#include "../g_world.qh"
+#include "../race.qh"
+#include "../round_handler.qh"
+#include "../scores.qh"
+
+#include "../mutators/mutators_include.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/notifications.qh"
+#include "../../common/playerstats.qh"
+#include "../../common/util.qh"
// =============================================
// Server side voting code, reworked by Samual
.float ready; // flag for if a player is ready
void reset_map(float dorespawn);
void ReadyCount();
+void ReadyRestart_force();
#endif
--- /dev/null
+#ifndef CSQCEFFECTS_H
+#define CSQCEFFECTS_H
+void te_csqc_lightningarc(vector from,vector to);
+#endif
// Fields
-.void(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) event_damage;
+.void(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force) event_damage;
//.string wad;
//.string map;
.entity flagcarried;
-.float playerid;
+.int playerid;
float playerid_last;
.float noalign; // if set to 1, the item or spawnpoint won't be dropped to the floor
.float version_nagtime;
const int NUM_JUMPPADSUSED = 3;
-.float jumppadcount;
+.int jumppadcount;
.entity jumppadsused[NUM_JUMPPADSUSED];
string gamemode_name;
.entity killindicator;
.float killindicator_teamchange;
-void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
+void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
float lockteams;
.float Version;
.int SendFlags;
-.float(entity to, float sendflags) SendEntity;
+.bool(entity to, int sendflags) SendEntity;
// player sounds, voice messages
// TODO implemented fall and falling
.float stat_leadlimit;
-float radar_showennemies;
+bool radar_showennemies;
#ifdef PROFILING
float client_cefc_accumulator;
#endif
.float weapon_load[WEP_MAXCOUNT];
-.float ammo_none; // used by the reloading system, must always be 0
+.int ammo_none; // used by the reloading system, must always be 0
.float clip_load;
.float old_clip_load;
.float clip_size;
.float vortex_chargepool_ammo;
.float hagar_load;
-.float grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
+.int grab; // 0 = can't grab, 1 = owner can grab, 2 = owner and team mates can grab, 3 = anyone can grab
#define PROJECTILE_MAKETRIGGER(e) (e).solid = SOLID_CORPSE; (e).dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE
// when doing this, hagar can go through clones
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../common/constants.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "mutators/mutators_include.qh"
-#endif
+#include "_all.qh"
+
+#include "defs.qh"
+#include "mutators/mutators_include.qh"
/**
* The point of these entities is to avoid the problems
+#include "_all.qh"
+
+#include "g_subs.qh"
+#include "waypointsprites.qh"
+#include "g_damage.qh"
+#include "bot/bot.qh"
+#include "../common/csqcmodel_settings.qh"
+#include "../csqcmodellib/sv_model.qh"
#include "weapons/common.qh"
.entity sprite;
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../common/constants.qh"
- #include "../common/util.qh"
- #include "constants.qh"
- #include "defs.qh"
-#endif
+#include "_all.qh"
-float Casing_SendEntity(entity to, float sf)
+#include "../common/util.qh"
+
+float Casing_SendEntity(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_CASING);
WriteByte(MSG_ENTITY, self.state); // actually type
#include "g_damage.qh"
-
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../warpzonelib/common.qh"
- #include "../common/constants.qh"
- #include "../common/teams.qh"
- #include "../common/util.qh"
- #include "../common/weapons/weapons.qh"
- #include "weapons/accuracy.qh"
- #include "weapons/csqcprojectile.qh"
- #include "weapons/selection.qh"
- #include "t_items.qh"
- #include "autocvars.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "../common/notifications.qh"
- #include "../common/deathtypes.qh"
- #include "mutators/mutators_include.qh"
- #include "tturrets/include/turrets_early.qh"
- #include "vehicles/vehicles_def.qh"
- #include "../csqcmodellib/sv_model.qh"
- #include "../common/playerstats.qh"
- #include "g_hook.qh"
- #include "scores.qh"
- #include "spawnpoints.qh"
-#endif
-
-float Damage_DamageInfo_SendEntity(entity to, float sf)
+#include "_all.qh"
+
+#include "g_hook.qh"
+#include "mutators/mutators_include.qh"
+#include "scores.qh"
+#include "waypointsprites.qh"
+#include "spawnpoints.qh"
+#include "tturrets/include/turrets_early.qh"
+#include "t_items.qh"
+#include "vehicles/vehicle.qh"
+#include "weapons/accuracy.qh"
+#include "weapons/csqcprojectile.qh"
+#include "weapons/selection.qh"
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/notifications.qh"
+#include "../common/playerstats.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
+#include "../csqcmodellib/sv_model.qh"
+#include "../warpzonelib/common.qh"
+
+float Damage_DamageInfo_SendEntity(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_DAMAGEINFO);
WriteShort(MSG_ENTITY, self.projectiledeathtype);
return true;
}
-void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, float deathtype, float bloodtype, entity dmgowner)
+void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, int deathtype, float bloodtype, entity dmgowner)
{
// TODO maybe call this from non-edgedamage too?
// TODO maybe make the client do the particle effects for the weapons and the impact sounds using this info?
PlayerTeamScore_AddScore(player, f);
}
-void GiveFrags (entity attacker, entity targ, float f, float deathtype)
+void GiveFrags (entity attacker, entity targ, float f, int deathtype)
{
// TODO route through PlayerScores instead
if(gameover) return;
return s;
}
-void LogDeath(string mode, float deathtype, entity killer, entity killed)
+void LogDeath(string mode, int deathtype, entity killer, entity killed)
{
string s;
if(!autocvar_sv_eventlog)
void Obituary_SpecialDeath(
entity notif_target,
float murder,
- float deathtype,
+ int deathtype,
string s1, string s2, string s3,
float f1, float f2, float f3)
{
float Obituary_WeaponDeath(
entity notif_target,
float murder,
- float deathtype,
+ int deathtype,
string s1, string s2, string s3,
float f1, float f2)
{
if(death_weapon)
{
w_deathtype = deathtype;
- float death_message = WEP_ACTION(death_weapon, ((murder) ? WR_KILLMESSAGE : WR_SUICIDEMESSAGE));
+ int death_message = WEP_ACTION(death_weapon, ((murder) ? WR_KILLMESSAGE : WR_SUICIDEMESSAGE));
w_deathtype = false;
- if(death_message)
+ if (death_message)
{
Send_Notification_WOCOVA(
NOTIF_ONE,
return false;
}
-void Obituary(entity attacker, entity inflictor, entity targ, float deathtype)
+void Obituary(entity attacker, entity inflictor, entity targ, int deathtype)
{
// Sanity check
if (!IS_PLAYER(targ)) { backtrace("Obituary called on non-player?!\n"); return; }
targ.iceblock = world;
}
-void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
float mirrordamage;
float mirrorforce;
}
}
-float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, float deathtype, entity directhitentity)
+float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, int deathtype, entity directhitentity)
// Returns total damage applies to creatures
{
entity targ;
return total_damage_to_creatures;
}
-float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, float deathtype, entity directhitentity)
+float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, entity directhitentity)
{
return RadiusDamageForSource (inflictor, (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5), inflictor.velocity, attacker, coredamage, edgedamage, rad, cantbe, mustbe, false, forceintensity, deathtype, directhitentity);
}
#include "../common/deathtypes.qh"
#include "mutators/mutators_include.qh"
#include "tturrets/include/turrets_early.qh"
- #include "vehicles/vehicles_def.qh"
+ #include "vehicles/vehicle.qh"
#include "../csqcmodellib/sv_model.qh"
#include "../common/playerstats.qh"
#include "g_hook.qh"
.float dmg_force;
.float dmg_radius;
-float Damage_DamageInfo_SendEntity(entity to, float sf);
+float Damage_DamageInfo_SendEntity(entity to, int sf);
-void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, float deathtype, float bloodtype, entity dmgowner);
+void Damage_DamageInfo(vector org, float coredamage, float edgedamage, float rad, vector force, int deathtype, float bloodtype, entity dmgowner);
float checkrules_firstblood;
// NOTE: f=0 means still count as a (positive) kill, but count no frags for it
void W_SwitchWeapon_Force(entity e, float w);
entity GiveFrags_randomweapons;
-void GiveFrags (entity attacker, entity targ, float f, float deathtype);
+void GiveFrags (entity attacker, entity targ, float f, int deathtype);
string AppendItemcodes(string s, entity player);
-void LogDeath(string mode, float deathtype, entity killer, entity killed);
+void LogDeath(string mode, int deathtype, entity killer, entity killed);
void Obituary_SpecialDeath(
entity notif_target,
float murder,
- float deathtype,
+ int deathtype,
string s1, string s2, string s3,
float f1, float f2, float f3);
float Obituary_WeaponDeath(
entity notif_target,
float murder,
- float deathtype,
+ int deathtype,
string s1, string s2, string s3,
float f1, float f2);
-void Obituary(entity attacker, entity inflictor, entity targ, float deathtype);
+void Obituary(entity attacker, entity inflictor, entity targ, int deathtype);
void Ice_Think();
entity damage_inflictor;
entity damage_attacker;
-void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
+void Damage (entity targ, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
float RadiusDamage_running;
-float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, float deathtype, entity directhitentity);
+float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector inflictorvelocity, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float inflictorselfdamage, float forceintensity, int deathtype, entity directhitentity);
// Returns total damage applies to creatures
-float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, float deathtype, entity directhitentity);
+float RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype, entity directhitentity);
.float fire_damagepersec;
.float fire_endtime;
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../warpzonelib/common.qh"
- #include "../warpzonelib/server.qh"
- #include "../common/constants.qh"
- #include "../common/util.qh"
- #include "../common/weapons/weapons.qh"
- #include "autocvars.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "vehicles/vehicles_def.qh"
- #include "command/common.qh"
- #include "g_hook.qh"
- #include "round_handler.qh"
-#endif
+#include "g_hook.qh"
+#include "_all.qh"
+
+#include "weapons/common.qh"
+#include "weapons/weaponsystem.qh"
+#include "weapons/selection.qh"
+#include "weapons/tracing.qh"
+#include "cl_player.qh"
+#include "t_teleporters.qh"
+#include "command/common.qh"
+#include "round_handler.qh"
+#include "vehicles/vehicle.qh"
+#include "../common/constants.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/server.qh"
/*============================================
}
.vector hook_start, hook_end;
-float GrapplingHookSend(entity to, float sf)
+float GrapplingHookSend(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_HOOK);
sf = sf & 0x7F;
void GrapplingHookThink()
{
- float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch, s;
+ float spd, dist, minlength, pullspeed, ropestretch, ropeairfriction, rubberforce, newlength, rubberforce_overstretch;
vector dir, org, end, v0, dv, v, myorg, vs;
if(self.realowner.hook != self) // how did that happen?
{
self.nextthink = time;
- s = self.realowner.cvar_cl_gunalign;
+ int s = self.realowner.cvar_cl_gunalign;
if(s != 1 && s != 2 && s != 4)
s = 3; // default value
--s;
//self.realowner.disableclientprediction = true;
}
-void GrapplingHook_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void GrapplingHook_Damage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.health <= 0)
return;
{
entity missile;
vector org;
- float s;
vector vs;
if(forbidWeaponUse()) return;
makevectors(self.v_angle);
- s = self.cvar_cl_gunalign;
+ int s = self.cvar_cl_gunalign;
if(s != 1 && s != 2 && s != 4)
s = 3; // default value
--s;
+#include "_all.qh"
+
+void train_next();
+
const float LOOP = 1;
const float DNOSHADOW = 2;
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../common/constants.qh"
- #include "autocvars.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "../csqcmodellib/sv_model.qh"
-#endif
+#include "_all.qh"
+
+#include "g_subs.qh"
+#include "g_triggers.qh"
+
+#include "../common/constants.qh"
+#include "../csqcmodellib/sv_model.qh"
.float modelscale;
self.SendFlags |= 2;
}
-float g_clientmodel_genericsendentity (entity to, float sf)
+float g_clientmodel_genericsendentity (entity to, int sf)
{
sf = sf & 0x0F;
if(self.angles != '0 0 0')
#include "g_subs.qh"
+#include "_all.qh"
+
+#include "antilag.qh"
+#include "command/common.qh"
+#include "../warpzonelib/common.qh"
void SUB_NullThink(void) { }
return stof(substring(dat, x-1, 1));
}
-string SetXBlock(float x, string dat, float new)
+string SetXBlock(float x, string dat, float val)
{
return strcat(
substring(dat, 0, x-1),
- ftos(new),
+ ftos(val),
substring(dat, x, -1)
);
}
#include "g_triggers.qh"
+#include "_all.qh"
+
+#include "weapons/csqcprojectile.qh"
+#include "../common/deathtypes.qh"
+#include "../warpzonelib/util_server.qh"
+#include "g_subs.qh"
#include "t_jumppads.qh"
void SUB_DontUseTargets()
multi_trigger ();
}
-void multi_eventdamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void multi_eventdamage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if (!self.takedamage)
return;
sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
if(GetPlayerSoundSampleField_notFound)
snd = "misc/null.wav";
- else if(activator.sample == "")
+ else if (activator.(sample) == "")
snd = "misc/null.wav";
else
{
- tokenize_console(activator.sample);
+ tokenize_console(activator.(sample));
float n;
n = stof(argv(1));
if(n > 0)
sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1));
if(GetPlayerSoundSampleField_notFound)
snd = "misc/null.wav";
- else if(activator.sample == "")
+ else if (activator.(sample) == "")
snd = "misc/null.wav";
else
{
- tokenize_console(activator.sample);
+ tokenize_console(activator.(sample));
float n;
n = stof(argv(1));
if(n > 0)
spawnfunc_func_pointparticles();
}
-float rainsnow_SendEntity(entity to, float sf)
+float rainsnow_SendEntity(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_RAINSNOW);
WriteByte(MSG_ENTITY, self.state);
void multi_touch();
-void multi_eventdamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
+void multi_eventdamage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
void multi_reset();
void spawnfunc_func_sparks();
-float rainsnow_SendEntity(entity to, float sf);
+float rainsnow_SendEntity(entity to, int sf);
/*QUAKED spawnfunc_func_rain (0 .5 .8) ?
This is an invisible area like a trigger, which rain falls inside of.
#include "g_violence.qh"
+#include "_all.qh"
-float Violence_GibSplash_SendEntity(entity to, float sf)
+float Violence_GibSplash_SendEntity(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_GIBSPLASH);
WriteByte(MSG_ENTITY, self.state); // actually type
#ifndef G_VIOLENCE_H
#define G_VIOLENCE_H
-float Violence_GibSplash_SendEntity(entity to, float sf);
+float Violence_GibSplash_SendEntity(entity to, int sf);
// TODO maybe convert this to a TE?
void Violence_GibSplash_At(vector org, vector dir, float type, float amount, entity gibowner, entity attacker);
#include "g_world.qh"
-
+#include "_all.qh"
+
+#include "anticheat.qh"
+#include "antilag.qh"
+#include "bot/bot.qh"
+#include "campaign.qh"
+#include "cheats.qh"
+#include "cl_client.qh"
+#include "command/common.qh"
+#include "command/getreplies.qh"
+#include "command/sv_cmd.qh"
+#include "command/vote.qh"
+#include "g_hook.qh"
+#include "ipban.qh"
+#include "mapvoting.qh"
+#include "mutators/mutators_include.qh"
+#include "race.qh"
+#include "scores.qh"
+#include "secret.qh"
+#include "teamplay.qh"
+#include "waypointsprites.qh"
+#include "weapons/weaponstats.qh"
#include "../common/buffs.qh"
-
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../common/constants.qh"
- #include "../common/stats.qh"
- #include "../common/teams.qh"
- #include "../common/util.qh"
- #include "../common/monsters/sv_monsters.qh"
- #include "../common/weapons/weapons.qh"
- #include "weapons/weaponstats.qh"
- #include "autocvars.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "../common/notifications.qh"
- #include "mutators/mutators_include.qh"
- #include "campaign.qh"
- #include "../common/mapinfo.qh"
- #include "command/common.qh"
- #include "command/vote.qh"
- #include "command/getreplies.qh"
- #include "command/sv_cmd.qh"
- #include "anticheat.qh"
- #include "cheats.qh"
- #include "../common/playerstats.qh"
- #include "g_hook.qh"
- #include "scores.qh"
- #include "mapvoting.qh"
- #include "ipban.qh"
- #include "race.qh"
- #include "antilag.qh"
- #include "secret.qh"
-#endif
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/mapinfo.qh"
+#include "../common/monsters/monsters.qh"
+#include "../common/monsters/sv_monsters.qh"
+#include "../common/notifications.qh"
+#include "../common/playerstats.qh"
+#include "../common/stats.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
const float LATENCY_THINKRATE = 10;
.float latency_sum;
float world_initialized;
string GetGametype();
-void GotoNextMap(float reinit);
void ShuffleMaplist();
-float(float reinit) DoNextMapOverride;
void SetDefaultAlpha()
{
}
entity randomseed;
-float RandomSeed_Send(entity to, float sf)
+float RandomSeed_Send(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_RANDOMSEED);
WriteShort(MSG_ENTITY, self.cnt);
void WeaponStats_Shutdown();
void spawnfunc_worldspawn (void)
{
- float fd, l, i, j, n;
+ float fd, l, j, n;
string s;
cvar = cvar_normal;
// character set: ASCII 33-126 without the following characters: : ; ' " \ $
if(autocvar_sv_eventlog)
{
- s = sprintf("%d.%s.%06d", ftos(autocvar_sv_eventlog_files_counter), strftime(false, "%s"), floor(random() * 1000000));
+ s = sprintf("%d.%s.%06d", itos(autocvar_sv_eventlog_files_counter), strftime(false, "%s"), floor(random() * 1000000));
matchid = strzone(s);
GameLogEcho(strcat(":gamestart:", GetGametype(), "_", GetMapname(), ":", s));
maplist_reply = strzone(getmaplist());
lsmaps_reply = strzone(getlsmaps());
monsterlist_reply = strzone(getmonsterlist());
- for(i = 0; i < 10; ++i)
+ for(int i = 0; i < 10; ++i)
{
s = getrecords(i);
if (s)
{
s = "";
n = tokenize_console(cvar_string("sv_curl_serverpackages"));
- for(i = 0; i < n; ++i)
+ for(int i = 0; i < n; ++i)
if(substring(argv(i), -18, -1) != "-serverpackage.txt")
if(substring(argv(i), -14, -1) != ".serverpackage") // OLD legacy
s = strcat(s, " ", argv(i));
if(fd >= 0)
{
j = search_getsize(fd);
- for(i = 0; i < j; ++i)
+ for(int i = 0; i < j; ++i)
s = strcat(s, " ", search_getfilename(fd, i));
search_end(fd);
}
if(fd >= 0)
{
j = search_getsize(fd);
- for(i = 0; i < j; ++i)
+ for(int i = 0; i < j; ++i)
s = strcat(s, " ", search_getfilename(fd, i));
search_end(fd);
}
{
entity head;
FOR_EACH_PLAYER(head)
- head.winning = (head.field == value);
+ head.winning = (head.(field) == value);
}
// set the .winning flag for those players with a given field value
{
entity head;
FOR_EACH_PLAYER(head)
- if(head.field == value)
+ if (head.(field) == value)
head.winning = 1;
}
if(have_team_spawns <= 0)
return WINNING_NO;
- if(autocvar_g_spawn_useallspawns <= 0)
+ if(!autocvar_g_spawn_useallspawns)
return WINNING_NO;
if(!some_spawn_has_been_used)
Exit deathmatch games upon conditions
============
*/
-void ReadyRestart();
void CheckRules_World()
{
float timelimit;
void CheckRules_Player();
void IntermissionThink();
+void GotoNextMap(float reinit);
+void ReadyRestart();
+
+void DumpStats(float final);
+float Map_IsRecent(string m);
+string GetNextMap();
+void ShuffleMaplist();
+void Map_Goto_SetStr(string nextmapname);
+void Map_Goto(float reinit);
+float DoNextMapOverride(float reinit);
+void CheckRules_World();
#endif
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../common/constants.qh"
- #include "../common/util.qh"
- #include "autocvars.qh"
- #include "defs.qh"
- #include "command/banning.qh"
- #include "ipban.qh"
-#endif
+#include "ipban.qh"
+#include "_all.qh"
+
+#include "autocvars.qh"
+#include "command/banning.qh"
+#include "defs.qh"
+#include "../common/constants.qh"
+#include "../common/util.qh"
+#include "../dpdefs/dpextensions.qh"
+#include "../dpdefs/progsdefs.qh"
/*
* Protocol of online ban list:
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../warpzonelib/util_server.qh"
- #include "../common/util.qh"
- #include "../common/monsters/monsters.qh"
- #include "defs.qh"
- #include "../common/notifications.qh"
- #include "item_key.qh"
-#endif
+#include "item_key.qh"
+#include "_all.qh"
+
+#include "../common/monsters/monsters.qh"
+#include "../common/notifications.qh"
+#include "../common/util.qh"
+#include "../warpzonelib/util_server.qh"
/*
TODO:
}
string item_keys_keylist(float keylist) {
- float base, l;
- string n;
-
// no keys
if (!keylist)
return "";
if ((keylist & (keylist-1)) != 0)
return strcat("the ", item_keys_names[lowestbit(keylist)]);
- n = "";
- base = 0;
+ string n = "";
+ int base = 0;
while (keylist) {
- l = lowestbit(keylist);
+ int l = lowestbit(keylist);
if (n)
n = strcat(n, ", the ", item_keys_names[base + l]);
else
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../common/constants.qh"
- #include "../common/util.qh"
- #include "autocvars.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "../common/mapinfo.qh"
- #include "command/getreplies.qh"
- #include "command/cmd.qh"
- #include "../common/playerstats.qh"
- #include "mapvoting.qh"
-#endif
+#include "mapvoting.qh"
+#include "_all.qh"
+
+#include "g_world.qh"
+#include "command/cmd.qh"
+#include "command/getreplies.qh"
+#include "../common/constants.qh"
+#include "../common/mapinfo.qh"
+#include "../common/playerstats.qh"
+#include "../common/util.qh"
float GameTypeVote_AvailabilityStatus(string gtname)
{
}
}
-float MapVote_SendEntity(entity to, float sf)
+float MapVote_SendEntity(entity to, int sf)
{
float i;
#ifndef MAPVOTING_H
#define MAPVOTING_H
+#include "../common/constants.qh"
+
// definitions for functions used outside mapvoting.qc
void MapVote_Start();
void MapVote_Spawn();
void MapVote_Think();
+void MapVote_SendPicture(float id);
float GameTypeVote_Start();
float GameTypeVote_Finished(float pos);
string GameTypeVote_MapInfo_FixName(string m);
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "miscfunctions.qh"
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../common/playerstats.qh"
- #include "../warpzonelib/anglestransform.qh"
- #include "../warpzonelib/server.qh"
- #include "../common/constants.qh"
- #include "../common/teams.qh"
- #include "../common/util.qh"
- #include "../common/urllib.qh"
- #include "../common/command/generic.qh"
- #include "../common/weapons/weapons.qh"
- #include "weapons/accuracy.qh"
- #include "weapons/csqcprojectile.qh"
- #include "weapons/selection.qh"
- #include "t_items.qh"
- #include "autocvars.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "../common/notifications.qh"
- #include "../common/deathtypes.qh"
- #include "mutators/mutators_include.qh"
- #include "tturrets/include/turrets_early.qh"
- #include "../common/mapinfo.qh"
- #include "command/common.qh"
- #include "../csqcmodellib/sv_model.qh"
- #include "ipban.qh"
-#endif
+#include "miscfunctions.qh"
+#include "_all.qh"
+
+#include "antilag.qh"
+#include "command/common.qh"
+#include "constants.qh"
+#include "g_hook.qh"
+#include "ipban.qh"
+#include "mutators/mutators_include.qh"
+#include "tturrets/include/turrets_early.qh"
+#include "t_items.qh"
+#include "weapons/accuracy.qh"
+#include "weapons/csqcprojectile.qh"
+#include "weapons/selection.qh"
+#include "../common/command/generic.qh"
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/mapinfo.qh"
+#include "../common/notifications.qh"
+#include "../common/playerstats.qh"
+#include "../common/teams.qh"
+#include "../common/urllib.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
+#include "../csqcmodellib/sv_model.qh"
+#include "../warpzonelib/anglestransform.qh"
+#include "../warpzonelib/server.qh"
void crosshair_trace(entity pl)
{
void GameLogEcho(string s)
{
string fn;
- float matches;
+ int matches;
if (autocvar_sv_eventlog_files)
{
{
logfile_open = true;
matches = autocvar_sv_eventlog_files_counter + 1;
- cvar_set("sv_eventlog_files_counter", ftos(matches));
+ cvar_set("sv_eventlog_files_counter", itos(matches));
fn = ftos(matches);
if (strlen(fn) < 8)
fn = strcat(substring("00000000", 0, 8 - strlen(fn)), fn);
{
if (f < 0)
{
- if (self.field)
- strunzone(self.field);
- self.field = string_null;
+ if (self.(field))
+ strunzone(self.(field));
+ self.(field) = string_null;
}
else if (f > 0)
{
if (thisname == name)
{
- if (self.field)
- strunzone(self.field);
- self.field = strzone(argv(f + 1));
+ if (self.(field))
+ strunzone(self.(field));
+ self.(field) = strzone(argv(f + 1));
}
}
else
if (f >= 0) // also initialize to the fitting value for "" when sending cvars out
if (thisname == name)
{
- string s;
- s = func(strcat1(self.field));
- if (s != self.field)
+ string s = func(strcat1(self.(field)));
+ if (s != self.(field))
{
- strunzone(self.field);
- self.field = strzone(s);
+ strunzone(self.(field));
+ self.(field) = strzone(s);
}
}
}
else if (f > 0)
{
if (thisname == name)
- self.field = stof(argv(f + 1));
+ self.(field) = stof(argv(f + 1));
}
else
stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
{
if (thisname == name)
{
- if(!self.field)
+ if (!self.(field))
{
- self.field = stof(argv(f + 1));
- if(!self.field)
- self.field = -1;
+ self.(field) = stof(argv(f + 1));
+ if (!self.(field))
+ self.(field) = -1;
}
}
}
else
{
- if(!self.field)
+ if (!self.(field))
stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
}
}
entno = num_for_edict(e);
idx = precache_sound_index(samp);
- float sflags;
+ int sflags;
sflags = 0;
_atten = floor(_atten * 64);
}
-void Net_LinkEntity(entity e, float docull, float dt, float(entity, float) sendfunc)
+void Net_LinkEntity(entity e, float docull, float dt, bool(entity, int) sendfunc)
{
vector mi, ma;
}
-entity eliminatedPlayers;
.float(entity) isEliminated;
float EliminatedPlayers_SendEntity(entity to, float sendflags)
{
#define SUB_OwnerCheck() (other && (other == self.owner))
-void RemoveGrapplingHook(entity pl);
void W_Crylink_Dequeue(entity e);
float WarpZone_Projectile_Touch_ImpactFilter_Callback()
{
.float scale2;
-float modeleffect_SendEntity(entity to, float sf)
+float modeleffect_SendEntity(entity to, int sf)
{
float f;
WriteByte(MSG_ENTITY, ENT_CLIENT_MODELEFFECT);
.float uncustomizeentityforclient_set;
.float nottargeted;
+entity eliminatedPlayers;
+void EliminatedPlayers_Init(float(entity) isEliminated_func);
+
+string admin_name(void);
+
+void write_recordmarker(entity pl, float tstart, float dt);
+
+void play2all(string samp);
+
+void DistributeEvenly_Init(float amount, float totalweight);
+float DistributeEvenly_Get(float weight);
+
+void modeleffect_spawn(string m, float s, float f, vector o, vector v, vector ang, vector angv, float s0, float s2, float a, float t1, float t2);
+
+void shockwave_spawn(string m, vector org, float sz, float t1, float t2);
+
+vector randompos(vector m1, vector m2);
+
+void play2team(float t, string filename);
+
+void GetCvars_handleFloat(string thisname, float f, .float field, string name);
+
+float spamsound(entity e, float chan, string samp, float vol, float _atten);
+
+void GetCvars_handleString(string thisname, float f, .string field, string name);
+
+void precache_all_playermodels(string pattern);
+
+void soundat(entity e, vector o, float chan, string samp, float vol, float _atten);
+
+void defer(float fdelay, void() func);
+
+void UncustomizeEntitiesRun();
+void InitializeEntitiesRun();
+
+void stopsoundto(float _dest, entity e, float chan);
+void soundtoat(float _dest, entity e, vector o, float chan, string samp, float vol, float _atten);
+float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float d);
+
+vector shotorg_adjust(vector vecs, float y_is_right, float visual);
float DistributeEvenly_amount;
float DistributeEvenly_totalweight;
float LostMovetypeFollow(entity ent);
+string uid2name(string myuid);
+
float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, float badsurfaceflags, float attempts, float maxaboveground, float minviewdistance);
string NearestLocation(vector p);
+#include "base.qh"
+#include "../_all.qh"
+
.float() cbc_func;
.entity cbc_next;
.float cbc_order;
string loaded_mutators[MAX_MUTATORS];
float Mutator_Add(mutatorfunc_t func, string name)
{
- float i, j;
+ int i, j;
j = -1;
for(i = 0; i < MAX_MUTATORS; ++i)
{
}
void Mutator_Remove(float(float) func, string name)
{
- float i;
+ int i;
for(i = 0; i < MAX_MUTATORS; ++i)
if(name == loaded_mutators[i])
break;
--- /dev/null
+#ifndef GAMEMODE_H
+#define GAMEMODE_H
+
+#include "mutator_nades.qh"
+
+#include "../cl_client.qh"
+#include "../cl_player.qh"
+#include "../cl_impulse.qh"
+#include "../cheats.qh"
+#include "../g_damage.qh"
+#include "../g_subs.qh"
+#include "../t_teleporters.qh"
+#include "../round_handler.qh"
+#include "../scores.qh"
+#include "../scores_rules.qh"
+#include "../waypointsprites.qh"
+
+#include "../bot/bot.qh"
+#include "../bot/navigation.qh"
+#include "../bot/waypoints.qh"
+#include "../bot/havocbot/roles.qh"
+#include "../bot/havocbot/role_keyhunt.qh"
+
+#include "../bot/havocbot/havocbot.qh"
+
+#include "../command/vote.qh"
+
+#include "../../common/monsters/monsters.qh"
+
+#include "../command/common.qh"
+
+#include "../weapons/tracing.qh"
+#include "../weapons/weaponsystem.qh"
+
+#include "../../common/deathtypes.qh"
+#include "../../common/notifications.qh"
+#include "../../common/stats.qh"
+#include "../../common/teams.qh"
+
+#include "../../warpzonelib/mathlib.qh"
+#include "../../warpzonelib/server.qh"
+#include "../../warpzonelib/util_server.qh"
+
+.float lastground;
+float total_players;
+float redalive, bluealive, yellowalive, pinkalive;
+.float redalive_stat, bluealive_stat, yellowalive_stat, pinkalive_stat;
+
+#endif
+#include "gamemode_assault.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+.entity sprite;
+
// random functions
void assault_objective_use()
{
-float total_players;
-float redalive, bluealive, yellowalive, pinkalive;
-.float redalive_stat, bluealive_stat, yellowalive_stat, pinkalive_stat;
+#include "gamemode_ca.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
float ca_teams;
float allowed_to_spawn;
+#include "gamemode_ctf.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#ifdef SVQC
+#include "../vehicles/vehicle.qh"
+#endif
+
+#include "../../warpzonelib/common.qh"
+#include "../../warpzonelib/mathlib.qh"
+
// ================================================================
// Official capture the flag game mode coding, reworked by Samual
// Last updated: September, 2012
}
}
-void ctf_FlagDamage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void ctf_FlagDamage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(ITEM_DAMAGE_NEEDKILL(deathtype))
{
const float RETURN_SPEEDRUN = 4;
const float RETURN_NEEDKILL = 5;
+void ctf_Handle_Throw(entity player, entity receiver, float droptype);
+
// flag properties
#define ctf_spawnorigin dropped_origin
float ctf_stalemate; // indicates that a stalemate is active
+#include "gamemode_cts.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../race.qh"
+
// legacy bot roles
.float race_checkpoint;
void havocbot_role_cts()
+#include "gamemode_domination.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
void dom_EventLog(string mode, float team_before, entity actor) // use an alias for easy changing and quick editing later
{
if(autocvar_sv_eventlog)
-.float freezetag_frozen_time;
-.float freezetag_frozen_timeout;
-const float ICE_MAX_ALPHA = 1;
-const float ICE_MIN_ALPHA = 0.1;
-float freezetag_teams;
+#include "gamemode_freezetag.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
const float SP_FREEZETAG_REVIVALS = 4;
void freezetag_ScoreRules(float teams)
return 1;
}
-.float reviving; // temp var
MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
{
float n;
--- /dev/null
+#ifndef GAMEMODE_FREEZETAG_H
+#define GAMEMODE_FREEZETAG_H
+.float freezetag_frozen_time;
+.float freezetag_frozen_timeout;
+const float ICE_MAX_ALPHA = 1;
+const float ICE_MIN_ALPHA = 0.1;
+float freezetag_teams;
+
+.float reviving; // temp var
+
+#endif
+#include "gamemode_invasion.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../../common/monsters/spawn.qh"
+#include "../../common/monsters/sv_monsters.qh"
+
void spawnfunc_invasion_spawnpoint()
{
if(!g_invasion) { remove(self); return; }
+#include "gamemode_keepaway.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
// ===========================================================
// Keepaway game mode coding, written by Samual and Diabolik
// Last updated: September, 2012
void() havocbot_role_ka_carrier;
void() havocbot_role_ka_collector;
+
+void ka_DropEvent(entity plyr);
+
#endif
-#define FOR_EACH_KH_KEY(v) for(v = kh_worldkeylist; v; v = v.kh_worldkeynext )
+#include "gamemode_keyhunt.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
// #define KH_PLAYER_USE_ATTACHMENT
// #define KH_PLAYER_USE_CARRIEDMODEL
}
}
-void kh_Key_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void kh_Key_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.owner)
return;
#ifndef GAMEMODE_KEYHUNT_H
#define GAMEMODE_KEYHUNT_H
+#define FOR_EACH_KH_KEY(v) for(v = kh_worldkeylist; v; v = v.kh_worldkeynext )
+
// ALL OF THESE should be removed in the future, as other code should not have to care
// used by bots:
typedef void(void) kh_Think_t;
void kh_StartRound();
void kh_Controller_SetThink(float t, kh_Think_t func);
+
+void kh_Key_DropAll(entity player, float suicide);
+
#endif
+#include "gamemode_lms.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../campaign.qh"
+#include "../command/cmd.qh"
+
// main functions
float LMS_NewPlayerLives()
{
+#include "gamemode_nexball.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../t_jumppads.qh"
+
float autocvar_g_nexball_safepass_turnrate;
float autocvar_g_nexball_safepass_maxdist;
float autocvar_g_nexball_safepass_holdtime;
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
float autocvar_g_onslaught_spawn_at_controlpoints;
float autocvar_g_onslaught_spawn_at_generator;
float autocvar_g_onslaught_cp_proxydecap;
entity ons_red_generator;
entity ons_blue_generator;
-void ons_gib_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
+void ons_gib_damage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector vforce)
{
self.velocity = self.velocity + vforce;
}
self.count = self.count - 1;
}
-void onslaught_generator_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void onslaught_generator_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
float i;
if (damage <= 0)
float ons_notification_time_team1;
float ons_notification_time_team2;
-void onslaught_controlpoint_icon_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void onslaught_controlpoint_icon_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
entity oself;
float nag;
+#include "gamemode_race.qh"
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
+#include "../race.qh"
+
// legacy bot roles
.float race_checkpoint;
void havocbot_role_race()
+#include "../_all.qh"
+
+#include "gamemode.qh"
+
/*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.
--- /dev/null
+#ifndef MUTATOR_H
+#define MUTATOR_H
+
+#include "base.qh"
+#include "mutator_nades.qh"
+
+#include "../cl_client.qh"
+#include "../cl_player.qh"
+#include "../cl_impulse.qh"
+#include "../cheats.qh"
+#include "../g_damage.qh"
+#include "../g_subs.qh"
+#include "../t_teleporters.qh"
+#include "../round_handler.qh"
+#include "../scores.qh"
+#include "../scores_rules.qh"
+#include "../waypointsprites.qh"
+
+#include "../bot/bot.qh"
+#include "../bot/navigation.qh"
+#include "../bot/waypoints.qh"
+
+#include "../bot/havocbot/havocbot.qh"
+#include "../bot/havocbot/roles.qh"
+#include "../bot/havocbot/role_keyhunt.qh"
+
+#include "../command/vote.qh"
+#include "../command/common.qh"
+
+#include "../weapons/common.qh"
+#include "../weapons/tracing.qh"
+#include "../weapons/throwing.qh"
+#include "../weapons/weaponsystem.qh"
+
+#include "../../common/deathtypes.qh"
+#include "../../common/notifications.qh"
+#include "../../common/stats.qh"
+#include "../../common/teams.qh"
+
+#include "../../common/monsters/monsters.qh"
+
+#include "../../warpzonelib/anglestransform.qh"
+#include "../../warpzonelib/mathlib.qh"
+#include "../../warpzonelib/server.qh"
+#include "../../warpzonelib/util_server.qh"
+
+#endif
+#include "../_all.qh"
+
+#include "mutator.qh"
+
.float bloodloss_timer;
MUTATOR_HOOKFUNCTION(bloodloss_PlayerThink)
+#include "mutator_buffs.qh"
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+#include "../../common/buffs.qh"
+
+.float lifetime;
+
float buffs_BuffModel_Customize()
{
entity player, myowner;
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+#include "../campaign.qh"
+
.float campcheck_nextcheck;
.float campcheck_traveled_distance;
+#include "mutator_dodging.qh"
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+#include "../../common/animdecide.qh"
.float cvar_cl_dodging_timeout;
self.velocity
+ (autocvar_sv_dodging_up_speed * v_up);
- if (autocvar_sv_dodging_sound == 1)
+ if (autocvar_sv_dodging_sound)
PlayerSound(playersound_jump, CH_PLAYER, VOICETYPE_PLAYERSOUND);
animdecide_setaction(self, ANIMACTION_JUMP, true);
// returns 1 if the player is close to a wall
-float check_close_to_wall(float threshold) {
- if (autocvar_sv_dodging_wall_dodging == 0)
- return 0;
+bool check_close_to_wall(float threshold)
+{
+ if(!autocvar_sv_dodging_wall_dodging)
+ return false;
vector trace_start;
vector trace_end;
trace_end = self.origin + (1000*v_right);
tracebox(trace_start, self.mins, self.maxs, trace_end, true, self);
if (trace_fraction < 1 && vlen (self.origin - trace_endpos) < threshold)
- return 1;
+ return true;
trace_end = self.origin - (1000*v_right);
tracebox(trace_start, self.mins, self.maxs, trace_end, true, self);
if (trace_fraction < 1 && vlen (self.origin - trace_endpos) < threshold)
- return 1;
+ return true;
trace_end = self.origin + (1000*v_forward);
tracebox(trace_start, self.mins, self.maxs, trace_end, true, self);
if (trace_fraction < 1 && vlen (self.origin - trace_endpos) < threshold)
- return 1;
+ return true;
trace_end = self.origin - (1000*v_forward);
tracebox(trace_start, self.mins, self.maxs, trace_end, true, self);
if (trace_fraction < 1 && vlen (self.origin - trace_endpos) < threshold)
- return 1;
+ return true;
- return 0;
+ return false;
}
-float check_close_to_ground(float threshold) {
+bool check_close_to_ground(float threshold)
+{
if (self.flags & FL_ONGROUND)
- return 1;
+ return true;
- return 0;
+ return false;
}
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+#include "../cl_client.qh"
+#include "../../common/buffs.qh"
+
void spawnfunc_item_minst_cells (void)
{
if (!g_instagib) { remove(self); return; }
+#include "../_all.qh"
+
+#include "mutator.qh"
+
MUTATOR_HOOKFUNCTION(invincibleprojectiles_EditProjectile)
{
if(other.health)
+#include "../_all.qh"
+
+#include "mutator.qh"
+
MUTATOR_HOOKFUNCTION(melee_SetStartItems)
{
start_ammo_shells = warmup_start_ammo_shells = 0;
+#include "../_all.qh"
+
+#include "mutator.qh"
+
.float midair_shieldtime;
MUTATOR_HOOKFUNCTION(midair_PlayerDamage)
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+#include "../antilag.qh"
+
.float multijump_count;
.float multijump_ready;
+#include "mutator_nades.qh"
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+#include "gamemode_keyhunt.qh"
+#include "gamemode_freezetag.qh"
+#include "../../common/nades.qh"
+#include "../../common/monsters/spawn.qh"
+#include "../../common/monsters/sv_monsters.qh"
+
+.float lifetime;
+
.entity nade_spawnloc;
void nade_timer_think()
void nade_boom()
{
string expef;
- float nade_blast = 1;
+ bool nade_blast = true;
switch ( self.nade_type )
{
expef = "explosion_medium";
break;
case NADE_TYPE_ICE:
- nade_blast = 0;
+ nade_blast = false;
expef = "electro_combo"; // hookbomb_explode electro_combo bigplasma_impact
break;
case NADE_TYPE_TRANSLOCATE:
- nade_blast = 0;
+ nade_blast = false;
expef = "";
break;
case NADE_TYPE_MONSTER:
case NADE_TYPE_SPAWN:
- nade_blast = 0;
+ nade_blast = false;
switch(self.realowner.team)
{
case NUM_TEAM_1: expef = "spawn_event_red"; break;
}
break;
case NADE_TYPE_HEAL:
- nade_blast = 0;
+ nade_blast = false;
expef = "spawn_event_red";
break;
self.nextthink = max(self.wait, time);
}
-void nade_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void nade_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(ITEM_DAMAGE_NEEDKILL(deathtype))
{
+#include "../_all.qh"
+
+#include "mutator.qh"
+
/*
CORE laser vortex lg rl cry gl elec hagar fireb hook
+#include "../_all.qh"
+
+#include "mutator.qh"
+
float g_nix_with_blaster;
// WEAPONTODO
-float nix_weapon;
+int nix_weapon;
float nix_nextchange;
float nix_nextweapon;
.float nix_lastchange_id;
-void ok_DecreaseCharge(entity ent, float wep)
+#include "mutator_overkill.qh"
+#include "../_all.qh"
+
+#include "mutator.qh"
+
+void W_Blaster_Attack(float, float, float, float, float, float, float, float, float, float);
+void spawnfunc_weapon_hmg();
+void spawnfunc_weapon_rpc();
+
+void ok_DecreaseCharge(entity ent, int wep)
{
if(!ent.ok_use_ammocharge) return;
ent.ammo_charge[wep] -= max(0, cvar(sprintf("g_overkill_ammo_decharge_%s", wepent.netname)));
}
-void ok_IncreaseCharge(entity ent, float wep)
+void ok_IncreaseCharge(entity ent, int wep)
{
entity wepent = get_weaponinfo(wep);
ent.ammo_charge[wep] = min(autocvar_g_overkill_ammo_charge_limit, ent.ammo_charge[wep] + cvar(sprintf("g_overkill_ammo_charge_rate_%s", wepent.netname)) * frametime / W_TICSPERFRAME);
}
-float ok_CheckWeaponCharge(entity ent, float wep)
+float ok_CheckWeaponCharge(entity ent, int wep)
{
if(!ent.ok_use_ammocharge) return true;
{
if(autocvar_g_overkill_ammo_charge)
{
- float i;
-
- for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+ for(int i = WEP_FIRST; i <= WEP_LAST; ++i)
self.ammo_charge[i] = autocvar_g_overkill_ammo_charge_limit;
self.ok_use_ammocharge = 1;
+#include "../_all.qh"
+
+#include "mutator.qh"
+
.vector spawn_origin, spawn_angles;
void physical_item_think()
}
}
-void physical_item_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void physical_item_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(!self.cnt) // not for dropped items
if(ITEM_DAMAGE_NEEDKILL(deathtype))
+#include "../_all.qh"
+
+#include "mutator.qh"
+
MUTATOR_HOOKFUNCTION(pinata_PlayerDies)
{
float j;
+#include "../_all.qh"
+
+#include "mutator.qh"
+
// Random Gravity
//
// Mutator by Mario
+#include "../_all.qh"
+
+#include "mutator.qh"
+
MUTATOR_HOOKFUNCTION(rocketflying_EditProjectile)
{
if(other.classname == "rocket" || other.classname == "mine")
+#include "../_all.qh"
+
+#include "mutator.qh"
+
.entity msnt_lookat;
.float msnt_timer;
+#include "../_all.qh"
+
+#include "mutator.qh"
+
#define _SSMAGIX "SUPERSPEC_OPTIONSFILE_V1"
#define _ISLOCAL ((edict_num(1) == self) ? true : false)
+#include "../_all.qh"
+
+#include "mutator.qh"
+
.float touchexplode_time;
void PlayerTouchExplode(entity p1, entity p2)
+#include "../_all.qh"
+
+#include "mutator.qh"
+
MUTATOR_HOOKFUNCTION(vampire_PlayerDamage)
{
if(time >= frag_target.spawnshieldtime)
#include "../../common/command/markup.qh"
#include "../../common/command/rpn.qh"
#include "../../common/command/generic.qh"
- #include "../../common/command/shared_defs.qh"
+ #include "../../common/command/command.qh"
#include "../../common/net_notice.qh"
#include "../../common/animdecide.qh"
#include "../../common/monsters/monsters.qh"
#include "../../common/deathtypes.qh"
#include "mutators_include.qh"
#include "../tturrets/include/turrets_early.qh"
- #include "../vehicles/vehicles_def.qh"
+ #include "../vehicles/vehicle.qh"
#include "../campaign.qh"
#include "../../common/campaign_common.qh"
#include "../../common/mapinfo.qh"
#include "../secret.qh"
#include "../pathlib/pathlib.qh"
#include "../tturrets/include/turrets.qh"
- #include "../vehicles/vehicles.qh"
+ #include "../vehicles/all.qh"
#endif
#include "base.qc"
+#include "../_all.qh"
+
+#include "mutator.qh"
+
const float MAX_STORAGE_ATTACHMENTS = 16;
float object_count;
.float object_flood;
-//#define PATHLIB_RDFIELDS
-#ifdef PATHLIB_RDFIELDS
- #define path_next swampslug
- #define path_prev lasertarget
-#else
- .entity path_next;
- .entity path_prev;
-#endif
+#include "pathlib.qh"
+#include "_all.qh"
+
+#include "g_subs.qh"
#define medium spawnshieldtime
//#define DEBUGPATHING
-
-entity openlist;
-entity closedlist;
-entity scraplist;
-
-.float pathlib_node_g;
-.float pathlib_node_h;
-.float pathlib_node_f;
-
-float pathlib_open_cnt;
-float pathlib_closed_cnt;
-float pathlib_made_cnt;
-float pathlib_merge_cnt;
-float pathlib_recycle_cnt;
-float pathlib_searched_cnt;
-
-#ifdef DEBUGPATHING
-
-#endif
-
-float pathlib_bestopen_seached;
-float pathlib_bestcash_hits;
-float pathlib_bestcash_saved;
-
-float pathlib_gridsize;
-
-float pathlib_movecost;
-float pathlib_movecost_diag;
-float pathlib_movecost_waterfactor;
-
-float pathlib_edge_check_size;
-
-float pathlib_foundgoal;
-entity goal_node;
-
-entity best_open_node;
-.float is_path_node;
-
-
#ifdef DEBUGPATHING
float edge_show(vector point,float fsize);
void mark_error(vector where,float lifetime);
return 0;
}
-#define inwater(point) (pointcontents(point) == CONTENT_WATER)
-/*
-float inwater(vector point)
-{
- if(pointcontents(point) == CONTENT_WATER)
- return 1;
- return 0;
-}
-*/
-
#define _pcheck(p) traceline(p+z_up,p-z_down,MOVE_WORLDONLY,self); if (!floor_ok(trace_endpos)) return 1
float edge_check(vector point,float fsize)
{
end.y = fsnap(end.y, pathlib_gridsize);
if(pointcontents(end) == CONTENT_EMPTY)
- return pathlib_wateroutnode( start, end);
+ return pathlib_wateroutnode( start, end, doedge);
tracebox(start, walknode_boxmin,walknode_boxmax, end, MOVE_WORLDONLY, self);
if(trace_fraction == 1)
return h;
}
-//#define PATHLIB_USE_NODESCRAP
const float PATHLIB_NODEEXPIRE = 0.05;
float pathlib_scraplist_cnt;
entity newnode()
#endif
++pathlib_made_cnt;
n = spawn();
-#ifdef PATHLIB_NODEEXPIRE
n.think = SUB_Remove;
n.nextthink = time + PATHLIB_NODEEXPIRE;
return n;
{
vector point;
vector where;
- float nodecnt;
+ float nodecnt = 0;
where = node.origin;
return world;
}
-
-
-
--- /dev/null
+#ifndef PATHLIB_H
+#define PATHLIB_H
+
+//#define PATHLIB_RDFIELDS
+#ifdef PATHLIB_RDFIELDS
+ #define path_next swampslug
+ #define path_prev lasertarget
+#else
+ .entity path_next;
+ .entity path_prev;
+#endif
+
+entity openlist;
+entity closedlist;
+entity scraplist;
+
+.float pathlib_node_g;
+.float pathlib_node_h;
+.float pathlib_node_f;
+
+float pathlib_open_cnt;
+float pathlib_closed_cnt;
+float pathlib_made_cnt;
+float pathlib_merge_cnt;
+float pathlib_recycle_cnt;
+float pathlib_searched_cnt;
+
+float pathlib_bestopen_seached;
+float pathlib_bestcash_hits;
+float pathlib_bestcash_saved;
+
+float pathlib_gridsize;
+
+float pathlib_movecost;
+float pathlib_movecost_diag;
+float pathlib_movecost_waterfactor;
+
+float pathlib_edge_check_size;
+
+float pathlib_foundgoal;
+entity goal_node;
+
+entity best_open_node;
+.float is_path_node;
+
+#define inwater(point) (pointcontents(point) == CONTENT_WATER)
+
+#endif
+#include "../pathlib.qh"
+
float pathlib_g_static(entity parent,vector to, float static_cost)
{
return parent.pathlib_node_g + static_cost;
+#include "../pathlib.qh"
#ifdef TURRET_DEBUG
void mark_error(vector where,float lifetime);
}
}
+void SUB_Remove();
+
void pathlib_showsquare(vector where,float goodsquare,float _lifetime)
{
entity s;
+#include "pathlib.qh"
+#include "utility.qh"
+
vector plib_points2[8];
vector plib_points[8];
float plib_fvals[8];
float pathlib_expandnode_starf(entity node, vector start, vector goal)
{
vector where,f,r,t;
- float i,fc,fc2,c;
+ float fc,c;
entity nap;
where = node.origin;
// Back-left
plib_points[7] = where - f - r;
- for(i=0;i < 8; ++i)
+ for(int i=0;i < 8; ++i)
{
t = plib_points[i];
fc = pathlib_heuristic(t,goal) + pathlib_cost(node, t, pathlib_gridsize);
plib_points2[0] = plib_points[0];
vector bp;
bp = plib_points[0];
- fc2 = 0;
- for(i = 0; i < 8; ++i)
+ int fc2 = 0;
+ for(int i = 0; i < 8; ++i)
{
c = 0;
nap = pathlib_nodeatpoint(plib_points[i]);
pathlib_makenode(node, start, bp, goal, pathlib_gridsize);
- for(i = 0; i < 3; ++i)
+ for(int i = 0; i < 3; ++i)
{
pathlib_makenode(node, start, plib_points2[i], goal, pathlib_gridsize);
}
+#include "../_all.qh"
+
+#include "pathlib.qh"
+#include "utility.qh"
+#include "../command/common.qh"
+
void pathlib_deletepath(entity start)
{
entity e;
--- /dev/null
+#ifndef PATHLIB_MAIN_H
+#define PATHLIB_MAIN_H
+float buildpath_nodefilter_none(vector n,vector c,vector p);
+entity path_build(entity next, vector where, entity prev, entity start);
+#endif
+#include "../_all.qh"
+
+#include "pathlib.qh"
+#include "utility.qh"
+
vector pathlib_wateroutnode(vector start,vector end, float doedge)
{
vector surface;
+#include "../bot/waypoints.qh"
+
+#include "pathlib.qh"
+#include "main.qh"
+
var float pathlib_wpp_open(entity wp, entity child, float cost);
void pathlib_wpp_close(entity wp)
#include "debug.qc"
#endif
-#include "utility.qc"
-#include "movenode.qc"
-#include "costs.qc"
-#include "expandnode.qc"
-#include "main.qc"
-#include "path_waypoint.qc"
#endif
+#include "utility.qh"
+
+#include "pathlib.qh"
+
float fsnap(float val,float fsize)
{
return rint(val / fsize) * fsize;
--- /dev/null
+#ifndef PATHLIB_UTILITY
+#define PATHLIB_UTILITY
+float fsnap(float val,float fsize);
+entity pathlib_nodeatpoint(vector where);
+float tile_check_plus2(vector where);
+#endif
void playerdemo_write_originvector(.vector f, string name)
{
- fputs(self.playerdemo_fh, strcat(vtos(self.f), "\n"));
+ fputs(self.playerdemo_fh, strcat(vtos(self.(f)), "\n"));
}
void playerdemo_write_sizevector(.vector f, string name)
{
- fputs(self.playerdemo_fh, strcat(vtos(self.f), "\n"));
+ fputs(self.playerdemo_fh, strcat(vtos(self.(f)), "\n"));
}
void playerdemo_write_vector(.vector f, string name)
{
- fputs(self.playerdemo_fh, strcat(vtos(self.f), "\n"));
+ fputs(self.playerdemo_fh, strcat(vtos(self.(f)), "\n"));
}
void playerdemo_write_string(.string f, string name)
{
- fputs(self.playerdemo_fh, strcat(self.f, "\n"));
+ fputs(self.playerdemo_fh, strcat(self.(f), "\n"));
}
void playerdemo_write_modelstring(.string f, string name)
{
- fputs(self.playerdemo_fh, strcat(self.f, "\n"));
+ fputs(self.playerdemo_fh, strcat(self.(f), "\n"));
}
void playerdemo_write_float(.float f, string name)
{
- fputs(self.playerdemo_fh, strcat(ftos(self.f), "\n"));
+ fputs(self.playerdemo_fh, strcat(ftos(self.(f)), "\n"));
}
void playerdemo_write()
{
}
void playerdemo_read_sizevector(.vector f, string name)
{
- self.f = stov(fgets(self.playerdemo_fh));
+ self.(f) = stov(fgets(self.playerdemo_fh));
setsize(self, self.mins, self.maxs);
}
void playerdemo_read_vector(.vector f, string name)
{
- self.f = stov(fgets(self.playerdemo_fh));
+ self.(f) = stov(fgets(self.playerdemo_fh));
}
void playerdemo_read_string(.string f, string name)
{
- string s;
- s = fgets(self.playerdemo_fh);
- if(s != self.f)
+ string s = fgets(self.playerdemo_fh);
+ if (s != self.(f))
{
/*
if(self.f)
strunzone(self.f);
*/
- self.f = strzone(s);
+ self.(f) = strzone(s);
}
}
void playerdemo_read_modelstring(.string f, string name)
{
- string s;
- s = fgets(self.playerdemo_fh);
- if(s != self.f)
+ string s = fgets(self.playerdemo_fh);
+ if (s != self.(f))
setmodel(self, s);
}
void playerdemo_read_float(.float f, string name)
{
- self.f = stof(fgets(self.playerdemo_fh));
+ self.(f) = stof(fgets(self.playerdemo_fh));
}
float playerdemo_read()
{
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../warpzonelib/anglestransform.qh"
- #include "../warpzonelib/util_server.qh"
- #include "../common/constants.qh"
- #include "../common/util.qh"
- #include "../common/weapons/weapons.qh"
- #include "autocvars.qh"
- #include "defs.qh"
- #include "../common/notifications.qh"
- #include "../common/deathtypes.qh"
- #include "mutators/mutators_include.qh"
- #include "../csqcmodellib/sv_model.qh"
- #include "portals.qh"
- #include "g_hook.qh"
-#endif
+#include "portals.qh"
+#include "_all.qh"
+
+#include "g_hook.qh"
+#include "g_subs.qh"
+#include "mutators/mutators_include.qh"
+#include "t_teleporters.qh"
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/notifications.qh"
+#include "../common/util.qh"
+#include "../common/weapons/weapons.qh"
+#include "../csqcmodellib/sv_model.qh"
+#include "../warpzonelib/anglestransform.qh"
+#include "../warpzonelib/util_server.qh"
#define PORTALS_ARE_NOT_SOLID
}
}
-void Portal_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void Portal_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(deathtype == DEATH_TELEFRAG)
return;
anticheat.qc
antilag.qc
-// assault.qc
campaign.qc
cheats.qc
cl_client.qc
cl_physics.qc
cl_player.qc
csqceffects.qc
-// ctf.qc
-// domination.qc
ent_cs.qc
func_breakable.qc
g_casings.qc
g_damage.qc
g_hook.qc
+// g_lights.qc // TODO: was never used
g_models.qc
g_subs.qc
g_tetris.qc
item_key.qc
mapvoting.qc
miscfunctions.qc
-// mode_onslaught.qc
movelib.qc
-// nexball.qc
+// pathlib.qc // TODO: was never used. Seems to duplicate `pathlib/`
playerdemo.qc
portals.qc
race.qc
round_handler.qc
-// runematch.qc
scores.qc
scores_rules.qc
secret.qc
t_items.qc
t_jumppads.qc
t_plats.qc
-t_quake3.qc
t_quake.qc
+t_quake3.qc
t_swamp.qc
t_teleporters.qc
waypointsprites.qc
+bot/aim.qc
bot/bot.qc
+bot/navigation.qc
+bot/scripting.qc
+bot/waypoints.qc
+
+bot/havocbot/havocbot.qc
+bot/havocbot/role_keyhunt.qc
+bot/havocbot/role_onslaught.qc
+bot/havocbot/roles.qc
-command/banning.qc
-command/cmd.qc
-command/common.qc
-command/getreplies.qc
-command/radarmap.qc
-command/sv_cmd.qc
-command/vote.qc
+command/commands.qc
mutators/mutators_include.qc
mutators/mutators.qc
+pathlib/costs.qc
+pathlib/expandnode.qc
+pathlib/main.qc
+pathlib/movenode.qc
+pathlib/path_waypoint.qc
+pathlib/utility.qc
+
+vehicles/all.qc
+
weapons/accuracy.qc
weapons/common.qc
weapons/csqcprojectile.qc // TODO
../common/buffs.qc
../common/campaign_file.qc
../common/campaign_setup.qc
-../common/command/generic.qc
-../common/command/markup.qc
-../common/command/rpn.qc
../common/mapinfo.qc
../common/monsters/monsters.qc
../common/monsters/spawn.qc
#include "race.qh"
+#include "_all.qh"
+
+#include "cl_client.qh"
+#include "portals.qh"
+#include "scores.qh"
+#include "spawnpoints.qh"
+#include "waypointsprites.qh"
+#include "bot/waypoints.qh"
+#include "bot/navigation.qh"
+#include "command/getreplies.qh"
+#include "../common/deathtypes.qh"
+#include "../common/notifications.qh"
+#include "../common/mapinfo.qh"
+#include "../warpzonelib/util_server.qh"
void W_Porto_Fail(float failhard);
.float race_penalty_accumulator;
.string race_penalty_reason;
.float race_checkpoint; // player: next checkpoint that has to be reached
-.float race_laptime;
.entity race_lastpenalty;
.entity sprite;
WriteInt24_t(msg, race_readTime(GetMapname(), 1));
}
+
+void race_send_speedaward(float msg)
+{
+ // send the best speed of the round
+ WriteByte(msg, SVC_TEMPENTITY);
+ WriteByte(msg, TE_CSQC_RACE);
+ WriteByte(msg, RACE_NET_SPEED_AWARD);
+ WriteInt24_t(msg, floor(speedaward_speed+0.5));
+ WriteString(msg, speedaward_holder);
+}
+
+void race_send_speedaward_alltimebest(float msg)
+{
+ // send the best speed
+ WriteByte(msg, SVC_TEMPENTITY);
+ WriteByte(msg, TE_CSQC_RACE);
+ WriteByte(msg, RACE_NET_SPEED_AWARD_BEST);
+ WriteInt24_t(msg, floor(speedaward_alltimebest+0.5));
+ WriteString(msg, speedaward_alltimebest_holder);
+}
+
void race_SendRankings(float pos, float prevpos, float del, float msg)
{
WriteByte(msg, SVC_TEMPENTITY);
.float race_place;
.float race_started;
.float race_completed;
+.float race_laptime;
float race_completing;
.float race_movetime; // for reading
float race_readTime(string map, float pos);
string race_readUID(string map, float pos);
string race_readName(string map, float pos);
+void race_ClearRecords();
+void race_SendNextCheckpoint(entity e, float spec);
+void race_PreparePlayer();
+void race_send_recordtime(float msg);
+void race_send_speedaward(float msg);
+
+float speedaward_speed;
+string speedaward_holder;
+string speedaward_uid;
+
+float speedaward_alltimebest;
+string speedaward_alltimebest_holder;
+string speedaward_alltimebest_uid;
+
+void race_send_speedaward(float msg);
+
+void race_send_speedaward_alltimebest(float msg);
+
+void race_SendRankings(float pos, float prevpos, float del, float msg);
+
+void race_RetractPlayer();
+
#endif
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../common/util.qh"
- #include "defs.qh"
- #include "round_handler.qh"
-#endif
+#include "round_handler.qh"
+#include "_all.qh"
+
+#include "command/vote.qh"
+#include "../common/util.qh"
void round_handler_Think()
{
#include "scores.qh"
+#include "_all.qh"
+
+#include "command/common.qh"
+#include "mutators/mutators_include.qh"
+#include "../common/playerstats.qh"
+#include "../common/teams.qh"
.entity scorekeeper;
entity teamscorekeepers[16];
return previous;
if((fieldflags & SFL_SORT_PRIO_MASK) < previous.y)
return previous;
- if(t1.field == t2.field)
+ if (t1.(field) == t2.(field))
return previous;
previous.y = fieldflags & SFL_SORT_PRIO_MASK;
if(fieldflags & SFL_ZERO_IS_WORST)
{
- if(t1.field == 0)
+ if (t1.(field) == 0)
{
previous.x = -1;
return previous;
}
- else if(t2.field == 0)
+ else if (t2.(field) == 0)
{
previous.x = +1;
return previous;
}
}
- if(fieldflags & SFL_LOWER_IS_BETTER)
- previous.x = (t2.field - t1.field);
+ if (fieldflags & SFL_LOWER_IS_BETTER)
+ previous.x = (t2.(field) - t1.(field));
else
- previous.x = (t1.field - t2.field);
+ previous.x = (t1.(field) - t2.(field));
return previous;
}
}
}
-float ScoreInfo_SendEntity(entity to, float sf)
+float ScoreInfo_SendEntity(entity to, int sf)
{
float i;
WriteByte(MSG_ENTITY, ENT_CLIENT_SCORES_INFO);
plist = world;
FOR_EACH_CLIENT(p)
- p.field = 0;
+ p.(field) = 0;
FOR_EACH_CLIENT(p) if(p.scorekeeper)
{
if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, 0))
j = i;
- pbest.field = j;
+ pbest.(field) = j;
if (!pfirst)
pfirst = pbest;
#ifndef SCORES_H
#define SCORES_H
+#include "../common/constants.qh"
+
entity scores_initialized; // non-world when scores labels/rules have been set
.float scores[MAX_SCORE];
.float teamscores[MAX_TEAMSCORE];
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../common/constants.qh"
- #include "autocvars.qh"
- #include "defs.qh"
- #include "scores.qh"
-#endif
-
-//float c1, c2, c3, c4;
+#include "scores_rules.qh"
+#include "_all.qh"
+
+#include "cl_client.qh"
+#include "scores.qh"
+
void CheckAllowedTeams (entity for_whom);
// NOTE: SP_ constants may not be >= MAX_SCORE; ST_constants may not be >= MAX_TEAMSCORE
--- /dev/null
+#ifndef SCORES_RULES_H
+#define SCORES_RULES_H
+
+void ScoreRules_basics(float teams, float sprio, float stprio, float score_enabled);
+void ScoreRules_basics_end();
+void ScoreRules_generic();
+
+#endif
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../common/util.qh"
- #include "defs.qh"
- #include "secret.qh"
-#endif
+#include "secret.qh"
+#include "_all.qh"
+
+#include "g_triggers.qh"
+#include "../common/util.qh"
void secrets_setstatus() {
self.stat_secrets_total = secrets_total;
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../warpzonelib/util_server.qh"
- #include "../common/constants.qh"
- #include "../common/teams.qh"
- #include "../common/util.qh"
- #include "autocvars.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "mutators/mutators_include.qh"
- #include "spawnpoints.qh"
- #include "race.qh"
-#endif
-
-float SpawnPoint_Send(entity to, float sf)
+#include "spawnpoints.qh"
+#include "_all.qh"
+
+#include "mutators/mutators_include.qh"
+#include "g_world.qh"
+#include "race.qh"
+#include "../common/constants.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
+#include "../warpzonelib/util_server.qh"
+
+float SpawnPoint_Send(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_SPAWNPOINT);
return true;
}
-float SpawnEvent_Send(entity to, float sf)
+float SpawnEvent_Send(entity to, int sf)
{
float send;
.vector spawnpoint_score;
float spawnpoint_nag;
-float SpawnEvent_Send(entity to, float sf);
+float SpawnEvent_Send(entity to, int sf);
entity Spawn_FilterOutBadSpots(entity firstspot, float mindist, float teamcheck);
entity SelectSpawnPoint (float anypoint);
#endif
#include "../dpdefs/dpextensions.qh"
#endif
-.vector steerto;
-
/**
Uniform pull towards a point
**/
--- /dev/null
+#ifndef STEERLIB_H
+#define STEERLIB_H
+
+.vector steerto;
+
+vector steerlib_arrive(vector point,float maximal_distance);
+vector steerlib_attract2(vector point, float min_influense,float max_distance,float max_influense);
+vector steerlib_pull(vector point);
+
+#endif
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../warpzonelib/common.qh"
- #include "../warpzonelib/server.qh"
- #include "../common/constants.qh"
- #include "../common/util.qh"
- #include "../common/weapons/weapons.qh"
- #include "weapons/csqcprojectile.qh"
- #include "autocvars.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "../common/deathtypes.qh"
- #include "mutators/mutators_include.qh"
- #include "vehicles/vehicles_def.qh"
- #include "../common/mapinfo.qh"
- #include "command/common.qh"
- #include "../csqcmodellib/sv_model.qh"
- #include "anticheat.qh"
- #include "g_hook.qh"
-#endif
+#include "_all.qh"
+
+#include "anticheat.qh"
+#include "g_hook.qh"
+#include "g_world.qh"
+
+#include "bot/bot.qh"
+#include "bot/waypoints.qh"
+
+#include "command/common.qh"
+
+#include "mutators/mutators_include.qh"
+#include "vehicles/vehicle.qh"
+#include "weapons/csqcprojectile.qh"
+
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/mapinfo.qh"
+#include "../common/util.qh"
+
+#include "../common/weapons/weapons.qh"
+
+#include "../csqcmodellib/sv_model.qh"
+
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/server.qh"
+
+.float lastground;
void CreatureFrame (void)
{
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../warpzonelib/util_server.qh"
- #include "defs.qh"
- #include "vehicles/vehicles_def.qh"
-#endif
+#include "_all.qh"
+
+#include "../warpzonelib/util_server.qh"
+#include "vehicles/vehicle.qh"
+
+.float ladder_time;
+.entity ladder_entity;
.float roomtype;
.float radius;
-#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "../common/util.qh"
- #include "../common/buffs.qh"
- #include "../common/weapons/weapons.qh"
- #include "../client/autocvars.qh"
- #include "../client/movetypes.qh"
- #include "../client/main.qh"
- #include "../csqcmodellib/common.qh"
- #include "../csqcmodellib/cl_model.qh"
- #include "t_items.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../warpzonelib/util_server.qh"
+#include "t_items.qh"
+
+#if defined(SVQC)
+ #include "_all.qh"
+
+ #include "g_subs.qh"
+ #include "waypointsprites.qh"
+
+ #include "bot/bot.qh"
+ #include "bot/waypoints.qh"
+
+ #include "mutators/mutators_include.qh"
+
+ #include "weapons/common.qh"
+ #include "weapons/selection.qh"
+ #include "weapons/weaponsystem.qh"
+
#include "../common/constants.qh"
+ #include "../common/deathtypes.qh"
+ #include "../common/notifications.qh"
#include "../common/util.qh"
+
#include "../common/monsters/monsters.qh"
+
#include "../common/weapons/weapons.qh"
- #include "weapons/weaponsystem.qh"
- #include "t_items.qh"
- #include "autocvars.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "../common/notifications.qh"
- #include "../common/deathtypes.qh"
- #include "mutators/mutators_include.qh"
+
+ #include "../warpzonelib/util_server.qh"
#endif
#ifdef CSQC
#endif
#ifdef SVQC
-float ItemSend(entity to, float sf)
+bool ItemSend(entity to, int sf)
{
if(self.gravity)
sf |= ISF_DROP;
float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode)
{
- if (!item.ammotype)
+ if (!item.(ammotype))
return false;
if (item.spawnshieldtime)
{
- if ((player.ammotype < ammomax) || item.pickup_anyway)
+ if ((player.(ammotype) < ammomax) || item.pickup_anyway)
{
- player.ammotype = bound(player.ammotype, ammomax, player.ammotype + item.ammotype);
+ player.(ammotype) = bound(player.(ammotype), ammomax, player.(ammotype) + item.(ammotype));
goto YEAH;
}
}
else if(g_weapon_stay == 2)
{
- float mi = min(item.ammotype, ammomax);
- if (player.ammotype < mi)
+ float mi = min(item.(ammotype), ammomax);
+ if (player.(ammotype) < mi)
{
- player.ammotype = mi;
+ player.(ammotype) = mi;
goto YEAH;
}
}
float weapon_pickupevalfunc(entity player, entity item)
{
- float c, j, position;
+ float c;
// See if I have it already
if(item.weapons & ~player.weapons)
if( bot_custom_weapon && c )
{
// Find the highest position on any range
- position = -1;
- for(j = 0; j < WEP_LAST ; ++j){
+ int position = -1;
+ for (int j = 0; j < WEP_LAST ; ++j){
if(
bot_weapons_far[j] == item.weapon ||
bot_weapons_mid[j] == item.weapon ||
return item.bot_pickupbasevalue * c;
}
-void Item_Damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void Item_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(ITEM_DAMAGE_NEEDKILL(deathtype))
RemoveItem();
StartItem ("models/items/a_rockets.md3", "misc/itempickup.wav", g_pickup_respawntime_ammo, g_pickup_respawntimejitter_ammo, "rockets", IT_ROCKETS, 0, 0, commodity_pickupevalfunc, 3000);
}
-void spawnfunc_item_shells (void);
void spawnfunc_item_bullets (void) {
if(!weaponswapping)
if(autocvar_sv_q3acompat_machineshotgunswap)
float GiveBit(entity e, .float fld, float bit, float op, float val)
{
float v0, v1;
- v0 = (e.fld & bit);
+ v0 = (e.(fld) & bit);
switch(op)
{
case OP_SET:
if(val > 0)
- e.fld |= bit;
+ e.(fld) |= bit;
else
- e.fld &= ~bit;
+ e.(fld) &= ~bit;
break;
case OP_MIN:
case OP_PLUS:
if(val > 0)
- e.fld |= bit;
+ e.(fld) |= bit;
break;
case OP_MAX:
if(val <= 0)
- e.fld &= ~bit;
+ e.(fld) &= ~bit;
break;
case OP_MINUS:
if(val > 0)
- e.fld &= ~bit;
+ e.(fld) &= ~bit;
break;
}
- v1 = (e.fld & bit);
+ v1 = (e.(fld) & bit);
return (v0 != v1);
}
float GiveValue(entity e, .float fld, float op, float val)
{
float v0, v1;
- v0 = e.fld;
+ v0 = e.(fld);
switch(op)
{
case OP_SET:
- e.fld = val;
+ e.(fld) = val;
break;
case OP_MIN:
- e.fld = max(e.fld, val); // min 100 cells = at least 100 cells
+ e.(fld) = max(e.(fld), val); // min 100 cells = at least 100 cells
break;
case OP_MAX:
- e.fld = min(e.fld, val);
+ e.(fld) = min(e.(fld), val);
break;
case OP_PLUS:
- e.fld += val;
+ e.(fld) += val;
break;
case OP_MINUS:
- e.fld -= val;
+ e.(fld) -= val;
break;
}
- v1 = e.fld;
+ v1 = e.(fld);
return (v0 != v1);
}
void GiveRot(entity e, float v0, float v1, .float rotfield, float rottime, .float regenfield, float regentime)
{
if(v0 < v1)
- e.rotfield = max(e.rotfield, time + rottime);
+ e.(rotfield) = max(e.(rotfield), time + rottime);
else if(v0 > v1)
- e.regenfield = max(e.regenfield, time + regentime);
+ e.(regenfield) = max(e.(regenfield), time + regentime);
}
float GiveItems(entity e, float beginarg, float endarg)
{
const int IT_FUEL_REGEN = 32; // fuel regeneration trigger
// where is 64... ?
const int IT_FUEL = 128;
-const int IT_SHELLS = 256;
-const int IT_NAILS = 512;
-const int IT_ROCKETS = 1024;
-const int IT_CELLS = 2048;
+// -Wdouble-declaration
+// const int IT_SHELLS = 256;
+// -Wdouble-declaration
+// const int IT_NAILS = 512;
+// -Wdouble-declaration
+// const int IT_ROCKETS = 1024;
+// -Wdouble-declaration
+// const int IT_CELLS = 2048;
const int IT_SUPERWEAPON = 4096;
const int IT_STRENGTH = 8192;
const int IT_INVINCIBLE = 16384;
// shared value space (union):
// for items:
- const int IT_KEY1 = 131072;
- const int IT_KEY2 = 262144;
+ // -Wdouble-declaration
+ #define IT_KEY1 131072
+ // -Wdouble-declaration
+ #define IT_KEY2 262144
// for players:
const int IT_RED_FLAG_TAKEN = 32768;
const int IT_RED_FLAG_LOST = 65536;
#endif
#ifdef SVQC
+void spawnfunc_item_strength();
+void spawnfunc_item_invincible();
+void spawnfunc_item_armor_small();
+void spawnfunc_item_shells();
+void spawnfunc_item_bullets();
+void spawnfunc_item_rockets();
+
float autocvar_sv_simple_items;
-float ItemSend(entity to, float sf);
+bool ItemSend(entity to, int sf);
float have_pickup_item(void);
// Savage: used for item garbage-collection
// TODO: perhaps nice special effect?
-float ItemSend(entity to, float sf);
+bool ItemSend(entity to, int sf);
void ItemUpdate(entity item);
// pickup evaluation functions
#include "t_jumppads.qh"
+#include "_all.qh"
+
+#include "g_subs.qh"
+
+#include "bot/navigation.qh"
+#include "bot/waypoints.qh"
+
+#include "weapons/csqcprojectile.qh"
+
+#include "../common/animdecide.qh"
+
+#include "../warpzonelib/util_server.qh"
void trigger_push_use()
{
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../warpzonelib/mathlib.qh"
- #include "../warpzonelib/common.qh"
- #include "../warpzonelib/util_server.qh"
- #include "../common/constants.qh"
- #include "../common/util.qh"
- #include "../common/weapons/weapons.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "../common/notifications.qh"
- #include "../common/deathtypes.qh"
- #include "command/common.qh"
- #include "../csqcmodellib/sv_model.qh"
-#endif
+#include "_all.qh"
+
+#include "bot/bot.qh"
+
+#include "command/common.qh"
+
+#include "g_damage.qh"
+#include "g_subs.qh"
+#include "item_key.qh"
+
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/notifications.qh"
+#include "../common/util.qh"
+
+#include "../common/weapons/weapons.qh"
+
+#include "../csqcmodellib/sv_model.qh"
+
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/mathlib.qh"
+#include "../warpzonelib/util_server.qh"
+
+.float height;
.float dmgtime2;
void generic_plat_blocked()
button_fire ();
}
-void button_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void button_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
if(self.spawnflags & DOOR_NOSPLASH)
if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
}
-void door_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void door_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
entity oself;
if(self.spawnflags & DOOR_NOSPLASH)
sound(self, CH_TRIGGER_SINGLE, self.noise2, VOL_BASE, ATTEN_NORM);
}
-void fd_secret_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void fd_secret_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
fd_secret_use();
}
-#include "../common/weapons/weapons.qc"
+#include "_all.qh"
+
+#include "../common/weapons/weapons.qh"
+
+void spawnfunc_weapon_electro();
+void spawnfunc_weapon_hagar();
+void spawnfunc_weapon_machinegun();
+void spawnfunc_item_bullets();
+void spawnfunc_item_armor_large();
+void spawnfunc_item_armor_large();
+void spawnfunc_item_health_mega();
+void spawnfunc_item_health_medium();
//***********************
//QUAKE 1 ENTITIES - So people can play quake1 maps with the xonotic weapons
-#include "../common/weapons/weapons.qc"
+#include "_all.qh"
+
+#include "../common/weapons/weapons.qh"
+#include "../common/buffs.qh"
+
+void spawnfunc_weapon_crylink();
+void spawnfunc_weapon_electro();
+void spawnfunc_weapon_hagar();
+void spawnfunc_weapon_machinegun();
+void spawnfunc_weapon_vortex();
+
+void spawnfunc_target_items();
+
+void spawnfunc_item_bullets();
+void spawnfunc_item_cells();
+void spawnfunc_item_rockets();
+void spawnfunc_item_shells();
+
+void spawnfunc_item_jetpack();
+
+void spawnfunc_item_armor_big();
+void spawnfunc_item_armor_large();
+void spawnfunc_item_armor_small();
+
+void spawnfunc_item_health_medium();
+void spawnfunc_item_health_mega();
//***********************
//QUAKE 3 ENTITIES - So people can play quake3 maps with the xonotic weapons
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
+ #include "_all.qh"
+
#include "../warpzonelib/util_server.qh"
#include "../common/weapons/weapons.qh"
- #include "defs.qh"
#include "../common/deathtypes.qh"
#endif
#include "t_teleporters.qh"
-
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../warpzonelib/common.qh"
- #include "../warpzonelib/util_server.qh"
- #include "../warpzonelib/server.qh"
- #include "../common/constants.qh"
- #include "../common/util.qh"
- #include "weapons/csqcprojectile.qh"
- #include "autocvars.qh"
- #include "constants.qh"
- #include "defs.qh"
- #include "../common/deathtypes.qh"
- #include "tturrets/include/turrets_early.qh"
- #include "vehicles/vehicles_def.qh"
- #include "../common/mapinfo.qh"
- #include "anticheat.qh"
-#endif
+#include "_all.qh"
+
+#include "anticheat.qh"
+#include "cl_player.qh"
+#include "g_hook.qh"
+#include "bot/waypoints.qh"
+#include "tturrets/include/turrets_early.qh"
+#include "vehicles/vehicle.qh"
+#include "weapons/csqcprojectile.qh"
+#include "../common/constants.qh"
+#include "../common/deathtypes.qh"
+#include "../common/mapinfo.qh"
+#include "../common/util.qh"
+#include "../warpzonelib/common.qh"
+#include "../warpzonelib/server.qh"
+#include "../warpzonelib/util_server.qh"
+
+.float lastteleporttime;
void trigger_teleport_use()
{
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../common/constants.qh"
- #include "constants.qh"
- #include "defs.qh"
-#endif
+#include "_all.qh"
+.float volume;
.float lifetime;
// values:
// volume
// spawnflags:
// 1 = START_OFF
// when triggered, it is disabled/enabled for everyone
-float trigger_music_SendEntity(entity to, float sf)
+float trigger_music_SendEntity(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_TRIGGER_MUSIC);
sf &= ~0x80;
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "../common/util.qh"
- #include "defs.qh"
-#endif
+#include "_all.qh"
+
+.entity pusher;
+.float pushltime;
// spawner entity
// "classname" "target_spawn"
{
float n, i;
string fn;
- vector prev, new;
+ vector prev, next;
float ft;
n = numentityfields();
{
fn = entityfieldname(i);
ft = entityfieldtype(i);
- new = i * '1 0 0' + ft * '0 1 0' + '0 0 1';
+ next = i * '1 0 0' + ft * '0 1 0' + '0 0 1';
prev = stov(db_get(TemporaryDB, strcat("/target_spawn/field/", fn)));
if(prev.y == 0)
{
- db_put(TemporaryDB, strcat("/target_spawn/field/", fn), vtos(new));
+ db_put(TemporaryDB, strcat("/target_spawn/field/", fn), vtos(next));
if(fn == "target_spawn_spawnfunc")
target_spawn_spawnfunc_field = i;
}
#include "teamplay.qh"
+#include "_all.qh"
+
+#include "cl_client.qh"
+#include "race.qh"
+#include "scores.qh"
+#include "scores_rules.qh"
+
+#include "bot/bot.qh"
+
+#include "command/vote.qh"
+
+#include "mutators/mutators_include.qh"
+
+#include "../common/deathtypes.qh"
+#include "../common/teams.qh"
void TeamchangeFrags(entity e)
{
void turret_stdproc_track();
/// Generic damage handeling. blows up the turret when health <= 0
-void turret_stdproc_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce);
+void turret_stdproc_damage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector vforce);
/// Spawns a explotion, does some damage & trows bits arround.
void turret_stdproc_die();
/// reassembles the turret.
/*
* Standard damage proc.
*/
-void turret_stdproc_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
+void turret_stdproc_damage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector vforce)
{
// Enougth allready!
if(self.deadflag == DEAD_DEAD)
+#include "../../_all.qh"
+
+#include "../../g_damage.qh"
+#include "../../bot/bot.qh"
+
#define cvar_base "g_turrets_unit_"
.float clientframe;
void turrets_setframe(float _frame, float client_only)
}
-float turret_send(entity to, float sf)
+float turret_send(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_TURRET);
turret_projectile_explode();
}
-void turret_projectile_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
+void turret_projectile_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector vforce)
{
self.velocity += vforce;
self.health -= damage;
void turret_fire()
{
- if (autocvar_g_turrets_nofire != 0)
+ if (autocvar_g_turrets_nofire)
return;
self.turret_firefunc();
self.nextthink = time + 1;
entity e;
- if (autocvar_g_turrets_reloadcvars == 1)
+ if (autocvar_g_turrets_reloadcvars)
{
e = nextent(world);
while (e)
if (!(self.spawnflags & TSF_SUSPENDED))
builtin_droptofloor(); // why can't we use regular droptofloor here?
- // Terrainbase spawnflag. This puts a enlongated model
- // under the turret, so it looks ok on uneaven surfaces.
- /* TODO: Handle this with CSQC
- if (self.spawnflags & TSF_TERRAINBASE)
- {
- entity tb;
- tb = spawn();
- setmodel(tb,"models/turrets/terrainbase.md3");
- setorigin(tb,self.origin);
- tb.solid = SOLID_BBOX;
- }
- */
-
self.cvar_basename = cvar_base_name;
load_unit_settings(self, self.cvar_basename, 0);
* Railgun-like beam, but has thickness and suppots slowing of target
*/
void FireImoBeam (vector start, vector end, vector smin, vector smax,
- float bforce, float f_dmg, float f_velfactor, float deathtype)
+ float bforce, float f_dmg, float f_velfactor, int deathtype)
{
vector hitloc, force, endpoint, dir;
+#include "../../bot/navigation.qh"
+
const float ewheel_amin_stop = 0;
const float ewheel_amin_fwd_slow = 1;
const float ewheel_amin_fwd_fast = 2;
+void W_MachineGun_MuzzleFlash(void);
+
void spawnfunc_turret_machinegun();
void turret_machinegun_std_init();
void turret_machinegun_attack();
+#include "../../_all.qh"
+
void spawnfunc_turret_phaser();
void turret_phaser_dinit();
void turret_phaser_attack();
+#include "../../g_subs.qh"
+
void spawnfunc_turret_targettrigger();
void turret_targettrigger_touch();
+#include "../../csqceffects.qh"
+
void spawnfunc_turret_tesla();
void turret_tesla_dinit();
void turret_tesla_fire();
+#include "../../_all.qh"
+
+#include "../../movelib.qh"
+#include "../../steerlib.qh"
+#include "../../t_teleporters.qh"
+
const float ANIM_NO = 0;
const float ANIM_TURN = 1;
const float ANIM_WALK = 2;
remove (self);
}
-void walker_rocket_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector vforce)
+void walker_rocket_damage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector vforce)
{
self.health = self.health - damage;
self.velocity = self.velocity + vforce;
--- /dev/null
+#if VEHICLES_ENABLED
+# include "vehicle.qc"
+
+# include "racer.qc"
+# include "raptor.qc"
+# include "spiderbot.qc"
+
+# ifndef VEHICLES_NO_UNSTABLE
+# include "bumblebee.qc"
+# endif
+#endif
--- /dev/null
+#ifndef VEHICLES_H
+#define VEHICLES_H
+
+#if VEHICLES_ENABLED
+# include "racer.qh"
+# include "raptor.qh"
+# include "spiderbot.qh"
+
+# ifndef VEHICLES_NO_UNSTABLE
+# include "bumblebee.qh"
+# endif
+#endif
+
+#endif
#include "bumblebee.qh"
#ifdef SVQC
+#include "vehicle.qh"
void bumb_fire_cannon(entity _gun, string _tagname, entity _owner)
{
vector v = gettaginfo(_gun, gettagindex(_gun, _tagname));
}
+.vector hook_start, hook_end;
float bumb_pilot_frame()
{
entity pilot, vehic;
}
}
-float bumble_raygun_send(entity to, float sf)
+float bumble_raygun_send(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_BUMBLE_RAYGUN);
float autocvar_g_vehicle_bumblebee = 0;
-float bumble_raygun_send(entity to, float sf);
+float bumble_raygun_send(entity to, int sf);
const vector BUMB_MIN = '-130 -130 -130';
const vector BUMB_MAX = '130 130 130';
void spawnfunc_vehicle_bumblebee();
-float bumble_raygun_send(entity to, float sf);
+float bumble_raygun_send(entity to, int sf);
#endif // SVQC
#ifdef CSQC
-const vector RACER_MIN = '-120 -120 -40';
-const vector RACER_MAX = '120 120 40';
+#include "vehicle.qh"
+#include "racer.qh"
#ifdef SVQC
void racer_exit(float eject);
void racer_fire_rocket(string tagname, entity trg)
{
vector v = gettaginfo(self, gettagindex(self, tagname));
- entity rocket = rocket = vehicles_projectile("wakizashi_rocket_launch", "weapons/rocket_fire.wav",
+ entity rocket = vehicles_projectile("wakizashi_rocket_launch", "weapons/rocket_fire.wav",
v, v_forward * autocvar_g_vehicle_racer_rocket_speed,
autocvar_g_vehicle_racer_rocket_damage, autocvar_g_vehicle_racer_rocket_radius, autocvar_g_vehicle_racer_rocket_force, 3,
DEATH_VH_WAKI_ROCKET, PROJECTILE_WAKIROCKET, 20, false, false, self.owner);
return 1;
}
+.float lastpushtime;
+
void racer_think()
{
self.nextthink = time;
--- /dev/null
+#ifndef RACER_H
+#define RACER_H
+const vector RACER_MIN = '-120 -120 -40';
+const vector RACER_MAX = '120 120 40';
+#endif
-const float RSM_FIRST = 0;
-const float RSM_BOMB = 0;
-const float RSM_FLARE = 1;
-const float RSM_LAST = 1;
-
-const vector RAPTOR_MIN = '-80 -80 0';
-const vector RAPTOR_MAX = '80 80 70';
+#include "vehicle.qh"
+#include "raptor.qh"
#ifdef SVQC
float autocvar_g_vehicle_raptor;
remove(self);
}
-void raptor_flare_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+void raptor_flare_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
{
self.health -= damage;
if(self.health <= 0)
--- /dev/null
+#ifndef RAPTOR_H
+#define RAPTOR_H
+const float RSM_FIRST = 0;
+const float RSM_BOMB = 0;
+const float RSM_FLARE = 1;
+const float RSM_LAST = 1;
+
+const vector RAPTOR_MIN = '-80 -80 0';
+const vector RAPTOR_MAX = '80 80 70';
+
+#endif
-const vector SPIDERBOT_MIN = '-75 -75 10';
-const vector SPIDERBOT_MAX = '75 75 125';
+#include "vehicle.qh"
+#include "spiderbot.qh"
#ifdef SVQC
float autocvar_g_vehicle_spiderbot;
--- /dev/null
+#ifndef SPIDERBOT_H
+#define SPIDERBOT_H
+const vector SPIDERBOT_MIN = '-75 -75 10';
+const vector SPIDERBOT_MAX = '75 75 125';
+#endif
--- /dev/null
+#include "vehicle.qh"
+
+#include "../_all.qh"
+#include "../cl_player.qh"
+#include "../../common/constants.qh"
+#include "../waypointsprites.qh"
+
+#include "../bot/waypoints.qh"
+
+float autocvar_g_vehicles_crush_dmg;
+float autocvar_g_vehicles_crush_force;
+float autocvar_g_vehicles_delayspawn;
+float autocvar_g_vehicles_delayspawn_jitter;
+
+float autocvar_g_vehicles_vortex_damagerate = 0.5;
+float autocvar_g_vehicles_machinegun_damagerate = 0.5;
+float autocvar_g_vehicles_rifle_damagerate = 0.75;
+float autocvar_g_vehicles_vaporizer_damagerate = 0.001;
+float autocvar_g_vehicles_tag_damagerate = 5;
+
+float autocvar_g_vehicles;
+
+void vehicles_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
+void vehicles_return();
+void vehicles_enter();
+void vehicles_reset_colors();
+void vehicles_clearreturn();
+void vehicles_setreturn();
+
+
+/** AuxiliaryXhair*
+ Send additional points of interest to be drawn, to vehicle owner
+**/
+const float MAX_AXH = 4;
+.entity AuxiliaryXhairs[MAX_AXH];
+
+float SendAuxiliaryXhair(entity to, int sf)
+{
+
+ WriteByte(MSG_ENTITY, ENT_CLIENT_AUXILIARYXHAIR);
+
+ WriteByte(MSG_ENTITY, self.cnt);
+
+ WriteCoord(MSG_ENTITY, self.origin.x);
+ WriteCoord(MSG_ENTITY, self.origin.y);
+ WriteCoord(MSG_ENTITY, self.origin.z);
+
+ WriteByte(MSG_ENTITY, rint(self.colormod.x * 255));
+ WriteByte(MSG_ENTITY, rint(self.colormod.y * 255));
+ WriteByte(MSG_ENTITY, rint(self.colormod.z * 255));
+
+ return true;
+}
+
+void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, int axh_id)
+{
+ if (!IS_REAL_CLIENT(own))
+ return;
+
+ entity axh;
+
+ axh_id = bound(0, axh_id, MAX_AXH);
+ axh = own.(AuxiliaryXhairs[axh_id]);
+
+ if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
+ {
+ axh = spawn();
+ axh.cnt = axh_id;
+ axh.drawonlytoclient = own;
+ axh.owner = own;
+ Net_LinkEntity(axh, false, 0, SendAuxiliaryXhair);
+ }
+
+ setorigin(axh, loc);
+ axh.colormod = clr;
+ axh.SendFlags = 0x01;
+ own.(AuxiliaryXhairs[axh_id]) = axh;
+}
+
+/*
+// SVC_TEMPENTITY based, horrible with even 50 ping. hm.
+// WriteByte(MSG_ONE, SVC_TEMPENTITY) uses reliable messagess, never use for thinsg that need continous updates.
+void SendAuxiliaryXhair2(entity own, vector loc, vector clr, float axh_id)
+{
+ msgexntity = own;
+
+ WriteByte(MSG_ONE, SVC_TEMPENTITY);
+ WriteByte(MSG_ONE, TE_CSQC_AUXILIARYXHAIR);
+
+ WriteByte(MSG_ONE, axh_id);
+
+ WriteCoord(MSG_ONE, loc_x);
+ WriteCoord(MSG_ONE, loc_y);
+ WriteCoord(MSG_ONE, loc_z);
+
+ WriteByte(MSG_ONE, rint(clr_x * 255));
+ WriteByte(MSG_ONE, rint(clr_y * 255));
+ WriteByte(MSG_ONE, rint(clr_z * 255));
+
+}
+*/
+// End AuxiliaryXhair
+
+/**
+ Notifies the client that he enterd a vehicle, and sends
+ realavent data.
+
+ only sends vehicle_id atm (wich is a HUD_* constant, ex. HUD_SPIDERBOT)
+**/
+void CSQCVehicleSetup(entity own, float vehicle_id)
+{
+ if (!IS_REAL_CLIENT(own))
+ return;
+
+ msg_entity = own;
+
+ WriteByte(MSG_ONE, SVC_TEMPENTITY);
+ WriteByte(MSG_ONE, TE_CSQC_VEHICLESETUP);
+ if(vehicle_id != 0)
+ WriteByte(MSG_ONE, vehicle_id);
+ else
+ WriteByte(MSG_ONE, 1 + own.vehicle.vehicle_weapon2mode + HUD_VEHICLE_LAST);
+}
+
+
+const float DAMAGE_TARGETDRONE = 10;
+
+vector targetdrone_getnewspot()
+{
+
+ vector spot;
+ float i;
+ for(i = 0; i < 100; ++i)
+ {
+ spot = self.origin + randomvec() * 1024;
+ tracebox(spot, self.mins, self.maxs, spot, MOVE_NORMAL, self);
+ if(trace_fraction == 1.0 && trace_startsolid == 0 && trace_allsolid == 0)
+ return spot;
+ }
+ return self.origin;
+}
+
+#if 0
+void targetdrone_think();
+void targetdrone_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force);
+void targetdrone_renwe()
+{
+ self.think = targetdrone_think;
+ self.nextthink = time + 0.1;
+ setorigin(self, targetdrone_getnewspot());
+ self.health = 200;
+ self.takedamage = DAMAGE_TARGETDRONE;
+ self.event_damage = targetdrone_damage;
+ self.solid = SOLID_BBOX;
+ setmodel(self, "models/runematch/rune.mdl");
+ self.effects = EF_LOWPRECISION;
+ self.scale = 10;
+ self.movetype = MOVETYPE_BOUNCEMISSILE;
+ setsize(self, '-100 -100 -100', '100 100 100');
+
+}
+void targetdrone_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+{
+ self.health -= damage;
+ if(self.health <= 0)
+ {
+ pointparticles(particleeffectnum("explosion_medium"), self.origin, '0 0 0', 1);
+
+ if(!self.cnt)
+ remove(self);
+ else
+ {
+ self.think = targetdrone_renwe;
+ self.nextthink = time + 1 + random() * 2;
+ self.solid = SOLID_NOT;
+ setmodel(self, "");
+ }
+ }
+}
+entity targetdrone_getfear()
+{
+ entity fear;
+ float i;
+
+ for(i = 64; i <= 1024; i += 64)
+ {
+ fear = findradius(self.origin, i);
+ while(fear)
+ {
+ if(fear.bot_dodge)
+ return fear;
+
+ fear = fear.chain;
+ }
+ }
+
+ return world;
+}
+void targetdrone_think()
+{
+ self.nextthink = time + 0.1;
+
+ if(self.wp00)
+ if(self.wp00.deadflag != DEAD_NO)
+ self.wp00 = targetdrone_getfear();
+
+ if(!self.wp00)
+ self.wp00 = targetdrone_getfear();
+
+ vector newdir;
+
+ if(self.wp00)
+ newdir = steerlib_push(self.wp00.origin) + randomvec() * 0.75;
+ else
+ newdir = randomvec() * 0.75;
+
+ newdir = newdir * 0.5 + normalize(self.velocity) * 0.5;
+
+ if(self.wp00)
+ self.velocity = normalize(newdir) * (500 + (1024 / min(vlen(self.wp00.origin - self.origin), 1024)) * 700);
+ else
+ self.velocity = normalize(newdir) * 750;
+
+ tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 2, MOVE_NORMAL, self);
+ if(trace_fraction != 1.0)
+ self.velocity = self.velocity * -1;
+
+ //normalize((normalize(self.velocity) * 0.5 + newdir * 0.5)) * 750;
+}
+
+void targetdrone_spawn(vector _where, float _autorenew)
+{
+ entity drone = spawn();
+ setorigin(drone, _where);
+ drone.think = targetdrone_renwe;
+ drone.nextthink = time + 0.1;
+ drone.cnt = _autorenew;
+}
+#endif
+
+void vehicles_locktarget(float incr, float decr, float _lock_time)
+{
+ if(self.lock_target && self.lock_target.deadflag != DEAD_NO)
+ {
+ self.lock_target = world;
+ self.lock_strength = 0;
+ self.lock_time = 0;
+ }
+
+ if(self.lock_time > time)
+ {
+ if(self.lock_target)
+ if(self.lock_soundtime < time)
+ {
+ self.lock_soundtime = time + 0.5;
+ play2(self.owner, "vehicles/locked.wav");
+ }
+
+ return;
+ }
+
+ if(trace_ent != world)
+ {
+ if(teamplay && trace_ent.team == self.team)
+ trace_ent = world;
+
+ if(trace_ent.deadflag != DEAD_NO)
+ trace_ent = world;
+ if(!(
+ (trace_ent.vehicle_flags & VHF_ISVEHICLE) ||
+ (trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET) ||
+ (trace_ent.takedamage == DAMAGE_TARGETDRONE)
+ )) { trace_ent = world; }
+ }
+
+ if(self.lock_target == world && trace_ent != world)
+ self.lock_target = trace_ent;
+
+ if(self.lock_target && trace_ent == self.lock_target)
+ {
+ if(self.lock_strength != 1 && self.lock_strength + incr >= 1)
+ {
+ play2(self.owner, "vehicles/lock.wav");
+ self.lock_soundtime = time + 0.8;
+ }
+ else if (self.lock_strength != 1 && self.lock_soundtime < time)
+ {
+ play2(self.owner, "vehicles/locking.wav");
+ self.lock_soundtime = time + 0.3;
+ }
+
+ }
+
+ // Have a locking target
+ // Trace hit current target
+ if(trace_ent == self.lock_target && trace_ent != world)
+ {
+ self.lock_strength = min(self.lock_strength + incr, 1);
+ if(self.lock_strength == 1)
+ self.lock_time = time + _lock_time;
+ }
+ else
+ {
+ if(trace_ent)
+ self.lock_strength = max(self.lock_strength - decr * 2, 0);
+ else
+ self.lock_strength = max(self.lock_strength - decr, 0);
+
+ if(self.lock_strength == 0)
+ self.lock_target = world;
+ }
+}
+
+
+#define vehicles_sweap_collision(orig,vel,dt,acm,mult) \
+traceline(orig, orig + vel * dt, MOVE_NORMAL, self); \
+if(trace_fraction != 1) \
+ acm += normalize(self.origin - trace_endpos) * (vlen(vel) * mult)
+
+// Hover movement support
+float force_fromtag_power;
+vector force_fromtag_origin;
+vector vehicles_force_fromtag_hover(string tag_name, float spring_length, float max_power)
+{
+ force_fromtag_origin = gettaginfo(self, gettagindex(self, tag_name));
+ v_forward = normalize(v_forward) * -1;
+ traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, self);
+
+ force_fromtag_power = (1 - trace_fraction) * max_power;
+ force_fromtag_normpower = force_fromtag_power / max_power;
+
+ return v_forward * force_fromtag_power;
+}
+
+// Experimental hovermode wich uses attraction/repulstion from surface insted of gravity/repulsion
+// Can possibly be use to move abt any surface (inclusing walls/celings)
+vector vehicles_force_fromtag_maglev(string tag_name, float spring_length, float max_power)
+{
+
+ force_fromtag_origin = gettaginfo(self, gettagindex(self, tag_name));
+ v_forward = normalize(v_forward) * -1;
+ traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, self);
+
+ // TODO - this may NOT be compatible with wall/celing movement, unhardcode 0.25 (engine count multiplier)
+ if(trace_fraction == 1.0)
+ {
+ force_fromtag_normpower = -0.25;
+ return '0 0 -200';
+ }
+
+ force_fromtag_power = ((1 - trace_fraction) - trace_fraction) * max_power;
+ force_fromtag_normpower = force_fromtag_power / max_power;
+
+ return v_forward * force_fromtag_power;
+}
+
+// Generic vehile projectile system
+void vehicles_projectile_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+{
+ // Ignore damage from oterh projectiles from my owner (dont mess up volly's)
+ if(inflictor.owner == self.owner)
+ return;
+
+ self.health -= damage;
+ self.velocity += force;
+ if(self.health < 1)
+ {
+ self.takedamage = DAMAGE_NO;
+ self.event_damage = func_null;
+ self.think = self.use;
+ self.nextthink = time;
+ }
+}
+
+void vehicles_projectile_explode()
+{
+ if(self.owner && other != world)
+ {
+ if(other == self.owner.vehicle)
+ return;
+
+ if(other == self.owner.vehicle.tur_head)
+ return;
+ }
+
+ PROJECTILE_TOUCH;
+
+ self.event_damage = func_null;
+ RadiusDamage (self, self.realowner, self.shot_dmg, 0, self.shot_radius, self, world, self.shot_force, self.totalfrags, other);
+
+ remove (self);
+}
+
+entity vehicles_projectile(string _mzlfx, string _mzlsound,
+ vector _org, vector _vel,
+ float _dmg, float _radi, float _force, float _size,
+ float _deahtype, float _projtype, float _health,
+ float _cull, float _clianim, entity _owner)
+{
+ entity proj;
+
+ proj = spawn();
+
+ PROJECTILE_MAKETRIGGER(proj);
+ setorigin(proj, _org);
+
+ proj.shot_dmg = _dmg;
+ proj.shot_radius = _radi;
+ proj.shot_force = _force;
+ proj.totalfrags = _deahtype;
+ proj.solid = SOLID_BBOX;
+ proj.movetype = MOVETYPE_FLYMISSILE;
+ proj.flags = FL_PROJECTILE;
+ proj.bot_dodge = true;
+ proj.bot_dodgerating = _dmg;
+ proj.velocity = _vel;
+ proj.touch = vehicles_projectile_explode;
+ proj.use = vehicles_projectile_explode;
+ proj.owner = self;
+ proj.realowner = _owner;
+ proj.think = SUB_Remove;
+ proj.nextthink = time + 30;
+
+ if(_health)
+ {
+ proj.takedamage = DAMAGE_AIM;
+ proj.event_damage = vehicles_projectile_damage;
+ proj.health = _health;
+ }
+ else
+ proj.flags = FL_PROJECTILE | FL_NOTARGET;
+
+ if(_mzlsound)
+ sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
+
+ if(_mzlfx)
+ pointparticles(particleeffectnum(_mzlfx), proj.origin, proj.velocity, 1);
+
+
+ setsize (proj, '-1 -1 -1' * _size, '1 1 1' * _size);
+
+ CSQCProjectile(proj, _clianim, _projtype, _cull);
+
+ return proj;
+}
+// End generic vehile projectile system
+
+void vehicles_reset()
+{
+ if(self.owner)
+ {
+ entity oldself = self;
+ self = self.owner;
+ vehicles_exit(VHEF_RELESE);
+ self = oldself;
+ }
+ self.alpha = -1;
+ self.movetype = MOVETYPE_NONE;
+ self.effects = EF_NODRAW;
+ self.colormod = '0 0 0';
+ self.avelocity = '0 0 0';
+ self.velocity = '0 0 0';
+ self.event_damage = func_null;
+ self.solid = SOLID_NOT;
+ self.deadflag = DEAD_NO;
+
+ self.touch = func_null;
+ self.nextthink = 0;
+ vehicles_setreturn();
+}
+
+/** vehicles_spawn
+ Exetuted for all vehicles on (re)spawn.
+ Sets defaults for newly spawned units.
+**/
+void vehicles_spawn()
+{
+ dprint("Spawning vehicle: ", self.netname, "\n");
+
+ // De-own & reset
+ self.vehicle_hudmodel.viewmodelforclient = self;
+
+ self.owner = world;
+ self.touch = vehicles_touch;
+ self.event_damage = vehicles_damage;
+ self.reset = vehicles_reset;
+ self.iscreature = true;
+ self.teleportable = false; // no teleporting for vehicles, too buggy
+ self.damagedbycontents = true;
+ self.movetype = MOVETYPE_WALK;
+ self.solid = SOLID_SLIDEBOX;
+ self.takedamage = DAMAGE_AIM;
+ self.deadflag = DEAD_NO;
+ self.bot_attack = true;
+ self.flags = FL_NOTARGET;
+ self.avelocity = '0 0 0';
+ self.velocity = '0 0 0';
+
+ // Reset locking
+ self.lock_strength = 0;
+ self.lock_target = world;
+ self.misc_bulletcounter = 0;
+
+ // Return to spawn
+ self.angles = self.pos2;
+ setorigin(self, self.pos1 + '0 0 0');
+ // Show it
+ pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
+
+ if(self.vehicle_controller)
+ self.team = self.vehicle_controller.team;
+
+ vehicles_reset_colors();
+ self.vehicle_spawn(VHSF_NORMAL);
+}
+
+// Better way of determening whats crushable needed! (fl_crushable?)
+float vehicles_crushable(entity e)
+{
+ if(IS_PLAYER(e))
+ return true;
+
+ if(e.flags & FL_MONSTER)
+ return true;
+
+ return false;
+}
+
+void vehicles_impact(float _minspeed, float _speedfac, float _maxpain)
+{
+ if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
+ return;
+
+ if(self.play_time < time)
+ {
+ float wc = vlen(self.velocity - self.oldvelocity);
+ //dprint("oldvel: ", vtos(self.oldvelocity), "\n");
+ //dprint("vel: ", vtos(self.velocity), "\n");
+ if(_minspeed < wc)
+ {
+ float take = min(_speedfac * wc, _maxpain);
+ Damage (self, world, world, take, DEATH_FALL, self.origin, '0 0 0');
+ self.play_time = time + 0.25;
+
+ //dprint("wc: ", ftos(wc), "\n");
+ //dprint("take: ", ftos(take), "\n");
+ }
+ }
+}
+
+void vehicles_touch()
+{
+ if(MUTATOR_CALLHOOK(VehicleTouch))
+ return;
+
+ // Vehicle currently in use
+ if(self.owner)
+ {
+ if(other != world)
+ if(vehicles_crushable(other))
+ {
+ if(vlen(self.velocity) != 0)
+ Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
+
+ return; // Dont do selfdamage when hitting "soft targets".
+ }
+
+ if(self.play_time < time)
+ if(self.vehicle_impact)
+ self.vehicle_impact();
+
+ return;
+ }
+
+ if (!IS_PLAYER(other))
+ return;
+
+ if(other.deadflag != DEAD_NO)
+ return;
+
+ if(other.vehicle != world)
+ return;
+
+ vehicles_enter();
+}
+.float monster_attack;
+void vehicles_enter()
+{
+ // Remove this when bots know how to use vehicles
+
+ if (IS_BOT_CLIENT(other))
+ if (autocvar_g_vehicles_allow_bots)
+ dprint("Bot enters vehicle\n"); // This is where we need to disconnect (some, all?) normal bot AI and hand over to vehicle's _aiframe()
+ else
+ return;
+
+ if(self.phase > time)
+ return;
+ if(other.frozen)
+ return;
+ if(other.vehicle)
+ return;
+ if(other.deadflag != DEAD_NO)
+ return;
+
+ if(teamplay)
+ if(self.team)
+ if(self.team != other.team)
+ return;
+
+ RemoveGrapplingHook(other);
+
+ self.vehicle_ammo1 = 0;
+ self.vehicle_ammo2 = 0;
+ self.vehicle_reload1 = 0;
+ self.vehicle_reload2 = 0;
+ self.vehicle_energy = 0;
+
+ self.owner = other;
+ self.switchweapon = other.switchweapon;
+
+ // .viewmodelforclient works better.
+ //self.vehicle_hudmodel.drawonlytoclient = self.owner;
+
+ self.vehicle_hudmodel.viewmodelforclient = self.owner;
+
+ self.event_damage = vehicles_damage;
+ self.nextthink = 0;
+ self.owner.angles = self.angles;
+ self.owner.takedamage = DAMAGE_NO;
+ self.owner.solid = SOLID_NOT;
+ self.owner.movetype = MOVETYPE_NOCLIP;
+ self.owner.alpha = -1;
+ self.owner.vehicle = self;
+ self.owner.event_damage = func_null;
+ self.owner.view_ofs = '0 0 0';
+ self.colormap = self.owner.colormap;
+ if(self.tur_head)
+ self.tur_head.colormap = self.owner.colormap;
+
+ self.owner.hud = self.hud;
+ self.owner.PlayerPhysplug = self.PlayerPhysplug;
+
+ self.owner.vehicle_ammo1 = self.vehicle_ammo1;
+ self.owner.vehicle_ammo2 = self.vehicle_ammo2;
+ self.owner.vehicle_reload1 = self.vehicle_reload1;
+ self.owner.vehicle_reload2 = self.vehicle_reload2;
+
+ // Cant do this, hides attached objects too.
+ //self.exteriormodeltoclient = self.owner;
+ //self.tur_head.exteriormodeltoclient = self.owner;
+
+ other.flags &= ~FL_ONGROUND;
+ self.flags &= ~FL_ONGROUND;
+
+ self.team = self.owner.team;
+ self.flags -= FL_NOTARGET;
+ self.monster_attack = true;
+
+ if (IS_REAL_CLIENT(other))
+ {
+ msg_entity = other;
+ WriteByte (MSG_ONE, SVC_SETVIEWPORT);
+ WriteEntity(MSG_ONE, self.vehicle_viewport);
+
+ WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
+ if(self.tur_head)
+ {
+ WriteAngle(MSG_ONE, self.tur_head.angles.x + self.angles.x); // tilt
+ WriteAngle(MSG_ONE, self.tur_head.angles.y + self.angles.y); // yaw
+ WriteAngle(MSG_ONE, 0); // roll
+ }
+ else
+ {
+ WriteAngle(MSG_ONE, self.angles.x * -1); // tilt
+ WriteAngle(MSG_ONE, self.angles.y); // yaw
+ WriteAngle(MSG_ONE, 0); // roll
+ }
+ }
+
+ vehicles_clearreturn();
+
+ CSQCVehicleSetup(self.owner, self.hud);
+
+ vh_player = other;
+ vh_vehicle = self;
+ MUTATOR_CALLHOOK(VehicleEnter);
+ other = vh_player;
+ self = vh_vehicle;
+
+ self.vehicle_enter();
+ antilag_clear(other);
+}
+
+/** vehicles_findgoodexit
+ Locates a valid location for the player to exit the vehicle.
+ Will first try prefer_spot, then up 100 random spots arround the vehicle
+ wich are in direct line of sight and empty enougth to hold a players bbox
+**/
+vector vehicles_findgoodexit(vector prefer_spot)
+{
+ //vector exitspot;
+ float mysize;
+
+ tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, prefer_spot, MOVE_NORMAL, self.owner);
+ if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+ return prefer_spot;
+
+ mysize = 1.5 * vlen(self.maxs - self.mins);
+ float i;
+ vector v, v2;
+ v2 = 0.5 * (self.absmin + self.absmax);
+ for(i = 0; i < 100; ++i)
+ {
+ v = randomvec();
+ v.z = 0;
+ v = v2 + normalize(v) * mysize;
+ tracebox(v2, PL_MIN, PL_MAX, v, MOVE_NORMAL, self.owner);
+ if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+ return v;
+ }
+
+ /*
+ exitspot = (self.origin + '0 0 48') + v_forward * mysize;
+ tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
+ if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+ return exitspot;
+
+ exitspot = (self.origin + '0 0 48') - v_forward * mysize;
+ tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
+ if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+ return exitspot;
+
+ exitspot = (self.origin + '0 0 48') + v_right * mysize;
+ tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
+ if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+ return exitspot;
+
+ exitspot = (self.origin + '0 0 48') - v_right * mysize;
+ tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
+ if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
+ return exitspot;
+ */
+
+ return self.origin;
+}
+
+/** vehicles_exit
+ Standarrd vehicle release fucntion.
+ custom code goes in self.vehicle_exit
+**/
+float vehicles_exit_running;
+void vehicles_exit(float eject)
+{
+ entity _vehicle;
+ entity _player;
+ entity _oldself = self;
+
+ if(vehicles_exit_running)
+ {
+ dprint("^1vehicles_exit allready running! this is not good..\n");
+ return;
+ }
+
+ vehicles_exit_running = true;
+ if(IS_CLIENT(self))
+ {
+ _vehicle = self.vehicle;
+
+ if (_vehicle.vehicle_flags & VHF_PLAYERSLOT)
+ {
+ _vehicle.vehicle_exit(eject);
+ self = _oldself;
+ vehicles_exit_running = false;
+ return;
+ }
+ }
+ else
+ _vehicle = self;
+
+ _player = _vehicle.owner;
+
+ self = _vehicle;
+
+ if (_player)
+ {
+ if (IS_REAL_CLIENT(_player))
+ {
+ msg_entity = _player;
+ WriteByte (MSG_ONE, SVC_SETVIEWPORT);
+ WriteEntity( MSG_ONE, _player);
+
+ WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
+ WriteAngle(MSG_ONE, 0);
+ WriteAngle(MSG_ONE, _vehicle.angles.y);
+ WriteAngle(MSG_ONE, 0);
+ }
+
+ setsize(_player, PL_MIN,PL_MAX);
+
+ _player.takedamage = DAMAGE_AIM;
+ _player.solid = SOLID_SLIDEBOX;
+ _player.movetype = MOVETYPE_WALK;
+ _player.effects &= ~EF_NODRAW;
+ _player.alpha = 1;
+ _player.PlayerPhysplug = func_null;
+ _player.vehicle = world;
+ _player.view_ofs = PL_VIEW_OFS;
+ _player.event_damage = PlayerDamage;
+ _player.hud = HUD_NORMAL;
+ _player.switchweapon = _vehicle.switchweapon;
+
+ CSQCVehicleSetup(_player, HUD_NORMAL);
+ }
+ _vehicle.flags |= FL_NOTARGET;
+
+ if(_vehicle.deadflag == DEAD_NO)
+ _vehicle.avelocity = '0 0 0';
+
+ _vehicle.tur_head.nodrawtoclient = world;
+
+ if(!teamplay)
+ _vehicle.team = 0;
+
+ vh_player = _player;
+ vh_vehicle = _vehicle;
+ MUTATOR_CALLHOOK(VehicleExit);
+ _player = vh_player;
+ _vehicle = vh_vehicle;
+
+ _vehicle.team = _vehicle.tur_head.team;
+
+ sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTEN_NORM);
+ _vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle;
+ _vehicle.phase = time + 1;
+ _vehicle.monster_attack = false;
+
+ _vehicle.vehicle_exit(eject);
+
+ vehicles_setreturn();
+ vehicles_reset_colors();
+ _vehicle.owner = world;
+ self = _oldself;
+
+ vehicles_exit_running = false;
+}
+
+
+void vehicles_regen(float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale)
+{
+ if (self.(regen_field) < field_max)
+ if (timer + rpause < time)
+ {
+ if (_healthscale)
+ regen = regen * (self.vehicle_health / self.tur_health);
+
+ self.(regen_field) = min(self.(regen_field) + regen * delta_time, field_max);
+
+ if (self.owner)
+ self.owner.(regen_field) = (self.(regen_field) / field_max) * 100;
+ }
+}
+
+void shieldhit_think()
+{
+ self.alpha -= 0.1;
+ if (self.alpha <= 0)
+ {
+ //setmodel(self, "");
+ self.alpha = -1;
+ self.effects |= EF_NODRAW;
+ }
+ else
+ {
+ self.nextthink = time + 0.1;
+ }
+}
+
+void vehicles_painframe()
+{
+ if(self.owner.vehicle_health <= 50)
+ if(self.pain_frame < time)
+ {
+ float _ftmp;
+ _ftmp = self.owner.vehicle_health / 50;
+ self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp);
+ pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
+
+ if(self.vehicle_flags & VHF_DMGSHAKE)
+ self.velocity += randomvec() * 30;
+
+ if(self.vehicle_flags & VHF_DMGROLL)
+ if(self.vehicle_flags & VHF_DMGHEADROLL)
+ self.tur_head.angles += randomvec();
+ else
+ self.angles += randomvec();
+
+ }
+}
+
+void vehicles_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+{
+ self.dmg_time = time;
+
+ // WEAPONTODO
+ if(DEATH_ISWEAPON(deathtype, WEP_VORTEX))
+ damage *= autocvar_g_vehicles_vortex_damagerate;
+
+ if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN))
+ damage *= autocvar_g_vehicles_machinegun_damagerate;
+
+ if(DEATH_ISWEAPON(deathtype, WEP_RIFLE))
+ damage *= autocvar_g_vehicles_rifle_damagerate;
+
+ if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
+ damage *= autocvar_g_vehicles_vaporizer_damagerate;
+
+ if(DEATH_ISWEAPON(deathtype, WEP_SEEKER))
+ damage *= autocvar_g_vehicles_tag_damagerate;
+
+ self.enemy = attacker;
+
+ if((self.vehicle_flags & VHF_HASSHIELD) && (self.vehicle_shield > 0))
+ {
+ if (wasfreed(self.vehicle_shieldent) || self.vehicle_shieldent == world)
+ {
+ self.vehicle_shieldent = spawn();
+ self.vehicle_shieldent.effects = EF_LOWPRECISION;
+
+ setmodel(self.vehicle_shieldent, "models/vhshield.md3");
+ setattachment(self.vehicle_shieldent, self, "");
+ setorigin(self.vehicle_shieldent, real_origin(self) - self.origin);
+ self.vehicle_shieldent.scale = 256 / vlen(self.maxs - self.mins);
+ self.vehicle_shieldent.think = shieldhit_think;
+ }
+
+ self.vehicle_shieldent.colormod = '1 1 1';
+ self.vehicle_shieldent.alpha = 0.45;
+ self.vehicle_shieldent.angles = vectoangles(normalize(hitloc - (self.origin + self.vehicle_shieldent.origin))) - self.angles;
+ self.vehicle_shieldent.nextthink = time;
+ self.vehicle_shieldent.effects &= ~EF_NODRAW;
+
+ self.vehicle_shield -= damage;
+
+ if(self.vehicle_shield < 0)
+ {
+ self.vehicle_health -= fabs(self.vehicle_shield);
+ self.vehicle_shieldent.colormod = '2 0 0';
+ self.vehicle_shield = 0;
+ self.vehicle_shieldent.alpha = 0.75;
+
+ if(sound_allowed(MSG_BROADCAST, attacker))
+ spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER
+ }
+ else
+ if(sound_allowed(MSG_BROADCAST, attacker))
+ spamsound (self, CH_PAIN, "onslaught/electricity_explode.wav", VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER
+
+ }
+ else
+ {
+ self.vehicle_health -= damage;
+
+ if(sound_allowed(MSG_BROADCAST, attacker))
+ spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER
+ }
+
+ if(self.damageforcescale < 1 && self.damageforcescale > 0)
+ self.velocity += force * self.damageforcescale;
+ else
+ self.velocity += force;
+
+ if(self.vehicle_health <= 0)
+ {
+ if(self.owner)
+ if(self.vehicle_flags & VHF_DEATHEJECT)
+ vehicles_exit(VHEF_EJECT);
+ else
+ vehicles_exit(VHEF_RELESE);
+
+
+ antilag_clear(self);
+
+ self.vehicle_die();
+ vehicles_setreturn();
+ }
+}
+
+void vehicles_clearreturn()
+{
+ entity ret;
+ // Remove "return helper", if any.
+ ret = findchain(classname, "vehicle_return");
+ while(ret)
+ {
+ if(ret.wp00 == self)
+ {
+ ret.classname = "";
+ ret.think = SUB_Remove;
+ ret.nextthink = time + 0.1;
+
+ if(ret.waypointsprite_attached)
+ WaypointSprite_Kill(ret.waypointsprite_attached);
+
+ return;
+ }
+ ret = ret.chain;
+ }
+}
+
+void vehicles_return()
+{
+ pointparticles(particleeffectnum("teleport"), self.wp00.origin + '0 0 64', '0 0 0', 1);
+
+ self.wp00.think = vehicles_spawn;
+ self.wp00.nextthink = time;
+
+ if(self.waypointsprite_attached)
+ WaypointSprite_Kill(self.waypointsprite_attached);
+
+ remove(self);
+}
+
+void vehicles_showwp_goaway()
+{
+ if(self.waypointsprite_attached)
+ WaypointSprite_Kill(self.waypointsprite_attached);
+
+ remove(self);
+
+}
+
+void vehicles_showwp()
+{
+ entity oldself = world;
+ vector rgb;
+
+ if(self.cnt)
+ {
+ self.think = vehicles_return;
+ self.nextthink = self.cnt;
+ }
+ else
+ {
+ self.think = vehicles_return;
+ self.nextthink = time +1;
+
+ oldself = self;
+ self = spawn();
+ setmodel(self, "null");
+ self.team = oldself.wp00.team;
+ self.wp00 = oldself.wp00;
+ setorigin(self, oldself.wp00.pos1);
+
+ self.nextthink = time + 5;
+ self.think = vehicles_showwp_goaway;
+ }
+
+ if(teamplay && self.team)
+ rgb = Team_ColorRGB(self.team);
+ else
+ rgb = '1 1 1';
+ WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP, rgb);
+ if(self.waypointsprite_attached)
+ {
+ WaypointSprite_UpdateRule(self.waypointsprite_attached, self.wp00.team, SPRITERULE_DEFAULT);
+ if(oldself == world)
+ WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, self.nextthink);
+ WaypointSprite_Ping(self.waypointsprite_attached);
+ }
+
+ if(oldself != world)
+ self = oldself;
+}
+
+void vehicles_setreturn()
+{
+ entity ret;
+
+ vehicles_clearreturn();
+
+ ret = spawn();
+ ret.classname = "vehicle_return";
+ ret.wp00 = self;
+ ret.team = self.team;
+ ret.think = vehicles_showwp;
+
+ if(self.deadflag != DEAD_NO)
+ {
+ ret.cnt = max(game_starttime, time) + self.vehicle_respawntime;
+ ret.nextthink = max(game_starttime, time) + max(0, self.vehicle_respawntime - 5);
+ }
+ else
+ ret.nextthink = max(game_starttime, time) + max(0, self.vehicle_respawntime - 1);
+
+ setmodel(ret, "null");
+ setorigin(ret, self.pos1 + '0 0 96');
+}
+
+void vehicles_reset_colors()
+{
+ entity e;
+ float _effects = 0, _colormap;
+ vector _glowmod, _colormod;
+
+ if(autocvar_g_nodepthtestplayers)
+ _effects |= EF_NODEPTHTEST;
+
+ if(autocvar_g_fullbrightplayers)
+ _effects |= EF_FULLBRIGHT;
+
+ if(self.team)
+ _colormap = 1024 + (self.team - 1) * 17;
+ else
+ _colormap = 1024;
+
+ _glowmod = '0 0 0';
+ _colormod = '0 0 0';
+
+ // Find all ents attacked to main model and setup effects, colormod etc.
+ e = findchainentity(tag_entity, self);
+ while(e)
+ {
+ if(e != self.vehicle_shieldent)
+ {
+ e.effects = _effects; // | EF_LOWPRECISION;
+ e.colormod = _colormod;
+ e.colormap = _colormap;
+ e.alpha = 1;
+ }
+ e = e.chain;
+ }
+
+ self.vehicle_hudmodel.effects = self.effects = _effects; // | EF_LOWPRECISION;
+ self.vehicle_hudmodel.colormod = self.colormod = _colormod;
+ self.vehicle_hudmodel.colormap = self.colormap = _colormap;
+ self.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
+
+ self.alpha = 1;
+ self.avelocity = '0 0 0';
+ self.velocity = '0 0 0';
+ self.effects = _effects;
+}
+
+void vehicle_use()
+{
+ dprint("vehicle ",self.netname, " used by ", activator.classname, "\n");
+
+ self.tur_head.team = activator.team;
+
+ if(self.tur_head.team == 0)
+ self.active = ACTIVE_NOT;
+ else
+ self.active = ACTIVE_ACTIVE;
+
+ if(self.active == ACTIVE_ACTIVE && self.deadflag == DEAD_NO)
+ {
+ dprint("^3Eat shit yall!\n");
+ vehicles_setreturn();
+ vehicles_reset_colors();
+ }
+ else if(self.active == ACTIVE_NOT && self.deadflag != DEAD_NO)
+ {
+
+ }
+}
+
+float vehicle_addplayerslot( entity _owner,
+ entity _slot,
+ float _hud,
+ string _hud_model,
+ float() _framefunc,
+ void(float) _exitfunc)
+{
+ if (!(_owner.vehicle_flags & VHF_MULTISLOT))
+ _owner.vehicle_flags |= VHF_MULTISLOT;
+
+ _slot.PlayerPhysplug = _framefunc;
+ _slot.vehicle_exit = _exitfunc;
+ _slot.hud = _hud;
+ _slot.vehicle_flags = VHF_PLAYERSLOT;
+ _slot.vehicle_viewport = spawn();
+ _slot.vehicle_hudmodel = spawn();
+ _slot.vehicle_hudmodel.viewmodelforclient = _slot;
+ _slot.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
+
+ setmodel(_slot.vehicle_hudmodel, _hud_model);
+ setmodel(_slot.vehicle_viewport, "null");
+
+ setattachment(_slot.vehicle_hudmodel, _slot, "");
+ setattachment(_slot.vehicle_viewport, _slot.vehicle_hudmodel, "");
+
+ return true;
+}
+
+float vehicle_initialize(string net_name,
+ string bodymodel,
+ string topmodel,
+ string hudmodel,
+ string toptag,
+ string hudtag,
+ string viewtag,
+ float vhud,
+ vector min_s,
+ vector max_s,
+ float nodrop,
+ void(float _spawnflag) spawnproc,
+ float _respawntime,
+ float() physproc,
+ void() enterproc,
+ void(float extflag) exitfunc,
+ void() dieproc,
+ void() thinkproc,
+ float use_csqc,
+ float _max_health,
+ float _max_shield)
+{
+ if(!autocvar_g_vehicles)
+ return false;
+
+ if(self.targetname)
+ {
+ self.vehicle_controller = find(world, target, self.targetname);
+ if(!self.vehicle_controller)
+ {
+ bprint("^1WARNING: ^7Vehicle with invalid .targetname\n");
+ }
+ else
+ {
+ self.team = self.vehicle_controller.team;
+ self.use = vehicle_use;
+
+ if(teamplay)
+ {
+ if(self.vehicle_controller.team == 0)
+ self.active = ACTIVE_NOT;
+ else
+ self.active = ACTIVE_ACTIVE;
+ }
+ }
+ }
+
+ precache_sound("onslaught/ons_hit2.wav");
+ precache_sound("onslaught/electricity_explode.wav");
+
+
+ addstat(STAT_HUD, AS_INT, hud);
+ addstat(STAT_VEHICLESTAT_HEALTH, AS_INT, vehicle_health);
+ addstat(STAT_VEHICLESTAT_SHIELD, AS_INT, vehicle_shield);
+ addstat(STAT_VEHICLESTAT_ENERGY, AS_INT, vehicle_energy);
+
+ addstat(STAT_VEHICLESTAT_AMMO1, AS_INT, vehicle_ammo1);
+ addstat(STAT_VEHICLESTAT_RELOAD1, AS_INT, vehicle_reload1);
+
+ addstat(STAT_VEHICLESTAT_AMMO2, AS_INT, vehicle_ammo2);
+ addstat(STAT_VEHICLESTAT_RELOAD2, AS_INT, vehicle_reload2);
+
+ if(bodymodel == "")
+ error("vehicles: missing bodymodel!");
+
+ if(hudmodel == "")
+ error("vehicles: missing hudmodel!");
+
+ if(net_name == "")
+ self.netname = self.classname;
+ else
+ self.netname = net_name;
+
+ if(self.team && !teamplay)
+ self.team = 0;
+
+ self.vehicle_flags |= VHF_ISVEHICLE;
+
+ setmodel(self, bodymodel);
+
+ self.vehicle_viewport = spawn();
+ self.vehicle_hudmodel = spawn();
+ self.tur_head = spawn();
+ self.tur_head.owner = self;
+ self.takedamage = DAMAGE_AIM;
+ self.bot_attack = true;
+ self.iscreature = true;
+ self.teleportable = false; // no teleporting for vehicles, too buggy
+ self.damagedbycontents = true;
+ self.hud = vhud;
+ self.tur_health = _max_health;
+ self.tur_head.tur_health = _max_shield;
+ self.vehicle_die = dieproc;
+ self.vehicle_exit = exitfunc;
+ self.vehicle_enter = enterproc;
+ self.PlayerPhysplug = physproc;
+ self.event_damage = func_null;
+ self.touch = vehicles_touch;
+ self.think = vehicles_spawn;
+ self.vehicle_spawn = spawnproc;
+ self.vehicle_respawntime = max(0, _respawntime);
+ self.effects = EF_NODRAW;
+ self.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_SOLID;
+ if(!autocvar_g_vehicles_delayspawn || !self.vehicle_respawntime)
+ self.nextthink = time;
+ else
+ self.nextthink = max(time, game_starttime) + max(0, self.vehicle_respawntime + ((random() * 2 - 1) * autocvar_g_vehicles_delayspawn_jitter));
+
+ if(autocvar_g_playerclip_collisions)
+ self.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
+
+ if(autocvar_g_nodepthtestplayers)
+ self.effects = self.effects | EF_NODEPTHTEST;
+
+ if(autocvar_g_fullbrightplayers)
+ self.effects = self.effects | EF_FULLBRIGHT;
+
+ setmodel(self.vehicle_hudmodel, hudmodel);
+ setmodel(self.vehicle_viewport, "null");
+
+ if(topmodel != "")
+ {
+ setmodel(self.tur_head, topmodel);
+ setattachment(self.tur_head, self, toptag);
+ setattachment(self.vehicle_hudmodel, self.tur_head, hudtag);
+ setattachment(self.vehicle_viewport, self.vehicle_hudmodel, viewtag);
+ }
+ else
+ {
+ setattachment(self.tur_head, self, "");
+ setattachment(self.vehicle_hudmodel, self, hudtag);
+ setattachment(self.vehicle_viewport, self.vehicle_hudmodel, viewtag);
+ }
+
+ setsize(self, min_s, max_s);
+ if (!nodrop)
+ {
+ setorigin(self, self.origin);
+ tracebox(self.origin + '0 0 100', min_s, max_s, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
+ setorigin(self, trace_endpos);
+ }
+
+ self.pos1 = self.origin;
+ self.pos2 = self.angles;
+ self.tur_head.team = self.team;
+
+ if(MUTATOR_CALLHOOK(VehicleSpawn))
+ return false;
+
+ return true;
+}
+
+vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname,
+ float _pichlimit_min, float _pichlimit_max,
+ float _rotlimit_min, float _rotlimit_max, float _aimspeed)
+{
+ vector vtmp, vtag;
+ float ftmp;
+ vtag = gettaginfo(_turrret, gettagindex(_turrret, _tagname));
+ vtmp = vectoangles(normalize(_target - vtag));
+ vtmp = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(_vehic.angles), AnglesTransform_FromAngles(vtmp))) - _turrret.angles;
+ vtmp = AnglesTransform_Normalize(vtmp, true);
+ ftmp = _aimspeed * frametime;
+ vtmp.y = bound(-ftmp, vtmp.y, ftmp);
+ vtmp.x = bound(-ftmp, vtmp.x, ftmp);
+ _turrret.angles_y = bound(_rotlimit_min, _turrret.angles.y + vtmp.y, _rotlimit_max);
+ _turrret.angles_x = bound(_pichlimit_min, _turrret.angles.x + vtmp.x, _pichlimit_max);
+ return vtag;
+}
+
+void vehicles_gib_explode()
+{
+ sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
+ pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
+ remove(self);
+}
+
+void vehicles_gib_think()
+{
+ self.alpha -= 0.1;
+ if(self.cnt >= time)
+ remove(self);
+ else
+ self.nextthink = time + 0.1;
+}
+
+entity vehicle_tossgib(entity _template, vector _vel, string _tag, float _burn, float _explode, float _maxtime, vector _rot)
+{
+ entity _gib = spawn();
+ setmodel(_gib, _template.model);
+ setorigin(_gib, gettaginfo(self, gettagindex(self, _tag)));
+ _gib.velocity = _vel;
+ _gib.movetype = MOVETYPE_TOSS;
+ _gib.solid = SOLID_CORPSE;
+ _gib.colormod = '-0.5 -0.5 -0.5';
+ _gib.effects = EF_LOWPRECISION;
+ _gib.avelocity = _rot;
+
+ if(_burn)
+ _gib.effects |= EF_FLAME;
+
+ if(_explode)
+ {
+ _gib.think = vehicles_gib_explode;
+ _gib.nextthink = time + random() * _explode;
+ _gib.touch = vehicles_gib_explode;
+ }
+ else
+ {
+ _gib.cnt = time + _maxtime;
+ _gib.think = vehicles_gib_think;
+ _gib.nextthink = time + _maxtime - 1;
+ _gib.alpha = 1;
+ }
+ return _gib;
+}
+
+/*
+vector predict_target(entity _targ, vector _from, float _shot_speed)
+{
+ float i; // loop
+ float _distance; // How far to target
+ float _impact_time; // How long untill projectile impacts
+ vector _predict_pos; // Predicted enemy location
+ vector _original_origin;// Where target is before predicted
+
+ _original_origin = real_origin(_targ); // Typicaly center of target BBOX
+
+ _predict_pos = _original_origin;
+ for(i = 0; i < 4; ++i) // Loop a few times to increase prediction accuracy (increase loop count if accuracy is to low)
+ {
+ _distance = vlen(_predict_pos - _from); // Get distance to previos predicted location
+ _impact_time = _distance / _shot_speed; // Calculate impact time
+ _predict_pos = _original_origin + _targ.velocity * _impact_time; // Calculate new predicted location
+ }
+
+ return _predict_pos;
+}
+*/
--- /dev/null
+#ifndef VEHICLE_H
+#define VEHICLE_H
+
+#include "../_all.qh"
+
+#include "../antilag.qh"
+#include "../cl_player.qh"
+#include "../g_damage.qh"
+#include "../g_hook.qh"
+#include "../g_subs.qh"
+#include "../movelib.qh"
+
+#include "../bot/bot.qh"
+
+#include "../command/common.qh"
+
+#include "../tturrets/include/turrets_early.qh"
+
+#include "../weapons/tracing.qh"
+
+#include "../../common/deathtypes.qh"
+#include "../../common/stats.qh"
+
+#include "../../warpzonelib/anglestransform.qh"
+#include "../../warpzonelib/server.qh"
+
+entity vehicles_projectile(string _mzlfx, string _mzlsound,
+ vector _org, vector _vel,
+ float _dmg, float _radi, float _force, float _size,
+ float _deahtype, float _projtype, float _health,
+ float _cull, float _clianim, entity _owner);
+
+vector vehicles_findgoodexit(vector prefer_spot);
+
+
+
+/** vehicles_locktarget
+
+ Generic target locking.
+
+ Figure out if what target is "locked" (if any), for missile tracking as such.
+
+ after calling, "if(self.lock_target != world && self.lock_strength == 1)" mean
+ you have a locked in target.
+
+ Exspects a crosshair_trace() or equivalent to be
+ dont before calling.
+
+**/
+.entity lock_target;
+.float lock_strength;
+.float lock_time;
+.float lock_soundtime;
+
+void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, int axh_id);
+
+vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname,
+ float _pichlimit_min, float _pichlimit_max,
+ float _rotlimit_min, float _rotlimit_max, float _aimspeed);
+
+#define VEHICLE_UPDATE_PLAYER(ply,fld,vhname) \
+ply.vehicle_##fld = (self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
+
+void CSQCVehicleSetup(entity own, float vehicle_id);
+
+.float() PlayerPhysplug;
+
+float autocvar_g_vehicles_allow_bots = 0;
+
+void vehicles_touch();
+
+void vehicles_regen(float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale);
+
+float shortangle_f(float ang1, float ang2);
+float anglemods(float v);
+
+entity vehicle_tossgib(entity _template, vector _vel, string _tag, float _burn, float _explode, float _maxtime, vector _rot);
+
+void vehicles_impact(float _minspeed, float _speedfac, float _maxpain);
+
+void shieldhit_think();
+
+float vehicle_addplayerslot( entity _owner,
+ entity _slot,
+ float _hud,
+ string _hud_model,
+ float() _framefunc,
+ void(float) _exitfunc);
+
+.void() vehicle_impact;
+
+float vehicle_initialize(string net_name,
+ string bodymodel,
+ string topmodel,
+ string hudmodel,
+ string toptag,
+ string hudtag,
+ string viewtag,
+ float vhud,
+ vector min_s,
+ vector max_s,
+ float nodrop,
+ void(float _spawnflag) spawnproc,
+ float _respawntime,
+ float() physproc,
+ void() enterproc,
+ void(float extflag) exitfunc,
+ void() dieproc,
+ void() thinkproc,
+ float use_csqc,
+ float _max_health,
+ float _max_shield);
+
+float force_fromtag_normpower;
+
+void vehicles_painframe();
+
+void vehicles_locktarget(float incr, float decr, float _lock_time);
+
+vector vehicles_force_fromtag_maglev(string tag_name, float spring_length, float max_power);
+
+vector vehicles_force_fromtag_hover(string tag_name, float spring_length, float max_power);
+
+void vehicles_projectile_explode();
+
+#if VEHICLES_ENABLED
+
+.int vehicle_flags;
+const int VHF_ISVEHICLE = 2; /// Indicates vehicle
+const int VHF_HASSHIELD = 4; /// Vehicle has shileding
+const int VHF_SHIELDREGEN = 8; /// Vehicles shield regenerates
+const int VHF_HEALTHREGEN = 16; /// Vehicles health regenerates
+const int VHF_ENERGYREGEN = 32; /// Vehicles energy regenerates
+const int VHF_DEATHEJECT = 64; /// Vehicle ejects pilot upon fatal damage
+const int VHF_MOVE_GROUND = 128; /// Vehicle moves on gound
+const int VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound
+const int VHF_MOVE_FLY = 512; /// Vehicle is airborn
+const int VHF_DMGSHAKE = 1024; /// Add random velocity each frame if health < 50%
+const int VHF_DMGROLL = 2048; /// Add random angles each frame if health < 50%
+const int VHF_DMGHEADROLL = 4096; /// Add random head angles each frame if health < 50%
+const int VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots
+const int VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle
+
+.entity gun1;
+.entity gun2;
+.entity gun3;
+.entity vehicle_shieldent; /// Entity to disply the shild effect on damage
+.entity vehicle;
+.entity vehicle_viewport;
+.entity vehicle_hudmodel;
+.entity vehicle_controller;
+
+.entity gunner1;
+.entity gunner2;
+
+.float vehicle_health; /// If self is player this is 0..100 indicating precentage of health left on vehicle. If self is vehile, this is the real health value.
+.float vehicle_energy; /// If self is player this is 0..100 indicating precentage of energy left on vehicle. If self is vehile, this is the real energy value.
+.float vehicle_shield; /// If self is player this is 0..100 indicating precentage of shield left on vehicle. If self is vehile, this is the real shield value.
+
+.float vehicle_ammo1; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo1 value.
+.float vehicle_reload1; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload1 value.
+.float vehicle_ammo2; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo2 value.
+.float vehicle_reload2; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload2 value.
+
+.float sound_nexttime;
+const float VOL_VEHICLEENGINE = 1;
+
+.float hud;
+.float dmg_time;
+.float vehicle_respawntime;
+//.void() vehicle_spawn;
+
+void vehicles_exit(float eject);
+.void(float exit_flags) vehicle_exit;
+const float VHEF_NORMAL = 0; /// User pressed exit key
+const float VHEF_EJECT = 1; /// User pressed exit key 3 times fast (not implemented) or vehile is dying
+const float VHEF_RELESE = 2; /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
+
+const float SVC_SETVIEWPORT = 5; // Net.Protocol 0x05
+const float SVC_SETVIEWANGLES = 10; // Net.Protocol 0x0A
+const float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80
+
+.void() vehicle_enter; /// Vehicles custom funciton to be executed when owner exit it
+.void() vehicle_die; /// Vehicles custom function to be executed when vehile die
+const float VHSF_NORMAL = 0;
+const float VHSF_FACTORY = 2;
+.void(float _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
+.float(float _imp) vehicles_impulse;
+.float vehicle_weapon2mode;
+
+#if VEHICLES_USE_ODE
+void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
+void(entity e, vector force, vector force_pos) physics_addforce = #541; // apply a force from certain origin, length of force vector is power of force
+void(entity e, vector torque) physics_addtorque = #542; // add relative torque
+#endif // VEHICLES_USE_ODE
+#endif // VEHICLES_ENABLED
+#endif
+++ /dev/null
-float autocvar_g_vehicles_crush_dmg;
-float autocvar_g_vehicles_crush_force;
-float autocvar_g_vehicles_delayspawn;
-float autocvar_g_vehicles_delayspawn_jitter;
-
-float autocvar_g_vehicles_vortex_damagerate = 0.5;
-float autocvar_g_vehicles_machinegun_damagerate = 0.5;
-float autocvar_g_vehicles_rifle_damagerate = 0.75;
-float autocvar_g_vehicles_vaporizer_damagerate = 0.001;
-float autocvar_g_vehicles_tag_damagerate = 5;
-
-float autocvar_g_vehicles;
-
-void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
-void vehicles_return();
-void vehicles_enter();
-void vehicles_touch();
-void vehicles_reset_colors();
-void vehicles_clearreturn();
-void vehicles_setreturn();
-
-
-/** AuxiliaryXhair*
- Send additional points of interest to be drawn, to vehicle owner
-**/
-const float MAX_AXH = 4;
-.entity AuxiliaryXhair[MAX_AXH];
-
-float SendAuxiliaryXhair(entity to, float sf)
-{
-
- WriteByte(MSG_ENTITY, ENT_CLIENT_AUXILIARYXHAIR);
-
- WriteByte(MSG_ENTITY, self.cnt);
-
- WriteCoord(MSG_ENTITY, self.origin.x);
- WriteCoord(MSG_ENTITY, self.origin.y);
- WriteCoord(MSG_ENTITY, self.origin.z);
-
- WriteByte(MSG_ENTITY, rint(self.colormod.x * 255));
- WriteByte(MSG_ENTITY, rint(self.colormod.y * 255));
- WriteByte(MSG_ENTITY, rint(self.colormod.z * 255));
-
- return true;
-}
-
-void UpdateAuxiliaryXhair(entity own, vector loc, vector clr, float axh_id)
-{
- if (!IS_REAL_CLIENT(own))
- return;
-
- entity axh;
-
- axh_id = bound(0, axh_id, MAX_AXH);
- axh = own.(AuxiliaryXhair[axh_id]);
-
- if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?)
- {
- axh = spawn();
- axh.cnt = axh_id;
- axh.drawonlytoclient = own;
- axh.owner = own;
- Net_LinkEntity(axh, false, 0, SendAuxiliaryXhair);
- }
-
- setorigin(axh, loc);
- axh.colormod = clr;
- axh.SendFlags = 0x01;
- own.(AuxiliaryXhair[axh_id]) = axh;
-}
-
-/*
-// SVC_TEMPENTITY based, horrible with even 50 ping. hm.
-// WriteByte(MSG_ONE, SVC_TEMPENTITY) uses reliable messagess, never use for thinsg that need continous updates.
-void SendAuxiliaryXhair2(entity own, vector loc, vector clr, float axh_id)
-{
- msgexntity = own;
-
- WriteByte(MSG_ONE, SVC_TEMPENTITY);
- WriteByte(MSG_ONE, TE_CSQC_AUXILIARYXHAIR);
-
- WriteByte(MSG_ONE, axh_id);
-
- WriteCoord(MSG_ONE, loc_x);
- WriteCoord(MSG_ONE, loc_y);
- WriteCoord(MSG_ONE, loc_z);
-
- WriteByte(MSG_ONE, rint(clr_x * 255));
- WriteByte(MSG_ONE, rint(clr_y * 255));
- WriteByte(MSG_ONE, rint(clr_z * 255));
-
-}
-*/
-// End AuxiliaryXhair
-
-/**
- Notifies the client that he enterd a vehicle, and sends
- realavent data.
-
- only sends vehicle_id atm (wich is a HUD_* constant, ex. HUD_SPIDERBOT)
-**/
-void CSQCVehicleSetup(entity own, float vehicle_id)
-{
- if (!IS_REAL_CLIENT(own))
- return;
-
- msg_entity = own;
-
- WriteByte(MSG_ONE, SVC_TEMPENTITY);
- WriteByte(MSG_ONE, TE_CSQC_VEHICLESETUP);
- if(vehicle_id != 0)
- WriteByte(MSG_ONE, vehicle_id);
- else
- WriteByte(MSG_ONE, 1 + own.vehicle.vehicle_weapon2mode + HUD_VEHICLE_LAST);
-}
-
-/** vehicles_locktarget
-
- Generic target locking.
-
- Figure out if what target is "locked" (if any), for missile tracking as such.
-
- after calling, "if(self.lock_target != world && self.lock_strength == 1)" mean
- you have a locked in target.
-
- Exspects a crosshair_trace() or equivalent to be
- dont before calling.
-
-**/
-.entity lock_target;
-.float lock_strength;
-.float lock_time;
-.float lock_soundtime;
-const float DAMAGE_TARGETDRONE = 10;
-
-vector targetdrone_getnewspot()
-{
-
- vector spot;
- float i;
- for(i = 0; i < 100; ++i)
- {
- spot = self.origin + randomvec() * 1024;
- tracebox(spot, self.mins, self.maxs, spot, MOVE_NORMAL, self);
- if(trace_fraction == 1.0 && trace_startsolid == 0 && trace_allsolid == 0)
- return spot;
- }
- return self.origin;
-}
-
-#if 0
-void targetdrone_think();
-void targetdrone_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force);
-void targetdrone_renwe()
-{
- self.think = targetdrone_think;
- self.nextthink = time + 0.1;
- setorigin(self, targetdrone_getnewspot());
- self.health = 200;
- self.takedamage = DAMAGE_TARGETDRONE;
- self.event_damage = targetdrone_damage;
- self.solid = SOLID_BBOX;
- setmodel(self, "models/runematch/rune.mdl");
- self.effects = EF_LOWPRECISION;
- self.scale = 10;
- self.movetype = MOVETYPE_BOUNCEMISSILE;
- setsize(self, '-100 -100 -100', '100 100 100');
-
-}
-void targetdrone_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
-{
- self.health -= damage;
- if(self.health <= 0)
- {
- pointparticles(particleeffectnum("explosion_medium"), self.origin, '0 0 0', 1);
-
- if(!self.cnt)
- remove(self);
- else
- {
- self.think = targetdrone_renwe;
- self.nextthink = time + 1 + random() * 2;
- self.solid = SOLID_NOT;
- setmodel(self, "");
- }
- }
-}
-entity targetdrone_getfear()
-{
- entity fear;
- float i;
-
- for(i = 64; i <= 1024; i += 64)
- {
- fear = findradius(self.origin, i);
- while(fear)
- {
- if(fear.bot_dodge)
- return fear;
-
- fear = fear.chain;
- }
- }
-
- return world;
-}
-void targetdrone_think()
-{
- self.nextthink = time + 0.1;
-
- if(self.wp00)
- if(self.wp00.deadflag != DEAD_NO)
- self.wp00 = targetdrone_getfear();
-
- if(!self.wp00)
- self.wp00 = targetdrone_getfear();
-
- vector newdir;
-
- if(self.wp00)
- newdir = steerlib_push(self.wp00.origin) + randomvec() * 0.75;
- else
- newdir = randomvec() * 0.75;
-
- newdir = newdir * 0.5 + normalize(self.velocity) * 0.5;
-
- if(self.wp00)
- self.velocity = normalize(newdir) * (500 + (1024 / min(vlen(self.wp00.origin - self.origin), 1024)) * 700);
- else
- self.velocity = normalize(newdir) * 750;
-
- tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 2, MOVE_NORMAL, self);
- if(trace_fraction != 1.0)
- self.velocity = self.velocity * -1;
-
- //normalize((normalize(self.velocity) * 0.5 + newdir * 0.5)) * 750;
-}
-
-void targetdrone_spawn(vector _where, float _autorenew)
-{
- entity drone = spawn();
- setorigin(drone, _where);
- drone.think = targetdrone_renwe;
- drone.nextthink = time + 0.1;
- drone.cnt = _autorenew;
-}
-#endif
-
-void vehicles_locktarget(float incr, float decr, float _lock_time)
-{
- if(self.lock_target && self.lock_target.deadflag != DEAD_NO)
- {
- self.lock_target = world;
- self.lock_strength = 0;
- self.lock_time = 0;
- }
-
- if(self.lock_time > time)
- {
- if(self.lock_target)
- if(self.lock_soundtime < time)
- {
- self.lock_soundtime = time + 0.5;
- play2(self.owner, "vehicles/locked.wav");
- }
-
- return;
- }
-
- if(trace_ent != world)
- {
- if(teamplay && trace_ent.team == self.team)
- trace_ent = world;
-
- if(trace_ent.deadflag != DEAD_NO)
- trace_ent = world;
-
- if(!trace_ent.vehicle_flags & VHF_ISVEHICLE ||
- trace_ent.turrcaps_flags & TFL_TURRCAPS_ISTURRET ||
- trace_ent.takedamage == DAMAGE_TARGETDRONE)
- trace_ent = world;
- }
-
- if(self.lock_target == world && trace_ent != world)
- self.lock_target = trace_ent;
-
- if(self.lock_target && trace_ent == self.lock_target)
- {
- if(self.lock_strength != 1 && self.lock_strength + incr >= 1)
- {
- play2(self.owner, "vehicles/lock.wav");
- self.lock_soundtime = time + 0.8;
- }
- else if (self.lock_strength != 1 && self.lock_soundtime < time)
- {
- play2(self.owner, "vehicles/locking.wav");
- self.lock_soundtime = time + 0.3;
- }
-
- }
-
- // Have a locking target
- // Trace hit current target
- if(trace_ent == self.lock_target && trace_ent != world)
- {
- self.lock_strength = min(self.lock_strength + incr, 1);
- if(self.lock_strength == 1)
- self.lock_time = time + _lock_time;
- }
- else
- {
- if(trace_ent)
- self.lock_strength = max(self.lock_strength - decr * 2, 0);
- else
- self.lock_strength = max(self.lock_strength - decr, 0);
-
- if(self.lock_strength == 0)
- self.lock_target = world;
- }
-}
-
-#define VEHICLE_UPDATE_PLAYER(ply,fld,vhname) \
-ply.vehicle_##fld = (self.vehicle_##fld / autocvar_g_vehicle_##vhname##_##fld) * 100
-
-#define vehicles_sweap_collision(orig,vel,dt,acm,mult) \
-traceline(orig, orig + vel * dt, MOVE_NORMAL, self); \
-if(trace_fraction != 1) \
- acm += normalize(self.origin - trace_endpos) * (vlen(vel) * mult)
-
-// Hover movement support
-float force_fromtag_power;
-float force_fromtag_normpower;
-vector force_fromtag_origin;
-vector vehicles_force_fromtag_hover(string tag_name, float spring_length, float max_power)
-{
- force_fromtag_origin = gettaginfo(self, gettagindex(self, tag_name));
- v_forward = normalize(v_forward) * -1;
- traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, self);
-
- force_fromtag_power = (1 - trace_fraction) * max_power;
- force_fromtag_normpower = force_fromtag_power / max_power;
-
- return v_forward * force_fromtag_power;
-}
-
-// Experimental hovermode wich uses attraction/repulstion from surface insted of gravity/repulsion
-// Can possibly be use to move abt any surface (inclusing walls/celings)
-vector vehicles_force_fromtag_maglev(string tag_name, float spring_length, float max_power)
-{
-
- force_fromtag_origin = gettaginfo(self, gettagindex(self, tag_name));
- v_forward = normalize(v_forward) * -1;
- traceline(force_fromtag_origin, force_fromtag_origin - (v_forward * spring_length), MOVE_NORMAL, self);
-
- // TODO - this may NOT be compatible with wall/celing movement, unhardcode 0.25 (engine count multiplier)
- if(trace_fraction == 1.0)
- {
- force_fromtag_normpower = -0.25;
- return '0 0 -200';
- }
-
- force_fromtag_power = ((1 - trace_fraction) - trace_fraction) * max_power;
- force_fromtag_normpower = force_fromtag_power / max_power;
-
- return v_forward * force_fromtag_power;
-}
-
-// Generic vehile projectile system
-void vehicles_projectile_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
-{
- // Ignore damage from oterh projectiles from my owner (dont mess up volly's)
- if(inflictor.owner == self.owner)
- return;
-
- self.health -= damage;
- self.velocity += force;
- if(self.health < 1)
- {
- self.takedamage = DAMAGE_NO;
- self.event_damage = func_null;
- self.think = self.use;
- self.nextthink = time;
- }
-}
-
-void vehicles_projectile_explode()
-{
- if(self.owner && other != world)
- {
- if(other == self.owner.vehicle)
- return;
-
- if(other == self.owner.vehicle.tur_head)
- return;
- }
-
- PROJECTILE_TOUCH;
-
- self.event_damage = func_null;
- RadiusDamage (self, self.realowner, self.shot_dmg, 0, self.shot_radius, self, world, self.shot_force, self.totalfrags, other);
-
- remove (self);
-}
-
-entity vehicles_projectile(string _mzlfx, string _mzlsound,
- vector _org, vector _vel,
- float _dmg, float _radi, float _force, float _size,
- float _deahtype, float _projtype, float _health,
- float _cull, float _clianim, entity _owner)
-{
- entity proj;
-
- proj = spawn();
-
- PROJECTILE_MAKETRIGGER(proj);
- setorigin(proj, _org);
-
- proj.shot_dmg = _dmg;
- proj.shot_radius = _radi;
- proj.shot_force = _force;
- proj.totalfrags = _deahtype;
- proj.solid = SOLID_BBOX;
- proj.movetype = MOVETYPE_FLYMISSILE;
- proj.flags = FL_PROJECTILE;
- proj.bot_dodge = true;
- proj.bot_dodgerating = _dmg;
- proj.velocity = _vel;
- proj.touch = vehicles_projectile_explode;
- proj.use = vehicles_projectile_explode;
- proj.owner = self;
- proj.realowner = _owner;
- proj.think = SUB_Remove;
- proj.nextthink = time + 30;
-
- if(_health)
- {
- proj.takedamage = DAMAGE_AIM;
- proj.event_damage = vehicles_projectile_damage;
- proj.health = _health;
- }
- else
- proj.flags = FL_PROJECTILE | FL_NOTARGET;
-
- if(_mzlsound)
- sound (self, CH_WEAPON_A, _mzlsound, VOL_BASE, ATTEN_NORM);
-
- if(_mzlfx)
- pointparticles(particleeffectnum(_mzlfx), proj.origin, proj.velocity, 1);
-
-
- setsize (proj, '-1 -1 -1' * _size, '1 1 1' * _size);
-
- CSQCProjectile(proj, _clianim, _projtype, _cull);
-
- return proj;
-}
-// End generic vehile projectile system
-
-void vehicles_reset()
-{
- if(self.owner)
- {
- entity oldself = self;
- self = self.owner;
- vehicles_exit(VHEF_RELESE);
- self = oldself;
- }
- self.alpha = -1;
- self.movetype = MOVETYPE_NONE;
- self.effects = EF_NODRAW;
- self.colormod = '0 0 0';
- self.avelocity = '0 0 0';
- self.velocity = '0 0 0';
- self.event_damage = func_null;
- self.solid = SOLID_NOT;
- self.deadflag = DEAD_NO;
-
- self.touch = func_null;
- self.nextthink = 0;
- vehicles_setreturn();
-}
-
-/** vehicles_spawn
- Exetuted for all vehicles on (re)spawn.
- Sets defaults for newly spawned units.
-**/
-void vehicles_spawn()
-{
- dprint("Spawning vehicle: ", self.netname, "\n");
-
- // De-own & reset
- self.vehicle_hudmodel.viewmodelforclient = self;
-
- self.owner = world;
- self.touch = vehicles_touch;
- self.event_damage = vehicles_damage;
- self.reset = vehicles_reset;
- self.iscreature = true;
- self.teleportable = false; // no teleporting for vehicles, too buggy
- self.damagedbycontents = true;
- self.movetype = MOVETYPE_WALK;
- self.solid = SOLID_SLIDEBOX;
- self.takedamage = DAMAGE_AIM;
- self.deadflag = DEAD_NO;
- self.bot_attack = true;
- self.flags = FL_NOTARGET;
- self.avelocity = '0 0 0';
- self.velocity = '0 0 0';
-
- // Reset locking
- self.lock_strength = 0;
- self.lock_target = world;
- self.misc_bulletcounter = 0;
-
- // Return to spawn
- self.angles = self.pos2;
- setorigin(self, self.pos1 + '0 0 0');
- // Show it
- pointparticles(particleeffectnum("teleport"), self.origin + '0 0 64', '0 0 0', 1);
-
- if(self.vehicle_controller)
- self.team = self.vehicle_controller.team;
-
- vehicles_reset_colors();
- self.vehicle_spawn(VHSF_NORMAL);
-}
-
-// Better way of determening whats crushable needed! (fl_crushable?)
-float vehicles_crushable(entity e)
-{
- if(IS_PLAYER(e))
- return true;
-
- if(e.flags & FL_MONSTER)
- return true;
-
- return false;
-}
-
-void vehicles_impact(float _minspeed, float _speedfac, float _maxpain)
-{
- if (trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
- return;
-
- if(self.play_time < time)
- {
- float wc = vlen(self.velocity - self.oldvelocity);
- //dprint("oldvel: ", vtos(self.oldvelocity), "\n");
- //dprint("vel: ", vtos(self.velocity), "\n");
- if(_minspeed < wc)
- {
- float take = min(_speedfac * wc, _maxpain);
- Damage (self, world, world, take, DEATH_FALL, self.origin, '0 0 0');
- self.play_time = time + 0.25;
-
- //dprint("wc: ", ftos(wc), "\n");
- //dprint("take: ", ftos(take), "\n");
- }
- }
-}
-
-.void() vehicle_impact;
-void vehicles_touch()
-{
- if(MUTATOR_CALLHOOK(VehicleTouch))
- return;
-
- // Vehicle currently in use
- if(self.owner)
- {
- if(other != world)
- if(vehicles_crushable(other))
- {
- if(vlen(self.velocity) != 0)
- Damage(other, self, self.owner, autocvar_g_vehicles_crush_dmg, DEATH_VH_CRUSH, '0 0 0', normalize(other.origin - self.origin) * autocvar_g_vehicles_crush_force);
-
- return; // Dont do selfdamage when hitting "soft targets".
- }
-
- if(self.play_time < time)
- if(self.vehicle_impact)
- self.vehicle_impact();
-
- return;
- }
-
- if (!IS_PLAYER(other))
- return;
-
- if(other.deadflag != DEAD_NO)
- return;
-
- if(other.vehicle != world)
- return;
-
- vehicles_enter();
-}
-float autocvar_g_vehicles_allow_bots = 0;
-void vehicles_enter()
-{
- // Remove this when bots know how to use vehicles
-
- if (IS_BOT_CLIENT(other))
- if (autocvar_g_vehicles_allow_bots)
- dprint("Bot enters vehicle\n"); // This is where we need to disconnect (some, all?) normal bot AI and hand over to vehicle's _aiframe()
- else
- return;
-
- if(self.phase > time)
- return;
- if(other.frozen)
- return;
- if(other.vehicle)
- return;
- if(other.deadflag != DEAD_NO)
- return;
-
- if(teamplay)
- if(self.team)
- if(self.team != other.team)
- return;
-
- RemoveGrapplingHook(other);
-
- self.vehicle_ammo1 = 0;
- self.vehicle_ammo2 = 0;
- self.vehicle_reload1 = 0;
- self.vehicle_reload2 = 0;
- self.vehicle_energy = 0;
-
- self.owner = other;
- self.switchweapon = other.switchweapon;
-
- // .viewmodelforclient works better.
- //self.vehicle_hudmodel.drawonlytoclient = self.owner;
-
- self.vehicle_hudmodel.viewmodelforclient = self.owner;
-
- self.event_damage = vehicles_damage;
- self.nextthink = 0;
- self.owner.angles = self.angles;
- self.owner.takedamage = DAMAGE_NO;
- self.owner.solid = SOLID_NOT;
- self.owner.movetype = MOVETYPE_NOCLIP;
- self.owner.alpha = -1;
- self.owner.vehicle = self;
- self.owner.event_damage = func_null;
- self.owner.view_ofs = '0 0 0';
- self.colormap = self.owner.colormap;
- if(self.tur_head)
- self.tur_head.colormap = self.owner.colormap;
-
- self.owner.hud = self.hud;
- self.owner.PlayerPhysplug = self.PlayerPhysplug;
-
- self.owner.vehicle_ammo1 = self.vehicle_ammo1;
- self.owner.vehicle_ammo2 = self.vehicle_ammo2;
- self.owner.vehicle_reload1 = self.vehicle_reload1;
- self.owner.vehicle_reload2 = self.vehicle_reload2;
-
- // Cant do this, hides attached objects too.
- //self.exteriormodeltoclient = self.owner;
- //self.tur_head.exteriormodeltoclient = self.owner;
-
- other.flags &= ~FL_ONGROUND;
- self.flags &= ~FL_ONGROUND;
-
- self.team = self.owner.team;
- self.flags -= FL_NOTARGET;
- self.monster_attack = true;
-
- if (IS_REAL_CLIENT(other))
- {
- msg_entity = other;
- WriteByte (MSG_ONE, SVC_SETVIEWPORT);
- WriteEntity(MSG_ONE, self.vehicle_viewport);
-
- WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
- if(self.tur_head)
- {
- WriteAngle(MSG_ONE, self.tur_head.angles.x + self.angles.x); // tilt
- WriteAngle(MSG_ONE, self.tur_head.angles.y + self.angles.y); // yaw
- WriteAngle(MSG_ONE, 0); // roll
- }
- else
- {
- WriteAngle(MSG_ONE, self.angles.x * -1); // tilt
- WriteAngle(MSG_ONE, self.angles.y); // yaw
- WriteAngle(MSG_ONE, 0); // roll
- }
- }
-
- vehicles_clearreturn();
-
- CSQCVehicleSetup(self.owner, self.hud);
-
- vh_player = other;
- vh_vehicle = self;
- MUTATOR_CALLHOOK(VehicleEnter);
- other = vh_player;
- self = vh_vehicle;
-
- self.vehicle_enter();
- antilag_clear(other);
-}
-
-/** vehicles_findgoodexit
- Locates a valid location for the player to exit the vehicle.
- Will first try prefer_spot, then up 100 random spots arround the vehicle
- wich are in direct line of sight and empty enougth to hold a players bbox
-**/
-vector vehicles_findgoodexit(vector prefer_spot)
-{
- //vector exitspot;
- float mysize;
-
- tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, prefer_spot, MOVE_NORMAL, self.owner);
- if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
- return prefer_spot;
-
- mysize = 1.5 * vlen(self.maxs - self.mins);
- float i;
- vector v, v2;
- v2 = 0.5 * (self.absmin + self.absmax);
- for(i = 0; i < 100; ++i)
- {
- v = randomvec();
- v.z = 0;
- v = v2 + normalize(v) * mysize;
- tracebox(v2, PL_MIN, PL_MAX, v, MOVE_NORMAL, self.owner);
- if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
- return v;
- }
-
- /*
- exitspot = (self.origin + '0 0 48') + v_forward * mysize;
- tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
- if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
- return exitspot;
-
- exitspot = (self.origin + '0 0 48') - v_forward * mysize;
- tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
- if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
- return exitspot;
-
- exitspot = (self.origin + '0 0 48') + v_right * mysize;
- tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
- if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
- return exitspot;
-
- exitspot = (self.origin + '0 0 48') - v_right * mysize;
- tracebox(self.origin + '0 0 32', PL_MIN, PL_MAX, exitspot, MOVE_NORMAL, self.owner);
- if(trace_fraction == 1.0 && !trace_startsolid && !trace_allsolid)
- return exitspot;
- */
-
- return self.origin;
-}
-
-/** vehicles_exit
- Standarrd vehicle release fucntion.
- custom code goes in self.vehicle_exit
-**/
-float vehicles_exit_running;
-void vehicles_exit(float eject)
-{
- entity _vehicle;
- entity _player;
- entity _oldself = self;
-
- if(vehicles_exit_running)
- {
- dprint("^1vehicles_exit allready running! this is not good..\n");
- return;
- }
-
- vehicles_exit_running = true;
- if(IS_CLIENT(self))
- {
- _vehicle = self.vehicle;
-
- if (_vehicle.vehicle_flags & VHF_PLAYERSLOT)
- {
- _vehicle.vehicle_exit(eject);
- self = _oldself;
- vehicles_exit_running = false;
- return;
- }
- }
- else
- _vehicle = self;
-
- _player = _vehicle.owner;
-
- self = _vehicle;
-
- if (_player)
- {
- if (IS_REAL_CLIENT(_player))
- {
- msg_entity = _player;
- WriteByte (MSG_ONE, SVC_SETVIEWPORT);
- WriteEntity( MSG_ONE, _player);
-
- WriteByte (MSG_ONE, SVC_SETVIEWANGLES);
- WriteAngle(MSG_ONE, 0);
- WriteAngle(MSG_ONE, _vehicle.angles.y);
- WriteAngle(MSG_ONE, 0);
- }
-
- setsize(_player, PL_MIN,PL_MAX);
-
- _player.takedamage = DAMAGE_AIM;
- _player.solid = SOLID_SLIDEBOX;
- _player.movetype = MOVETYPE_WALK;
- _player.effects &= ~EF_NODRAW;
- _player.alpha = 1;
- _player.PlayerPhysplug = func_null;
- _player.vehicle = world;
- _player.view_ofs = PL_VIEW_OFS;
- _player.event_damage = PlayerDamage;
- _player.hud = HUD_NORMAL;
- _player.switchweapon = _vehicle.switchweapon;
-
- CSQCVehicleSetup(_player, HUD_NORMAL);
- }
- _vehicle.flags |= FL_NOTARGET;
-
- if(_vehicle.deadflag == DEAD_NO)
- _vehicle.avelocity = '0 0 0';
-
- _vehicle.tur_head.nodrawtoclient = world;
-
- if(!teamplay)
- _vehicle.team = 0;
-
- vh_player = _player;
- vh_vehicle = _vehicle;
- MUTATOR_CALLHOOK(VehicleExit);
- _player = vh_player;
- _vehicle = vh_vehicle;
-
- _vehicle.team = _vehicle.tur_head.team;
-
- sound (_vehicle, CH_TRIGGER_SINGLE, "misc/null.wav", 1, ATTEN_NORM);
- _vehicle.vehicle_hudmodel.viewmodelforclient = _vehicle;
- _vehicle.phase = time + 1;
- _vehicle.monster_attack = false;
-
- _vehicle.vehicle_exit(eject);
-
- vehicles_setreturn();
- vehicles_reset_colors();
- _vehicle.owner = world;
- self = _oldself;
-
- vehicles_exit_running = false;
-}
-
-
-void vehicles_regen(float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale)
-{
- if(self.regen_field < field_max)
- if(timer + rpause < time)
- {
- if(_healthscale)
- regen = regen * (self.vehicle_health / self.tur_health);
-
- self.regen_field = min(self.regen_field + regen * delta_time, field_max);
-
- if(self.owner)
- self.owner.regen_field = (self.regen_field / field_max) * 100;
- }
-}
-
-void shieldhit_think()
-{
- self.alpha -= 0.1;
- if (self.alpha <= 0)
- {
- //setmodel(self, "");
- self.alpha = -1;
- self.effects |= EF_NODRAW;
- }
- else
- {
- self.nextthink = time + 0.1;
- }
-}
-
-void vehicles_painframe()
-{
- if(self.owner.vehicle_health <= 50)
- if(self.pain_frame < time)
- {
- float _ftmp;
- _ftmp = self.owner.vehicle_health / 50;
- self.pain_frame = time + 0.1 + (random() * 0.5 * _ftmp);
- pointparticles(particleeffectnum("smoke_small"), (self.origin + (randomvec() * 80)), '0 0 0', 1);
-
- if(self.vehicle_flags & VHF_DMGSHAKE)
- self.velocity += randomvec() * 30;
-
- if(self.vehicle_flags & VHF_DMGROLL)
- if(self.vehicle_flags & VHF_DMGHEADROLL)
- self.tur_head.angles += randomvec();
- else
- self.angles += randomvec();
-
- }
-}
-
-void vehicles_damage(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
-{
- self.dmg_time = time;
-
- // WEAPONTODO
- if(DEATH_ISWEAPON(deathtype, WEP_VORTEX))
- damage *= autocvar_g_vehicles_vortex_damagerate;
-
- if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN))
- damage *= autocvar_g_vehicles_machinegun_damagerate;
-
- if(DEATH_ISWEAPON(deathtype, WEP_RIFLE))
- damage *= autocvar_g_vehicles_rifle_damagerate;
-
- if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
- damage *= autocvar_g_vehicles_vaporizer_damagerate;
-
- if(DEATH_ISWEAPON(deathtype, WEP_SEEKER))
- damage *= autocvar_g_vehicles_tag_damagerate;
-
- self.enemy = attacker;
-
- if((self.vehicle_flags & VHF_HASSHIELD) && (self.vehicle_shield > 0))
- {
- if (wasfreed(self.vehicle_shieldent) || self.vehicle_shieldent == world)
- {
- self.vehicle_shieldent = spawn();
- self.vehicle_shieldent.effects = EF_LOWPRECISION;
-
- setmodel(self.vehicle_shieldent, "models/vhshield.md3");
- setattachment(self.vehicle_shieldent, self, "");
- setorigin(self.vehicle_shieldent, real_origin(self) - self.origin);
- self.vehicle_shieldent.scale = 256 / vlen(self.maxs - self.mins);
- self.vehicle_shieldent.think = shieldhit_think;
- }
-
- self.vehicle_shieldent.colormod = '1 1 1';
- self.vehicle_shieldent.alpha = 0.45;
- self.vehicle_shieldent.angles = vectoangles(normalize(hitloc - (self.origin + self.vehicle_shieldent.origin))) - self.angles;
- self.vehicle_shieldent.nextthink = time;
- self.vehicle_shieldent.effects &= ~EF_NODRAW;
-
- self.vehicle_shield -= damage;
-
- if(self.vehicle_shield < 0)
- {
- self.vehicle_health -= fabs(self.vehicle_shield);
- self.vehicle_shieldent.colormod = '2 0 0';
- self.vehicle_shield = 0;
- self.vehicle_shieldent.alpha = 0.75;
-
- if(sound_allowed(MSG_BROADCAST, attacker))
- spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER
- }
- else
- if(sound_allowed(MSG_BROADCAST, attacker))
- spamsound (self, CH_PAIN, "onslaught/electricity_explode.wav", VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER
-
- }
- else
- {
- self.vehicle_health -= damage;
-
- if(sound_allowed(MSG_BROADCAST, attacker))
- spamsound (self, CH_PAIN, "onslaught/ons_hit2.wav", VOL_BASE, ATTEN_NORM); // FIXME: PLACEHOLDER
- }
-
- if(self.damageforcescale < 1 && self.damageforcescale > 0)
- self.velocity += force * self.damageforcescale;
- else
- self.velocity += force;
-
- if(self.vehicle_health <= 0)
- {
- if(self.owner)
- if(self.vehicle_flags & VHF_DEATHEJECT)
- vehicles_exit(VHEF_EJECT);
- else
- vehicles_exit(VHEF_RELESE);
-
-
- antilag_clear(self);
-
- self.vehicle_die();
- vehicles_setreturn();
- }
-}
-
-void vehicles_clearreturn()
-{
- entity ret;
- // Remove "return helper", if any.
- ret = findchain(classname, "vehicle_return");
- while(ret)
- {
- if(ret.wp00 == self)
- {
- ret.classname = "";
- ret.think = SUB_Remove;
- ret.nextthink = time + 0.1;
-
- if(ret.waypointsprite_attached)
- WaypointSprite_Kill(ret.waypointsprite_attached);
-
- return;
- }
- ret = ret.chain;
- }
-}
-
-void vehicles_return()
-{
- pointparticles(particleeffectnum("teleport"), self.wp00.origin + '0 0 64', '0 0 0', 1);
-
- self.wp00.think = vehicles_spawn;
- self.wp00.nextthink = time;
-
- if(self.waypointsprite_attached)
- WaypointSprite_Kill(self.waypointsprite_attached);
-
- remove(self);
-}
-
-void vehicles_showwp_goaway()
-{
- if(self.waypointsprite_attached)
- WaypointSprite_Kill(self.waypointsprite_attached);
-
- remove(self);
-
-}
-
-void vehicles_showwp()
-{
- entity oldself = world;
- vector rgb;
-
- if(self.cnt)
- {
- self.think = vehicles_return;
- self.nextthink = self.cnt;
- }
- else
- {
- self.think = vehicles_return;
- self.nextthink = time +1;
-
- oldself = self;
- self = spawn();
- setmodel(self, "null");
- self.team = oldself.wp00.team;
- self.wp00 = oldself.wp00;
- setorigin(self, oldself.wp00.pos1);
-
- self.nextthink = time + 5;
- self.think = vehicles_showwp_goaway;
- }
-
- if(teamplay && self.team)
- rgb = Team_ColorRGB(self.team);
- else
- rgb = '1 1 1';
- WaypointSprite_Spawn("vehicle", 0, 0, self, '0 0 64', world, 0, self, waypointsprite_attached, true, RADARICON_POWERUP, rgb);
- if(self.waypointsprite_attached)
- {
- WaypointSprite_UpdateRule(self.waypointsprite_attached, self.wp00.team, SPRITERULE_DEFAULT);
- if(oldself == world)
- WaypointSprite_UpdateBuildFinished(self.waypointsprite_attached, self.nextthink);
- WaypointSprite_Ping(self.waypointsprite_attached);
- }
-
- if(oldself != world)
- self = oldself;
-}
-
-void vehicles_setreturn()
-{
- entity ret;
-
- vehicles_clearreturn();
-
- ret = spawn();
- ret.classname = "vehicle_return";
- ret.wp00 = self;
- ret.team = self.team;
- ret.think = vehicles_showwp;
-
- if(self.deadflag != DEAD_NO)
- {
- ret.cnt = max(game_starttime, time) + self.vehicle_respawntime;
- ret.nextthink = max(game_starttime, time) + max(0, self.vehicle_respawntime - 5);
- }
- else
- ret.nextthink = max(game_starttime, time) + max(0, self.vehicle_respawntime - 1);
-
- setmodel(ret, "null");
- setorigin(ret, self.pos1 + '0 0 96');
-}
-
-void vehicles_reset_colors()
-{
- entity e;
- float _effects = 0, _colormap;
- vector _glowmod, _colormod;
-
- if(autocvar_g_nodepthtestplayers)
- _effects |= EF_NODEPTHTEST;
-
- if(autocvar_g_fullbrightplayers)
- _effects |= EF_FULLBRIGHT;
-
- if(self.team)
- _colormap = 1024 + (self.team - 1) * 17;
- else
- _colormap = 1024;
-
- _glowmod = '0 0 0';
- _colormod = '0 0 0';
-
- // Find all ents attacked to main model and setup effects, colormod etc.
- e = findchainentity(tag_entity, self);
- while(e)
- {
- if(e != self.vehicle_shieldent)
- {
- e.effects = _effects; // | EF_LOWPRECISION;
- e.colormod = _colormod;
- e.colormap = _colormap;
- e.alpha = 1;
- }
- e = e.chain;
- }
-
- self.vehicle_hudmodel.effects = self.effects = _effects; // | EF_LOWPRECISION;
- self.vehicle_hudmodel.colormod = self.colormod = _colormod;
- self.vehicle_hudmodel.colormap = self.colormap = _colormap;
- self.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
-
- self.alpha = 1;
- self.avelocity = '0 0 0';
- self.velocity = '0 0 0';
- self.effects = _effects;
-}
-
-void vehicle_use()
-{
- dprint("vehicle ",self.netname, " used by ", activator.classname, "\n");
-
- self.tur_head.team = activator.team;
-
- if(self.tur_head.team == 0)
- self.active = ACTIVE_NOT;
- else
- self.active = ACTIVE_ACTIVE;
-
- if(self.active == ACTIVE_ACTIVE && self.deadflag == DEAD_NO)
- {
- dprint("^3Eat shit yall!\n");
- vehicles_setreturn();
- vehicles_reset_colors();
- }
- else if(self.active == ACTIVE_NOT && self.deadflag != DEAD_NO)
- {
-
- }
-}
-
-float vehicle_addplayerslot( entity _owner,
- entity _slot,
- float _hud,
- string _hud_model,
- float() _framefunc,
- void(float) _exitfunc)
-{
- if (!(_owner.vehicle_flags & VHF_MULTISLOT))
- _owner.vehicle_flags |= VHF_MULTISLOT;
-
- _slot.PlayerPhysplug = _framefunc;
- _slot.vehicle_exit = _exitfunc;
- _slot.hud = _hud;
- _slot.vehicle_flags = VHF_PLAYERSLOT;
- _slot.vehicle_viewport = spawn();
- _slot.vehicle_hudmodel = spawn();
- _slot.vehicle_hudmodel.viewmodelforclient = _slot;
- _slot.vehicle_viewport.effects = (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT);
-
- setmodel(_slot.vehicle_hudmodel, _hud_model);
- setmodel(_slot.vehicle_viewport, "null");
-
- setattachment(_slot.vehicle_hudmodel, _slot, "");
- setattachment(_slot.vehicle_viewport, _slot.vehicle_hudmodel, "");
-
- return true;
-}
-
-float vehicle_initialize(string net_name,
- string bodymodel,
- string topmodel,
- string hudmodel,
- string toptag,
- string hudtag,
- string viewtag,
- float vhud,
- vector min_s,
- vector max_s,
- float nodrop,
- void(float _spawnflag) spawnproc,
- float _respawntime,
- float() physproc,
- void() enterproc,
- void(float extflag) exitfunc,
- void() dieproc,
- void() thinkproc,
- float use_csqc,
- float _max_health,
- float _max_shield)
-{
- if(!autocvar_g_vehicles)
- return false;
-
- if(self.targetname)
- {
- self.vehicle_controller = find(world, target, self.targetname);
- if(!self.vehicle_controller)
- {
- bprint("^1WARNING: ^7Vehicle with invalid .targetname\n");
- }
- else
- {
- self.team = self.vehicle_controller.team;
- self.use = vehicle_use;
-
- if(teamplay)
- {
- if(self.vehicle_controller.team == 0)
- self.active = ACTIVE_NOT;
- else
- self.active = ACTIVE_ACTIVE;
- }
- }
- }
-
- precache_sound("onslaught/ons_hit2.wav");
- precache_sound("onslaught/electricity_explode.wav");
-
-
- addstat(STAT_HUD, AS_INT, hud);
- addstat(STAT_VEHICLESTAT_HEALTH, AS_INT, vehicle_health);
- addstat(STAT_VEHICLESTAT_SHIELD, AS_INT, vehicle_shield);
- addstat(STAT_VEHICLESTAT_ENERGY, AS_INT, vehicle_energy);
-
- addstat(STAT_VEHICLESTAT_AMMO1, AS_INT, vehicle_ammo1);
- addstat(STAT_VEHICLESTAT_RELOAD1, AS_INT, vehicle_reload1);
-
- addstat(STAT_VEHICLESTAT_AMMO2, AS_INT, vehicle_ammo2);
- addstat(STAT_VEHICLESTAT_RELOAD2, AS_INT, vehicle_reload2);
-
- if(bodymodel == "")
- error("vehicles: missing bodymodel!");
-
- if(hudmodel == "")
- error("vehicles: missing hudmodel!");
-
- if(net_name == "")
- self.netname = self.classname;
- else
- self.netname = net_name;
-
- if(self.team && !teamplay)
- self.team = 0;
-
- self.vehicle_flags |= VHF_ISVEHICLE;
-
- setmodel(self, bodymodel);
-
- self.vehicle_viewport = spawn();
- self.vehicle_hudmodel = spawn();
- self.tur_head = spawn();
- self.tur_head.owner = self;
- self.takedamage = DAMAGE_AIM;
- self.bot_attack = true;
- self.iscreature = true;
- self.teleportable = false; // no teleporting for vehicles, too buggy
- self.damagedbycontents = true;
- self.hud = vhud;
- self.tur_health = _max_health;
- self.tur_head.tur_health = _max_shield;
- self.vehicle_die = dieproc;
- self.vehicle_exit = exitfunc;
- self.vehicle_enter = enterproc;
- self.PlayerPhysplug = physproc;
- self.event_damage = func_null;
- self.touch = vehicles_touch;
- self.think = vehicles_spawn;
- self.vehicle_spawn = spawnproc;
- self.vehicle_respawntime = max(0, _respawntime);
- self.effects = EF_NODRAW;
- self.dphitcontentsmask = DPCONTENTS_BODY | DPCONTENTS_SOLID;
- if(!autocvar_g_vehicles_delayspawn || !self.vehicle_respawntime)
- self.nextthink = time;
- else
- self.nextthink = max(time, game_starttime) + max(0, self.vehicle_respawntime + ((random() * 2 - 1) * autocvar_g_vehicles_delayspawn_jitter));
-
- if(autocvar_g_playerclip_collisions)
- self.dphitcontentsmask |= DPCONTENTS_PLAYERCLIP;
-
- if(autocvar_g_nodepthtestplayers)
- self.effects = self.effects | EF_NODEPTHTEST;
-
- if(autocvar_g_fullbrightplayers)
- self.effects = self.effects | EF_FULLBRIGHT;
-
- setmodel(self.vehicle_hudmodel, hudmodel);
- setmodel(self.vehicle_viewport, "null");
-
- if(topmodel != "")
- {
- setmodel(self.tur_head, topmodel);
- setattachment(self.tur_head, self, toptag);
- setattachment(self.vehicle_hudmodel, self.tur_head, hudtag);
- setattachment(self.vehicle_viewport, self.vehicle_hudmodel, viewtag);
- }
- else
- {
- setattachment(self.tur_head, self, "");
- setattachment(self.vehicle_hudmodel, self, hudtag);
- setattachment(self.vehicle_viewport, self.vehicle_hudmodel, viewtag);
- }
-
- setsize(self, min_s, max_s);
- if (!nodrop)
- {
- setorigin(self, self.origin);
- tracebox(self.origin + '0 0 100', min_s, max_s, self.origin - '0 0 10000', MOVE_WORLDONLY, self);
- setorigin(self, trace_endpos);
- }
-
- self.pos1 = self.origin;
- self.pos2 = self.angles;
- self.tur_head.team = self.team;
-
- if(MUTATOR_CALLHOOK(VehicleSpawn))
- return false;
-
- return true;
-}
-
-vector vehicle_aimturret(entity _vehic, vector _target, entity _turrret, string _tagname,
- float _pichlimit_min, float _pichlimit_max,
- float _rotlimit_min, float _rotlimit_max, float _aimspeed)
-{
- vector vtmp, vtag;
- float ftmp;
- vtag = gettaginfo(_turrret, gettagindex(_turrret, _tagname));
- vtmp = vectoangles(normalize(_target - vtag));
- vtmp = AnglesTransform_ToAngles(AnglesTransform_LeftDivide(AnglesTransform_FromAngles(_vehic.angles), AnglesTransform_FromAngles(vtmp))) - _turrret.angles;
- vtmp = AnglesTransform_Normalize(vtmp, true);
- ftmp = _aimspeed * frametime;
- vtmp.y = bound(-ftmp, vtmp.y, ftmp);
- vtmp.x = bound(-ftmp, vtmp.x, ftmp);
- _turrret.angles_y = bound(_rotlimit_min, _turrret.angles.y + vtmp.y, _rotlimit_max);
- _turrret.angles_x = bound(_pichlimit_min, _turrret.angles.x + vtmp.x, _pichlimit_max);
- return vtag;
-}
-
-void vehicles_gib_explode()
-{
- sound (self, CH_SHOTS, "weapons/rocket_impact.wav", VOL_BASE, ATTEN_NORM);
- pointparticles(particleeffectnum("explosion_small"), randomvec() * 80 + (self.origin + '0 0 100'), '0 0 0', 1);
- remove(self);
-}
-
-void vehicles_gib_think()
-{
- self.alpha -= 0.1;
- if(self.cnt >= time)
- remove(self);
- else
- self.nextthink = time + 0.1;
-}
-
-entity vehicle_tossgib(entity _template, vector _vel, string _tag, float _burn, float _explode, float _maxtime, vector _rot)
-{
- entity _gib = spawn();
- setmodel(_gib, _template.model);
- setorigin(_gib, gettaginfo(self, gettagindex(self, _tag)));
- _gib.velocity = _vel;
- _gib.movetype = MOVETYPE_TOSS;
- _gib.solid = SOLID_CORPSE;
- _gib.colormod = '-0.5 -0.5 -0.5';
- _gib.effects = EF_LOWPRECISION;
- _gib.avelocity = _rot;
-
- if(_burn)
- _gib.effects |= EF_FLAME;
-
- if(_explode)
- {
- _gib.think = vehicles_gib_explode;
- _gib.nextthink = time + random() * _explode;
- _gib.touch = vehicles_gib_explode;
- }
- else
- {
- _gib.cnt = time + _maxtime;
- _gib.think = vehicles_gib_think;
- _gib.nextthink = time + _maxtime - 1;
- _gib.alpha = 1;
- }
- return _gib;
-}
-
-/*
-vector predict_target(entity _targ, vector _from, float _shot_speed)
-{
- float i; // loop
- float _distance; // How far to target
- float _impact_time; // How long untill projectile impacts
- vector _predict_pos; // Predicted enemy location
- vector _original_origin;// Where target is before predicted
-
- _original_origin = real_origin(_targ); // Typicaly center of target BBOX
-
- _predict_pos = _original_origin;
- for(i = 0; i < 4; ++i) // Loop a few times to increase prediction accuracy (increase loop count if accuracy is to low)
- {
- _distance = vlen(_predict_pos - _from); // Get distance to previos predicted location
- _impact_time = _distance / _shot_speed; // Calculate impact time
- _predict_pos = _original_origin + _targ.velocity * _impact_time; // Calculate new predicted location
- }
-
- return _predict_pos;
-}
-*/
+++ /dev/null
-#ifndef VEHICLES_H
-#define VEHICLES_H
-
-#ifdef VEHICLES_ENABLED
-#include "vehicles.qc"
-
-#include "racer.qc"
-#include "spiderbot.qc"
-#include "raptor.qc"
-#ifndef VEHICLES_NO_UNSTABLE
-#include "bumblebee.qc"
-#endif
-#endif
-#endif
+++ /dev/null
-#ifndef VEHICLES_DEF_H
-#define VEHICLES_DEF_H
-
-#include "../tturrets/include/turrets_early.qh"
-
-// #define VEHICLES_USE_ODE
-#define VEHICLES_ENABLED
-#ifdef VEHICLES_ENABLED
-
-.int vehicle_flags;
-const int VHF_ISVEHICLE = 2; /// Indicates vehicle
-const int VHF_HASSHIELD = 4; /// Vehicle has shileding
-const int VHF_SHIELDREGEN = 8; /// Vehicles shield regenerates
-const int VHF_HEALTHREGEN = 16; /// Vehicles health regenerates
-const int VHF_ENERGYREGEN = 32; /// Vehicles energy regenerates
-const int VHF_DEATHEJECT = 64; /// Vehicle ejects pilot upon fatal damage
-const int VHF_MOVE_GROUND = 128; /// Vehicle moves on gound
-const int VHF_MOVE_HOVER = 256; /// Vehicle hover close to gound
-const int VHF_MOVE_FLY = 512; /// Vehicle is airborn
-const int VHF_DMGSHAKE = 1024; /// Add random velocity each frame if health < 50%
-const int VHF_DMGROLL = 2048; /// Add random angles each frame if health < 50%
-const int VHF_DMGHEADROLL = 4096; /// Add random head angles each frame if health < 50%
-const int VHF_MULTISLOT = 8192; /// Vehicle has multiple player slots
-const int VHF_PLAYERSLOT = 16384; /// This ent is a player slot on a multi-person vehicle
-
-.entity gun1;
-.entity gun2;
-.entity gun3;
-.entity vehicle_shieldent; /// Entity to disply the shild effect on damage
-.entity vehicle;
-.entity vehicle_viewport;
-.entity vehicle_hudmodel;
-.entity vehicle_controller;
-
-.entity gunner1;
-.entity gunner2;
-
-.float vehicle_health; /// If self is player this is 0..100 indicating precentage of health left on vehicle. If self is vehile, this is the real health value.
-.float vehicle_energy; /// If self is player this is 0..100 indicating precentage of energy left on vehicle. If self is vehile, this is the real energy value.
-.float vehicle_shield; /// If self is player this is 0..100 indicating precentage of shield left on vehicle. If self is vehile, this is the real shield value.
-
-.float vehicle_ammo1; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo1 value.
-.float vehicle_reload1; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload1 value.
-.float vehicle_ammo2; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real ammo2 value.
-.float vehicle_reload2; /// If self is player this field's use depends on the individual vehile. If self is vehile, this is the real reload2 value.
-
-.float sound_nexttime;
-const float VOL_VEHICLEENGINE = 1;
-
-.float hud;
-.float dmg_time;
-.float vehicle_respawntime;
-//.void() vehicle_spawn;
-
-void vehicles_exit(float eject);
-.void(float exit_flags) vehicle_exit;
-const float VHEF_NORMAL = 0; /// User pressed exit key
-const float VHEF_EJECT = 1; /// User pressed exit key 3 times fast (not implemented) or vehile is dying
-const float VHEF_RELESE = 2; /// Release ownership, client possibly allready dissconnected / went spec / changed team / used "kill" (not implemented)
-
-const float SVC_SETVIEWPORT = 5; // Net.Protocol 0x05
-const float SVC_SETVIEWANGLES = 10; // Net.Protocol 0x0A
-const float SVC_UPDATEENTITY = 128; // Net.Protocol 0x80
-
-.void() vehicle_enter; /// Vehicles custom funciton to be executed when owner exit it
-.void() vehicle_die; /// Vehicles custom function to be executed when vehile die
-const float VHSF_NORMAL = 0;
-const float VHSF_FACTORY = 2;
-.void(float _spawnflag) vehicle_spawn; /// Vehicles custom fucntion to be efecuted when vehicle (re)spawns
-.float(float _imp) vehicles_impulse;
-.float vehicle_weapon2mode = volly_counter;
-
-#ifdef VEHICLES_USE_ODE
-void(entity e, float physics_enabled) physics_enable = #540; // enable or disable physics on object
-void(entity e, vector force, vector force_pos) physics_addforce = #541; // apply a force from certain origin, length of force vector is power of force
-void(entity e, vector torque) physics_addtorque = #542; // add relative torque
-#endif // VEHICLES_USE_ODE
-#endif // VEHICLES_ENABLED
-#endif
wp.team = t;
wp.owner = own;
wp.currentammo = hideable;
- if(own)
+ if (own)
{
- if(own.ownfield)
- remove(own.ownfield);
- own.ownfield = wp;
+ if (own.(ownfield))
+ remove(own.(ownfield));
+ own.(ownfield) = wp;
wp.owned_by_field = ownfield;
}
wp.fade_rate = maxdistance;
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../common/constants.qh"
- #include "../../common/util.qh"
- #include "../../common/weapons/weapons.qh"
- #include "accuracy.qh"
- #include "../autocvars.qh"
- #include "../constants.qh"
- #include "../defs.qh"
- #include "../mutators/mutators_include.qh"
-#endif
+#include "accuracy.qh"
+#include "../_all.qh"
+
+#include "../mutators/mutators_include.qh"
+#include "../../common/constants.qh"
+#include "../../common/teams.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/weapons.qh"
float accuracy_byte(float n, float d)
{
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../common/constants.qh"
- #include "../../common/util.qh"
- #include "../../common/weapons/weapons.qh"
- #include "common.qh"
- #include "../t_items.qh"
- #include "../autocvars.qh"
- #include "../defs.qh"
- #include "../../common/notifications.qh"
- #include "../../common/deathtypes.qh"
-#endif
+#include "common.qh"
+#include "../_all.qh"
+
+#include "../t_items.qh"
+#include "../../common/constants.qh"
+#include "../../common/deathtypes.qh"
+#include "../../common/notifications.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/weapons.qh"
void W_GiveWeapon (entity e, float wep)
{
player.prevstrengthsoundattempt = time;
}
-float W_CheckProjectileDamage(entity inflictor, entity projowner, float deathtype, float exception)
+float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
{
float is_from_contents = (deathtype == DEATH_SLIME || deathtype == DEATH_LAVA);
float is_from_owner = (inflictor == projowner);
.float prevstrengthsound;
.float prevstrengthsoundattempt;
void W_PlayStrengthSound(entity player);
-float W_CheckProjectileDamage(entity inflictor, entity projowner, float deathtype, float exception);
+float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception);
void W_PrepareExplosionByDamage(entity attacker, void() explode);
#endif
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../common/constants.qh"
- #include "../../common/weapons/weapons.qh"
- #include "csqcprojectile.qh"
- #include "../t_items.qh"
- #include "../constants.qh"
- #include "../defs.qh"
- #include "../command/common.qh"
-#endif
+#include "csqcprojectile.qh"
+#include "../_all.qh"
+
+#include "../t_items.qh"
+
+#include "../command/common.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/weapons/weapons.qh"
.float csqcprojectile_type;
-float CSQCProjectile_SendEntity(entity to, int sf)
+bool CSQCProjectile_SendEntity(entity to, int sf)
{
float ft, fr;
if(sf & 2)
WriteByte(MSG_ENTITY, self.csqcprojectile_type); // TODO maybe put this into sf?
- return 1;
+ return true;
}
.vector csqcprojectile_oldorigin;
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../common/weapons/weapons.qh"
- #include "hitplot.qh"
- #include "../autocvars.qh"
- #include "../defs.qh"
- #include "../antilag.qh"
-#endif
+#include "hitplot.qh"
+#include "../_all.qh"
+
+#include "../antilag.qh"
+#include "../g_subs.qh"
+#include "../../common/weapons/weapons.qh"
vector W_HitPlotUnnormalizedUntransform(vector screenforward, vector screenright, vector screenup, vector v)
{
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../common/constants.qh"
- #include "../../common/util.qh"
- #include "../../common/weapons/weapons.qh"
- #include "selection.qh"
- #include "weaponsystem.qh"
- #include "../t_items.qh"
- #include "../autocvars.qh"
- #include "../defs.qh"
-#endif
+#include "selection.qh"
+#include "../_all.qh"
+
+#include "weaponsystem.qh"
+#include "../t_items.qh"
+#include "../waypointsprites.qh"
+#include "../../common/constants.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/weapons.qh"
// switch between weapons
void Send_WeaponComplain(entity e, float wpn, float type)
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../common/weapons/weapons.qh"
- #include "spawning.qh"
- #include "weaponsystem.qh"
- #include "../t_items.qh"
- #include "../autocvars.qh"
- #include "../constants.qh"
- #include "../defs.qh"
- #include "../mutators/mutators_include.qh"
-#endif
+#include "spawning.qh"
+#include "../_all.qh"
+
+#include "weaponsystem.qh"
+#include "../mutators/mutators_include.qh"
+#include "../t_items.qh"
+#include "../../common/weapons/weapons.qh"
string W_Apply_Weaponreplace(string in)
{
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../common/util.qh"
- #include "../../common/weapons/weapons.qh"
- #include "throwing.qh"
- #include "weaponsystem.qh"
- #include "../t_items.qh"
- #include "../autocvars.qh"
- #include "../constants.qh"
- #include "../defs.qh"
- #include "../../common/notifications.qh"
- #include "../mutators/mutators_include.qh"
- #include "../../common/mapinfo.qh"
-#endif
+#include "throwing.qh"
+#include "../_all.qh"
+
+#include "weaponsystem.qh"
+#include "../mutators/mutators_include.qh"
+#include "../t_items.qh"
+#include "../g_damage.qh"
+#include "../g_subs.qh"
+#include "../../common/mapinfo.qh"
+#include "../../common/notifications.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/weapons.qh"
void thrown_wep_think()
{
entity oldself, wep;
float thisammo, i;
string s;
- var .float ammotype = (get_weaponinfo(wpn)).ammo_field;
+ var .int ammotype = (get_weaponinfo(wpn)).ammo_field;
wep = spawn();
// if our weapon is loaded, give its load back to the player
if(self.(weapon_load[self.weapon]) > 0)
{
- own.ammotype += self.(weapon_load[self.weapon]);
+ own.(ammotype) += self.(weapon_load[self.weapon]);
self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
}
- wep.ammotype = 0;
+ wep.(ammotype) = 0;
}
else if(doreduce)
{
// if our weapon is loaded, give its load back to the player
if(self.(weapon_load[self.weapon]) > 0)
{
- own.ammotype += self.(weapon_load[self.weapon]);
+ own.(ammotype) += self.(weapon_load[self.weapon]);
self.(weapon_load[self.weapon]) = -1; // schedule the weapon for reloading
}
- thisammo = min(own.ammotype, wep.ammotype);
- wep.ammotype = thisammo;
- own.ammotype -= thisammo;
+ thisammo = min(own.(ammotype), wep.(ammotype));
+ wep.(ammotype) = thisammo;
+ own.(ammotype) -= thisammo;
switch(ammotype)
{
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../warpzonelib/common.qh"
- #include "../../common/constants.qh"
- #include "../../common/util.qh"
- #include "../../common/weapons/weapons.qh"
- #include "tracing.qh"
- #include "../autocvars.qh"
- #include "../defs.qh"
- #include "../antilag.qh"
-#endif
+#include "tracing.qh"
+#include "../_all.qh"
+
+#include "accuracy.qh"
+#include "common.qh"
+#include "hitplot.qh"
+
+#include "../g_damage.qh"
+#include "../g_subs.qh"
+#include "../antilag.qh"
+
+#include "../../common/constants.qh"
+#include "../../common/util.qh"
+
+#include "../../common/weapons/weapons.qh"
+
+#include "../../warpzonelib/common.qh"
// this function calculates w_shotorg and w_shotdir based on the weapon model
// offset, trueaim and antilag, and won't put w_shotorg inside a wall.
// Ballistics Tracing
// ====================
-void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, float deathtype)
+void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype)
{
vector hitloc, force, endpoint, dir;
entity ent, endent;
.float railgundistance;
.vector railgunforce;
-void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, float deathtype);
+void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, int deathtype);
float fireBullet_trace_callback_eff;
entity fireBullet_last_hit;
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../common/urllib.qh"
- #include "../../common/weapons/weapons.qh"
- #include "weaponstats.qh"
- #include "../autocvars.qh"
- #include "../defs.qh"
-#endif
+#include "weaponstats.qh"
+#include "../_all.qh"
+
+#include "../g_world.qh"
+
+#include "../../common/urllib.qh"
+#include "../../common/weapons/weapons.qh"
void WeaponStats_Init()
{
-#if defined(CSQC)
-#elif defined(MENUQC)
-#elif defined(SVQC)
- #include "../../dpdefs/progsdefs.qh"
- #include "../../dpdefs/dpextensions.qh"
- #include "../../common/constants.qh"
- #include "../../common/util.qh"
- #include "../../common/animdecide.qh"
- #include "../../common/monsters/monsters.qh"
- #include "../../common/weapons/weapons.qh"
- #include "weaponsystem.qh"
- #include "../t_items.qh"
- #include "../autocvars.qh"
- #include "../defs.qh"
- #include "../../common/notifications.qh"
- #include "../mutators/mutators_include.qh"
- #include "../command/common.qh"
- #include "../../csqcmodellib/sv_model.qh"
- #include "../round_handler.qh"
-#endif
+#include "weaponsystem.qh"
+#include "../_all.qh"
+
+#include "selection.qh"
+
+#include "../command/common.qh"
+#include "../mutators/mutators_include.qh"
+#include "../round_handler.qh"
+#include "../t_items.qh"
+#include "../../common/animdecide.qh"
+#include "../../common/constants.qh"
+#include "../../common/monsters/monsters.qh"
+#include "../../common/notifications.qh"
+#include "../../common/util.qh"
+#include "../../common/weapons/weapons.qh"
+#include "../../csqcmodellib/sv_model.qh"
/*
===========================================================================
--- /dev/null
+#!/bin/bash
+set -eu
+cd "$(dirname "$0")"
+cd ..
+
+declare -a NOWARN=(
+ '-Wno-field-redeclared'
+ '-Wno-unused-variable'
+ '-Wno-implicit-function-pointer'
+)
+declare -a FEATURES=(
+ '-DVEHICLES_ENABLED=1'
+ '-DVEHICLES_USE_ODE=0'
+)
+declare QCC=../../../gmqcc/gmqcc
+
+function check() {
+ declare -l base="$1"
+ declare -la predefs=("${!2}")
+ find "$base" -type f -name '*.qc' -print0 | sort -z | while IFS= read -r -d '' file; do
+ echo "$file"
+ ${QCC} -std=gmqcc -fftepp -fftepp-predefs -Werror -Wall "${NOWARN[@]}" "${FEATURES[@]}" -futf8 -O3 "${predefs[@]}" "$file" >/dev/null
+ done
+}
+
+clientdefs=("-DCSQC" "common/util-pre.qh" "dpdefs/csprogsdefs.qh")
+check "client" clientdefs[@]
+
+serverdefs=("-DSVQC" "common/util-pre.qh" "server/sys-pre.qh" "dpdefs/progsdefs.qh" "dpdefs/dpextensions.qh" "server/sys-post.qh" "server/defs.qh" "server/autocvars.qh")
+check "server" serverdefs[@]
+
+menudefs=("-DMENUQC" "common/util-pre.qh" "dpdefs/menudefs.qh")
+check "menu" menudefs[@]
+#include "anglestransform.qh"
+
#if defined(CSQC)
#include "../dpdefs/csprogsdefs.qh"
- #include "anglestransform.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
#include "../dpdefs/progsdefs.qh"
#include "../dpdefs/dpextensions.qh"
- #include "anglestransform.qh"
#endif
#ifdef POSITIVE_PITCH_IS_DOWN
+#include "client.qh"
+#include "common.qh"
+
#if defined(CSQC)
- #include "../dpdefs/csprogsdefs.qh"
- #include "common.qh"
- #include "client.qh"
#include "../client/autocvars.qh"
#include "../csqcmodellib/cl_model.qh"
+ #include "../dpdefs/csprogsdefs.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
#endif
+#include "common.qh"
+
#if defined(CSQC)
#include "../dpdefs/csprogsdefs.qh"
- #include "common.qh"
#include "../server/t_items.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "common.qh"
#include "../common/weapons/weapons.qh"
+ #include "../dpdefs/dpextensions.qh"
+ #include "../dpdefs/progsdefs.qh"
#endif
void WarpZone_Accumulator_Clear(entity acc)
+#include "mathlib.qh"
#if defined(CSQC)
#include "../dpdefs/csprogsdefs.qh"
- #include "mathlib.qh"
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
#include "../dpdefs/dpextensions.qh"
- #include "mathlib.qh"
+ #include "../dpdefs/progsdefs.qh"
#endif
int fpclassify(float x)
const float M_LOG10E = 0.43429448190325182765; /* log_10 e */
const float M_LN2 = 0.69314718055994530942; /* log_e 2 */
const float M_LN10 = 2.30258509299404568402; /* log_e 10 */
-const float M_PI = 3.14159265358979323846; /* pi */
+// -Wdouble-declaration
+#define M_PI 3.14159265358979323846 /* pi */
const float M_PI_2 = 1.57079632679489661923; /* pi/2 */
const float M_PI_4 = 0.78539816339744830962; /* pi/4 */
const float M_1_PI = 0.31830988618379067154; /* 1/pi */
+#include "server.qh"
+
+#include "common.qh"
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "common.qh"
- #include "server.qh"
#include "../common/constants.qh"
#include "../common/util.qh"
+ #include "../dpdefs/dpextensions.qh"
+ #include "../dpdefs/progsdefs.qh"
+ #include "../server/command/common.qh"
#include "../server/constants.qh"
#include "../server/defs.qh"
- #include "../server/command/common.qh"
#endif
#ifdef WARPZONELIB_KEEPDEBUG
WarpZone_PostTeleportPlayer_Callback(player);
}
-float WarpZone_Teleported_Send(entity to, float sf)
+bool WarpZone_Teleported_Send(entity to, int sf)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_TELEPORTED);
WriteCoord(MSG_ENTITY, self.angles.x);
}
}
-float WarpZone_Send(entity to, float sendflags)
+bool WarpZone_Send(entity to, int sendflags)
{
WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE);
return true;
}
-float WarpZone_Camera_Send(entity to, float sendflags)
+bool WarpZone_Camera_Send(entity to, int sendflags)
{
int f = 0;
WriteByte(MSG_ENTITY, ENT_CLIENT_WARPZONE_CAMERA);
+#include "util_server.qh"
+
+#include "common.qh"
+
#if defined(CSQC)
#elif defined(MENUQC)
#elif defined(SVQC)
- #include "../dpdefs/progsdefs.qh"
- #include "../dpdefs/dpextensions.qh"
- #include "common.qh"
- #include "util_server.qh"
#include "../csqcmodellib/sv_model.qh"
+ #include "../dpdefs/dpextensions.qh"
+ #include "../dpdefs/progsdefs.qh"
#endif
void WarpZoneLib_MoveOutOfSolid_Expand(entity e, vector by)
Severin "sev" Meyer
*Music / Sound FX
+AquaNova (Archer)
blkrbt
chooksta
Independent.nu
{SC0RP} - Ian "ID" Dorrell
Stephan
unfa
-AquaNova (Archer)
*Game Code
Samual "Ares" Lenks
**Other Active Contributors
+BuddyFriendGuy
Erik "Ablu" Schilling
Jope "Sless" Withers
Mircea "Taoki" Kitsune
*Asturian
Llumex03
+Tornes "Tornes.Llume" Ḷḷume
Ximielga
*Belarusian
lokster
set_killer
+*Chinese (China)
+Antonidas
+kalawore
+sapphireliu
+
*Czech
shogun assassin/woky
+Superovoce
Tomáš "CZHeron" Volavka
*Dutch
vegiburger
*English (Australia)
+Laurene "sunflowers" Albrand
Zac "Mario" Jardine
*Finnish
Yepoleb
*Greek
-Γιάννης "Evropi" Α.
+Γιάννης "Evropi" Ανθυμίδης
Konstantinos "LDinos" Mihalenas
Savoritias
Vindex
Ruszkai "CuBe0wL" Ákos
xaN1C4n3
-*Japanese
-Lento
-
*Italian
Antonio "terencehill" Piu
Felice "MaidenBeast" Sallustio
Amadeusz "amade/proraide" Sławiński
*Portuguese
-Ricardo "Hellgardia" Silva
+Ricardo Manuel "Hellgardia" da Cruz Coelho da Silva
xXxCHAOTICxXx
*Romanian
+Adrian-Ciprian "adrian.tinjala" Tînjală
BusterDBK
Mircea "Taoki" Kitsune
Tudor "TropiKo" Ionel
*Serbian
Саша "salepetronije" Петровић
Pendulla
-Ristovski
+Rafael "Ristovski"
*Spanish
0000simon