diff --git a/ParoxysmII/source/.gitignore b/ParoxysmII/source/.gitignore index 3254418..42857c0 100644 --- a/ParoxysmII/source/.gitignore +++ b/ParoxysmII/source/.gitignore @@ -1,3 +1,4 @@ *.dat *.sym +.deps config.rh diff --git a/ParoxysmII/source/Makefile b/ParoxysmII/source/Makefile index 9c6f775..a38717d 100644 --- a/ParoxysmII/source/Makefile +++ b/ParoxysmII/source/Makefile @@ -5,19 +5,32 @@ SRC= buttons.r builtins.r client.r combat.r defs.r doors.r dynlight.r \ HEADERS = client.rh paroxysm.rh config.rh -RFLAGS += -Wall -Werror -g --advanced +RFLAGS += -Wall -Werror -g +QFCC = qfcc INSTALLDIR = $(HOME)/.quake/paroxysm/ +OBJ = $(addsuffix .o,$(basename $(SRC))) +DEP = $(addprefix .deps/,$(addsuffix .d,$(basename $(SRC)))) + +%.o: %.r + @mkdir -p .deps + @$(QFCC) -M -q $(RFLAGS) -c $< | sed -e 's/\(\.r\)\?\.o\>/.o/' > .deps/`basename $@ .o`.d + $(QFCC) $(RFLAGS) -q -c -o $@ $< + + all: qwprogs.dat -qwprogs.dat: $(SRC) $(HEADERS) progs.src Makefile - qfcc $(RFLAGS) +qwprogs.dat: $(OBJ) + qfcc -o qwprogs.dat $(OBJ) clean: - -rm -f *.dat *.sym progdefs.h + -rm -f *.dat *.sym progdefs.h *.o + -rm -rf .deps install: qwprogs.dat -cp qwprogs.* $(INSTALLDIR) .PHONY: clean install + +-include $(DEP) diff --git a/ParoxysmII/source/builtins.rh b/ParoxysmII/source/builtins.rh new file mode 100644 index 0000000..b38c986 --- /dev/null +++ b/ParoxysmII/source/builtins.rh @@ -0,0 +1,236 @@ +/* + builtins.r + + Master builtins list + + Copyright (C) 2002 Jeff Teunissen + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 of the License, or (at + your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + + $Id$ +*/ + +#include "config.rh" + +/**************************************************************************** + * MATH FUNCTIONS * + ****************************************************************************/ + +/* + ceil + + Returns v, rounded up to the next higher integer +*/ +@extern float (float v) ceil; + +/* + fabs + + Returns the absolute value of v +*/ +@extern float (float v) fabs; + +/* + floor + + Returns v, rounded down to the next lower integer +*/ +@extern float (float v) floor; + +/* + makevectors + + Sets v_forward, v_up, v_right global vectors from the vector ang +*/ +@extern void (vector ang) makevectors; + +/* + normalize + + Transform vector v into a unit vector (a vector with a length of 1) +*/ +@extern vector (vector v) normalize; + +/* + random + + Generate a random number such that 0 <= num <= 1 +*/ +@extern float () random; + +/* + rint + + Returns v, rounded to the closest integer. x.5 rounds up. +*/ +@extern float (float v) rint; + +/* + vectoangles + + Returns a vector 'pitch yaw 0' corresponding to vector v. +*/ +@extern vector (vector v) vectoangles; + +/* + vectoyaw + + Returns the yaw angle ("bearing"), in degrees, associated with vector v. +*/ +@extern float (vector v) vectoyaw; +/* + vlen + + Return the length of vector v +*/ +@extern float (vector v) vlen; + +/**************************************************************************** + * ENTITY FUNCTIONS * + ****************************************************************************/ + +/* + makestatic + + Make entity e static (part of the world). + Static entities do not interact with the game. +*/ +@extern void (entity e) makestatic; + +/* + remove + + Remove entity e. +*/ +@extern void (entity e) remove; + +/* + setmodel + + Sets the model name for entity e to string m. + Set the entity's move type and solid type before calling. +*/ +@extern void (entity e, string m) setmodel; + +/* + setorigin + + Sets origin for entity e to vector o. +*/ +@extern void (entity e, vector o) setorigin; + +/* + setsize + + Set the size of entity e to a cube with the bounds ( x1 y1 z1 ) ( x2 y2 z2 ) +*/ +@extern void (entity e, vector min, vector max) setsize; + +/* + spawn + + Creates a new entity and returns it. +*/ +@extern entity () spawn; + +// ------------------------------------------------------------------------- + +/**************************************************************************** + * DEBUGGING FUNCTIONS * + ****************************************************************************/ + +/* + abort (in QuakeC, this was break) + + Tell the engine to abort (stop) code processing. +*/ +@extern void () abort; + +/* + coredump + + Tell the engine to print all edicts (entities) +*/ +@extern void () coredump; + +/* + traceon + + Enable instruction trace in the interpreter +*/ +@extern void () traceon; + +/* + traceoff + + Disable instruction trace in the interpreter +*/ +@extern void () traceoff; + +/* + eprint + + Print all information on an entity to the server console +*/ +@extern void (entity e) eprint; + +/**************************************************************************** + * CLIENT/SERVER FUNCTIONS * + ****************************************************************************/ + +/* + cvar + + Get the value of one of the server's configuration variables. + Doesn't really supply anything useful for string or vector Cvars. +*/ +@extern float (string s) cvar; + +/* + cvar_set + + Set the value of one of the server's configuration variables. +*/ +@extern void (string var, string val) cvar_set; + +/* + infokey + + Get an info key for an entity. Using an entity of zero (world) reads the + serverinfo/localinfo. +*/ +#ifdef QUAKEWORLD +@extern string (entity e, string key) infokey; + +/* + setinfokey (QuakeForge-only) + + Set an info key for an entity. Using an entity of zero (world) sets a key + in the server's localinfo. Does nothing if the entity is not a player. +*/ +# ifndef __VERSION6__ +@extern void (entity e, string key, string value) setinfokey; +# endif +#endif + +#if 0 + PR_AddBuiltin (pr, "vectoyaw", PF_vectoyaw, 13); // float (vector v) vectoyaw + PR_AddBuiltin (pr, "find", PF_Find, 18); // entity (entity start, .(...) fld, ... match) find + PR_AddBuiltin (pr, "dprint", PF_dprint, 25); // void (string s) dprint +#endif diff --git a/ParoxysmII/source/client.r b/ParoxysmII/source/client.r index 1710816..87892a7 100644 --- a/ParoxysmII/source/client.r +++ b/ParoxysmII/source/client.r @@ -4,12 +4,6 @@ #include "paroxysm.rh" // prototypes -void () W_WeaponFrame; -void () W_SetCurrentAmmo; -void () player_pain; -void () player_stand1; -void (vector org) spawn_tfog; -void (vector org, entity death_owner) spawn_tdeath; float modelindex_eyes, modelindex_player; @@ -213,8 +207,6 @@ void() trigger_changelevel = PLAYER GAME EDGE FUNCTIONS ============================================================================= */ -void() set_suicide_frame; -// called by ClientKill and DeadThink void() respawn = { @@ -349,8 +341,6 @@ entity() SelectSpawnPoint = return spot; }; -//void() DecodeLevelParms; -void() PlayerDie; /* =========== ValidateUser diff --git a/ParoxysmII/source/client.rh b/ParoxysmII/source/client.rh index 8ca0f71..6ff431f 100644 --- a/ParoxysmII/source/client.rh +++ b/ParoxysmII/source/client.rh @@ -26,37 +26,37 @@ $Id$ */ -entity () FindIntermission; -entity() SelectSpawnPoint; -float (entity e) ValidateUser; -float (vector v) CheckSpawnPoint; -void () DecodeLevelParms; -void () GotoNextMap; -void () IntermissionThink; -void () SetChangeParms; -void () SetNewParms; -void () changelevel_touch; -void () execute_changelevel; -void () info_intermission; -void () trigger_changelevel; -void () CheckPowerups; -void () CheckRules; -void () CheckWaterJump; -void () ClientConnect; -void () ClientDisconnect; -void () ClientKill; -void () NextLevel; -void () PlayerDeathThink; -void () PlayerJump; -void () PlayerPostThink; -void () PlayerPreThink; -void () PlayerRegen; -void () PutClientInServer; -void () WaterMove; -void () info_player_coop; -void () info_player_deathmatch; -void () info_player_start; -void () info_player_start2; -void () respawn; -void () set_suicide_frame; -void (entity targ, entity attacker) ClientObituary; +@extern entity () FindIntermission; +@extern entity() SelectSpawnPoint; +@extern float (entity e) ValidateUser; +@extern float (vector v) CheckSpawnPoint; +@extern void () DecodeLevelParms; +@extern void () GotoNextMap; +@extern void () IntermissionThink; +@extern void () SetChangeParms; +@extern void () SetNewParms; +@extern void () changelevel_touch; +@extern void () execute_changelevel; +@extern void () info_intermission; +@extern void () trigger_changelevel; +@extern void () CheckPowerups; +@extern void () CheckRules; +@extern void () CheckWaterJump; +@extern void () ClientConnect; +@extern void () ClientDisconnect; +@extern void () ClientKill; +@extern void () NextLevel; +@extern void () PlayerDeathThink; +@extern void () PlayerJump; +@extern void () PlayerPostThink; +@extern void () PlayerPreThink; +@extern void () PlayerRegen; +@extern void () PutClientInServer; +@extern void () WaterMove; +@extern void () info_player_coop; +@extern void () info_player_deathmatch; +@extern void () info_player_start; +@extern void () info_player_start2; +@extern void () respawn; +@extern void () set_suicide_frame; +@extern void (entity targ, entity attacker) ClientObituary; diff --git a/ParoxysmII/source/combat.r b/ParoxysmII/source/combat.r index 4d25026..782ffd9 100644 --- a/ParoxysmII/source/combat.r +++ b/ParoxysmII/source/combat.r @@ -2,11 +2,6 @@ #include "paroxysm.rh" -void () T_MissileTouch; -void () info_player_start; -void (entity targ, entity attacker) ClientObituary; -void (entity inflictor, entity attacker, float damage, entity ignore, string dtype) T_RadiusDamage; - /*SERVER void() monster_death_use; */ diff --git a/ParoxysmII/source/defs.r b/ParoxysmII/source/defs.r index 9257da8..6abfa9c 100644 --- a/ParoxysmII/source/defs.r +++ b/ParoxysmII/source/defs.r @@ -62,7 +62,7 @@ entity msg_entity; // destination of single entity writes // // required prog functions -// +#if 0 void() main; // only for testing void() StartFrame; @@ -86,7 +86,7 @@ void() SetChangeParms; // call to set parms for @self so they can //================================================ void end_sys_globals; // flag for structure dumping //================================================ - +#endif /* ============================================================================== @@ -217,125 +217,6 @@ void end_sys_fields; // flag for structure dumping ============================================================================== */ -// 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; - -// takedamage values - -float DAMAGE_NO = 0; -float DAMAGE_YES = 1; -float DAMAGE_AIM = 2; - -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 SVC_SMALLKICK = 34; -float SVC_BIGKICK = 35; -float SVC_MUZZLEFLASH = 39; - -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; -float TE_BLOOD = 12; -float TE_LIGHTNINGBLOOD = 13; - -// 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 CHAN_NO_PHS_ADD = 8; // ie: CHAN_BODY | CHAN_NO_PHS_ADD - -float ATTN_NONE = 0; // Attenuation -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; -float EF_FLAG1 = 16; -float EF_FLAG2 = 32; - -// GLQuakeWorld Stuff -float EF_BLUE = 64; // Blue Globe effect for Quad -float EF_RED = 128; // Red Globe effect for Pentagram - -// 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 -float MSG_MULTICAST = 4; // for multicast() call - -// message levels -float PRINT_LOW = 0; // pickup messages -float PRINT_MEDIUM = 1; // death messages -float PRINT_HIGH = 2; // critical messages -float PRINT_CHAT = 3; // also goes to chat console - -// multicast sets -float MULTICAST_ALL = 0; // every client -float MULTICAST_PHS = 1; // within hearing -float MULTICAST_PVS = 2; // within sight -float MULTICAST_ALL_R = 3; // every client, reliable -float MULTICAST_PHS_R = 4; // within hearing, reliable -float MULTICAST_PVS_R = 5; // within sight, reliable //================================================ @@ -401,11 +282,6 @@ float rj; .float search_time; .float attack_state; -float AS_STRAIGHT = 1; -float AS_SLIDING = 2; -float AS_MELEE = 3; -float AS_MISSILE = 4; - // // player only fields // @@ -589,27 +465,3 @@ void(vector where, float set) multicast = #82; // sends the temp message to a se // of clients, possibly in PVS or PHS //============================================================================ - -// -// subs.qc -// -void(vector tdest, float tspeed, void() func) SUB_CalcMove; -void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt; -void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove; -void() SUB_CalcMoveDone; -void() SUB_CalcAngleMoveDone; -void() SUB_Null; -void() SUB_UseTargets; -void() SUB_Remove; - -// -// combat.qc -// -void(entity targ, entity inflictor, entity attacker, float damage) T_Damage; - - -float (entity e, float healamount, float ignore) T_Heal; // health function - -float(entity targ, entity inflictor) CanDamage; - - diff --git a/ParoxysmII/source/defs.rh b/ParoxysmII/source/defs.rh new file mode 100644 index 0000000..32fa564 --- /dev/null +++ b/ParoxysmII/source/defs.rh @@ -0,0 +1,673 @@ + +/* +============================================================================== + + SOURCE FOR GLOBALVARS_T C STRUCTURE + +============================================================================== +*/ + +// +// system globals +// +@extern entity other; +@extern entity world; +@extern float time; +@extern float frametime; + +@extern entity newmis; // if this is set, the entity that just + // run created a new missile that should + // be simulated immediately + +@extern 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 +@extern string mapname; + +@extern float serverflags; // propagated from level to level, used to + // keep track of completed episodes + +@extern float total_secrets; +@extern float total_monsters; + +@extern float found_secrets; // number of secrets found +@extern float killed_monsters; // number of monsters killed + +// spawnparms are used to encode information about clients across server +// level changes +@extern float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16; + +// +// global variables set by built in functions +// +@extern vector v_forward, v_up, v_right; // set by makevectors() + +// set by traceline / tracebox +@extern float trace_allsolid; +@extern float trace_startsolid; +@extern float trace_fraction; +@extern vector trace_endpos; +@extern vector trace_plane_normal; +@extern float trace_plane_dist; +@extern entity trace_ent; +@extern float trace_inopen; +@extern float trace_inwater; + +@extern entity msg_entity; // destination of single entity writes + +// +// required prog functions +// +@extern void() main; // only for testing + +@extern void() StartFrame; + +@extern void() PlayerPreThink; +@extern void() PlayerPostThink; + +@extern void() ClientKill; +@extern void() ClientConnect; +@extern void() PutClientInServer; // call after setting the parm1... parms +@extern void() ClientDisconnect; + +@extern void() SetNewParms; // called when a client first connects to + // a server. sets parms so they can be + // saved off for restarts + +@extern void() SetChangeParms; // call to set parms for @self so they can + // be saved for a level transition + + +//================================================ +@extern void end_sys_globals; // flag for structure dumping +//================================================ + +/* +============================================================================== + + SOURCE FOR ENTVARS_T C STRUCTURE + +============================================================================== +*/ + +// +// system fields (*** = do not set in prog code, maintained by C code) +// +@extern .float modelindex; // *** model index in the precached list +@extern .vector absmin, absmax; // *** origin + mins / maxs + +@extern .float ltime; // local time for entity +@extern .float lastruntime; // *** to allow entities to run out of sequence + +@extern .float movetype; +@extern .float solid; + +@extern .vector origin; // *** +@extern .vector oldorigin; // *** +@extern .vector velocity; +@extern .vector angles; +@extern .vector avelocity; + +@extern .string classname; // spawn function +@extern .string model; +@extern .float frame; +@extern .float skin; +@extern .float effects; + +@extern .vector mins, maxs; // bounding box extents reletive to origin +@extern .vector size; // maxs - mins + +@extern .void() touch; +@extern .void() use; +@extern .void() think; +@extern .void() blocked; // for doors or plats, called when can't push other + +@extern .float nextthink; +@extern .entity groundentity; + + + +// stats +@extern .float health; +@extern .float frags; +@extern .float weapon; // one of the IT_TSHOT, etc flags +@extern .string weaponmodel; +@extern .float weaponframe; +@extern .float currentammo; +@extern .float ammo_shells, ammo_nails, ammo_rockets, ammo_cells; + +@extern .float items; // bit flags + +@extern .float takedamage; +@extern .entity chain; +@extern .float deadflag; + +@extern .vector view_ofs; // add to origin to get eye point + + +@extern .float button0; // fire +@extern .float button1; // use +@extern .float button2; // jump + +@extern .float impulse; // weapon changes + +@extern .float fixangle; +@extern .vector v_angle; // view / targeting angle for players + +@extern .string netname; + +@extern .entity enemy; + +@extern .float flags; + +@extern .float colormap; +@extern .float team; + +@extern .float max_health; // players maximum health is stored here + +@extern .float teleport_time; // don't back up + +@extern .float armortype; // save this fraction of incoming damage +@extern .float armorvalue; + +@extern .float waterlevel; // 0 = not in, 1 = feet, 2 = wast, 3 = eyes +@extern .float watertype; // a contents value + +@extern .float ideal_yaw; +@extern .float yaw_speed; + +@extern .entity aiment; + +@extern .entity goalentity; // a movetarget or an enemy + +@extern .float spawnflags; + +@extern .string target; +@extern .string targetname; + +// damage is accumulated through a frame. and sent as one single +// message, so the super shotgun doesn't generate huge messages +@extern .float dmg_take; +@extern .float dmg_save; +@extern .entity dmg_inflictor; + +@extern .entity owner; // who launched a missile +@extern .vector movedir; // mostly for doors, but also used for waterjump + +@extern .string message; // trigger messages + +@extern .float sounds; // either a cd track number or sound number + +@extern .string noise, noise1, noise2, noise3; // contains names of wavs to play + +//================================================ +@extern void end_sys_fields; // flag for structure dumping +//================================================ + +/* +============================================================================== + + VARS NOT REFERENCED BY C CODE + +============================================================================== +*/ + +// edict.solid values +#define SOLID_NOT 0 // no interaction with other objects +#define SOLID_TRIGGER 1 // touch on edge, but not blocking +#define SOLID_BBOX 2 // touch on edge, block +#define SOLID_SLIDEBOX 3 // touch on edge, but not an onground +#define SOLID_BSP 4 // bsp clip, touch on edge, block + +// range values +#define RANGE_MELEE 0 +#define RANGE_NEAR 1 +#define RANGE_MID 2 +#define RANGE_FAR 3 + +// deadflag values + +#define DEAD_NO 0 +#define DEAD_DYING 1 +#define DEAD_DEAD 2 +#define DEAD_RESPAWNABLE 3 + +// takedamage values + +#define DAMAGE_NO 0 +#define DAMAGE_YES 1 +#define DAMAGE_AIM 2 + +#define STATE_TOP 0 +#define STATE_BOTTOM 1 +#define STATE_UP 2 +#define STATE_DOWN 3 + +#define VEC_ORIGIN '0 0 0' +#define VEC_HULL_MIN '-16 -16 -24' +#define VEC_HULL_MAX '16 16 32' +#define VEC_HULL2_MIN '-32 -32 -24' +#define VEC_HULL2_MAX '32 32 64' + +// protocol bytes +#define SVC_TEMPENTITY 23 +#define SVC_KILLEDMONSTER 27 +#define SVC_FOUNDSECRET 28 +#define SVC_INTERMISSION 30 +#define SVC_FINALE 31 +#define SVC_CDTRACK 32 +#define SVC_SELLSCREEN 33 +#define SVC_SMALLKICK 34 +#define SVC_BIGKICK 35 +#define SVC_MUZZLEFLASH 39 + +#define TE_SPIKE 0 +#define TE_SUPERSPIKE 1 +#define TE_GUNSHOT 2 +#define TE_EXPLOSION 3 +#define TE_TAREXPLOSION 4 +#define TE_LIGHTNING1 5 +#define TE_LIGHTNING2 6 +#define TE_WIZSPIKE 7 +#define TE_KNIGHTSPIKE 8 +#define TE_LIGHTNING3 9 +#define TE_LAVASPLASH 10 +#define TE_TELEPORT 11 +#define TE_BLOOD 12 +#define TE_LIGHTNINGBLOOD 13 + +// sound channels +// channel 0 never willingly overrides +// other channels (1-7) allways override a playing sound on that channel +#define CHAN_AUTO 0 +#define CHAN_WEAPON 1 +#define CHAN_VOICE 2 +#define CHAN_ITEM 3 +#define CHAN_BODY 4 +#define CHAN_NO_PHS_ADD 8 // ie: CHAN_BODY | CHAN_NO_PHS_ADD + +#define ATTN_NONE 0 // Attenuation +#define ATTN_NORM 1 +#define ATTN_IDLE 2 +#define ATTN_STATIC 3 + +// update types + +#define UPDATE_GENERAL 0 +#define UPDATE_STATIC 1 +#define UPDATE_BINARY 2 +#define UPDATE_TEMP 3 + +// entity effects + +//float EF_BRIGHTFIELD = 1; +//float EF_MUZZLEFLASH = 2; +#define EF_BRIGHTLIGHT 4 +#define EF_DIMLIGHT 8 +#define EF_FLAG1 16 +#define EF_FLAG2 32 + +// GLQuakeWorld Stuff +#define EF_BLUE 64 // Blue Globe effect for Quad +#define EF_RED 128 // Red Globe effect for Pentagram + +// messages +#define MSG_BROADCAST 0 // unreliable to all +#define MSG_ONE 1 // reliable to one (msg_entity) +#define MSG_ALL 2 // reliable to all +#define MSG_INIT 3 // write to the init string +#define MSG_MULTICAST 4 // for multicast() call + +// message levels +#define PRINT_LOW 0 // pickup messages +#define PRINT_MEDIUM 1 // death messages +#define PRINT_HIGH 2 // critical messages +#define PRINT_CHAT 3 // also goes to chat console + +// multicast sets +#define MULTICAST_ALL 0 // every client +#define MULTICAST_PHS 1 // within hearing +#define MULTICAST_PVS 2 // within sight +#define MULTICAST_ALL_R 3 // every client, reliable +#define MULTICAST_PHS_R 4 // within hearing, reliable +#define MULTICAST_PVS_R 5 // within sight, reliable + +//================================================ + +// +// globals +// +@extern float movedist; + +@extern string string_null; // null string, nothing should be held here +@extern float empty_float; + +@extern entity activator; // the entity that activated a trigger or brush + +@extern entity damage_attacker; // set by T_Damage +@extern entity damage_inflictor; +@extern float framecount; + +// +// cvars checked each frame +// +@extern float teamplay; +@extern float timelimit; +@extern float fraglimit; +@extern float deathmatch; +@extern float rj; + +//================================================ + +// +// world fields (FIXME: make globals) +// +@extern .string wad; +@extern .string map; +@extern .float worldtype; // 0=medieval 1=metal 2=base + +//================================================ + +@extern .string killtarget; + +// +// quakeed fields +// +@extern .float light_lev; // not used by game, but parsed by light util +@extern .float style; + +// +// monster ai +// +@extern .void() th_stand; +@extern .void() th_walk; +@extern .void() th_run; +@extern .void() th_missile; +@extern .void() th_melee; +@extern .void() th_pain; +@extern .void() th_die; + +@extern .entity oldenemy; // mad at this player before taking damage + +@extern .float speed; + +@extern .float lefty; + +@extern .float search_time; +@extern .float attack_state; + +#define AS_STRAIGHT 1 +#define AS_SLIDING 2 +#define AS_MELEE 3 +#define AS_MISSILE 4 + +// +// player only fields +// +@extern .float voided; +@extern .float walkframe; + +// Zoid Additions +@extern .float maxspeed; // Used to set Maxspeed on a player +@extern .float gravity; // Gravity Multiplier (0 to 1.0) + +@extern .float attack_finished; +@extern .float pain_finished; + +@extern .float invincible_finished; +@extern .float invisible_finished; +@extern .float super_damage_finished; +@extern .float radsuit_finished; + +@extern .float invincible_time, invincible_sound; +@extern .float invisible_time, invisible_sound; +@extern .float super_time, super_sound; +@extern .float rad_time; +@extern .float fly_sound; + +@extern .float axhitme; + +@extern .float show_hostile; // set to time+0.2 whenever a client fires a + // weapon or takes damage. Used to alert + // monsters that otherwise would let the player go +@extern .float jump_flag; // player jump flag +// + POX - removed +//.float swim_flag; // player swimming sound flag +// - POX +@extern .float air_finished; // when time > air_finished, start drowning +@extern .float bubble_count; // keeps track of the number of bubbles +@extern .string deathtype; // keeps track of how the player died + +// +// object stuff +// +@extern .string mdl; +@extern .vector mangle; // angle at start + +@extern .vector oldorigin; // only used by secret door + +@extern .float t_length, t_width; + +// +// doors, etc +// +@extern .vector dest, dest1, dest2; +@extern .float wait; // time from firing to restarting +@extern .float delay; // time from activation to firing +@extern .entity trigger_field; // door's trigger entity +@extern .string noise4; + +// +// monsters +// +@extern .float pausetime; +@extern .entity movetarget; + +// +// doors +// +@extern .float aflag; +@extern .float dmg; // damage done by door when hit + +// +// misc +// +@extern .float cnt; // misc flag + +// +// subs +// +@extern .void() think1; +@extern .vector finaldest, finalangle; + +// +// triggers +// +@extern .float count; // for counting triggers + + +// +// plats / doors / buttons +// +@extern .float lip; +@extern .float state; +@extern .vector pos1, pos2; // top and bottom positions +@extern .float height; + +// +// sounds +// +@extern .float waitmin, waitmax; +@extern .float distance; +@extern .float volume; + + +//=========================================================================== + +// +// builtin functions +// + +@extern void(string e) error; +@extern void(string e) objerror; + +// 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 +@extern void(vector v1, vector v2, float nomonsters, entity forent) traceline; + +@extern entity() checkclient; // returns a client to look for +@extern entity(entity start, .string fld, string match) find; +@extern void(entity client, string s)stuffcmd; +@extern entity(vector org, float rad) findradius; +@extern void(float level, string s) bprint; +@extern void(entity client, float level, string s) sprint; +@extern void(string s) dprint; +@extern string(float f) ftos; +@extern string(vector v) vtos; +@extern float(float yaw, float dist) walkmove; // returns TRUE or FALSE +// #33 was removed +@extern float() droptofloor; // TRUE if landed on floor +@extern void(float style, string value) lightstyle; +// #39 was removed +@extern float(entity e) checkbottom; // true if @self is on ground +@extern float(vector v) pointcontents; // returns a CONTENT_* +// #42 was removed +@extern vector(entity e, float speed) aim; // returns the shooting vector +@extern void(string s) localcmd; // put string into local que +@extern entity(entity e) nextent; // for looping through all ents +// #48 was removed +@extern void() ChangeYaw; // turn towards @self.ideal_yaw + // at @self.yaw_speed +// #50 was removed + +// +// direct client message generation +// +@extern void(float to, float f) WriteByte; +@extern void(float to, float f) WriteChar; +@extern void(float to, float f) WriteShort; +@extern void(float to, float f) WriteLong; +@extern void(float to, float f) WriteCoord; +@extern void(float to, float f) WriteAngle; +@extern void(float to, string s) WriteString; +@extern void(float to, entity s) WriteEntity; + +@extern void(float step) movetogoal; + +@extern void(string s) changelevel; + +//#71 was removed + +@extern void(entity client, string s) centerprint; // sprint, but in middle + +@extern void(entity e, float chan, string samp, float vol, float atten) sound; +@extern void(vector pos, string samp, float vol, float atten) ambientsound; + +@extern string(string s) precache_sound; +@extern string(string s) precache_model; +@extern string(string s) precache_file; // no effect except for -copy +@extern string(string s) precache_model2; // registered version only +@extern string(string s) precache_sound2; // registered version only +@extern string(string s) precache_file2; // registered version only + +@extern void(entity e) setspawnparms; // set parm1... to the + // values at level start + // for coop respawn + +@extern void(entity killer, entity killee) logfrag; // add to stats + +@extern float(string s) stof; // convert string to float +@extern void(vector where, float set) multicast; // sends the temp message to a set + // of clients, possibly in PVS or PHS + +//============================================================================ + +// +// subs.qc +// +@extern void(vector tdest, float tspeed, void() func) SUB_CalcMove; +@extern void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt; +@extern void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove; +@extern void() SUB_CalcMoveDone; +@extern void() SUB_CalcAngleMoveDone; +@extern void() SUB_Null; +@extern void() SUB_UseTargets; +@extern void() SUB_Remove; + +// FIXME needs sorting into appropriate places +@extern vector () SetMovedir; +@extern void() InitTrigger; +@extern void(entity ent) CopyToBodyQue; +@extern void() SpawnObserver; +@extern void(entity me) flash_on; +@extern float() W_BestWeapon; +@extern void() ObserverThink; +@extern void (entity inflictor, entity attacker, float damage, entity ignore, string dtype) T_RadiusDamage; +@extern void(vector org, float damage) SpawnBlood; +@extern void(vector org, vector dir) launch_spike; +@extern void() superspike_touch; +@extern void() ID_CheckTarget; +@extern void() W_FireAxe; +@extern void() SuperDamageSound; +@extern void(float ox) W_FireNails; +@extern void(float ox) W_FirePlasma; +@extern void(vector barrel) W_FireRocket; +@extern void() W_FireTShot; +@extern void() W_SecondTrigger; +@extern float() crandom; +@extern void(float timeleft) DropQuad; +@extern void(float timeleft) DropRing; +@extern float modelindex_eyes, modelindex_player; +@extern void() DropBackpack; +@extern void() W_SetCurrentAmmo; +@extern .float regen_finished; +@extern .float armregen; +@extern vector() wall_velocity; +@extern void() player_run; +@extern void() player_axe1; +@extern void() player_axeb1; +@extern void() player_axec1; +@extern void() player_axed1; +@extern void() player_tshot; +@extern void() player_tshot1; +@extern void() player_shot1; +@extern void() player_plasma1; +@extern void() player_plasma2; +@extern void() player_nail1; +@extern void() player_grenade1; +@extern void() player_rocket1; +@extern void() player_stand1; +@extern void() W_Precache; +@extern void(entity targ, entity attacker) ClientObituary; +@extern void() teleport_touch; +@extern entity() SelectSpawnPoint; +@extern void() bubble_bob; +@extern void () player_pain; +@extern void () W_WeaponFrame; +@extern void () W_SetCurrentAmmo; +@extern void (vector org) spawn_tfog; +@extern void (vector org, entity death_owner) spawn_tdeath; +@extern void() PlayerDie; +@extern void() regen_ambientsound; +@extern void() InitBodyQue; + + +// +// combat.qc +// +@extern void(entity targ, entity inflictor, entity attacker, float damage) T_Damage; + + +@extern float (entity e, float healamount, float ignore) T_Heal; // health function + +@extern float(entity targ, entity inflictor) CanDamage; + + diff --git a/ParoxysmII/source/items.r b/ParoxysmII/source/items.r index d1338c8..d6e4474 100644 --- a/ParoxysmII/source/items.r +++ b/ParoxysmII/source/items.r @@ -2,7 +2,6 @@ #include "paroxysm.rh" // POX - had to make room for Paroxysm's DM modes...... -void() W_SetCurrentAmmo; /* ALL LIGHTS SHOULD BE 0 1 0 IN COLOR ALL OTHER ITEMS SHOULD BE .8 .3 .4 IN COLOR */ .entity quadcore; // + POX - used by the dual model quad @@ -401,7 +400,7 @@ void(float old, float new) Deathmatch_Weapon = weapon_touch ============= */ -float() W_BestWeapon; + void() weapon_touch = { local float hadammo, best, new = NIL, old; diff --git a/ParoxysmII/source/observe.r b/ParoxysmII/source/observe.r index 9521897..6689106 100644 --- a/ParoxysmII/source/observe.r +++ b/ParoxysmII/source/observe.r @@ -8,8 +8,6 @@ This was written to support Last Man Standing Rules, it is a crude form of Spect observes to stay connected as players so they can play the next game. An LMS observer is counted as a player, so you can still have the max amount of true Spectors connected */ -entity() SelectSpawnPoint; -void() teleport_touch; //POX v1.12 //POX v1.12 - sets fov for observer (impulses 1 and 2) /*------------------ SetObserverFOV diff --git a/ParoxysmII/source/paroxysm.rh b/ParoxysmII/source/paroxysm.rh index 13451f4..a78379a 100644 --- a/ParoxysmII/source/paroxysm.rh +++ b/ParoxysmII/source/paroxysm.rh @@ -1,6 +1,11 @@ #ifndef __paroxysm_rh_ #define __paroxysm_rh_ +#include "defs.rh" +#include "builtins.rh" +#include "poxdefs.rh" +#include "sectrig.rh" + /**************************************************************************** * ENGINE-DEFINED CONSTANTS * ****************************************************************************/ diff --git a/ParoxysmII/source/player.r b/ParoxysmII/source/player.r index 121110c..1ca03af 100644 --- a/ParoxysmII/source/player.r +++ b/ParoxysmII/source/player.r @@ -2,7 +2,6 @@ #include "config.rh" #include "paroxysm.rh" -void() bubble_bob; /* ============================================================================== PLAYER @@ -75,7 +74,6 @@ $frame axattd1 axattd2 axattd3 axattd4 axattd5 axattd6 PLAYER ============================================================================== */ -void() player_run; void() player_stand1 = [$axstnd1, player_stand1] { @self.weaponframe = 0; diff --git a/ParoxysmII/source/poxdefs.rh b/ParoxysmII/source/poxdefs.rh new file mode 100644 index 0000000..5539fe3 --- /dev/null +++ b/ParoxysmII/source/poxdefs.rh @@ -0,0 +1,62 @@ +#include "config.rh" +#include "paroxysm.rh" + +// POX - bunch of new variable declarations and prototypes for POXworld +//New stuff for timing second triggers and other weapon stuff +@extern .float prime_tshot; //this is set when tShot is primed for a triple barrel fire +@extern .float st_tshotload; //used to time out the tSot's trigger during reload +@extern .float st_sshotgun; //next attack for ComboGun +@extern .float st_pball; //next attack for Impact grenade +@extern .float which_ammo; //used to clean up ammo switching for ComboGun +@extern .float st_mplasma; //next attack for MegaPlasma Burst +@extern .float st_plasma; //next attack for PlasmaGun +@extern .float LorR; //sets which barrel to use for next PlasmaGun shot +@extern .float st_mine; //next attack for PhaseMine +@extern .float st_grenade; //next attack for Grenades +@extern .float no_obj; //fixes a problem with 'hanging' mines on breakable objects destroyed be something else +@extern .entity spawnmaster; +@extern .entity lastowner; +@extern .float st_nailgun; //next attack for Nailgun +@extern .float st_shrapnel; //next attack for ShrapnelBomb +@extern .float shrap_detonate; //decide whether to launch or detonate a ShrapnelBomb +@extern .float shrap_time; //holds the bombs time out (2 minutes then boom) - just in case owner died +@extern .float reload_rocket; //keeps count of rockets fired +@extern .float st_rocketload; //used to time out the rhino's trigger during reload +@extern .float missfire_finished; //used to seperate attacks and missfires (POXnote : DO I STILL NEED THIS?) +@extern .float nobleed; //set to TRUE for triggers, breakable objects, buttons, etc... +// Footsteps +@extern .float spawnsilent; +@extern .vector old_velocity; +//POX v1.2 REMOVED EARTHQUAKE! (not suitable for DM) +@extern void() func_earthquake = {remove(@self);}; +//Water Movement +@extern .float uwmuffle; //underwater muffle sound timeout +@extern .float onwsound; //on water sound timeout +@extern .float outwsound; //head out of water sound flag +@extern .float inwsound; //head in water sound flag +//New DM option constants +@extern float fraglimit_LMS; // stores the fraglimit at worldspawn so it can't be changed during a game +@extern float lms_plrcount; // Keeps track of the number of players in an LMS game +@extern float lms_gameover; // Lets CheckRules know when one or zero players are left +@extern .float LMS_registered; // prevents players from being counted more than once +@extern .float LMS_observer; // Bump think to Observer code if TRUE (1 = late, 2 = killed) +@extern .float LMS_observer_fov; // Stores observer's current fov +@extern .float LMS_zoom; // 1 = zoom in, 2 = zoom out, 0 = stop +@extern .float LMS_observer_time; // times the display of observer instructions +//Dark Mode stuff... +@extern .float flash_flag; // flashlight toggle (no user toggle) +@extern .entity flash; // flash entity +// Moved here for use in weapons.qc +@extern float intermission_running; +@extern .float gl_fix; //a hack for toggling gl_flashblend +//Used by Target ID impulse +@extern .float target_id_finished; +@extern .float target_id_toggle; +@extern .float target_id_same; +@extern .entity last_target_id; +@extern void(entity client, string s1, string s2, string s3, string s4) centerprint4; +//POX v1.2 - improved reseting of colour_light +@extern .float cshift_finished; +@extern .float cshift_off; +//POX 1.2 - allows idtarget state to be saved across levelchanges +@extern .float target_id_temp; diff --git a/ParoxysmII/source/sectrig.r b/ParoxysmII/source/sectrig.r index 04ef5e5..9b8847c 100644 --- a/ParoxysmII/source/sectrig.r +++ b/ParoxysmII/source/sectrig.r @@ -2,39 +2,37 @@ #include "paroxysm.rh" // + POX moved prototypes from weapons.qc for use here -void(float shotcount, vector dir, vector spread) FireBullets2; -void(float damage) spawn_touchblood; -void() muzzleflash; -void (entity targ, entity inflictor, entity attacker, float damage) T_Damage; -void () player_run; -void(entity bomb, entity attacker, float rad, entity ignore, string dtype) T_RadiusDamage; -void(vector org, float damage) SpawnBlood; -void() SuperDamageSound; -float SECOND_TRIGGER = 15; // Impulse constant for second trigger (more readable than 15) -void(vector org) launch_shrapnel; //Predeclare -void() player_shot1; -void() player_gshot1; -void() player_plasma1; -void() player_plasma2; -void() player_mplasma1; -void() player_nail1; -void() player_rocket1; -void() player_rocketload1; -void() player_grenade1; -void() player_reshot1; -void() player_tshot1; -void() player_shrap1; -void() player_axe1; -void() player_axeb1; -void() player_axec1; -void() player_axed1; +@extern void(float shotcount, vector dir, vector spread) FireBullets2; +@extern void(float damage) spawn_touchblood; +@extern void() muzzleflash; +@extern void (entity targ, entity inflictor, entity attacker, float damage) T_Damage; +@extern void () player_run; +@extern void(vector org, float damage) SpawnBlood; +@extern void() SuperDamageSound; +@extern void(vector org) launch_shrapnel; //Predeclare +@extern void() player_shot1; +@extern void() player_gshot1; +@extern void() player_plasma1; +@extern void() player_plasma2; +@extern void() player_mplasma1; +@extern void() player_nail1; +@extern void() player_rocket1; +@extern void() player_rocketload1; +@extern void() player_grenade1; +@extern void() player_reshot1; +@extern void() player_tshot1; +@extern void() player_shrap1; +@extern void() player_axe1; +@extern void() player_axeb1; +@extern void() player_axec1; +@extern void() player_axed1; -void(float damage, vector dir) TraceAttack; -void() ClearMultiDamage; -void() ApplyMultiDamage; -void() Multi_Finish; -void(vector org, vector dir) launch_spike; -void() superspike_touch; +@extern void(float damage, vector dir) TraceAttack; +@extern void() ClearMultiDamage; +@extern void() ApplyMultiDamage; +@extern void() Multi_Finish; +@extern void(vector org, vector dir) launch_spike; +@extern void() superspike_touch; //Some nitty-gritty from weapons.qc ... float() crandom = diff --git a/ParoxysmII/source/sectrig.rh b/ParoxysmII/source/sectrig.rh new file mode 100644 index 0000000..faeaf40 --- /dev/null +++ b/ParoxysmII/source/sectrig.rh @@ -0,0 +1,2 @@ + +#define SECOND_TRIGGER 15 // Impulse constant for second trigger (more readable than 15) diff --git a/ParoxysmII/source/server.r b/ParoxysmII/source/server.r index 199772c..3a90b0a 100644 --- a/ParoxysmII/source/server.r +++ b/ParoxysmII/source/server.r @@ -1,3 +1,4 @@ +#include "paroxysm.rh" void() monster_ogre = {remove(@self);}; void() monster_demon1 = {remove(@self);}; diff --git a/ParoxysmII/source/specfx.r b/ParoxysmII/source/specfx.r index 02e1cf8..2fdce5e 100644 --- a/ParoxysmII/source/specfx.r +++ b/ParoxysmII/source/specfx.r @@ -271,7 +271,7 @@ This entity should be used in conjunction with a regen_station trigger clr = skin# (0 = blue, 1 = yellow, 2 = red) */ .float clr; -void() regen_ambientsound; + void() particle_stream = { precache_sound("ambience/regen1.wav"); diff --git a/ParoxysmII/source/world.r b/ParoxysmII/source/world.r index 85723ce..3f4755f 100644 --- a/ParoxysmII/source/world.r +++ b/ParoxysmII/source/world.r @@ -2,9 +2,6 @@ #include "paroxysm.rh" -void() bubble_bob; - -void() InitBodyQue; void() main = { dprint ("main function\n");