diff --git a/Changelog.txt b/Changelog.txt new file mode 100644 index 0000000..6a1f8ec --- /dev/null +++ b/Changelog.txt @@ -0,0 +1,111 @@ +Credits: +Thanks goes to (alphabetically) David Hyde, Knightmare, Musashi, and Yamagi for their respective work on keeping Q2 both alive and also playable on modern architectures. + + +Known Bugs: +- The game will crash if a door tries to close on any monster either living or dead. Be sure to gib any monsters that die in a doorway. +- After the cutscene, gun and crosshair visibility are not automatically restored. To restore the Q2 defaults, you can set "cl_gun 2" and "crosshair 1" in the console. + + +Release 2 Notes: +- Saving now works on all maps! The "target_effect" entity has been disabled because it was causing the game to crash when loading save files in maps that use it. SPOILER: In SMD3 the hallway with the Brains near the start of the map consequently has an invisible trap now. Be sure to locate the switch to disable the "invisible steam" before passing down the hallway. + +Release 2 Change Log: +g_func_decs.h +Missing function declaration added + +g_target.c +Disabled the SP_target_effect entity and all related functions + + +Release 1 Notes: +- No attempt has been made to clean up the original Lazarus_SMD code beyond simply getting it compiling with GCC and as operational in-game as I could. +- Music and footstep noises are unavailable on non-Windows platforms due to FMOD being Windows-only. +- Fog is disabled on all platforms. Re-enabling it on Windows would require removing all code related to the 3dfxgl implementation of GLide (which neither GCC or YamagiQ2 supports). +- On Windows the old Lazarus save-file system is used w/o Knightmare's enhancements. This is because the list of game functions is slightly different when compiled on Windows, owing to the differences in Sound listed above. + +Release 1 Change Log: +g_cmds.c +Change _MAX_PATH to MAX_OSPATH +Added Q_strlwr() definition to replace non-standard strlwr() reference +Change stricmp() references to Q_stricmp() +Added Knightmare's SetLazarusCrosshair() definition + +g_crane.c +Change stricmp() references to Q_stricmp() + +g_fog.c +Uncomment "#define DISABLE_FOG" + +g_func_decs.h & g_func_list.h +Files added to support Knightmare's changes to g_save.c + +g_items.c +*_armor_index variable declarations now match g_local.h +Per Knightmare: Removed "static" modifier from declarations for drop_temp_touch() and drop_make_touchable() + +g_local.h +Added max/min macros +Added "#define DISABLE_FMOD" if not compiled on Windows + +g_misc.c +Don't patch models; comment out Windows-specific direct.h +Make sure self->activator->classname isn't NULL before using it in func_clock_screen_think() +Per Knightmare: Removed "static" modifier from declarations for func_clock_reset(), func_clock_format_countdown(), and light_use() + +g_mmove_decs.h & g_mmove_list.h +Files added to support Knightmare's changes to g_save.c + +g_monster.c +Comment out Windows-specific direct.h + +g_patchplayermodels.c +Don't patch models; comment out Windows-specific direct.h + +g_target.c +Change stricmp() references to Q_stricmp() + +g_trigger.c +Change stricmp() references to Q_stricmp() +Added Yamagi's code for locating the YamagiQ2 save directory to trans_ent_filename() + +g_save.c +Replaced original g_save.c file with Knightmare's version +Moved Knightmare's "#define"s related to saving from q_shared.h to g_save.c +Add "#ifndef DISABLE_FMOD" block around call to FMOD's ReadTextureSurfaceAssignments() +Re-order text displayed when InitGame() is called to match YamagiQ2's expected formatting + +g_sound.c +Added Knightmare's "#ifdef DISABLE_FMOD" code-block + +g_spawn.c +Change _MAX_PATH to MAX_OSPATH +Add "#ifndef DISABLE_FMOD" block around use of FMOD footsteps boolean + +g_trigger.c +Change _MAX_PATH to MAX_OSPATH + +g_weapon.c +Per Knightmare: Removed "static" modifier from declarations for check_dodge(), check_dodge_inf_mg(), fire_lead(), Grenade_Add_To_Chain(), Grenade_Remove_From_Chain(), Grenade_Explode(), Grenade_Touch(), rocket_explode(), and rocket_die() + +p_client.c +Change stricmp() references to Q_stricmp() +Per Knightmare: Removed "static" modifier from declarations for SP_FixCoopSpots() and SP_CreateCoopSpots() + +m_actor.c +Change stricmp() references to Q_stricmp() + +p_client.c +Added Knightmare's calls to SetLazarusCrosshair() + +p_text.c +Explicitly cast temp_buffer variable as char before math operations +Change stricmp() references to Q_stricmp() +Use "/" instead of "\\" when delineating folder names + +p_view.c +Add "#ifndef DISABLE_FMOD" block around use of FMOD footsteps boolean +Change stricmp() references to Q_stricmp() + +q_shared.c +Added "#define GCC_COMP" to disable operations unsupported by GCC diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..5f4374d --- /dev/null +++ b/Makefile @@ -0,0 +1,244 @@ +# ----------------------------------------------------- # +# Makefile for the "Slight Mechanical Destruction # +# by Musashi" (SMD) game module for Quake II # +# Ported from the original SMD source code for Windows # +# by Alkaline - See included Changelog for details # +# # +# Just type "make" to compile the # +# SMD Game library (game.so / game.dylib / game.dll) # +# # +# Build Dependencies: # +# - None, but you need Quake II (and SMD) to play. # +# While in theory any engine should work, # +# Yamagi Quake II is recommended. # +# # +# Compatible Platforms: # +# - Linux (compiles, plays, and saves) # +# - macOS (compiles, plays, and saves) # +# - Windows (compiles w/MinGW; not play-tested) # +# - Other? (Should compile on most Unix-like OSes) # +# ----------------------------------------------------- # + +# Detect the OS +ifdef SystemRoot +OSTYPE := Windows +else +OSTYPE := $(shell uname -s) +endif + +# Special case for MinGW +ifneq (,$(findstring MINGW,$(OSTYPE))) +OSTYPE := Windows +endif + +# Detect the architecture +ifeq ($(OSTYPE), Windows) +# At this time only i386 is supported on Windows +ARCH := i386 +# seems like mingw doesn't set CC by default +CC := gcc +else +# Some platforms call it "amd64" and some "x86_64" +ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/amd64/x86_64/) +endif + +# Refuse all other platforms as a firewall against PEBKAC +# (You'll need some #ifdef for your unsupported platform!) +ifeq ($(findstring $(ARCH), i386 x86_64 sparc64 ia64),) +$(error arch $(ARCH) is currently not supported) +endif + +# ---------- + +# Base CFLAGS. +# +# -O2 are enough optimizations. +# +# -fno-strict-aliasing since the source doesn't comply +# with strict aliasing rules and it's next to impossible +# to get it there... +# +# -fomit-frame-pointer since the framepointer is mostly +# useless for debugging Quake II and slows things down. +# +# -g to build allways with debug symbols. Please do not +# change this, since it's our only chance to debug this +# crap when random crashes happen! +# +# -fPIC for position independend code. +# +# -MMD to generate header dependencies. +ifeq ($(OSTYPE), Darwin) +CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \ + -Wall -pipe -g -fwrapv -arch i386 -arch x86_64 +else +CFLAGS := -O0 -fno-strict-aliasing -fomit-frame-pointer \ + -Wall -pipe -ggdb -MMD -fwrapv +endif + +# ---------- + +# Base LDFLAGS. +ifeq ($(OSTYPE), Darwin) +LDFLAGS := -shared -arch i386 -arch x86_64 +else +LDFLAGS := -shared +endif + +# ---------- + +# Builds everything +all: smd + +# ---------- + +# When make is invoked by "make VERBOSE=1" print +# the compiler and linker commands. + +ifdef VERBOSE +Q := +else +Q := @ +endif + +# ---------- + +# Phony targets +.PHONY : all clean smd + +# ---------- + +# Cleanup +clean: + @echo "===> CLEAN" + ${Q}rm -Rf build release + +# ---------- + +# The SMD game +ifeq ($(OSTYPE), Windows) +FILESUFFIX := dll +smd: + @echo "===> Building game.dll" + ${Q}mkdir -p release + $(MAKE) release/game.dll + +build/%.o: %.c + @echo "===> CC $<" + ${Q}mkdir -p $(@D) + ${Q}$(CC) -c $(CFLAGS) -o $@ $< +else + ifeq ($(OSTYPE), Darwin) + FILESUFFIX := dylib + else + FILESUFFIX := so + endif + +smd: + @echo "===> Building game.${FILESUFFIX}" + ${Q}mkdir -p release + $(MAKE) release/game.${FILESUFFIX} + +build/%.o: %.c + @echo "===> CC $<" + ${Q}mkdir -p $(@D) + ${Q}$(CC) -c $(CFLAGS) -o $@ $< + +release/game.${FILESUFFIX} : CFLAGS += -fPIC +endif + +# ---------- + +SMD_OBJS_ = \ + src/g_ai.o \ + src/g_camera.o \ + src/g_chase.o \ + src/g_cmds.o \ + src/g_combat.o \ + src/g_crane.o \ + src/g_fog.o \ + src/g_func.o \ + src/g_items.o \ + src/g_jetpack.o \ + src/g_lights.o \ + src/g_lock.o \ + src/g_main.o \ + src/g_misc.o \ + src/g_model.o \ + src/g_monster.o \ + src/g_mtrain.o \ + src/g_newai.o \ + src/g_patchplayermodels.o \ + src/g_pendulum.o \ + src/g_phys.o \ + src/g_reflect.o \ + src/g_save.o \ + src/g_sound.o \ + src/g_spawn.o \ + src/g_svcmds.o \ + src/g_target.o \ + src/g_thing.o \ + src/g_tracktrain.o \ + src/g_trigger.o \ + src/g_turret.o \ + src/g_utils.o \ + src/g_vehicle.o \ + src/g_weapon.o \ + src/m_actor_weap.o \ + src/m_actor.o \ + src/m_berserk.o \ + src/m_boss2.o \ + src/m_boss3.o \ + src/m_boss31.o \ + src/m_boss32.o \ + src/m_brain.o \ + src/m_chick.o \ + src/m_flash.o \ + src/m_flipper.o \ + src/m_float.o \ + src/m_flyer.o \ + src/m_gladiator.o \ + src/m_gunner.o \ + src/m_hover.o \ + src/m_infantry.o \ + src/m_insane.o \ + src/m_medic.o \ + src/m_move.o \ + src/m_mutant.o \ + src/m_parasite.o \ + src/m_sentrybot.o \ + src/m_soldier.o \ + src/m_supertank.o \ + src/m_tank.o \ + src/p_client.o \ + src/p_chase.o \ + src/p_hud.o \ + src/p_menu.o \ + src/p_text.o \ + src/p_trail.o \ + src/p_view.o \ + src/p_weapon.o \ + src/q_shared.o + +# ---------- + +# Rewrite paths to our object directory +SMD_OBJS = $(patsubst %,build/%,$(SMD_OBJS_)) + +# ---------- + +# Generate header dependencies +SMD_DEPS= $(SMD_OBJS:.o=.d) + +# ---------- + +# Suck header dependencies in +-include $(SMD_DEPS) + +# ---------- + +release/game.${FILESUFFIX} : $(SMD_OBJS) + @echo "===> LD $@" + ${Q}$(CC) $(LDFLAGS) -o $@ $(SMD_OBJS) + +# ---------- diff --git a/src/g_cmds.c b/src/g_cmds.c index b05f657..42d2f63 100644 --- a/src/g_cmds.c +++ b/src/g_cmds.c @@ -3,6 +3,17 @@ int nostatus = 0; +char *Q_strlwr(char *str) +{ + unsigned char *p = (unsigned char *)str; + + while (*p) { + *p = tolower((unsigned char)*p); + p++; + } + + return str; +} void RotateAngles(vec3_t in, vec3_t delta, vec3_t out) { @@ -875,7 +886,7 @@ void Cmd_Use_f (edict_t *ent) } index = ITEM_INDEX(it); #ifdef JETPACK_MOD - if(!stricmp(s,"jetpack")) + if(!Q_stricmp(s,"jetpack")) { // Special case - turns on/off if(!ent->client->jetpack) @@ -897,7 +908,7 @@ void Cmd_Use_f (edict_t *ent) return; } #endif - if (!stricmp(s,"stasis generator")) + if (!Q_stricmp(s,"stasis generator")) { // Special case - turn freeze off if already on if(level.freeze) @@ -1032,7 +1043,7 @@ void Cmd_InvUse_f (edict_t *ent) } #ifdef JETPACK_MOD - if(!stricmp(it->classname,"item_jetpack")) + if(!Q_stricmp(it->classname,"item_jetpack")) { if(!ent->client->jetpack) { @@ -1535,6 +1546,18 @@ void Cmd_Bbox_f (edict_t *ent) DrawBBox(viewing); } +void SetLazarusCrosshair (edict_t *ent) +{ + if (deathmatch->value || coop->value) return; + if (!ent->inuse) return; + if (!ent->client) return; + if (ent->client->zoomed || ent->client->zooming) + return; + + gi.cvar_forceset("lazarus_crosshair", va("%d",(int)(crosshair->value))); + gi.cvar_forceset("lazarus_cl_gun", va("%d",(int)(cl_gun->value))); +} + void SetSensitivities(edict_t *ent,qboolean reset) { char string[512]; @@ -2081,7 +2104,7 @@ void ClientCommand (edict_t *ent) { edict_t *temp; - strlwr(parm); + Q_strlwr(parm); temp = G_Spawn(); temp->message = parm; temp->volume = 255; @@ -2101,7 +2124,7 @@ void ClientCommand (edict_t *ent) else if(!Q_stricmp(cmd, "properties")) { if(parm) { - char filename[_MAX_PATH]; + char filename[MAX_OSPATH]; edict_t *e; FILE *f; // int i; diff --git a/src/g_crane.c b/src/g_crane.c index d10a806..3708877 100644 --- a/src/g_crane.c +++ b/src/g_crane.c @@ -217,7 +217,7 @@ void Crane_Move_Done (edict_t *ent) } // Lazarus: ACK! If crate is being carried, it's NOT a MOVETYPE_PUSHABLE!!!! // if(ent->movetype == MOVETYPE_PUSHABLE) - if(!stricmp(ent->classname,"func_pushable")) + if(!Q_stricmp(ent->classname,"func_pushable")) { edict_t *e; @@ -421,7 +421,7 @@ void Crane_Move_Final (edict_t *ent) } VectorScale (ent->moveinfo.dir, ent->moveinfo.remaining_distance / FRAMETIME, ent->velocity); - if(!stricmp(ent->classname,"crane_hook")) + if(!Q_stricmp(ent->classname,"crane_hook")) { VectorCopy(ent->velocity,ent->crane_cable->velocity); ent->crane_cable->velocity[2] = 0; @@ -450,7 +450,7 @@ void Crane_Move_Begin (edict_t *ent) VectorScale (ent->moveinfo.dir, ent->moveinfo.speed, ent->velocity); frames = floor((ent->moveinfo.remaining_distance / ent->moveinfo.speed) / FRAMETIME); ent->moveinfo.remaining_distance -= frames * ent->moveinfo.speed * FRAMETIME; - if(!stricmp(ent->classname,"crane_hook")) + if(!Q_stricmp(ent->classname,"crane_hook")) { if((ent->crane_light) && (ent->crane_cargo==NULL)) { @@ -494,7 +494,7 @@ void G_FindCraneParts() continue; if (!e->classname) continue; - if (stricmp(e->classname,"crane_control")) + if (Q_stricmp(e->classname,"crane_control")) continue; control = e; diff --git a/src/g_fog.c b/src/g_fog.c index 7e0775f..19eab6b 100644 --- a/src/g_fog.c +++ b/src/g_fog.c @@ -1,6 +1,6 @@ #include "g_local.h" -//#define DISABLE_FOG +#define DISABLE_FOG #ifdef DISABLE_FOG void Fog_Init() diff --git a/src/g_func_decs.h b/src/g_func_decs.h new file mode 100644 index 0000000..7afda26 --- /dev/null +++ b/src/g_func_decs.h @@ -0,0 +1,1620 @@ +extern void Info_SetValueForKey ( char * s , char * key , char * value ) ; +extern qboolean Info_Validate ( char * s ) ; +extern void Info_RemoveKey ( char * s , char * key ) ; +extern char * Info_ValueForKey ( char * s , char * key ) ; +extern void Com_sprintf ( char * dest , int size , char * fmt , ... ) ; +extern int Q_strcasecmp ( char * s1 , char * s2 ) ; +extern int Q_strncasecmp ( char * s1 , char * s2 , int n ) ; +extern int Q_stricmp ( char * s1 , char * s2 ) ; +extern void Com_PageInMemory ( byte * buffer , int size ) ; +extern char * COM_Parse ( char * * data_p ) ; +extern char * va ( char * format , ... ) ; +extern void Swap_Init ( void ) ; +extern float FloatNoSwap ( float f ) ; +extern float FloatSwap ( float f ) ; +extern int LongNoSwap ( int l ) ; +extern int LongSwap ( int l ) ; +extern short ShortNoSwap ( short l ) ; +extern short ShortSwap ( short l ) ; +extern float LittleFloat ( float l ) ; +extern float BigFloat ( float l ) ; +extern int LittleLong ( int l ) ; +extern int BigLong ( int l ) ; +extern short LittleShort ( short l ) ; +extern short BigShort ( short l ) ; +extern void COM_DefaultExtension ( char * path , char * extension ) ; +extern void COM_FilePath ( char * in , char * out ) ; +extern void COM_FileBase ( char * in , char * out ) ; +extern char * COM_FileExtension ( char * in ) ; +extern void COM_StripExtension ( char * in , char * out ) ; +extern char * COM_SkipPath ( char * pathname ) ; +extern int Q_log2 ( int val ) ; +extern void VectorScale ( vec3_t in , vec_t scale , vec3_t out ) ; +extern void VectorInverse ( vec3_t v ) ; +extern vec_t VectorLength ( vec3_t v ) ; +extern void CrossProduct ( vec3_t v1 , vec3_t v2 , vec3_t cross ) ; +extern void _VectorCopy ( vec3_t in , vec3_t out ) ; +extern void _VectorAdd ( vec3_t veca , vec3_t vecb , vec3_t out ) ; +extern void _VectorSubtract ( vec3_t veca , vec3_t vecb , vec3_t out ) ; +extern vec_t _DotProduct ( vec3_t v1 , vec3_t v2 ) ; +extern void VectorMA ( vec3_t veca , float scale , vec3_t vecb , vec3_t vecc ) ; +extern vec_t VectorNormalize2 ( vec3_t v , vec3_t out ) ; +extern vec_t VectorNormalize ( vec3_t v ) ; +extern int VectorCompare ( vec3_t v1 , vec3_t v2 ) ; +extern void AddPointToBounds ( vec3_t v , vec3_t mins , vec3_t maxs ) ; +extern void ClearBounds ( vec3_t mins , vec3_t maxs ) ; +extern int BoxOnPlaneSide ( vec3_t emins , vec3_t emaxs , struct cplane_s * p ) ; +extern int BoxOnPlaneSide2 ( vec3_t emins , vec3_t emaxs , struct cplane_s * p ) ; +extern float anglemod ( float a ) ; +extern float LerpAngle ( float a2 , float a1 , float frac ) ; +extern float Q_fabs ( float f ) ; +extern void R_ConcatTransforms ( float in1 [ 3 ] [ 4 ] , float in2 [ 3 ] [ 4 ] , float out [ 3 ] [ 4 ] ) ; +extern void R_ConcatRotations ( float in1 [ 3 ] [ 3 ] , float in2 [ 3 ] [ 3 ] , float out [ 3 ] [ 3 ] ) ; +extern void PerpendicularVector ( vec3_t dst , const vec3_t src ) ; +extern void ProjectPointOnPlane ( vec3_t dst , const vec3_t p , const vec3_t normal ) ; +extern void AngleVectors ( vec3_t angles , vec3_t forward , vec3_t right , vec3_t up ) ; +extern void RotatePointAroundVector ( vec3_t dst , const vec3_t dir , const vec3_t point , float degrees ) ; +extern void kick_attack ( edict_t * ent ) ; +extern void Weapon_Null ( edict_t * ent ) ; +extern void Weapon_BFG ( edict_t * ent ) ; +extern void weapon_bfg_fire ( edict_t * ent ) ; +extern void Weapon_Railgun ( edict_t * ent ) ; +extern void weapon_railgun_fire ( edict_t * ent ) ; +extern void Weapon_SuperShotgun ( edict_t * ent ) ; +extern void weapon_supershotgun_fire ( edict_t * ent ) ; +extern void Weapon_Shotgun ( edict_t * ent ) ; +extern void weapon_shotgun_fire ( edict_t * ent ) ; +extern void Weapon_Chaingun ( edict_t * ent ) ; +extern void Chaingun_Fire ( edict_t * ent ) ; +extern void Weapon_Machinegun ( edict_t * ent ) ; +extern void Machinegun_Fire ( edict_t * ent ) ; +extern void Weapon_HyperBlaster ( edict_t * ent ) ; +extern void Weapon_HyperBlaster_Fire ( edict_t * ent ) ; +extern void Weapon_Blaster ( edict_t * ent ) ; +extern void Weapon_Blaster_Fire ( edict_t * ent ) ; +extern void Blaster_Fire ( edict_t * ent , vec3_t g_offset , int damage , qboolean hyper , int effect ) ; +extern void Weapon_HomingMissileLauncher ( edict_t * ent ) ; +extern void Weapon_HomingMissileLauncher_Fire ( edict_t * ent ) ; +extern void Weapon_RocketLauncher ( edict_t * ent ) ; +extern void Weapon_RocketLauncher_Fire ( edict_t * ent ) ; +extern edict_t * rocket_target ( edict_t * self , vec3_t start , vec3_t forward ) ; +extern void Weapon_GrenadeLauncher ( edict_t * ent ) ; +extern void weapon_grenadelauncher_fire ( edict_t * ent ) ; +extern void Weapon_Grenade ( edict_t * ent ) ; +extern void weapon_grenade_fire ( edict_t * ent , qboolean held ) ; +extern void Weapon_Generic ( edict_t * ent , int FRAME_ACTIVATE_LAST , int FRAME_FIRE_LAST , int FRAME_IDLE_LAST , int FRAME_DEACTIVATE_LAST , int * pause_frames , int * fire_frames , void ( * fire ) ( edict_t * ent ) ) ; +extern void Drop_Weapon ( edict_t * ent , gitem_t * item ) ; +extern void Use_Weapon ( edict_t * ent , gitem_t * in_item ) ; +extern void Think_Weapon ( edict_t * ent ) ; +extern void NoAmmoWeaponChange ( edict_t * ent ) ; +extern void ChangeWeapon ( edict_t * ent ) ; +extern qboolean Pickup_Weapon ( edict_t * ent , edict_t * other ) ; +extern void PlayerNoise ( edict_t * who , vec3_t where , int type ) ; +extern void P_ProjectSource ( gclient_t * client , vec3_t point , vec3_t distance , vec3_t forward , vec3_t right , vec3_t result ) ; +extern void ClientEndServerFrame ( edict_t * ent ) ; +extern void WhatsIt ( edict_t * ent ) ; +extern void G_SetClientFrame ( edict_t * ent ) ; +extern void G_SetClientSound ( edict_t * ent ) ; +extern void G_SetClientEvent ( edict_t * ent ) ; +extern void G_SetClientEffects ( edict_t * ent ) ; +extern void P_WorldEffects ( void ) ; +extern void P_FallingDamage ( edict_t * ent ) ; +extern void P_SlamDamage ( edict_t * ent ) ; +extern void SV_CalcBlend ( edict_t * ent ) ; +extern void SV_AddBlend ( float r , float g , float b , float a , float * v_blend ) ; +extern void SV_CalcGunOffset ( edict_t * ent ) ; +extern void SV_CalcViewOffset ( edict_t * ent ) ; +extern void P_DamageFeedback ( edict_t * player ) ; +extern float SV_CalcRoll ( vec3_t angles , vec3_t velocity ) ; +extern edict_t * PlayerTrail_LastSpot ( void ) ; +extern edict_t * PlayerTrail_PickNext ( edict_t * self ) ; +extern edict_t * PlayerTrail_PickFirst ( edict_t * self ) ; +extern void PlayerTrail_New ( vec3_t spot ) ; +extern void PlayerTrail_Add ( vec3_t spot ) ; +extern void PlayerTrail_Init ( void ) ; +extern void SP_target_text ( edict_t * self ) ; +extern void Use_Target_Text ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void Do_Text_Display ( edict_t * activator , int flags , char * message ) ; +extern void Text_Prev ( edict_t * ent ) ; +extern void Text_Next ( edict_t * ent ) ; +extern void Text_Update ( edict_t * ent ) ; +extern void Text_BuildDisplay ( texthnd_t * hnd ) ; +extern void Text_Close ( edict_t * ent ) ; +extern void Text_Open ( edict_t * ent ) ; +extern void PMenu_Select ( edict_t * ent ) ; +extern void PMenu_Prev ( edict_t * ent ) ; +extern void PMenu_Next ( edict_t * ent ) ; +extern void PMenu_Update ( edict_t * ent ) ; +extern void PMenu_Close ( edict_t * ent ) ; +extern void PMenu_Open ( edict_t * ent , pmenu_t * entries , int cur , int num ) ; +extern void G_SetSpectatorStats ( edict_t * ent ) ; +extern void G_CheckChaseStats ( edict_t * ent ) ; +extern void G_SetStats ( edict_t * ent ) ; +extern void WhatIsIt ( edict_t * ent ) ; +extern void Cmd_Help_f ( edict_t * ent ) ; +extern void HelpComputer ( edict_t * ent ) ; +extern void Cmd_Score_f ( edict_t * ent ) ; +extern void DeathmatchScoreboard ( edict_t * ent ) ; +extern void DeathmatchScoreboardMessage ( edict_t * ent , edict_t * killer ) ; +extern void BeginIntermission ( edict_t * targ ) ; +extern void MoveClientToIntermission ( edict_t * ent ) ; +extern void ClientBeginServerFrame ( edict_t * ent ) ; +extern void ClientThink ( edict_t * ent , usercmd_t * ucmd ) ; +extern void ClientSpycam ( edict_t * ent ) ; +extern void ClientPushPushable ( edict_t * ent ) ; +extern void RemovePush ( edict_t * ent ) ; +extern float PM_CmdScale ( usercmd_t * cmd ) ; +extern void PrintPmove ( pmove_t * pm ) ; +extern unsigned CheckBlock ( void * b , int c ) ; +extern trace_t PM_trace ( vec3_t start , vec3_t mins , vec3_t maxs , vec3_t end ) ; +extern void ClientDisconnect ( edict_t * ent ) ; +extern qboolean ClientConnect ( edict_t * ent , char * userinfo ) ; +extern void ClientUserinfoChanged ( edict_t * ent , char * userinfo ) ; +extern void ClientBegin ( edict_t * ent ) ; +extern void ClientBeginDeathmatch ( edict_t * ent ) ; +extern void PutClientInServer ( edict_t * ent ) ; +extern void spectator_respawn ( edict_t * ent ) ; +extern void respawn ( edict_t * self ) ; +extern void CopyToBodyQue ( edict_t * ent ) ; +extern void body_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void InitBodyQue ( void ) ; +extern void SelectSpawnPoint ( edict_t * ent , vec3_t origin , vec3_t angles , int * style , int * health ) ; +extern edict_t * SelectCoopSpawnPoint ( edict_t * ent ) ; +extern edict_t * SelectDeathmatchSpawnPoint ( void ) ; +extern edict_t * SelectFarthestDeathmatchSpawnPoint ( void ) ; +extern edict_t * SelectRandomDeathmatchSpawnPoint ( void ) ; +extern float PlayersRangeFromSpot ( edict_t * spot ) ; +extern void FetchClientEntData ( edict_t * ent ) ; +extern void SaveClientData ( void ) ; +extern void InitClientResp ( gclient_t * client ) ; +extern void InitClientPersistant ( gclient_t * client , int style ) ; +extern void SelectStartWeapon ( gclient_t * client , int style ) ; +extern void player_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void LookAtKiller ( edict_t * self , edict_t * inflictor , edict_t * attacker ) ; +extern void TossClientWeapon ( edict_t * self ) ; +extern void ClientObituary ( edict_t * self , edict_t * inflictor , edict_t * attacker ) ; +extern qboolean IsNeutral ( edict_t * ent ) ; +extern qboolean IsFemale ( edict_t * ent ) ; +extern void player_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void SP_info_player_intermission ( void ) ; +extern void SP_info_player_coop ( edict_t * self ) ; +extern void SP_info_player_deathmatch ( edict_t * self ) ; +extern void SP_info_player_start ( edict_t * self ) ; +extern void SP_CreateCoopSpots ( edict_t * self ) ; +extern void SP_FixCoopSpots ( edict_t * self ) ; +extern void CheckChasecam_Viewent ( edict_t * ent ) ; +extern void Cmd_Chasecam_Toggle ( edict_t * ent ) ; +extern void ChasecamTrack ( edict_t * ent ) ; +extern void ChasecamRemove ( edict_t * ent , int opt ) ; +extern void ChasecamRestart ( edict_t * ent ) ; +extern void ChasecamStart ( edict_t * ent ) ; +extern void SP_monster_tank ( edict_t * self ) ; +extern void tank_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void tank_dead ( edict_t * self ) ; +extern void tank_cmdr_body_think ( edict_t * self ) ; +extern void tank_attack ( edict_t * self ) ; +extern void tank_doattack_rocket ( edict_t * self ) ; +extern void tank_refire_rocket ( edict_t * self ) ; +extern void tank_poststrike ( edict_t * self ) ; +extern void tank_reattack_blaster ( edict_t * self ) ; +extern void TankMachineGun ( edict_t * self ) ; +extern void TankRocket ( edict_t * self ) ; +extern void TankStrike ( edict_t * self ) ; +extern void TankBlaster ( edict_t * self ) ; +extern void tank_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void tank_run ( edict_t * self ) ; +extern void tank_walk ( edict_t * self ) ; +extern void tank_stand ( edict_t * self ) ; +extern void tank_idle ( edict_t * self ) ; +extern void tank_windup ( edict_t * self ) ; +extern void tank_thud ( edict_t * self ) ; +extern void tank_footstep ( edict_t * self ) ; +extern void tank_sight ( edict_t * self , edict_t * other ) ; +extern void SP_monster_supertank ( edict_t * self ) ; +extern void supertank_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void BossExplode ( edict_t * self ) ; +extern void supertank_dead ( edict_t * self ) ; +extern void supertank_attack ( edict_t * self ) ; +extern void supertankMachineGun ( edict_t * self ) ; +extern void supertankRocket ( edict_t * self ) ; +extern void supertank_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void supertank_reattack1 ( edict_t * self ) ; +extern void supertank_run ( edict_t * self ) ; +extern void supertank_walk ( edict_t * self ) ; +extern void supertank_forward ( edict_t * self ) ; +extern void supertank_stand ( edict_t * self ) ; +extern void supertank_search ( edict_t * self ) ; +extern void TreadSound ( edict_t * self ) ; +extern void SP_monster_soldier_ss ( edict_t * self ) ; +extern void SP_monster_soldier ( edict_t * self ) ; +extern void SP_monster_soldier_light ( edict_t * self ) ; +extern void SP_monster_soldier_x ( edict_t * self ) ; +extern void soldier_jump ( edict_t * self ) ; +extern void soldier_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void soldier_dead ( edict_t * self ) ; +extern void soldier_fire7 ( edict_t * self ) ; +extern void soldier_fire6 ( edict_t * self ) ; +extern void soldier_dodge ( edict_t * self , edict_t * attacker , float eta ) ; +extern void soldier_duck_hold ( edict_t * self ) ; +extern void soldier_sight ( edict_t * self , edict_t * other ) ; +extern void soldier_attack ( edict_t * self ) ; +extern void soldier_attack6_refire ( edict_t * self ) ; +extern void soldier_fire8 ( edict_t * self ) ; +extern void soldier_fire4 ( edict_t * self ) ; +extern void soldier_attack3_refire ( edict_t * self ) ; +extern void soldier_fire3 ( edict_t * self ) ; +extern void soldier_duck_up ( edict_t * self ) ; +extern void soldier_duck_down ( edict_t * self ) ; +extern void soldier_attack2_refire2 ( edict_t * self ) ; +extern void soldier_attack2_refire1 ( edict_t * self ) ; +extern void soldier_fire2 ( edict_t * self ) ; +extern void soldier_attack1_refire2 ( edict_t * self ) ; +extern void soldier_attack1_refire1 ( edict_t * self ) ; +extern void soldier_fire1 ( edict_t * self ) ; +extern void soldier_fire ( edict_t * self , int flash_number ) ; +extern void soldier_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void soldier_run ( edict_t * self ) ; +extern void soldier_walk ( edict_t * self ) ; +extern void soldier_walk1_random ( edict_t * self ) ; +extern void soldier_stand ( edict_t * self ) ; +extern void soldier_cock ( edict_t * self ) ; +extern void soldier_idle ( edict_t * self ) ; +extern void SP_monster_sentrybot ( edict_t * self ) ; +extern void sentrybot_attack ( edict_t * self ) ; +extern void sentrybot_fire ( edict_t * self ) ; +extern void sentrybot_MG ( edict_t * self ) ; +extern void sentrybot_HB ( edict_t * self ) ; +extern void sentrybot_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void sentrybot_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void sentrybot_jump ( edict_t * self ) ; +extern void sentrybot_run ( edict_t * self ) ; +extern void sentrybot_walk ( edict_t * self ) ; +extern void sentrybot_sound_move ( edict_t * self ) ; +extern void sentrybot_sight ( edict_t * self , edict_t * other ) ; +extern void sentrybot_search ( edict_t * self ) ; +extern void sentrybot_idle ( edict_t * self ) ; +extern void sentrybot_stand ( edict_t * self ) ; +extern void sentrybot_sound_stand ( edict_t * self ) ; +extern void SP_monster_parasite ( edict_t * self ) ; +extern void parasite_jump ( edict_t * self ) ; +extern void parasite_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void parasite_dead ( edict_t * self ) ; +extern void parasite_attack ( edict_t * self ) ; +extern void parasite_drain_attack ( edict_t * self ) ; +extern qboolean parasite_drain_attack_ok ( vec3_t start , vec3_t end ) ; +extern void parasite_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void parasite_walk ( edict_t * self ) ; +extern void parasite_start_walk ( edict_t * self ) ; +extern void parasite_run ( edict_t * self ) ; +extern void parasite_start_run ( edict_t * self ) ; +extern void parasite_stand ( edict_t * self ) ; +extern void parasite_idle ( edict_t * self ) ; +extern void parasite_refidget ( edict_t * self ) ; +extern void parasite_do_fidget ( edict_t * self ) ; +extern void parasite_end_fidget ( edict_t * self ) ; +extern void parasite_search ( edict_t * self ) ; +extern void parasite_scratch ( edict_t * self ) ; +extern void parasite_tap ( edict_t * self ) ; +extern void parasite_sight ( edict_t * self , edict_t * other ) ; +extern void parasite_reel_in ( edict_t * self ) ; +extern void parasite_launch ( edict_t * self ) ; +extern void SP_monster_mutant ( edict_t * self ) ; +extern void mutant_fake_jump ( edict_t * self ) ; +extern void mutant_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void mutant_dead ( edict_t * self ) ; +extern void mutant_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern qboolean mutant_checkattack ( edict_t * self ) ; +extern qboolean mutant_check_jump ( edict_t * self ) ; +extern qboolean mutant_check_melee ( edict_t * self ) ; +extern void mutant_jump ( edict_t * self ) ; +extern void mutant_check_landing ( edict_t * self ) ; +extern void mutant_jump_takeoff ( edict_t * self ) ; +extern void mutant_jump_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void mutant_melee ( edict_t * self ) ; +extern void mutant_check_refire ( edict_t * self ) ; +extern void mutant_hit_right ( edict_t * self ) ; +extern void mutant_hit_left ( edict_t * self ) ; +extern void mutant_run ( edict_t * self ) ; +extern void mutant_walk ( edict_t * self ) ; +extern void mutant_walk_loop ( edict_t * self ) ; +extern void mutant_idle ( edict_t * self ) ; +extern void mutant_idle_loop ( edict_t * self ) ; +extern void mutant_stand ( edict_t * self ) ; +extern void mutant_swing ( edict_t * self ) ; +extern void mutant_search ( edict_t * self ) ; +extern void mutant_sight ( edict_t * self , edict_t * other ) ; +extern void mutant_step ( edict_t * self ) ; +extern qboolean M_walkmove ( edict_t * ent , float yaw , float dist ) ; +extern void M_MoveToGoal ( edict_t * ent , float dist ) ; +extern qboolean SV_CloseEnough ( edict_t * ent , edict_t * goal , float dist ) ; +extern void SV_NewChaseDir ( edict_t * actor , edict_t * enemy , float dist ) ; +extern void SV_FixCheckBottom ( edict_t * ent ) ; +extern qboolean SV_StepDirection ( edict_t * ent , float yaw , float dist ) ; +extern void M_ChangeYaw ( edict_t * ent ) ; +extern qboolean SV_movestep ( edict_t * ent , vec3_t move , qboolean relink ) ; +extern qboolean M_CheckBottom ( edict_t * ent ) ; +extern void SP_monster_medic ( edict_t * self ) ; +extern qboolean medic_checkattack ( edict_t * self ) ; +extern void medic_attack ( edict_t * self ) ; +extern void medic_hook_retract ( edict_t * self ) ; +extern void medic_cable_attack ( edict_t * self ) ; +extern void medic_hook_launch ( edict_t * self ) ; +extern void medic_continue ( edict_t * self ) ; +extern void medic_dodge ( edict_t * self , edict_t * attacker , float eta ) ; +extern void medic_duck_up ( edict_t * self ) ; +extern void medic_duck_hold ( edict_t * self ) ; +extern void medic_duck_down ( edict_t * self ) ; +extern void medic_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void medic_dead ( edict_t * self ) ; +extern void medic_fire_blaster ( edict_t * self ) ; +extern void medic_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void medic_run ( edict_t * self ) ; +extern void medic_walk ( edict_t * self ) ; +extern void medic_stand ( edict_t * self ) ; +extern void medic_sight ( edict_t * self , edict_t * other ) ; +extern void medic_search ( edict_t * self ) ; +extern void medic_idle ( edict_t * self ) ; +extern void medic_NextPatrolPoint ( edict_t * self , edict_t * hint ) ; +extern void medic_StopPatrolling ( edict_t * self ) ; +extern edict_t * medic_FindDeadMonster ( edict_t * self ) ; +extern qboolean embedded ( edict_t * ent ) ; +extern void abortHeal ( edict_t * self , qboolean mark ) ; +extern void DeleteBadMedic ( edict_t * self ) ; +extern void cleanupHeal ( edict_t * self , qboolean change_frame ) ; +extern void deadmonster_think ( edict_t * self ) ; +extern void SP_misc_insane ( edict_t * self ) ; +extern void insane_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void insane_dead ( edict_t * self ) ; +extern void insane_stand ( edict_t * self ) ; +extern void insane_checkup ( edict_t * self ) ; +extern void insane_checkdown ( edict_t * self ) ; +extern void insane_onground ( edict_t * self ) ; +extern void insane_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void insane_run ( edict_t * self ) ; +extern void insane_walk ( edict_t * self ) ; +extern void insane_cross ( edict_t * self ) ; +extern void insane_scream ( edict_t * self ) ; +extern void insane_moan ( edict_t * self ) ; +extern void insane_shake ( edict_t * self ) ; +extern void insane_fist ( edict_t * self ) ; +extern void SP_monster_infantry ( edict_t * self ) ; +extern void infantry_jump ( edict_t * self ) ; +extern void infantry_attack ( edict_t * self ) ; +extern void infantry_smack ( edict_t * self ) ; +extern void infantry_swing ( edict_t * self ) ; +extern void infantry_fire ( edict_t * self ) ; +extern void infantry_cock_gun ( edict_t * self ) ; +extern void infantry_dodge ( edict_t * self , edict_t * attacker , float eta ) ; +extern void infantry_end_roll ( edict_t * self ) ; +extern void infantry_roll ( edict_t * self ) ; +extern void infantry_start_roll ( edict_t * self ) ; +extern void infantry_duck_up ( edict_t * self ) ; +extern void infantry_duck_hold ( edict_t * self ) ; +extern void infantry_duck_down ( edict_t * self ) ; +extern void infantry_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void blood_spurt ( edict_t * self ) ; +extern void infantry_dead ( edict_t * self ) ; +extern void infantry_sight ( edict_t * self , edict_t * other ) ; +extern void InfantryMachineGun ( edict_t * self ) ; +extern void InfantryHyperBlaster ( edict_t * self ) ; +extern void infantry_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void infantry_run ( edict_t * self ) ; +extern void infantry_walk ( edict_t * self ) ; +extern void infantry_fidget ( edict_t * self ) ; +extern void infantry_stand ( edict_t * self ) ; +extern void SP_monster_hover ( edict_t * self ) ; +extern void hover_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void hover_dead ( edict_t * self ) ; +extern void hover_deadthink ( edict_t * self ) ; +extern void hover_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void hover_dodge ( edict_t * self , edict_t * attacker , float eta ) ; +extern void hover_attack ( edict_t * self ) ; +extern void hover_start_attack ( edict_t * self ) ; +extern void hover_walk ( edict_t * self ) ; +extern void hover_run ( edict_t * self ) ; +extern void hover_stand ( edict_t * self ) ; +extern void hover_fire_blaster ( edict_t * self ) ; +extern void hover_fire_rocket ( edict_t * self ) ; +extern void hover_reattack ( edict_t * self ) ; +extern void hover_search ( edict_t * self ) ; +extern void hover_sight ( edict_t * self , edict_t * other ) ; +extern void SP_monster_gunner ( edict_t * self ) ; +extern void gunner_jump ( edict_t * self ) ; +extern void gunner_refire_chain ( edict_t * self ) ; +extern void gunner_fire_chain ( edict_t * self ) ; +extern void gunner_attack ( edict_t * self ) ; +extern void GunnerGrenade ( edict_t * self ) ; +extern void SetNotBusy ( edict_t * self ) ; +extern void GunnerFire ( edict_t * self ) ; +extern void gunner_opengun ( edict_t * self ) ; +extern void gunner_dodge ( edict_t * self , edict_t * attacker , float eta ) ; +extern void gunner_duck_up ( edict_t * self ) ; +extern void gunner_duck_hold ( edict_t * self ) ; +extern void gunner_duck_down ( edict_t * self ) ; +extern qboolean gunner_grenade_check ( edict_t * self ) ; +extern void gunner_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void gunner_dead ( edict_t * self ) ; +extern void gunner_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void gunner_runandshoot ( edict_t * self ) ; +extern void gunner_run ( edict_t * self ) ; +extern void gunner_walk ( edict_t * self ) ; +extern void gunner_stand ( edict_t * self ) ; +extern void gunner_fidget ( edict_t * self ) ; +extern void gunner_search ( edict_t * self ) ; +extern void gunner_sight ( edict_t * self , edict_t * other ) ; +extern void gunner_idlesound ( edict_t * self ) ; +extern void SP_monster_gladiator ( edict_t * self ) ; +extern qboolean gladiator_blocked ( edict_t * self , float dist ) ; +extern void gladiator_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void gladiator_dead ( edict_t * self ) ; +extern void gladiator_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void gladiator_attack ( edict_t * self ) ; +extern void GladiatorGun_3 ( edict_t * self ) ; +extern void GladiatorGun_2 ( edict_t * self ) ; +extern void GladiatorGun_1 ( edict_t * self ) ; +extern void GladiatorGun_0 ( edict_t * self ) ; +extern void GladiatorGun ( edict_t * self ) ; +extern void gladiator_melee ( edict_t * self ) ; +extern void GaldiatorMelee ( edict_t * self ) ; +extern void gladiator_run ( edict_t * self ) ; +extern void gladiator_walk ( edict_t * self ) ; +extern void gladiator_stand ( edict_t * self ) ; +extern void gladiator_cleaver_swing ( edict_t * self ) ; +extern void gladiator_search ( edict_t * self ) ; +extern void gladiator_sight ( edict_t * self , edict_t * other ) ; +extern void gladiator_idle ( edict_t * self ) ; +extern void SP_monster_flyer ( edict_t * self ) ; +extern void flyer_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void flyer_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void flyer_check_melee ( edict_t * self ) ; +extern void flyer_melee ( edict_t * self ) ; +extern void flyer_nextmove ( edict_t * self ) ; +extern void flyer_setstart ( edict_t * self ) ; +extern void flyer_attack ( edict_t * self ) ; +extern void flyer_loop_melee ( edict_t * self ) ; +extern void flyer_slash_right ( edict_t * self ) ; +extern void flyer_slash_left ( edict_t * self ) ; +extern void flyer_fireright ( edict_t * self ) ; +extern void flyer_fireleft ( edict_t * self ) ; +extern void flyer_fire ( edict_t * self , int flash_number ) ; +extern void flyer_start ( edict_t * self ) ; +extern void flyer_stop ( edict_t * self ) ; +extern void flyer_stand ( edict_t * self ) ; +extern void flyer_walk ( edict_t * self ) ; +extern void flyer_run ( edict_t * self ) ; +extern void flyer_pop_blades ( edict_t * self ) ; +extern void flyer_idle ( edict_t * self ) ; +extern void flyer_sight ( edict_t * self , edict_t * other ) ; +extern void SP_monster_floater ( edict_t * self ) ; +extern void floater_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void floater_dead ( edict_t * self ) ; +extern void floater_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void floater_dodge ( edict_t * self , edict_t * attacker , float eta ) ; +extern void floater_melee ( edict_t * self ) ; +extern void floater_attack ( edict_t * self ) ; +extern void floater_zap ( edict_t * self ) ; +extern void floater_wham ( edict_t * self ) ; +extern void floater_walk ( edict_t * self ) ; +extern void floater_run ( edict_t * self ) ; +extern void floater_stand ( edict_t * self ) ; +extern void floater_fire_blaster ( edict_t * self ) ; +extern void floater_idle ( edict_t * self ) ; +extern void floater_sight ( edict_t * self , edict_t * other ) ; +extern void SP_monster_flipper ( edict_t * self ) ; +extern void flipper_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void flipper_sight ( edict_t * self , edict_t * other ) ; +extern void flipper_dead ( edict_t * self ) ; +extern void flipper_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void flipper_melee ( edict_t * self ) ; +extern void flipper_preattack ( edict_t * self ) ; +extern void flipper_bite ( edict_t * self ) ; +extern void flipper_start_run ( edict_t * self ) ; +extern void flipper_walk ( edict_t * self ) ; +extern void flipper_run ( edict_t * self ) ; +extern void flipper_run_loop ( edict_t * self ) ; +extern void flipper_stand ( edict_t * self ) ; +extern void SP_monster_chick ( edict_t * self ) ; +extern void chick_sight ( edict_t * self , edict_t * other ) ; +extern void chick_attack ( edict_t * self ) ; +extern void chick_melee ( edict_t * self ) ; +extern void chick_slash ( edict_t * self ) ; +extern void chick_reslash ( edict_t * self ) ; +extern void chick_attack1 ( edict_t * self ) ; +extern void chick_rerocket ( edict_t * self ) ; +extern void chick_skip_frames ( edict_t * self ) ; +extern void ChickReload ( edict_t * self ) ; +extern void Chick_PreAttack1 ( edict_t * self ) ; +extern void ChickRocket ( edict_t * self ) ; +extern void ChickSlash ( edict_t * self ) ; +extern void chick_dodge ( edict_t * self , edict_t * attacker , float eta ) ; +extern void chick_end_backflip ( edict_t * self ) ; +extern void chick_backflip ( edict_t * self ) ; +extern void chick_start_backflip ( edict_t * self ) ; +extern void chick_duck_up ( edict_t * self ) ; +extern void chick_duck_hold ( edict_t * self ) ; +extern void chick_duck_down ( edict_t * self ) ; +extern void chick_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void chick_dead ( edict_t * self ) ; +extern void chick_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void chick_run ( edict_t * self ) ; +extern void chick_walk ( edict_t * self ) ; +extern void chick_stand ( edict_t * self ) ; +extern void chick_fidget ( edict_t * self ) ; +extern void ChickMoan ( edict_t * self ) ; +extern void SP_monster_brain ( edict_t * self ) ; +extern void brain_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void brain_dead ( edict_t * self ) ; +extern void brain_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void brain_attack ( edict_t * self ) ; +extern void brain_drain_check ( edict_t * self ) ; +extern void brain_check_melee ( edict_t * self ) ; +extern void brain_drain_attack ( edict_t * self ) ; +extern qboolean brain_drain_attack_ok ( vec3_t start , vec3_t end ) ; +extern void brain_plasma_attack ( edict_t * self ) ; +extern void brain_run ( edict_t * self ) ; +extern void brain_chest_closed ( edict_t * self ) ; +extern void brain_tentacle_attack ( edict_t * self ) ; +extern void brain_chest_open ( edict_t * self ) ; +extern void brain_hit_left ( edict_t * self ) ; +extern void brain_swing_left ( edict_t * self ) ; +extern void brain_hit_right ( edict_t * self ) ; +extern void brain_swing_right ( edict_t * self ) ; +extern void brain_dodge ( edict_t * self , edict_t * attacker , float eta ) ; +extern void brain_duck_up ( edict_t * self ) ; +extern void brain_duck_hold ( edict_t * self ) ; +extern void brain_duck_down ( edict_t * self ) ; +extern void brain_walk ( edict_t * self ) ; +extern void brain_walk2_cycle ( edict_t * self ) ; +extern void brain_idle ( edict_t * self ) ; +extern void brain_stand ( edict_t * self ) ; +extern void brain_search ( edict_t * self ) ; +extern void brain_sight ( edict_t * self , edict_t * other ) ; +extern void MakronToss ( edict_t * self ) ; +extern void MakronSpawn ( edict_t * self ) ; +extern void SP_monster_makron ( edict_t * self ) ; +extern void MakronPrecache ( void ) ; +extern qboolean Makron_CheckAttack ( edict_t * self ) ; +extern void makron_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void makron_dead ( edict_t * self ) ; +extern void makron_torso ( edict_t * ent ) ; +extern void makron_torso_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void makron_torso_think ( edict_t * self ) ; +extern void makron_attack ( edict_t * self ) ; +extern void makron_sight ( edict_t * self , edict_t * other ) ; +extern void makron_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void MakronHyperblaster ( edict_t * self ) ; +extern void MakronRailgun ( edict_t * self ) ; +extern void MakronSaveloc ( edict_t * self ) ; +extern void makronBFG ( edict_t * self ) ; +extern void makron_run ( edict_t * self ) ; +extern void makron_walk ( edict_t * self ) ; +extern void makron_prerailgun ( edict_t * self ) ; +extern void makron_brainsplorch ( edict_t * self ) ; +extern void makron_step_right ( edict_t * self ) ; +extern void makron_step_left ( edict_t * self ) ; +extern void makron_popup ( edict_t * self ) ; +extern void makron_hit ( edict_t * self ) ; +extern void makron_stand ( edict_t * self ) ; +extern void makron_taunt ( edict_t * self ) ; +extern void SP_monster_jorg ( edict_t * self ) ; +extern qboolean Jorg_CheckAttack ( edict_t * self ) ; +extern void jorg_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void jorg_dead ( edict_t * self ) ; +extern void jorg_attack ( edict_t * self ) ; +extern void jorg_firebullet ( edict_t * self ) ; +extern void jorg_firebullet_left ( edict_t * self ) ; +extern void jorg_firebullet_right ( edict_t * self ) ; +extern void jorgBFG ( edict_t * self ) ; +extern void jorg_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void jorg_attack1 ( edict_t * self ) ; +extern void jorg_reattack1 ( edict_t * self ) ; +extern void jorg_run ( edict_t * self ) ; +extern void jorg_walk ( edict_t * self ) ; +extern void jorg_stand ( edict_t * self ) ; +extern void jorg_step_right ( edict_t * self ) ; +extern void jorg_step_left ( edict_t * self ) ; +extern void jorg_death_hit ( edict_t * self ) ; +extern void jorg_idle ( edict_t * self ) ; +extern void jorg_search ( edict_t * self ) ; +extern void SP_monster_boss3_stand ( edict_t * self ) ; +extern void Think_Boss3Stand ( edict_t * ent ) ; +extern void Use_Boss3 ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern void SP_monster_boss2 ( edict_t * self ) ; +extern qboolean Boss2_CheckAttack ( edict_t * self ) ; +extern void boss2_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void boss2_dead ( edict_t * self ) ; +extern void boss2_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void boss2_reattack_mg ( edict_t * self ) ; +extern void boss2_attack_mg ( edict_t * self ) ; +extern void boss2_attack ( edict_t * self ) ; +extern void boss2_walk ( edict_t * self ) ; +extern void boss2_run ( edict_t * self ) ; +extern void boss2_stand ( edict_t * self ) ; +extern void Boss2MachineGun ( edict_t * self ) ; +extern void boss2_firebullet_left ( edict_t * self ) ; +extern void boss2_firebullet_right ( edict_t * self ) ; +extern void Boss2Rocket ( edict_t * self ) ; +extern void boss2_search ( edict_t * self ) ; +extern void SP_monster_berserk ( edict_t * self ) ; +extern void berserk_jump ( edict_t * self ) ; +extern void berserk_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void berserk_dead ( edict_t * self ) ; +extern void berserk_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void berserk_melee ( edict_t * self ) ; +extern void berserk_strike ( edict_t * self ) ; +extern void berserk_attack_club ( edict_t * self ) ; +extern void berserk_swing ( edict_t * self ) ; +extern void berserk_attack_spike ( edict_t * self ) ; +extern void berserk_run ( edict_t * self ) ; +extern void berserk_walk ( edict_t * self ) ; +extern void berserk_fidget ( edict_t * self ) ; +extern void berserk_stand ( edict_t * self ) ; +extern void berserk_search ( edict_t * self ) ; +extern void berserk_sight ( edict_t * self , edict_t * other ) ; +extern void actorBFG ( edict_t * self ) ; +extern void actorRailGun ( edict_t * self ) ; +extern void actorHyperblaster ( edict_t * self ) ; +extern void actorRocket ( edict_t * self ) ; +extern void actorGrenadeLauncher ( edict_t * self ) ; +extern void actorChaingun ( edict_t * self ) ; +extern void actorMachineGun ( edict_t * self ) ; +extern void actorSuperShotgun ( edict_t * self ) ; +extern void actorShotgun ( edict_t * self ) ; +extern void actorBlaster ( edict_t * self ) ; +extern void ActorTarget ( edict_t * self , vec3_t target ) ; +extern void TraceAimPoint ( vec3_t start , vec3_t target ) ; +extern void muzzleflash_think ( edict_t * flash ) ; +extern void actor_moveit ( edict_t * player , edict_t * actor ) ; +extern void actor_files ( ) ; +extern qboolean InPak ( char * basedir , char * gamedir , char * filename ) ; +extern void SP_target_actor ( edict_t * self ) ; +extern void target_actor_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_misc_actor ( edict_t * self ) ; +extern void actor_salute ( edict_t * self ) ; +extern qboolean actor_blocked ( edict_t * self , float dist ) ; +extern void actor_jump ( edict_t * self ) ; +extern void actor_end_jump ( edict_t * self ) ; +extern qboolean actor_checkattack ( edict_t * self ) ; +extern void actor_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void actor_attack ( edict_t * self ) ; +extern void actor_seekcover ( edict_t * self ) ; +extern void actor_no_weapon_sound ( edict_t * self ) ; +extern void actor_fire ( edict_t * self ) ; +extern void actor_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void actor_dead ( edict_t * self ) ; +extern void actor_pain ( edict_t * self , edict_t * other , float kick , int damage ) ; +extern void actor_switch ( edict_t * self ) ; +extern void actor_ideal_range ( edict_t * self ) ; +extern void actor_run_back ( edict_t * self ) ; +extern void actor_run ( edict_t * self ) ; +extern void actor_walk_back ( edict_t * self ) ; +extern void actor_walk ( edict_t * self ) ; +extern void actor_stand ( edict_t * self ) ; +extern qboolean AimGrenade ( edict_t * self , vec3_t start , vec3_t target , vec_t speed , vec3_t aim ) ; +extern void fire_bfg ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , float damage_radius ) ; +extern void bfg_think ( edict_t * self ) ; +extern void bfg_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void bfg_explode ( edict_t * self ) ; +extern void fire_rail ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int kick ) ; +extern void SP_rocket ( edict_t * rocket ) ; +extern void rocket_delayed_start ( edict_t * rocket ) ; +extern void fire_rocket ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , float damage_radius , int radius_damage , edict_t * home_target ) ; +extern void rocket_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void rocket_explode ( edict_t * ent ) ; +extern void rocket_touch ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void Rocket_Evade ( edict_t * rocket , vec3_t dir , float speed ) ; +extern void homing_think ( edict_t * self ) ; +extern void SP_handgrenade ( edict_t * grenade ) ; +extern void handgrenade_delayed_start ( edict_t * grenade ) ; +extern void SP_grenade ( edict_t * grenade ) ; +extern void grenade_delayed_start ( edict_t * grenade ) ; +extern void fire_grenade2 ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int speed , float timer , float damage_radius , qboolean held ) ; +extern void fire_grenade ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int speed , float timer , float damage_radius ) ; +extern void Grenade_Touch ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void Grenade_Explode ( edict_t * ent ) ; +extern void Grenade_Remove_From_Chain ( edict_t * grenade ) ; +extern void Grenade_Add_To_Chain ( edict_t * grenade ) ; +extern void Grenade_Evade ( edict_t * monster ) ; +extern void SP_plasma_bolt ( edict_t * bolt ) ; +extern void fire_plasma ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int effect ) ; +extern void plasma_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_bolt ( edict_t * bolt ) ; +extern void bolt_delayed_start ( edict_t * bolt ) ; +extern void fire_blaster ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int effect , qboolean hyper ) ; +extern void blaster_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void fire_shotgun ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int kick , int hspread , int vspread , int count , int mod ) ; +extern void fire_bullet ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int kick , int hspread , int vspread , int mod ) ; +extern void fire_lead ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int kick , int te_impact , int hspread , int vspread , int mod ) ; +extern qboolean fire_hit ( edict_t * self , vec3_t aim , int damage , int kick ) ; +extern void check_dodge_inf_mg ( edict_t * self , vec3_t start , vec3_t dir ) ; +extern void check_dodge ( edict_t * self , vec3_t start , vec3_t dir , int speed ) ; +extern void SP_func_vehicle ( edict_t * self ) ; +extern void turn_vehicle ( edict_t * self ) ; +extern void vehicle_think ( edict_t * self ) ; +extern void vehicle_disengage ( edict_t * vehicle ) ; +extern void vehicle_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void vehicle_blocked ( edict_t * self , edict_t * other ) ; +extern void func_vehicle_explode ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void G_UseTarget ( edict_t * ent , edict_t * activator , edict_t * target ) ; +extern void Think_Delay_Single ( edict_t * ent ) ; +extern void GameDirRelativePath ( char * filename , char * output ) ; +extern edict_t * LookingAt ( edict_t * ent , int filter , vec3_t endpos , float * range ) ; +extern float AtLeast ( float x , float dx ) ; +extern qboolean point_infront ( edict_t * self , vec3_t point ) ; +extern void stuffcmd ( edict_t * pent , char * pszCommand ) ; +extern float SnapToEights ( float x ) ; +extern void AnglesNormalize ( vec3_t vec ) ; +extern qboolean KillBox ( edict_t * ent ) ; +extern void G_TouchSolids ( edict_t * ent ) ; +extern void G_TouchTriggers ( edict_t * ent ) ; +extern void G_FreeEdict ( edict_t * ed ) ; +extern edict_t * G_Spawn ( void ) ; +extern void G_InitEdict ( edict_t * e ) ; +extern char * G_CopyString ( char * in ) ; +extern void vectoangles2 ( vec3_t value1 , vec3_t angles ) ; +extern void vectoangles ( vec3_t value1 , vec3_t angles ) ; +extern float vectoyaw2 ( vec3_t vec ) ; +extern float vectoyaw ( vec3_t vec ) ; +extern void G_SetMovedir ( vec3_t angles , vec3_t movedir ) ; +extern char * vtosf ( vec3_t v ) ; +extern char * vtos ( vec3_t v ) ; +extern float * tv ( float x , float y , float z ) ; +extern void G_UseTargets ( edict_t * ent , edict_t * activator ) ; +extern void Think_Delay ( edict_t * ent ) ; +extern edict_t * G_PickTarget ( char * targetname ) ; +extern edict_t * findradius2 ( edict_t * from , vec3_t org , float rad ) ; +extern edict_t * findradius ( edict_t * from , vec3_t org , float rad ) ; +extern edict_t * G_Find ( edict_t * from , int fieldofs , char * match ) ; +extern void G_ProjectSource2 ( vec3_t point , vec3_t distance , vec3_t forward , vec3_t right , vec3_t up , vec3_t result ) ; +extern void G_ProjectSource ( vec3_t point , vec3_t distance , vec3_t forward , vec3_t right , vec3_t result ) ; +extern void SP_turret_driver ( edict_t * self ) ; +extern void turret_driver_link ( edict_t * self ) ; +extern void turret_driver_think ( edict_t * self ) ; +extern void turret_driver_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void SP_turret_base ( edict_t * self ) ; +extern void use_turret_base ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void turret_base_finish ( edict_t * self ) ; +extern void SP_model_turret ( edict_t * self ) ; +extern void SP_turret_breach ( edict_t * self ) ; +extern void turret_breach_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void use_turret_breach ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void toggle_turret_breach ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void turret_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void turret_die_temp_think ( edict_t * self ) ; +extern void turret_breach_finish_init ( edict_t * self ) ; +extern void turret_breach_think ( edict_t * self ) ; +extern void turret_turn ( edict_t * self ) ; +extern void turret_disengage ( edict_t * self ) ; +extern void turret_breach_fire ( edict_t * self ) ; +extern void hrocket_turret_fire ( edict_t * self , edict_t * owner , vec3_t start , vec3_t dir , vec3_t start2 , vec3_t dir2 , int damage , int speed , float damage_radius , int radius_damage , edict_t * home_target ) ; +extern void turret_blocked ( edict_t * self , edict_t * other ) ; +extern edict_t * TurretTarget ( edict_t * self ) ; +extern void SP_trigger_disguise ( edict_t * self ) ; +extern void trigger_disguise_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void trigger_disguise_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_trigger_transition ( edict_t * self ) ; +extern int trigger_transition_ents ( edict_t * changelevel , edict_t * self ) ; +extern void trans_ent_filename ( char * filename ) ; +extern void WriteTransitionEdict ( FILE * f , edict_t * changelevel , edict_t * ent ) ; +extern qboolean HasSpawnFunction ( edict_t * ent ) ; +extern void SP_trigger_speaker ( edict_t * self ) ; +extern void trigger_speaker_enable ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void trigger_speaker_disable ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void trigger_speaker_think ( edict_t * self ) ; +extern void SP_trigger_look ( edict_t * self ) ; +extern void trigger_look_enable ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void trigger_look_disable ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void trigger_look_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_trigger_bbox ( edict_t * ent ) ; +extern void trigger_bbox_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void trigger_bbox_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void trigger_bbox_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void trigger_bbox_reset ( edict_t * self ) ; +extern void SP_trigger_scales ( edict_t * self ) ; +extern void trigger_scales_think ( edict_t * self ) ; +extern float weight_on_top ( edict_t * ent ) ; +extern void SP_trigger_inside ( edict_t * self ) ; +extern void trigger_inside_think ( edict_t * self ) ; +extern void SP_trigger_mass ( edict_t * self ) ; +extern void trigger_mass_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_tremor_trigger_multiple ( edict_t * ent ) ; +extern void tremor_trigger_enable ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void Use_tremor_Multi ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_trigger_monsterjump ( edict_t * self ) ; +extern void trigger_monsterjump_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_trigger_gravity ( edict_t * self ) ; +extern void trigger_gravity_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_trigger_hurt ( edict_t * self ) ; +extern void hurt_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void hurt_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_trigger_command ( edict_t * self ) ; +extern void trigger_cmd_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_trigger_medibot ( edict_t * self ) ; +extern void medibot_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void medibot_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_trigger_push ( edict_t * self ) ; +extern void trigger_push_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_trigger_always ( edict_t * ent ) ; +extern void SP_trigger_counter ( edict_t * self ) ; +extern void trigger_counter_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_trigger_key ( edict_t * self ) ; +extern void trigger_key_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_trigger_relay ( edict_t * self ) ; +extern void trigger_relay_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_trigger_once ( edict_t * ent ) ; +extern void SP_trigger_multiple ( edict_t * ent ) ; +extern void trigger_enable ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void Touch_Multi ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void Use_Multi ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern void multi_trigger ( edict_t * ent ) ; +extern void multi_wait ( edict_t * ent ) ; +extern void InitTrigger ( edict_t * self ) ; +extern void SP_info_train_start ( edict_t * self ) ; +extern void find_tracktrain ( edict_t * self ) ; +extern void SP_func_tracktrain ( edict_t * self ) ; +extern void tracktrain_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void func_tracktrain_find ( edict_t * self ) ; +extern void tracktrain_next ( edict_t * self ) ; +extern void tracktrain_turn ( edict_t * self ) ; +extern void train_angles ( edict_t * train ) ; +extern void LookAhead ( edict_t * train , vec3_t point , float dist ) ; +extern edict_t * NextPathTrack ( edict_t * train , edict_t * path ) ; +extern qboolean is_backing_up ( edict_t * train ) ; +extern void tracktrain_reach_dest ( edict_t * self ) ; +extern void tracktrain_blocked ( edict_t * self , edict_t * other ) ; +extern void tracktrain_think ( edict_t * self ) ; +extern void tracktrain_hide ( edict_t * self ) ; +extern void tracktrain_disengage ( edict_t * train ) ; +extern void tracktrain_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void tracktrain_drive ( edict_t * train , edict_t * other ) ; +extern void SP_func_trackchange ( edict_t * self ) ; +extern void trackchange_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void trackchange_done ( edict_t * self ) ; +extern void SP_path_track ( edict_t * self ) ; +extern void path_track_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern float UTIL_AngleDistance ( float next , float cur ) ; +extern float UTIL_ApproachAngle ( float target , float value , float speed ) ; +extern float UTIL_AngleMod ( float a ) ; +extern void SP_thing ( edict_t * self ) ; +extern void thing_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void thing_grenade_boom ( edict_t * self ) ; +extern void thing_think_pause ( edict_t * self ) ; +extern void thing_think ( edict_t * self ) ; +extern void thing_restore_leader ( edict_t * self ) ; +extern edict_t * SpawnThing ( ) ; +extern void SP_target_viewshake ( edict_t * self ) ; +extern void target_viewshake_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_viewshake_think ( edict_t * self ) ; +extern void SP_target_bubbles ( edict_t * self ) ; +extern void target_bubbles_on ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_bubbles_off ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_bubbles_think ( edict_t * self ) ; +extern void SP_target_holo ( edict_t * self ) ; +extern void target_holo_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_holo_think ( edict_t * self ) ; +extern void SP_target_skill ( edict_t * self ) ; +extern void use_target_skill ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_clone ( edict_t * self ) ; +extern void target_clone_starton ( edict_t * self ) ; +extern void clone ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_fade ( edict_t * self ) ; +extern void use_target_fade ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_sky ( edict_t * self ) ; +extern void use_target_sky ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_set_effect ( edict_t * self ) ; +extern void use_target_set_effect ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_movewith ( edict_t * self ) ; +extern void use_target_movewith ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void movewith_detach ( edict_t * child ) ; +extern void SP_target_change ( edict_t * self ) ; +extern void use_target_change ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_failure ( edict_t * self ) ; +extern void use_target_failure ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_failure_fade_lights ( edict_t * self ) ; +extern void target_failure_think ( edict_t * self ) ; +extern void target_failure_player_die ( edict_t * player ) ; +extern void target_failure_wipe ( edict_t * self ) ; +extern void SP_target_animation ( edict_t * self ) ; +extern void target_animation_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_animate ( edict_t * ent ) ; +extern void SP_target_monitor ( edict_t * self ) ; +extern void use_target_monitor ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_monitor_move ( edict_t * self ) ; +extern void target_monitor_off ( edict_t * self ) ; +extern void SP_target_CD ( edict_t * self ) ; +extern void use_target_CD ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_attractor ( edict_t * self ) ; +extern void use_target_attractor ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_attractor_think ( edict_t * self ) ; +extern void target_attractor_think_single ( edict_t * self ) ; +extern void SP_target_effect ( edict_t * self ) ; +extern void target_effect_think ( edict_t * self ) ; +extern void target_effect_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_effect_widowbeam ( edict_t * self , edict_t * activator ) ; +extern void target_effect_tunnel_sparks ( edict_t * self , edict_t * activator ) ; +extern void target_effect_explosion ( edict_t * self , edict_t * activator ) ; +extern void target_effect_sparks ( edict_t * self , edict_t * activator ) ; +extern void target_effect_lightning ( edict_t * self , edict_t * activator ) ; +extern void target_effect_trail ( edict_t * self , edict_t * activator ) ; +extern void target_effect_splash ( edict_t * self , edict_t * activator ) ; +extern void target_effect_steam ( edict_t * self , edict_t * activator ) ; +extern void target_effect_at ( edict_t * self , edict_t * activator ) ; +extern void SP_target_rotation ( edict_t * self ) ; +extern void use_target_rotation ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_rocks ( edict_t * self ) ; +extern void use_target_rocks ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void ThrowRock ( edict_t * self , char * modelname , float speed , vec3_t origin , vec3_t size , int mass ) ; +extern void directed_debris_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void SP_target_monsterbattle ( edict_t * self ) ; +extern void use_target_monsterbattle ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_anger ( edict_t * self ) ; +extern void use_target_anger ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_locator ( edict_t * self ) ; +extern void target_locator_init ( edict_t * self ) ; +extern void SP_target_earthquake ( edict_t * self ) ; +extern void target_earthquake_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_earthquake_think ( edict_t * self ) ; +extern void SP_target_lightramp ( edict_t * self ) ; +extern void target_lightramp_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_lightramp_think ( edict_t * self ) ; +extern void SP_target_laser ( edict_t * self ) ; +extern void target_laser_start ( edict_t * self ) ; +extern void target_laser_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_laser_off ( edict_t * self ) ; +extern void target_laser_on ( edict_t * self ) ; +extern void target_laser_think ( edict_t * self ) ; +extern void target_laser_ps_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_laser_ps_off ( edict_t * self ) ; +extern void target_laser_ps_on ( edict_t * self ) ; +extern void target_laser_ps_think ( edict_t * self ) ; +extern void SP_target_crosslevel_target ( edict_t * self ) ; +extern void target_crosslevel_target_think ( edict_t * self ) ; +extern void SP_target_crosslevel_trigger ( edict_t * self ) ; +extern void trigger_crosslevel_trigger_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_blaster ( edict_t * self ) ; +extern void target_blaster_init ( edict_t * self ) ; +extern void toggle_target_blaster ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void find_target_blaster_target ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_blaster_think ( edict_t * self ) ; +extern void use_target_blaster ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_spawner ( edict_t * self ) ; +extern void use_target_spawner ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_splash ( edict_t * self ) ; +extern void use_target_splash ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_changelevel ( edict_t * ent ) ; +extern void use_target_changelevel ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_explosion ( edict_t * ent ) ; +extern void use_target_explosion ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_explosion_explode ( edict_t * self ) ; +extern void SP_target_goal ( edict_t * ent ) ; +extern void use_target_goal ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern void SP_target_secret ( edict_t * ent ) ; +extern void use_target_secret ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern void SP_target_help ( edict_t * ent ) ; +extern void Use_Target_Help ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_speaker ( edict_t * ent ) ; +extern void Use_Target_Speaker ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern void SP_target_temp_entity ( edict_t * ent ) ; +extern void Use_Target_Tent ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void ServerCommand ( void ) ; +extern void SVCmd_WriteIP_f ( void ) ; +extern void SVCmd_ListIP_f ( void ) ; +extern void SVCmd_RemoveIP_f ( void ) ; +extern void SVCmd_AddIP_f ( void ) ; +extern qboolean SV_FilterPacket ( char * from ) ; +extern void Svcmd_Test_f ( void ) ; +extern void Cmd_ToggleHud ( ) ; +extern void Hud_Off ( ) ; +extern void Hud_On ( ) ; +extern void SP_worldspawn ( edict_t * ent ) ; +extern void SpawnEntities ( char * mapname , char * entities , char * spawnpoint ) ; +extern void LoadTransitionEnts ( ) ; +extern void G_FindTeams ( void ) ; +extern char * ED_ParseEdict ( char * data , edict_t * ent ) ; +extern void ED_ParseField ( char * key , char * value , edict_t * ent ) ; +extern char * ED_NewString ( char * string ) ; +extern void ED_CallSpawn ( edict_t * ent ) ; +extern void SP_target_playback ( edict_t * ent ) ; +extern void target_playback_delayed_restart ( edict_t * ent ) ; +extern void target_playback_delayed_start ( edict_t * ent ) ; +extern void Use_Target_Playback ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern qboolean FMOD_IsPlaying ( edict_t * ent ) ; +extern void target_playback_fadein ( edict_t * ent ) ; +extern void target_playback_fadeout ( edict_t * ent ) ; +extern void target_playback_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void FMOD_StopSound ( edict_t * ent , qboolean free ) ; +extern int FMOD_PlaySound ( edict_t * ent ) ; +extern void CheckEndSample ( edict_t * ent ) ; +extern void CheckEndMusic ( edict_t * ent ) ; +extern void FMOD_Stop ( ) ; +extern void FMOD_UpdateSpeakerPos ( edict_t * speaker ) ; +extern void FMOD_UpdateListenerPos ( ) ; +extern void FMOD_Shutdown ( ) ; +extern qboolean FMOD_Init ( ) ; +extern void FootStep ( edict_t * ent ) ; +extern void PlayFootstep ( edict_t * ent , footstep_t index ) ; +extern void ReadLevel ( char * filename ) ; +extern void WriteLevel ( char * filename ) ; +extern void ReadLevelLocals ( FILE * f ) ; +extern void ReadEdict ( FILE * f , edict_t * ent ) ; +extern void WriteLevelLocals ( FILE * f ) ; +extern void WriteEdict ( FILE * f , edict_t * ent ) ; +extern void ReadGame ( char * filename ) ; +extern void WriteGame ( char * filename , qboolean autosave ) ; +extern void ReadClient ( FILE * f , gclient_t * client ) ; +extern void WriteClient ( FILE * f , gclient_t * client ) ; +extern void ReadField ( FILE * f , field_t * field , byte * base ) ; +extern void WriteField2 ( FILE * f , field_t * field , byte * base ) ; +extern void WriteField1 ( FILE * f , field_t * field , byte * base ) ; +extern mmove_t * FindMmoveByName ( char * name ) ; +extern mmoveList_t * GetMmoveByAddress ( mmove_t * adr ) ; +extern byte * FindFunctionByName ( char * name ) ; +extern functionList_t * GetFunctionByAddress ( byte * adr ) ; +extern void InitGame ( void ) ; +extern void SP_func_reflect ( edict_t * self ) ; +extern void use_func_reflect ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void AddReflection ( edict_t * ent ) ; +extern void DeleteReflection ( edict_t * ent , int index ) ; +extern void ReflectSparks ( int type , vec3_t origin , vec3_t movedir ) ; +extern void ReflectSteam ( vec3_t origin , vec3_t movedir , int count , int sounds , int speed , int wait , int nextid ) ; +extern void ReflectTrail ( int type , vec3_t start , vec3_t end ) ; +extern void ReflectExplosion ( int type , vec3_t origin ) ; +extern void G_RunEntity ( edict_t * ent ) ; +extern void SV_Physics_Conveyor ( edict_t * ent ) ; +extern void SV_Physics_Debris ( edict_t * ent ) ; +extern trace_t SV_DebrisEntity ( edict_t * ent , vec3_t push ) ; +extern void SV_Physics_Vehicle ( edict_t * ent ) ; +extern int SV_VehicleMove ( edict_t * ent , float time , int mask ) ; +extern void SV_Physics_Step ( edict_t * ent ) ; +extern float RiderMass ( edict_t * platform ) ; +extern void SV_AddRotationalFriction ( edict_t * ent ) ; +extern void SV_Physics_Toss ( edict_t * ent ) ; +extern void SV_Physics_Noclip ( edict_t * ent ) ; +extern void SV_Physics_None ( edict_t * ent ) ; +extern void SV_Physics_Pusher ( edict_t * ent ) ; +extern qboolean SV_Push ( edict_t * pusher , vec3_t move , vec3_t amove ) ; +extern void RealBoundingBox ( edict_t * ent , vec3_t mins , vec3_t maxs ) ; +extern void MoveRiders ( edict_t * platform , edict_t * ignore , vec3_t move , vec3_t amove , qboolean turn ) ; +extern trace_t SV_PushEntity ( edict_t * ent , vec3_t push ) ; +extern void SV_AddGravity ( edict_t * ent ) ; +extern int SV_PushableMove ( edict_t * ent , float time , int mask ) ; +extern int SV_FlyMove ( edict_t * ent , float time , int mask ) ; +extern int ClipVelocity ( vec3_t in , vec3_t normal , vec3_t out , float overbounce ) ; +extern void SV_Impact ( edict_t * e1 , trace_t * trace ) ; +extern qboolean SV_RunThink ( edict_t * ent ) ; +extern void SV_CheckVelocity ( edict_t * ent ) ; +extern edict_t * SV_TestEntityPosition ( edict_t * ent ) ; +extern void other_FallingDamage ( edict_t * ent ) ; +extern void SP_func_pendulum ( edict_t * ent ) ; +extern void pendulum_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void pendulum_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void pendulum_rotate ( edict_t * self ) ; +extern void pendulum_blocked ( edict_t * self , edict_t * other ) ; +extern int PatchPlayerModels ( char * modelname ) ; +extern qboolean monster_jump_finished ( edict_t * self ) ; +extern void monster_jump_start ( edict_t * self ) ; +extern int CountPlayers ( void ) ; +extern edict_t * PickCoopTarget ( edict_t * self ) ; +extern qboolean has_valid_enemy ( edict_t * self ) ; +extern void drawbbox ( edict_t * self ) ; +extern qboolean below ( edict_t * self , edict_t * other ) ; +extern void PredictAim ( edict_t * target , vec3_t start , float bolt_speed , qboolean eye_height , float offset , vec3_t aimdir , vec3_t aimpoint ) ; +extern edict_t * CheckForBadArea ( edict_t * ent ) ; +extern edict_t * SpawnBadArea ( vec3_t mins , vec3_t maxs , float lifespan , edict_t * owner ) ; +extern void badarea_touch ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern qboolean face_wall ( edict_t * self ) ; +extern float realrange ( edict_t * self , edict_t * other ) ; +extern qboolean inback ( edict_t * self , edict_t * other ) ; +extern void InitHintPaths ( void ) ; +extern void SP_hint_path ( edict_t * self ) ; +extern void hint_path_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern qboolean monsterlost_checkhint ( edict_t * self ) ; +extern void hintpath_stop ( edict_t * self ) ; +extern void hintpath_go ( edict_t * self , edict_t * point ) ; +extern edict_t * hintpath_other_end ( edict_t * ent ) ; +extern edict_t * hintpath_findstart ( edict_t * ent ) ; +extern qboolean blocked_checknewenemy ( edict_t * self ) ; +extern qboolean blocked_checkjump ( edict_t * self , float dist , float maxDown , float maxUp ) ; +extern qboolean blocked_checkplat ( edict_t * self , float dist ) ; +extern qboolean blocked_checkshot ( edict_t * self , float shotChance ) ; +extern void SP_model_train ( edict_t * self ) ; +extern void model_train_animator ( edict_t * animator ) ; +extern int HintTestStart ( edict_t * self ) ; +extern void HintTestNext ( edict_t * self , edict_t * hint ) ; +extern int PatchMonsterModel ( char * modelname ) ; +extern void InitiallyDead ( edict_t * self ) ; +extern void stationarymonster_start ( edict_t * self ) ; +extern void stationarymonster_start_go ( edict_t * self ) ; +extern void stationarymonster_triggered_start ( edict_t * self ) ; +extern void stationarymonster_triggered_spawn_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void stationarymonster_triggered_spawn ( edict_t * self ) ; +extern void swimmonster_start ( edict_t * self ) ; +extern void swimmonster_start_go ( edict_t * self ) ; +extern void flymonster_start ( edict_t * self ) ; +extern void flymonster_start_go ( edict_t * self ) ; +extern void walkmonster_start ( edict_t * self ) ; +extern void walkmonster_start_go ( edict_t * self ) ; +extern void monster_start_go ( edict_t * self ) ; +extern qboolean monster_start ( edict_t * self ) ; +extern void monster_death_use ( edict_t * self ) ; +extern void monster_triggered_start ( edict_t * self ) ; +extern void monster_triggered_spawn_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void monster_triggered_spawn ( edict_t * self ) ; +extern void monster_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void monster_think ( edict_t * self ) ; +extern void M_MoveFrame ( edict_t * self ) ; +extern void M_SetEffects ( edict_t * ent ) ; +extern void M_droptofloor ( edict_t * ent ) ; +extern void M_WorldEffects ( edict_t * ent ) ; +extern void M_CatagorizePosition ( edict_t * ent ) ; +extern void M_CheckGround ( edict_t * ent ) ; +extern void AttackFinished ( edict_t * self , float time ) ; +extern void M_FlyCheck ( edict_t * self ) ; +extern void M_FliesOn ( edict_t * self ) ; +extern void M_FliesOff ( edict_t * self ) ; +extern void monster_fire_bfg ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int speed , int kick , float damage_radius , int flashtype ) ; +extern void monster_fire_railgun ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int kick , int flashtype ) ; +extern void monster_fire_rocket ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , edict_t * homing_target ) ; +extern void monster_fire_grenade ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int speed , int flashtype ) ; +extern void monster_fire_plasma ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , int effect ) ; +extern void monster_fire_blaster ( edict_t * self , vec3_t start , vec3_t dir , int damage , int speed , int flashtype , int effect ) ; +extern void monster_fire_shotgun ( edict_t * self , vec3_t start , vec3_t aimdir , int damage , int kick , int hspread , int vspread , int count , int flashtype ) ; +extern void monster_fire_bullet ( edict_t * self , vec3_t start , vec3_t dir , int damage , int kick , int hspread , int vspread , int flashtype ) ; +extern qboolean M_SetDeath ( edict_t * self , mmove_t * * deathmoves ) ; +extern void FadeDieSink ( edict_t * ent ) ; +extern void FadeSink ( edict_t * ent ) ; +extern void SP_model_spawn ( edict_t * ent ) ; +extern void model_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void model_spawn_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void modelspawn_think ( edict_t * self ) ; +extern void PrecacheDebris ( int type ) ; +extern int PatchDeadSoldier ( ) ; +extern void SP_target_fountain ( edict_t * ent ) ; +extern void target_fountain_delayed_use ( edict_t * self ) ; +extern void target_fountain_use ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern void target_fountain_think ( edict_t * self ) ; +extern void SP_target_precipitation ( edict_t * ent ) ; +extern void target_precipitation_delayed_use ( edict_t * self ) ; +extern void target_precipitation_use ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern void target_precipitation_think ( edict_t * self ) ; +extern void spawn_precipitation ( edict_t * self , vec3_t org , vec3_t dir , float speed ) ; +extern void drop_touch ( edict_t * drop , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void leaf_fade ( edict_t * self ) ; +extern void leaf_fade2 ( edict_t * self ) ; +extern void fountain_animate ( edict_t * self ) ; +extern void drop_splash ( edict_t * drop ) ; +extern void drop_add_to_chain ( edict_t * drop ) ; +extern void SP_misc_light ( edict_t * self ) ; +extern void misc_light_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void misc_light_think ( edict_t * self ) ; +extern void SP_misc_teleporter_dest ( edict_t * ent ) ; +extern void SP_trigger_teleporter ( edict_t * self ) ; +extern void trigger_teleporter_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_misc_teleporter ( edict_t * ent ) ; +extern void use_teleporter ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void teleporter_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void teleport_transition_ents ( edict_t * transition , edict_t * teleporter , edict_t * destination ) ; +extern void SP_func_clock_screen ( edict_t * self ) ; +extern void func_clock_screen_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void func_clock_screen_think ( edict_t * self ) ; +extern void SP_func_clock ( edict_t * self ) ; +extern void func_clock_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void func_clock_think ( edict_t * self ) ; +extern void func_clock_format_countdown ( edict_t * self ) ; +extern void func_clock_reset ( edict_t * self ) ; +extern void SP_target_string ( edict_t * self ) ; +extern void target_string_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_character ( edict_t * self ) ; +extern void SP_misc_gib_head ( edict_t * ent ) ; +extern void SP_misc_gib_leg ( edict_t * ent ) ; +extern void SP_misc_gib_arm ( edict_t * ent ) ; +extern void SP_light_mine2 ( edict_t * ent ) ; +extern void SP_light_mine1 ( edict_t * ent ) ; +extern void SP_misc_satellite_dish ( edict_t * ent ) ; +extern void misc_satellite_dish_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void misc_satellite_dish_think ( edict_t * self ) ; +extern void SP_misc_strogg_ship ( edict_t * ent ) ; +extern void misc_strogg_ship_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_misc_viper_bomb ( edict_t * self ) ; +extern void misc_viper_bomb_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void viper_bomb_think ( edict_t * self ) ; +extern void misc_viper_bomb_prethink ( edict_t * self ) ; +extern void misc_viper_bomb_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_misc_bigviper ( edict_t * ent ) ; +extern void SP_misc_viper ( edict_t * ent ) ; +extern void misc_viper_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void viper_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void SP_misc_deadsoldier ( edict_t * ent ) ; +extern void misc_deadsoldier_flieson ( edict_t * self ) ; +extern void misc_deadsoldier_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void SP_misc_banner ( edict_t * ent ) ; +extern void misc_banner_think ( edict_t * ent ) ; +extern void SP_monster_commander_body ( edict_t * self ) ; +extern void commander_body_drop ( edict_t * self ) ; +extern void commander_body_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void commander_body_think ( edict_t * self ) ; +extern void SP_misc_easterchick2 ( edict_t * ent ) ; +extern void misc_easterchick2_think ( edict_t * self ) ; +extern void SP_misc_easterchick ( edict_t * ent ) ; +extern void misc_easterchick_think ( edict_t * self ) ; +extern void SP_misc_eastertank ( edict_t * ent ) ; +extern void misc_eastertank_think ( edict_t * self ) ; +extern void SP_misc_blackhole ( edict_t * ent ) ; +extern void misc_blackhole_transparent ( edict_t * ent ) ; +extern void misc_blackhole_think ( edict_t * self ) ; +extern void misc_blackhole_use ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern void SP_misc_explobox ( edict_t * self ) ; +extern void barrel_delay ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void barrel_explode ( edict_t * self ) ; +extern void barrel_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_func_explosive ( edict_t * self ) ; +extern void func_explosive_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void func_explosive_spawn ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void func_explosive_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void func_explosive_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void func_explosive_explode ( edict_t * self ) ; +extern void func_explosive_respawn ( edict_t * self ) ; +extern void SP_func_object ( edict_t * self ) ; +extern void func_object_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void func_object_release ( edict_t * self ) ; +extern void func_object_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_func_wall ( edict_t * self ) ; +extern void func_wall_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_light ( edict_t * self ) ; +extern void light_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_info_notnull ( edict_t * self ) ; +extern void SP_info_null ( edict_t * self ) ; +extern void SP_viewthing ( edict_t * ent ) ; +extern void TH_viewthing ( edict_t * ent ) ; +extern void SP_point_combat ( edict_t * self ) ; +extern void point_combat_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_path_corner ( edict_t * self ) ; +extern void path_corner_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void BecomeExplosion2 ( edict_t * self ) ; +extern void BecomeExplosion1 ( edict_t * self ) ; +extern void SP_debris ( edict_t * debris ) ; +extern void debris_delayed_start ( edict_t * debris ) ; +extern void ThrowDebris ( edict_t * self , char * modelname , float speed , vec3_t origin , int skin , int effects ) ; +extern void debris_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void ThrowClientHead ( edict_t * self , int damage ) ; +extern void SP_gibhead ( edict_t * gib ) ; +extern void ThrowHead ( edict_t * self , char * gibname , int damage , int type ) ; +extern void SP_gib ( edict_t * gib ) ; +extern void gib_delayed_start ( edict_t * gib ) ; +extern void ThrowGib ( edict_t * self , char * gibname , int damage , int type ) ; +extern void gib_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void gib_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void gib_think ( edict_t * self ) ; +extern void ClipGibVelocity ( edict_t * ent ) ; +extern void VelocityForDamage ( int damage , vec3_t v ) ; +extern void SP_func_areaportal ( edict_t * ent ) ; +extern void Use_Areaportal ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern void FadeDieThink ( edict_t * ent ) ; +extern void FadeThink ( edict_t * ent ) ; +extern void G_RunFrame ( void ) ; +extern void ExitLevel ( void ) ; +extern void CheckDMRules ( void ) ; +extern void CheckNeedPass ( void ) ; +extern void EndDMLevel ( void ) ; +extern edict_t * CreateTargetChangeLevel ( char * map ) ; +extern void ClientEndServerFrames ( void ) ; +extern void Com_Printf ( char * msg , ... ) ; +extern void Sys_Error ( char * error , ... ) ; +extern game_export_t * GetGameAPI ( game_import_t * import ) ; +extern int Debug_Soundindex ( char * name ) ; +extern int Debug_Modelindex ( char * name ) ; +extern void ShutdownGame ( void ) ; +extern void SP_target_lock_clue ( edict_t * self ) ; +extern void lock_clue_initialize ( edict_t * self ) ; +extern void lock_clue_think ( edict_t * self ) ; +extern void lock_clue_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_lock_code ( edict_t * self ) ; +extern void lock_code_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_lock ( edict_t * self ) ; +extern void lock_initialize ( edict_t * lock ) ; +extern void lock_digit_increment ( edict_t * digit , edict_t * activator ) ; +extern void target_lock_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_target_lock_digit ( edict_t * self ) ; +extern void SP_target_lightswitch ( edict_t * self ) ; +extern void use_target_lightswitch ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void target_lightswitch_toggle ( edict_t * self ) ; +extern void ToggleLights ( ) ; +extern void Lights ( ) ; +extern void Jet_ApplyJet ( edict_t * ent , usercmd_t * ucmd ) ; +extern void Jet_ApplySparks ( edict_t * ent ) ; +extern void Jet_ApplyLifting ( edict_t * ent ) ; +extern void Jet_BecomeExplosion ( edict_t * ent , int damage ) ; +extern qboolean Jet_AvoidGround ( edict_t * ent ) ; +extern void Use_Stasis ( edict_t * ent , gitem_t * item ) ; +extern void Use_Jet ( edict_t * ent , gitem_t * item ) ; +extern void Use_Flashlight ( edict_t * ent , gitem_t * item ) ; +extern void SetItemNames ( void ) ; +extern void InitItems ( void ) ; +extern void SP_item_health_mega ( edict_t * self ) ; +extern void SP_item_health_large ( edict_t * self ) ; +extern void SP_item_health_small ( edict_t * self ) ; +extern void SP_item_health ( edict_t * self ) ; +extern void SpawnItem ( edict_t * ent , gitem_t * item ) ; +extern void PrecacheItem ( gitem_t * it ) ; +extern void droptofloor ( edict_t * ent ) ; +extern void Use_Item ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern edict_t * Drop_Item ( edict_t * ent , gitem_t * item ) ; +extern void drop_make_touchable ( edict_t * ent ) ; +extern void drop_temp_touch ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void Touch_Item ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void Drop_PowerArmor ( edict_t * ent , gitem_t * item ) ; +extern qboolean Pickup_PowerArmor ( edict_t * ent , edict_t * other ) ; +extern void Use_PowerArmor ( edict_t * ent , gitem_t * item ) ; +extern int PowerArmorType ( edict_t * ent ) ; +extern qboolean Pickup_Armor ( edict_t * ent , edict_t * other ) ; +extern int ArmorIndex ( edict_t * ent ) ; +extern qboolean Pickup_Health ( edict_t * ent , edict_t * other ) ; +extern void MegaHealth_think ( edict_t * self ) ; +extern void Drop_Ammo ( edict_t * ent , gitem_t * item ) ; +extern qboolean Pickup_Ammo ( edict_t * ent , edict_t * other ) ; +extern qboolean Add_Ammo ( edict_t * ent , gitem_t * item , int count ) ; +extern qboolean Pickup_Key ( edict_t * ent , edict_t * other ) ; +extern void Use_Silencer ( edict_t * ent , gitem_t * item ) ; +extern void Use_Invulnerability ( edict_t * ent , gitem_t * item ) ; +extern void Use_Envirosuit ( edict_t * ent , gitem_t * item ) ; +extern void Use_Breather ( edict_t * ent , gitem_t * item ) ; +extern void Use_Quad ( edict_t * ent , gitem_t * item ) ; +extern qboolean Pickup_Pack ( edict_t * ent , edict_t * other ) ; +extern qboolean Pickup_Bandolier ( edict_t * ent , edict_t * other ) ; +extern qboolean Pickup_AncientHead ( edict_t * ent , edict_t * other ) ; +extern qboolean Pickup_Adrenaline ( edict_t * ent , edict_t * other ) ; +extern void Drop_Jetpack ( edict_t * ent , gitem_t * item ) ; +extern void Drop_General ( edict_t * ent , gitem_t * item ) ; +extern qboolean Pickup_Powerup ( edict_t * ent , edict_t * other ) ; +extern void SetRespawn ( edict_t * ent , float delay ) ; +extern void DoRespawn ( edict_t * ent ) ; +extern gitem_t * FindItem ( char * pickup_name ) ; +extern gitem_t * FindItemByClassname ( char * classname ) ; +extern gitem_t * GetItemByIndex ( int index ) ; +extern void item_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void SP_func_air ( edict_t * self ) ; +extern void func_air_on ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void func_air_off ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void func_air_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void SP_func_door_swinging ( edict_t * self ) ; +extern void func_door_swinging_init ( edict_t * self ) ; +extern void swinging_door_killed ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void SP_func_force_wall ( edict_t * ent ) ; +extern void force_wall_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void func_force_wall_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void force_wall_think ( edict_t * self ) ; +extern void SP_func_pivot ( edict_t * ent ) ; +extern void pivot_init ( edict_t * ent ) ; +extern void pivot_touch ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void pivot_stop ( edict_t * ent ) ; +extern void pivot_blocked ( edict_t * self , edict_t * other ) ; +extern void SP_func_bobbingwater ( edict_t * self ) ; +extern void bob_init ( edict_t * self ) ; +extern void bob_think ( edict_t * self ) ; +extern void SP_func_pushable ( edict_t * self ) ; +extern void func_pushable_spawn ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void box_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void box_water_friction ( edict_t * ent ) ; +extern qboolean box_walkmove ( edict_t * ent , float yaw , float dist ) ; +extern void box_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void box_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern qboolean box_movestep ( edict_t * ent , vec3_t move , qboolean relink ) ; +extern void SP_func_killbox ( edict_t * ent ) ; +extern void use_killbox ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_func_door_secret ( edict_t * ent ) ; +extern void door_secret_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void door_secret_blocked ( edict_t * self , edict_t * other ) ; +extern void door_secret_done ( edict_t * self ) ; +extern void door_secret_move6 ( edict_t * self ) ; +extern void door_secret_move5 ( edict_t * self ) ; +extern void door_secret_move4 ( edict_t * self ) ; +extern void door_secret_move3 ( edict_t * self ) ; +extern void door_secret_move2 ( edict_t * self ) ; +extern void door_secret_move1 ( edict_t * self ) ; +extern void door_secret_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_func_conveyor ( edict_t * self ) ; +extern void func_conveyor_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_func_timer ( edict_t * self ) ; +extern void func_timer_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void func_timer_think ( edict_t * self ) ; +extern void SP_trigger_elevator ( edict_t * self ) ; +extern void trigger_elevator_init ( edict_t * self ) ; +extern void trigger_elevator_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void SP_func_train ( edict_t * self ) ; +extern void train_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void func_train_find ( edict_t * self ) ; +extern void train_resume ( edict_t * self ) ; +extern void train_next ( edict_t * self ) ; +extern void train_yaw ( edict_t * self ) ; +extern void train_children_think ( edict_t * self ) ; +extern void train_wait ( edict_t * self ) ; +extern void train_blocked ( edict_t * self , edict_t * other ) ; +extern void train_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void SP_func_water ( edict_t * self ) ; +extern void SP_func_door_rot_dh ( edict_t * ent ) ; +extern void func_door_rot_dh_init ( edict_t * ent ) ; +extern void SP_func_door_rotating ( edict_t * ent ) ; +extern void SP_func_door ( edict_t * ent ) ; +extern void Door_Speaker_Think ( edict_t * self ) ; +extern void door_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void door_killed ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void door_destroyed ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void door_blocked ( edict_t * self , edict_t * other ) ; +extern void Think_SpawnDoorTrigger ( edict_t * ent ) ; +extern void Think_CalcMoveSpeed ( edict_t * self ) ; +extern void Touch_DoorTrigger ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void door_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void door_go_up ( edict_t * self , edict_t * activator ) ; +extern void door_go_down ( edict_t * self ) ; +extern void door_hit_bottom ( edict_t * self ) ; +extern void door_hit_top ( edict_t * self ) ; +extern void swinging_door_reset ( edict_t * self ) ; +extern void door_use_areaportals ( edict_t * self , qboolean open ) ; +extern void SP_func_trainbutton ( edict_t * ent ) ; +extern void movewith_init ( edict_t * ent ) ; +extern void trainbutton_killed ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void trainbutton_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void trainbutton_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void trainbutton_fire ( edict_t * self ) ; +extern void trainbutton_wait ( edict_t * self ) ; +extern void trainbutton_return ( edict_t * self ) ; +extern void trainbutton_done ( edict_t * self ) ; +extern void SP_func_button ( edict_t * ent ) ; +extern void button_killed ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void button_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void button_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void button_fire ( edict_t * self ) ; +extern void button_wait ( edict_t * self ) ; +extern void button_return ( edict_t * self ) ; +extern void button_done ( edict_t * self ) ; +extern void SP_func_rotating_dh ( edict_t * ent ) ; +extern void func_rotating_dh_init ( edict_t * ent ) ; +extern void SP_func_rotating ( edict_t * ent ) ; +extern void rotating_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void rotating_touch ( edict_t * self , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void rotating_blocked ( edict_t * self , edict_t * other ) ; +extern void rotating_decel ( edict_t * self ) ; +extern void rotating_accel ( edict_t * self ) ; +extern void SP_func_plat ( edict_t * ent ) ; +extern void plat_spawn_inside_trigger ( edict_t * ent ) ; +extern void Touch_Plat_Center ( edict_t * ent , edict_t * other , cplane_t * plane , csurface_t * surf ) ; +extern void Use_Plat ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern void plat_blocked ( edict_t * self , edict_t * other ) ; +extern void plat_go_up ( edict_t * ent ) ; +extern void plat_go_down ( edict_t * ent ) ; +extern void plat_hit_bottom ( edict_t * ent ) ; +extern void plat_hit_top ( edict_t * ent ) ; +extern void Think_AccelMove ( edict_t * ent ) ; +extern void plat_Accelerate ( moveinfo_t * moveinfo ) ; +extern void plat_CalcAcceleratedMove ( moveinfo_t * moveinfo ) ; +extern void AngleMove_Calc ( edict_t * ent , void ( * func ) ( edict_t * ) ) ; +extern void AngleMove_Begin ( edict_t * ent ) ; +extern void AngleMove_Final ( edict_t * ent ) ; +extern void AngleMove_Done ( edict_t * ent ) ; +extern void Move_Calc ( edict_t * ent , vec3_t dest , void ( * func ) ( edict_t * ) ) ; +extern void Move_Begin ( edict_t * ent ) ; +extern void Move_Final ( edict_t * ent ) ; +extern void Move_Done ( edict_t * ent ) ; +extern void check_reverse_rotation ( edict_t * self , vec3_t point ) ; +extern void train_spline ( edict_t * self ) ; +extern void spline_calc ( edict_t * train , vec3_t p1 , vec3_t p2 , vec3_t a1 , vec3_t a2 , float m , vec3_t p , vec3_t a ) ; +extern void movewith_update ( edict_t * self ) ; +extern void set_child_movement ( edict_t * self ) ; +extern void Cmd_Fog_f ( edict_t * ent ) ; +extern void SP_target_fog ( edict_t * self ) ; +extern void SP_trigger_fog ( edict_t * self ) ; +extern void Fog_Off ( ) ; +extern void Fog ( vec3_t viewpoint ) ; +extern void Fog_Init ( ) ; +extern void SP_crane_reset ( edict_t * self ) ; +extern void crane_reset_use ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern void crane_reset_go ( edict_t * temp ) ; +extern void SP_crane_beam ( edict_t * self ) ; +extern void SP_crane_hoist ( edict_t * self ) ; +extern void SP_crane_hook ( edict_t * self ) ; +extern void SP_crane_control ( edict_t * self ) ; +extern void Use_Crane_Control ( edict_t * ent , edict_t * other , edict_t * activator ) ; +extern void crane_control_action ( edict_t * control , edict_t * activator , vec3_t point ) ; +extern void Crane_AdjustSpeed ( edict_t * ent ) ; +extern void G_FindCraneParts ( ) ; +extern void Crane_Move_Begin ( edict_t * ent ) ; +extern void Crane_Move_Final ( edict_t * ent ) ; +extern void Crane_blocked ( edict_t * self , edict_t * other ) ; +extern qboolean Crane_Hook_Bonk ( edict_t * hook , int axis , int dir , vec3_t bonk ) ; +extern void Crane_Stop ( edict_t * control ) ; +extern void Crane_Move_Done ( edict_t * ent ) ; +extern void crane_light_off ( edict_t * light ) ; +extern void Cable_Think ( edict_t * cable ) ; +extern void SetSpotlightLength ( edict_t * hook ) ; +extern void SetCableLength ( edict_t * cable ) ; +extern void Cargo_Float_Up ( edict_t * cargo ) ; +extern void cargo_blocked ( edict_t * cargo , edict_t * obstacle ) ; +extern void Cargo_Stop ( edict_t * ent ) ; +extern edict_t * CrateOnTop ( edict_t * from , edict_t * ent ) ; +extern void Moving_Speaker_Think ( edict_t * speaker ) ; +extern void T_RadiusDamage ( edict_t * inflictor , edict_t * attacker , float damage , edict_t * ignore , float radius , int mod , double dmg_slope ) ; +extern void T_Damage ( edict_t * in_targ , edict_t * inflictor , edict_t * in_attacker , vec3_t dir , vec3_t point , vec3_t normal , int damage , int knockback , int dflags , int mod ) ; +extern qboolean CheckTeamDamage ( edict_t * targ , edict_t * attacker ) ; +extern void M_ReactToDamage ( edict_t * targ , edict_t * attacker ) ; +extern void CallMyFriends ( edict_t * targ , edict_t * attacker ) ; +extern void DefendMyFriend ( edict_t * self , edict_t * enemy ) ; +extern int BloodType ( int index ) ; +extern void SpawnDamage ( int type , vec3_t origin , vec3_t normal ) ; +extern void Killed ( edict_t * targ , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern qboolean CanDamage ( edict_t * targ , edict_t * inflictor ) ; +extern void cleanupHealTarget ( edict_t * ent ) ; +extern void ClientCommand ( edict_t * ent ) ; +extern void Restart_FMOD ( edict_t * self ) ; +extern void ForcewallOff ( edict_t * player ) ; +extern void SpawnForcewall ( edict_t * player ) ; +extern void forcewall_think ( edict_t * self ) ; +extern void decoy_think ( edict_t * self ) ; +extern void decoy_die ( edict_t * self , edict_t * inflictor , edict_t * attacker , int damage , vec3_t point ) ; +extern void Cmd_attack2_f ( edict_t * ent , qboolean bOn ) ; +extern void SetSensitivities ( edict_t * ent , qboolean reset ) ; +extern void SetLazarusCrosshair ( edict_t * ent ) ; +extern void Cmd_Bbox_f ( edict_t * ent ) ; +extern void DrawBBox ( edict_t * ent ) ; +extern void Cmd_PlayerList_f ( edict_t * ent ) ; +extern void Cmd_Say_f ( edict_t * ent , qboolean team , qboolean arg0 ) ; +extern void Cmd_Wave_f ( edict_t * ent ) ; +extern void Cmd_Players_f ( edict_t * ent ) ; +extern int PlayerSort ( void const * a , void const * b ) ; +extern void Cmd_PutAway_f ( edict_t * ent ) ; +extern void Cmd_Kill_f ( edict_t * ent ) ; +extern void Cmd_InvDrop_f ( edict_t * ent ) ; +extern void Cmd_WeapLast_f ( edict_t * ent ) ; +extern void Cmd_WeapNext_f ( edict_t * ent ) ; +extern void Cmd_WeapPrev_f ( edict_t * ent ) ; +extern void Cmd_InvUse_f ( edict_t * ent ) ; +extern void Cmd_Inven_f ( edict_t * ent ) ; +extern void Cmd_Drop_f ( edict_t * ent ) ; +extern void Cmd_Use_f ( edict_t * ent ) ; +extern void Cmd_Noclip_f ( edict_t * ent ) ; +extern void Cmd_Notarget_f ( edict_t * ent ) ; +extern void Cmd_God_f ( edict_t * ent ) ; +extern void Cmd_Give_f ( edict_t * ent ) ; +extern void ValidateSelectedItem ( edict_t * ent ) ; +extern void SelectPrevItem ( edict_t * ent , int itflags ) ; +extern void SelectNextItem ( edict_t * ent , int itflags ) ; +extern qboolean OnSameTeam ( edict_t * ent1 , edict_t * ent2 ) ; +extern char * ClientTeam ( edict_t * ent ) ; +extern void ShiftItem ( edict_t * ent , int direction ) ; +extern void SaveEntProps ( edict_t * e , FILE * f ) ; +extern void laser_sight_think ( edict_t * laser ) ; +extern void RotateAngles ( vec3_t in , vec3_t delta , vec3_t out ) ; +extern char * Q_strlwr ( char * str ) ; +extern void GetChaseTarget ( edict_t * ent ) ; +extern void ChasePrev ( edict_t * ent ) ; +extern void ChaseNext ( edict_t * ent ) ; +extern void UpdateChaseCam ( edict_t * ent ) ; +extern void SP_func_monitor ( edict_t * self ) ; +extern void func_monitor_init ( edict_t * self ) ; +extern void use_camera ( edict_t * self , edict_t * other , edict_t * activator ) ; +extern edict_t * G_FindPrevCamera ( edict_t * camera , edict_t * monitor ) ; +extern edict_t * G_FindNextCamera ( edict_t * camera , edict_t * monitor ) ; +extern void camera_on ( edict_t * ent ) ; +extern void faker_animate ( edict_t * self ) ; +extern void camera_off ( edict_t * ent ) ; +extern qboolean ai_chicken ( edict_t * self , edict_t * badguy ) ; +extern void ai_run ( edict_t * self , float dist ) ; +extern qboolean ai_checkattack ( edict_t * self , float dist ) ; +extern void ai_run_slide ( edict_t * self , float distance ) ; +extern void ai_run_missile ( edict_t * self ) ; +extern void ai_run_melee ( edict_t * self ) ; +extern qboolean M_CheckAttack ( edict_t * self ) ; +extern qboolean FacingIdeal ( edict_t * self ) ; +extern qboolean FindTarget ( edict_t * self ) ; +extern void FoundTarget ( edict_t * self ) ; +extern void HuntTarget ( edict_t * self ) ; +extern qboolean canReach ( edict_t * self , edict_t * other ) ; +extern qboolean infront ( edict_t * self , edict_t * other ) ; +extern qboolean visible ( edict_t * self , edict_t * other ) ; +extern int range ( edict_t * self , edict_t * other ) ; +extern void ai_turn ( edict_t * self , float dist ) ; +extern void ai_charge ( edict_t * self , float dist ) ; +extern void ai_walk ( edict_t * self , float dist ) ; +extern void ai_stand ( edict_t * self , float dist ) ; +extern void ai_strafe ( edict_t * self , float dist ) ; +extern void ai_move ( edict_t * self , float dist ) ; +extern void AI_SetSightClient ( void ) ; diff --git a/src/g_func_list.h b/src/g_func_list.h new file mode 100644 index 0000000..5321894 --- /dev/null +++ b/src/g_func_list.h @@ -0,0 +1,1621 @@ +{"Info_SetValueForKey", (byte *)Info_SetValueForKey}, +{"Info_Validate", (byte *)Info_Validate}, +{"Info_RemoveKey", (byte *)Info_RemoveKey}, +{"Info_ValueForKey", (byte *)Info_ValueForKey}, +{"Com_sprintf", (byte *)Com_sprintf}, +{"Q_strcasecmp", (byte *)Q_strcasecmp}, +{"Q_strncasecmp", (byte *)Q_strncasecmp}, +{"Q_stricmp", (byte *)Q_stricmp}, +{"Com_PageInMemory", (byte *)Com_PageInMemory}, +{"COM_Parse", (byte *)COM_Parse}, +{"va", (byte *)va}, +{"Swap_Init", (byte *)Swap_Init}, +{"FloatNoSwap", (byte *)FloatNoSwap}, +{"FloatSwap", (byte *)FloatSwap}, +{"LongNoSwap", (byte *)LongNoSwap}, +{"LongSwap", (byte *)LongSwap}, +{"ShortNoSwap", (byte *)ShortNoSwap}, +{"ShortSwap", (byte *)ShortSwap}, +{"LittleFloat", (byte *)LittleFloat}, +{"BigFloat", (byte *)BigFloat}, +{"LittleLong", (byte *)LittleLong}, +{"BigLong", (byte *)BigLong}, +{"LittleShort", (byte *)LittleShort}, +{"BigShort", (byte *)BigShort}, +{"COM_DefaultExtension", (byte *)COM_DefaultExtension}, +{"COM_FilePath", (byte *)COM_FilePath}, +{"COM_FileBase", (byte *)COM_FileBase}, +{"COM_FileExtension", (byte *)COM_FileExtension}, +{"COM_StripExtension", (byte *)COM_StripExtension}, +{"COM_SkipPath", (byte *)COM_SkipPath}, +{"Q_log2", (byte *)Q_log2}, +{"VectorScale", (byte *)VectorScale}, +{"VectorInverse", (byte *)VectorInverse}, +{"VectorLength", (byte *)VectorLength}, +{"CrossProduct", (byte *)CrossProduct}, +{"_VectorCopy", (byte *)_VectorCopy}, +{"_VectorAdd", (byte *)_VectorAdd}, +{"_VectorSubtract", (byte *)_VectorSubtract}, +{"_DotProduct", (byte *)_DotProduct}, +{"VectorMA", (byte *)VectorMA}, +{"VectorNormalize2", (byte *)VectorNormalize2}, +{"VectorNormalize", (byte *)VectorNormalize}, +{"VectorCompare", (byte *)VectorCompare}, +{"AddPointToBounds", (byte *)AddPointToBounds}, +{"ClearBounds", (byte *)ClearBounds}, +{"BoxOnPlaneSide", (byte *)BoxOnPlaneSide}, +{"BoxOnPlaneSide2", (byte *)BoxOnPlaneSide2}, +{"anglemod", (byte *)anglemod}, +{"LerpAngle", (byte *)LerpAngle}, +{"Q_fabs", (byte *)Q_fabs}, +{"R_ConcatTransforms", (byte *)R_ConcatTransforms}, +{"R_ConcatRotations", (byte *)R_ConcatRotations}, +{"PerpendicularVector", (byte *)PerpendicularVector}, +{"ProjectPointOnPlane", (byte *)ProjectPointOnPlane}, +{"AngleVectors", (byte *)AngleVectors}, +{"RotatePointAroundVector", (byte *)RotatePointAroundVector}, +{"kick_attack", (byte *)kick_attack}, +{"Weapon_Null", (byte *)Weapon_Null}, +{"Weapon_BFG", (byte *)Weapon_BFG}, +{"weapon_bfg_fire", (byte *)weapon_bfg_fire}, +{"Weapon_Railgun", (byte *)Weapon_Railgun}, +{"weapon_railgun_fire", (byte *)weapon_railgun_fire}, +{"Weapon_SuperShotgun", (byte *)Weapon_SuperShotgun}, +{"weapon_supershotgun_fire", (byte *)weapon_supershotgun_fire}, +{"Weapon_Shotgun", (byte *)Weapon_Shotgun}, +{"weapon_shotgun_fire", (byte *)weapon_shotgun_fire}, +{"Weapon_Chaingun", (byte *)Weapon_Chaingun}, +{"Chaingun_Fire", (byte *)Chaingun_Fire}, +{"Weapon_Machinegun", (byte *)Weapon_Machinegun}, +{"Machinegun_Fire", (byte *)Machinegun_Fire}, +{"Weapon_HyperBlaster", (byte *)Weapon_HyperBlaster}, +{"Weapon_HyperBlaster_Fire", (byte *)Weapon_HyperBlaster_Fire}, +{"Weapon_Blaster", (byte *)Weapon_Blaster}, +{"Weapon_Blaster_Fire", (byte *)Weapon_Blaster_Fire}, +{"Blaster_Fire", (byte *)Blaster_Fire}, +{"Weapon_HomingMissileLauncher", (byte *)Weapon_HomingMissileLauncher}, +{"Weapon_HomingMissileLauncher_Fire", (byte *)Weapon_HomingMissileLauncher_Fire}, +{"Weapon_RocketLauncher", (byte *)Weapon_RocketLauncher}, +{"Weapon_RocketLauncher_Fire", (byte *)Weapon_RocketLauncher_Fire}, +{"rocket_target", (byte *)rocket_target}, +{"Weapon_GrenadeLauncher", (byte *)Weapon_GrenadeLauncher}, +{"weapon_grenadelauncher_fire", (byte *)weapon_grenadelauncher_fire}, +{"Weapon_Grenade", (byte *)Weapon_Grenade}, +{"weapon_grenade_fire", (byte *)weapon_grenade_fire}, +{"Weapon_Generic", (byte *)Weapon_Generic}, +{"Drop_Weapon", (byte *)Drop_Weapon}, +{"Use_Weapon", (byte *)Use_Weapon}, +{"Think_Weapon", (byte *)Think_Weapon}, +{"NoAmmoWeaponChange", (byte *)NoAmmoWeaponChange}, +{"ChangeWeapon", (byte *)ChangeWeapon}, +{"Pickup_Weapon", (byte *)Pickup_Weapon}, +{"PlayerNoise", (byte *)PlayerNoise}, +{"P_ProjectSource", (byte *)P_ProjectSource}, +{"ClientEndServerFrame", (byte *)ClientEndServerFrame}, +{"WhatsIt", (byte *)WhatsIt}, +{"G_SetClientFrame", (byte *)G_SetClientFrame}, +{"G_SetClientSound", (byte *)G_SetClientSound}, +{"G_SetClientEvent", (byte *)G_SetClientEvent}, +{"G_SetClientEffects", (byte *)G_SetClientEffects}, +{"P_WorldEffects", (byte *)P_WorldEffects}, +{"P_FallingDamage", (byte *)P_FallingDamage}, +{"P_SlamDamage", (byte *)P_SlamDamage}, +{"SV_CalcBlend", (byte *)SV_CalcBlend}, +{"SV_AddBlend", (byte *)SV_AddBlend}, +{"SV_CalcGunOffset", (byte *)SV_CalcGunOffset}, +{"SV_CalcViewOffset", (byte *)SV_CalcViewOffset}, +{"P_DamageFeedback", (byte *)P_DamageFeedback}, +{"SV_CalcRoll", (byte *)SV_CalcRoll}, +{"PlayerTrail_LastSpot", (byte *)PlayerTrail_LastSpot}, +{"PlayerTrail_PickNext", (byte *)PlayerTrail_PickNext}, +{"PlayerTrail_PickFirst", (byte *)PlayerTrail_PickFirst}, +{"PlayerTrail_New", (byte *)PlayerTrail_New}, +{"PlayerTrail_Add", (byte *)PlayerTrail_Add}, +{"PlayerTrail_Init", (byte *)PlayerTrail_Init}, +{"SP_target_text", (byte *)SP_target_text}, +{"Use_Target_Text", (byte *)Use_Target_Text}, +{"Do_Text_Display", (byte *)Do_Text_Display}, +{"Text_Prev", (byte *)Text_Prev}, +{"Text_Next", (byte *)Text_Next}, +{"Text_Update", (byte *)Text_Update}, +{"Text_BuildDisplay", (byte *)Text_BuildDisplay}, +{"Text_Close", (byte *)Text_Close}, +{"Text_Open", (byte *)Text_Open}, +{"PMenu_Select", (byte *)PMenu_Select}, +{"PMenu_Prev", (byte *)PMenu_Prev}, +{"PMenu_Next", (byte *)PMenu_Next}, +{"PMenu_Update", (byte *)PMenu_Update}, +{"PMenu_Close", (byte *)PMenu_Close}, +{"PMenu_Open", (byte *)PMenu_Open}, +{"G_SetSpectatorStats", (byte *)G_SetSpectatorStats}, +{"G_CheckChaseStats", (byte *)G_CheckChaseStats}, +{"G_SetStats", (byte *)G_SetStats}, +{"WhatIsIt", (byte *)WhatIsIt}, +{"Cmd_Help_f", (byte *)Cmd_Help_f}, +{"HelpComputer", (byte *)HelpComputer}, +{"Cmd_Score_f", (byte *)Cmd_Score_f}, +{"DeathmatchScoreboard", (byte *)DeathmatchScoreboard}, +{"DeathmatchScoreboardMessage", (byte *)DeathmatchScoreboardMessage}, +{"BeginIntermission", (byte *)BeginIntermission}, +{"MoveClientToIntermission", (byte *)MoveClientToIntermission}, +{"ClientBeginServerFrame", (byte *)ClientBeginServerFrame}, +{"ClientThink", (byte *)ClientThink}, +{"ClientSpycam", (byte *)ClientSpycam}, +{"ClientPushPushable", (byte *)ClientPushPushable}, +{"RemovePush", (byte *)RemovePush}, +{"PM_CmdScale", (byte *)PM_CmdScale}, +{"PrintPmove", (byte *)PrintPmove}, +{"CheckBlock", (byte *)CheckBlock}, +{"PM_trace", (byte *)PM_trace}, +{"ClientDisconnect", (byte *)ClientDisconnect}, +{"ClientConnect", (byte *)ClientConnect}, +{"ClientUserinfoChanged", (byte *)ClientUserinfoChanged}, +{"ClientBegin", (byte *)ClientBegin}, +{"ClientBeginDeathmatch", (byte *)ClientBeginDeathmatch}, +{"PutClientInServer", (byte *)PutClientInServer}, +{"spectator_respawn", (byte *)spectator_respawn}, +{"respawn", (byte *)respawn}, +{"CopyToBodyQue", (byte *)CopyToBodyQue}, +{"body_die", (byte *)body_die}, +{"InitBodyQue", (byte *)InitBodyQue}, +{"SelectSpawnPoint", (byte *)SelectSpawnPoint}, +{"SelectCoopSpawnPoint", (byte *)SelectCoopSpawnPoint}, +{"SelectDeathmatchSpawnPoint", (byte *)SelectDeathmatchSpawnPoint}, +{"SelectFarthestDeathmatchSpawnPoint", (byte *)SelectFarthestDeathmatchSpawnPoint}, +{"SelectRandomDeathmatchSpawnPoint", (byte *)SelectRandomDeathmatchSpawnPoint}, +{"PlayersRangeFromSpot", (byte *)PlayersRangeFromSpot}, +{"FetchClientEntData", (byte *)FetchClientEntData}, +{"SaveClientData", (byte *)SaveClientData}, +{"InitClientResp", (byte *)InitClientResp}, +{"InitClientPersistant", (byte *)InitClientPersistant}, +{"SelectStartWeapon", (byte *)SelectStartWeapon}, +{"player_die", (byte *)player_die}, +{"LookAtKiller", (byte *)LookAtKiller}, +{"TossClientWeapon", (byte *)TossClientWeapon}, +{"ClientObituary", (byte *)ClientObituary}, +{"IsNeutral", (byte *)IsNeutral}, +{"IsFemale", (byte *)IsFemale}, +{"player_pain", (byte *)player_pain}, +{"SP_info_player_intermission", (byte *)SP_info_player_intermission}, +{"SP_info_player_coop", (byte *)SP_info_player_coop}, +{"SP_info_player_deathmatch", (byte *)SP_info_player_deathmatch}, +{"SP_info_player_start", (byte *)SP_info_player_start}, +{"SP_CreateCoopSpots", (byte *)SP_CreateCoopSpots}, +{"SP_FixCoopSpots", (byte *)SP_FixCoopSpots}, +{"CheckChasecam_Viewent", (byte *)CheckChasecam_Viewent}, +{"Cmd_Chasecam_Toggle", (byte *)Cmd_Chasecam_Toggle}, +{"ChasecamTrack", (byte *)ChasecamTrack}, +{"ChasecamRemove", (byte *)ChasecamRemove}, +{"ChasecamRestart", (byte *)ChasecamRestart}, +{"ChasecamStart", (byte *)ChasecamStart}, +{"SP_monster_tank", (byte *)SP_monster_tank}, +{"tank_die", (byte *)tank_die}, +{"tank_dead", (byte *)tank_dead}, +{"tank_cmdr_body_think", (byte *)tank_cmdr_body_think}, +{"tank_attack", (byte *)tank_attack}, +{"tank_doattack_rocket", (byte *)tank_doattack_rocket}, +{"tank_refire_rocket", (byte *)tank_refire_rocket}, +{"tank_poststrike", (byte *)tank_poststrike}, +{"tank_reattack_blaster", (byte *)tank_reattack_blaster}, +{"TankMachineGun", (byte *)TankMachineGun}, +{"TankRocket", (byte *)TankRocket}, +{"TankStrike", (byte *)TankStrike}, +{"TankBlaster", (byte *)TankBlaster}, +{"tank_pain", (byte *)tank_pain}, +{"tank_run", (byte *)tank_run}, +{"tank_walk", (byte *)tank_walk}, +{"tank_stand", (byte *)tank_stand}, +{"tank_idle", (byte *)tank_idle}, +{"tank_windup", (byte *)tank_windup}, +{"tank_thud", (byte *)tank_thud}, +{"tank_footstep", (byte *)tank_footstep}, +{"tank_sight", (byte *)tank_sight}, +{"SP_monster_supertank", (byte *)SP_monster_supertank}, +{"supertank_die", (byte *)supertank_die}, +{"BossExplode", (byte *)BossExplode}, +{"supertank_dead", (byte *)supertank_dead}, +{"supertank_attack", (byte *)supertank_attack}, +{"supertankMachineGun", (byte *)supertankMachineGun}, +{"supertankRocket", (byte *)supertankRocket}, +{"supertank_pain", (byte *)supertank_pain}, +{"supertank_reattack1", (byte *)supertank_reattack1}, +{"supertank_run", (byte *)supertank_run}, +{"supertank_walk", (byte *)supertank_walk}, +{"supertank_forward", (byte *)supertank_forward}, +{"supertank_stand", (byte *)supertank_stand}, +{"supertank_search", (byte *)supertank_search}, +{"TreadSound", (byte *)TreadSound}, +{"SP_monster_soldier_ss", (byte *)SP_monster_soldier_ss}, +{"SP_monster_soldier", (byte *)SP_monster_soldier}, +{"SP_monster_soldier_light", (byte *)SP_monster_soldier_light}, +{"SP_monster_soldier_x", (byte *)SP_monster_soldier_x}, +{"soldier_jump", (byte *)soldier_jump}, +{"soldier_die", (byte *)soldier_die}, +{"soldier_dead", (byte *)soldier_dead}, +{"soldier_fire7", (byte *)soldier_fire7}, +{"soldier_fire6", (byte *)soldier_fire6}, +{"soldier_dodge", (byte *)soldier_dodge}, +{"soldier_duck_hold", (byte *)soldier_duck_hold}, +{"soldier_sight", (byte *)soldier_sight}, +{"soldier_attack", (byte *)soldier_attack}, +{"soldier_attack6_refire", (byte *)soldier_attack6_refire}, +{"soldier_fire8", (byte *)soldier_fire8}, +{"soldier_fire4", (byte *)soldier_fire4}, +{"soldier_attack3_refire", (byte *)soldier_attack3_refire}, +{"soldier_fire3", (byte *)soldier_fire3}, +{"soldier_duck_up", (byte *)soldier_duck_up}, +{"soldier_duck_down", (byte *)soldier_duck_down}, +{"soldier_attack2_refire2", (byte *)soldier_attack2_refire2}, +{"soldier_attack2_refire1", (byte *)soldier_attack2_refire1}, +{"soldier_fire2", (byte *)soldier_fire2}, +{"soldier_attack1_refire2", (byte *)soldier_attack1_refire2}, +{"soldier_attack1_refire1", (byte *)soldier_attack1_refire1}, +{"soldier_fire1", (byte *)soldier_fire1}, +{"soldier_fire", (byte *)soldier_fire}, +{"soldier_pain", (byte *)soldier_pain}, +{"soldier_run", (byte *)soldier_run}, +{"soldier_walk", (byte *)soldier_walk}, +{"soldier_walk1_random", (byte *)soldier_walk1_random}, +{"soldier_stand", (byte *)soldier_stand}, +{"soldier_cock", (byte *)soldier_cock}, +{"soldier_idle", (byte *)soldier_idle}, +{"SP_monster_sentrybot", (byte *)SP_monster_sentrybot}, +{"sentrybot_attack", (byte *)sentrybot_attack}, +{"sentrybot_fire", (byte *)sentrybot_fire}, +{"sentrybot_MG", (byte *)sentrybot_MG}, +{"sentrybot_HB", (byte *)sentrybot_HB}, +{"sentrybot_die", (byte *)sentrybot_die}, +{"sentrybot_pain", (byte *)sentrybot_pain}, +{"sentrybot_jump", (byte *)sentrybot_jump}, +{"sentrybot_run", (byte *)sentrybot_run}, +{"sentrybot_walk", (byte *)sentrybot_walk}, +{"sentrybot_sound_move", (byte *)sentrybot_sound_move}, +{"sentrybot_sight", (byte *)sentrybot_sight}, +{"sentrybot_search", (byte *)sentrybot_search}, +{"sentrybot_idle", (byte *)sentrybot_idle}, +{"sentrybot_stand", (byte *)sentrybot_stand}, +{"sentrybot_sound_stand", (byte *)sentrybot_sound_stand}, +{"SP_monster_parasite", (byte *)SP_monster_parasite}, +{"parasite_jump", (byte *)parasite_jump}, +{"parasite_die", (byte *)parasite_die}, +{"parasite_dead", (byte *)parasite_dead}, +{"parasite_attack", (byte *)parasite_attack}, +{"parasite_drain_attack", (byte *)parasite_drain_attack}, +{"parasite_drain_attack_ok", (byte *)parasite_drain_attack_ok}, +{"parasite_pain", (byte *)parasite_pain}, +{"parasite_walk", (byte *)parasite_walk}, +{"parasite_start_walk", (byte *)parasite_start_walk}, +{"parasite_run", (byte *)parasite_run}, +{"parasite_start_run", (byte *)parasite_start_run}, +{"parasite_stand", (byte *)parasite_stand}, +{"parasite_idle", (byte *)parasite_idle}, +{"parasite_refidget", (byte *)parasite_refidget}, +{"parasite_do_fidget", (byte *)parasite_do_fidget}, +{"parasite_end_fidget", (byte *)parasite_end_fidget}, +{"parasite_search", (byte *)parasite_search}, +{"parasite_scratch", (byte *)parasite_scratch}, +{"parasite_tap", (byte *)parasite_tap}, +{"parasite_sight", (byte *)parasite_sight}, +{"parasite_reel_in", (byte *)parasite_reel_in}, +{"parasite_launch", (byte *)parasite_launch}, +{"SP_monster_mutant", (byte *)SP_monster_mutant}, +{"mutant_fake_jump", (byte *)mutant_fake_jump}, +{"mutant_die", (byte *)mutant_die}, +{"mutant_dead", (byte *)mutant_dead}, +{"mutant_pain", (byte *)mutant_pain}, +{"mutant_checkattack", (byte *)mutant_checkattack}, +{"mutant_check_jump", (byte *)mutant_check_jump}, +{"mutant_check_melee", (byte *)mutant_check_melee}, +{"mutant_jump", (byte *)mutant_jump}, +{"mutant_check_landing", (byte *)mutant_check_landing}, +{"mutant_jump_takeoff", (byte *)mutant_jump_takeoff}, +{"mutant_jump_touch", (byte *)mutant_jump_touch}, +{"mutant_melee", (byte *)mutant_melee}, +{"mutant_check_refire", (byte *)mutant_check_refire}, +{"mutant_hit_right", (byte *)mutant_hit_right}, +{"mutant_hit_left", (byte *)mutant_hit_left}, +{"mutant_run", (byte *)mutant_run}, +{"mutant_walk", (byte *)mutant_walk}, +{"mutant_walk_loop", (byte *)mutant_walk_loop}, +{"mutant_idle", (byte *)mutant_idle}, +{"mutant_idle_loop", (byte *)mutant_idle_loop}, +{"mutant_stand", (byte *)mutant_stand}, +{"mutant_swing", (byte *)mutant_swing}, +{"mutant_search", (byte *)mutant_search}, +{"mutant_sight", (byte *)mutant_sight}, +{"mutant_step", (byte *)mutant_step}, +{"M_walkmove", (byte *)M_walkmove}, +{"M_MoveToGoal", (byte *)M_MoveToGoal}, +{"SV_CloseEnough", (byte *)SV_CloseEnough}, +{"SV_NewChaseDir", (byte *)SV_NewChaseDir}, +{"SV_FixCheckBottom", (byte *)SV_FixCheckBottom}, +{"SV_StepDirection", (byte *)SV_StepDirection}, +{"M_ChangeYaw", (byte *)M_ChangeYaw}, +{"SV_movestep", (byte *)SV_movestep}, +{"M_CheckBottom", (byte *)M_CheckBottom}, +{"SP_monster_medic", (byte *)SP_monster_medic}, +{"medic_checkattack", (byte *)medic_checkattack}, +{"medic_attack", (byte *)medic_attack}, +{"medic_hook_retract", (byte *)medic_hook_retract}, +{"medic_cable_attack", (byte *)medic_cable_attack}, +{"medic_hook_launch", (byte *)medic_hook_launch}, +{"medic_continue", (byte *)medic_continue}, +{"medic_dodge", (byte *)medic_dodge}, +{"medic_duck_up", (byte *)medic_duck_up}, +{"medic_duck_hold", (byte *)medic_duck_hold}, +{"medic_duck_down", (byte *)medic_duck_down}, +{"medic_die", (byte *)medic_die}, +{"medic_dead", (byte *)medic_dead}, +{"medic_fire_blaster", (byte *)medic_fire_blaster}, +{"medic_pain", (byte *)medic_pain}, +{"medic_run", (byte *)medic_run}, +{"medic_walk", (byte *)medic_walk}, +{"medic_stand", (byte *)medic_stand}, +{"medic_sight", (byte *)medic_sight}, +{"medic_search", (byte *)medic_search}, +{"medic_idle", (byte *)medic_idle}, +{"medic_NextPatrolPoint", (byte *)medic_NextPatrolPoint}, +{"medic_StopPatrolling", (byte *)medic_StopPatrolling}, +{"medic_FindDeadMonster", (byte *)medic_FindDeadMonster}, +{"embedded", (byte *)embedded}, +{"abortHeal", (byte *)abortHeal}, +{"DeleteBadMedic", (byte *)DeleteBadMedic}, +{"cleanupHeal", (byte *)cleanupHeal}, +{"deadmonster_think", (byte *)deadmonster_think}, +{"SP_misc_insane", (byte *)SP_misc_insane}, +{"insane_die", (byte *)insane_die}, +{"insane_dead", (byte *)insane_dead}, +{"insane_stand", (byte *)insane_stand}, +{"insane_checkup", (byte *)insane_checkup}, +{"insane_checkdown", (byte *)insane_checkdown}, +{"insane_onground", (byte *)insane_onground}, +{"insane_pain", (byte *)insane_pain}, +{"insane_run", (byte *)insane_run}, +{"insane_walk", (byte *)insane_walk}, +{"insane_cross", (byte *)insane_cross}, +{"insane_scream", (byte *)insane_scream}, +{"insane_moan", (byte *)insane_moan}, +{"insane_shake", (byte *)insane_shake}, +{"insane_fist", (byte *)insane_fist}, +{"SP_monster_infantry", (byte *)SP_monster_infantry}, +{"infantry_jump", (byte *)infantry_jump}, +{"infantry_attack", (byte *)infantry_attack}, +{"infantry_smack", (byte *)infantry_smack}, +{"infantry_swing", (byte *)infantry_swing}, +{"infantry_fire", (byte *)infantry_fire}, +{"infantry_cock_gun", (byte *)infantry_cock_gun}, +{"infantry_dodge", (byte *)infantry_dodge}, +{"infantry_end_roll", (byte *)infantry_end_roll}, +{"infantry_roll", (byte *)infantry_roll}, +{"infantry_start_roll", (byte *)infantry_start_roll}, +{"infantry_duck_up", (byte *)infantry_duck_up}, +{"infantry_duck_hold", (byte *)infantry_duck_hold}, +{"infantry_duck_down", (byte *)infantry_duck_down}, +{"infantry_die", (byte *)infantry_die}, +{"blood_spurt", (byte *)blood_spurt}, +{"infantry_dead", (byte *)infantry_dead}, +{"infantry_sight", (byte *)infantry_sight}, +{"InfantryMachineGun", (byte *)InfantryMachineGun}, +{"InfantryHyperBlaster", (byte *)InfantryHyperBlaster}, +{"infantry_pain", (byte *)infantry_pain}, +{"infantry_run", (byte *)infantry_run}, +{"infantry_walk", (byte *)infantry_walk}, +{"infantry_fidget", (byte *)infantry_fidget}, +{"infantry_stand", (byte *)infantry_stand}, +{"SP_monster_hover", (byte *)SP_monster_hover}, +{"hover_die", (byte *)hover_die}, +{"hover_dead", (byte *)hover_dead}, +{"hover_deadthink", (byte *)hover_deadthink}, +{"hover_pain", (byte *)hover_pain}, +{"hover_dodge", (byte *)hover_dodge}, +{"hover_attack", (byte *)hover_attack}, +{"hover_start_attack", (byte *)hover_start_attack}, +{"hover_walk", (byte *)hover_walk}, +{"hover_run", (byte *)hover_run}, +{"hover_stand", (byte *)hover_stand}, +{"hover_fire_blaster", (byte *)hover_fire_blaster}, +{"hover_fire_rocket", (byte *)hover_fire_rocket}, +{"hover_reattack", (byte *)hover_reattack}, +{"hover_search", (byte *)hover_search}, +{"hover_sight", (byte *)hover_sight}, +{"SP_monster_gunner", (byte *)SP_monster_gunner}, +{"gunner_jump", (byte *)gunner_jump}, +{"gunner_refire_chain", (byte *)gunner_refire_chain}, +{"gunner_fire_chain", (byte *)gunner_fire_chain}, +{"gunner_attack", (byte *)gunner_attack}, +{"GunnerGrenade", (byte *)GunnerGrenade}, +{"SetNotBusy", (byte *)SetNotBusy}, +{"GunnerFire", (byte *)GunnerFire}, +{"gunner_opengun", (byte *)gunner_opengun}, +{"gunner_dodge", (byte *)gunner_dodge}, +{"gunner_duck_up", (byte *)gunner_duck_up}, +{"gunner_duck_hold", (byte *)gunner_duck_hold}, +{"gunner_duck_down", (byte *)gunner_duck_down}, +{"gunner_grenade_check", (byte *)gunner_grenade_check}, +{"gunner_die", (byte *)gunner_die}, +{"gunner_dead", (byte *)gunner_dead}, +{"gunner_pain", (byte *)gunner_pain}, +{"gunner_runandshoot", (byte *)gunner_runandshoot}, +{"gunner_run", (byte *)gunner_run}, +{"gunner_walk", (byte *)gunner_walk}, +{"gunner_stand", (byte *)gunner_stand}, +{"gunner_fidget", (byte *)gunner_fidget}, +{"gunner_search", (byte *)gunner_search}, +{"gunner_sight", (byte *)gunner_sight}, +{"gunner_idlesound", (byte *)gunner_idlesound}, +{"SP_monster_gladiator", (byte *)SP_monster_gladiator}, +{"gladiator_blocked", (byte *)gladiator_blocked}, +{"gladiator_die", (byte *)gladiator_die}, +{"gladiator_dead", (byte *)gladiator_dead}, +{"gladiator_pain", (byte *)gladiator_pain}, +{"gladiator_attack", (byte *)gladiator_attack}, +{"GladiatorGun_3", (byte *)GladiatorGun_3}, +{"GladiatorGun_2", (byte *)GladiatorGun_2}, +{"GladiatorGun_1", (byte *)GladiatorGun_1}, +{"GladiatorGun_0", (byte *)GladiatorGun_0}, +{"GladiatorGun", (byte *)GladiatorGun}, +{"gladiator_melee", (byte *)gladiator_melee}, +{"GaldiatorMelee", (byte *)GaldiatorMelee}, +{"gladiator_run", (byte *)gladiator_run}, +{"gladiator_walk", (byte *)gladiator_walk}, +{"gladiator_stand", (byte *)gladiator_stand}, +{"gladiator_cleaver_swing", (byte *)gladiator_cleaver_swing}, +{"gladiator_search", (byte *)gladiator_search}, +{"gladiator_sight", (byte *)gladiator_sight}, +{"gladiator_idle", (byte *)gladiator_idle}, +{"SP_monster_flyer", (byte *)SP_monster_flyer}, +{"flyer_die", (byte *)flyer_die}, +{"flyer_pain", (byte *)flyer_pain}, +{"flyer_check_melee", (byte *)flyer_check_melee}, +{"flyer_melee", (byte *)flyer_melee}, +{"flyer_nextmove", (byte *)flyer_nextmove}, +{"flyer_setstart", (byte *)flyer_setstart}, +{"flyer_attack", (byte *)flyer_attack}, +{"flyer_loop_melee", (byte *)flyer_loop_melee}, +{"flyer_slash_right", (byte *)flyer_slash_right}, +{"flyer_slash_left", (byte *)flyer_slash_left}, +{"flyer_fireright", (byte *)flyer_fireright}, +{"flyer_fireleft", (byte *)flyer_fireleft}, +{"flyer_fire", (byte *)flyer_fire}, +{"flyer_start", (byte *)flyer_start}, +{"flyer_stop", (byte *)flyer_stop}, +{"flyer_stand", (byte *)flyer_stand}, +{"flyer_walk", (byte *)flyer_walk}, +{"flyer_run", (byte *)flyer_run}, +{"flyer_pop_blades", (byte *)flyer_pop_blades}, +{"flyer_idle", (byte *)flyer_idle}, +{"flyer_sight", (byte *)flyer_sight}, +{"SP_monster_floater", (byte *)SP_monster_floater}, +{"floater_die", (byte *)floater_die}, +{"floater_dead", (byte *)floater_dead}, +{"floater_pain", (byte *)floater_pain}, +{"floater_dodge", (byte *)floater_dodge}, +{"floater_melee", (byte *)floater_melee}, +{"floater_attack", (byte *)floater_attack}, +{"floater_zap", (byte *)floater_zap}, +{"floater_wham", (byte *)floater_wham}, +{"floater_walk", (byte *)floater_walk}, +{"floater_run", (byte *)floater_run}, +{"floater_stand", (byte *)floater_stand}, +{"floater_fire_blaster", (byte *)floater_fire_blaster}, +{"floater_idle", (byte *)floater_idle}, +{"floater_sight", (byte *)floater_sight}, +{"SP_monster_flipper", (byte *)SP_monster_flipper}, +{"flipper_die", (byte *)flipper_die}, +{"flipper_sight", (byte *)flipper_sight}, +{"flipper_dead", (byte *)flipper_dead}, +{"flipper_pain", (byte *)flipper_pain}, +{"flipper_melee", (byte *)flipper_melee}, +{"flipper_preattack", (byte *)flipper_preattack}, +{"flipper_bite", (byte *)flipper_bite}, +{"flipper_start_run", (byte *)flipper_start_run}, +{"flipper_walk", (byte *)flipper_walk}, +{"flipper_run", (byte *)flipper_run}, +{"flipper_run_loop", (byte *)flipper_run_loop}, +{"flipper_stand", (byte *)flipper_stand}, +{"SP_monster_chick", (byte *)SP_monster_chick}, +{"chick_sight", (byte *)chick_sight}, +{"chick_attack", (byte *)chick_attack}, +{"chick_melee", (byte *)chick_melee}, +{"chick_slash", (byte *)chick_slash}, +{"chick_reslash", (byte *)chick_reslash}, +{"chick_attack1", (byte *)chick_attack1}, +{"chick_rerocket", (byte *)chick_rerocket}, +{"chick_skip_frames", (byte *)chick_skip_frames}, +{"ChickReload", (byte *)ChickReload}, +{"Chick_PreAttack1", (byte *)Chick_PreAttack1}, +{"ChickRocket", (byte *)ChickRocket}, +{"ChickSlash", (byte *)ChickSlash}, +{"chick_dodge", (byte *)chick_dodge}, +{"chick_end_backflip", (byte *)chick_end_backflip}, +{"chick_backflip", (byte *)chick_backflip}, +{"chick_start_backflip", (byte *)chick_start_backflip}, +{"chick_duck_up", (byte *)chick_duck_up}, +{"chick_duck_hold", (byte *)chick_duck_hold}, +{"chick_duck_down", (byte *)chick_duck_down}, +{"chick_die", (byte *)chick_die}, +{"chick_dead", (byte *)chick_dead}, +{"chick_pain", (byte *)chick_pain}, +{"chick_run", (byte *)chick_run}, +{"chick_walk", (byte *)chick_walk}, +{"chick_stand", (byte *)chick_stand}, +{"chick_fidget", (byte *)chick_fidget}, +{"ChickMoan", (byte *)ChickMoan}, +{"SP_monster_brain", (byte *)SP_monster_brain}, +{"brain_die", (byte *)brain_die}, +{"brain_dead", (byte *)brain_dead}, +{"brain_pain", (byte *)brain_pain}, +{"brain_attack", (byte *)brain_attack}, +{"brain_drain_check", (byte *)brain_drain_check}, +{"brain_check_melee", (byte *)brain_check_melee}, +{"brain_drain_attack", (byte *)brain_drain_attack}, +{"brain_drain_attack_ok", (byte *)brain_drain_attack_ok}, +{"brain_plasma_attack", (byte *)brain_plasma_attack}, +{"brain_run", (byte *)brain_run}, +{"brain_chest_closed", (byte *)brain_chest_closed}, +{"brain_tentacle_attack", (byte *)brain_tentacle_attack}, +{"brain_chest_open", (byte *)brain_chest_open}, +{"brain_hit_left", (byte *)brain_hit_left}, +{"brain_swing_left", (byte *)brain_swing_left}, +{"brain_hit_right", (byte *)brain_hit_right}, +{"brain_swing_right", (byte *)brain_swing_right}, +{"brain_dodge", (byte *)brain_dodge}, +{"brain_duck_up", (byte *)brain_duck_up}, +{"brain_duck_hold", (byte *)brain_duck_hold}, +{"brain_duck_down", (byte *)brain_duck_down}, +{"brain_walk", (byte *)brain_walk}, +{"brain_walk2_cycle", (byte *)brain_walk2_cycle}, +{"brain_idle", (byte *)brain_idle}, +{"brain_stand", (byte *)brain_stand}, +{"brain_search", (byte *)brain_search}, +{"brain_sight", (byte *)brain_sight}, +{"MakronToss", (byte *)MakronToss}, +{"MakronSpawn", (byte *)MakronSpawn}, +{"SP_monster_makron", (byte *)SP_monster_makron}, +{"MakronPrecache", (byte *)MakronPrecache}, +{"Makron_CheckAttack", (byte *)Makron_CheckAttack}, +{"makron_die", (byte *)makron_die}, +{"makron_dead", (byte *)makron_dead}, +{"makron_torso", (byte *)makron_torso}, +{"makron_torso_die", (byte *)makron_torso_die}, +{"makron_torso_think", (byte *)makron_torso_think}, +{"makron_attack", (byte *)makron_attack}, +{"makron_sight", (byte *)makron_sight}, +{"makron_pain", (byte *)makron_pain}, +{"MakronHyperblaster", (byte *)MakronHyperblaster}, +{"MakronRailgun", (byte *)MakronRailgun}, +{"MakronSaveloc", (byte *)MakronSaveloc}, +{"makronBFG", (byte *)makronBFG}, +{"makron_run", (byte *)makron_run}, +{"makron_walk", (byte *)makron_walk}, +{"makron_prerailgun", (byte *)makron_prerailgun}, +{"makron_brainsplorch", (byte *)makron_brainsplorch}, +{"makron_step_right", (byte *)makron_step_right}, +{"makron_step_left", (byte *)makron_step_left}, +{"makron_popup", (byte *)makron_popup}, +{"makron_hit", (byte *)makron_hit}, +{"makron_stand", (byte *)makron_stand}, +{"makron_taunt", (byte *)makron_taunt}, +{"SP_monster_jorg", (byte *)SP_monster_jorg}, +{"Jorg_CheckAttack", (byte *)Jorg_CheckAttack}, +{"jorg_die", (byte *)jorg_die}, +{"jorg_dead", (byte *)jorg_dead}, +{"jorg_attack", (byte *)jorg_attack}, +{"jorg_firebullet", (byte *)jorg_firebullet}, +{"jorg_firebullet_left", (byte *)jorg_firebullet_left}, +{"jorg_firebullet_right", (byte *)jorg_firebullet_right}, +{"jorgBFG", (byte *)jorgBFG}, +{"jorg_pain", (byte *)jorg_pain}, +{"jorg_attack1", (byte *)jorg_attack1}, +{"jorg_reattack1", (byte *)jorg_reattack1}, +{"jorg_run", (byte *)jorg_run}, +{"jorg_walk", (byte *)jorg_walk}, +{"jorg_stand", (byte *)jorg_stand}, +{"jorg_step_right", (byte *)jorg_step_right}, +{"jorg_step_left", (byte *)jorg_step_left}, +{"jorg_death_hit", (byte *)jorg_death_hit}, +{"jorg_idle", (byte *)jorg_idle}, +{"jorg_search", (byte *)jorg_search}, +{"SP_monster_boss3_stand", (byte *)SP_monster_boss3_stand}, +{"Think_Boss3Stand", (byte *)Think_Boss3Stand}, +{"Use_Boss3", (byte *)Use_Boss3}, +{"SP_monster_boss2", (byte *)SP_monster_boss2}, +{"Boss2_CheckAttack", (byte *)Boss2_CheckAttack}, +{"boss2_die", (byte *)boss2_die}, +{"boss2_dead", (byte *)boss2_dead}, +{"boss2_pain", (byte *)boss2_pain}, +{"boss2_reattack_mg", (byte *)boss2_reattack_mg}, +{"boss2_attack_mg", (byte *)boss2_attack_mg}, +{"boss2_attack", (byte *)boss2_attack}, +{"boss2_walk", (byte *)boss2_walk}, +{"boss2_run", (byte *)boss2_run}, +{"boss2_stand", (byte *)boss2_stand}, +{"Boss2MachineGun", (byte *)Boss2MachineGun}, +{"boss2_firebullet_left", (byte *)boss2_firebullet_left}, +{"boss2_firebullet_right", (byte *)boss2_firebullet_right}, +{"Boss2Rocket", (byte *)Boss2Rocket}, +{"boss2_search", (byte *)boss2_search}, +{"SP_monster_berserk", (byte *)SP_monster_berserk}, +{"berserk_jump", (byte *)berserk_jump}, +{"berserk_die", (byte *)berserk_die}, +{"berserk_dead", (byte *)berserk_dead}, +{"berserk_pain", (byte *)berserk_pain}, +{"berserk_melee", (byte *)berserk_melee}, +{"berserk_strike", (byte *)berserk_strike}, +{"berserk_attack_club", (byte *)berserk_attack_club}, +{"berserk_swing", (byte *)berserk_swing}, +{"berserk_attack_spike", (byte *)berserk_attack_spike}, +{"berserk_run", (byte *)berserk_run}, +{"berserk_walk", (byte *)berserk_walk}, +{"berserk_fidget", (byte *)berserk_fidget}, +{"berserk_stand", (byte *)berserk_stand}, +{"berserk_search", (byte *)berserk_search}, +{"berserk_sight", (byte *)berserk_sight}, +{"actorBFG", (byte *)actorBFG}, +{"actorRailGun", (byte *)actorRailGun}, +{"actorHyperblaster", (byte *)actorHyperblaster}, +{"actorRocket", (byte *)actorRocket}, +{"actorGrenadeLauncher", (byte *)actorGrenadeLauncher}, +{"actorChaingun", (byte *)actorChaingun}, +{"actorMachineGun", (byte *)actorMachineGun}, +{"actorSuperShotgun", (byte *)actorSuperShotgun}, +{"actorShotgun", (byte *)actorShotgun}, +{"actorBlaster", (byte *)actorBlaster}, +{"ActorTarget", (byte *)ActorTarget}, +{"TraceAimPoint", (byte *)TraceAimPoint}, +{"muzzleflash_think", (byte *)muzzleflash_think}, +{"actor_moveit", (byte *)actor_moveit}, +{"actor_files", (byte *)actor_files}, +{"InPak", (byte *)InPak}, +{"SP_target_actor", (byte *)SP_target_actor}, +{"target_actor_touch", (byte *)target_actor_touch}, +{"SP_misc_actor", (byte *)SP_misc_actor}, +{"actor_salute", (byte *)actor_salute}, +{"actor_blocked", (byte *)actor_blocked}, +{"actor_jump", (byte *)actor_jump}, +{"actor_end_jump", (byte *)actor_end_jump}, +{"actor_checkattack", (byte *)actor_checkattack}, +{"actor_use", (byte *)actor_use}, +{"actor_attack", (byte *)actor_attack}, +{"actor_seekcover", (byte *)actor_seekcover}, +{"actor_no_weapon_sound", (byte *)actor_no_weapon_sound}, +{"actor_fire", (byte *)actor_fire}, +{"actor_die", (byte *)actor_die}, +{"actor_dead", (byte *)actor_dead}, +{"actor_pain", (byte *)actor_pain}, +{"actor_switch", (byte *)actor_switch}, +{"actor_ideal_range", (byte *)actor_ideal_range}, +{"actor_run_back", (byte *)actor_run_back}, +{"actor_run", (byte *)actor_run}, +{"actor_walk_back", (byte *)actor_walk_back}, +{"actor_walk", (byte *)actor_walk}, +{"actor_stand", (byte *)actor_stand}, +{"AimGrenade", (byte *)AimGrenade}, +{"fire_bfg", (byte *)fire_bfg}, +{"bfg_think", (byte *)bfg_think}, +{"bfg_touch", (byte *)bfg_touch}, +{"bfg_explode", (byte *)bfg_explode}, +{"fire_rail", (byte *)fire_rail}, +{"SP_rocket", (byte *)SP_rocket}, +{"rocket_delayed_start", (byte *)rocket_delayed_start}, +{"fire_rocket", (byte *)fire_rocket}, +{"rocket_die", (byte *)rocket_die}, +{"rocket_explode", (byte *)rocket_explode}, +{"rocket_touch", (byte *)rocket_touch}, +{"Rocket_Evade", (byte *)Rocket_Evade}, +{"homing_think", (byte *)homing_think}, +{"SP_handgrenade", (byte *)SP_handgrenade}, +{"handgrenade_delayed_start", (byte *)handgrenade_delayed_start}, +{"SP_grenade", (byte *)SP_grenade}, +{"grenade_delayed_start", (byte *)grenade_delayed_start}, +{"fire_grenade2", (byte *)fire_grenade2}, +{"fire_grenade", (byte *)fire_grenade}, +{"Grenade_Touch", (byte *)Grenade_Touch}, +{"Grenade_Explode", (byte *)Grenade_Explode}, +{"Grenade_Remove_From_Chain", (byte *)Grenade_Remove_From_Chain}, +{"Grenade_Add_To_Chain", (byte *)Grenade_Add_To_Chain}, +{"Grenade_Evade", (byte *)Grenade_Evade}, +{"SP_plasma_bolt", (byte *)SP_plasma_bolt}, +{"fire_plasma", (byte *)fire_plasma}, +{"plasma_touch", (byte *)plasma_touch}, +{"SP_bolt", (byte *)SP_bolt}, +{"bolt_delayed_start", (byte *)bolt_delayed_start}, +{"fire_blaster", (byte *)fire_blaster}, +{"blaster_touch", (byte *)blaster_touch}, +{"fire_shotgun", (byte *)fire_shotgun}, +{"fire_bullet", (byte *)fire_bullet}, +{"fire_lead", (byte *)fire_lead}, +{"fire_hit", (byte *)fire_hit}, +{"check_dodge_inf_mg", (byte *)check_dodge_inf_mg}, +{"check_dodge", (byte *)check_dodge}, +{"SP_func_vehicle", (byte *)SP_func_vehicle}, +{"turn_vehicle", (byte *)turn_vehicle}, +{"vehicle_think", (byte *)vehicle_think}, +{"vehicle_disengage", (byte *)vehicle_disengage}, +{"vehicle_touch", (byte *)vehicle_touch}, +{"vehicle_blocked", (byte *)vehicle_blocked}, +{"func_vehicle_explode", (byte *)func_vehicle_explode}, +{"G_UseTarget", (byte *)G_UseTarget}, +{"Think_Delay_Single", (byte *)Think_Delay_Single}, +{"GameDirRelativePath", (byte *)GameDirRelativePath}, +{"LookingAt", (byte *)LookingAt}, +{"AtLeast", (byte *)AtLeast}, +{"point_infront", (byte *)point_infront}, +{"stuffcmd", (byte *)stuffcmd}, +{"SnapToEights", (byte *)SnapToEights}, +{"AnglesNormalize", (byte *)AnglesNormalize}, +{"KillBox", (byte *)KillBox}, +{"G_TouchSolids", (byte *)G_TouchSolids}, +{"G_TouchTriggers", (byte *)G_TouchTriggers}, +{"G_FreeEdict", (byte *)G_FreeEdict}, +{"G_Spawn", (byte *)G_Spawn}, +{"G_InitEdict", (byte *)G_InitEdict}, +{"G_CopyString", (byte *)G_CopyString}, +{"vectoangles2", (byte *)vectoangles2}, +{"vectoangles", (byte *)vectoangles}, +{"vectoyaw2", (byte *)vectoyaw2}, +{"vectoyaw", (byte *)vectoyaw}, +{"G_SetMovedir", (byte *)G_SetMovedir}, +{"vtosf", (byte *)vtosf}, +{"vtos", (byte *)vtos}, +{"tv", (byte *)tv}, +{"G_UseTargets", (byte *)G_UseTargets}, +{"Think_Delay", (byte *)Think_Delay}, +{"G_PickTarget", (byte *)G_PickTarget}, +{"findradius2", (byte *)findradius2}, +{"findradius", (byte *)findradius}, +{"G_Find", (byte *)G_Find}, +{"G_ProjectSource2", (byte *)G_ProjectSource2}, +{"G_ProjectSource", (byte *)G_ProjectSource}, +{"SP_turret_driver", (byte *)SP_turret_driver}, +{"turret_driver_link", (byte *)turret_driver_link}, +{"turret_driver_think", (byte *)turret_driver_think}, +{"turret_driver_die", (byte *)turret_driver_die}, +{"SP_turret_base", (byte *)SP_turret_base}, +{"use_turret_base", (byte *)use_turret_base}, +{"turret_base_finish", (byte *)turret_base_finish}, +{"SP_model_turret", (byte *)SP_model_turret}, +{"SP_turret_breach", (byte *)SP_turret_breach}, +{"turret_breach_touch", (byte *)turret_breach_touch}, +{"use_turret_breach", (byte *)use_turret_breach}, +{"toggle_turret_breach", (byte *)toggle_turret_breach}, +{"turret_die", (byte *)turret_die}, +{"turret_die_temp_think", (byte *)turret_die_temp_think}, +{"turret_breach_finish_init", (byte *)turret_breach_finish_init}, +{"turret_breach_think", (byte *)turret_breach_think}, +{"turret_turn", (byte *)turret_turn}, +{"turret_disengage", (byte *)turret_disengage}, +{"turret_breach_fire", (byte *)turret_breach_fire}, +{"hrocket_turret_fire", (byte *)hrocket_turret_fire}, +{"turret_blocked", (byte *)turret_blocked}, +{"TurretTarget", (byte *)TurretTarget}, +{"SP_trigger_disguise", (byte *)SP_trigger_disguise}, +{"trigger_disguise_use", (byte *)trigger_disguise_use}, +{"trigger_disguise_touch", (byte *)trigger_disguise_touch}, +{"SP_trigger_transition", (byte *)SP_trigger_transition}, +{"trigger_transition_ents", (byte *)trigger_transition_ents}, +{"trans_ent_filename", (byte *)trans_ent_filename}, +{"WriteTransitionEdict", (byte *)WriteTransitionEdict}, +{"HasSpawnFunction", (byte *)HasSpawnFunction}, +{"SP_trigger_speaker", (byte *)SP_trigger_speaker}, +{"trigger_speaker_enable", (byte *)trigger_speaker_enable}, +{"trigger_speaker_disable", (byte *)trigger_speaker_disable}, +{"trigger_speaker_think", (byte *)trigger_speaker_think}, +{"SP_trigger_look", (byte *)SP_trigger_look}, +{"trigger_look_enable", (byte *)trigger_look_enable}, +{"trigger_look_disable", (byte *)trigger_look_disable}, +{"trigger_look_touch", (byte *)trigger_look_touch}, +{"SP_trigger_bbox", (byte *)SP_trigger_bbox}, +{"trigger_bbox_use", (byte *)trigger_bbox_use}, +{"trigger_bbox_touch", (byte *)trigger_bbox_touch}, +{"trigger_bbox_die", (byte *)trigger_bbox_die}, +{"trigger_bbox_reset", (byte *)trigger_bbox_reset}, +{"SP_trigger_scales", (byte *)SP_trigger_scales}, +{"trigger_scales_think", (byte *)trigger_scales_think}, +{"weight_on_top", (byte *)weight_on_top}, +{"SP_trigger_inside", (byte *)SP_trigger_inside}, +{"trigger_inside_think", (byte *)trigger_inside_think}, +{"SP_trigger_mass", (byte *)SP_trigger_mass}, +{"trigger_mass_touch", (byte *)trigger_mass_touch}, +{"SP_tremor_trigger_multiple", (byte *)SP_tremor_trigger_multiple}, +{"tremor_trigger_enable", (byte *)tremor_trigger_enable}, +{"Use_tremor_Multi", (byte *)Use_tremor_Multi}, +{"SP_trigger_monsterjump", (byte *)SP_trigger_monsterjump}, +{"trigger_monsterjump_touch", (byte *)trigger_monsterjump_touch}, +{"SP_trigger_gravity", (byte *)SP_trigger_gravity}, +{"trigger_gravity_touch", (byte *)trigger_gravity_touch}, +{"SP_trigger_hurt", (byte *)SP_trigger_hurt}, +{"hurt_touch", (byte *)hurt_touch}, +{"hurt_use", (byte *)hurt_use}, +{"SP_trigger_command", (byte *)SP_trigger_command}, +{"trigger_cmd_touch", (byte *)trigger_cmd_touch}, +{"SP_trigger_medibot", (byte *)SP_trigger_medibot}, +{"medibot_touch", (byte *)medibot_touch}, +{"medibot_use", (byte *)medibot_use}, +{"SP_trigger_push", (byte *)SP_trigger_push}, +{"trigger_push_touch", (byte *)trigger_push_touch}, +{"SP_trigger_always", (byte *)SP_trigger_always}, +{"SP_trigger_counter", (byte *)SP_trigger_counter}, +{"trigger_counter_use", (byte *)trigger_counter_use}, +{"SP_trigger_key", (byte *)SP_trigger_key}, +{"trigger_key_use", (byte *)trigger_key_use}, +{"SP_trigger_relay", (byte *)SP_trigger_relay}, +{"trigger_relay_use", (byte *)trigger_relay_use}, +{"SP_trigger_once", (byte *)SP_trigger_once}, +{"SP_trigger_multiple", (byte *)SP_trigger_multiple}, +{"trigger_enable", (byte *)trigger_enable}, +{"Touch_Multi", (byte *)Touch_Multi}, +{"Use_Multi", (byte *)Use_Multi}, +{"multi_trigger", (byte *)multi_trigger}, +{"multi_wait", (byte *)multi_wait}, +{"InitTrigger", (byte *)InitTrigger}, +{"SP_info_train_start", (byte *)SP_info_train_start}, +{"find_tracktrain", (byte *)find_tracktrain}, +{"SP_func_tracktrain", (byte *)SP_func_tracktrain}, +{"tracktrain_use", (byte *)tracktrain_use}, +{"func_tracktrain_find", (byte *)func_tracktrain_find}, +{"tracktrain_next", (byte *)tracktrain_next}, +{"tracktrain_turn", (byte *)tracktrain_turn}, +{"train_angles", (byte *)train_angles}, +{"LookAhead", (byte *)LookAhead}, +{"NextPathTrack", (byte *)NextPathTrack}, +{"is_backing_up", (byte *)is_backing_up}, +{"tracktrain_reach_dest", (byte *)tracktrain_reach_dest}, +{"tracktrain_blocked", (byte *)tracktrain_blocked}, +{"tracktrain_think", (byte *)tracktrain_think}, +{"tracktrain_hide", (byte *)tracktrain_hide}, +{"tracktrain_disengage", (byte *)tracktrain_disengage}, +{"tracktrain_die", (byte *)tracktrain_die}, +{"tracktrain_drive", (byte *)tracktrain_drive}, +{"SP_func_trackchange", (byte *)SP_func_trackchange}, +{"trackchange_use", (byte *)trackchange_use}, +{"trackchange_done", (byte *)trackchange_done}, +{"SP_path_track", (byte *)SP_path_track}, +{"path_track_use", (byte *)path_track_use}, +{"UTIL_AngleDistance", (byte *)UTIL_AngleDistance}, +{"UTIL_ApproachAngle", (byte *)UTIL_ApproachAngle}, +{"UTIL_AngleMod", (byte *)UTIL_AngleMod}, +{"SP_thing", (byte *)SP_thing}, +{"thing_touch", (byte *)thing_touch}, +{"thing_grenade_boom", (byte *)thing_grenade_boom}, +{"thing_think_pause", (byte *)thing_think_pause}, +{"thing_think", (byte *)thing_think}, +{"thing_restore_leader", (byte *)thing_restore_leader}, +{"SpawnThing", (byte *)SpawnThing}, +{"SP_target_viewshake", (byte *)SP_target_viewshake}, +{"target_viewshake_use", (byte *)target_viewshake_use}, +{"target_viewshake_think", (byte *)target_viewshake_think}, +{"SP_target_bubbles", (byte *)SP_target_bubbles}, +{"target_bubbles_on", (byte *)target_bubbles_on}, +{"target_bubbles_off", (byte *)target_bubbles_off}, +{"target_bubbles_think", (byte *)target_bubbles_think}, +{"SP_target_holo", (byte *)SP_target_holo}, +{"target_holo_use", (byte *)target_holo_use}, +{"target_holo_think", (byte *)target_holo_think}, +{"SP_target_skill", (byte *)SP_target_skill}, +{"use_target_skill", (byte *)use_target_skill}, +{"SP_target_clone", (byte *)SP_target_clone}, +{"target_clone_starton", (byte *)target_clone_starton}, +{"clone", (byte *)clone}, +{"SP_target_fade", (byte *)SP_target_fade}, +{"use_target_fade", (byte *)use_target_fade}, +{"SP_target_sky", (byte *)SP_target_sky}, +{"use_target_sky", (byte *)use_target_sky}, +{"SP_target_set_effect", (byte *)SP_target_set_effect}, +{"use_target_set_effect", (byte *)use_target_set_effect}, +{"SP_target_movewith", (byte *)SP_target_movewith}, +{"use_target_movewith", (byte *)use_target_movewith}, +{"movewith_detach", (byte *)movewith_detach}, +{"SP_target_change", (byte *)SP_target_change}, +{"use_target_change", (byte *)use_target_change}, +{"SP_target_failure", (byte *)SP_target_failure}, +{"use_target_failure", (byte *)use_target_failure}, +{"target_failure_fade_lights", (byte *)target_failure_fade_lights}, +{"target_failure_think", (byte *)target_failure_think}, +{"target_failure_player_die", (byte *)target_failure_player_die}, +{"target_failure_wipe", (byte *)target_failure_wipe}, +{"SP_target_animation", (byte *)SP_target_animation}, +{"target_animation_use", (byte *)target_animation_use}, +{"target_animate", (byte *)target_animate}, +{"SP_target_monitor", (byte *)SP_target_monitor}, +{"use_target_monitor", (byte *)use_target_monitor}, +{"target_monitor_move", (byte *)target_monitor_move}, +{"target_monitor_off", (byte *)target_monitor_off}, +{"SP_target_CD", (byte *)SP_target_CD}, +{"use_target_CD", (byte *)use_target_CD}, +{"SP_target_attractor", (byte *)SP_target_attractor}, +{"use_target_attractor", (byte *)use_target_attractor}, +{"target_attractor_think", (byte *)target_attractor_think}, +{"target_attractor_think_single", (byte *)target_attractor_think_single}, +{"SP_target_effect", (byte *)SP_target_effect}, +{"target_effect_think", (byte *)target_effect_think}, +{"target_effect_use", (byte *)target_effect_use}, +{"target_effect_widowbeam", (byte *)target_effect_widowbeam}, +{"target_effect_tunnel_sparks", (byte *)target_effect_tunnel_sparks}, +{"target_effect_explosion", (byte *)target_effect_explosion}, +{"target_effect_sparks", (byte *)target_effect_sparks}, +{"target_effect_lightning", (byte *)target_effect_lightning}, +{"target_effect_trail", (byte *)target_effect_trail}, +{"target_effect_splash", (byte *)target_effect_splash}, +{"target_effect_steam", (byte *)target_effect_steam}, +{"target_effect_at", (byte *)target_effect_at}, +{"SP_target_rotation", (byte *)SP_target_rotation}, +{"use_target_rotation", (byte *)use_target_rotation}, +{"SP_target_rocks", (byte *)SP_target_rocks}, +{"use_target_rocks", (byte *)use_target_rocks}, +{"ThrowRock", (byte *)ThrowRock}, +{"directed_debris_die", (byte *)directed_debris_die}, +{"SP_target_monsterbattle", (byte *)SP_target_monsterbattle}, +{"use_target_monsterbattle", (byte *)use_target_monsterbattle}, +{"SP_target_anger", (byte *)SP_target_anger}, +{"use_target_anger", (byte *)use_target_anger}, +{"SP_target_locator", (byte *)SP_target_locator}, +{"target_locator_init", (byte *)target_locator_init}, +{"SP_target_earthquake", (byte *)SP_target_earthquake}, +{"target_earthquake_use", (byte *)target_earthquake_use}, +{"target_earthquake_think", (byte *)target_earthquake_think}, +{"SP_target_lightramp", (byte *)SP_target_lightramp}, +{"target_lightramp_use", (byte *)target_lightramp_use}, +{"target_lightramp_think", (byte *)target_lightramp_think}, +{"SP_target_laser", (byte *)SP_target_laser}, +{"target_laser_start", (byte *)target_laser_start}, +{"target_laser_use", (byte *)target_laser_use}, +{"target_laser_off", (byte *)target_laser_off}, +{"target_laser_on", (byte *)target_laser_on}, +{"target_laser_think", (byte *)target_laser_think}, +{"target_laser_ps_use", (byte *)target_laser_ps_use}, +{"target_laser_ps_off", (byte *)target_laser_ps_off}, +{"target_laser_ps_on", (byte *)target_laser_ps_on}, +{"target_laser_ps_think", (byte *)target_laser_ps_think}, +{"SP_target_crosslevel_target", (byte *)SP_target_crosslevel_target}, +{"target_crosslevel_target_think", (byte *)target_crosslevel_target_think}, +{"SP_target_crosslevel_trigger", (byte *)SP_target_crosslevel_trigger}, +{"trigger_crosslevel_trigger_use", (byte *)trigger_crosslevel_trigger_use}, +{"SP_target_blaster", (byte *)SP_target_blaster}, +{"target_blaster_init", (byte *)target_blaster_init}, +{"toggle_target_blaster", (byte *)toggle_target_blaster}, +{"find_target_blaster_target", (byte *)find_target_blaster_target}, +{"target_blaster_think", (byte *)target_blaster_think}, +{"use_target_blaster", (byte *)use_target_blaster}, +{"SP_target_spawner", (byte *)SP_target_spawner}, +{"use_target_spawner", (byte *)use_target_spawner}, +{"SP_target_splash", (byte *)SP_target_splash}, +{"use_target_splash", (byte *)use_target_splash}, +{"SP_target_changelevel", (byte *)SP_target_changelevel}, +{"use_target_changelevel", (byte *)use_target_changelevel}, +{"SP_target_explosion", (byte *)SP_target_explosion}, +{"use_target_explosion", (byte *)use_target_explosion}, +{"target_explosion_explode", (byte *)target_explosion_explode}, +{"SP_target_goal", (byte *)SP_target_goal}, +{"use_target_goal", (byte *)use_target_goal}, +{"SP_target_secret", (byte *)SP_target_secret}, +{"use_target_secret", (byte *)use_target_secret}, +{"SP_target_help", (byte *)SP_target_help}, +{"Use_Target_Help", (byte *)Use_Target_Help}, +{"SP_target_speaker", (byte *)SP_target_speaker}, +{"Use_Target_Speaker", (byte *)Use_Target_Speaker}, +{"SP_target_temp_entity", (byte *)SP_target_temp_entity}, +{"Use_Target_Tent", (byte *)Use_Target_Tent}, +{"ServerCommand", (byte *)ServerCommand}, +{"SVCmd_WriteIP_f", (byte *)SVCmd_WriteIP_f}, +{"SVCmd_ListIP_f", (byte *)SVCmd_ListIP_f}, +{"SVCmd_RemoveIP_f", (byte *)SVCmd_RemoveIP_f}, +{"SVCmd_AddIP_f", (byte *)SVCmd_AddIP_f}, +{"SV_FilterPacket", (byte *)SV_FilterPacket}, +{"Svcmd_Test_f", (byte *)Svcmd_Test_f}, +{"Cmd_ToggleHud", (byte *)Cmd_ToggleHud}, +{"Hud_Off", (byte *)Hud_Off}, +{"Hud_On", (byte *)Hud_On}, +{"SP_worldspawn", (byte *)SP_worldspawn}, +{"SpawnEntities", (byte *)SpawnEntities}, +{"LoadTransitionEnts", (byte *)LoadTransitionEnts}, +{"G_FindTeams", (byte *)G_FindTeams}, +{"ED_ParseEdict", (byte *)ED_ParseEdict}, +{"ED_ParseField", (byte *)ED_ParseField}, +{"ED_NewString", (byte *)ED_NewString}, +{"ED_CallSpawn", (byte *)ED_CallSpawn}, +{"SP_target_playback", (byte *)SP_target_playback}, +{"target_playback_delayed_restart", (byte *)target_playback_delayed_restart}, +{"target_playback_delayed_start", (byte *)target_playback_delayed_start}, +{"Use_Target_Playback", (byte *)Use_Target_Playback}, +{"FMOD_IsPlaying", (byte *)FMOD_IsPlaying}, +{"target_playback_fadein", (byte *)target_playback_fadein}, +{"target_playback_fadeout", (byte *)target_playback_fadeout}, +{"target_playback_die", (byte *)target_playback_die}, +{"FMOD_StopSound", (byte *)FMOD_StopSound}, +{"FMOD_PlaySound", (byte *)FMOD_PlaySound}, +{"CheckEndSample", (byte *)CheckEndSample}, +{"CheckEndMusic", (byte *)CheckEndMusic}, +{"FMOD_Stop", (byte *)FMOD_Stop}, +{"FMOD_UpdateSpeakerPos", (byte *)FMOD_UpdateSpeakerPos}, +{"FMOD_UpdateListenerPos", (byte *)FMOD_UpdateListenerPos}, +{"FMOD_Shutdown", (byte *)FMOD_Shutdown}, +{"FMOD_Init", (byte *)FMOD_Init}, +{"FootStep", (byte *)FootStep}, +{"PlayFootstep", (byte *)PlayFootstep}, +{"ReadLevel", (byte *)ReadLevel}, +{"WriteLevel", (byte *)WriteLevel}, +{"ReadLevelLocals", (byte *)ReadLevelLocals}, +{"ReadEdict", (byte *)ReadEdict}, +{"WriteLevelLocals", (byte *)WriteLevelLocals}, +{"WriteEdict", (byte *)WriteEdict}, +{"ReadGame", (byte *)ReadGame}, +{"WriteGame", (byte *)WriteGame}, +{"ReadClient", (byte *)ReadClient}, +{"WriteClient", (byte *)WriteClient}, +{"ReadField", (byte *)ReadField}, +{"WriteField2", (byte *)WriteField2}, +{"WriteField1", (byte *)WriteField1}, +{"FindMmoveByName", (byte *)FindMmoveByName}, +{"GetMmoveByAddress", (byte *)GetMmoveByAddress}, +{"FindFunctionByName", (byte *)FindFunctionByName}, +{"GetFunctionByAddress", (byte *)GetFunctionByAddress}, +{"InitGame", (byte *)InitGame}, +{"SP_func_reflect", (byte *)SP_func_reflect}, +{"use_func_reflect", (byte *)use_func_reflect}, +{"AddReflection", (byte *)AddReflection}, +{"DeleteReflection", (byte *)DeleteReflection}, +{"ReflectSparks", (byte *)ReflectSparks}, +{"ReflectSteam", (byte *)ReflectSteam}, +{"ReflectTrail", (byte *)ReflectTrail}, +{"ReflectExplosion", (byte *)ReflectExplosion}, +{"G_RunEntity", (byte *)G_RunEntity}, +{"SV_Physics_Conveyor", (byte *)SV_Physics_Conveyor}, +{"SV_Physics_Debris", (byte *)SV_Physics_Debris}, +{"SV_DebrisEntity", (byte *)SV_DebrisEntity}, +{"SV_Physics_Vehicle", (byte *)SV_Physics_Vehicle}, +{"SV_VehicleMove", (byte *)SV_VehicleMove}, +{"SV_Physics_Step", (byte *)SV_Physics_Step}, +{"RiderMass", (byte *)RiderMass}, +{"SV_AddRotationalFriction", (byte *)SV_AddRotationalFriction}, +{"SV_Physics_Toss", (byte *)SV_Physics_Toss}, +{"SV_Physics_Noclip", (byte *)SV_Physics_Noclip}, +{"SV_Physics_None", (byte *)SV_Physics_None}, +{"SV_Physics_Pusher", (byte *)SV_Physics_Pusher}, +{"SV_Push", (byte *)SV_Push}, +{"RealBoundingBox", (byte *)RealBoundingBox}, +{"MoveRiders", (byte *)MoveRiders}, +{"SV_PushEntity", (byte *)SV_PushEntity}, +{"SV_AddGravity", (byte *)SV_AddGravity}, +{"SV_PushableMove", (byte *)SV_PushableMove}, +{"SV_FlyMove", (byte *)SV_FlyMove}, +{"ClipVelocity", (byte *)ClipVelocity}, +{"SV_Impact", (byte *)SV_Impact}, +{"SV_RunThink", (byte *)SV_RunThink}, +{"SV_CheckVelocity", (byte *)SV_CheckVelocity}, +{"SV_TestEntityPosition", (byte *)SV_TestEntityPosition}, +{"other_FallingDamage", (byte *)other_FallingDamage}, +{"SP_func_pendulum", (byte *)SP_func_pendulum}, +{"pendulum_die", (byte *)pendulum_die}, +{"pendulum_use", (byte *)pendulum_use}, +{"pendulum_rotate", (byte *)pendulum_rotate}, +{"pendulum_blocked", (byte *)pendulum_blocked}, +{"PatchPlayerModels", (byte *)PatchPlayerModels}, +{"monster_jump_finished", (byte *)monster_jump_finished}, +{"monster_jump_start", (byte *)monster_jump_start}, +{"CountPlayers", (byte *)CountPlayers}, +{"PickCoopTarget", (byte *)PickCoopTarget}, +{"has_valid_enemy", (byte *)has_valid_enemy}, +{"drawbbox", (byte *)drawbbox}, +{"below", (byte *)below}, +{"PredictAim", (byte *)PredictAim}, +{"CheckForBadArea", (byte *)CheckForBadArea}, +{"SpawnBadArea", (byte *)SpawnBadArea}, +{"badarea_touch", (byte *)badarea_touch}, +{"face_wall", (byte *)face_wall}, +{"realrange", (byte *)realrange}, +{"inback", (byte *)inback}, +{"InitHintPaths", (byte *)InitHintPaths}, +{"SP_hint_path", (byte *)SP_hint_path}, +{"hint_path_touch", (byte *)hint_path_touch}, +{"monsterlost_checkhint", (byte *)monsterlost_checkhint}, +{"hintpath_stop", (byte *)hintpath_stop}, +{"hintpath_go", (byte *)hintpath_go}, +{"hintpath_other_end", (byte *)hintpath_other_end}, +{"hintpath_findstart", (byte *)hintpath_findstart}, +{"blocked_checknewenemy", (byte *)blocked_checknewenemy}, +{"blocked_checkjump", (byte *)blocked_checkjump}, +{"blocked_checkplat", (byte *)blocked_checkplat}, +{"blocked_checkshot", (byte *)blocked_checkshot}, +{"SP_model_train", (byte *)SP_model_train}, +{"model_train_animator", (byte *)model_train_animator}, +{"HintTestStart", (byte *)HintTestStart}, +{"HintTestNext", (byte *)HintTestNext}, +{"PatchMonsterModel", (byte *)PatchMonsterModel}, +{"InitiallyDead", (byte *)InitiallyDead}, +{"stationarymonster_start", (byte *)stationarymonster_start}, +{"stationarymonster_start_go", (byte *)stationarymonster_start_go}, +{"stationarymonster_triggered_start", (byte *)stationarymonster_triggered_start}, +{"stationarymonster_triggered_spawn_use", (byte *)stationarymonster_triggered_spawn_use}, +{"stationarymonster_triggered_spawn", (byte *)stationarymonster_triggered_spawn}, +{"swimmonster_start", (byte *)swimmonster_start}, +{"swimmonster_start_go", (byte *)swimmonster_start_go}, +{"flymonster_start", (byte *)flymonster_start}, +{"flymonster_start_go", (byte *)flymonster_start_go}, +{"walkmonster_start", (byte *)walkmonster_start}, +{"walkmonster_start_go", (byte *)walkmonster_start_go}, +{"monster_start_go", (byte *)monster_start_go}, +{"monster_start", (byte *)monster_start}, +{"monster_death_use", (byte *)monster_death_use}, +{"monster_triggered_start", (byte *)monster_triggered_start}, +{"monster_triggered_spawn_use", (byte *)monster_triggered_spawn_use}, +{"monster_triggered_spawn", (byte *)monster_triggered_spawn}, +{"monster_use", (byte *)monster_use}, +{"monster_think", (byte *)monster_think}, +{"M_MoveFrame", (byte *)M_MoveFrame}, +{"M_SetEffects", (byte *)M_SetEffects}, +{"M_droptofloor", (byte *)M_droptofloor}, +{"M_WorldEffects", (byte *)M_WorldEffects}, +{"M_CatagorizePosition", (byte *)M_CatagorizePosition}, +{"M_CheckGround", (byte *)M_CheckGround}, +{"AttackFinished", (byte *)AttackFinished}, +{"M_FlyCheck", (byte *)M_FlyCheck}, +{"M_FliesOn", (byte *)M_FliesOn}, +{"M_FliesOff", (byte *)M_FliesOff}, +{"monster_fire_bfg", (byte *)monster_fire_bfg}, +{"monster_fire_railgun", (byte *)monster_fire_railgun}, +{"monster_fire_rocket", (byte *)monster_fire_rocket}, +{"monster_fire_grenade", (byte *)monster_fire_grenade}, +{"monster_fire_plasma", (byte *)monster_fire_plasma}, +{"monster_fire_blaster", (byte *)monster_fire_blaster}, +{"monster_fire_shotgun", (byte *)monster_fire_shotgun}, +{"monster_fire_bullet", (byte *)monster_fire_bullet}, +{"M_SetDeath", (byte *)M_SetDeath}, +{"FadeDieSink", (byte *)FadeDieSink}, +{"FadeSink", (byte *)FadeSink}, +{"SP_model_spawn", (byte *)SP_model_spawn}, +{"model_die", (byte *)model_die}, +{"model_spawn_use", (byte *)model_spawn_use}, +{"modelspawn_think", (byte *)modelspawn_think}, +{"PrecacheDebris", (byte *)PrecacheDebris}, +{"PatchDeadSoldier", (byte *)PatchDeadSoldier}, +{"SP_target_fountain", (byte *)SP_target_fountain}, +{"target_fountain_delayed_use", (byte *)target_fountain_delayed_use}, +{"target_fountain_use", (byte *)target_fountain_use}, +{"target_fountain_think", (byte *)target_fountain_think}, +{"SP_target_precipitation", (byte *)SP_target_precipitation}, +{"target_precipitation_delayed_use", (byte *)target_precipitation_delayed_use}, +{"target_precipitation_use", (byte *)target_precipitation_use}, +{"target_precipitation_think", (byte *)target_precipitation_think}, +{"spawn_precipitation", (byte *)spawn_precipitation}, +{"drop_touch", (byte *)drop_touch}, +{"leaf_fade", (byte *)leaf_fade}, +{"leaf_fade2", (byte *)leaf_fade2}, +{"fountain_animate", (byte *)fountain_animate}, +{"drop_splash", (byte *)drop_splash}, +{"drop_add_to_chain", (byte *)drop_add_to_chain}, +{"SP_misc_light", (byte *)SP_misc_light}, +{"misc_light_use", (byte *)misc_light_use}, +{"misc_light_think", (byte *)misc_light_think}, +{"SP_misc_teleporter_dest", (byte *)SP_misc_teleporter_dest}, +{"SP_trigger_teleporter", (byte *)SP_trigger_teleporter}, +{"trigger_teleporter_use", (byte *)trigger_teleporter_use}, +{"SP_misc_teleporter", (byte *)SP_misc_teleporter}, +{"use_teleporter", (byte *)use_teleporter}, +{"teleporter_touch", (byte *)teleporter_touch}, +{"teleport_transition_ents", (byte *)teleport_transition_ents}, +{"SP_func_clock_screen", (byte *)SP_func_clock_screen}, +{"func_clock_screen_use", (byte *)func_clock_screen_use}, +{"func_clock_screen_think", (byte *)func_clock_screen_think}, +{"SP_func_clock", (byte *)SP_func_clock}, +{"func_clock_use", (byte *)func_clock_use}, +{"func_clock_think", (byte *)func_clock_think}, +{"func_clock_format_countdown", (byte *)func_clock_format_countdown}, +{"func_clock_reset", (byte *)func_clock_reset}, +{"SP_target_string", (byte *)SP_target_string}, +{"target_string_use", (byte *)target_string_use}, +{"SP_target_character", (byte *)SP_target_character}, +{"SP_misc_gib_head", (byte *)SP_misc_gib_head}, +{"SP_misc_gib_leg", (byte *)SP_misc_gib_leg}, +{"SP_misc_gib_arm", (byte *)SP_misc_gib_arm}, +{"SP_light_mine2", (byte *)SP_light_mine2}, +{"SP_light_mine1", (byte *)SP_light_mine1}, +{"SP_misc_satellite_dish", (byte *)SP_misc_satellite_dish}, +{"misc_satellite_dish_use", (byte *)misc_satellite_dish_use}, +{"misc_satellite_dish_think", (byte *)misc_satellite_dish_think}, +{"SP_misc_strogg_ship", (byte *)SP_misc_strogg_ship}, +{"misc_strogg_ship_use", (byte *)misc_strogg_ship_use}, +{"SP_misc_viper_bomb", (byte *)SP_misc_viper_bomb}, +{"misc_viper_bomb_use", (byte *)misc_viper_bomb_use}, +{"viper_bomb_think", (byte *)viper_bomb_think}, +{"misc_viper_bomb_prethink", (byte *)misc_viper_bomb_prethink}, +{"misc_viper_bomb_touch", (byte *)misc_viper_bomb_touch}, +{"SP_misc_bigviper", (byte *)SP_misc_bigviper}, +{"SP_misc_viper", (byte *)SP_misc_viper}, +{"misc_viper_use", (byte *)misc_viper_use}, +{"viper_die", (byte *)viper_die}, +{"SP_misc_deadsoldier", (byte *)SP_misc_deadsoldier}, +{"misc_deadsoldier_flieson", (byte *)misc_deadsoldier_flieson}, +{"misc_deadsoldier_die", (byte *)misc_deadsoldier_die}, +{"SP_misc_banner", (byte *)SP_misc_banner}, +{"misc_banner_think", (byte *)misc_banner_think}, +{"SP_monster_commander_body", (byte *)SP_monster_commander_body}, +{"commander_body_drop", (byte *)commander_body_drop}, +{"commander_body_use", (byte *)commander_body_use}, +{"commander_body_think", (byte *)commander_body_think}, +{"SP_misc_easterchick2", (byte *)SP_misc_easterchick2}, +{"misc_easterchick2_think", (byte *)misc_easterchick2_think}, +{"SP_misc_easterchick", (byte *)SP_misc_easterchick}, +{"misc_easterchick_think", (byte *)misc_easterchick_think}, +{"SP_misc_eastertank", (byte *)SP_misc_eastertank}, +{"misc_eastertank_think", (byte *)misc_eastertank_think}, +{"SP_misc_blackhole", (byte *)SP_misc_blackhole}, +{"misc_blackhole_transparent", (byte *)misc_blackhole_transparent}, +{"misc_blackhole_think", (byte *)misc_blackhole_think}, +{"misc_blackhole_use", (byte *)misc_blackhole_use}, +{"SP_misc_explobox", (byte *)SP_misc_explobox}, +{"barrel_delay", (byte *)barrel_delay}, +{"barrel_explode", (byte *)barrel_explode}, +{"barrel_touch", (byte *)barrel_touch}, +{"SP_func_explosive", (byte *)SP_func_explosive}, +{"func_explosive_touch", (byte *)func_explosive_touch}, +{"func_explosive_spawn", (byte *)func_explosive_spawn}, +{"func_explosive_use", (byte *)func_explosive_use}, +{"func_explosive_die", (byte *)func_explosive_die}, +{"func_explosive_explode", (byte *)func_explosive_explode}, +{"func_explosive_respawn", (byte *)func_explosive_respawn}, +{"SP_func_object", (byte *)SP_func_object}, +{"func_object_use", (byte *)func_object_use}, +{"func_object_release", (byte *)func_object_release}, +{"func_object_touch", (byte *)func_object_touch}, +{"SP_func_wall", (byte *)SP_func_wall}, +{"func_wall_use", (byte *)func_wall_use}, +{"SP_light", (byte *)SP_light}, +{"light_use", (byte *)light_use}, +{"SP_info_notnull", (byte *)SP_info_notnull}, +{"SP_info_null", (byte *)SP_info_null}, +{"SP_viewthing", (byte *)SP_viewthing}, +{"TH_viewthing", (byte *)TH_viewthing}, +{"SP_point_combat", (byte *)SP_point_combat}, +{"point_combat_touch", (byte *)point_combat_touch}, +{"SP_path_corner", (byte *)SP_path_corner}, +{"path_corner_touch", (byte *)path_corner_touch}, +{"BecomeExplosion2", (byte *)BecomeExplosion2}, +{"BecomeExplosion1", (byte *)BecomeExplosion1}, +{"SP_debris", (byte *)SP_debris}, +{"debris_delayed_start", (byte *)debris_delayed_start}, +{"ThrowDebris", (byte *)ThrowDebris}, +{"debris_die", (byte *)debris_die}, +{"ThrowClientHead", (byte *)ThrowClientHead}, +{"SP_gibhead", (byte *)SP_gibhead}, +{"ThrowHead", (byte *)ThrowHead}, +{"SP_gib", (byte *)SP_gib}, +{"gib_delayed_start", (byte *)gib_delayed_start}, +{"ThrowGib", (byte *)ThrowGib}, +{"gib_die", (byte *)gib_die}, +{"gib_touch", (byte *)gib_touch}, +{"gib_think", (byte *)gib_think}, +{"ClipGibVelocity", (byte *)ClipGibVelocity}, +{"VelocityForDamage", (byte *)VelocityForDamage}, +{"SP_func_areaportal", (byte *)SP_func_areaportal}, +{"Use_Areaportal", (byte *)Use_Areaportal}, +{"FadeDieThink", (byte *)FadeDieThink}, +{"FadeThink", (byte *)FadeThink}, +{"G_RunFrame", (byte *)G_RunFrame}, +{"ExitLevel", (byte *)ExitLevel}, +{"CheckDMRules", (byte *)CheckDMRules}, +{"CheckNeedPass", (byte *)CheckNeedPass}, +{"EndDMLevel", (byte *)EndDMLevel}, +{"CreateTargetChangeLevel", (byte *)CreateTargetChangeLevel}, +{"ClientEndServerFrames", (byte *)ClientEndServerFrames}, +{"Com_Printf", (byte *)Com_Printf}, +{"Sys_Error", (byte *)Sys_Error}, +{"GetGameAPI", (byte *)GetGameAPI}, +{"Debug_Soundindex", (byte *)Debug_Soundindex}, +{"Debug_Modelindex", (byte *)Debug_Modelindex}, +{"ShutdownGame", (byte *)ShutdownGame}, +{"SP_target_lock_clue", (byte *)SP_target_lock_clue}, +{"lock_clue_initialize", (byte *)lock_clue_initialize}, +{"lock_clue_think", (byte *)lock_clue_think}, +{"lock_clue_use", (byte *)lock_clue_use}, +{"SP_target_lock_code", (byte *)SP_target_lock_code}, +{"lock_code_use", (byte *)lock_code_use}, +{"SP_target_lock", (byte *)SP_target_lock}, +{"lock_initialize", (byte *)lock_initialize}, +{"lock_digit_increment", (byte *)lock_digit_increment}, +{"target_lock_use", (byte *)target_lock_use}, +{"SP_target_lock_digit", (byte *)SP_target_lock_digit}, +{"SP_target_lightswitch", (byte *)SP_target_lightswitch}, +{"use_target_lightswitch", (byte *)use_target_lightswitch}, +{"target_lightswitch_toggle", (byte *)target_lightswitch_toggle}, +{"ToggleLights", (byte *)ToggleLights}, +{"Lights", (byte *)Lights}, +{"Jet_ApplyJet", (byte *)Jet_ApplyJet}, +{"Jet_ApplySparks", (byte *)Jet_ApplySparks}, +{"Jet_ApplyLifting", (byte *)Jet_ApplyLifting}, +{"Jet_BecomeExplosion", (byte *)Jet_BecomeExplosion}, +{"Jet_AvoidGround", (byte *)Jet_AvoidGround}, +{"Use_Stasis", (byte *)Use_Stasis}, +{"Use_Jet", (byte *)Use_Jet}, +{"Use_Flashlight", (byte *)Use_Flashlight}, +{"SetItemNames", (byte *)SetItemNames}, +{"InitItems", (byte *)InitItems}, +{"SP_item_health_mega", (byte *)SP_item_health_mega}, +{"SP_item_health_large", (byte *)SP_item_health_large}, +{"SP_item_health_small", (byte *)SP_item_health_small}, +{"SP_item_health", (byte *)SP_item_health}, +{"SpawnItem", (byte *)SpawnItem}, +{"PrecacheItem", (byte *)PrecacheItem}, +{"droptofloor", (byte *)droptofloor}, +{"Use_Item", (byte *)Use_Item}, +{"Drop_Item", (byte *)Drop_Item}, +{"drop_make_touchable", (byte *)drop_make_touchable}, +{"drop_temp_touch", (byte *)drop_temp_touch}, +{"Touch_Item", (byte *)Touch_Item}, +{"Drop_PowerArmor", (byte *)Drop_PowerArmor}, +{"Pickup_PowerArmor", (byte *)Pickup_PowerArmor}, +{"Use_PowerArmor", (byte *)Use_PowerArmor}, +{"PowerArmorType", (byte *)PowerArmorType}, +{"Pickup_Armor", (byte *)Pickup_Armor}, +{"ArmorIndex", (byte *)ArmorIndex}, +{"Pickup_Health", (byte *)Pickup_Health}, +{"MegaHealth_think", (byte *)MegaHealth_think}, +{"Drop_Ammo", (byte *)Drop_Ammo}, +{"Pickup_Ammo", (byte *)Pickup_Ammo}, +{"Add_Ammo", (byte *)Add_Ammo}, +{"Pickup_Key", (byte *)Pickup_Key}, +{"Use_Silencer", (byte *)Use_Silencer}, +{"Use_Invulnerability", (byte *)Use_Invulnerability}, +{"Use_Envirosuit", (byte *)Use_Envirosuit}, +{"Use_Breather", (byte *)Use_Breather}, +{"Use_Quad", (byte *)Use_Quad}, +{"Pickup_Pack", (byte *)Pickup_Pack}, +{"Pickup_Bandolier", (byte *)Pickup_Bandolier}, +{"Pickup_AncientHead", (byte *)Pickup_AncientHead}, +{"Pickup_Adrenaline", (byte *)Pickup_Adrenaline}, +{"Drop_Jetpack", (byte *)Drop_Jetpack}, +{"Drop_General", (byte *)Drop_General}, +{"Pickup_Powerup", (byte *)Pickup_Powerup}, +{"SetRespawn", (byte *)SetRespawn}, +{"DoRespawn", (byte *)DoRespawn}, +{"FindItem", (byte *)FindItem}, +{"FindItemByClassname", (byte *)FindItemByClassname}, +{"GetItemByIndex", (byte *)GetItemByIndex}, +{"item_die", (byte *)item_die}, +{"SP_func_air", (byte *)SP_func_air}, +{"func_air_on", (byte *)func_air_on}, +{"func_air_off", (byte *)func_air_off}, +{"func_air_touch", (byte *)func_air_touch}, +{"SP_func_door_swinging", (byte *)SP_func_door_swinging}, +{"func_door_swinging_init", (byte *)func_door_swinging_init}, +{"swinging_door_killed", (byte *)swinging_door_killed}, +{"SP_func_force_wall", (byte *)SP_func_force_wall}, +{"force_wall_use", (byte *)force_wall_use}, +{"func_force_wall_touch", (byte *)func_force_wall_touch}, +{"force_wall_think", (byte *)force_wall_think}, +{"SP_func_pivot", (byte *)SP_func_pivot}, +{"pivot_init", (byte *)pivot_init}, +{"pivot_touch", (byte *)pivot_touch}, +{"pivot_stop", (byte *)pivot_stop}, +{"pivot_blocked", (byte *)pivot_blocked}, +{"SP_func_bobbingwater", (byte *)SP_func_bobbingwater}, +{"bob_init", (byte *)bob_init}, +{"bob_think", (byte *)bob_think}, +{"SP_func_pushable", (byte *)SP_func_pushable}, +{"func_pushable_spawn", (byte *)func_pushable_spawn}, +{"box_touch", (byte *)box_touch}, +{"box_water_friction", (byte *)box_water_friction}, +{"box_walkmove", (byte *)box_walkmove}, +{"box_use", (byte *)box_use}, +{"box_die", (byte *)box_die}, +{"box_movestep", (byte *)box_movestep}, +{"SP_func_killbox", (byte *)SP_func_killbox}, +{"use_killbox", (byte *)use_killbox}, +{"SP_func_door_secret", (byte *)SP_func_door_secret}, +{"door_secret_die", (byte *)door_secret_die}, +{"door_secret_blocked", (byte *)door_secret_blocked}, +{"door_secret_done", (byte *)door_secret_done}, +{"door_secret_move6", (byte *)door_secret_move6}, +{"door_secret_move5", (byte *)door_secret_move5}, +{"door_secret_move4", (byte *)door_secret_move4}, +{"door_secret_move3", (byte *)door_secret_move3}, +{"door_secret_move2", (byte *)door_secret_move2}, +{"door_secret_move1", (byte *)door_secret_move1}, +{"door_secret_use", (byte *)door_secret_use}, +{"SP_func_conveyor", (byte *)SP_func_conveyor}, +{"func_conveyor_use", (byte *)func_conveyor_use}, +{"SP_func_timer", (byte *)SP_func_timer}, +{"func_timer_use", (byte *)func_timer_use}, +{"func_timer_think", (byte *)func_timer_think}, +{"SP_trigger_elevator", (byte *)SP_trigger_elevator}, +{"trigger_elevator_init", (byte *)trigger_elevator_init}, +{"trigger_elevator_use", (byte *)trigger_elevator_use}, +{"SP_func_train", (byte *)SP_func_train}, +{"train_use", (byte *)train_use}, +{"func_train_find", (byte *)func_train_find}, +{"train_resume", (byte *)train_resume}, +{"train_next", (byte *)train_next}, +{"train_yaw", (byte *)train_yaw}, +{"train_children_think", (byte *)train_children_think}, +{"train_wait", (byte *)train_wait}, +{"train_blocked", (byte *)train_blocked}, +{"train_die", (byte *)train_die}, +{"SP_func_water", (byte *)SP_func_water}, +{"SP_func_door_rot_dh", (byte *)SP_func_door_rot_dh}, +{"func_door_rot_dh_init", (byte *)func_door_rot_dh_init}, +{"SP_func_door_rotating", (byte *)SP_func_door_rotating}, +{"SP_func_door", (byte *)SP_func_door}, +{"Door_Speaker_Think", (byte *)Door_Speaker_Think}, +{"door_touch", (byte *)door_touch}, +{"door_killed", (byte *)door_killed}, +{"door_destroyed", (byte *)door_destroyed}, +{"door_blocked", (byte *)door_blocked}, +{"Think_SpawnDoorTrigger", (byte *)Think_SpawnDoorTrigger}, +{"Think_CalcMoveSpeed", (byte *)Think_CalcMoveSpeed}, +{"Touch_DoorTrigger", (byte *)Touch_DoorTrigger}, +{"door_use", (byte *)door_use}, +{"door_go_up", (byte *)door_go_up}, +{"door_go_down", (byte *)door_go_down}, +{"door_hit_bottom", (byte *)door_hit_bottom}, +{"door_hit_top", (byte *)door_hit_top}, +{"swinging_door_reset", (byte *)swinging_door_reset}, +{"door_use_areaportals", (byte *)door_use_areaportals}, +{"SP_func_trainbutton", (byte *)SP_func_trainbutton}, +{"movewith_init", (byte *)movewith_init}, +{"trainbutton_killed", (byte *)trainbutton_killed}, +{"trainbutton_touch", (byte *)trainbutton_touch}, +{"trainbutton_use", (byte *)trainbutton_use}, +{"trainbutton_fire", (byte *)trainbutton_fire}, +{"trainbutton_wait", (byte *)trainbutton_wait}, +{"trainbutton_return", (byte *)trainbutton_return}, +{"trainbutton_done", (byte *)trainbutton_done}, +{"SP_func_button", (byte *)SP_func_button}, +{"button_killed", (byte *)button_killed}, +{"button_touch", (byte *)button_touch}, +{"button_use", (byte *)button_use}, +{"button_fire", (byte *)button_fire}, +{"button_wait", (byte *)button_wait}, +{"button_return", (byte *)button_return}, +{"button_done", (byte *)button_done}, +{"SP_func_rotating_dh", (byte *)SP_func_rotating_dh}, +{"func_rotating_dh_init", (byte *)func_rotating_dh_init}, +{"SP_func_rotating", (byte *)SP_func_rotating}, +{"rotating_use", (byte *)rotating_use}, +{"rotating_touch", (byte *)rotating_touch}, +{"rotating_blocked", (byte *)rotating_blocked}, +{"rotating_decel", (byte *)rotating_decel}, +{"rotating_accel", (byte *)rotating_accel}, +{"SP_func_plat", (byte *)SP_func_plat}, +{"plat_spawn_inside_trigger", (byte *)plat_spawn_inside_trigger}, +{"Touch_Plat_Center", (byte *)Touch_Plat_Center}, +{"Use_Plat", (byte *)Use_Plat}, +{"plat_blocked", (byte *)plat_blocked}, +{"plat_go_up", (byte *)plat_go_up}, +{"plat_go_down", (byte *)plat_go_down}, +{"plat_hit_bottom", (byte *)plat_hit_bottom}, +{"plat_hit_top", (byte *)plat_hit_top}, +{"Think_AccelMove", (byte *)Think_AccelMove}, +{"plat_Accelerate", (byte *)plat_Accelerate}, +{"plat_CalcAcceleratedMove", (byte *)plat_CalcAcceleratedMove}, +{"AngleMove_Calc", (byte *)AngleMove_Calc}, +{"AngleMove_Begin", (byte *)AngleMove_Begin}, +{"AngleMove_Final", (byte *)AngleMove_Final}, +{"AngleMove_Done", (byte *)AngleMove_Done}, +{"Move_Calc", (byte *)Move_Calc}, +{"Move_Begin", (byte *)Move_Begin}, +{"Move_Final", (byte *)Move_Final}, +{"Move_Done", (byte *)Move_Done}, +{"check_reverse_rotation", (byte *)check_reverse_rotation}, +{"train_spline", (byte *)train_spline}, +{"spline_calc", (byte *)spline_calc}, +{"movewith_update", (byte *)movewith_update}, +{"set_child_movement", (byte *)set_child_movement}, +{"Cmd_Fog_f", (byte *)Cmd_Fog_f}, +{"SP_target_fog", (byte *)SP_target_fog}, +{"SP_trigger_fog", (byte *)SP_trigger_fog}, +{"Fog_Off", (byte *)Fog_Off}, +{"Fog", (byte *)Fog}, +{"Fog_Init", (byte *)Fog_Init}, +{"SP_crane_reset", (byte *)SP_crane_reset}, +{"crane_reset_use", (byte *)crane_reset_use}, +{"crane_reset_go", (byte *)crane_reset_go}, +{"SP_crane_beam", (byte *)SP_crane_beam}, +{"SP_crane_hoist", (byte *)SP_crane_hoist}, +{"SP_crane_hook", (byte *)SP_crane_hook}, +{"SP_crane_control", (byte *)SP_crane_control}, +{"Use_Crane_Control", (byte *)Use_Crane_Control}, +{"crane_control_action", (byte *)crane_control_action}, +{"Crane_AdjustSpeed", (byte *)Crane_AdjustSpeed}, +{"G_FindCraneParts", (byte *)G_FindCraneParts}, +{"Crane_Move_Begin", (byte *)Crane_Move_Begin}, +{"Crane_Move_Final", (byte *)Crane_Move_Final}, +{"Crane_blocked", (byte *)Crane_blocked}, +{"Crane_Hook_Bonk", (byte *)Crane_Hook_Bonk}, +{"Crane_Stop", (byte *)Crane_Stop}, +{"Crane_Move_Done", (byte *)Crane_Move_Done}, +{"crane_light_off", (byte *)crane_light_off}, +{"Cable_Think", (byte *)Cable_Think}, +{"SetSpotlightLength", (byte *)SetSpotlightLength}, +{"SetCableLength", (byte *)SetCableLength}, +{"Cargo_Float_Up", (byte *)Cargo_Float_Up}, +{"cargo_blocked", (byte *)cargo_blocked}, +{"Cargo_Stop", (byte *)Cargo_Stop}, +{"CrateOnTop", (byte *)CrateOnTop}, +{"Moving_Speaker_Think", (byte *)Moving_Speaker_Think}, +{"T_RadiusDamage", (byte *)T_RadiusDamage}, +{"T_Damage", (byte *)T_Damage}, +{"CheckTeamDamage", (byte *)CheckTeamDamage}, +{"M_ReactToDamage", (byte *)M_ReactToDamage}, +{"CallMyFriends", (byte *)CallMyFriends}, +{"DefendMyFriend", (byte *)DefendMyFriend}, +{"BloodType", (byte *)BloodType}, +{"SpawnDamage", (byte *)SpawnDamage}, +{"Killed", (byte *)Killed}, +{"CanDamage", (byte *)CanDamage}, +{"cleanupHealTarget", (byte *)cleanupHealTarget}, +{"ClientCommand", (byte *)ClientCommand}, +{"Restart_FMOD", (byte *)Restart_FMOD}, +{"ForcewallOff", (byte *)ForcewallOff}, +{"SpawnForcewall", (byte *)SpawnForcewall}, +{"forcewall_think", (byte *)forcewall_think}, +{"decoy_think", (byte *)decoy_think}, +{"decoy_die", (byte *)decoy_die}, +{"Cmd_attack2_f", (byte *)Cmd_attack2_f}, +{"SetSensitivities", (byte *)SetSensitivities}, +{"SetLazarusCrosshair", (byte *)SetLazarusCrosshair}, +{"Cmd_Bbox_f", (byte *)Cmd_Bbox_f}, +{"DrawBBox", (byte *)DrawBBox}, +{"Cmd_PlayerList_f", (byte *)Cmd_PlayerList_f}, +{"Cmd_Say_f", (byte *)Cmd_Say_f}, +{"Cmd_Wave_f", (byte *)Cmd_Wave_f}, +{"Cmd_Players_f", (byte *)Cmd_Players_f}, +{"PlayerSort", (byte *)PlayerSort}, +{"Cmd_PutAway_f", (byte *)Cmd_PutAway_f}, +{"Cmd_Kill_f", (byte *)Cmd_Kill_f}, +{"Cmd_InvDrop_f", (byte *)Cmd_InvDrop_f}, +{"Cmd_WeapLast_f", (byte *)Cmd_WeapLast_f}, +{"Cmd_WeapNext_f", (byte *)Cmd_WeapNext_f}, +{"Cmd_WeapPrev_f", (byte *)Cmd_WeapPrev_f}, +{"Cmd_InvUse_f", (byte *)Cmd_InvUse_f}, +{"Cmd_Inven_f", (byte *)Cmd_Inven_f}, +{"Cmd_Drop_f", (byte *)Cmd_Drop_f}, +{"Cmd_Use_f", (byte *)Cmd_Use_f}, +{"Cmd_Noclip_f", (byte *)Cmd_Noclip_f}, +{"Cmd_Notarget_f", (byte *)Cmd_Notarget_f}, +{"Cmd_God_f", (byte *)Cmd_God_f}, +{"Cmd_Give_f", (byte *)Cmd_Give_f}, +{"ValidateSelectedItem", (byte *)ValidateSelectedItem}, +{"SelectPrevItem", (byte *)SelectPrevItem}, +{"SelectNextItem", (byte *)SelectNextItem}, +{"OnSameTeam", (byte *)OnSameTeam}, +{"ClientTeam", (byte *)ClientTeam}, +{"ShiftItem", (byte *)ShiftItem}, +{"SaveEntProps", (byte *)SaveEntProps}, +{"laser_sight_think", (byte *)laser_sight_think}, +{"RotateAngles", (byte *)RotateAngles}, +{"Q_strlwr", (byte *)Q_strlwr}, +{"GetChaseTarget", (byte *)GetChaseTarget}, +{"ChasePrev", (byte *)ChasePrev}, +{"ChaseNext", (byte *)ChaseNext}, +{"UpdateChaseCam", (byte *)UpdateChaseCam}, +{"SP_func_monitor", (byte *)SP_func_monitor}, +{"func_monitor_init", (byte *)func_monitor_init}, +{"use_camera", (byte *)use_camera}, +{"G_FindPrevCamera", (byte *)G_FindPrevCamera}, +{"G_FindNextCamera", (byte *)G_FindNextCamera}, +{"camera_on", (byte *)camera_on}, +{"faker_animate", (byte *)faker_animate}, +{"camera_off", (byte *)camera_off}, +{"ai_chicken", (byte *)ai_chicken}, +{"ai_run", (byte *)ai_run}, +{"ai_checkattack", (byte *)ai_checkattack}, +{"ai_run_slide", (byte *)ai_run_slide}, +{"ai_run_missile", (byte *)ai_run_missile}, +{"ai_run_melee", (byte *)ai_run_melee}, +{"M_CheckAttack", (byte *)M_CheckAttack}, +{"FacingIdeal", (byte *)FacingIdeal}, +{"FindTarget", (byte *)FindTarget}, +{"FoundTarget", (byte *)FoundTarget}, +{"HuntTarget", (byte *)HuntTarget}, +{"canReach", (byte *)canReach}, +{"infront", (byte *)infront}, +{"visible", (byte *)visible}, +{"range", (byte *)range}, +{"ai_turn", (byte *)ai_turn}, +{"ai_charge", (byte *)ai_charge}, +{"ai_walk", (byte *)ai_walk}, +{"ai_stand", (byte *)ai_stand}, +{"ai_strafe", (byte *)ai_strafe}, +{"ai_move", (byte *)ai_move}, +{"AI_SetSightClient", (byte *)AI_SetSightClient}, +{0, 0} diff --git a/src/g_items.c b/src/g_items.c index d4c0b89..529d292 100644 --- a/src/g_items.c +++ b/src/g_items.c @@ -24,9 +24,9 @@ gitem_armor_t combatarmor_info = { 50, 100, .60, .30, ARMOR_COMBAT}; gitem_armor_t bodyarmor_info = {100, 200, .80, .60, ARMOR_BODY}; int noweapon_index; -static int jacket_armor_index; -static int combat_armor_index; -static int body_armor_index; +int jacket_armor_index; +int combat_armor_index; +int body_armor_index; static int power_screen_index; static int power_shield_index; int shells_index; @@ -935,7 +935,7 @@ void Touch_Item (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf //====================================================================== -static void drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) +/*static*/ void drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) { if (other == ent->owner) return; @@ -943,7 +943,7 @@ static void drop_temp_touch (edict_t *ent, edict_t *other, cplane_t *plane, csur Touch_Item (ent, other, plane, surf); } -static void drop_make_touchable (edict_t *ent) +/*static*/ void drop_make_touchable (edict_t *ent) { ent->touch = Touch_Item; if (deathmatch->value) diff --git a/src/g_local.h b/src/g_local.h index 6c7f086..0c7fc3c 100644 --- a/src/g_local.h +++ b/src/g_local.h @@ -17,6 +17,13 @@ #define PI 3.14159265359 +#define max(X,Y) (X > Y ? X : Y) +#define min(X,Y) (X < Y ? X : Y) + +#ifndef _WIN32 + #define DISABLE_FMOD +#endif + // protocol bytes that can be directly added to messages #define svc_muzzleflash 1 #define svc_muzzleflash2 2 diff --git a/src/g_misc.c b/src/g_misc.c index cc9e9bc..1b662ea 100644 --- a/src/g_misc.c +++ b/src/g_misc.c @@ -766,7 +766,7 @@ Default _cone value is 10 (used to set size of light for spotlights) #define START_OFF 1 -static void light_use (edict_t *self, edict_t *other, edict_t *activator) +/*static*/ void light_use (edict_t *self, edict_t *other, edict_t *activator) { if (self->spawnflags & START_OFF) { @@ -2265,7 +2265,7 @@ If START_OFF, this entity must be used before it starts // don't let field width of any clock messages change, or it // could cause an overwrite after a game load -static void func_clock_reset (edict_t *self) +/*static*/ void func_clock_reset (edict_t *self) { self->activator = NULL; if (self->spawnflags & 1) @@ -2280,7 +2280,7 @@ static void func_clock_reset (edict_t *self) } } -static void func_clock_format_countdown (edict_t *self) +/*static*/ void func_clock_format_countdown (edict_t *self) { if (self->style == 0) { @@ -2445,7 +2445,7 @@ void func_clock_screen_think(edict_t *self) self->nextthink = level.time + 1; return; } - else if (Q_stricmp(self->activator->classname, "player")) //map not yet finished loading + else if (!self->activator->classname || Q_stricmp(self->activator->classname, "player")) //map not yet finished loading { self->nextthink = level.time + 1; return; @@ -3754,11 +3754,13 @@ MISC_DEADSOLDIER MODEL PATCH #define MAX_SKINNAME 64 #define DEADSOLDIER_MODEL "models/deadbods/dude/tris.md2" -#include +//#include #include "pak.h" int PatchDeadSoldier () { + return 1; + cvar_t *gamedir; char skins[NUM_SKINS][MAX_SKINNAME]; // skin entries char infilename[MAX_OSPATH]; diff --git a/src/g_mmove_decs.h b/src/g_mmove_decs.h new file mode 100644 index 0000000..22b1423 --- /dev/null +++ b/src/g_mmove_decs.h @@ -0,0 +1,319 @@ +extern mmove_t tank_move_death ; +extern mmove_t tank_move_attack_chain ; +extern mmove_t tank_move_attack_post_rocket ; +extern mmove_t tank_move_attack_fire_rocket ; +extern mmove_t tank_move_attack_pre_rocket ; +extern mmove_t tank_move_attack_strike ; +extern mmove_t tank_move_attack_post_blast ; +extern mmove_t tank_move_reattack_blast ; +extern mmove_t tank_move_attack_blast ; +extern mmove_t tank_move_pain3 ; +extern mmove_t tank_move_pain2 ; +extern mmove_t tank_move_pain1 ; +extern mmove_t tank_move_stop_run ; +extern mmove_t tank_move_run ; +extern mmove_t tank_move_start_run ; +extern mmove_t tank_move_stop_walk ; +extern mmove_t tank_move_walk ; +extern mmove_t tank_move_start_walk ; +extern mmove_t tank_move_stand ; +extern mmove_t supertank_move_end_attack1 ; +extern mmove_t supertank_move_attack1 ; +extern mmove_t supertank_move_attack2 ; +extern mmove_t supertank_move_attack3 ; +extern mmove_t supertank_move_attack4 ; +extern mmove_t supertank_move_backward ; +extern mmove_t supertank_move_death ; +extern mmove_t supertank_move_pain1 ; +extern mmove_t supertank_move_pain2 ; +extern mmove_t supertank_move_pain3 ; +extern mmove_t supertank_move_turn_left ; +extern mmove_t supertank_move_turn_right ; +extern mmove_t supertank_move_forward ; +extern mmove_t supertank_move_run ; +extern mmove_t supertank_move_stand ; +extern mmove_t soldier_move_jump ; +extern mmove_t soldier_move_death6 ; +extern mmove_t soldier_move_death5 ; +extern mmove_t soldier_move_death4 ; +extern mmove_t soldier_move_death3 ; +extern mmove_t soldier_move_death2 ; +extern mmove_t soldier_move_death1 ; +extern mmove_t soldier_move_duck ; +extern mmove_t soldier_move_attack6 ; +extern mmove_t soldier_move_attack4 ; +extern mmove_t soldier_move_attack3 ; +extern mmove_t soldier_move_attack2 ; +extern mmove_t soldier_move_attack1 ; +extern mmove_t soldier_move_pain4 ; +extern mmove_t soldier_move_pain3 ; +extern mmove_t soldier_move_pain2 ; +extern mmove_t soldier_move_pain1 ; +extern mmove_t soldier_move_run ; +extern mmove_t soldier_move_start_run ; +extern mmove_t soldier_move_walk2 ; +extern mmove_t soldier_move_walk1 ; +extern mmove_t soldier_move_stand3 ; +extern mmove_t soldier_move_stand1 ; +extern mmove_t sentrybot_move_attack ; +extern mmove_t sentrybot_move_pain2 ; +extern mmove_t sentrybot_move_pain1 ; +extern mmove_t sentrybot_move_jump ; +extern mmove_t sentrybot_move_run ; +extern mmove_t sentrybot_move_walk ; +extern mmove_t sentrybot_move_stand ; +extern mmove_t parasite_move_jump ; +extern mmove_t parasite_move_death ; +extern mmove_t parasite_move_break ; +extern mmove_t parasite_move_drain ; +extern mmove_t parasite_move_pain1 ; +extern mmove_t parasite_move_stop_walk ; +extern mmove_t parasite_move_start_walk ; +extern mmove_t parasite_move_walk ; +extern mmove_t parasite_move_stop_run ; +extern mmove_t parasite_move_start_run ; +extern mmove_t parasite_move_run ; +extern mmove_t parasite_move_stand ; +extern mmove_t parasite_move_end_fidget ; +extern mmove_t parasite_move_fidget ; +extern mmove_t parasite_move_start_fidget ; +extern mmove_t mutant_move_fake_jump ; +extern mmove_t mutant_move_death2 ; +extern mmove_t mutant_move_death1 ; +extern mmove_t mutant_move_pain3 ; +extern mmove_t mutant_move_pain2 ; +extern mmove_t mutant_move_pain1 ; +extern mmove_t mutant_move_jump ; +extern mmove_t mutant_move_attack ; +extern mmove_t mutant_move_run ; +extern mmove_t mutant_move_start_walk ; +extern mmove_t mutant_move_walk ; +extern mmove_t mutant_move_idle ; +extern mmove_t mutant_move_stand ; +extern mmove_t medic_move_attackCable ; +extern mmove_t medic_move_attackBlaster ; +extern mmove_t medic_move_attackHyperBlaster ; +extern mmove_t medic_move_duck ; +extern mmove_t medic_move_death ; +extern mmove_t medic_move_pain2 ; +extern mmove_t medic_move_pain1 ; +extern mmove_t medic_move_run ; +extern mmove_t medic_move_walk ; +extern mmove_t medic_move_stand ; +extern mmove_t insane_move_struggle_cross ; +extern mmove_t insane_move_cross ; +extern mmove_t insane_move_crawl_death ; +extern mmove_t insane_move_crawl_pain ; +extern mmove_t insane_move_runcrawl ; +extern mmove_t insane_move_crawl ; +extern mmove_t insane_move_stand_death ; +extern mmove_t insane_move_stand_pain ; +extern mmove_t insane_move_run_insane ; +extern mmove_t insane_move_walk_insane ; +extern mmove_t insane_move_run_normal ; +extern mmove_t insane_move_walk_normal ; +extern mmove_t insane_move_down ; +extern mmove_t insane_move_jumpdown ; +extern mmove_t insane_move_downtoup ; +extern mmove_t insane_move_uptodown ; +extern mmove_t insane_move_stand_insane ; +extern mmove_t insane_move_stand_normal ; +extern mmove_t infantry_move_jump ; +extern mmove_t infantry_move_attack2 ; +extern mmove_t infantry_move_attack1 ; +extern mmove_t infantry_move_roll ; +extern mmove_t infantry_move_duck ; +extern mmove_t infantry_move_death4 ; +extern mmove_t infantry_move_death3 ; +extern mmove_t infantry_move_death2 ; +extern mmove_t infantry_move_death1 ; +extern mmove_t infantry_move_pain2 ; +extern mmove_t infantry_move_pain1 ; +extern mmove_t infantry_move_run ; +extern mmove_t infantry_move_walk ; +extern mmove_t infantry_move_fidget ; +extern mmove_t infantry_move_stand ; +extern mmove_t hover_move_end_attack ; +extern mmove_t hover_move_attack2 ; +extern mmove_t hover_move_attack1 ; +extern mmove_t hover_move_start_attack ; +extern mmove_t hover_move_backward ; +extern mmove_t hover_move_death1 ; +extern mmove_t hover_move_run ; +extern mmove_t hover_move_walk ; +extern mmove_t hover_move_forward ; +extern mmove_t hover_move_land ; +extern mmove_t hover_move_pain1 ; +extern mmove_t hover_move_pain2 ; +extern mmove_t hover_move_pain3 ; +extern mmove_t hover_move_takeoff ; +extern mmove_t hover_move_stop2 ; +extern mmove_t hover_move_stop1 ; +extern mmove_t hover_move_stand ; +extern mmove_t gunner_move_jump ; +extern mmove_t gunner_move_attack_grenade ; +extern mmove_t gunner_move_endfire_chain ; +extern mmove_t gunner_move_fire_chain ; +extern mmove_t gunner_move_attack_chain ; +extern mmove_t gunner_move_duck ; +extern mmove_t gunner_move_death ; +extern mmove_t gunner_move_pain1 ; +extern mmove_t gunner_move_pain2 ; +extern mmove_t gunner_move_pain3 ; +extern mmove_t gunner_move_runandshoot ; +extern mmove_t gunner_move_run ; +extern mmove_t gunner_move_walk ; +extern mmove_t gunner_move_stand ; +extern mmove_t gunner_move_fidget ; +extern mmove_t gladiator_move_death ; +extern mmove_t gladiator_move_pain_air ; +extern mmove_t gladiator_move_pain ; +extern mmove_t gladiator_move_attack_gun ; +extern mmove_t gladiator_move_attack_melee ; +extern mmove_t gladiator_move_run ; +extern mmove_t gladiator_move_walk ; +extern mmove_t gladiator_move_stand ; +extern mmove_t flyer_move_loop_melee ; +extern mmove_t flyer_move_end_melee ; +extern mmove_t flyer_move_start_melee ; +extern mmove_t flyer_move_attack2 ; +extern mmove_t flyer_move_bankleft ; +extern mmove_t flyer_move_bankright ; +extern mmove_t flyer_move_defense ; +extern mmove_t flyer_move_pain1 ; +extern mmove_t flyer_move_pain2 ; +extern mmove_t flyer_move_pain3 ; +extern mmove_t flyer_move_rollleft ; +extern mmove_t flyer_move_rollright ; +extern mmove_t flyer_move_stop ; +extern mmove_t flyer_move_start ; +extern mmove_t flyer_move_run ; +extern mmove_t flyer_move_walk ; +extern mmove_t flyer_move_stand ; +extern mmove_t floater_move_run ; +extern mmove_t floater_move_walk ; +extern mmove_t floater_move_pain3 ; +extern mmove_t floater_move_pain2 ; +extern mmove_t floater_move_pain1 ; +extern mmove_t floater_move_death ; +extern mmove_t floater_move_attack3 ; +extern mmove_t floater_move_attack2 ; +extern mmove_t floater_move_attack1 ; +extern mmove_t floater_move_activate ; +extern mmove_t floater_move_stand2 ; +extern mmove_t floater_move_stand1 ; +extern mmove_t flipper_move_death ; +extern mmove_t flipper_move_attack ; +extern mmove_t flipper_move_pain1 ; +extern mmove_t flipper_move_pain2 ; +extern mmove_t flipper_move_start_run ; +extern mmove_t flipper_move_walk ; +extern mmove_t flipper_move_run_start ; +extern mmove_t flipper_move_run_loop ; +extern mmove_t flipper_move_stand ; +extern mmove_t chick_move_start_slash ; +extern mmove_t chick_move_end_slash ; +extern mmove_t chick_move_slash ; +extern mmove_t chick_move_end_attack1 ; +extern mmove_t chick_move_attack1 ; +extern mmove_t chick_move_start_attack1 ; +extern mmove_t chick_move_backflip ; +extern mmove_t chick_move_duck ; +extern mmove_t chick_move_death1 ; +extern mmove_t chick_move_death2 ; +extern mmove_t chick_move_pain3 ; +extern mmove_t chick_move_pain2 ; +extern mmove_t chick_move_pain1 ; +extern mmove_t chick_move_walk ; +extern mmove_t chick_move_run ; +extern mmove_t chick_move_start_run ; +extern mmove_t chick_move_stand ; +extern mmove_t chick_move_fidget ; +extern mmove_t brain_move_preattack_drain ; +extern mmove_t brain_move_attack_drain ; +extern mmove_t brain_move_attack_plasma ; +extern mmove_t brain_move_run ; +extern mmove_t brain_move_attack3 ; +extern mmove_t brain_move_attack2 ; +extern mmove_t brain_move_attack1 ; +extern mmove_t brain_move_death1 ; +extern mmove_t brain_move_death2 ; +extern mmove_t brain_move_duck ; +extern mmove_t brain_move_pain1 ; +extern mmove_t brain_move_pain2 ; +extern mmove_t brain_move_pain3 ; +extern mmove_t brain_move_defense ; +extern mmove_t brain_move_walk2 ; +extern mmove_t brain_move_walk1 ; +extern mmove_t brain_move_idle ; +extern mmove_t brain_move_stand ; +extern mmove_t makron_move_attack5 ; +extern mmove_t makron_move_attack4 ; +extern mmove_t makron_move_attack3 ; +extern mmove_t makron_move_sight ; +extern mmove_t makron_move_death3 ; +extern mmove_t makron_move_death2 ; +extern mmove_t makron_move_pain4 ; +extern mmove_t makron_move_pain5 ; +extern mmove_t makron_move_pain6 ; +extern mmove_t makron_move_walk ; +extern mmove_t makron_move_run ; +extern mmove_t makron_move_stand ; +extern mmove_t jorg_move_end_attack1 ; +extern mmove_t jorg_move_attack1 ; +extern mmove_t jorg_move_start_attack1 ; +extern mmove_t jorg_move_attack2 ; +extern mmove_t jorg_move_death ; +extern mmove_t jorg_move_pain1 ; +extern mmove_t jorg_move_pain2 ; +extern mmove_t jorg_move_pain3 ; +extern mmove_t jorg_move_end_walk ; +extern mmove_t jorg_move_walk ; +extern mmove_t jorg_move_start_walk ; +extern mmove_t jorg_move_run ; +extern mmove_t jorg_move_stand ; +extern mmove_t boss2_move_death ; +extern mmove_t boss2_move_pain_light ; +extern mmove_t boss2_move_pain_heavy ; +extern mmove_t boss2_move_attack_rocket ; +extern mmove_t boss2_move_attack_post_mg ; +extern mmove_t boss2_move_attack_mg ; +extern mmove_t boss2_move_attack_pre_mg ; +extern mmove_t boss2_move_run ; +extern mmove_t boss2_move_walk ; +extern mmove_t boss2_move_fidget ; +extern mmove_t boss2_move_stand ; +extern mmove_t berserk_move_jump ; +extern mmove_t berserk_move_death2 ; +extern mmove_t berserk_move_death1 ; +extern mmove_t berserk_move_pain2 ; +extern mmove_t berserk_move_pain1 ; +extern mmove_t berserk_move_attack_strike ; +extern mmove_t berserk_move_attack_club ; +extern mmove_t berserk_move_attack_spike ; +extern mmove_t berserk_move_run1 ; +extern mmove_t berserk_move_walk ; +extern mmove_t berserk_move_stand_fidget ; +extern mmove_t berserk_move_stand ; +extern mmove_t actor_move_salute ; +extern mmove_t actor_move_jump ; +extern mmove_t actor_move_crattack ; +extern mmove_t actor_move_attack ; +extern mmove_t actor_move_death2 ; +extern mmove_t actor_move_death1 ; +extern mmove_t actor_move_switch ; +extern mmove_t actor_move_taunt ; +extern mmove_t actor_move_flipoff ; +extern mmove_t actor_move_pain3 ; +extern mmove_t actor_move_pain2 ; +extern mmove_t actor_move_pain1 ; +extern mmove_t mmove_reloc ; +extern mmove_t actor_move_walk_back ; +extern mmove_t actor_move_walk ; +extern mmove_t actor_move_stand ; +extern mmove_t actor_move_run_bad ; +extern mmove_t actor_move_run_back ; +extern mmove_t actor_move_run ; +extern mmove_t actor_move_crouchwalk_back ; +extern mmove_t actor_move_crouchwalk ; +extern mmove_t actor_move_crouch ; diff --git a/src/g_mmove_list.h b/src/g_mmove_list.h new file mode 100644 index 0000000..ff9fe0f --- /dev/null +++ b/src/g_mmove_list.h @@ -0,0 +1,320 @@ +{"tank_move_death", &tank_move_death}, +{"tank_move_attack_chain", &tank_move_attack_chain}, +{"tank_move_attack_post_rocket", &tank_move_attack_post_rocket}, +{"tank_move_attack_fire_rocket", &tank_move_attack_fire_rocket}, +{"tank_move_attack_pre_rocket", &tank_move_attack_pre_rocket}, +{"tank_move_attack_strike", &tank_move_attack_strike}, +{"tank_move_attack_post_blast", &tank_move_attack_post_blast}, +{"tank_move_reattack_blast", &tank_move_reattack_blast}, +{"tank_move_attack_blast", &tank_move_attack_blast}, +{"tank_move_pain3", &tank_move_pain3}, +{"tank_move_pain2", &tank_move_pain2}, +{"tank_move_pain1", &tank_move_pain1}, +{"tank_move_stop_run", &tank_move_stop_run}, +{"tank_move_run", &tank_move_run}, +{"tank_move_start_run", &tank_move_start_run}, +{"tank_move_stop_walk", &tank_move_stop_walk}, +{"tank_move_walk", &tank_move_walk}, +{"tank_move_start_walk", &tank_move_start_walk}, +{"tank_move_stand", &tank_move_stand}, +{"supertank_move_end_attack1", &supertank_move_end_attack1}, +{"supertank_move_attack1", &supertank_move_attack1}, +{"supertank_move_attack2", &supertank_move_attack2}, +{"supertank_move_attack3", &supertank_move_attack3}, +{"supertank_move_attack4", &supertank_move_attack4}, +{"supertank_move_backward", &supertank_move_backward}, +{"supertank_move_death", &supertank_move_death}, +{"supertank_move_pain1", &supertank_move_pain1}, +{"supertank_move_pain2", &supertank_move_pain2}, +{"supertank_move_pain3", &supertank_move_pain3}, +{"supertank_move_turn_left", &supertank_move_turn_left}, +{"supertank_move_turn_right", &supertank_move_turn_right}, +{"supertank_move_forward", &supertank_move_forward}, +{"supertank_move_run", &supertank_move_run}, +{"supertank_move_stand", &supertank_move_stand}, +{"soldier_move_jump", &soldier_move_jump}, +{"soldier_move_death6", &soldier_move_death6}, +{"soldier_move_death5", &soldier_move_death5}, +{"soldier_move_death4", &soldier_move_death4}, +{"soldier_move_death3", &soldier_move_death3}, +{"soldier_move_death2", &soldier_move_death2}, +{"soldier_move_death1", &soldier_move_death1}, +{"soldier_move_duck", &soldier_move_duck}, +{"soldier_move_attack6", &soldier_move_attack6}, +{"soldier_move_attack4", &soldier_move_attack4}, +{"soldier_move_attack3", &soldier_move_attack3}, +{"soldier_move_attack2", &soldier_move_attack2}, +{"soldier_move_attack1", &soldier_move_attack1}, +{"soldier_move_pain4", &soldier_move_pain4}, +{"soldier_move_pain3", &soldier_move_pain3}, +{"soldier_move_pain2", &soldier_move_pain2}, +{"soldier_move_pain1", &soldier_move_pain1}, +{"soldier_move_run", &soldier_move_run}, +{"soldier_move_start_run", &soldier_move_start_run}, +{"soldier_move_walk2", &soldier_move_walk2}, +{"soldier_move_walk1", &soldier_move_walk1}, +{"soldier_move_stand3", &soldier_move_stand3}, +{"soldier_move_stand1", &soldier_move_stand1}, +{"sentrybot_move_attack", &sentrybot_move_attack}, +{"sentrybot_move_pain2", &sentrybot_move_pain2}, +{"sentrybot_move_pain1", &sentrybot_move_pain1}, +{"sentrybot_move_jump", &sentrybot_move_jump}, +{"sentrybot_move_run", &sentrybot_move_run}, +{"sentrybot_move_walk", &sentrybot_move_walk}, +{"sentrybot_move_stand", &sentrybot_move_stand}, +{"parasite_move_jump", ¶site_move_jump}, +{"parasite_move_death", ¶site_move_death}, +{"parasite_move_break", ¶site_move_break}, +{"parasite_move_drain", ¶site_move_drain}, +{"parasite_move_pain1", ¶site_move_pain1}, +{"parasite_move_stop_walk", ¶site_move_stop_walk}, +{"parasite_move_start_walk", ¶site_move_start_walk}, +{"parasite_move_walk", ¶site_move_walk}, +{"parasite_move_stop_run", ¶site_move_stop_run}, +{"parasite_move_start_run", ¶site_move_start_run}, +{"parasite_move_run", ¶site_move_run}, +{"parasite_move_stand", ¶site_move_stand}, +{"parasite_move_end_fidget", ¶site_move_end_fidget}, +{"parasite_move_fidget", ¶site_move_fidget}, +{"parasite_move_start_fidget", ¶site_move_start_fidget}, +{"mutant_move_fake_jump", &mutant_move_fake_jump}, +{"mutant_move_death2", &mutant_move_death2}, +{"mutant_move_death1", &mutant_move_death1}, +{"mutant_move_pain3", &mutant_move_pain3}, +{"mutant_move_pain2", &mutant_move_pain2}, +{"mutant_move_pain1", &mutant_move_pain1}, +{"mutant_move_jump", &mutant_move_jump}, +{"mutant_move_attack", &mutant_move_attack}, +{"mutant_move_run", &mutant_move_run}, +{"mutant_move_start_walk", &mutant_move_start_walk}, +{"mutant_move_walk", &mutant_move_walk}, +{"mutant_move_idle", &mutant_move_idle}, +{"mutant_move_stand", &mutant_move_stand}, +{"medic_move_attackCable", &medic_move_attackCable}, +{"medic_move_attackBlaster", &medic_move_attackBlaster}, +{"medic_move_attackHyperBlaster", &medic_move_attackHyperBlaster}, +{"medic_move_duck", &medic_move_duck}, +{"medic_move_death", &medic_move_death}, +{"medic_move_pain2", &medic_move_pain2}, +{"medic_move_pain1", &medic_move_pain1}, +{"medic_move_run", &medic_move_run}, +{"medic_move_walk", &medic_move_walk}, +{"medic_move_stand", &medic_move_stand}, +{"insane_move_struggle_cross", &insane_move_struggle_cross}, +{"insane_move_cross", &insane_move_cross}, +{"insane_move_crawl_death", &insane_move_crawl_death}, +{"insane_move_crawl_pain", &insane_move_crawl_pain}, +{"insane_move_runcrawl", &insane_move_runcrawl}, +{"insane_move_crawl", &insane_move_crawl}, +{"insane_move_stand_death", &insane_move_stand_death}, +{"insane_move_stand_pain", &insane_move_stand_pain}, +{"insane_move_run_insane", &insane_move_run_insane}, +{"insane_move_walk_insane", &insane_move_walk_insane}, +{"insane_move_run_normal", &insane_move_run_normal}, +{"insane_move_walk_normal", &insane_move_walk_normal}, +{"insane_move_down", &insane_move_down}, +{"insane_move_jumpdown", &insane_move_jumpdown}, +{"insane_move_downtoup", &insane_move_downtoup}, +{"insane_move_uptodown", &insane_move_uptodown}, +{"insane_move_stand_insane", &insane_move_stand_insane}, +{"insane_move_stand_normal", &insane_move_stand_normal}, +{"infantry_move_jump", &infantry_move_jump}, +{"infantry_move_attack2", &infantry_move_attack2}, +{"infantry_move_attack1", &infantry_move_attack1}, +{"infantry_move_roll", &infantry_move_roll}, +{"infantry_move_duck", &infantry_move_duck}, +{"infantry_move_death4", &infantry_move_death4}, +{"infantry_move_death3", &infantry_move_death3}, +{"infantry_move_death2", &infantry_move_death2}, +{"infantry_move_death1", &infantry_move_death1}, +{"infantry_move_pain2", &infantry_move_pain2}, +{"infantry_move_pain1", &infantry_move_pain1}, +{"infantry_move_run", &infantry_move_run}, +{"infantry_move_walk", &infantry_move_walk}, +{"infantry_move_fidget", &infantry_move_fidget}, +{"infantry_move_stand", &infantry_move_stand}, +{"hover_move_end_attack", &hover_move_end_attack}, +{"hover_move_attack2", &hover_move_attack2}, +{"hover_move_attack1", &hover_move_attack1}, +{"hover_move_start_attack", &hover_move_start_attack}, +{"hover_move_backward", &hover_move_backward}, +{"hover_move_death1", &hover_move_death1}, +{"hover_move_run", &hover_move_run}, +{"hover_move_walk", &hover_move_walk}, +{"hover_move_forward", &hover_move_forward}, +{"hover_move_land", &hover_move_land}, +{"hover_move_pain1", &hover_move_pain1}, +{"hover_move_pain2", &hover_move_pain2}, +{"hover_move_pain3", &hover_move_pain3}, +{"hover_move_takeoff", &hover_move_takeoff}, +{"hover_move_stop2", &hover_move_stop2}, +{"hover_move_stop1", &hover_move_stop1}, +{"hover_move_stand", &hover_move_stand}, +{"gunner_move_jump", &gunner_move_jump}, +{"gunner_move_attack_grenade", &gunner_move_attack_grenade}, +{"gunner_move_endfire_chain", &gunner_move_endfire_chain}, +{"gunner_move_fire_chain", &gunner_move_fire_chain}, +{"gunner_move_attack_chain", &gunner_move_attack_chain}, +{"gunner_move_duck", &gunner_move_duck}, +{"gunner_move_death", &gunner_move_death}, +{"gunner_move_pain1", &gunner_move_pain1}, +{"gunner_move_pain2", &gunner_move_pain2}, +{"gunner_move_pain3", &gunner_move_pain3}, +{"gunner_move_runandshoot", &gunner_move_runandshoot}, +{"gunner_move_run", &gunner_move_run}, +{"gunner_move_walk", &gunner_move_walk}, +{"gunner_move_stand", &gunner_move_stand}, +{"gunner_move_fidget", &gunner_move_fidget}, +{"gladiator_move_death", &gladiator_move_death}, +{"gladiator_move_pain_air", &gladiator_move_pain_air}, +{"gladiator_move_pain", &gladiator_move_pain}, +{"gladiator_move_attack_gun", &gladiator_move_attack_gun}, +{"gladiator_move_attack_melee", &gladiator_move_attack_melee}, +{"gladiator_move_run", &gladiator_move_run}, +{"gladiator_move_walk", &gladiator_move_walk}, +{"gladiator_move_stand", &gladiator_move_stand}, +{"flyer_move_loop_melee", &flyer_move_loop_melee}, +{"flyer_move_end_melee", &flyer_move_end_melee}, +{"flyer_move_start_melee", &flyer_move_start_melee}, +{"flyer_move_attack2", &flyer_move_attack2}, +{"flyer_move_bankleft", &flyer_move_bankleft}, +{"flyer_move_bankright", &flyer_move_bankright}, +{"flyer_move_defense", &flyer_move_defense}, +{"flyer_move_pain1", &flyer_move_pain1}, +{"flyer_move_pain2", &flyer_move_pain2}, +{"flyer_move_pain3", &flyer_move_pain3}, +{"flyer_move_rollleft", &flyer_move_rollleft}, +{"flyer_move_rollright", &flyer_move_rollright}, +{"flyer_move_stop", &flyer_move_stop}, +{"flyer_move_start", &flyer_move_start}, +{"flyer_move_run", &flyer_move_run}, +{"flyer_move_walk", &flyer_move_walk}, +{"flyer_move_stand", &flyer_move_stand}, +{"floater_move_run", &floater_move_run}, +{"floater_move_walk", &floater_move_walk}, +{"floater_move_pain3", &floater_move_pain3}, +{"floater_move_pain2", &floater_move_pain2}, +{"floater_move_pain1", &floater_move_pain1}, +{"floater_move_death", &floater_move_death}, +{"floater_move_attack3", &floater_move_attack3}, +{"floater_move_attack2", &floater_move_attack2}, +{"floater_move_attack1", &floater_move_attack1}, +{"floater_move_activate", &floater_move_activate}, +{"floater_move_stand2", &floater_move_stand2}, +{"floater_move_stand1", &floater_move_stand1}, +{"flipper_move_death", &flipper_move_death}, +{"flipper_move_attack", &flipper_move_attack}, +{"flipper_move_pain1", &flipper_move_pain1}, +{"flipper_move_pain2", &flipper_move_pain2}, +{"flipper_move_start_run", &flipper_move_start_run}, +{"flipper_move_walk", &flipper_move_walk}, +{"flipper_move_run_start", &flipper_move_run_start}, +{"flipper_move_run_loop", &flipper_move_run_loop}, +{"flipper_move_stand", &flipper_move_stand}, +{"chick_move_start_slash", &chick_move_start_slash}, +{"chick_move_end_slash", &chick_move_end_slash}, +{"chick_move_slash", &chick_move_slash}, +{"chick_move_end_attack1", &chick_move_end_attack1}, +{"chick_move_attack1", &chick_move_attack1}, +{"chick_move_start_attack1", &chick_move_start_attack1}, +{"chick_move_backflip", &chick_move_backflip}, +{"chick_move_duck", &chick_move_duck}, +{"chick_move_death1", &chick_move_death1}, +{"chick_move_death2", &chick_move_death2}, +{"chick_move_pain3", &chick_move_pain3}, +{"chick_move_pain2", &chick_move_pain2}, +{"chick_move_pain1", &chick_move_pain1}, +{"chick_move_walk", &chick_move_walk}, +{"chick_move_run", &chick_move_run}, +{"chick_move_start_run", &chick_move_start_run}, +{"chick_move_stand", &chick_move_stand}, +{"chick_move_fidget", &chick_move_fidget}, +{"brain_move_preattack_drain", &brain_move_preattack_drain}, +{"brain_move_attack_drain", &brain_move_attack_drain}, +{"brain_move_attack_plasma", &brain_move_attack_plasma}, +{"brain_move_run", &brain_move_run}, +{"brain_move_attack3", &brain_move_attack3}, +{"brain_move_attack2", &brain_move_attack2}, +{"brain_move_attack1", &brain_move_attack1}, +{"brain_move_death1", &brain_move_death1}, +{"brain_move_death2", &brain_move_death2}, +{"brain_move_duck", &brain_move_duck}, +{"brain_move_pain1", &brain_move_pain1}, +{"brain_move_pain2", &brain_move_pain2}, +{"brain_move_pain3", &brain_move_pain3}, +{"brain_move_defense", &brain_move_defense}, +{"brain_move_walk2", &brain_move_walk2}, +{"brain_move_walk1", &brain_move_walk1}, +{"brain_move_idle", &brain_move_idle}, +{"brain_move_stand", &brain_move_stand}, +{"makron_move_attack5", &makron_move_attack5}, +{"makron_move_attack4", &makron_move_attack4}, +{"makron_move_attack3", &makron_move_attack3}, +{"makron_move_sight", &makron_move_sight}, +{"makron_move_death3", &makron_move_death3}, +{"makron_move_death2", &makron_move_death2}, +{"makron_move_pain4", &makron_move_pain4}, +{"makron_move_pain5", &makron_move_pain5}, +{"makron_move_pain6", &makron_move_pain6}, +{"makron_move_walk", &makron_move_walk}, +{"makron_move_run", &makron_move_run}, +{"makron_move_stand", &makron_move_stand}, +{"jorg_move_end_attack1", &jorg_move_end_attack1}, +{"jorg_move_attack1", &jorg_move_attack1}, +{"jorg_move_start_attack1", &jorg_move_start_attack1}, +{"jorg_move_attack2", &jorg_move_attack2}, +{"jorg_move_death", &jorg_move_death}, +{"jorg_move_pain1", &jorg_move_pain1}, +{"jorg_move_pain2", &jorg_move_pain2}, +{"jorg_move_pain3", &jorg_move_pain3}, +{"jorg_move_end_walk", &jorg_move_end_walk}, +{"jorg_move_walk", &jorg_move_walk}, +{"jorg_move_start_walk", &jorg_move_start_walk}, +{"jorg_move_run", &jorg_move_run}, +{"jorg_move_stand", &jorg_move_stand}, +{"boss2_move_death", &boss2_move_death}, +{"boss2_move_pain_light", &boss2_move_pain_light}, +{"boss2_move_pain_heavy", &boss2_move_pain_heavy}, +{"boss2_move_attack_rocket", &boss2_move_attack_rocket}, +{"boss2_move_attack_post_mg", &boss2_move_attack_post_mg}, +{"boss2_move_attack_mg", &boss2_move_attack_mg}, +{"boss2_move_attack_pre_mg", &boss2_move_attack_pre_mg}, +{"boss2_move_run", &boss2_move_run}, +{"boss2_move_walk", &boss2_move_walk}, +{"boss2_move_fidget", &boss2_move_fidget}, +{"boss2_move_stand", &boss2_move_stand}, +{"berserk_move_jump", &berserk_move_jump}, +{"berserk_move_death2", &berserk_move_death2}, +{"berserk_move_death1", &berserk_move_death1}, +{"berserk_move_pain2", &berserk_move_pain2}, +{"berserk_move_pain1", &berserk_move_pain1}, +{"berserk_move_attack_strike", &berserk_move_attack_strike}, +{"berserk_move_attack_club", &berserk_move_attack_club}, +{"berserk_move_attack_spike", &berserk_move_attack_spike}, +{"berserk_move_run1", &berserk_move_run1}, +{"berserk_move_walk", &berserk_move_walk}, +{"berserk_move_stand_fidget", &berserk_move_stand_fidget}, +{"berserk_move_stand", &berserk_move_stand}, +{"actor_move_salute", &actor_move_salute}, +{"actor_move_jump", &actor_move_jump}, +{"actor_move_crattack", &actor_move_crattack}, +{"actor_move_attack", &actor_move_attack}, +{"actor_move_death2", &actor_move_death2}, +{"actor_move_death1", &actor_move_death1}, +{"actor_move_switch", &actor_move_switch}, +{"actor_move_taunt", &actor_move_taunt}, +{"actor_move_flipoff", &actor_move_flipoff}, +{"actor_move_pain3", &actor_move_pain3}, +{"actor_move_pain2", &actor_move_pain2}, +{"actor_move_pain1", &actor_move_pain1}, +{"mmove_reloc", &mmove_reloc}, +{"actor_move_walk_back", &actor_move_walk_back}, +{"actor_move_walk", &actor_move_walk}, +{"actor_move_stand", &actor_move_stand}, +{"actor_move_run_bad", &actor_move_run_bad}, +{"actor_move_run_back", &actor_move_run_back}, +{"actor_move_run", &actor_move_run}, +{"actor_move_crouchwalk_back", &actor_move_crouchwalk_back}, +{"actor_move_crouchwalk", &actor_move_crouchwalk}, +{"actor_move_crouch", &actor_move_crouch}, +{0, 0} diff --git a/src/g_monster.c b/src/g_monster.c index 87fc4f2..fced296 100644 --- a/src/g_monster.c +++ b/src/g_monster.c @@ -1050,7 +1050,7 @@ void InitiallyDead (edict_t *self) #define MAX_SKINS 16 #define MAX_SKINNAME 64 -#include +//#include #include "pak.h" int PatchMonsterModel (char *modelname) diff --git a/src/g_patchplayermodels.c b/src/g_patchplayermodels.c index 6df13f3..46c1560 100644 --- a/src/g_patchplayermodels.c +++ b/src/g_patchplayermodels.c @@ -7,7 +7,7 @@ // PatchPlayerModels (ent); -#include +//#include #include "g_local.h" @@ -21,6 +21,8 @@ // int PatchPlayerModels (char *modelname) { + return 1; + cvar_t *game; int j; int numskins; // number of skin entries diff --git a/src/g_save.c b/src/g_save.c index 70e1152..54f494e 100644 --- a/src/g_save.c +++ b/src/g_save.c @@ -3,6 +3,14 @@ #define Function(f) {#f, f} + +#ifndef _WIN32 +#define SAVEGAME_USE_FUNCTION_TABLE +#endif + +#define SAVEGAME_DLLNAME "Lazarus Quake II mod for SMD" +#define SAVEGAME_VERSION 1 + mmove_t mmove_reloc; field_t fields[] = { @@ -39,7 +47,6 @@ field_t fields[] = { {"origin", FOFS(s.origin), F_VECTOR}, {"angles", FOFS(s.angles), F_VECTOR}, {"angle", FOFS(s.angles), F_ANGLEHACK}, - {"goalentity", FOFS(goalentity), F_EDICT, FFL_NOSPAWN}, {"movetarget", FOFS(movetarget), F_EDICT, FFL_NOSPAWN}, {"enemy", FOFS(enemy), F_EDICT, FFL_NOSPAWN}, @@ -209,10 +216,14 @@ field_t fields[] = { {"badMedic2", FOFS(monsterinfo.badMedic2), F_EDICT}, {"last_player_enemy", FOFS(monsterinfo.last_player_enemy), F_EDICT}, {"commander", FOFS(monsterinfo.commander), F_EDICT}, - {"blocked", FOFS(monsterinfo.blocked), F_MMOVE, FFL_NOSPAWN}, - {"duck", FOFS(monsterinfo.duck), F_MMOVE, FFL_NOSPAWN}, - {"unduck", FOFS(monsterinfo.unduck), F_MMOVE, FFL_NOSPAWN}, - {"sidestep", FOFS(monsterinfo.sidestep), F_MMOVE, FFL_NOSPAWN}, + {"blocked", FOFS(monsterinfo.blocked), F_FUNCTION, FFL_NOSPAWN}, + {"duck", FOFS(monsterinfo.duck), F_FUNCTION, FFL_NOSPAWN}, + {"unduck", FOFS(monsterinfo.unduck), F_FUNCTION, FFL_NOSPAWN}, + {"sidestep", FOFS(monsterinfo.sidestep), F_FUNCTION, FFL_NOSPAWN}, +// {"blocked", FOFS(monsterinfo.blocked), F_MMOVE, FFL_NOSPAWN}, +// {"duck", FOFS(monsterinfo.duck), F_MMOVE, FFL_NOSPAWN}, +// {"unduck", FOFS(monsterinfo.unduck), F_MMOVE, FFL_NOSPAWN}, +// {"sidestep", FOFS(monsterinfo.sidestep), F_MMOVE, FFL_NOSPAWN}, // ROGUE {0, 0, 0, 0} @@ -256,15 +267,17 @@ only happens when a new game is started or a save game is loaded. ============ */ +#ifndef DISABLE_FMOD void ReadTextureSurfaceAssignments(); +#endif void InitGame (void) { gi.dprintf("==== InitGame ====\n"); //CW++ + gi.dprintf("E-mail: musashi.planetquake@gmail.com\n\n"); gi.dprintf("Slight Mechanical Destruction\n"); gi.dprintf("by Musashi\n"); - gi.dprintf("E-mail: musashi.planetquake@gmail.com\n\n"); //CW-- gun_x = gi.cvar ("gun_x", "0", 0); @@ -290,7 +303,10 @@ void InitGame (void) deathmatch = gi.cvar ("deathmatch", "0", CVAR_LATCH); coop = gi.cvar ("coop", "0", CVAR_LATCH); skill = gi.cvar ("skill", "1", CVAR_LATCH); - maxentities = gi.cvar ("maxentities", "1024", CVAR_LATCH); + + //Knightmare- increase maxentities + //maxentities = gi.cvar ("maxentities", "1024", CVAR_LATCH); + maxentities = gi.cvar ("maxentities", va("%i",MAX_EDICTS), CVAR_LATCH); // change anytime vars dmflags = gi.cvar ("dmflags", "0", CVAR_SERVERINFO); @@ -423,8 +439,10 @@ void InitGame (void) game.clients = gi.TagMalloc (game.maxclients * sizeof(game.clients[0]), TAG_GAME); globals.num_edicts = game.maxclients+1; +#ifndef DISABLE_FMOD if(footstep_sounds->value) ReadTextureSurfaceAssignments(); +#endif //CW++ game.clock_count = 0; @@ -434,11 +452,86 @@ void InitGame (void) //========================================================= +#ifdef SAVEGAME_USE_FUNCTION_TABLE + +typedef struct { + char *funcStr; + byte *funcPtr; +} functionList_t; + +typedef struct { + char *mmoveStr; + mmove_t *mmovePtr; +} mmoveList_t; + +#include "g_func_decs.h" + +functionList_t functionList[] = { +#include "g_func_list.h" +}; + +#include "g_mmove_decs.h" + +mmoveList_t mmoveList[] = { +#include "g_mmove_list.h" +}; + +functionList_t *GetFunctionByAddress (byte *adr) +{ + int i; + for (i=0; functionList[i].funcStr; i++) + { + if (functionList[i].funcPtr == adr) + return &functionList[i]; + } + return NULL; +} + +byte *FindFunctionByName (char *name) +{ + int i; + for (i=0; functionList[i].funcStr; i++) + { + if (!strcmp(name, functionList[i].funcStr)) + return functionList[i].funcPtr; + } + return NULL; +} + +mmoveList_t *GetMmoveByAddress (mmove_t *adr) +{ + int i; + for (i=0; mmoveList[i].mmoveStr; i++) + { + if (mmoveList[i].mmovePtr == adr) + return &mmoveList[i]; + } + return NULL; +} + +mmove_t *FindMmoveByName (char *name) +{ + int i; + for (i=0; mmoveList[i].mmoveStr; i++) + { + if (!strcmp(name, mmoveList[i].mmoveStr)) + return mmoveList[i].mmovePtr; + } + return NULL; +} + +#endif // SAVEGAME_USE_FUNCTION_TABLE +//========================================================= + void WriteField1 (FILE *f, field_t *field, byte *base) { void *p; int len; int index; +#ifdef SAVEGAME_USE_FUNCTION_TABLE + functionList_t *func; + mmoveList_t *mmove; +#endif if (field->flags & FFL_SPAWNTEMP) return; @@ -482,7 +575,36 @@ void WriteField1 (FILE *f, field_t *field, byte *base) index = *(gitem_t **)p - itemlist; *(int *)p = index; break; - +#ifdef SAVEGAME_USE_FUNCTION_TABLE + // Matches with an address in the function list, which is generated by extractfuncs.exe. + // Actual name of function is saved as a string, allowing version-independent savegames. + case F_FUNCTION: + if (*(byte **)p == NULL) + len = 0; + else + { + func = GetFunctionByAddress (*(byte **)p); + if (!func) + gi.error ("WriteField1: function not in list, can't save game"); + len = strlen(func->funcStr)+1; + } + *(int *)p = len; + break; + // Matches with an address in the mmove list, which is generated by extractfuncs.exe. + // Actual name of mmove is saved as a string, allowing version-independent savegames. + case F_MMOVE: + if (*(byte **)p == NULL) + len = 0; + else + { + mmove = GetMmoveByAddress (*(mmove_t **)p); + if (!mmove) + gi.error ("WriteField1: mmove not in list, can't save game"); + len = strlen(mmove->mmoveStr)+1; + } + *(int *)p = len; + break; +#else // SAVEGAME_USE_FUNCTION_TABLE //relative to code segment case F_FUNCTION: if (*(byte **)p == NULL) @@ -500,7 +622,7 @@ void WriteField1 (FILE *f, field_t *field, byte *base) index = *(byte **)p - (byte *)&mmove_reloc; *(int *)p = index; break; - +#endif // SAVEGAME_USE_FUNCTION_TABLE default: gi.error ("WriteEdict: unknown field type"); } @@ -511,6 +633,10 @@ void WriteField2 (FILE *f, field_t *field, byte *base) { int len; void *p; +#ifdef SAVEGAME_USE_FUNCTION_TABLE + functionList_t *func; + mmoveList_t *mmove; +#endif if (field->flags & FFL_SPAWNTEMP) return; @@ -525,6 +651,28 @@ void WriteField2 (FILE *f, field_t *field, byte *base) fwrite (*(char **)p, len, 1, f); } break; +#ifdef SAVEGAME_USE_FUNCTION_TABLE + case F_FUNCTION: + if ( *(byte **)p ) + { + func = GetFunctionByAddress (*(byte **)p); + if (!func) + gi.error ("WriteField2: function not in list, can't save game"); + len = strlen(func->funcStr)+1; + fwrite (func->funcStr, len, 1, f); + } + break; + case F_MMOVE: + if ( *(byte **)p ) + { + mmove = GetMmoveByAddress (*(mmove_t **)p); + if (!mmove) + gi.error ("WriteField2: mmove not in list, can't save game"); + len = strlen(mmove->mmoveStr)+1; + fwrite (mmove->mmoveStr, len, 1, f); + } + break; +#endif } } @@ -533,6 +681,9 @@ void ReadField (FILE *f, field_t *field, byte *base) void *p; int len; int index; +#ifdef SAVEGAME_USE_FUNCTION_TABLE + char funcStr[512]; +#endif if (field->flags & FFL_SPAWNTEMP) return; @@ -578,7 +729,38 @@ void ReadField (FILE *f, field_t *field, byte *base) else *(gitem_t **)p = &itemlist[index]; break; - +#ifdef SAVEGAME_USE_FUNCTION_TABLE + // Matches with a string in the function list, which is generated by extractfuncs.exe. + // Actual address of function is loaded from list, allowing version-independent savegames. + case F_FUNCTION: + len = *(int *)p; + if (!len) + *(byte **)p = NULL; + else + { + if (len > sizeof(funcStr)) + gi.error ("ReadField: function name is longer than buffer (%i chars)", sizeof(funcStr)); + fread (funcStr, len, 1, f); + if ( !(*(byte **)p = FindFunctionByName (funcStr)) ) + gi.error ("ReadField: function %s not found in table, can't load game", funcStr); + } + break; + // Matches with a string in the mmove list, which is generated by extractfuncs.exe. + // Actual address of mmove is loaded from list, allowing version-independent savegames. + case F_MMOVE: + len = *(int *)p; + if (!len) + *(byte **)p = NULL; + else + { + if (len > sizeof(funcStr)) + gi.error ("ReadField: mmove name is longer than buffer (%i chars)", sizeof(funcStr)); + fread (funcStr, len, 1, f); + if ( !(*(mmove_t **)p = FindMmoveByName (funcStr)) ) + gi.error ("ReadField: mmove %s not found in table, can't load game", funcStr); + } + break; +#else // SAVEGAME_USE_FUNCTION_TABLE //relative to code segment case F_FUNCTION: index = *(int *)p; @@ -596,7 +778,7 @@ void ReadField (FILE *f, field_t *field, byte *base) else *(byte **)p = (byte *)&mmove_reloc + index; break; - +#endif // SAVEGAME_USE_FUNCTION_TABLE default: gi.error ("ReadEdict: unknown field type"); } @@ -675,6 +857,9 @@ void WriteGame (char *filename, qboolean autosave) FILE *f; int i; char str[16]; +#ifdef SAVEGAME_USE_FUNCTION_TABLE + char str2[64]; +#endif if(developer->value) gi.dprintf ("==== WriteGame ====\n"); @@ -693,6 +878,16 @@ void WriteGame (char *filename, qboolean autosave) strcpy (str, __DATE__); fwrite (str, sizeof(str), 1, f); +#ifdef SAVEGAME_USE_FUNCTION_TABLE + // use modname and save version for compatibility instead of build date + memset (str2, 0, sizeof(str2)); + strcpy (str2, SAVEGAME_DLLNAME); + fwrite (str2, sizeof(str2), 1, f); + + i = SAVEGAME_VERSION; + fwrite (&i, sizeof(i), 1, f); +#endif + game.autosaved = autosave; fwrite (&game, sizeof(game), 1, f); game.autosaved = false; @@ -708,6 +903,9 @@ void ReadGame (char *filename) FILE *f; int i; char str[16]; +#ifdef SAVEGAME_USE_FUNCTION_TABLE + char str2[64]; +#endif if(developer->value) gi.dprintf ("==== ReadGame ====\n"); @@ -719,11 +917,28 @@ void ReadGame (char *filename) gi.error ("Couldn't open %s", filename); fread (str, sizeof(str), 1, f); +#ifndef SAVEGAME_USE_FUNCTION_TABLE if (strcmp (str, __DATE__)) { fclose (f); gi.error ("Savegame from an older version.\n"); } +#else // SAVEGAME_USE_FUNCTION_TABLE + // check modname and save version for compatibility instead of build date + fread (str2, sizeof(str2), 1, f); + if (strcmp (str2, SAVEGAME_DLLNAME)) + { + fclose (f); + gi.error ("Savegame from a different game DLL.\n"); + } + + fread (&i, sizeof(i), 1, f); + if (i != SAVEGAME_VERSION) + { + fclose (f); + gi.error ("ReadGame: savegame %s is wrong version (%i, should be %i)\n", filename, i, SAVEGAME_VERSION); + } +#endif // SAVEGAME_USE_FUNCTION_TABLE g_edicts = gi.TagMalloc (game.maxentities * sizeof(g_edicts[0]), TAG_GAME); globals.edicts = g_edicts; @@ -753,6 +968,16 @@ void WriteEdict (FILE *f, edict_t *ent) // all of the ints, floats, and vectors stay as they are temp = *ent; +#ifdef SAVEGAME_USE_FUNCTION_TABLE // FIXME: remove once this is working reliably + if (readout->value) + { + if (ent->classname && strlen(ent->classname)) + gi.dprintf("WriteEdict: %s\n", ent->classname); + else + gi.dprintf("WriteEdict: unknown entity\n"); + } +#endif + // change the pointers to lengths or indexes for (field=fields ; field->name ; field++) { @@ -812,6 +1037,7 @@ All pointer variables (except function pointers) must be handled specially. void ReadEdict (FILE *f, edict_t *ent) { field_t *field; + int i; // Knightmare added fread (ent, sizeof(*ent), 1, f); @@ -819,6 +1045,9 @@ void ReadEdict (FILE *f, edict_t *ent) { ReadField (f, field, (byte *)ent); } + // Knightmare- nullify reflection pointers to prevent crash + for (i=0; i<6; i++) + ent->reflection[i] = NULL; } /* diff --git a/src/g_sound.c b/src/g_sound.c index 95e3213..fc0c854 100644 --- a/src/g_sound.c +++ b/src/g_sound.c @@ -1,4 +1,37 @@ #include "g_local.h" + +#ifdef DISABLE_FMOD +void PlayFootstep (edict_t *ent, footstep_t index) {} +void FootStep (edict_t *ent) {} +qboolean FMOD_Init () +{ + return false; +} +void FMOD_Shutdown () {} +void FMOD_UpdateListenerPos () {} +void FMOD_UpdateSpeakerPos (edict_t *speaker) {} +void FMOD_Stop () {} +void CheckEndMusic (edict_t *ent) {} +void CheckEndSample (edict_t *ent) {} +int FMOD_PlaySound (edict_t *ent) +{ + return 0; +} +void FMOD_StopSound (edict_t *ent, qboolean free) {} +void target_playback_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) {} +void target_playback_fadeout (edict_t *ent) {} +void target_playback_fadein (edict_t *ent) {} +qboolean FMOD_IsPlaying (edict_t *ent) +{ + return false; +} +void Use_Target_Playback (edict_t *ent, edict_t *other, edict_t *activator) {} +void target_playback_delayed_start (edict_t *ent) {} +void target_playback_delayed_restart (edict_t *ent) {} +void SP_target_playback (edict_t *ent) {} + +#else // DISABLE_FMOD + #include "fmod.h" #include @@ -1396,3 +1429,4 @@ void SP_target_playback (edict_t *ent) } } +#endif // DISABLE_FMOD diff --git a/src/g_spawn.c b/src/g_spawn.c index a3ad329..bfb6f12 100644 --- a/src/g_spawn.c +++ b/src/g_spawn.c @@ -689,7 +689,7 @@ void LoadTransitionEnts() gi.dprintf("==== LoadTransitionEnts ====\n"); if(game.transition_ents) { - char t_file[_MAX_PATH]; + char t_file[MAX_OSPATH]; int i, j; FILE *f; vec3_t v_spawn; @@ -1326,6 +1326,7 @@ void SP_worldspawn (edict_t *ent) if(footstep_sounds->value) world->effects |= FX_WORLDSPAWN_STEPSOUNDS; +#ifndef DISABLE_FMOD if(deathmatch->value || coop->value) qFMOD_Footsteps = false; else if(world->effects & FX_WORLDSPAWN_STEPSOUNDS) @@ -1334,7 +1335,8 @@ void SP_worldspawn (edict_t *ent) FMOD_Init(); } else - qFMOD_Footsteps = false; + qFMOD_Footsteps = false; +#endif } // Hud toggle ripped from TPP source diff --git a/src/g_target.bak b/src/g_target.bak new file mode 100644 index 0000000..00b9341 --- /dev/null +++ b/src/g_target.bak @@ -0,0 +1,4496 @@ +#include "g_local.h" + +#define IF_VISIBLE 8 +#define SEEK_PLAYER 128 +#define ANIM_MASK (EF_ANIM01|EF_ANIM23|EF_ANIM_ALL|EF_ANIM_ALLFAST) //CW + +static float fCrosshair; //CW: store crosshair value for [target_monitor] use +char *single_statusbar; //CW: reference external definition in g_spawn.c + +///CW++ Holographic "repair catalogue" of monsters. +#define HOLO_SIZE 12 + +char *holo_list[HOLO_SIZE] = {"models/monsters/berserk/tris.md2", + "models/monsters/brain/tris.md2", + "models/monsters/flipper/tris.md2", + "models/monsters/float/tris.md2", + "models/monsters/flyer/tris.md2", + "models/monsters/gladiatr/tris.md2", + "models/monsters/gunner/tris.md2", + "models/monsters/hover/tris.md2", + "models/monsters/infantry/tris.md2", + "models/monsters/parasite/tris.md2", + "models/monsters/soldier/tris.md2", + "players/walker/tris.md2"}; +//CW-- + +/*QUAKED target_temp_entity (1 0 0) (-8 -8 -8) (8 8 8) +Fire an origin based temp entity event to the clients. +"style" type byte +*/ +void Use_Target_Tent (edict_t *self, edict_t *other, edict_t *activator) +{ + gi.WriteByte (svc_temp_entity); + gi.WriteByte (self->style); + gi.WritePosition (self->s.origin); + gi.multicast (self->s.origin, MULTICAST_PVS); + + self->count--; + if (!self->count) + { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } + +} + +void SP_target_temp_entity (edict_t *ent) +{ + ent->use = Use_Target_Tent; +} + + +//========================================================== + +//========================================================== + +/*QUAKED target_speaker (1 0 0) (-8 -8 -8) (8 8 8) looped-on looped-off reliable changelevel +"noise" wav file to play +"attenuation" +DWH +-2 = only played (full volume) for player who triggered the target_speaker +end DWH + +-1 = none, send to whole level + 1 = normal fighting sounds + 2 = idle sound level + 3 = ambient sound level +"volume" 0.0 to 1.0 + +Normal sounds play each time the target is used. The reliable flag can be set for crucial voiceovers. + +Looped sounds are always atten 3 / vol 1, and the use function toggles it on/off. +Multiple identical looping sounds will just increase volume without any speed cost. + +Changelevel spawnflag added for Lazarus. This should ONLY be applied in the code, +and is an indication that the "message" key contains the noise. +*/ +void Use_Target_Speaker (edict_t *ent, edict_t *other, edict_t *activator) +{ + int chan; + + if (ent->spawnflags & 3) + { // looping sound toggles + if (ent->s.sound) { + ent->s.sound = 0; // turn it off + ent->nextthink = 0; + } + else + ent->s.sound = ent->noise_index; // start it + } + else + { + if (ent->attenuation == -2) { + if (ent->spawnflags & 4) + chan = CHAN_VOICE|CHAN_RELIABLE; + else + chan = CHAN_VOICE; + gi.sound (activator, chan, ent->noise_index, 1, ATTN_NORM, 0); + } + else + { // normal sound + if (ent->spawnflags & 4) + chan = CHAN_VOICE|CHAN_RELIABLE; + else + chan = CHAN_VOICE; + // use a positioned_sound, because this entity won't normally be + // sent to any clients because it is invisible + gi.positioned_sound (ent->s.origin, ent, chan, ent->noise_index, ent->volume, ent->attenuation, 0); + } + + ent->count--; + if (!ent->count) { + ent->think = G_FreeEdict; + ent->nextthink = level.time + 1; + } + } +} + +void SP_target_speaker (edict_t *ent) +{ + if (!(ent->spawnflags & 8)) + { + if (!st.noise) + { + gi.dprintf("target_speaker with no noise set at %s\n", vtos(ent->s.origin)); + G_FreeEdict(ent); + return; + } + // DWH: Use "message" key to store noise for speakers that change levels + // via trigger_transition + if (!strstr (st.noise, ".wav")) + { + ent->message = gi.TagMalloc(strlen(st.noise)+5,TAG_LEVEL); + sprintf(ent->message,"%s.wav", st.noise); + } + else + { + ent->message = gi.TagMalloc(strlen(st.noise)+1,TAG_LEVEL); + strcpy(ent->message,st.noise); + } + } + ent->noise_index = gi.soundindex (ent->message); + ent->spawnflags &= ~8; + + if (!ent->volume) + ent->volume = 1.0; + + if (!ent->attenuation) + ent->attenuation = 1.0; + else if (ent->attenuation == -1) // use -1 so 0 defaults to 1 + ent->attenuation = 0; + + // check for prestarted looping sound + if (ent->spawnflags & 1) + ent->s.sound = ent->noise_index; + + ent->use = Use_Target_Speaker; + + // must link the entity so we get areas and clusters so + // the server can determine who to send updates to + gi.linkentity (ent); +} + + +//========================================================== + +void Use_Target_Help (edict_t *self, edict_t *other, edict_t *activator) +{ + if (self->message) + { + if (self->spawnflags & 1) + strncpy (game.helpmessage1, self->message, sizeof(game.helpmessage2)-1); + else + strncpy (game.helpmessage2, self->message, sizeof(game.helpmessage1)-1); + } + + game.helpchanged++; + + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } +} + +/*QUAKED target_help (1 0 1) (-16 -16 -24) (16 16 24) help1 +When fired, the "message" key becomes the current personal computer string, and the message light will be set on all clients status bars. +*/ +void SP_target_help(edict_t *ent) +{ + if (deathmatch->value) + { // auto-remove for deathmatch + G_FreeEdict (ent); + return; + } + + // Lazarus: we allow blank message if world->effects is "help=pic only" + if (!ent->message && !(world->effects & FX_WORLDSPAWN_NOHELP)) + { + gi.dprintf ("%s with no message at %s\n", ent->classname, vtos(ent->s.origin)); + G_FreeEdict (ent); + return; + } + ent->use = Use_Target_Help; +} + +//========================================================== + +/*QUAKED target_secret (1 0 1) (-8 -8 -8) (8 8 8) +Counts a secret found. +These are single use targets. + +Lazarus: +DISABLED SF=1 + +*/ +void use_target_secret (edict_t *ent, edict_t *other, edict_t *activator) +{ + if (ent->spawnflags & 1) + { + ent->spawnflags &= ~1; + level.total_secrets++; + return; + } + gi.sound (ent, CHAN_VOICE, ent->noise_index, 1, ATTN_NORM, 0); + + level.found_secrets++; + + G_UseTargets (ent, activator); + G_FreeEdict (ent); +} + +void SP_target_secret (edict_t *ent) +{ + if (deathmatch->value) + { // auto-remove for deathmatch + G_FreeEdict (ent); + return; + } + + ent->use = use_target_secret; + if (!st.noise) + st.noise = "misc/secret.wav"; + ent->noise_index = gi.soundindex (st.noise); + ent->svflags = SVF_NOCLIENT; + + if (!(ent->spawnflags & 1)) + level.total_secrets++; + + // map bug hack + if (!Q_stricmp(level.mapname, "mine3") && ent->s.origin[0] == 280 && ent->s.origin[1] == -2048 && ent->s.origin[2] == -624) + ent->message = "You have found a secret area."; +} + +//========================================================== + +/*QUAKED target_goal (1 0 1) (-8 -8 -8) (8 8 8) +Counts a goal completed. +These are single use targets. + +Lazarus: +DISABLED SF=1 + +*/ +void use_target_goal (edict_t *ent, edict_t *other, edict_t *activator) +{ + if (ent->spawnflags & 1) + { + ent->spawnflags &= ~1; + level.total_goals++; + return; + } + gi.sound (ent, CHAN_VOICE, ent->noise_index, 1, ATTN_NORM, 0); + + level.found_goals++; + + if (level.found_goals == level.total_goals) + gi.configstring (CS_CDTRACK, "0"); + + G_UseTargets (ent, activator); + G_FreeEdict (ent); +} + +void SP_target_goal (edict_t *ent) +{ + if (deathmatch->value) + { // auto-remove for deathmatch + G_FreeEdict (ent); + return; + } + + ent->use = use_target_goal; + if (!st.noise) + st.noise = "misc/secret.wav"; + ent->noise_index = gi.soundindex (st.noise); + ent->svflags = SVF_NOCLIENT; + + if (!(ent->spawnflags & 1)) + level.total_goals++; +} + +//========================================================== + + +/*QUAKED target_explosion (1 0 0) (-8 -8 -8) (8 8 8) +Spawns an explosion temporary entity when used. + +"delay" wait this long before going off +"dmg" how much radius damage should be done, defaults to 0 +*/ +void target_explosion_explode (edict_t *self) +{ + float save; + + gi.WriteByte (svc_temp_entity); + gi.WriteByte (TE_EXPLOSION1); + gi.WritePosition (self->s.origin); + gi.multicast (self->s.origin, MULTICAST_PHS); + + if (level.num_reflectors) + ReflectExplosion (TE_EXPLOSION1,self->s.origin); + + T_RadiusDamage (self, self->activator, self->dmg, NULL, self->dmg+40, MOD_EXPLOSIVE, -0.5); + + save = self->delay; + self->delay = 0; + G_UseTargets (self, self->activator); + self->delay = save; + + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } +} + +void use_target_explosion (edict_t *self, edict_t *other, edict_t *activator) +{ + self->activator = activator; + + if (!self->delay) + { + target_explosion_explode (self); + return; + } + + self->think = target_explosion_explode; + self->nextthink = level.time + self->delay; +} + +void SP_target_explosion (edict_t *ent) +{ + ent->use = use_target_explosion; + ent->svflags = SVF_NOCLIENT; +} + + +//========================================================== + +/*QUAKED target_changelevel (1 0 0) (-8 -8 -8) (8 8 8) +Changes level to "map" when fired + +Lazarus spawnflags: + 1 CLEAR_INVENTORY: Removes all pickups other than weapons, restore health to 100 + 2 LANDMARK: If set, player position when spawning in the next map will be at the + same offset from the info_player_start as his current position relative + to the target_changelevel. Velocity, angles, and crouch state will be + preserved across maps. + 4 NO_GUN Sets cl_gun 0 and crosshair 0 for the next map/demo only + 8 EASY Sets skill 0 for next map +16 NORMAL Sets skill 1 for next map +32 HARD Sets skill 2 for next map +64 NIGHTMARE Sets skill 3 for next map +*/ +void use_target_changelevel (edict_t *self, edict_t *other, edict_t *activator) +{ + edict_t *transition; + extern int nostatus; + + if (level.intermissiontime) + return; // already activated + + if (!deathmatch->value && !coop->value) + { + if (g_edicts[1].health <= 0) + return; + } + + // if noexit, do a ton of damage to other + if (deathmatch->value && !( (int)dmflags->value & DF_ALLOW_EXIT) && other != world) + { + T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, 10 * other->max_health, 1000, 0, MOD_EXIT); + return; + } + + FMOD_Stop(); + + // if multiplayer, let everyone know who hit the exit + if (deathmatch->value) + { + if (activator && activator->client) + gi.bprintf (PRINT_HIGH, "%s exited the level.\n", activator->client->pers.netname); + } + + if (activator->client) + { + if (activator->client->chasetoggle) + { + ChasecamRemove (activator, OPTION_OFF); + activator->client->pers.chasetoggle = 1; + } + else + activator->client->pers.chasetoggle = 0; + + if (!activator->vehicle) + activator->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION; + } + + // if going to a new unit, clear cross triggers + if (strstr(self->map, "*")) + { + game.serverflags &= ~(SFL_CROSS_TRIGGER_MASK); + game.lock_code[0] = 0; + game.lock_revealed = 0; + game.lock_hud = 0; + game.transition_ents = 0; + + if (activator->client) + { + activator->client->pers.spawn_landmark = false; + activator->client->pers.spawn_levelchange = false; + } + } + else + { + if (self->spawnflags & 2 && activator->client) + { + activator->client->pers.spawn_landmark = true; + VectorSubtract(activator->s.origin,self->s.origin, + activator->client->pers.spawn_offset); + VectorCopy(activator->velocity,activator->client->pers.spawn_velocity); + VectorCopy(activator->s.angles,activator->client->pers.spawn_angles); + activator->client->pers.spawn_angles[ROLL] = 0; + VectorCopy(activator->client->ps.viewangles,activator->client->pers.spawn_viewangles); + activator->client->pers.spawn_pm_flags = activator->client->ps.pmove.pm_flags; + if (self->s.angles[YAW]) + { + vec3_t angles; + vec3_t forward, right, v; + + angles[PITCH] = angles[ROLL] = 0.; + angles[YAW] = self->s.angles[YAW]; + AngleVectors(angles,forward,right,NULL); + VectorNegate(right,right); + VectorCopy(activator->client->pers.spawn_offset,v); + G_ProjectSource (vec3_origin, + v, forward, right, + activator->client->pers.spawn_offset); + VectorCopy(activator->client->pers.spawn_velocity,v); + G_ProjectSource (vec3_origin, + v, forward, right, + activator->client->pers.spawn_velocity); + activator->client->pers.spawn_angles[YAW] += angles[YAW]; + activator->client->pers.spawn_viewangles[YAW] += angles[YAW]; + } + } + else + { + activator->client->pers.spawn_landmark = false; + } + + if ((self->spawnflags & 4) && activator->client && !deathmatch->value && !coop->value) + { + nostatus = 1; + stuffcmd(activator,"cl_gun 0;crosshair 0\n"); + activator->client->pers.hand = 2; + } + + activator->client->pers.spawn_levelchange = true; + activator->client->pers.spawn_gunframe = activator->client->ps.gunframe; + activator->client->pers.spawn_modelframe = activator->s.frame; + activator->client->pers.spawn_anim_end = activator->client->anim_end; + } + + if (level.next_skill > 0) + { + gi.cvar_forceset("skill", va("%d",level.next_skill-1)); + level.next_skill = 0; // reset + } + else if (self->spawnflags & 8) + gi.cvar_forceset("skill", "0"); + else if (self->spawnflags & 16) + gi.cvar_forceset("skill", "1"); + else if (self->spawnflags & 32) + gi.cvar_forceset("skill", "2"); + else if (self->spawnflags & 64) + gi.cvar_forceset("skill", "3"); + + if (self->spawnflags & 1) + { + int n; + if (activator && activator->client) + { + for (n = 0; n < MAX_ITEMS; n++) + { + // Keep blaster + if (!(itemlist[n].flags & IT_WEAPON) || itemlist[n].weapmodel != WEAP_BLASTER ) + activator->client->pers.inventory[n] = 0; + } + // Switch to blaster + if ( activator->client->pers.inventory[ITEM_INDEX(FindItem("blaster"))] ) + activator->client->newweapon = FindItem ("blaster"); + else + activator->client->newweapon = FindItem ("No Weapon"); + ChangeWeapon(activator); + activator->client->pers.health = activator->health = 100; + } + } + game.transition_ents = 0; + if (self->spawnflags & 2 && activator->client) + { + transition = G_Find(NULL,FOFS(classname),"trigger_transition"); + while(transition) + { + if (!Q_stricmp(transition->targetname,self->targetname)) + { + game.transition_ents = trigger_transition_ents(self,transition); + break; + } + transition = G_Find(transition,FOFS(classname),"trigger_transition"); + } + } + BeginIntermission (self); +} + +void SP_target_changelevel (edict_t *ent) +{ + if (!ent->map) + { + gi.dprintf("target_changelevel with no map at %s\n", vtos(ent->s.origin)); + G_FreeEdict (ent); + return; + } + + if ((deathmatch->value || coop->value) && (ent->spawnflags & 2)) + { + gi.dprintf("target_changelevel at %s\nLANDMARK only valid in single-player\n", + vtos(ent->s.origin)); + ent->spawnflags &= ~2; + } + // ugly hack because *SOMEBODY* screwed up their map + if ((Q_stricmp(level.mapname, "fact1") == 0) && (Q_stricmp(ent->map, "fact3") == 0)) + ent->map = "fact3$secret1"; + + ent->use = use_target_changelevel; + ent->svflags = SVF_NOCLIENT; +} + + +//========================================================== + +/*QUAKED target_splash (1 0 0) (-8 -8 -8) (8 8 8) +Creates a particle splash effect when used. + +Set "sounds" to one of the following: + 1) sparks + 2) blue water + 3) brown water + 4) slime + 5) lava + 6) blood + +"count" how many pixels in the splash +"dmg" if set, does a radius damage at this location when it splashes + useful for lava/sparks +*/ + + +void use_target_splash (edict_t *self, edict_t *other, edict_t *activator) +{ + gi.WriteByte (svc_temp_entity); + gi.WriteByte (TE_SPLASH); + gi.WriteByte (self->count); + gi.WritePosition (self->s.origin); + gi.WriteDir (self->movedir); + gi.WriteByte (self->sounds); + gi.multicast (self->s.origin, MULTICAST_PVS); + if (self->dmg) + T_RadiusDamage (self, activator, self->dmg, NULL, self->dmg+40, MOD_SPLASH, -0.5); +} + +void SP_target_splash (edict_t *self) +{ + self->use = use_target_splash; + G_SetMovedir (self->s.angles, self->movedir); + if (!self->count) + self->count = 32; + self->svflags = SVF_NOCLIENT; +} + +//========================================================== + +/*QUAKED target_spawner (1 0 0) (-8 -8 -8) (8 8 8) +Set target to the type of entity you want spawned. +Useful for spawning monsters and gibs in the factory levels. + +For monsters: + Set direction to the facing you want it to have. + +For gibs: + Set direction if you want it moving and + speed how fast it should be moving otherwise it + will just be dropped +*/ +void ED_CallSpawn (edict_t *ent); + +void use_target_spawner (edict_t *self, edict_t *other, edict_t *activator) +{ + edict_t *ent; + + ent = G_Spawn(); + ent->classname = self->target; + VectorCopy (self->s.origin, ent->s.origin); + VectorCopy (self->s.angles, ent->s.angles); + ED_CallSpawn (ent); + gi.unlinkentity (ent); + KillBox (ent); + gi.linkentity (ent); + if (self->speed) + VectorCopy (self->movedir, ent->velocity); + + self->count--; + if (!self->count) + { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } + +} + + +void SP_target_spawner (edict_t *self) +{ + self->use = use_target_spawner; + self->svflags = SVF_NOCLIENT; + if (self->speed) + { + G_SetMovedir (self->s.angles, self->movedir); + VectorScale (self->movedir, self->speed, self->movedir); + } +} + +//========================================================== + +/*QUAKED target_blaster (1 0 0) (-8 -8 -8) (8 8 8) NOTRAIL NOEFFECTS +Fires a blaster bolt in the set direction when triggered. + +dmg default is 15 +speed default is 1000 +*/ + +/* Lazarus: +sounds - weapon choice +0 = blaster +1 = railgun +2 = rocket +3 = bfg +4 = homing rocket +5 = machinegun +6 = grenade +*/ + +void use_target_blaster (edict_t *self, edict_t *other, edict_t *activator) +{ + vec3_t movedir, start, target; + int effect; + + VectorCopy(self->s.origin,start); + if (self->enemy) + { + if (self->sounds == 6) + { + if (!AimGrenade (self, start, self->enemy->s.origin, self->speed, movedir)) + return; + } + else + { + VectorMA(self->enemy->absmin,0.5,self->enemy->size,target); + VectorSubtract(target,start,movedir); + VectorNormalize(movedir); + } + } else + VectorCopy(self->movedir,movedir); + + if (self->spawnflags & 2) + effect = 0; + else if (self->spawnflags & 1) + effect = EF_HYPERBLASTER; + else + effect = EF_BLASTER; + + // Lazarus: weapon choices + if (self->sounds == 1) + { + fire_rail (self, start, movedir, self->dmg, 0); + gi.WriteByte (svc_muzzleflash); + gi.WriteShort (self-g_edicts); + gi.WriteByte (MZ_RAILGUN); + gi.multicast (start, MULTICAST_PVS); + } + else if (self->sounds == 2) + { + fire_rocket(self, start, movedir, self->dmg, self->speed, self->dmg, self->dmg, NULL); + gi.positioned_sound (start, self, CHAN_WEAPON, gi.soundindex("weapons/rocklf1a.wav"), 1, ATTN_NORM, 0); + } + else if (self->sounds == 3) + { + fire_bfg(self, start, movedir, self->dmg, self->speed, self->dmg); + gi.positioned_sound (start, self, CHAN_WEAPON, gi.soundindex("weapons/laser2.wav"), 1, ATTN_NORM, 0); + } + else if (self->sounds == 4) + { + fire_rocket(self, start, movedir, self->dmg, self->speed, self->dmg, self->dmg, self->enemy); + gi.positioned_sound (start, self, CHAN_WEAPON, gi.soundindex("weapons/rocklf1a.wav"), 1, ATTN_NORM, 0); + } + else if (self->sounds == 5) + { + fire_bullet(self, start, movedir, self->dmg, 2, 0, 0, MOD_TARGET_BLASTER); + gi.WriteByte(svc_temp_entity); + gi.WriteByte(TE_CHAINFIST_SMOKE); + gi.WritePosition(start); + gi.multicast(start, MULTICAST_PVS); + gi.positioned_sound(start,self,CHAN_WEAPON,gi.soundindex(va("weapons/machgf%db.wav",rand() % 5 + 1)),1,ATTN_NORM,0); + } + else if (self->sounds == 6) + { + fire_grenade(self, start, movedir, self->dmg, self->speed, 2.5, self->dmg+40); + gi.WriteByte (svc_muzzleflash2); + gi.WriteShort (self - g_edicts); + gi.WriteByte (MZ2_GUNNER_GRENADE_1); + gi.multicast (start, MULTICAST_PVS); + } + else { + fire_blaster (self, start, movedir, self->dmg, self->speed, effect, MOD_TARGET_BLASTER); + gi.sound (self, CHAN_VOICE, self->noise_index, 1, ATTN_NORM, 0); + } +} + +void target_blaster_think (edict_t *self) +{ + edict_t *ent; + edict_t *player; + trace_t tr; + vec3_t target; + int i; + + if (self->spawnflags & SEEK_PLAYER) { + // this takes precedence over everything else + + // If we are currently targeting a non-player, reset and look for + // a player + if (self->enemy && !self->enemy->client) + self->enemy = NULL; + + // Is currently targeted player alive and not using notarget? + if (self->enemy) { + if (self->enemy->flags & FL_NOTARGET) + self->enemy = NULL; + else if (!self->enemy->inuse || self->enemy->health < 0) + self->enemy = NULL; + } + + // We have a live not-notarget player as target. If IF_VISIBLE is + // set, see if we can see him + if (self->enemy && (self->spawnflags & IF_VISIBLE) ) { + VectorMA(self->enemy->absmin,0.5,self->enemy->size,target); + tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,target,self,MASK_OPAQUE); + if (tr.fraction != 1.0) + self->enemy = NULL; + } + + // If we STILL have an enemy, then he must be a good player target. Frag him + if (self->enemy) { + use_target_blaster(self,self,self); + if (self->wait) + self->nextthink = level.time + self->wait; + return; + } + + // Find a player - note that we search the entire entity list so we'll + // also hit on func_monitor-viewing fake players + for(i=1, player=g_edicts+1; ienemy; i++, player++) { + if (!player->inuse) continue; + if (!player->client) continue; + if (player->svflags & SVF_NOCLIENT) continue; + if (player->health >= 0 && !(player->flags & FL_NOTARGET) ) { + if (self->spawnflags & IF_VISIBLE) { + // player must be seen to shoot + VectorMA(player->s.origin,0.5,player->size,target); + tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,target,self,MASK_OPAQUE); + if (tr.fraction == 1.0) + self->enemy = player; + } else { + // we don't care whether he can be seen + self->enemy = player; + } + } + } + // If we have an enemy, shoot + if (self->enemy) { + use_target_blaster(self,self,self); + if (self->wait) + self->nextthink = level.time + self->wait; + return; + } + } + + // If we get to this point, then either SEEK_PLAYER wasn't set or we couldn't find + // a live, notarget player. + + if (self->target) { + if (!(self->spawnflags & IF_VISIBLE)) { + // have a target, don't care whether it's visible; cannot be a gibbed monster + self->enemy = NULL; + ent = G_Find (NULL, FOFS(targetname), self->target); + while(ent && !self->enemy) { + // if target is not a monster, we're done + if ( !(ent->svflags & SVF_MONSTER)) { + self->enemy = ent; + break; + } + ent = G_Find(ent, FOFS(targetname), self->target); + } + } else { + // has a target, but must be visible and not a monster + self->enemy = NULL; + ent = G_Find (NULL, FOFS(targetname), self->target); + while(ent && !self->enemy) { + // if the target isn't a monster, we don't care whether + // it can be seen or not. + if ( !(ent->svflags & SVF_MONSTER) ) { + self->enemy = ent; + break; + } + if ( ent->health > ent->gib_health) + { + // Not a gibbed monster + VectorMA(ent->absmin,0.5,ent->size,target); + tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,target,self,MASK_OPAQUE); + if (tr.fraction == 1.0) + { + self->enemy = ent; + break; + } + } + ent = G_Find(ent, FOFS(targetname), self->target); + } + } + } + if (self->enemy || !(self->spawnflags & IF_VISIBLE) ) { + use_target_blaster(self,self,self); + if (self->wait) + self->nextthink = level.time + self->wait; + } else if (self->wait) + self->nextthink = level.time + FRAMETIME; +} + +void find_target_blaster_target(edict_t *self, edict_t *other, edict_t *activator) +{ + target_blaster_think(self); +} + +void toggle_target_blaster (edict_t *self, edict_t *other, edict_t *activator) +{ + // used for target_blasters with a "wait" value + + self->activator = activator; + if (self->spawnflags & 4) { + + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } + else + { + self->spawnflags &= ~4; + self->nextthink = 0; + } + } else { + self->spawnflags |= 4; + self->think (self); + } +} + +void target_blaster_init (edict_t *self) +{ + if (self->target) { + edict_t *ent; + ent = G_Find (NULL, FOFS(targetname), self->target); + if (!ent) + gi.dprintf("%s at %s: %s is a bad target\n", self->classname, vtos(self->s.origin), self->target); + self->enemy = ent; + } +} +void SP_target_blaster (edict_t *self) +{ + G_SetMovedir (self->s.angles, self->movedir); + self->noise_index = gi.soundindex ("weapons/laser2.wav"); + + if (!self->dmg) + self->dmg = 15; + if (!self->speed) + self->speed = 1000; + + // If SEEK_PLAYER is not set and there's no target, then + // IF_VISIBLE is meaningless + if (!(self->spawnflags & 128) && !self->target) + self->spawnflags &= ~16; + + if (self->wait) { + // toggled target_blaster + self->use = toggle_target_blaster; + self->enemy = NULL; // for now + self->think = target_blaster_think; + if (self->spawnflags & 4) + self->nextthink = level.time + 1; + else + self->nextthink = 0; + } else if (self->target || (self->spawnflags & SEEK_PLAYER)) { + self->use = find_target_blaster_target; + if (self->target) { + self->think = target_blaster_init; + self->nextthink = level.time + 2*FRAMETIME; + } + } else { + // normal targeted target_blaster + self->use = use_target_blaster; + } + + gi.linkentity(self); + self->svflags = SVF_NOCLIENT; +} + + +//========================================================== + +/*QUAKED target_crosslevel_trigger (.5 .5 .5) (-8 -8 -8) (8 8 8) trigger1 trigger2 trigger3 trigger4 trigger5 trigger6 trigger7 trigger8 +Once this trigger is touched/used, any trigger_crosslevel_target with the same trigger number is automatically used when a level is started within the same unit. It is OK to check multiple triggers. Message, delay, target, and killtarget also work. +*/ +void trigger_crosslevel_trigger_use (edict_t *self, edict_t *other, edict_t *activator) +{ + game.serverflags |= self->spawnflags; + // DWH: By most editors, the trigger should be able to fire targets. Added + // the following line: + G_UseTargets (self, activator); + G_FreeEdict (self); +} + +void SP_target_crosslevel_trigger (edict_t *self) +{ + self->svflags = SVF_NOCLIENT; + self->use = trigger_crosslevel_trigger_use; +} + +/*QUAKED target_crosslevel_target (.5 .5 .5) (-8 -8 -8) (8 8 8) trigger1 trigger2 trigger3 trigger4 trigger5 trigger6 trigger7 trigger8 +Triggered by a trigger_crosslevel elsewhere within a unit. If multiple triggers are checked, all must be true. Delay, target and +killtarget also work. + +"delay" delay before using targets if the trigger has been activated (default 1) +*/ +void target_crosslevel_target_think (edict_t *self) +{ + if (self->spawnflags == (game.serverflags & SFL_CROSS_TRIGGER_MASK & self->spawnflags)) + { + G_UseTargets (self, self); + G_FreeEdict (self); + } +} + +void SP_target_crosslevel_target (edict_t *self) +{ + if (! self->delay) + self->delay = 1; + self->svflags = SVF_NOCLIENT; + + self->think = target_crosslevel_target_think; + self->nextthink = level.time + self->delay; +} + +//========================================================== + +/*QUAKED target_laser (0 .5 .8) (-8 -8 -8) (8 8 8) START_ON RED GREEN BLUE YELLOW ORANGE FAT +When triggered, fires a laser. You can either set a target +or a direction. +*/ + +// DWH - player-seeking laser stuff +void target_laser_ps_think (edict_t *self) +{ + edict_t *ignore; + edict_t *player; + trace_t tr; + vec3_t start; + vec3_t end; + vec3_t point; + vec3_t last_movedir; + vec3_t target; + int count; + int i; + + if (self->wait > 0) + { + if ( level.time >= self->starttime ) { + self->starttime = level.time + self->wait; + self->endtime = level.time + self->delay; + } + else if ( level.time >= self->endtime ) { + self->nextthink = level.time + FRAMETIME; + return; + } + } + + if (self->spawnflags & 0x80000000) + count = 8; // spark count + else + count = 4; + + if (self->enemy) + { + if (self->enemy->flags & FL_NOTARGET || (self->enemy->health < self->enemy->gib_health) ) + self->enemy = NULL; + else { + // first make sure laser can see the center of the enemy + VectorMA(self->enemy->absmin,0.5,self->enemy->size,target); + tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,target,self,MASK_OPAQUE); + if (tr.fraction != 1.0) + self->enemy = NULL; + } + } + if (!self->enemy) + { + // find a player - as with target_blaster, search entire entity list so + // we'll pick up fake players representing camera-viewers + for(i=1, player=g_edicts+1; ienemy; i++, player++) { + if (!player->inuse) continue; + if (!player->client) continue; + if (player->svflags & SVF_NOCLIENT) continue; + if ((player->health >= player->gib_health) && !(player->flags & FL_NOTARGET) ) { + VectorMA(player->absmin,0.5,player->size,target); + tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,target,self,MASK_OPAQUE); + if (tr.fraction == 1.0) { + self->enemy = player; + self->spawnflags |= 0x80000001; + count = 8; + } + } + } + } + if (!self->enemy) + { + self->svflags |= SVF_NOCLIENT; + self->nextthink = level.time + FRAMETIME; + return; + } + + self->svflags &= ~SVF_NOCLIENT; + VectorCopy (self->movedir, last_movedir); + VectorMA (self->enemy->absmin, 0.5, self->enemy->size, point); + VectorSubtract (point, self->s.origin, self->movedir); + VectorNormalize (self->movedir); + if (!VectorCompare(self->movedir, last_movedir)) + self->spawnflags |= 0x80000000; + + ignore = self; + VectorCopy (self->s.origin, start); + VectorMA (start, 2048, self->movedir, end); + while(1) + { + tr = gi.trace (start, NULL, NULL, end, ignore, CONTENTS_SOLID|CONTENTS_MONSTER|CONTENTS_DEADMONSTER); + + if (!tr.ent) + break; + + // hurt it if we can + if (tr.ent->takedamage && !self->style) + { + if (!(tr.ent->flags & FL_IMMUNE_LASER) && (self->dmg > 0) ) + T_Damage (tr.ent, self, self->activator, self->movedir, tr.endpos, vec3_origin, self->dmg, 1, DAMAGE_ENERGY, MOD_TARGET_LASER); + else if (self->dmg < 0) + { + tr.ent->health -= self->dmg; + if (tr.ent->health > tr.ent->max_health) + tr.ent->health = tr.ent->max_health; + } + } + + // if we hit something that's not a monster or player or is immune to lasers, we're done + if (!(tr.ent->svflags & SVF_MONSTER) && (!tr.ent->client)) + { + if ((self->spawnflags & 0x80000000) && (self->style != 3)) + { + self->spawnflags &= ~0x80000000; + gi.WriteByte (svc_temp_entity); + gi.WriteByte (TE_LASER_SPARKS); + gi.WriteByte (count); + gi.WritePosition (tr.endpos); + gi.WriteDir (tr.plane.normal); + gi.WriteByte (self->s.skinnum); + gi.multicast (tr.endpos, MULTICAST_PVS); + } + break; + } + + ignore = tr.ent; + VectorCopy (tr.endpos, start); + } + VectorCopy (tr.endpos, self->s.old_origin); + self->nextthink = level.time + FRAMETIME; +} + +void target_laser_ps_on (edict_t *self) +{ + if (!self->activator) + self->activator = self; + + self->spawnflags |= 0x80000001; +// self->svflags &= ~SVF_NOCLIENT; + if (self->wait > 0) + { + self->starttime = level.time + self->wait; + self->endtime = level.time + self->delay; + } + target_laser_ps_think (self); +} + +void target_laser_ps_off (edict_t *self) +{ + self->spawnflags &= ~1; + self->svflags |= SVF_NOCLIENT; + self->nextthink = 0; +} + +void target_laser_ps_use (edict_t *self, edict_t *other, edict_t *activator) +{ + self->activator = activator; + if (self->spawnflags & 1) + { + target_laser_ps_off (self); + self->count--; + if (!self->count) + { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } + } + else + target_laser_ps_on (self); +} + +void target_laser_think (edict_t *self) +{ + edict_t *ignore; + vec3_t start; + vec3_t end; + trace_t tr; + vec3_t point; + vec3_t last_movedir; + int count; + + // DWH + if (self->wait > 0) + { + // pulsed laser + if (level.time >= self->starttime) + { + self->starttime = level.time + self->wait; + self->endtime = level.time + self->delay; + } + else if (level.time >= self->endtime) + { + self->nextthink = level.time + FRAMETIME; + return; + } + } + // end DWH + + if (self->spawnflags & 0x80000000) + count = 8; + else + count = 4; + + if (self->enemy) + { + VectorCopy (self->movedir, last_movedir); + VectorMA (self->enemy->absmin, 0.5, self->enemy->size, point); + VectorSubtract (point, self->s.origin, self->movedir); + VectorNormalize (self->movedir); + if (!VectorCompare(self->movedir, last_movedir)) + self->spawnflags |= 0x80000000; + } + + ignore = self; + VectorCopy (self->s.origin, start); + VectorMA (start, 2048, self->movedir, end); + while(1) + { + tr = gi.trace (start, NULL, NULL, end, ignore, CONTENTS_SOLID|CONTENTS_MONSTER|CONTENTS_DEADMONSTER); + + if (!tr.ent) + break; + + // hurt it if we can + if (tr.ent->takedamage && !self->style) + { + if (!(tr.ent->flags & FL_IMMUNE_LASER) && (self->dmg > 0)) + T_Damage (tr.ent, self, self->activator, self->movedir, tr.endpos, vec3_origin, self->dmg, 1, DAMAGE_ENERGY, MOD_TARGET_LASER); + else if (self->dmg < 0) + { + tr.ent->health -= self->dmg; + if (tr.ent->health > tr.ent->max_health) + tr.ent->health = tr.ent->max_health; + } + } + + // if we hit something that's not a monster or player or is immune to lasers, we're done + if (!(tr.ent->svflags & SVF_MONSTER) && (!tr.ent->client) ) + { + if ((self->spawnflags & 0x80000000) && (self->style != 3)) + { + self->spawnflags &= ~0x80000000; + gi.WriteByte (svc_temp_entity); + gi.WriteByte (TE_LASER_SPARKS); + gi.WriteByte (count); + gi.WritePosition (tr.endpos); + gi.WriteDir (tr.plane.normal); + gi.WriteByte (self->s.skinnum); + gi.multicast (tr.endpos, MULTICAST_PVS); + } + break; + } + + ignore = tr.ent; + VectorCopy (tr.endpos, start); + } + + VectorCopy (tr.endpos, self->s.old_origin); + + self->nextthink = level.time + FRAMETIME; +} + +void target_laser_on (edict_t *self) +{ + if (self->wait > 0) + { + self->starttime = level.time + self->wait; + self->endtime = level.time + self->delay; + } + if (!self->activator) + self->activator = self; + self->spawnflags |= 0x80000001; + self->svflags &= ~SVF_NOCLIENT; + target_laser_think (self); +} + +void target_laser_off (edict_t *self) +{ + self->spawnflags &= ~1; + self->svflags |= SVF_NOCLIENT; + self->nextthink = 0; +} + +void target_laser_use (edict_t *self, edict_t *other, edict_t *activator) +{ + self->activator = activator; + if (self->spawnflags & 1) + { + target_laser_off (self); + self->count--; + if (!self->count) + { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } + } + else + target_laser_on (self); +} + +void target_laser_start (edict_t *self) +{ + edict_t *ent; + + self->movetype = MOVETYPE_NONE; + self->solid = SOLID_NOT; + self->s.renderfx |= RF_BEAM|RF_TRANSLUCENT; + self->s.modelindex = 1; // must be non-zero + + // set the beam diameter + if (self->mass > 1) + self->s.frame = self->mass; + else if (self->spawnflags & 64) + self->s.frame = 16; + else + self->s.frame = 4; + + // set the color + if (self->spawnflags & 2) + self->s.skinnum = 0xf2f2f0f0; + else if (self->spawnflags & 4) + self->s.skinnum = 0xd0d1d2d3; + else if (self->spawnflags & 8) + self->s.skinnum = 0xf3f3f1f1; + else if (self->spawnflags & 16) + self->s.skinnum = 0xdcdddedf; + else if (self->spawnflags & 32) + self->s.skinnum = 0xe0e1e2e3; + + + if (!self->dmg) + self->dmg = 1; + VectorSet (self->mins, -8, -8, -8); + VectorSet (self->maxs, 8, 8, 8); + + // DWH + + // pulsed laser + if (self->wait > 0) + { + if (self->delay >= self->wait) + { + gi.dprintf("target_laser at %s, delay must be < wait.\n", vtos(self->s.origin)); + self->wait = 0; + } + else if (self->delay == 0.) + { + gi.dprintf("target_laser at %s, wait > 0 but delay = 0\n", vtos(self->s.origin)); + self->wait = 0; + } + } + + if (self->spawnflags & 128) + { + // player-seeking laser + self->enemy = NULL; + self->use = target_laser_ps_use; + self->think = target_laser_ps_think; + gi.linkentity(self); + if (self->spawnflags & 1) + target_laser_ps_on(self); + else + target_laser_ps_off(self); + return; + } + // end DWH + + if (!self->enemy) + { + if (self->target) + { + ent = G_Find (NULL, FOFS(targetname), self->target); + if (!ent) + gi.dprintf ("%s at %s: %s is a bad target\n", self->classname, vtos(self->s.origin), self->target); + self->enemy = ent; + } + else + { + G_SetMovedir (self->s.angles, self->movedir); + } + } + self->use = target_laser_use; + self->think = target_laser_think; + + gi.linkentity (self); + + if (self->spawnflags & 1) + target_laser_on (self); + else + target_laser_off (self); +} + +void SP_target_laser (edict_t *self) +{ + // let everything else get spawned before we start firing + self->think = target_laser_start; + self->nextthink = level.time + 1; +} + +//========================================================== + +/*QUAKED target_lightramp (0 .5 .8) (-8 -8 -8) (8 8 8) TOGGLE +speed How many seconds the ramping will take +message two letters; starting lightlevel and ending lightlevel +*/ + +#define LIGHTRAMP_TOGGLE 1 +#define LIGHTRAMP_CUSTOM 2 +#define LIGHTRAMP_LOOP 4 +#define LIGHTRAMP_ACTIVE 128 + +void target_lightramp_think (edict_t *self) +{ + char style[2]; + + if (self->spawnflags & LIGHTRAMP_CUSTOM) { + if (self->movedir[2] > 0) + style[0] = self->message[(int)self->movedir[0]]; + else + style[0] = self->message[(int)(self->movedir[1]-self->movedir[0])]; + self->movedir[0]++; + } else { + style[0] = 'a' + self->movedir[0] + (level.time - self->timestamp) / FRAMETIME * self->movedir[2]; + } + style[1] = 0; + gi.configstring (CS_LIGHTS+self->enemy->style, style); + + if (self->spawnflags & LIGHTRAMP_CUSTOM) { + if ((self->movedir[0] <= self->movedir[1]) || + ((self->spawnflags & LIGHTRAMP_LOOP) && (self->spawnflags & LIGHTRAMP_ACTIVE)) ) { + self->nextthink = level.time + FRAMETIME; + if (self->movedir[0] > self->movedir[1]) { + self->movedir[0] = 0; + if (self->spawnflags & LIGHTRAMP_TOGGLE) + self->movedir[2] *= -1; + } + } else { + self->movedir[0] = 0; + if (self->spawnflags & LIGHTRAMP_TOGGLE) + self->movedir[2] *= -1; + + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } + } + } else { + if ( (level.time - self->timestamp) < self->speed) { + self->nextthink = level.time + FRAMETIME; + } else if (self->spawnflags & LIGHTRAMP_TOGGLE) { + char temp; + + temp = self->movedir[0]; + self->movedir[0] = self->movedir[1]; + self->movedir[1] = temp; + self->movedir[2] *= -1; + if ( (self->spawnflags & LIGHTRAMP_LOOP) && (self->spawnflags & LIGHTRAMP_ACTIVE) ) { + self->timestamp = level.time; + self->nextthink = level.time + FRAMETIME; + } + } else if ((self->spawnflags & LIGHTRAMP_LOOP) && (self->spawnflags & LIGHTRAMP_ACTIVE)) { + // Not toggled, looping. Start sequence over + self->timestamp = level.time; + self->nextthink = level.time + FRAMETIME; + } else { + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } + } + } +} + +void target_lightramp_use (edict_t *self, edict_t *other, edict_t *activator) +{ + if (self->spawnflags & LIGHTRAMP_LOOP) { + if (self->spawnflags & LIGHTRAMP_ACTIVE) { + self->spawnflags &= ~LIGHTRAMP_ACTIVE; // already on, turn it off + target_lightramp_think(self); + return; + } else { + self->spawnflags |= LIGHTRAMP_ACTIVE; + } + } + + if (!self->enemy) + { + edict_t *e; + + // check all the targets + e = NULL; + while (1) + { + e = G_Find (e, FOFS(targetname), self->target); + if (!e) + break; + if (strcmp(e->classname, "light") != 0) + { + gi.dprintf("%s at %s ", self->classname, vtos(self->s.origin)); + gi.dprintf("target %s (%s at %s) is not a light\n", self->target, e->classname, vtos(e->s.origin)); + } + else + { + self->enemy = e; + } + } + + if (!self->enemy) + { + gi.dprintf("%s target %s not found at %s\n", self->classname, self->target, vtos(self->s.origin)); + G_FreeEdict (self); + return; + } + } + + self->timestamp = level.time; + target_lightramp_think (self); +} + +void SP_target_lightramp (edict_t *self) +{ + // DWH: CUSTOM spawnflag allows custom light switching, speed is ignored + if (self->spawnflags & LIGHTRAMP_CUSTOM) { + if (!self->message || strlen(self->message) < 2) { + gi.dprintf("custom target_lightramp has bad ramp (%s) at %s\n", self->message, vtos(self->s.origin)); + G_FreeEdict (self); + return; + } + } else { + if (!self->message || strlen(self->message) != 2 || self->message[0] < 'a' || self->message[0] > 'z' || self->message[1] < 'a' || self->message[1] > 'z' || self->message[0] == self->message[1]) + { + gi.dprintf("target_lightramp has bad ramp (%s) at %s\n", self->message, vtos(self->s.origin)); + G_FreeEdict (self); + return; + } + } + + if (deathmatch->value) + { + G_FreeEdict (self); + return; + } + + if (!self->target) + { + gi.dprintf("%s with no target at %s\n", self->classname, vtos(self->s.origin)); + G_FreeEdict (self); + return; + } + + self->svflags |= SVF_NOCLIENT; + self->use = target_lightramp_use; + self->think = target_lightramp_think; + + if (self->spawnflags & LIGHTRAMP_CUSTOM) { + self->movedir[0] = 0; // index into message + self->movedir[1] = strlen(self->message)-1; // position of last character + self->movedir[2] = 1; // direction = start->end + } else { + self->movedir[0] = self->message[0] - 'a'; + self->movedir[1] = self->message[1] - 'a'; + self->movedir[2] = (self->movedir[1] - self->movedir[0]) / (self->speed / FRAMETIME); + } + + self->spawnflags &= ~LIGHTRAMP_ACTIVE; // not currently on +} + +//========================================================== + +/*QUAKED target_earthquake (1 0 0) (-8 -8 -8) (8 8 8) +When triggered, this initiates a level-wide earthquake. +All players and monsters are affected. +"speed" severity of the quake (default:200) +"count" duration of the quake (default:5) +*/ + +void target_earthquake_think (edict_t *self) +{ + int i; + edict_t *e; + + if (self->last_move_time < level.time) + { + gi.positioned_sound (self->s.origin, self, CHAN_AUTO, self->noise_index, 1.0, ATTN_NONE, 0); + self->last_move_time = level.time + 0.5; + } + + for (i=1, e=g_edicts+i; i < globals.num_edicts; i++,e++) + { + if (!e->inuse) + continue; + if (!e->client) + continue; + if (!e->groundentity) + continue; + // Lazarus: special case for tracktrain riders - + // earthquakes hurt 'em too bad, so don't shake 'em + if ((e->groundentity->flags & FL_TRACKTRAIN) && (e->groundentity->moveinfo.state)) + continue; + e->groundentity = NULL; + e->velocity[0] += crandom()* 150; + e->velocity[1] += crandom()* 150; + e->velocity[2] = self->speed * (100.0 / e->mass); + } + + if (level.time < self->timestamp) + self->nextthink = level.time + FRAMETIME; +} + +void target_earthquake_use (edict_t *self, edict_t *other, edict_t *activator) +{ + self->timestamp = level.time + self->count; + self->nextthink = level.time + FRAMETIME; + self->activator = activator; + self->last_move_time = 0; +} + +void SP_target_earthquake (edict_t *self) +{ + if (!self->targetname) + gi.dprintf("untargeted %s at %s\n", self->classname, vtos(self->s.origin)); + + if (!self->count) + self->count = 5; + + if (!self->speed) + self->speed = 200; + + self->svflags |= SVF_NOCLIENT; + self->think = target_earthquake_think; + self->use = target_earthquake_use; + + self->noise_index = gi.soundindex ("world/quake.wav"); +} + +// DWH +// +// Tremor stuff follows +// +// +// target_locator can be used to move entities to a random selection +// from a series of path_corners. Move takes place at level start ONLY. +// +void target_locator_init(edict_t *self) +{ + int num_points=0; + int i, N, nummoves; + qboolean looped; + edict_t *tgt0, *tgtlast, *target, *next; + edict_t *move; + + move = NULL; + move = G_Find(move,FOFS(targetname),self->target); + + if (!move) + { + gi.dprintf("Target of target_locator (%s) not found.\n", + self->target); + G_FreeEdict(self); + return; + } + target = G_Find(NULL,FOFS(targetname),self->pathtarget); + if (!target) + { + gi.dprintf("Pathtarget of target_locator (%s) not found.\n", + self->pathtarget); + G_FreeEdict(self); + return; + } + + srand(time(NULL)); + tgt0 = target; + next = NULL; + target->spawnflags &= 0x7FFE; + while(next != tgt0) + { + if (target->target) + { + next = G_Find(NULL,FOFS(targetname),target->target); + if ((!next) || (next==tgt0)) tgtlast = target; + if (!next) + { + gi.dprintf("Target %s of path_corner at %s not found.\n", + target->target,vtos(target->s.origin)); + break; + } + target = next; + target->spawnflags &= 0x7FFE; + num_points++; + } + else + { + next = tgt0; + tgtlast = target; + } + } + if (!num_points) num_points=1; + + nummoves = 1; + while(move) + { + if (nummoves > num_points) break; // more targets than path_corners + + N = rand() % num_points; + i = 0; + next = tgt0; + looped = false; + while(i<=N) + { + target = next; + if (!(target->spawnflags & 1)) i++; + if (target==tgtlast) + { + // We've looped thru all path_corners, but not + // reached the target number yet. This can only + // happen in the case of multiple targets. Use the + // next available path_corner. + looped = true; + } + if (looped && !(target->spawnflags & 1)) i = N+1; + next = G_Find(NULL,FOFS(targetname),target->target); + } + target->spawnflags |= 1; + + // Assumptions here: SOLID_BSP entities are assumed to be brush models, + // all others are point ents + if (move->solid == SOLID_BSP) + { + vec3_t origin; + VectorAdd(move->absmin,move->absmax,origin); + VectorScale(origin,0.5,origin); + VectorSubtract(target->s.origin,origin,move->s.origin); + } + else { + VectorCopy(target->s.origin,move->s.origin); + VectorCopy(target->s.angles,move->s.angles); + } + M_droptofloor(move); + gi.linkentity(move); + move = G_Find(move,FOFS(targetname),self->target); + nummoves++; + } + // All done, go away + G_FreeEdict(self); +} +void SP_target_locator(edict_t *self) +{ + if (!self->target) + { + gi.dprintf("target_locator w/o target at %s\n",vtos(self->s.origin)); + G_FreeEdict(self); + return; + } + if (!self->pathtarget) + { + gi.dprintf("target_locator w/o pathtarget at %s\n",vtos(self->s.origin)); + G_FreeEdict(self); + return; + } + self->think = target_locator_init; + self->nextthink = level.time + 2*FRAMETIME; + gi.linkentity(self); +} + +// +// TARGET_ANGER +// +// target Monster(s) to make angry +// killtarget Entity to get angry at +// pathtarget Entity to run to +// Spawnflags: +// HOLD (16) Stand in place +// BRUTAL (32) Gib killtarget + +void use_target_anger(edict_t *self, edict_t *other, edict_t *activator) +{ + edict_t *kill_me, *movetarget; + edict_t *t; + vec3_t vec; + float dist, best_dist; + edict_t *best_target; + + if (self->pathtarget) + movetarget = G_PickTarget(self->pathtarget); + else + movetarget = NULL; + + if (self->target) + { + t = NULL; + while ((t = G_Find (t, FOFS(targetname), self->target))) + { + if (t == self) + { + gi.dprintf ("WARNING: entity used itself.\n"); + } + else + { + if (t->use) + { + if (t->health < 0) + return; + if (self->movedir[2] > 0) + { + t->velocity[0] = self->movedir[0] * self->speed; + t->velocity[1] = self->movedir[1] * self->speed; + if (t->groundentity) + { + t->groundentity = NULL; + t->velocity[2] = self->movedir[2]; + if (t->monsterinfo.aiflags & AI_ACTOR) + gi.sound (self, CHAN_VOICE, t->actor_sound_index[0], 1, ATTN_NORM, 0); + } + } + if (self->killtarget) + { + kill_me = G_Find(NULL, FOFS(targetname), self->killtarget); + if (kill_me) + { + best_dist = 9000.; + best_target = NULL; + if (kill_me->health > 0) + { + VectorSubtract(kill_me->s.origin,t->s.origin,vec); + best_dist = VectorLength(vec); + best_target = kill_me; + } + while (kill_me) + { + kill_me = G_Find(kill_me, FOFS(targetname), self->killtarget); + if (!kill_me) + break; + if (!kill_me->inuse) + continue; + if (kill_me->health <= 0) + continue; + VectorSubtract(kill_me->s.origin,t->s.origin,vec); + dist = VectorLength(vec); + if (dist < best_dist) + { + best_dist = dist; + best_target = kill_me; + } + } + kill_me = best_target; + } + } + if (kill_me) + { + // Make whatever a "good guy" so the monster will try to kill it! + kill_me->monsterinfo.aiflags |= AI_GOOD_GUY; + t->enemy = t->goalentity = kill_me; + t->monsterinfo.aiflags |= AI_TARGET_ANGER; + if (movetarget) + t->movetarget = movetarget; + FoundTarget (t); + } + else + { + t->monsterinfo.pausetime = 0; + t->goalentity = t->movetarget = movetarget; + } + + if ((self->spawnflags & 16) && !(t->flags & (FL_SWIM|FL_FLY))) + { + t->monsterinfo.pausetime = level.time + 100000000; + t->monsterinfo.aiflags |= AI_STAND_GROUND; + t->monsterinfo.stand (t); + } + if (self->spawnflags & 32) + t->monsterinfo.aiflags |= AI_BRUTAL; + } + } + if (!self->inuse) + { + gi.dprintf("entity was removed while using targets\n"); + return; + } + } + } + + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } + +} + +void SP_target_anger(edict_t *self) +{ + if (deathmatch->value) { + G_FreeEdict(self); + return; + } + if (!self->target) { + gi.dprintf("target_anger with no target set at %s\n",vtos(self->s.origin)); + G_FreeEdict(self); + return; + } + if (!self->killtarget && !self->pathtarget) { + gi.dprintf("target_anger with no killtarget or\npathtarget set at %s\n",vtos(self->s.origin)); + G_FreeEdict(self); + return; + } + // pathtarget is incompatible with HOLD SF + if (self->pathtarget && (self->spawnflags & 16)) + { + gi.dprintf("target anger at %s,\npathtarget is incompatible with HOLD\n", + vtos(self->s.origin)); + self->spawnflags &= ~16; + } + + G_SetMovedir (self->s.angles, self->movedir); + self->movedir[2] = st.height; + self->use = use_target_anger; +} + +// target_monsterbattle serves the same purpose as target_anger, but +// ends up turning a dmgteam group of monsters against another dmgteam + +void use_target_monsterbattle(edict_t *self, edict_t *other, edict_t *activator) +{ + edict_t *grouch, *grouchmate; + edict_t *target, *targetmate; + + grouch = G_Find(NULL,FOFS(targetname),self->target); + if (!grouch) return; + if (!grouch->inuse) return; + target = G_Find(NULL,FOFS(targetname),self->killtarget); + if (!target) return; + if (!target->inuse) return; + if (grouch->dmgteam) { + grouchmate = G_Find(NULL,FOFS(dmgteam),grouch->dmgteam); + while(grouchmate) { + grouchmate->monsterinfo.aiflags |= AI_FREEFORALL; + grouchmate = G_Find(grouchmate,FOFS(dmgteam),grouch->dmgteam); + } + } + if (target->dmgteam) { + targetmate = G_Find(NULL,FOFS(dmgteam),target->dmgteam); + while(targetmate) { + targetmate->monsterinfo.aiflags |= AI_FREEFORALL; + targetmate = G_Find(targetmate,FOFS(dmgteam),target->dmgteam); + } + } + grouch->enemy = target; + grouch->monsterinfo.aiflags |= AI_TARGET_ANGER; + FoundTarget(grouch); + + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } +} +void SP_target_monsterbattle(edict_t *self) +{ + if (deathmatch->value) { + G_FreeEdict(self); + return; + } + if (!self->target) { + gi.dprintf("target_monsterbattle with no target set at %s\n",vtos(self->s.origin)); + G_FreeEdict(self); + return; + } + if (!self->killtarget) { + gi.dprintf("target_monsterbattle with no killtarget set at %s\n",vtos(self->s.origin)); + G_FreeEdict(self); + return; + } + self->use = use_target_monsterbattle; +} + +/*==================================================================================== + TARGET_ROCKS +======================================================================================*/ +void directed_debris_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) +{ + G_FreeEdict (self); +} +void FadeDieThink(edict_t *); +void ThrowRock (edict_t *self, char *modelname, float speed, vec3_t origin, vec3_t size, int mass) +{ + edict_t *chunk; + vec_t var = speed/5; + + chunk = G_Spawn(); + VectorCopy (origin, chunk->s.origin); + gi.setmodel (chunk, modelname); + VectorCopy(size,chunk->maxs); + VectorScale(chunk->maxs,0.5,chunk->maxs); + VectorNegate(chunk->maxs,chunk->mins); + chunk->velocity[0] = speed * self->movedir[0] + var * crandom(); + chunk->velocity[1] = speed * self->movedir[1] + var * crandom(); + chunk->velocity[2] = speed * self->movedir[2] + var * crandom(); + chunk->movetype = MOVETYPE_DEBRIS; + chunk->attenuation = 0.5; + chunk->solid = SOLID_NOT; + chunk->avelocity[0] = random()*600; + chunk->avelocity[1] = random()*600; + chunk->avelocity[2] = random()*600; + chunk->think = FadeDieThink; + chunk->nextthink = level.time + 15 + random()*5; + chunk->s.frame = 0; + chunk->flags = 0; + chunk->classname = "debris"; + chunk->takedamage = DAMAGE_YES; + chunk->die = directed_debris_die; + chunk->mass = mass; + gi.linkentity (chunk); +} + +void use_target_rocks (edict_t *self, edict_t *other, edict_t *activator) +{ + vec3_t chunkorigin; + vec3_t size, source; + vec_t mass; + int count; + char modelname[64]; + + VectorSet(source,8,8,8); + mass = self->mass; + // big chunks + if (mass >= 100) + { + sprintf(modelname,"models/objects/rock%d/tris.md2",self->style*2+1); + count = mass / 100; + if (count > 16) + count = 16; + VectorSet(size,8,8,8); + while(count--) + { + chunkorigin[0] = self->s.origin[0] + crandom() * source[0]; + chunkorigin[1] = self->s.origin[1] + crandom() * source[1]; + chunkorigin[2] = self->s.origin[2] + crandom() * source[2]; + ThrowRock (self, modelname, self->speed, chunkorigin, size, 100); + } + } + // small chunks + count = mass / 25; + sprintf(modelname,"models/objects/rock%d/tris.md2",self->style*2+2); + if (count > 16) + count = 16; + VectorSet(size,4,4,4); + while(count--) + { + chunkorigin[0] = self->s.origin[0] + crandom() * source[0]; + chunkorigin[1] = self->s.origin[1] + crandom() * source[1]; + chunkorigin[2] = self->s.origin[2] + crandom() * source[2]; + ThrowRock (self, modelname, self->speed, chunkorigin, size, 25); + } + if (self->dmg) + T_RadiusDamage (self, activator, self->dmg, NULL, self->dmg+40, MOD_SPLASH, -0.5); + + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } + +} + +void SP_target_rocks (edict_t *self) +{ + gi.modelindex ("models/objects/rock1/tris.md2"); + gi.modelindex ("models/objects/rock2/tris.md2"); + if (!self->speed) + self->speed = 400; + if (!self->mass) + self->mass = 500; + self->use = use_target_rocks; + G_SetMovedir (self->s.angles, self->movedir); + self->svflags = SVF_NOCLIENT; +} + +/*==================================================================================== + TARGET_ROTATION +======================================================================================*/ + +void use_target_rotation (edict_t *self, edict_t *other, edict_t *activator) +{ + edict_t *target; + int i, pick; + char *p1, *p2; + char targetname[256]; + + if (self->spawnflags & 2) { + // random pick + pick = self->sounds * random(); + if (pick == self->sounds) pick--; + } else { + pick = self->mass; + if (pick == self->sounds) { + if (self->spawnflags & 1) // no loop + return; + else + pick = 0; + } + self->mass = pick+1; + } + p1 = self->target; + p2 = targetname; + memset(targetname,0,sizeof(targetname)); + // skip over pick commas + for(i=0; iinuse && target->use) + target->use(target,other,activator); + target = G_Find(target,FOFS(targetname),targetname); + } + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } +} + +void SP_target_rotation (edict_t *self) +{ + char *p; + + if (!self->target) { + gi.dprintf("target_rotation without a target at %s\n",vtos(self->s.origin)); + G_FreeEdict(self); + return; + } + if ( (self->spawnflags & 3) == 3) { + gi.dprintf("target_rotation at %s: NO_LOOP and RANDOM are mutually exclusive.\n"); + self->spawnflags = 2; + } + self->use = use_target_rotation; + self->svflags = SVF_NOCLIENT; + self->mass = 0; // index of currently selected target + self->sounds = 0; // number of comma-delimited targets in target string + p = self->target; + while( (p = strstr(p,",")) != NULL) { + self->sounds++; + p++; + } + self->sounds++; +} + +/*==================================================================================== + TARGET_EFFECT +======================================================================================*/ + +/* Unknowns or not supported +TE_FLAME, 32 Rogue flamethrower, never implemented +TE_FORCEWALL, 37 ?? +*/ + +//========================================================================= +/* Spawns an effect at the entity origin + TE_FLASHLIGHT 36 +*/ +void target_effect_at (edict_t *self, edict_t *activator) +{ + gi.WriteByte (svc_temp_entity); + gi.WriteByte (self->style); + gi.WritePosition (self->s.origin); + gi.WriteShort (self - g_edicts); + gi.multicast (self->s.origin, MULTICAST_PVS); +} +/* Poor man's target_steam + TE_STEAM 40 +*/ +void target_effect_steam (edict_t *self, edict_t *activator) +{ + static int nextid; + int wait; + + if (self->wait) + wait = self->wait*1000; + else + wait = 0; + + if (nextid > 20000) + nextid = nextid %20000; + nextid++; + + gi.WriteByte (svc_temp_entity); + gi.WriteByte (self->style); + gi.WriteShort (nextid); + gi.WriteByte (self->count); + gi.WritePosition (self->s.origin); + gi.WriteDir (self->movedir); + gi.WriteByte (self->sounds&0xff); + gi.WriteShort ( (int)(self->speed) ); + gi.WriteLong ( (int)(wait) ); + gi.multicast (self->s.origin, MULTICAST_PVS); + + if (level.num_reflectors) + ReflectSteam (self->s.origin,self->movedir,self->count,self->sounds,(int)(self->speed),wait,nextid); +} + +//========================================================================= +/* +Spawns (style) Splash with (count) particles of (sounds) color at (origin) +moving in (movedir) direction. + + TE_SPLASH 10 Randomly shaded shower of particles + TE_LASER_SPARKS 15 Splash particles obey gravity + TE_WELDING_SPARKS 25 Splash particles with flash of light at {origin} +*/ +//========================================================================= +void target_effect_splash (edict_t *self, edict_t *activator) +{ + gi.WriteByte(svc_temp_entity); + gi.WriteByte(self->style); + gi.WriteByte(self->count); + gi.WritePosition(self->s.origin); + gi.WriteDir(self->movedir); + gi.WriteByte(self->sounds); + gi.multicast(self->s.origin, MULTICAST_PVS); +} + +//====================================================== +/* +Spawns a trail of (type) from (start) to (end) and Broadcasts to all +in Potentially Visible Set from vector (origin) + + TE_RAILTRAIL 3 Spawns a blue spiral trail filled with white smoke + TE_BUBBLETRAIL 11 Spawns a trail of bubbles + TE_PARASITE_ATTACK 16 + TE_MEDIC_CABLE_ATTACK 19 + TE_BFG_LASER 23 Spawns a green laser + TE_GRAPPLE_CABLE 24 + TE_RAILTRAIL2 31 NOT IMPLEMENTED IN ENGINE + TE_DEBUGTRAIL 34 + TE_HEATBEAM, 38 Requires Rogue model + TE_MONSTER_HEATBEAM, 39 Requires Rogue model + TE_BUBBLETRAIL2 41 +*/ +//====================================================== +void target_effect_trail (edict_t *self, edict_t *activator) +{ + edict_t *target; + + if (!self->target) return; + target = G_Find(NULL,FOFS(targetname),self->target); + if (!target) return; + + gi.WriteByte(svc_temp_entity); + gi.WriteByte(self->style); + if ((self->style == TE_PARASITE_ATTACK) || (self->style==TE_MEDIC_CABLE_ATTACK) || + (self->style == TE_HEATBEAM) || (self->style==TE_MONSTER_HEATBEAM) || + (self->style == TE_GRAPPLE_CABLE) ) + gi.WriteShort(self-g_edicts); + gi.WritePosition(self->s.origin); + gi.WritePosition(target->s.origin); + if (self->style == TE_GRAPPLE_CABLE) { + gi.WritePosition(vec3_origin); + } + gi.multicast(self->s.origin, MULTICAST_PVS); + + if (level.num_reflectors) + { + if ((self->style == TE_RAILTRAIL) || (self->style == TE_BUBBLETRAIL) || + (self->style == TE_BFG_LASER) || (self->style == TE_DEBUGTRAIL) || + (self->style == TE_BUBBLETRAIL2)) + ReflectTrail(self->style,self->s.origin,target->s.origin); + } +} +//=========================================================================== +/* TE_LIGHTNING 33 Lightning bolt + + Similar but slightly different syntax to trail stuff */ +void target_effect_lightning(edict_t *self, edict_t *activator) +{ + edict_t *target; + + if (!self->target) return; + target = G_Find(NULL,FOFS(targetname),self->target); + if (!target) return; + + gi.WriteByte (svc_temp_entity); + gi.WriteByte (self->style); + gi.WriteShort (target - g_edicts); // destination entity + gi.WriteShort (self - g_edicts); // source entity + gi.WritePosition (target->s.origin); + gi.WritePosition (self->s.origin); + gi.multicast (self->s.origin, MULTICAST_PVS); +} +//=========================================================================== +/* +Spawns sparks of (type) from (start) in direction of (movdir) and +Broadcasts to all in Potentially Visible Set from vector (origin) + + TE_GUNSHOT 0 Spawns a grey splash of particles, with a bullet puff + TE_BLOOD 1 Spawns a spurt of red blood + TE_BLASTER 2 Spawns a blaster sparks + TE_SHOTGUN 4 Spawns a small grey splash of spark particles, with a bullet puff + TE_SPARKS 9 Spawns a red/gold splash of spark particles + TE_SCREEN_SPARKS 12 Spawns a large green/white splash of sparks + TE_SHIELD_SPARKS 13 Spawns a large blue/violet splash of sparks + TE_BULLET_SPARKS 14 Same as TE_SPARKS, with a bullet puff and richochet sound + TE_GREENBLOOD 26 Spurt of green (actually kinda yellow) blood + TE_BLUEHYPERBLASTER 27 NOT IMPLEMENTED + TE_BLASTER2 30 Green/white sparks with a yellow/white flash + TE_MOREBLOOD 42 + TE_HEATBEAM_SPARKS 43 + TE_HEATBEAM_STEAM 44 + TE_CHAINFIST_SMOKE 45 + TE_ELECTRIC_SPARKS 46 + TE_FLECHETTE 55 +*/ +//====================================================== +void target_effect_sparks (edict_t *self, edict_t *activator) +{ + gi.WriteByte(svc_temp_entity); + gi.WriteByte(self->style); + gi.WritePosition(self->s.origin); + if (self->style != TE_CHAINFIST_SMOKE) + gi.WriteDir(self->movedir); + gi.multicast(self->s.origin, MULTICAST_PVS); + + if (level.num_reflectors) + ReflectSparks(self->style,self->s.origin,self->movedir); +} + +//====================================================== +/* +Spawns a (type) effect at (start} and Broadcasts to all in the +Potentially Hearable set from vector (origin) + + TE_EXPLOSION1 5 airburst + TE_EXPLOSION2 6 ground burst + TE_ROCKET_EXPLOSION 7 rocket explosion + TE_GRENADE_EXPLOSION 8 grenade explosion + TE_ROCKET_EXPLOSION_WATER 17 underwater rocket explosion + TE_GRENADE_EXPLOSION_WATER 18 underwater grenade explosion + TE_BFG_EXPLOSION 20 BFG explosion sprite + TE_BFG_BIGEXPLOSION 21 BFG particle explosion + TE_BOSSTPORT 22 + TE_PLASMA_EXPLOSION 28 + TE_PLAIN_EXPLOSION 35 + TE_TRACKER_EXPLOSION 47 + TE_TELEPORT_EFFECT 48 + TE_DBALL_GOAL 49 Identical to TE_TELEPORT_EFFECT? + TE_NUKEBLAST 51 + TE_WIDOWSPLASH 52 + TE_EXPLOSION1_BIG 53 Works, but requires Rogue models/objects/r_explode2 + TE_EXPLOSION1_NP 54 +*/ +//============================================================================== +void target_effect_explosion (edict_t *self, edict_t *activator) +{ + gi.WriteByte(svc_temp_entity); + gi.WriteByte(self->style); + gi.WritePosition(self->s.origin); + gi.multicast(self->s.origin, MULTICAST_PHS); + + if (level.num_reflectors) + ReflectExplosion (self->style, self->s.origin); + +} +//=============================================================================== +/* TE_TUNNEL_SPARKS 29 + Similar to other splash effects, but Xatrix does some funky things with + the origin so we'll do the same */ + +void target_effect_tunnel_sparks (edict_t *self, edict_t *activator) +{ + vec3_t origin; + int i; + + VectorCopy(self->s.origin,origin); + for (i=0; icount; i++) + { + origin[2] += (self->speed * 0.01) * (i + random()); + gi.WriteByte (svc_temp_entity); + gi.WriteByte (self->style); + gi.WriteByte (1); + gi.WritePosition (origin); + gi.WriteDir (vec3_origin); + gi.WriteByte (self->sounds + (rand()&7)); // color + gi.multicast (self->s.origin, MULTICAST_PVS); + } +} +//=============================================================================== +/* TE_WIDOWBEAMOUT 50 +*/ +void target_effect_widowbeam(edict_t *self, edict_t *activator) +{ + gi.WriteByte (svc_temp_entity); + gi.WriteByte (TE_WIDOWBEAMOUT); + gi.WriteShort (20001); + gi.WritePosition (self->s.origin); + gi.multicast (self->s.origin, MULTICAST_PVS); +} +//=============================================================================== + +void target_effect_use(edict_t *self, edict_t *other, edict_t *activator) +{ + if (self->spawnflags & 1) { + // currently looped on - turn it off + self->spawnflags &= ~1; + self->spawnflags |= 2; + self->nextthink = 0; + return; + } + if (self->spawnflags & 2) { + // currently looped off - turn it on + self->spawnflags &= ~2; + self->spawnflags |= 1; + self->nextthink = level.time + self->wait; + } + if (self->spawnflags & 4) { + // "if_moving" set. If movewith target isn't moving, + // don't play + edict_t *mover; + if (!self->movewith) return; + mover = G_Find(NULL,FOFS(targetname),self->movewith); + if (!mover) return; + if (!VectorLength(mover->velocity)) return; + } + self->play(self,activator); +} +void target_effect_think(edict_t *self) +{ + self->play(self,NULL); + self->nextthink = level.time + self->wait; +} +//=============================================================================== +void SP_target_effect (edict_t *self) +{ + if (self->movewith) + self->movetype = MOVETYPE_PUSH; + else + self->movetype = MOVETYPE_NONE; + + switch (self->style ) { + case TE_FLASHLIGHT: + self->play = target_effect_at; + break; + case TE_STEAM: + self->play = target_effect_steam; + G_SetMovedir (self->s.angles, self->movedir); + if (!self->count) + self->count = 32; + if (!self->sounds) + self->sounds = 8; + if (!self->speed) + self->speed = 75; + break; + case TE_SPLASH: + case TE_LASER_SPARKS: + case TE_WELDING_SPARKS: + self->play = target_effect_splash; + G_SetMovedir (self->s.angles, self->movedir); + if (!self->count) + self->count = 32; + break; + case TE_RAILTRAIL: + case TE_BUBBLETRAIL: + case TE_PARASITE_ATTACK: + case TE_MEDIC_CABLE_ATTACK: + case TE_BFG_LASER: + case TE_GRAPPLE_CABLE: + case TE_DEBUGTRAIL: + case TE_HEATBEAM: + case TE_MONSTER_HEATBEAM: + case TE_BUBBLETRAIL2: + if (!self->target) { + gi.dprintf("%s at %s with style=%d needs a target\n",self->classname,vtos(self->s.origin),self->style); + G_FreeEdict(self); + } else + self->play = target_effect_trail; + break; + case TE_LIGHTNING: + if (!self->target) { + gi.dprintf("%s at %s with style=%d needs a target\n",self->classname,vtos(self->s.origin),self->style); + G_FreeEdict(self); + } else + self->play = target_effect_lightning; + break; + case TE_GUNSHOT: + case TE_BLOOD: + case TE_BLASTER: + case TE_SHOTGUN: + case TE_SPARKS: + case TE_SCREEN_SPARKS: + case TE_SHIELD_SPARKS: + case TE_BULLET_SPARKS: + case TE_GREENBLOOD: + case TE_BLASTER2: + case TE_MOREBLOOD: + case TE_HEATBEAM_SPARKS: + case TE_HEATBEAM_STEAM: + case TE_CHAINFIST_SMOKE: + case TE_ELECTRIC_SPARKS: + case TE_FLECHETTE: + self->play = target_effect_sparks; + G_SetMovedir (self->s.angles, self->movedir); + break; + case TE_EXPLOSION1: + case TE_EXPLOSION2: + case TE_ROCKET_EXPLOSION: + case TE_GRENADE_EXPLOSION: + case TE_ROCKET_EXPLOSION_WATER: + case TE_GRENADE_EXPLOSION_WATER: + case TE_BFG_EXPLOSION: + case TE_BFG_BIGEXPLOSION: + case TE_BOSSTPORT: + case TE_PLASMA_EXPLOSION: + case TE_PLAIN_EXPLOSION: + case TE_TRACKER_EXPLOSION: + case TE_TELEPORT_EFFECT: + case TE_DBALL_GOAL: + case TE_NUKEBLAST: + case TE_WIDOWSPLASH: + case TE_EXPLOSION1_BIG: + case TE_EXPLOSION1_NP: + self->play = target_effect_explosion; + break; + case TE_TUNNEL_SPARKS: + if (!self->count) + self->count = 32; + if (!self->sounds) + self->sounds = 116; // Light blue, same color used by Xatrix + self->play = target_effect_tunnel_sparks; + break; + case TE_WIDOWBEAMOUT: + self->play = target_effect_widowbeam; + G_SetMovedir (self->s.angles, self->movedir); + break; + default: + gi.dprintf("%s at %s: bad style %d\n",self->classname,vtos(self->s.origin),self->style); + } + self->use = target_effect_use; + self->think = target_effect_think; + if (self->spawnflags & 1) + self->nextthink = level.time + 1; + +} + +/*===================================================================================== + TARGET_ATTRACTOR - pulls target entity towards its origin + target - Targetname of entity to attract. Ignored if PLAYER spawnflag is set + pathtarget - Entity or entities to "use" when distance criteria is met. + speed - Minimum speed to pull target with. Must use a value > sv_gravity/10 + to overcome gravity when pulling up. + distance - When target is within "distance" units of target_attractor, attraction + is shut off. Use a value < 0 to hold target in place. 0 will be reset + to 1. + sounds - effect to use. ONLY VALID for PLAYER or MONSTER, not target. If sounds + is non-zero, SINGLE_TARGET and SIGHT are automatically set + 0 = none + 1 = medic cable + 2 = green laser + + Spawnflags: 1 - START_ON + 2 - PLAYER (attract player, ignore "target" + 4 - NO_GRAVITY - turns off gravity for target. W/O this flag you'll + get an annoying jitter when pulling players up. + 8 - MONSTER - attract ALL monsters, ignore "target" + 16 - SIGHT - must have LOS to target to attract it + 32 - SINGLE_TARGET - will select best target + 64 - PATHTARGET_FIRE - used internally only +=======================================================================================*/ +#define ATTRACTOR_ON 1 +#define ATTRACTOR_PLAYER 2 +#define ATTRACTOR_NO_GRAVITY 4 +#define ATTRACTOR_MONSTER 8 +#define ATTRACTOR_SIGHT 16 +#define ATTRACTOR_SINGLE 32 +#define ATTRACTOR_PATHTARGET 64 + +void target_attractor_think_single(edict_t *self) +{ + edict_t *ent, *target, *previous_target; + trace_t tr; + vec3_t dir, targ_org; + vec_t dist, speed; + vec_t best_dist; + vec3_t forward, right; + int i; + int num_targets = 0; + + if (!self->spawnflags & ATTRACTOR_ON) return; + + previous_target = self->target_ent; + target = NULL; + best_dist = 8192; + + if (self->spawnflags & ATTRACTOR_PLAYER) { + for(i=1, ent=&g_edicts[i]; i<=game.maxclients; i++, ent++) { + if (!ent->inuse) continue; + if (ent->health <= 0) continue; + num_targets++; + VectorSubtract(self->s.origin,ent->s.origin,dir); + dist = VectorLength(dir); + if (dist > self->moveinfo.distance) continue; + if (self->spawnflags & ATTRACTOR_SIGHT) { + tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,ent->s.origin,NULL,MASK_OPAQUE | MASK_SHOT); + if (tr.ent != ent) continue; + } + if (dist < best_dist) { + best_dist = dist; + target = ent; + } + } + } + if (self->spawnflags & ATTRACTOR_MONSTER) { + for(i=1, ent=&g_edicts[i]; i<=globals.num_edicts; i++, ent++) { + if (!ent->inuse) continue; + if (ent->health <= 0) continue; + if (!(ent->svflags & SVF_MONSTER)) continue; + num_targets++; + VectorSubtract(self->s.origin,ent->s.origin,dir); + dist = VectorLength(dir); + if (dist > self->moveinfo.distance) continue; + if (self->spawnflags & ATTRACTOR_SIGHT) { + tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,ent->s.origin,NULL,MASK_OPAQUE | MASK_SHOT); + if (tr.ent != ent) continue; + } + if (dist < best_dist) { + best_dist = dist; + target = ent; + } + } + } + if (!(self->spawnflags & (ATTRACTOR_PLAYER | ATTRACTOR_MONSTER))) { + ent = G_Find(NULL,FOFS(targetname),self->target); + while(ent) { + if (!ent->inuse) continue; + num_targets++; + VectorAdd(ent->s.origin,ent->origin_offset,targ_org); + VectorSubtract(self->s.origin,targ_org,dir); + dist = VectorLength(dir); + if (dist > self->moveinfo.distance) continue; + if (self->spawnflags & ATTRACTOR_SIGHT) { + tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,targ_org,NULL,MASK_OPAQUE | MASK_SHOT); + if (tr.ent != ent) continue; + } + if (dist < best_dist) { + best_dist = dist; + target = ent; + } + ent = G_Find(ent,FOFS(targetname),self->target); + } + } + self->target_ent = target; + if (!target) { + if (num_targets > 0) self->nextthink = level.time + FRAMETIME; + return; + } + + if (target != previous_target) + self->moveinfo.speed = 0; + + if (self->moveinfo.speed != self->speed) { + if (self->speed > 0) + self->moveinfo.speed = min(self->speed, self->moveinfo.speed + self->accel); + else + self->moveinfo.speed = max(self->speed, self->moveinfo.speed + self->accel); + } + + VectorAdd(target->s.origin,target->origin_offset,targ_org); + VectorSubtract(self->s.origin,targ_org,dir); + dist = VectorLength(dir); + if (readout->value) gi.dprintf("distance=%g, pull speed=%g\n",dist,self->moveinfo.speed); + + if ((self->pathtarget) && (self->spawnflags & ATTRACTOR_PATHTARGET)) + { + if (dist == 0) { + // fire pathtarget when close + ent = G_Find(NULL,FOFS(targetname),self->pathtarget); + while(ent) { + if (ent->use) + ent->use(ent,self,self); + ent = G_Find(ent,FOFS(targetname),self->pathtarget); + } + self->spawnflags &= ~ATTRACTOR_PATHTARGET; + } + } + VectorNormalize(dir); + speed = VectorNormalize(target->velocity); + speed = max(fabs(self->moveinfo.speed),speed); + if (self->moveinfo.speed < 0) speed = -speed; + if (speed > dist*10) { + speed = dist*10; + VectorScale(dir,speed,target->velocity); + // if NO_GRAVITY is NOT set, and target would normally be affected by gravity, + // counteract gravity during the last move + if ( !(self->spawnflags & ATTRACTOR_NO_GRAVITY) ) { + if ( (target->movetype == MOVETYPE_BOUNCE ) || + (target->movetype == MOVETYPE_PUSHABLE) || + (target->movetype == MOVETYPE_STEP ) || + (target->movetype == MOVETYPE_TOSS ) || + (target->movetype == MOVETYPE_DEBRIS ) ) { + target->velocity[2] += target->gravity * sv_gravity->value * FRAMETIME; + } + } + } else + VectorScale(dir,speed,target->velocity); + // Add attractor velocity in case it's a movewith deal + VectorAdd(target->velocity,self->velocity,target->velocity); + if (target->client) { + float scale; + if (target->groundentity || target->waterlevel > 1) { + if (target->groundentity) + scale = 0.75; + else + scale = 0.375; + // Players - add movement stuff so he MAY be able to escape + AngleVectors (target->client->v_angle, forward, right, NULL); + for (i=0 ; i<3 ; i++) + target->velocity[i] += scale * forward[i] * target->client->ucmd.forwardmove + + scale * right[i] * target->client->ucmd.sidemove; + target->velocity[2] += scale * target->client->ucmd.upmove; + } + } + // If target is on the ground and attractor is overhead, give 'em a little nudge. + // This is only really necessary for players + if (target->groundentity && (self->s.origin[2] > target->absmax[2])) { + target->s.origin[2] += 1; + target->groundentity = NULL; + } + + if (self->sounds) { + vec3_t new_origin; + + if (target->client) + VectorCopy(target->s.origin,new_origin); + else + VectorMA(targ_org,FRAMETIME,target->velocity,new_origin); + + switch(self->sounds) { + case 1: + gi.WriteByte(svc_temp_entity); + gi.WriteByte(TE_MEDIC_CABLE_ATTACK); + gi.WriteShort(self-g_edicts); + gi.WritePosition(self->s.origin); + gi.WritePosition(new_origin); + gi.multicast(self->s.origin, MULTICAST_PVS); + break; + case 2: + gi.WriteByte(svc_temp_entity); + gi.WriteByte(TE_BFG_LASER); + gi.WritePosition(self->s.origin); + gi.WritePosition(new_origin); + gi.multicast(self->s.origin, MULTICAST_PVS); + } + } + + + if (self->spawnflags & ATTRACTOR_NO_GRAVITY) + target->gravity_debounce_time = level.time + 2*FRAMETIME; + gi.linkentity(target); + + if (!num_targets) { + // shut 'er down + self->spawnflags &= ~ATTRACTOR_ON; + } else { + self->nextthink = level.time + FRAMETIME; + } +} + +void target_attractor_think(edict_t *self) +{ + edict_t *ent, *target; + trace_t tr; + vec3_t dir, targ_org; + vec_t dist, speed; + vec3_t forward, right; + int i; + int ent_start; + int num_targets = 0; + + if (!self->spawnflags & ATTRACTOR_ON) return; + + if (self->moveinfo.speed != self->speed) { + if (self->speed > 0) + self->moveinfo.speed = min(self->speed, self->moveinfo.speed + self->accel); + else + self->moveinfo.speed = max(self->speed, self->moveinfo.speed + self->accel); + } + + target = NULL; + ent_start = 1; + while(true) + { + if (self->spawnflags & (ATTRACTOR_PLAYER || ATTRACTOR_MONSTER)) + { + target = NULL; + for(i=ent_start, ent=&g_edicts[ent_start];ispawnflags & ATTRACTOR_PLAYER) && ent->client && ent->inuse) + { + target = ent; + ent_start = i+1; + continue; + } + if ((self->spawnflags & ATTRACTOR_MONSTER) && (ent->svflags & SVF_MONSTER) && (ent->inuse)) + { + target = ent; + ent_start = i+1; + } + } + } else + target = G_Find(target,FOFS(targetname),self->target); + if (!target) break; + if (!target->inuse) continue; + if ( ((target->client) || (target->svflags & SVF_MONSTER)) && (target->health <= 0)) continue; + num_targets++; + + VectorAdd(target->s.origin,target->origin_offset,targ_org); + VectorSubtract(self->s.origin,targ_org,dir); + dist = VectorLength(dir); + + if (self->spawnflags & ATTRACTOR_SIGHT) { + tr = gi.trace(self->s.origin,vec3_origin,vec3_origin,target->s.origin,NULL,MASK_OPAQUE | MASK_SHOT); + if (tr.ent != target) continue; + } + + if (readout->value) gi.dprintf("distance=%g, pull speed=%g\n",dist,self->moveinfo.speed); + if (dist > self->moveinfo.distance) + continue; + + if ((self->pathtarget) && (self->spawnflags & ATTRACTOR_PATHTARGET)) + { + if (dist == 0) { + // fire pathtarget when close + ent = G_Find(NULL,FOFS(targetname),self->pathtarget); + while(ent) { + if (ent->use) + ent->use(ent,self,self); + ent = G_Find(ent,FOFS(targetname),self->pathtarget); + } + self->spawnflags &= ~ATTRACTOR_PATHTARGET; + } + } + VectorNormalize(dir); + speed = VectorNormalize(target->velocity); + speed = max(fabs(self->moveinfo.speed),speed); + if (self->moveinfo.speed < 0) speed = -speed; + if (speed > dist*10) { + speed = dist*10; + VectorScale(dir,speed,target->velocity); + // if NO_GRAVITY is NOT set, and target would normally be affected by gravity, + // counteract gravity during the last move + if ( !(self->spawnflags & ATTRACTOR_NO_GRAVITY) ) { + if ( (target->movetype == MOVETYPE_BOUNCE ) || + (target->movetype == MOVETYPE_PUSHABLE) || + (target->movetype == MOVETYPE_STEP ) || + (target->movetype == MOVETYPE_TOSS ) || + (target->movetype == MOVETYPE_DEBRIS ) ) { + target->velocity[2] += target->gravity * sv_gravity->value * FRAMETIME; + } + } + } else + VectorScale(dir,speed,target->velocity); + // Add attractor velocity in case it's a movewith deal + VectorAdd(target->velocity,self->velocity,target->velocity); + if (target->client) { + float scale; + if (target->groundentity || target->waterlevel > 1) { + if (target->groundentity) + scale = 0.75; + else + scale = 0.375; + // Players - add movement stuff so he MAY be able to escape + AngleVectors (target->client->v_angle, forward, right, NULL); + for (i=0 ; i<3 ; i++) + target->velocity[i] += scale * forward[i] * target->client->ucmd.forwardmove + + scale * right[i] * target->client->ucmd.sidemove; + target->velocity[2] += scale * target->client->ucmd.upmove; + } + } + // If target is on the ground and attractor is overhead, give 'em a little nudge. + // This is only really necessary for players + if (target->groundentity && (self->s.origin[2] > target->absmax[2])) { + target->s.origin[2] += 1; + target->groundentity = NULL; + } + if (self->spawnflags & ATTRACTOR_NO_GRAVITY) + target->gravity_debounce_time = level.time + 2*FRAMETIME; + gi.linkentity(target); + } + if (!num_targets) { + // shut 'er down + self->spawnflags &= ~ATTRACTOR_ON; + } else { + self->nextthink = level.time + FRAMETIME; + } +} + +void use_target_attractor(edict_t *self, edict_t *other, edict_t *activator) +{ + if (self->spawnflags & ATTRACTOR_ON) { + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } + else + { + self->spawnflags &= ~ATTRACTOR_ON; + self->s.sound = 0; + self->target_ent = NULL; + self->nextthink = 0; + } + } else { + self->spawnflags |= (ATTRACTOR_ON + ATTRACTOR_PATHTARGET); + self->s.sound = self->noise_index; + if (self->spawnflags & ATTRACTOR_SINGLE) + self->think = target_attractor_think_single; + else + self->think = target_attractor_think; + self->moveinfo.speed = 0; + gi.linkentity(self); + self->think(self); + } +} + +void SP_target_attractor(edict_t *self) +{ + if (!self->target && !(self->spawnflags & ATTRACTOR_PLAYER) && + !(self->spawnflags & ATTRACTOR_MONSTER)) { + gi.dprintf("target_attractor without a target at %s\n",vtos(self->s.origin)); + G_FreeEdict(self); + return; + } + if (self->sounds) { +// if ((self->spawnflags & ATTRACTOR_PLAYER) || (self->spawnflags & ATTRACTOR_MONSTER)) { + self->spawnflags |= (ATTRACTOR_SIGHT | ATTRACTOR_SINGLE); +// } else { +// gi.dprintf("Target_attractor sounds key is only valid\n" +// "for PLAYER or MONSTER. Setting sounds=0\n"); +// } + } + if (st.distance) + self->moveinfo.distance = st.distance; + else + self->moveinfo.distance = 8192; + + self->solid = SOLID_NOT; + if (self->movewith) + self->movetype = MOVETYPE_PUSH; + else + self->movetype = MOVETYPE_NONE; + self->use = use_target_attractor; + + if (st.noise) + self->noise_index = gi.soundindex(st.noise); + else + self->noise_index = 0; + + if (!self->speed) + self->speed = 100; + + if (!self->accel) + self->accel = self->speed; + else { + self->accel *= 0.1; + if (self->accel > self->speed) + self->accel = self->speed; + } + + if (self->spawnflags & ATTRACTOR_ON) { + if (self->spawnflags & ATTRACTOR_SINGLE) + self->think = target_attractor_think_single; + else + self->think = target_attractor_think; + if (self->sounds) + self->nextthink = level.time + 2*FRAMETIME; + else + self->think(self); + } +} + +/*=================================================================== + TARGET_CD + Play the CD track specified by the "sounds" value, looping the + track "dmg" times. This does NOT override player's option to + disable CD music, and of course does nothing if a music CD is not + in place. If "dmg" is not specified, track is looped cd_loopcount + (default=4) times. +===================================================================*/ +void use_target_CD (edict_t *self, edict_t *other, edict_t *activator) +{ + gi.configstring (CS_CDTRACK, va("%d",self->sounds)); + if ((self->dmg > 0) && (!deathmatch->value) && (!coop->value)) + stuffcmd(&g_edicts[1],va("cd_loopcount %d\n",self->dmg)); + + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } +} + +void SP_target_CD (edict_t *self) +{ + self->use = use_target_CD; + if (!self->dmg) + self->dmg = lazarus_cd_loop->value; + gi.linkentity(self); +} +/*=================================================================== + TARGET_MONITOR + Move the player's viewpoint to the target_monitor origin, + gives the target_monitor angles to the player, and freezes him + for "wait" seconds (default=3). If wait < 0, target_monitor + must be targeted a second time to free the player. +===================================================================*/ +#define SF_MONITOR_CHASECAM 1 +#define SF_MONITOR_EYEBALL 2 // Same as CHASECAM, but viewpoint is at the target + // entity's viewheight, and target entity is made + // invisible while in use + +void target_monitor_off (edict_t *self) +{ + int i; + edict_t *faker; + edict_t *player; + + player = self->child; + if (!player) return; + + if (self->spawnflags & SF_MONITOR_EYEBALL) + { + if (self->target_ent) + self->target_ent->svflags &= ~SVF_NOCLIENT; + } + faker = player->client->camplayer; + VectorCopy(faker->s.origin,player->s.origin); + free(faker->client); + G_FreeEdict (faker); + player->client->ps.pmove.origin[0] = player->s.origin[0]*8; + player->client->ps.pmove.origin[1] = player->s.origin[1]*8; + player->client->ps.pmove.origin[2] = player->s.origin[2]*8; + for (i=0 ; i<3 ; i++) + player->client->ps.pmove.delta_angles[i] = + ANGLE2SHORT(player->client->org_viewangles[i] - player->client->resp.cmd_angles[i]); + VectorCopy(player->client->org_viewangles, player->client->resp.cmd_angles); + VectorCopy(player->client->org_viewangles, player->s.angles); + VectorCopy(player->client->org_viewangles, player->client->ps.viewangles); + VectorCopy(player->client->org_viewangles, player->client->v_angle); + + player->client->ps.gunindex = gi.modelindex(player->client->pers.weapon->view_model); + player->client->ps.pmove.pm_flags &= ~PMF_NO_PREDICTION; + player->client->ps.pmove.pm_type = PM_NORMAL; + player->svflags &= ~SVF_NOCLIENT; + player->clipmask = MASK_PLAYERSOLID; + player->solid = SOLID_BBOX; + player->viewheight = 22; + player->client->camplayer = NULL; + player->target_ent = NULL; + gi.unlinkentity(player); + KillBox(player); + gi.linkentity(player); + + if (self->noise_index) + gi.sound (player, CHAN_VOICE, self->noise_index, 1, ATTN_NORM, 0); + + // if we were previously in third person view, restore it + if (tpp->value) + Cmd_Chasecam_Toggle (player); + +//CW+++ Switch crosshair and HUD back on again. + stuffcmd(player, va("crosshair %f\n", fCrosshair)); + gi.configstring (CS_STATUSBAR, single_statusbar); +//CW--- + + self->child = NULL; + gi.linkentity(self); + + self->count--; + if (!self->count) { + self->use = NULL; + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } +} + +void target_monitor_move (edict_t *self) +{ + // "chase cam" + trace_t trace; + vec3_t forward, o, goal; + + if (!self->target_ent || !self->target_ent->inuse) + { + if (self->wait) + { + self->think = target_monitor_off; + self->nextthink = self->monsterinfo.attack_finished; + } + return; + } + + if ( (self->monsterinfo.attack_finished > 0) && + (level.time > self->monsterinfo.attack_finished)) + { + target_monitor_off(self); + return; + } + + AngleVectors(self->target_ent->s.angles,forward,NULL,NULL); + VectorMA(self->target_ent->s.origin, -self->moveinfo.distance, forward, o); + + o[2] += self->viewheight; + + VectorSubtract(o,self->s.origin,o); + VectorMA(self->s.origin,0.2,o,o); + + trace = gi.trace(self->target_ent->s.origin, NULL, NULL, o, self, MASK_SOLID); + VectorCopy(trace.endpos, goal); + VectorMA(goal, 2, forward, goal); + + // pad for floors and ceilings + VectorCopy(goal, o); + o[2] += 6; + trace = gi.trace(goal, NULL, NULL, o, self, MASK_SOLID); + if (trace.fraction < 1) { + VectorCopy(trace.endpos, goal); + goal[2] -= 6; + } + + VectorCopy(goal, o); + o[2] -= 6; + trace = gi.trace(goal, NULL, NULL, o, self, MASK_SOLID); + if (trace.fraction < 1) { + VectorCopy(trace.endpos, goal); + goal[2] += 6; + } + + VectorCopy(goal, self->s.origin); + self->nextthink = level.time + FRAMETIME; + gi.linkentity(self); +} +void use_target_monitor (edict_t *self, edict_t *other, edict_t *activator) +{ + int i; + edict_t *faker; + edict_t *monster; + gclient_t *cl; + + if (activator && !activator->client) //CW - added activator check + return; + +//CW++ Remove crosshair and HUD whilst looking through monitor. + fCrosshair = crosshair->value; + stuffcmd(activator, "crosshair 0\n"); + gi.configstring (CS_STATUSBAR, NULL); +//CW-- + + if (self->child) + { + if (self->wait < 0) + target_monitor_off(self); + return; + } + + if (self->target) + self->target_ent = G_Find(NULL,FOFS(targetname),self->target); + + // if this is a CHASE_CAM target_monitor and the target no longer + // exists, remove this target_monitor and exit + if (self->spawnflags & SF_MONITOR_CHASECAM) + { + if (!self->target_ent || !self->target_ent->inuse) + { + G_FreeEdict(self); + return; + } + } + // save current viewangles + VectorCopy(activator->client->v_angle,activator->client->org_viewangles); + + // create a fake player to stand in real player's position + faker = activator->client->camplayer = G_Spawn(); + faker->s.frame = activator->s.frame; + VectorCopy (activator->s.origin, faker->s.origin); + VectorCopy (activator->velocity, faker->velocity); + VectorCopy (activator->s.angles, faker->s.angles); + faker->s = activator->s; + faker->takedamage = DAMAGE_NO; // so monsters won't attack + faker->flags |= FL_NOTARGET; // ... just to make sure +// faker->movetype = MOVETYPE_WALK; + faker->movetype = MOVETYPE_TOSS; + faker->groundentity = activator->groundentity; + faker->viewheight = activator->viewheight; + faker->inuse = true; + faker->classname = "camplayer"; + faker->mass = activator->mass; + faker->solid = SOLID_BBOX; + faker->deadflag = DEAD_NO; + faker->clipmask = MASK_PLAYERSOLID; + faker->health = 100000; // invulnerable + faker->light_level = activator->light_level; + faker->think = faker_animate; + faker->nextthink = level.time + FRAMETIME; + VectorCopy(activator->mins,faker->mins); + VectorCopy(activator->maxs,faker->maxs); + // create a client so you can pick up items/be shot/etc while in camera + cl = (gclient_t *) malloc(sizeof(gclient_t)); + faker->client = cl; + faker->target_ent = activator; + gi.linkentity (faker); + + if (self->target_ent && self->target_ent->inuse) + { + if (self->spawnflags & SF_MONITOR_EYEBALL) + VectorCopy(self->target_ent->s.angles, activator->client->ps.viewangles); + else + { + vec3_t dir; + VectorSubtract(self->target_ent->s.origin,self->s.origin,dir); + vectoangles(dir,activator->client->ps.viewangles); + } + } + else + VectorCopy (self->s.angles, activator->client->ps.viewangles); + + VectorCopy (self->s.origin, activator->s.origin); + activator->client->ps.pmove.origin[0] = self->s.origin[0]*8; + activator->client->ps.pmove.origin[1] = self->s.origin[1]*8; + activator->client->ps.pmove.origin[2] = self->s.origin[2]*8; + activator->client->ps.pmove.pm_type = PM_FREEZE; + activator->svflags |= SVF_NOCLIENT; + activator->solid = SOLID_NOT; + activator->viewheight = 0; + if (activator->client->chasetoggle) + { + Cmd_Chasecam_Toggle (activator); + activator->client->pers.chasetoggle = 1; + } + else + activator->client->pers.chasetoggle = 0; + activator->clipmask = 0; + VectorClear(activator->velocity); + activator->client->ps.gunindex = 0; + activator->client->ps.pmove.pm_flags |= PMF_NO_PREDICTION; + gi.linkentity(activator); + + gi.unlinkentity(faker); + KillBox(faker); + gi.linkentity(faker); + + // check to see if player is the enemy of any monster. + for (i=maxclients->value+1, monster=g_edicts+i; iinuse) continue; + if (!(monster->svflags & SVF_MONSTER)) continue; + if (monster->enemy == activator) + { + monster->enemy = NULL; + monster->oldenemy = NULL; + if (monster->goalentity == activator) + monster->goalentity = NULL; + if (monster->movetarget == activator) + monster->movetarget = NULL; + monster->monsterinfo.attack_finished = level.time + 1; + FindTarget(monster); + } + } + + activator->target_ent = self; + self->child = activator; + + if (self->noise_index) + gi.sound (activator, CHAN_VOICE, self->noise_index, 1, ATTN_NORM, 0); + + if (self->spawnflags & SF_MONITOR_CHASECAM) + { + if (self->wait > 0) + self->monsterinfo.attack_finished = level.time + self->wait; + else + self->monsterinfo.attack_finished = 0; + + if (self->spawnflags & SF_MONITOR_EYEBALL) + { + self->viewheight = self->target_ent->viewheight; + self->target_ent->svflags |= SVF_NOCLIENT; + } + VectorCopy(self->target_ent->s.origin,self->s.origin); + self->think = target_monitor_move; + self->think(self); + } + else if (self->wait > 0) + { + self->think = target_monitor_off; + self->nextthink = level.time + self->wait; + } +} + +void SP_target_monitor (edict_t *self) +{ + char buffer[MAX_QPATH]; + + if (!self->wait) + self->wait = 3; + self->use = use_target_monitor; + self->movetype = MOVETYPE_NOCLIP; + if (st.noise) + { + if (!strstr (st.noise, ".wav")) + Com_sprintf (buffer, sizeof(buffer), "%s.wav", st.noise); + else + strncpy (buffer, st.noise, sizeof(buffer)); + self->noise_index = gi.soundindex (buffer); + } + + if (self->spawnflags & SF_MONITOR_EYEBALL) + self->spawnflags |= SF_MONITOR_CHASECAM; + + if (self->spawnflags & SF_MONITOR_CHASECAM) + { // chase cam + if (self->spawnflags & SF_MONITOR_EYEBALL) + { + self->moveinfo.distance = 0; + self->viewheight = 0; + } + else + { + if (st.distance) + self->moveinfo.distance = st.distance; + else + self->moveinfo.distance = 128; + + if (st.height) + self->viewheight = st.height; + else + self->viewheight = 16; + } + + // MUST have target + if (!self->target) + { + gi.dprintf("CHASECAM target_monitor with no target at %s\n",vtos(self->s.origin)); + self->spawnflags &= ~(SF_MONITOR_CHASECAM | SF_MONITOR_EYEBALL); + } + else if (self->movewith) + { + gi.dprintf("CHASECAM target_monitor cannot use 'movewith'\n"); + self->spawnflags &= ~(SF_MONITOR_CHASECAM | SF_MONITOR_EYEBALL); + } + } + + gi.linkentity(self); +} + +/*==================================================================================== + TARGET_ANIMATION causes the target entity to use the animation frames + "startframe" through "startframe" + "framenumbers" - 1. + + Spawnflags: + ACTIVATOR = 1 - target_animation acts on it's activator rather than + it's target + + "message" - specifies allowable classname to animate. This prevents + animating entities with inapplicable frame numbers +=====================================================================================*/ +void target_animate (edict_t *ent) +{ + if ( (ent->s.frame < ent->monsterinfo.currentmove->firstframe) || + (ent->s.frame >= ent->monsterinfo.currentmove->lastframe ) ) + { + if (ent->monsterinfo.currentmove->endfunc) + { + ent->think = ent->monsterinfo.currentmove->endfunc; + ent->nextthink = level.time + FRAMETIME; + } + else if (ent->svflags & SVF_MONSTER) + { + // Hopefully we don't get here, but if we DO then we definitely + // need for monsters/actors to turn their brains back on. + ent->think = monster_think; + ent->nextthink = level.time + FRAMETIME; + } + else + { + ent->think = NULL; + ent->nextthink = 0; + } + ent->monsterinfo.currentmove = ent->monsterinfo.savemove; + return; + } + ent->s.frame++; + ent->nextthink = level.time + FRAMETIME; + gi.linkentity(ent); +} + +void target_animation_use (edict_t *self, edict_t *other, edict_t *activator) +{ + edict_t *target = NULL; + + if (level.time < self->touch_debounce_time) + return; + if (self->spawnflags & 1) + { + if (activator && activator->client) + return; + if (self->message && Q_stricmp(self->message, activator->classname)) + return; + if (!self->target) + target = activator; + } + if (!target) + { + if (!self->target) + return; + target = G_Find(NULL,FOFS(targetname),self->target); + if (!target) + return; + } + // Don't allow target to be animated if ALREADY under influence of + // another target_animation + if (target->think == target_animate) + return; + self->monsterinfo.currentmove->firstframe = self->startframe; + self->monsterinfo.currentmove->lastframe = self->startframe + self->framenumbers - 1; + self->monsterinfo.currentmove->frame = NULL; + self->monsterinfo.currentmove->endfunc = target->think; + target->s.frame = self->startframe; + target->think = target_animate; + target->monsterinfo.savemove = target->monsterinfo.currentmove; + target->monsterinfo.currentmove = self->monsterinfo.currentmove; + target->nextthink = level.time + FRAMETIME; + gi.linkentity(target); + + self->count--; + if (!self->count) + G_FreeEdict(self); + else + self->touch_debounce_time = level.time + (self->framenumbers+1)*FRAMETIME; +} + +void SP_target_animation (edict_t *self) +{ + mmove_t *move; + if (!self->target && !(self->spawnflags & 1)) + { + gi.dprintf("target_animation w/o a target at %s\n",vtos(self->s.origin)); + G_FreeEdict(self); + } + switch(self->sounds) + { + case 1: + // actor jump + self->startframe = 66; + self->framenumbers = 6; + break; + case 2: + // actor flip + self->startframe = 72; + self->framenumbers = 12; + break; + case 3: + // actor salute + self->startframe = 84; + self->framenumbers = 11; + break; + case 4: + // actor taunt + self->startframe = 95; + self->framenumbers = 17; + break; + case 5: + // actor wave + self->startframe = 112; + self->framenumbers = 11; + break; + case 6: + // actor point + self->startframe = 123; + self->framenumbers = 12; + break; + default: + if (!self->framenumbers) + self->framenumbers = 1; + } + self->use = target_animation_use; + move = gi.TagMalloc(sizeof(mmove_t), TAG_LEVEL); + self->monsterinfo.currentmove = move; +} +/*=================================================================================== + TARGET_FAILURE - Halts the game, fades the screen to black and displays + a message explaining to the player how he screwed up. + Optionally plays a sound. +====================================================================================*/ +void target_failure_wipe (edict_t *self) +{ + edict_t *player; + + player = &g_edicts[1]; // Gotta be, since this is SP only + if (player->client->textdisplay) Text_Close(player); +} + +void target_failure_player_die (edict_t *player) +{ + int n; + + // player_die w/o... umm... dying + + if (player->client->chasetoggle) + { + ChasecamRemove (player, OPTION_OFF); + player->client->pers.chasetoggle = 1; + } + else + player->client->pers.chasetoggle = 0; + player->client->pers.spawn_landmark = false; // paranoia check + player->client->pers.spawn_levelchange = false; + player->client->zooming = 0; + player->client->zoomed = false; + SetSensitivities(player,true); + if (player->client->spycam) + camera_off(player); + VectorClear (player->avelocity); + player->takedamage = DAMAGE_NO; + player->movetype = MOVETYPE_NONE; + player->s.modelindex2 = 0; // remove linked weapon model + player->s.sound = 0; + player->client->weapon_sound = 0; + player->svflags |= SVF_DEADMONSTER; + player->client->respawn_time = level.time + 1.0; + player->client->ps.gunindex = 0; + // clear inventory + for (n = 0; n < game.num_items; n++) + { + player->client->pers.inventory[n] = 0; + } + // remove powerups + player->client->quad_framenum = 0; + player->client->invincible_framenum = 0; + player->client->breather_framenum = 0; + player->client->enviro_framenum = 0; + player->flags &= ~FL_POWER_ARMOR; + player->client->flashlight = false; + player->deadflag = DEAD_FROZEN; + gi.linkentity (player); +} +void target_failure_think (edict_t *self) +{ + target_failure_player_die(self->target_ent); + self->target_ent = NULL; + self->think = target_failure_wipe; + self->nextthink = level.time + 10; +} + +void target_failure_fade_lights (edict_t *self) +{ + char lightvalue[2]; + char values[] = "abcdefghijklm"; + + lightvalue[0] = values[self->flags]; + lightvalue[1] = 0; + gi.configstring(CS_LIGHTS+0, lightvalue); + if (self->flags) + { + self->flags--; + self->nextthink = level.time + 0.2; + } + else + { + target_failure_player_die(self->target_ent); + self->target_ent = NULL; + self->think = target_failure_wipe; + self->nextthink = level.time + 10; + } +} + +void Use_Target_Text(edict_t *self, edict_t *other, edict_t *activator); +void use_target_failure (edict_t *self, edict_t *other, edict_t *activator) +{ + if (!activator->client) + return; + + if (self->target_ent) + return; + + if (strlen(self->message)) + Use_Target_Text(self,other,activator); + + if (self->noise_index) + gi.sound (activator, CHAN_VOICE|CHAN_RELIABLE, self->noise_index, 1, ATTN_NORM, 0); + + self->target_ent = activator; + if (Q_stricmp(vid_ref->string,"gl")) + { + self->flags = 12; + self->think = target_failure_fade_lights; + self->nextthink = level.time + FRAMETIME; + } + else + { + activator->client->fadestart= level.framenum; + activator->client->fadein = level.framenum + 40; + activator->client->fadehold = activator->client->fadein + 100000; + activator->client->fadeout = 0; + activator->client->fadecolor[0] = 0; + activator->client->fadecolor[1] = 0; + activator->client->fadecolor[2] = 0; + activator->client->fadealpha = 1.0; + self->think = target_failure_think; + self->nextthink = level.time + 4; + } + activator->deadflag = DEAD_FROZEN; + gi.linkentity(activator); +} + +void SP_target_failure (edict_t *self) +{ + if (deathmatch->value || coop->value) + { // SP only + G_FreeEdict (self); + return; + } + self->use = use_target_failure; + if (st.noise) + self->noise_index = gi.soundindex(st.noise); +} + +/*===================================================================================== + TARGET_CHANGE - copies selected fields to target. + Target value should be of the form "entitytotarget,new target value". + All other keys are replacements for the targeted entity, NOT the + target_change. +======================================================================================*/ +void use_target_change (edict_t *self, edict_t *other, edict_t *activator) +{ + char *buffer; + char *target; + char *newtarget; + int L; + int newteams=0; + edict_t *target_ent; + + if (!self->target) + return; + L = strlen(self->target); + buffer = (char *)malloc(L+1); + strcpy(buffer,self->target); + newtarget = strstr(buffer,","); + if (newtarget) + { + *newtarget = 0; + newtarget++; + } + target = buffer; + target_ent = G_Find(NULL,FOFS(targetname),target); + while(target_ent) + { + if (newtarget && strlen(newtarget)) + target_ent->target = G_CopyString(newtarget); + if (self->newtargetname && strlen(self->newtargetname)) + target_ent->targetname = G_CopyString(self->newtargetname); + if (self->team && strlen(self->team)) + { + target_ent->team = G_CopyString(self->team); + newteams++; + } + if (VectorLength(self->s.angles)) + { + VectorCopy (self->s.angles, target_ent->s.angles); + if (target_ent->solid == SOLID_BSP) + G_SetMovedir (target_ent->s.angles, target_ent->movedir); + } + if (self->deathtarget && strlen(self->deathtarget)) + target_ent->deathtarget = G_CopyString(self->deathtarget); + if (self->pathtarget && strlen(self->pathtarget)) + target_ent->pathtarget = G_CopyString(self->pathtarget); + if (self->killtarget && strlen(self->killtarget)) + target_ent->killtarget = G_CopyString(self->killtarget); + if (self->message && strlen(self->message)) + target_ent->message = G_CopyString(self->message); + if (self->delay > 0) + target_ent->delay = self->delay; + if (self->dmg > 0) + target_ent->dmg = self->dmg; + if (self->health > 0) + target_ent->health = self->health; + if (self->mass > 0) + target_ent->mass = self->mass; + if (self->pitch_speed > 0) + target_ent->pitch_speed = self->pitch_speed; + if (self->random > 0) + target_ent->random = self->random; + if (self->roll_speed > 0) + target_ent->roll_speed = self->roll_speed; + if (self->wait > 0) + target_ent->wait = self->wait; + if (self->yaw_speed > 0) + target_ent->yaw_speed = self->yaw_speed; + if (self->noise_index) + { + if (target_ent->s.sound == target_ent->noise_index) + target_ent->s.sound = target_ent->noise_index = self->noise_index; + else + target_ent->noise_index = self->noise_index; + } + if (self->spawnflags) + { + target_ent->spawnflags = self->spawnflags; + // special cases: + if (!Q_stricmp(target_ent->classname,"model_train")) + { + if (target_ent->spawnflags & 32) + { + target_ent->spawnflags &= ~32; + target_ent->spawnflags |= 8; + } + if (target_ent->spawnflags & 64) + { + target_ent->spawnflags &= ~64; + target_ent->spawnflags |= 16; + } + } + } + gi.linkentity(target_ent); + target_ent = G_Find(target_ent,FOFS(targetname),target); + } + free(buffer); + if (newteams) + G_FindTeams(); +} + +void SP_target_change (edict_t *self) +{ + self->use = use_target_change; + if (st.noise) + self->noise_index = gi.soundindex(st.noise); +} + +/*==================================================================================== + TARGET_MOVEWITH - sets an entity to "movewith" it's pathtarget (or remove + that setting if DETACH (=1) is set) +======================================================================================*/ + +void movewith_detach (edict_t *child) +{ + edict_t *e; + edict_t *parent=NULL; + int i; + + for(i=1; imovewith_next == child) parent=e; + } + if (parent) parent->movewith_next = child->movewith_next; + + child->movewith_next = NULL; + child->movewith = NULL; + child->movetype = child->org_movetype; + // if monster, give 'em a small vertical boost + if (child->svflags & SVF_MONSTER) + child->s.origin[2] += 2; + gi.linkentity(child); +} + +void use_target_movewith (edict_t *self, edict_t *other, edict_t *activator) +{ + edict_t *target; + + if (!self->target) + return; + target = G_Find(NULL,FOFS(targetname),self->target); + + if (self->spawnflags & 1) + { + // Detach + while(target) + { + if (target->movewith_ent) + movewith_detach(target); + target = G_Find(target,FOFS(targetname),self->target); + } + } + else + { + // Attach + edict_t *parent; + edict_t *e; + edict_t *previous; + + parent = G_Find(NULL,FOFS(targetname),self->pathtarget); + if (!parent || !parent->inuse) + return; + while(target) + { + if (!target->movewith_ent || (target->movewith_ent != parent) ) + { + if (target->movewith_ent) + movewith_detach(target); + + target->movewith_ent = parent; + VectorCopy(parent->s.angles,target->parent_attach_angles); + if (target->org_movetype < 0) + target->org_movetype = target->movetype; + if (target->movetype != MOVETYPE_NONE) + target->movetype = MOVETYPE_PUSH; + VectorCopy(target->mins,target->org_mins); + VectorCopy(target->maxs,target->org_maxs); + VectorSubtract(target->s.origin,parent->s.origin,target->movewith_offset); + e = parent->movewith_next; + previous = parent; + while(e) + { + previous = e; + e = previous->movewith_next; + } + previous->movewith_next = target; + gi.linkentity(target); + } + target = G_Find(target,FOFS(targetname),self->target); + } + } + + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } +} + +void SP_target_movewith (edict_t *self) +{ + if (!self->target) + { + gi.dprintf("target_movewith with no target\n"); + G_FreeEdict(self); + return; + } + if (!(self->spawnflags & 1) && !self->pathtarget) + { + gi.dprintf("target_movewith w/o DETACH and no pathtarget\n"); + G_FreeEdict(self); + return; + } + self->use = use_target_movewith; +} + +/*==================================================================================== + TARGET_SET_EFFECT - sets s.effects and/or s.renderfx for targeted entity + Style + 0 = Copy + 1 = NOT + 2 = XOR (toggle) +======================================================================================*/ + +void use_target_set_effect (edict_t *self, edict_t *other, edict_t *activator) +{ + edict_t *target; + + target = G_Find(NULL,FOFS(targetname),self->target); + while(target) + { + if (self->style == 1) + { + target->s.effects &= ~self->effects; + target->s.renderfx &= ~self->renderfx; + } + else if (self->style == 2) + { + target->s.effects ^= self->effects; + target->s.renderfx ^= self->renderfx; + } + else + { + target->s.effects = self->effects; + target->s.renderfx = self->renderfx; + } + gi.linkentity(target); + target = G_Find(target,FOFS(targetname),self->target); + } +} + +void SP_target_set_effect (edict_t *self) +{ + if (!self->target) + { + gi.dprintf("target_set_effect w/o a target at %s\n",vtos(self->s.origin)); + G_FreeEdict(self); + return; + } + self->use = use_target_set_effect; +} + +/*============================================================================= + TARGET_SKY - uses the "sky" string as parameter to "sky" console command. + Best used in areas where player cannot see the sky, of course. + + NOTE: Tried using a START_ON spawnflag, but it ends up being meaningless. + If we don't delay use_target_sky a bit at level start, we get + "SZ_GetSpace: overflow without allowoverflow set", and if we use + a sufficient delay to get around the error then the original sky + is visible before the switch. +=============================================================================*/ +void use_target_sky (edict_t *self, edict_t *other, edict_t *activator) +{ + gi.configstring(CS_SKY,self->pathtarget); + stuffcmd(&g_edicts[1],va("sky %s\n",self->pathtarget)); + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } +} + +void SP_target_sky (edict_t *self) +{ + if (!st.sky || !*st.sky) + { + gi.dprintf("Target_sky with no sky string at %s\n",vtos(self->s.origin)); + G_FreeEdict(self); + return; + } + self->pathtarget = gi.TagMalloc(strlen(st.sky)+1,TAG_LEVEL); + strcpy(self->pathtarget,st.sky); + self->use = use_target_sky; +} + +/*============================================================================= + TARGET_FADE fades the screen to a color + color = R,G,B components of fade color, 0-1 + alpha = opacity of fade. 0=no effect, 1=solid color + fadein = time in seconds from trigger until full alpha + fadeout = time in seconds after fadein+holdtime from full alpha to clear screen + holdtime = time to hold the effect at full alpha value. -1 = permanent +=============================================================================*/ +void use_target_fade (edict_t *self, edict_t *other, edict_t *activator) +{ + if (!activator->client) + return; + + activator->client->fadestart= level.framenum; + activator->client->fadein = level.framenum + self->fadein*10; + activator->client->fadehold = activator->client->fadein + self->holdtime*10; + activator->client->fadeout = activator->client->fadehold + self->fadeout*10; + activator->client->fadecolor[0] = self->color[0]; + activator->client->fadecolor[1] = self->color[1]; + activator->client->fadecolor[2] = self->color[2]; + activator->client->fadealpha = self->alpha; + + self->count--; + if (!self->count) { + self->think = G_FreeEdict; + self->nextthink = level.time + 1; + } +} + +void SP_target_fade (edict_t *self) +{ + self->use = use_target_fade; + if (self->fadein < 0) + self->fadein = 0; + if (self->holdtime < 0) + { + self->count = 1; + self->holdtime = 10000; + } + if (self->fadeout < 0) + self->fadeout = 0; +} + +/*============================================================================= + TARGET_CLONE + Spawns a new entity, using model and other parameters of source entity. + + source - targetname of source entity for model + newtargetname - targetname to assign to spawned entity + target - target to assign to spawned entity + count - number of spawner uses before being freed + Spawnflags + 1 = START_ON +=============================================================================*/ +void button_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf); +void Think_CalcMoveSpeed (edict_t *self); +void Think_SpawnDoorTrigger (edict_t *ent); +void func_train_find (edict_t *self); +void clone (edict_t *self, edict_t *other, edict_t *activator) +{ + edict_t *parent; + edict_t *child; + int newteams=0; + + parent = G_Find(NULL,FOFS(targetname),self->source); + if (!parent) + return; + child = G_Spawn(); + child->classname = gi.TagMalloc(strlen(parent->classname)+1,TAG_LEVEL); + strcpy(child->classname,parent->classname); + child->s.modelindex = parent->s.modelindex; + VectorCopy(self->s.origin,child->s.origin); + child->svflags = parent->svflags; + VectorCopy(parent->mins,child->mins); + VectorCopy(parent->maxs,child->maxs); + VectorCopy(parent->size,child->size); + + if (self->newtargetname && strlen(self->newtargetname)) + child->targetname = G_CopyString(self->newtargetname); + if (self->team && strlen(self->team)) + { + child->team = G_CopyString(self->team); + newteams++; + } + if (self->target && strlen(self->target)) + child->target = G_CopyString(self->target); + + if (parent->deathtarget && strlen(parent->deathtarget)) + child->deathtarget = G_CopyString(parent->deathtarget); + if (parent->destroytarget && strlen(parent->destroytarget)) + child->destroytarget = G_CopyString(parent->destroytarget); + if (parent->killtarget && strlen(parent->killtarget)) + child->killtarget = G_CopyString(parent->killtarget); + + child->solid = parent->solid; + child->clipmask = parent->clipmask; + child->movetype = parent->movetype; + child->mass = parent->mass; + child->health = parent->health; + child->max_health = parent->max_health; + child->takedamage = parent->takedamage; + child->dmg = parent->dmg; + child->sounds = parent->sounds; + child->speed = parent->speed; + child->accel = parent->accel; + child->decel = parent->decel; + child->gib_type = parent->gib_type; + child->noise_index = parent->noise_index; + child->noise_index2 = parent->noise_index2; + child->wait = parent->wait; + child->delay = parent->delay; + child->random = parent->random; + child->style = parent->style; + child->flags = parent->flags; + child->blocked = parent->blocked; + child->touch = parent->touch; + child->use = parent->use; + child->pain = parent->pain; + child->die = parent->die; + child->s.effects = parent->s.effects; + child->s.skinnum = parent->s.skinnum; + child->item = parent->item; + child->moveinfo.sound_start = parent->moveinfo.sound_start; + child->moveinfo.sound_middle = parent->moveinfo.sound_middle; + child->moveinfo.sound_end = parent->moveinfo.sound_end; + VectorCopy(parent->movedir,child->movedir); + VectorCopy(self->s.angles, child->s.angles); + if (VectorLength(child->s.angles) != 0) + { + if (child->s.angles[YAW] == 90 || child->s.angles[YAW] == 270) + { + // We're correct for these angles, not even gonna bother with others + vec_t temp; + temp = child->size[0]; + child->size[0] = child->size[1]; + child->size[1] = temp; + temp = child->mins[0]; + if (child->s.angles[YAW] == 90) + { + child->mins[0] = -child->maxs[1]; + child->maxs[1] = child->maxs[0]; + child->maxs[0] = -child->mins[1]; + child->mins[1] = temp; + } + else + { + child->mins[0] = child->mins[1]; + child->mins[1] = -child->maxs[0]; + child->maxs[0] = child->maxs[1]; + child->maxs[1] = -temp; + } + } + vectoangles(child->movedir,child->movedir); + child->movedir[PITCH] += child->s.angles[PITCH]; + child->movedir[YAW] += child->s.angles[YAW]; + child->movedir[ROLL] += child->s.angles[ROLL]; + if (child->movedir[PITCH] > 360) child->movedir[PITCH] -= 360; + if (child->movedir[YAW] > 360) child->movedir[YAW] -= 360; + if (child->movedir[ROLL] > 360) child->movedir[ROLL] -= 360; + AngleVectors(child->movedir,child->movedir,NULL,NULL); + } + VectorAdd(child->s.origin,child->mins,child->absmin); + VectorAdd(child->s.origin,child->maxs,child->absmax); + + child->spawnflags = parent->spawnflags; + // classname-specific stuff + if (!Q_stricmp(child->classname,"func_button")) + { + VectorCopy(child->s.origin,child->pos1); + child->moveinfo.distance = parent->moveinfo.distance; + VectorMA(child->pos1, child->moveinfo.distance, child->movedir, child->pos2); + child->moveinfo.state = 1; + child->moveinfo.speed = child->speed; + child->moveinfo.accel = child->accel; + child->moveinfo.decel = child->decel; + child->moveinfo.wait = child->wait; + VectorCopy(child->pos1, child->moveinfo.start_origin); + VectorCopy(child->s.angles, child->moveinfo.start_angles); + VectorCopy(child->pos2, child->moveinfo.end_origin); + VectorCopy(child->s.angles, child->moveinfo.end_angles); + if (!child->targetname) + child->touch = button_touch; + } + else if (!Q_stricmp(child->classname,"func_door")) + { + VectorCopy(child->s.origin,child->pos1); + child->moveinfo.distance = parent->moveinfo.distance; + VectorMA(child->pos1, child->moveinfo.distance, child->movedir, child->pos2); + child->moveinfo.state = 1; + child->moveinfo.speed = child->speed; + child->moveinfo.accel = child->accel; + child->moveinfo.decel = child->decel; + child->moveinfo.wait = child->wait; + VectorCopy(child->pos1, child->moveinfo.start_origin); + VectorCopy(child->s.angles, child->moveinfo.start_angles); + VectorCopy(child->pos2, child->moveinfo.end_origin); + VectorCopy(child->s.angles, child->moveinfo.end_angles); + if (child->health || child->targetname) + child->think = Think_CalcMoveSpeed; + else + child->think = Think_SpawnDoorTrigger; + child->nextthink = level.time + FRAMETIME; + } + else if (!Q_stricmp(child->classname,"func_door_rotating")) + { + VectorClear(child->s.angles); + VectorCopy(parent->s.angles,child->s.angles); + VectorCopy(parent->pos1, child->pos1); + VectorCopy(parent->pos2, child->pos2); + child->moveinfo.distance = parent->moveinfo.distance; + child->moveinfo.state = 1; + child->moveinfo.speed = child->speed; + child->moveinfo.accel = child->accel; + child->moveinfo.decel = child->decel; + child->moveinfo.wait = child->wait; + VectorCopy(child->s.origin, child->moveinfo.start_origin); + VectorCopy(child->pos1, child->moveinfo.start_angles); + VectorCopy(child->s.origin, child->moveinfo.end_origin); + VectorCopy(child->pos2, child->moveinfo.end_angles); + if (child->health || child->targetname) + child->think = Think_CalcMoveSpeed; + else + child->think = Think_SpawnDoorTrigger; + child->nextthink = level.time + FRAMETIME; + } + else if (!Q_stricmp(child->classname,"func_rotating")) + { + VectorClear(child->s.angles); + if (child->spawnflags & 1) + child->use (child, NULL, NULL); + } + else if (!Q_stricmp(child->classname,"func_train")) + { + VectorClear(self->s.angles); + child->smooth_movement = parent->smooth_movement; + child->pitch_speed = parent->pitch_speed; + child->yaw_speed = parent->yaw_speed; + child->roll_speed = parent->roll_speed; + child->moveinfo.speed = child->speed; + child->moveinfo.accel = child->moveinfo.decel = child->moveinfo.speed; + child->think = func_train_find; + child->nextthink = level.time + FRAMETIME; + if (child->moveinfo.sound_middle || parent->noise_index) + { + edict_t *speaker; + if (child->moveinfo.sound_middle) + child->noise_index = child->moveinfo.sound_middle; + else + child->noise_index = parent->noise_index; + child->moveinfo.sound_middle = 0; + speaker = G_Spawn(); + speaker->classname = "moving_speaker"; + speaker->s.sound = 0; + speaker->volume = 1; + speaker->attenuation = 1; + speaker->owner = child; + speaker->think = Moving_Speaker_Think; + speaker->nextthink = level.time + 2*FRAMETIME; + speaker->spawnflags = 7; // owner must be moving to play + child->speaker = speaker; + if (VectorLength(child->s.origin)) + VectorCopy(child->s.origin,speaker->s.origin); + else { + VectorAdd(child->absmin,child->absmax,speaker->s.origin); + VectorScale(speaker->s.origin,0.5,speaker->s.origin); + } + VectorSubtract(speaker->s.origin,child->s.origin,speaker->offset); + } + } + gi.unlinkentity(child); + KillBox(child); + gi.linkentity(child); + if (self->s.angles[YAW] != 0) + { + VectorAdd(child->s.origin,child->mins,child->absmin); + VectorAdd(child->s.origin,child->maxs,child->absmax); + } + self->count--; + if (!self->count) + G_FreeEdict(self); + if (newteams) + G_FindTeams(); +} + +void target_clone_starton (edict_t *self) +{ + self->use(self,NULL,NULL); +} + +void SP_target_clone (edict_t *self) +{ + if (!self->source) + { + gi.dprintf("%s with no source at %s\n", + self->classname,vtos(self->s.origin)); + G_FreeEdict(self); + return; + } + self->use = clone; + if (self->spawnflags & 1) + { + self->think = target_clone_starton; + self->nextthink = level.time + 2; + } +} + +void use_target_skill (edict_t *self, edict_t *other, edict_t *activator) +{ + level.next_skill = self->style + 1; + self->count--; + if (!self->count) + G_FreeEdict(self); +} + +void SP_target_skill (edict_t *self) +{ + self->use = use_target_skill; +} + +//CW++ +/*============================================================================= + target_holo + Displays a model from the 'holo_list' array, advancing to the next one + in the list each time it is used (wraps around). + + Model 'effects' and 'renderfx' fields can be set as usual; it is suggested + that a combination of rotating and translucent styles are used to give a + "holographic" effect. These weren't hardcoded, though, to allow mappers + more flexibility with this entity. + + "count" = initial model number to be displayed (see the declaration + of holo_list). +=============================================================================*/ +void target_holo_think(edict_t *self) +{ + self->s.frame++; + if (self->s.frame >= self->framenumbers) + self->s.frame = self->startframe; + self->nextthink = level.time + FRAMETIME; + gi.linkentity(self); +} + +void target_holo_use(edict_t *self, edict_t *other, edict_t *activator) +{ + self->usermodel = G_CopyString(holo_list[++self->count]); + self->s.modelindex = gi.modelindex(self->usermodel); + gi.linkentity(self); + if (self->count == (HOLO_SIZE - 1)) + self->count = 0; +} + +void SP_target_holo(edict_t *self) +{ + if ((self->count >= (HOLO_SIZE - 1)) || (self->count < 0)) + self->count = 0; + + self->s.modelindex = gi.modelindex(holo_list[self->count]); + self->solid = SOLID_NOT; + + if (self->movewith) + self->movetype = MOVETYPE_NOCLIP; + else + self->movetype = MOVETYPE_NONE; + + switch (self->style) + { + case 1 : self->s.effects |= EF_ANIM01; break; + case 2 : self->s.effects |= EF_ANIM23; break; + case 3 : self->s.effects |= EF_ANIM_ALL; break; + case 4 : self->s.effects |= EF_ANIM_ALLFAST; break; + } + self->s.effects |= self->effects; + self->s.renderfx |= self->renderfx; + + if (self->startframe < 0) + self->startframe = 0; + if (!self->framenumbers) + self->framenumbers = 1; + self->framenumbers += self->startframe; + self->s.frame = self->startframe; + + if (st.noise) + self->noise_index = gi.soundindex(st.noise); + self->s.sound = self->noise_index; + + if (!(self->s.effects & ANIM_MASK) && (self->framenumbers > 1)) + { + self->think = target_holo_think; + self->nextthink = level.time + (2 * FRAMETIME); + } + self->use = target_holo_use; + gi.linkentity(self); +} + + +//========================================================== +/*QUAKED target_bubbles (1 0 0) (-8 -8 -8) (8 8 8) StartOn +Continuously spawns a number of sprites that float upwards and vanish +when they reach a specified height. If no usermodel is specified, the +sprites will be taken from the file "sprites/s_bubble.sp2" by default. + +"usermodel" SP2 file +"startframe" PCX frame number +"speed" vertical velocity (default = 40) +"random" random +/- amount to vary vertical velocity by +"height" height above parent entity at which to vanish (default = 128) +"mass" number of sprite groups spawned per second (default = 5; max = 10) +"mass2" number of sprites per group (default = 1) +"radius" random +/- amount to scatter bubbles in XY plane +"count" number of times entity can be toggled off +"movewith" targetname of train or other mover +"targetname" name of entity (allows it to be toggled on/off) +"spawnflags" 1 = Start on (if targetname set) +"effects" as usual +"renderfx" as usual +*/ + +void target_bubbles_on(edict_t *self, edict_t *other, edict_t *activator); + +void target_bubbles_think(edict_t *self) +{ + edict_t *bubble; + vec3_t offset; + float v_speed; + int i; + + for (i = 0; i < self->mass2; ++i) + { + bubble = G_Spawn(); + bubble->s.modelindex = gi.modelindex(self->usermodel); + bubble->s.frame = self->startframe; + bubble->s.effects = self->effects; + bubble->s.renderfx = self->renderfx; + bubble->movetype = MOVETYPE_NOCLIP; + + VectorSet(offset, crandom()*self->radius, crandom()*self->radius, 0); + VectorAdd(self->s.origin, offset, bubble->s.origin); + + VectorSet(bubble->movedir, 0, 0, 1); + v_speed = self->speed + (crandom() * self->random); + VectorSet(bubble->velocity, 0, 0, v_speed); + + bubble->nextthink = level.time + (self->pos2[2] / v_speed); + bubble->think = G_FreeEdict; + gi.linkentity(bubble); + } + + self->nextthink = level.time + (1.0 / self->mass); +} + +void target_bubbles_off(edict_t *self, edict_t *other, edict_t *activator) +{ + self->nextthink = 0; + self->use = target_bubbles_on; + + --self->count; + if (!self->count) + { + self->think = G_FreeEdict; + self->use = NULL; + self->nextthink = level.time + 1; + } +} + +void target_bubbles_on(edict_t *self, edict_t *other, edict_t *activator) +{ + self->nextthink = level.time + FRAMETIME; + self->think = target_bubbles_think; + self->use = target_bubbles_off; +} + +void SP_target_bubbles(edict_t *self) +{ + self->svflags |= SVF_NOCLIENT; + +// Initialise default values. + + if (!self->usermodel) + self->usermodel = G_CopyString("sprites/s_bubbles.sp2"); + + if (!st.height) + self->pos2[2] = 128; + else + self->pos2[2] = st.height; + + if (!self->speed) + self->speed = 40; + + if (!self->mass) + self->mass = 5; + + if (self->mass > 10) + self->mass = 10; + + if (!self->mass2) + self->mass2 = 1; + +// If targeted then wait for activation, otherwise start bubbling! + + if (self->targetname) + { + if (self->spawnflags & 1) + { + self->think = target_bubbles_think; + self->nextthink = level.time + FRAMETIME; + self->use = target_bubbles_off; + } + else + self->use = target_bubbles_on; + } + else + { + self->think = target_bubbles_think; + self->nextthink = level.time + FRAMETIME; + } +} + + +/*============================================================================= +QUAKED target_viewshake (1 0 0) (-8 -8 -8) (8 8 8) +Shakes the player's viewing angle briefly. + +"angle" = +/- degrees in horizontal plane (only YAW used) +"yaw_speed" = amplitude decay factor (lower => longer shake) +"count" = number of times entity can be used +*/ +void target_viewshake_think(edict_t *self) +{ + self->target_ent->client->ps.viewangles[YAW] += self->ideal_yaw; + self->ideal_yaw *= -(1.0 - self->angle); + + if (abs(self->ideal_yaw) < 0.01) + { + if (self->count == 0) + G_FreeEdict(self); + else + { + self->target_ent->client->ps.viewangles[YAW] = self->holdtime; + self->nextthink = 0.0; + } + + return; + } + + self->angle += self->yaw_speed; + self->nextthink = level.time + FRAMETIME; +} + +void target_viewshake_use(edict_t *self, edict_t *other, edict_t *activator) +{ + self->target_ent = activator; + self->holdtime = self->target_ent->client->ps.viewangles[YAW]; + + self->ideal_yaw = self->s.angles[YAW]; + self->angle = 0.0; + + self->think = target_viewshake_think; + self->nextthink = level.time + FRAMETIME; + + self->count--; +} + +void SP_target_viewshake(edict_t *self) +{ + if (!self->targetname) + { + gi.dprintf("target_viewshake with no targetname at %s\n", vtos(self->s.origin)); + G_FreeEdict(self); + return; + } + + self->use = target_viewshake_use; + self->svflags |= SVF_NOCLIENT; +} +//CW-- \ No newline at end of file diff --git a/src/g_target.c b/src/g_target.c index c58db0a..5c84072 100644 --- a/src/g_target.c +++ b/src/g_target.c @@ -2160,17 +2160,27 @@ TE_FORCEWALL, 37 ?? */ void target_effect_at (edict_t *self, edict_t *activator) { +/* if(!self || !activator) + { + return; + } + gi.WriteByte (svc_temp_entity); gi.WriteByte (self->style); gi.WritePosition (self->s.origin); gi.WriteShort (self - g_edicts); gi.multicast (self->s.origin, MULTICAST_PVS); -} +*/ } /* Poor man's target_steam TE_STEAM 40 */ void target_effect_steam (edict_t *self, edict_t *activator) { +/* if(!self || !activator) + { + return; + } + static int nextid; int wait; @@ -2196,7 +2206,7 @@ void target_effect_steam (edict_t *self, edict_t *activator) if (level.num_reflectors) ReflectSteam (self->s.origin,self->movedir,self->count,self->sounds,(int)(self->speed),wait,nextid); -} +*/ } //========================================================================= /* @@ -2210,6 +2220,11 @@ moving in (movedir) direction. //========================================================================= void target_effect_splash (edict_t *self, edict_t *activator) { +/* if(!self || !activator) + { + return; + } + gi.WriteByte(svc_temp_entity); gi.WriteByte(self->style); gi.WriteByte(self->count); @@ -2217,7 +2232,7 @@ void target_effect_splash (edict_t *self, edict_t *activator) gi.WriteDir(self->movedir); gi.WriteByte(self->sounds); gi.multicast(self->s.origin, MULTICAST_PVS); -} +*/ } //====================================================== /* @@ -2239,6 +2254,11 @@ in Potentially Visible Set from vector (origin) //====================================================== void target_effect_trail (edict_t *self, edict_t *activator) { +/* if(!self || !activator) + { + return; + } + edict_t *target; if (!self->target) return; @@ -2265,13 +2285,18 @@ void target_effect_trail (edict_t *self, edict_t *activator) (self->style == TE_BUBBLETRAIL2)) ReflectTrail(self->style,self->s.origin,target->s.origin); } -} +*/ } //=========================================================================== /* TE_LIGHTNING 33 Lightning bolt Similar but slightly different syntax to trail stuff */ void target_effect_lightning(edict_t *self, edict_t *activator) { +/* if(!self || !activator) + { + return; + } + edict_t *target; if (!self->target) return; @@ -2285,7 +2310,7 @@ void target_effect_lightning(edict_t *self, edict_t *activator) gi.WritePosition (target->s.origin); gi.WritePosition (self->s.origin); gi.multicast (self->s.origin, MULTICAST_PVS); -} +*/ } //=========================================================================== /* Spawns sparks of (type) from (start) in direction of (movdir) and @@ -2312,6 +2337,11 @@ Broadcasts to all in Potentially Visible Set from vector (origin) //====================================================== void target_effect_sparks (edict_t *self, edict_t *activator) { +/* if(!self || !activator) + { + return; + } + gi.WriteByte(svc_temp_entity); gi.WriteByte(self->style); gi.WritePosition(self->s.origin); @@ -2321,7 +2351,7 @@ void target_effect_sparks (edict_t *self, edict_t *activator) if (level.num_reflectors) ReflectSparks(self->style,self->s.origin,self->movedir); -} +*/ } //====================================================== /* @@ -2350,6 +2380,11 @@ Potentially Hearable set from vector (origin) //============================================================================== void target_effect_explosion (edict_t *self, edict_t *activator) { +/* if(!self || !activator) + { + return; + } + gi.WriteByte(svc_temp_entity); gi.WriteByte(self->style); gi.WritePosition(self->s.origin); @@ -2358,7 +2393,7 @@ void target_effect_explosion (edict_t *self, edict_t *activator) if (level.num_reflectors) ReflectExplosion (self->style, self->s.origin); -} +*/ } //=============================================================================== /* TE_TUNNEL_SPARKS 29 Similar to other splash effects, but Xatrix does some funky things with @@ -2366,6 +2401,11 @@ void target_effect_explosion (edict_t *self, edict_t *activator) void target_effect_tunnel_sparks (edict_t *self, edict_t *activator) { +/* if(!self || !activator) + { + return; + } + vec3_t origin; int i; @@ -2381,22 +2421,32 @@ void target_effect_tunnel_sparks (edict_t *self, edict_t *activator) gi.WriteByte (self->sounds + (rand()&7)); // color gi.multicast (self->s.origin, MULTICAST_PVS); } -} +*/ } //=============================================================================== /* TE_WIDOWBEAMOUT 50 */ void target_effect_widowbeam(edict_t *self, edict_t *activator) { +/* if(!self || !activator) + { + return; + } + gi.WriteByte (svc_temp_entity); gi.WriteByte (TE_WIDOWBEAMOUT); gi.WriteShort (20001); gi.WritePosition (self->s.origin); gi.multicast (self->s.origin, MULTICAST_PVS); -} +*/ } //=============================================================================== void target_effect_use(edict_t *self, edict_t *other, edict_t *activator) { +/* if(!self || !activator) + { + return; + } + if (self->spawnflags & 1) { // currently looped on - turn it off self->spawnflags &= ~1; @@ -2420,15 +2470,25 @@ void target_effect_use(edict_t *self, edict_t *other, edict_t *activator) if (!VectorLength(mover->velocity)) return; } self->play(self,activator); -} +*/ } void target_effect_think(edict_t *self) { +/* if(!self || !self->play || !level.time || !self->wait) + { + return; + } + self->play(self,NULL); self->nextthink = level.time + self->wait; -} +*/ } //=============================================================================== void SP_target_effect (edict_t *self) { +/* if(!self) + { + return; + } + if (self->movewith) self->movetype = MOVETYPE_PUSH; else @@ -2537,7 +2597,7 @@ void SP_target_effect (edict_t *self) if (self->spawnflags & 1) self->nextthink = level.time + 1; -} +*/ } /*===================================================================================== TARGET_ATTRACTOR - pulls target entity towards its origin @@ -3585,7 +3645,7 @@ void use_target_failure (edict_t *self, edict_t *other, edict_t *activator) gi.sound (activator, CHAN_VOICE|CHAN_RELIABLE, self->noise_index, 1, ATTN_NORM, 0); self->target_ent = activator; - if (stricmp(vid_ref->string,"gl")) + if (Q_stricmp(vid_ref->string,"gl")) { self->flags = 12; self->think = target_failure_fade_lights; @@ -4493,4 +4553,4 @@ void SP_target_viewshake(edict_t *self) self->use = target_viewshake_use; self->svflags |= SVF_NOCLIENT; } -//CW-- \ No newline at end of file +//CW-- diff --git a/src/g_trigger.c b/src/g_trigger.c index ca8fd8d..d879e7a 100644 --- a/src/g_trigger.c +++ b/src/g_trigger.c @@ -1,5 +1,10 @@ #include "g_local.h" + +#ifdef _WIN32 +#include +#endif + #define TRIGGER_MONSTER 1 #define TRIGGER_NOT_PLAYER 2 #define TRIGGER_START_OFF 4 @@ -1102,7 +1107,7 @@ void trigger_inside_think (edict_t *self) hit = touch[i]; if (!hit->inuse) continue; if (!hit->targetname) continue; - if (stricmp(self->pathtarget, hit->targetname)) continue; + if (Q_stricmp(self->pathtarget, hit->targetname)) continue; // must be COMPLETELY inside if (hit->absmin[0] < self->absmin[0]) continue; if (hit->absmin[1] < self->absmin[1]) continue; @@ -1794,12 +1799,96 @@ entlist_t DoNotMove[] = { void trans_ent_filename (char *filename) { - GameDirRelativePath("save/trans.ent",filename); + char *gamedirname = ""; + char *cfgdir; + char *savedirfilename = "save/trans.ent"; + + cvar_t *gamedircvar = gi.cvar("gamedir", "", 0); + if(strlen(gamedircvar->string)) + { + gamedirname = strcat(gamedircvar->string, "/"); + } +#ifdef _WIN32 + char *cur; + char *old; + char profile[MAX_PATH]; + int len; + wchar_t sprofile[MAX_PATH]; + wchar_t uprofile[MAX_PATH]; + cfgdir = "YamagiQ2"; + + /* The following lines implement a horrible + hack to connect the UTF-16 WinAPI to the + ASCII Quake II. While this should work in + most cases, it'll fail if the "Windows to + DOS filename translation" is switched off. + In that case the function will return NULL + and no homedir is used. */ + + /* Get the path to "My Documents" directory */ + SHGetFolderPathW(NULL, CSIDL_PERSONAL, NULL, 0, uprofile); + + /* Create a UTF-16 DOS path */ + len = GetShortPathNameW(uprofile, sprofile, sizeof(sprofile)); + + if (len == 0) + { + GameDirRelativePath(savedirfilename,filename); + return; + } + + /* Since the DOS path contains no UTF-16 characters, just convert it to ASCII */ + WideCharToMultiByte(CP_ACP, 0, sprofile, -1, profile, sizeof(profile), NULL, NULL); + + if (len == 0) + { + GameDirRelativePath(savedirfilename,filename); + return; + } + + /* Check if path is too long */ + if (len + 11 >= 256) + { + GameDirRelativePath(savedirfilename,filename); + return; + } + + /* Replace backslashes by slashes */ + cur = old = profile; + + if (strstr(cur, "\\") != NULL) + { + while (cur != NULL) + { + if ((cur - old) > 1) + { + *cur = '/'; + + } + + old = cur; + cur = strchr(old + 1, '\\'); + } + } +#else + char *profile; + cfgdir = ".yq2"; + + profile = getenv("HOME"); + + if (!profile) + { + GameDirRelativePath(savedirfilename,filename); + return; + } +#endif + + sprintf(filename, "%s/%s/%s%s", profile, cfgdir, gamedirname, savedirfilename); } int trigger_transition_ents (edict_t *changelevel, edict_t *self) { - char t_file[_MAX_PATH]; + char t_file[MAX_OSPATH]; int i, j; int total=0; qboolean nogo; diff --git a/src/g_weapon.c b/src/g_weapon.c index fa8788a..25a2eb4 100644 --- a/src/g_weapon.c +++ b/src/g_weapon.c @@ -10,7 +10,7 @@ a non-instant attack weapon. It checks to see if a monster's dodge function should be called. ================= */ -static void check_dodge(edict_t *self, vec3_t start, vec3_t dir, int speed) +/*static*/ void check_dodge(edict_t *self, vec3_t start, vec3_t dir, int speed) { vec3_t end; vec3_t v; @@ -35,7 +35,7 @@ static void check_dodge(edict_t *self, vec3_t start, vec3_t dir, int speed) } //CW++ Infantry guards can roll-dodge MG bursts -static void check_dodge_inf_mg(edict_t *self, vec3_t start, vec3_t dir) +/*static*/ void check_dodge_inf_mg(edict_t *self, vec3_t start, vec3_t dir) { vec3_t end; trace_t tr; @@ -154,7 +154,7 @@ fire_lead This is an internal support routine used for bullet/pellet based weapons. ================= */ -static void fire_lead (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int te_impact, int hspread, int vspread, int mod) +/*static*/ void fire_lead (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int te_impact, int hspread, int vspread, int mod) { trace_t tr; vec3_t dir; @@ -676,7 +676,7 @@ void Grenade_Evade (edict_t *monster) } } -static void Grenade_Add_To_Chain (edict_t *grenade) +/*static*/ void Grenade_Add_To_Chain (edict_t *grenade) { edict_t *ancestor; @@ -687,7 +687,7 @@ static void Grenade_Add_To_Chain (edict_t *grenade) grenade->prev_grenade = ancestor; } -static void Grenade_Remove_From_Chain (edict_t *grenade) +/*static*/ void Grenade_Remove_From_Chain (edict_t *grenade) { if (grenade->prev_grenade) { @@ -699,7 +699,7 @@ static void Grenade_Remove_From_Chain (edict_t *grenade) } } -static void Grenade_Explode (edict_t *ent) +/*static*/ void Grenade_Explode (edict_t *ent) { vec3_t origin; int mod; @@ -763,7 +763,7 @@ static void Grenade_Explode (edict_t *ent) G_FreeEdict (ent); } -static void Grenade_Touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) +/*static*/ void Grenade_Touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *surf) { if (other == ent->owner) return; @@ -1205,7 +1205,7 @@ void rocket_touch (edict_t *ent, edict_t *other, cplane_t *plane, csurface_t *su G_FreeEdict (ent); } -static void rocket_explode (edict_t *ent) +/*static*/ void rocket_explode (edict_t *ent) { vec3_t origin; int type; @@ -1232,7 +1232,7 @@ static void rocket_explode (edict_t *ent) G_FreeEdict (ent); } -static void rocket_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) +/*static*/ void rocket_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point) { self->takedamage = DAMAGE_NO; self->nextthink = level.time + FRAMETIME; diff --git a/src/m_actor.c b/src/m_actor.c index 7860330..32e1389 100644 --- a/src/m_actor.c +++ b/src/m_actor.c @@ -1768,7 +1768,7 @@ qboolean InPak(char *basedir, char *gamedir, char *filename) for(kk=0; kkclient->pers.spawn_landmark = false; // paranoia check self->client->pers.spawn_levelchange = false; + SetLazarusCrosshair(self); //backup crosshair self->client->zooming = 0; self->client->zoomed = false; SetSensitivities(self,true); @@ -1647,6 +1648,7 @@ void ClientBegin (edict_t *ent) } // DWH + SetLazarusCrosshair(ent); //backup crosshair SetSensitivities(ent,true); if (game.maxclients == 1) @@ -2417,13 +2419,13 @@ void ClientThink (edict_t *ent, usercmd_t *ucmd) viewing = LookingAt(ent,0,intersect,&range); if(viewing && viewing->classname) { - if(!stricmp(viewing->classname,"crane_control")) + if(!Q_stricmp(viewing->classname,"crane_control")) crane_control_action(viewing,ent,intersect); - if(!stricmp(viewing->classname,"target_lock_digit")) + if(!Q_stricmp(viewing->classname,"target_lock_digit")) lock_digit_increment(viewing,ent); - if(!stricmp(viewing->classname,"func_trainbutton") && (viewing->spawnflags & 1)) + if(!Q_stricmp(viewing->classname,"func_trainbutton") && (viewing->spawnflags & 1)) trainbutton_use(viewing,ent,ent); - if(!stricmp(viewing->classname,"func_monitor") && range <= 100) { + if(!Q_stricmp(viewing->classname,"func_monitor") && range <= 100) { use_camera(viewing,ent,ent); if(client->spycam && client->spycam->viewer == ent) { client->old_owner_angles[0] = ucmd->angles[0]; diff --git a/src/p_text.c b/src/p_text.c index efe1f20..e32d05e 100644 --- a/src/p_text.c +++ b/src/p_text.c @@ -242,14 +242,14 @@ void Do_Text_Display(edict_t *activator, int flags, char *message) strcpy(filename,basedir->string); if(strlen(gamedir->string)) { - strcat(filename,"\\"); + strcat(filename,"/"); strcat(filename,gamedir->string); } // First check for existence of text file in pak0.pak -> pak9.pak in_pak = false; for(i=0; i<=9 && !in_pak; i++) { - sprintf(pakfile,"%s\\pak%d.pak",filename,i); + sprintf(pakfile,"%s/pak%d.pak",filename,i); if (NULL != (f = fopen(pakfile, "rb"))) { num=fread(&pakheader,1,sizeof(pak_header_t),f); @@ -266,7 +266,7 @@ void Do_Text_Display(edict_t *activator, int flags, char *message) for(k=0; kbuffer,0,hnd->allocated); memcpy(hnd->buffer,temp_buffer,hnd->size); - p1 = hnd->buffer + (p2-temp_buffer); + + char *force_char_cast = temp_buffer; + p1 = hnd->buffer + (p2-force_char_cast); p2 = p1; free(temp_buffer); } @@ -478,7 +480,10 @@ void Do_Text_Display(edict_t *activator, int flags, char *message) memset(hnd->buffer,0,hnd->allocated); memcpy(hnd->buffer,temp_buffer,hnd->size); p2 = p1; - p1 = hnd->buffer + (p2-temp_buffer); + + char *force_char_cast = temp_buffer; + + p1 = hnd->buffer + (p2-force_char_cast); free(temp_buffer); } p2 = hnd->buffer + hnd->size; @@ -508,7 +513,10 @@ void Do_Text_Display(edict_t *activator, int flags, char *message) memset(hnd->buffer,0,hnd->allocated); memcpy(hnd->buffer,temp_buffer,hnd->size); p2 = p1; - p1 = hnd->buffer + (p2-temp_buffer); + + char *force_char_cast = temp_buffer; + + p1 = hnd->buffer + (p2-force_char_cast); free(temp_buffer); } p2 = hnd->buffer + hnd->size; @@ -592,7 +600,9 @@ void Do_Text_Display(edict_t *activator, int flags, char *message) while(*p2 != 0) p2++; p2++; - memcpy(p1,p2,hnd->buffer+hnd->size-p2+1); + + char *force_char_cast = hnd->buffer+hnd->size; + memcpy(p1,p2,force_char_cast-p2+1); hnd->nlines--; // Found one (only one is allowed) gi.sound (activator, CHAN_AUTO, gi.soundindex (sound), 1, ATTN_NORM, 0); diff --git a/src/p_view.c b/src/p_view.c index 1590b8e..a26838b 100644 --- a/src/p_view.c +++ b/src/p_view.c @@ -528,7 +528,7 @@ void SV_CalcBlend (edict_t *ent) float alpha; // Turn off fade for dead software players or they won't see menu - if((ent->health <= 0) && (stricmp(vid_ref->string,"gl"))) + if((ent->health <= 0) && (Q_stricmp(vid_ref->string,"gl"))) ent->client->fadein = 0; if(ent->client->fadein > level.framenum) @@ -1073,6 +1073,7 @@ void G_SetClientEvent (edict_t *ent) int r; r = rand() & 1 + ent->client->leftfoot*2; ent->client->leftfoot = 1 - ent->client->leftfoot; +#ifndef DISABLE_FMOD if(qFMOD_Footsteps) { switch (r){ @@ -1084,13 +1085,16 @@ void G_SetClientEvent (edict_t *ent) } else { +#endif switch (r){ case 0: gi.sound(ent,CHAN_VOICE,gi.soundindex("player/pl_ladder1.wav"),1.0,ATTN_NORM,0); break; case 1: gi.sound(ent,CHAN_VOICE,gi.soundindex("player/pl_ladder3.wav"),1.0,ATTN_NORM,0); break; case 2: gi.sound(ent,CHAN_VOICE,gi.soundindex("player/pl_ladder2.wav"),1.0,ATTN_NORM,0); break; case 3: gi.sound(ent,CHAN_VOICE,gi.soundindex("player/pl_ladder4.wav"),1.0,ATTN_NORM,0); break; } +#ifndef DISABLE_FMOD } +#endif } } } diff --git a/src/q_shared.c b/src/q_shared.c index 55d872a..f3f2f66 100644 --- a/src/q_shared.c +++ b/src/q_shared.c @@ -5,6 +5,7 @@ vec3_t vec3_origin = {0,0,0}; //============================================================================ #ifdef _WIN32 +#define GCC_COMP #pragma optimize( "", off ) #endif @@ -240,7 +241,7 @@ float Q_fabs (float f) #endif } -#if defined _M_IX86 && !defined C_ONLY +#if defined _M_IX86 && !defined GCC_COMP #pragma warning (disable:4035) __declspec( naked ) long Q_ftol( float f ) { @@ -324,7 +325,8 @@ BoxOnPlaneSide Returns 1, 2, or 1 + 2 ================== */ -#if !id386 || defined __linux__ + +#if !id386 || !defined _WIN32 || defined GCC_COMP int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p) { float dist1, dist2; diff --git a/src/removed/g_splinetrain.c b/src/removed/g_splinetrain.c new file mode 100644 index 0000000..3eb1d3f --- /dev/null +++ b/src/removed/g_splinetrain.c @@ -0,0 +1,429 @@ +#include "g_local.h" + +#define STATE_TOP 0 +#define STATE_BOTTOM 1 +#define STATE_UP 2 +#define STATE_DOWN 3 + +void Move_Calc (edict_t *ent, vec3_t dest, void(*func)(edict_t*)); +void train_blocked (edict_t *self, edict_t *other); +void train_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point); + +void train_spline_calc (edict_t *train, vec3_t p1, vec3_t p2, vec3_t a1, vec3_t a2, float m) +{ + /* p1, p2 = origins of path_* ents + a1, a2 = angles from path_* ents + m = decimal position along curve */ + + vec3_t v1, v2; // direction vectors + vec3_t c1, c2; // control-point coords + vec3_t d, v; // temps + float s; // vector scale + vec3_t p, a; // final computed position & angles for mover + // these greatly simplify/speed up equations + // (make sure m is already assigned a value) + float n = 1.0 - m; + float m2 = m * m; + float m3 = m2 * m; + float n2 = n * n; + float n3 = n2 * n; + float mn2_3 = m * n2 * 3; + float m2n_3 = m2 * n * 3; + float mn_2 = m * n * 2; + + // Beziers need two control-points to define the shape of the curve. + // These can be created from the available data. They are offset a + // specific distance from the endpoints (path_*s), in the direction + // of the endpoints' angle vectors (the 2nd control-point is offset in + // the opposite direction). The distance used is a fraction of the total + // distance between the endpoints, ensuring it's scaled proportionally. + // The factor of 0.4 is simply based on experimentation, as a value that + // yields nice even curves. + + AngleVectors(a1, v1, NULL, NULL); + AngleVectors(a2, v2, NULL, NULL); + + VectorSubtract(p2, p1, d); + s = sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]) * 0.4; + + VectorMA(p1, s, v1, c1); + VectorMA(p2, -s, v2, c2); + + // cubic interpolation of the four points + // gives the position along the curve + p[0] = n3 * p1[0] + mn2_3 * c1[0] + m2n_3 * c2[0] + m3 * p2[0]; + p[1] = n3 * p1[1] + mn2_3 * c1[1] + m2n_3 * c2[1] + m3 * p2[1]; + p[2] = n3 * p1[2] + mn2_3 * c1[2] + m2n_3 * c2[2] + m3 * p2[2]; + + // should be optional: + // first derivative of bezier formula provides direction vector + // along the curve (equation simplified in terms of m & n) + v[0] = (n2 * p1[0] - (n2 - mn_2) * c1[0] - (mn_2 - m2) * c2[0] - m2 * p2[0]) / -s; + v[1] = (n2 * p1[1] - (n2 - mn_2) * c1[1] - (mn_2 - m2) * c2[1] - m2 * p2[1]) / -s; + v[2] = (n2 * p1[2] - (n2 - mn_2) * c1[2] - (mn_2 - m2) * c2[2] - m2 * p2[2]) / -s; + vectoangles(v, a); + + VectorSubtract(p,train->mins,train->s.origin); + VectorCopy(a,train->s.angles); + + gi.linkentity(train); +} +void train_spline_next (edict_t *self); +void train_spline_wait (edict_t *self) +{ + if (self->target_ent->pathtarget) + { + char *savetarget; + edict_t *ent; + + ent = self->target_ent; + savetarget = ent->target; + ent->target = ent->pathtarget; + G_UseTargets (ent, self->activator); + ent->target = savetarget; + + // make sure we didn't get killed by a killtarget + if (!self->inuse) + return; + } + + // Lazarus: rotating trains + if(self->target_ent) { + if(self->target_ent->speed) { + self->speed = self->target_ent->speed; + self->moveinfo.speed = self->speed; + self->moveinfo.accel = self->moveinfo.decel = self->moveinfo.speed; + } + if(self->spawnflags & TRAIN_ROTATE) { + if(self->target_ent->pitch_speed) + self->pitch_speed = self->target_ent->pitch_speed; + if(self->target_ent->yaw_speed) + self->yaw_speed = self->target_ent->yaw_speed; + if(self->target_ent->roll_speed) + self->roll_speed = self->target_ent->roll_speed; + } + } + + if (self->moveinfo.wait) + { + if (self->moveinfo.wait > 0) + { + // Lazarus: turn off animation for stationary trains + self->s.effects &= ~(EF_ANIM_ALL | EF_ANIM_ALLFAST); + self->nextthink = level.time + self->moveinfo.wait; + self->think = train_spline_next; + } + else if (self->spawnflags & TRAIN_TOGGLE) // && wait < 0 + { + train_spline_next (self); + self->spawnflags &= ~TRAIN_START_ON; + VectorClear (self->velocity); + // Lazarus: turn off animation for stationary trains + self->s.effects &= ~(EF_ANIM_ALL | EF_ANIM_ALLFAST); + self->nextthink = 0; + } + + if (!(self->flags & FL_TEAMSLAVE)) + { + if (self->s.sound && self->moveinfo.sound_end) + gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_end, 1, ATTN_STATIC, 0); + self->s.sound = 0; + } + } + else + { + train_spline_next (self); + } + +} + +void train_spline_move (edict_t *self) +{ + edict_t *train; + + train = self->enemy; + if(!train || !train->inuse) + return; + if(train->from != train->to) + { + train_spline_calc (train, train->from->s.origin, train->to->s.origin, + train->from->s.angles, train->to->s.angles, + train->moveinfo.ratio); + train->moveinfo.ratio += train->moveinfo.speed * FRAMETIME / train->moveinfo.distance; + } + self->nextthink = level.time + FRAMETIME; +} + +void train_spline_next (edict_t *self) +{ + edict_t *ent; + vec3_t dest; + qboolean first; + vec3_t angles,v; + + first = true; +again: + if (!self->target) + { + self->s.sound = 0; + return; + } + + ent = G_PickTarget (self->target); + if (!ent) + { + gi.dprintf ("train_spline_next: bad target %s\n", self->target); + return; + } + + // spline stuff: + self->from = self->to; + self->to = ent; + VectorSubtract(self->from->s.origin,self->to->s.origin,v); + self->moveinfo.distance = VectorLength(v); + self->moveinfo.ratio = 0.0; + // end spline stuff + self->target = ent->target; + + // check for a teleport path_corner + if (ent->spawnflags & 1) + { + if (!first) + { + gi.dprintf ("connected teleport path_corners, see %s at %s\n", ent->classname, vtos(ent->s.origin)); + return; + } + first = false; + VectorSubtract (ent->s.origin, self->mins, self->s.origin); + VectorCopy (self->s.origin, self->s.old_origin); + self->s.event = EV_OTHER_TELEPORT; + gi.linkentity (self); + goto again; + } + + self->moveinfo.wait = ent->wait; + self->target_ent = ent; + + if (!(self->flags & FL_TEAMSLAVE)) + { + if (self->moveinfo.sound_start) + gi.sound (self, CHAN_NO_PHS_ADD+CHAN_VOICE, self->moveinfo.sound_start, 1, ATTN_STATIC, 0); + self->s.sound = self->moveinfo.sound_middle; + } + + VectorSubtract (ent->s.origin, self->mins, dest); + self->moveinfo.state = STATE_TOP; + VectorCopy (self->s.origin, self->moveinfo.start_origin); + VectorCopy (dest, self->moveinfo.end_origin); + + // Rroff rotating + if (self->spawnflags & TRAIN_ROTATE && !(ent->spawnflags & 2)) + { + // Lazarus: No no no :-). This is measuring from the center + // of the func_train to the path_corner. Should + // be path_corner to path_corner. + //VectorSubtract (ent->s.origin, self->s.origin, v); + VectorAdd(self->s.origin,self->mins,v); + VectorSubtract(ent->s.origin,v,v); + vectoangles(v,angles); + self->ideal_yaw = angles[YAW]; + self->ideal_pitch = angles[PITCH]; + if(self->ideal_pitch < 0) self->ideal_pitch += 360; + self->ideal_roll = ent->roll; + + VectorClear(self->movedir); + self->movedir[1] = 1.0; + } + Move_Calc (self, dest, train_spline_wait); + self->spawnflags |= TRAIN_START_ON; +} + +void train_spline_resume (edict_t *self) +{ + edict_t *ent; + vec3_t dest; + + ent = self->target_ent; + + VectorSubtract (ent->s.origin, self->mins, dest); + self->moveinfo.state = STATE_TOP; + VectorCopy (self->s.origin, self->moveinfo.start_origin); + VectorCopy (dest, self->moveinfo.end_origin); + Move_Calc (self, dest, train_spline_wait); + self->spawnflags |= TRAIN_START_ON; +} + +void func_train_spline_find (edict_t *self) +{ + edict_t *ent; + + if (!self->target) + { + gi.dprintf ("train_spline_find: no target\n"); + return; + } + ent = G_PickTarget (self->target); + if (!ent) + { + gi.dprintf ("train_spline_find: target %s not found\n", self->target); + return; + } + + // Lazarus: trains can change speed at path_corners + if(ent->speed) { + self->speed = ent->speed; + self->moveinfo.speed = self->speed; + self->moveinfo.accel = self->moveinfo.decel = self->moveinfo.speed; + } + if(ent->pitch_speed) + self->pitch_speed = ent->pitch_speed; + if(ent->yaw_speed) + self->yaw_speed = ent->yaw_speed; + if(ent->roll_speed) + self->roll_speed = ent->roll_speed; + + // Lazarus: spline stuff + self->from = self->to = ent; + + self->target = ent->target; + + ent->think = train_spline_move; + ent->enemy = self; + ent->nextthink = level.time + FRAMETIME; + + VectorSubtract (ent->s.origin, self->mins, self->s.origin); + gi.linkentity (self); + + // if not triggered, start immediately + if (!self->targetname) + self->spawnflags |= TRAIN_START_ON; + + if (self->spawnflags & TRAIN_START_ON) + { + // Lazarus: animated trains + if (self->spawnflags & TRAIN_ANIMATE) + self->s.effects |= EF_ANIM_ALL; + else if (self->spawnflags & TRAIN_ANIMATE_FAST) + self->s.effects |= EF_ANIM_ALLFAST; + + self->nextthink = level.time + FRAMETIME; + self->think = train_spline_next; + self->activator = self; + } +} + +void train_spline_use (edict_t *self, edict_t *other, edict_t *activator) +{ + self->activator = activator; + + if (self->spawnflags & TRAIN_START_ON) + { + if (!(self->spawnflags & TRAIN_TOGGLE)) + return; + self->spawnflags &= ~TRAIN_START_ON; + VectorClear (self->velocity); + VectorClear (self->avelocity); + self->s.effects &= ~(EF_ANIM_ALL | EF_ANIM_ALLFAST); + self->nextthink = 0; + } + else + { + if (self->spawnflags & TRAIN_ANIMATE) + self->s.effects |= EF_ANIM_ALL; + else if (self->spawnflags & TRAIN_ANIMATE_FAST) + self->s.effects |= EF_ANIM_ALLFAST; + + if (self->target_ent) + train_spline_resume(self); + else + train_spline_next(self); + } +} + +void SP_func_train_spline (edict_t *self) +{ + self->movetype = MOVETYPE_PUSH; + + VectorClear (self->s.angles); + self->blocked = train_blocked; + if (self->spawnflags & TRAIN_BLOCK_STOPS) + self->dmg = 0; + else + { + if (!self->dmg) + self->dmg = 100; + } + self->solid = SOLID_BSP; + gi.setmodel (self, self->model); + + if (st.noise) + self->moveinfo.sound_middle = gi.soundindex (st.noise); + + if (!self->speed) + self->speed = 100; + + // Lazarus: Do NOT set default values for rotational speeds - if they're 0, then they're 0. + + self->moveinfo.speed = self->speed; + self->moveinfo.accel = self->moveinfo.decel = self->moveinfo.speed; + self->use = train_spline_use; + + // Lazarus: damageable + if (self->health) { + self->die = train_die; + self->takedamage = DAMAGE_YES; + } else { + self->die = NULL; + self->takedamage = DAMAGE_NO; + } + + gi.linkentity (self); + if (self->target) + { + // start trains on the second frame, to make sure their targets have had + // a chance to spawn + self->nextthink = level.time + FRAMETIME; + self->think = func_train_spline_find; + } + else + { + gi.dprintf ("func_train_spline without a target at %s\n", vtos(self->absmin)); + } + + // Lazarus: TRAIN_SMOOTH forces trains to go directly to Move_Done from + // Move_Final rather than slowing down (if necessary) for one + // frame. + if (self->spawnflags & TRAIN_SMOOTH) + self->smooth_movement = true; + else + self->smooth_movement = false; + + // Lazarus: make noise field work w/o origin brush + // ver. 1.3 change - do this for ALL trains +// if(st.noise && !VectorLength(self->s.origin) ) + if(st.noise) + { + edict_t *speaker; + + self->noise_index = self->moveinfo.sound_middle; + self->moveinfo.sound_middle = 0; + speaker = G_Spawn(); + speaker->classname = "moving_speaker"; + speaker->s.sound = 0; + speaker->volume = 1; + speaker->attenuation = 1; + speaker->owner = self; + speaker->think = Moving_Speaker_Think; + speaker->nextthink = level.time + 2*FRAMETIME; + speaker->spawnflags = 7; // owner must be moving to play + self->speaker = speaker; + if(VectorLength(self->s.origin)) + VectorCopy(self->s.origin,speaker->s.origin); + else { + VectorAdd(self->absmin,self->absmax,speaker->s.origin); + VectorScale(speaker->s.origin,0.5,speaker->s.origin); + } + VectorSubtract(speaker->s.origin,self->s.origin,speaker->offset); + } + +} diff --git a/src/removed/majbitch.c b/src/removed/majbitch.c new file mode 100644 index 0000000..000d9c8 --- /dev/null +++ b/src/removed/majbitch.c @@ -0,0 +1,903 @@ +#include +#include +#include +#include +#include + +#ifndef NULL + #define NULL ((void *)0) +#endif + +typedef unsigned char byte; +typedef float vec_t; +typedef vec_t vec3_t[3]; + +#define LUMP_ENTDATA 0 +#define LUMP_PLANES 1 +#define LUMP_VERTEX 2 +#define LUMP_VISLIST 3 +#define LUMP_NODES 4 +#define LUMP_TEXINFO 5 +#define LUMP_FACES 6 +#define LUMP_LIGHTDATA 7 +#define LUMP_LEAFS 8 +#define LUMP_LEAFFACES 9 +#define LUMP_LEAFBRUSHES 10 +#define LUMP_EDGES 11 +#define LUMP_SURFEDGES 12 +#define LUMP_MODELS 13 +#define LUMP_BRUSHES 14 +#define LUMP_BRUSHSIDES 15 +#define LUMP_POP 16 +#define LUMP_AREAS 17 +#define LUMP_AREAPORTALS 18 +#define LUMP_HEADER 19 + +#define MAX_MAP_AREAS 256 +#define MAX_MAP_AREAPORTALS 1024 +#define MAX_MAP_MODELS 1024 +#define MAX_MAP_ENTITIES 2048 +#define MAX_MAP_BRUSHES 8192 +#define MAX_MAP_TEXINFO 8192 +#define MAX_MAP_PLANES 65536 +#define MAX_MAP_NODES 65536 +#define MAX_MAP_BRUSHSIDES 65536 +#define MAX_MAP_LEAFS 65536 +#define MAX_MAP_VERTS 65536 +#define MAX_MAP_FACES 65536 +#define MAX_MAP_LEAFFACES 65536 +#define MAX_MAP_LEAFBRUSHES 65536 +#define MAX_MAP_PORTALS 65536 +#define MAX_MAP_EDGES 128000 +#define MAX_MAP_SURFEDGES 256000 + +#define MAX_MAP_ENTSTRING 0x40000 +#define MAX_MAP_LIGHTING 0x200000 +#define MAX_MAP_VISIBILITY 0x100000 + +// 0-2 are axial planes +#define PLANE_X 0 +#define PLANE_Y 1 +#define PLANE_Z 2 + +// 3-5 are non-axial planes +#define PLANE_ANYX 3 +#define PLANE_ANYY 4 +#define PLANE_ANYZ 5 + +#define DVIS_PVS 0 // vis.bitofs[][0] +#define DVIS_PHS 1 // vis.bitofs[][1] + +typedef unsigned char byte; + +//============================= +// Entire BSP Tree Structures +//============================= + +typedef struct { + float normal[3]; // normal to this plane + float dist; // used with normal to determine front/back of plane + int type; // type of plane, (see: PLANE_X ... PLANE_ANYZ) +} plane_t; + +typedef struct { + float origin[3]; // location of this vertex +} vertex_t; + +typedef struct { + float blend[2][4]; // [s/t][4] - see q2 blend[] // Maj++ renamed + int flags; // miptex flags (See SURF_* flag types) + int value; // light emission + char texture[32]; // texture name (ie, "SKY") + int nexttexinfo; // next texinfo (-1 = end of chain) +} texinfo_t; + +typedef struct { + byte lightchar[1]; +} lightdata_t; + +typedef struct { + short planenum; // map->plane[] + short side; // 0 or 1 -1=none + int firstedge; // map->edge[] + short numedges; // total edges associated with this face + short texinfo; // map->texinfo[] + byte lightstyle[4];// see Q2 lightstyles.. + int lightofs; // map->lightdata[] +} face_t; + +typedef struct { + int planenum; // map->plane[] + int right; // child[0]: -1=leaf[-(right+1)],otherwise index to child node + int left; // child[1]: -1=leaf[-(left+1)], otherwise index to child node + short mins[3]; // minsize of this node (for tracing). + short maxs[3]; // maxsize of this node (for tracing). + short firstface; // map->face[] + short numfaces; // total faces associated with this node +} node_t; + +typedef struct { + int portalnum; // number of this areaportal + int nextarea; // connected area[] +} areaportal_t; + +typedef struct { + int numareaportals; // total areaportals associated with this area + int firstareaportal; // map->areaportal[] +} area_t; + +typedef struct { + short dleaffaces[MAX_MAP_LEAFFACES]; // map->face[] +} leafface_t; + +typedef struct { + short planenum; // map->plane[] + short texinfo; // map->texinfo[] +} brushside_t; + +typedef struct { + int firstbrushside;// map->brushside[] + int numbrushsides; // total brushsides associated with this surface + int contents; // pointcontents of this surface.. +} brush_t; + +typedef struct { + short dleafbrushes[MAX_MAP_LEAFBRUSHES]; // map->brush[] +} leafbrush_t; + +typedef struct { + int numclusters; // ???? + int bitofs[8][2];// ???? +} vis_t; + +typedef struct { + int contents; // pointcontents of this leaf + short cluster; // + short area; // + short mins[3]; // size of leaf + short maxs[3]; // size of leaf + short firstleafface; // map->leafface[] + short numleaffaces; // total leaffaces associated with this leaf + short firstleafbrush; // map->leafbrushes[] + short numleafbrushes; // total leafbrushes associated with this leaf +} leaf_t; + +typedef struct { + short v[2]; // vertex[xy] of this edge +} edge_t; + +typedef struct { + int dsurfedges[1];// map->edge[] +} surfedge_t; + +typedef struct { + byte dpop[256]; // ??????? +} pop_t; + +typedef struct { + float mins[3]; // size of model + float maxs[3]; // size of model + float origin[3]; // location of model + long rootnode; // start of BSP tree + long firstface; // map->face[] + long numfaces; // total faces associated with this model +} model_t; + +typedef struct { + char entchar[MAX_MAP_ENTSTRING]; // map entities??? Maj++ +} entdata_t; + +//=============================================== +typedef struct cplane_s { + vec3_t normal; // normal vector + float dist; // distance + byte type; // for fast side tests + byte signbits; // direction of normal + byte pad[2]; // unused +} cplane_t; + +//============================= +// BSP Header Structures +//============================= + +typedef struct { + int fileofs; + int filelen; +} lump_t; + +// LUMP_HEADER +typedef struct { + char string[4]; + long version; + lump_t lumps[LUMP_HEADER]; +} header_t; + +header_t header; + +//=================================== +// Map structure (w/o header).. +//=================================== +typedef struct map_s { + int num_entdatas;// count of entdata_t's. + entdata_t *entdata; // 0=LUMP INDEX + int num_planes; // count of plane_t's + cplane_t *plane; // 1=LUMP INDEX + int num_vertexs; + vertex_t *vertex; // 2 + int num_viss; + vis_t *vis; // 3 + int num_nodes; + node_t *node; // 4 + int num_texinfos; + texinfo_t *texinfo; // 5 + int num_faces; + face_t *face; // 6 + long int num_lightchars; + lightdata_t *lightdata; // 7 + int num_leafs; + leaf_t *leaf; // 8 + int num_leaffaces; + leafface_t *leafface; // 9 + int num_leafbrushes; + leafbrush_t *leafbrush; // 10 + int num_edges; + edge_t *edge; // 11 + long int num_surfedges; + surfedge_t *surfedge; // 12 + int num_models; + model_t *model; // 13 + int num_brushes; + brush_t *brush; // 14 + int num_brushsides; + brushside_t *brushside; // 15 + int num_popchars; + pop_t *pop; // 16 + int num_areas; + area_t *area; // 17 + int num_areaportals; + areaportal_t *areaportal; // 18 +} map_t; + +map_t *map; + +//================================================== +//========== MEMORY ALLOCATION ROUTINES ============ +//================================================== + +//================================================== +void *xmalloc(unsigned long size) { +void *mem; + + mem = malloc(size); + if (!mem){ + fprintf(stderr, "xmalloc: %s\n", strerror(errno)); + exit(1); } + return mem; +} +//================================================== +//============= DATA BUFFER READING ================ +//================================================== + +unsigned long getp; // Location of pointer in buffer +unsigned long numbytes; // Size of buffer (in bytes) +unsigned char *buffer; // Pointer to buffered data. + +//================================================== +// Move num bytes from location into address +//================================================== +void getmem(void *addr, unsigned long bytes) { + memmove(addr, buffer+getp, bytes); + getp += bytes; +} + +//===================================================== +//========= ROUTINES FOR READING BSP STRUCTS ========== +//===================================================== + +//===================================================== +// LUMP 0 - Read all BSP entdata chars from buffer. +//===================================================== +entdata_t *read_entdata(void) { +entdata_t *entdata; +int i; + + // Set GET pointer to start of entdata_t data + getp = header.lumps[LUMP_ENTDATA].fileofs; + + // How many entdata chars are there? + map->num_entdatas = header.lumps[LUMP_ENTDATA].filelen; + + fprintf(stderr, "entdata count=%d\n",map->num_entdatas); + + if (map->num_entdatas <= 0) return NULL; + + // Allocate 1 entdata_t structure + entdata = (entdata_t *)xmalloc(sizeof(entdata_t)); + + // Sequentially read entchar[] chars from buffer + for (i=0; i < map->num_entdatas; i++) + getmem((void *)&entdata->entchar[i],sizeof(entdata->entchar[0])); + + return entdata; +} + +//===================================================== +// LUMP 1 - Read all BSP plane structs from buffer. +// Modified to use cplane_t instead +//===================================================== +cplane_t *read_planes(void) { +cplane_t *plane; +int i; + + // Set GET pointer to start of plane_t data + getp = header.lumps[LUMP_PLANES].fileofs; + + // How many plane_t records are there? + map->num_planes = header.lumps[LUMP_PLANES].filelen/sizeof(plane_t); + + fprintf(stderr, "plane count=%d\n",map->num_planes); + + if (map->num_planes <= 0) return NULL; + + // Allocate all plane_t structures for num_planes + plane = (cplane_t *)xmalloc(map->num_planes*sizeof(cplane_t)); + + // Sequentially read plane_t structs from buffer + for (i=0; i < map->num_planes; i++) { + getmem((void *)&plane[i],sizeof(plane_t)); + + plane[i].signbits=(int)(plane[i].normal[0] < 0.0F); + + if (plane[i].normal[1] < 0.0F) + plane[i].signbits |= 2; + + if (plane[i].normal[2] < 0.0F) + plane[i].signbits |= 4; + + plane[i].pad[0] = 0; + plane[i].pad[1] = 0; } + + return plane; +} + +//===================================================== +// LUMP 2 - Read all BSP vertex structs from buffer. +//===================================================== +vertex_t *read_vertexs(void) { +vertex_t *vertex; +int i; + + // Set GET pointer to start of vertex_t data + getp = header.lumps[LUMP_VERTEX].fileofs; + + // How many vertex_t records are there? + map->num_vertexs = header.lumps[LUMP_VERTEX].filelen/sizeof(vertex_t); + + fprintf(stderr, "vertex count=%d\n",map->num_vertexs); + + if (map->num_vertexs <= 0) return NULL; + + // Allocate all vertex_t structures for num_vertexs + vertex = (vertex_t *)xmalloc(map->num_vertexs*sizeof(vertex_t)); + + // Sequentially read vertex_t structs from buffer + for (i=0; i < map->num_vertexs; i++) + getmem((void *)&vertex[i],sizeof(vertex_t)); + + return vertex; +} + +//===================================================== +// LUMP 3 - Read all BSP vis structs from buffer. +//===================================================== +vis_t *read_vis(void) { +vis_t *viss; +int i; + + // Set GET pointer to start of vis_t data + getp = header.lumps[LUMP_VISLIST].fileofs; + + // How many vis_t records are there? + map->num_viss = header.lumps[LUMP_VISLIST].filelen/sizeof(vis_t); + + fprintf(stderr, "vis count=%d\n",map->num_viss); + + if (map->num_viss <= 0) return NULL; + + // Allocate all vis_t structures for num_viss + viss = (vis_t *)xmalloc(map->num_viss*sizeof(vis_t)); + + // Sequentially read vis_t structs from buffer + for (i=0; i < map->num_viss; i++) + getmem((void *)&viss[i],sizeof(vis_t)); + + return viss; +} + +//===================================================== +// LUMP 4 - Read all BSP node structs from buffer. +//===================================================== +node_t *read_nodes(void) { +node_t *node; +int i; + + // Set GET pointer to start of node_t data + getp = header.lumps[LUMP_NODES].fileofs; + + // How many node_t records are there? + map->num_nodes = header.lumps[LUMP_NODES].filelen/sizeof(node_t); + + fprintf(stderr, "node count=%d\n",map->num_nodes); + + if (map->num_nodes <= 0) return NULL; + + // Allocate all node_t structures for num_nodes + node = (node_t *)xmalloc(map->num_nodes*sizeof(node_t)); + + // Sequentially read node_t structs from buffer + for (i=0; i < map->num_nodes; i++) + getmem((void *)&node[i],sizeof(node_t)); + + return node; +} + +//===================================================== +// LUMP 5 - Read all BSP texinfo structs from buffer. +//===================================================== +texinfo_t *read_texinfo(void) { +texinfo_t *texinfo; +int i; + + // Set GET pointer to start of texinfo_t data + getp = header.lumps[LUMP_TEXINFO].fileofs; + + // How many texinfo_t records are there? + map->num_texinfos = header.lumps[LUMP_TEXINFO].filelen/sizeof(texinfo_t); + + fprintf(stderr, "texinfo count=%d\n",map->num_texinfos); + + if (map->num_texinfos <= 0) return NULL; + + // Allocate all texinfo_t structures for num_texinfos + texinfo = (texinfo_t *)xmalloc(map->num_texinfos*sizeof(texinfo_t)); + + // Sequentially read texinfo_t structs from buffer + for (i=0; i < map->num_texinfos; i++) + getmem((void *)&texinfo[i],sizeof(texinfo_t)); + + return texinfo; +} + +//===================================================== +// LUMP 6 - Read all BSP face structs from buffer. +//===================================================== +face_t *read_faces(void) { +face_t *face; +int i; + + // Set GET pointer to start of face_t data + getp = header.lumps[LUMP_FACES].fileofs; + + // How many face_t records are there? + map->num_faces = header.lumps[LUMP_FACES].filelen/sizeof(face_t); + + fprintf(stderr, "face count=%d\n",map->num_faces); + + if (map->num_faces <= 0) return NULL; + + // Allocate all face_t structures for num_faces + face = (face_t *)xmalloc(map->num_faces*sizeof(face_t)); + + // Sequentially read face_t structs from buffer + for (i=0; i < map->num_faces; i++) + getmem((void *)&face[i],sizeof(face_t)); + + return face; +} + +//===================================================== +// LUMP 7 - Read all BSP lightdata chars from buffer. +//===================================================== +lightdata_t *read_lightdata(void) { +lightdata_t *lightdata; +lightdata_t templight; +long int i; + + // Set GET pointer to start of lightdata_t data + getp = header.lumps[LUMP_LIGHTDATA].fileofs; + + // How many lightdata chars are there? + map->num_lightchars = header.lumps[LUMP_LIGHTDATA].filelen; + + fprintf(stderr, "lightdata count=%d\n",map->num_lightchars); + + if (map->num_lightchars <= 0) return NULL; + + // Allocate 1 lightdata_t structure + lightdata = (lightdata_t *)xmalloc(map->num_lightchars*sizeof(templight.lightchar[0])); + + // Sequentially read all lightchar[] chars from buffer + for (i=0; i < map->num_lightchars; i++) + getmem((void *)&lightdata->lightchar[i],sizeof(lightdata->lightchar[0])); + + return lightdata; +} + +//===================================================== +// LUMP 8 - Read all BSP leaf structs from buffer. +//===================================================== +leaf_t *read_leafs(void) { +leaf_t *leaf; +int i; + + // Set GET pointer to start of leaf_t data + getp = header.lumps[LUMP_LEAFS].fileofs; + + // How many leaf_t records are there? + map->num_leafs = header.lumps[LUMP_LEAFS].filelen/sizeof(leaf_t); + + fprintf(stderr, "leaf count=%d\n",map->num_leafs); + + if (map->num_leafs <= 0) return NULL; + + // Allocate all leaf_t structures for num_leafs + leaf = (leaf_t *)xmalloc(map->num_leafs*sizeof(leaf_t)); + + // Sequentially read leaf_t structs from buffer + for (i=0; i < map->num_leafs; i++) + getmem((void *)&leaf[i],sizeof(leaf_t)); + + return leaf; +} + +//===================================================== +// LUMP 9 - Read all BSP leafface structs from buffer. +//===================================================== +leafface_t *read_leaffaces(void) { +leafface_t *leafface; +leafface_t tempface; +int i; + + // Set GET pointer to start of leafface_t data + getp = header.lumps[LUMP_LEAFFACES].fileofs; + + // How many leafface_t records are there? + map->num_leaffaces = header.lumps[LUMP_LEAFFACES].filelen; + + fprintf(stderr, "leafface count=%d\n",map->num_leaffaces); + + if (map->num_leaffaces <= 0) return NULL; + + // Allocate 1 leafface_t structure + leafface = (leafface_t *)xmalloc(map->num_leaffaces*sizeof(tempface.dleaffaces[0])); + + // Sequentially read all dleafface[] chars from buffer + for (i=0; i < map->num_leaffaces; i++) + getmem((void *)&leafface->dleaffaces[i],sizeof(leafface->dleaffaces[0])); + + return leafface; +} + +//===================================================== +// LUMP 10 - Read all BSP leafbrush chars from buffer. +//===================================================== +leafbrush_t *read_leafbrushes(void) { +leafbrush_t *leafbrush; +leafbrush_t tempbrush; +int i; + + // Set GET pointer to start of leafbrush_t data + getp = header.lumps[LUMP_LEAFBRUSHES].fileofs; + + // How many leafbrush_t records are there? + map->num_leafbrushes = header.lumps[LUMP_LEAFBRUSHES].filelen; + + fprintf(stderr, "leafbrush count=%d\n",map->num_leafbrushes); + + if (map->num_leafbrushes <= 0) return NULL; + + // Allocate 1 leafbrush_t structure + leafbrush = (leafbrush_t *)xmalloc(map->num_leafbrushes*sizeof(tempbrush.dleafbrushes[0])); + + // Sequentially read all dleafbrushes[] chars from buffer + for (i=0; i < map->num_leafbrushes; i++) + getmem((void *)&leafbrush->dleafbrushes[i],sizeof(leafbrush->dleafbrushes[0])); + + return leafbrush; +} + +//===================================================== +// LUMP 11 - Read all BSP edge structs from buffer. +//===================================================== +edge_t *read_edges(void) { +edge_t *edge; +int i; + + // Set GET pointer to start of edge_t data + getp = header.lumps[LUMP_EDGES].fileofs; + + // How many edge_t records are there? + map->num_edges = header.lumps[LUMP_EDGES].filelen/sizeof(edge_t); + + fprintf(stderr, "edge count=%d\n",map->num_edges); + + if (map->num_edges <= 0) return NULL; + + // Allocate all edge_t structures for num_edges + edge = (edge_t *)xmalloc(map->num_edges*sizeof(edge_t)); + + // Sequentially read edge_t structs from buffer + for (i=0; i < map->num_edges; i++) + getmem((void *)&edge[i],sizeof(edge_t)); + + return edge; +} + +//===================================================== +// LUMP 12 - Read all BSP surfedge chars from buffer. +//===================================================== +surfedge_t *read_surfedges(void) { +surfedge_t *surfedge; +surfedge_t surftemp; +long int i; + + // Set GET pointer to start of surfedge_t data + getp = header.lumps[LUMP_SURFEDGES].fileofs; + + // How many surfedge_t records are there? + map->num_surfedges = header.lumps[LUMP_SURFEDGES].filelen; + + fprintf(stderr, "surfedge count=%d\n",map->num_surfedges); + + if (map->num_surfedges <= 0) return NULL; + + // Allocate 1 surfedge_t structure + surfedge = (surfedge_t *) xmalloc(map->num_surfedges*sizeof(surftemp.dsurfedges[0])); + + // Sequentially read all dsurfedges[] chars from buffer + for (i=0; i < map->num_surfedges; i++) + getmem((void *)&surfedge->dsurfedges[i],sizeof(surfedge->dsurfedges[0])); + + return surfedge; +} + +//===================================================== +// LUMP 13 - Read all BSP model structs from buffer. +//===================================================== +model_t *read_models(void) { +model_t *model; +int i; + + // Set GET pointer to start of model_t data + getp = header.lumps[LUMP_MODELS].fileofs; + + // How many model_t records are there? + map->num_models = header.lumps[LUMP_MODELS].filelen/sizeof(model_t); + + fprintf(stderr, "model count=%d\n",map->num_models); + + if (map->num_models <= 0) return NULL; + + // Allocate all model_t structures for num_models + model = (model_t *)xmalloc(map->num_models*sizeof(model_t)); + + // Sequentially read model_t structs from buffer + for (i=0; i < map->num_models; i++) + getmem((void *)&model[i],sizeof(model_t)); + + return model; +} + +//===================================================== +// LUMP 14 - Read all BSP brush structs from buffer. +//===================================================== +brush_t *read_brushes(void) { +brush_t *brush; +int i; + + // Set GET pointer to start of brush_t data + getp = header.lumps[LUMP_BRUSHES].fileofs; + + // How many brush_t records are there? + map->num_brushes = header.lumps[LUMP_BRUSHES].filelen/sizeof(brush_t); + + fprintf(stderr, "brush count=%d\n",map->num_brushes); + + if (map->num_brushes <= 0) return NULL; + + // Allocate all brush_t structures for num_brushes + brush = (brush_t *)xmalloc(map->num_brushes*sizeof(brush_t)); + + // Sequentially read brush_t structs from buffer + for (i=0; i < map->num_brushes; i++) + getmem((void *)&brush[i],sizeof(brush_t)); + + return brush; +} + +//===================================================== +// LUMP 15 - Read all BSP brushside structs from buffer. +//===================================================== +brushside_t *read_brushsides(void) { +brushside_t *brushside; +int i; + + // Set GET pointer to start of brushside_t data + getp = header.lumps[LUMP_BRUSHSIDES].fileofs; + + // How many brushside_t records are there? + map->num_brushsides = header.lumps[LUMP_BRUSHSIDES].filelen/sizeof(brushside_t); + + fprintf(stderr, "brushside count=%d\n",map->num_brushsides); + + if (map->num_brushsides <= 0) return NULL; + + // Allocate all brushside_t structures for num_brushsides + brushside = (brushside_t *)xmalloc(map->num_brushsides*sizeof(brushside_t)); + + // Sequentially read brushside_t structs from buffer + for (i=0; i < map->num_brushsides; i++) + getmem((void *)&brushside[i],sizeof(brushside_t)); + + return brushside; +} + +//===================================================== +// LUMP 16 - Read all BSP pop chars from buffer. +//===================================================== +pop_t *read_pop(void) { +pop_t *pop; +int i; + + // Set GET pointer to start of pop_t data + getp = header.lumps[LUMP_POP].fileofs; + + // How many pop chars are there? + map->num_popchars = header.lumps[LUMP_POP].filelen; + + fprintf(stderr, "pop count=%d\n",map->num_popchars); + + if (map->num_popchars <= 0) return NULL; + + // Allocate 1 pop_t structure + pop = (pop_t *)xmalloc(sizeof(pop_t)); + + // Sequentially read dpop[] bytes from buffer + for (i=0; i < map->num_popchars; i++) + getmem((void *)&pop->dpop[i],sizeof(pop->dpop[0])); + + return pop; +} + +//===================================================== +// LUMP 17 - Read all BSP area structs from buffer. +//===================================================== +area_t *read_areas(void) { +area_t *area; +int i; + + // Set GET pointer to start of area_t data + getp = header.lumps[LUMP_AREAS].fileofs; + + // How many area_t records are there? + map->num_areas = header.lumps[LUMP_AREAS].filelen/sizeof(area_t); + + fprintf(stderr, "area count=%d\n",map->num_areas); + + if (map->num_areas <= 0) return NULL; + + // Allocate all area_t structures for num_areas + area = (area_t *)xmalloc(map->num_areas*sizeof(area_t)); + + // Sequentially read area_t structs from buffer + for (i=0; i < map->num_areas; i++) + getmem((void *)&area[i],sizeof(area_t)); + + return area; +} + +//===================================================== +// LUMP 18 - Read all BSP areaportal structs from buffer. +//===================================================== +areaportal_t *read_areaportals(void) { +areaportal_t *areaportal; +int i; + + // Set GET pointer to start of areaportal_t data + getp = header.lumps[LUMP_AREAPORTALS].fileofs; + + // How many areaportal_t records are there? + map->num_areaportals = header.lumps[LUMP_AREAPORTALS].filelen/sizeof(areaportal_t); + + fprintf(stderr, "areaportal count=%d\n",map->num_areaportals); + + if (map->num_areaportals <= 0) return NULL; + + // Allocate all areaportal_t structures for num_areaportals + areaportal = (areaportal_t *)xmalloc(map->num_areaportals*sizeof(areaportal_t)); + + // Sequentially read areaportal_t structs from buffer + for (i=0; i < map->num_areaportals; i++) + getmem((void *)&areaportal[i],sizeof(areaportal_t)); + + return areaportal; +} + +//================================================ +// Reads entire BSP file into map_t struct. +//================================================ +void load_bsp_map(char *filepath) { +FILE *f; +long size; + + f = fopen(filepath, "rb"); + if (!f) { + fprintf(stderr, "fopen: %s\n", strerror(errno)); + fclose(f); + return ; } + + errno=0; + fseek(f, 0L, SEEK_END); + if (errno) { + fprintf(stderr, "fseek: %s\n", strerror(errno)); + return ; } + + errno=0; + size = ftell(f); + if (errno) { + fprintf(stderr, "ftell: %s\n", strerror(errno)); + fclose(f); + return ; } + + fseek(f, 0L, SEEK_SET); + buffer=xmalloc(size); + + fread(buffer, 1, size, f); + fclose(f); + + // Read BSP header + getmem((void*)&header,sizeof(header_t)); + + // Allocate entire map_t struct + map = (map_t *)xmalloc(sizeof(map_t)); + + map->entdata = read_entdata(); + map->plane = read_planes(); + map->vertex = read_vertexs(); + map->vis = read_vis(); + map->node = read_nodes(); + map->texinfo = read_texinfo(); + map->face = read_faces(); + map->lightdata = read_lightdata(); + map->leaf = read_leafs(); + map->leafface = read_leaffaces(); + map->leafbrush = read_leafbrushes(); + map->edge = read_edges(); + map->surfedge = read_surfedges(); + map->model = read_models(); + map->brush = read_brushes(); + map->brushside = read_brushsides(); + map->pop = read_pop(); + map->area = read_areas(); + map->areaportal = read_areaportals(); + + free(buffer); +} + +//================================================= +int main(int argc, char *argv[]) { +char t; + + fprintf(stderr, "BSP Tree contains: \n"); + fprintf(stderr, "----------------------\n"); + load_bsp_map("c:\\quake2\\baseq2\\maps\\q2dm2.bsp"); + fprintf(stderr, "----------------------\n\n\n\n"); + + printf("waiting for your input "); + t=getchar(); + + return 0; +} + + +