From a20051fd1c4b940d85697bff477db20a1aa3d21c Mon Sep 17 00:00:00 2001 From: avirox Date: Tue, 20 Dec 2005 23:23:43 +0000 Subject: [PATCH] Removed file/folder git-svn-id: svn://svn.icculus.org/nexuiz/trunk@700 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- TeamNexuiz/game/gamec/GameC.dsp | 457 --- TeamNexuiz/game/gamec/GameC.dsw | 29 - TeamNexuiz/game/gamec/GameC.ncb | Bin 107520 -> 0 bytes TeamNexuiz/game/gamec/GameC.opt | Bin 58880 -> 0 bytes TeamNexuiz/game/gamec/GameC.plg | 1015 ------ TeamNexuiz/game/gamec/Makefile | 5 - TeamNexuiz/game/gamec/bot.c | 1239 -------- TeamNexuiz/game/gamec/bot_ai.c | 1023 ------ TeamNexuiz/game/gamec/bot_ed.c | 1367 -------- TeamNexuiz/game/gamec/bot_fight.c | 438 --- TeamNexuiz/game/gamec/bot_maps.c | 152 - TeamNexuiz/game/gamec/bot_misc.c | 841 ----- TeamNexuiz/game/gamec/bot_move.c | 512 --- TeamNexuiz/game/gamec/bot_phys.c | 666 ---- TeamNexuiz/game/gamec/bot_way.c | 1001 ------ TeamNexuiz/game/gamec/builtins.h | 76 - TeamNexuiz/game/gamec/cl_client.c | 1232 -------- TeamNexuiz/game/gamec/cl_impulse.c | 165 - TeamNexuiz/game/gamec/cl_physics.c | 298 -- TeamNexuiz/game/gamec/cl_physics.c_bh | 305 -- TeamNexuiz/game/gamec/cl_player.c | 354 --- TeamNexuiz/game/gamec/cl_weaponanimations.c | 25 - TeamNexuiz/game/gamec/cl_weapons.c | 321 -- TeamNexuiz/game/gamec/cl_weaponsystem.c | 343 -- TeamNexuiz/game/gamec/class.c | 469 --- TeamNexuiz/game/gamec/constants.h | 200 -- TeamNexuiz/game/gamec/ctf.c | 396 --- TeamNexuiz/game/gamec/defs.h | 250 -- TeamNexuiz/game/gamec/domination.c | 239 -- TeamNexuiz/game/gamec/engineer.c | 46 - TeamNexuiz/game/gamec/extensions.h | 976 ------ TeamNexuiz/game/gamec/g_casings.c | 91 - TeamNexuiz/game/gamec/g_damage.c | 308 -- TeamNexuiz/game/gamec/g_decors.c | 246 -- TeamNexuiz/game/gamec/g_lights.c | 120 - TeamNexuiz/game/gamec/g_subs.c | 456 --- TeamNexuiz/game/gamec/g_tetris.c | 746 ----- TeamNexuiz/game/gamec/g_triggers.c | 1430 --------- TeamNexuiz/game/gamec/g_violence.c | 58 - TeamNexuiz/game/gamec/g_world.c | 652 ---- TeamNexuiz/game/gamec/mauvebot.c | 860 ------ TeamNexuiz/game/gamec/medic.c | 124 - TeamNexuiz/game/gamec/pyro.c | 179 -- TeamNexuiz/game/gamec/scout.c | 157 - TeamNexuiz/game/gamec/soldier.c | 221 -- TeamNexuiz/game/gamec/spy.c | 218 -- TeamNexuiz/game/gamec/sv_main.c | 18 - TeamNexuiz/game/gamec/sv_stats.c | 5 - TeamNexuiz/game/gamec/sys.h | 145 - TeamNexuiz/game/gamec/t_fort.c | 195 -- TeamNexuiz/game/gamec/t_halflife.c | 58 - TeamNexuiz/game/gamec/t_items.c | 356 --- TeamNexuiz/game/gamec/t_jumppads.c | 96 - TeamNexuiz/game/gamec/t_plats.c | 446 --- TeamNexuiz/game/gamec/t_quake.c | 48 - TeamNexuiz/game/gamec/t_quake3.c | 18 - TeamNexuiz/game/gamec/t_teleporters.c | 308 -- TeamNexuiz/game/gamec/tfai.c | 48 - TeamNexuiz/game/gamec/tfbuttons.c | 169 - TeamNexuiz/game/gamec/tfclient.c | 98 - TeamNexuiz/game/gamec/tfcombat.c | 630 ---- TeamNexuiz/game/gamec/tfdefs.c | 221 -- TeamNexuiz/game/gamec/tffunctions.c | 1574 ---------- TeamNexuiz/game/gamec/tfgrenades.c | 712 ----- TeamNexuiz/game/gamec/tfitems.c | 40 - TeamNexuiz/game/gamec/tfmapitems.c | 3089 ------------------- TeamNexuiz/game/gamec/tfplats.c | 499 --- TeamNexuiz/game/gamec/tfq3fitems.c | 303 -- TeamNexuiz/game/gamec/w_bombletts.c | 129 - TeamNexuiz/game/gamec/w_common.c | 977 ------ TeamNexuiz/game/gamec/w_crylink.c | 113 - TeamNexuiz/game/gamec/w_electro.c | 137 - TeamNexuiz/game/gamec/w_flamer.c | 139 - TeamNexuiz/game/gamec/w_grenadelauncher.c | 112 - TeamNexuiz/game/gamec/w_grenades.c | 841 ----- TeamNexuiz/game/gamec/w_hagar.c | 122 - TeamNexuiz/game/gamec/w_hook.c | 250 -- TeamNexuiz/game/gamec/w_hotbombs.c | 267 -- TeamNexuiz/game/gamec/w_incendiary_r.c | 166 - TeamNexuiz/game/gamec/w_laser.c | 101 - TeamNexuiz/game/gamec/w_namek.c | 138 - TeamNexuiz/game/gamec/w_nex.c | 103 - TeamNexuiz/game/gamec/w_rocketlauncher.c | 141 - TeamNexuiz/game/gamec/w_setrope.c | 84 - TeamNexuiz/game/gamec/w_shotgun.c | 119 - TeamNexuiz/game/gamec/w_uzi.c | 92 - 86 files changed, 33413 deletions(-) delete mode 100644 TeamNexuiz/game/gamec/GameC.dsp delete mode 100644 TeamNexuiz/game/gamec/GameC.dsw delete mode 100644 TeamNexuiz/game/gamec/GameC.ncb delete mode 100644 TeamNexuiz/game/gamec/GameC.opt delete mode 100644 TeamNexuiz/game/gamec/GameC.plg delete mode 100644 TeamNexuiz/game/gamec/Makefile delete mode 100644 TeamNexuiz/game/gamec/bot.c delete mode 100644 TeamNexuiz/game/gamec/bot_ai.c delete mode 100644 TeamNexuiz/game/gamec/bot_ed.c delete mode 100644 TeamNexuiz/game/gamec/bot_fight.c delete mode 100644 TeamNexuiz/game/gamec/bot_maps.c delete mode 100644 TeamNexuiz/game/gamec/bot_misc.c delete mode 100644 TeamNexuiz/game/gamec/bot_move.c delete mode 100644 TeamNexuiz/game/gamec/bot_phys.c delete mode 100644 TeamNexuiz/game/gamec/bot_way.c delete mode 100644 TeamNexuiz/game/gamec/builtins.h delete mode 100644 TeamNexuiz/game/gamec/cl_client.c delete mode 100644 TeamNexuiz/game/gamec/cl_impulse.c delete mode 100644 TeamNexuiz/game/gamec/cl_physics.c delete mode 100644 TeamNexuiz/game/gamec/cl_physics.c_bh delete mode 100644 TeamNexuiz/game/gamec/cl_player.c delete mode 100644 TeamNexuiz/game/gamec/cl_weaponanimations.c delete mode 100644 TeamNexuiz/game/gamec/cl_weapons.c delete mode 100644 TeamNexuiz/game/gamec/cl_weaponsystem.c delete mode 100644 TeamNexuiz/game/gamec/class.c delete mode 100644 TeamNexuiz/game/gamec/constants.h delete mode 100644 TeamNexuiz/game/gamec/ctf.c delete mode 100644 TeamNexuiz/game/gamec/defs.h delete mode 100644 TeamNexuiz/game/gamec/domination.c delete mode 100644 TeamNexuiz/game/gamec/engineer.c delete mode 100644 TeamNexuiz/game/gamec/extensions.h delete mode 100644 TeamNexuiz/game/gamec/g_casings.c delete mode 100644 TeamNexuiz/game/gamec/g_damage.c delete mode 100644 TeamNexuiz/game/gamec/g_decors.c delete mode 100644 TeamNexuiz/game/gamec/g_lights.c delete mode 100644 TeamNexuiz/game/gamec/g_subs.c delete mode 100644 TeamNexuiz/game/gamec/g_tetris.c delete mode 100644 TeamNexuiz/game/gamec/g_triggers.c delete mode 100644 TeamNexuiz/game/gamec/g_violence.c delete mode 100644 TeamNexuiz/game/gamec/g_world.c delete mode 100644 TeamNexuiz/game/gamec/mauvebot.c delete mode 100644 TeamNexuiz/game/gamec/medic.c delete mode 100644 TeamNexuiz/game/gamec/pyro.c delete mode 100644 TeamNexuiz/game/gamec/scout.c delete mode 100644 TeamNexuiz/game/gamec/soldier.c delete mode 100644 TeamNexuiz/game/gamec/spy.c delete mode 100644 TeamNexuiz/game/gamec/sv_main.c delete mode 100644 TeamNexuiz/game/gamec/sv_stats.c delete mode 100644 TeamNexuiz/game/gamec/sys.h delete mode 100644 TeamNexuiz/game/gamec/t_fort.c delete mode 100644 TeamNexuiz/game/gamec/t_halflife.c delete mode 100644 TeamNexuiz/game/gamec/t_items.c delete mode 100644 TeamNexuiz/game/gamec/t_jumppads.c delete mode 100644 TeamNexuiz/game/gamec/t_plats.c delete mode 100644 TeamNexuiz/game/gamec/t_quake.c delete mode 100644 TeamNexuiz/game/gamec/t_quake3.c delete mode 100644 TeamNexuiz/game/gamec/t_teleporters.c delete mode 100644 TeamNexuiz/game/gamec/tfai.c delete mode 100644 TeamNexuiz/game/gamec/tfbuttons.c delete mode 100644 TeamNexuiz/game/gamec/tfclient.c delete mode 100644 TeamNexuiz/game/gamec/tfcombat.c delete mode 100644 TeamNexuiz/game/gamec/tfdefs.c delete mode 100644 TeamNexuiz/game/gamec/tffunctions.c delete mode 100644 TeamNexuiz/game/gamec/tfgrenades.c delete mode 100644 TeamNexuiz/game/gamec/tfitems.c delete mode 100644 TeamNexuiz/game/gamec/tfmapitems.c delete mode 100644 TeamNexuiz/game/gamec/tfplats.c delete mode 100644 TeamNexuiz/game/gamec/tfq3fitems.c delete mode 100644 TeamNexuiz/game/gamec/w_bombletts.c delete mode 100644 TeamNexuiz/game/gamec/w_common.c delete mode 100644 TeamNexuiz/game/gamec/w_crylink.c delete mode 100644 TeamNexuiz/game/gamec/w_electro.c delete mode 100644 TeamNexuiz/game/gamec/w_flamer.c delete mode 100644 TeamNexuiz/game/gamec/w_grenadelauncher.c delete mode 100644 TeamNexuiz/game/gamec/w_grenades.c delete mode 100644 TeamNexuiz/game/gamec/w_hagar.c delete mode 100644 TeamNexuiz/game/gamec/w_hook.c delete mode 100644 TeamNexuiz/game/gamec/w_hotbombs.c delete mode 100644 TeamNexuiz/game/gamec/w_incendiary_r.c delete mode 100644 TeamNexuiz/game/gamec/w_laser.c delete mode 100644 TeamNexuiz/game/gamec/w_namek.c delete mode 100644 TeamNexuiz/game/gamec/w_nex.c delete mode 100644 TeamNexuiz/game/gamec/w_rocketlauncher.c delete mode 100644 TeamNexuiz/game/gamec/w_setrope.c delete mode 100644 TeamNexuiz/game/gamec/w_shotgun.c delete mode 100644 TeamNexuiz/game/gamec/w_uzi.c diff --git a/TeamNexuiz/game/gamec/GameC.dsp b/TeamNexuiz/game/gamec/GameC.dsp deleted file mode 100644 index 38b74d0bf..000000000 --- a/TeamNexuiz/game/gamec/GameC.dsp +++ /dev/null @@ -1,457 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Game code" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=Game code - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "GameC.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "GameC.mak" CFG="Game code - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Game code - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "Game code - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "Game code - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Game_code___Win32_Release" -# PROP BASE Intermediate_Dir "Game_code___Win32_Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Game_code___Win32_Release" -# PROP Intermediate_Dir "Game_code___Win32_Release" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GAMECODE_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GAMECODE_EXPORTS" /YX /FD /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x419 /d "NDEBUG" -# ADD RSC /l 0x419 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 - -!ELSEIF "$(CFG)" == "Game code - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GAMECODE_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GAMECODE_EXPORTS" /YX /FD /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x419 /d "_DEBUG" -# ADD RSC /l 0x419 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "Game code - Win32 Release" -# Name "Game code - Win32 Debug" -# Begin Group "Header Files" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\builtins.h -# End Source File -# Begin Source File - -SOURCE=.\constants.h -# End Source File -# Begin Source File - -SOURCE=.\defs.h -# End Source File -# Begin Source File - -SOURCE=.\extensions.h -# End Source File -# Begin Source File - -SOURCE=.\sys.h -# End Source File -# End Group -# Begin Group "Source Files" - -# PROP Default_Filter "" -# Begin Group "client" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\cl_client.c -# End Source File -# Begin Source File - -SOURCE=.\cl_impulse.c -# End Source File -# Begin Source File - -SOURCE=.\cl_physics.c -# End Source File -# Begin Source File - -SOURCE=.\cl_player.c -# End Source File -# Begin Source File - -SOURCE=.\mauvebot.c -# End Source File -# End Group -# Begin Group "server" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\sv_main.c -# End Source File -# Begin Source File - -SOURCE=.\sv_stats.c -# End Source File -# End Group -# Begin Group "map" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\t_fort.c -# End Source File -# Begin Source File - -SOURCE=.\t_halflife.c -# End Source File -# Begin Source File - -SOURCE=.\t_items.c -# End Source File -# Begin Source File - -SOURCE=.\t_jumppads.c -# End Source File -# Begin Source File - -SOURCE=.\t_plats.c -# End Source File -# Begin Source File - -SOURCE=.\t_quake.c -# End Source File -# Begin Source File - -SOURCE=.\t_quake3.c -# End Source File -# Begin Source File - -SOURCE=.\t_teleporters.c -# End Source File -# End Group -# Begin Group "game" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\ctf.c -# End Source File -# Begin Source File - -SOURCE=.\domination.c -# End Source File -# Begin Source File - -SOURCE=.\g_casings.c -# End Source File -# Begin Source File - -SOURCE=.\g_damage.c -# End Source File -# Begin Source File - -SOURCE=.\g_decors.c -# End Source File -# Begin Source File - -SOURCE=.\g_lights.c -# End Source File -# Begin Source File - -SOURCE=.\g_subs.c -# End Source File -# Begin Source File - -SOURCE=.\g_tetris.c -# End Source File -# Begin Source File - -SOURCE=.\g_triggers.c -# End Source File -# Begin Source File - -SOURCE=.\g_violence.c -# End Source File -# Begin Source File - -SOURCE=.\g_world.c -# End Source File -# End Group -# Begin Group "class" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\class.c -# End Source File -# Begin Source File - -SOURCE=.\engineer.c -# End Source File -# Begin Source File - -SOURCE=.\medic.c -# End Source File -# Begin Source File - -SOURCE=.\pyro.c -# End Source File -# Begin Source File - -SOURCE=.\scout.c -# End Source File -# Begin Source File - -SOURCE=.\soldier.c -# End Source File -# Begin Source File - -SOURCE=.\spy.c -# End Source File -# End Group -# Begin Group "weapons" - -# PROP Default_Filter "" -# Begin Group "pyro" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\w_bombletts.c -# End Source File -# Begin Source File - -SOURCE=.\w_flamer.c -# End Source File -# Begin Source File - -SOURCE=.\w_hotbombs.c -# End Source File -# Begin Source File - -SOURCE=.\w_incendiary_r.c -# End Source File -# End Group -# Begin Group "scout" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\w_hook.c -# End Source File -# Begin Source File - -SOURCE=.\w_setrope.c -# End Source File -# End Group -# Begin Group "soldier" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\w_electro.c -# End Source File -# Begin Source File - -SOURCE=.\w_namek.c -# End Source File -# Begin Source File - -SOURCE=.\w_rocketlauncher.c -# End Source File -# Begin Source File - -SOURCE=.\w_shotgun.c -# End Source File -# End Group -# Begin Group "spy" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\w_laser.c -# End Source File -# End Group -# Begin Group "medic" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\w_uzi.c -# End Source File -# End Group -# Begin Group "engineer" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\w_crylink.c -# End Source File -# End Group -# Begin Group "unused" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\cl_weaponanimations.c -# End Source File -# Begin Source File - -SOURCE=.\w_grenadelauncher.c -# End Source File -# Begin Source File - -SOURCE=.\w_hagar.c -# End Source File -# Begin Source File - -SOURCE=.\w_nex.c -# End Source File -# End Group -# Begin Source File - -SOURCE=.\cl_weapons.c -# End Source File -# Begin Source File - -SOURCE=.\cl_weaponsystem.c -# End Source File -# Begin Source File - -SOURCE=.\w_common.c -# End Source File -# Begin Source File - -SOURCE=.\w_grenades.c -# End Source File -# End Group -# Begin Group "TF map items" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\tfbuttons.c -# End Source File -# Begin Source File - -SOURCE=.\tfitems.c -# End Source File -# Begin Source File - -SOURCE=.\tfmapitems.c -# End Source File -# Begin Source File - -SOURCE=.\tfplats.c -# End Source File -# Begin Source File - -SOURCE=.\tfq3fitems.c -# End Source File -# End Group -# Begin Group "TF combat" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\tfai.c -# End Source File -# Begin Source File - -SOURCE=.\tfcombat.c -# End Source File -# End Group -# Begin Group "TF Defs&Functs" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\tfdefs.c -# End Source File -# Begin Source File - -SOURCE=.\tffunctions.c -# End Source File -# End Group -# Begin Group "TF Client" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\tfclient.c -# End Source File -# End Group -# Begin Group "TF Weaponry" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=.\tfgrenades.c -# End Source File -# End Group -# End Group -# Begin Source File - -SOURCE=..\progs.src -# End Source File -# Begin Source File - -SOURCE=..\todo.txt -# End Source File -# End Target -# End Project diff --git a/TeamNexuiz/game/gamec/GameC.dsw b/TeamNexuiz/game/gamec/GameC.dsw deleted file mode 100644 index fb12d9365..000000000 --- a/TeamNexuiz/game/gamec/GameC.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "Game code"=.\GameC.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/TeamNexuiz/game/gamec/GameC.ncb b/TeamNexuiz/game/gamec/GameC.ncb deleted file mode 100644 index e4a081aa243889ffbd5bf0c9a9c049a2c4eb2767..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 107520 zcmeI534mNxmG^H|^`5P>hmb&JlLSJ@!V&^Ps+T04bayqqWFt^ix+|R~-Cb>0brwWT zAPA@|vMBnYL=i-oVNeHQ)RDzcMsY&~l~D(9+(l%>QTYbt`~U8H?{+1Cb~BQIynE}t zcg|hUJ9l~ao?G|ahOYMhY%aScAFn>H`j}(lef`&*1Z4Mu0PL%zPi$B^NFFS|)BhWL(ES7!PrB`W|$nJIF$C~40Pj~5!Gsns% z9lhht0@)A70{SPIqh){O!cR2wWZNA+$;_2K-{m*i93y+Vi$BF&EL-ZrA7(C+{dY0X z?4kzY35Sdr(F2y=3TPWT>3|tcghyK_dC*@C%e(bkDK#lA8_Gk zn77F;apg7ByjAvam;Nl(kcjz`!)L36OUwj^&k@~4X1#l#H<@zTAG`dIGNrOJ-TTZn zBV;df@#m?8#+b8Q_@hmk>_;6v$CwJ)87};MGg9_Gm)@~vl3>I6y0Z3f0mf5WWVX+A8+0(Tjs)_V6K$ya{N8f zTqE1-=sU@LNOr4xzoq6QvV9Ie*?d&?S@N^(XPLQ7_MhDQoMNt%{klv4RCBfLIQM>U zHXo3E!o@$$Tq}Ewi+{R#zihdqXSumtcK&A`Q2ww}*Oua|wvN#3(k&#`8lbqa4G2SN_~eR1G%H=anC>t(;8*DJc$#Eq#kSIAzg z&Otxn)n=mX1oaLcUSlT6KH~6NGhKFsOK*jlBKvlSuQbzSyWMzcl{sAY9_L?Y#>-A{ z&;=ZC62xZGfDOnj-E!dNA@n~pEU1~O*p*CTp(NJ(mTWK zmc7f3r<%;cez-*<~*MwdN+-nJ)f1^D)_fhQB@VbG?}* zJH@^K1~W%?pTjqr8M5zi>7Qw4%Wib(Z!$AwS3Cc+%u?B-9skZ&4(l}{Rer0;FJ+o# z>l{7jn3b~4E`Hi^;P{<=<|W$tGO-9cG>E!!EsyX_ft>qi>5@EBkBb z-)UN8FLUv?ni|=9hj*EiWlwPQoNHFgzTo0-Gs|ULUHERZL3X>#uSYes+I-1{?^O-1 zGAZ{yS<@tYoAd88ZK6%q1dxZ->VCrR; zIsfgZP4*0z{|>WC_A2MU(tVRF=xrHcKD^{9NC#J|96>A*?xz=+qBD0cl>yd ziON3U^1ICJkgan3xZDiL{>sI_!fcma;P5NWPT9{o{JrMWvirpU@cQ5JV1df$rLH#$ zUsZ)(H|9sQmtqq~{uh%iDHC1_9<}nCXYr4M$MhX2GEWKTdO=rcLJou+cztu=m*r~T zc6=AH^3Kl0g8_**CL}{EMu7_YV#)w({1`yYxz|{Pt0Ymr9B-&J?@! z%B(zh9(Wh|m761FKkL$~u>H;P_&4A`!p;vKasDGM{(Xm!viJiIA8qlkJA91Af8p>- zi$CM=u@?W4!^c^C8Tlv4pV`THvmCq;e1gSSIDDeT>m5GH;?3Z*2tV24>%r^6r&#=K z@SWg?S-b;$IrvnIKLBpa=WyFU?{N4uE5E+b;nS`B`zH=R!uH>zDuVb&TKRSd?`Qk> zxRtkm$i43jJHNZg`OmcTx8IRo5%kQm^R+*_^k>`o*trg$W9N6bJN!*{KKLGoA7$rr z{iOd0>CLtCw-4c82|mxx-@fX?A8qHCGr(>AJI3O_asKlyey^kdSS#P(XS}h?bcGAx z;K?^D_7#y>!+)*rL`Fx{%uK|VPs}XW{BXB$ zul^O84@dqb@=b;J{EN*K<~L>yxQ$<8{%HPW{@eMNnn%oc%|e%6nOPb+BeL81mz!+# z1JP5Qe}#!ew?wZ1xAlF5W@C4mFSzg{Rew)3X@`$8Up8Mgvt9hr<_qRNlNIjOuQ8@F za%5z+!z<0K$Z?SmDZb}F*0e^hk9^#vr@l!o<}8=qcoj>`{LuMNF!x7(7P->l6U{Fo ze~A3r;ghshdT)e!M?D*>bbvR>|K%>qKJX)Ka0PCK&qG;9!o2@}Iq)R)z1eI3<@$nu z3%mk6s_)MNS3m!LIS{^C$bmO52d3%xkBA-5Ml>G3$E1Z9+5SL-6`5nf{rNxgwyg6n z()Y61)H=MF5rjDz+a--Vx`f7f-IPbs~i>Kc*GB@n$=? z|NTE#|DW3cZu^g7?OwUkT(U!(|6l)@3qQ*4*G#(bqs>3cZgc))?0(3{-1}6T+hvb;{$tJmkv$H7OYb=Q z|NhHddgJZ>&HG&V33k84Q!c%U8tuH#yw%~8G#a|nTgaxYy-B z!|ava<;ruW-Jkrd!)Mw3$zxpn*>->N3`fr#bD`{PNB^75=VU9K|54_%vg=%abIqq@ zYh8Nt%$>4#JN#(#8QFRl{}}xnF8Nx{!Mm*qkpl*r#XCy#Ty)cyp8`S7ykt9hS+32%Yq4I~_fBmj2H>{;anA*yH@ySbptOxBPm(_|H#p@gB^7 z4tyW{aVrcLxE&bwK)f)Vk_b)6fxpOs-_u`=_s0Jh$Nn5!IwAP}M9s|D&e&z(w!OyG z{+36McK$`CG4iX(7Uy4Vo{o->o#p&X^ga8GS>fd|{tB5wy2Z?(i3@Md0X|6;2@C+6@HtDonWu6>s3 z-vtZJe>l9%?k9K-+>Uq4E#B_pSD5*-ZQ!>58Da5F&VQuEXE}V7#iu%aw8c*Ve}?xN zWAXXUztZCSRL=jKOVL9Ua^Q8#fu~%1h-i27cg@!v9yRrmPe<+qxBu^tnd2j;M}FY^ zi}df{dUGTAMA}!eDT^$Q+yidgYl-=pb~6`#XA9xiEyF^>Lk|2Map00kYOnVD%lH2g zlL5EwH)>j=ndqk-9+NJ#pP3t7_#!hgHY2tk+;9KCHorFCcHv9R)3RT5c&Uj+Mn-nK z_+{q8=)=+T9bRtc$4-s)y6_dIHnu8uo%0`I`lH*US2}#8iN-2ox4H16%#+dIMGN~F z;9x#{pnDXU@OK z{DanOzUKUk&9jjcqhlOiV)jICh`iN>FV$|{@0**Pf0;=|HbD2a64WZrTx7%k&~VOXtON3A^L0j6YD?5bVuJGeZloN zm1a|PTl8Dbf2?VUoE52Y@yDsR+h^`^_;{_y-D-MWeiO_Oq+R!iF8)OGg~-1Txxae3 ze(a^(!>Sr`;ML+l^VFbyM9fLjSGMLb;dcLj)cjU|30?qh=0|Iy9|FG~f3^SE*JJN+ z{*%oAm?@E)!7YC#n=eG4j7A)NQ_OR+e{|swGy7tnkG)j;|69AgT6HN*_w~nt@3{IH zvHN-Mak!`d>vq>(&<++e7lTiwzM~DS$Xw_A*$rH5e(vIzSp7i1b$F@O_wy%*m#IbT zn=Y39rAywS2{{mQ;8o(lb%(1Z+wWyWv;B=`0Nj4BqUI<`_`4h)Q)``V-s5nEQVT!u z+w>}t873QYAmqTSz=4O=o+F3zJuj2C-wRA)nsD16NWLz8zCXd=;uH1n(0?(ju4o1d7^IXr59VgB3P>F}8TPkg`mF}NKc6iHh5HS>(ai*9UHjGhe{p{{Mfp+Q-uUL>7T!_ELi|qMPmplJrJ6^rt#Yg^MVXk+0sXbpT@4}ba^TO_S{tPnW z<~fH~*zxsN!u#X@W3}V>Q5S!tC1A7jV&a~xi2$LmkJ z{Knezv3`gD3r4Qv?0Hw$gWLBVZ_l^dNqE~|PO$TVyPW?-dmh&whflKO?Iqxr{>k<{ zw4XVDPDh?%?sxcM_Wx23IeMnr`M^jQ|8RT0*KN*!nw>v1I{)b!y^VM48^O5yU_4D| zUbh^0^GtpD?fGgEy+hP21g9YiE>a6^b9hX(D`m(3jPbcb6LKKr!0Vd>SE_v%&7{54 z{*AdA+;9KKj`pcbEfQr4lmK^FtH4D*k)S9@M{ z)XrzSoqx>E-=~6G{~{|7c$@Ptw*AAS4ll9u>FXShcJZ-hjl;{V{NQsAFSq^8We%^f z^W_H}KEn1l%N#z^_9vfk_$b@|%yal?+y9*9@G*9O(@XU`Lv?#uCWam%2VSQf=$tdy z{*N|wrorJ+vqt-Ymx9mc`yG>h09qEZ|b$GdHHQUU8y7oRw z`gkufJ6-(I8V`&$V_f(#lAkX%A9i@9S!SBewJ!WveXq;SCrNJ({mlf~spcPD_`}WP zkx|iUF8nleb>!*@eMyzvlDanP3ic1}6KlDiQF?^o`JAqp!q5)|-~0f+SAO5}!;;?J zy1uB3|2RCP=MQu(h$_L*gdF%g;=t8&d70bIV|r4(r_WRS`#XBS@Kr(%gdBKz4lJ== zoc$To_qSMc|#Rzt8Vswzi!8EFy zGiFxqy|QR|P1yzUBC@{zmjATn_z}_cq%M#6mwbhTNa+mYm1An|Q=*CUKD{kMul`1% z-K%E)MQsH05A*nSo@kn;y@th>D>_i@U>I9s#>7>RE;%5-fUbmSx?5L?_4n=v1bwy9 z&e5Sh52ug9;t#@V9ji@FY0{d)P=UOuBD8Zmvl_o)Ah z*E}woMyfydICZf26>#UpRC;tZ&7C}qZ^VmJ`P;jAbgfulE4nzxd5z7&yZ_B{+kKTz z1b!K_dUf6EJ8!w>s%t*Fy6wG3&zX1AHP2K`3 zzIp9cFHX{8b@1!ge(!(lU0TD#c>FTv`=W_+bu`?O@$MEp=(pv~i|PjH zx=}Q7o`_eR2e(jnf8y3#Z(h4U0|I{iUNmtof>iU%c=!E7zS`LCOxxFQ9SBAYUVAj= zY|(`NbZ?k{2nYMu%+^RyCR%OB_Z6=-0g_MGGSOxATU%oN0h@&n!R?yhJ7mnqM3>d0 zYspaKJh*1Ufm7CC-f<4PG^G#h(Dh%x{9)nfDrk>mL=$=k4`sdI-7+{{@aSr5_=spi zf7-zv7rv;nxCx@yPb`anM>L@a$y2*>=#;Mv{NX!aSf@_R-A4qg3H<^{$duhy=TGyCLK&1Ag01rOfs zd$;F){h1T|{Jim3qA51h*!{|{rd)1Fuei`Fu_-H&f5lVhh%WX$9?Jg9qkH$qk&$@y zK9ee)HKeyWXn{PsYLdr`F7}}vdO3hzefe#Xo!@Gs9OphLn%LhWae$0>x8T9M-T9q? z!OTuA`>o`dsg9qCCjN(i2JF}gOMaGT}V+h1dJ1@-H;*C<`zdyUaG@{+4; zImYI`HtYS#uQ9rUb-t~yF}l__U1rPiwN;8CHACUR$(lX>sMMGTC3fB}`S{to^mkt~ zSyJ|&%I!qq9~FFu;P(rDR`AVwUMu`D!AZf}^n6Tlj@R=zJuj2neS)77{8n9;>UzJf zn{=J7Yrg!hjvK3M4EbI~{p?FP|xf_V5o@i3wR*e8YW)YT_3 zD>6j=joQk3cI$bQhK!uA%$dq*!B^TJ=&`AvJ}ce=tPmH!80Do?@fy3SYF%Y~N;{&$JL+J!%&Fi#1d zCikl}A>q6h&Vb=uQ~uMyc@U4OY&i!4-OuQUMkh3KTGphmQ=Xjpiadt1A3Ah##slX% z6pN0HO8)_+y+pK*5}kLeJP%iX&xvoG4a<43oB_+YkiBQS#os@u3^)gtvtPfYuoHBx z7tKFbdNW1yMZ(V#{86PjL-2ia`b#d-CdQO~*b$jqM;{pg@W?;N`3s&#!e55ogM7kXRki{^VyTne2KmIPsUYt${)QQ z%vIQb&z^hc>+H2hpB*~B*k_L}5A=JzTV;Bq%6zWs{B&Krb@i%DcFFBoU1NmLP?(JP z^{DuUOk$@l&f?{K5YE8m+}mRLao%lA;gKV9)(`7it96~G>)YZ%rJgZezZA^g;%kdk z-g@^(bdAtEzFk+hcyo`Q6ZGD9$BcQ4t`dd&gu>jV=RD<;(6dVJoFBxQL7WrB*=4gu zcZF#EtjZbP*vBjEBZ9xL>j7O~*Yyis&*=J*u4VFHu4{#^dR@)B*6TW3SBI`oE4@$a zz0q5aE_3vi-=%W7R#&<5e?iwW(K1u``z0dWtnfcn*kdZM43 zGt(#Q{n5RIz9s&H!Z~Z~ZAAZhr}%fB^5m=|&QnJR`mYuLQk6x!c-N+DldhlZJ-@2_ z{#Dm3;Zt>;pliOaFDU#2qJM|3v|#k4Beh2^h)(n?mHs~)W2T7D`*giS@3B$u!FfvT z@kVaW*~$+c~qHbJ{tZo%7f^gZ)_f^Iwr#T_@|} z9CprLpC*_y*IV`EtaZ*;=S=n0%KvDU_m!e4E*k5^&t|#3o4O#kg!~?s+aE>aul2l4 zc)hL@6y^ott%A49?@NMHigTNuH!I#e)tQvS+^ToHLhv#@&yfFBdOj@o=M`qJ!agbZ ze7WDEG_F@#tP?-4awyXiomc3&Vvc=_{7%&MoZ|nN;w({`30+BD?4A9i{I)8M)w*UX zOuw!RRR)|(&0c%-!=n=(J?`jcM;|;o;L-bzu6Oj)qmv#z^j7!0p6HnWiPAt9H~*vR zP`&+-u8Va2PVRr!b*`@4b-hPdKmK~6iwpf*$e!4jKRv4cU35GkTC4P~zY=W=bY)d9 zR_pqz;>^(X8(r-C-JtIg`+eEtd$C~l_OhRsJ-iJ>fT)bn2Pf<4BJb0}}I&>Zu%H{BI| z>e>JN(_J6`VU(JV{72OcBZ=of+2W7&QmxLz)N-+@a+GviKRcBt7s>4Ib0 zcSbwKy-0CsQ^1EQO~!-3YE^c;>%mc5uYrq217io^Ql-xr1bDXY^x44dc4K@D98tdX z-5xyKwhiE7(ZIM4II1)mPXL!FU&cYeGj*p;15Z$z^c%nt#ij2DezVe_;fFs)F7&;) zb0!yU8n{H%@m&JubS=AA--elI$27PXDF?&agT`3 zgr81Q7;^~R$0>cjyTBz%ld%jbhkPK1Xn11`dZv4DK32oaEacR zxeRcb(x-n1jwwyP@1FY+b`0pj6YRGU_)PgS{{gO0T)tPpXY0;)3wVU`qR$29)Dz|` zz{e>(-v;1|b!Y4e925QYUBL4chVKF}=acYF1Mb%SW<7!Xbmuz?Ob(1wfyf(OP+aCtgo!C%zE{9UDg8(N@QdYgi=Y16 z1T!8X46T{DnFo)t;|S8+T63p)LQmY^tUKRE;2BDj?>O)X^)8G(fGbtI8A}2;>dttE zbk-{!zWKP1RCwk{z!9axd=Qv@u+LgIeOKhdoCWt;y7OHIjw?LlAJV*1@5?v?_g%U( z_5(%(7IOjMCAz0)d2oq#(K24beYEmoUIl!F?#y9;*{%EUe%!<4!o1dVA7jT^z+)7b zu{ChD?)I!-!5X#M@iFe@O2_K-6C6{%%nfm$raRwG;Q0!}oEkWyRQLFF7AZVqYTQRD z3}aPbG=Vct1J3Bqw-|W7-o~CMEI29}7>nbMrY^>5z;Dr=`8aTi^0McT*zj>X*2G;W z2iY+_@Ce0ao&r2WDKTCEE*5Q!&44e|o%u2_u^G<-mn(hd1;8Vf4)ZMF({*QV0E|`= z#Kyy*C{SC6X1x_EQ<$l+{#&SFP9H<0pP8=&+zFv zTJ$iE$Gt*nGS2`WuXK=^09WeHd=j_}`u%ja$px7h?h8bNJr`SWMD>>c?%*C1%$x!^ zuRC*1;0mR~90|BYc_DWJo~k>t72uPUCUZ~VaSCts?g@^lgqQp76DcY=FK*7{F z=EPo@qJsY;%&@X9+{@(4oEdns@993S-F@Q%YP3C#P zZ`U1JBJd)mgKPpA4Ti|afQz+DlDRbS;YuHQ1#pe-%wd7YDShUL!0*r<*(C5{rO7-8 zc!ct0jtx9gDIu=_o})0#6M?5GedJ}pWugJu25^PKBRc>tQeMbIfn&NOD+7L$?#N() z$0|+cgPwblmAe2JE6ts8&wac~8#x2+Ba}X}PGD+{)zv7dR5T-V!+pN)zYzdDO7{!n z9vo9T$aZiqQu@ewfe#Z6$Yp_}N}qWt@LYvLrU)EUURF<|;L*wpc^U2zg-7=5!TNsr zG>nl8vJTuwDX**J9!$+e-i!MZrG(rQc#7`GqJT@4CbAOXk&4Tl8F-H9vAQk=N2wce z&%H!xKH=wEp^(fq34fH*NA?6`-;hCKJtR^|#!Z9>NF z!4WIJ0UoV%n6CrBTX*Kdz=w+-J^}nr z-I4JD$CVp$bKsbAKn?&rPwCtp_uw++YjtzVyile2>^3q#{F>*E>`-;(Qz-<-Rcb$T%x>?-Qr%MUJ4l@aINmh!94d$D+2^B zSNh1pfye6pP~3wLQ~In!;66$DB2NLHE{c$)0gn)Wki`RY`U$cz;PtvA&jc<}`pDmb zc^l+$z~zdI%nCTAJ2DjDV-)5SetC_gynGraiw5LFgt=6AFkdHR?Z9YT zd@}CAl?sJ?9QQf8f6h<8Oz9&F!hM!vAlm`HLU-0)fTt+mr{f;1QH5Q9z&)b$Su+5h zs5^2p-~ru{IRPJ`G@pxmaJk|l8^!$;rO6rv@JQW}3j>c(npS_S;0n=(JR0|6!N@Fu z6N-zx2)I(=S?}=TYECi3gQqGl);4e-r#ovC!0KVG{1bS&(m{>~e4g&CX8?~^n#k>e zM=BlGCxDOCowW{NdfXd*o^$2}YgxFDQJSoA02e6?GHzhB;2{46Zq^-{Jn$H$k4zu< z1l^JS0!P(GSYPtsu~sGs{4Tk$?gJcCnyhC4FVLN}GvEoL0eKj3v1ntx#e=8Wbs}K& z_8_MPjwvtXY`~L54{}i8tnSFxfmi6xnhWsBN+0<>@C3zRoeVglyjbf19;I|xCj&lS z;gNp>pP@UlV&Is1bk>1@OT;VI0f0F}2>CPc2+@fQ4|tl=L2Ht=>zTO6ls;=Tz-obZZO{up z*2nFgg zbZ2c1m=hgYmjE6w8urZa;E77#%5&we5xf*PS&m;7X;53>X+4kH~0&k5>A~#DN(Ru$}_kqB}BW;3-P;aX-!Fa$)@n z_i>_O@W0p7ty~%RVx^Cq9=J$pBBKVLtaMl}1wK*vBKrouTzA$=fGZT6^=ROz(r1kn zc)IS$nt@|VA6Y)|D5c5TH}Gg#)&zj}=#Kmwm{VerRRg0@pY=T8({yLO6S!RIuS z6Aj4JfmbO_3RcTIsMR1w2mavwjX- zq*}ll8gP^D$ku_Oh_zbaVx`0SAn@Tzhx2cN$LnkG=nM}YA=+48TX~ii#2dy&JAEK2>2Y`SqBFmtvhSDz~xGZ z^%CH5qK!2M;K`zm|1SWSDhBHxz@tTjIwT86ls;=jxcBSM+BNVD-B~LJE>rrfp#qOp znylFXPf=d1^8?e{?e@c$Dm?!e!2JZ}#{USsFyrldI&egBS%(3>O!v3=G^`QK`W)^f zl+JyAI^&fNYecwDRb18xfh!b-^*i8=y0g9oyj^$J{D9Gx&N>dTq%C$m&~rb+u9E;C ztMvKb1u(jtS+@i(fj@qly>j6{1-MVvowX`pPE+RpAiyJ)4(l==Jl?K*0+%Tr*1doa zS9t!b06boI*6D#`N|p6r;FY?w_6i(TsKGtU6?W|t_tTXZ>)F5&je7WB0PwN8^WOzv zMlP&x0go09{Ko^hL}{|-2YkNn{I>m%cmlt=QU8@IPCKvt> z031_Z{3igoSTO6?z^ip+bT0D}J~f%m1D&RN*(M_8 zHZ^8;4s@NjDVH7SZx`ArM|*4Ew0WSbJKxotTd;K~q1&^)xqP}ePwA zrslfFRgyWU05&J9*VMMA>Jx2^)vIcoajH+W2q3T4x`tX)yCPN9T(@#n>x#PC`Wn-aTwB|^ zp{X{NXk1xe+nB7buWRy1NVYZBnAX}phpX z$-3%VlW1*iOf@E(8%$eMO+sW<)ioxXHw@BWC3+Q3WYjgTQ-Ee8MzxB&sg`=)+fSge z*3{G{T34l3kb&b^i)n3ct2IsaskL>r>r%-TEoOVBJ)iCOXsAloYzRniOj^ptC?zgZ z66CouS<{fLv1!+c%)z|ZY;bUWVr{}k_1>U5S)XifA8bAHkhY-TaPKN zwe__tniDHwOv|d;`uY}|PE(>;1yo;a3nnQRl2lcq#y+dtT3b|$Jx5!fRjP5SkP04D zuGVCWQnFQ9rBPE$b@puQ_ZnxLUEQ6~~yGOAroRN$Jr23sp_ z{;jnQO)81H)(sZ*n9ED3OjUcu^p+;IfmQIaK@4=MtxMFeA-@&%8;oj0i>*A##+51! z)qHu_YP7nop~*&7=}<508tYm~xHZvSyS}MD*;1!k?Y&y7+SN)`Jo&b?HPtq^G}W!~ z*;3oQwpML?MUr$$vRRxKn+|M%uK9VdLCdhYRy8LRHPwlhR^oeA5B?~T>el9@&&yS9 z&8-0q9(TQ}Pid)tscmkkYq8|o(oMFmY||?RMby+L7Af&M@zX2Un%3q-^%~wr0b5oj zTdng7wL8@W(rirnT?G|I^{>_zq}mqs4)W?6*VZ*w*HtOJE#c-`TR##wkbo`3mevhE zDi&Gtl;a?4ZM*e*2$5&2VxrzJq@aoK-{4gtR2giV+6o083~K|e$Fvcwj2RV}uL_+8nC+Lpmi)vK0z^;LOHo!CYwBdP@?LY zni6elO73k7J}F-8#)Nuf!g~DkI@r2~ri8v}Dqy{SqIsqIGQs{gV+bGNj?5OmsOk26 z*Y-5scBVJqmEUD@`Tnln&Q$L}cef9lj!Z5;lrME=XFk)L>(cjnXkYf+E&}GW`E++G zmuc_MXtDQL;yo66k44_&MDKCD_c%dG4fJ+6l6um8 zz0@XAkP^wM&hG5yba&2l_2$j?RDW0J*1YM-b*6j<+T3hPUY1^tUfL&EcQ3n>EWFg- zPxfD?t2f)1={31b|MpD(mhNR5Yss=d2QNiAqM)fTAf%4s~;tAT>qo>if>Wb)Np)4iRUCY4dn2+mgxY~I|R zY2Dh@yUjG|#WVd)*<9YkVML~1h1@AFt>ZNtvfDE%i7i>`41NU_q(wv3_IyiUdPi?l zmeTTQsP+l)BlKl=WcmmCa;86%Bd8y0jkqLwGVR+uA{sOZ4q8Oqi`rwI^a_oc9UlE& z(A5JyeF5qH{+qP*b%@;RY)Z{O2Pb0F`%LS1i*ts+Bd zl`4d;p1y(ZTt=l(=Rwuko}P4XN6yp?^z`iVcssQ6?Ay94*VUd=QY~v!-s?7bP9~=+ z*5BpT6~R5}ow>eDrUQ4u>8^f<=JMG-hosxvRZjil4k0`H)7$BWhDePqb81(%Z&y{e zW0#q2t9`tqE3=5(;&?}YdPlrtpnaRY?MQcfz_}_T>(bTHor&96}y~dV&+yia55LadF5FNTNj{D8e^YEkj zZZ;lidY(Ym$uIb9#^aA zR<lJ)X|zl`>re)24Wb7urYYSM$62GX5w&zO^f_+ycyYu6|yAF1B5@Ztc(R=v|jd z_o;*M#{cnbf2W_rjv*G~4jZ4>Nz>C%yF4fF6@7S1e+98V% zuc<T^x9TEDEZ`mahIxoZDirxG73+{y4O{=21~dn^)C`6?>Pu+#X&}9b+b~xsqlt zbUN!S2mCLH*Jq}-rgL7N3f-?Nq(-3+d_lmJ-*D?wwfge*cV+uu!q-b8rTW>M>sBM{ z>g~{XI?KmpD5YZ?Z&xqvoe#|lJ}N_ur#?-ScD2nRNCdKcBGxse>NRL*E~eSACdX@Q zS0tO)C7NqYe|8|BN#)b}GMGeNDp{p*TU&LjW&?z*PbSxBz}1RZO)}Z6q1Q^YBfYDS zUSA)&j*K_X$@rfm4I@+!+Vd%!tc_K-VntnbTYam`IY_TsvzGc=O~y8-RCIld{O4l- zxx^%!H0w%gplq|(R7hjT6`F;KHj%@OKvSPu%|kY4^Qm@?Eb_c)%?6F?G==w@@>Z3v z%esaM9&wd1Vv5wF{jkORVN3SIG|W(MoU+N~(%bc!&+)m>EjERiO|My#$HXe8kw`OI zNT#K&d4N=XgaNlTTo7#d@BCBgl2krHfzGl zn`;8-m#LT`sJ5oAHQCI&Tj@*tK!3lgd`cPRh^8rCb)B8hsO-FV2nsRh%GolfL%p|G zu8Ky9s{~R>O=`{Nf!watU@UptiKU%ELPDG5G9Hnd;9v1^oe0enaXRV)@dt?26FnCDh-QiR3{{t$y=;XpBK$1(w&_e zqY-7Bb?(;C&IhvFY;x`W={|b%_m4luwIVfQF8?tp*jt zYgB-q7|0T9 zsKvx*LGPhKd-FiAH*QdZc7CH*YRPB%?10`I%BQ?pMxje&Q4-g-Q{3Yv$GYvS9I@cfIxw5n$WHYrUnGGb3r$H5nqFlgL66s+dp+>7lg7IC3{!u z^WE!_($TRpm^jp@l%57FnolT=g2|IQjbN%$)vw`%-n%_x-@HbBT+={r`_=@NZ>TKQ zS4JFNk?roz?x?3jt7b^ou&bG|imBNpp+Q&sI)4=6c_zBM<&ZN3w?N?S@j^4qjD|To zf;c_tZ3UQ3-X`8^$3cOw=}Gr*OW6+A8UOw;@iyH@eOj~bv@WQs}NJx!l2u-j( zzXcxChgS1VmdL)X8KM9F4$aAxT8kKTZK|tYqtEi7Lv^A_5gCXj8eZ&dT_m2j0`0`g zl*W8oC?R%A()Ok%jb4U8t9l%IG_`J#JcRI_>M?TS8|~7A^7gyv!P|PXnyYnmXS2D? z7S+ulh?Q>Ha;~4|o57dPIGM`g8fsda)tZfKEwtL=H@{ zfE^~8oTO~qOz%LC=cy4CJ(ER@mvmikSH8x^RQuTJ2kT9Db@%acvp!ykjEP@)-$&iPl=%$}qG! z$wJAh)&ks4k>t&qq-G5@lC(5+W!f|9Eb@ttjuvVW5bbs3vWIP|nS92*G?k9;8W3cu={r$hB@Hr_rO363rF_^AXD19$xvs88a{fM5 znt&K}5jOD#BHK4jRn==fxW$Numba+lW=vCEZM9}cBv6%XuF>e*MrqlamaGJ!e8GBj zTGHBlYO9JkB{8QWZ%_C8G6v#n)Txy8B7V|CD+djfG-jqGh7^8#SGGIT+s>ecZ}!Tr z%|Scu6zEC!<2@bSR;2AqY&6jFBtjDO_h)xydp#Mt;`+UUpjO-Q42c9Qbyxn~>0Dk7 z6_M&+Z#d#xx?2LPEl}>Yl3brYJn5dEY%0;*shMJ03lSc^HfGSf@fd-ZKyLt6LAr(h#Bv<`NvJ=#LIh&O2QTxz#$LGW+ghg_Y!VRB!(gY;Q) zO(pr)f8S+g>5b=JZv}X1>Dcwlf3t4^LCLdNGYoi79;chQtxHy=-pV{Uuo%==Zrfm<6 zIeCqM`?CFN$kaqz#Z!5^+T^NC5X3OemAEj7pdpL|7Iu{?aI{YTaM2E~Njl}V3NKZ^ zZ4ROCNtmql96RjvWayg0OGKm2$m`Z6cInT1<0j9+!htL@wX$n_W}WTaf-gl7affDw z{ujf3F4m>I6{>`CGk&@0bH_q~9rtPm(4T4c%CpK2rGhm9OG1EXA=RgBvp=R>m(mBf zN=)+USeI()$!=rNkZNg2>MtSdyve1_cpa~{HY0hlPmUi6+5Y~yO3E9spbrUp@R_sg z93Cs|nyKXQfBgd`F8A+Z9;4D9Qg9W2yFRBw4eoc(-CAeTV7Y&&(YB^L(?brd<~j6~ zdow$SN<=?%mHco?_dC3yW-@Rd!b!2dsXwb_!k+jF3F&g18oKz_X0`IRwktP~?vA(Q z2Rgd4n^@z__HJrusmW|VdFiIAuHH>M_y^;H-uBJ^t5n+i^Z)BKdbX&=blYU+7I}I^ z(J{auFVp(lCFf7DulZ-%AIn~!v^HI!KY~4-=mN?LXKxL9W6+6%zM{aehZ3Ds?CVA^ z4tgHYC&GR;_PXvB&fZh@gQEil9VF;LC^YP``IhzuVbE8{K28j}D%f{|{-O!mzs(+c zbmlDA9%FP@pzne`%; z&;=40vC-<%VP7%(<_mRcqlcWm(1Afm06LS<-NZh5_Bsa!eU0qlLLUnHEzl2!x!31E zFnV;*^M*ku$8_-mb9LO)orlhvA48CD_NYt`H0(=ck1~2){+dA_-4zOlZY}hlVV+VM zaBeGmv0locTZ%pL=xHf5>|17UC3;=Z5yRg4b5w?fdJ;b)o?veF9{b(dBgK9__D8XY zo_)TBdhyXqf_^XdW}=4$-9Lf3M*w;r*+Y&lhnF+xd_V^f`>5EXjm|7|QLvYaef0+# z_WWYl$BF(^_R0nZomuP`4-ES(*}p$uSD`^i6no?gjnxla=-|Wby$lSx9?*q=VgDri z+x|`bW3M}gy|ftiO``lKv?&*#U&R9T4q1{iWazUpqIzS5zd$9wvseop5hF~~@5dCkQ znT4KS_Sd6FjQzyu4MX4Gf#y^4N2d&X!O@$?p2kMy^ORt8)v-4>Fq{#Fjs*;RTQN`A zyV`^Jj4l;)v>a&Av53BF^rZxbeesyblxASiUs7n$#fRZ6-OK!P^;|q1uk4*gPa}I= zF}uY-_UWOcXs_sDk0QFM*ptrQ)ZZ$vZ;3yFPIz?8ZWnDBbieEqzsAZ9y>=M(CI))5 z!O@@dkjfu}-i9A54|J;p2Azus8uaYk?Z-ja00w=M?89ddG&;eaF7|ZAqW=Mdz9RNr zqR;4`g)dO~p)UqqBTvTVP+-sp@w{;KXtDqNz;mt9vBsId?EU48UG@^AAEMB(N43zP zGYCCE=$7Fey=Q$-^lhO(5*=TGLFX8IeP7OS9$8Fr0)t)}^kbs862o3f^t2V4IWLjk zMuodOJ{XF9?Q>xE_K}SPi&<%v{3JiJ^(DTIJ z{3_KSbev$&DR8#lb)Ut&8@i0pLxet_z$8T{hW*1B_OPS-??7{o=tSoZx*OTc&w0L9 zAGFGuGXifEkI?&zesgpmqALg+6ff0HHS(J*4P_IMASbqR_A>8{MAh zUA-+n=)-<-^l?r0^F#M6dNI%kh7Q2#^R!2};2qH0fi8={px3m}u&+2U?4!o8Kl(SL|Rht?Aci~c+G0dQW+1LALB(2;kb;p||{msDOq)rG!4&X4Ep zUi4?7!-Kusg$CWbfkCGLdK%EhggHWSFjWQbhHmKCT#X&%hh8W2QlJ+Cy))?M!Jv;4 z9ZTp}L}v~9Q_-)8K}RzNU76^NK_|d3^q%OWibA)-p~I5%tYgXp{R$Vx^&Qju7M^v2 zUI+9KKcTXjFFvE|jI$17Gxg4XTSZ6Xfd)N;81(g_546yrR|A6%?~kaCqtgQ&xEOTc zpbw>9@zE27?soRg&rlmdXUc=hH!$c84Gelr(HRw(?J8@|p5`n7^t-aJ9z7`9WN&p_ zJR^T}3SrRYHc5Oyx0(?>=>A1t5;~*Naf(iP^eLj_k@FPMg@YbW^toWr&xYO{bQ-;! zK?g!$I2#z94(Q}~QtyVo*ZY(<`Ww;r5tyr0{^(x}40_wq*MVLMbcvzc0i7D?bGldb zpSi|PTDJ-QLluMrsZ6rdL#eaM&l?}FdqijUqM^v9#q8NCtc zS;C-a6k~O#icjcfInbcH`WtfGs<7zWM}N-IdJpuGpkwwiy;q?@-ysGa6X*~^cg^oq z=h3b8U*Zoszcwl@^zWfNW4YdCY+Q9kJVXEb(}GV_p3mut9%gite^?g=9XAJ>9~HDS z{Ek)H=z~Ph19~XXC58_1D}A~Sj1P{^4-7gK(AULTADD#bDKs++aP*d-r}*VeTKRDX z2xn{*8gxOSLoYDBN)z3781#~r#Vu%ce|eDl1<|!y@0HNCQ~v1M`=ZYibUy_K9fjA+ zAKjSf-A2buU@nu}2bFhd-WVL1|Jj9+%)HyGsLFNf_l`sKo71Cx^Ksr<34&}7*Z;J% zq(6x3kNy1xXqPtmN|?RHkL`s%ZV1BDf*ry(-=W7W+$}uJsQ!+qVaD2T)6+2HdK;jI z8L4nn&G4fRZUq^BT>eAm?frNKaf6*2!;k7M-R!qJ;FTuA%FQc|8~k^Fm1tUqWb?keI+ry|De8-nEH>=D`Twx z_sdt1r~ZLA{4Bk{%?&fR{rZxL|#Z&~oyuwmzESB76fchH&g|4lXQ z9QD^A?+;bOk2&}kpkc=?_&dd}!xGe3zf^ymKZz99aH2Ckvupu>DtZw0S_O$C1y7$(Vu%iqI}I=B=*?5HnZ79VyJ!4mnfBL>Um!;a`J zoew+Oi$z{KJ;q?3hp=O*Wpv-r_r->>uhWBd1exja7>0+La000>Siy@l(o6{sv zn6Kx93U`v8W96>-x)m5nE+A$5D8bZ(R^<1WKC+qoHT>?!~`60u( zO9=1%S-sy3JyS}5k)D@{j(K{1SomT+Cn!8~`G3)SNCshzva&)k=Ib3okaN}QQWW!H z;mD~F{vb#BwB83sZqv)m*7NtuZ>FA$gwN9RD++hCp5IgCC3;2`{un(kQnt3Zt6}v^a9+LHLh)`WF5q^tY7AidX-aT?-?K)_g<9~&pY%i(sQfIVZ2T%I7k0L z+AQtQXBg=~)2V!IIx%9MS#LH-lkl0+;Cz-k@l(}FoF+}X%cZTqN}6D6)cI-ujag|{ z>3p8mW{pngYtSiLW7X-R8-KDowZqhL9-E z)Q?q1cAPrlMd}!rsB=9*oz6+>gqNu!O^VLYgd7Mt5ON^oK*)iR10e@O4ul*CIS_In bX9x_O*XNX4*fX)0f@n_Ng=7r?yX>eduf-I_*p^?(g7E5TssLs!UmO$r07eE(5RL`&A{wnA-5Sl>h3g~sv8=$M8H$lYr zHtz3$-UYn}`VQ!Q&$D(;)0Ezl#-Ht6S|KL+i9{si==APw{jkPg}f8K4@-1l2(e z&>pA>`V#aQ)B?3Z9Z(n41N{<2`M&6-BBgH1PH~XDgL^;q1SuZ>dJ8Sa&wKueXr;ry z{?*@felthq^;x%&dmqwSkVc0VOq8UIa_At^#ZecRns?eLwOuO5QT!C{l#?1Ot_|eg zO&uVA6Hm{7T~5u*-cAmGSUZY&IB0&gV|5381Ah{S^Pk~_3#&D&M^QCREeTqdS1&Br z%zCq9a_*aQrMiJf%dQ!Es}&2ZmL)YQP$(9(a)DPXrHZOmwo8&IWz%xUHv4tmFjqKP z7Bigvq-P>4PBXe~t!MW&`@Z`uBltcSVZV+S54Z>6tL5dA-4Dwms1?2>uc0JH%`_r~ zM1Wi2%_w_J~q=?+pPlw-C%d(OSUZDgfRo>() zQi4VVKA+#MpP4Ol(XNDl_h z8eV0BJf%maqFM?5jMjBs57n9F%M~gw(yHs0Jyh*-fzL_FMUj;<)j~ocn|{SZvHgKz z2PG)TVqTM#ilk$a5^O zp9XS`X{sU?q{_phm~NZ)UbmLv_M3fsfQpL9?Q#TZxSY}AxD0NAR^kbfW=JQ;OeM%> zbYu(?!N@bde4_;edt6z=g-MJuR1q$JqJG^V0c%V%`~_A`Jsc_|+BW=`+Svp2V!z z54E<{2qN>9yrvYj%?iJfCxL?zcXV6=D@ov$CYl0XYc%2=hA*>^wB!kZr;t2fE^F=( z9^`rXKewG_&>XHmpIchMs9$Tf%)?%{Z-;|p7#;PG86b%6vNzkK?1gepBc*}W-fPmB z7|yDcoKke9j~1Q;9j!xf%jL;Iti!g$Nq zYN}aJXFd%^_;H-7*)mZ_QPxPGA09cmF9v4+NwA^-+#4AlEvC z%e1+la$V=4TTh3Xwzb1(LxiH927OQ{21SKC(|^~pTx$-(PsbfU>D8egpxwF)YihX9ic zL<{n~R4FRyE~;{rH&hVy%uxnWE|>U<@X+bF3BfdINUB;?WhGloiodP!1zAWt%|W9N ziiAYA6#=qTq={Top;Xz{Xc$f|skDhj=cF*G;`1@#IjoP-Rw`;SpNGPlgzl?7EU(I-ffnlQNu1#wIvDDdc3;&VNl zo0|uax9~6j`px2B{{1(LlG8P5-Wt;gDPqO>Mwr+N!A6U^yu2})P04Q`t&|e~MO8{} zF_^;2n)O;`I3yuIEfD&i@^Hthe-rHChlq8k$J*z{JXCQ#c{630j4LoG_`DDw(e z>^B?ZqNA=PS}qkZXr&KVIO{8++ivTfT2%Xan%tz=@{eW<%+F4tR=65IES<+Np1TkW zX4lw?E5kj-v^_L0f6CSSO|w%=T0Dj;3`%zLLiCtPFNDA75SGXAKM%oV_#ean82;w~ zTMpj9@IR5^e=!u8;eSVA;tc;|_#ean0E)gacFFKRhW~L%5F*3>#sD-7|1%l>cO**8 z@IUWo3x@wO{O?Vp)Ay#t<0 z|IaP|A4T$CfdBV-a`$$8zt20?tD8;p;Ou>=s6Mz7gt+FYrsck$96B!6QnuML!^A(_ z>h>SIZqpx8KEg-$xHYcV?~+Ar+RD5ZW?n}`>(WD0ubF+0Qn4<3MZl%?^@k>4T23XZBYOSDx`9OAXB$ z>{>pf%N`Sl`G0fF|2x5rk@rlo<8aIlc|_!987vAn*QF4WKbzek-T zqpA(vxqaW_kUvqsVT5>%F#Att|2g6=&iucb|MwJq*BSoH@Lz`iGW?f2%3quLe|rXv zKC;X3U*`Y49k^>JyI?c_Z|qix9R|O>`0p=%=Nf*#9fEB)xUFXA);cGeyMu;<4SHKW zE~SK$i_VSXes?q#Z?_$S9LL3?ji`QimdsD-T3otXE^nwXN4=O5DtfSjYm~k+}{}}$~Z5GM) ze}p2EwwCnqzvR#t-G6{x|%>IuK zq6uKe(W5D%VB4s1o*yyjc~SOc)4YjMh72)}H05LGzj%vFhW|1AkDdSG+c-uJBw_ep zFf#k97~b|hJc=c{8>TVoj39RYi*uf&@9oR*zhj*2!S;V-`#-YtU+6?ChW|1AkKupe zVj~Iv^Ur^N_RO)j6IwWgr&extcSEOOvaoZGdS>_^!~dN17{mWY!5fDEG5jwI?~St} z^f9?)fHZKnW%wV*&VOd-KeO|n!-J*6g&aHoIr!}(7*5&w&+PnXeDg;kLU#Uh(n;0q z{AX?#KVKZ>PyB5>|M?%-`Oob9=a>=YxHFxT&Ltnmo9ukd&VRO!c}TOr20VfDpGE9B zxSJZJ8u(|X`h@j8*Y)}f?0@(f<>2jqC}Ouq1Nqb5kDZi_eGs4Tx{CcLmk{MF=(zho zRw#@6^xt%@=iPsDI=P0ayiEQVaQ=^b`Pw^!KNq)j+t^$4AJ+YcTmHjsKX>xl4!y;h z|96NGGym_QvtQ)`pOdiPUjptWE0{PEL*Vjc_UpP~a+cj67(J3e|<@k!EiB&$b{7ZLt>9i8(*pwBnHqcwnV;E0TL`^6TJAy=i z$bZVUwZrA*@KutL<_Y4zi`Zu|lS-XQEu>Sw@V6f3(;$lJ06|OZ3w-+Csxy#mi&*9vJHCQlmGjtEI$eQCMXxV(>uDZuI?OY{jTxY zw8L|orqUfcNd3=1>z)>tXFv-ianf~>w6Lc)bR1eW72*9%{IT%bDGUD=3PglCDY*M( zyhOqqn3=nsDM?Q`eE|BcHxhpDl%@A2O}b+Muu=7`daGGKshNPAb@{&>w0k|hHmw0L zJ^_35_**A5=znL1rN2Vb+h)t`;h-(EKdsgu{{nb#hE?#&>P|y5bgS8EOiTRuu>bB1 zi+_Q{cMl((%7QOG@Vzs`vSZ29(Ds|%mf0~*YV3P^hULeU-_Q=a{Z{RShQ7CESa=Nl z4XviP^~SWSK0fNbIrGw+Mt5psetgioI>XYRTiw9{&Qogi@pbMSGb}hpdkC(X)9Uc? z(f;)rmK`0QWG9GgN;Mx}=U$m%=`q%m^auKrDG49PHZIS$@YcT8)|=A;cH%?*Ycni7 z+C7A~?CE{n#)tY>XIOeH@9_f%KJA~FCxvOgGQ;B2pf_l?>?VHHn9i?T@qT}4hNY*< z$Im&o-T|;P9r5Em|KbdbkMA4v&^9}k^PARmi%m! zmHKyBFPxbH!7oAL%OL;mE5HGBY}4*HU-sM1uXbO0-*#c)l%>ChTKE}=F8}WSl}fp5 zT%*-AJ1+}r_~OUMyZKWVpG5r+PhS7-i~mN%hR1qh;U~-~_W-{Q%*}uje4*oa*M7$} zWSUkVh@(5HQsk$KQ2L9dG!<#hUH~MBrubD4sz(dKBx3X`~=l6wCHTapbJJSHu z0Mh`|0Mh`|K#~To&Cf03{ruAJx91=I_8WR;7t;XK0Mh`|0Mh`|0Mh`|0Mh`|!2eSX F{2!pI13dr$ diff --git a/TeamNexuiz/game/gamec/GameC.plg b/TeamNexuiz/game/gamec/GameC.plg deleted file mode 100644 index 2b05476e1..000000000 --- a/TeamNexuiz/game/gamec/GameC.plg +++ /dev/null @@ -1,1015 +0,0 @@ - - -
-

Build Log

-

---------------------Configuration: Game code - Win32 Debug-------------------- -

-

Command Lines

-Creating temporary file "C:\DOCUME~1\User\LOCALS~1\Temp\RSP66.tmp" with contents -[ -/nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "GAMECODE_EXPORTS" /Fp"Debug/GameC.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weapons.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\sv_main.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ed.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_fight.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_maps.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_misc.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_move.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_phys.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_way.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\ctf.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\domination.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\g_casings.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\g_damage.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\g_decors.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\g_lights.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\g_subs.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\g_tetris.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\g_triggers.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\g_violence.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\g_world.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\t_halflife.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\t_items.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\t_jumppads.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\t_plats.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\t_quake.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\t_quake3.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\t_teleporters.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_bombletts.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_common.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_crylink.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_electro.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_flamer.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_grenadelauncher.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_hagar.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_incendiary_r.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_laser.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_nex.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_rocketlauncher.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_shotgun.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_uzi.c" -"C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\w_hotbombs.c" -] -Creating command line "cl.exe @C:\DOCUME~1\User\LOCALS~1\Temp\RSP66.tmp" -Creating temporary file "C:\DOCUME~1\User\LOCALS~1\Temp\RSP67.tmp" with contents -[ -kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"Debug/GameC.pdb" /debug /machine:I386 /out:"Debug/GameC.dll" /implib:"Debug/GameC.lib" /pdbtype:sept -.\Debug\class.obj -.\Debug\engineer.obj -.\Debug\medic.obj -.\Debug\pyro.obj -.\Debug\scout.obj -.\Debug\soldier.obj -.\Debug\spy.obj -.\Debug\cl_client.obj -.\Debug\cl_impulse.obj -.\Debug\cl_physics.obj -.\Debug\cl_player.obj -.\Debug\cl_weaponanimations.obj -.\Debug\cl_weapons.obj -.\Debug\cl_weaponsystem.obj -.\Debug\sv_main.obj -.\Debug\sv_stats.obj -.\Debug\bot.obj -.\Debug\bot_ai.obj -.\Debug\bot_ed.obj -.\Debug\bot_fight.obj -.\Debug\bot_maps.obj -.\Debug\bot_misc.obj -.\Debug\bot_move.obj -.\Debug\bot_phys.obj -.\Debug\bot_way.obj -.\Debug\ctf.obj -.\Debug\domination.obj -.\Debug\g_casings.obj -.\Debug\g_damage.obj -.\Debug\g_decors.obj -.\Debug\g_lights.obj -.\Debug\g_subs.obj -.\Debug\g_tetris.obj -.\Debug\g_triggers.obj -.\Debug\g_violence.obj -.\Debug\g_world.obj -.\Debug\t_halflife.obj -.\Debug\t_items.obj -.\Debug\t_jumppads.obj -.\Debug\t_plats.obj -.\Debug\t_quake.obj -.\Debug\t_quake3.obj -.\Debug\t_teleporters.obj -.\Debug\w_bombletts.obj -.\Debug\w_common.obj -.\Debug\w_crylink.obj -.\Debug\w_electro.obj -.\Debug\w_flamer.obj -.\Debug\w_grenadelauncher.obj -.\Debug\w_hagar.obj -.\Debug\w_incendiary_r.obj -.\Debug\w_laser.obj -.\Debug\w_nex.obj -.\Debug\w_rocketlauncher.obj -.\Debug\w_shotgun.obj -.\Debug\w_uzi.obj -.\Debug\w_hotbombs.obj -] -Creating command line "link.exe @C:\DOCUME~1\User\LOCALS~1\Temp\RSP67.tmp" -

Output Window

-Compiling... -class.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(2) : error C2146: syntax error : missing ')' before identifier 'inflictor' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(2) : error C2081: 'entity' : name in formal parameter list illegal -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(2) : error C2061: syntax error : identifier 'inflictor' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(2) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(2) : error C2059: syntax error : ',' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(2) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(13) : error C2061: syntax error : identifier 'NameOfClass' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(13) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(13) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(48) : warning C4013: 'substring' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(48) : error C2065: 'self' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(48) : error C2224: left of '.playermodel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(49) : warning C4047: '==' : 'int ' differs in levels of indirection from 'char [6]' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(50) : error C2065: 'CLASS_SCOUT' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(50) : warning C4244: 'return' : conversion from 'int ' to 'float ', possible loss of data -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(51) : error C2224: left of '.playermodel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(52) : warning C4047: '==' : 'int ' differs in levels of indirection from 'char [4]' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(53) : error C2065: 'CLASS_SPY' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(53) : warning C4244: 'return' : conversion from 'int ' to 'float ', possible loss of data -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(54) : error C2224: left of '.playermodel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(55) : warning C4047: '==' : 'int ' differs in levels of indirection from 'char [8]' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(56) : error C2065: 'CLASS_SOLDIER' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(56) : warning C4244: 'return' : conversion from 'int ' to 'float ', possible loss of data -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(57) : error C2224: left of '.playermodel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(58) : warning C4047: '==' : 'int ' differs in levels of indirection from 'char [5]' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(59) : error C2065: 'CLASS_PYRO' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(59) : warning C4244: 'return' : conversion from 'int ' to 'float ', possible loss of data -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(60) : error C2224: left of '.playermodel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(61) : warning C4047: '==' : 'int ' differs in levels of indirection from 'char [6]' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(62) : error C2065: 'CLASS_MEDIC' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(62) : warning C4244: 'return' : conversion from 'int ' to 'float ', possible loss of data -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(63) : error C2224: left of '.playermodel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(64) : warning C4047: '==' : 'int ' differs in levels of indirection from 'char [9]' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(65) : error C2065: 'CLASS_ENGINEER' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(65) : warning C4244: 'return' : conversion from 'int ' to 'float ', possible loss of data -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(82) : warning C4013: 'bprint' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(82) : error C2224: left of '.netname' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(82) : warning C4013: 'NameOfClass' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(82) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(89) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(89) : error C2224: left of '.max_health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(90) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(90) : error C2224: left of '.max_health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(98) : error C2224: left of '.armorvalue' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(98) : error C2224: left of '.max_armor' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(99) : error C2224: left of '.armorvalue' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(99) : error C2224: left of '.max_armor' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(107) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(108) : warning C4013: 'BecomeScout' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(110) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(111) : warning C4013: 'BecomeSpy' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(113) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(114) : warning C4013: 'BecomeSoldier' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(116) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(117) : warning C4013: 'BecomePyro' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(119) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(120) : warning C4013: 'BecomeMedic' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(122) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(123) : warning C4013: 'BecomeEngineer' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(127) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(127) : warning C4013: 'ceil' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(127) : error C2224: left of '.max_health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(129) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(129) : error C2224: left of '.max_health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(132) : error C2224: left of '.armorvalue' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(132) : error C2224: left of '.max_armor' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(134) : error C2224: left of '.armorvalue' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(134) : error C2224: left of '.max_armor' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(141) : error C2146: syntax error : missing ')' before identifier 'pl' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(141) : error C2061: syntax error : identifier 'pl' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(141) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(141) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(142) : error C2449: found '{' at file scope (missing function header?) -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(178) : error C2059: syntax error : '}' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(254) : error C2146: syntax error : missing ')' before identifier 'pl' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(254) : error C2061: syntax error : identifier 'pl' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(254) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(254) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(255) : error C2449: found '{' at file scope (missing function header?) -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(262) : error C2059: syntax error : '}' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(282) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(287) : error C2224: left of '.playermodel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(287) : error C2224: left of '.mdl' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(293) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(295) : error C2224: left of '.change_mdl_on_respawn' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(296) : error C2224: left of '.change_mdl_on_respawn' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(306) : warning C4013: 'cvar' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(308) : error C2224: left of '.playermodel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(308) : error C2224: left of '.mdl' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(309) : warning C4013: 'ResetPlayerModel' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(324) : error C2224: left of '.change_mdl_on_respawn' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(324) : error C2224: left of '.playermodel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(325) : error C2224: left of '.change_mdl_on_respawn' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(325) : warning C4013: 'strzone' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(325) : error C2224: left of '.change_mdl_on_respawn' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(326) : error C2224: left of '.playermodel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(326) : error C2224: left of '.model' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(327) : warning C4013: 'sprint' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(335) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(336) : warning C4013: 'SpyDecloak' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(338) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(346) : warning C4013: 'PlayerKilled' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(346) : error C2065: 'TRUE' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(346) : error C2065: 'world' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(346) : error C2065: 'DEATH_CLASSCHANGE' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(346) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(346) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(347) : warning C4013: 'respawn' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(352) : warning C4244: 'function' : conversion from 'int ' to 'float ', possible loss of data -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(352) : warning C4244: 'function' : conversion from 'int ' to 'float ', possible loss of data -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(358) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(359) : warning C4013: 'ScoutSpecial' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(360) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(361) : warning C4013: 'SpySpecial' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(362) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(363) : warning C4013: 'SoldierSpecial' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(364) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(365) : warning C4013: 'PyroSpecial' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(366) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(367) : warning C4013: 'MedicSpecial' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(368) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(369) : warning C4013: 'EngineerSpecial' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(374) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(375) : warning C4013: 'ScoutPreThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(376) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(377) : warning C4013: 'SpyPreThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(378) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(379) : warning C4013: 'SoldierPreThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(380) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(381) : warning C4013: 'PyroPreThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(382) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(383) : warning C4013: 'MedicPreThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(384) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(385) : warning C4013: 'EngineerPreThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(390) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(391) : warning C4013: 'ScoutPostThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(392) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(393) : warning C4013: 'SpyPostThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(394) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(395) : warning C4013: 'SoldierPostThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(396) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(397) : warning C4013: 'PyroPostThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(398) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(399) : warning C4013: 'MedicPostThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(400) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\class.c(401) : warning C4013: 'EngineerPostThink' undefined; assuming extern returning int -engineer.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(3) : warning C4013: 'sprint' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(3) : error C2065: 'self' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(16) : error C2224: left of '.max_health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(16) : warning C4013: 'cvar' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(18) : error C2224: left of '.max_armor' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(20) : error C2224: left of '.mass' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(22) : warning C4013: 'SetPlayerSpeed' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(24) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(24) : error C2065: 'IT_WEP1' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(24) : error C2065: 'IT_WEP2' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(24) : error C2065: 'IT_WEP3' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(24) : error C2065: 'IT_WEP4' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(25) : error C2224: left of '.switchweapon' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(26) : error C2224: left of '.ammo_shells' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(26) : warning C4013: 'floor' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(27) : error C2224: left of '.ammo_nails' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(28) : error C2224: left of '.ammo_rockets' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\engineer.c(29) : error C2224: left of '.ammo_cells' must have struct/union type -medic.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(3) : warning C4013: 'sprint' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(3) : error C2065: 'self' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(16) : error C2224: left of '.max_health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(16) : warning C4013: 'cvar' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(18) : error C2224: left of '.max_armor' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(20) : error C2224: left of '.mass' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(22) : warning C4013: 'SetPlayerSpeed' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(24) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(24) : error C2065: 'IT_WEP1' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(24) : error C2065: 'IT_WEP2' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(24) : error C2065: 'IT_WEP3' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(24) : error C2065: 'IT_WEP4' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(25) : error C2224: left of '.switchweapon' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(26) : error C2224: left of '.ammo_shells' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(26) : warning C4013: 'floor' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(27) : error C2224: left of '.ammo_nails' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(28) : error C2224: left of '.ammo_rockets' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\medic.c(29) : error C2224: left of '.ammo_cells' must have struct/union type -pyro.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(3) : warning C4013: 'sprint' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(3) : error C2065: 'self' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(16) : error C2224: left of '.max_health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(16) : warning C4013: 'cvar' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(18) : error C2224: left of '.max_armor' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(20) : error C2224: left of '.mass' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(22) : warning C4013: 'SetPlayerSpeed' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(24) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(24) : error C2065: 'IT_WEP1' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(24) : error C2065: 'IT_WEP2' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(24) : error C2065: 'IT_WEP3' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(24) : error C2065: 'IT_WEP4' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(25) : error C2224: left of '.switchweapon' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(26) : error C2224: left of '.ammo_shells' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(26) : warning C4013: 'floor' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(27) : error C2224: left of '.ammo_nails' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(28) : error C2224: left of '.ammo_rockets' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\pyro.c(29) : error C2224: left of '.ammo_cells' must have struct/union type -scout.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(3) : warning C4013: 'sprint' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(3) : error C2065: 'self' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(16) : error C2224: left of '.max_health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(16) : warning C4013: 'cvar' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(18) : error C2224: left of '.max_armor' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(20) : error C2224: left of '.mass' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(22) : warning C4013: 'SetPlayerSpeed' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(24) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(24) : error C2065: 'IT_WEP1' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(24) : error C2065: 'IT_WEP2' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(24) : error C2065: 'IT_WEP3' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(24) : error C2065: 'IT_WEP4' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(25) : error C2224: left of '.switchweapon' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(26) : error C2224: left of '.ammo_shells' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(26) : warning C4013: 'floor' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(27) : error C2224: left of '.ammo_nails' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(28) : error C2224: left of '.ammo_rockets' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\scout.c(29) : error C2224: left of '.ammo_cells' must have struct/union type -soldier.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(3) : warning C4013: 'sprint' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(3) : error C2065: 'self' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(16) : error C2224: left of '.max_health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(16) : warning C4013: 'cvar' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(18) : error C2224: left of '.max_armor' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(20) : error C2224: left of '.mass' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(22) : warning C4013: 'SetPlayerSpeed' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(24) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(24) : error C2065: 'IT_WEP1' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(24) : error C2065: 'IT_WEP2' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(24) : error C2065: 'IT_WEP3' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(24) : error C2065: 'IT_WEP4' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(25) : error C2224: left of '.switchweapon' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(26) : error C2224: left of '.ammo_shells' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(26) : warning C4013: 'floor' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(27) : error C2224: left of '.ammo_nails' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(28) : error C2224: left of '.ammo_rockets' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\soldier.c(29) : error C2224: left of '.ammo_cells' must have struct/union type -spy.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(4) : error C2065: 'self' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(4) : error C2224: left of '.special_active' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(6) : error C2224: left of '.special_active' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(7) : warning C4013: 'ResetPlayerModel' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(8) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(9) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(11) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(16) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(18) : warning C4013: 'sprint' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(22) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(22) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(24) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(26) : error C2224: left of '.special_active' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(27) : error C2224: left of '.special_time' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(27) : error C2065: 'time' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(32) : error C2224: left of '.special_active' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(42) : error C2065: 'local' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(42) : error C2146: syntax error : missing ';' before identifier 'vector' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(42) : error C2065: 'vector' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(42) : error C2146: syntax error : missing ';' before identifier 'm1' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(42) : error C2065: 'm1' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(42) : error C2065: 'm2' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(43) : error C2224: left of '.special_active' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(45) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(49) : error C2224: left of '.model' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(49) : error C2224: left of '.special_time' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(51) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(51) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(52) : error C2224: left of '.weaponentity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(52) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(53) : error C2224: left of '.special_time' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(54) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(56) : error C2224: left of '.mins' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(57) : error C2224: left of '.maxs' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(58) : warning C4013: 'setmodel' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(59) : warning C4013: 'setsize' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(60) : error C2224: left of '.special_time' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(63) : error C2224: left of '.special_time' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(65) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(65) : error C2224: left of '.weaponentity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(66) : error C2224: left of '.special_time' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(69) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(69) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(70) : error C2224: left of '.armorvalue' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(71) : error C2224: left of '.armorvalue' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(71) : error C2224: left of '.armorvalue' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(76) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(76) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(78) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(78) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(79) : error C2224: left of '.weaponentity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(79) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(80) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(81) : error C2224: left of '.alpha' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(84) : error C2224: left of '.weaponentity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(87) : error C2224: left of '.exteriorweaponentity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(87) : error C2224: left of '.weaponentity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(96) : error C2224: left of '.max_health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(96) : warning C4013: 'cvar' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(98) : error C2224: left of '.max_armor' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(100) : error C2224: left of '.mass' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(102) : warning C4013: 'SetPlayerSpeed' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(104) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(104) : error C2065: 'IT_WEP1' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(104) : error C2065: 'IT_WEP2' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(104) : error C2065: 'IT_WEP3' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(104) : error C2065: 'IT_WEP4' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(105) : error C2224: left of '.switchweapon' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(106) : error C2224: left of '.ammo_shells' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(106) : warning C4013: 'floor' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(107) : error C2224: left of '.ammo_nails' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(108) : error C2224: left of '.ammo_rockets' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\spy.c(109) : error C2224: left of '.ammo_cells' must have struct/union type -cl_client.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(3) : error C2065: 'self' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(3) : error C2224: left of '.classname' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(17) : error C2061: syntax error : identifier 'SelectSpawnPoint' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(17) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(17) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(65) : error C2061: syntax error : identifier 'CheckPlayerModel' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(65) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(65) : error C2146: syntax error : missing ')' before identifier 'playermodel' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(65) : error C2061: syntax error : identifier 'playermodel' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(65) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(65) : error C2449: found '{' at file scope (missing function header?) -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(72) : error C2059: syntax error : '}' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(136) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(137) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(138) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(139) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(154) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(185) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(224) : warning C4013: 'Damage' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(224) : error C2065: 'DEATH_KILL' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(224) : error C2224: left of '.origin' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(224) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(236) : warning C4013: 'ClientInRankings' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(237) : warning C4013: 'bprint' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(237) : error C2224: left of '.netname' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(239) : warning C4013: 'stuffcmd' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(239) : warning C4013: 'strcat' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(239) : error C2065: 'mapname' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(241) : warning C4013: 'ftos' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(241) : warning C4013: 'cvar' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(260) : warning C4013: 'ClientDisconnected' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(261) : error C2224: left of '.netname' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(265) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(266) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(267) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(275) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(275) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(282) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(294) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(294) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(301) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(306) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(307) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(308) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(309) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(310) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(311) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(312) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(324) : error C2224: left of '.waterlevel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(326) : error C2224: left of '.watertype' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(326) : error C2065: 'CONTENT_WATER' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(327) : error C2224: left of '.velocity_z' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(328) : error C2224: left of '.watertype' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(328) : error C2065: 'CONTENT_SLIME' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(329) : error C2224: left of '.velocity_z' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(331) : error C2224: left of '.velocity_z' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(335) : error C2224: left of '.jump_pad' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(339) : warning C4013: 'CapPlayerVelocity' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(339) : error C2224: left of '.speed' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(342) : error C2224: left of '.flags' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(342) : error C2065: 'FL_ONGROUND' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(345) : error C2224: left of '.flags' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(345) : error C2065: 'FL_JUMPRELEASED' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(348) : error C2224: left of '.velocity_z' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(348) : error C2224: left of '.velocity_z' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(350) : error C2224: left of '.flags' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(350) : error C2224: left of '.flags' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(351) : error C2224: left of '.flags' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(351) : error C2224: left of '.flags' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(354) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(355) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(371) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(402) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(410) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(429) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(461) : warning C4013: 'CopyBody' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(462) : warning C4013: 'PutClientInServer' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(467) : error C2224: left of '.effects' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(467) : error C2224: left of '.effects' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(467) : error C2224: left of '.effects' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(467) : error C2065: 'EF_RED' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(467) : error C2065: 'EF_BLUE' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(467) : error C2065: 'EF_ADDITIVE' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(467) : error C2065: 'EF_FULLBRIGHT' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(468) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(468) : error C2065: 'IT_STRENGTH' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(470) : error C2224: left of '.effects' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(470) : error C2224: left of '.effects' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(471) : error C2065: 'time' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(471) : error C2224: left of '.strength_finished' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(473) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(473) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(473) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(474) : warning C4013: 'sprint' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(479) : error C2224: left of '.strength_finished' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(481) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(481) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(485) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(485) : error C2065: 'IT_INVINCIBLE' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(487) : error C2224: left of '.effects' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(487) : error C2224: left of '.effects' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(488) : error C2224: left of '.invincible_finished' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(490) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(490) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(490) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(496) : error C2224: left of '.invincible_finished' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(498) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(498) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(506) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(507) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(507) : warning C4013: 'bound' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(507) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(507) : error C2224: left of '.health' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(507) : error C2065: 'frametime' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_client.c(507) : fatal error C1003: error count exceeds 100; stopping compilation -cl_impulse.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(12) : error C2065: 'self' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(12) : error C2224: left of '.think' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(13) : error C2224: left of '.nextthink' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(13) : error C2065: 'time' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(14) : warning C4013: 'SV_PlayerPhysics' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(15) : warning C4013: 'PlayerPreThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(17) : warning C4013: 'PlayerPostThink' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(22) : error C2224: left of '.impulse' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(22) : error C2224: left of '.impulse' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(23) : warning C4013: 'W_SwitchWeapon' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(23) : error C2224: left of '.impulse' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(24) : error C2224: left of '.impulse' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(25) : warning C4013: 'W_NextWeapon' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(26) : error C2224: left of '.impulse' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(27) : warning C4013: 'W_PreviousWeapon' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(28) : error C2224: left of '.impulse' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(28) : warning C4013: 'cvar' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(30) : warning C4013: 'makevectors' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(30) : error C2224: left of '.v_angle' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(31) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(31) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(31) : error C2065: 'v_forward' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(33) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(33) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(35) : error C2224: left of '.impulse' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(37) : error C2224: left of '.impulse' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(39) : error C2224: left of '.items' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(39) : error C2065: 'IT_WEP1' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(39) : error C2065: 'IT_WEP2' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(39) : error C2065: 'IT_WEP3' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(39) : error C2065: 'IT_WEP4' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(39) : error C2065: 'IT_WEP5' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(40) : error C2224: left of '.ammo_shells' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(41) : error C2224: left of '.ammo_nails' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(42) : error C2224: left of '.ammo_rockets' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(43) : error C2224: left of '.ammo_cells' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(46) : error C2224: left of '.impulse' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(48) : warning C4013: 'ClassSpecial' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(52) : error C2224: left of '.impulse' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(55) : warning C4013: 'sprint' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(56) : warning C4013: 'NameOfClass' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(56) : error C2224: left of '.class' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(58) : error C2224: left of '.playermodel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_impulse.c(62) : error C2224: left of '.impulse' must have struct/union type -cl_physics.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(7) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(8) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(9) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(11) : error C2061: syntax error : identifier 'HorizVelocity' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(11) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(11) : error C2146: syntax error : missing ')' before identifier 'vel' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(11) : error C2061: syntax error : identifier 'vel' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(11) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(12) : error C2449: found '{' at file scope (missing function header?) -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(15) : error C2059: syntax error : '}' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(35) : error C2065: 'local' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(35) : error C2146: syntax error : missing ';' before identifier 'vector' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(35) : error C2065: 'vector' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(35) : error C2146: syntax error : missing ';' before identifier 'wishvel' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(35) : error C2065: 'wishvel' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(35) : error C2065: 'wishdir' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(35) : error C2065: 'v' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(36) : error C2143: syntax error : missing ';' before 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(38) : error C2143: syntax error : missing ';' before 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(40) : error C2065: 'self' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(40) : error C2224: left of '.movetype' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(40) : error C2065: 'MOVETYPE_NONE' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(43) : error C2224: left of '.punchangle' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(43) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(45) : error C2065: 'f' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(45) : warning C4013: 'vlen' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(45) : error C2224: left of '.punchangle' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(45) : error C2065: 'frametime' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(47) : error C2224: left of '.punchangle' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(47) : warning C4013: 'normalize' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(47) : error C2224: left of '.punchangle' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(49) : error C2224: left of '.punchangle' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(49) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(52) : error C2224: left of '.punchvector' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(52) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(54) : error C2224: left of '.punchvector' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(56) : error C2224: left of '.punchvector' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(56) : error C2224: left of '.punchvector' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(58) : error C2224: left of '.punchvector' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(58) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(62) : error C2224: left of '.deadflag' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(66) : warning C4013: 'SetPlayerSpeed' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(67) : error C2065: 'classmaxspeed' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(67) : error C2224: left of '.speed' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(69) : warning C4244: '=' : conversion from 'float ' to 'int ', possible loss of data -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(72) : error C2065: 'classstopspeed' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(72) : error C2224: left of '.speed' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(74) : error C2224: left of '.fixangle' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(76) : error C2224: left of '.angles_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(77) : error C2224: left of '.angles_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(77) : error C2224: left of '.v_angle_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(78) : error C2224: left of '.angles_z' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(81) : error C2224: left of '.flags' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(81) : error C2065: 'FL_WATERJUMP' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(83) : error C2224: left of '.velocity_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(83) : error C2224: left of '.movedir_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(84) : error C2224: left of '.velocity_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(84) : error C2224: left of '.movedir_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(85) : error C2065: 'time' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(85) : error C2224: left of '.teleport_time' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(85) : error C2224: left of '.waterlevel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(87) : error C2224: left of '.flags' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(87) : error C2224: left of '.flags' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(87) : error C2224: left of '.flags' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(88) : error C2224: left of '.teleport_time' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(91) : error C2224: left of '.movetype' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(91) : error C2065: 'MOVETYPE_NOCLIP' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(91) : error C2224: left of '.movetype' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(91) : error C2065: 'MOVETYPE_FLY' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(94) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(94) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(95) : warning C4013: 'makevectors' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(95) : error C2224: left of '.v_angle' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(97) : error C2065: 'v_forward' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(97) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(97) : error C2065: 'v_right' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(97) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(97) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(97) : error C2224: left of '.movement_z' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(100) : error C2065: 'wishspeed' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(103) : error C2224: left of '.teleport_time' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(105) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(107) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(107) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(107) : warning C4013: 'min' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(110) : error C2224: left of '.waterlevel' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(113) : error C2224: left of '.v_angle' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(115) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(115) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(115) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(115) : error C2224: left of '.movement_z' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(116) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(117) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(123) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(126) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(126) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(129) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(131) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(131) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(132) : warning C4013: 'CapPlayerVelocity' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(134) : error C2224: left of '.ladder_time' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(137) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(137) : error C2224: left of '.velocity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(138) : error C2224: left of '.v_angle' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(140) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(140) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(140) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(140) : error C2224: left of '.movement_z' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(141) : error C2224: left of '.gravity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_physics.c(141) : fatal error C1003: error count exceeds 100; stopping compilation -cl_player.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(1) : error C2061: syntax error : identifier 'die1' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(1) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(1) : error C2061: syntax error : identifier 'draw' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(1) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(1) : error C2061: syntax error : identifier 'duckwalk' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(1) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(1) : error C2061: syntax error : identifier 'duckidle' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(1) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(2) : error C2061: syntax error : identifier '$frame' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(2) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(2) : error C2061: syntax error : identifier 'pain1' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(2) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(2) : error C2061: syntax error : identifier 'shoot' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(2) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(2) : error C2061: syntax error : identifier 'run' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(2) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(3) : error C2061: syntax error : identifier '$frame' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(3) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(3) : error C2061: syntax error : identifier 'straferight' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(3) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(3) : error C2061: syntax error : identifier 'dead2' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(3) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(4) : error C2061: syntax error : identifier '$frame' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(4) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(4) : error C2061: syntax error : identifier 'backright' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(4) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(17) : error C2054: expected '(' to follow 'backleft' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(18) : error C2085: 'CopyBody' : not in formal parameter list -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(18) : error C2143: syntax error : missing ';' before '{' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(60) : error C2065: 'self' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(60) : error C2224: left of '.deadflag' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(60) : error C2065: 'DEAD_NO' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(62) : error C2065: 'time' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(62) : error C2224: left of '.dead_time' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(64) : error C2224: left of '.maxs_z' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(65) : warning C4013: 'setsize' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(65) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(65) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(66) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(66) : error C2224: left of '.dead_frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(69) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(69) : error C2224: left of '.die_frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(74) : error C2224: left of '.crouch' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(76) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(76) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(76) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(76) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(77) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(77) : error C2065: '$duckwalk' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(79) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(79) : error C2065: '$duckidle' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(81) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(81) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(81) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(81) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(83) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(83) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(84) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(84) : error C2065: '$run' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(85) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(85) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(86) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(86) : error C2065: '$runbackwards' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(87) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(87) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(88) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(88) : error C2065: '$straferight' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(89) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(89) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(90) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(90) : error C2065: '$strafeleft' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(91) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(91) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(92) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(92) : error C2065: '$forwardright' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(93) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(93) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(94) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(94) : error C2065: '$forwardleft' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(95) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(95) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(96) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(96) : error C2065: '$backright' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(97) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(97) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(98) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(98) : error C2065: '$backleft' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(100) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(102) : error C2224: left of '.pain_finished' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(103) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(103) : error C2224: left of '.pain_frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(104) : error C2224: left of '.attack_finished' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(105) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(105) : error C2065: '$shoot' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(107) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(107) : error C2065: '$idle' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(109) : error C2224: left of '.flags' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(109) : error C2065: 'FL_ONGROUND' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(110) : error C2224: left of '.frame' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(110) : error C2065: '$jump' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(114) : error C2146: syntax error : missing ')' before identifier 'org' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(114) : error C2061: syntax error : identifier 'org' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_player.c(114) : fatal error C1003: error count exceeds 100; stopping compilation -cl_weaponanimations.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(1) : error C2061: syntax error : identifier 'fire' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(1) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(1) : error C2061: syntax error : identifier 'idle' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(1) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(4) : error C2054: expected '(' to follow 'run' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(4) : error C2085: 'WFRAME_FIRE1' : not in formal parameter list -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(4) : error C2143: syntax error : missing ';' before '=' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(14) : error C2065: 'self' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(14) : error C2224: left of '.attack_finished' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(14) : error C2065: 'time' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(15) : error C2224: left of '.weaponframe' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(15) : error C2065: '$fire' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(16) : error C2224: left of '.movement_x' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(16) : error C2224: left of '.movement_y' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(17) : error C2224: left of '.weaponframe' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(17) : error C2065: '$run' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(19) : error C2224: left of '.weaponframe' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(19) : error C2065: '$idle' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(23) : error C2224: left of '.weaponentity' must have struct/union type -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponanimations.c(24) : error C2224: left of '.weaponentity' must have struct/union type -cl_weapons.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weapons.c(4) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weapons.c(102) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weapons.c(117) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weapons.c(139) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weapons.c(161) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weapons.c(285) : error C2015: too many characters in constant -cl_weaponsystem.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(10) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(22) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(57) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(69) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(70) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(80) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(81) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(87) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(102) : error C2146: syntax error : missing ')' before identifier 'cl' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(102) : error C2061: syntax error : identifier 'cl' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(102) : error C2059: syntax error : ',' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(102) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(129) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(142) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(149) : error C2146: syntax error : missing ')' before identifier 'e' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(149) : error C2061: syntax error : identifier 'e' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(149) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(150) : error C2054: expected '(' to follow 'w_getbestweapon' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(169) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(197) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(205) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(235) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(258) : error C2146: syntax error : missing ')' before identifier 'ent' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(258) : error C2061: syntax error : identifier 'ent' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(258) : error C2059: syntax error : ',' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(258) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(260) : error C2015: too many characters in constant -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(266) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\cl_weaponsystem.c(276) : error C2059: syntax error : 'type' -sv_main.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\sv_main.c(10) : error C2065: 'sv_maxspeed' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\sv_main.c(10) : warning C4013: 'cvar' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\sv_main.c(11) : error C2065: 'sv_friction' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\sv_main.c(12) : error C2065: 'sv_accelerate' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\sv_main.c(13) : error C2065: 'sv_stopspeed' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\sv_main.c(14) : error C2065: 'teamplay' : undeclared identifier -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\sv_main.c(16) : warning C4013: 'BotFrame' undefined; assuming extern returning int -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\sv_main.c(17) : warning C4013: 'CheckRules_World' undefined; assuming extern returning int -bot.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(88) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(107) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(108) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(109) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(110) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(111) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(112) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(113) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(114) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(115) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(116) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(117) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(118) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(119) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(120) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(121) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(123) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(124) : error C2059: syntax error : '.' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(198) : error C2061: syntax error : identifier 'fixer' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(198) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(199) : error C2061: syntax error : identifier 'route_table' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(199) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(200) : error C2061: syntax error : identifier 'b_temp1' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(200) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(200) : error C2059: syntax error : ',' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(201) : error C2061: syntax error : identifier 'player_head' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(201) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(201) : error C2059: syntax error : ',' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(207) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(208) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(209) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(212) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(213) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(214) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(215) : error C2146: syntax error : missing ')' before identifier 'bot' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(215) : error C2061: syntax error : identifier 'bot' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(215) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(216) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(217) : error C2146: syntax error : missing ')' before identifier 'who' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(217) : error C2061: syntax error : identifier 'who' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(217) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(220) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(221) : error C2146: syntax error : missing ')' before identifier 'org' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(221) : error C2061: syntax error : identifier 'org' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(221) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(221) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(222) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(223) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(224) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(225) : error C2146: syntax error : missing ')' before identifier 'this' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(225) : error C2061: syntax error : identifier 'this' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(225) : error C2059: syntax error : ',' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(225) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(226) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(227) : error C2146: syntax error : missing ')' before identifier 'start' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(227) : error C2061: syntax error : identifier 'start' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(227) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(227) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(230) : error C2146: syntax error : missing ')' before identifier 'e' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(230) : error C2061: syntax error : identifier 'e' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(230) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(231) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(232) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(233) : error C2146: syntax error : missing ')' before identifier 'weird' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(233) : error C2061: syntax error : identifier 'weird' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(233) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(234) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(235) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(236) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(237) : error C2146: syntax error : missing ')' before identifier 'sdir' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(237) : error C2061: syntax error : identifier 'sdir' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(237) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(238) : error C2146: syntax error : missing ')' before identifier 'whichway' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(238) : error C2061: syntax error : identifier 'whichway' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(238) : error C2059: syntax error : ',' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(238) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(239) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(240) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(241) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(244) : error C2061: syntax error : identifier 'PickARandomName' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(244) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(245) : error C2146: syntax error : missing ')' before identifier 'targ' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(245) : error C2061: syntax error : identifier 'targ' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(245) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(246) : error C2059: syntax error : 'type' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(247) : error C2146: syntax error : missing ')' before identifier 'targ1' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(247) : error C2061: syntax error : identifier 'targ1' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(247) : error C2059: syntax error : ',' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(247) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(248) : error C2146: syntax error : missing ')' before identifier 'targ' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(248) : error C2061: syntax error : identifier 'targ' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(248) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(249) : error C2146: syntax error : missing ')' before identifier 'targ' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(249) : error C2061: syntax error : identifier 'targ' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(249) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(250) : error C2146: syntax error : missing ')' before identifier 'ent' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(250) : error C2061: syntax error : identifier 'ent' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(250) : error C2059: syntax error : ';' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(250) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(251) : error C2146: syntax error : missing ')' before identifier 'ent' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(251) : error C2061: syntax error : identifier 'ent' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot.c(251) : fatal error C1003: error count exceeds 100; stopping compilation -bot_ai.c -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(55) : error C2146: syntax error : missing ')' before identifier 'scot' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(55) : error C2061: syntax error : identifier 'scot' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(55) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(57) : error C2059: syntax error : 'if' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(59) : error C2059: syntax error : 'else' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(61) : error C2059: syntax error : 'else' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(63) : error C2059: syntax error : 'else' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(65) : error C2059: syntax error : 'else' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(67) : error C2059: syntax error : 'else' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(69) : error C2059: syntax error : '}' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(82) : error C2146: syntax error : missing ')' before identifier 'ent' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(82) : error C2061: syntax error : identifier 'ent' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(82) : error C2059: syntax error : ')' -C:\Games\Nexuiz\TeamNexuiz\src\game\gamec\bot_ai.c(84) : error C2059: syntax error : 'if' -cl.exe terminated at user request. - -
- - diff --git a/TeamNexuiz/game/gamec/Makefile b/TeamNexuiz/game/gamec/Makefile deleted file mode 100644 index 37764fae7..000000000 --- a/TeamNexuiz/game/gamec/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -../../data/progs.dat: *.nc *.qc bot/*.qc bot/maps/*.qc Makefile progs.src - frikqcc /O2 -warn 2 || true - -clean: - rm -f ../../data/progs.dat progdefs.h error.log diff --git a/TeamNexuiz/game/gamec/bot.c b/TeamNexuiz/game/gamec/bot.c deleted file mode 100644 index 537f359f3..000000000 --- a/TeamNexuiz/game/gamec/bot.c +++ /dev/null @@ -1,1239 +0,0 @@ - -/* -====================================== -FrikBot X (Version 0.10.1) -====================================== - -This program is in the Public Domain. My crack legal -team would like to add: - -RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" -AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE -ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR -FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN -NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY -GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, -EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" -SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. - -You accept this software on the condition that you -indemnify and hold harmless Ryan "FrikaC" Smith from -any and all liability or damages to third parties, -including attorney fees, court costs, and other -related costs and expenses, arising out of your use -of this software irrespective of the cause of said -liability. - -The export from the United States or the subsequent -reexport of this software is subject to compliance -with United States export control and munitions -control restrictions. You agree that in the event you -seek to export this software, you assume full -responsibility for obtaining all necessary export -licenses and approvals and for assuring compliance -with applicable reexport restrictions. - -Any reproduction of this software must contain -this notice in its entirety. - -====================================== -These installation instructions only apply to Normal Quake (as does this -entire file). For QuakeWorld, please refer to bot_qw.qc - --------------------------------------- -To install on a new mod, do all this: --------------------------------------- -Place all included bot*.qc files in the subdirectory "frikbot" -in your source folder, then... - -* Add the following lines to progs.src right after the defs.qc line -frikbot/bot.qc -frikbot/bot_way.qc -frikbot/bot_fight.qc -frikbot/bot_ai.qc -frikbot/bot_misc.qc -frikbot/bot_phys.qc -frikbot/bot_move.qc -frikbot/bot_ed.qc - --------------------------------------- -* Comment out the following functions in defs.qc -sound, stuffcmd, sprint, aim, centerprint, setspawnparms -WriteByte, WriteChar, WriteShort, WriteLong, WriteCoord -WriteAngle, WriteString, WriteEntity --------------------------------------- -* Add this to worldspawn() in world.qc, right at the very top, before InitBodyQue(); -BotInit(); // FrikBot --------------------------------------- -* add this line to StartFrame() in world.qc, at the very top -BotFrame(); // FrikBot --------------------------------------- -* Add these two lines to PlayerPreThink in client.qc at the very top -if (BotPreFrame()) // FrikBot - return; --------------------------------------- -* Add this line to PlayerPostThink in client.qc at the very top -if (BotPostFrame()) // FrikBot - return; --------------------------------------- -* Add the following line to the very top of Client Connect in client.qc -ClientInRankings(); // FrikBot --------------------------------------- -* Add these lines to the very top of ClientDisconnect in client.qc -ClientDisconnected(); // FrikBot --------------------------------------- -*/ - -void() bot_map_load = -{ - // place your qc loaded waypoints here - //if (mapname == "mattrye1_nex") - // map_mattrye1_nex(); -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Variables and shtuff - -bot.qc has become pretty much a header file -for all variable in the bot... - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -// ----- entity fields --- -.float wallhug, keys, oldkeys, ishuman; -.float b_frags, b_clientno, b_shirt, b_pants; -.float ai_time, b_sound, missile_speed; -.float portal_time, b_skill, switch_wallhug; -.float b_aiflags, b_num, b_chattime; -.float b_menu, b_menu_time, b_menu_value; -.float route_failed, dyn_flags, dyn_time; -.float dyn_plat; -.entity temp_way, last_way, phys_obj; -.entity target1, target2, target3, target4; -.entity _next, _last; -.entity current_way; -.vector b_angle, mouse_emu, obs_dir; -.vector movement, b_dir; -.vector dyn_dest; - -.float search_time; -.vector dest1, dest2; - -// --------defines----- -//float SVC_UPDATENAME = 13; -//float SVC_UPDATEFRAGS = 14; -//float SVC_UPDATECOLORS = 17; - -// used for the physics & movement AI -float KEY_MOVEUP = 1; -float KEY_MOVEDOWN = 2; -float KEY_MOVELEFT = 4; -float KEY_MOVERIGHT = 8; -float KEY_MOVEFORWARD = 16; -float KEY_MOVEBACK = 32; -float KEY_LOOKUP = 64; -float KEY_LOOKDOWN = 128; -float KEY_LOOKLEFT = 256; -float KEY_LOOKRIGHT = 512; - -// these are aiflags for waypoints -// some overlap to the bot -float AI_TELELINK_1 = 1; // link type -float AI_TELELINK_2 = 2; // link type -float AI_TELELINK_3 = 4; // link type -float AI_TELELINK_4 = 8; // link type -float AI_DOORFLAG = 16; // read ahead -float AI_PRECISION = 32; // read ahead + point -float AI_SURFACE = 64; // point -float AI_BLIND = 128; // read ahead + point -float AI_JUMP = 256; // point + ignore -float AI_DIRECTIONAL = 512; // read ahead + ignore -float AI_PLAT_BOTTOM = 1024; // read ahead -float AI_RIDE_TRAIN = 2048; // read ahead -float AI_SUPER_JUMP = 4096; // point + ignore + route test -float AI_SNIPER = 8192; // point type -float AI_AMBUSH = 16384; // point type -float AI_DOOR_NO_OPEN = 32768; // read ahead -float AI_DIFFICULT = 65536; // route test -float AI_TRACE_TEST = 131072; // route test -float AI_CARELESS = 262144; // Electro - jumppads, bot doesn't have to touch this entity, only get close - -// these are flags for bots/players (dynamic/editor flags) -float AI_OBSTRUCTED = 1; -float AI_HOLD_SELECT = 2; -float AI_ROUTE_FAILED = 2; -float AI_WAIT = 4; -float AI_DANGER = 8; - - -// addition masks -float AI_POINT_TYPES = 29152; -float AI_READAHEAD_TYPES = 36528; -float AI_IGNORE_TYPES = 4864; - -float WM_UNINIT = 0; -float WM_DYNAMIC = 1; -float WM_LOADING = 2; -float WM_LOADED = 3; -float WM_EDITOR = 4; -float WM_EDITOR_DYNAMIC = 5; -float WM_EDITOR_DYNLINK = 6; - - -float OPT_SAVEBOTS = 1; -float OPT_NOCHAT = 2; - -// -------globals----- -float active_clients; -float max_clients, real_frametime; -float bot_count, b_options; -float waypoint_mode, dump_mode; -float waypoints, direct_route; -float sv_friction, sv_gravity; -float sv_accelerate, sv_maxairspeed, sv_maxspeed, sv_stopspeed; -entity fixer; -entity route_table; -entity b_temp1, b_temp2, b_temp3; -entity player_head, phys_head, way_head; -float busy_waypoints; -float saved_bots, saved_skills1, saved_skills2, current_bots; - -// -------ProtoTypes------ -// external -void() ClientConnect; -void() ClientDisconnect; -void() SetNewParms; - -// rankings -float(float clientno) ClientBitFlag; -float() ClientNextAvailable; -void(float whichteam, float whatbot, float whatskill) BotConnect; -void(entity bot) BotDisconnect; -void(float clientno) BotInvalidClientNo; -void(entity who) UpdateClient; - -// waypointing -void() DynamicWaypoint; -entity(vector org) make_waypoint; -void() ClearAllWays; -void() FixWaypoints; -float() begin_route; -void(entity this, float direct) bot_get_path; -void() WaypointThink; -entity(entity start) FindWayPoint; - -// physics & movement -float(entity e) bot_can_rj; -void() bot_jump; -void() frik_bot_roam; -float(vector weird) frik_walkmove; -void() frik_movetogoal; -void() frik_obstacles; -float(float flag) frik_recognize_plat; -float(vector sdir) frik_KeysForDir; -void(vector whichway, float danger) frik_obstructed; -void() SV_Physics_Client; -void() SV_ClientThink; -void() CL_KeyMove; - -// ai & misc -string() PickARandomName; -float(entity targ) fov; -float(float y1, float y2) angcomp; -float(entity targ1, entity targ2) wisible; -float(entity targ) sisible; -float(entity targ) fisible; -vector(entity ent) realorigin; -void(entity ent) target_drop; -void(entity ent) target_add; -void() KickABot; -void() BotImpulses; -void(entity targ, float success) bot_lost; -string(float r) BotName; -float(float v) frik_anglemod; -//void() bot_chat; -void(float tpic) bot_start_topic; - - -// editor stuffs - -void() bot_way_edit; -void() bot_menu_display; - - -// ----------Commands--------- -void(entity e, float chan, string samp, float vol, float atten) frik_sound = #8; -void(entity client, string s) frik_stuffcmd = #21; -void(entity client, string s) frik_sprint = #24; -vector(entity e, float sped) frik_aim = #44; -void(entity client, string s) frik_centerprint = #73; -void(entity e) frik_setspawnparms = #78; -void(float to, float f) frik_WriteByte = #52; -void(float to, float f) frik_WriteChar = #53; -void(float to, float f) frik_WriteShort = #54; -void(float to, float f) frik_WriteLong = #55; -void(float to, float f) frik_WriteCoord = #56; -void(float to, float f) frik_WriteAngle = #57; -void(float to, string s) frik_WriteString = #58; -void(float to, entity s) frik_WriteEntity = #59; - -void(entity client, string s1, string s2, string s3, string s4, string s5, string s6, string s7) -frik_big_centerprint = #73; - -//---------------------------------------------------------------------------- - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Function redclarations. These allow function -designed to work for clients (sprint, so forth) -to mainly not complain when working with a bot - -Although these shouldn't be needed anymore, -as the bots truly are clients now, if you don't -stop the SZ_ buffer from filling up by disabling -direct messages to the bots, it crashes quake :-( - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -void(entity client, string s) stuffcmd = -{ - if (client.ishuman == 1) - frik_stuffcmd(client, s); - b_temp1 = player_head; - - while(b_temp1) - { - if (b_temp1.classname == "botcam") - { - if ((b_temp1.enemy == client) && b_temp1.ishuman) - frik_stuffcmd(b_temp1, s); - } - b_temp1 = b_temp1._next; - } -}; - -void(entity e) setspawnparms = -{ - if (e.ishuman == 1) - frik_setspawnparms(e); - else - { - b_temp1 = player_head; - while(b_temp1) - { - if (b_temp1.ishuman) - { - frik_setspawnparms(b_temp1); - return; - } - b_temp1 = b_temp1._next; - } - SetNewParms(); - } -}; -void(entity client, string s) sprint = -{ - if (client.ishuman == 1) - frik_sprint(client, s); - b_temp1 = player_head; - - while(b_temp1) - { - if (b_temp1.classname == "botcam") - { - if ((b_temp1.enemy == client) && b_temp1.ishuman) - frik_sprint(b_temp1, s); - } - b_temp1 = b_temp1._next; - } - -}; -void(entity client, string s) centerprint = -{ - if (client.ishuman == 1) - frik_centerprint(client, s); - b_temp1 = player_head; - - while(b_temp1) - { - if (b_temp1.classname == "botcam") - { - if ((b_temp1.enemy == client) && b_temp1.ishuman) - frik_centerprint(b_temp1, s); - } - b_temp1 = b_temp1._next; - } -}; - -vector(entity e, float sped) aim = -{ - e.missile_speed = sped; - return frik_aim(e, sped); -}; - -void(entity e, float chan, string samp, float vol, float atten) sound = -{ - - frik_sound(e, chan, samp, vol, atten); - if (samp == "items/inv3.wav") - return; - else if (e.classname == "player") - e.b_sound = time + 1; - else if (other.classname == "player") - other.b_sound = time + 1; - -}; -void(float to, float f) WriteByte = -{ - if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) - return; - frik_WriteByte(to, f); -}; -void(float to, float f) WriteChar = -{ - if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) - return; - frik_WriteChar(to, f); -}; -void(float to, float f) WriteShort = -{ - if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) - return; - frik_WriteShort(to, f); -}; -void(float to, float f) WriteLong = -{ - if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) - return; - frik_WriteLong(to, f); -}; -void(float to, float f) WriteCoord = -{ - if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) - return; - frik_WriteCoord(to, f); -}; -void(float to, float f) WriteAngle = -{ - if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) - return; - frik_WriteAngle(to, f); -}; -void(float to, string s) WriteString = -{ - if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) - return; - frik_WriteString(to, s); -}; -void(float to, entity s) WriteEntity = -{ - if ((to == MSG_ONE) && (msg_entity.ishuman != TRUE)) - return; - frik_WriteEntity(to, s); -}; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Bot Cam, see what the bot sees (or any other player) - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -float() botcam = -{ - if (self.classname != "botcam") - return FALSE; - setorigin(self, self.enemy.origin); - self.items = self.enemy.items; - self.weapon = self.enemy.weapon; - self.weaponmodel = self.enemy.weaponmodel; - self.currentammo = self.enemy.currentammo; - self.weaponframe = self.enemy.weaponframe; - self.ammo_shells = self.enemy.ammo_shells; - self.ammo_nails = self.enemy.ammo_nails; - self.ammo_rockets= self.enemy.ammo_rockets; - self.ammo_cells = self.enemy.ammo_cells; - self.view_ofs = self.enemy.view_ofs; - self.health = self.enemy.health; - self.armorvalue = self.enemy.armorvalue; - self.dmg_take = self.enemy.dmg_take; - self.dmg_save = self.enemy.dmg_save; - self.dmg_inflictor = self.enemy.dmg_inflictor; - self.punchangle = self.enemy.punchangle; - self.deadflag = self.enemy.deadflag; - msg_entity = self; - WriteByte (MSG_ONE,5); - WriteEntity (MSG_ONE, self.enemy); - WriteByte (MSG_ONE, 10); - WriteAngle (MSG_ONE,self.enemy.v_angle_x); - WriteAngle (MSG_ONE,self.enemy.v_angle_y); - WriteAngle (MSG_ONE,self.enemy.v_angle_z); - self.modelindex = 0; - - self.impulse = 0; - return TRUE; - -}; - -void() botcam_u = -{ - - // sloppy cycling code - if (self.classname != "botcam") - { - self.enemy = player_head; - } - else - { - do - self.enemy = self.enemy._next; - while (self.enemy.classname == "botcam"); - } - if (self.enemy == self) - { - do - self.enemy = self.enemy._next; - while (self.enemy.classname == "botcam"); - } - - self.classname = "botcam"; - self.solid = SOLID_NOT; - self.movetype = MOVETYPE_NONE; - self.takedamage = DAMAGE_NO; - - - if (!self.enemy) - { - sprint(self, "No one left to track!\n"); - msg_entity = self; - WriteByte (MSG_ONE,5); - WriteEntity (MSG_ONE, self); - PutClientInServer(); - return; - } - if (!self.enemy.ishuman) - { - self.enemy.dmg_take = 0; - self.enemy.dmg_save = 0; - } - sprint(self, "Now tracking "); - sprint(self, self.enemy.netname); - sprint(self, "\n"); -}; - - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Stuff mentioned up top -it just links the bot into the mod - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() ClientFixRankings = -{ - local float cno; - if (self.switch_wallhug > time) - return; - self.switch_wallhug = 0; - - b_temp2 = nextent(world); - cno = 0; - - while (cno < max_clients) - { - if ((!b_temp2.ishuman) && (active_clients & ClientBitFlag(cno))) - UpdateClient(b_temp2); - cno = cno + 1; - b_temp2 = nextent(b_temp2); - } -}; - -void() ClientInRankings = -{ - local float cno; - if (player_head) - player_head._last = self; - - self._next = player_head; - self._last = world; - player_head = self; - - if (!self.phys_obj) - { - b_temp2 = phys_head; - while (b_temp2 != world && b_temp2.owner != self) - b_temp2 = b_temp2._next; - self.phys_obj = b_temp2; - } - - if (self.ishuman == 2) - { - self.ishuman = FALSE; - return; - } - cno = self.colormap - 1; - BotInvalidClientNo (cno); - active_clients = active_clients | ClientBitFlag(cno); - - self.b_clientno = cno; - self.ishuman = TRUE; - self.switch_wallhug = time + 1; -}; - - -void() ClientDisconnected = -{ - if (player_head == self) - player_head = self._next; - if (self._next) - self._next._last = self._last; - if (self._last) - self._last._next = self._next; - - active_clients = active_clients - active_clients & ClientBitFlag(self.b_clientno); -}; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -BotPreFrame & BotPostFrame, used to make the -bot easier to install - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -float () BotPreFrame = -{ - if (self.b_clientno == -1) - return TRUE; - if (self.ishuman) - { - if (self.switch_wallhug) - ClientFixRankings(); - if (self.classname == "botcam") - return TRUE; - } - if (self.b_frags != self.frags) - { - - if (self.b_frags > self.frags) - { - if (pointcontents(self.origin) == CONTENT_LAVA) - bot_start_topic(10); - else - bot_start_topic(9); - } - else - bot_start_topic(2); - self.b_frags = self.frags; - } - DynamicWaypoint(); - return FALSE; -}; -float () BotPostFrame = -{ - if (self.b_clientno == -1) - return TRUE; - if (self.ishuman) - { - - if (waypoint_mode > WM_LOADED) - bot_menu_display(); - - BotImpulses(); - - if (botcam()) - return TRUE; - } - return FALSE; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Bot Chat code - -The rest of this code is in bot_misc.qc - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -void(string h) BotSay = // simulate talking by composing a 'chat' message -{ - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 1); - WriteString(MSG_ALL, self.netname); - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 2); - WriteString(MSG_ALL, h); -}; -void() BotSayInit = -{ - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 1); - WriteString(MSG_ALL, self.netname); -}; -void(string h) BotSay2 = -{ - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 2); - WriteString(MSG_ALL, h); -}; -void(string h) BotSayTeam = -{ - local entity t; - if (!teamplay) - return; - t = player_head; - while(t) - { - if (t.team == self.team) - { - msg_entity = t; - WriteByte(MSG_ONE, 8); - WriteByte(MSG_ONE, 1); - WriteByte(MSG_ONE, 40); - WriteString(MSG_ONE, self.netname); - WriteByte(MSG_ONE, 8); - WriteByte(MSG_ONE, 2); - WriteByte(MSG_ONE, 41); - WriteString(MSG_ONE, h); - } - t = t._next; - } -}; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -BotInit - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - - -void() BotInit = -{ - local entity ent, fisent; - local float numents; - - // spawn entities for the physics - ent = nextent(world); - max_clients = 0; - - while(ent != world) - { - max_clients = max_clients + 1; - ent = nextent(ent); - } - if (max_clients > 16) - max_clients = 16; - - ent = nextent(world); - fisent = world; - while (numents < max_clients) - { - - phys_head = spawn(); - if (fisent) - fisent._next = phys_head; - phys_head._last = fisent; - fisent = phys_head; - ent.phys_obj = phys_head; - phys_head.classname = "phys_obj"; - phys_head.owner = ent; - numents = numents + 1; - ent = nextent(ent); - } - //precache_model("progs/s_light.spr"); // file missing from nexuiz - //precache_model("progs/s_bubble.spr"); // file missing from nexuiz - // the bots return! - b_options = cvar("saved1"); - if (coop || (b_options & OPT_SAVEBOTS)) - { - saved_bots = cvar("scratch1"); - saved_skills1 = cvar("scratch2"); - saved_skills2 = cvar("scratch3"); - } - cvar_set ("saved4", "0"); - if (max_clients > 1) - { - localcmd("exec maps/"); - localcmd(mapname); - localcmd(".way\n"); - waypoint_mode = WM_DYNAMIC; - bot_map_load(); - } - else - waypoint_mode = WM_LOADED; - -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Rankings 'utilities'. Written by Alan Kivlin, -this code just fools clients by sending precisely -the same network messages as when a real player -signs on to the server. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - - -void(entity who) UpdateClient = -{ - WriteByte (MSG_ALL, SVC_UPDATENAME); - WriteByte (MSG_ALL, who.b_clientno); - WriteString (MSG_ALL, who.netname); - WriteByte (MSG_ALL, SVC_UPDATECOLORS); - WriteByte (MSG_ALL, who.b_clientno); - WriteByte (MSG_ALL, who.b_shirt * 16 + who.b_pants); - WriteByte (MSG_ALL, SVC_UPDATEFRAGS); - WriteByte (MSG_ALL, who.b_clientno); - WriteShort (MSG_ALL, who.frags); -}; - -float(float clientno) ClientBitFlag = -{ - // bigger, but faster - if (clientno == 0) - return 1; - else if (clientno == 1) - return 2; - else if (clientno == 2) - return 4; - else if (clientno == 3) - return 8; - else if (clientno == 4) - return 16; - else if (clientno == 5) - return 32; - else if (clientno == 6) - return 64; - else if (clientno == 7) - return 128; - else if (clientno == 8) - return 256; - else if (clientno == 9) - return 512; - else if (clientno == 10) - return 1024; - else if (clientno == 11) - return 2048; - else if (clientno == 12) - return 4096; - else if (clientno == 13) - return 8192; - else if (clientno == 14) - return 16384; - else if (clientno == 15) - return 32768; - return 0; -}; - -float() ClientNextAvailable = -{ - local float clientno; - - clientno = max_clients; - while(clientno > 0) - { - clientno = clientno - 1; - - if(!(active_clients & ClientBitFlag(clientno))) - return clientno; - } - - return -1; -}; - - -void(entity e1, entity e2, float flag) DeveloperLightning = -{ - // used to show waypoint links for debugging - WriteByte (MSG_BROADCAST, 23); - if (flag) - WriteByte (MSG_BROADCAST, 6); - else - WriteByte (MSG_BROADCAST, 13); - WriteEntity (MSG_BROADCAST, e2); - WriteCoord (MSG_BROADCAST, e1.origin_x); - WriteCoord (MSG_BROADCAST, e1.origin_y); - WriteCoord (MSG_BROADCAST, e1.origin_z); - WriteCoord (MSG_BROADCAST, e2.origin_x); - WriteCoord (MSG_BROADCAST, e2.origin_y); - WriteCoord (MSG_BROADCAST, e2.origin_z); -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Find Another Color - -Team finding code - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -float(float tcolor) FindAnotherColor = -{ - local float bestbet, scolor, pcount, bestp; - bestbet = -1; - bestp = 16; - while(scolor < 14) - { - if (scolor != tcolor) - { - b_temp2 = player_head; - pcount = 0; - while(b_temp2 != world) - { - if (b_temp2.team == scolor + 1) - pcount = pcount + 1; - b_temp2 = b_temp2._next; - } - if ((pcount < bestp) && pcount) - { - bestbet = scolor; - bestp = pcount; - } - } - scolor = scolor + 1; - } - if (bestbet < 0) - { - bestbet = tcolor; - while (bestbet == tcolor) - { - bestbet = floor(random() * 13); - } - } - return bestbet; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -BotConnect and related functions. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -entity(float num) GetClientEntity = -{ - local entity upsy; - upsy = world; - num = num + 1; - while (num > 0) - { - num = num - 1; - upsy = nextent(upsy); - } - return upsy; -}; - -void(float whichteam, float whatbot, float whatskill) BotConnect = -{ - local float f; - local string h; - local entity uself; - - f = ClientNextAvailable(); - uself = self; - if(f == -1) - { - bprint("Unable to connect a bot, server is full.\n"); - return; - } - - // chat thing - - active_clients = active_clients | ClientBitFlag(f); - bot_count = bot_count + 1; - self = GetClientEntity(f); - if (!saved_bots) - bot_start_topic(1); - self.b_clientno = f; - self.colormap = f + 1; - if (whatbot) - self.netname = BotName(whatbot); - else - self.netname = PickARandomName(); - - - // players can set skill all weird, so leave these checks in - whatskill = rint(whatskill); - if (whatskill > 3) - whatskill = 3; - else if (whatskill < 0) - whatskill = 0; - self.b_skill = whatskill; - - if (teamplay && !coop) - { - if (whichteam) - self.b_pants = FindAnotherColor(uself.team - 1); - else - self.b_pants = uself.team - 1; - self.b_shirt = self.b_pants; - } - - self.team = self.b_pants + 1; - UpdateClient(self); - SetNewParms(); - self.ishuman = 2; - ClientConnect(); - PutClientInServer(); - - // this is risky... could corrupt .way files if done wrong - // If you're not the gambling type, comment this out - - f = ClientBitFlag(self.b_num - 1); - current_bots = current_bots | f; - - if (self.b_num <= 8) - saved_skills1 = (saved_skills1 & (65536 - (3 * f)) | (self.b_skill * f)); - else - { - f = ClientBitFlag(self.b_num - 9); - saved_skills2 = (saved_skills2 & (65536 - (3 * f)) | (self.b_skill * f)); - } - - h = ftos(current_bots); - cvar_set("scratch1", h); - h = ftos(saved_skills1); - cvar_set("scratch2", h); - h = ftos(saved_skills2); - cvar_set("scratch3", h); - self = uself; - -}; - -void(entity bot) BotDisconnect = -{ - local string h; - local entity uself; - uself = self; - self = bot; - - bot_count = bot_count - 1; - current_bots = current_bots - (current_bots & ClientBitFlag(self.b_num - 1)); - h = ftos(current_bots); - cvar_set("scratch1", h); - - - ClientDisconnect(); - - if (self.b_clientno != -1) - { - // the bot's client number is not in use by a real player so we - // must remove it's entry in the rankings - // Quake engine sets all fields to 0, can only do the most important here - self.b_frags = self.frags = 0; - self.netname = ""; - self.classname = ""; - self.health = 0; - self.items = 0; - self.armorvalue = 0; - self.weaponmodel = ""; - self.b_pants = 0; - self.b_shirt = 0; - self.ammo_shells = self.ammo_nails = self.ammo_rockets = self.ammo_cells = 0; - UpdateClient(self); - active_clients = active_clients - (active_clients & ClientBitFlag(self.b_clientno)); - self.b_clientno = -1; - } - self = uself; -}; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -BotInvalidClientNo -kicks a bot if a player connects and takes the bot's space - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void(float clientno) BotInvalidClientNo = -{ - local entity bot; - - bot = GetClientEntity(clientno); - if(bot.b_clientno > 0) - { - if (!bot.ishuman) - { - bot.b_clientno = -1; - BotDisconnect(bot); - active_clients = active_clients | ClientBitFlag(self.b_clientno); - BotConnect(0, bot.b_num, bot.b_skill); - return; - } - } -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Waypoint Loading from file - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -void() LoadWaypoint = -{ - local vector org; - local entity tep; - local float r; - org_x = cvar("saved1"); - org_y = cvar("saved2"); - org_z = cvar("saved3"); - - tep = make_waypoint(org); - - r = cvar("saved4"); - - tep.b_aiflags = floor(r / 4); - tep.b_pants = cvar("scratch1"); - tep.b_skill = cvar("scratch2"); - tep.b_shirt = cvar("scratch3"); - tep.b_frags = cvar("scratch4"); -}; - -void() bot_return = -{ - if (time > 2) - { - if ((waypoint_mode == WM_DYNAMIC) || (waypoint_mode == WM_LOADED)) - { - // minor precaution - - if (saved_bots & 1) BotConnect(0, 1, saved_skills1 & 3); - if (saved_bots & 2) BotConnect(0, 2, (saved_skills1 & 12) / 4); - if (saved_bots & 4) BotConnect(0, 3, (saved_skills1 & 48) / 16); - if (saved_bots & 8) BotConnect(0, 4, (saved_skills1 & 192) / 64); - if (saved_bots & 16) BotConnect(0, 5, (saved_skills1 & 768) / 256); - if (saved_bots & 32) BotConnect(0, 6, (saved_skills1 & 3072) / 1024); - if (saved_bots & 64) BotConnect(0, 7, (saved_skills1 & 12288) / 4096); - if (saved_bots & 128) BotConnect(0, 8, (saved_skills1 & 49152) / 16384); - if (saved_bots & 256) BotConnect(0, 9, saved_skills2 & 3); - if (saved_bots & 512) BotConnect(0, 10, (saved_skills2 & 12) / 4); - if (saved_bots & 1024) BotConnect(0, 11, (saved_skills2& 48) / 16); - if (saved_bots & 2048) BotConnect(0, 12, (saved_skills2 & 192) / 64); - if (saved_bots & 4096) BotConnect(0, 13, (saved_skills2 & 768) / 256); - if (saved_bots & 8192) BotConnect(0, 14, (saved_skills2 & 3072) / 1024); - if (saved_bots & 16384) BotConnect(0, 15, (saved_skills2 & 12288) / 4096); - if (saved_bots & 32768) BotConnect(0, 16, (saved_skills2 & 49152) / 16384); - saved_bots = 0; - } - } -}; - - -void() WaypointWatch = -{ - // Waypoint Baywatch - local float bigboobs; - local string h; - - if (max_clients < 2) - return; - if (waypoint_mode != WM_UNINIT) - { - bigboobs = cvar("saved4"); - if (bigboobs != 0) - { - if ((bigboobs & 3) == 1) - ClearAllWays(); - else if ((bigboobs & 3) == 3) - { - FixWaypoints(); - h = ftos(b_options); - cvar_set("saved1", h); - cvar_set("saved4", "0"); - cvar_set("scratch1", "0"); - waypoint_mode = WM_LOADED; - return; - } - LoadWaypoint(); - waypoint_mode = WM_LOADING; - cvar_set("saved4", "0"); - } - } -}; -void() BotFrame = -{ - local float num; - - // for the sake of speed - sv_maxairspeed = cvar("sv_maxairspeed"); - sv_maxspeed = cvar("sv_maxspeed"); - sv_gravity = cvar("sv_gravity"); - sv_friction = cvar("sv_friction"); - sv_accelerate = cvar("sv_accelerate"); - sv_stopspeed = cvar("sv_stopspeed"); - real_frametime = frametime; // in NQ this is alright - - self = nextent(world); - num = 0; - while (num < max_clients) - { - if (self.ishuman == FALSE) - { - if (active_clients & ClientBitFlag(num)) - { - frik_obstacles(); - CL_KeyMove(); - SV_ClientThink(); - SV_Physics_Client(); - } - } - self = nextent(self); - num = num + 1; - } - WaypointWatch(); - - if (saved_bots) - bot_return(); -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Bot Impulses. Allows the player to perform bot -related functions. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() BotImpulses = -{ -/* local float f; - if (self.impulse == 100) - { - f = cvar("skill"); - BotConnect(0, 0, f); - } - if (self.impulse == 101) - { - f = cvar("skill"); - BotConnect(1, 0, f); - } - else if (self.impulse == 102) - KickABot(); - else if (self.impulse == 103) - botcam_u(); - else if (self.impulse == 104) - bot_way_edit(); - else - return; - - self.impulse = 0; -*/ - }; - - - diff --git a/TeamNexuiz/game/gamec/bot_ai.c b/TeamNexuiz/game/gamec/bot_ai.c deleted file mode 100644 index c5b8751aa..000000000 --- a/TeamNexuiz/game/gamec/bot_ai.c +++ /dev/null @@ -1,1023 +0,0 @@ -/*********************************************** -* * -* FrikBot General AI * -* "The I'd rather be playing Quake AI" * -* * -***********************************************/ - -/* - -This program is in the Public Domain. My crack legal -team would like to add: - -RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" -AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE -ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR -FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN -NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY -GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, -EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" -SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. - -You accept this software on the condition that you -indemnify and hold harmless Ryan "FrikaC" Smith from -any and all liability or damages to third parties, -including attorney fees, court costs, and other -related costs and expenses, arising out of your use -of this software irrespective of the cause of said -liability. - -The export from the United States or the subsequent -reexport of this software is subject to compliance -with United States export control and munitions -control restrictions. You agree that in the event you -seek to export this software, you assume full -responsibility for obtaining all necessary export -licenses and approvals and for assuring compliance -with applicable reexport restrictions. - -Any reproduction of this software must contain -this notice in its entirety. - -*/ - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -target_onstack - -checks to see if an entity is on the bot's stack - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -float(entity scot) target_onstack = -{ - if (scot == world) - return FALSE; - else if (self.target1 == scot) - return 1; - else if (self.target2 == scot) - return 2; - else if (self.target3 == scot) - return 3; - else if (self.target4 == scot) - return 4; - else - return FALSE; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -target_add - -adds a new entity to the stack, since it's a -LIFO stack, this will be the bot's new target1 - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void(entity ent) target_add = -{ - if (ent == world) - return; - if (target_onstack(ent)) - return; - self.target4 = self.target3; - self.target3 = self.target2; - self.target2 = self.target1; - self.target1 = ent; - self.search_time = time + 5; -}; - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -target_drop - -Removes an entity from the bot's target stack. -The stack will empty everything up to the object -So if you have target2 item_health, target1 -waypoint, and you drop the health, the waypoint -is gone too. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void(entity ent) target_drop = -{ - local float tg; - - tg = target_onstack(ent); - if (tg == 1) - { - self.target1 = self.target2; - self.target2 = self.target3; - self.target3 = self.target4; - self.target4 = world; - } - else if (tg == 2) - { - self.target1 = self.target3; - self.target2 = self.target4; - self.target3 = self.target4 = world; - } - else if (tg == 3) - { - self.target1 = self.target4; - self.target2 = self.target3 = self.target4 = world; - } - else if (tg == 4) - self.target1 = self.target2 = self.target3 = self.target4 = world; - self.search_time = time + 5; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -bot_lost - -Bot has lost its target. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void(entity targ, float success) bot_lost = -{ - if (!targ) - return; - - target_drop(targ); - if (targ.classname == "waypoint") - targ.b_sound = targ.b_sound - (targ.b_sound & ClientBitFlag(self.b_clientno)); - - // find a new route - if (!success) - { - self.target1 = self.target2 = self.target3 = self.target4 = world; - self.last_way = FindWayPoint(self.current_way); - ClearMyRoute(); - self.b_aiflags = 0; - } - else - { - if (targ.classname == "item_artifact_invisibility") - if (self.items & 524288) - bot_start_topic(3); - - if (targ.flags & FL_ITEM) - { - if (targ.model == string_null) - targ._last = world; - else - targ._last = self; - } - } - - - if (targ.classname != "player") - targ.search_time = time + 5; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -bot_check_lost - -decide if my most immediate target should be -removed. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -void(entity targ) bot_check_lost = -{ - local vector dist; - dist = realorigin(targ) - self.origin; - dist_z = 0; - if (targ == world) - return; - - // waypoints and items are lost if you get close enough to them - - else if (targ.flags & FL_ITEM) - { - if (vlen(targ.origin - self.origin) < 32) - bot_lost(targ, TRUE); - else if (targ.model == string_null) - bot_lost(targ, TRUE); - } - else if (targ.classname == "waypoint") - { - if (!(self.b_aiflags & (AI_SNIPER | AI_AMBUSH))) - { - if (self.b_aiflags & AI_RIDE_TRAIN) - { - if (vlen(targ.origin - self.origin) < 48) - bot_lost(targ, TRUE); - } - else if (self.b_aiflags & AI_PRECISION) - { - if (vlen(targ.origin - self.origin) < 24) - bot_lost(targ, TRUE); - } - else if (vlen(targ.origin - self.origin) < 32) - bot_lost(targ, TRUE); - else if (self.b_aiflags & AI_CARELESS) // Electro - better for jumppads - { - if (vlen(targ.origin - self.origin) < 128) - bot_lost(targ, TRUE); - } - } - } - else if (targ.classname == "temp_waypoint") - { - if (vlen(targ.origin - self.origin) < 32) - bot_lost(targ, TRUE); - } - else if (targ.classname == "player") - { - if (targ.health <= 0) - bot_lost(targ, TRUE); - else if ((coop) || (teamplay && targ.team == self.team)) - { - if (targ.target1.classname == "player") - { - if (!targ.target1.ishuman) - bot_lost(targ, TRUE); - } - else if (targ.teleport_time > time) - { - // try not to telefrag teammates - self.keys = self.keys & 960; - } - else if (vlen(targ.origin - self.origin) < 128) - { - if (vlen(targ.origin - self.origin) < 48) - frik_walkmove(self.origin - targ.origin); - else - { - self.keys = self.keys & 960; - bot_start_topic(4); - } - self.search_time = time + 5; // never time out - } - else if (!fisible(targ)) - bot_lost(targ, FALSE); - } - else if (waypoint_mode > WM_LOADED) - { - if (vlen(targ.origin - self.origin) < 128) - { - bot_lost(targ, TRUE); - } - } - } - - // buttons are lost of their frame changes - else if (targ.classname == "func_button") - { - if (targ.frame) - { - bot_lost(targ, TRUE); - if (self.enemy == targ) - self.enemy = world; - //if (self.target1) - // bot_get_path(self.target1, TRUE); - - } - } - // trigger_multiple style triggers are lost if their thinktime changes - else if ((targ.movetype == MOVETYPE_NONE) && (targ.solid == SOLID_TRIGGER)) - { - if (targ.nextthink >= time) - { - bot_lost(targ, TRUE); - //if (self.target1) - // bot_get_path(self.target1, TRUE); - } - } - // lose any target way above the bot's head - // FIXME: if the bot can fly in your mod.. - if ((targ.origin_z - self.origin_z) > 64) - { - dist = targ.origin - self.origin; - dist_z = 0; - if (vlen(dist) < 32) - if (self.flags & FL_ONGROUND) - if(!frik_recognize_plat(FALSE)) - bot_lost(targ, FALSE); - } - else if (targ.classname == "train") - { - if (frik_recognize_plat(FALSE)) - bot_lost(targ, TRUE); - } - // targets are lost if the bot's search time has expired - if (time > self.search_time) - bot_lost(targ, FALSE); -}; - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -bot_handle_ai - -This is a 0.10 addition. Handles any action -based b_aiflags. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() bot_handle_ai = -{ - local entity newt; - local vector v; - - // handle ai flags -- note, not all aiflags are handled - // here, just those that perform some sort of action - - // wait is used by the ai to stop the bot until his search time expires / or route changes - - if (self.b_aiflags & AI_WAIT) - self.keys = self.keys & 960; - - if (self.b_aiflags & AI_DOORFLAG) // was on a door when spawned - { - b_temp3 = self; - self = self.last_way; - if (!frik_recognize_plat(FALSE)) // if there is nothing there now - { - newt = FindThing("door"); // this is likely the door responsible (crossfingers) - self = b_temp3; - - if (self.b_aiflags & AI_DOOR_NO_OPEN) - { - if (newt.nextthink) - self.keys = self.keys & 960; // wait until it closes - else - { - bot_lost(self.last_way, FALSE); - } - } - else - { - if (newt.targetname) - { - newt = find(world, target, newt.targetname); - if (newt.health > 0) - { - self.enemy = newt; - bot_weapon_switch(1); - } - else - { - // target_drop(self.last_way); - target_add(newt); - // bot_get_path(newt, TRUE); - } - } - self.b_aiflags = self.b_aiflags - AI_DOORFLAG; - } - } - else - self = b_temp3; - } - - if (self.b_aiflags & AI_JUMP) - { - if (self.flags & FL_ONGROUND) - { - bot_jump(); - self.b_aiflags = self.b_aiflags - AI_JUMP; - } - } - else if (self.b_aiflags & AI_SUPER_JUMP) - { - if (self.weapon != WEP_LASER) - self.impulse = 7; - else if (self.flags & FL_ONGROUND) - { - self.b_aiflags = self.b_aiflags - AI_SUPER_JUMP; - if (bot_can_rj(self)) - { - bot_jump(); - self.v_angle_x = self.b_angle_x = 80; - self.button0 = TRUE; - } - else - bot_lost(self.target1, FALSE); - - } - } - if (self.b_aiflags & AI_SURFACE) - { - if (self.waterlevel > 2) - { - self.keys = KEY_MOVEUP; - self.button2 = TRUE; // swim! - } - else - self.b_aiflags = self.b_aiflags - AI_SURFACE; - } - if (self.b_aiflags & AI_RIDE_TRAIN) - { - // simple, but effective - // this can probably be used for a lot of different - // things, not just trains (door elevators come to mind) - b_temp3 = self; - self = self.last_way; - - if (!frik_recognize_plat(FALSE)) // if there is nothing there now - { - self = b_temp3; - self.keys = self.keys & 960; - } - else - { - self = b_temp3; - if (frik_recognize_plat(FALSE)) - { - v = realorigin(trace_ent) + trace_ent.origin - self.origin; - v_z = 0; - if (vlen(v) < 24) - self.keys = self.keys & 960; - else - { - self.b_aiflags = self.b_aiflags | AI_PRECISION; - self.keys = frik_KeysForDir(v); - } - } - } - } - if (self.b_aiflags & AI_PLAT_BOTTOM) - { - newt = FindThing("plat"); - if (newt.state != 1) - { - v = self.origin - realorigin(newt); - v_z = 0; - if (vlen(v) > 96) - self.keys = self.keys & 960; - else - frik_walkmove(v); - } - else - self.b_aiflags = self.b_aiflags - AI_PLAT_BOTTOM; - } - if (self.b_aiflags & AI_DIRECTIONAL) - { - if ((normalize(self.last_way.origin - self.origin) * self.b_dir) > 0.4) - { - self.b_aiflags = self.b_aiflags - AI_DIRECTIONAL; - bot_lost(self.target1, TRUE); - } - } - if (self.b_aiflags & AI_SNIPER) - { - self.b_aiflags = (self.b_aiflags | AI_WAIT | AI_PRECISION) - AI_SNIPER; - // FIXME: Add a switch to wep command - // FIXME: increase delay? - } - if (self.b_aiflags & AI_AMBUSH) - { - self.b_aiflags = (self.b_aiflags | AI_WAIT) - AI_AMBUSH; - // FIXME: Add a switch to wep command - // FIXME: increase delay? - } - -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -bot_path - -Bot will follow a route generated by the -begin_route set of functions in bot_way.qc. -This code, while it works pretty well, can get -confused - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() bot_path = -{ - local entity jj, tele; - - bot_check_lost(self.target1); - if (!self.target1) - { - self.keys=0; - return; - } - if (target_onstack(self.last_way)) - return; // old waypoint still being hunted - - jj = FindRoute(self.last_way); - if (!jj) - { - // this is an ugly hack - if (self.target1.current_way != self.last_way) - { - if (self.target1.classname != "temp_waypoint") - if (self.target1.classname != "player") - bot_lost(self.target1, FALSE); - } - - return; - } - - // update the bot's special ai features - - // Readahed types are AI conditions to perform while heading to a waypoint - // point types are AI flags that should be executed once reaching a waypoint - - self.b_aiflags = (jj.b_aiflags & AI_READAHEAD_TYPES) | (self.last_way.b_aiflags & AI_POINT_TYPES); - target_add(jj); - if (self.last_way) - { - if (CheckLinked(self.last_way, jj) == 2) // waypoints are telelinked - { - tele = FindThing("trigger_teleport"); // this is probbly the teleport responsible - target_add(tele); - } - traceline(self.last_way.origin, jj.origin, FALSE, self); // check for blockage - if (trace_fraction != 1) - { - if (trace_ent.classname == "door" && !(self.b_aiflags & AI_DOOR_NO_OPEN)) // a door blocks the way - { - // linked doors fix - if (trace_ent.owner) - trace_ent = trace_ent.owner; - if ((trace_ent.health > 0) && (self.enemy == world)) - { - self.enemy = trace_ent; - bot_weapon_switch(1); - self.b_aiflags = self.b_aiflags | AI_BLIND; // nick knack paddy hack - } - else if (trace_ent.targetname) - { - tele = find(world, target, trace_ent.targetname); - if (tele.health > 0) - { - self.enemy = tele; - bot_weapon_switch(1); - } - else - { - // target_drop(jj); - target_add(tele); - // bot_get_path(tele, TRUE); - self.b_aiflags = self.b_aiflags | AI_BLIND; // give a bot a bone - return; - } - } - } - else if (trace_ent.classname == "func_wall") - { - // give up - bot_lost(self.target1, FALSE); - return; - } - } - } - // this is used for AI_DRIECTIONAL - self.b_dir = normalize(jj.origin - self.last_way.origin); - - self.last_way = jj; -}; - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Bot Priority Look. What a stupid name. This is where -the bot finds things it wants to kill/grab. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -// priority scale -// 0 - 10 virtually ignore -// 10 - 30 normal item range -// 30 - 50 bot will consider this a target worth changing course for -// 50 - 90 bot will hunt these as vital items - -// *!* Make sure you add code to bot_check_lost to remove the target *!* - -float(entity thing) priority_for_thing = -{ - local float thisp; - thisp = 0; - // This is the most executed function in the bot. Careful what you do here. - - if (thing.flags & FL_ITEM && thing.model != string_null && thing.search_time < time) - { - // ugly hack - if (thing._last != self) - thisp = 20; - else if (thing.classname == "item_strength") // IT_STRENGTH - thisp = 65; - else if (thing.classname == "item_invincible") // IT_INVINCIBLE - thisp = 65; - //else if (thing.classname == "item_speed") // IT_SPEED - // thisp = 65; - //else if (thing.classname == "item_slowmo") // IT_SLOWMO - // thisp = 65; - else if (thing.classname == "item_health") - { - if (thing.spawnflags & 2) - thisp = 55; - if (self.health < 40) - thisp = thisp + 50; - } - else if (thing.classname == "item_health1" || thing.classname == "item_health2") - { - thisp = 20; - if (self.health < 40) - thisp = thisp + 50; - } - else if (thing.classname == "item_health100") - { - thisp = 55; - if (self.health < 40) - thisp = thisp + 50; - } - else if (thing.classname == "item_armor1") - { - thisp = 20; - if (self.armorvalue < 100) - thisp = thisp + 25; - } - else if (thing.classname == "item_armor25") - { - thisp = 60; - if (self.armorvalue < 100) - thisp = thisp + 25; - } - else if (thing.classname == "weapon_shotgun") - { - if (!(self.items & IT_SHOTGUN)) - thisp = 25; - } - else if (thing.classname == "weapon_uzi") - { - if (!(self.items & IT_UZI)) - thisp = 30; - } - else if (thing.classname == "weapon_electro") - { - if (!(self.items & IT_ELECTRO)) - thisp = 35; - } - else if (thing.classname == "weapon_grenadelauncher") - { - if (!(self.items & IT_GRENADE_LAUNCHER)) - thisp = 45; - } - else if (thing.classname == "weapon_crylink") - { - if (!(self.items & IT_CRYLINK)) - thisp = 60; - } - else if (thing.classname == "weapon_nex") - { - if (!(self.items & IT_NEX)) // IT_LIGHTNING - thisp = 50; - } - else if (thing.classname == "weapon_hagar") - { - if (!(self.items & IT_HAGAR)) - thisp = 45; - } - else if (thing.classname == "weapon_rocketlauncher") - { - if (!(self.items & IT_ROCKET_LAUNCHER)) - thisp = 50; - } - } - else if (thing.classname == "player") - { - if (thing.health > 0) - { - if (thing == self) - return 0; - else - { - if (coop) - { - thisp = 100; - if (thing.target1.classname == "player") - if (!thing.target1.ishuman) - return 0; - } - else if (teamplay && thing.team == self.team) - { - thisp = 100; - if (thing.target1.classname == "player") - return 0; - } - else thisp = 30; - } - } - } - else if (thing.classname == "waypoint") - { - if (thing.b_aiflags & AI_SNIPER) - thisp = 30; - else if (thing.b_aiflags & AI_AMBUSH) - thisp = 30; - } - if (pointcontents(thing.origin) < -3) - return 0; - if (thisp) - { - if (thing.current_way) - { - // check to see if it's unreachable - if (thing.current_way.items == -1) - return 0; - else - thisp = thisp + (13000 - thing.current_way.items) * 0.05; - - } - } - return thisp; -}; - -void(float scope) bot_look_for_crap = -{ - local entity foe, best; - local float thatp, bestp, dist; - - if (scope == 1) - foe = findradius(self.origin, 13000); - else - foe = findradius(self.origin, 500); - - bestp = 1; - while(foe) - { - thatp = priority_for_thing(foe); - if (thatp) - if (!scope) - if (!sisible(foe)) - thatp = 0; - if (thatp > bestp) - { - bestp = thatp; - best = foe; - dist = vlen(self.origin - foe.origin); - } - foe = foe.chain; - } - if (best == world) - return; - if (!target_onstack(best)) - { - target_add(best); - if (scope) - { - bot_get_path(best, FALSE); - self.b_aiflags = self.b_aiflags | AI_WAIT; - } - } -}; - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -bot_angle_set - -Sets the bots look keys & b_angle to point at -the target - used for fighting and just -generally making the bot look good. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() bot_angle_set = -{ - local float h; - local vector view; - - if (self.enemy) - { - if (self.enemy.items & 524288) - if (random() > 0.2) - return; - if (self.missile_speed == 0) - self.missile_speed = 10000; - if (self.enemy.solid == SOLID_BSP) - { - view = (((self.enemy.absmin + self.enemy.absmax) * 0.5) - self.origin); - } - else - { - h = vlen(self.enemy.origin - self.origin) / self.missile_speed; - if (self.enemy.flags & FL_ONGROUND) - view = self.enemy.velocity * h; - else - view = (self.enemy.velocity - (sv_gravity * '0 0 1') * h) * h; - view = self.enemy.origin + view; - // FIXME: ? - traceline(self.enemy.origin, view, FALSE, self); - view = trace_endpos; - - if (self.weapon == WEP_GRENADE_LAUNCHER || self.weapon == WEP_ELECTRO || self.weapon == WEP_HAGAR || self.weapon == WEP_ROCKET_LAUNCHER) - view = view - '0 0 22'; - - view = normalize(view - self.origin); - } - view = vectoangles(view); - view_x = view_x * -1; - self.b_angle = view; - } - else if (self.target1) - { - view = realorigin(self.target1); - if (self.target1.flags & FL_ITEM) - view = view + '0 0 48'; - view = view - (self.origin + self.view_ofs); - view = vectoangles(view); - view_x = view_x * -1; - self.b_angle = view; - } - else - self.b_angle_x = 0; - // HACK HACK HACK HACK - // The bot falls off ledges a lot because of "turning around" - // so let the bot use instant turn around when not hunting a player - if (self.b_skill == 3) - { - self.keys = self.keys & 63; - self.v_angle = self.b_angle; - while (self.v_angle_x < -180) - self.v_angle_x = self.v_angle_x + 360; - while (self.v_angle_x > 180) - self.v_angle_x = self.v_angle_x - 360; - - } - else if ((self.enemy == world || self.enemy.movetype == MOVETYPE_PUSH) && self.target1.classname != "player") - { - self.keys = self.keys & 63; - self.v_angle = self.b_angle; - while (self.v_angle_x < -180) - self.v_angle_x = self.v_angle_x + 360; - while (self.v_angle_x > 180) - self.v_angle_x = self.v_angle_x - 360; - } - else if (self.b_skill < 2) // skill 2 handled in bot_phys - { - if (self.b_angle_x > 180) - self.b_angle_x = self.b_angle_x - 360; - self.keys = self.keys & 63; - - if (angcomp(self.b_angle_y, self.v_angle_y) > 10) - self.keys = self.keys | KEY_LOOKLEFT; - else if (angcomp(self.b_angle_y, self.v_angle_y) < -10) - self.keys = self.keys | KEY_LOOKRIGHT; - if (angcomp(self.b_angle_x, self.v_angle_x) < -10) - self.keys = self.keys | KEY_LOOKUP; - else if (angcomp(self.b_angle_x, self.v_angle_x) > 10) - self.keys = self.keys | KEY_LOOKDOWN; - } -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -BotAI - -This is the main ai loop. Though called every -frame, the ai_time limits it's actual updating - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -float stagger_think; -float intermission_running; - -void() BotAI = -{ - // am I dead? Fire randomly until I respawn - // health < 1 is used because fractional healths show up as 0 on normal player - // status bars, and the mod probably already compensated for that - - if (self.health < 1) - { - self.button0 = floor(random() * 2); - self.button2 = 0; - self.keys = 0; - self.b_aiflags = 0; - ClearMyRoute(); - self.target1 = self.target2 = self.target3 = self.target4 = self.enemy = world; - self.last_way = world; - return; - } - - // stagger the bot's AI out so they all don't think at the same time, causing game - // 'spikes' - if (self.b_skill < 2) - { - if (self.ai_time > time) - return; - - self.ai_time = time + 0.05; - if (bot_count > 0) - { - if ((time - stagger_think) < (0.1 / bot_count)) - self.ai_time = self.ai_time + 0.1 / (2 * bot_count); - } - else - return; - } - if (intermission_running) - bot_start_topic(7); - stagger_think = time; - - // shut the bot's buttons off, various functions will turn them on by AI end - - self.button2 = 0; - self.button0 = 0; - - - // target1 is like goalentity in normal Quake monster AI. - // it's the bot's most immediate target - if (route_table == self) - { - if (busy_waypoints <= 0) - { - if (waypoint_mode < WM_EDITOR) - bot_look_for_crap(TRUE); - } - self.b_aiflags = 0; - self.keys = 0; - } - else if (self.target1) - { - frik_movetogoal(); - bot_path(); - } - else - { - if (waypoint_mode < WM_EDITOR) - { - if(self.route_failed) - { - frik_bot_roam(); - self.route_failed = 0; - } - else if(!begin_route()) - { - bot_look_for_crap(FALSE); - } - self.keys = 0; - } - else - { - self.b_aiflags = AI_WAIT; - self.keys = 0; - } - } - - // bot_angle_set points the bot at it's goal (self.enemy or target1) - - bot_angle_set(); - - // fight my enemy. Enemy is probably a field QC coders will most likely use a lot - // for their own needs, since it's unused on a normal player - // FIXME - if (self.enemy) - bot_fight_style(); - else if (random() < 0.2) - if (random() < 0.2) - bot_weapon_switch(-1); - bot_dodge_stuff(); - - // checks to see if bot needs to start going up for air -/* if (self.waterlevel > 2) - { - if (time > (self.air_finished - 2)) - { - traceline (self.origin, self.origin + '0 0 6800', TRUE, self); - if (trace_inopen) - { - self.keys = KEY_MOVEUP; - self.button2 = TRUE; // swim! - return; // skip ai flags for now - this is life or death - } - } - } -*/ - // b_aiflags handling - - - if (self.b_aiflags) - bot_handle_ai(); - //else - // bot_chat(); // don't want chat to screw him up if he's rjing or something -}; diff --git a/TeamNexuiz/game/gamec/bot_ed.c b/TeamNexuiz/game/gamec/bot_ed.c deleted file mode 100644 index 6d3d065f8..000000000 --- a/TeamNexuiz/game/gamec/bot_ed.c +++ /dev/null @@ -1,1367 +0,0 @@ -/*********************************************** -* * -* FrikBot Waypoint Editor * -* "The 'wtf is this doing in my mod' code" * -* * -***********************************************/ - -/* - -This program is in the Public Domain. My crack legal -team would like to add: - -RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" -AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE -ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR -FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN -NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY -GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, -EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" -SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. - -You accept this software on the condition that you -indemnify and hold harmless Ryan "FrikaC" Smith from -any and all liability or damages to third parties, -including attorney fees, court costs, and other -related costs and expenses, arising out of your use -of this software irrespective of the cause of said -liability. - -The export from the United States or the subsequent -reexport of this software is subject to compliance -with United States export control and munitions -control restrictions. You agree that in the event you -seek to export this software, you assume full -responsibility for obtaining all necessary export -licenses and approvals and for assuring compliance -with applicable reexport restrictions. - -Any reproduction of this software must contain -this notice in its entirety. - -*/ - -float saved1, saved2, saved3, scratch1, scratch2, scratch3, scratch4; -float bytecounter, filecount; - -float MENU_MAIN = 1; -float MENU_WAYPOINTS = 2; -float MENU_LINKS = 3; -float MENU_FLAGS = 4; -float MENU_FLAGS2 = 5; -float MENU_BOTS = 6; -float MENU_WAYLIST = 7; -// 8 = link way -// 9 = telelink way -// 10 = delete link -// 11 = create link X2 -// 12 = delete link x2 -// 13 = confirmation of delete all -// 14 = Teleport to way -// 15 = confirmation of delete point - -void() BSPDumpWaypoints; -void() QCDumpWaypoints; -void() DumpWaypoints; -/* -// source for the menu strings... - --- Main Menu --\n -[1] >>Waypoint Management\n -[2] >>Link Management \n -[3] >>AI Flag Management \n -[4] >>Bot Management \n -[5] >>Waylist Management \n -[6] [#] Noclip \n -[7] [#] Godmode \n -[8] [#] Hold Select \n -[9] Teleport to Way # \n -[0] Close Menu \n - -// missing from main is show way info -// iffy on the teleport to way thing being on main...seems like either a bot or way list thing - --- Waypoint Management --\n -[1] Move Waypoint \n -[2] Delete Waypoint \n -[3] Make Waypoint \n -[4] Make Way + Link \n -[5] Make Way + Link X2 \n -[6] Make Way + Telelink \n -[7] Show waypoint info \n -[8] >>Link Management \n -[9] >>AI Flag Management \n -[0] >>Main Menu \n - --- Link Management --\n -[1] Unlink Waypoint \n -[2] Create Link \n -[3] Create Telelink \n -[4] Delete Link \n -[5] Create Link X2 \n -[6] Delete Link X2 \n -[7] >Make Waypoint \n -[8] >>Waypoint Management\n -[9] >>AI Flag Management \n -[0] >>Main Menu \n - -// Ai flags...ugh - --- AI Flag Management --\n -[1] [#] Door Flag \n -[2] [#] Precision \n -[3] [#] Surface for air \n -[4] [#] Blind mode \n -[5] [#] Jump \n -[6] [#] Dark \n -[7] [#] Super Jump \n -\n -[9] >>AI Flags page 2 \n -[0] >>Main Menu \n - --- AI Flags pg. 2--\n -[1] [#] Difficult \n -[2] [#] Wait for plat \n -[3] [#] Ride train \n -[4] [#] Door flag no open\n -[5] [#] Ambush \n -[6] [#] Snipe \n -[7] [#] Trace Test \n -\n -[9] >>AI Flag Management \n -[0] >>Main Menu \n - --- Bot Management --\n -[1] Add a Test Bot \n -[2] Order Test Bot here \n -[3] Remove Test Bot \n -[4] Stop Test Bot \n -[5] Teleport Bot here \n -[6] Teleport to Way # \n -\n -\n -\n -[0] >>Main Menu \n - --- Waylist Management --\n -[1] Delete ALL Waypoints \n -[2] Dump Waypoints \n -[3] Check For Errors \n -[4] Save Waypoints \n -[5] [#] Dynamic Mode \n -[6] [#] Dynamic Link \n -[7] [#] WAY output \n -[8] [#] QC output \n -[9] [#] BSP ents output \n -[0] Main Menu \n - -*/ - -void() bot_menu_display = -{ -// build options - local string s1, s2, s3, s4, s5, s6, s7, h; - local entity t; - -// check impulses - if (self.impulse > 0 && self.impulse < 11 && self.b_menu) - { - if (self.b_menu == MENU_MAIN) - { - if (self.impulse == 1) - { - self.b_menu = MENU_WAYPOINTS; - self.b_menu_time = time; - } - else if (self.impulse == 2) - { - self.b_menu = MENU_LINKS; - self.b_menu_time = time; - } - else if (self.impulse == 3) - { - self.b_menu = MENU_FLAGS; - self.b_menu_time = time; - } - else if (self.impulse == 4) - { - self.b_menu = MENU_BOTS; - self.b_menu_time = time; - } - else if (self.impulse == 5) - { - self.b_menu = MENU_WAYLIST; - self.b_menu_time = time; - } - else if (self.impulse == 6) - { - if (self.movetype == MOVETYPE_NOCLIP) - self.movetype = MOVETYPE_WALK; - else - self.movetype = MOVETYPE_NOCLIP; - self.b_menu_time = time; - - } - else if (self.impulse == 7) - { - if (self.flags & FL_GODMODE) - self.flags = self.flags - FL_GODMODE; - else - self.flags = self.flags | FL_GODMODE; - self.b_menu_time = time; - - } - else if (self.impulse == 8) - { - if (self.b_aiflags & AI_HOLD_SELECT) - self.b_aiflags = self.b_aiflags - AI_HOLD_SELECT; - else - self.b_aiflags = self.b_aiflags | AI_HOLD_SELECT; - self.b_menu_time = time; - } - else if (self.impulse == 9) - { - self.b_menu = 14; - self.b_menu_time = time; - } - else if (self.impulse == 10) - bot_way_edit(); - } - else if (self.b_menu == MENU_WAYPOINTS) - { - if (self.impulse == 1) - { - if (self.current_way) - setorigin(self.current_way, self.origin + self.view_ofs); - } - else if (self.impulse == 2) - { - if (self.current_way) - { - self.b_menu = 15; - self.b_menu_time = time; - self.last_way = self.current_way; - } - } - else if (self.impulse == 3) - { - make_waypoint(self.origin + self.view_ofs); - } - else if (self.impulse == 4) - { - t = make_waypoint(self.origin + self.view_ofs); - if (!LinkWays(self.current_way, t)) - sprint(self, "Unable to link them\n"); - } - else if (self.impulse == 5) - { - t = make_waypoint(self.origin + self.view_ofs); - if (!LinkWays(self.current_way, t)) - sprint(self, "Unable to link old to new\n"); - LinkWays(t, self.current_way); - } - else if (self.impulse == 6) - { - t = make_waypoint(self.origin + self.view_ofs); - if (!TeleLinkWays(self.current_way, t)) - sprint(self, "Unable to link them\n"); - } - else if (self.impulse == 7) - { - if (self.current_way) - { - sprint(self, "\nwaypoint info for waypoint #"); - h = ftos(self.current_way.count); - sprint(self, h); - sprint(self, "\nAI Flag value: "); - h = ftos(self.current_way.b_aiflags); - sprint(self, h); - - if (self.current_way.target1) - { - h = ftos(self.current_way.target1.count); - if (self.current_way.b_aiflags & AI_TELELINK_1) - sprint(self, "\nTelelink1 to:"); - else - sprint(self, "\nLink1 to:"); - sprint(self, h); - } - if (self.current_way.target2) - { - h = ftos(self.current_way.target2.count); - if (self.current_way.b_aiflags & AI_TELELINK_2) - sprint(self, "\nTelelink2 to:"); - else - sprint(self, "\nLink2 to:"); - sprint(self, h); - } - if (self.current_way.target3) - { - h = ftos(self.current_way.target3.count); - if (self.current_way.b_aiflags & AI_TELELINK_3) - sprint(self, "\nTelelink3 to:"); - else - sprint(self, "\nLink3 to:"); - sprint(self, h); - } - if (self.current_way.target4) - { - h = ftos(self.current_way.target4.count); - if (self.current_way.b_aiflags & AI_TELELINK_4) - sprint(self, "\nTelelink4 to:"); - else - sprint(self, "\nLink4 to:"); - sprint(self, h); - } - sprint(self, "\n\n"); - } - - } - if (self.impulse == 8) - { - self.b_menu = MENU_LINKS; - self.b_menu_time = time; - } - else if (self.impulse == 9) - { - self.b_menu = MENU_FLAGS; - self.b_menu_time = time; - } - else if (self.impulse == 10) - { - self.b_menu = MENU_MAIN; - self.b_menu_time = time; - } - } - else if (self.b_menu == MENU_LINKS) - { - if (self.impulse == 1) - { - if (self.current_way) - self.current_way.target1 = self.current_way.target2 = self.current_way.target3 = self.current_way.target4 = world; - } - else if (self.impulse == 2) - { - self.b_menu = 8; - self.b_menu_time = time; - self.last_way = self.current_way; - } - else if (self.impulse == 3) - { - self.b_menu = 9; - self.b_menu_time = time; - self.last_way = self.current_way; - } - else if (self.impulse == 4) - { - self.b_menu = 10; - self.b_menu_time = time; - self.last_way = self.current_way; - } - else if (self.impulse == 5) - { - self.b_menu = 11; - self.b_menu_time = time; - self.last_way = self.current_way; - } - else if (self.impulse == 6) - { - self.b_menu = 12; - self.b_menu_time = time; - self.last_way = self.current_way; - } - else if (self.impulse == 7) - make_waypoint(self.origin + self.view_ofs); - else if (self.impulse == 8) - { - self.b_menu = MENU_WAYPOINTS; - self.b_menu_time = time; - } - else if (self.impulse == 9) - { - self.b_menu = MENU_FLAGS; - self.b_menu_time = time; - } - else if (self.impulse == 10) - { - self.b_menu = MENU_MAIN; - self.b_menu_time = time; - } - } - else if (self.b_menu == MENU_FLAGS) - { - - if (self.current_way) - { - if (self.impulse == 1) - { - if (self.current_way.b_aiflags & AI_DOORFLAG) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DOORFLAG); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DOORFLAG; - - self.b_menu_time = time; - } - else if (self.impulse == 2) - { - if (self.current_way.b_aiflags & AI_PRECISION) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_PRECISION); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PRECISION; - self.b_menu_time = time; - } - else if (self.impulse == 3) - { - if (self.current_way.b_aiflags & AI_SURFACE) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SURFACE); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SURFACE; - self.b_menu_time = time; - } - else if (self.impulse == 4) - { - if (self.current_way.b_aiflags & AI_BLIND) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_BLIND); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_BLIND; - self.b_menu_time = time; - } - else if (self.impulse == 5) - { - if (self.current_way.b_aiflags & AI_JUMP) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_JUMP); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_JUMP; - self.b_menu_time = time; - } - else if (self.impulse == 6) - { - if (self.current_way.b_aiflags & AI_DIRECTIONAL) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DIRECTIONAL); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DIRECTIONAL; - self.b_menu_time = time; - } - else if (self.impulse == 7) - { - if (self.current_way.b_aiflags & AI_SUPER_JUMP) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SUPER_JUMP); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SUPER_JUMP; - self.b_menu_time = time; - } - else if (self.impulse == 8) - { - if (self.current_way.b_aiflags & AI_CARELESS) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_CARELESS); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_CARELESS; - self.b_menu_time = time; - } - } - if (self.impulse == 9) - { - self.b_menu = MENU_FLAGS2; - self.b_menu_time = time; - } - else if (self.impulse == 10) - { - self.b_menu = MENU_MAIN; - self.b_menu_time = time; - } - } - else if (self.b_menu == MENU_FLAGS2) - { - - if (self.current_way) - { - if (self.impulse == 1) - { - if (self.current_way.b_aiflags & AI_DIFFICULT) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DIFFICULT); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DIFFICULT; self.b_menu_time = time; - } - else if (self.impulse == 2) - { - if (self.current_way.b_aiflags & AI_PLAT_BOTTOM) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_PLAT_BOTTOM); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PLAT_BOTTOM; - self.b_menu_time = time; - } - else if (self.impulse == 3) - { - if (self.current_way.b_aiflags & AI_RIDE_TRAIN) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_RIDE_TRAIN); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_RIDE_TRAIN; - self.b_menu_time = time; - } - else if (self.impulse == 4) - { - if (self.current_way.b_aiflags & AI_DOOR_NO_OPEN) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_DOOR_NO_OPEN); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_DOOR_NO_OPEN; - self.b_menu_time = time; - } - else if (self.impulse == 5) - { - if (self.current_way.b_aiflags & AI_AMBUSH) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_AMBUSH); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_AMBUSH; - self.b_menu_time = time; - } - else if (self.impulse == 6) - { - if (self.current_way.b_aiflags & AI_SNIPER) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_SNIPER); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_SNIPER; - self.b_menu_time = time; - } - else if (self.impulse == 7) - { - if (self.current_way.b_aiflags & AI_TRACE_TEST) - self.current_way.b_aiflags = self.current_way.b_aiflags - (self.current_way.b_aiflags & AI_TRACE_TEST); - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_TRACE_TEST; - self.b_menu_time = time; - } - - } - if (self.impulse == 9) - { - self.b_menu = MENU_FLAGS; - self.b_menu_time = time; - } - else if (self.impulse == 10) - { - self.b_menu = MENU_MAIN; - self.b_menu_time = time; - } - } - - else if (self.b_menu == MENU_BOTS) - { - if (self.impulse == 1) - { - self.impulse = 100; - return; - } - else if (self.impulse == 2) - { - b_temp3 = self; - self = player_head; - while(self) - { - if (!self.ishuman) - { - target_add(b_temp3); - bot_get_path(b_temp3, TRUE); - self = world; - } - else - self = self._next; - } - self = b_temp3; - } - else if (self.impulse == 3) - { - self.impulse = 102; - return; - } - else if (self.impulse == 4) - { - b_temp1 = self; - self = player_head; - while(self) - { - if (!self.ishuman) - { - self.target1 = self.target2 = self.target3 = self.target4 = world; - route_table = world; - } - self = self._next; - } - self = b_temp1; - } - else if (self.impulse == 5) - { - if (self.current_way) - { - b_temp1 = self; - self = player_head; - while(self) - { - if (!self.ishuman) - { - setorigin(self, b_temp1.current_way.origin); - } - self = self._next; - } - self = b_temp1; - } - else - sprint(self, "select a waypoint first\n"); - } - else if (self.impulse == 6) - { - self.b_menu = 14; - self.b_menu_time = time; - } - else if (self.impulse == 10) - { - self.b_menu = MENU_MAIN; - self.b_menu_time = time; - } - } - else if (self.b_menu == MENU_WAYLIST) - { - if (self.impulse == 1) - { - self.b_menu = 13; - self.b_menu_time = time; - } - else if (self.impulse == 2) - { - if (dump_mode == 0) - DumpWaypoints(); - else if (dump_mode == 1) - QCDumpWaypoints(); - else if (dump_mode == 2) - BSPDumpWaypoints(); - } - else if (self.impulse == 3) - { - t = way_head; - while(t) - { - if ((t.target1 == world) && (t.target2 == world) && (t.target3 == world) && (t.target4 == world)) - { - sprint(self, "Waypoint #"); - h = ftos(t.count); - sprint(self, h); - sprint(self, " has no outbound links\n"); - } - if ((t.target1 == t) || (t.target2 == t) || (t.target3 == t) || (t.target4 == t)) - { - sprint(self, "Waypoint #"); - h = ftos(t.count); - sprint(self, h); - sprint(self, " links to itself (??)\n"); - } - t = t._next; - } - sprint(self, "Error check complete\n"); - } - else if (self.impulse == 4) - { - sprint(self, "not in this version (FBX 0.10.0)\n"); - } - else if (self.impulse == 5) - { - if (waypoint_mode == WM_EDITOR_DYNAMIC) - waypoint_mode = WM_EDITOR; - else - waypoint_mode = WM_EDITOR_DYNAMIC; - self.b_menu_time = time; - - } - else if (self.impulse == 6) - { - if (waypoint_mode == WM_EDITOR_DYNLINK) - waypoint_mode = WM_EDITOR; - else - waypoint_mode = WM_EDITOR_DYNLINK; - self.b_menu_time = time; - } - else if (self.impulse == 7) - { - dump_mode = 0; - self.b_menu_time = time; - } - else if (self.impulse == 8) - { - dump_mode = 1; - self.b_menu_time = time; - } - else if (self.impulse == 9) - { - dump_mode = 2; - self.b_menu_time = time; - } - else if (self.impulse == 10) - { - self.b_menu = MENU_MAIN; - self.b_menu_time = time; - } - } - else if (self.b_menu == 8) - { - if (self.impulse == 1) - { - if (self.current_way) - { - if (!LinkWays(self.last_way, self.current_way)) - sprint(self, "Unable to link them\n"); - self.b_menu = MENU_LINKS; - self.b_menu_time = time; - } - } - else if (self.impulse == 2) - { - self.b_menu = MENU_LINKS; - self.b_menu_time = time; - } - } - else if (self.b_menu == 9) - { - if (self.impulse == 1) - { - if (self.current_way) - { - if (!TeleLinkWays(self.last_way, self.current_way)) - sprint(self, "Unable to link them\n"); - self.b_menu = MENU_LINKS; - self.b_menu_time = time; - } - } - else if (self.impulse == 2) - { - self.b_menu = MENU_LINKS; - self.b_menu_time = time; - } - } - else if (self.b_menu == 10) - { - if (self.impulse == 1) - { - if (self.current_way) - { - UnlinkWays(self.last_way, self.current_way); - self.b_menu = MENU_LINKS; - self.b_menu_time = time; - } - } - else if (self.impulse == 2) - { - self.b_menu = MENU_LINKS; - self.b_menu_time = time; - } - } - else if (self.b_menu == 11) - { - if (self.impulse == 1) - { - if (self.current_way) - { - if (!LinkWays(self.last_way, self.current_way)) - sprint(self, "Unable to link 1 to 2\n"); - if (!LinkWays(self.current_way, self.last_way)) - sprint(self, "Unable to link 2 to 1\n"); - self.b_menu = MENU_LINKS; - self.b_menu_time = time; - } - } - else if (self.impulse == 2) - { - self.b_menu = MENU_LINKS; - self.b_menu_time = time; - } - } - else if (self.b_menu == 12) - { - if (self.impulse == 1) - { - if (self.current_way) - { - UnlinkWays(self.last_way, self.current_way); - UnlinkWays(self.current_way, self.last_way); - self.b_menu = MENU_LINKS; - self.b_menu_time = time; - } - } - else if (self.impulse == 2) - { - self.b_menu = MENU_LINKS; - self.b_menu_time = time; - } - } - else if (self.b_menu == 13) - { - if (self.impulse == 1) - { - ClearAllWays(); - self.b_menu = MENU_WAYLIST; - self.b_menu_time = time; - } - else if (self.impulse == 2) - { - self.b_menu = MENU_WAYLIST; - self.b_menu_time = time; - } - } - else if (self.b_menu == 14) - { - if (self.impulse == 10) - self.impulse = 0; - self.b_menu_value = self.b_menu_value * 10 + self.impulse; - self.b_menu_time = 0; - } - else if (self.b_menu == 15) - { - if (self.impulse == 1) - { - delete_waypoint(self.last_way); - self.b_menu = MENU_WAYPOINTS; - self.b_menu_time = time; - } - else if (self.impulse == 2) - { - self.b_menu = MENU_WAYPOINTS; - self.b_menu_time = time; - } - } - self.impulse = 0; - - } - if (self.b_menu_time < time) - { - if (self.b_menu == MENU_MAIN) - { - s1 = "-- Main Menu --\n[1] >>Waypoint Management\n[2] >>Link Management \n[3] >>AI Flag Management \n[4] >>Bot Management \n[5] >>Waylist Management \n"; - if (self.movetype == MOVETYPE_NOCLIP) - s2 = "[6] [#] Noclip \n"; - else - s2 = "[6] [ ] Noclip \n"; - - if (self.flags & FL_GODMODE) - s3 = "[7] [#] Godmode \n"; - else - s3 = "[7] [ ] Godmode \n"; - if (self.b_aiflags & AI_HOLD_SELECT) - s4 = "[8] [#] Hold Select \n"; - else - s4 = "[8] [ ] Hold Select \n"; - s5 = "[9] Teleport to Way # \n[0] Close Menu \n"; - } - else if (self.b_menu == MENU_WAYPOINTS) - { - s1 = "-- Waypoint Management --\n[1] Move Waypoint \n[2] Delete Waypoint \n[3] Make Waypoint \n[4] Make Way + Link \n[5] Make Way + Link X2 \n[6] Make Way + Telelink \n[7] Show waypoint info \n[8] >>Link Management \n[9] >>AI Flag Management \n[0] >>Main Menu \n"; - } - else if (self.b_menu == MENU_LINKS) - { - s1 = "-- Link Management --\n[1] Unlink Waypoint \n[2] Create Link \n[3] Create Telelink \n[4] Delete Link \n[5] Create Link X2 \n[6] Delete Link X2 \n[7] >Make Waypoint \n[8] >>Waypoint Management\n[9] >>AI Flag Management \n[0] >>Main Menu \n"; - } - else if (self.b_menu == MENU_FLAGS) - { - if (self.current_way.b_aiflags & AI_DOORFLAG) - s1 = "-- AI Flag Management --\n[1] [#] Door Flag \n"; - else - s1 = "-- AI Flag Management --\n[1] [ ] Door Flag \n"; - - if (self.current_way.b_aiflags & AI_PRECISION) - s2 = "[2] [#] Precision \n"; - else - s2 = "[2] [ ] Precision \n"; - - if (self.current_way.b_aiflags & AI_SURFACE) - s3 = "[3] [#] Surface for air \n"; - else - s3 = "[3] [ ] Surface for air \n"; - - if (self.current_way.b_aiflags & AI_BLIND) - s4 = "[4] [#] Blind mode \n"; - else - s4 = "[4] [ ] Blind mode \n"; - - if (self.current_way.b_aiflags & AI_JUMP) - s5 = "[5] [#] Jump \n"; - else - s5 = "[5] [ ] Jump \n"; - - if (self.current_way.b_aiflags & AI_DIRECTIONAL) - s6 = "[6] [#] Directional \n"; - else - s6 = "[6] [ ] Directional \n"; - - // Electro - eww - if ( (self.current_way.b_aiflags & AI_SUPER_JUMP) && (self.current_way.b_aiflags & AI_CARELESS) ) - s7 = "[7] [#] Super Jump \n[8] [#] Careless \n[9] >>AI Flags page 2 \n[0] >>Main Menu \n"; - else if ( (self.current_way.b_aiflags & AI_SUPER_JUMP) && (!(self.current_way.b_aiflags & AI_CARELESS)) ) - s7 = "[7] [#] Super Jump \n[8] [ ] Careless \n[9] >>AI Flags page 2 \n[0] >>Main Menu \n"; - else if ( (!(self.current_way.b_aiflags & AI_SUPER_JUMP)) && (self.current_way.b_aiflags & AI_CARELESS) ) - s7 = "[7] [ ] Super Jump \n[8] [#] Careless \n[9] >>AI Flags page 2 \n[0] >>Main Menu \n"; - else if ( (!(self.current_way.b_aiflags & AI_SUPER_JUMP)) && (!(self.current_way.b_aiflags & AI_CARELESS)) ) - s7 = "[7] [ ] Super Jump \n[8] [ ] Careless \n[9] >>AI Flags page 2 \n[0] >>Main Menu \n"; - } - else if (self.b_menu == MENU_FLAGS2) - { - if (self.current_way.b_aiflags & AI_DIFFICULT) - s1 = "-- AI Flags pg. 2--\n[1] [#] Difficult \n"; - else - s1 = "-- AI Flags pg. 2--\n[1] [ ] Difficult \n"; - - if (self.current_way.b_aiflags & AI_PLAT_BOTTOM) - s2 = "[2] [#] Wait for plat \n"; - else - s2 = "[2] [ ] Wait for plat \n"; - - if (self.current_way.b_aiflags & AI_RIDE_TRAIN) - s3 = "[3] [#] Ride train \n"; - else - s3 = "[3] [ ] Ride train \n"; - - if (self.current_way.b_aiflags & AI_DOOR_NO_OPEN) - s4 = "[4] [#] Door flag no open\n"; - else - s4 = "[4] [ ] Door flag no open\n"; - - if (self.current_way.b_aiflags & AI_AMBUSH) - s5 = "[5] [#] Ambush \n"; - else - s5 = "[5] [ ] Ambush \n"; - - if (self.current_way.b_aiflags & AI_SNIPER) - s6 = "[6] [#] Snipe \n"; - else - s6 = "[6] [ ] Snipe \n"; - - if (self.current_way.b_aiflags & AI_TRACE_TEST) - s7 = "[7] [#] Trace Test \n\n[9] >>AI Flag Management \n[0] >>Main Menu \n"; - else - s7 = "[7] [ ] Trace Test \n\n[9] >>AI Flag Management \n[0] >>Main Menu \n"; - - } - else if (self.b_menu == MENU_BOTS) - { - s1 = "-- Bot Management --\n[1] Add a Test Bot \n[2] Order Test Bot here \n[3] Remove Test Bot \n[4] Stop Test Bot \n[5] Teleport Bot here \n[6] Teleport to Way # \n\n\n\n[0] >>Main Menu \n"; - } - else if (self.b_menu == MENU_WAYLIST) - { - s1 = "-- Waylist Management --\n[1] Delete ALL Waypoints \n[2] Dump Waypoints \n[3] Check For Errors \n[4] Save Waypoints \n"; - - if (waypoint_mode == WM_EDITOR_DYNAMIC) - s2 = "[5] [#] Dynamic Mode \n[6] [#] Dynamic Link \n"; - else if (waypoint_mode == WM_EDITOR_DYNLINK) - s2 = "[5] [ ] Dynamic Mode \n[6] [#] Dynamic Link \n"; - else - s2 = "[5] [ ] Dynamic Mode \n[6] [ ] Dynamic Link \n"; - if (dump_mode == 0) - s3 = "[7] [#] WAY output \n[8] [ ] QC output \n[9] [ ] BSP ents output \n[0] Main Menu \n"; - else if (dump_mode == 1) - s3 = "[7] [ ] WAY output \n[8] [#] QC output \n[9] [ ] BSP ents output \n[0] Main Menu \n"; - else if (dump_mode == 2) - s3 = "[7] [ ] WAY output \n[8] [ ] QC output \n[9] [#] BSP ents output \n[0] Main Menu \n"; - - } - else if (self.b_menu == 8) - s1 = "-- Link Ways --\n\nSelect another way and push 1\nor press 2 to cancel"; - else if (self.b_menu == 9) - s1 = "-- Telelink Ways --\n\nSelect another way and push 1\nor press 2 to cancel"; - else if (self.b_menu == 10) - s1 = "-- Delete Link --\n\nSelect another way and push 1\nor press 2 to cancel"; - else if (self.b_menu == 11) - s1 = "-- Create Link X2 --\n\nSelect another way and push 1\nor press 2 to cancel"; - else if (self.b_menu == 12) - s1 = "-- Delete Link X2 --\n\nSelect another way and push 1\nor press 2 to cancel"; - else if (self.b_menu == 13) - s1 = "-- Delete ALL Ways --\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel"; - else if (self.b_menu == 14) - { - s1 = "-- Teleport to Way # --\n\nEnter way number and press\nimpulse 104 to warp\n\nWaypoint #"; - s2 = ftos(self.b_menu_value); - - } - else if (self.b_menu == 15) - s1 = "-- Delete Waypoint --\n\nAre you sure? Push 1 to go\nthrough with it, 2 to cancel"; - frik_big_centerprint(self, s1, s2, s3, s4, s5, s6, s7); - self.b_menu_time = time + 1.25; - } -}; - - -// engage menu -void() bot_way_edit = -{ - local entity t; - local float f; - if (self.b_menu_value) - { - if (self.b_menu == 14) - { - t = WaypointForNum(self.b_menu_value); - if (t) - setorigin(self, t.origin - self.view_ofs); - else - sprint(self, "No waypoint with that number\n"); - - self.b_menu = MENU_MAIN; - self.b_menu_time = time; - } - self.b_menu_value = 0; - return; - } - if (waypoint_mode < WM_EDITOR) - { - self.b_menu = MENU_MAIN; - waypoint_mode = WM_EDITOR; - self.b_menu_time = 0; - cvar_set("saved2", "0"); - WriteByte(MSG_ALL, 8); - WriteByte(MSG_ALL, 1); - WriteString(MSG_ALL, "MAKE SURE THE FOLLOWING LINE CONTAINS -CONDEBUG BEFORE PROCEEDING\n"); - localcmd("cmdline\n"); - t = way_head; - while (t) - { - setmodel(t, "progs/s_bubble.spr"); // show the waypoints // file missing from nexuiz - t = t._next; - } - if (self.current_way) - setmodel(self.current_way, "progs/s_light.spr"); // file missing from nexuiz - } - else - { - saved2 = cvar("saved2"); - if (saved2 != 0) - { - f = self.b_menu; - self.b_menu = floor(saved2/16); - self.impulse = saved2 & 15; - bot_menu_display(); - self.b_menu = f; - cvar_set("saved2", "0"); - return; - } - self.b_menu = 0; - waypoint_mode = WM_LOADED; - t = way_head; - while (t) - { - setmodel(t, string_null); // hide the waypoints - t = t._next; - } - } -}; - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Waypoint Saving to file. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - - -// bytecount is really iffy -// since there is no true way to determine the length of an ftos -// it uses an approximate of 5 -// various other things are guesses, but I don't cut it at the absolute -// max so it should be okay - -void() PrintWaypoint = -{ - local entity t; - local float needcolon; - local string h; - - if (self.enemy == world) - t = way_head; - else - t = self.enemy._next; - if (bytecounter >= 8000) - { - bprint("exec maps/"); - bprint(mapname); - bprint(".wa"); - h = ftos(filecount); - bprint(h); - filecount = filecount + 1; - bprint("\n// **** break here **** \n"); - bytecounter = 26; - } - if (t == world) - { - remove(self); - fixer = world; - bprint("saved4 3\n// end waypoint dump\n"); - bytecounter = bytecounter + 27; - return; - } - if ((t.origin_x != saved1) || (t.count == 1)) - { - bprint("saved1 "); - h = ftos(t.origin_x); - bprint(h); - saved1 = t.origin_x; - bytecounter = bytecounter + 12; - needcolon = TRUE; - } - if ((t.origin_y != saved2) || (t.count == 1)) - { - if (needcolon) - { - bprint("; "); - bytecounter = bytecounter + 2; - } - else - needcolon = TRUE; - bprint("saved2 "); - h = ftos(t.origin_y); - bprint(h); - bytecounter = bytecounter + 12; - saved2 = t.origin_y; - } - if ((t.origin_z != saved3) || (t.count == 1)) - { - if (needcolon) - { - bprint("; "); - bytecounter = bytecounter + 2; - } - else - needcolon = TRUE; - bprint("saved3 "); - h = ftos(t.origin_z); - bprint(h); - bytecounter = bytecounter + 12; - saved3 = t.origin_z; - } - bytecounter = bytecounter + 1; - bprint("\n"); - needcolon = FALSE; - if ((scratch1 != t.target1.count) || t.count == 1) - { - needcolon = TRUE; - bprint("scratch1 "); - bytecounter = bytecounter + 14; - h = ftos(t.target1.count); - bprint(h); - scratch1 = t.target1.count; - } - if ((scratch2 != t.target2.count) || t.count == 1) - { - if (needcolon) - { - bprint("; "); - bytecounter = bytecounter + 2; - } - else - needcolon = TRUE; - bprint("scratch2 "); - bytecounter = bytecounter + 14; - h = ftos(t.target2.count); - bprint(h); - scratch2 = t.target2.count; - } - if ((scratch3 != t.target3.count) || t.count == 1) - { - if (needcolon) - { - bprint("; "); - bytecounter = bytecounter + 2; - } - else - needcolon = TRUE; - bprint("scratch3 "); - bytecounter = bytecounter + 14; - h = ftos(t.target3.count); - bprint(h); - scratch3 = t.target3.count; - } - if ((scratch4 != t.target4.count) || t.count == 1) - { - if (needcolon) - { - bprint("; "); - bytecounter = bytecounter + 2; - } - else - needcolon = TRUE; - bprint("scratch4 "); - bytecounter = bytecounter + 14; - h = ftos(t.target4.count); - bprint(h); - scratch4 = t.target4.count; - } - bprint("\nsaved4 "); - bytecounter = bytecounter + 19; - if (t.count != 1) - h = ftos(t.b_aiflags * 4 + 2); - else - h = ftos(t.b_aiflags * 4 + 1); - bprint(h); - bprint ("; wait\n"); - self.nextthink = time + 0.01; - self.enemy = t; -}; - -// to allow for 100+ waypoints, we need to trick the runaway loop counter -void() DumpWaypoints = -{ - bytecounter = 50; - filecount = 1; - - bprint("// "); - bprint(world.message); - bprint("- maps/"); - bprint(mapname); - bprint(".way\n"); - bprint("// Ways by "); - bprint(self.netname); - bprint("\n"); - if (!fixer) - { - fixer = spawn(); - fixer.nextthink = time + 0.01; - fixer.think = PrintWaypoint; - fixer.enemy = world; - } -}; - -void() PrintQCWaypoint = -{ - local entity t; - local string h; - - if (self.enemy == world) - t = way_head; - else - t = self.enemy._next; - - if (t == world) - { - remove(self); - fixer = world; - bprint("};\n\n// End dump\n"); - return; - } - bprint(" make_way("); - h = vtos(t.origin); - bprint(h); - bprint(", '"); - h = ftos(t.target1.count); - bprint(h); - bprint(" "); - h = ftos(t.target2.count); - bprint(h); - bprint(" "); - h = ftos(t.target3.count); - bprint(h); - bprint("', "); - h = ftos(t.target4.count); - bprint(h); - bprint(", "); - h = ftos(t.b_aiflags); - bprint(h); - bprint(");\n"); - self.nextthink = time + 0.01; - self.enemy = t; - -}; -void() QCDumpWaypoints = -{ - bprint("/* QC Waypoint Dump - src/frikbot/map_"); - - bprint(mapname); - bprint(".qc\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\nvoid(vector org, vector bit1, float bit4, float flargs) make_way;\n"); - bprint("// Ways by "); - bprint(self.netname); - bprint("\n\n"); - - bprint("void() map_"); - bprint(mapname); - bprint(" =\n{\n"); - - - if (!fixer) - { - fixer = spawn(); - fixer.nextthink = time + 0.01; - fixer.think = PrintQCWaypoint; - fixer.enemy = world; - } -}; - -void() PrintBSPWaypoint = -{ - local entity t; - local string h; - - if (self.enemy == world) - t = way_head; - else - t = self.enemy._next; - - if (t == world) - { - bprint("\n\n// End dump\n"); - remove(self); - fixer = world; - return; - } - bprint("{\n\"classname\" \"waypoint\"\n\"origin\" \""); - h = ftos(t.origin_x); - bprint(h); - bprint(" "); - h = ftos(t.origin_y); - bprint(h); - bprint(" "); - h = ftos(t.origin_z); - bprint(h); - if (t.target1.count) - { - bprint("\"\n\"b_pants\" \""); - h = ftos(t.target1.count); - bprint(h); - } - if (t.target2.count) - { - bprint("\"\n\"b_skill\" \""); - h = ftos(t.target2.count); - bprint(h); - } - if (t.target3.count) - { - bprint("\"\n\"b_shirt\" \""); - h = ftos(t.target3.count); - bprint(h); - } - if (t.target4.count) - { - bprint("\"\n\"b_frags\" \""); - h = ftos(t.target4.count); - bprint(h); - } - if (t.b_aiflags) - { - bprint("\"\n\"b_aiflags\" \""); - h = ftos(t.b_aiflags); - bprint(h); - } - bprint("\"\n}\n"); - self.nextthink = time + 0.01; - self.enemy = t; - -}; -void() BSPDumpWaypoints = -{ - bprint("/* BSP entities Dump - maps/"); - - bprint(mapname); - bprint(".ent\nFor instructions please read the\nreadme.html that comes with FrikBot */\n\n\n"); - - if (!fixer) - { - fixer = spawn(); - fixer.nextthink = time + 0.01; - fixer.think = PrintBSPWaypoint; - fixer.enemy = world; - } -}; diff --git a/TeamNexuiz/game/gamec/bot_fight.c b/TeamNexuiz/game/gamec/bot_fight.c deleted file mode 100644 index 36cd200a5..000000000 --- a/TeamNexuiz/game/gamec/bot_fight.c +++ /dev/null @@ -1,438 +0,0 @@ -/*********************************************** -* * -* FrikBot Fight Code * -* "Because I ain't no Ghandi code" * -* * -***********************************************/ - -/* - -This program is in the Public Domain. My crack legal -team would like to add: - -RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" -AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE -ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR -FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN -NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY -GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, -EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" -SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. - -You accept this software on the condition that you -indemnify and hold harmless Ryan "FrikaC" Smith from -any and all liability or damages to third parties, -including attorney fees, court costs, and other -related costs and expenses, arising out of your use -of this software irrespective of the cause of said -liability. - -The export from the United States or the subsequent -reexport of this software is subject to compliance -with United States export control and munitions -control restrictions. You agree that in the event you -seek to export this software, you assume full -responsibility for obtaining all necessary export -licenses and approvals and for assuring compliance -with applicable reexport restrictions. - -Any reproduction of this software must contain -this notice in its entirety. - -*/ - -.entity avoid; - -float(entity e) bot_size_player = -{ - local float sz; - - sz = e.health + e.armorvalue * e.armortype; - if (e.weapon == WEP_ROCKET_LAUNCHER) - sz = sz + 60; - else if (e.weapon == WEP_HAGAR) - sz = sz + 60; - else if (e.weapon == WEP_NEX) - sz = sz + 60; - else if (e.weapon == WEP_CRYLINK) - sz = sz + 50; - else if (e.weapon == WEP_ELECTRO) - sz = sz + 50; - else if (e.weapon == WEP_GRENADE_LAUNCHER) - sz = sz + 40; - else if (e.weapon == WEP_UZI) - sz = sz + 40; - else if (e.weapon == WEP_SHOTGUN) - sz = sz + 10; - else if (e.weapon == WEP_LASER) - sz = sz - 50; - if (e.items & 4194304) // Quad - sz = sz + 200; - if (e.items & 1048576) // Invul - sz = sz + 300; - if (e.items & 524288) // Invis - sz = sz + 250; - return sz; -}; - -void() bot_dodge_stuff = -{ - local entity foe; - local float foedist, avdist, foesz, flen, tsz; - local vector v; - - if (waypoint_mode > WM_LOADED) - return; - - self.avoid = world; - - - if (self.enemy) - { - v = self.origin - realorigin(self.enemy); - foedist = vlen(v); - foesz = bot_size_player(self.enemy); - } - else - { - foedist = 3000; - foesz = 9999999; - } - avdist = 256; - - foe = find(world, classname, "grenade"); - while(foe) - { - flen = vlen(foe.origin - self.origin); - if (flen < avdist) - { - avdist = flen; - self.avoid = foe; - } - foe = find(foe, classname, "grenade"); - } - if (!self.avoid) - { - foe = find(world, classname, "missile"); - while(foe) - { - if (foe.owner != self) - { - flen = vlen(foe.origin - self.origin); - if (flen < avdist) - { - avdist = flen; - self.avoid = foe; - } - } - foe = find(foe, classname, "missile"); - } - if (!self.avoid) - { - foe = find(world, classname, "spike"); - while(foe) - { - if (foe.owner != self) - { - flen = vlen(foe.origin - self.origin); - if (flen < avdist) - { - avdist = flen; - self.avoid = foe; - } - } - foe = find(foe, classname, "spike"); - } - } - } - if (coop) - { - if (!self.enemy) - { - foe = findradius(self.origin, foedist); - while(foe) - { - if(foe.flags & FL_MONSTER) - { - if(foe.health > 0) - { - flen = vlen(foe.origin - self.origin); - if (flen < foedist) - { - tsz = bot_size_player(foe); - if (tsz < foesz) - { - if (fisible(foe)) - { - self.enemy = foe; - foedist = flen; - foesz = tsz; - } - } - } - } - } - foe = foe.chain; - } - } - } - else - { - foe = player_head; - while(foe) - { - if(foe != self) - { - if (foe.modelindex != 0) - { - if (foe.health > 0) - { - if (!(teamplay && self.team == foe.team)) - { - flen = vlen(foe.origin - self.origin); - if (flen < foedist) - { - tsz = bot_size_player(foe); - if (tsz < foesz) - { - if (fov(foe) || foe.b_sound > time || self.b_skill == 3) - { - if (fisible(foe)) - { - self.enemy = foe; - foedist = vlen(foe.origin - self.origin); - } - } - } - } - } - } - } - } - foe = foe._next; - } - } -}; - - - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -weapon_range - -_x "sweet spot range" - try to maintain this range if possible -_y minimum range bot can be to be effective (rl/gl) (move away) -_z maximum range bot can be to be effective (lg/axe) (move in) --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -vector(float wep) weapon_range = -{ - if (wep == IT_LASER) // IT_AXE - return '48 0 300'; - else if (wep == IT_SHOTGUN) // IT_SHOTGUN - return '128 0 99999'; - else if (wep == IT_CRYLINK) // IT_SUPER_SHOTGUN - return '128 0 99999'; - else if (wep == IT_UZI) // IT_NAILGUN - return '180 0 3000'; - else if (wep == IT_HAGAR) // IT_SUPER_NAILGUN - return '180 48 3000'; - else if (wep == IT_GRENADE_LAUNCHER) // IT_GRENADE_LAUNCHER - return '180 48 3000'; - else if (wep == IT_ELECTRO) // IT_ROCKET_LAUNCHER - return '180 48 3000'; - else if (wep == IT_ROCKET_LAUNCHER) // IT_ROCKET_LAUNCHER - return '180 48 3000'; - else if (wep == IT_NEX) // IT_LIGHTNING - return '350 0 99999'; - return '48 0 300'; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -bot_weapon_switch - -Pick a weapon based on range / ammo - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void(float brange) bot_weapon_switch = -{ - local float it, flag, pulse; - local vector v; - - it = self.items & 127; - pulse = 0; - - while(it) - { - if ((self.ammo_rockets >= 3) && (it & IT_ROCKET_LAUNCHER)){flag = IT_ROCKET_LAUNCHER;pulse = 9;} - else if ((self.ammo_rockets >= 1) && (it & IT_HAGAR)){flag = IT_HAGAR;pulse = 8;} - else if ((self.ammo_cells >= 5) && (it & IT_NEX)){flag = IT_NEX;pulse = 7;} - else if ((self.ammo_cells >= 1) && (it & IT_CRYLINK)){flag = IT_CRYLINK;pulse = 6;} - else if ((self.ammo_cells >= 2) && (it & IT_ELECTRO)){flag = IT_ELECTRO;pulse = 5;} - else if ((self.ammo_rockets >= 3) && (it & IT_GRENADE_LAUNCHER)){flag = IT_GRENADE_LAUNCHER;pulse = 4;} - else if ((self.ammo_nails >= 1) && (it & IT_UZI)){flag = IT_UZI;pulse = 3;} - else if ((self.ammo_shells >= 1) && (it & IT_SHOTGUN)){flag = IT_SHOTGUN;pulse = 2;} - else - { - if (pulse) - self.impulse = pulse; - return; - } - - if (brange == -1) - { - if (pulse) - self.impulse = pulse; - return; - } - - v = weapon_range(flag); - if (brange < v_y || brange > v_z) - it = it - flag; - else - { - if (pulse) - self.impulse = pulse; - return; - } - } -}; - -void() bot_shoot = -{ - // quick little function to stop making him shoot the wrong way ! Argh - local float g; - g = angcomp(self.v_angle_x, self.b_angle_x); - if (fabs(g) > 30) - return; // argh, too far away - g = angcomp(self.v_angle_y, self.b_angle_y); - if (fabs(g) > 30) - return; // not again! - self.button0 = TRUE; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Bot_fight_style - -This is the core of the bot's thinking when -attacking an enemy. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() bot_fight_style = -{ - local vector v, v1, v2, org; - local float foedist, mysz, foesz; - - - if (self.enemy.health <= 0) - { - self.enemy = world; - return; - } - else if (!self.enemy.takedamage) - { - self.enemy = world; - return; - } - else if (!fisible(self.enemy)) - { - self.enemy = world; - return; - } - - org = realorigin(self.enemy); - makevectors(self.v_angle); - - // decide if I should shoot - - foedist = vlen(org - self.origin); - v = weapon_range(self.weapon); - if (foedist > v_y && foedist < v_z) - { - traceline(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * v_z, FALSE, self); - if (vlen(trace_endpos - (self.origin + self.view_ofs)) >= v_y) - { - // try to avoid shooting teammates - if (trace_ent.classname == "player") - if ((trace_ent.team == self.team && teamplay) || (coop)) - return; - bot_shoot(); - } - } - else - bot_weapon_switch(foedist); - - if (!(self.b_aiflags & (AI_PRECISION | AI_BLIND | AI_OBSTRUCTED))) - { - foesz = bot_size_player(self.enemy); - mysz = bot_size_player(self) + 5; - - if (foesz > mysz) - { - if (teamplay) - { - if (random() < 0.02) - { - bot_start_topic(5); - self.b_chattime = 1; - } - } - - return; - } - else if (mysz < 140) - return; - else if (self.avoid) - { - if (self.avoid.velocity) - v = self.avoid.velocity; - else - v = normalize(self.avoid.origin - self.origin); - v1_x = v_y; - v1_y = v_y * -1; - v2_x = v_y; - v2_y = v_y * -1; - foedist = vlen(self.avoid.origin - (self.origin + v1)); - if (foedist < vlen(self.avoid.origin - (self.origin + v2))) - frik_walkmove(v2); - else - frik_walkmove(v1); - } - else if (!self.enemy.flags & FL_MONSTER) - { - if (foedist + 32 < v_x) - frik_walkmove(self.origin - org); - else if (foedist - 32 > v_x) - frik_walkmove(org - self.origin); - else if (self.wallhug) - frik_walkmove(v_right); - else - frik_walkmove(v_right * -1); - } - } - else - { - foesz = bot_size_player(self.enemy); - mysz = bot_size_player(self) + 5; - - if (foesz > mysz) - return; - else if (mysz < 140) - return; - self.keys = self.keys & 960; - } -}; - - diff --git a/TeamNexuiz/game/gamec/bot_maps.c b/TeamNexuiz/game/gamec/bot_maps.c deleted file mode 100644 index a28220003..000000000 --- a/TeamNexuiz/game/gamec/bot_maps.c +++ /dev/null @@ -1,152 +0,0 @@ -void(vector org, vector bit1, float bit4, float flargs) make_way; -// Ways by Electro - -void() map_mattrye1_nex = -{ - make_way('655.3 370.1 -34.0', '2 43 0', 0, 0); - make_way('214.7 338.9 -34.0', '1 3 0', 0, 0); - make_way('-70.7 197.7 -34.0', '2 4 5', 0, 0); - make_way('-263.8 27.5 -34.0', '3 5 6', 10, 0); - make_way('-263.8 199.7 -34.0', '4 6 3', 0, 0); - make_way('-394.6 201.2 -34.0', '5 7 4', 0, 0); - make_way('-617.8 260.5 -34.0', '6 8 0', 0, 0); - make_way('-644.1 428.5 -34.0', '7 9 0', 0, 0); - make_way('-642.2 727.9 -34.0', '8 0 0', 0, 0); - make_way('-259.3 -187.2 -34.0', '4 11 12', 0, 0); - make_way('-26.8 -384.2 -34.0', '10 12 32', 0, 0); - make_way('-254.3 -368.7 -34.0', '10 11 13', 0, 0); - make_way('-453.0 -380.6 -34.0', '12 14 0', 0, 0); - make_way('-634.6 -436.6 -34.0', '13 15 0', 0, 0); - make_way('-724.5 -730.3 -34.0', '14 16 0', 0, 0); - make_way('-1118.6 -771.6 -34.0', '15 17 0', 0, 0); - make_way('-1509.0 -737.1 62.0', '16 18 0', 0, 0); - make_way('-1519.2 -374.8 182.0', '17 19 41', 0, 0); - make_way('-1035.7 -196.8 182.0', '18 20 39', 41, 0); - make_way('-749.3 -135.9 182.0', '19 21 0', 0, 0); - make_way('-576.4 -26.8 182.0', '20 22 0', 0, 0); - make_way('-404.1 -18.0 182.0', '21 23 12', 0, 0); - make_way('-123.2 -18.2 182.0', '22 24 10', 12, 0); - make_way('102.6 -27.2 182.0', '23 25 0', 0, 0); - make_way('106.8 -383.1 182.0', '24 26 36', 0, 0); - make_way('-232.4 -342.7 278.0', '25 27 13', 0, 0); - make_way('-245.5 -20.1 374.0', '26 28 29', 21, 0); - make_way('107.1 6.3 374.0', '27 25 0', 0, 0); - make_way('-277.8 554.4 374.0', '27 30 0', 0, 0); - make_way('-520.5 574.9 374.0', '29 31 9', 8, 0); - make_way('-768.3 574.9 374.0', '30 8 9', 0, 0); - make_way('465.9 -423.7 -34.0', '11 33 0', 0, 0); - make_way('543.3 -660.4 -34.0', '32 34 0', 0, 0); - make_way('537.0 -955.6 -34.0', '33 35 0', 0, 0); - make_way('165.7 -926.3 86.0', '34 36 0', 0, 0); - make_way('138.8 -740.6 155.8', '35 25 33', 0, 0); - make_way('581.8 195.7 -21.1', '38 0 0', 0, 262144); - make_way('847.0 120.2 191.0', '28 0 0', 0, 262144); - make_way('-1101.5 176.0 182.0', '19 40 0', 0, 0); - make_way('-1584.0 173.6 182.0', '39 0 0', 0, 0); - make_way('-1295.4 -37.8 148.2', '18 42 19', 0, 0); - make_way('-1362.7 -55.6 -221.2', '41 0 0', 0, 0); - make_way('769.2 196.2 -34.0', '1 44 0', 0, 0); - make_way('633.1 193.1 -34.0', '43 37 0', 0, 256); -}; -/* -// Ways by Electro - -void() map_mattrye2 = -{ - make_way('-652.5 -1043.9 511.0', '4 0 0', 0, 0); - make_way('-992.5 -617.0 415.0', '3 7 0', 0, 0); - make_way('-953.0 -50.2 351.0', '6 8 0', 0, 0); - make_way('-647.0 77.1 351.0', '7 9 0', 0, 0); - make_way('-698.8 764.0 239.0', '8 10 0', 0, 0); - make_way('-1054.6 766.4 239.0', '9 11 0', 0, 0); - make_way('-1357.9 786.5 239.0', '10 12 0', 0, 0); - make_way('-1373.6 1502.7 127.0', '11 13 0', 0, 0); - make_way('-1110.3 1625.0 127.0', '12 14 0', 0, 0); - make_way('-985.9 2144.7 127.0', '13 15 0', 0, 0); - make_way('-495.4 2230.9 127.0', '14 16 17', 0, 0); - make_way('-47.4 2158.4 127.0', '15 40 0', 0, 0); - make_way('-501.6 2626.1 127.0', '15 18 0', 0, 0); - make_way('346.4 2679.1 223.0', '17 19 20', 0, 0); - make_way('433.6 2248.8 223.0', '18 20 0', 0, 0); - make_way('550.4 2675.8 223.0', '19 18 21', 0, 0); - make_way('876.8 2671.6 271.0', '20 22 0', 0, 0); - make_way('837.9 2263.6 319.0', '21 19 23', 0, 0); - make_way('925.9 1798.9 319.0', '22 24 0', 0, 0); - make_way('1644.3 1772.2 351.0', '23 25 0', 0, 0); - make_way('1628.4 1068.5 351.0', '24 26 0', 0, 0); - make_way('1409.9 965.9 351.0', '25 27 0', 0, 0); - make_way('1073.8 789.9 351.0', '26 28 44', 45, 0); - make_way('1408.4 645.5 416.0', '27 29 26', 0, 0); - make_way('1653.5 624.0 479.0', '28 30 0', 0, 0); - make_way('1662.9 317.8 479.0', '29 31 45', 0, 0); - make_way('1637.0 28.1 479.0', '30 32 0', 0, 0); - make_way('1060.8 -48.7 479.0', '31 33 0', 0, 0); - make_way('996.9 -484.3 479.0', '32 34 0', 0, 0); - make_way('550.8 -491.1 479.0', '33 35 37', 39, 0); - make_way('542.9 -914.0 479.0', '34 36 37', 39, 0); - make_way('712.4 -1089.3 511.0', '35 0 0', 0, 0); - make_way('-13.4 -289.6 479.0', '34 39 35', 3, 0); - make_way('-97.3 -677.8 479.0', '2 4 3', 0, 0); - make_way('144.7 -679.1 479.0', '35 37 34', 0, 0); - make_way('2.3 1824.9 127.0', '16 41 0', 0, 0); - make_way('6.0 1232.9 127.0', '40 42 0', 0, 0); - make_way('10.5 768.3 127.0', '41 43 0', 0, 0); - make_way('5.0 375.1 127.0', '42 44 0', 0, 0); - make_way('875.6 378.7 351.0', '43 45 27', 0, 0); - make_way('1090.9 453.8 351.0', '44 27 0', 0, 0); - make_way('-560.0 1269.1 351.0', '0 0 0', 0, 0); - make_way('-434.0 1282.5 127.0', '41 40 42', 0, 0); - make_way('602.4 1275.2 351.0', '0 0 0', 0, 0); - make_way('430.0 1282.1 127.0', '41 42 40', 0, 0); -}; - -// Ways by Electro - -void() map_mattrye1_nex = -{ - make_way('655.3 370.1 -34.0', '2 43 0', 0, 0); - make_way('214.7 338.9 -34.0', '1 3 0', 0, 0); - make_way('-70.7 197.7 -34.0', '2 4 5', 0, 0); - make_way('-263.8 27.5 -34.0', '3 5 6', 10, 0); - make_way('-263.8 199.7 -34.0', '4 6 3', 0, 0); - make_way('-394.6 201.2 -34.0', '5 7 4', 0, 0); - make_way('-617.8 260.5 -34.0', '6 8 0', 0, 0); - make_way('-644.1 428.5 -34.0', '7 9 0', 0, 0); - make_way('-642.2 727.9 -34.0', '8 0 0', 0, 0); - make_way('-259.3 -187.2 -34.0', '4 11 12', 0, 0); - make_way('-26.8 -384.2 -34.0', '10 12 32', 0, 0); - make_way('-254.3 -368.7 -34.0', '10 11 13', 0, 0); - make_way('-453.0 -380.6 -34.0', '12 14 0', 0, 0); - make_way('-634.6 -436.6 -34.0', '13 15 0', 0, 0); - make_way('-724.5 -730.3 -34.0', '14 16 0', 0, 0); - make_way('-1118.6 -771.6 -34.0', '15 17 0', 0, 0); - make_way('-1509.0 -737.1 62.0', '16 18 0', 0, 0); - make_way('-1519.2 -374.8 182.0', '17 19 41', 0, 0); - make_way('-1035.7 -196.8 182.0', '18 20 39', 41, 0); - make_way('-749.3 -135.9 182.0', '19 21 0', 0, 0); - make_way('-576.4 -26.8 182.0', '20 22 0', 0, 0); - make_way('-404.1 -18.0 182.0', '21 23 12', 0, 0); - make_way('-123.2 -18.2 182.0', '22 24 10', 12, 0); - make_way('102.6 -27.2 182.0', '23 25 0', 0, 0); - make_way('106.8 -383.1 182.0', '24 26 36', 0, 0); - make_way('-232.4 -342.7 278.0', '25 27 13', 0, 0); - make_way('-245.5 -20.1 374.0', '26 28 29', 21, 0); - make_way('107.1 6.3 374.0', '27 25 0', 0, 0); - make_way('-277.8 554.4 374.0', '27 30 0', 0, 0); - make_way('-520.5 574.9 374.0', '29 31 9', 8, 0); - make_way('-768.3 574.9 374.0', '30 8 9', 0, 0); - make_way('465.9 -423.7 -34.0', '11 33 0', 0, 0); - make_way('543.3 -660.4 -34.0', '32 34 0', 0, 0); - make_way('537.0 -955.6 -34.0', '33 35 0', 0, 0); - make_way('165.7 -926.3 86.0', '34 36 0', 0, 0); - make_way('138.8 -740.6 155.8', '35 25 33', 0, 0); - make_way('581.8 195.7 -21.1', '38 0 0', 0, 262144); - make_way('847.0 120.2 191.0', '28 0 0', 0, 262144); - make_way('-1101.5 176.0 182.0', '19 40 0', 0, 0); - make_way('-1584.0 173.6 182.0', '39 0 0', 0, 0); - make_way('-1295.4 -37.8 148.2', '18 42 19', 0, 0); - make_way('-1362.7 -55.6 -221.2', '41 0 0', 0, 0); - make_way('769.2 196.2 -34.0', '1 44 0', 0, 0); - make_way('633.1 193.1 -34.0', '43 37 0', 0, 256); -}; -*/ diff --git a/TeamNexuiz/game/gamec/bot_misc.c b/TeamNexuiz/game/gamec/bot_misc.c deleted file mode 100644 index c78752a49..000000000 --- a/TeamNexuiz/game/gamec/bot_misc.c +++ /dev/null @@ -1,841 +0,0 @@ -/*********************************************** -* * -* FrikBot Misc Code * -* "Because you can't name it anything else" * -* * -***********************************************/ - -/* -This program is in the Public Domain. My crack legal -team would like to add: - -RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" -AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE -ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR -FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN -NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY -GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, -EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" -SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. - -You accept this software on the condition that you -indemnify and hold harmless Ryan "FrikaC" Smith from -any and all liability or damages to third parties, -including attorney fees, court costs, and other -related costs and expenses, arising out of your use -of this software irrespective of the cause of said -liability. - -The export from the United States or the subsequent -reexport of this software is subject to compliance -with United States export control and munitions -control restrictions. You agree that in the event you -seek to export this software, you assume full -responsibility for obtaining all necessary export -licenses and approvals and for assuring compliance -with applicable reexport restrictions. - -Any reproduction of this software must contain -this notice in its entirety. - -*/ - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -BotName - -Sets bot's name and colors - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -string(float r) BotName = -{ - self.b_num = r; - if (r == 1) - { - self.playermodel = "models/player/visitant.zym"; - self.playerskin = "0"; - return "Visitant"; - } - else if (r == 2) - { - self.playermodel = "models/player/marine.zym"; - self.playerskin = "0"; - return "Marine"; - } - else if (r == 3) - { - self.playermodel = "models/player/specop.zym"; - self.playerskin = "0"; - return "Specop"; - } - else if (r == 4) - { - self.playermodel = "models/player/nexus.zym"; - self.playerskin = "0"; - return "Nexus"; - } - else if (r == 5) - { - self.playermodel = "models/player/skadi.zym"; - self.playerskin = "0"; - return "Skadi"; - } - else if (r == 6) - { - self.playermodel = "models/player/lurk.zym"; - self.playerskin = "0"; - return "Lurk"; - } - else if (r == 7) - { - self.playermodel = "models/player/headhunter.zym"; - self.playerskin = "0"; - return "HeadHunter"; - } - else if (r == 8) - { - self.playermodel = "models/player/carni.zym"; - self.playerskin = "0"; - return "Carni"; - } - else if (r == 9) - { - self.playermodel = "models/player/grunt.zym"; - self.playerskin = "0"; - return "Grunt"; - } - else if (r == 10) - { - self.playermodel = "models/player/insurrectionist.zym"; - self.playerskin = "0"; - return "Insurrectionist"; - } - else if (r == 11) - { - self.playermodel = "models/player/jeandarc.zym"; - self.playerskin = "0"; - return "Jeandarc"; - } - else if (r == 12) - { - self.playermodel = "models/player/lycanthrope.zym"; - self.playerskin = "0"; - return "Lycanthrope"; - } - else if (r == 13) - { - self.playermodel = "models/player/pyria.zym"; - self.playerskin = "0"; - return "Pyria"; - } - else if (r == 14) - { - self.playermodel = "models/player/shock.zym"; - self.playerskin = "0"; - return "Shock"; - } - else if (r == 15) - { - self.playermodel = "models/player/marine.zym"; - self.playerskin = "1"; - return "Private"; - } - else if (r == 16) - { - self.playermodel = "models/player/nexus.zym"; - self.playerskin = "1"; - return "Mulder"; - } - else if (r == 17) - { - self.playermodel = "models/player/skadi.zym"; - self.playerskin = "1"; - return "Elite"; - } - else if (r == 18) - { - self.playermodel = "models/player/lurk.zym"; - self.playerskin = "1"; - return "Reptile"; - } - else if (r == 19) - { - self.playermodel = "models/player/crash.zym"; - self.playerskin = "2"; - return "mechanical"; - } - else if (r == 20) - { - self.playermodel = "models/player/crash.zym"; - self.playerskin = "1"; - return "Quark"; - } - else if (r == 21) - { - self.playermodel = "models/player/insurrectionist.zym"; - self.playerskin = "1"; - return "Anarchist"; - } - else if (r == 22) - { - self.playermodel = "models/player/jeandarc.zym"; - self.playerskin = "1"; - return "Heroine"; - } - else if (r == 23) - { - self.playermodel = "models/player/lycanthrope.zym"; - self.playerskin = "1"; - return "Wolf"; - } - else if (r == 24) - { - self.playermodel = "models/player/pyria.zym"; - self.playerskin = "1"; - return "Soldier"; - } - else if (r == 25) - { - self.playermodel = "models/player/rebel.zym"; - self.playerskin = "0"; - return "Rebel"; - } - else - { - self.playermodel = "models/player/crash.zym"; - self.playerskin = "0"; - return "Crash"; - } - -}; -string () PickARandomName = -{ - if (bot_count > 16) - return "player"; - - local float y, test; - local string h; - local entity t; - y = TRUE; - while(y) - { - test = ceil(random() * 16); - h = BotName(test); - t = find(world, netname, h); - if (t == world) - y = FALSE; - } - return h; -}; - - - -// I didn't like the old code so this is very stripped down - -entity b_originator; -float b_topic; -/* FBX Topics - -b_originator == self - 1 - sign on - 2 - killed targ - 3 - team message "friendly eyes" - 4 - team message "on your back" - 5 - team message "need back up" - 6 - excuses - ---- - 7 - gameover - ---- - 8 - welcoming someone onto server - 9 - ridicule lost frag (killed self?) - 10 - ridicule lost frag (lava) - 11 - lag -b_originator == targ - - -*/ -void(float tpic) bot_start_topic = -{ - if (random() < 0.2) - { - b_topic = tpic; - b_originator = self; - } - else - b_topic = 0; -}; - -/* -void() bot_chat = -{ - local float r; - if (b_options & OPT_NOCHAT) - return; - r = ceil (random() * 6); - - if (self.b_chattime > time) - { - if (self.b_skill < 2) - self.keys = self.button0 = self.button2 = 0; - return; - } - else if (self.b_chattime) - { - if (b_topic == 1) - { - if (b_originator == self) - { - if (r == 1) - { - BotSay(": lo all\n"); - bot_start_topic(8); - } - else if (r == 2) - { - BotSay(": hey everyone\n"); - bot_start_topic(8); - } - else if (r == 3) - { - BotSay(": prepare to be fragged!\n"); - bot_start_topic(0); - } - else if (r == 4) - { - BotSay(": boy this is laggy\n"); - bot_start_topic(11); - } - else if (r == 5) - { - BotSay(": #mm getting some lag here\n"); - bot_start_topic(11); - } - else - { - BotSay(": hi everyone\n"); - bot_start_topic(8); - } - } - } - else if (b_topic == 2) - { - if (b_originator == self) - { - if (r == 1) - BotSay(": take that\n"); - else if (r == 2) - BotSay(": yehaww!\n"); - else if (r == 3) - BotSay(": wh00p\n"); - else if (r == 4) - BotSay(": j00_sawk();\n"); - else if (r == 5) - BotSay(": i rule\n"); - else - BotSay(": eat that\n"); - bot_start_topic(0); - } - } - else if (b_topic == 3) - { - if (b_originator == self) - { - if (r < 3) - BotSayTeam(": friendly eyes\n"); - else - BotSayTeam(": team eyes\n"); - bot_start_topic(0); - } - } - else if (b_topic == 4) - { - if (b_originator == self) - { - if (r < 3) - BotSayTeam(": on your back\n"); - else - BotSayTeam(": I'm with you\n"); - bot_start_topic(0); - } - } - else if (b_topic == 5) - { - if (b_originator == self) - { - if (r < 3) - BotSayTeam(": I need help\n"); - else - BotSayTeam(": need backup\n"); - bot_start_topic(0); - } - } - else if (b_topic == 6) - { - if (b_originator == self) - { - if (r == 1) - { - BotSay(": sun got in my eyes\n"); - bot_start_topic(0); - } - else if (r == 2) - { - BotSay(": mouse needs cleaning\n"); - bot_start_topic(0); - } - else if (r == 3) - { - BotSay(": i meant to do that\n"); - bot_start_topic(0); - } - else if (r == 4) - { - BotSay(": lag\n"); - bot_start_topic(11); - } - else if (r == 5) - { - BotSay(": killer lag\n"); - bot_start_topic(11); - } - else - { - BotSay(": 100% lag\n"); - bot_start_topic(11); - } - } - } - else if (b_topic == 7) - { - if (r == 1) - BotSay(": gg\n"); - else if (r == 2) - BotSay(": gg all\n"); - else if (r == 3) - BotSay(": that was fun\n"); - else if (r == 4) - BotSay(": good game\n"); - else if (r == 5) - BotSay(": pah\n"); - else - BotSay(": hrm\n"); - bot_start_topic(0); - } - else if (b_topic == 8) - { - if (b_originator != self) - { - if (r == 1) - { - BotSay(": heya\n"); - bot_start_topic(0); - } - else if (r == 2) - { - BotSay(": welcome\n"); - bot_start_topic(0); - } - else if (r == 3) - { - BotSayInit(); - BotSay2(": hi "); - BotSay2(b_originator.netname); - BotSay2("\n"); - bot_start_topic(0); - } - else if (r == 4) - { - BotSayInit(); - BotSay2(": hey "); - BotSay2(b_originator.netname); - BotSay2("\n"); - bot_start_topic(0); - } - else if (r == 5) - { - BotSay(": howdy\n"); - bot_start_topic(0); - } - else - { - BotSay(": lo\n"); - bot_start_topic(0); - } - } - } - - else if (b_topic == 9) - { - if (b_originator != self) - { - if (r == 1) - BotSay(": hah\n"); - else if (r == 2) - BotSay(": heheh\n"); - else if (r == 3) - { - BotSayInit(); - BotSay2(": good work "); - BotSay2(b_originator.netname); - BotSay2("\n"); - } - else if (r == 4) - { - BotSayInit(); - BotSay2(": nice1 "); - BotSay2(b_originator.netname); - BotSay2("\n"); - } - else if (r == 5) - BotSay(": lol\n"); - else - BotSay(": :)\n"); - b_topic = 6; - } - } - else if (b_topic == 10) - { - if (b_originator != self) - { - if (r == 1) - BotSay(": have a nice dip?\n"); - else if (r == 2) - BotSay(": bah I hate levels with lava\n"); - else if (r == 3) - { - BotSayInit(); - BotSay2(": good job "); - BotSay2(b_originator.netname); - BotSay2("\n"); - } - else if (r == 4) - { - BotSayInit(); - BotSay2(": nice backflip "); - BotSay2(b_originator.netname); - BotSay2("\n"); - } - else if (r == 5) - BotSay(": watch your step\n"); - else - BotSay(": hehe\n"); - b_topic = 6; - } - } - - else if (b_topic == 11) - { - if (b_originator != self) - { - if (r == 1) - { - BotSayInit(); - BotSay2(": yeah right "); - BotSay2(b_originator.netname); - BotSay2("\n"); - bot_start_topic(0); - } - else if (r == 2) - { - BotSay(": ping\n"); - bot_start_topic(0); - } - else if (r == 3) - { - BotSay(": shuddup, you're an lpb\n"); - bot_start_topic(0); - } - else if (r == 4) - { - BotSay(": lag my eye\n"); - bot_start_topic(0); - } - else if (r == 5) - { - BotSay(": yeah\n"); - bot_start_topic(11); - } - else - { - BotSay(": totally\n"); - bot_start_topic(11); - } - } - } - self.b_chattime = 0; - } - else if (b_topic) - { - if (random() < 0.5) - { - if (self == b_originator) - { - if (b_topic <= 7) - self.b_chattime = time + 2; - } - else - { - if (b_topic >= 7) - self.b_chattime = time + 2; - } - } - } -}; -*/ - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Kick A Bot. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() KickABot = -{ - local entity ty; - ty = find(world, classname, "player"); - while (ty != world) - { - if (!(ty.ishuman)) - { - - BotDisconnect(ty); - ty.ishuman = TRUE; - ty = world; - } - else - ty = find(ty, classname, "player"); - } - -}; - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Simplified origin checking. - -God, I wish I had inline - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -vector(entity ent) realorigin = -{ -// even more simplified... - return (ent.absmin + ent.absmax) * 0.5; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -fisible - -a version of visible that checks for corners -of the bounding boxes - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -float (entity targ) fisible = -{ - local vector spot1, org; - local float thruwater, pc1, pc2; - - org = realorigin(targ); - spot1 = self.origin + self.view_ofs; - - if (targ.solid == SOLID_BSP) - { - traceline (spot1, org, TRUE, self); - if (trace_ent == targ) - return TRUE; - else if (trace_fraction == 1) - return TRUE; - return FALSE; - } - else - { - pc1 = pointcontents(org); - pc2 = pointcontents(spot1); - if (targ.classname == "player") - thruwater = FALSE; - else if (pc1 == CONTENT_LAVA) - return FALSE; - else - thruwater = TRUE; - } - - if (pc1 < -1) // targ's origin is in water or other liquid - { - if (pc2 != pc1) - { - // look for their head - traceline (spot1, org + targ.mins, TRUE, self); - // cross the water check - if (trace_inopen) - if (trace_inwater) - if (!thruwater) - return FALSE; - if (trace_ent == targ) - return TRUE; - else if (trace_fraction == 1) - return TRUE; - return FALSE; - } - } - else - { - if (pc2 != pc1) - { - traceline (spot1, org + targ.maxs, TRUE, self); - if (trace_inopen) - if (trace_inwater) - if (!thruwater) - return FALSE; - if (trace_ent == targ) - return TRUE; - else if (trace_fraction == 1) - return TRUE; - return FALSE; - } - } - traceline (spot1, org, TRUE, self); - if (trace_ent == targ) - return TRUE; - else if (trace_fraction == 1) - return TRUE; - traceline (spot1, org + targ.maxs, TRUE, self); - if (trace_ent == targ) - return TRUE; - else if (trace_fraction == 1) - return TRUE; - traceline (spot1, org + targ.mins, TRUE, self); - if (trace_ent == targ) - return TRUE; - else if (trace_fraction == 1) - return TRUE; - return FALSE; -}; - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Wisible - -goes through movable brushes/entities, used -for waypoints - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -// this is used for waypoint stuff.... -float (entity targ1, entity targ2) wisible = -{ - local vector spot1, spot2; - local entity ignore; - - spot1 = targ1.origin; - spot2 = realorigin(targ2); - - ignore = self; - do - { - traceline (spot1, spot2, TRUE, ignore); - spot1 = realorigin(trace_ent); - ignore = trace_ent; - } while ((trace_ent != world) && (trace_fraction != 1)); - if (trace_endpos == spot2) - return TRUE; - else - return FALSE; -}; - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -sisible - -Now this is getting ridiculous. Simple visible, -used when we need just a simple traceline nothing else - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -float (entity targ) sisible = -{ - traceline (self.origin, targ.origin, TRUE, self); - if (trace_ent == targ) - return TRUE; - else if (trace_fraction == 1) - return TRUE; - return FALSE; -}; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -angcomp - -subtracts one angle from another - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -float (float y1, float y2) angcomp = -{ - y1 = frik_anglemod(y1); - y2 = frik_anglemod(y2); - - local float answer; - answer = y1 - y2; - if (answer > 180) - answer = (360 - answer) * -1; - else if (answer < -180) - answer = answer + 360; - return answer; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -fov - -is the entity in the bot's field of view - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -float (entity targ) fov = -{ - local vector yawn; - local float g; - yawn = realorigin(targ); - yawn = (yawn + targ.view_ofs) - (self.origin + self.view_ofs); - yawn = normalize(yawn); - yawn = vectoangles(yawn); - g = angcomp(self.v_angle_x, yawn_x); - if (fabs(g) > 45) - return FALSE; - g = angcomp(self.v_angle_y, yawn_y); - if (fabs(g) > 60) - return FALSE; - - return TRUE; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -frik_anglemod - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ -float(float v) frik_anglemod = -{ - return v - floor(v/360) * 360; -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/bot_move.c b/TeamNexuiz/game/gamec/bot_move.c deleted file mode 100644 index fabba0722..000000000 --- a/TeamNexuiz/game/gamec/bot_move.c +++ /dev/null @@ -1,512 +0,0 @@ -/*********************************************** -* * -* FrikBot Movement AI * -* "The slightly better movement AI" * -* * -***********************************************/ - -/* - -This program is in the Public Domain. My crack legal -team would like to add: - -RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" -AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE -ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR -FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN -NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY -GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, -EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" -SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. - -You accept this software on the condition that you -indemnify and hold harmless Ryan "FrikaC" Smith from -any and all liability or damages to third parties, -including attorney fees, court costs, and other -related costs and expenses, arising out of your use -of this software irrespective of the cause of said -liability. - -The export from the United States or the subsequent -reexport of this software is subject to compliance -with United States export control and munitions -control restrictions. You agree that in the event you -seek to export this software, you assume full -responsibility for obtaining all necessary export -licenses and approvals and for assuring compliance -with applicable reexport restrictions. - -Any reproduction of this software must contain -this notice in its entirety. - -*/ - -void() bot_jump = -{ - // TODO check for precision, etc. - self.button2 = TRUE; -}; - -float(entity e) bot_can_rj = -{ - // this returns true of the bot can rocket/superjump/hook - // if your mod doesn't have an RL you can just return FALSE all the time - // if it has a hook or some other means for the bot to get to high places - // you can check here for that capability - - // am I dumb? - if (e.b_skill == 0) - return FALSE; - - // quad = bad - if (e.items & 4194304) - return FALSE; - - // do I have rockets & RL? - if (!((e.items & 32) && (e.ammo_rockets > 0))) - return FALSE; - - // do I have pent? - if (e.items & 1048576) - return TRUE; - - if (e.health > 50) - return TRUE; - else - return FALSE; -}; - -float(float flag) frik_recognize_plat = -{ - if ((self.classname != "waypoint") && !(self.flags & FL_ONGROUND)) - return FALSE; - traceline(self.origin, self.origin - '0 0 64', TRUE, self); - if (trace_ent != world) - { - if (flag) // afect bot movement too - { - if (self.keys & KEY_MOVEUP) - { - if (trace_ent.velocity_z > 0) - self.keys = self.keys & 960; // 960 is all view keys - } - else if (self.keys & KEY_MOVEDOWN) - { - if (trace_ent.velocity_z < 0) - self.keys = self.keys & 960; - } - } - return TRUE; - } - else - return FALSE; -}; - -float(vector sdir) frik_KeysForDir = -{ - - local vector keydir; - local float outkeys, tang; - outkeys = 0; - if (sdir_x || sdir_y) - { - // Everything is tested against 60 degrees, - // this allows the bot to overlap the keys - // 30 degrees on each diagonal 45 degrees - // might look more realistic - - keydir = vectoangles(sdir); - tang = angcomp(keydir_y, self.v_angle_y); - if ((tang <= 150) && (tang >= 30)) - outkeys = outkeys + KEY_MOVELEFT; - else if ((tang >= -150) && (tang <= -30)) - outkeys = outkeys + KEY_MOVERIGHT; - if (fabs(tang) <= 60) - outkeys = outkeys + KEY_MOVEFORWARD; - else if (fabs(tang) >= 120) - outkeys = outkeys + KEY_MOVEBACK; - } - if (sdir_z > 0.7) - outkeys = outkeys + KEY_MOVEUP; - else if (sdir_z < 0.7) - outkeys = outkeys + KEY_MOVEDOWN; - return outkeys; - -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -frik_obstructed - -Bot has hit a ledge or wall that he should -manuever around. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void(vector whichway, float danger) frik_obstructed = -{ - local float dist; - local vector disway, org; -// TODO: something - if (self.b_aiflags & AI_BLIND) - return; - org = realorigin(self.target1); - - if (danger) - { - self.b_aiflags = self.b_aiflags | AI_DANGER; - self.keys = frik_KeysForDir('0 0 0' - whichway); - } - if (self.b_aiflags & AI_PRECISION) - return; - - - if (self.target1) - { - if (self.b_aiflags & AI_OBSTRUCTED) - { - if (!(self.b_aiflags & AI_DANGER)) - { - self.b_aiflags = self.b_aiflags - AI_OBSTRUCTED; - return; - } - else if (!danger) - return; - } - self.obs_dir = whichway; - disway_x = whichway_y * -1; - disway_y = whichway_x; - dist = vlen(org - (self.origin + disway)); - disway_x = whichway_y; - disway_y = whichway_x * -1; - self.wallhug = vlen(org - (self.origin + disway)) > dist; - self.b_aiflags = self.b_aiflags | AI_OBSTRUCTED; - - } - else - { - disway_x = whichway_y * -1; - disway_y = whichway_x; - dist = vlen(disway - self.obs_dir); - disway_x = whichway_y; - disway_y = whichway_x * -1; - self.wallhug = vlen(disway - self.obs_dir) < dist; - self.obs_dir = whichway; - - self.b_aiflags = self.b_aiflags | AI_OBSTRUCTED; - } -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -frik_obstacles - -Detects small bumps the bot needs to jump over -or ledges the bot should avoid falling in. - -Also responsible for jumping gaps. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() frik_obstacles = -{ - local vector start, stop, ang; - local float test, conts, dist, hgt; - - if (!(self.flags & FL_ONGROUND)) - return; - if (self.b_aiflags & AI_BLIND) - return; - - ang = normalize(self.velocity); - ang_z = 0; - start = self.origin + ang * 32; // ahem - start_z = self.origin_z + self.maxs_z; - stop = start; - stop_z = self.origin_z + self.mins_z; - traceline(start, stop - '0 0 256', TRUE, self); - if (trace_allsolid || trace_startsolid) - return; - hgt = trace_endpos_z - stop_z; - - if (hgt > 18) - { - bot_jump(); - return; - } - if (hgt >= 0) - return; - - conts = pointcontents(trace_endpos + '0 0 4'); - start = stop - '0 0 8'; - stop = start + ang * 256; - traceline(start, stop, TRUE, self); - test = vlen(trace_endpos - start); - if (test <= 20) - return; // it's a walkable gap, do nothing - ang_x = self.velocity_y * -1; - ang_y = self.velocity_x; - ang = normalize(ang); - traceline(start - (ang * 10), start + (ang * 10), TRUE, self); - if ((trace_fraction != 1) || trace_startsolid) - return; // gap is only 20 wide, walkable - ang = self.velocity; - ang_z = 0; - dist = ((540 / sv_gravity) * vlen(ang))/* + 32*/; - if (test > dist) // I can't make it - { - if (conts < -3) // bad stuff down dare - { - frik_obstructed(ang, TRUE); - return; - } - else - { - if (self.target1) - { - stop = realorigin(self.target1); - if ((stop_z - self.origin_z) < -32) - return; // safe to fall - } - frik_obstructed(ang, FALSE); - return; - } - } - else - { - ang = normalize(ang); - //look for a ledge - traceline(self.origin, self.origin + (ang * (test + 20)), TRUE, self); - if (trace_fraction != 1) - { - if (conts < -3) // bad stuff down dare - { - frik_obstructed(ang, TRUE); - return; - } - else - { - if (self.target1) - { - stop = realorigin(self.target1); - if ((stop_z - self.origin_z) < -32) - return; // safe to fall - } - frik_obstructed(ang, FALSE); - return; - } - } - - if (self.target1) - { - // getting furter away from my target? - test = vlen(self.target1.origin - (ang + self.origin)); - if (test > vlen(self.target1.origin - self.origin)) - { - if (conts < -3) // bad stuff down dare - { - frik_obstructed(ang, TRUE); - return; - } - else - { - frik_obstructed(ang, FALSE); - return; - } - } - } - } - if (hgt < -18) - { - if (self.target1) - { - stop = realorigin(self.target1); - if ((stop_z - self.origin_z) < -32) - return; // safe to fall - } - bot_jump(); - } - // go for it - -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -After frik_obstructed, the bot uses the -following funtion to move "around" the obstacle - -I have no idea how well it will work - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() frik_dodge_obstruction = -{ - local vector way, org; - local float oflags, yaw; - - if (!(self.b_aiflags & AI_OBSTRUCTED)) - return; - if ((self.b_aiflags & (AI_BLIND | AI_PRECISION)) || !(self.flags & FL_ONGROUND)) - { - self.b_aiflags = self.b_aiflags - AI_OBSTRUCTED; - return; - } - - // perform a walkmove check to see if the obs_dir is still obstructed - // walkmove is less forgiving than frik_obstacles, so I dunno - // how well this will work - - oflags = self.flags; - org = self.origin; - - yaw = vectoyaw(self.obs_dir); - if (walkmove(yaw, 32)) - self.b_aiflags = self.b_aiflags - AI_OBSTRUCTED; - else - { - if (self.b_aiflags & AI_DANGER) - { - way = '0 0 0' - self.obs_dir; - } - else if (self.wallhug) - { - way_x = self.obs_dir_y * -1; - way_y = self.obs_dir_x; - } - else - { - way_x = self.obs_dir_y; - way_y = self.obs_dir_x * -1; - } - self.keys = self.keys & 960 + frik_KeysForDir(way); - } - - // fix the bot - - self.origin = org; - self.flags = oflags; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -movetogoal and walkmove replacements - -blah - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() frik_movetogoal = -{ - local vector way; - local float g; - - if (self.target1 == world) - { - makevectors(self.v_angle); - frik_walkmove(v_forward); - return; - } - way = realorigin(self.target1) - self.origin; - if (vlen(way) < 25) - { - self.keys = self.keys & 960; - return; - } - - way = normalize(way); - self.keys = self.keys & 960 + frik_KeysForDir(way); - - frik_dodge_obstruction(); - frik_recognize_plat(TRUE); - - if (self.b_aiflags & AI_PRECISION) - { - g = angcomp(self.v_angle_x, self.b_angle_x); - if (fabs(g) > 10) - self.keys = self.keys & 960; - g = angcomp(self.v_angle_y, self.b_angle_y); - if (fabs(g) > 10) - self.keys = self.keys & 960; - } -}; - -float(vector weird) frik_walkmove = -{ - // okay so it's not walkmove - // sue me - self.keys = self.keys & 960 + frik_KeysForDir(weird); - - frik_dodge_obstruction(); - frik_recognize_plat(TRUE); - if (self.b_aiflags & AI_OBSTRUCTED) - return FALSE; - else - return TRUE; -}; - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -The "hook" method of navigation. This nav -system is copyrighted 1999 by Ryan "Frika C" -Smith, keep that in mind when you steal it. - -I brought this back because normal roaming -won't work - the bot gets distracted by it's -own waypoints. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() frik_bot_roam = -{ - local vector org, ang, org1; - local float loopcount, flag, dist; - - loopcount = 26; - flag = FALSE; - while((loopcount > 0) && !flag) - { - loopcount = loopcount - 1; - org = self.origin + self.view_ofs; - ang = self.angles; - ang_y = frik_anglemod(ang_y - 90 + (random() * 180)); - ang_x = 0; // avoid upward sloping - makevectors(ang); - traceline(org, org + v_forward * 2300, TRUE, self); - if (trace_fraction != 1) - { - org1 = trace_endpos; - ang = normalize(trace_plane_normal); - ang_z = 0; // avoid upward sloping - traceline(org1, org1 + (ang * 2300), TRUE, self); - if ((trace_fraction != 1) && (vlen(trace_endpos - org1) >= 64)) - { - org = trace_endpos; - traceline(org, self.origin + self.view_ofs, TRUE, self); - if (trace_fraction != 1) - { - dist = vlen(org1 - org) /2; - org = org1 + (ang * dist); - traceline(org, org - '0 0 48', TRUE, self); - if (trace_fraction != 1) - { - SpawnTempWaypoint(org); - flag = TRUE; - } - } - } - } - } - self.b_angle_y = self.v_angle_y + 10; -}; diff --git a/TeamNexuiz/game/gamec/bot_phys.c b/TeamNexuiz/game/gamec/bot_phys.c deleted file mode 100644 index 5b72de0c0..000000000 --- a/TeamNexuiz/game/gamec/bot_phys.c +++ /dev/null @@ -1,666 +0,0 @@ -/*********************************************** -* * -* FrikBot Physics * -* The near-perfect emulation of * -* Client movement * -* * -* Special Thanks to: Asdf, Frog * -* Alan "Strider" Kivlin * -* * -* * -***********************************************/ - -/* - -This program is in the Public Domain. My crack legal -team would like to add: - -RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" -AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE -ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR -FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN -NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY -GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, -EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" -SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. - -You accept this software on the condition that you -indemnify and hold harmless Ryan "FrikaC" Smith from -any and all liability or damages to third parties, -including attorney fees, court costs, and other -related costs and expenses, arising out of your use -of this software irrespective of the cause of said -liability. - -The export from the United States or the subsequent -reexport of this software is subject to compliance -with United States export control and munitions -control restrictions. You agree that in the event you -seek to export this software, you assume full -responsibility for obtaining all necessary export -licenses and approvals and for assuring compliance -with applicable reexport restrictions. - -Any reproduction of this software must contain -this notice in its entirety. - -*/ - -/* -========================================= - -Stuff mimicking cl_input.c code - -========================================= -*/ -float(float key) CL_KeyState = -{ - return ((self.keys & key) > 0); -}; - -void() CL_KeyMove = // CL_BaseMove + CL_AdjustAngles -{ - local float anglespeed; - local vector view; - if (self.keys != self.oldkeys) - { - self.movement = '0 0 0'; - self.movement_y = self.movement_y + (350 * CL_KeyState(KEY_MOVERIGHT)); - // 350 is the default cl_sidespeed - self.movement_y = self.movement_y - (350 * CL_KeyState(KEY_MOVELEFT)); - // 350 is the default cl_sidespeed - self.movement_x = self.movement_x + (200 * CL_KeyState(KEY_MOVEFORWARD)); - // 200 is the default cl_forwardspeed - self.movement_x = self.movement_x - (200 * CL_KeyState(KEY_MOVEBACK)); - // 200 is the default cl_backspeed - self.movement_z = self.movement_z + (200 * CL_KeyState(KEY_MOVEUP)); - // 200 is the default cl_upspeed - self.movement_z = self.movement_z - (200 * CL_KeyState(KEY_MOVEDOWN)); - // 200 is the default cl_upspeed - if (!self.b_aiflags & AI_PRECISION) - self.movement = self.movement * 2; - // 2 is the default cl_movespeedkey & bot always has +speed - } - self.oldkeys = self.keys; - - if (self.b_skill != 2) // use mouse emulation - { - anglespeed = 1.5 * real_frametime; - // 1.5 is the default cl_anglespeedkey & bot always has +speed - self.v_angle_y = self.v_angle_y + anglespeed * CL_KeyState(KEY_LOOKLEFT) * 140; - // 140 is default cl_yawspeed - self.v_angle_y = self.v_angle_y - anglespeed * CL_KeyState(KEY_LOOKRIGHT) * 140; - // 140 is default cl_yawspeed - self.v_angle_x = self.v_angle_x - anglespeed * CL_KeyState(KEY_LOOKUP) * 150; - // 150 is default cl_pitchspeed - self.v_angle_x = self.v_angle_x + anglespeed * CL_KeyState(KEY_LOOKDOWN) * 150; - // 150 is default cl_pitchspeed - } - else - { - view_x = angcomp(self.b_angle_x, self.v_angle_x); - view_y = angcomp(self.b_angle_y, self.v_angle_y); - if (vlen(view) > 30) - { - self.mouse_emu = self.mouse_emu + (view * 30); - if (vlen(self.mouse_emu) > 180) - self.mouse_emu = normalize(self.mouse_emu) * 180; - } - else - self.mouse_emu = view * (1 / real_frametime); - self.v_angle = self.v_angle + self.mouse_emu * real_frametime; - - - } - if (self.v_angle_x > 80) - self.v_angle_x = 80; - else if (self.v_angle_x < -70) - self.v_angle_x = -70; - - if (self.v_angle_z > 50) - self.v_angle_z = 50; - else if (self.v_angle_z < -50) - self.v_angle_z = -50; - self.v_angle_y = frik_anglemod(self.v_angle_y); - -}; - -/* -========================================= - -Stuff mimicking sv_user.c - -========================================= -*/ -void() SV_UserFriction = -{ - local vector vel; - local float sped, friction, newspeed; - - vel = self.velocity; - vel_z =0; - sped = vlen(vel); - vel = self.velocity; - - if (!sped) - return; - - friction = sv_friction; - if (sped < sv_stopspeed) - newspeed = sped - real_frametime * sv_stopspeed * friction; - else - newspeed = sped - real_frametime * sped * friction; - - if (newspeed < 0) - newspeed = 0; - newspeed = newspeed / sped; - - self.velocity_y = vel_y * newspeed; - self.velocity_x = vel_x * newspeed; -}; -void() SV_WaterJump = -{ - if (time > self.teleport_time || !self.waterlevel) - { - self.flags = self.flags - (self.flags & FL_WATERJUMP); - self.teleport_time = 0; - } - self.velocity_x = self.movedir_x; - self.velocity_y = self.movedir_y; -}; - -void() DropPunchAngle = -{ - local float len; - len = vlen(self.punchangle); - self.punchangle = normalize(self.punchangle); - len = len - 10 * real_frametime; - if (len < 0) - len = 0; - self.punchangle = self.punchangle * len; -}; - - -void(vector wishvel) SV_AirAccelerate = -{ - local float addspeed, wishspd, accelspeed, currentspeed; - - wishspd = vlen(wishvel); - wishvel = normalize(wishvel); - if (wishspd > 30) - wishspd = 30; - currentspeed = self.velocity * wishvel; - addspeed = wishspd - currentspeed; - if (addspeed <= 0) - return; - accelspeed = 10 * sv_accelerate * wishspd * real_frametime; - if (accelspeed > addspeed) - accelspeed = addspeed; - - self.velocity = self.velocity + accelspeed * wishvel; -}; - -void(vector wishvel) SV_Accelerate = -{ - local float addspeed, wishspd, accelspeed, currentspeed; - - wishspd = vlen(wishvel); - wishvel = normalize(wishvel); - - currentspeed = self.velocity * wishvel; - addspeed = wishspd - currentspeed; - if (addspeed <= 0) - return; - accelspeed = sv_accelerate * wishspd * real_frametime; - if (accelspeed > addspeed) - accelspeed = addspeed; - - self.velocity = self.velocity + accelspeed * wishvel; -}; -void() SV_WaterMove = -{ - local vector wishvel; - local float wishspeed, addspeed, cspeed, newspeed; - makevectors(self.v_angle); - wishvel = v_right * self.movement_y + v_forward * self.movement_x; - - if (self.movement == '0 0 0') - wishvel_z = wishvel_z - 60; - else - wishvel_z = wishvel_z + self.movement_z; - wishspeed = vlen(wishvel); - - if (wishspeed > sv_maxspeed) - { - wishvel = (sv_maxspeed / wishspeed) * wishvel; - wishspeed = sv_maxspeed; - } - wishspeed = wishspeed * 0.7; - cspeed = vlen(self.velocity); - if (cspeed) - { - newspeed = cspeed - (real_frametime * cspeed * sv_friction); - if (newspeed < 0) - newspeed = 0; - self.velocity = self.velocity * (newspeed / cspeed); - - } - else - newspeed = 0; - - if (!wishspeed) - return; - addspeed = wishspeed - newspeed; - if (addspeed <= 0) - return; - wishvel = normalize(wishvel); - cspeed = sv_accelerate * wishspeed * real_frametime; - if (cspeed > addspeed) - cspeed = addspeed; - self.velocity = self.velocity + cspeed * wishvel; -}; -void() SV_AirMove = -{ - local vector wishvel, vangle; - - vangle = self.v_angle; - vangle_x = vangle_z = 0; - makevectors(vangle); - if (time < self.teleport_time && (self.movement_x < 0)) - self.movement_x = 0; - wishvel = v_right * self.movement_y + v_forward * self.movement_x; - - - if (self.movetype != MOVETYPE_WALK) - wishvel_z = self.movement_z; - else - wishvel_z = 0; - if (vlen(wishvel) > sv_maxspeed) - wishvel = normalize(wishvel) * sv_maxspeed; - if (self.movetype == MOVETYPE_NOCLIP) - self.velocity = wishvel; - else if (self.flags & FL_ONGROUND) - { - SV_UserFriction(); - SV_Accelerate(wishvel); - } - else - SV_AirAccelerate (wishvel); -}; - -void() SV_ClientThink = -{ - local vector vangle; - - if (self.movetype == MOVETYPE_NONE) - return; - DropPunchAngle(); - if (self.health <= 0) - return; - self.v_angle_z = 0; // V_CalcRoll removed, sucks - self.angles_z = self.v_angle_z * 4; - vangle = self.v_angle + self.punchangle; - if (!self.fixangle) - { - self.angles_x = (vangle_x / -3); - self.angles_y = vangle_y; - } else - { - self.v_angle = self.angles; - self.fixangle = 0; - } - if (self.flags & FL_WATERJUMP) - { - SV_WaterJump(); - return; - } - if ((self.waterlevel >= 2) && (self.movetype != MOVETYPE_NOCLIP)) - { - SV_WaterMove(); - return; - } - SV_AirMove(); - -}; -/* -========================================= - -Stuff mimicking sv_phys.c - -========================================= -*/ - -float() SV_RunThink = -{ - local float thinktime, bkuptime; - thinktime = self.nextthink; - bkuptime = time; - if (thinktime <= 0 || thinktime > (time + real_frametime)) - return TRUE; - if (thinktime < time) - thinktime = time; - self.nextthink = 0; - time = thinktime; - other = world; - makevectors(self.v_angle); // hack - self.think(); - time = bkuptime; - return TRUE; -}; - -void(float scal) SV_AddGravity = -{ - self.velocity_z = self.velocity_z - (scal * sv_gravity * real_frametime); -}; - -float() SV_CheckWater = -{ - local vector point; - local float cont; - - point_x = self.origin_x; - point_y = self.origin_y; - self.waterlevel = 0; - self.watertype = CONTENT_EMPTY; - point_z = self.origin_z + self.mins_z + 1; - cont = pointcontents(point); - if (cont <= CONTENT_WATER) - { - self.watertype = cont; - self.waterlevel = 1; - point_z = self.origin_z + (self.mins_z + self.maxs_z) * 0.5; - cont = pointcontents(point); - if (cont <= CONTENT_WATER) - { - self.waterlevel = 2; - point_z = self.origin_z + self.view_ofs_z; - cont = pointcontents(point); - if (cont <= CONTENT_WATER) - self.waterlevel = 3; - } - } - return (self.waterlevel > 1); - -}; -void() RemoveThud = // well sometimes -{ - local entity oself; - if (other == world) - { - if (self.flags & FL_ONGROUND) - { - self.flags = self.flags - FL_ONGROUND; - } - } - else - { - if (other.solid == SOLID_BSP && (self.flags & FL_ONGROUND)) - { - // RM: Does this break anything? - // If not, then some more thuds have been removed. - self.flags = self.flags - FL_ONGROUND; - } - if (other == self.owner) - return; - if (self.owner.solid == SOLID_NOT) - return; - oself = other; - other = self.owner; - self = oself; - if (self.solid == SOLID_BSP) - if (self.touch) - self.touch(); - } - -}; -void() SV_CheckOnGround = -{ - local vector org, v; - org = self.origin; - local float currentflags; - currentflags = self.flags; - self.flags = self.flags | FL_ONGROUND | FL_PARTIALGROUND; - walkmove(0,0); // perform C touch function - self.flags = currentflags | FL_ONGROUND; - if ((org_x != self.origin_x) || (org_y != self.origin_y)) - org = self.origin; - else - self.origin = org; - v = org; - v_z = self.maxs_z + org_z + 1; - traceline (org, v, TRUE, self); - if ((self.waterlevel == 3) && (self.movetype == MOVETYPE_WALK)) - self.flags = self.flags - FL_ONGROUND; - else if ((trace_plane_normal_z <= 0.7) && (trace_fraction != 1)) - self.flags = self.flags - FL_ONGROUND; - else if (!droptofloor(0,0)) - self.flags = self.flags - FL_ONGROUND; - else if (org_z - self.origin_z < 2) - self.flags = self.flags | FL_ONGROUND; - else - self.flags = self.flags - FL_ONGROUND; - setorigin(self, org); -}; -// Thanks to Alan Kivlin for this function -// modified heavily by me -float(vector dir) botCheckForStep = -{ - local vector currentorigin, v; - local float currentflags, yaw, stepdistance, movedistance; - currentorigin = self.origin; - currentflags = self.flags; - self.flags = FL_ONGROUND | FL_PARTIALGROUND; - dir = normalize(dir); - dir_z = 0; - yaw = vectoyaw(dir); - if(walkmove(yaw, 3)) - { - if(droptofloor(0,0)) - { - stepdistance = self.origin_z - currentorigin_z; - v = self.origin - currentorigin; - v_z = 0; - movedistance = vlen(v); - if((stepdistance > 0 && stepdistance <= 16) && movedistance != 0) - { - self.flags = currentflags | FL_PARTIALGROUND; - return 1; - } - } - } - self.flags = currentflags; - setorigin(self, currentorigin); - return 0; -}; -// this is merely here to fix a problem with e3m5 -void(vector dir) BruteForceStep = -{ - local vector currentorigin; - local float currentflags, i, len; - - currentorigin = self.origin; - currentflags = self.flags; - len = vlen(dir); - if (len > 16) - dir = normalize(dir) * 16; - - setorigin(self, currentorigin + dir); - - while(i < 18 && !walkmove(0, 0)) - { - self.origin_z = currentorigin_z + i; - i = i + 2; - } - self.flags = currentflags; - if (i >=18) - setorigin(self, currentorigin); -}; - -void() PostPhysics = -{ - local vector obstr, org; - local float back, dst,cflags; - - self = self.owner; - - self.velocity = self.velocity - self.phys_obj.dest1 + self.phys_obj.velocity; - if (self.phys_obj.dest2 == self.origin) - { - setorigin(self, self.phys_obj.origin); - // might've been moved during other person's physics - // (teleporters / plats) - - if (self.movetype == MOVETYPE_WALK) - { - - if (self.phys_obj.dest1_x || self.phys_obj.dest1_y) - { - if ((self.flags & FL_ONGROUND) || (self.waterlevel <= 2)) - { - obstr = self.phys_obj.movedir - self.origin; - obstr_z = 0; - if (vlen(obstr) > 0.1) - { - dst = vlen(obstr); - back = vectoyaw(obstr); - cflags = self.flags; - self.flags = self.flags | FL_PARTIALGROUND; - if(walkmove(back, dst)) - { - self.flags = cflags; - self.phys_obj.dest1_z = 0; - self.velocity = self.velocity + self.phys_obj.dest1 - self.phys_obj.velocity; - } - else - { - if (dst > 1) - frik_obstructed(obstr, FALSE); - - org = self.origin; - self.flags = cflags; - obstr = self.phys_obj.dest1; - obstr_x = 0; - if (!botCheckForStep(obstr)) - { - obstr = self.phys_obj.dest1; - obstr_y = 0; - if (!botCheckForStep(obstr)) - { - // if no steps were found, bot is really obstucted - BruteForceStep(self.phys_obj.dest1); - } - } - } - } - } - } - } - } - - SV_CheckOnGround(); - - PlayerPostThink(); - BotAI(); - self.dmg_take = self.dmg_save = 0; - -}; -// Avoid calling BotAI and the physics at the same time -// Can trip the runaway loop counter - -void() SV_FlyMove = -{ - // This is nothing like the Quake function. - - if (self.phys_obj == world) - { - self.phys_obj = find(world,classname,"phys_obj"); - while (self.phys_obj.owner != self) - { - self.phys_obj = find(self.phys_obj,classname,"phys_obj"); - if (self.phys_obj == world) - { - error("No physics entity spawned!\nMake sure BotInit was called\n"); - } - } - } - - setmodel (self.phys_obj, string_null); - self.phys_obj.movetype = MOVETYPE_STEP; - - self.phys_obj.solid = SOLID_TRIGGER; - self.phys_obj.touch = RemoveThud; - setsize(self.phys_obj, self.mins, self.maxs); - self.phys_obj.dest2 = self.phys_obj.origin = self.origin; - self.phys_obj.watertype = 0; - self.phys_obj.movedir = self.origin + real_frametime * self.velocity; - self.phys_obj.dest1 = self.phys_obj.velocity = self.velocity; - self.phys_obj.velocity_z = self.phys_obj.velocity_z + sv_gravity * real_frametime; - self.phys_obj.flags = 0; - self.phys_obj.think = PostPhysics; - self.phys_obj.nextthink = time; -}; - - -void() SV_Physics_Toss = -{ - if (!SV_RunThink()) - return; - if (self.flags & FL_ONGROUND) - { - self.velocity = '0 0 0'; - BotAI(); - return; - } - if (self.movetype != MOVETYPE_FLY) - SV_AddGravity(1); - self.angles = self.angles + real_frametime * self.avelocity; - SV_FlyMove(); - -}; -void() SV_Physics_Client = -{ - - PlayerPreThink(); - - if (self.movetype == MOVETYPE_NONE) - { - if (!SV_RunThink()) - return; - PlayerPostThink(); - BotAI(); - - } - else if ((self.movetype == MOVETYPE_WALK) || (self.movetype == MOVETYPE_STEP)) - { - if (!SV_RunThink()) - return; - if (!(SV_CheckWater()) && (!(self.flags & FL_WATERJUMP))) - SV_AddGravity(1); - SV_FlyMove(); - } - else if ((self.movetype == MOVETYPE_TOSS) || (self.movetype == MOVETYPE_BOUNCE)) - { - SV_Physics_Toss(); - } - else if (self.movetype == MOVETYPE_FLY) - { - if (!SV_RunThink()) - return; - SV_FlyMove(); - } - else if (self.movetype == MOVETYPE_NOCLIP) - { - if (!SV_RunThink()) - return; - self.origin = self.origin + real_frametime * self.velocity; - - PlayerPostThink(); - BotAI(); - } - else - error ("SV_Physics_Client: Bad Movetype (BOT)"); - -}; - - diff --git a/TeamNexuiz/game/gamec/bot_way.c b/TeamNexuiz/game/gamec/bot_way.c deleted file mode 100644 index fb0641549..000000000 --- a/TeamNexuiz/game/gamec/bot_way.c +++ /dev/null @@ -1,1001 +0,0 @@ - /*********************************************** -* * -* FrikBot Waypoints * -* "The better than roaming AI" * -* * -***********************************************/ - -/* - -This program is in the Public Domain. My crack legal -team would like to add: - -RYAN "FRIKAC" SMITH IS PROVIDING THIS SOFTWARE "AS IS" -AND MAKES NO WARRANTY, EXPRESS OR IMPLIED, AS TO THE -ACCURACY, CAPABILITY, EFFICIENCY, MERCHANTABILITY, OR -FUNCTIONING OF THIS SOFTWARE AND/OR DOCUMENTATION. IN -NO EVENT WILL RYAN "FRIKAC" SMITH BE LIABLE FOR ANY -GENERAL, CONSEQUENTIAL, INDIRECT, INCIDENTAL, -EXEMPLARY, OR SPECIAL DAMAGES, EVEN IF RYAN "FRIKAC" -SMITH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES, IRRESPECTIVE OF THE CAUSE OF SUCH DAMAGES. - -You accept this software on the condition that you -indemnify and hold harmless Ryan "FrikaC" Smith from -any and all liability or damages to third parties, -including attorney fees, court costs, and other -related costs and expenses, arising out of your use -of this software irrespective of the cause of said -liability. - -The export from the United States or the subsequent -reexport of this software is subject to compliance -with United States export control and munitions -control restrictions. You agree that in the event you -seek to export this software, you assume full -responsibility for obtaining all necessary export -licenses and approvals and for assuring compliance -with applicable reexport restrictions. - -Any reproduction of this software must contain -this notice in its entirety. - -*/ - - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Waypoint Linking code - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - - -float (entity e1, entity e2) CheckLinked = -{ - if ((e1 == e2) || (e2 == world) || (e1 == world)) - return FALSE; - else if (e1.target1 == e2) - { - if (e1.b_aiflags & AI_TELELINK_1) - return 2; - else return TRUE; - } - else if (e1.target2 == e2) - { - if (e1.b_aiflags & AI_TELELINK_2) - return 2; - else return TRUE; - } - else if (e1.target3 == e2) - { - if (e1.b_aiflags & AI_TELELINK_3) - return 2; - else return TRUE; - } - else if (e1.target4 == e2) - { - if (e1.b_aiflags & AI_TELELINK_4) - return 2; - else return TRUE; - } - - else return FALSE; -}; - - -float (entity e1, entity e2) LinkWays = -{ - if ((e1 == e2) || (e2 == world) || (e1 == world)) - return FALSE; - else if (CheckLinked(e1, e2)) - return FALSE; // already linked!!! - - if (e1.target1 == world) - { - e1.target1 = e2; - return TRUE; - } - else if (e1.target2 == world) - { - e1.target2 = e2; - return TRUE; - } - else if (e1.target3 == world) - { - e1.target3 = e2; - return TRUE; - } - else if (e1.target4 == world) - { - e1.target4 = e2; - return TRUE; - } - else return FALSE; - -}; -// Link Ways part 2, used only for teleporters - -float (entity e1, entity e2) TeleLinkWays = -{ - if ((e1 == e2) || (e2 == world) || (e1 == world)) - return FALSE; - else if (CheckLinked(e1, e2)) - return FALSE; // already linked!!! - - if (e1.target1 == world) - { - e1.target1 = e2; - e1.b_aiflags = e1.b_aiflags | AI_TELELINK_1; - return TRUE; - } - else if (e1.target2 == world) - { - e1.target2 = e2; - e1.b_aiflags = e1.b_aiflags | AI_TELELINK_2; - return TRUE; - } - else if (e1.target3 == world) - { - e1.target3 = e2; - e1.b_aiflags = e1.b_aiflags | AI_TELELINK_3; - return TRUE; - } - else if (e1.target4 == world) - { - e1.target4 = e2; - e1.b_aiflags = e1.b_aiflags | AI_TELELINK_4; - return TRUE; - } - else - return FALSE; - -}; - -void (entity e1, entity e2) UnlinkWays = -{ - if ((e1 == e2) || (e2 == world) || (e1 == world)) - return; - else if (!CheckLinked(e1, e2)) - return; - - if (e1.target1 == e2) - { - e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_1); - e1.target1 = world; - } - if (e1.target2 == e2) - { - e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_2); - e1.target2 = world; - } - if (e1.target3 == e2) - { - e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_3); - e1.target3 = world; - } - if (e1.target4 == e2) - { - e1.b_aiflags = e1.b_aiflags - (e1.b_aiflags & AI_TELELINK_4); - e1.target4 = world; - } - -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -FindWaypoint - -This is used quite a bit, by many different -functions big lag causer - -Finds the closest, fisible, waypoint to e - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -entity(entity start) FindWayPoint = -{ - local entity t; - local vector org; - local float dst, tdst; - local entity best; - - org = realorigin(self); - - t = way_head; - if (start != world) - { - dst = vlen(start.origin - org); - best = start; - } - else - { - dst = 100000; - best = world; - } - while(t) - { - // real players cut through ignore types - if (dst < 20) - return best; - if (!(t.b_aiflags & AI_IGNORE_TYPES) || self.ishuman) - { - tdst = vlen(t.origin - org); - if (tdst < dst) - { - if (sisible(t)) - { - dst = tdst; - best = t; - } - } - } - t = t._next; - } - return best; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Waypoint Spawning Code - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -entity way_foot; // Ugh. Do I need a foot for this or not? - -entity(vector org) make_waypoint = -{ - local entity point; - point = spawn(); - point.classname = "waypoint"; - point.search_time = time; // don't double back for me; - point.solid = SOLID_TRIGGER; - point.movetype = MOVETYPE_NONE; - point.items = -1; - setorigin(point, org); - - setsize(point, PL_MIN, PL_MAX); - waypoints = waypoints + 1; - if (!way_head) - { - way_head = point; - way_foot = point; - } - else - { - way_foot._next = point; - point._last = way_foot; - way_foot = point; - } - - point.count = waypoints; - if (waypoint_mode > WM_LOADED) // editor modes - setmodel(point, "progs/s_bubble.spr"); // file missing from nexuiz - return point; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Dynamic Waypoint spawning and linking. Not -very good all things considered. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() DynamicWaypoint = -{ - local entity t; - local float dist, dynlink, dynpoint, editor; - - if (self.teleport_time > self.portal_time) - { - if (!self.flags & FL_WATERJUMP) - { - self.dyn_flags = 2; - if (!self.ishuman) - { - bot_lost(self.target1, TRUE); - self.enemy = world; - } - } - self.portal_time = self.teleport_time; - } -// stacking everything on waypoint_mode might've been good for the editor, -// but it sucks to beat hell for this code. - - -// convert waypoint_mode to something more usable.. - if (waypoint_mode > WM_LOADED) - { - if (self.ishuman) - { - if (waypoint_mode == WM_EDITOR_DYNLINK) - dynlink = 1; - else if (waypoint_mode == WM_EDITOR_DYNAMIC) - dynlink = dynpoint = 1; - editor = 1; - } - } - else if (waypoint_mode == WM_DYNAMIC) - dynlink = dynpoint = 1; - -// if there's nothing for dynamic to do.. - if (!dynpoint) - { - if (!editor) - return; - } -// for speed sake, I won't have bots dynamic waypoint in coop - if (!self.ishuman) - if (coop) - return; - -// don't waypoint in single player - if (max_clients < 2) - return; -// if you're dead - else if (self.health <= 0) - { - if (dynpoint) - { - if (self.current_way) - { - if (pointcontents(self.origin) < -4) - { - if (self.current_way.b_aiflags & AI_BLIND) - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_PRECISION; - else - self.current_way.b_aiflags = self.current_way.b_aiflags | AI_BLIND; - } - } - } - self.dyn_dest = '0 0 0'; - self.current_way = world; - self.dyn_flags = 0; - return; - } - -// you shouldn't be making waypoints mid air - if (dynpoint) - { - if (!((self.flags & FL_ONGROUND) || self.waterlevel == 3)) - { - if (self.dyn_flags != 2) - { - self.dyn_flags = 1; - } - return; - } - } -// keep from doing the rest of this every frame - if (self.dyn_time > time) - return; - self.dyn_time = time + 0.2; - -// display the links for editor mode - if (editor) - { - if (self.current_way) - { - if (self.current_way.target1) - DeveloperLightning(self.current_way, self.current_way.target1, self.current_way.b_aiflags & AI_TELELINK_1); - if (self.current_way.target2) - DeveloperLightning(self.current_way, self.current_way.target2, self.current_way.b_aiflags & AI_TELELINK_2); - if (self.current_way.target3) - DeveloperLightning(self.current_way, self.current_way.target3, self.current_way.b_aiflags & AI_TELELINK_3); - if (self.current_way.target4) - DeveloperLightning(self.current_way, self.current_way.target4, self.current_way.b_aiflags & AI_TELELINK_4); - } - if (self.b_aiflags & AI_HOLD_SELECT) - return; - } - - t = FindWayPoint(self.current_way); - if (t) - { - dist = vlen(self.origin - t.origin); - if (dist < 192) - { - if (dist < 64) - { - - if (t != self.current_way) - { - if (dynlink) - { - if (!self.dyn_flags) - { - if (wisible(t, self.current_way)) - LinkWays(t, self.current_way); - } - if (self.dyn_flags == 2) - TeleLinkWays(self.current_way, t); - else if (wisible(t, self.current_way)) - LinkWays(self.current_way, t); - } - if (editor) - { - setmodel(t, "progs/s_light.spr"); // file missing from nexuiz - if (self.current_way) - setmodel(self.current_way, "progs/s_bubble.spr"); // file missing from nexuiz - } - } - self.current_way = t; - self.dyn_flags = 0; - } - self.dyn_dest = self.origin + self.view_ofs; - return; - } - } - - if (frik_recognize_plat(FALSE)) - { - if (vlen(trace_ent.velocity) > 0) - { - if (self.dyn_plat) - return; - self.dyn_plat = TRUE; - if (!self.dyn_flags) - self.dyn_flags = 1; - //bprint("on a plat!!!!!\n"); - } - else - self.dyn_plat = FALSE; - } - else - self.dyn_plat = FALSE; - - if (self.dyn_flags == 2) - self.dyn_dest = self.origin + self.view_ofs; - else if (self.dyn_dest == '0 0 0') - self.dyn_dest = self.origin + self.view_ofs; - if (!dynpoint) - return; - t = make_waypoint(self.dyn_dest); - - if (!self.dyn_flags) - { - if (wisible(t, self.current_way)) - LinkWays(t, self.current_way); - } - if (self.dyn_flags == 2) - TeleLinkWays(self.current_way, t); - else if (wisible(t, self.current_way)) - LinkWays(self.current_way, t); - - if (editor) - { - setmodel(t, "progs/s_light.spr"); // file missing from nexuiz - if (self.current_way) - setmodel(self.current_way, "progs/s_bubble.spr"); // file missing from nexuiz - } - self.current_way = t; - self.dyn_flags = 0; - - self.dyn_dest = self.origin + self.view_ofs; - - if (frik_recognize_plat(FALSE)) - { - if (trace_ent.classname == "door") - t.b_aiflags = t.b_aiflags | AI_DOORFLAG; - } -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Waypoint Loading from file - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() ClearAllWays = -{ - - local entity t, n; - t = way_head; - while(t) - { - n = t._next; - remove(t); - t = n; - } - way_head = world; - way_foot = world; - waypoints = 0; -}; - -entity(float num) WaypointForNum = -{ - local entity t; - if (!num) - return world; - - t = way_head; - while (t) - { - if (t.count == num) - return t; - t = t._next; - } - return world; -}; - -void() FixThisWaypoint = -{ - self.enemy.target1 = WaypointForNum(self.enemy.b_pants); - self.enemy.target2 = WaypointForNum(self.enemy.b_skill); - self.enemy.target3 = WaypointForNum(self.enemy.b_shirt); - self.enemy.target4 = WaypointForNum(self.enemy.b_frags); - self.enemy = self.enemy._next; - self.nextthink = time; - if (self.enemy == world) - { - remove(self); - fixer = world; - } -}; - -void() FixWaypoints = -{ - if (!fixer) - fixer = spawn(); - fixer.nextthink = time; - fixer.think = FixThisWaypoint; - fixer.enemy = way_head; -}; - - - -void(entity what) delete_waypoint = -{ - local entity t; - - if (way_head == what) - way_head = what._next; - if (way_foot == what) - way_foot = what._last; - if (what._last) - what._last._next = what._next; - if (what._next) - what._next._last = what._last; - waypoints = 0; - t = way_head; - while(t) - { - t.count = waypoints = waypoints + 1; - if (CheckLinked(t, what)) - UnlinkWays(t, what); - t = t._next; - } - if (self.current_way == what) - self.current_way = world; - remove(what); -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -FindRoute & FindThing used by the pathing code -in bot_ai.qc - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - - -entity(string s) FindThing = -{ - local entity t; - local float tdst, dst; - local entity best; - dst = 100000; - best = world; - t = find (world, classname, s); - while (t != world) - { - tdst = vlen(((t.absmin + t.absmax) * 0.5) - self.origin); - if (tdst < dst) - { - dst = tdst; - best = t; - } - t = find(t, classname, s); - } - return best; -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -FindRoute, this is a key function in the -pathing. The name is a bit misleading, this -code finds the closest waypoint that is part -of a route calculated by the begin_route and -end_route routines This is a definite path to -an object. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -entity(entity lastone) FindRoute = -{ - // kinda like FindWaypoint, only of this bots route though - local entity t, best; - local float dst, tdst, flag; - flag = ClientBitFlag(self.b_clientno); - t = way_head; - dst = 100000; - best = world; - while(t) - { - tdst = vlen(t.origin - self.origin); - if ((tdst < dst) && (t.b_sound & flag)) - { - if ((lastone == world) || (CheckLinked(lastone, t))) - { - dst = tdst; - best = t; - } - } - t = t._next; - } - return best; -}; -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Route & path table management - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() ClearRouteTable = -{ - // cleans up route table - - local entity t; - t = way_head; - while (t) - { - t. keys = FALSE; - t.enemy = world; - t.items = -1; // not in table - t = t._next; - } -}; - -void() ClearMyRoute = -{ - local float flag; - local entity t; - - flag = ClientBitFlag(self.b_clientno); - - t = way_head; - while (t) - { - t.b_sound = t.b_sound - (t.b_sound & flag); - t = t._next; - } -}; - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Mark_path - -After the route has been found, mark it with -bitflags so the table can be used for a -different bot. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - - -void(entity this) mark_path = -{ - local entity t, oself; - local float flag; - - ClearMyRoute(); - - oself = self; - self = this; - t = FindWayPoint(this.current_way); - self = oself; - // FIXME - // ugh, better way to find players please!!! - if (this.classname != "player") - this.current_way = t; - - if (t.enemy == world) - { - bot_lost(this, FALSE); - if (waypoint_mode == WM_DYNAMIC) - self.route_failed = TRUE; - return; - } - - flag = ClientBitFlag(self.b_clientno); - - while(t) - { - if (t.b_sound & flag) - return; - if (t == self.last_way) - return; - t.b_sound = t.b_sound | flag; - t = t.enemy; - } -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -WaypointThink - -Calculates the routes. We use thinks to avoid -tripping the runaway loop counter - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void(entity e2, float b_bit) FollowLink = -{ - local float dist; - - if (self.b_aiflags & b_bit) - dist = self.items; - else - dist = vlen(self.origin - e2.origin) + self.items; - - // check if this is an RJ link - if (e2.b_aiflags & AI_SUPER_JUMP) - { - if (!bot_can_rj(route_table)) - return; - } - if (e2.b_aiflags & AI_DIFFICULT) - dist = dist + 1000; - - dist = dist + random() * 100; // add a little chaos - - if ((dist < e2.items) || (e2.items == -1)) - { - if (!e2.keys) - busy_waypoints = busy_waypoints + 1; - e2.keys = TRUE; - e2.items = dist; - e2.think = WaypointThink; - e2.nextthink = time; - e2.enemy = self; - } -}; - -void() WaypointThink = -{ - local entity oself; - - if (self.items == -1) - return; - // can you say ugly? - if (self.b_aiflags & AI_TRACE_TEST) - { - if (self.target1) - { - traceline(self.origin, self.target1.origin, TRUE, self); - if (trace_fraction == 1) - FollowLink(self.target1, AI_TELELINK_1); - } - if (self.target2) - { - traceline(self.origin, self.target2.origin, TRUE, self); - if (trace_fraction == 1) - FollowLink(self.target2, AI_TELELINK_2); - } - if (self.target3) - { - traceline(self.origin, self.target3.origin, TRUE, self); - if (trace_fraction == 1) - FollowLink(self.target3, AI_TELELINK_3); - } - if (self.target4) - { - traceline(self.origin, self.target4.origin, TRUE, self); - if (trace_fraction == 1) - FollowLink(self.target4, AI_TELELINK_4); - } - } - else - { - if (self.target1) - FollowLink(self.target1, AI_TELELINK_1); - if (self.target2) - FollowLink(self.target2, AI_TELELINK_2); - if (self.target3) - FollowLink(self.target3, AI_TELELINK_3); - if (self.target4) - FollowLink(self.target4, AI_TELELINK_4); - } - - busy_waypoints = busy_waypoints - 1; - self.keys = FALSE; - - if (busy_waypoints <= 0) - { - if (direct_route) - { - oself = self; - self = route_table; - bot_get_path(self.target1, FALSE); - self = oself; - direct_route = FALSE; - } - } -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -begin_route and bot_get_path - -PLEASE NOTE: bot_get_path replaces the old -calls to begin_route. - -Routing isn't done all at once now, but in two -stages, the bot will calc a route *THEN* -choose a target, *THEN* mark a path. - -Boy it's confusing. - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -float() begin_route = -{ - if (busy_waypoints > 0) - return FALSE; - - if (route_table != world) - { - if (!route_table.ishuman) - { - if (route_table.b_clientno != -1) - return FALSE; - } - } - - route_table = self; - ClearRouteTable(); - self.last_way = FindWayPoint(self.current_way); - - if (self.last_way != world) - { - self.last_way.items = vlen(self.last_way.origin - self.origin); - self.last_way.nextthink = time; - self.last_way.think = WaypointThink; - self.last_way.keys = TRUE; - busy_waypoints = 1; - return TRUE; - } - else - { - route_table = world; - busy_waypoints = 0; - return FALSE; - } -}; - -void(entity this, float direct) bot_get_path = -{ - if (this == world) - return; - - if (route_table == self) - { - if (busy_waypoints <= 0) - { - route_table = world; - mark_path(this); - } - return; - } - if (direct) - { - if(begin_route()) - direct_route = TRUE; - else - bot_lost(this, FALSE); - return; - } -}; - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -BSP/QC Waypoint loading - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void() waypoint = -{ - self.search_time = time; - self.solid = SOLID_TRIGGER; - self.movetype = MOVETYPE_NONE; - setorigin(self, self.origin); - - setsize(self, PL_MIN, PL_MAX); - waypoints = waypoints + 1; - if (!way_head) - { - way_head = self; - way_foot = self; - } - else - { - way_foot._next = self; - self._last = way_foot; - way_foot = self; - } - - self.count = waypoints; - waypoint_mode = WM_LOADED; - if (self.count == 1) - { - self.think = FixWaypoints; // wait until all bsp loaded points are spawned - self.nextthink = time; - } -}; - -void(vector org, vector bit1, float bit4, float flargs) make_way = -{ - local entity y; - waypoint_mode = WM_LOADED; - y = make_waypoint(org); - y.b_aiflags = flargs; - y.b_pants = bit1_x; - y.b_skill = bit1_y; - y.b_shirt = bit1_z; - y.b_frags = bit4; - if (y.count == 1) - { - y.think = FixWaypoints; // wait until all qc loaded points are spawned - y.nextthink = time; - } -}; - - -/* --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= - -Temporary Marker code - --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -*/ - -void(vector org) SpawnTempWaypoint = -{ - local entity tep; - - if (!self.temp_way) - self.temp_way = tep = spawn(); - else - tep = self.temp_way; - - tep.classname = "temp_waypoint"; - tep.search_time = 0; - tep.solid = SOLID_TRIGGER; - tep.movetype = MOVETYPE_NOCLIP; - setorigin(tep, org); - target_add(tep); - setsize(tep, PL_MIN, PL_MAX); // FIXME: convert these to numerical -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/builtins.h b/TeamNexuiz/game/gamec/builtins.h deleted file mode 100644 index b32e40888..000000000 --- a/TeamNexuiz/game/gamec/builtins.h +++ /dev/null @@ -1,76 +0,0 @@ - -void makevectors (vector ang) = #1; -void setorigin (entity e, vector o) = #2; -void setmodel (entity e, string m) = #3; -void setsize (entity e, vector min, vector max) = #4; - -void crash (void) = #6; -float random (void) = #7; -void(entity e, float chan, string samp, float vol, float atten) sound = #8; -vector normalize (vector v) = #9; -void error (string e) = #10; -void objerror (string e) = #11; -float vlen (vector v) = #12; -float vectoyaw (vector v) = #13; -entity spawn (void) = #14; -//entity spawn_real (void) = #14; -// spawn redirect function -//entity spawn (); -void remove (entity e) = #15; -void traceline (vector v1, vector v2, float nomonst, entity forent) = #16; -entity checkclient (void) = #17; -entity find (entity start, .string fld, string match) = #18; -string precache_sound (string s) = #19; -string precache_model (string s) = #20; -void(entity client, string s)stuffcmd = #21; -entity findradius (vector org, float rad) = #22; -void bprint (string s, ...) = #23; -void(entity client, string s) sprint = #24; -void dprint (string s, ...) = #25; -string ftos (float f) = #26; -string vtos (vector v) = #27; -void coredump (void) = #28; -void traceon (void) = #29; -void traceoff (void) = #30; -void eprint (entity e) = #31; -float walkmove (float yaw, float dist) = #32; - -float droptofloor (float yaw, float dist) = #34; -void lightstyle (float style, string value) = #35; -float rint (float v) = #36; -float floor (float v) = #37; -float ceil (float v) = #38; - -float checkbottom (entity e) = #40; -float pointcontents (vector v) = #41; - -float fabs (float f) = #43; -vector(entity e, float speed) aim = #44; -float cvar (string s) = #45; -void localcmd (string s) = #46; -entity nextent (entity e) = #47; -void particle (vector v, vector d, float colour, float count) = #48; -void ChangeYaw (void) = #49; - -vector vectoangles (vector v) = #51; -//void(float to, float f) WriteByte = #52; -//void(float to, float f) WriteCoord = #56; -void(float to, float f) WriteByte = #52; -void(float to, float f) WriteChar = #53; -void(float to, float f) WriteShort = #54; -void(float to, float f) WriteLong = #55; -void(float to, float f) WriteCoord = #56; -void(float to, float f) WriteAngle = #57; -void(float to, string s) WriteString = #58; -void(float to, entity s) WriteEntity = #59; -void movetogoal (float step) = #67; -string precache_file (string s) = #68; -void makestatic (entity e) = #69; -void changelevel (string s) = #70; - -void cvar_set (string var, string val) = #72; -void(entity client, string s) centerprint = #73; -void ambientsound (vector pos, string samp, float vol, float atten) = #74; -string precache_model2 (string s) = #75; -string precache_sound2 (string s) = #76; -string precache_file2 (string s) = #77; diff --git a/TeamNexuiz/game/gamec/cl_client.c b/TeamNexuiz/game/gamec/cl_client.c deleted file mode 100644 index a28887cf8..000000000 --- a/TeamNexuiz/game/gamec/cl_client.c +++ /dev/null @@ -1,1232 +0,0 @@ -void info_player_start (void) -{ - if (self.allowteams != "") - { - if (self.allowteams == "blue") - self.team_no = 1; - if (self.allowteams == "red") - self.team_no = 2; - if (!self.goal_state) - self.goal_state = 1; - if (!self.group_no) - self.group_no = 1; - i_p_t(); - return; - } - else - { - self.classname = "info_player_deathmatch"; - } -}; - -void info_player_deathmatch (void) -{ -} -/* -=============== - Find Team Spawn Point (NexTF!) - =============== -*/ -entity (float team_num) FindTeamSpawnPoint = -{ - local entity spot; - local entity at_spot; - local float spot_found; - local float attempts; - - if ((team_num == 1)) - { - spot = lastspawn_team1; - attempts = 0; - while (1) - { - attempts = (attempts + 1); - spot = find (spot, team_str_home, "ts1"); - if ((spot == world)) - { - spot = find (world, team_str_home, "ts1"); - } - if ((spot == world)) - { - return (world); - } - at_spot = findradius (spot.origin, 40); - spot_found = 1; - while ((at_spot != world)) - { - if (((at_spot.classname == "player") && (at_spot.deadflag == 0))) - { - spot_found = 0; - } - at_spot = at_spot.chain; - } - if (!Activated (spot, self)) - { - spot_found = 0; - } - if ((spot_found || (attempts >= 30))) - { - lastspawn_team1 = spot; - return (spot); - } - } - } - else - { - if ((team_num == 2)) - { - spot = lastspawn_team2; - attempts = 0; - while (1) - { - attempts = (attempts + 1); - spot = find (spot, team_str_home, "ts2"); - if ((spot == world)) - { - spot = find (world, team_str_home, "ts2"); - } - if ((spot == world)) - { - return (world); - } - at_spot = findradius (spot.origin, 40); - spot_found = 1; - while ((at_spot != world)) - { - if (((at_spot.classname == "player") && (at_spot.deadflag == 0))) - { - spot_found = 0; - } - at_spot = at_spot.chain; - } - if (!Activated (spot, self)) - { - spot_found = 0; - } - if ((spot_found || (attempts >= 30))) - { - lastspawn_team2 = spot; - return (spot); - } - } - } - else - { - if ((team_num == 3)) - { - spot = lastspawn_team3; - attempts = 0; - while (1) - { - attempts = (attempts + 1); - spot = find (spot, team_str_home, "ts3"); - if ((spot == world)) - { - spot = find (world, team_str_home, "ts3"); - } - if ((spot == world)) - { - return (world); - } - at_spot = findradius (spot.origin, 40); - spot_found = 1; - while ((at_spot != world)) - { - if (((at_spot.classname == "player") && (at_spot.deadflag == 0))) - { - spot_found = 0; - } - at_spot = at_spot.chain; - } - if (!Activated (spot, self)) - { - spot_found = 0; - } - if ((spot_found || (attempts >= 30))) - { - lastspawn_team3 = spot; - return (spot); - } - } - } - else - { - if ((team_num == 4)) - { - spot = lastspawn_team4; - attempts = 0; - while (1) - { - attempts = (attempts + 1); - spot = find (spot, team_str_home, "ts4"); - if ((spot == world)) - { - spot = find (world, team_str_home, "ts4"); - } - if ((spot == world)) - { - return (world); - } - at_spot = findradius (spot.origin, 40); - spot_found = 1; - while ((at_spot != world)) - { - if (((at_spot.classname == "player") && (at_spot.deadflag == 0))) - { - spot_found = 0; - } - at_spot = at_spot.chain; - } - if (!Activated (spot, self)) - { - spot_found = 0; - } - if ((spot_found || (attempts >= 30))) - { - lastspawn_team4 = spot; - return (spot); - } - } - } - } - } - } - return (world); -}; - -/* -============= -SelectSpawnPoint - -Finds a point to respawn -============= -*/ -entity () SelectSpawnPoint = -{ - local entity spot; - local entity at_spot; - local float spot_found; - local float attempts; - - if (self.team_no < 1) - { -// self.origin_z = self.origin_z + 30; - stuffcmd(self, "alias menu_showteamselect \"set scmenu_directmenu TeamSelect; togglemenu\"\n"); - stuffcmd(self, "set scmenu_directmenu TeamSelect; togglemenu\n"); - -// spot = find (world, classname, "item_tfgoal"); -// return (spot); - } - self.is_dead = 0; //TEMP - - if ((self.team_no != 0)) - { - spot = FindTeamSpawnPoint (self.team_no); - if ((spot != world)) - { - return (spot); - } - } - if (coop) - { - lastspawn = find (lastspawn, classname, "info_player_coop"); - if ((lastspawn == world)) - { - lastspawn = find (world, classname, "info_player_coop"); - } - if ((lastspawn != world)) - { - return (lastspawn); - } - } - else - { - if (deathmatch) - { - spot = find (lastspawn, classname, "info_player_deathmatch"); - if ((spot == world)) - { - spot = find (world, classname, "info_player_deathmatch"); - } - attempts = 0; - while (((spot != world) && (attempts < 100))) - { - attempts = (attempts + 1); - at_spot = findradius (spot.origin, 40); - spot_found = 1; - while (at_spot) - { - if (((at_spot.classname == "player") && (at_spot.deadflag == 0))) - { - spot_found = 0; - } - at_spot = at_spot.chain; - } - if ((spot_found || (attempts >= 10))) - { - lastspawn = spot; - return (spot); - } - spot = find (spot, classname, "info_player_deathmatch"); - if ((spot == world)) - { - spot = find (world, classname, "info_player_deathmatch"); - } - } - } - } - if (serverflags) - { - spot = find (world, classname, "info_player_start2"); - if (spot) - { - return (spot); - } - } - spot = find (world, classname, "info_player_start"); - if (!spot) - { - spot = find (world, is_converted_goal, "yes"); - } - if (!spot) - { - spot = find (world, classname, "info_tfgoal"); - } - if (!spot) - { - error ("PutClientInServer: no info_player_start on level\n"); - } - return (spot); -}; - -/*entity SelectSpawnPoint (void) // Old, non-tf code -{ - local entity spot, thing; - local float pcount; - - spot = find (world, classname, "testplayerstart"); - if (spot) - return spot; - - spot = lastspawn; - while (1) - { - spot = find(spot, classname, "info_player_deathmatch"); - if (spot != world) - { - if (spot == lastspawn) - return lastspawn; - pcount = 0; - thing = findradius(spot.origin, 70); - while(thing) - { - if (thing.classname == "player") - pcount = pcount + 1; - thing = thing.chain; - } - if (pcount == 0) - { - lastspawn = spot; - return spot; - } - } - } - - spot = find (world, classname, "info_player_start"); - if (!spot) - error ("PutClientInServer: no info_player_start on level"); - - return spot; -}*/ - -/* -============= -CheckPlayerModel - -Checks if the argument string can be a valid playermodel. -Returns a valid one in doubt. -============= -*/ -string CheckPlayerModel(string playermodel) { - if( substring(playermodel,0,13) != "models/class/") playermodel = "models/class/scout.zym"; - - /* Possible Fixme: Check if server can open the model? - This would kill custom models, however. */ - - return playermodel; -} - - -/* -============= -PutClientInServer - -Called when a client spawns in the server -============= -*/ -void PutClientInServer (void) -{ - entity spot; - float oldcl; - if (self.team_no < 1) - { - self.movetype = 0; - self.solid = 0; - self.flags = FL_CLIENT; - self.takedamage = DAMAGE_AIM; - self.effects = 0; - self.health = cvar("g_balance_health_start"); - self.max_health = cvar("g_balance_health_stable"); - self.armorvalue = cvar("g_balance_armor_start"); - self.max_armor = self.armorvalue; - self.damageforcescale = 2; - self.death_time = 0; - self.dead_time = 0; - self.dead_frame = 0; - self.die_frame = 0; - self.alpha = 0; - self.scale = 0; - self.fade_time = 0; - self.pain_frame = 0; - self.pain_finished = 0; - self.strength_finished = 0; - self.invincible_finished = 0; - //self.speed_finished = 0; - //self.slowmo_finished = 0; - // players have no think function - self.think = SUB_Null; - self.nextthink = 0; - self.speed = -1; - self.jump_pad = 0; - spot = SelectSpawnPoint(); -// setorigin (self, spot.origin + '0 0 1' * (1 - self.mins_z + 24)); - setorigin (self, spot.origin + '-2 0 4' * (1 - self.mins_z + 24)); - self.angles_y = self.angles_y + 180; - return; - } - // fixme: are these the right teams & colors? - /*if(self.team == 5) // Wazat -- I'm using TeamFortress_TeamSet for this now - { - self.team_no = 1; - } - if(self.team == 14) - { - self.team_no = 2; - } - if(self.team == 4) - { - self.team_no = 3; - } - if(self.team == 13) - { - self.team_no = 4; - }*/ - - DoTFAliases (); - -// spot = SelectSpawnPoint (); // moved down - self.classname = "player"; - self.movetype = MOVETYPE_WALK; - self.solid = SOLID_SLIDEBOX; - self.flags = FL_CLIENT; - self.takedamage = DAMAGE_AIM; - self.effects = 0; - self.health = cvar("g_balance_health_start"); - self.max_health = cvar("g_balance_health_stable"); - self.armorvalue = cvar("g_balance_armor_start"); - self.max_armor = self.armorvalue; - self.damageforcescale = 2; - self.death_time = 0; - self.dead_time = 0; - self.dead_frame = 0; - self.die_frame = 0; - self.alpha = 0; - self.scale = 0; - self.fade_time = 0; - self.pain_frame = 0; - self.pain_finished = 0; - self.strength_finished = 0; - self.invincible_finished = 0; - //self.speed_finished = 0; - //self.slowmo_finished = 0; - // players have no think function - self.think = SUB_Null; - self.nextthink = 0; - self.speed = -1; - self.jump_pad = 0; - //self.wpn5 = 0; // not carrying an extra weapon - ResetExtraWeapon(); // not carrying an extra weapon - - DelayHealthRegen(self); - DelayArmorRegen(self); - DelayHealthRot(self); - DelayArmorRot(self); - - - self.special_active = 0; - self.special_time = 0; - - self.grenade_time = 0; - - if(self.onfire != world) - remove(self.onfire); - self.onfire = world; - self.flame_heat = 0; - self.flame_heat_time = 0; - - self.poison_damage = 0; - self.poison_rate = 0; - - // if the player is supposed to change model (and hence class) on respawn, do it. - if(self.change_mdl_on_respawn != "") - { - self.playermodel = self.change_mdl_on_respawn; - //strunzone(self.change_mdl_on_respawn); // can't unzone or it'll crash later - } - // set the class. If he changed classes while dead it will take effect now. - oldcl = self.class; - self.class = GetPlayerClass(); - ChangeClass((oldcl != self.class), FALSE); - - - - self.deadflag = DEAD_NO; - - spot = SelectSpawnPoint (); // maybe temp - self.angles = spot.angles; - self.fixangle = TRUE; // turn this way immediately - self.velocity = '0 0 0'; - self.avelocity = '0 0 0'; - self.punchangle = '0 0 0'; - self.punchvector = '0 0 0'; - - self.viewzoom = 0.6; - - - self.playermodel = CheckPlayerModel(self.playermodel); - - precache_model (self.playermodel); - setmodel (self, self.playermodel); - self.skin = stof(self.playerskin); - self.mdl = strzone(self.playermodel); - - self.crouch = FALSE; - self.view_ofs = PL_VIEW_OFS; - setsize (self, PL_MIN, PL_MAX); - setorigin (self, spot.origin + '0 0 1' * (1 - self.mins_z - 24)); - // don't reset back to last position, even if new position is stuck in solid - self.oldorigin = self.origin; - -// self.items = IT_LASER | IT_UZI| IT_SHOTGUN | IT_GRENADE_LAUNCHER | IT_ELECTRO | IT_CRYLINK | IT_NEX | IT_HAGAR | IT_ROCKET_LAUNCHER; -// self.weapon = IT_UZI; - - - // fixme: move this to Become code -/* self.items = IT_WEP1 | IT_WEP2 | IT_WEP3 | IT_WEP4; - //self.weapon = 1; - self.switchweapon = IT_WEP2; - self.ammo_shells = 50; - self.ammo_nails = 0; - self.ammo_rockets = 0; - self.ammo_cells = 0;*/ - - if (cvar("g_fullbrightplayers") == 1) - self.effects = EF_FULLBRIGHT; - - self.event_damage = PlayerDamage; - - self.statdraintime = time + 5; - self.button0 = self.button1 = self.button2 = self.button3 = 0; - - /* - W_UpdateWeapon(); - W_UpdateAmmo(); - */ - CL_SpawnWeaponentity(); - self.weaponentity.alpha = self.exteriorweaponentity.alpha = 0; - self.weaponentity.colormod = '0 0 0'; - self.weaponentity.scale = 0; - - //stuffcmd(self, "chase_active 0"); -} - -/* -============= -SetNewParms -============= -*/ -void SetNewParms (void) -{ - -} - -/* -============= -SetChangeParms -============= -*/ -void SetChangeParms (void) -{ - -} - -/* -============= -ClientKill - -Called when a client types 'kill' in the console -============= -*/ -void ClientKill (void) -{ - Damage(self, self, self, 100000, DEATH_KILL, self.origin, '0 0 0'); -} - -/* -============= -ClientConnect - -Called when a client connects to the server -============= -*/ -void ClientConnect (void) -{ - //ClientInRankings(); - bprint ("^4",self.netname); - bprint (" connected\n"); - stuffcmd(self, strcat("exec maps/", mapname, ".cfg\n")); - // send prediction settings to the client - stuffcmd(self, strcat("cl_movement_maxspeed ", ftos(cvar("sv_maxspeed")), "\n")); - stuffcmd(self, strcat("cl_movement_maxairspeed ", ftos(cvar("sv_maxairspeed")), "\n")); - stuffcmd(self, strcat("cl_movement_accelerate ", ftos(cvar("sv_accelerate")), "\n")); - stuffcmd(self, strcat("cl_movement_friction ", ftos(cvar("sv_friction")), "\n")); - stuffcmd(self, strcat("cl_movement_stopspeed ", ftos(cvar("sv_stopspeed")), "\n")); - stuffcmd(self, strcat("cl_movement_jumpvelocity ", ftos(cvar("g_balance_jumpheight")), "\n")); - stuffcmd(self, strcat("cl_movement_stepheight ", ftos(cvar("sv_stepheight")), "\n")); - stuffcmd(self, strcat("cl_movement_edgefriction 0\n")); - // TEMP FOR TESTING PURPOSES! - //teamplay = 21?TeamFortress; - DecodeLevelParms (); - //cvar_set ("teamplay", "21?TeamFortress"); - // teamplay = cvar ("teamplay"); - -/* joinorder = joinorder + 1; // old temp autoteam, but now we have a menu instead :P - if (joinorder == 1 || joinorder == 3 || joinorder == 5 || joinorder == 7) - TeamFortress_TeamSet (1); - else { - TeamFortress_TeamSet (2); - }*/ -} - -/* -============= -ClientDisconnect - -Called when a client disconnects from the server -============= -*/ -void ClientDisconnect (void) -{ - //ClientDisconnected(); - self.has_disconnected = 1; - bprint ("^4",self.netname); - bprint (" disconnected\n"); -} - -.entity chatbubbleentity; -.float buttonchat; -void() ChatBubbleThink = -{ - self.nextthink = time; - if (!self.owner.modelindex || self.owner.chatbubbleentity != self) - { - remove(self); - return; - } - setorigin(self, self.owner.origin + '0 0 15' + self.owner.maxs_z * '0 0 1'); - if (self.owner.buttonchat) - self.effects = 0; - else - self.effects = EF_NODRAW; -}; - -void() UpdateChatBubble = -{ - if (!self.modelindex) - return; - // spawn a chatbubble entity if needed - if (!self.chatbubbleentity) - { - self.chatbubbleentity = spawn(); - self.chatbubbleentity.owner = self; - self.chatbubbleentity.think = ChatBubbleThink; - self.chatbubbleentity.nextthink = time; - setmodel(self.chatbubbleentity, "models/misc/chatbubble.spr"); - setorigin(self.chatbubbleentity, self.origin + '0 0 15' + self.maxs_z * '0 0 1'); - self.chatbubbleentity.effects = EF_NODRAW; - } -} - -// LordHavoc: this hack will be removed when proper _pants/_shirt layers are -// added to the model skins -void() UpdateColorModHack = -{ - local float c; - c = self.clientcolors & 15; - // LordHavoc: only bothering to support white, green, red, yellow, blue - if (teamplay == 0) self.colormod = '0 0 0'; - else if (c == 0) self.colormod = '1.00 1.00 1.00'; - else if (c == 3) self.colormod = '0.10 1.73 0.10'; - else if (c == 4) self.colormod = '1.73 0.10 0.10'; - else if (c == 12) self.colormod = '1.22 1.22 0.10'; - else if (c == 13) self.colormod = '0.10 0.10 1.73'; - else self.colormod = '1 1 1'; -}; - -/* -============= -PlayerJump - -When you press the jump key -============= -*/ -void PlayerJump (void) -{ - if (self.waterlevel >= 2) - { - if (self.watertype == CONTENT_WATER) - self.velocity_z = 200; - else if (self.watertype == CONTENT_SLIME) - self.velocity_z = 80; - else - self.velocity_z = 50; - - return; - } - if(self.jump_pad) - return; - -// self.jump_pad = 0; - CapPlayerVelocity(self, self.speed); - - - if (!(self.flags & FL_ONGROUND)) - return; - - if (!(self.flags & FL_JUMPRELEASED)) - return; - - self.velocity_z = self.velocity_z + cvar("g_balance_jumpheight"); - - self.flags = self.flags - FL_ONGROUND; - self.flags = self.flags - FL_JUMPRELEASED; -} - -.float watersound_finished; -void() WaterMove = -{ - if (self.movetype == MOVETYPE_NOCLIP) - return; - if (self.health < 0) - return; - - if (self.waterlevel != 3) - { - self.air_finished = time + 12; - self.dmg = 2; - } - else if (self.air_finished < time) - { // drown! - if (self.pain_finished < time) - { - Damage (self, world, world, 5, DEATH_DROWN, self.origin, '0 0 0'); - self.pain_finished = time + 0.5; - } - } - - if (!self.waterlevel) - { - if (self.flags & FL_INWATER) - { - // play leave water sound - self.flags = self.flags - FL_INWATER; - } - return; - } - - if (self.watersound_finished < time) - { - self.watersound_finished = time + 0.5; - if (self.watertype == CONTENT_LAVA) - sound (self, CHAN_BODY, "player/lava.wav", 1, ATTN_NORM); - if (self.watertype == CONTENT_SLIME) - sound (self, CHAN_BODY, "player/slime.wav", 1, ATTN_NORM); - //if (self.watertype == CONTENT_WATER) - // sound (self, CHAN_BODY, "player/water.wav", 1, ATTN_NORM); - } - - if (self.watertype == CONTENT_LAVA) - { // do damage - - // lava sets me to the maximum heat level, so I'll catch fire easily - self.flame_heat = cvar("g_balance_maxheat"); - - if (self.dmgtime < time) - { - self.dmgtime = time + 0.1; - Damage (self, world, world, 3 * self.waterlevel, DEATH_LAVA, self.origin, '0 0 0'); - } - } - else if (self.watertype == CONTENT_SLIME) - { // do damage - - // cool me off - self.flame_heat = 0; - - if (self.dmgtime < time) - { - self.dmgtime = time + 0.1; - Damage (self, world, world, 1 * self.waterlevel, DEATH_SLIME, self.origin, '0 0 0'); - } - } - else if (self.watertype == CONTENT_WATER) - { - // cool me off - self.flame_heat = 0; - } - - if ( !(self.flags & FL_INWATER) ) - { - - //if (self.watertype == CONTENT_LAVA) - // sound (self, CHAN_BODY, "player/inlava.wav", 1, ATTN_NORM); - //if (self.watertype == CONTENT_WATER) - // sound (self, CHAN_BODY, "player/inh2o.wav", 1, ATTN_NORM); - //if (self.watertype == CONTENT_SLIME) - // sound (self, CHAN_BODY, "player/slimbrn2.wav", 1, ATTN_NORM); - - self.flags = self.flags + FL_INWATER; - self.dmgtime = 0; - } -}; - -void() CheckWaterJump = -{ - local vector start, end; - -// check for a jump-out-of-water - makevectors (self.angles); - start = self.origin; - start_z = start_z + 8; - v_forward_z = 0; - normalize(v_forward); - end = start + v_forward*24; - traceline (start, end, TRUE, self); - if (trace_fraction < 1) - { // solid at waist - start_z = start_z + self.maxs_z - 8; - end = start + v_forward*24; - self.movedir = trace_plane_normal * -50; - traceline (start, end, TRUE, self); - if (trace_fraction == 1) - { // open at eye level - self.flags = self.flags | FL_WATERJUMP; - self.velocity_z = 225; - self.flags = self.flags - (self.flags & FL_JUMPRELEASED); - self.teleport_time = time + 2; // safety net - return; - } - } -}; - - -void respawn(void) -{ - CopyBody(1); - PutClientInServer(); -} - -void player_powerups (void) -{ - self.effects = self.effects - (self.effects & (EF_RED | EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT)); - if (self.items & IT_STRENGTH) - { - self.effects = self.effects | (EF_BLUE | EF_ADDITIVE | EF_FULLBRIGHT); - if (time > self.strength_finished) - { - self.items = self.items - (self.items & IT_STRENGTH); - sprint(self, "^3Strength has worn off\n"); - } - } - else - { - if (time < self.strength_finished) - { - self.items = self.items | IT_STRENGTH; - sprint(self, "^3Strength infuses your weapons with devestating power\n"); - } - } - if (self.items & IT_INVINCIBLE) - { - self.effects = self.effects | (EF_RED | EF_ADDITIVE | EF_FULLBRIGHT); - if (time > self.invincible_finished) - { - self.items = self.items - (self.items & IT_INVINCIBLE); - sprint(self, "^3Shield has worn off\n"); - } - } - else - { - if (time < self.invincible_finished) - { - self.items = self.items | IT_INVINCIBLE; - sprint(self, "^3Shield surrounds you\n"); - } - } -} - -void player_regen_health (float maxh, float regen_rate_mod) -{ - if (self.health < maxh && time > self.health_regen_delay) - self.health = bound(0, self.health + regen_rate_mod*(maxh- self.health) * cvar("g_balance_health_regen") * frametime, 1000); -} -void player_rot_health (float maxh, float rot_rate_mod) -{ - if (self.health > maxh && time > self.health_rot_delay) - self.health = bound(0, self.health + rot_rate_mod*(maxh - self.health) * cvar("g_balance_health_rot") * frametime, 1000); -} -void player_regen_armor (float maxa, float regen_rate_mod) -{ - if (self.armorvalue < maxa && time > self.armor_regen_delay) - self.armorvalue = bound(0, self.armorvalue + regen_rate_mod*(maxa - self.armorvalue) * cvar("g_balance_armor_regen") * frametime, 1000); -} -void player_rot_armor (float maxa, float regen_rot_mod) -{ - if (self.armorvalue > maxa && time > self.armor_rot_delay) - self.armorvalue = bound(0, self.armorvalue + regen_rot_mod*(maxa - self.armorvalue) * cvar("g_balance_armor_rot") * frametime, 1000); -} - -void player_clearpoison(entity targ) -{ - targ.poison_damage = targ.poison_rate = 0; -} - -void DelayHealthRegen(entity e) { e.health_regen_delay = time + cvar("g_balance_regen_wait");} -void DelayHealthRot(entity e) { e.health_rot_delay = time + cvar("g_balance_rot_wait");} -void DelayArmorRegen(entity e) { e.armor_regen_delay = time + cvar("g_balance_regen_wait");} -void DelayArmorRot(entity e) { e.armor_rot_delay = time + cvar("g_balance_rot_wait");} - - -void player_takepoison() -{ - float oldhealth, take; - if(self.health <= 5) - { - player_clearpoison(self); - return; - } - oldhealth = self.health; - - take = bound(0, self.poison_rate * frametime, self.health - 5); - if(take <= 0) - { - player_clearpoison(self); - return; - } - - DelayHealthRegen(self); - self.health = self.health - take; - self.poison_damage = self.poison_damage - take; - - if(self.health <= 5 || self.poison_damage <= 0) - { - player_clearpoison(self); - return; - } -} - -// cool off so you're not so vulnerable to fire -void player_cooloff () -{ - if(self.flame_heat_time > time)//heat up - self.flame_heat = bound(0, self.flame_heat + self.flame_heat * cvar("g_balance_heatup_rate") * frametime, cvar("g_balance_maxheat")); - else//cool off - self.flame_heat = bound(0, self.flame_heat - self.flame_heat * cvar("g_balance_cooloff_rate") * frametime, cvar("g_balance_maxheat")); -} - -void player_regen (void) -{ - local float maxh; - local float maxa; - maxh = self.max_health;//cvar("g_balance_health_stable"); - maxa = self.max_armor;//cvar("g_balance_armor_stable"); - - if(self.poison_damage) - { - player_takepoison(); - return; - } - - if(self.class == CLASS_SPY) - {// don't let spy regenerate if cloaked, but do allow rot if above max - if(self.special_active) - { - //if(self.health > maxh) - player_rot_health(maxh, 1.0); - //if(self.armorvalue > maxa) - player_rot_armor(maxa, 1.0); - } - else - { - player_regen_health(maxh, 0.1); // spies regenerate slowly, and mostly rely on health packs - player_regen_armor(maxa, 1.0); - player_rot_health(maxh, 1.0); - player_rot_armor(maxa, 1.0); - } - } - else - { - player_regen_health(maxh, 1.0); - player_regen_armor(maxa, 1.0); - player_rot_health(maxh, 1.0); - player_rot_armor(maxa, 1.0); - } - - player_cooloff(); -} - -/* -============= -PlayerPreThink - -Called every frame for each client before the physics are run -============= -*/ -.float attack_finished; -void PlayerPreThink (void) -{ - local vector m1, m2; - - CheckRules_Player(); - - if (intermission_running) - { - IntermissionThink (); // otherwise a button could be missed between - return; // the think tics - } - - if (self.deadflag != DEAD_NO) - { - player_anim(); - weapon_freeze(); - if (self.deadflag == DEAD_DYING) - { - if (time > self.dead_time) - self.deadflag = DEAD_DEAD; - } - else if (self.deadflag == DEAD_DEAD) - { - if (!self.button0 && !self.button2 && !self.button3) - self.deadflag = DEAD_RESPAWNABLE; - } - else if (self.deadflag == DEAD_RESPAWNABLE) - { - if (self.button0 || self.button2 || self.button3 || self.button4) - respawn(); - } - return; - } - - if (self.button5) - { - if (!self.crouch) - { - self.crouch = TRUE; - self.view_ofs = PL_CROUCH_VIEW_OFS; - setsize (self, PL_CROUCH_MIN, PL_CROUCH_MAX); - } - } - else - { - if (self.crouch) - { - tracebox(self.origin, PL_MIN, PL_MAX, self.origin, FALSE, self); - if (!trace_startsolid) - { - self.crouch = FALSE; - self.view_ofs = PL_VIEW_OFS; - setsize (self, PL_MIN, PL_MAX); - } - } - } - - if (self.playermodel != self.mdl) - { - //bprint("playermodel changed\n"); - self.playermodel = CheckPlayerModel(self.playermodel); - if(CheckForClassChange()) // check if we'll allow it - return; // if there's a return value, drop what you're doing and let the player respawn - - if(self.playermodel != self.mdl) // if change has been allowed - { - m1 = self.mins; - m2 = self.maxs; - precache_model (self.playermodel); - if(self.model != "") - { - setmodel (self, self.playermodel); - setsize (self, m1, m2); - } - self.mdl = strzone(self.playermodel); - } - } - - ClassPreThink(); - - if (self.skin != stof(self.playerskin)) - self.skin = stof(self.playerskin); - - if(self.class == CLASS_SCOUT) - GrapplingHookFrame(); - - W_WeaponFrame(); - - if (self.button4 || (self.weapon == WEP_NEX && self.button3)) - { - if (self.viewzoom > 0.4) - self.viewzoom = max (0.4, self.viewzoom - frametime * 2); - } - else if (self.viewzoom < 1.0) - self.viewzoom = min (1.0, self.viewzoom + frametime); - - - if (self.button2) - PlayerJump (); - else - self.flags = self.flags | FL_JUMPRELEASED; - - - player_powerups(); - player_regen(); - player_anim(); - - //self.angles_y=self.v_angle_y + 90; // temp - - WaterMove (); - if (self.waterlevel == 2) - CheckWaterJump (); - - //if (TetrisPreFrame()) return; - - PlayerLasergatePreThink(); -} - -/* -============= -PlayerPostThink - -Called every frame for each client after the physics are run -============= -*/ -void PlayerPostThink (void) -{ - float soundrandom; - CheckRules_Player(); - UpdateChatBubble(); - UpdateColorModHack(); - if (self.deadflag == DEAD_NO) - if (self.impulse) - ImpulseCommands (); - if (intermission_running) - return; // intermission or finale - - // VorteX: landing on floor, landing damage etc. - // LordHavoc: removed 'big fall' death code that VorteX added - if (self.flags & FL_ONGROUND || (self.waterlevel >= 2 && self.velocity_z <= 0)) - self.jump_pad = 0; - - if (self.flags & FL_ONGROUND) - { - CapPlayerVelocity(self, self.speed); - - if (self.jump_flag < -100 && !self.watertype == CONTENT_WATER) // HitGround - { - soundrandom = random() * 4; - - self.air_time = time; //temp BH var - - if (soundrandom < 1) - sound (self, CHAN_BODY, "misc/hitground1.wav", 1, ATTN_NORM); - else if (soundrandom < 2) - sound (self, CHAN_BODY, "misc/hitground2.wav", 1, ATTN_NORM); - else if (soundrandom < 3) - sound (self, CHAN_BODY, "misc/hitground3.wav", 1, ATTN_NORM); - else if (soundrandom < 4) - sound (self, CHAN_BODY, "misc/hitground4.wav", 1, ATTN_NORM); - if (self.jump_flag < -650) // landing damage - { - local float dm; - dm = bound(0, 0.1*(fabs(self.jump_flag) - 600), 5); - Damage (self, world, world, dm, DEATH_FALL, self.origin, '0 0 0'); - } - self.jump_flag = 0; - } - } - else - self.jump_flag = self.velocity_z; - - ClassPostThink(); - - //if (TetrisPostFrame()) return; - PlayerLasergatePostThink(); -} - -// Parse team join, class etc. -void SV_ParseClientCommand (string s) -{ - local float args; - local float h; - local string c; - local string d; - local string f; - local string g; - local string i; - args = tokenize(s); - c = argv(0); - d = argv(1); - f = argv(2); - g = argv(3); - i = argv(4); - - if (c == "join") - { - return; - } - if (c == "selectteam") - { - if (self.team_no > 0) - { - sprint(self, "You are already on a team!\n"); - return; - } - if (d == "auto" || d == "5") - { - TeamFortress_TeamPutPlayerInTeam(); - PutClientInServer (); - } - if (d == "red" || d == "2") - { - TeamFortress_TeamSet (2); - PutClientInServer (); - } - if (d == "blue" || d == "1") - { - TeamFortress_TeamSet (1); - PutClientInServer (); - } - } - else - { - clientcommand(self, s); - } -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/cl_impulse.c b/TeamNexuiz/game/gamec/cl_impulse.c deleted file mode 100644 index f4b442508..000000000 --- a/TeamNexuiz/game/gamec/cl_impulse.c +++ /dev/null @@ -1,165 +0,0 @@ -void CopyBody(float keepvelocity); - -// changes by LordHavoc on 03/30/04 -// cleaned up dummy code -// dummies are now removed eventually after being gibbed (norespawn = TRUE) -// dummy impulse now checks sv_cheats to prevent players from overwhelming server with dummies -// dummies now use player code where possible - -void player_anim (void); -void DummyThink(void) -{ - self.think = DummyThink; - self.nextthink = time; - SV_PlayerPhysics(); - PlayerPreThink(); - //player_anim(); - PlayerPostThink(); -} - -void CopyBody2(float keepvelocity, float testbody); -void ImpulseCommands (void) -{ - local float swpn; - - if (self.team_no < 1) // Bring up choose team menu if not on team - { - stuffcmd(self, "menu_showteamselect\n"); - - } - - if (self.impulse == 71) - { - local string whee; - whee = ftos (self.maxammo_rockets); - sprint(self, whee); - sprint(self, "\n"); - } - - if (self.impulse == 70) { // reload impulse - swpn = self.weapon; - if(self.class == CLASS_SOLDIER) - { - if (swpn == WEP4) - DoReload (3, (CLIP_MAX_ROCKETS - self.clip_rockets)); // weapon type 3 is RL, and reload X rockets. - } - else if(self.class == CLASS_PYRO) - { - if (swpn == WEP1) - DoReload (4, (CLIP_MAX_PIPEGRENADES - self.clip_pipegrenades)); - } - else if(self.class == CLASS_SCOUT || self.class == CLASS_ENGINEER) - { - if (swpn == WEP4) - DoReload (2, (CLIP_MAX_CRYLINK - self.clip_crylink)); - } - } - if (self.impulse == 69) { - local entity isneardoor; - local string st; - isneardoor = findradius (self.origin, 200); - while (isneardoor) - { - if ((isneardoor.classname == "door")) - { -// st = stos(isneardoor.model); - sprint (self, isneardoor.model); - sprint (self, "\n"); - dremove(newmis); - return; - } - isneardoor = isneardoor.chain; - } - } - if (self.impulse == 8) { - TeamFortress_ThrowGrenade(); } - if ((self.impulse == 150)) // GREN TYPE 1 - { - TeamFortress_PrimeGrenade(); - } -/* if ((self.impulse == 151)) // GREN TYPE 2 - { - TeamFortress_PrimeGrenade(); - }*/ - if ((self.impulse == 152)) - { - TeamFortress_ThrowGrenade(); - } - - if (self.impulse >= 1 && self.impulse <= 5) - { - if(self.buttonuse) - { - if(self.impulse == 5 && self.wpn5.weapon) - { - weapon_action(self.weapon, WR_DROP); - SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.wpn5.weapon); - self.weapon = 0; - ResetExtraWeapon(); - self.switchweapon = w_getbestweapon(self); - if(self.switchweapon == WEP5) - self.switchweapon = WEP1; - } - } - else - if (self.reload_time < time) { - W_SwitchWeapon (self.impulse); } - } - else if (self.impulse == 10) - if (self.reload_time < time) { - W_NextWeapon (); } - else if (self.impulse == 12) - if (self.reload_time < time) { - W_PreviousWeapon (); } - else if (self.impulse == 13 && cvar("sv_cheats")) - { - makevectors (self.v_angle); - self.velocity = self.velocity + v_forward * 300; - CopyBody2(1, TRUE); - self.velocity = self.velocity - v_forward * 300; - } - else if (self.impulse == 14 && cvar("sv_cheats")) - CopyBody2(0, TRUE); - else if (self.impulse == 99 && cvar("sv_cheats")) - { - self.items = IT_WEP1 | IT_WEP2 | IT_WEP3 | IT_WEP4 | IT_WEP5; - self.ammo_shells = 999; - self.ammo_nails = 999; - self.ammo_rockets = 999; - self.ammo_cells = 999; - } - - if(self.impulse == 20) - { - ClassSpecial(); - } - - if(self.impulse == 30) - { - ClassGrenade(WR_GRENADE1); - } - if(self.impulse == 31) - { - ClassGrenade(WR_GRENADE2); - } - - // model/class test - if(self.impulse == 57) - { - //self.class = GetPlayerClass(); - sprint(self, "Current class: "); - sprint(self, NameOfClass(self.class)); - sprint(self, ", model: "); - sprint(self, self.playermodel); - sprint(self, "\n"); - } - if(self.impulse == 211) // XavioR test impulse - { - local string woottest; - woottest = ftos(self.team_no); - sprint (self, woottest); - sprint (self, "\n"); - } - //TetrisImpulses(); - self.impulse = 0; -} \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/cl_physics.c b/TeamNexuiz/game/gamec/cl_physics.c deleted file mode 100644 index e2b989dc8..000000000 --- a/TeamNexuiz/game/gamec/cl_physics.c +++ /dev/null @@ -1,298 +0,0 @@ -float sv_accelerate; -float sv_maxairspeed; -float sv_friction; -float sv_maxspeed; -float sv_stopspeed; -float sv_gravity; -.float ladder_time; -.entity ladder_entity; -.float gravity; - -vector HorizVelocity(vector vel) -{ - vel_z = 0; - return vel; -} - -void CapPlayerVelocity(entity pl, float classmaxspeed) -{ - if(self.jump_pad || self.hook.state) - return; - vector wishvel; - // prevent bunnyhopping - wishvel = pl.velocity; - wishvel_z = 0; - if(vlen(wishvel) > classmaxspeed) - { - wishvel = normalize(wishvel) * classmaxspeed; - pl.velocity_x = wishvel_x; - pl.velocity_y = wishvel_y; - } -} - -void MauveBot_AI(); - -void SV_PlayerPhysics() -{ - local vector wishvel, wishdir, v; - local float wishspeed, prevspeed, f; - - local float classmaxspeed, classmaxairspeed, classstopspeed; - - MauveBot_AI(); - - if (self.movetype == MOVETYPE_NONE) - return; - - if (self.punchangle != '0 0 0') - { - f = vlen(self.punchangle) - 10 * frametime; - if (f > 0) - self.punchangle = normalize(self.punchangle) * f; - else - self.punchangle = '0 0 0'; - } - - if (self.punchvector != '0 0 0') - { - f = vlen(self.punchvector) - 30 * frametime; - if (f > 0) - self.punchvector = normalize(self.punchvector) * f; - else - self.punchvector = '0 0 0'; - } - - // if dead, behave differently - if (self.deadflag) - return; - - // determine the max speed this class can move at - SetPlayerSpeed(self); - classmaxspeed = self.speed; - if(classmaxspeed < 0) - classmaxspeed = sv_maxspeed; - - // help the slower players climb slopes a little more easily - classstopspeed = sv_stopspeed * (self.speed / sv_maxspeed); - - if (!self.fixangle) - { - self.angles_x = 0; - self.angles_y = self.v_angle_y; - self.angles_z = 0; - } - - if (self.flags & FL_WATERJUMP ) - { - self.velocity_x = self.movedir_x; - self.velocity_y = self.movedir_y; - if (time > self.teleport_time || self.waterlevel == 0) - { - self.flags = self.flags - (self.flags & FL_WATERJUMP); - self.teleport_time = 0; - } - } - else if (self.movetype == MOVETYPE_NOCLIP || (self.movetype == MOVETYPE_FLY && !self.hook.state)) - { - // noclipping or flying - self.velocity = self.velocity * (1 - frametime * sv_friction); - makevectors(self.v_angle); - //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z; - wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z; - // acceleration - wishdir = normalize(wishvel); - wishspeed = vlen(wishvel); - if (wishspeed > classmaxspeed)//sv_maxspeed) - wishspeed = classmaxspeed;//sv_maxspeed; - if (time >= self.teleport_time) - { - f = wishspeed - (self.velocity * wishdir); - if (f > 0) - self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed); - } - } - else if (self.waterlevel >= 2) - { - // swimming - makevectors(self.v_angle); - //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z; - wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z; - if (wishvel == '0 0 0') - wishvel = '0 0 -60'; // drift towards bottom - - wishdir = normalize(wishvel); - wishspeed = vlen(wishvel); - if (wishspeed > classmaxspeed)//sv_maxspeed) - wishspeed = classmaxspeed;//sv_maxspeed; - wishspeed = wishspeed * 0.7; - - //if(self.jump_pad || self.hook.state) - //{ - // //wishspeed = wishspeed * cvar("sv_jumppad_control"); // give player limited control on a jump pad - // wishspeed = cvar("sv_jumppad_control"); // give player limited control on a jump pad - //} - - // water friction - self.velocity = self.velocity * (1 - frametime * sv_friction); - - // water acceleration - f = wishspeed - (self.velocity * wishdir); - if (f > 0) - self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed); - CapPlayerVelocity(self, classmaxspeed); - } - else if (time < self.ladder_time) - { - if (self.ladder_entity.classname == "scout_rope") - { - // friction - self.velocity = self.velocity * (1 - frametime * sv_friction); - - makevectors(self.v_angle); - - // forward makes you move up, backward makes you move down. - wishvel = '0 0 1' * self.movement_x + v_right * self.movement_y; - // also push forward when reaching the top - if(//self.movement_x > 0 && - (self.origin_z + self.mins_z*0.9 > self.ladder_entity.origin_z + self.ladder_entity.maxs_z)) - wishvel = wishvel + v_forward * self.movement_x; - - // negate gravity - if (self.gravity) - self.velocity_z = self.velocity_z + self.gravity * sv_gravity * frametime; - else - self.velocity_z = self.velocity_z + sv_gravity * frametime; - - // acceleration - wishdir = normalize(wishvel); - wishspeed = vlen(wishvel); - - - if (wishspeed > classmaxspeed)//sv_maxspeed) - wishspeed = classmaxspeed;//sv_maxspeed; - if (time >= self.teleport_time) - { - f = wishspeed - (self.velocity * wishdir); - if (f > 0) - self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed); - } - CapPlayerVelocity(self, classmaxspeed); - } - else - { - // on a func_ladder or swimming in func_water - self.velocity = self.velocity * (1 - frametime * sv_friction); - makevectors(self.v_angle); - //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z; - wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z; - if (self.gravity) - self.velocity_z = self.velocity_z + self.gravity * sv_gravity * frametime; - else - self.velocity_z = self.velocity_z + sv_gravity * frametime; - if (self.ladder_entity.classname == "func_water") - { - f = vlen(wishvel); - if (f > self.ladder_entity.speed) - wishvel = wishvel * (self.ladder_entity.speed / f); - - self.watertype = self.ladder_entity.skin; - f = self.ladder_entity.origin_z + self.ladder_entity.maxs_z; - if ((self.origin_z + self.view_ofs_z) < f) - self.waterlevel = 3; - else if ((self.origin_z + (self.mins_z + self.maxs_z) * 0.5) < f) - self.waterlevel = 2; - else if ((self.origin_z + self.mins_z + 1) < f) - self.waterlevel = 1; - else - { - self.waterlevel = 0; - self.watertype = CONTENT_EMPTY; - } - } - // acceleration - wishdir = normalize(wishvel); - wishspeed = vlen(wishvel); - - - if (wishspeed > classmaxspeed)//sv_maxspeed) - wishspeed = classmaxspeed;//sv_maxspeed; - if (time >= self.teleport_time) - { - f = wishspeed - (self.velocity * wishdir); - if (f > 0) - self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed); - } - CapPlayerVelocity(self, classmaxspeed); - } - } - else if (self.flags & FL_ONGROUND) - { - // walking - makevectors(self.v_angle_y * '0 1 0'); - wishvel = v_forward * self.movement_x + v_right * self.movement_y; - // friction - if (self.velocity_x || self.velocity_y) - { - v = self.velocity; - v_z = 0; - f = vlen(v); - if (f < classstopspeed)//sv_stopspeed) - f = 1 - frametime * (classstopspeed / f) * sv_friction;//sv_stopspeed / f) * sv_friction; - else - f = 1 - frametime * sv_friction; - if (f > 0) - self.velocity = self.velocity * f; - else - self.velocity = '0 0 0'; - } - // acceleration - wishdir = normalize(wishvel); - wishspeed = vlen(wishvel); - if(self.jump_pad || self.hook.state) - { - //wishspeed = wishspeed * cvar("sv_jumppad_control"); // give player limited control on a jump pad - wishspeed = cvar("sv_jumppad_control"); // give player limited control on a jump pad - } - - if (wishspeed > classmaxspeed)//sv_maxspeed) - wishspeed = classmaxspeed;//sv_maxspeed; - if (time >= self.teleport_time) - { - f = wishspeed - (self.velocity * wishdir); - if (f > 0) - self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed); - } - - CapPlayerVelocity(self, classmaxspeed); - } - else - { - classmaxairspeed = classmaxspeed;//*0.8; - if(self.jump_pad || self.hook.state) // allow limited air control and upper velocity when coming off a jump pad - prevspeed = vlen(HorizVelocity(self.velocity)); - else - prevspeed = classmaxairspeed; - // airborn - makevectors(self.v_angle_y * '0 1 0'); - wishvel = v_forward * self.movement_x + v_right * self.movement_y; - // acceleration - wishdir = normalize(wishvel); - wishspeed = vlen(wishvel); - - if(self.jump_pad || self.hook.state) - { - //wishspeed = wishspeed * cvar("sv_jumppad_control"); // give player limited control on a jump pad - wishspeed = cvar("sv_jumppad_control"); // give player limited control on a jump pad - } - - if (wishspeed > classmaxairspeed)//sv_maxairspeed) - wishspeed = classmaxairspeed;//sv_maxairspeed; - if (time >= self.teleport_time) - { - f = wishspeed;// - (self.velocity * wishdir); - if (f > 0) - self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed); - } - CapPlayerVelocity(self, max(prevspeed, classmaxairspeed)); - } -}; diff --git a/TeamNexuiz/game/gamec/cl_physics.c_bh b/TeamNexuiz/game/gamec/cl_physics.c_bh deleted file mode 100644 index cd27f1ab7..000000000 --- a/TeamNexuiz/game/gamec/cl_physics.c_bh +++ /dev/null @@ -1,305 +0,0 @@ -float sv_accelerate; -float sv_maxairspeed; -float sv_friction; -float sv_maxspeed; -float sv_stopspeed; -float sv_gravity; -.float ladder_time; -.entity ladder_entity; -.float gravity; - -vector HorizVelocity(vector vel) -{ - vel_z = 0; - return vel; -} - -void CapPlayerVelocity(entity pl, float classmaxspeed) -{ - if(self.jump_pad || self.hook.state) - return; - vector wishvel; - // prevent bunnyhopping - wishvel = pl.velocity; - wishvel_z = 0; - if(vlen(wishvel) > classmaxspeed) - { - wishvel = normalize(wishvel) * classmaxspeed; - pl.velocity_x = wishvel_x; - pl.velocity_y = wishvel_y; - } -} - -void MauveBot_AI(); - -void SV_PlayerPhysics() -{ - local vector wishvel, wishdir, v; - local float wishspeed, prevspeed, f; - - local float classmaxspeed, classmaxairspeed, classstopspeed; - - MauveBot_AI(); - - if (self.movetype == MOVETYPE_NONE) - return; - - if (self.punchangle != '0 0 0') - { - f = vlen(self.punchangle) - 10 * frametime; - if (f > 0) - self.punchangle = normalize(self.punchangle) * f; - else - self.punchangle = '0 0 0'; - } - - if (self.punchvector != '0 0 0') - { - f = vlen(self.punchvector) - 30 * frametime; - if (f > 0) - self.punchvector = normalize(self.punchvector) * f; - else - self.punchvector = '0 0 0'; - } - - // if dead, behave differently - if (self.deadflag) - return; - - // determine the max speed this class can move at - SetPlayerSpeed(self); - classmaxspeed = self.speed; - if(classmaxspeed < 0) - classmaxspeed = sv_maxspeed; - - // help the slower players climb slopes a little more easily - classstopspeed = sv_stopspeed * (self.speed / sv_maxspeed); - - if (!self.fixangle) - { - self.angles_x = 0; - self.angles_y = self.v_angle_y; - self.angles_z = 0; - } - - if (self.flags & FL_WATERJUMP ) - { - self.velocity_x = self.movedir_x; - self.velocity_y = self.movedir_y; - if (time > self.teleport_time || self.waterlevel == 0) - { - self.flags = self.flags - (self.flags & FL_WATERJUMP); - self.teleport_time = 0; - } - } - else if (self.movetype == MOVETYPE_NOCLIP || (self.movetype == MOVETYPE_FLY && !self.hook.state)) - { - // noclipping or flying - self.velocity = self.velocity * (1 - frametime * sv_friction); - makevectors(self.v_angle); - //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z; - wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z; - // acceleration - wishdir = normalize(wishvel); - wishspeed = vlen(wishvel); - if (wishspeed > classmaxspeed)//sv_maxspeed) - wishspeed = classmaxspeed;//sv_maxspeed; - if (time >= self.teleport_time) - { - f = wishspeed - (self.velocity * wishdir); - if (f > 0) - self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed); - } - } - else if (self.waterlevel >= 2) - { - // swimming - makevectors(self.v_angle); - //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z; - wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z; - if (wishvel == '0 0 0') - wishvel = '0 0 -60'; // drift towards bottom - - wishdir = normalize(wishvel); - wishspeed = vlen(wishvel); - if (wishspeed > classmaxspeed)//sv_maxspeed) - wishspeed = classmaxspeed;//sv_maxspeed; - wishspeed = wishspeed * 0.7; - - //if(self.jump_pad || self.hook.state) - //{ - // //wishspeed = wishspeed * cvar("sv_jumppad_control"); // give player limited control on a jump pad - // wishspeed = cvar("sv_jumppad_control"); // give player limited control on a jump pad - //} - - // water friction - self.velocity = self.velocity * (1 - frametime * sv_friction); - - // water acceleration - f = wishspeed - (self.velocity * wishdir); - if (f > 0) - self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed); - CapPlayerVelocity(self, classmaxspeed); - } - else if (time < self.ladder_time) - { - if (self.ladder_entity.classname == "scout_rope") - { - // friction - self.velocity = self.velocity * (1 - frametime * sv_friction); - - makevectors(self.v_angle); - - // forward makes you move up, backward makes you move down. - wishvel = '0 0 1' * self.movement_x + v_right * self.movement_y; - // also push forward when reaching the top - if(//self.movement_x > 0 && - (self.origin_z + self.mins_z*0.9 > self.ladder_entity.origin_z + self.ladder_entity.maxs_z)) - wishvel = wishvel + v_forward * self.movement_x; - - // negate gravity - if (self.gravity) - self.velocity_z = self.velocity_z + self.gravity * sv_gravity * frametime; - else - self.velocity_z = self.velocity_z + sv_gravity * frametime; - - // acceleration - wishdir = normalize(wishvel); - wishspeed = vlen(wishvel); - - - if (wishspeed > classmaxspeed)//sv_maxspeed) - wishspeed = classmaxspeed;//sv_maxspeed; - if (time >= self.teleport_time) - { - f = wishspeed - (self.velocity * wishdir); - if (f > 0) - self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed); - } - CapPlayerVelocity(self, classmaxspeed); - } - else - { - // on a func_ladder or swimming in func_water - self.velocity = self.velocity * (1 - frametime * sv_friction); - makevectors(self.v_angle); - //wishvel = v_forward * self.movement_x + v_right * self.movement_y + v_up * self.movement_z; - wishvel = v_forward * self.movement_x + v_right * self.movement_y + '0 0 1' * self.movement_z; - if (self.gravity) - self.velocity_z = self.velocity_z + self.gravity * sv_gravity * frametime; - else - self.velocity_z = self.velocity_z + sv_gravity * frametime; - if (self.ladder_entity.classname == "func_water") - { - f = vlen(wishvel); - if (f > self.ladder_entity.speed) - wishvel = wishvel * (self.ladder_entity.speed / f); - - self.watertype = self.ladder_entity.skin; - f = self.ladder_entity.origin_z + self.ladder_entity.maxs_z; - if ((self.origin_z + self.view_ofs_z) < f) - self.waterlevel = 3; - else if ((self.origin_z + (self.mins_z + self.maxs_z) * 0.5) < f) - self.waterlevel = 2; - else if ((self.origin_z + self.mins_z + 1) < f) - self.waterlevel = 1; - else - { - self.waterlevel = 0; - self.watertype = CONTENT_EMPTY; - } - } - // acceleration - wishdir = normalize(wishvel); - wishspeed = vlen(wishvel); - - - if (wishspeed > classmaxspeed)//sv_maxspeed) - wishspeed = classmaxspeed;//sv_maxspeed; - if (time >= self.teleport_time) - { - f = wishspeed - (self.velocity * wishdir); - if (f > 0) - self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed); - } -// CapPlayerVelocity(self, classmaxspeed); - } - } - else if (self.flags & FL_ONGROUND) - { - // walking - makevectors(self.v_angle_y * '0 1 0'); - wishvel = v_forward * self.movement_x + v_right * self.movement_y; - // friction - if (self.velocity_x || self.velocity_y) - { - v = self.velocity; - v_z = 0; - f = vlen(v); - if (f < classstopspeed)//sv_stopspeed) - f = 1 - frametime * (classstopspeed / f) * sv_friction;//sv_stopspeed / f) * sv_friction; - else - f = 1 - frametime * sv_friction; -// if (f > 0) // Bunny hopping? lets chat - if (f > 0 && self.air_time < (time - .05)) - self.velocity = self.velocity * f; - else - if (self.air_time < (time - .05)) - { - self.velocity = '0 0 0'; - } - } - // acceleration - wishdir = normalize(wishvel); - wishspeed = vlen(wishvel); - if(self.jump_pad || self.hook.state) - { - //wishspeed = wishspeed * cvar("sv_jumppad_control"); // give player limited control on a jump pad - wishspeed = cvar("sv_jumppad_control"); // give player limited control on a jump pad - } - - if (wishspeed > classmaxspeed)//sv_maxspeed) - wishspeed = classmaxspeed;//sv_maxspeed; - if (time >= self.teleport_time) - { - f = wishspeed - (self.velocity * wishdir); - if (f > 0) - self.velocity = self.velocity + wishdir * min(f, sv_accelerate * frametime * wishspeed); - } - -// CapPlayerVelocity(self, classmaxspeed); - } - else - { - classmaxairspeed = classmaxspeed;//*0.8; - if(self.jump_pad || self.hook.state) // allow limited air control and upper velocity when coming off a jump pad - prevspeed = vlen(HorizVelocity(self.velocity)); - else - prevspeed = classmaxairspeed; - // airborn - makevectors(self.v_angle_y * '0 1 0'); - - wishvel = v_forward * self.movement_x + v_right * (self.movement_y/50); - - // acceleration - wishdir = normalize(wishvel); - wishspeed = vlen(wishvel); - - if(self.jump_pad || self.hook.state) - { - //wishspeed = wishspeed * cvar("sv_jumppad_control"); // give player limited control on a jump pad - wishspeed = cvar("sv_jumppad_control"); // give player limited control on a jump pad - } - -// if (wishspeed > classmaxairspeed)//sv_maxairspeed) -// wishspeed = classmaxairspeed;//sv_maxairspeed; - if (time >= self.teleport_time) - { - f = wishspeed;// - (self.velocity * wishdir); - if (f > 0) - self.velocity = self.velocity + wishdir * 26/*min(f, sv_accelerate * frametime * wishspeed)*/; - - } -// CapPlayerVelocity(self, max(prevspeed, classmaxairspeed)); //temp - } -}; diff --git a/TeamNexuiz/game/gamec/cl_player.c b/TeamNexuiz/game/gamec/cl_player.c deleted file mode 100644 index 0d58d15fb..000000000 --- a/TeamNexuiz/game/gamec/cl_player.c +++ /dev/null @@ -1,354 +0,0 @@ -$frame die1 die2 draw duck duckwalk duckjump duckidle idle -$frame jump pain1 pain2 shoot taunt run runbackwards -$frame strafeleft straferight dead1 dead2 forwardright -$frame forwardleft backright backleft - -// changes by LordHavoc on 03/29/04 and 03/30/04 at Vermeulen's request -// merged player_run and player_stand to player_anim -// added death animations to player_anim -// can now spawn thrown weapons from anywhere, not just from players -// thrown weapons now fade out after 20 seconds -// created PlayerGib function -// PlayerDie no longer uses hitloc or damage -// PlayerDie now supports dying animations as well as gibbing -// cleaned up PlayerDie a lot -// added CopyBody - -void player_cooloff(); -void BodyFakePhysics() -{ - self.think = BodyFakePhysics; - self.nextthink = time; - - SV_PlayerPhysics(); - - player_cooloff(); -} - -void CopyBody2(float keepvelocity, float testbody) -{ - local entity oldself; - if (self.effects & EF_NODRAW) - return; - oldself = self; - self = spawn(); - self.angles = oldself.angles; - self.avelocity = oldself.avelocity; - self.classname = "body"; - self.mass = oldself.mass; - self.damageforcescale = oldself.damageforcescale; - self.effects = oldself.effects; - self.event_damage = oldself.event_damage; - self.frame = oldself.frame; - self.health = oldself.health; - self.model = oldself.model; - self.modelindex = oldself.modelindex; - self.movetype = oldself.movetype; - self.nextthink = oldself.nextthink; - self.skin = oldself.skin; - self.solid = oldself.solid; - self.takedamage = oldself.takedamage; - self.think = oldself.think; - if (keepvelocity == 1) - self.velocity = oldself.velocity; - self.fade_time = oldself.fade_time; - self.fade_rate = oldself.fade_rate; - //self.weapon = oldself.weapon; - setorigin(self, oldself.origin); - setsize(self, oldself.mins, oldself.maxs);//'-16 -16 -24', '16 16 5'); - self.oldorigin = oldself.origin; - // move any fire burning me to the corpse - if(oldself.onfire != world) - { - self.onfire = oldself.onfire; // corpse is now on fire - self.onfire.enemy = self; // burn corpse instead of me when I respawn - oldself.onfire = world; // I'm not on fire anymore - setattachment(self.onfire, self, ""); - } - - if(testbody) - { - self.armorvalue = oldself.armorvalue; - self.think = BodyFakePhysics; - self.nextthink = time; - } - - self = oldself; -} - -void CopyBody(float keepvelocity) -{ - CopyBody2(keepvelocity, FALSE); -} - -void player_anim (void) -{ - if (self.deadflag != DEAD_NO) - { - if (time > self.dead_time) - { - if (self.maxs_z > 5) - setsize(self, '-16 -16 -24', '16 16 5'); - self.frame = self.dead_frame; - } - else - self.frame = self.die_frame; - return; - } - - - if (self.crouch) - { - if (self.movement_x * self.movement_x + self.movement_y * self.movement_y > 20) - self.frame = $duckwalk; - else - self.frame = $duckidle; - } - else if ((self.movement_x * self.movement_x + self.movement_y * self.movement_y) > 20) - { - if (self.movement_x > 0 && self.movement_y == 0) - { - self.frame = $run; - } - else if (self.movement_x < 0 && self.movement_y == 0) - self.frame = $runbackwards; - else if (self.movement_x == 0 && self.movement_y > 0) - self.frame = $straferight; - else if (self.movement_x == 0 && self.movement_y < 0) - self.frame = $strafeleft; - else if (self.movement_x > 0 && self.movement_y > 0) - self.frame = $forwardright; - else if (self.movement_x > 0 && self.movement_y < 0) - self.frame = $forwardleft; - else if (self.movement_x < 0 && self.movement_y > 0) - self.frame = $backright; - else if (self.movement_x < 0 && self.movement_y < 0) - self.frame = $backleft; - else - self.frame = $run; - } - else if (self.pain_finished > time) - self.frame = self.pain_frame; - else if (self.attack_finished > time) - self.frame = $shoot; - else - self.frame = $idle; - - if (!(self.flags & FL_ONGROUND)) - self.frame = $jump; -} -//End change by Supajoe on 11:44 PM EST 11/16/03 (Subject: Player animations) - - -void PlayerCorpseDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - local float take, save; - te_blood (hitloc, force, damage); - // damage resistance (ignore most of the damage from a bullet or similar) - damage = max(damage - 5, 1); - save = bound(0, damage * 0.6, self.armorvalue); - take = bound(0, damage - save, damage); - self.armorvalue = self.armorvalue - save; - self.health = self.health - take; - self.dmg_save = self.dmg_save + save; - self.dmg_take = self.dmg_take + take; - self.dmg_inflictor = inflictor; - if (self.health <= -50) - { - // don't use any animations as a gib - self.frame = 0; - self.dead_frame = 0; - self.die_frame = 0; - // view just above the floor - self.view_ofs = '0 0 4'; - - // make a juicy mess - te_bloodshower (self.origin + self.mins, self.origin + self.maxs, 800, 1000); - te_bloodshower (self.origin + self.mins, self.origin + self.maxs, 400, 1000); - - // make a meaty mess - TossGib (self, "models/gibs/eye.md3", self.origin, self.velocity,0); - TossGib (world, "models/gibs/bloodyskull.md3", self.origin, '0 0 600',0); - - TossGib (world, "models/gibs/gib1.md3", self.origin, self.velocity,0); - TossGib (world, "models/gibs/gib2.md3", self.origin, self.velocity,0); - TossGib (world, "models/gibs/gib3.md3", self.origin, self.velocity,0); - TossGib (world, "models/gibs/gib4.md3", self.origin, self.velocity,0); - - // these destory on impact - TossGib (world, "models/gibs/gib5.md3", self.origin, '-500 0 450',1); - TossGib (world, "models/gibs/gib6.md3", self.origin, '0 500 450',1); - TossGib (world, "models/gibs/chunk.mdl", self.origin, '0 -500 450',1); - TossGib (world, "models/gibs/chunk.mdl", self.origin, '500 0 450',1); - TossGib (world, "models/gibs/chunk.mdl", self.origin, self.velocity,1); - TossGib (world, "models/gibs/chunk.mdl", self.origin, '0 0 450',1); - - sound (trace_ent, CHAN_VOICE, "misc/gib.wav", 1, ATTN_NORM); - } -} - -void PlayerKilled (float unnatural_death, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - if(self.class == CLASS_SPY) - SpyDecloak(); - - // throw a weapon - SpawnThrownWeapon (self.origin + (self.mins + self.maxs) * 0.5, self.wpn5.weapon);//self.weapon); - // print an obituary message - Obituary (attacker, self, deathtype); - // Drop flag or any carried item - TeamFortress_RemoveTimers (); - // Make sure corpse cant take tfgoal items - self.is_dead = 1; - // make the corpse upright (not tilted) - self.angles_x = 0; - self.angles_z = 0; - // don't spin - self.avelocity = '0 0 0'; - // no weapon when dead - self.weaponmodel = ""; - w_clear(); - // view from the floor - self.view_ofs = '0 0 -8'; - // toss the corpse - self.movetype = MOVETYPE_TOSS; - // shootable corpse - self.solid = SOLID_CORPSE; - // don't stick to the floor - self.flags = self.flags - (self.flags & FL_ONGROUND); - // dying animation - self.deadflag = DEAD_DYING; - // when to allow respawn - self.death_time = time + 0.5; - // when to switch to the dead_frame - self.dead_time = time + 2; - if(!unnatural_death) - { - if (random() < 0.5) - { - self.die_frame = $die1; - self.dead_frame = $dead1; - } - else - { - self.die_frame = $die2; - self.dead_frame = $dead2; - } - } - else - { - self.die_frame = $dead2; - self.dead_frame = $dead2; - if(self.health > -1) - self.health = -1; - } - // start the animation - player_anim(); - // set damage function to corpse damage - self.event_damage = PlayerCorpseDamage; - // call the corpse damage function just in case it wants to gib - self.event_damage(inflictor, attacker, 0, deathtype, hitloc, force); - // set up to fade out later - SUB_SetFade (self, time + 12 + random () * 4, 1); -} - -float PlayerShouldDie (entity inflictor, entity attacker, float damage, float deathtype) -{ - // returns true if player should die from this source of damage. - // If so, don't block this damage in any way - - if(damage > 2000) - return TRUE; - - if( deathtype == DEATH_FALL - || deathtype == DEATH_TELEFRAG - || deathtype == DEATH_DROWN - || deathtype == DEATH_HURTTRIGGER - || deathtype == DEATH_LAVA - || deathtype == DEATH_SLIME - || deathtype == DEATH_KILL - || deathtype == DEATH_CLASSCHANGE -// || deathtype == DEATH_BURNING - || deathtype == DEATH_LASERGATE - ) - return TRUE; - - return FALSE; -} - -void PlayerDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - local float take, save, damagearmor; - - te_blood (hitloc, force, damage); - if (self.pain_finished < time) //Don't switch pain sequences like crazy - { - if (random() > 0.5) - self.pain_frame = $pain1; - else - self.pain_frame = $pain2; - self.pain_finished = time + 0.5; //Supajoe - } - - if(self.class == CLASS_MEDIC) - { - if(deathtype == DEATH_BURNING) - damage = 0; // being on fire or near burning targets does nothing to medics - // the flame thrower, flame rockets, and hotbombs also do minimal damage - else if(deathtype == WEP_FLAMER || - deathtype == WEP_ROCKET_INCENDIARY || - deathtype == WEP_HOTBOMBS) - damage = damage * cvar("g_balance_class_medic_flame_takedamage"); - } - - // how much damage to deal to armor - damagearmor = bound(0, damage * 0.2 * (self.armorvalue / 50) * cvar("g_balance_armor_takedamage"), self.armorvalue); - // how much damage armor blocks - save = bound(0, damage * (self.armorvalue / 100) * cvar("g_balance_armor_effectiveness"), damage); - // how much damage to deal to player - take = bound(0, damage - save, damage); - - // if being telefragged or killed by a death trigger etc, don't block that - if(PlayerShouldDie(inflictor, attacker, damage, deathtype)) - { - if(take < damage) - take = damage; // deal full damage - } - else - { - // keep the damage the armor allowed through, and further reduce it if the player is using the shield - if(self.class == CLASS_SCOUT) - take = SpecialShieldProtect(take); - } - - if (save > 10) - sound (self, CHAN_IMPACT, "misc/armorimpact.wav", 1, ATTN_NORM); - if (take > 10) - sound (self, CHAN_IMPACT, "misc/bodyimpact1.wav", 1, ATTN_NORM); - if (take > 30) - sound (self, CHAN_IMPACT, "misc/bodyimpact2.wav", 1, ATTN_NORM); - - if (take > 50) - TossGib (world, "models/gibs/chunk.mdl", hitloc, force * -0.1,1); - if (take > 100) - TossGib (world, "models/gibs/chunk.mdl", hitloc, force * -0.1,1); - - if (!(self.flags & FL_GODMODE)) - { - self.armorvalue = self.armorvalue - damagearmor; - self.health = self.health - take; - } - - DelayHealthRegen(self); - DelayArmorRegen(self); - - - self.dmg_save = self.dmg_save + max(save - 10, 0); - self.dmg_take = self.dmg_take + max(take - 10, 0); - self.dmg_inflictor = inflictor; - if (self.health <= 2) - { - PlayerKilled(FALSE, inflictor, attacker, damage, deathtype, hitloc, force); - } -} - diff --git a/TeamNexuiz/game/gamec/cl_weaponanimations.c b/TeamNexuiz/game/gamec/cl_weaponanimations.c deleted file mode 100644 index 87683b778..000000000 --- a/TeamNexuiz/game/gamec/cl_weaponanimations.c +++ /dev/null @@ -1,25 +0,0 @@ -$frame fire fire2 idle run - -// VorteX: static frame globals -float WFRAME_FIRE1 = 0; -float WFRAME_FIRE2 = 1; -float WFRAME_IDLE = 2; -float WFRAME_RUN = 3; - -// changes by LordHavoc on 03/30/04 -// cleaned up code formatting a bit -// renamed to weapon_anim -void weapon_anim () -{ - if (self.attack_finished > time) - self.weaponframe = $fire; - else if (self.movement_x || self.movement_y) - self.weaponframe = $run; - else - self.weaponframe = $idle; -} -void weapon_freeze () -{ - if (self.weaponentity) - self.weaponentity.frame = WFRAME_IDLE; -} \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/cl_weapons.c b/TeamNexuiz/game/gamec/cl_weapons.c deleted file mode 100644 index 0fd20f24e..000000000 --- a/TeamNexuiz/game/gamec/cl_weapons.c +++ /dev/null @@ -1,321 +0,0 @@ - -// generic weapons table -// add new weapons here -void(float wpn, float wrequest) weapon_action = -{ - if ((self.reload_time + .25) > time) { - return; } - if (wpn == WEP5) - { - wpn = self.wpn5.weapon; - - // various extra weapons the player can equip - if (wpn == WEP_LASER) - w_laser(wrequest); - else if (wpn == WEP_SHOTGUN) - w_shotgun(wrequest); - else if (wpn == WEP_UZI) - w_uzi(wrequest); - else if (wpn == WEP_GRENADE_LAUNCHER) - w_glauncher(wrequest); - else if (wpn == WEP_ELECTRO) - w_electro(wrequest); - else if (wpn == WEP_CRYLINK) - w_crylink(wrequest); - else if (wpn == WEP_NEX) - w_nex(wrequest); - else if (wpn == WEP_HAGAR) - w_hagar(wrequest); - else if (wpn == WEP_ROCKET_LAUNCHER) - w_rlauncher(wrequest); - return; - } - else if(self.class == CLASS_SCOUT) - { - if (wpn == WEP1) - w_shotgun(wrequest); - else if (wpn == WEP2) - w_grapple(wrequest); - else if (wpn == WEP3) - w_uzi(wrequest); - else if (wpn == WEP4) - w_crylink(wrequest); - } - else if(self.class == CLASS_SPY) - { - if (wpn == WEP1) - w_laser(wrequest); - else if (wpn == WEP2) - w_uzi(wrequest); - else if (wpn == WEP3) - w_uzi(wrequest); - else if (wpn == WEP4) - w_uzi(wrequest); - } - else if(self.class == CLASS_SOLDIER) - { - if (wpn == WEP1) - w_shotgun(wrequest); - else if (wpn == WEP2) - w_namek(wrequest); - else if (wpn == WEP3) - w_electro(wrequest); - else if (wpn == WEP4) - w_rlauncher(wrequest); - } - else if(self.class == CLASS_PYRO) - { - if (wpn == WEP1) - w_bombletts(wrequest); - else if (wpn == WEP2) - w_flamer(wrequest); - else if (wpn == WEP3) - w_rincendiary(wrequest); - else if (wpn == WEP4) - w_hotbombs(wrequest); - } - else if(self.class == CLASS_MEDIC) - { - if (wpn == WEP1) - w_shotgun(wrequest); - else if (wpn == WEP2) - w_electro(wrequest); - else if (wpn == WEP3) - w_laser(wrequest); - else if (wpn == WEP4) - w_uzi(wrequest); - } - else if(self.class == CLASS_ENGINEER) - { - if (wpn == WEP1) - w_laser(wrequest); - else if (wpn == WEP2) - w_laser(wrequest); - else if (wpn == WEP3) - w_electro(wrequest); - else if (wpn == WEP4) - w_rlauncher(wrequest); - } - else - { - if (wpn == WEP_LASER) - w_laser(wrequest); - else if (wpn == WEP_SHOTGUN) - w_shotgun(wrequest); - else if (wpn == WEP_UZI) - w_uzi(wrequest); - else if (wpn == WEP_GRENADE_LAUNCHER) - w_glauncher(wrequest); - else if (wpn == WEP_ELECTRO) - w_electro(wrequest); - else if (wpn == WEP_CRYLINK) - w_crylink(wrequest); - else if (wpn == WEP_NEX) - w_nex(wrequest); - else if (wpn == WEP_HAGAR) - w_hagar(wrequest); - else if (wpn == WEP_ROCKET_LAUNCHER) - w_rlauncher(wrequest); - } - -}; - -// switch between weapons -void(float imp) W_SwitchWeapon -{ -/* if (self.reload_time > time - .1) - { - return; - }*/ - weapon_hasammo = TRUE; - if (!client_hasweapon(self, imp, TRUE)) - { - if (!weapon_hasammo) - sprint(self, "You don't have any ammo for that weapon\n"); - else - sprint(self, "You don't own that weapon\n"); - } - else - self.switchweapon = imp; -}; - -// next weapon -void() W_NextWeapon = -{ - local float weaponwant, i; - - weaponwant = self.switchweapon + 1; - if (weaponwant < WEP_FIRST) - weaponwant = WEP_LAST; - if (weaponwant > WEP_LAST) - weaponwant = WEP_FIRST; - weapon_hasammo = TRUE; - i = 0; - while(!client_hasweapon(self, weaponwant, TRUE)) - { - i = i + 1; - if(i >= 20) - return; // failed; there's probably some weird problem causing an infinite loop - weaponwant = weaponwant + 1; - if (weaponwant < WEP_FIRST) - weaponwant = WEP_LAST; - if (weaponwant > WEP_LAST) - weaponwant = WEP_FIRST; - } - self.switchweapon = weaponwant; -}; - -// prev weapon -void() W_PreviousWeapon = -{ - local float weaponwant, i; - - weaponwant = self.switchweapon - 1; - if (weaponwant < WEP_FIRST) - weaponwant = WEP_LAST; - if (weaponwant > WEP_LAST) - weaponwant = WEP_FIRST; - weapon_hasammo = TRUE; - i = 0; - while(!client_hasweapon(self, weaponwant, TRUE)) - { - i = i + 1; - if(i >= 20) - return; // failed; there's probably some weird problem causing an infinite loop - weaponwant = weaponwant - 1; - if (weaponwant < WEP_FIRST) - weaponwant = WEP_LAST; - if (weaponwant > WEP_LAST) - weaponwant = WEP_FIRST; - } - self.switchweapon = weaponwant; -}; - -// Brought back weapon frame -void() W_WeaponFrame = -{ - if (!self.weaponentity || self.health <= 0) - return; // Dead player can't use weapons and injure impulse commands - - if (cvar("g_antilag")) - { - // if aiming at a player and the original trace won't hit that player - // anymore, try aiming at the player's new position - if (self.cursor_trace_ent) - { - if (self.cursor_trace_ent.takedamage) - { - traceline(self.origin + self.view_ofs, self.cursor_trace_endpos, FALSE, self); - if (trace_ent != self.cursor_trace_ent) - { - traceline(self.origin + self.view_ofs, self.cursor_trace_ent.origin + (self.cursor_trace_ent.mins + self.cursor_trace_ent.maxs) * 0.5, FALSE, self); - if (trace_ent == self.cursor_trace_ent) - self.cursor_trace_endpos = trace_endpos; - } - } - } - self.v_angle = vectoangles(self.cursor_trace_endpos - (self.origin + self.view_ofs)); - self.v_angle_x = 0 - self.v_angle_x; - } - - makevectors(self.v_angle); - - // Change weapon - if (self.weapon != self.switchweapon) - { - //bprint("switching weapon: "); - //bprint(ftos(self.weapon)); - //bprint(" --> "); - //bprint(ftos(self.switchweapon)); - //bprint("\n"); - - //self.weaponentity.state = WS_CLEAR; - if (self.weaponentity.state == WS_CLEAR) - { - //bprint("switching in\n"); - self.weaponentity.state = WS_RAISE; - weapon_action(self.switchweapon, WR_SETUP); - // VorteX: add player model weapon select frame here - // setcustomframe(PlayerWeaponRaise); - weapon_action(self.weapon, WR_UPDATECOUNTS); - weapon_action(self.weapon, WR_RAISE); - } - else if (self.weaponentity.state == WS_READY) - { - //bprint("switching out\n"); - sound (self, CHAN_WEAPON, "weapons/weapon_switch.wav", 1, ATTN_NORM); - self.weaponentity.state = WS_DROP; - // VorteX: add player model weapon deselect frame here - // setcustomframe(PlayerWeaponDrop); - weapon_action(self.weapon, WR_DROP); - } - } - - if (self.button0) - weapon_action(self.weapon, WR_FIRE1); - if (self.button3) - weapon_action(self.weapon, WR_FIRE2); - - // do weapon think - if (time >= self.weapon_nextthink) - if (self.weapon_nextthink > 0) - self.weapon_think(); - - // weapon bobbing and script actions - local float bobintensity, q1pitching, framespeed, diff; - local vector vel, realorg, layer1, boblayer; - - bobintensity = cvar("g_viewweapon_bobintensity"); // weapon bob intensity - q1pitching = fabs(cvar("g_viewweapon_q1pitching")); // q1 style of "bob" when looking up and down - - realorg = self.weaponentity.origin + self.weaponentity.view_ofs; - realorg = realorg - self.weaponentity.finaldest; // finaldest is last bob position - - // VorteX: actually this is needed for weapon screen offset - if (q1pitching) - { - self.weaponentity.view_ofs_x = q1pitching*bound(-5.5, self.v_angle_x/45, 5.5); - self.weaponentity.view_ofs_z = q1pitching*bound(-1.5, self.v_angle_x/60, 1.5); - } - - // weapon origin interpolation, layer 1 - if (realorg != self.weaponentity.pos1) - { - framespeed = frametime*self.weaponentity.lip*10; // lip is speed of origin changing (of layer1) - diff = vlen(realorg - self.weaponentity.pos1); - // VorteX: add speed modifier (haste)? - layer1 = frametime*10*self.weaponentity.lip*normalize(self.weaponentity.pos1 - realorg); - if (diff <= vlen(layer1)) - layer1 = normalize(self.weaponentity.pos1 - realorg)*diff; - } - - // weapon bobbing (q3-style) - if (self.flags & FL_ONGROUND && self.waterlevel < 2) - { - // VorteX: only xy velocity matters - vel_x = self.velocity_x; - vel_y = self.velocity_y; - framespeed = vlen(vel); - // Y axis - diff = bobintensity*framespeed/300; - self.weaponentity.destvec_y = self.weaponentity.destvec_y + frametime*10; - boblayer_y = diff*cos(self.weaponentity.destvec_y + 90); - // Z axis - diff = bobintensity*framespeed/540; - self.weaponentity.destvec_z = self.weaponentity.destvec_z + frametime*20; - boblayer_z = diff*cos(self.weaponentity.destvec_z); - self.weaponentity.finaldest = boblayer; - } - else if (self.waterlevel > 0) - {// swim, all velocity matters - // X axis - framespeed = vlen(self.velocity); - diff = bobintensity*framespeed/100; - self.weaponentity.destvec_x = self.weaponentity.destvec_x + frametime*6; - boblayer_x = diff*cos(self.weaponentity.destvec_x); - self.weaponentity.finaldest = boblayer; - } - else - self.weaponentity.finaldest = '0 0 0'; - self.weaponentity.origin = realorg + boblayer + layer1 - self.weaponentity.view_ofs; -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/cl_weaponsystem.c b/TeamNexuiz/game/gamec/cl_weaponsystem.c deleted file mode 100644 index 7ad87e9a8..000000000 --- a/TeamNexuiz/game/gamec/cl_weaponsystem.c +++ /dev/null @@ -1,343 +0,0 @@ -/* -=========================================================================== - - CLIENT WEAPONSYSTEM CODE - Bring back W_Weaponframe - -=========================================================================== -*/ - -void() CL_Weaponentity_Think = -{ - self.nextthink = time; - if (self.owner.weaponentity != self) - { - remove(self); - return; - } - self.effects = self.owner.effects; - if(!(self.class == CLASS_SPY && self.special_active)) - self.alpha = self.owner.alpha; -}; - -void() CL_ExteriorWeaponentity_Think = -{ - self.nextthink = time; - if (self.owner.exteriorweaponentity != self) - { - remove(self); - return; - } - if (self.cnt != self.owner.weaponentity.modelindex || self.dmg != self.owner.modelindex || self.deadflag != self.owner.deadflag) - { - self.cnt = self.owner.weaponentity.modelindex; - self.dmg = self.owner.modelindex; - self.deadflag = self.owner.deadflag; - if (self.owner.deadflag) self.model = ""; - else if (self.owner.wpn == WEP_LASER) setmodel(self, "models/weapons/v_laser.md3"); - else if (self.owner.wpn == WEP_SHOTGUN) setmodel(self, "models/weapons/v_shotgun.md3"); - else if (self.owner.wpn == WEP_UZI) setmodel(self, "models/weapons/v_uzi.md3"); - else if (self.owner.wpn == WEP_GRENADE_LAUNCHER) setmodel(self, "models/weapons/v_gl.md3"); - else if (self.owner.wpn == WEP_ELECTRO) setmodel(self, "models/weapons/v_electro.md3"); - else if (self.owner.wpn == WEP_CRYLINK) setmodel(self, "models/weapons/v_crylink.md3"); - else if (self.owner.wpn == WEP_NEX) setmodel(self, "models/weapons/v_nex.md3"); - else if (self.owner.wpn == WEP_HAGAR) setmodel(self, "models/weapons/v_hagar.md3"); - else if (self.owner.wpn == WEP_ROCKET_LAUNCHER) setmodel(self, "models/weapons/v_rl.md3"); - else if (self.owner.wpn == WEP_BOMBLETTS) setmodel(self, "models/weapons/v_bombletts.md3"); - else if (self.owner.wpn == WEP_ROCKET_INCENDIARY) setmodel(self, "models/weapons/v_rli.md3"); - else if (self.owner.wpn == WEP_HOTBOMBS) setmodel(self, "models/weapons/v_hotbombs.md3"); - else if (self.owner.wpn == WEP_GRAPPLE) setmodel(self, "models/weapons/v_grapple.md3"); - else if (self.owner.wpn == WEP_NAMEK) setmodel(self, "models/weapons/v_namek.md3"); - setattachment(self, self.owner, "bip01 r hand"); - // if that didn't find a tag, hide the exterior weapon model - if (!self.tag_index) - self.model = ""; - } - self.effects = self.owner.weaponentity.effects; -}; - -// spawning weaponentity for client -void() CL_SpawnWeaponentity = -{ - if (self.weaponentity) - { - w_clear(); - return; - } - self.weaponentity = spawn(); - self.weaponentity.solid = SOLID_NOT; - self.weaponentity.owner = self; - self.weaponentity.weaponentity = self.weaponentity; - setmodel(self.weaponentity, ""); - self.weaponentity.origin = '0 0 0'; - self.weaponentity.angles = '0 0 0'; - self.weaponentity.viewmodelforclient = self; - self.weaponentity.flags = 0; - self.weaponentity.think = CL_Weaponentity_Think; - self.weaponentity.nextthink = time; - - self.exteriorweaponentity = spawn(); - self.exteriorweaponentity.solid = SOLID_NOT; - self.exteriorweaponentity.exteriorweaponentity = self.exteriorweaponentity; - self.exteriorweaponentity.owner = self; - self.exteriorweaponentity.origin = '0 0 0'; - self.exteriorweaponentity.angles = '0 0 0'; - self.exteriorweaponentity.think = CL_ExteriorWeaponentity_Think; - self.exteriorweaponentity.nextthink = time; -}; - -// convertion from index (= impulse) to flag in .items -float(float index) weapon_translateindextoflag = -{ - if (index == WEP1) - return IT_WEP1; - else if (index == WEP2) - return IT_WEP2; - else if (index == WEP3) - return IT_WEP3; - else if (index == WEP4) - return IT_WEP4; - else if (index == WEP5) - return IT_WEP5; - return IT_WEP1; -}; - -float(entity cl, float wpn, float andammo) client_hasweapon = -{ - local float itemcode; - local entity oldself; - - weapon_hasammo = TRUE; - if (wpn < WEP_FIRST || wpn > WEP_LAST) - return FALSE; - itemcode = weapon_translateindextoflag(wpn); - if (cl.items & itemcode) - { - if (andammo) - { - oldself = self; - self = cl; - weapon_action(wpn, WR_CHECKAMMO); - self = oldself; - if (weapon_hasammo) - return TRUE; - return FALSE; - } - return TRUE; - } - return FALSE; -}; - -// Weapon subs -void() w_clear = -{ - weapon_action(self.weapon, WR_CLEAR); - if (self.weapon != -1) - self.weapon = 0; - if (self.weaponentity) - { - self.weaponentity.state = WS_CLEAR; - setmodel(self.weaponentity, ""); - self.weaponentity.effects = 0; - } -}; - -void() w_ready = -{ - self.weaponentity.state = WS_READY; - weapon_action(self.weapon, WR_IDLE); -}; - -// FIXME: add qw-style client-custom weaponrating (cl_weaponrating)? -float(entity e) w_getbestweapon -{// add new weapons here - if(e.class == CLASS_SCOUT) - { - if (client_hasweapon(e, WEP5, TRUE)) - return WEP5; - else if (client_hasweapon(e, WEP3, TRUE)) - return WEP3; - else if (client_hasweapon(e, WEP2, TRUE)) - return WEP2; - weapon_hasammo = TRUE; - return WEP1; - } - if(e.class == CLASS_SPY) - { - if (client_hasweapon(e, WEP5, TRUE)) - return WEP5; - else if (client_hasweapon(e, WEP2, TRUE)) - return WEP2; - weapon_hasammo = TRUE; - return WEP1; - } - if(e.class == CLASS_SOLDIER) - { - if (client_hasweapon(e, WEP5, TRUE)) - return WEP5; - else if (client_hasweapon(e, WEP4, TRUE)) - return WEP4; - else if (client_hasweapon(e, WEP3, TRUE)) - return WEP3; - else if (client_hasweapon(e, WEP2, TRUE)) - return WEP2; - weapon_hasammo = TRUE; - return WEP1; - } - if(e.class == CLASS_PYRO) - { - if (client_hasweapon(e, WEP5, TRUE)) - return WEP5; - else if (client_hasweapon(e, WEP3, TRUE)) - return WEP3; - else if (client_hasweapon(e, WEP2, TRUE)) - return WEP2; - else if (client_hasweapon(e, WEP4, TRUE)) - return WEP4; - weapon_hasammo = TRUE; - return WEP1; - } - if(e.class == CLASS_MEDIC) - { - if (client_hasweapon(e, WEP5, TRUE)) - return WEP5; - else if (client_hasweapon(e, WEP4, TRUE)) - return WEP4; - else if (client_hasweapon(e, WEP3, TRUE)) - return WEP3; - else if (client_hasweapon(e, WEP2, TRUE)) - return WEP2; - weapon_hasammo = TRUE; - return WEP1; - } - if(e.class == CLASS_ENGINEER) - { - if (client_hasweapon(e, WEP5, TRUE)) - return WEP5; - else if (client_hasweapon(e, WEP4, TRUE)) - return WEP4; - else if (client_hasweapon(e, WEP3, TRUE)) - return WEP3; - else if (client_hasweapon(e, WEP2, TRUE)) - return WEP2; - weapon_hasammo = TRUE; - return WEP1; - } - weapon_hasammo = TRUE; - return WEP1; -}; - -// Setup weapon for client (after this raise frame will be launched) -void(float new_wep, string wmodel, float hudammo) weapon_setup = -{ - local string weaponmdl; - - self.items = self.items - (self.items & (IT_SHELLS | IT_NAILS | IT_ROCKETS | IT_CELLS)); - self.items = self.items | hudammo; - - self.weapon = self.switchweapon; - //self.weapon = weapon_translateindextoflag(new_wep); - self.wpn = new_wep; - - if (wmodel != "") - { - weaponmdl = strzone(strcat("models/weapons/", wmodel)); - setmodel(self.weaponentity, weaponmdl); - } - // VorteX: update visible weapon - // CL_ViswepUpdate(); -}; - -/*void(float new_wep, string wmodel, float hudammo, void spfunciton()) weapon_setup_special = -{ - weapon_setup(new_wep, wmodel, hudammo); - spfunction(); -}*/ - -// shot direction -float WEAPON_MAXRELX = 14; // if more, shot can be spawned after wall surface (in empty worldspace) or inside other entity if client stands close to it -void(float x, float y, float z) weapon_shotdir = -{ - makevectors(self.v_angle); - self.shotorg = self.origin + self.view_ofs + v_forward*bound(0, x, WEAPON_MAXRELX) + v_right*(y + self.weaponentity.view_ofs_y) + v_up*z; - self.shotdir = aim(self, 1000); -}; - -// perform weapon to attack (weaponstate and attack_finished check is here) -void(float() checkfunc1, float() checkfunc2, void() firefunc, float atktime) weapon_prepareattack = -{ - // fixme: does spy need to decloak here? - //if(self.class == CLASS_SPY) - //{ - // SpyDecloak(); - //} - // Change to best weapon if failed - if ((cvar("g_instagib") == 0) && (cvar("g_rocketarena") == 0)) - { - if (!checkfunc1()) - { - if (!checkfunc2()) - self.switchweapon = w_getbestweapon(self); - return; - } - } - // Don't do shot if previos attack not finished - if (time < self.attack_finished) - return; - // Can't do shot if changing weapon - if (self.weaponentity.state != WS_READY) - return; - - self.attack_finished = time + atktime; - firefunc(); -}; - -void SpyDecloak(); -// perform weapon attack -void(float() checkfunc1, float() checkfunc2, void() firefunc) weapon_doattack -{ - if(self.class == CLASS_SPY) - { - SpyDecloak(); - } - - - // Change to best weapon if failed - if ((cvar("g_instagib") == 0) && (cvar("g_rocketarena") == 0)) - { - if (!checkfunc1()) - { - if (!checkfunc2()) - self.switchweapon = w_getbestweapon(self); - return; - } - } - self.weaponentity.state = WS_INUSE; - firefunc(); - weapon_action(self.weapon, WR_UPDATECOUNTS); // update ammo now -}; - -void(entity ent, float recoil) weapon_recoil = -{ - ent.punchangle = (randomvec() + '-1 0 0')*recoil; - ent.punchangle_z = 0; // don't want roll - if (recoil > 3) // push back if large recoil - ent.velocity = ent.velocity - normalize(ent.shotdir)*recoil*25; -}; - -void(float fr, float t, void() func) weapon_thinkf = -{ - if (fr >= 0) - if (self.weaponentity != world) - self.weaponentity.frame = fr; - // VorteX: haste can be added here - self.weapon_nextthink = time + t; - self.weapon_think = func; -}; - -void(float spd, vector org) weapon_boblayer1 = -{ - // VorteX: haste can be added here - self.weaponentity.pos1 =org; - self.weaponentity.lip = spd; -}; diff --git a/TeamNexuiz/game/gamec/class.c b/TeamNexuiz/game/gamec/class.c deleted file mode 100644 index 0c5cceeaa..000000000 --- a/TeamNexuiz/game/gamec/class.c +++ /dev/null @@ -1,469 +0,0 @@ - -void PlayerKilled (float unnatural_death, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force); - - - -/* -============= -NameOfClass - -Translates class number to a string for printing -============= -*/ -string NameOfClass(float cl) -{ - if(cl == CLASS_SCOUT) - return "Scout"; - if(cl == CLASS_SPY) - return "Spy"; - if(cl == CLASS_SOLDIER) - return "Soldier"; - if(cl == CLASS_PYRO) - return "Pryo"; - if(cl == CLASS_MEDIC) - return "Medic"; - if(cl == CLASS_ENGINEER) - return "Engineer"; - return "Invalid Class"; -} - -/* -============= -GetPlayerClass - -Returns the player's class by checking his model name -============= -*/ -float GetPlayerClass() -{ - //string s; - //s = substring(self.playermodel,13,3); - - //bprint("Class Prefix: "); - //bprint(s); - //bprint("\n"); - - // only the prefix matters; - // thus, you could have multiple medic models, such as a male and female. - if(substring(self.playermodel,13,5) - == "scout") - return CLASS_SCOUT; - if(substring(self.playermodel,13,3) - == "spy") - return CLASS_SPY; - if(substring(self.playermodel,13,7) - == "soldier") - return CLASS_SOLDIER; - if(substring(self.playermodel,13,4) - == "pyro") - return CLASS_PYRO; - if(substring(self.playermodel,13,5) - == "medic") - return CLASS_MEDIC; - if(substring(self.playermodel,13,8) - == "engineer") - return CLASS_ENGINEER; - - return -1; -} - -/* -============= -ChangeClass - -Changes the player's class -============= -*/ - -void ChangeClass(float announce_change, float instant_change) -{ - float portion, aportion; - if(announce_change) - bprint(self.netname, " becomes a ", NameOfClass(self.class), "\n"); - - portion = 1.0; - - if(instant_change) - { - // health - if(self.health < self.max_health) - aportion = self.health / self.max_health; - else - aportion = 1.0; - - if(aportion < portion) - portion = aportion; - - // armor - if(self.armorvalue < self.max_armor) - aportion = self.armorvalue / self.max_armor; - else - aportion = 1.0; - - if(aportion < portion) - portion = aportion; - } - - if(self.class == CLASS_SCOUT) - BecomeScout(portion); - - if(self.class == CLASS_SPY) - BecomeSpy(portion); - - if(self.class == CLASS_SOLDIER) - BecomeSoldier(portion); - - if(self.class == CLASS_PYRO) - BecomePyro(portion); - - if(self.class == CLASS_MEDIC) - BecomeMedic(portion); - - if(self.class == CLASS_ENGINEER) - BecomeEngineer(portion); - - // set starting health - if(!instant_change)//portion == 1.0) - self.health = ceil(self.max_health * 1.2); - else - self.health = self.max_health; - // set starting armor - if(!instant_change)//portion == 1.0) - self.armorvalue = ceil(self.max_armor * 1.2); - else - self.armorvalue = self.max_armor; - - // test code - //if(instant_change) - // self.health = 2 + self.health * 0.8; -}; - -float SetPlayerMass(entity pl) -{ - float m, extra_mass; - if(self.class == CLASS_SCOUT) - { - m = cvar("g_balance_class_scout_mass"); - } - else if(self.class == CLASS_SPY) - { - m = cvar("g_balance_class_spy_mass"); - } - else if(self.class == CLASS_SOLDIER) - { - m = cvar("g_balance_class_soldier_mass"); - } - else if(self.class == CLASS_PYRO) - { - m = cvar("g_balance_class_pyro_mass"); - } - else if(self.class == CLASS_MEDIC) - { - m = cvar("g_balance_class_medic_mass"); - } - else if(self.class == CLASS_ENGINEER) - { - m = cvar("g_balance_class_engineer_mass"); - } - else - m = cvar("sv_maxspeed"); - - // fixme: if I'm carrying a flag or extra weapon, add that mass - extra_mass = 0; - - if(self.wpn5.mass) - extra_mass = extra_mass + self.wpn5.mass; - - - self.mass = m + extra_mass; - - return m; // return what my natural mass is -}; - -void SetPlayerSpeed(entity pl) -{ - local float s, m, plmass; - string temp; - if(self.class == CLASS_SCOUT) - { - s = cvar("g_balance_class_scout_speed"); - //m = cvar("g_balance_class_scout_mass"); - } - else if(self.class == CLASS_SPY) - { - s = cvar("g_balance_class_spy_speed"); - //m = cvar("g_balance_class_spy_mass"); - } - else if(self.class == CLASS_SOLDIER) - { - s = cvar("g_balance_class_soldier_speed"); - //m = cvar("g_balance_class_soldier_mass"); - } - else if(self.class == CLASS_PYRO) - { - s = cvar("g_balance_class_pyro_speed"); - //m = cvar("g_balance_class_pyro_mass"); - } - else if(self.class == CLASS_MEDIC) - { - s = cvar("g_balance_class_medic_speed"); - //m = cvar("g_balance_class_medic_mass"); - } - else if(self.class == CLASS_ENGINEER) - { - s = cvar("g_balance_class_engineer_speed"); - //m = cvar("g_balance_class_engineer_mass"); - } - - - // fixme: if I'm in a manned turret, set my speed to 0 - // fixme: if I'm piloting a vehicle, what to do? - - - // if my mass is different because of what I'm carrying, - // slow me down - - m = SetPlayerMass(pl); - - if(pl.mass == 0) - plmass = 1; - else - plmass = pl.mass; - s = ceil( s * (m / plmass ) ); - - if(s != pl.speed) - { - //bprint("debug: adjusting speed\n"); - temp = ftos(s); - - //stuffcmd( pl, strcat("cl_movement_maxspeed ", temp , "\n")); - //stuffcmd( pl, strcat("cl_movement_maxairspeed ", temp , "\n")); - - //stuffcmd( pl, strcat("cl_forwardspeed ", temp , "\n")); - //stuffcmd( pl, strcat("cl_backspeed ", temp , "\n")); - //stuffcmd( pl, strcat("cl_sidespeed ", temp , "\n")); - //stuffcmd( pl, strcat("cl_upspeed ", temp , "\n")); - } - - pl.speed = s; -} - - - -/* -============= -ResetPlayerModel - -Resets the player's model to what it should be when returning from invisibility, - or trying to change class but not being allowed. -============= -*/ - -void ResetPlayerModel(entity pl) -{ - local vector m1, m2; - m1 = pl.mins; - m2 = pl.maxs; - //precache_model (self.playermodel); needed? - setmodel (pl, pl.playermodel); - setsize (pl, m1, m2); -} - -/* -============= -CheckForClassChange - -Returns the player's class by checking his model. -Called from PlayerPreThink whenever the player changes his model, before change is made. -============= -*/ - -void() respawn; -float CheckForClassChange() -{ - float cl; - - // FIXME: need an option to not allow class changes at all once the player has changed once - - //bprint("check if allow change\n"); - - // don't monitor the player's model when he's dead. - // this means he can change class when dead and respawn as the new class. - if(self.health <= 0) // fixme: or if player is an observer - return 0; - - //bprint("healthy\n"); - - if(self.playermodel == self.mdl) - return 0; // haven't changed models since last legitimate change - - //bprint("model has changed\n"); - - cl = GetPlayerClass(); - if(self.class == cl) // changed models, but it didn't affect my class - { - if(self.change_mdl_on_respawn) // if was going to change class, but I just switched models of the same class I'm in now, undo the future class change - self.change_mdl_on_respawn = ""; - return 0; - } - - //bprint("class changed\n"); - - - // it's changed; now figure out what to do about it - - // don't allow player class - if(cvar("g_classchange_not_allowed")) - { - self.playermodel = self.mdl; // return to old model - ResetPlayerModel(self); - - /*local vector m1, m2; - self.playermodel = self.model; // return to old model - m1 = self.mins; - m2 = self.maxs; - //precache_model (self.playermodel); needed? - setmodel (self, self.playermodel); - setsize (self, m1, m2);*/ - return 0; - } - - // allow change, but don't take effect until death - if(cvar("g_classchange_delay_until_death")) - { - self.change_mdl_on_respawn = self.playermodel; - self.change_mdl_on_respawn = strzone(self.change_mdl_on_respawn); - self.playermodel = self.model; - if (self.team_no > 0) - sprint(self, "You will change class after you die\n"); - return 0; - } - - // allow change, possibly with stipulations (like force respawn) - - //bprint("allowing change\n"); - - if(self.class == CLASS_SPY) - SpyDecloak(); - - self.class = cl; - //self.mdl = strzone(self.playermodel); - - - // allow change, but instant kill & respawn - if(cvar("g_classchange_force_respawn")) - { - PlayerKilled(TRUE, world, world, 1, DEATH_CLASSCHANGE, '0 0 0', '0 0 0'); - respawn(); - return 1; - } - - // allow class change without a hitch - ChangeClass(TRUE, TRUE); - return 0; -} - -void ClassSpecial() -{ - if(self.class == CLASS_SCOUT) - ScoutSpecial(); - if(self.class == CLASS_SPY) - SpySpecial(); - if(self.class == CLASS_SOLDIER) - SoldierSpecial(); - if(self.class == CLASS_PYRO) - PyroSpecial(); - if(self.class == CLASS_MEDIC) - MedicSpecial(); - if(self.class == CLASS_ENGINEER) - EngineerSpecial(); -} - -void ClassGrenade(float req) -{ - if(self.grenade_time > time) - return; - - if(self.class == CLASS_SCOUT) - ScoutGrenade(req); - if(self.class == CLASS_SPY) - SpyGrenade(req); - if(self.class == CLASS_SOLDIER) - SoldierGrenade(req); - if(self.class == CLASS_PYRO) - PyroGrenade(req); - if(self.class == CLASS_MEDIC) - MedicGrenade(req); - if(self.class == CLASS_ENGINEER) - EngineerGrenade(req); -} - -void ClassPreThink() -{ - if(self.class == CLASS_SCOUT) - ScoutPreThink(); - if(self.class == CLASS_SPY) - SpyPreThink(); - if(self.class == CLASS_SOLDIER) - SoldierPreThink(); - if(self.class == CLASS_PYRO) - PyroPreThink(); - if(self.class == CLASS_MEDIC) - MedicPreThink(); - if(self.class == CLASS_ENGINEER) - EngineerPreThink(); -} - -void ClassPostThink() -{ - if(self.class == CLASS_SCOUT) - ScoutPostThink(); - if(self.class == CLASS_SPY) - SpyPostThink(); - if(self.class == CLASS_SOLDIER) - SoldierPostThink(); - if(self.class == CLASS_PYRO) - PyroPostThink(); - if(self.class == CLASS_MEDIC) - MedicPostThink(); - if(self.class == CLASS_ENGINEER) - EngineerPostThink(); -} - -/* -========================= - Set MaxAmmo for classes - Wazat - edit these values to whatever - ========================= -*/ -void (float classnum) SetMaxAmmoFor = -{ - // if no class is found, it will just default to these - self.maxammo_shells = 200; - self.maxammo_nails = 200; - self.maxammo_cells = 40; - self.maxammo_rockets = 40; - self.no_grenades_1 = 4; - self.clip_rockets = 4; - - if (classnum == CLASS_SCOUT) // Scout Supplies - { - self.maxammo_shells = 200; - self.maxammo_nails = 200; - self.maxammo_cells = 40; - self.maxammo_rockets = 40; - self.clip_crylink = CLIP_MAX_CRYLINK; - } - else if (classnum == 2) { // Spy supplies - self.maxammo_shells = 150; - self.maxammo_nails = 80; - self.maxammo_cells = 70; - self.maxammo_rockets = 15; - } - else if (classnum == CLASS_SOLDIER) { - self.maxammo_rockets = 40; - } - else if (classnum == CLASS_PYRO) { - self.clip_pipegrenades = 6; - } -}; diff --git a/TeamNexuiz/game/gamec/constants.h b/TeamNexuiz/game/gamec/constants.h deleted file mode 100644 index 4312b9f8f..000000000 --- a/TeamNexuiz/game/gamec/constants.h +++ /dev/null @@ -1,200 +0,0 @@ - -float FALSE = 0; -float TRUE = 1; - -float FL_FLY = 1; -float FL_SWIM = 2; -float FL_CLIENT = 8; -float FL_INWATER = 16; -float FL_MONSTER = 32; -float FL_GODMODE = 64; -float FL_NOTARGET = 128; -float FL_ITEM = 256; -float FL_ONGROUND = 512; -float FL_PARTIALGROUND = 1024; -float FL_WATERJUMP = 2048; -float FL_JUMPRELEASED = 4096; -float FL_WEAPON = 8192; -float FL_POWERUP = 16384; - -float MOVETYPE_NONE = 0; -float MOVETYPE_ANGLENOCLIP = 1; -float MOVETYPE_ANGLECLIP = 2; -float MOVETYPE_WALK = 3; -float MOVETYPE_STEP = 4; -float MOVETYPE_FLY = 5; -float MOVETYPE_TOSS = 6; -float MOVETYPE_PUSH = 7; -float MOVETYPE_NOCLIP = 8; -float MOVETYPE_FLYMISSILE = 9; -float MOVETYPE_BOUNCE = 10; -//float MOVETYPE_BOUNCEMISSILE = 11; // Like bounce but doesn't lose speed on bouncing -//float MOVETYPE_FOLLOW = 12; // 'Attaches' the entity to its aim_ent - -float SOLID_NOT = 0; -float SOLID_TRIGGER = 1; -float SOLID_BBOX = 2; -float SOLID_SLIDEBOX = 3; -float SOLID_BSP = 4; -//float SOLID_CORPSE = 5; // Unobstructed by CORPSE or SLIDEBOX - -float DEAD_NO = 0; -float DEAD_DYING = 1; -float DEAD_DEAD = 2; -float DEAD_RESPAWNABLE = 3; - -float DAMAGE_NO = 0; -float DAMAGE_YES = 1; -float DAMAGE_AIM = 2; - -float CONTENT_EMPTY = -1; -float CONTENT_SOLID = -2; -float CONTENT_WATER = -3; -float CONTENT_SLIME = -4; -float CONTENT_LAVA = -5; -float CONTENT_SKY = -6; - -float SVC_BAD = 0; -float SVC_NOP = 1; -float SVC_DISCONNECT = 2; -float SVC_UPDATESTAT = 3; -float SVC_VERSION = 4; -float SVC_SETVIEW = 5; -float SVC_SOUND = 6; -float SVC_TIME = 7; -float SVC_PRINT = 8; -float SVC_STUFFTEXT = 9; -float SVC_SETANGLE = 10; -float SVC_SERVERINFO = 11; -float SVC_LIGHTSTYLE = 12; -float SVC_UPDATENAME = 13; -float SVC_UPDATEFRAGS = 14; -float SVC_CLIENTDATA = 15; -float SVC_STOPSOUND = 16; -float SVC_UPDATECOLORS = 17; -float SVC_PARTICLE = 18; -float SVC_DAMAGE = 19; -float SVC_SPAWNSTATIC = 20; -float SVC_SPAWNBINARY = 21; -float SVC_SPAWNBASELINE = 22; -float SVC_TEMPENTITY = 23; -float SVC_SETPAUSE = 24; -float SVC_SIGNONNUM = 25; -float SVC_CENTERPRINT = 26; -float SVC_KILLEDMONSTER = 27; -float SVC_FOUNDSECRET = 28; -float SVC_SPAWNSTATICSOUND = 29; -float SVC_INTERMISSION = 30; -float SVC_FINALE = 31; -float SVC_CDTRACK = 32; -float SVC_SELLSCREEN = 33; -float SVC_CUTSCENE = 34; - -float TE_SPIKE = 0; -float TE_SUPERSPIKE = 1; -float TE_GUNSHOT = 2; -float TE_EXPLOSION = 3; -float TE_TAREXPLOSION = 4; -float TE_LIGHTNING1 = 5; -float TE_LIGHTNING2 = 6; -float TE_WIZSPIKE = 7; -float TE_KNIGHTSPIKE = 8; -float TE_LIGHTNING3 = 9; -float TE_LAVASPLASH = 10; -float TE_TELEPORT = 11; - -float CHAN_AUTO = 0; -float CHAN_WEAPON = 1; -float CHAN_VOICE = 2; -float CHAN_ITEM = 3; -float CHAN_BODY = 4; -float CHAN_IMPACT = 5; - -float ATTN_NONE = 0; -float ATTN_NORM = 0.5; -float ATTN_IDLE = 2; -float ATTN_STATIC = 3; - -float UPDATE_GENERAL = 0; -float UPDATE_STATIC = 1; -float UPDATE_BINARY = 2; -float UPDATE_TEMP = 3; - -float EF_BRIGHTFIELD = 1; -float EF_MUZZLEFLASH = 2; -float EF_BRIGHTLIGHT = 4; -float EF_DIMLIGHT = 8; - -float MSG_BROADCAST = 0; -float MSG_ONE = 1; -float MSG_ALL = 2; -float MSG_INIT = 3; - -// Deathtypes (weapon deathtypes are WEP_*) -float DEATH_FALL = 10000; -float DEATH_TELEFRAG = 10001; -float DEATH_DROWN = 10002; -float DEATH_HURTTRIGGER = 10003; -float DEATH_LAVA = 10004; -float DEATH_SLIME = 10005; -float DEATH_KILL = 10006; -float DEATH_CLASSCHANGE = 10007; -float DEATH_BURNING = 10008; -float DEATH_LASERGATE = 10009; - -float IT_LASER = 4096; -float IT_SHOTGUN = 1; -float IT_UZI = 2; -float IT_GRENADE_LAUNCHER = 4; -float IT_ELECTRO = 8; -float IT_CRYLINK = 16; -float IT_NEX = 32; -float IT_HAGAR = 64; -float IT_ROCKET_LAUNCHER = 128; - -float IT_WEP1 = 4096; -float IT_WEP2 = 1; -float IT_WEP3 = 2; -float IT_WEP4 = 4; -float IT_WEP5 = 8; - -float IT_SHELLS = 256; -float IT_NAILS = 512; -float IT_ROCKETS = 1024; -float IT_CELLS = 2048; - -float IT_STRENGTH = 8192; -float IT_INVINCIBLE = 16384; -//float IT_SPEED = 32768; -//float IT_SLOWMO = 65536; - -float IT_KEY1 = 131072; -float IT_KEY2 = 262144; - -vector PL_VIEW_OFS = '0 0 35'; -vector PL_MIN = '-16 -16 -24'; -vector PL_MAX = '16 16 45'; -vector PL_CROUCH_VIEW_OFS = '0 0 15'; -vector PL_CROUCH_MIN = '-16 -16 -24'; -vector PL_CROUCH_MAX = '16 16 25'; - -// Sajt - added these, just as constants. Not sure how you want them actually put in the game, but I just -// did this so at least they worked -// NOTE: instagib IS NOT compatible with rocket-arena, so make sure to prevent selecting both in a menu -//float GAME_INSTAGIB = 1; /// everyone gets the nex gun with infinite ammo, and one shot kills -//float GAME_ROCKET_ARENA = 16; /// Everyone starts with a rocket launcher -//float GAME_FULLBRIGHT_PLAYERS = 64; /// makes the players model fullbright -//float GAME_TEAMS = 128; /// Teams, red/green/yellow/blue - -float game; // set to "gamecfg" on worldspawn - - -//float POWERUP_STRENGTH_DAMAGE = 2; // damage multiplier for strength powerup -//float POWERUP_STRENGTH_FORCE = 4; // force multiplier for strength powerup - -//float POWERUP_INVINCIBLE_TAKEDAMAGE = 0.2; // received damage multiplier for invincible powerup - - - -float TE_BEAM = 13; // grappling hook - diff --git a/TeamNexuiz/game/gamec/ctf.c b/TeamNexuiz/game/gamec/ctf.c deleted file mode 100644 index 1e3a8f4b4..000000000 --- a/TeamNexuiz/game/gamec/ctf.c +++ /dev/null @@ -1,396 +0,0 @@ - -.entity flagcarried; - -float FLAGSCORE_PICKUP = 1; -float FLAGSCORE_RETURN = 5; // returned by owner team -float FLAGSCORE_RETURNROGUE = 10; // returned by rogue team -float FLAGSCORE_CAPTURE = 5; -float FLAGSCORE_CAPTURE_TEAM = 20; - -float FLAG_BASE = 1; -float FLAG_CARRY = 2; -float FLAG_DROPPED = 3; - -void() FlagThink; -void() FlagTouch; - -void() place_flag = -{ - self.mdl = self.model; - self.flags = FL_ITEM; - self.solid = SOLID_TRIGGER; - self.movetype = MOVETYPE_TOSS; - self.velocity = '0 0 0'; - self.origin_z = self.origin_z + 6; - self.think = FlagThink; - self.touch = FlagTouch; - self.nextthink = time + 0.1; - self.cnt = FLAG_BASE; - self.mangle = self.angles; - self.effects = self.effects | EF_DIMLIGHT; - if (!droptofloor(0, 0)) - { - dprint("Flag fell out of level at ", vtos(self.origin), "\n"); - remove(self); - return; - } - self.oldorigin = self.origin; -}; - -void(entity e) RegenFlag = -{ - e.movetype = MOVETYPE_TOSS; - e.solid = SOLID_TRIGGER; - // TODO: play a sound here - sound (e, CHAN_AUTO, self.noise3, 1, ATTN_NONE); - setorigin(e, e.oldorigin); - e.angles = e.mangle; - e.cnt = FLAG_BASE; - e.owner = world; - e.flags = FL_ITEM; // clear FL_ONGROUND and any other junk -}; - -void(entity e) ReturnFlag = -{ - if (e.owner) - if (e.owner.flagcarried == e) - e.owner.flagcarried = world; - e.owner = world; - RegenFlag(e); -}; - -void(entity e) DropFlag = -{ - local entity p; - - if (!e.owner) - { - dprint("FLAG: drop - no owner?!?!\n"); - return; - } - p = e.owner; - if (p.flagcarried != e) - { - dprint("FLAG: drop - owner is not carrying this flag??\n"); - return; - } - bprint(p.netname); - if (e.team == 5) - bprint(" lost the RED flag\n"); - else - bprint(" lost the BLUE flag\n"); - if (p.flagcarried == e) - p.flagcarried = world; - e.owner = world; - - e.flags = FL_ITEM; // clear FL_ONGROUND and any other junk - e.solid = SOLID_TRIGGER; - e.movetype = MOVETYPE_TOSS; - // setsize(e, '-16 -16 0', '16 16 74'); - setorigin(e, p.origin - '0 0 24'); - e.cnt = FLAG_DROPPED; - e.velocity = '0 0 300'; - e.pain_finished = time + 30; -}; - -void() FlagThink = -{ - local entity e; - local vector v; - local float f; - - self.nextthink = time + 0.1; - - if (self.cnt == FLAG_BASE) - return; - - if (self.cnt == FLAG_DROPPED) - { - if (time > self.pain_finished) - { - if (self.team == 5) - bprint("The RED flag has returned to base\n"); - else - bprint("The BLUE flag has returned to base\n"); - ReturnFlag(self); - } - return; - } - - e = self.owner; - if (e.classname != "player" || (e.deadflag) || (e.flagcarried != self)) - { - DropFlag(self); - return; - } - - // borrowed from threewave CTF, because it would be way too much work - - makevectors (e.angles); - v = v_forward; - v_z = 0 - v_z; // reverse z - - f = 14; - /* - if (e.frame >= 29 && e.frame <= 40) - { - if (e.frame >= 29 && e.frame <= 34) - { - //axpain - if (e.frame == 29) f = f + 2; - else if (e.frame == 30) f = f + 8; - else if (e.frame == 31) f = f + 12; - else if (e.frame == 32) f = f + 11; - else if (e.frame == 33) f = f + 10; - else if (e.frame == 34) f = f + 4; - } - else if (e.frame >= 35 && e.frame <= 40) - { - // pain - if (e.frame == 35) f = f + 2; - else if (e.frame == 36) f = f + 10; - else if (e.frame == 37) f = f + 10; - else if (e.frame == 38) f = f + 8; - else if (e.frame == 39) f = f + 4; - else if (e.frame == 40) f = f + 2; - } - } - else if (e.frame >= 103 && e.frame <= 118) - { - if (e.frame >= 103 && e.frame <= 104) f = f + 6; //nailattack - else if (e.frame >= 105 && e.frame <= 106) f = f + 6; //light - else if (e.frame >= 107 && e.frame <= 112) f = f + 7; //rocketattack - else if (e.frame >= 112 && e.frame <= 118) f = f + 7; //shotattack - } - */ - self.angles = e.angles + '0 0 -45'; - setorigin (self, e.origin + '0 0 -16' - f*v + v_right * 22); - self.nextthink = time + 0.01; -}; - -float flagcaptimerecord; -.float flagpickuptime; - -void() FlagTouch = -{ - local float t; - local entity head; - if (other.classname != "player") - return; - if (other.health < 1) // ignore dead players - return; - - if (self.cnt == FLAG_CARRY) - return; - - if (self.cnt == FLAG_BASE) - if (other.team == self.team) - if (other.flagcarried) // he's got a flag - if (other.flagcarried.team != self.team) // capture - { - t = time - other.flagpickuptime; - if (flagcaptimerecord == 0) - { - if (other.flagcarried.team == 5) - bprint(other.netname, " captured the RED flag in ", ftos(t), " seconds\n"); - else - bprint(other.netname, " captured the BLUE flag in ", ftos(t), " seconds\n"); - flagcaptimerecord = t; - } - else if (t < flagcaptimerecord) - { - if (other.flagcarried.team == 5) - bprint(other.netname, " captured the RED flag in ", ftos(t), ", breaking the previous record of", ftos(flagcaptimerecord), " seconds\n"); - else - bprint(other.netname, " captured the BLUE flag in ", ftos(t), ", breaking the previous record of", ftos(flagcaptimerecord), " seconds\n"); - flagcaptimerecord = t; - } - else - { - if (other.flagcarried.team == 5) - bprint(other.netname, " captured the RED flag in ", ftos(t), ", failing to break the previous record of", ftos(flagcaptimerecord), " seconds\n"); - else - bprint(other.netname, " captured the BLUE flag in ", ftos(t), ", failing to break the previous record of", ftos(flagcaptimerecord), " seconds\n"); - } - other.frags = other.frags + FLAGSCORE_CAPTURE; - head = find(head, classname, "player"); - while (head) - { - if (head.team == self.goalentity.team) - head.frags = head.frags + FLAGSCORE_CAPTURE_TEAM; - head = find(head, classname, "player"); - } - sound (self, CHAN_AUTO, self.noise2, 1, ATTN_NONE); - ReturnFlag(other.flagcarried); - } - if (self.cnt == FLAG_BASE) - if (other.team == 5 || other.team == 14) // only red and blue team can steal flags - if (other.team != self.team) - if (!other.flagcarried) - { - // pick up - other.flagpickuptime = time; // used for timing runs - self.solid = SOLID_NOT; - setorigin(self, self.origin); // relink - self.owner = other; - other.flagcarried = self; - self.cnt = FLAG_CARRY; - if (other.flagcarried.team == 5) - bprint(other.netname, " got the RED flag\n"); - else - bprint(other.netname, " got the BLUE flag\n"); - other.frags = other.frags + FLAGSCORE_PICKUP; - sound (self, CHAN_AUTO, self.noise, 1, ATTN_NONE); - return; - } - - if (self.cnt == FLAG_DROPPED) - { - self.flags = FL_ITEM; // clear FL_ONGROUND and any other junk - if (other.team == self.team || (other.team != 5 && other.team != 14)) - { - // return flag - if (self.team == 5) - bprint(other.netname, " returned the RED flag\n"); - else - bprint(other.netname, " returned the BLUE flag\n"); - if (other.team == 5 || other.team == 14) - other.frags = other.frags + FLAGSCORE_RETURN; - else - other.frags = other.frags + FLAGSCORE_RETURNROGUE; - sound (self, CHAN_AUTO, self.noise1, 1, ATTN_NONE); - ReturnFlag(self); - } - else if (!other.flagcarried) - { - // pick up - other.flagpickuptime = time; // used for timing runs - self.solid = SOLID_NOT; - setorigin(self, self.origin); // relink - self.owner = other; - other.flagcarried = self; - self.cnt = FLAG_CARRY; - if (self.team == 5) - bprint(other.netname, " picked up the RED flag\n"); - else - bprint(other.netname, " picked up the BLUE flag\n"); - other.frags = other.frags + FLAGSCORE_PICKUP; - sound (self, CHAN_AUTO, self.noise, 1, ATTN_NONE); - } - } -}; - -/*QUAKED info_player_team1 (1 0 0) (-16 -16 -24) (16 16 24) -CTF Starting point for a player -in team one (Red). - -Keys: -"angle" - viewing angle when spawning -*/ -//void() info_player_team1 = {};//self.team = 4;self.classname = "info_player_start";info_player_start();}; - -/*QUAKED info_player_team2 (1 0 0) (-16 -16 -24) (16 16 24) -CTF Starting point for a player in -team two (Blue). - -Keys: -"angle" - viewing angle when spawning -*/ -//void() info_player_team2 = {};//self.team = 13;self.classname = "info_player_start";info_player_start();}; - -/*QUAKED item_flag_team1 (0 0.5 0.8) (-48 -48 -24) (48 48 64) -CTF flag for team one (Red). -Multiple are allowed. - -Keys: -"angle" - Angle the flag will point -(minus 90 degrees) -"model" - model to use, note this needs red and blue as skins 0 and 1 - (default models/ctf/flag.md3) -"noise" - sound played when flag is picked up - (default ctf/take.wav) -"noise1" - sound played when flag is returned by a teammate - (default ctf/return.wav) -"noise2" - sound played when flag is captured - (default ctf/capture.wav) -"noise3" - sound played when flag is lost in the field and respawns itself - (default ctf/respawn.wav) -*/ - -/*void() item_flag_team1 = -{ - if (!cvar("g_ctf")) - return; - self.team = 5; // color 4 team (red) - self.items = IT_KEY2; // gold key (redish enough) - self.skin = 0; - if (!self.model) - self.model = "models/ctf/flag.md3"; - if (!self.noise) - self.noise = "ctf/take.wav"; - if (!self.noise1) - self.noise1 = "ctf/return.wav"; - if (!self.noise2) - self.noise2 = "ctf/capture.wav"; - if (!self.noise3) - self.noise3 = "ctf/respawn.wav"; - precache_model (self.model); - setmodel (self, self.model); - precache_sound (self.noise); - precache_sound (self.noise1); - precache_sound (self.noise2); - precache_sound (self.noise3); - setsize(self, '-16 -16 0', '16 16 74'); - self.nextthink = time + 0.2; // start after doors etc - self.think = place_flag; -}; -*/ - -/*QUAKED item_flag_team2 (0 0.5 0.8) (-48 -48 -24) (48 48 64) -CTF flag for team two (Blue). -Multiple are allowed. - -Keys: -"angle" - Angle the flag will point -(minus 90 degrees) - -*/ - -/* -void() item_flag_team2 = -{ - if (!cvar("g_ctf")) - return; - self.team = 14; // color 13 team (blue) - self.items = IT_KEY1; // silver key (bluish enough) - self.skin = 1; - if (!self.model) - self.model = "models/ctf/flag.md3"; - if (!self.noise) - self.noise = "ctf/take.wav"; - if (!self.noise1) - self.noise1 = "ctf/return.wav"; - if (!self.noise2) - self.noise2 = "ctf/capture.wav"; - if (!self.noise3) - self.noise3 = "ctf/respawn.wav"; - precache_model (self.model); - setmodel (self, self.model); - precache_sound (self.noise); - precache_sound (self.noise1); - precache_sound (self.noise2); - precache_sound (self.noise3); - setsize(self, '-16 -16 0', '16 16 74'); - self.nextthink = time + 0.2; // start after doors etc - self.think = place_flag; -}; -*/ diff --git a/TeamNexuiz/game/gamec/defs.h b/TeamNexuiz/game/gamec/defs.h deleted file mode 100644 index a265f2556..000000000 --- a/TeamNexuiz/game/gamec/defs.h +++ /dev/null @@ -1,250 +0,0 @@ - -// Globals - -entity activator; -string string_null; - -//entity casing; -entity dest; - -// Fields - -.void(entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) event_damage; - -//.string wad; -//.string map; - -//.float worldtype; -.float delay; -.float wait; -.float lip; -//.float light_lev; -.float speed; -//.float style; -//.float skill; - -.string killtarget; - -.vector pos1, pos2; -.vector mangle; - -.float jump_flag; // storing velocity_z for falling damage -.float attack_finished; -.float pain_finished; //Added by Supajoe -.float pain_frame; //" -.float statdraintime; // record the one-second intervals between draining health and armour when they're over 100 -.float crouch; // Crouching or not? - -.float strength_finished; -//.float speed_finished; -.float invincible_finished; -//.float slowmo_finished; - -.vector finaldest, finalangle; //plat.qc stuff -.void() think1; -.float state; -.float t_length, t_width; - -.vector dest1; -.vector dest2; -.vector destvec; // for rain -.float cnt; // for rain -.float count; -//.float cnt2; - -.float death_time; -.float dead_time; -.float dead_frame; -.float die_frame; -.float fade_time; -.float fade_rate; - -.string mdl; - -.string playermodel; -.string playerskin; - -.float respawntime; -//.float chasecam; - -.float electrocount; -//.float crylinkcount; - -.float damageforcescale; - -//.float gravity; - -.float dmg; - -// for railgun damage (hitting multiple enemies) -.float railgunhit; -.float railgunhitsolidbackup; -.vector railgunhitloc; - -.float air_finished; -.float dmgtime; - -.float killcount; - -// definistions for weaponsystem - -.entity weaponentity; -.entity exteriorweaponentity; -.float switchweapon; -void(float wpn, float wrequest) weapon_action; -float(entity cl, float wpn, float andammo) client_hasweapon; -void() w_clear; -// VorteX: standalone think for weapons, so normal think on weaponentity can be reserved by weaponflashes (which needs update even player dies) -.float weapon_nextthink; -.void() weapon_think; -.vector shotdir, shotorg; // new generic aiming system for all weapons (not finished yet, can be removed) -float weapon_hasammo; // sets by WR_CHECKAMMO request - -//float PLAYER_WEAPONSELECTION_DELAY = ); -float PLAYER_WEAPONSELECTION_SPEED = 18; -vector PLAYER_WEAPONSELECTION_RANGE = '0 20 -40'; - -// weapon states (self.weaponentity.state) -float WS_CLEAR = 0; // no weapon selected -float WS_RAISE = 1; // raise frame -float WS_DROP = 2; // deselecting frame -float WS_INUSE = 3; // fire state -float WS_READY = 4; // idle frame - -// weapon requests -float WR_SETUP = 1; // setup weapon data -float WR_UPDATECOUNTS = 2; // update ammo display -float WR_IDLE = 3; // idle frame -float WR_DROP = 4; // deselect frame -float WR_RAISE = 5; // select frame -float WR_FIRE1 = 6; // primary fire frame -float WR_FIRE2 = 7; // secondary fire -float WR_FIRE3 = 8; // third fire -float WR_CHECKAMMO = 9; // checks ammo for weapon -float WR_CLEAR = 10; // runs afted deselecting frames, remove weapon parts (if presented). This useful for quake3-style chaingun - -// not part of weapon requests, but almost was, thus the naming convention -float WR_GRENADE1 = 11; -float WR_GRENADE2 = 12; - -// Weapon indexes -float WEP_LASER = 1; // float IT_LASER = 4096; -float WEP_SHOTGUN = 2; // float IT_SHOTGUN = 1; -float WEP_UZI = 3; // float IT_UZI = 2; -float WEP_GRENADE_LAUNCHER = 4; // float IT_GRENADE_LAUNCHER = 4; -float WEP_ELECTRO = 5; // float IT_ELECTRO = 8; -float WEP_CRYLINK = 6; // float IT_CRYLINK = 16; -float WEP_NEX = 7; // float IT_NEX = 32; -float WEP_HAGAR = 8; // float IT_HAGAR = 64; -float WEP_ROCKET_LAUNCHER = 9; // float IT_ROCKET_LAUNCHER = 128; -float WEP_BOMBLETTS = 10; -float WEP_ROCKET_INCENDIARY = 11; -float WEP_FLAMER = 12; -float WEP_HOTBOMBS = 13; -float WEP_GRAPPLE = 14; -float WEP_NAMEK = 15; - -float WEP_SCOUT_SPECIAL = 50; -float WEP_SPY_SPECIAL = 51; -float WEP_SOLDIER_SPECIAL = 52; -float WEP_PYRO_SPECIAL = 53; -float WEP_MEDIC_SPECIAL = 54; -float WEP_ENGINEER_SPECIAL = 55; - -float WEP_GRENADE_MIRV = 60; -float WEP_GRENADE_FRAG = 61; - -float WEP1 = 1; -float WEP2 = 2; -float WEP3 = 3; -float WEP4 = 4; -float WEP5 = 5; - -// For weapon cycling commands -float WEP_FIRST = 1; -float WEP_LAST = 5;//9; - - - - - - - -// class definitions - -float CLASS_SCOUT = 1; -float CLASS_SPY = 2; -float CLASS_SOLDIER = 4; -float CLASS_PYRO = 8; -float CLASS_MEDIC = 16; -float CLASS_ENGINEER = 32; - -.float team_no; - -.float class; -.float max_health; -.float max_armor; -.float mass; -.float wpn; // the weapon that's in the slot I've selected -.entity wpn5; // what weapon I'm holding in my extra (5th) slot -//.float oldclass; -.string change_mdl_on_respawn; // for changing class after death - -.float special_active; -.float special_time; - -.float grenade_time; - -.float jump_pad; // true if just hit a jump pad (don't slow player when jump pads launch him) - -.entity onfire; // world if not on fire, otherwise points to entity burning you -.float flame_heat; // starts at 0. Being near someone on fire raises it. When it hits 1, the flame spreads to you. -.float flame_heat_time; // set when near a fire so code elsewhere knows to heat up instead of cool down - -.float poison_damage; // total damage poison will deal over time -.float poison_rate; // how fast to deal the poison - -.float create_time; // tracks the time an entity was created to we can know which - // is the oldest when limiting the player's # of turrets or - // hotbombs, for example - - -.float buttonuse; // 1 if player is using +use - - -// health regen/rot -.float health_regen_delay; -.float health_rot_delay; -.float armor_regen_delay; -.float armor_rot_delay; - -void DelayHealthRegen(entity e); -void DelayHealthRot(entity e); -void DelayArmorRegen(entity e); -void DelayArmorRot(entity e); - - -// grappling hook -.entity hook; -void GrapplingHookFrame(); -void RemoveGrapplingHook(entity pl); - - - -string NameOfClass(float cl); -float GetPlayerClass(); -void ResetPlayerModel(entity pl); -void SetPlayerSpeed(entity pl); - - -// entity limiting function, to limit # of bombs etc a player can have. -float W_LimitNumEnts(string clname, float num_allowed, void() DeathFunc); - -// functions to let players cross lasergates -void PlayerLasergatePreThink(); -void PlayerLasergatePostThink(); - -void SpyCloakFlicker(entity pl); - -// BH Test Var -.float air_time; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/domination.c b/TeamNexuiz/game/gamec/domination.c deleted file mode 100644 index 21e6b9982..000000000 --- a/TeamNexuiz/game/gamec/domination.c +++ /dev/null @@ -1,239 +0,0 @@ - -/* -Domination as a plugin for netquake mods -by LordHavoc (lordhavoc@ghdigital.com) - -How to add domination points to a mod: -1. Add this line to progs.src above world.qc: -domination.qc -2. Comment out all lines in ClientObituary in client.qc that begin with targ.frags or attacker.frags. -3. Add this above worldspawn in world.qc: -void() dom_init; -4. Add this line to the end of worldspawn in world.qc: -dom_init(); - -Note: The only teams who can use dom control points are identified by dom_team entities (if none exist these default to red and blue and use only quake models/sounds). -*/ - -void() dom_spawnteams; - -void() dompointthink = -{ - local entity head; - self.nextthink = time + 3; - if (!self.goalentity.netname) - return; - head = find(head, classname, "player"); - while (head) - { - if (head.team == self.goalentity.team) - head.frags = head.frags + 1; - head = find(head, classname, "player"); - } -}; - -void() dompointtouch = -{ - local entity head; - if (other.classname != "player") - return; - if (other.health < 1) - return; - // only valid teams can claim it - head = find(world, classname, "dom_team"); - while (head && head.team != other.team) - head = find(head, classname, "dom_team"); - if (!head || head.netname == "" || head == self.goalentity) - return; - - self.goalentity = head; - self.model = head.mdl; - self.modelindex = head.dmg; - self.skin = head.skin; - - bprint(head.message); - bprint("\n"); - - if (head.noise != "") - sound(self, CHAN_BODY, head.noise, 1, ATTN_NORM); - if (head.noise1 != "") - sound(self, CHAN_VOICE, head.noise1, 1, ATTN_NONE); -}; - -/*QUAKED dom_team (0 .5 .8) (-16 -16 -24) (16 16 32) -Team declaration for Domination gameplay, this allows you to decide what team -names and control point models are used in your map. - -Note: If you use dom_team entities you must define at least 3 and only two -can have netname set! The nameless team owns all control points at start. - -Keys: -"netname" - Name of the team (for example Red, Blue, Green, Yellow, Life, Death, etc) -"cnt" - Scoreboard color of the team (for example 4 is red and 13 is blue) -"model" - Model to use for control points owned by this team (for example - "progs/b_g_key.mdl" is a gold keycard, and "progs/b_s_key.mdl" is a silver - keycard) -"skin" - Skin of the model to use (for team skins on a single model) -"noise" - Sound to play when this team captures a point. - (this is a localized sound, like a small alarm or other effect) -"noise1" - Narrator speech to play when this team captures a point. - (this is a global sound, like "Red team has captured a control point") -"message" - Message to show when a team captures a point - (for example "Red team has captured a control point", or - "The forces of light have captured a mana well") -*/ - -void() dom_team = -{ - precache_model(self.model); - if (self.noise != "") - precache_sound(self.noise); - if (self.noise1 != "") - precache_sound(self.noise1); - self.classname = "dom_team"; - setmodel(self, self.model); - self.mdl = self.model; - self.dmg = self.modelindex; - self.model = ""; - self.modelindex = 0; - // this would have to be changed if used in quakeworld - self.team = self.cnt + 1; -}; - -void() dom_controlpoint_setup = -{ - local entity head; - // find the dom_team representing unclaimed points - head = find(world, classname, "dom_team"); - while(head && head.netname != "") - head = find(head, classname, "dom_team"); - if (!head) - objerror("no dom_team with netname \"\" found\n"); - - // copy important properties from dom_team entity - self.goalentity = head; - setmodel(self, head.mdl); - self.skin = head.skin; - - self.think = dompointthink; - self.nextthink = time; - self.touch = dompointtouch; - self.solid = SOLID_TRIGGER; - setsize(self, '-16 -16 -24', '16 16 32'); - setorigin(self, self.origin); - droptofloor(0, 0); -}; - -/*QUAKED dom_controlpoint (0 .5 .8) (-16 -16 -24) (16 16 32) -Control point for Domination gameplay. -*/ -void() dom_controlpoint = -{ - self.think = dom_controlpoint_setup; - self.nextthink = time + 0.1; -}; - -// code from here on is just to support maps that don't have control point and team entities -void(string teamname, float teamcolor, string pointmodel, float pointskin, string capsound, string capnarration, string capmessage) dom_spawnteam = -{ - local entity oldself; - oldself = self; - self = spawn(); - self.classname = "dom_team"; - self.netname = teamname; - self.cnt = teamcolor; - self.model = pointmodel; - self.skin = pointskin; - self.noise = capsound; - self.noise1 = capnarration; - self.message = capmessage; - - // this code is identical to dom_team - setmodel(self, self.model); - self.mdl = self.model; - self.dmg = self.modelindex; - self.model = ""; - self.modelindex = 0; - // this would have to be changed if used in quakeworld - self.team = self.cnt + 1; - - //eprint(self); - self = oldself; -}; - -void(vector org) dom_spawnpoint = -{ - local entity oldself; - oldself = self; - self = spawn(); - self.classname = "dom_controlpoint"; - self.think = dom_controlpoint; - self.nextthink = time; - self.origin = org; - dom_controlpoint(); - self = oldself; -}; - -void() dom_spawnteams = -{ - // LordHavoc: edit this if you want to change defaults - dom_spawnteam("Red", 4, "models/domination/dom_red.md3", 0, "domination/claim.wav", "", "Red team has captured a control point"); - dom_spawnteam("Blue", 13, "models/domination/dom_blue.md3", 0, "domination/claim.wav", "", "Blue team has captured a control point"); - dom_spawnteam("Green", 3, "models/domination/dom_green.md3", 0, "domination/claim.wav", "", "Green team has captured a control point"); - dom_spawnteam("Yellow", 12, "models/domination/dom_yellow.md3", 0, "domination/claim.wav", "", "Yellow team has captured a control point"); - dom_spawnteam("", 0, "models/domination/dom_unclaimed.md3", 0, "", "", ""); -}; - -void() dom_delayedinit = -{ - local entity head; - // if no teams are found, spawn defaults - if (find(world, classname, "dom_team") == world) - dom_spawnteams(); - // if no control points are found, spawn defaults - if (find(world, classname, "dom_controlpoint") == world) - { - // here follow default domination points for each map - /* - if (world.model == "maps/e1m1.bsp") - { - dom_spawnpoint('0 0 0'); - } - else - */ - { - // if no supported map was found, make every deathmatch spawn a point - head = find(world, classname, "info_player_deathmatch"); - while (head) - { - dom_spawnpoint(head.origin); - head = find(head, classname, "info_player_deathmatch"); - } - } - } -}; - -void() dom_init = -{ - local entity e; - // we have to precache default models/sounds even if they might not be - // used because worldspawn is executed before any other entities are read, - // so we don't even know yet if this map is set up for domination... - precache_model("models/domination/dom_red.md3"); - precache_model("models/domination/dom_blue.md3"); - precache_model("models/domination/dom_green.md3"); - precache_model("models/domination/dom_yellow.md3"); - precache_model("models/domination/dom_unclaimed.md3"); - precache_sound("domination/claim.wav"); - e = spawn(); - e.think = dom_delayedinit; - e.nextthink = time + 0.1; -}; - diff --git a/TeamNexuiz/game/gamec/engineer.c b/TeamNexuiz/game/gamec/engineer.c deleted file mode 100644 index 5522c966f..000000000 --- a/TeamNexuiz/game/gamec/engineer.c +++ /dev/null @@ -1,46 +0,0 @@ -void EngineerSpecial() -{ - sprint(self, "Not done yet\n"); -} - -void EngineerGrenade(float req) -{ - if(req == WR_GRENADE1) - { - if(W_ThrowGrenade(W_ArmorGrenade)) - self.grenade_time = time + cvar("g_balance_grenade_armor_refire"); - } - else if(req == WR_GRENADE2) - { - - self.grenade_time = time + 2; - } -} - -void EngineerPreThink() -{ -} - -void EngineerPostThink() -{ -} - -void BecomeEngineer(float portion) -{ - self.max_health = cvar("g_balance_class_engineer_health") * portion; - - self.max_armor = cvar("g_balance_class_engineer_armor") * portion; - - self.mass = cvar("g_balance_class_engineer_mass"); - - SetPlayerSpeed(self); - - self.items = IT_WEP1 | IT_WEP2 | IT_WEP3 | IT_WEP4; - self.switchweapon = WEP2; - self.ammo_shells = floor(20 * portion); - self.ammo_nails = floor(20 * portion); - self.ammo_rockets = floor(1 * portion); - self.ammo_cells = floor(0 * portion); - self.playerclass = 9; // TF P.C. - SetMaxAmmoFor (32); -} diff --git a/TeamNexuiz/game/gamec/extensions.h b/TeamNexuiz/game/gamec/extensions.h deleted file mode 100644 index 3aace7dcc..000000000 --- a/TeamNexuiz/game/gamec/extensions.h +++ /dev/null @@ -1,976 +0,0 @@ - -//DarkPlaces supported extension list, draft version 1.04 - -//checkextension function -//idea: expected by almost everyone -//darkplaces implementation: LordHavoc -float(string s) checkextension = #99; -//description: -//check if (cvar("pr_checkextension")) before calling this, this is the only -//guarenteed extension to be present in the extension system, it allows you -//to check if an extension is available, by name, to check for an extension -//use code like this: -//// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere) -//if (cvar("pr_checkextension")) -//if (checkextension("DP_SV_SETCOLOR")) -// ext_setcolor = TRUE; -//from then on you can check ext_setcolor to know if that extension is available - -//DP_QC_CVAR_STRING -//idea: Paul Timofeyev -//DarkPlaces implementation: Paul Timofeyev, LordHavoc -//builtin definitions: -string(string s) cvar_string = #448; -//description: -//returns the value of a cvar, as a tempstring. - -//DP_QC_TRACE_MOVETYPES -//idea: LordHavoc -//darkplaces implementation: id Software -//constant definitions: -float MOVE_NORMAL = 0; // same as FALSE -float MOVE_NOMONSTERS = 1; // same as TRUE -float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE -//description: -//this extension does nothing (do not check for it), it only documents existing MOVE_ values that were never defined in defs.qc, these are passed as the 'nomonsters' parameter to traceline/tracebox - -//DP_QC_TRACE_MOVETYPE_WORLDONLY -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//constant definitions: -float MOVE_WORLDONLY = 3; -//description: -//allows traces to hit only world (see DP_QC_TRACE_MOVETYPES for how to use this) - -//DP_QC_TRACE_MOVETYPE_HITMODEL -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//constant definitions: -float MOVE_HITMODEL = 4; -//description: -//allows traces to hit alias models (not sprites!) instead of entity boxes (see DP_QC_TRACE_MOVETYPES for how to use this) - -// LordHavoc: HIGHLY experimental, do not implement this in other engines -//DP_CGAME -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//SVC definitions: -float svc_cgame = 50; // [short] length [bytes] data -//description: -//contains network messages to client gamecode. - -//DP_CL_LOADSKY -//idea: Nehahra, LordHavoc -//darkplaces implementation: LordHavoc -//client console commands: -//"loadsky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, use "" to revert to quake sky, note: this is the same as Quake2 skybox naming) -//description: -//sets global skybox for the map for this client (can be stuffed to a client by QC), does not hurt much to repeatedly execute this command, please don't use this in mods if it can be avoided (only if changing skybox is REALLY needed, otherwise please use DP_GFX_SKYBOX). - -//DP_EF_ADDITIVE -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//effects bit: -float EF_ADDITIVE = 32; -//description: -//additive blending when this object is rendered - -//DP_EF_BLUE -//idea: id Software -//darkplaces implementation: LordHavoc -//effects bit: -float EF_BLUE = 64; -//description: -//entity emits blue light (used for quad) - -//DP_EF_FLAME -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//effects bit: -float EF_FLAME = 1024; -//description: -//entity is on fire - -//DP_EF_FULLBRIGHT -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//effects bit: -float EF_FULLBRIGHT = 512; -//description: -//entity is always brightly lit - -//DP_EF_NODRAW -//idea: id Software -//darkplaces implementation: LordHavoc -//effects bit: -float EF_NODRAW = 16; -//description: -//prevents server from sending entity to client (forced invisible, even if it would have been a light source or other such things) - -//DP_EF_RED -//idea: id Software -//darkplaces implementation: LordHavoc -//effects bit: -float EF_RED = 128; -//description: -//entity emits red light (used for invulnerability) - -//DP_EF_STARDUST -//idea: MythWorks Inc -//darkplaces implementation: LordHavoc -//effects bit: -float EF_STARDUST = 2048; -//description: -//entity emits bouncing sparkles in every direction - -//entity attributes used for rendering/networking: -//idea: Nehahra -//darkplaces implementation: LordHavoc -//DP_ENT_ALPHA -//field definition: -.float alpha; -//description: -//controls opacity of the entity, 0.0 is forced to be 1.0 (otherwise everything would be invisible), use -1 if you want to make something invisible, 1.0 is solid (like normal). - -//DP_ENT_COLORMOD -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//field definition: -.vector colormod; -//description: -//controls color of the entity, '0 0 0', is forced to be '1 1 1' (otherwise everything would be black), used for tinting objects, for instance using '1 0.6 0.4' on an ogre would give you an orange ogre (order is red green blue), note the colors can go up to '8 8 8' (8x as bright as normal). - -//DP_ENT_CUSTOMCOLORMAP -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//description: -//if .colormap is set to 1024 + pants + shirt * 16, those colors will be used for colormapping the entity, rather than looking up a colormap by player number. - -/* -//NOTE: no longer supported by darkplaces because all entities are delta compressed now -//DP_ENT_DELTACOMPRESS // no longer supported -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//effects bit: -float EF_DELTA = 8388608; -//description: -//(obsolete) applies delta compression to the network updates of the entity, making updates smaller, this might cause some unreliable behavior in packet loss situations, so it should only be used on numerous (nails/plasma shots/etc) or unimportant objects (gibs/shell casings/bullet holes/etc). -*/ - -//DP_ENT_EXTERIORMODELTOCLIENT -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//fields: -.entity exteriormodeltoclient; -//description: -//the entity is visible to all clients with one exception: if the specified client is using first person view (not using chase_active) the entity will not be shown. - -//DP_ENT_GLOW -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//field definitions: -.float glow_color; -.float glow_size; -.float glow_trail; -//description: -//customizable glowing light effect on the entity, glow_color is a paletted (8bit) color in the range 0-255 (note: 0 and 254 are white), glow_size is 0 or higher (up to the engine what limit to cap it to, darkplaces imposes a 1020 limit), if glow_trail is true it will leave a trail of particles of the same color as the light. - -//DP_ENT_LOWPRECISION -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//effects bit: -float EF_LOWPRECISION = 4194304; -//description: -//uses low quality origin coordinates, reducing network traffic compared to the default high precision, intended for numerous objects (projectiles/gibs/bullet holes/etc). - -//DP_ENT_SCALE -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//field definitions: -.float scale; -//description: -//controls rendering scale of the object, 0 is forced to be 1, darkplaces uses 1/16th accuracy and a limit of 15.9375, can be used to make an object larger or smaller. - -//DP_ENT_VIEWMODEL -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//field definitions: -.entity viewmodelforclient; -//description: -//this is a very special capability, attachs the entity to the view of the client specified, origin and angles become relative to the view of that client, all effects can be used (multiple skins on a weapon model etc)... the entity is not visible to any other client. - -//DP_GFX_FOG -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//worldspawn fields: -//"fog" (parameters: "density red green blue", example: "0.1 0.3 0.3 0.3") -//description: -//global fog for the map, can not be changed by QC - -//DP_GFX_SKYBOX -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//worldspawn fields: -//"sky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, note: "sky" is also used the same way by Quake2) -//description: -//global skybox for the map, can not be changed by QC - -//DP_GFX_EXTERNALTEXTURES -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//description: -//loads external textures found in various directories (tenebrae compatible)... -/* -in all examples .tga is merely the base texture, it can be any of these: -.tga (base texture) -_glow.tga (fullbrights or other glowing overlay stuff, NOTE: this is done using additive blend, not alpha) -_pants.tga (pants overlay for colormapping on models, this should be shades of grey (it is tinted by pants color) and black wherever the base texture is not black, as this is an additive blend) -_shirt.tga (same idea as pants, but for shirt color) -_diffuse.tga (this may be used instead of base texture for per pixel lighting) -_gloss.tga (specular texture for per pixel lighting, note this can be in color (tenebrae only supports greyscale)) -_norm.tga (normalmap texture for per pixel lighting) -_bump.tga (bumpmap, converted to normalmap at load time, supported only for reasons of tenebrae compatibility) -_luma.tga (same as _glow but supported only for reasons of tenebrae compatibility) - -due to glquake's incomplete Targa(r) loader, this section describes -required Targa(r) features support: -types: -type 1 (uncompressed 8bit paletted with 24bit/32bit palette) -type 2 (uncompressed 24bit/32bit true color, glquake supported this) -type 3 (uncompressed 8bit greyscale) -type 9 (RLE compressed 8bit paletted with 24bit/32bit palette) -type 10 (RLE compressed 24bit/32bit true color, glquake supported this) -type 11 (RLE compressed 8bit greyscale) -attribute bit 0x20 (Origin At Top Left, top to bottom, left to right) - -image formats guarenteed to be supported: tga, pcx, lmp -image formats that are optional: png, jpg - -mdl/spr/spr32 examples: -skins are named _A (A being a number) and skingroups are named like _A_B -these act as suffixes on the model name... -example names for skin _2_1 of model "progs/armor.mdl": -game/override/progs/armor.mdl_2_1.tga -game/textures/progs/armor.mdl_2_1.tga -game/progs/armor.mdl_2_1.tga -example names for skin _0 of the model "progs/armor.mdl": -game/override/progs/armor.mdl_0.tga -game/textures/progs/armor.mdl_0.tga -game/progs/armor.mdl_0.tga -note that there can be more skins files (of the _0 naming) than the mdl -contains, this is only useful to save space in the .mdl file if classic quake -compatibility is not a concern. - -bsp/md2/md3 examples: -example names for the texture "quake" of model "maps/start.bsp": -game/override/quake.tga -game/textures/quake.tga -game/progs/quake.tga - -sbar/menu/console textures: for example the texture "conchars" (console font) in gfx.wad -game/override/gfx/conchars.tga -game/textures/gfx/conchars.tga -game/gfx/conchars.tga -*/ - -//DP_GFX_QUAKE3MODELTAGS -//idea: id Software -//darkplaces implementation: LordHavoc -//field definitions: -.entity tag_entity; // entity this is attached to (call setattachment to set this) -.float tag_index; // which tag on that entity (0 is relative to the entity, > 0 is an index into the tags on the model if it has any) (call setattachment to set this) -//builtin definitions: -void(entity e, entity tagentity, string tagname) setattachment = #443; // attachs e to a tag on tagentity (note: use "" to attach to entity origin/angles instead of a tag) -//description: -//allows entities to be visually attached to model tags (which follow animations perfectly) on other entities, for example attaching a weapon to a player's hand, or upper body attached to lower body, allowing it to change angles and frame separately (note: origin and angles are relative to the tag, use '0 0 0' for both if you want it to follow exactly, this is similar to viewmodelforclient's behavior). -//note 2: if the tag is not found, it defaults to "" (attach to origin/angles of entity) -//note 3: attaching to world turns off attachment -//note 4: the entity that this is attached to must be visible for this to work - -//DP_GFX_SKINFILES -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//description: -//alias models (mdl, md2, md3) can have .skin files to replace conventional texture naming, these have a naming format such as: -//progs/test.md3_0.skin -//progs/test.md3_1.skin -//... -// -//these files contain replace commands (replace meshname shadername), example: -//replace "helmet" "progs/test/helmet1.tga" // this is a mesh shader replacement -//replace "teamstripes" "progs/test/redstripes.tga" -//replace "visor" "common/nodraw" // this makes the visor mesh invisible -////it is not possible to rename tags using this format -// -//Or the Quake3 syntax (100% compatible with Quake3's .skin files): -//helmet,progs/test/helmet1.tga // this is a mesh shader replacement -//teamstripes,progs/test/redstripes.tga -//visor,common/nodraw // this makes the visor mesh invisible -//tag_camera, // this defines that the first tag in the model is called tag_camera -//tag_test, // this defines that the second tag in the model is called tag_test -// -//any names that are not replaced are automatically show up as a grey checkerboard to indicate the error status, and "common/nodraw" is a special case that is invisible. -//this feature is intended to allow multiple skin sets on md3 models (which otherwise only have one skin set). -//other commands might be added someday but it is not expected. - -//DP_HALFLIFE_MAP -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//description: -//simply indicates that the engine supports HalfLife maps (BSP version 30, NOT the QER RGBA ones which are also version 30). - -//DP_HALFLIFE_MAP_CVAR -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//cvars: -//halflifebsp 0/1 -//description: -//engine sets this cvar when loading a map to indicate if it is halflife format or not. - -//DP_INPUTBUTTONS -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//field definitions: -.float button3; -.float button4; -.float button5; -.float button6; -.float button7; -.float button8; -//description: -//set to the state of the +button3, +button4, +button5, +button6, +button7, and +button8 buttons from the client, this does not involve protocol changes (the extra 6 button bits were simply not used). - -//DP_MONSTERWALK -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//description: -//MOVETYPE_WALK is permitted on non-clients, so bots can move smoothly, run off ledges, etc, just like a real player. - -//DP_MOVETYPEBOUNCEMISSILE -//idea: id Software -//darkplaces implementation: id Software -//movetype definitions: -float MOVETYPE_BOUNCEMISSILE = 11; -//description: -//MOVETYPE_BOUNCE but without gravity, and with full reflection (no speed loss like grenades have), in other words - bouncing laser bolts. - -//DP_MOVETYPEFOLLOW -//idea: id Software, LordHavoc (redesigned) -//darkplaces implementation: LordHavoc -//movetype definitions: -float MOVETYPE_FOLLOW = 12; -//description: -//MOVETYPE_FOLLOW implemented, this uses existing entity fields in unusual ways: -//aiment - the entity this is attached to. -//punchangle - the original angles when the follow began. -//view_ofs - the relative origin (note that this is un-rotated by punchangle, and that is actually the only purpose of punchangle). -//v_angle - the relative angles. -//here's an example of how you would set a bullet hole sprite to follow a bmodel it was created on, even if the bmodel rotates: -//hole.movetype = MOVETYPE_FOLLOW; // make the hole follow -//hole.solid = SOLID_NOT; // MOVETYPE_FOLLOW is always non-solid -//hole.aiment = bmodel; // make the hole follow bmodel -//hole.punchangle = bmodel.angles; // the original angles of bmodel -//hole.view_ofs = hole.origin - bmodel.origin; // relative origin -//hole.v_angle = hole.angles - bmodel.angles; // relative angles - -//DP_QC_CHANGEPITCH -//idea: id Software -//darkplaces implementation: id Software -//field definitions: -.float idealpitch; -.float pitch_speed; -//builtin definitions: -void(entity ent) changepitch = #63; -//description: -//equivilant to changeyaw, ent is normally self. (this was a Q2 builtin) - -//DP_QC_COPYENTITY -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(entity from, entity to) copyentity = #400; -//description: -//copies all data in the entity to another entity. - -//DP_QC_ETOS -//idea: id Software -//darkplaces implementation: id Software -//builtin definitions: -string(entity ent) etos = #65; -//description: -//lists all of the entity's fields into a string (similar to edict command in console). (this was a Q2 builtin) - -//DP_QC_FINDCHAIN -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -entity(.string fld, string match) findchain = #402; -//description: -//similar to find() but returns a chain of entities like findradius. - -//DP_QC_FINDCHAINFLOAT -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -entity(.entity fld, entity match) findchainentity = #403; -entity(.float fld, float match) findchainfloat = #403; -//description: -//similar to findentity()/findfloat() but returns a chain of entities like findradius. - -//DP_QC_FINDFLOAT -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -entity(entity start, .entity fld, entity match) findentity = #98; -entity(entity start, .float fld, float match) findfloat = #98; -//description: -//finds an entity or float field value, similar to find(), but for entity and float fields. - -//DP_QC_GETLIGHT -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -vector(vector org) getlight = #92; -//description: -//returns the lighting at the requested location (in color), 0-255 range (can exceed 255). - -//DP_QC_GETSURFACE -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -float(entity e, float s) getsurfacenumpoints = #434; -vector(entity e, float s, float n) getsurfacepoint = #435; -vector(entity e, float s) getsurfacenormal = #436; -string(entity e, float s) getsurfacetexture = #437; -float(entity e, vector p) getsurfacenearpoint = #438; -vector(entity e, float s, vector p) getsurfaceclippedpoint = #439; -//description: -//functions to query surface information. - -//DP_QC_MINMAXBOUND -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -float(float a, float b) min = #94; -float(float a, float b, float c) min3 = #94; -float(float a, float b, float c, float d) min4 = #94; -float(float a, float b, float c, float d, float e) min5 = #94; -float(float a, float b, float c, float d, float e, float f) min6 = #94; -float(float a, float b, float c, float d, float e, float f, float g) min7 = #94; -float(float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94; -float(float a, float b) max = #95; -float(float a, float b, float c) max3 = #95; -float(float a, float b, float c, float d) max4 = #95; -float(float a, float b, float c, float d, float e) max5 = #95; -float(float a, float b, float c, float d, float e, float f) max6 = #95; -float(float a, float b, float c, float d, float e, float f, float g) max7 = #95; -float(float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95; -float(float minimum, float val, float maximum) bound = #96; -//description: -//min returns the lowest of all the supplied numbers. -//max returns the highest of all the supplied numbers. -//bound clamps the value to the range and returns it. - -//DP_QC_RANDOMVEC -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -vector() randomvec = #91; -//description: -//returns a vector of length < 1, much quicker version of this QC: do {v_x = random();v_y = random();v_z = random();} while(vlen(v) > 1) - -//DP_QC_SINCOSSQRTPOW -//idea: id Software, LordHavoc -//darkplaces implementation: id Software, LordHavoc -//builtin definitions: -float(float val) sin = #60; -float(float val) cos = #61; -float(float val) sqrt = #62; -float(float a, float b) pow = #97; -//description: -//useful math functions, sine of val, cosine of val, square root of val, and raise a to power b, respectively. - -//DP_QC_TRACEBOX -//idea: id Software -//darkplaces implementation: id Software -//builtin definitions: -void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90; -//description: -//similar to traceline but much more useful, traces a box of the size specified (technical note: currently the hull size can only be one of the sizes used in the map for bmodel collisions, entity collisions will pay attention to the exact size specified however, this is a collision code limitation in quake itself, and will be fixed eventually). - -//DP_QC_TRACETOSS -//idea: id Software -//darkplaces implementation: id Software -//builtin definitions: -void(entity ent, entity ignore) tracetoss = #64; -//description: -//simulates movement of the entity as if it is MOVETYPE_TOSS and starting with it's current state (location, velocity, etc), returns relevant trace_ variables (trace_fraction is always 0, all other values are supported - trace_ent, trace_endpos, trace_plane_normal), does not actually alter the entity. - -//DP_QC_VECTORVECTORS -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector dir) vectorvectors = #432; -//description: -//creates v_forward, v_right, and v_up vectors given a forward vector, similar to makevectors except it takes a forward direction vector instead of angles. - -//DP_QUAKE2_MODEL -//idea: quake community -//darkplaces implementation: LordHavoc -//description: -//shows that the engine supports Quake2 .md2 files. - -//DP_QUAKE3_MODEL -//idea: quake community -//darkplaces implementation: LordHavoc -//description: -//shows that the engine supports Quake3 .md3 files. - -//DP_REGISTERCVAR -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -float(string name, string value) registercvar = #93; -//description: -//adds a new console cvar to the server console (in singleplayer this is the player's console), the cvar exists until the mod is unloaded or the game quits. - -//DP_SOLIDCORPSE -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//solid definitions: -float SOLID_CORPSE = 5; -//description: -//the entity will not collide with SOLID_CORPSE and SOLID_SLIDEBOX entities (and likewise they will not collide with it), this is useful if you want dead bodies that are shootable but do not obstruct movement by players and monsters, note that if you traceline with a SOLID_SLIDEBOX entity as the ignoreent, it will ignore SOLID_CORPSE entities, this is desirable for visibility and movement traces, but not for bullets, for the traceline to hit SOLID_CORPSE you must temporarily force the player (or whatever) to SOLID_BBOX and then restore to SOLID_SLIDEBOX after the traceline. - -//DP_SPRITE32 -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//description: -//the engine supports .spr32 sprites. - -//DP_SV_BOTCLIENT -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//constants: -float CLIENTTYPE_DISCONNECTED = 0; -float CLIENTTYPE_REAL = 1; -float CLIENTTYPE_BOT = 2; -float CLIENTTYPE_NOTACLIENT = 3; -//builtin definitions: -entity() spawnclient = #454; // like spawn but for client slots (also calls relevant connect/spawn functions), returns world if no clients available -float(entity clent) clienttype = #455; // returns one of the CLIENTTYPE_* constants -void(entity clent) dropclient = #453; -//description: -//spawns a client with no network connection, to allow bots to use client slots with no hacks. -//How to use: -/* - // to spawn a bot - local entity oldself; - oldself = self; - self = spawnclient(); - if (!self) - { - bprint("Can not add bot, server full.\n"); - self = oldself; - return; - } - self.netname = "Yoyobot"; - self.clientcolors = 12 * 16 + 4; // yellow (12) shirt and red (4) pants - ClientConnect(); - PutClientInServer(); - self = oldself; - - // to remove all bots - local entity head; - head = find(world, classname, "player"); - while (head) - { - if (clienttype(head) == CLIENTTYPE_BOT) - dropclient(head); - head = find(head, classname, "player"); - } - - // to identify if a client is a bot (for example in PlayerPreThink) - if (clienttype(self) == CLIENTTYPE_BOT) - botthink(); -*/ -//see also DP_SV_CLIENTCOLORS DP_SV_CLIENTNAME DP_SV_DROPCLIENT -//How it works: -//creates a new client, calls SetNewParms and stores the parms, and returns the client. -//this intentionally does not call SV_SendServerinfo to allow the QuakeC a chance to set the netname and clientcolors fields before actually spawning the bot by calling ClientConnect and PutClientInServer manually -//on level change ClientConnect and PutClientInServer are called by the engine to spawn in the bot (this is why clienttype() exists to tell you on the next level what type of client this is). -//parms work the same on bot clients as they do on real clients, and do carry from level to level - -//DP_SV_CLIENTCOLORS -//idea: LordHavoc -//darkplaces implementation: LordHavoc -.float clientcolors; // colors of the client (format: pants + shirt * 16) -//description: -//allows qc to read and modify the client colors associated with a client entity (not particularly useful on other entities), and automatically sends out any appropriate network updates if changed - -//DP_SV_CLIENTNAME -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//allows qc to modify the client's .netname, and automatically sends out any appropriate network updates if changed - -//DP_SV_DRAWONLYTOCLIENT -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//field definitions: -.entity drawonlytoclient; -//description: -//the entity is only visible to the specified client. - -//DP_SV_EFFECT -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector org, string modelname, float startframe, float endframe, float framerate) effect = #404; -//SVC definitions: -//float svc_effect = #52; // [vector] org [byte] modelindex [byte] startframe [byte] framecount [byte] framerate -//float svc_effect2 = #53; // [vector] org [short] modelindex [byte] startframe [byte] framecount [byte] framerate -//description: -//clientside playback of simple custom sprite effects (explosion sprites, etc). - -//DP_SV_NODRAWTOCLIENT -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//field definitions: -.entity nodrawtoclient; -//description: -//the entity is not visible to the specified client. - -//DP_SV_PLAYERPHYSICS -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//field definitions: -.vector movement; -//engine-called QC prototypes: -//void() SV_PlayerPhysics; -//description: -//.movement vector contains the movement input from the player, allowing QC to do as it wishs with the input, and SV_PlayerPhysics will completely replace the player physics if present (works for all MOVETYPE's), see darkplaces mod source for example of this function (in playermovement.qc, adds HalfLife ladders support, as well as acceleration/deceleration while airborn (rather than the quake sudden-stop while airborn), and simplifies the physics a bit) - -//DP_SV_SETCOLOR -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(entity ent, float colors) setcolor = #401; -//engine called QC functions (optional): -//void(float color) SV_ChangeTeam; -//description: -//setcolor sets the color on a client and updates internal color information accordingly (equivilant to stuffing a "color" command but immediate) -//SV_ChangeTeam is called by the engine whenever a "color" command is recieved, it may decide to do anything it pleases with the color passed by the client, including rejecting it (by doing nothing), or calling setcolor to apply it, preventing team changes is one use for this. -//the color format is pants + shirt * 16 (0-255 potentially) - -//DP_SV_SLOWMO -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//cvars: -//"slowmo" (0+, default 1) -//description: -//sets the time scale of the server, mainly intended for use in singleplayer by the player, however potentially useful for mods, so here's an extension for it. -//range is 0 to infinite, recommended values to try are 0.1 (very slow, 10% speed), 1 (normal speed), 5 (500% speed). - -//DP_TE_BLOOD -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector org, vector velocity, float howmany) te_blood = #405; -//temp entity definitions: -float TE_BLOOD = 50; -//protocol: -//vector origin -//byte xvelocity (-128 to +127) -//byte yvelocity (-128 to +127) -//byte zvelocity (-128 to +127) -//byte count (0 to 255, how much blood) -//description: -//creates a blood effect. - -//DP_TE_BLOODSHOWER -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector mincorner, vector maxcorner, float explosionspeed, float howmany) te_bloodshower = #406; -//temp entity definitions: -//float TE_BLOODSHOWER = 52; -//protocol: -//vector mins (minimum corner of the cube) -//vector maxs (maximum corner of the cube) -//coord explosionspeed (velocity of blood particles flying out of the center) -//short count (number of blood particles) -//description: -//creates an exploding shower of blood, for making gibbings more convincing. - -//DP_TE_CUSTOMFLASH -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector org, float radius, float lifetime, vector color) te_customflash = #417; -//temp entity definitions: -//float TE_CUSTOMFLASH = 73; -//protocol: -//vector origin -//byte radius ((MSG_ReadByte() + 1) * 8, meaning 8-2048 unit radius) -//byte lifetime ((MSG_ReadByte() + 1) / 256.0, meaning approximately 0-1 second lifetime) -//byte red (0.0 to 1.0 converted to 0-255) -//byte green (0.0 to 1.0 converted to 0-255) -//byte blue (0.0 to 1.0 converted to 0-255) -//description: -//creates a customized light flash. - -//DP_TE_EXPLOSIONRGB -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector org, vector color) te_explosionrgb = #407; -//temp entity definitions: -//float TE_EXPLOSIONRGB = 53; -//protocol: -//vector origin -//byte red (0.0 to 1.0 converted to 0 to 255) -//byte green (0.0 to 1.0 converted to 0 to 255) -//byte blue (0.0 to 1.0 converted to 0 to 255) -//description: -//creates a colored explosion effect. - -//DP_TE_FLAMEJET -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//temp entity definitions: -float TE_FLAMEJET = 74; -//protocol: -//vector origin -//vector velocity -//byte count (0 to 255, how many flame particles) -//description: -//creates a single puff of flame particles. (not very useful really) - -//DP_TE_PARTICLECUBE -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector mincorner, vector maxcorner, vector vel, float howmany, float color, float gravityflag, float randomveljitter) te_particlecube = #408; -//temp entity definitions: -//float TE_PARTICLECUBE = 54; -//protocol: -//vector mins (minimum corner of the cube) -//vector maxs (maximum corner of the cube) -//vector velocity -//short count -//byte color (palette color) -//byte gravity (TRUE or FALSE, FIXME should this be a scaler instead?) -//coord randomvel (how much to jitter the velocity) -//description: -//creates a cloud of particles, useful for forcefields but quite customizable. - -//DP_TE_PARTICLERAIN -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlerain = #409; -//temp entity definitions: -//float TE_PARTICLERAIN = 55; -//protocol: -//vector mins (minimum corner of the cube) -//vector maxs (maximum corner of the cube) -//vector velocity (velocity of particles) -//short count (number of particles) -//byte color (8bit palette color) -//description: -//creates a shower of rain, the rain will appear either at the top (if falling down) or bottom (if falling up) of the cube. - -//DP_TE_PARTICLESNOW -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector mincorner, vector maxcorner, vector vel, float howmany, float color) te_particlesnow = #410; -//temp entity definitions: -//float TE_PARTICLERAIN = 56; -//protocol: -//vector mins (minimum corner of the cube) -//vector maxs (maximum corner of the cube) -//vector velocity (velocity of particles) -//short count (number of particles) -//byte color (8bit palette color) -//description: -//creates a shower of snow, the snow will appear either at the top (if falling down) or bottom (if falling up) of the cube, low velocities are advisable for convincing snow. - -//DP_TE_QUADEFFECTS1 -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector org) te_gunshotquad = #412; -void(vector org) te_spikequad = #413; -void(vector org) te_superspikequad = #414; -void(vector org) te_explosionquad = #415; -//temp entity definitions: -//float TE_GUNSHOTQUAD = 57; // [vector] origin -//float TE_SPIKEQUAD = 58; // [vector] origin -//float TE_SUPERSPIKEQUAD = 59; // [vector] origin -//float TE_EXPLOSIONQUAD = 70; // [vector] origin -//protocol: -//vector origin -//description: -//all of these just take a location, and are equivilant in function (but not appearance :) to the original TE_GUNSHOT, etc. - -//DP_TE_SMALLFLASH -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector org) te_smallflash = #416; -//temp entity definitions: -//float TE_SMALLFLASH = 72; -//protocol: -//vector origin -//description: -//creates a small light flash (radius 200, time 0.2). - -//DP_TE_SPARK -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector org, vector vel, float howmany) te_spark = #411; -//temp entity definitions: -//float TE_SPARK = 51; -//protocol: -//vector origin -//byte xvelocity (-128 to 127) -//byte yvelocity (-128 to 127) -//byte zvelocity (-128 to 127) -//byte count (number of sparks) -//description: -//creates a shower of sparks and a smoke puff. - -//DP_TE_STANDARDEFFECTBUILTINS -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector org) te_gunshot = #418; -void(vector org) te_spike = #419; -void(vector org) te_superspike = #420; -void(vector org) te_explosion = #421; -void(vector org) te_tarexplosion = #422; -void(vector org) te_wizspike = #423; -void(vector org) te_knightspike = #424; -void(vector org) te_lavasplash = #425; -void(vector org) te_teleport = #426; -void(vector org, float color) te_explosion2 = #427; -void(entity own, vector start, vector end) te_lightning1 = #428; -void(entity own, vector start, vector end) te_lightning2 = #429; -void(entity own, vector start, vector end) te_lightning3 = #430; -void(entity own, vector start, vector end) te_beam = #431; -//description: -//to make life easier on mod coders. - -//DP_TE_PLASMABURN -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//builtin definitions: -void(vector org) te_plasmaburn = #433; -//temp entity definitions: -//float TE_PLASMABURN = 75; -//protocol: -//vector origin -//description: -//creates a small light flash (radius 200, time 0.2) and marks the walls. - -//DP_VIEWZOOM -//idea: LordHavoc -//darkplaces implementation: LordHavoc -//field definitions: -.float viewzoom; -//description: -//scales fov and sensitivity of player, valid range is 0 to 1 (intended for sniper rifle zooming, and such) - -//FRIK_FILE -//idea: FrikaC -//darkplaces implementation: LordHavoc -//builtin definitions: -float(string s) stof = #81; // get numerical value from a string -float(string filename, float mode) fopen = #110; // opens a file inside quake/gamedir/data/ (mode is FILE_READ, FILE_APPEND, or FILE_WRITE), returns fhandle >= 0 if successful, or fhandle < 0 if unable to open file for any reason -void(float fhandle) fclose = #111; // closes a file -string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring -void(float fhandle, string s) fputs = #113; // writes a line of text to the end of the file -float(string s) strlen = #114; // returns how many characters are in a string -string(string s1, ...) strcat = #115; // concatenates two strings (for example "abc", "def" would return "abcdef") and returns as a tempstring -string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring -vector(string s) stov = #117; // returns vector value from a string -string(string s) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often) -void(string s) strunzone = #119; // removes a copy of a string from the string zone (you can not use that string again or it may crash!!!) -//constants: -float FILE_READ = 0; -float FILE_APPEND = 1; -float FILE_WRITE = 2; -//cvars: -//pr_zone_min_strings : default 64 (64k), min 64 (64k), max 8192 (8mb) -//description: -//provides text file access functions and string manipulation functions, note that you may want to set pr_zone_min_strings in the worldspawn function if 64k is not enough string zone space. - -//KRIMZON_SV_PARSECLIENTCOMMAND -//idea: KrimZon -//darkplaces implementation: KrimZon, LordHavoc -//engine-called QC prototypes: -//void(string s) SV_ParseClientCommand; -//builtin definitions: -void(entity e, string s) clientcommand = #440; -float(string s) tokenize = #441; -string(float n) argv = #442; -//description: -//provides QC the ability to completely control server interpretation of client commands ("say" and "color" for example, clientcommand is necessary for this and substring (FRIK_FILE) is useful) as well as adding new commands (tokenize, argv, and stof (FRIK_FILE) are useful for this)), whenever a clc_stringcmd is received the QC function is called, and it is up to the QC to decide what (if anything) to do with it - -//NEH_RESTOREGAME -//idea: Nehahra -//darkplaces implementation: LordHavoc -//engine-called QC prototypes: -//void() RestoreGame; -//description: -//when a savegame is loaded, this function is called - -//NEH_CMD_PLAY2 -//idea: Nehahra -//darkplaces implementation: LordHavoc -//description: -//shows that the engine supports the "play2" console command (plays a sound without spatialization). - -//PRYDON_CLIENTCURSOR -//idea: FrikaC -//darkplaces implementation: LordHavoc -//effects bit: -float EF_SELECTABLE = 16384; // allows cursor to highlight entity (brighten) -//field definitions: -.float cursor_active; // true if cl_prydoncursor mode is on -.vector cursor_screen; // screen position of cursor as -1 to +1 in _x and _y (_z unused) -.vector cursor_trace_start; // position of camera -.vector cursor_trace_endpos; // position of cursor in world (as traced from camera) -.entity cursor_trace_ent; // entity the cursor is pointing at (server forces this to world if the entity is currently free at time of receipt) -//cvar definitions: -//cl_prydoncursor (0/1+, default 0, 1 and above use cursors named gfx/prydoncursor%03i.lmp - or .tga and such if DP_GFX_EXTERNALTEXTURES is implemented) -//description: -//shows that the engine supports the cl_prydoncursor cvar, this puts a clientside mouse pointer on the screen and feeds input to the server for the QuakeC to use as it sees fit. -//the mouse pointer triggers button4 if cursor is at left edge of screen, button5 if at right edge of screen, button6 if at top edge of screen, button7 if at bottom edge of screen. -//the clientside trace skips transparent entities (except those marked EF_SELECTABLE). -//the selected entity highlights only if EF_SELECTABLE is set, a typical selection method would be doubling the brightness of the entity by some means (such as colormod[] *= 2). -//intended to be used by Prydon Gate. - -//TW_SV_STEPCONTROL -//idea: Transfusion -//darkplaces implementation: LordHavoc -//cvars: -//sv_jumpstep (0/1, default 1) -//sv_stepheight (default 18) -//description: -//sv_jumpstep allows stepping up onto stairs while airborn, sv_stepheight controls how high a single step can be. - -// NEXUIZ_PLAYERMODEL -// NEXUIZ_PLAYERSKIN -//idea: -//darkplaces implementation: Black -.string playermodel; // contains the name of the model set by a client with playermodel -.string playerskin; // contains the name of the skin set by a client with playerskin - -//unassigned stuff: (need to write up specs but haven't yet) -.vector punchvector; // DP_SV_PUNCHVECTOR -.float ping; // DP_SV_PING - - diff --git a/TeamNexuiz/game/gamec/g_casings.c b/TeamNexuiz/game/gamec/g_casings.c deleted file mode 100644 index 7d7888eae..000000000 --- a/TeamNexuiz/game/gamec/g_casings.c +++ /dev/null @@ -1,91 +0,0 @@ -void() casingtouch = -{ - if (other.solid == SOLID_BSP) - if (vlen(self.velocity) >= 50) - if (time >= self.attack_finished) - sound (self, CHAN_IMPACT, "weapons/tink1.wav", 0.5, ATTN_NORM); - self.attack_finished = time + 0.2; - //self.touch = SUB_Null; // one tink is enough - //self.dest = self.origin - self.groundentity.origin; -}; - -void() casingthink = -{ - local float p; - self.nextthink = time + 0.1; - if (self.flags & FL_ONGROUND) - { - // just keep the yaw angle - self.angles_x = 0; - self.angles_z = 0; - self.flags = self.flags - FL_ONGROUND; - self.nextthink = time + 0.5; - } - p = pointcontents(self.origin); - if (p == CONTENT_SOLID || p == CONTENT_LAVA || p == CONTENT_SKY) - { - removedecor(self); - return; - } - if (time > self.cnt) - { - self.nextthink = time; - self.alpha = self.alpha - frametime; - if (self.alpha < 0.0625) - removedecor(self); - } -}; - -// knock loose the casing when disturbed -void() casingknockedloosefunc = -{ - self.movetype = MOVETYPE_BOUNCE; - self.flags = self.flags - (self.flags & FL_ONGROUND); - self.avelocity = randomvec() * 300; - self.nextthink = time + 0.1; - self.touch = casingtouch; -}; - -void(vector org, vector vel, float randomvel, vector ang, vector avel, float randomavel, float casingtype) SpawnCasing = -{ - local entity e; - if (cvar("temp1") & 2048) - return; - - e = newdecor(); - //e.isdecor = TRUE; - e.alpha = 1; - //e.forcescale = 15; - e.movetype = MOVETYPE_BOUNCE; - e.solid = SOLID_TRIGGER; - e.velocity = vel + randomvec() * randomvel; - e.angles = ang; - e.avelocity = avel + randomvec() * randomavel; - e.nextthink = time; - e.think = casingthink; - e.touch = casingtouch; - //e.knockedloosefunc = casingknockedloosefunc; - //e.effects = EF_LOWPRECISION; - e.createdtime = time; - if (casingtype == 1) - { - setmodel (e, "models/casing_shell.mdl"); - e.cnt = time + 30; - // bias to make these be considered more important than other things - e.createdtime = time + 1; - } - else if (casingtype == 2) - { - setmodel (e, "models/casing_steel.mdl"); - e.cnt = time + 10; - } - else - { - setmodel (e, "models/casing_bronze.mdl"); - e.cnt = time + 10; - } - if (maxclients == 1) - e.cnt = time + 3000; - setsize (e, '0 0 -1', '0 0 -1'); - setorigin (e, org); -}; diff --git a/TeamNexuiz/game/gamec/g_damage.c b/TeamNexuiz/game/gamec/g_damage.c deleted file mode 100644 index c06349837..000000000 --- a/TeamNexuiz/game/gamec/g_damage.c +++ /dev/null @@ -1,308 +0,0 @@ - -float checkrules_firstblood; - -void Obituary (entity attacker, entity targ, float deathtypeN) // Renamed "deathtype" to "deathtypeN" -{ // b/c of conflict with item_tfgoal - string s; - - if (targ.classname == "player" || targ.classname == "corpse") - { - if (targ.classname == "corpse") - s = "A corpse"; - else - s = targ.netname; - - if (((attacker.classname == "info_tfgoal") || (attacker.classname == "item_tfgoal"))) - { - if ((attacker.deathtype != "")) - { - bprint (targ.netname); - bprint (attacker.deathtype); - } - return; - } - - if (targ == attacker) - { - if (deathtypeN == IT_GRENADE_LAUNCHER) - bprint ("^1",s, " detonated\n"); - else if (deathtypeN == IT_ELECTRO) - bprint ("^1",s, " played with plasma\n"); - else if (deathtypeN == IT_ROCKET_LAUNCHER) - bprint ("^1",s, " exploded\n"); - else if (deathtypeN == DEATH_KILL) - bprint ("^1",s, " couldn't take it anymore\n"); - else if (deathtypeN == 88) - bprint ("^1",s, " blew his own sorry ass up\n"); - else - bprint ("^1",s, " couldn't resist the urge to self immolate\n"); - targ.frags = targ.frags - 1; - if (targ.killcount > 2) - bprint ("^1",s," ended it all with a ",ftos(targ.killcount)," kill spree\n"); - } - else if (teamplay && attacker.team == targ.team) - { - bprint ("^1", attacker.netname, " mows down a teammate\n"); - attacker.frags = attacker.frags - 1; - if (targ.killcount > 2) - bprint ("^1",s,"'s ",ftos(targ.killcount)," kill spree was endeded by a teammate!\n"); - if (attacker.killcount > 2) - bprint ("^1",attacker.netname," ended a ",ftos(attacker.killcount)," kill spree by killing a teammate\n"); - attacker.killcount = 0; - } - else if (attacker.classname == "player") - { - if (!checkrules_firstblood) - { - checkrules_firstblood = TRUE; - //sound(world, CHAN_AUTO, "announcer/firstblood.wav", 1, ATTN_NONE); - bprint("^1",attacker.netname, " drew first blood", "\n"); - } - - if (deathtypeN == WEP_LASER) - bprint ("^1",s, " was blasted by ", attacker.netname, "\n"); - else if (deathtypeN == WEP_UZI) - bprint ("^1",s, " was riddled full of holes by ", attacker.netname, "\n"); - else if (deathtypeN == WEP_SHOTGUN) - bprint ("^1",s, " was gunned by ", attacker.netname, "\n"); - else if (deathtypeN == WEP_GRENADE_LAUNCHER) - bprint ("^1", s, " was blasted by ", attacker.netname, "\n"); - else if (deathtypeN == WEP_ELECTRO) - bprint ("^1",s, " was blasted by ", attacker.netname, "\n"); - else if (deathtypeN == WEP_CRYLINK) - bprint ("^1",s, " was blasted by ", attacker.netname, "\n"); - else if (deathtypeN == WEP_NEX) - bprint ("^1",s, " has been vaporized by ", attacker.netname, "\n"); - else if (deathtypeN == WEP_HAGAR) - bprint ("^1",s, " was pummeled by ", attacker.netname, "\n"); - else if (deathtypeN == WEP_ROCKET_LAUNCHER) - bprint ("^1",s, " was blasted by ", attacker.netname, "\n"); - else if (deathtypeN == WEP_GRENADE_MIRV) - bprint ("^1",s, " was blasted by ", attacker.netname, "'s mirv\n"); - else if (deathtypeN == WEP_GRENADE_FRAG) - bprint ("^1",s, " was fragged by ", attacker.netname, "'s grenade\n"); - else if (deathtypeN == DEATH_BURNING) - bprint ("^1",s, " was fried toasty by ", attacker.netname, "\n"); - else if (deathtypeN == DEATH_TELEFRAG) - bprint ("^1",s, " was telefragged by ", attacker.netname, "\n"); - else if (deathtypeN == 88) - bprint ("^1",s, " exploded from ", attacker.netname, "'s grenade\n"); - else - bprint ("^1",s, " was killed by ", attacker.netname, "\n"); - - attacker.frags = attacker.frags + 1; - if (targ.killcount > 2) - bprint ("^1",s,"'s ", ftos(targ.killcount), " kill spree was ended by ", attacker.netname, "\n"); - attacker.killcount = attacker.killcount + 1; - if (attacker.killcount > 2) - bprint ("^1",attacker.netname," has ",ftos(attacker.killcount)," kills in a row\n"); - } - else - { - if (deathtypeN == DEATH_CLASSCHANGE) - { - if (targ.killcount > 2) - bprint ("^1",s," changed with a ",ftos(targ.killcount)," kill spree\n"); - if (targ.killcount) - targ.killcount = 0; - return; // don't print anything more or lose frags - } - else if (deathtypeN == DEATH_HURTTRIGGER) - bprint ("^1",s, " ", attacker.message, "\n"); - else if (deathtypeN == DEATH_DROWN) - bprint ("^1",s, " drowned\n"); - else if (deathtypeN == DEATH_SLIME) - bprint ("^1",s, " was slimed\n"); - else if (deathtypeN == DEATH_LAVA) - bprint ("^1",s, " turned into hot slag\n"); - else if (deathtypeN == DEATH_FALL) - bprint ("^1",s, " hit the ground with a crunch\n"); - else if (deathtypeN == DEATH_LASERGATE) - bprint ("^1",s, " ", attacker.message, "\n"); - targ.frags = targ.frags - 1; - if (targ.killcount > 2) - bprint ("^1",s," died with a ",ftos(targ.killcount)," kill spree\n"); - } - // FIXME: this should go in PutClientInServer - if (targ.killcount) - targ.killcount = 0; - } -} - -void (entity targ, entity inflictor, entity attacker, float damage) T_Damage; - -void Damage (entity targ, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - deathmsg = deathtype; - T_Damage (targ, inflictor, attacker, damage); - return; - - local entity oldself; - oldself = self; - self = targ; - // nullify damage if teamplay is on - if (teamplay) - if (attacker.team) - if (attacker.team == targ.team) - if (teamplay == 1 || (teamplay == 3 && attacker != targ)) - damage = 0; - // apply strength multiplier - if (attacker.items & IT_STRENGTH) - { - damage = damage * cvar("g_balance_powerup_strength_damage"); - force = force * cvar("g_balance_powerup_strength_force"); - } - // apply invincibility multiplier - if (targ.items & IT_INVINCIBLE) - damage = damage * cvar("g_balance_powerup_invincible_takedamage"); - // apply push - if (self.damageforcescale) - { - self.velocity = self.velocity + self.damageforcescale * force; - self.flags = self.flags - (self.flags & FL_ONGROUND); - } -/* - // apply damage - if (self.event_damage) - self.event_damage (inflictor, attacker, damage, deathtype, hitloc, force); - self = oldself; */ -} - -void (entity targ, entity inflictor, entity attacker, float damage) T_Damage; -void (entity inflictor, entity attacker, float damage, entity ignore) T_RadiusDamage; - -void RadiusDamage (entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity ignore, float forceintensity, float deathtype) -{ -// deathmsg = deathtype; -// T_RadiusDamage (inflictor, attacker, coredamage, ignore); -// return; - - entity targ; - float finaldmg; - float power; - vector blastorigin; - vector force; - vector m1; - vector m2; - vector nearest; - vector diff; - - blastorigin = (inflictor.origin + (inflictor.mins + inflictor.maxs) * 0.5); - - targ = findradius (blastorigin, rad); - while (targ) - { - if (targ != inflictor) - if (ignore != targ) - { - // LordHavoc: measure distance to nearest point on target (not origin) - // (this guarentees 100% damage on a touch impact) - nearest = blastorigin; - m1 = targ.origin + targ.mins; - m2 = targ.origin + targ.maxs; - if (nearest_x < m1_x) nearest_x = m1_x; - if (nearest_y < m1_y) nearest_y = m1_y; - if (nearest_z < m1_z) nearest_z = m1_z; - if (nearest_x > m2_x) nearest_x = m2_x; - if (nearest_y > m2_y) nearest_y = m2_y; - if (nearest_z > m2_z) nearest_z = m2_z; - diff = nearest - blastorigin; - // round up a little on the damage to ensure full damage on impacts - // and turn the distance into a fraction of the radius - power = 1 - ((vlen (diff) - 2) / rad); - //bprint(" "); - //bprint(ftos(power)); - if (power > 0) - { - if (power > 1) - power = 1; - finaldmg = coredamage * power + edgedamage * (1 - power); - if (finaldmg > 0) - { - force = normalize((m1 + m2) * 0.5 - blastorigin) * (finaldmg / coredamage) * forceintensity; - if (targ == attacker) - finaldmg = finaldmg * cvar("g_balance_selfdamagepercent"); // Partial damage if the attacker hits himself - Damage (targ, inflictor, attacker, finaldmg, deathtype, inflictor.origin, force); - } - } - } - targ = targ.chain; - } -} - -/* -entity multi_ent; -float multi_damage; -vector multi_force; - -void ClearMultiDamage (void) -{ - multi_ent = world; - multi_damage = 0; - multi_force = '0 0 0'; -} - -void ApplyMultiDamage (void) -{ - if (!multi_ent) - return; - - Damage (self, multi_ent.origin, multi_ent, 0, multi_damage, multi_force); -} - -void AddMultiDamage (entity hit, float damage, vector force) -{ - if (!hit) - return; - - if (hit != multi_ent) - { - ApplyMultiDamage (); - ClearMultiDamage (); - multi_ent = hit; - } - multi_damage = multi_damage + damage; - multi_force = multi_force + force; -} - -void FireBullets (float shotcount, vector dir, vector spread, float deathtype) -{ - vector direction; - vector source; - vector vel; - vector org; - - makevectors (self.v_angle); - - source = self.origin + v_forward * 10; // FIXME - source_x = self.absmin_z + self.size_z * 0.7; // ??? whaddabout view_ofs - - // LordHavoc: better to use normal damage - //ClearMultiDamage (); - while (shotcount > 0) - { - direction = dir + crandom () * spread_x * v_right + crandom () * spread_y * v_up; - - traceline (source, source + direction * 2048, FALSE, self); - if (trace_fraction != 1.0) - { - vel = normalize (direction + v_up * crandom () + v_right * crandom ()); - vel = vel + 2 * trace_plane_normal; - vel = vel * 200; - - org = trace_endpos - direction * 4; - - if (!trace_ent.takedamage) - te_gunshot (org); - // LordHavoc: better to use normal damage - //AddMultiDamage (trace_ent, 4, direction * 4); - Damage (trace_ent, self, self, 4, deathtype, trace_endpos, direction * 4); - } - - shotcount = shotcount + 1; - } - - // LordHavoc: better to use normal damage - //ApplyMultiDamage (); -} -*/ diff --git a/TeamNexuiz/game/gamec/g_decors.c b/TeamNexuiz/game/gamec/g_decors.c deleted file mode 100644 index 87bbcd472..000000000 --- a/TeamNexuiz/game/gamec/g_decors.c +++ /dev/null @@ -1,246 +0,0 @@ - -float maxclients; // set by worldspawn code -float numdecors; -float maxdecors; -.float createdtime; - -//void(vector org, entity en, vector dir, float splattype, float importance) newbloodsplat; -//void(vector org, float bodydamage, float armordamage, vector vel, float damgtype) genericbleedfunc; - -// removes the oldest decors each frame to maintain a certain maximum decors -void() decorframe = -{ - local entity estart, e, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10; - local float bt1, bt2, bt3, bt4, bt5, bt6, bt7, bt8, bt9, bt10, iterations; - - // numdecors is allowed to be bogus as long as it is >= the real number of decors - // (but perfection is clearly preferable) - if (numdecors <= maxdecors) - return; - - // recount all the decors - numdecors = 0; - estart = e = findchain(classname, "decor"); - while(e) - { - numdecors = numdecors + 1; - e = e.chain; - } - if (numdecors <= maxdecors) - return; // nothing to do - - // limit it to considering 10000 entities per frame, - // otherwise it can cause a runaway loop error - iterations = 0; - while (numdecors > maxdecors && iterations < 10000) - { - iterations = iterations + 1; - // find and remove the oldest decors (upto 10 at once) - b1 = b2 = b3 = b4 = b5 = b6 = b7 = b8 = b9 = b10 = world; - bt1 = bt2 = bt3 = bt4 = bt5 = bt6 = bt7 = bt8 = bt9 = bt10 = time + 10000; - if (iterations > 0) - estart = findchain(classname, "decor"); - e = estart; - while(e) - { - iterations = iterations + 1; - if (e.createdtime < bt10) - { - if (e.createdtime < bt9) - { - if (e.createdtime < bt8) - { - if (e.createdtime < bt7) - { - if (e.createdtime < bt6) - { - if (e.createdtime < bt5) - { - if (e.createdtime < bt4) - { - if (e.createdtime < bt3) - { - if (e.createdtime < bt2) - { - if (e.createdtime < bt1) - { - b10=b9;bt10=bt9; - b9=b8;bt9=bt8; - b8=b7;bt8=bt7; - b7=b6;bt7=bt6; - b6=b5;bt6=bt5; - b5=b4;bt5=bt4; - b4=b3;bt4=bt3; - b3=b2;bt3=bt2; - b2=b1;bt2=bt1; - b1=e;bt1=e.createdtime; - } - else - { - b10=b9;bt10=bt9; - b9=b8;bt9=bt8; - b8=b7;bt8=bt7; - b7=b6;bt7=bt6; - b6=b5;bt6=bt5; - b5=b4;bt5=bt4; - b4=b3;bt4=bt3; - b3=b2;bt3=bt2; - b2=e;bt2=e.createdtime; - } - } - else - { - b10=b9;bt10=bt9; - b9=b8;bt9=bt8; - b8=b7;bt8=bt7; - b7=b6;bt7=bt6; - b6=b5;bt6=bt5; - b5=b4;bt5=bt4; - b4=b3;bt4=bt3; - b3=e;bt3=e.createdtime; - } - } - else - { - b10=b9;bt10=bt9; - b9=b8;bt9=bt8; - b8=b7;bt8=bt7; - b7=b6;bt7=bt6; - b6=b5;bt6=bt5; - b5=b4;bt5=bt4; - b4=e;bt4=e.createdtime; - } - } - else - { - b10=b9;bt10=bt9; - b9=b8;bt9=bt8; - b8=b7;bt8=bt7; - b7=b6;bt7=bt6; - b6=b5;bt6=bt5; - b5=e;bt5=e.createdtime; - } - } - else - { - b10=b9;bt10=bt9; - b9=b8;bt9=bt8; - b8=b7;bt8=bt7; - b7=b6;bt7=bt6; - b6=e;bt6=e.createdtime; - } - } - else - { - b10=b9;bt10=bt9; - b9=b8;bt9=bt8; - b8=b7;bt8=bt7; - b7=e;bt7=e.createdtime; - } - } - else - { - b10=b9;bt10=bt9; - b9=b8;bt9=bt8; - b8=e;bt8=e.createdtime; - } - } - else - { - b10=b9;bt10=bt9; - b9=e;bt9=e.createdtime; - } - } - else - { - b10=e;bt10=e.createdtime; - } - } - // failed all 10 slots - e = e.chain; - } - // remove the oldest decors - if (numdecors > maxdecors) {numdecors = numdecors - 1;remove(b1);} - if (numdecors > maxdecors) {numdecors = numdecors - 1;remove(b2);} - if (numdecors > maxdecors) {numdecors = numdecors - 1;remove(b3);} - if (numdecors > maxdecors) {numdecors = numdecors - 1;remove(b4);} - if (numdecors > maxdecors) {numdecors = numdecors - 1;remove(b5);} - if (numdecors > maxdecors) {numdecors = numdecors - 1;remove(b6);} - if (numdecors > maxdecors) {numdecors = numdecors - 1;remove(b7);} - if (numdecors > maxdecors) {numdecors = numdecors - 1;remove(b8);} - if (numdecors > maxdecors) {numdecors = numdecors - 1;remove(b9);} - if (numdecors > maxdecors) {numdecors = numdecors - 1;remove(b10);} - } -}; - -entity() newdecor = -{ - local entity e; - numdecors++; - e = spawn(); - e.classname = "decor"; - return e; -}; - -void(entity e) removedecor = -{ - numdecors--; - remove(e); -}; - - -void(vector org, vector vel, float amount) blood = -{ - te_blood(org, vel, amount); -}; - -void(vector org, vector vel, float amount) spark = -{ - te_spark(org, vel, amount); -}; - -void(vector m1, vector m2, float vel, float amount) bloodshower = -{ - te_bloodshower(m1, m2, vel, amount); -}; - -void(vector org, float quad) bulletpuff = -{ - if (quad) - te_gunshotquad(org); - else - te_gunshot(org); -}; - -void(vector org, float quad) nailpuff = -{ - if (quad) - te_superspikequad(org); - else - te_superspike(org); -}; - -// used for various little bouncing debris to avoid getting stuck in the air -void() DecorThink = -{ - self.nextthink = time; - self.flags = self.flags - (self.flags & FL_ONGROUND); - if (pointcontents(self.origin) == CONTENT_SOLID) - removedecor(self); -}; - -.float createdtime; - -void() InitDecors = -{ - // different number of decors in multi-player (to avoid lag on modems) - if (maxclients > 1) - maxdecors = 32; - else - maxdecors = 100; - // overridable by saved2 cvar on server console - if (cvar("decors")) - maxdecors = cvar("decors"); - if (maxdecors < 1) - maxdecors = 1; -}; diff --git a/TeamNexuiz/game/gamec/g_lights.c b/TeamNexuiz/game/gamec/g_lights.c deleted file mode 100644 index 7c17760cb..000000000 --- a/TeamNexuiz/game/gamec/g_lights.c +++ /dev/null @@ -1,120 +0,0 @@ -float LOOP = 1; - -float DNOSHADOW = 2; -float DFOLLOW = 4; -.float light_lev; -.float lefty; -.vector color; -.string dtagname; - -/*QUAKED dynlight (0 1 0) (-8 -8 -8) (8 8 8) START_OFF NOSHADOW FOLLOW -Dynamic light. -Can do one of these things: sit still and be just a silly light, travel along a path, follow an entity around, attach to a tag on an entity. -It can spin around it's own axis in all the above cases. -If targeted, it will toggle between on or off. -keys: -"light_lev" light radius, default 200 -"color" light color in rgb and brightness, 1 1 1 produces bright white, up to 255 255 255 (nuclear blast), recommended values up to 1 1 1, default 1 1 1 -"style" lightstyle, same as for static lights -"angles" initial orientation -"avelocity" a vector value, the direction and speed it rotates in -"skin" cubemap number, must be 16 or above -"dtagname" will attach to this tag on the entity which "targetname" matches "target". If the "target" is either not an md3 model or is missing tags, it will attach to the targets origin. Note that the "target" must be visible to the light -"targetname" will toggle on and off when triggered -"target" if issued with a target, preferrably path_corner, it will move along the path. If also issued with the FOLLOW spawnflag, then this is the entity it will follow. If issued with the "tagname" key it will attach it to this targets tag called "tagname", does not work together with FOLLOW or path movement -"speed" the speed it will travel along the path, default 100 -flags: -"START_OFF" light will be in off state until targeted -"NOSHADOW" will not cast shadows in realtime lighting mode -"FOLLOW" will follow the entity which "targetname" matches "target" -*/ -void() dynlight_think = -{ - if(!self.owner) - remove(self); - - self.nextthink = 0.1; -}; -void() dynlight_find_aiment = -{ - local entity targ; - - targ = find(world, targetname, self.target); - self.movetype = MOVETYPE_FOLLOW; - self.aiment = targ; - self.owner = targ; - self.punchangle = targ.angles; - self.view_ofs = self.origin - targ.origin; - self.v_angle = self.angles - targ.angles; - self.nextthink = 0.1; - self.think = dynlight_think; -}; -void() dynlight_find_path = -{ - local entity targ; - - targ = find(world, targetname, self.target); - self.target = targ.target; - setorigin (self, targ.origin); - self.nextthink = self.ltime + 0.1; - self.think = train_next; -}; -void() dynlight_use = -{ - if (self.light_lev == 0) - self.light_lev = self.lefty; - else - self.light_lev = 0; -}; -void() dynlight = -{ - local entity targ; - - if (!self.light_lev) - self.light_lev = 200; - if (!self.color) - self.color = '1 1 1'; - self.lefty = self.light_lev; - self.use = dynlight_use; - setsize (self, '0 0 0', '0 0 0'); - setorigin (self, self.origin); - //self.pflags = PFLAGS_FULLDYNAMIC; - self.solid = SOLID_NOT; - //self.blocked = SUB_Null; - //if (self.spawnflags & DNOSHADOW) - // self.pflags = self.pflags + PFLAGS_NOSHADOW; - //if (self.spawnflags & START_OFF) - // self.light_lev = 0; - -//tag attaching - if (self.dtagname) - { - if (!self.target) - objerror ("dynlight: no target to follow"); - targ = find(world, targetname, self.target); - setattachment(self, targ, self.dtagname); - self.owner = targ; - self.think = dynlight_think; - return; - } - -// entity following - if (self.spawnflags & DFOLLOW) - { - if (!self.target) - objerror ("dynlight: no target to follow"); - self.nextthink = time + 0.1; - self.think = dynlight_find_aiment; - return; - } -// path following - if (self.target) -// if (!(self.spawnflags & DFOLLOW)) - { - self.movetype = MOVETYPE_PUSH; - if (!self.speed) - self.speed = 100; - self.nextthink = self.ltime + 0.1; - self.think = dynlight_find_path; - } -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/g_subs.c b/TeamNexuiz/game/gamec/g_subs.c deleted file mode 100644 index a9ce56423..000000000 --- a/TeamNexuiz/game/gamec/g_subs.c +++ /dev/null @@ -1,456 +0,0 @@ -void() SUB_Null = {}; - -void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove; -void() SUB_CalcMoveDone; -void() SUB_CalcAngleMoveDone; -//void() SUB_UseTargets; -void() SUB_Remove; - -void info_null (void) -{ -} - -/* -================== -SUB_Remove - -Remove self -================== -*/ -void SUB_Remove (void) -{ - remove (self); -} - -/* -================== -SUB_VanishOrRemove - -Makes client invisible or removes non-client -================== -*/ -void SUB_VanishOrRemove (entity ent) -{ - if (ent.flags & FL_CLIENT) - { - // vanish - ent.effects = EF_NODRAW; - } - else - { - // remove - remove (ent); - } -} - -void ExtinguishFlame(entity targ); - -void SUB_SetFade_Think (void) -{ - if(self.onfire) - ExtinguishFlame(self); - self.think = SUB_SetFade_Think; - self.nextthink = self.fade_time; - self.alpha = 1 - (time - self.fade_time) * self.fade_rate; - if (self.alpha < 0.01) - SUB_VanishOrRemove(self); - self.alpha = bound(0.01, self.alpha, 1); -} - -/* -================== -SUB_SetFade - -Fade 'ent' out when time >= 'when' -================== -*/ -void SUB_SetFade (entity ent, float when, float fadetime) -{ - //if (ent.flags & FL_CLIENT) // && ent.deadflag != DEAD_NO) - // return; - //ent.alpha = 1; - ent.fade_rate = 1/fadetime; - ent.fade_time = when; - ent.think = SUB_SetFade_Think; - ent.nextthink = when; -} - -/* -============= -SUB_CalcMove - -calculate self.velocity and self.nextthink to reach dest from -self.origin traveling at speed -=============== -*/ -/* -void SUB_CalcMoveDone (void) -{ - // After moving, set origin to exact final destination - - setorigin (self, self.finaldest); - self.velocity = '0 0 0'; - self.nextthink = -1; - if (self.think1) - self.think1 (); -} -*/ -/*void SUB_CalcMove (vector tdest, float tspeed, void() func) -{ - vector delta; - float traveltime; - - if (!tspeed) - objerror ("No speed is defined!"); - - self.think1 = func; - self.finaldest = tdest; - self.think = SUB_CalcMoveDone; - - if (tdest == self.origin) - { - self.velocity = '0 0 0'; - self.nextthink = self.ltime + 0.1; - return; - } - - delta = tdest - self.origin; - traveltime = vlen (delta) / tspeed; - - if (traveltime < 0.1) - { - self.velocity = '0 0 0'; - self.nextthink = self.ltime + 0.1; - return; - } - - self.velocity = delta * (1/traveltime); // QuakeC doesn't allow vector/float division - - self.nextthink = self.ltime + traveltime; -}*/ - -void () SUB_CalcMoveDone = -{ - setorigin (self, self.finaldest); - self.velocity = '0 0 0'; - self.nextthink = -1; - if (self.think1) - { - self.think1 (); - } -}; - -void (vector tdest, float tspeed, void() func) SUB_CalcMove = -{ - local vector vdestdelta; - local float len; - local float traveltime; - - if (!tspeed) - { - objerror ("No speed is defined!"); - } - self.think1 = func; - self.finaldest = tdest; - self.think = SUB_CalcMoveDone; - if ((tdest == self.origin)) - { - self.velocity = '0 0 0'; - self.nextthink = (self.ltime + 0.1); - return; - } - vdestdelta = (tdest - self.origin); - len = vlen (vdestdelta); - traveltime = (len / tspeed); - if ((traveltime < 0.1)) - { - self.velocity = '0 0 0'; - self.nextthink = (self.ltime + 0.1); - return; - } - self.nextthink = (self.ltime + traveltime); - self.velocity = (vdestdelta * (1 / traveltime)); -}; - -void SUB_CalcMoveEnt (entity ent, vector tdest, float tspeed, void() func) -{ - entity oldself; - - oldself = self; - self = ent; - - SUB_CalcMove (tdest, tspeed, func); - - self = oldself; -} - -/* -============= -SUB_CalcAngleMove - -calculate self.avelocity and self.nextthink to reach destangle from -self.angles rotating - -The calling function should make sure self.think is valid -=============== -*/ -void SUB_CalcAngleMoveDone (void) -{ - // After rotating, set angle to exact final angle - self.angles = self.finalangle; - self.avelocity = '0 0 0'; - self.nextthink = -1; - if (self.think1) - self.think1 (); -} - -void SUB_CalcAngleMove (vector destangle, float tspeed, void() func) -{ - vector delta; - float traveltime; - - if (!tspeed) - objerror ("No speed is defined!"); - - delta = destangle = self.angles; - traveltime = vlen (delta) / tspeed; - - self.avelocity = delta * (1 / traveltime); - - self.think1 = func; - self.finalangle = destangle; - - self.think = SUB_CalcAngleMoveDone; - self.nextthink = self.ltime + traveltime; -} - -void SUB_CalcAngleMoveEnt (entity ent, vector destangle, float tspeed, void() func) -{ - entity oldself; - - oldself = self; - self = ent; - - SUB_CalcAngleMove (destangle, tspeed, func); - - self = oldself; -} - -/* -================== -main - -unused but required by the engine -================== -*/ -void main (void) -{ - -} - -// Sound functions - -/* -================== -PointSound - -Play a sound at the given location -================== -*/ -void PointSound (vector org, string snd, float vol, float attn) -{ - entity speaker; - - speaker = spawn (); - setorigin (speaker, org); - sound (speaker, CHAN_BODY, snd, vol, attn); - remove (speaker); -} - -// Misc - -/* -================== -traceline_hitcorpse - -A version of traceline that must be used by SOLID_SLIDEBOX things that want to hit SOLID_CORPSE things with a trace attack -================== -*/ -void traceline_hitcorpse (entity source, vector v1, vector v2, float nomonst, entity forent) -{ - float oldsolid; - - oldsolid = source.solid; - source.solid = SOLID_BBOX; - - traceline (v1, v2, nomonst, forent); - - source.solid = oldsolid; -} - -/* -================== -findbetterlocation - -Returns a point at least 12 units away from walls -(useful for explosion animations, although the blast is performed where it really happened) -Ripped from DPMod -================== -*/ -vector findbetterlocation (vector org) -{ - vector loc; - - traceline (org, org - '12 0 0', TRUE, world); - if (trace_fraction < 1) - { - loc = trace_endpos; - traceline (loc, loc + '12 0 0', TRUE, world); - if (trace_fraction >= 1) - org = loc + '12 0 0'; - } - - traceline (org, org - '-12 0 0', TRUE, world); - if (trace_fraction < 1) - { - loc = trace_endpos; - traceline (loc, loc + '-12 0 0', TRUE, world); - if (trace_fraction >= 1) - org = loc + '-12 0 0'; - } - - traceline (org, org - '0 12 0' , TRUE, world); - if (trace_fraction < 1) - { - loc = trace_endpos; - traceline (loc, loc + '0 12 0', TRUE, world); - if (trace_fraction >= 1) - org = loc + '0 12 0'; - } - - traceline (org, org - '0 -12 0', TRUE, world); - if (trace_fraction < 1) - { - loc = trace_endpos; - traceline (loc, loc + '0 -12 0', TRUE, world); - if (trace_fraction >= 1) - org = loc + '0 -12 0'; - } - - traceline (org, org - '0 0 12' , TRUE, world); - if (trace_fraction < 1) - { - loc = trace_endpos; - traceline (loc, loc + '0 0 12', TRUE, world); - if (trace_fraction >= 1) - org = loc + '0 0 12'; - } - - traceline (org, org - '0 0 -12', TRUE, world); - if (trace_fraction < 1) - { - loc = trace_endpos; - traceline (loc, loc + '0 0 -12', TRUE, world); - if (trace_fraction >= 1) - org = loc + '0 0 -12'; - } - - return org; -} - -/* -================== -crandom - -Returns a random number between -1.0 and 1.0 -================== -*/ -float crandom (void) -{ - return 2 * (random () - 0.5); -} - -/* -================== -Angc used for animations -================== -*/ - - -float angc (float a1, float a2) -{ - float a; - - while (a1 > 180) - a1 = a1 - 360; - while (a1 < -179) - a1 = a1 + 360; - - while (a2 > 180) - a2 = a2 - 360; - while (a2 < -179) - a2 = a2 + 360; - - a = a1 - a2; - while (a > 180) - a = a - 360; - while (a < -179) - a = a + 360; - - return a; -} - - -/* -================ -InitTrigger -================ -*/ - -void() SetMovedir = -{ - if (self.movedir != '0 0 0') - self.movedir = normalize(self.movedir); - else - { - if (self.angles == '0 -1 0') - self.movedir = '0 0 1'; - else if (self.angles == '0 -2 0') - self.movedir = '0 0 -1'; - else - { - makevectors (self.angles); - self.movedir = v_forward; - } - } - - self.angles = '0 0 0'; -}; - -void() InitTrigger = -{ -// trigger angles are used for one-way touches. An angle of 0 is assumed -// to mean no restrictions, so use a yaw of 360 instead. - if (self.movedir == '0 0 0') - if (self.angles != '0 0 0') - SetMovedir (); - self.solid = SOLID_TRIGGER; - setmodel (self, self.model); // set size and link into world - self.movetype = MOVETYPE_NONE; - self.modelindex = 0; - self.model = ""; -}; - -void() InitSolidBSPTrigger = -{ -// trigger angles are used for one-way touches. An angle of 0 is assumed -// to mean no restrictions, so use a yaw of 360 instead. - if (self.movedir == '0 0 0') - if (self.angles != '0 0 0') - SetMovedir (); - self.solid = SOLID_BSP; - setmodel (self, self.model); // set size and link into world - self.movetype = MOVETYPE_PUSH; -// self.modelindex = 0; - self.model = ""; -}; diff --git a/TeamNexuiz/game/gamec/g_tetris.c b/TeamNexuiz/game/gamec/g_tetris.c deleted file mode 100644 index f78aac272..000000000 --- a/TeamNexuiz/game/gamec/g_tetris.c +++ /dev/null @@ -1,746 +0,0 @@ -/* - -Installation: - -in weapons.qc add TetrisImpulses(); to ImpulseCommands - -in progs.src add tetris.qc after subs.qc -in client.qc add if (TetrisPreFrame()) return; to PlayerPreThink -in client.qc add if (TetrisPostFrame()) return; to PlayerPostThink - -*/ - -.vector tet_org; - -.float tetris_on, tet_time, tet_autodown; -.vector piece_pos; -.float piece_type, next_piece, tet_score, tet_lines; - -var float tet_high_score = 0; - -float TET_LINES = 20; -float TET_WIDTH = 10; -//character values -float TET_BORDER = 132; -float TET_BLOCKS = 132; // +1 = first color, +2, +3; -float TET_SPACE = 32; // blankness - - - -float TETKEY_UP = 1; -float TETKEY_DOWN = 2; -float TETKEY_LEFT = 4; -float TETKEY_RIGHT = 8; -float TETKEY_ROTLEFT = 16; -float TETKEY_ROTRIGHT = 32; - -float PIECES = 7; - -.float line1, line2, line3, line4, line5, line6, line7, -line8, line9, line10, line11, line12, line13, line14, line15, -line16, line17, line18, line19, line20; - - -float SVC_CENTERPRINTa = 26; - - -/* -********************************* - -Library Functions - -********************************* -*/ -void (float ln, float vl) SetLine = -{ - if (ln == 1) - self.line1 = vl; - else if (ln == 2) - self.line2 = vl; - else if (ln == 3) - self.line3 = vl; - else if (ln == 4) - self.line4 = vl; - else if (ln == 5) - self.line5 = vl; - else if (ln == 6) - self.line6 = vl; - else if (ln == 7) - self.line7 = vl; - else if (ln == 8) - self.line8 = vl; - else if (ln == 9) - self.line9 = vl; - else if (ln == 10) - self.line10 = vl; - else if (ln == 11) - self.line11 = vl; - else if (ln == 12) - self.line12 = vl; - else if (ln == 13) - self.line13 = vl; - else if (ln == 14) - self.line14 = vl; - else if (ln == 15) - self.line15 = vl; - else if (ln == 16) - self.line16 = vl; - else if (ln == 17) - self.line17 = vl; - else if (ln == 18) - self.line18 = vl; - else if (ln == 19) - self.line19 = vl; - else if (ln == 20) - self.line20 = vl; -}; - -float (float ln) GetLine = -{ - if (ln == 1) - return self.line1; - else if (ln == 2) - return self.line2; - else if (ln == 3) - return self.line3; - else if (ln == 4) - return self.line4; - else if (ln == 5) - return self.line5; - else if (ln == 6) - return self.line6; - else if (ln == 7) - return self.line7; - else if (ln == 8) - return self.line8; - else if (ln == 9) - return self.line9; - else if (ln == 10) - return self.line10; - else if (ln == 11) - return self.line11; - else if (ln == 12) - return self.line12; - else if (ln == 13) - return self.line13; - else if (ln == 14) - return self.line14; - else if (ln == 15) - return self.line15; - else if (ln == 16) - return self.line16; - else if (ln == 17) - return self.line17; - else if (ln == 18) - return self.line18; - else if (ln == 19) - return self.line19; - else if (ln == 20) - return self.line20; - else - return 0; -}; - -float(float x, float dat) GetXBlock = -{ - if (x == 1) - return dat & 3; - else if (x == 2) - return (dat & 12) / 4; - else if (x == 3) - return (dat & 48) / 16; - else if (x == 4) - return (dat & 192) / 64; - else if (x == 5) - return (dat & 768) / 256; - else if (x == 6) - return (dat & 3072) / 1024; - else if (x == 7) - return (dat & 12288) / 4096; - else if (x == 8) - return (dat & 49152) / 16384; - else if (x == 9) - return (dat & 196608) / 65536; - else if (x == 10) - return (dat & 786432) / 262144; - else - return 0; -}; - -float(float x, float dat, float new) SetXBlock = -{ - if (x == 1) - return (dat - (dat & 3)) | new; - else if (x == 2) - return (dat - (dat & 12)) | (new*4); - else if (x == 3) - return (dat - (dat & 48)) | (new*16); - else if (x == 4) - return (dat - (dat & 192)) | (new*64); - else if (x == 5) - return (dat - (dat & 768)) | (new*256); - else if (x == 6) - return (dat - (dat & 3072)) | (new*1024); - else if (x == 7) - return (dat - (dat & 12288)) | (new*4096); - else if (x == 8) - return (dat - (dat & 49152)) | (new*16384); - else if (x == 9) - return (dat - (dat & 196608)) | (new*65536); - else if (x == 10) - return (dat - (dat & 786432)) | (new*262144); - else - return dat; -}; - - -float(float x, float y) GetSquare = -{ - return GetXBlock(x, GetLine(y)); -}; - -void (float x, float y, float val) SetSquare = -{ - float dat; - - dat = GetLine(y); - dat = SetXBlock(x, dat, val & 3); - SetLine(y, dat); -}; - - - -vector(float pc) PieceShape = -{ - -/* -1 = - ## - ## -*/ - if (pc == 1) - return '20 20 0'; // 1 * 4 + 1 * 16 -/* -2 = - -#### -*/ - else if (pc == 2) - return '85 0 0'; - -/* -3 = - -### -# -*/ - else if (pc == 3) - return '21 1 0'; -/* -4 = - -# -### -*/ - else if (pc == 4) - return '1 21 0'; -/* -5 = -## - ## -*/ - else if (pc == 5) - return '5 20 0'; - -/* -6 = - ## -## -*/ - else if (pc == 6) - return '20 5 0'; - -/* -7 = - # -### -*/ - else if (pc == 7) - return '4 21 0'; - - - else - return '0 0 0'; - -} - -// do x 1..4 and y 1..4 in case of rotation -float(float x, float y, float rot, float pc) PieceMetric = -{ - float t; - vector piece_dat; - - // return bits of a piece - if (rot == 1) // 90 degrees - { - t = y; - y = x; - x = 5 - t; - } - else if (rot == 2)//180 - { - x = 5 - x; - y = 3 - y; - } - else if (rot == 3) // 270 - { - t = y; - y = 5 - x; - x = t; - } - if (x < 1 || y < 1 || x > 4 || y > 2) - return 0; - piece_dat = PieceShape(pc); - if (y == 1) - return GetXBlock(x, piece_dat_x); // first row - else if (y == 2) - return GetXBlock(x, piece_dat_y); // second row - else if (y == 3) - return GetXBlock(x, piece_dat_z); // third row (doesn't exist) - else - return 0; // illegal parms -}; -/* -********************************* - -Draw - -********************************* -*/ - - -/* some prydon gate functions to make life easier.... - -somewhat modified because we don't need all the fanciness Prydon Gate is capable of - -*/ - -void(float c1, float c2, float c3, float c4, float c5, float c6) p6 = -{ - WriteChar(MSG_ONE, c1); - WriteChar(MSG_ONE, c2); - WriteChar(MSG_ONE, c3); - WriteChar(MSG_ONE, c4); - WriteChar(MSG_ONE, c5); - WriteChar(MSG_ONE, c6); -}; - -float(float num, float dig) pnum = -{ - local float f, i; - if (num < 0) - { - WriteChar(MSG_ONE, 45); - num = 0 - num; - } - f = floor(num / 10); - num = num - (f * 10); - if (f) - dig = pnum(f, dig+1); - else - { - // pad to 6 - for (i = 0; i < (5 - dig); i = i + 1) - WriteChar(MSG_ONE, TET_SPACE); - } - WriteChar(MSG_ONE, 48 + num); - return dig; -}; - -void (float ln) DrawLine = -{ - float x, d; - WriteChar(MSG_ONE, TET_BORDER); - - for (x = 1; x <= TET_WIDTH; x = x + 1) - { - d = GetSquare(x, ln); - if (d) - WriteChar(MSG_ONE, TET_BLOCKS + d); - else - WriteChar(MSG_ONE, TET_SPACE); - } - WriteChar(MSG_ONE, TET_BORDER); -} - -void (float pc, float ln) DrawPiece = -{ - float x, d, piece_ln, color; - vector piece_dat; - color = pc & 3; - if (color == 0) // 4 - color = 1; - WriteChar(MSG_ONE, TET_SPACE); // pad to 6 - - piece_dat = PieceShape(pc); - if (ln == 1) - piece_ln = piece_dat_x; - else - piece_ln = piece_dat_y; - for (x = 1; x <= 4; x = x + 1) - { - d = GetXBlock(x, piece_ln) * color; - if (d) - WriteChar(MSG_ONE, TET_BLOCKS + d); - else - WriteChar(MSG_ONE, TET_SPACE); - } - WriteChar(MSG_ONE, TET_SPACE); // pad to 6 -} -void() Draw_Tetris = -{ - float i; - msg_entity = self; - WriteChar(MSG_ONE, SVC_CENTERPRINTa); - // decoration - for (i = 1; i <= (TET_WIDTH + 2); i = i + 1) - WriteChar(MSG_ONE, TET_BORDER); - p6(' ', ' ', ' ', ' ', ' ', ' '); - WriteChar(MSG_ONE, 10); - for (i = 1; i <= TET_LINES; i = i + 1) - { - DrawLine(i); - if (i == 1) - p6(' ', 'N', 'E', 'X', 'T', ' '); - else if (i == 3) - DrawPiece(self.next_piece, 1); - else if (i == 4) - DrawPiece(self.next_piece, 2); - else if (i == 6) - p6(' ', 'L', 'I', 'N', 'E', 'S'); - else if (i == 7) - pnum(self.tet_lines, 0); - else if (i == 9) - p6(' ', 'S', 'C', 'O', 'R', 'E'); - else if (i == 10) - pnum(self.tet_score, 0); - else if (i == 12) - p6(' ', 'H', 'I', 'G', 'H', ' '); - else if (i == 13) - p6(' ', 'S', 'C', 'O', 'R', 'E'); - else if (i == 14) - pnum(tet_high_score, 0); - else if (i == 16) - p6(' ', 'L', 'E', 'V', 'E', 'L'); - else if (i == 17) - pnum(floor(self.tet_lines / 20)+ 1, 0); - else - p6(' ', ' ', ' ', ' ', ' ', ' '); - WriteChar(MSG_ONE, 10); - } - // decoration - - for (i = 1; i <= (TET_WIDTH + 2); i = i + 1) - WriteChar(MSG_ONE, TET_BORDER); - p6(' ', ' ', ' ', ' ', ' ', ' '); - WriteChar(MSG_ONE, 10); - WriteChar(MSG_ONE, 0); -} -/* -********************************* - -Game Functions - -********************************* -*/ - -// reset the game -void() ResetTetris = -{ - float i; - - for (i=1; i<=TET_LINES; i = i + 1) - SetLine(i, 0); - self.piece_pos = '0 0 0'; - self.piece_type = 0; - self.next_piece = self.tet_lines = self.tet_score = 0; - -}; - -void () Tet_GameOver = -{ - centerprint(self, "Game Over"); - self.tetris_on = 0; - ResetTetris(); - self.movetype = MOVETYPE_WALK; -}; - - - -/* -********************************* - -Game Mechanics - -********************************* -*/ -float() RandomPiece = -{ - return floor(random() * PIECES) + 1; -}; - -void(float n) TetAddScore = -{ - self.tet_score = self.tet_score + n; - if (self.tet_score > tet_high_score) - tet_high_score = self.tet_score; -}; -float CheckMetrics(float piece, float orgx, float orgy, float rot) = -{ - // check to see if the piece, if moved to the locations will overlap - - float x, y; - // why did I start counting from 1, damnit - orgx = orgx - 1; - orgy = orgy - 1; - - for (y = 1; y < 5; y = y + 1) - { - for (x = 1; x < 5; x = x + 1) - { - if (PieceMetric(x, y, rot, piece)) - { - if (GetSquare(x + orgx, y + orgy)) - return FALSE; // uhoh, gonna hit something. - if (x+orgx<1 || x+orgx > TET_WIDTH || y+orgy<1 || y+orgy> TET_LINES) - return FALSE; // ouside the level - } - } - } - return TRUE; -} - -void ClearPiece(float piece, float orgx, float orgy, float rot) = -{ - - float x, y; - // why did I start counting from 1, damnit - orgx = orgx - 1; - orgy = orgy - 1; - - for (y = 1; y < 5; y = y + 1) - { - for (x = 1; x < 5; x = x + 1) - { - if (PieceMetric(x, y, rot, piece)) - { - SetSquare(x + orgx, y + orgy, 0); - } - } - } -} -void CementPiece(float piece, float orgx, float orgy, float rot) = -{ - float color; - float x, y; - // why did I start counting from 1, damnit - orgx = orgx - 1; - orgy = orgy - 1; - - color = piece & 3; - if (color == 0) // 4 - color = 1; - - for (y = 1; y < 5; y = y + 1) - { - for (x = 1; x < 5; x = x + 1) - { - if (PieceMetric(x, y, rot, piece)) - { - SetSquare(x + orgx, y + orgy, color); - } - } - } -} - -float LINE_LOW = 349525; -float LINE_HIGH = 699050; // above number times 2 - -void() CompletedLines = -{ - float y, cleared, ln; - - cleared = 0; - y = TET_LINES; - while(y >= 1) - { - ln = GetLine(y); - if (((ln & LINE_LOW) | ((ln & LINE_HIGH)/2)) == LINE_LOW) - cleared = cleared + 1; - else - y = y - 1; - ln = GetLine(y - cleared); - SetLine(y, ln); - } - self.tet_lines = self.tet_lines + cleared; - TetAddScore(cleared * cleared * 10); -}; - -void(float keyss) HandleGame = -{ - - // first off, we need to see if we need a new piece - vector check_pos; - float brand_new; - brand_new = 0; - if (self.tet_time > time) - return; - self.tet_time = time + 0.1; - - - if (self.piece_type == 0) - { - self.piece_pos = '5 1 0'; // that's about middle top, we count from 1 ARGH - if (self.next_piece) - self.piece_type = self.next_piece; - else - self.piece_type = RandomPiece(); - self.next_piece = RandomPiece(); - keyss = 0; // no movement first frame - self.tet_autodown = time + 0.2; - brand_new = 1; - } - else - ClearPiece(self.piece_type, self.piece_pos_x, self.piece_pos_y, self.piece_pos_z); - - // next we need to check the piece metrics against what's on the level - // based on the key order - - check_pos = self.piece_pos; - - if (keyss & TETKEY_RIGHT) - check_pos_x = check_pos_x + 1; - else if (keyss & TETKEY_LEFT) - check_pos_x = check_pos_x - 1; - else if (keyss & TETKEY_ROTRIGHT) - check_pos_z = check_pos_z + 1; - else if (keyss & TETKEY_ROTLEFT) - check_pos_z = check_pos_z - 1; - // bounds check - if (check_pos_z > 3) - check_pos_z = 0; - else if (check_pos_z < 0) - check_pos_z = 3; - - // reality check - if (CheckMetrics(self.piece_type, check_pos_x, check_pos_y, check_pos_z)) - self.piece_pos = check_pos; - else if (brand_new) - Tet_GameOver(); - check_pos = self.piece_pos; - if (keyss & TETKEY_DOWN) - check_pos_y = check_pos_y + 1; - else if (self.tet_autodown < time) - { - check_pos_y = check_pos_y + 1; - self.tet_autodown = time + 1 / (floor(self.tet_lines / 20) + 1); - } - if (CheckMetrics(self.piece_type, check_pos_x, check_pos_y, check_pos_z)) - self.piece_pos = check_pos; - else - { - CementPiece(self.piece_type, self.piece_pos_x, self.piece_pos_y, self.piece_pos_z); - TetAddScore(1); - CompletedLines(); - self.piece_type = 0; - return; - } - CementPiece(self.piece_type, self.piece_pos_x, self.piece_pos_y, self.piece_pos_z); -}; - -/* -********************************* - -Important Linking Into Quake stuff - -********************************* -*/ - - -void() TetrisImpulses = -{ - if (self.impulse == 200) - { - self.tetris_on = 1; - ResetTetris(); - self.tet_org = self.origin; - self.movetype = MOVETYPE_NOCLIP; - stuffcmd(self, "cl_bob 0\ncl_rollangle 0\n"); - } -}; - - -float() TetrisPreFrame = -{ - if (!self.tetris_on) - return 0; - - self.tet_org = self.origin; - if (self.tet_time > time) - return 1; - Draw_Tetris(); - return 1; - -}; -float(float v) frik_anglemoda = -{ - return v - floor(v/360) * 360; -}; -float (float y1, float y2) angcompa = -{ - y1 = frik_anglemoda(y1); - y2 = frik_anglemoda(y2); - - local float answer; - answer = y1 - y2; - if (answer > 180) - answer = answer - 360; - else if (answer < -180) - answer = answer + 360; - return answer; -}; - - -float() TetrisPostFrame = -{ - vector mov; - float keysa, norm; - - keysa = 0; - - if (!self.tetris_on) - return 0; - if (self.origin != self.tet_org) - { - mov = vectoangles(self.origin - self.tet_org); - self.origin = self.tet_org; - - norm = angcompa(self.v_angle_y, mov_y); - - if (norm > -80 && norm < 80) - keysa = keysa | TETKEY_UP; - if (norm > 10 && norm < 170) - keysa = keysa | TETKEY_RIGHT; - if (norm > 100 || norm < -260) - keysa = keysa | TETKEY_DOWN; - if (norm > -170 && norm < -10) - keysa = keysa | TETKEY_LEFT; - } - if (self.button0) - keysa = keysa | TETKEY_ROTRIGHT; - if (self.button2) - keysa = keysa | TETKEY_ROTLEFT; - HandleGame(keysa); - return 1; -}; - diff --git a/TeamNexuiz/game/gamec/g_triggers.c b/TeamNexuiz/game/gamec/g_triggers.c deleted file mode 100644 index 6d9bdd315..000000000 --- a/TeamNexuiz/game/gamec/g_triggers.c +++ /dev/null @@ -1,1430 +0,0 @@ - -void() SUB_UseTargets; - -void() DelayThink = -{ - activator = self.enemy; - SUB_UseTargets (); - remove(self); -}; - -/* -============================== -SUB_UseTargets - -the global "activator" should be set to the entity that initiated the firing. - -If self.delay is set, a DelayedUse entity will be created that will actually -do the SUB_UseTargets after that many seconds have passed. - -Centerprints any self.message to the activator. - -Removes all entities with a targetname that match self.killtarget, -and removes them, so some events can remove other triggers. - -Search for (string)targetname in all entities that -match (string)self.target and call their .use function - -============================== -*/ -/*void() SUB_UseTargets = -{ - local entity t, stemp, otemp, act; - -// -// check for a delay -// - if (self.delay) - { - // create a temp object to fire at a later time - t = spawn(); - t.classname = "DelayedUse"; - t.nextthink = time + self.delay; - t.think = DelayThink; - t.enemy = activator; - t.message = self.message; - t.killtarget = self.killtarget; - t.target = self.target; - return; - } - - -// -// print the message -// - if (activator.classname == "player" && self.message != "") - { - centerprint (activator, self.message); - if (!self.noise) - sound (activator, CHAN_VOICE, "misc/talk.wav", 1, ATTN_NORM); - } - -// -// kill the killtagets -// - if (self.killtarget) - { - t = world; - do - { - t = find (t, targetname, self.killtarget); - if (!t) - return; - remove (t); - } while ( 1 ); - } - -// -// fire targets -// - if (self.target) - { - act = activator; - t = world; - do - { - t = find (t, targetname, self.target); - if (!t) - { - return; - } - stemp = self; - otemp = other; - self = t; - other = stemp; - if (self.use) - self.use (); - self = stemp; - other = otemp; - activator = act; - } while ( 1 ); - } - - -};*/ - - - -void() trigger_reactivate = -{ - self.solid = SOLID_TRIGGER; -}; - -//============================================================================= - -float SPAWNFLAG_NOMESSAGE = 1; -float SPAWNFLAG_NOTOUCH = 1; - -// the wait time has passed, so set back up for another activation -void() multi_wait = -{ - if (self.max_health) - { - self.health = self.max_health; - self.takedamage = DAMAGE_YES; - self.solid = SOLID_BBOX; - } -}; - - -// the trigger was just touched/killed/used -// self.enemy should be set to the activator so it can be held through a delay -// so wait for the delay time before firing -/*void() multi_trigger = -{ - if (self.nextthink > time) - { - return; // allready been triggered - } - - if (self.classname == "trigger_secret") - { - if (self.enemy.classname != "player") - return; - found_secrets = found_secrets + 1; - WriteByte (MSG_ALL, SVC_FOUNDSECRET); - } - - if (self.noise) - sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); - -// don't trigger again until reset - self.takedamage = DAMAGE_NO; - - activator = self.enemy; - - SUB_UseTargets(); - - if (self.wait > 0) - { - self.think = multi_wait; - self.nextthink = time + self.wait; - } - else - { // we can't just remove (self) here, because this is a touch function - // called wheil C code is looping through area links... - self.touch = SUB_Null; - - self.nextthink = time + 0.1; - self.think = SUB_Remove; - } -};*/ - -void() multi_trigger = -{ - if (self.nextthink > time) - { - return; - } - if (self.classname == "trigger_secret") - { - if (self.enemy.classname != "player") - { - return; - } - found_secrets = found_secrets + TF_FLARE_OFF; - WriteByte(2, 28); - } - if (self.noise) - { - sound(self, 2, self.noise, TF_FLARE_OFF, TF_FLARE_OFF); - } - self.takedamage = TF_FLARE_LIT; - activator = self.enemy; - SUB_UseTargets(); - if (self.wait > TF_FLARE_LIT) - { - self.think = multi_wait; - self.nextthink = time + self.wait; - } - else - { - self.touch = SUB_Null; - self.nextthink = time + 0.1; - self.think = SUB_Remove; - } -}; - -void() multi_use = -{ - self.enemy = activator; - multi_trigger(); -}; - -void() multi_touch = -{ - if (other.classname != "player") - return; - -// if the trigger has an angles field, check player's facing direction - if (self.movedir != '0 0 0') - { - makevectors (other.angles); - if (v_forward * self.movedir < 0) - return; // not facing the right way - } - - self.enemy = other; - multi_trigger (); -}; - -void multi_eventdamage (vector hitloc, float damage, entity inflictor, entity attacker, float deathtype) -{ - if (!self.takedamage) - return; - self.health = self.health - damage; - if (self.health <= 0) - { - self.enemy = attacker; - multi_trigger(); - } -} - -/*QUAKED trigger_multiple (.5 .5 .5) ? notouch -Variable sized repeatable trigger. Must be targeted at one or more entities. If "health" is set, the trigger must be killed to activate each time. -If "delay" is set, the trigger waits some time after activating before firing. -"wait" : Seconds between triggerings. (.2 default) -If notouch is set, the trigger is only fired by other entities, not by touching. -NOTOUCH has been obsoleted by trigger_relay! -sounds -1) secret -2) beep beep -3) large switch -4) -set "message" to text string -*/ -void (float tno) ConvertToGoal; -void () CheckIfQ3FTrigger; -void() trigger_multiple = -{ -/* if (CheckIfQ3FTrigger() == 1) - { - ConvertToGoal (1); - return; - } - if (CheckIfQ3FTrigger() == 2) - { - ConvertToGoal (2); - return; - }*/ - CheckIfQ3FTrigger (); - - if (self.sounds == 1) - { - precache_sound ("misc/secret.wav"); - self.noise = "misc/secret.wav"; - } - else if (self.sounds == 2) - { - precache_sound ("misc/talk.wav"); - self.noise = "misc/talk.wav"; - } - else if (self.sounds == 3) - { - precache_sound ("misc/trigger1.wav"); - self.noise = "misc/trigger1.wav"; - } - - if (!self.wait) - self.wait = 0.2; - self.use = multi_use; - - InitTrigger (); - - if (self.health) - { - if (self.spawnflags & SPAWNFLAG_NOTOUCH) - objerror ("health and notouch don't make sense\n"); - self.max_health = self.health; - self.event_damage = multi_eventdamage; - self.takedamage = DAMAGE_YES; - self.solid = SOLID_BBOX; - setorigin (self, self.origin); // make sure it links into the world - } - else - { - if ( !(self.spawnflags & SPAWNFLAG_NOTOUCH) ) - { - self.touch = multi_touch; - } - } -}; - - -/*QUAKED trigger_once (.5 .5 .5) ? notouch -Variable sized trigger. Triggers once, then removes itself. You must set the key "target" to the name of another object in the level that has a matching -"targetname". If "health" is set, the trigger must be killed to activate. -If notouch is set, the trigger is only fired by other entities, not by touching. -if "killtarget" is set, any objects that have a matching "target" will be removed when the trigger is fired. -if "angle" is set, the trigger will only fire when someone is facing the direction of the angle. Use "360" for an angle of 0. -sounds -1) secret -2) beep beep -3) large switch -4) -set "message" to text string -*/ -/*void() trigger_once = -{ - self.wait = -1; - trigger_multiple(); -};*/ - -//============================================================================= - -/*QUAKED trigger_relay (.5 .5 .5) (-8 -8 -8) (8 8 8) -This fixed size trigger cannot be touched, it can only be fired by other events. It can contain killtargets, targets, delays, and messages. -*/ -void() trigger_relay = -{ - self.use = SUB_UseTargets; -}; - - -//============================================================================= - - -void() counter_use = -{ - self.count = self.count - 1; - if (self.count < 0) - return; - - if (self.count != 0) - { - if (activator.classname == "player" - && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) - { - if (self.count >= 4) - centerprint (activator, "There are more to go..."); - else if (self.count == 3) - centerprint (activator, "Only 3 more to go..."); - else if (self.count == 2) - centerprint (activator, "Only 2 more to go..."); - else - centerprint (activator, "Only 1 more to go..."); - } - return; - } - - if (activator.classname == "player" - && (self.spawnflags & SPAWNFLAG_NOMESSAGE) == 0) - centerprint(activator, "Sequence completed!"); - self.enemy = activator; - multi_trigger (); -}; - -/*QUAKED trigger_counter (.5 .5 .5) ? nomessage -Acts as an intermediary for an action that takes multiple inputs. - -If nomessage is not set, t will print "1 more.. " etc when triggered and "sequence complete" when finished. - -After the counter has been triggered "count" times (default 2), it will fire all of it's targets and remove itself. -*/ -void() trigger_counter = -{ - self.wait = -1; - if (!self.count) - self.count = 2; - - self.use = counter_use; -}; - -.float triggerhurttime; -/*void() hurt_touch = -{ - if (other.takedamage) - if (other.triggerhurttime < time) - { - other.triggerhurttime = time + 1; - Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0'); - } - - return; -};*/ - -/*QUAKED trigger_hurt (.5 .5 .5) ? -Any object touching this will be hurt -set dmg to damage amount -defalt dmg = 5 -*/ -/*void() trigger_hurt = -{ - InitTrigger (); - self.touch = hurt_touch; - if (!self.dmg) - self.dmg = 1000; - if (!self.message) - self.message = "was in the wrong place."; -};*/ - -//void() target_speaker_use = {sound(self, CHAN_VOICE, self.noise, 1, 1);} -//void() target_speaker = {self.use = target_speaker_use;} - -void() target_speaker = -{ -if(self.noise) { - precache_sound (self.noise); - ambientsound (self.origin, self.noise, 1, ATTN_STATIC); -} -//remove(self); -}; - - -/* -void() sparksthink = -{ - self.nextthink = time + 0.1; - - if(random() < self.wait) { - te_spark(self.origin,'0 0 -1',self.cnt); - } -} - - -void() func_sparks = -{ - self.think = sparksthink; - self.nextthink = time + 0.2; - - // self.cnt is the amount of sparks that one burst will spawn - if(self.cnt < 1) { - self.cnt = 25.0; // nice default value - } - - // self.wait is the probability that a sparkthink will spawn a spark shower - // range: 0 - 1, but 0 makes little sense, so... - if(self.wait < 0.05) { - self.wait = 0.25; // nice default value - } - - // sound - if(self.noise) { - precache_sound (self.noise); - ambientsound (self.origin, self.noise, 1, ATTN_STATIC); - } -} -*/ - - -/* -============================================================================= - -SECRET DOORS - -============================================================================= -*/ - -void() fd_secret_move1; -void() fd_secret_move2; -void() fd_secret_move3; -void() fd_secret_move4; -void() fd_secret_move5; -void() fd_secret_move6; -void() fd_secret_done; - -float SECRET_OPEN_ONCE = 1; // stays open -float SECRET_1ST_LEFT = 2; // 1st move is left of arrow -float SECRET_1ST_DOWN = 4; // 1st move is down from arrow -float SECRET_NO_SHOOT = 8; // only opened by trigger -float SECRET_YES_SHOOT = 16; // shootable even if targeted - - -void () fd_secret_use = -{ - local float temp; - - self.health = 10000; - //self.havocattack = TRUE; - - // exit if still moving around... - if (self.origin != self.oldorigin) - return; - - self.message = ""; // no more message - - SUB_UseTargets(); // fire all targets / killtargets - - self.velocity = '0 0 0'; - - // Make a sound, wait a little... - - if (self.noise1 != "") - sound(self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); - self.nextthink = self.ltime + 0.1; - - temp = 1 - (self.spawnflags & SECRET_1ST_LEFT); // 1 or -1 - makevectors(self.mangle); - - if (!self.t_width) - { - if (self.spawnflags & SECRET_1ST_DOWN) - self.t_width = fabs(v_up * self.size); - else - self.t_width = fabs(v_right * self.size); - } - - if (!self.t_length) - self.t_length = fabs(v_forward * self.size); - - if (self.spawnflags & SECRET_1ST_DOWN) - self.dest1 = self.origin - v_up * self.t_width; - else - self.dest1 = self.origin + v_right * (self.t_width * temp); - - self.dest2 = self.dest1 + v_forward * self.t_length; - SUB_CalcMove(self.dest1, self.speed, fd_secret_move1); - if (self.noise2 != "") - sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); -}; - -// Wait after first movement... -void () fd_secret_move1 = -{ - self.nextthink = self.ltime + 1.0; - self.think = fd_secret_move2; - if (self.noise3 != "") - sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); -}; - -// Start moving sideways w/sound... -void () fd_secret_move2 = -{ - if (self.noise2 != "") - sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); - SUB_CalcMove(self.dest2, self.speed, fd_secret_move3); -}; - -// Wait here until time to go back... -void () fd_secret_move3 = -{ - if (self.noise3 != "") - sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); - if (!(self.spawnflags & SECRET_OPEN_ONCE)) - { - self.nextthink = self.ltime + self.wait; - self.think = fd_secret_move4; - } -}; - -// Move backward... -void () fd_secret_move4 = -{ - if (self.noise2 != "") - sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); - SUB_CalcMove(self.dest1, self.speed, fd_secret_move5); -}; - -// Wait 1 second... -void () fd_secret_move5 = -{ - self.nextthink = self.ltime + 1.0; - self.think = fd_secret_move6; - if (self.noise3 != "") - sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); -}; - -void () fd_secret_move6 = -{ - if (self.noise2 != "") - sound(self, CHAN_VOICE, self.noise2, 1, ATTN_NORM); - SUB_CalcMove(self.oldorigin, self.speed, fd_secret_done); -}; - -void () fd_secret_done = -{ - if (!self.targetname || self.spawnflags&SECRET_YES_SHOOT) - { - self.health = 10000; - self.takedamage = DAMAGE_YES; - //self.th_pain = fd_secret_use; - } - if (self.noise3 != "") - sound(self, CHAN_VOICE, self.noise3, 1, ATTN_NORM); -}; - -void () secret_blocked = -{ - if (time < self.attack_finished) - return; - self.attack_finished = time + 0.5; - //T_Damage (other, self, self, self.dmg, self.dmg, self.deathtype, DT_IMPACT, (self.absmin + self.absmax) * 0.5, '0 0 0', Obituary_Generic); -}; - -/* -============== -secret_touch - -Prints messages -================ -*/ -void() secret_touch = -{ - if (activator.classname != "player") - return; - if (self.attack_finished > time) - return; - - self.attack_finished = time + 2; - - if (self.message) - { - if (other.flags & FL_CLIENT) - centerprint (other, self.message); - sound (other, CHAN_BODY, "misc/talk.wav", 1, ATTN_NORM); - } -}; - - -/*QUAKED func_door_secret (0 .5 .8) ? open_once 1st_left 1st_down no_shoot always_shoot -Basic secret door. Slides back, then to the side. Angle determines direction. -wait = # of seconds before coming back -1st_left = 1st move is left of arrow -1st_down = 1st move is down from arrow -always_shoot = even if targeted, keep shootable -t_width = override WIDTH to move back (or height if going down) -t_length = override LENGTH to move sideways -"dmg" damage to inflict when blocked (2 default) - -If a secret door has a targetname, it will only be opened by it's botton or trigger, not by damage. -"sounds" -1) medieval -2) metal -3) base -*/ - -void () func_door_secret = -{ - /*if (!self.deathtype) // map makers can override this - self.deathtype = " got in the way";*/ - - if (!self.dmg) - self.dmg = 2; - - // Magic formula... - self.mangle = self.angles; - self.angles = '0 0 0'; - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - self.classname = "door"; - setmodel (self, self.model); - setorigin (self, self.origin); - - self.touch = secret_touch; - self.blocked = secret_blocked; - self.speed = 50; - self.use = fd_secret_use; - if ( !self.targetname || self.spawnflags&SECRET_YES_SHOOT) - { - self.health = 10000; - self.takedamage = DAMAGE_YES; - self.event_damage = fd_secret_use; - } - self.oldorigin = self.origin; - if (!self.wait) - self.wait = 5; // 5 seconds before closing -}; - - -// TF DOORS // SHOULD MOVE THIS TO SEPERATE TF DOORS FILE -void() door_go_down; -void() door_go_up; -float() DoorShouldOpen; - -void() fd_secret_move1; -void() fd_secret_move2; -void() fd_secret_move3; -void() fd_secret_move4; -void() fd_secret_move5; -void() fd_secret_move6; -void() fd_secret_done; - - -void() door_blocked = -{ - T_Damage(other, self, self, self.dmg); - if (self.wait >= TF_FLARE_LIT) - { - if (self.state == 3) - { - door_go_up(); - } - else - { - door_go_down(); - } - } -}; - -void() door_hit_top = -{ - sound(self, 2, self.noise1, TF_FLARE_OFF, TF_FLARE_OFF); - self.state = TF_FLARE_LIT; - if (self.spawnflags & 32) - { - return; - } - self.think = door_go_down; - self.nextthink = self.ltime + self.wait; -}; - -void() door_hit_bottom = -{ - self.goal_state = 2; - sound(self, 2, self.noise1, TF_FLARE_OFF, TF_FLARE_OFF); - self.state = TF_FLARE_OFF; -}; - -void() door_go_down = -{ - sound(self, 2, self.noise2, TF_FLARE_OFF, TF_FLARE_OFF); - if (self.max_health) - { - self.takedamage = TF_FLARE_OFF; - self.health = self.max_health; - } - self.state = 3; - SUB_CalcMove(self.pos1, self.speed, door_hit_bottom); -}; - -void() door_go_up = -{ - if (self.state == 2) - { - return; - } - if (self.state == TF_FLARE_LIT) - { - self.nextthink = self.ltime + self.wait; - return; - } - sound(self, 2, self.noise2, TF_FLARE_OFF, TF_FLARE_OFF); - self.state = 2; - SUB_CalcMove(self.pos2, self.speed, door_hit_top); - SUB_UseTargets(); -}; - -void() door_fire = -{ - local entity oself; - local entity starte; - if (self.owner != self) - { - objerror("door_fire: self.owner != self"); - } - if (self.items) - { - sound(self, 2, self.noise4, TF_FLARE_OFF, TF_FLARE_OFF); - } - self.message = string_null; - oself = self; - if (self.spawnflags & 32) - { - if (self.state == 2 || self.state == TF_FLARE_LIT) - { - starte = self; - do - { - door_go_down(); - self = self.enemy; - } while (self != starte && self != world); - self = oself; - return; - } - } - starte = self; - do - { - door_go_up(); - self = self.enemy; - } while (self != starte && self != world); - self = oself; -}; - -void() door_use = -{ - if (other.classname == "info_tfgoal") // Doors by item_tfgoals in q3f maps werent working right - { //so I added this as a temp fix. - return; // Note: doors by info_tfgoals will react slower` - } - local entity oself; - self.message = ""; - self.owner.message = ""; - self.enemy.message = ""; - oself = self; - self = self.owner; - door_fire(); - self = oself; -}; - -void() door_trigger_touch = -{ - local entity te; - if (other.health <= TF_FLARE_LIT) - { - return; - } - if (!Activated(self, other)) - { - if (self.else_goal != TF_FLARE_LIT) - { - te = Findgoal(self.else_goal); - if (te) - { - DoResults(te, other, self.goal_result & 2); - } - } - return; - } - if (time < self.attack_finished) - { - return; - } - self.attack_finished = time + TF_FLARE_OFF; - activator = other; - self = self.owner; - door_use(); -}; - -void() door_killed = -{ - local entity oself; - oself = self; - self = self.owner; - self.health = self.max_health; - self.takedamage = TF_FLARE_LIT; - door_use(); - self = oself; -}; - -void() door_touch = -{ - local entity te; - if (other.classname != "player") - { - return; - } - if (self.owner.attack_finished > time) - { - return; - } - if (!Activated(self, other)) - { - if (self.else_goal != TF_FLARE_LIT) - { - te = Findgoal(self.else_goal); - if (te) - { - DoResults(te, other, self.goal_result & 2); - } - } - return; - } - self.owner.attack_finished = time + 2; - if (self.owner.message != "") - { - CenterPrint(other, self.owner.message); - sound(other, 2, "misc/talk.wav", TF_FLARE_OFF, TF_FLARE_OFF); - } - if (!(self.items)) - { - return; - } - if ((self.items & other.items) != self.items) - { - if (self.owner.items == 131072) - { - if (world.worldtype == 2) - { - CenterPrint(other, "You need the silver keycard"); - sound(self, 2, self.noise3, TF_FLARE_OFF, TF_FLARE_OFF); - } - else - { - if (world.worldtype == TF_FLARE_OFF) - { - CenterPrint(other, "You need the silver runekey"); - sound(self, 2, self.noise3, TF_FLARE_OFF, TF_FLARE_OFF); - } - else - { - if (world.worldtype == TF_FLARE_LIT) - { - CenterPrint(other, "You need the silver key"); - sound(self, 2, self.noise3, TF_FLARE_OFF, TF_FLARE_OFF); - } - } - } - } - else - { - if (world.worldtype == 2) - { - CenterPrint(other, "You need the gold keycard\n"); - sound(self, 2, self.noise3, TF_FLARE_OFF, TF_FLARE_OFF); - } - else - { - if (world.worldtype == TF_FLARE_OFF) - { - CenterPrint(other, "You need the gold runekey"); - sound(self, 2, self.noise3, TF_FLARE_OFF, TF_FLARE_OFF); - } - else - { - if (world.worldtype == TF_FLARE_LIT) - { - CenterPrint(other, "You need the gold key"); - sound(self, 2, self.noise3, TF_FLARE_OFF, TF_FLARE_OFF); - } - } - } - } - return; - } - other.items = other.items - self.items; - other.tf_items = other.tf_items | self.items; - if (DoorShouldOpen()) - { - self.touch = SUB_Null; - if (self.enemy) - { - self.enemy.touch = SUB_Null; - } - door_use(); - } -}; - -entity(vector fmins, vector fmaxs) spawn_field = -{ - local entity trigger; - local vector t1; - local vector t2; - trigger = spawn(); - trigger.movetype = TF_FLARE_LIT; - trigger.solid = TF_FLARE_OFF; - trigger.owner = self; - trigger.touch = door_trigger_touch; - trigger.team_no = self.team_no; - trigger.playerclass = self.playerclass; - trigger.items_allowed = self.items_allowed; - trigger.activate_goal_no = self.activate_goal_no; - trigger.inactivate_goal_no = self.inactivate_goal_no; - trigger.remove_goal_no = self.remove_goal_no; - trigger.restore_goal_no = self.restore_goal_no; - trigger.activate_group_no = self.activate_group_no; - trigger.inactivate_group_no = self.inactivate_group_no; - trigger.remove_group_no = self.remove_group_no; - trigger.restore_group_no = self.restore_group_no; - trigger.goal_activation = self.goal_activation; - trigger.goal_effects = self.goal_effects; - trigger.goal_result = self.goal_result; - trigger.goal_group = self.goal_group; - t1 = fmins; - t2 = fmaxs; - setsize(trigger, t1 - '60 60 8', t2 + '60 60 8'); - return trigger; -}; - -float(entity e1, entity e2) EntitiesTouching = -{ - if (e1.mins_x > e2.maxs_x) - { - return TF_FLARE_LIT; - } - if (e1.mins_y > e2.maxs_y) - { - return TF_FLARE_LIT; - } - if (e1.mins_z > e2.maxs_z) - { - return TF_FLARE_LIT; - } - if (e1.maxs_x < e2.mins_x) - { - return TF_FLARE_LIT; - } - if (e1.maxs_y < e2.mins_y) - { - return TF_FLARE_LIT; - } - if (e1.maxs_z < e2.mins_z) - { - return TF_FLARE_LIT; - } - return TF_FLARE_OFF; -}; - -void() LinkDoors = -{ - local entity t; - local entity starte; - local vector cmins; - local vector cmaxs; - if (self.enemy) - { - return; - } - if (self.spawnflags & 4) - { - self.enemy = self; - self.owner = self; - return; - } - cmins = self.mins; - cmaxs = self.maxs; - starte = self; - t = self; - do - { - self.owner = starte; - if (self.health) - { - starte.health = self.health; - } - if (self.targetname) - { - starte.targetname = self.targetname; - } - if (self.message != "") - { - starte.message = self.message; - } - t = find(t, classname, self.classname); - if (!t) - { - self.enemy = starte; - self = self.owner; - if (self.health) - { - return; - } - if (self.targetname) - { - return; - } - if (self.items) - { - return; - } - self.owner.trigger_field = spawn_field(cmins, cmaxs); - return; - } - if (EntitiesTouching(self, t)) - { - if (t.enemy) - { - objerror("cross connected doors"); - } - self.enemy = t; - self = t; - if (t.mins_x < cmins_x) - { - cmins_x = t.mins_x; - } - if (t.mins_y < cmins_y) - { - cmins_y = t.mins_y; - } - if (t.mins_z < cmins_z) - { - cmins_z = t.mins_z; - } - if (t.maxs_x > cmaxs_x) - { - cmaxs_x = t.maxs_x; - } - if (t.maxs_y > cmaxs_y) - { - cmaxs_y = t.maxs_y; - } - if (t.maxs_z > cmaxs_z) - { - cmaxs_z = t.maxs_z; - } - } - } while (TF_FLARE_OFF); -}; - -void() func_door = -{ - if (CheckExistence() == TF_FLARE_LIT) - { - dremove(self); - return; - } - - // Q3F/ETF Map Support - if (self.allowteams == "red") - { - self.team_no = 2; - } - if (self.allowteams == "blue") - { - self.team_no = 1; - } - - if (world.worldtype == TF_FLARE_LIT) - { - precache_sound("doors/medtry.wav"); - precache_sound("doors/meduse.wav"); - self.noise3 = "doors/medtry.wav"; - self.noise4 = "doors/meduse.wav"; - } - else - { - if (world.worldtype == TF_FLARE_OFF) - { - precache_sound("doors/runetry.wav"); - precache_sound("doors/runeuse.wav"); - self.noise3 = "doors/runetry.wav"; - self.noise4 = "doors/runeuse.wav"; - } - else - { - if (world.worldtype == 2) - { - precache_sound("doors/basetry.wav"); - precache_sound("doors/baseuse.wav"); - self.noise3 = "doors/basetry.wav"; - self.noise4 = "doors/baseuse.wav"; - } - else - { - dprint("no worldtype set!\n"); - } - } - } - if (self.sounds == TF_FLARE_LIT) - { - precache_sound("misc/null.wav"); - precache_sound("misc/null.wav"); - self.noise1 = "misc/null.wav"; - self.noise2 = "misc/null.wav"; - } - if (self.sounds == TF_FLARE_OFF) - { - precache_sound("doors/drclos4.wav"); - precache_sound("doors/doormv1.wav"); - self.noise1 = "doors/drclos4.wav"; - self.noise2 = "doors/doormv1.wav"; - } - if (self.sounds == 2) - { - precache_sound("doors/hydro1.wav"); - precache_sound("doors/hydro2.wav"); - self.noise2 = "doors/hydro1.wav"; - self.noise1 = "doors/hydro2.wav"; - } - if (self.sounds == 3) - { - precache_sound("doors/stndr1.wav"); - precache_sound("doors/stndr2.wav"); - self.noise2 = "doors/stndr1.wav"; - self.noise1 = "doors/stndr2.wav"; - } - if (self.sounds == 4) - { - precache_sound("doors/ddoor1.wav"); - precache_sound("doors/ddoor2.wav"); - self.noise1 = "doors/ddoor2.wav"; - self.noise2 = "doors/ddoor1.wav"; - } - if (self.armorclass == TF_FLARE_OFF) - { - precache_sound("doors/creekdr1.wav"); - precache_sound("doors/creekdr2.wav"); - self.noise2 = "doors/creekdr1.wav"; - self.noise1 = "doors/creekdr2.wav"; - } - if (self.armorclass == 2) - { - precache_sound("doors/metaldr1.wav"); - precache_sound("doors/metaldr2.wav"); - self.noise2 = "doors/metaldr1.wav"; - self.noise1 = "doors/metaldr2.wav"; - } - if (self.armorclass == 3) - { - precache_sound("doors/electdr1.wav"); - precache_sound("doors/electdr2.wav"); - self.noise2 = "doors/electdr1.wav"; - self.noise1 = "doors/electdr2.wav"; - } - if (self.armorclass == 4) - { - precache_sound("doors/track_st.wav"); - precache_sound("doors/track_e.wav"); - self.noise2 = "doors/track_st.wav"; - self.noise1 = "doors/track_e.wav"; - } - SetMovedir(); - self.max_health = self.health; - self.solid = 4; - self.movetype = 7; - setorigin(self, self.origin); - setmodel(self, self.model); - self.classname = "door"; - self.blocked = door_blocked; - self.use = door_use; - if (self.spawnflags & 16) - { - self.items = 131072; - } - if (self.spawnflags & 8) - { - self.items = 262144; - } - if (!(self.speed)) - { - self.speed = 100; - } - if (!(self.wait)) - { - self.wait = 3; - } - if (!(self.lip)) - { - self.lip = 8; - } - if (!(self.dmg)) - { - self.dmg = 2; - } - self.pos1 = self.origin; - self.pos2 = self.pos1 + self.movedir * (fabs(self.movedir * self.size) - self.lip); - if (self.spawnflags & TF_FLARE_OFF) - { - setorigin(self, self.pos2); - self.pos2 = self.pos1; - self.pos1 = self.origin; - } - self.state = TF_FLARE_OFF; - if (self.health) - { - self.takedamage = TF_FLARE_OFF; - self.th_die = door_killed; - } - if (self.items) - { - self.wait = -1; - } - self.touch = door_touch; - self.think = LinkDoors; - self.nextthink = self.ltime + 0.1; -}; - -// MOVE TO TFTRIGGERS -void() trigger_once = -{ - if (CheckExistence() == TF_FLARE_LIT) - { - dremove(self); - return; - } - self.wait = -1; - trigger_multiple(); -}; - -void() hurt_on = -{ - self.solid = TF_FLARE_OFF; - self.nextthink = -1; -}; - -void() hurt_touch = -{ - local entity te; - if (other.is_dead != 0) // added by xavior to stop killing of dead bodies - return; //// - if (other.takedamage) - { - if (!Activated(self, other)) - { - if (self.else_goal != TF_FLARE_LIT) - { - te = Findgoal(self.else_goal); - if (te) - { - DoResults(te, other, self.goal_result & 2); - } - } - return; - } - self.solid = TF_FLARE_LIT; - deathmsg = 36; - TF_T_Damage(other, self, self, self.dmg, TF_FLARE_OFF, TF_FLARE_LIT); - self.think = hurt_on; - self.nextthink = time + TF_FLARE_OFF; - } -}; - -void() trigger_hurt = -{ - if (self.allowteams == "red") // Converted to work with q3f/ETF entities - { - self.team_no = 2; - self.owned_by = 2; - } - if (self.allowteams == "blue") - { - self.owned_by = 1; - self.team_no = 1; - } - - if (CheckExistence() == TF_FLARE_LIT) - { - dremove(self); - return; - } - InitTrigger(); - self.touch = hurt_touch; - if (!(self.dmg)) - { - self.dmg = 5; - } -}; - - -// TF SUBS -void () SUB_UseTargets = -{ - local entity t; - local entity stemp; - local entity otemp; - local entity act; - - if (self.dont_do_triggerwork) - { - self.dont_do_triggerwork = 0; - return; - } - if (self.delay) - { - t = spawn (); - t.classname = "DelayedUse"; - t.nextthink = (time + self.delay); - t.think = DelayThink; - t.enemy = activator; - t.message = self.message; - t.killtarget = self.killtarget; - t.target = self.target; - return; - } - if (((activator.classname == "player") && (self.message != ""))) - { - CenterPrint (activator, self.message); - if (!self.noise) - { - sound (activator, 2, "misc/talk.wav", 1, 1); - } - } - if ((activator.classname == "player")) - { - DoGroupWork (self, activator); - DoGoalWork (self, activator); - } - if (self.killtarget) - { - t = world; - do - { - t = find (t, targetname, self.killtarget); - if (!t) - { - return; - } - remove (t); - - } while (1); - } - if (self.target) - { - act = activator; - t = world; - do - { - t = find (t, targetname, self.target); - if (!t) - { - return; - } - stemp = self; - otemp = other; - self = t; - other = stemp; - if ((self.use != SUB_Null)) - { - if (self.use) - { - self.use (); - } - } - self = stemp; - other = otemp; - activator = act; - - } while (1); - } -}; - diff --git a/TeamNexuiz/game/gamec/g_violence.c b/TeamNexuiz/game/gamec/g_violence.c deleted file mode 100644 index dfed7d5ae..000000000 --- a/TeamNexuiz/game/gamec/g_violence.c +++ /dev/null @@ -1,58 +0,0 @@ -void GibDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - float r; - r = random (); - if (r < 0.60) - sound (self, CHAN_IMPACT, "misc/gib_splat01.wav", 1, ATTN_NORM); - else if (r < 0.65) - sound (self, CHAN_IMPACT, "misc/gib_splat02.wav", 1, ATTN_NORM); - else if (r < 0.70) - sound (self, CHAN_IMPACT, "misc/gib_splat03.wav", 1, ATTN_NORM); - else if (r < 0.75) - sound (self, CHAN_IMPACT, "misc/gib_splat04.wav", 1, ATTN_NORM); - te_blood (self.origin + '0 0 1', '0 0 30', 10); - self.health = self.health - damage; - if (self.health <= -12) - { - self.event_damage = SUB_Null; - SUB_VanishOrRemove (self); - } -} - - -void GibTouch () -{ - GibDamage (other, other, 11, 0, self.origin, '0 0 0'); -} - -// changes by LordHavoc on 03/30/04 -// TossGib now takes a gib entity so it can be used for tossing heads -// gib.velocity now uses randomvec() instead of a bunch of manual random calls -// merged Gib() into PlayerGib() -entity TossGib (entity gib, string mdlname, vector org, vector v, float destroyontouch) -{ - if (gib == world) - gib = spawn (); - gib.classname = "gib"; - gib.movetype = MOVETYPE_BOUNCE; - gib.solid = SOLID_CORPSE; - gib.skin = 0; - gib.effects = 0; - - setmodel (gib, mdlname); - setsize (gib, '-8 -8 -8', '8 8 8'); - setorigin (gib, org); - - gib.health = -1; - gib.takedamage = DAMAGE_YES; - gib.damageforcescale = 3.5; - gib.event_damage = GibDamage; - if (destroyontouch == 1) - gib.touch = GibTouch; - - gib.velocity = v + randomvec() * 450; - gib.avelocity = randomvec() * 300; - - SUB_SetFade (gib, time + 12 + random () * 4, 1); - return gib; -} diff --git a/TeamNexuiz/game/gamec/g_world.c b/TeamNexuiz/game/gamec/g_world.c deleted file mode 100644 index 178f476c3..000000000 --- a/TeamNexuiz/game/gamec/g_world.c +++ /dev/null @@ -1,652 +0,0 @@ -entity lastspawn; - -void() dom_init; - -void worldspawn (void) -{ - lastspawn = world; - - // the gravity set here can be overwritten by .cfg - if(world.gravity) - { - cvar_set("sv_gravity", ftos(world.gravity)); - } - else - cvar_set("sv_gravity", "800"); - - game = cvar ("gamecfg"); // load game options - - //precache_model ("progs/beam.mdl"); - precache_model ("progs/beam.mdl"); - precache_model ("models/bullet.mdl"); - precache_model ("models/casing_bronze.mdl"); - precache_model ("models/casing_shell.mdl"); - precache_model ("models/casing_steel.mdl"); - precache_model ("models/ebomb.mdl"); - precache_model ("models/elaser.mdl"); - precache_model ("models/flash.md3"); - precache_model ("models/gibs/bloodyskull.md3"); - precache_model ("models/gibs/chunk.mdl"); - precache_model ("models/gibs/eye.md3"); - precache_model ("models/gibs/gib1.md3"); - precache_model ("models/gibs/gib2.md3"); - precache_model ("models/gibs/gib3.md3"); - precache_model ("models/gibs/gib4.md3"); - precache_model ("models/gibs/gib5.md3"); - precache_model ("models/gibs/gib6.md3"); - precache_model ("models/grenademodel.md3"); - precache_model ("models/hagarmissile.mdl"); - precache_model ("models/items/a_bullets.mdl"); - precache_model ("models/items/a_cells.md3"); - precache_model ("models/items/a_rockets.md3"); - precache_model ("models/items/a_shells.md3"); - precache_model ("models/items/g_a1.md3"); - precache_model ("models/items/g_a25.md3"); - precache_model ("models/items/g_h1.md3"); - precache_model ("models/items/g_h25.md3"); - precache_model ("models/items/g_h100.md3"); - precache_model ("models/items/g_invincible.md3"); - precache_model ("models/items/g_strength.md3"); - precache_model ("models/laser.mdl"); - precache_model ("models/misc/chatbubble.spr"); - precache_model ("models/nexflash.md3"); - precache_model ("models/plasma.mdl"); - precache_model ("models/plasmatrail.mdl"); - precache_model ("models/rocket.md3"); - precache_model ("models/sprites/grenadeexplosion.spr32"); - precache_model ("models/sprites/hagarexplosion.spr32"); - precache_model ("models/sprites/muzzleflash.spr32"); - //precache_model ("models/sprites/plasmahitwall.spr32"); - //precache_model ("models/sprites/plasmashot.spr32"); - precache_model ("models/sprites/rocketexplosion.spr32"); - precache_model ("models/tracer.mdl"); - precache_model ("models/uziflash.md3"); - precache_model ("models/weapons/g_crylink.md3"); - precache_model ("models/weapons/g_electro.md3"); - precache_model ("models/weapons/g_gl.md3"); - precache_model ("models/weapons/g_hagar.md3"); - precache_model ("models/weapons/g_nex.md3"); - precache_model ("models/weapons/g_rl.md3"); - precache_model ("models/weapons/g_shotgun.md3"); - precache_model ("models/weapons/g_uzi.md3"); - precache_model ("models/weapons/v_crylink.md3"); - precache_model ("models/weapons/v_electro.md3"); - precache_model ("models/weapons/v_gl.md3"); - precache_model ("models/weapons/v_hagar.md3"); - precache_model ("models/weapons/v_laser.md3"); - precache_model ("models/weapons/v_nex.md3"); - precache_model ("models/weapons/v_rl.md3"); - precache_model ("models/weapons/v_shotgun.md3"); - precache_model ("models/weapons/v_uzi.md3"); - precache_model ("models/weapons/w_crylink.zym"); - precache_model ("models/weapons/w_electro.zym"); - precache_model ("models/weapons/w_gl.zym"); - precache_model ("models/weapons/w_hagar.zym"); - precache_model ("models/weapons/w_laser.zym"); - precache_model ("models/weapons/w_nex.zym"); - precache_model ("models/weapons/w_rl.zym"); - precache_model ("models/weapons/w_shotgun.zym"); - precache_model ("models/weapons/w_uzi.zym"); - - - - // new weapon models - precache_model ("models/weapons/v_rli.md3"); // incendiary rockets - precache_model ("models/weapons/v_flamer.md3"); // flamer - precache_model ("models/weapons/v_bombletts.md3"); // bombletts - precache_model ("models/weapons/v_hotbombs.md3"); // hot bombs - precache_model ("models/weapons/v_grapple.md3"); // grappling hook - precache_model ("models/weapons/v_namek.md3"); // namek - - precache_model ("models/weapons/w_rli.zym"); - precache_model ("models/weapons/w_flamer.zym"); - precache_model ("models/weapons/w_bombletts.zym"); - precache_model ("models/weapons/w_hotbombs.zym"); - precache_model ("models/weapons/w_grapple.zym"); - precache_model ("models/weapons/w_namek.zym"); - - - // other stuff - precache_model ("models/weapons/namekb.mdl"); - precache_sound ("weapons/namek_fire.wav"); - - precache_model ("models/misc/shield_s.mdl"); - - precache_model ("models/misc/ropebase.mdl"); - - // on fire sprites - precache_model ("models/sprites/fire_base.spr32"); - precache_model ("models/sprites/fire_top.spr32"); - - precache_model ("models/sprites/null.spr"); - - - precache_sound ("announcer/1fragleft.wav"); - precache_sound ("announcer/1minuteremains.wav"); - precache_sound ("announcer/2fragsleft.wav"); - precache_sound ("announcer/3fragsleft.wav"); - precache_sound ("announcer/welcometonexuiz.wav"); - precache_sound ("misc/armor1.wav"); - precache_sound ("misc/armor25.wav"); - precache_sound ("misc/armorimpact.wav"); - precache_sound ("misc/bodyimpact1.wav"); - precache_sound ("misc/bodyimpact2.wav"); - precache_sound ("misc/gib.wav"); - precache_sound ("misc/gib_splat01.wav"); - precache_sound ("misc/gib_splat02.wav"); - precache_sound ("misc/gib_splat03.wav"); - precache_sound ("misc/gib_splat04.wav"); - //precache_sound ("misc/h2ohit.wav"); - precache_sound ("misc/hit.wav"); - precache_sound ("misc/hitground1.wav"); - precache_sound ("misc/hitground2.wav"); - precache_sound ("misc/hitground3.wav"); - precache_sound ("misc/hitground4.wav"); - precache_sound ("misc/itempickup.wav"); - precache_sound ("misc/itemrespawn.wav"); - precache_sound ("misc/jumppad.wav"); - precache_sound ("misc/mediumhealth.wav"); - precache_sound ("misc/megahealth.wav"); - precache_sound ("misc/minihealth.wav"); - precache_sound ("misc/powerup.wav"); - precache_sound ("misc/talk.wav"); - precache_sound ("misc/teleport.wav"); - precache_sound ("plats/medplat1.wav"); - precache_sound ("plats/medplat2.wav"); - precache_sound ("player/lava.wav"); - precache_sound ("player/slime.wav"); - precache_sound ("weapons/crylink.wav"); - precache_sound ("weapons/crylink2.wav"); - precache_sound ("weapons/electro_fire.wav"); - precache_sound ("weapons/electro_fly.wav"); - precache_sound ("weapons/electro_impact.wav"); - precache_sound ("weapons/grenade_bounce.wav"); - precache_sound ("weapons/grenade_fire.wav"); - precache_sound ("weapons/grenade_impact.wav"); - precache_sound ("weapons/hagar_fire.wav"); - precache_sound ("weapons/hagexp1.wav"); - precache_sound ("weapons/hagexp2.wav"); - precache_sound ("weapons/hagexp3.wav"); - precache_sound ("weapons/lasergun_fire.wav"); - precache_sound ("weapons/laserimpact.wav"); - precache_sound ("weapons/nexfire.wav"); - precache_sound ("weapons/neximpact.wav"); - precache_sound ("weapons/ric1.wav"); - precache_sound ("weapons/ric2.wav"); - precache_sound ("weapons/ric3.wav"); - precache_sound ("weapons/rocket_fire.wav"); - precache_sound ("weapons/rocket_fly.wav"); - precache_sound ("weapons/rocket_impact.wav"); - precache_sound ("weapons/shotgun_fire.wav"); - precache_sound ("weapons/shotgun_reload.wav"); - precache_sound ("weapons/tink1.wav"); - precache_sound ("weapons/uzi_fire.wav"); - precache_sound ("weapons/weapon_switch.wav"); - precache_sound ("weapons/weaponpickup.wav"); - precache_sound ("weapons/flamer.wav"); - // TF SOUNDS & MODELS - precache_sound ("weapons/prime.wav"); - precache_sound ("weapons/gren.wav"); - precache_sound ("weapons/bounce.wav"); -// precache_sound ("player/step1l.wav"); - precache_sound ("weapons/throw.wav"); - precache_model ("progs/hgren2.mdl"); - precache_model ("models/ammo/grenade/grenade.md3"); - precache_model ("models/grenades/fragnade.md3"); - - // plays music for the level if there is any - if (self.noise) - { - precache_sound (self.noise); - ambientsound ('0 0 0', self.noise, 1.00, ATTN_NONE); - } - - // 0 normal - lightstyle(0, "m"); - - // 1 FLICKER (first variety) - lightstyle(1, "mmnmmommommnonmmonqnmmo"); - - // 2 SLOW STRONG PULSE - lightstyle(2, "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba"); - - // 3 CANDLE (first variety) - lightstyle(3, "mmmmmaaaaammmmmaaaaaabcdefgabcdefg"); - - // 4 FAST STROBE - lightstyle(4, "mamamamamama"); - - // 5 GENTLE PULSE 1 - lightstyle(5,"jklmnopqrstuvwxyzyxwvutsrqponmlkj"); - - // 6 FLICKER (second variety) - lightstyle(6, "nmonqnmomnmomomno"); - - // 7 CANDLE (second variety) - lightstyle(7, "mmmaaaabcdefgmmmmaaaammmaamm"); - - // 8 CANDLE (third variety) - lightstyle(8, "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa"); - - // 9 SLOW STROBE (fourth variety) - lightstyle(9, "aaaaaaaazzzzzzzz"); - - // 10 FLUORESCENT FLICKER - lightstyle(10, "mmamammmmammamamaaamammma"); - - // 11 SLOW PULSE NOT FADE TO BLACK - lightstyle(11, "abcdefghijklmnopqrrqponmlkjihgfedcba"); - - // styles 32-62 are assigned by the light program for switchable lights - - // 63 testing - lightstyle(63, "a"); - - if (cvar("g_domination")) - dom_init(); -} - -/* // spawn redirect function; doesn't work! -entity spawn() -{ - entity e; - e = spawn_real(); - e.create_time = time; - return e; -}*/ - -void light (void) -{ - makestatic (self); -} - - -// reads and alters data/maplist.cfg (sliding it one line), and returns a -// strzoned string containing the next map -#define MAPLIST "maplist.cfg" -string() Nex_RotateMapList = -{ - local float lHandle; - local string lNextMap; - local string lCurrentMap; - local string lBuffer; - - lHandle = fopen( MAPLIST, FILE_READ ); - if( lHandle < 0 ) { - fclose( lHandle ); - // restart the current map if no other map is not found - return strzone( mapname ); - } - - // get the first line that will be moved to the end later - lCurrentMap = strzone( fgets( lHandle ) ); - if( !lCurrentMap ) { - fclose( lHandle ); - // restart the current map if no other map is not found - return strzone( mapname ); - } - - // now get the second line which is the map that should be loaded next - lBuffer = fgets( lHandle ); - // if there isnt a second line, nothing needs to be rotated - if( !lBuffer ) { - fclose( lHandle ); - strunzone( lCurrentMap ); - // restart the current map if no other map is not found - return strzone( mapname ); - } - - // since lBuffer holds the next map, it is assigned to nextmap - lNextMap = strzone( lBuffer ); - - // since fgets uses its own buffer we need to move lBuffer to a tempstring - // before reading the next line (or lBuffer will be lost) - lBuffer = strcat( lBuffer ); - - // read in the rest of the list - while( 1 ) { - local string lLine; - - lLine = fgets( lHandle ); - if( !lLine ) { - break; - } - - lBuffer = strcat( lBuffer, "\n", lLine ); - } - // rotate the list - lBuffer = strcat( lBuffer, "\n", lCurrentMap ); - - // dismiss lCurrentmap now - strunzone( lCurrentMap ); - - // and close the file handle - fclose( lHandle ); - - // open the maplist for output this one - lHandle = fopen( MAPLIST, FILE_WRITE ); - if( lHandle < 0 ) { - // this shouldnt happen! - // print a warning/error message - dprint( "Couldn't open ", MAPLIST, " for output!\n" ); - - strunzone( lNextMap ); - - // we return the currently running map - return strzone( mapname ); - } - - fputs( lHandle, lBuffer ); - - fclose( lHandle ); - - return lNextMap; -}; - -float gameover; -float intermission_running; -//float intermission_exittime; -float alreadychangedlevel; - - -void() GotoNextMap = -{ - local string nextmap; - //local float n, nummaps; - //local string s; - if (alreadychangedlevel) - return; - alreadychangedlevel = TRUE; - if (cvar("samelevel")) // if samelevel is set, stay on same level - changelevel (mapname); - else - { - // method 1 - - //local entity pos; - local float fh; - local string line; - - // restart current map if no cycle is found - nextmap = strzone(mapname); - fh = fopen("maplist.cfg", FILE_READ); - if (fh >= 0) - { - while (1) - { - line = fgets(fh); - if (nextmap == mapname) - { - strunzone(nextmap); - nextmap = strzone(line); - } - if (!line) - break; - if (line == mapname) - { - line = fgets(fh); - if (!line) - break; - strunzone(nextmap); - nextmap = strzone(line); - break; - } - } - fclose(fh); - } - changelevel (nextmap); - strunzone(nextmap); - - // method 2 - //nextmap = Nex_RotateMapList(); - //changelevel (nextmap); - //strunzone (nextmap); - // method 3 - /* - s = cvar_string("g_maplist"); - nummaps = tokenize(s); - // if no map list, restart current one - nextmap = mapname; - if (nummaps >= 1) - { - n = 0; - while (n < nummaps) - { - if (argv(n) == mapname) - break; - n = n + 1; - } - n = n + 1; - if (n >= nummaps) - n = 0; - nextmap = argv(n); - } - changelevel (nextmap); - */ - } -}; - - -/* -============ -IntermissionThink - -When the player presses attack or jump, change to the next level -============ -*/ -void() IntermissionThink = -{ - if (time < intermission_exittime) - return; - - if (time < intermission_exittime + 10 && !self.button0 && !self.button1 && !self.button2 && !self.button3) - return; - - GotoNextMap (); -}; - -/* -============ -FindIntermission - -Returns the entity to view from -============ -*/ -/* -entity() FindIntermission = -{ - local entity spot; - local float cyc; - -// look for info_intermission first - spot = find (world, classname, "info_intermission"); - if (spot) - { // pick a random one - cyc = random() * 4; - while (cyc > 1) - { - spot = find (spot, classname, "info_intermission"); - if (!spot) - spot = find (spot, classname, "info_intermission"); - cyc = cyc - 1; - } - return spot; - } - -// then look for the start position - spot = find (world, classname, "info_player_start"); - if (spot) - return spot; - -// testinfo_player_start is only found in regioned levels - spot = find (world, classname, "testplayerstart"); - if (spot) - return spot; - -// then look for the start position - spot = find (world, classname, "info_player_deathmatch"); - if (spot) - return spot; - - //objerror ("FindIntermission: no spot"); - return world; -}; -*/ - -/* -=============================================================================== - -RULES - -=============================================================================== -*/ - -/* -go to the next level for deathmatch -only called if a time or frag limit has expired -*/ -void() NextLevel = -{ - gameover = TRUE; - - intermission_running = 1; - -// enforce a wait time before allowing changelevel - intermission_exittime = time + 5; - - WriteByte (MSG_ALL, SVC_CDTRACK); - WriteByte (MSG_ALL, 3); - WriteByte (MSG_ALL, 3); - - //pos = FindIntermission (); - - other = find (world, classname, "player"); - while (other != world) - { - //other.nextthink = time + 0.5; - other.takedamage = DAMAGE_NO; - other.solid = SOLID_NOT; - other.movetype = MOVETYPE_NONE; - other.angles = other.v_angle; - other.angles_x = other.angles_x * -1; - /* - if (pos != world); - { - other.modelindex = 0; - other.weaponentity = world; // remove weapon model - other.view_ofs = '0 0 0'; - other.angles = other.v_angle = pos.mangle; - if (!other.angles) - { - other.angles = other.v_angle = pos.angles; - other.v_angle_x = other.v_angle_x * -1; - } - other.fixangle = TRUE; // turn this way immediately - setorigin (other, pos.origin); - } - */ - other = find (other, classname, "player"); - } - - WriteByte (MSG_ALL, SVC_INTERMISSION); -}; - -/* -============ -CheckRules_Player - -Exit deathmatch games upon conditions -============ -*/ -void() CheckRules_Player = -{ - local float fraglimit; - - if (gameover) // someone else quit the game already - return; - - fraglimit = cvar("fraglimit"); - if (fraglimit && self.frags >= fraglimit) - { - NextLevel (); - return; - } -}; - -float checkrules_oneminutewarning; -float checkrules_leaderfrags; -entity checkrules_leader; - -/* -============ -CheckRules_World - -Exit deathmatch games upon conditions -============ -*/ -void() CheckRules_World = -{ - local float timelimit; - local float fraglimit; - local float checkrules_oldleaderfrags; - local entity checkrules_oldleader; - local entity head; - - if (intermission_running) - if (time >= intermission_exittime + 60) - { - GotoNextMap(); - return; - } - - if (gameover) // someone else quit the game already - return; - - timelimit = cvar("timelimit") * 60; - fraglimit = cvar("fraglimit"); - - if (timelimit && time >= timelimit) - { - NextLevel (); - return; - } - - if (!checkrules_oneminutewarning && timelimit && time > timelimit - 60) - { - checkrules_oneminutewarning = TRUE; - sound(world, CHAN_AUTO, "announcer/1minuteremains.wav", 1, ATTN_NONE); - } - - checkrules_oldleader = checkrules_leader; - checkrules_oldleaderfrags = checkrules_leaderfrags; - checkrules_leaderfrags = 0; - checkrules_leader = world; - head = findchain(classname, "player"); - while (head) - { - if (checkrules_leaderfrags < head.frags) - { - checkrules_leaderfrags = head.frags; - checkrules_leader = head; - } - head = head.chain; - } - if (checkrules_leaderfrags <= 0) - { - checkrules_leader = world; - checkrules_leaderfrags = 0; - } - checkrules_leaderfrags = floor(checkrules_leaderfrags); - if (checkrules_leaderfrags != checkrules_oldleaderfrags) - { - if (checkrules_leaderfrags == fraglimit - 1) - sound(world, CHAN_AUTO, "announcer/1fragleft.wav", 1, ATTN_NONE); - else if (checkrules_leaderfrags == fraglimit - 2) - sound(world, CHAN_AUTO, "announcer/2fragsleft.wav", 1, ATTN_NONE); - else if (checkrules_leaderfrags == fraglimit - 3) - sound(world, CHAN_AUTO, "announcer/3fragsleft.wav", 1, ATTN_NONE); - } -// if (checkrules_leader != checkrules_oldleader)// && checkrules_leaderfrags > checkrules_oldleaderfrags) -// bprint("^1",checkrules_leader.netname, " has taken the lead with ", ftos(checkrules_leaderfrags), " frags\n"); -}; - diff --git a/TeamNexuiz/game/gamec/mauvebot.c b/TeamNexuiz/game/gamec/mauvebot.c deleted file mode 100644 index 681ae4736..000000000 --- a/TeamNexuiz/game/gamec/mauvebot.c +++ /dev/null @@ -1,860 +0,0 @@ -/* - -MauveBot v1.0 for Nexuiz - -*/ - - - -//float intermission_running; - - - -.float skill_level; - - - -.float ai_time; - -.float threat; - -.entity dodgeent; - - - -float THREAT_UNFLAGGED = 0; - -float THREAT_IGNORE = -1; - - - -float DODGE_DIST = 500; - -float SEARCH_DIST = 1000; - - - -.float search_time; - - - -float bot_number; - - - -string(float r) BotName = -{ - string gender, name, cl; - - if(random() > 0.5) - { - gender = "female"; - } - else - { - gender = "male"; - } - - if (r == 1) - { - cl = "scout"; - self.playerskin = "0"; - } - else if (r == 2) - { - cl = "spy"; - self.playerskin = "0"; - } - else if (r == 3) - { - cl = "soldier"; - self.playerskin = "0"; - } - else if (r == 4) - { - cl = "pyro"; - self.playerskin = "0"; - } - else if (r == 5) - { - cl = "medic"; - self.playerskin = "0"; - } - else - { - cl = "engineer"; - self.playerskin = "0"; - } - - name = strzone(strcat("bot", ftos(ceil(random()*99)), "_", cl)); - - self.playermodel = strzone(strcat("models/class/", cl, "_", gender, ".zym")); - - return name; -}; - - - -string () PickARandomName = - -{ - - local float y, test; - - local string h; - - local entity t; - - - - t = find(world, classname, "player"); - - while(t) - - { - - if (clienttype(self) == CLIENTTYPE_BOT) - - y = y + 1; - - t = find(t, classname, "player"); - - } - - -/* - if (y > 25) - { - self.playermodel = "models/class/soldier_female.zym"; - self.playerskin = "0"; - return "EJP_Tank"; - } -*/ - - - y = TRUE; - - while(y) - { - test = ceil(random() * 6);//25); - h = BotName(test); - t = find(world, netname, h); - if (t == world) - y = FALSE; - } - - return h; - -}; - - - -// Adds a bot to the server - -void() add_MauveBot = - -{ - - local entity oldself; - - local float flo; - - local string str; - - - - oldself = self; - - self = spawnclient(); - - if (!self) - - { - - bprint("Can not add bot, server full.\n"); - - str = ftos(bot_number); - - cvar_set("bot_number", str); - - self = oldself; - - return; - - } - - - - flo = floor(random() * 5); - - if (flo == 0) - - self.clientcolors = 0; - - else if (flo == 1) - - self.clientcolors = 3; - - else if (flo == 2) - - self.clientcolors = 4; - - else if (flo == 3) - - self.clientcolors = 12; - - else if (flo == 4) - - self.clientcolors = 13; - - self.clientcolors = self.clientcolors + self.clientcolors * 16; - - - - self.netname = PickARandomName(); - - - - ClientConnect(); - - PutClientInServer(); - - self.skill_level = cvar("skill"); - - if (self.skill_level > 10) - - self.skill_level = 10; - - if (self.skill_level < 1) - - self.skill_level = 1; - - self = oldself; - - - - bot_number = bot_number + 1; - -}; - - - -void() remove_MauveBot = - -{ - - local float flo, i; - - local entity ent; - - - - flo = floor(random() * bot_number); - - - - ent = find(world, classname, "player"); - - - - while(ent) - - { - - if (clienttype(ent) == CLIENTTYPE_BOT) - - { - - if (flo == i) - - { - - dropclient(ent); - - if (bot_number > 0) - - bot_number = bot_number - 1; - - return; - - } - - i = i + 1; - - } - - ent = find(ent, classname, "player"); - - } - -}; - - - -float (entity targ) visible = - -{ - - local vector start, end, org; - - - -// if (self.skill_level < 3) - -// if (random() > self.skill_level / 10) - -// return FALSE; - - - - org = targ.origin; - - if (org == '0 0 0') - - org = (targ.absmin + targ.absmax) * 0.5; - - - - start = self.origin + self.view_ofs; - - end = org; - - traceline (start, end, TRUE, self); - - if (!(trace_inopen && trace_inwater)) - - if (trace_fraction == 1) - - return TRUE; - - return FALSE; - -}; - - - -void(entity ent) bot_set_angle = - -{ - - local vector view; - - local float flo; - - if (ent != world) - - { - - view = ent.origin; - - if (view == '0 0 0') - - view = (ent.absmin + ent.absmax) * 0.5; - - - - if (self.skill_level < 6) - - view = view - ent.velocity * (0.5 / self.skill_level); - - - - flo = vlen(ent.origin - self.origin) / (self.skill_level * 4); - - - - view_x = view_x + (random() * flo * 2) - flo; - - view_y = view_y + (random() * flo * 2) - flo; - - view_z = view_z + (random() * flo * 2) - flo; - - - - view = view - (self.origin + self.view_ofs); - - self.v_angle = vectoangles(view); - - self.v_angle_x = self.v_angle_x * -1; - - self.angles = self.v_angle; - - self.angles_x = self.angles_x * -1; - - if (self.angles_x > 180) - - self.angles_x = self.angles_x - 360; - - if (self.angles_x != 0) - - self.angles_x = self.angles_x / 6; - - } - - else - - self.angles_x = 0;// hack! - -}; - - - -void() MauveToGoal = - -{ - - local vector vec, en, diff, dir; - - - - vec = self.origin; - - movetogoal(20); - - en = self.origin; - - self.origin = vec; - - - - diff = en - self.origin; - - if (diff == '0 0 0') - - diff = self.goalentity.origin - self.origin; - - - - if (self.search_time < time) - - { - - self.goalentity.search_time = time + 20; - - self.goalentity = world; - - return; - - } - - - - dir = normalize(diff); - - dir = dir * cvar("cl_forwardspeed");// - (self.velocity - dir * (self.velocity * dir)); - - - - makevectors(self.v_angle); - - self.movement_x = dir * v_forward; - - self.movement_y = dir * v_right; - - self.movement_z = dir * v_up; - -}; - - - -void() look_for_stuff = - -{ - - local entity item, best, best2, best3; - - local float dist, tdist, dist2, topthreat; - - - - item = findradius(self.origin, 1000); - - - - if (self.search_time < time) - - self.enemy = world; - - - - if (self.enemy.health < 0) - - self.enemy = world; - - - - if (self.enemy.deadflag) - - self.enemy = world; - - - - dist = dist2 = SEARCH_DIST; - - topthreat = 0; - - - - while(item) - - { - - if (item.flags & FL_CLIENT) - - { - - if (item != self) - - { - - if ((item.health > 0) && (!item.deadflag)) - - { - - if (visible(item)) - - { - - tdist = vlen(item.origin - self.origin); - - if (tdist < dist) - - { - - best = item; - - dist = tdist; - - } - - } - - } - - } - - } - - else if (( (item.flags & FL_ITEM) && item.model != string_null) && (item.search_time < time)) - - { - - if (visible(item)) - - { - - tdist = vlen(item.origin - self.origin); - - if (tdist < dist2) - - { - - best2 = item; - - dist2 = tdist; - - } - - } - - } - - if (item.threat == THREAT_UNFLAGGED) - - { - - if (item.classname == "missile") - - item.threat = 100; - - else if (item.classname == "laserbolt") - - item.threat = 10; - - else if (item.classname == "grenade") - - item.threat = 50; - - else if (item.classname == "plasma") - - item.threat = 60; - - else if (item.classname == "spike") - - item.threat = 30; - - else - - item.threat = THREAT_IGNORE; - - } - - if (item.threat > 0) - - { - - if ((item.owner != self) || (item.velocity == '0 0 0')) - - { - - tdist = vlen(item.origin - self.origin); - - if (tdist < DODGE_DIST) - - { - - if (item.threat / tdist > topthreat) - - { - - topthreat = item.threat / tdist; - - best3 = item; - - } - - } - - } - - } - - item = item.chain; - - } - - if ((best != self.enemy) && (best != world)) - - self.enemy = best; - - if ((best2 != self.goalentity) && (best2 != world)) - - { - - self.goalentity = best2; - - self.search_time = time + 5; - - } - - self.dodgeent = best3; - -}; - - - -void() DodgeProjectile = - -{ - - local vector vec; - - - - vec = vectoangles(self.dodgeent.origin - self.origin); - - makevectors(vec); - - - - self.goalentity = spawn(); - - - - if (self.dodgeent.velocity != '0 0 0') - - setorigin(self.goalentity, self.origin + v_right * 50); - - else - - setorigin(self.goalentity, self.origin - v_forward * 50); - - - - MauveToGoal(); - - - - remove(self.goalentity); - - self.goalentity = world; - -}; - - - -void() MauveBot_AI = - -{ - - - - if (clienttype(self) != CLIENTTYPE_BOT) - - { - - //local entity ent; - - local float flo; - - - - if (time >= 3) - - { - - flo = cvar("bot_number"); - - - - if (flo > bot_number) - - add_MauveBot(); - - else if (flo < bot_number) - - remove_MauveBot(); - - } - - else - - remove_MauveBot(); - - return; - - } - - - - self.button0 = 0; - - self.button2 = 0; - - self.button3 = 0; - - - - self.movement = '0 0 0'; - - - - if (self.deadflag == DEAD_RESPAWNABLE) - - { - - self.button0 = 1; - - return; - - } - - else if (self.deadflag) - - return; - - - - if (self.goalentity.model == string_null) - - self.goalentity = world; - - - - if (time > self.ai_time) - - { - - self.ai_time = time + (0.5 / self.skill_level) + (random() * (1 / self.skill_level)); - - - - look_for_stuff(); - - - - if (self.enemy) - - { - - bot_set_angle(self.enemy); - - if (visible(self.enemy)) - - { - - self.button0 = 1; - - self.search_time = 100000; - - } - - else if (self.search_time == 100000) - - self.search_time = time + 5; - - if (self.goalentity == world) - - { - - if (self.enemy) - - { - - self.goalentity = self.enemy; - - if (vlen(self.enemy.origin - self.origin) < 300) - - self.dodgeent = self.enemy; - - } - - } - - } - - else if (self.goalentity) - - bot_set_angle(self.goalentity); - - - - if (random() < 0.03) - - self.button2 = 1; - - } - - else - - { - - if (self.skill_level > 3) - - { - - if (visible(self.enemy)) - - { - - self.button0 = 1; - - self.search_time = 100000; - - } - - } - - } - - - - if (self.dodgeent != world) - - DodgeProjectile(); - - else if (self.goalentity != world) - - MauveToGoal(); - -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/medic.c b/TeamNexuiz/game/gamec/medic.c deleted file mode 100644 index 7b788ed98..000000000 --- a/TeamNexuiz/game/gamec/medic.c +++ /dev/null @@ -1,124 +0,0 @@ -void MedicSpecial() -{ - sprint(self, "Not done yet\n"); -} - -void MedicGrenade(float req) -{ - float atk_delay; - atk_delay = cvar("g_balance_class_medic_grenade_delayattack"); - if(req == WR_GRENADE1) - { - if(W_ThrowGrenade(W_PoisonGrenade)) - { - self.grenade_time = time + cvar("g_balance_grenade_poison_refire"); - // special: medic can't shoot for a while - if(self.attack_finished < time + atk_delay) - self.attack_finished = time + atk_delay; - } - } - else if(req == WR_GRENADE2) - { - if(W_ThrowGrenade(W_ArmorGrenade)) - { - self.grenade_time = time + cvar("g_balance_grenade_armor_refire"); - // special: medic can't shoot for a while - if(self.attack_finished < time + atk_delay) - self.attack_finished = time + atk_delay; - } - } -} - -void player_clearpoison(entity targ); - -void MedicPreThink() -{ - entity head; - float maxhpratio, healamt, armoramt, reducestatus, didheal; - - if(self.special_time > time) - return; - self.special_time = time + cvar("g_balance_medic_heal_pingrate"); - - maxhpratio = cvar("g_balance_medic_heal_max"); - healamt = cvar("g_balance_medic_heal_pingheal"); - armoramt = cvar("g_balance_medic_heal_pingarmor"); - reducestatus = cvar("g_balance_medic_heal_reducestatus"); - - head = findradius(self.origin, cvar("g_balance_medic_heal_radius")); - while(head) - { - if(head.team == self.team && head.class != CLASS_MEDIC)// && head != self) - { - if(head.classname == "player") - { - didheal = 0; - if(head.health < head.max_health * maxhpratio) - { - //bprint(strcat("heal hp ", ftos(head.health))); - //bprint(strcat(" ", ftos(head.health + healamt))); - //bprint(strcat(" ", ftos(head.max_health * maxhpratio), "\n")); - head.health = bound(head.health, - head.health + healamt, - head.max_health * maxhpratio); - //head.health = head.health + healamt; - //if(head.health > head.max_health * maxhpratio) - // head.health = head.max_health * maxhpratio; - DelayHealthRot(head); - didheal = 1; - } - if(head.armorvalue < head.max_armor * maxhpratio) - { - //bprint("heal ar\n"); - head.armorvalue = bound(head.armorvalue, - head.armorvalue + armoramt, - head.max_armor * maxhpratio); - DelayArmorRot(head); - didheal = 1; - } - if(head.poison_damage) - { - //bprint("heal poison\n"); - player_clearpoison(head); - didheal = 1; - } - if(head.onfire) - { - //bprint("heal fire\n"); - head.onfire.wait = time + (head.onfire.wait - time)*reducestatus; - didheal = 1; - } - if(didheal) - { - // visual effect - te_teleport(head.origin); - } - } - } - head = head.chain; - } -} - -void MedicPostThink() -{ -} - -void BecomeMedic(float portion) -{ - self.max_health = cvar("g_balance_class_medic_health") * portion; - - self.max_armor = cvar("g_balance_class_medic_armor") * portion; - - self.mass = cvar("g_balance_class_medic_mass"); - - SetPlayerSpeed(self); - - self.items = IT_WEP1 | IT_WEP2 | IT_WEP3 | IT_WEP4; - self.switchweapon = WEP2; - self.ammo_shells = floor(20 * portion); - self.ammo_nails = floor(50 * portion); - self.ammo_rockets = floor(0 * portion); - self.ammo_cells = floor(0 * portion); - self.playerclass = 5; // TF P.C. - SetMaxAmmoFor (16); -} diff --git a/TeamNexuiz/game/gamec/pyro.c b/TeamNexuiz/game/gamec/pyro.c deleted file mode 100644 index f24e1651a..000000000 --- a/TeamNexuiz/game/gamec/pyro.c +++ /dev/null @@ -1,179 +0,0 @@ - - -void W_NapalmGlob_Think (void) -{ - if(self.wait < time) - { - remove(self); - return; - } - self.nextthink = time + cvar("g_balance_napalm_glob_damagerate"); - - RadiusDamage (self, self.owner, cvar("g_balance_napalm_glob_damage"), cvar("g_balance_napalm_glob_edgedamage"), cvar("g_balance_napalm_glob_radius"), world, cvar("g_balance_napalm_glob_force"), WEP_PYRO_SPECIAL); -} - -void W_NapalmGlob_Touch (void) -{ - if(self.count) - return; - - self.movetype = MOVETYPE_NONE; - - self.count = 1; -} - -void W_NapalmSpitGlob(vector org, vector vel) -{ - entity gren; - - gren = spawn (); - gren.owner = self.owner; - gren.classname = "napalm"; - gren.movetype = MOVETYPE_TOSS; - gren.solid = SOLID_BBOX; - setmodel(gren, "models/plasma.mdl"); - setsize(gren, '0 0 0', '0 0 0'); - setorigin(gren, org); - - gren.nextthink = time + 0.1; - gren.think = W_NapalmGlob_Think; - gren.touch = W_NapalmGlob_Touch; - gren.wait = time + cvar("g_balance_napalm_glob_duration"); - gren.gravity = cvar("g_balance_napalm_glob_gravity"); - gren.velocity = vel; - gren.avelocity = '100 150 100'; - gren.count = 0; - - gren.angles = vectoangles (gren.velocity); - - gren.scale = 5; - gren.colormod = '5 0 0'; - //gren.glow_size = cvar("g_balance_napalm_glob_radius"); // glow at damage radius - //gren.glow_color = 236;//250; // red -} - -void W_Napalm_Explode (void) -{ - vector org2, vel, vel2, vels, ang; - float num, angsize; - - setsize(self, '0 0 0', '0 0 0'); - - org2 = findbetterlocation (self.origin); - //te_explosion (org2); - //effect (org2, "models/sprites/grenadeexplosion.spr32", 0, 20, 30); - sound (self, CHAN_BODY, "misc/gib.wav", 1, ATTN_NORM); - -// RadiusDamage (self, self.owner, cvar("g_balance_napalm_damage"), cvar("g_balance_napalm_edgedamage"), cvar("g_balance_napalm_radius"), world, cvar("g_balance_napalm_force"), WEP_PYRO_SPECIAL); - - traceline(org2, org2 - '0 0 30', TRUE, self); - if(trace_fraction < 1) - vels = '0 0 1'; - else - vels = '0 0 -1'; - - num = cvar("g_balance_napalm_numglobs"); - angsize = 360 / (num - 1); - ang_y = self.angles_y; - while(num > 0) - { - if(num == 1) - { - vel = '0 0 0'; - } - else - { - ang_y = ang_y + angsize; - makevectors(ang); - vel_x = v_forward_x; - vel_y = v_forward_y; - //vel_x = vels_x + crandom()*0.8; - //vel_y = vels_y + crandom()*0.8; - } - vel2_z = vels_z + crandom()*0.8; - vel = normalize(vel); - vel2 = normalize(vel2); - W_NapalmSpitGlob(org2, vel*cvar("g_balance_napalm_glob_speedh") + vel2*cvar("g_balance_napalm_glob_speedv")); - num = num - 1; - } - - remove (self); -} - -void PyroSpecial() -{ - if(self.special_time > time) - return; - self.special_time = time + cvar("g_balance_napalm_firerate"); - - local entity gren; - local vector org; - - sound (self, CHAN_WEAPON, "weapons/grenade_fire.wav", 1, ATTN_NORM); - self.punchangle_x = -4; - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -12; - - gren = spawn (); - gren.owner = self; - gren.classname = "grenade"; - gren.movetype = MOVETYPE_BOUNCE; - gren.solid = SOLID_BBOX; - setmodel(gren, "models/plasma.mdl"); - setsize(gren, '-6 -6 -3', '6 6 3'); - setorigin(gren, org); - - gren.nextthink = time + 5; - gren.think = W_Napalm_Explode; - gren.touch = W_Napalm_Explode; - gren.velocity = v_forward * cvar("g_balance_napalm_speed") - + v_up * cvar("g_balance_napalm_speed_up"); - gren.avelocity = '100 150 100'; - - gren.angles = vectoangles (gren.velocity); - - gren.scale = 8; - gren.colormod = '5 0 0'; -} - - -void PyroGrenade(float req) -{ - if(req == WR_GRENADE1) - { - if(W_ThrowGrenade(W_ConcussionGrenade)) - self.grenade_time = time + cvar("g_balance_grenade_concussion_refire"); - } - else if(req == WR_GRENADE2) - { - if(W_ThrowGrenade(W_Firebomb)) - self.grenade_time = time + cvar("g_balance_grenade_firebomb_refire"); - } -} - -void PyroPreThink() -{ -} - -void PyroPostThink() -{ -} - -void BecomePyro(float portion) -{ - self.max_health = cvar("g_balance_class_pyro_health") * portion; - - self.max_armor = cvar("g_balance_class_pyro_armor") * portion; - - self.mass = cvar("g_balance_class_pyro_mass"); - - SetPlayerSpeed(self); - - self.items = IT_WEP1 | IT_WEP2 | IT_WEP3 | IT_WEP4; - self.switchweapon = WEP2;//w_getbestweapon(self); - self.ammo_shells = floor(20 * portion); - self.ammo_nails = floor(150 * portion); - self.ammo_rockets = floor(14 * portion); - self.ammo_cells = floor(6 * portion); - self.playerclass = 7; // TF P.C. - SetMaxAmmoFor (8); -} diff --git a/TeamNexuiz/game/gamec/scout.c b/TeamNexuiz/game/gamec/scout.c deleted file mode 100644 index 5f23d2908..000000000 --- a/TeamNexuiz/game/gamec/scout.c +++ /dev/null @@ -1,157 +0,0 @@ -void SpecialShieldThink() -{ - if(!self.owner.special_active || self.owner.health <= 0) - { - remove(self.enemy); - remove(self); - return; - } - self.nextthink = time; - - // let tag attachment handle this - //setorigin(self, 0.5*(self.owner.absmin + self.owner.absmax)); - //self.velocity = self.owner.velocity; - - self.alpha = 0.3 + 0.3*((self.owner.special_time - time) / cvar("g_balance_shield_duration")); - if(self.alpha < 0.05) - self.alpha = 0.05; - - self.enemy.alpha = self.alpha; - self.enemy.effects = self.effects; -}; - -void ActivateSpecialShield(float emergency_shield) -{ - vector org; - entity e; - if(self.special_time > time) - { - return; // currently active or recharging - } - - sprint(self, "<==Shield activated!==>\n"); - - self.special_active = 1; - if(emergency_shield) - self.special_time = time + cvar("g_balance_shield_emergency_duration"); - else - self.special_time = time + cvar("g_balance_shield_duration"); - - e = spawn(); - e.owner = self; - e.think = SpecialShieldThink; - e.nextthink = time; - e.alpha = 1; - - e.colormod_x = 255; - e.colormod_y = 0; - e.colormod_z = 128; - e.colormod = e.colormod * (1/255) * 1.2; - - e.effects = EF_ADDITIVE; - - e.movetype = MOVETYPE_NONE; - e.solid = SOLID_NOT; - - org = 0.5*(self.absmin + self.absmax) - self.origin; - - setmodel(e, "models/misc/shield_s.mdl"); - setorigin(e, org + '0 0 16');//0.5*(self.absmin + self.absmax)); - - setattachment(e, self, ""); - - e.enemy = spawn(); - e.enemy.owner = e; - e.enemy.alpha = 1; - e.enemy.colormod = e.colormod; - setmodel(e.enemy, e.model); - - // use viewmodelforclient, since setattachment makes it invisible to the player - e.enemy.viewmodelforclient = self; - setorigin(e.enemy, e.origin);//'0 0 0');//0.5*(self.absmin + self.absmax)); - - //setattachment(e.enemy, e, ""); - //setorigin(e.enemy, e.origin);//0.5*(self.absmin + self.absmax)); -} - -float SpecialShieldProtect(float damage) -{ - // check for emergency activate - if(!self.special_active && self.special_time < time) // shield is off but ready - { - if(damage > self.health - 5) // this attack will be lethal or dang-well close - ActivateSpecialShield(TRUE); // emergency activate for less time, but save me - } - - if(!self.special_active || self.special_time < time) // shield is off - return damage; // don't alter damage - - - damage = damage - damage * (cvar("g_balance_shield_protection") / 100); - if(damage < 0) - damage = 0; - return damage; -} - -void ScoutSpecial() -{ - ActivateSpecialShield(FALSE); -} - -void ScoutGrenade(float req) -{ - if(req == WR_GRENADE1) - { - if(W_ThrowGrenade(W_ConcussionGrenade)) - self.grenade_time = time + cvar("g_balance_grenade_concussion_refire"); - } - else if(req == WR_GRENADE2) - { - - self.grenade_time = time + 2; - } -} - - -void ScoutPreThink() -{ - if(self.special_time != 0 && self.special_time < time) - { - // the timer has run out - - // shield was active, go into recharge mode - if(self.special_active) - { - self.special_active = 0; - self.special_time = time + cvar("g_balance_shield_recharge_time"); - } - else - { - self.special_time = 0; // finished recharging; ready to activate again - } - } -} - -void ScoutPostThink() -{ -} - -void BecomeScout(float portion) -{ - self.max_health = cvar("g_balance_class_scout_health") * portion; - - self.max_armor = cvar("g_balance_class_scout_armor") * portion; - - self.mass = cvar("g_balance_class_scout_mass"); - - SetPlayerSpeed(self); - - self.items = IT_WEP1 | IT_WEP2 | IT_WEP3 | IT_WEP4; - self.switchweapon = WEP2; - self.ammo_shells = floor(20 * portion); - self.ammo_nails = floor(150 * portion); - self.ammo_rockets = floor(0 * portion); - self.ammo_cells = floor(0 * portion); - self.playerclass = 1; // TF P.C. - SetMaxAmmoFor (1); -} diff --git a/TeamNexuiz/game/gamec/soldier.c b/TeamNexuiz/game/gamec/soldier.c deleted file mode 100644 index 70a397954..000000000 --- a/TeamNexuiz/game/gamec/soldier.c +++ /dev/null @@ -1,221 +0,0 @@ -void W_RicochetRocket_Explode (); - -void W_RicochetRocket_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - self.health = self.health - damage; - if (self.health <= 0) - { - other = self; - W_RicochetRocket_Explode(); - } -} - -entity W_Launch_RicochetRocket (vector org, vector vel, float rocket_grav, float num, float totalbounces) -{ - local entity gren; - - gren = spawn (); - gren.classname = "rocket"; - gren.solid = SOLID_BBOX; - gren.movetype = MOVETYPE_BOUNCEMISSILE; - gren.gravity = rocket_grav;//0.01; - setmodel(gren, "models/rocket.md3"); - if(self.classname == "player") - { - gren.owner = self; - setsize(gren, '-6 -6 -3', '6 6 3'); - } - else - { - gren.owner = self.owner; - setsize(gren, '0 0 0', '0 0 0'); - } - setorigin(gren, org); - - gren.cnt = num; // what # this one is - gren.count = totalbounces; // how many missiles this missile splits into - - gren.nextthink = time + 10; - gren.think = W_RicochetRocket_Explode; - gren.touch = W_RicochetRocket_Explode; - gren.velocity = vel; - gren.angles = vectoangles (gren.velocity); - - gren.colormod = 2 * '1 1 0'; - - return gren; -} - -// bounce off the wall, then become volatile -void W_RicochetRocket_NullTouch () -{ - self.delay = self.delay - 1; - if(self.delay <= 0) - self.touch = SUB_Null; - - //self.touch = W_RicochetRocket_Explode; - //self.think = self.touch; - //self.nextthink = time + 10; - //self.angles = vectoangles(self.velocity); -} - -void W_RicochetRocket_Update () -{ - self.angles = vectoangles(self.velocity); - if(self.wait < time && self.delay <= 0) - { - self.touch = W_RicochetRocket_Explode; - self.think = W_RicochetRocket_Explode; - self.nextthink = time + 10; - } - else - { - self.think = W_RicochetRocket_Update; - self.nextthink = time + 0.1; - } -} - -void W_RicochetRocket_Explode () -{ - vector org2, vel, dir; - float num, spread, bouncecount; - string rocketid; - entity e; - - if(other != self && other.classname == self.classname) - { - self.angles = vectoangles(self.velocity); - return; // don't touch other ricochet rockets - } - - if(self.cnt <= 1) - { - rocketid = ""; - } - else - rocketid = ftos(self.cnt); - - spread = cvar(strcat("g_balance_ricochet_spread",rocketid)); - - org2 = findbetterlocation (self.origin); - te_explosion (org2); - effect (org2, "models/sprites/rocketexplosion.spr32", 0, 20, 40); - sound (self, CHAN_BODY, "weapons/rocket_impact.wav", 1, ATTN_NORM); - - self.event_damage = SUB_Null; - RadiusDamage (self, self.owner, cvar(strcat("g_balance_ricochet_damage",rocketid)), cvar(strcat("g_balance_ricochet_edgedamage",rocketid)), cvar(strcat("g_balance_ricochet_radius",rocketid)), world, cvar(strcat("g_balance_ricochet_force",rocketid)), WEP_SOLDIER_SPECIAL); - - bouncecount = cvar("g_balance_ricochet_bouncecount"); - - if(self.cnt >= bouncecount) - { - // don't spawn more rockets - remove(self); - return; - } - - self.solid = SOLID_NOT; - - self.cnt = self.cnt + 1; - - if(self.cnt <= 1) - { - rocketid = ""; - } - else - rocketid = ftos(self.cnt); - - //bprint("Rocket", ftos(self.cnt-1)); - //bprint(" splits ", ftos(self.count), "times\n"); - - num = self.count; - dir = normalize(self.velocity); - while(num) - { - vel_x = dir_x + crandom()*spread; - vel_y = dir_y + crandom()*spread; - vel_z = dir_z + crandom()*spread; - vel = normalize(vel) * cvar(strcat("g_balance_ricochet_speed",rocketid)); - e = W_Launch_RicochetRocket(org2, vel, - cvar(strcat("g_balance_ricochet_gravity",rocketid)), - self.cnt, cvar(strcat("g_balance_ricochet_splitcount",rocketid)) ); - //if(other != self) // touched something else, not detonated by damage - { - // going to hit the same thing that detonated this rocket; - // avoid that by bouncing off before setting an explosion touch - e.touch = W_RicochetRocket_NullTouch; - e.delay = cvar("g_balance_ricochet_nulltouches"); - e.wait = time + cvar("g_balance_ricochet_nulltime"); - e.think = W_RicochetRocket_Update; - e.nextthink = time + 0.1;//4; - } - e.scale = 0.3 + 0.4*(1 - (self.cnt / bouncecount)); - num = num - 1; - } - - remove (self); -} - -void SoldierSpecial() -{ - entity e; - if(self.special_time > time) - return; - self.special_time = time + cvar("g_balance_ricochet_firerate"); - - local vector org; - - sound (self, CHAN_WEAPON, "weapons/rocket_fire.wav", 1, ATTN_NORM); - self.punchangle_x = -4; - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -12; - e = W_Launch_RicochetRocket(org, v_forward * cvar("g_balance_ricochet_speed"), cvar("g_balance_ricochet_gravity"), 1, cvar("g_balance_ricochet_splitcount")); - // first rocket takes damage, others don't - e.takedamage = DAMAGE_YES; - e.damageforcescale = 4; - e.health = 30; - e.event_damage = W_RicochetRocket_Damage; -} - - - -void SoldierGrenade(float req) -{ - if(req == WR_GRENADE1) - { - if(W_ThrowGrenade(W_MirvGrenade)) - self.grenade_time = time + cvar("g_balance_grenade_mirv_refire"); - } - else if(req == WR_GRENADE2) - { - if(W_ThrowGrenade(W_FragGrenade)) - self.grenade_time = time + cvar("g_balance_grenade_frag_refire"); - } -} - -void SoldierPreThink() -{ -} - -void SoldierPostThink() -{ -} - -void BecomeSoldier(float portion) -{ - self.max_health = cvar("g_balance_class_soldier_health") * portion; - - self.max_armor = cvar("g_balance_class_soldier_armor") * portion; - - self.mass = cvar("g_balance_class_soldier_mass"); - - SetPlayerSpeed(self); - - self.items = IT_WEP1 | IT_WEP2 | IT_WEP3 | IT_WEP4; - self.switchweapon = WEP3; - self.ammo_shells = floor(20 * portion); - self.ammo_nails = floor(150 * portion); - self.ammo_rockets = floor(12 * portion); - self.ammo_cells = floor(0 * portion); - self.playerclass = 3; // TF P.C. - SetMaxAmmoFor (CLASS_SOLDIER); -} diff --git a/TeamNexuiz/game/gamec/spy.c b/TeamNexuiz/game/gamec/spy.c deleted file mode 100644 index ceab4c3df..000000000 --- a/TeamNexuiz/game/gamec/spy.c +++ /dev/null @@ -1,218 +0,0 @@ - -void SpyDecloak() -{ - if(!self.special_active) - return; - self.special_active = 0; - ResetPlayerModel(self); - if(self.health < 2) - self.alpha = 0; - else - self.alpha = 0.1; -} - -void SpyCloak() -{ - if(self.health <= cvar("g_balance_spy_cloak_min_health")) - { - sprint(self, "not healthy enough\n"); - return; - } - - self.health = self.health - cvar("g_balance_spy_cloak_cost_start"); - - self.alpha = 1; - - self.special_active = 1; - self.special_time = time; -} - -void SpySpecial() -{ - if(self.special_active) - { - SpyDecloak(); - return; - } - SpyCloak(); -} - -void SpyGrenade(float req) -{ - SpyDecloak(); - if(req == WR_GRENADE1) - { - if( W_ThrowGrenade(W_NailGrenade) ) - self.grenade_time = time + cvar("g_balance_grenade_nail_refire"); - } - else if(req == WR_GRENADE2) - { - } -} - -void SpyCloakFlicker(entity pl) -{ - if(pl.class != CLASS_SPY) - return; - if(!pl.special_active) - return; - - pl.alpha = bound(0.001, pl.alpha + 0.3 + random()*0.2, 1); -} - -void SpyPreThink() -{ - local vector m1, m2; - local float desired_alpha, spd, min_health; - - if(self.special_active) // am I cloaked? - { - min_health = cvar("g_balance_spy_cloak_min_health"); - if(self.health < min_health || self.onfire != world || self.poison_damage) - {// out of health - SpyDecloak(); - return; - } - - spd = vlen(self.velocity); - spd = spd - self.speed*1.15; // spy can stay cloaked up to his max speed (plus some extra to keep from flickering on slopes), but any faster and he starts to show... - if(spd <= 0) - desired_alpha = 0; - else - { - desired_alpha = bound(0, - cvar("g_balance_spy_move_alpha")*spd / self.speed, - cvar("g_balance_spy_move_alpha_max")); - } - - - // adjust alpha to reflect new value - if(self.alpha < desired_alpha) - self.alpha = bound(0.001, self.alpha + 0.1, 1); - else if(self.alpha > desired_alpha) - self.alpha = bound(0.001, self.alpha - 0.1, 1); - - // take health/armor cost - self.health = bound(min_health, - self.health - cvar("g_balance_spy_cloak_cost_upkeeph") * frametime, - self.health); - // take health/armor cost - self.armorvalue = bound(0, - self.armorvalue - cvar("g_balance_spy_cloak_cost_upkeepa") * frametime, - self.armorvalue); - - if(self.health <= min_health) - {// out of health - SpyDecloak(); - return; - } - - - self.special_time = time + 0.1; - - // if I'm fully cloaked, set my model to nothing - if(self.alpha < 0.01 && self.model != "") - { - m1 = self.mins; - m2 = self.maxs; - setmodel (self, ""); - setsize (self, m1, m2); - } - else if(self.alpha > 0.01 && self.model == "") - { - ResetPlayerModel(self); - } - - self.alpha = bound(0.001, self.alpha, 1.0); - - // also cloak weapons - self.weaponentity.alpha = 1 - 0.5*(1 - self.alpha);//self.alpha + 0.1; - self.exteriorweaponentity.alpha = self.alpha; //self.weaponentity.alpha; - } - else - {// decloaked - if(self.alpha != 0)// && self.alpha != 1) - {// not fully visible yet, keep phasing back in - self.alpha = self.alpha + 0.1; - self.weaponentity.alpha = 1 - (1 - self.alpha)*0.5; - if(self.alpha > 1) - self.alpha = self.weaponentity.alpha = 0; - } - //else - // self.weaponentity.alpha = 0; - } - - - - /* if(self.special_active) // am I cloaked? - { - if(self.health < 10) - {// out of health - SpyDecloak(); - } - else if(self.model != "" && self.special_time <= time) - {// not fully cloaked yet, but working on it - self.alpha = self.alpha - 0.1; - self.weaponentity.alpha = 1 - (1 - self.alpha)*0.5;//self.alpha + 0.1; - self.special_time = time + 0.1; - if(self.alpha < 0.1) - { - m1 = self.mins; - m2 = self.maxs; - setmodel (self, ""); - setsize (self, m1, m2); - self.special_time = time + 1; - } - } - else if(self.special_time <= time) - {// fully cloaked, take health cost - self.alpha = self.weaponentity.alpha = 0.25; - self.special_time = time + 1; - - // reduce health & armor while cloaked - self.health = self.health - 2;//3; - if(self.armorvalue > 2)//3) - self.armorvalue = self.armorvalue - 2;//3; - } - } - else - {// decloaked - if(self.alpha != 0 && self.alpha != 1) - {// not fully visible yet, keep phasing back in - self.alpha = self.alpha + 0.1; - self.weaponentity.alpha = 1 - (1 - self.alpha)*0.5; - if(self.alpha > 1) - self.alpha = 0; - } - else - self.weaponentity.alpha = 0; - } - - self.exteriorweaponentity.alpha = self.weaponentity.alpha;*/ -} - -void SpyPostThink() -{ -} - -void BecomeSpy(float portion) -{ - self.max_health = cvar("g_balance_class_spy_health") * portion; - - self.max_armor = cvar("g_balance_class_spy_armor") * portion; - - self.mass = cvar("g_balance_class_spy_mass"); - - SetPlayerSpeed(self); - - self.items = IT_WEP1 | IT_WEP2 | IT_WEP3 | IT_WEP4; - self.switchweapon = WEP2; - self.ammo_shells = floor(20 * portion); - self.ammo_nails = floor(50 * portion); - self.ammo_rockets = floor(3 * portion); - self.ammo_cells = floor(0 * portion); - self.playerclass = 8; // TF P.C. - SetMaxAmmoFor (2); - // fixme: also have off-hand grenade, different for each class - // where to do that? -} diff --git a/TeamNexuiz/game/gamec/sv_main.c b/TeamNexuiz/game/gamec/sv_main.c deleted file mode 100644 index c223e4c6f..000000000 --- a/TeamNexuiz/game/gamec/sv_main.c +++ /dev/null @@ -1,18 +0,0 @@ -/* -============= -StartFrame - -Called before each frame by the server -============= -*/ -void StartFrame (void) -{ - sv_maxairspeed = cvar("sv_maxairspeed"); - sv_maxspeed = cvar ("sv_maxspeed"); - sv_friction = cvar ("sv_friction"); - sv_accelerate = cvar ("sv_accelerate"); - sv_stopspeed = cvar ("sv_stopspeed"); - teamplay = cvar ("teamplay"); - - CheckRules_World (); -} \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/sv_stats.c b/TeamNexuiz/game/gamec/sv_stats.c deleted file mode 100644 index 1c5fe45da..000000000 --- a/TeamNexuiz/game/gamec/sv_stats.c +++ /dev/null @@ -1,5 +0,0 @@ - -// Accuracy -//.float shots; -//.float hits; - diff --git a/TeamNexuiz/game/gamec/sys.h b/TeamNexuiz/game/gamec/sys.h deleted file mode 100644 index a5c2903ac..000000000 --- a/TeamNexuiz/game/gamec/sys.h +++ /dev/null @@ -1,145 +0,0 @@ - -// DO NOT modify the contents of this file, or you will risk incompatibility with the game engine. - -entity self; -entity other; -entity world; - -float time; -float frametime; -float force_retouch; -string mapname; -float deathmatch; -float coop; -float teamplay; -float serverflags; -float total_secrets; -float total_monsters; -float found_secrets; -float killed_monsters; -float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16; -vector v_forward, v_up, v_right; -float trace_allsolid; -float trace_startsolid; -float trace_fraction; -vector trace_endpos; -vector trace_plane_normal; -float trace_plane_dist; -entity trace_ent; -float trace_inopen; -float trace_inwater; - -entity msg_entity; - -void main (void); -void StartFrame (void); -void PlayerPreThink (void); -void PlayerPostThink (void); -void ClientKill (void); -void ClientConnect (void); -void PutClientInServer (void); -void ClientDisconnect (void); -void SetNewParms (void); -void SetChangeParms (void); - -///////////////////////////////////////////////////////// -void end_sys_globals; -///////////////////////////////////////////////////////// - -.float modelindex; - -.vector absmin, absmax; - -.float ltime; -.float movetype; -.float solid; - -.vector origin; -.vector oldorigin; -.vector velocity; -.vector angles; -.vector avelocity; -.vector punchangle; - -.string classname; -.string model; - -.float frame; -.float skin; -.float effects; - -.vector mins, maxs; -.vector size; - -.void() touch; -.void() use; -.void() think; -.void() blocked; - -.float nextthink; - -.entity groundentity; - -.float health; -.float frags; - -.float weapon; -.string weaponmodel; -.float weaponframe; - -.float currentammo; -.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells; -.float items; - -.float takedamage; - -.entity chain; - -.float deadflag; - -.vector view_ofs; - -.float button0; -.float button1; -.float button2; -.float impulse; -.float fixangle; -.vector v_angle; -.float idealpitch; - -.string netname; -.entity enemy; - -.float flags; -.float colormap; -.float team; -.float max_health; -.float teleport_time; -.float armortype; -.float armorvalue; -.float waterlevel; -.float watertype; -.float ideal_yaw; -.float yaw_speed; - -.entity aiment; -.entity goalentity; - -.float spawnflags; - -.string target; -.string targetname; - -.float dmg_take; -.float dmg_save; -.entity dmg_inflictor; - -.entity owner; -.vector movedir; -.string message; -.float sounds; -.string noise, noise1, noise2, noise3; - -///////////////////////////////////////////////////////// -void end_sys_fields; -///////////////////////////////////////////////////////// diff --git a/TeamNexuiz/game/gamec/t_fort.c b/TeamNexuiz/game/gamec/t_fort.c deleted file mode 100644 index c4d74c0a2..000000000 --- a/TeamNexuiz/game/gamec/t_fort.c +++ /dev/null @@ -1,195 +0,0 @@ -//*********************** -//NEX FORT ENTITIES -//*********************** - -float LGATE_START_OFF = 1; -float LGATE_TOGGLE = 2; -float LGATE_ADDITIVE_BLEND = 4; -float LGATE_INSTANT_KILL = 8; // fixme: not done yet -float LGATE_FULLBRIGHT = 16; - -//float STATE_ACTIVE; -//float STATE_INACTIVE; - -void PlayerLasergatePreThink () -{ - // player is starting his movement code. - // set owner of all friendly lasergates to player so he can pass through them. - - entity e; - e=world; - do - { - e = find(e, classname, "func_lasergate"); - if(e) - { - if(e.team_no && e.team_no == self.team_no) - { - //bprint("found a lasergate\n"); - e.owner = self; - } - } - }while(e); -} - -void PlayerLasergatePostThink () -{ - // player is starting his movement code. - // set owner of all friendly lasergates to player so he can pass through them. - - entity e; - e=world; - do - { - e = find(e, classname, "func_lasergate"); - if(e) - e.owner = world; - }while(e); -} - -void lasergate_touch() -{ - //if(self.state != STATE_ACTIVE) - // return; // lasergate is inactive - - //bprint("touch\n"); - if(other == self.owner) - return; // don't hurt the guy that's moving at the moment - - //bprint("not owner\n"); - if(self.team_no && other.team_no == self.team_no) - return; // don't hurt teammates if it does touch them somehow - - //bprint("not team\n"); - if(!self.dmg) - return; // no damage to deal - - //bprint("have damage\n"); - if(self.respawntime > time) - return; // don't damage every frame - - //bprint("hurt player!\n"); - self.respawntime = time + self.attack_finished; - - - Damage (other, self, self, self.dmg, DEATH_LASERGATE, 0.5*(self.absmin+self.absmax), '0 0 0'); -} - -void lasergate_activate() -{ -// if(self.state) -// return; -// bprint("lasergate_activate\n"); - self.state=1; - setorigin(self, self.origin); - setmodel(self, self.mdl); - setsize (self, self.mins , self.maxs); - self.touch = lasergate_touch; -} - -void lasergate_deactivate() -{ -// if(!self.state) -// return; -// bprint("lasergate_deactivate\n"); - self.state=0; - setmodel(self, ""); - self.touch = SUB_Null; -} - -void lasergate_use() -{ - if(self.spawnflags & LGATE_TOGGLE) - { - if(self.state) - lasergate_deactivate(); - else - lasergate_activate(); - return; - } - - if(self.spawnflags & LGATE_START_OFF) - { - lasergate_activate(); - self.think = lasergate_deactivate; - self.nextthink = self.ltime + self.wait; - } - else - { - lasergate_deactivate(); - self.think = lasergate_activate; - self.nextthink = self.ltime + self.wait; - } -} - -void func_lasergate() -{ - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - - self.use = lasergate_use; - self.mdl = self.model; - - // testing - //self.dmg = 999; - - if(!self.attack_finished) - self.attack_finished = 1; - if(!self.wait) - self.wait = 5; - if(!self.message) - self.message = " tried to cross a lasergate"; - - if(self.spawnflags & LGATE_ADDITIVE_BLEND) - self.effects = self.effects | EF_ADDITIVE; - - if(self.spawnflags & LGATE_FULLBRIGHT) - self.effects = self.effects | EF_FULLBRIGHT; - - if(self.spawnflags & LGATE_START_OFF) - lasergate_deactivate(); - else - lasergate_activate(); -} - - - - - - - -void trigger_gravity_use() = -{ - if(activator.classname != "player") - return; - - if(self.gravity) - activator.gravity = self.gravity; - else if(self.speed) - { - activator.gravity = self.speed / cvar("sv_gravity"); - } -} - -void trigger_gravity_touch() = -{ - if (other.classname != "player") - return; - - activator = other; - self.use(); -} - - -void trigger_gravity() = -{ - if(!self.gravity && !self.speed) - self.gravity = 0.5; - - self.use = trigger_gravity_use; - self.touch = trigger_gravity_touch; - - InitTrigger (); - -} - diff --git a/TeamNexuiz/game/gamec/t_halflife.c b/TeamNexuiz/game/gamec/t_halflife.c deleted file mode 100644 index 342eb1b37..000000000 --- a/TeamNexuiz/game/gamec/t_halflife.c +++ /dev/null @@ -1,58 +0,0 @@ - -.float roomtype; -.float radius; -.float pitch; -.float renderamt; -.float rendermode; -.vector rendercolor; - -void() weapon_crossbow = {}; -void() weapon_handgrenade = {}; -void() ammo_crossbow = {}; -void() ammo_9mmclip = {}; -void() ammo_gaussclip = {}; -void() weapon_rpg = {}; -void() weapon_357 = {}; -void() ammo_ARgrenades = {}; -void() item_battery = {}; -void() ammo_rpgclip = {}; -void() weapon_9mmAR = {}; -void() weapon_tripmine = {}; -void() weapon_snark = {}; -void() ammo_buckshot = {}; -void() ammo_9mmAR = {}; -void() ammo_357 = {}; -void() weapon_gauss = {}; -void() weapon_hornetgun = {}; -//void() weapon_shotgun = {}; -void() item_healthkit = {}; -void() item_longjump = {}; -void() item_antidote = {}; -void() func_recharge = {}; -void() info_node = {}; -void() env_sound = {}; -void() light_spot = {}; -void() func_healthcharger = {}; - - -void() func_ladder_touch = -{ - if (other.classname != "player") - return; - other.ladder_time = time + 0.1; - other.ladder_entity = self; -}; - -void() func_ladder = -{ - InitTrigger (); - self.touch = func_ladder_touch; -}; - -void() func_water = -{ - self.solid = SOLID_TRIGGER; - setmodel (self, self.model); // set size and link into world - self.touch = func_ladder_touch; -}; - diff --git a/TeamNexuiz/game/gamec/t_items.c b/TeamNexuiz/game/gamec/t_items.c deleted file mode 100644 index 3b45c7dba..000000000 --- a/TeamNexuiz/game/gamec/t_items.c +++ /dev/null @@ -1,356 +0,0 @@ -void Item_ClearRespawnEffect (void) { - self.effects = 0; -} - -void Item_Respawn (void) -{ - self.model = self.mdl; // restore original model - self.solid = SOLID_TRIGGER; // allow it to be touched again - sound (self, CHAN_VOICE, "misc/itemrespawn.wav", 1, ATTN_NORM); // play respawn sound - setorigin (self, self.origin); - - // Savage: Add simple Respawn effect and make sure it gets removed - if(self.effects == 0) { - self.effects = EF_STARDUST; - self.think = Item_ClearRespawnEffect; - self.nextthink = time + 0.1; - } -} - -void Item_Touch (void) -{ - - local entity oldself; - local float _switchweapon; - - if (other.classname != "player") - return; - if (other.deadflag) - return; - if (self.solid != SOLID_TRIGGER) - return; - - if(self.buttonuse && !other.buttonuse) - return; // player must press "use" button to pick this up - - if (self.classname == "droppedweapon") - { - // don't allow my owner to accidentally pick me up again just after dropping me - if(self.enemy == other && self.delay > time) - return; - } - - // Savage: Remove the respawn effect if still present - if(self.effects == EF_STARDUST) - self.effects = 0; - - - sound (self, CHAN_BODY, self.noise, 1, ATTN_NORM); - - SpyCloakFlicker(other); - - // if the player is using their best weapon before items are given, they - // probably want to switch to an even better weapon after items are given - _switchweapon = other.switchweapon == w_getbestweapon(other); - - if (self.ammo_shells) - other.ammo_shells = min (other.ammo_shells + self.ammo_shells, 999); - if (self.ammo_nails) - other.ammo_nails = min (other.ammo_nails + self.ammo_nails, 999); - if (self.ammo_rockets) - other.ammo_rockets = min (other.ammo_rockets + self.ammo_rockets, 999); - if (self.ammo_cells) - other.ammo_cells = min (other.ammo_cells + self.ammo_cells, 999); - - if (self.weapon == WEP_UZI) W_GiveWeapon (other, WEP_UZI, "Machine gun", self.mass); - if (self.weapon == WEP_SHOTGUN) W_GiveWeapon (other, WEP_SHOTGUN, "Shotgun", self.mass); - if (self.weapon == WEP_GRENADE_LAUNCHER) W_GiveWeapon (other, WEP_GRENADE_LAUNCHER, "Mortar", self.mass); - if (self.weapon == WEP_ELECTRO) W_GiveWeapon (other, WEP_ELECTRO, "Electro", self.mass); - if (self.weapon == WEP_NEX) W_GiveWeapon (other, WEP_NEX, "Nex", self.mass); - if (self.weapon == WEP_HAGAR) W_GiveWeapon (other, WEP_HAGAR, "Hagar", self.mass); - if (self.weapon == WEP_ROCKET_LAUNCHER) W_GiveWeapon (other, WEP_ROCKET_LAUNCHER, "Rocket Launcher", self.mass); - if (self.weapon == WEP_CRYLINK) W_GiveWeapon (other, WEP_CRYLINK, "Crylink", self.mass); - - if (self.strength_finished) - other.strength_finished = max(other.strength_finished, time) + cvar("g_balance_powerup_strength_time"); - if (self.invincible_finished) - other.invincible_finished = max(other.invincible_finished, time) + cvar("g_balance_powerup_invincible_time"); - //if (self.speed_finished) - // other.speed_finished = max(other.speed_finished, time) + cvar("g_balance_powerup_speed_time"); - //if (self.slowmo_finished) - // other.slowmo_finished = max(other.slowmo_finished, time) + (cvar("g_balance_powerup_slowmo_time") * cvar("g_balance_powerup_slowmo_speed")); - - if (self.max_health) - { - other.health = other.health + self.max_health; - DelayHealthRot(other); - } - if (self.armorvalue) - { - other.armorvalue = other.armorvalue + self.armorvalue; - DelayArmorRot(other); - } - - oldself = self; - self = other; - - if (_switchweapon) - self.switchweapon = w_getbestweapon(self); - - //W_UpdateWeapon (); - //W_UpdateAmmo (); - weapon_action(self.weapon, WR_UPDATECOUNTS); - - self = oldself; - - if (self.classname == "droppedweapon") - remove (self); - else - { - self.solid = SOLID_NOT; - self.model = string_null; - self.nextthink = time + self.respawntime; - self.think = Item_Respawn; - setorigin (self, self.origin); - } -} - -// Savage: used for item garbage-collection -// TODO: perhaps nice special effect? -void RemoveItem(void) = { - remove(self); -} - - -void StartItem (string itemmodel, string pickupsound, float defaultrespawntime, string itemname, float itemid, float itemflags) -{ - if ((cvar("g_instagib") == 1) | (cvar("g_rocketarena") == 1)) - { - remove (self); - return; - } - self.mdl = itemmodel; - self.noise = pickupsound; - // let mappers override respawntime - if (!self.respawntime) - self.respawntime = defaultrespawntime; - self.netname = itemname; - if(itemflags & FL_WEAPON) - self.weapon = itemid; - else - self.items = itemid; - self.flags = FL_ITEM | itemflags; - setmodel (self, self.mdl); - if (itemflags & FL_WEAPON) - { - setorigin (self, self.origin + '0 0 22'); - setsize (self, '-12 -12 -12', '12 12 12'); - } - else - { - setorigin (self, self.origin + '0 0 15'); - // setsize (self, '-8 -8 -5', '8 8 8'); - } - self.movetype = MOVETYPE_TOSS; - self.solid = SOLID_TRIGGER; - self.touch = Item_Touch; - - if (itemflags & FL_POWERUP) - self.effects = self.effects | EF_ADDITIVE; - - // Savage: remove thrown items after a certain period of time ("garbage collection") - if (self.classname == "droppedweapon") - { - self.think = RemoveItem; - self.nextthink = time + 60; - } - - if (cvar("g_fullbrightitems")) - self.effects = self.effects | EF_FULLBRIGHT; - -} - -void weapon_uzi (void) {self.buttonuse=1;self.mass=0.25;self.ammo_nails = 120;StartItem ("models/weapons/g_uzi.md3", "weapons/weaponpickup.wav", 15, "Uzi", WEP_UZI, FL_WEAPON);} -void weapon_shotgun (void) {self.buttonuse=1;self.mass=0.15;self.ammo_shells = 15;StartItem ("models/weapons/g_shotgun.md3", "weapons/weaponpickup.wav", 15, "Shotgun", WEP_SHOTGUN, FL_WEAPON);} -void weapon_grenadelauncher (void) {self.buttonuse=1;self.mass=2;self.ammo_rockets = 15;StartItem ("models/weapons/g_gl.md3", "weapons/weaponpickup.wav", 15, "Grenade Launcher", WEP_GRENADE_LAUNCHER, FL_WEAPON);} -void weapon_electro (void) {self.buttonuse=1;self.mass=1.8;self.ammo_cells = 25;StartItem ("models/weapons/g_electro.md3", "weapons/weaponpickup.wav", 15, "Electro", WEP_ELECTRO, FL_WEAPON);} -void weapon_crylink (void) {self.buttonuse=1;self.mass=0.6;self.ammo_cells = 25;StartItem ("models/weapons/g_crylink.md3", "weapons/weaponpickup.wav", 15, "Crylink", WEP_CRYLINK, FL_WEAPON);} -void weapon_nex (void) {self.buttonuse=1;self.mass=1.5;self.ammo_cells = 25;StartItem ("models/weapons/g_nex.md3", "weapons/weaponpickup.wav", 15, "Nex Gun", WEP_NEX, FL_WEAPON);} -void weapon_hagar (void) {self.buttonuse=1;self.mass=1;self.ammo_rockets = 15;StartItem ("models/weapons/g_hagar.md3", "weapons/weaponpickup.wav", 15, "Hagar", WEP_HAGAR, FL_WEAPON);} -void weapon_rocketlauncher (void) {self.buttonuse=1;self.mass=2.5;self.ammo_rockets = 15;StartItem ("models/weapons/g_rl.md3", "weapons/weaponpickup.wav", 15, "Rocket Launcher", WEP_ROCKET_LAUNCHER, FL_WEAPON);} - -void(entity pl, float typ) PrintGrenadeType = -{ - local string st; - if (typ == TF_FLARE_OFF) - { - st = "Normal"; - }/* - else - { - if (typ == 2) - { - st = "Concussion"; - } - else - { - if (typ == 3) - { - st = "Nail"; - } - else - { - if (typ == 4) - { - st = "Mirv"; - } - else - { - if (typ == 5) - { - st = "Napalm"; - } - else - { - if (typ == 6) - { - st = "Flare"; - } - else - { - if (typ == 7) - { - st = "Gas"; - } - else - { - if (typ == 8) - { - st = "EMP"; - } - else - { - if (typ == 9) - { - st = "Flash"; - } - } - } - } - } - } - } - } - }*/ - sprint(pl, st); -}; - -void() GetGrenadePossibility = -{ - if (random() < 0.5) - { - return TF_FLARE_LIT; - } - if (random() < 0.5) - { - if (other.tp_grenades_1 != TF_FLARE_LIT && other.no_grenades_1 < 4) - { - other.no_grenades_1 = other.no_grenades_1 + TF_FLARE_OFF; - sprint(other, "You found a "); - PrintGrenadeType(other, other.tp_grenades_1); - sprint(other, " grenade\n"); - return TF_FLARE_OFF; - } - }/* - else - { - if (other.tp_grenades_2 != TF_FLARE_LIT && other.no_grenades_2 < 4) - { - other.no_grenades_2 = other.no_grenades_2 + TF_FLARE_OFF; - sprint(other, 2, "You found a "); - PrintGrenadeType(other, other.tp_grenades_2); - sprint(other, 2, " grenade\n"); - return TF_FLARE_OFF; - } - }*/ - sprint(other, "WOOOO\n"); - return TF_FLARE_LIT; -}; - -void item_rockets (void) {GetGrenadePossibility();self.ammo_rockets = 15;StartItem ("models/items/a_rockets.md3", "misc/itempickup.wav", 15, "rockets", IT_ROCKETS, 0);} -void item_bullets (void) {self.ammo_nails = 120;StartItem ("models/items/a_bullets.mdl", "misc/itempickup.wav", 15, "bullets", IT_NAILS, 0);} -void item_cells (void) {self.ammo_cells = 25;StartItem ("models/items/a_cells.md3", "misc/itempickup.wav", 15, "cells", IT_CELLS, 0);} -void item_shells (void) {self.ammo_shells = 25;StartItem ("models/items/a_shells.md3", "misc/itempickup.wav", 15, "shells", IT_SHELLS, 0);} - -void item_armor1 (void) {self.armorvalue = 5;StartItem ("models/items/g_a1.md3", "misc/armor1.wav", 15, "Armor Shard", 0, 0);} -void item_armor25 (void) {self.armorvalue = 100;StartItem ("models/items/g_a25.md3", "misc/armor25.wav", 30, "Armor", 0, 0);} -void item_health1 (void) {self.max_health = 5;StartItem ("models/items/g_h1.md3", "misc/minihealth.wav", 15, "5 Health", 0, 0);} -void item_health25 (void) {self.max_health = 25;StartItem ("models/items/g_h25.md3", "misc/mediumhealth.wav", 15, "25 Health", 0, 0);} -void item_health100 (void) {self.max_health = 100;StartItem ("models/items/g_h100.md3", "misc/megahealth.wav", 30, "100 Health", 0, 0);} - -void item_strength (void) {self.strength_finished = 30;StartItem ("models/items/g_strength.md3", "misc/powerup.wav", 120, "Strength Powerup", IT_STRENGTH, FL_POWERUP);} -void item_invincible (void) {self.invincible_finished = 30;StartItem ("models/items/g_invincible.md3", "misc/powerup.wav", 120, "Invulnerability", IT_INVINCIBLE, FL_POWERUP);} -//void item_speed (void) {self.speed_finished = 30;StartItem ("models/items/g_speed.md3", "misc/powerup.wav", 120, "Speed Powerup", IT_SPEED, FL_POWERUP);} -//void item_slowmo (void) {self.slowmo_finished = 30;StartItem ("models/items/g_slowmo.md3", "misc/powerup.wav", 120, "Slow Motion", IT_SLOWMO, FL_POWERUP);} - -void misc_models (void) -{ - precache_model (self.model); - setmodel (self, self.model); - setsize (self, self.mins, self.maxs); -} - - -void SpawnThrownWeapon (vector org, float w) -{ - return; // Not in tf, eh? We need to add backpacks! :P - - local entity oldself; - - if (w == IT_LASER) - return; - - oldself = self; - self = spawn(); - // this will cause it to be removed later - self.classname = "droppedweapon"; - - setorigin(self, org); - if(oldself.health <= 2) - self.velocity = randomvec() * 100 + '0 0 200'; - else - { - makevectors(oldself.angles); // not v_angle; we don't care for up/down motion - self.velocity = v_forward*150 + '0 0 100'; - } - - SUB_SetFade(self, time + 10, 1); - - // delay re-pickup by owner, i.e. don't let my owner pick me up by accident - self.enemy = oldself; - self.delay = time + 2; - - if (w == WEP_UZI) - weapon_uzi (); - else if (w == WEP_SHOTGUN) - weapon_shotgun (); - else if (w == WEP_GRENADE_LAUNCHER) - weapon_grenadelauncher (); - else if (w == WEP_ELECTRO) - weapon_electro (); - else if (w == WEP_CRYLINK) - weapon_crylink (); - else if (w == WEP_NEX) - weapon_nex (); - else if (w == WEP_HAGAR) - weapon_hagar (); - else if (w == WEP_ROCKET_LAUNCHER) - weapon_rocketlauncher (); - else - { - remove(self); - } - - self = oldself; -} - diff --git a/TeamNexuiz/game/gamec/t_jumppads.c b/TeamNexuiz/game/gamec/t_jumppads.c deleted file mode 100644 index 1e816ba0c..000000000 --- a/TeamNexuiz/game/gamec/t_jumppads.c +++ /dev/null @@ -1,96 +0,0 @@ -float PUSH_ONCE = 1; -float PUSH_SILENT = 2; - -void() trigger_push_touch = -{ - local float flighttime, dist, grav; - local vector org; - - if (other.classname != "player" && other.classname != "corpse" && other.classname != "body" && other.classname != "gib" && other.classname != "missile" && other.classname != "casing" && other.classname != "grenade" && other.classname != "plasma") - return; - - other.jump_pad = 1; - - if (!self.target) - { - other.velocity = self.movedir; - other.flags = other.flags - (other.flags & FL_ONGROUND); - return; - } - - org = other.origin; - - if (other.classname == "player") - sound (other, CHAN_ITEM, "misc/jumppad.wav", 1, ATTN_NORM); - - // figure out how long it will take to hit the point considering gravity - grav = cvar("sv_gravity"); - flighttime = sqrt((self.enemy.origin_z - org_z) / (0.5 * grav)); - if (!flighttime) - return; - - // how far in X and Y to move - self.movedir = (self.enemy.origin - org); - self.movedir_z = 0; - dist = vlen(self.movedir); - - // finally calculate the velocity - self.movedir = normalize(self.movedir) * (dist / flighttime); - self.movedir_z = flighttime * grav; - - other.velocity = self.movedir; - other.flags = other.flags - (other.flags & FL_ONGROUND); - - if (other.classname == "missile") - other.angles = vectoangles (other.velocity); - - if (self.spawnflags & PUSH_ONCE) - { - self.touch = SUB_Null; - self.think = SUB_Remove; - self.nextthink = time; - } -}; - -void() trigger_push_findtarget = -{ - // find the target - self.enemy = find(world, targetname, self.target); - if (!self.enemy) - { - objerror("trigger_push: target not found\n"); - remove(self); - } -}; - -void() trigger_push = -{ - if (self.angles != '0 0 0') - SetMovedir (); - - self.solid = SOLID_TRIGGER; - setmodel (self, self.model); - self.movetype = MOVETYPE_NONE; - self.modelindex = 0; - self.model = ""; - - self.touch = trigger_push_touch; - - // check if this is a jump pad - if (self.target) - { - self.think = trigger_push_findtarget; - self.nextthink = time + 0.2; - } - else - { - // normal push setup - if (!self.speed) - self.speed = 1000; - self.movedir = self.movedir * self.speed * 10; - } -}; - -void() target_push = {}; -//void() info_notnull = {}; // Moved to tfq3fitems.c! -void() target_position = {}; diff --git a/TeamNexuiz/game/gamec/t_plats.c b/TeamNexuiz/game/gamec/t_plats.c deleted file mode 100644 index 0182a3893..000000000 --- a/TeamNexuiz/game/gamec/t_plats.c +++ /dev/null @@ -1,446 +0,0 @@ -/*void() plat_center_touch; -void() plat_outside_touch; -void() plat_trigger_use; -void() plat_go_up; -void() plat_go_down; -void() plat_crush; -float PLAT_LOW_TRIGGER = 1; - -void() plat_spawn_inside_trigger = -{ - local entity trigger; - local vector tmin, tmax; - - trigger = spawn(); - trigger.touch = plat_center_touch; - trigger.movetype = MOVETYPE_NONE; - trigger.solid = SOLID_TRIGGER; - trigger.enemy = self; - - tmin = self.mins + '25 25 0'; - tmax = self.maxs - '25 25 -8'; - tmin_z = tmax_z - (self.pos1_z - self.pos2_z + 8); - if (self.spawnflags & PLAT_LOW_TRIGGER) - tmax_z = tmin_z + 8; - - if (self.size_x <= 50) - { - tmin_x = (self.mins_x + self.maxs_x) / 2; - tmax_x = tmin_x + 1; - } - if (self.size_y <= 50) - { - tmin_y = (self.mins_y + self.maxs_y) / 2; - tmax_y = tmin_y + 1; - } - - setsize (trigger, tmin, tmax); -}; - -void() plat_hit_top = -{ - sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); - self.state = 1; - self.think = plat_go_down; - self.nextthink = self.ltime + 3; -}; - -void() plat_hit_bottom = -{ - sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); - self.state = 2; -}; - -void() plat_go_down = -{ - sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); - self.state = 3; - SUB_CalcMove (self.pos2, self.speed, plat_hit_bottom); -}; - -void() plat_go_up = -{ - sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); - self.state = 4; - SUB_CalcMove (self.pos1, self.speed, plat_hit_top); -}; - -void() plat_center_touch = -{ - if (other.classname != "player") - return; - - if (other.health <= 0) - return; - - self = self.enemy; - if (self.state == 2) - plat_go_up (); - else if (self.state == 1) - self.nextthink = self.ltime + 1; // delay going down -}; - -void() plat_outside_touch = -{ - if (other.classname != "player") - return; - - if (other.health <= 0) - return; - - self = self.enemy; - if (self.state == 1) - plat_go_down (); -}; - -void() plat_trigger_use = -{ - if (self.think) - return; // allready activated - plat_go_down(); -}; - - -void() plat_crush = -{ - if (self.state == 4) - plat_go_down (); - else if (self.state == 3) - plat_go_up (); - else - objerror ("plat_crush: bad self.state\n"); -}; - -void() plat_use = -{ - self.use = SUB_Null; - if (self.state != 4) - objerror ("plat_use: not in up state"); - plat_go_down(); -}; - - -.string sound1, sound2; - -void() func_plat = -{ - if (!self.t_length) - self.t_length = 80; - if (!self.t_width) - self.t_width = 10; - - if (self.sounds == 0) - self.sounds = 2; - - if (self.sounds == 1) - { - precache_sound ("plats/plat1.wav"); - precache_sound ("plats/plat2.wav"); - self.noise = "plats/plat1.wav"; - self.noise1 = "plats/plat2.wav"; - } - - if (self.sounds == 2) - { - precache_sound ("plats/medplat1.wav"); - precache_sound ("plats/medplat2.wav"); - self.noise = "plats/medplat1.wav"; - self.noise1 = "plats/medplat2.wav"; - } - - if (self.sound1) - { - precache_sound (self.sound1); - self.noise = self.sound1; - } - if (self.sound2) - { - precache_sound (self.sound2); - self.noise1 = self.sound2; - } - - self.mangle = self.angles; - self.angles = '0 0 0'; - - self.classname = "plat"; - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - setorigin (self, self.origin); - setmodel (self, self.model); - setsize (self, self.mins , self.maxs); - - self.blocked = plat_crush; - if (!self.speed) - self.speed = 150; - self.pos1 = self.origin; - self.pos2 = self.origin; - self.pos2_z = self.origin_z - self.size_z + 8; - - self.use = plat_trigger_use; - - plat_spawn_inside_trigger (); // the "start moving" trigger - - if (self.targetname) - { - self.state = 4; - self.use = plat_use; - } - else - { - setorigin (self, self.pos2); - self.state = 2; - } -}; - - -/* -void() train_next; -void() func_train_find; - -void() train_blocked = -{ - if (time < self.attack_finished) - return; - self.attack_finished = time + 0.5; -}; -void() train_use = -{ - if (self.think != func_train_find) - return; - train_next(); -}; - -void() train_wait = -{ - if (self.wait) - { - self.nextthink = self.ltime + self.wait; - sound (self, CHAN_VOICE, self.noise, 1, ATTN_NORM); - } - else - self.nextthink = self.ltime + 0.1; - - self.think = train_next; -}; - -void() train_next = -{ - local entity targ; - - targ = find (world, targetname, self.target); - self.target = targ.target; - if (!self.target) - objerror ("train_next: no next target"); - if (targ.wait) - self.wait = targ.wait; - else - self.wait = 0; - sound (self, CHAN_VOICE, self.noise1, 1, ATTN_NORM); - SUB_CalcMove (targ.origin - self.mins, self.speed, train_wait); -}; - -void() func_train_find = -{ - local entity targ; - - targ = find (world, targetname, self.target); - self.target = targ.target; - setorigin (self, targ.origin - self.mins); - if (!self.targetname) - { // not triggered, so start immediately - self.nextthink = self.ltime + 0.1; - self.think = train_next; - } -}; - - -void() func_train = -{ - if (!self.speed) - self.speed = 100; - if (!self.target) - objerror ("func_train without a target"); - - if (self.sounds == 0) - { - self.noise = ("misc/null.wav"); - precache_sound ("misc/null.wav"); - self.noise1 = ("misc/null.wav"); - precache_sound ("misc/null.wav"); - } - - if (self.sounds == 1) - { - self.noise = ("plats/train2.wav"); - precache_sound ("plats/train2.wav"); - self.noise1 = ("plats/train1.wav"); - precache_sound ("plats/train1.wav"); - } - - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - self.blocked = train_blocked; - self.use = train_use; - self.classname = "train"; - - setmodel (self, self.model); - setsize (self, self.mins , self.maxs); - setorigin (self, self.origin); - self.nextthink = self.ltime + 0.1; - self.think = func_train_find; -}; -*/ - -void() train_next; // temp -/*void() train_wait = -{ - self.think = train_next; - self.nextthink = self.ltime + self.wait; -}; - -/*void() train_next = -{ - local entity targ; - targ = find(world, targetname, self.target); - self.target = targ.target; - if (!self.target) - objerror("train_next: no next target"); - self.wait = targ.wait; - if (!self.wait) - self.wait = 0.1; - if (targ.speed) - SUB_CalcMove(targ.origin - self.mins, targ.speed, train_wait); - else - SUB_CalcMove(targ.origin - self.mins, self.speed, train_wait); -};*/ -/* //temp -void() func_train_find = -{ - local entity targ; - targ = find(world, targetname, self.target); - self.target = targ.target; - setorigin(self, targ.origin - self.mins); - self.nextthink = self.ltime + 1; - self.think = train_next; -}; - -/*QUAKED func_train (0 .5 .8) ? -Ridable platform, targets path_corner path to follow. -speed : speed the train moves (can be overridden by each path_corner) -target : targetname of first path_corner (starts here) -*/ -/*void() func_train = -{ - if (!self.target) - objerror("func_train without a target"); - if (!self.speed) - self.speed = 100; - - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - - setmodel(self, self.model); - setsize(self, self.mins, self.maxs); - setorigin(self, self.origin); - - // wait for targets to spawn - self.nextthink = self.ltime + 0.1; - self.think = func_train_find; -}; - -/*QUAKED func_rotating (0 .5 .8) ? - - X_AXIS Y_AXIS -Brush model that spins in place on one axis (default Z). -speed : speed to rotate (in degrees per second) -noise : path/name of looping .wav file to play. -*/ -void() func_rotating = -{ - if (self.noise) - { - precache_sound(self.noise); - ambientsound(self.origin, self.noise, 1, ATTN_IDLE); - } - if (!self.speed) - self.speed = 100; - // FIXME: test if this turns the right way, then remove this comment (negate as needed) - if (self.spawnflags & 4) // X (untested) - self.avelocity = '0 0 1' * self.speed; - // FIXME: test if this turns the right way, then remove this comment (negate as needed) - else if (self.spawnflags & 8) // Y (untested) - self.avelocity = '1 0 0' * self.speed; - // FIXME: test if this turns the right way, then remove this comment (negate as needed) - else // Z - self.avelocity = '0 1 0' * self.speed; - - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - - setmodel(self, self.model); - setsize(self, self.mins, self.maxs); - setorigin(self, self.origin); - - // wait for targets to spawn - self.nextthink = self.ltime + 999999999; - self.think = SUB_Null; -}; - -.float height; -.float phase; -void() func_bobbing_controller_think = -{ - local vector v; - self.nextthink = time + 0.1; - // calculate sinewave using makevectors - makevectors((time * self.owner.cnt + self.owner.phase) * '0 1 0'); - v = self.owner.destvec + self.owner.movedir * v_forward_y; - // * 10 so it will arrive in 0.1 sec - self.owner.velocity = (v - self.owner.origin) * 10; -}; - -/*QUAKED func_bobbing (0 .5 .8) ? X_AXIS Y_AXIS -Brush model that moves back and forth on one axis (default Z). -speed : how long one cycle takes in seconds (default 4) -height : how far the cycle moves (default 32) -phase : cycle timing adjustment (0-1 as a fraction of the cycle, default 0) -noise : path/name of looping .wav file to play. -*/ -void() func_bobbing = -{ - local entity controller; - if (self.noise) - { - precache_sound(self.noise); - ambientsound(self.origin, self.noise, 1, ATTN_IDLE); - } - if (!self.speed) - self.speed = 4; - if (!self.height) - self.height = 32; - // center of bobbing motion - self.destvec = self.origin; - // time scale to get degrees - self.cnt = 360 / self.speed; - // how far to bob - if (self.spawnflags & 1) // X - self.movedir = '1 0 0' * self.height; - else if (self.spawnflags & 2) // Y - self.movedir = '0 1 0' * self.height; - else // Z - self.movedir = '0 0 1' * self.height; - - self.solid = SOLID_BSP; - self.movetype = MOVETYPE_PUSH; - - setmodel(self, self.model); - setsize(self, self.mins, self.maxs); - setorigin(self, self.origin); - - // wait for targets to spawn - controller = spawn(); - controller.classname = "func_bobbing_controller"; - controller.owner = self; - controller.nextthink = time + 1; - controller.think = func_bobbing_controller_think; - self.nextthink = self.ltime + 999999999; - self.think = SUB_Null; -}; diff --git a/TeamNexuiz/game/gamec/t_quake.c b/TeamNexuiz/game/gamec/t_quake.c deleted file mode 100644 index 169cda743..000000000 --- a/TeamNexuiz/game/gamec/t_quake.c +++ /dev/null @@ -1,48 +0,0 @@ -//*********************** -//QUAKE 1 ENTITIES - So people can play quake1 maps with the nexuiz weapons -//*********************** -void weapon_nailgun (void) {weapon_electro();} -void weapon_supernailgun (void) {weapon_hagar();} -void weapon_supershotgun (void) {weapon_uzi();} - -void item_spikes (void) {item_bullets();} -void item_armor2 (void) {item_armor25();} -void item_armorInv (void) {item_armor25();} -void item_health (void) {if (self.spawnflags & 2) item_health100();else item_health25();} - -//item_spikes -//item_health - - - - - - - -// garbage function to reduce warnings in compiling about unused variables -void junk_function () -{ - self.exteriormodeltoclient = world; - self.glow_trail = 0; - self.tag_entity = world; - self.button6 = 0; - self.button7 = 0; - self.button8 = 0; - self.pitch_speed = 0; - self.drawonlytoclient = world; - self.nodrawtoclient = world; - self.cursor_active = 0; - self.cursor_screen = '0 0 0'; - self.cursor_trace_start = '0 0 0'; - self.ping = 0; - self.roomtype = 0; - self.radius = 0; - self.pitch = 0; - self.renderamt = 0; - self.rendermode = 0; - self.rendercolor = '0 0 0'; - precache_model("progs/s_bubble.spr"); - precache_model("progs/s_light.spr"); - bprint(ftos(sv_maxairspeed), "\n"); -} - diff --git a/TeamNexuiz/game/gamec/t_quake3.c b/TeamNexuiz/game/gamec/t_quake3.c deleted file mode 100644 index 0a178bc2a..000000000 --- a/TeamNexuiz/game/gamec/t_quake3.c +++ /dev/null @@ -1,18 +0,0 @@ -//*********************** -//QUAKE 3 ENTITIES - So people can play quake3 maps with the nexuiz weapons -//*********************** -void weapon_machinegun (void) {weapon_uzi();} -void weapon_plasmagun (void) {weapon_electro();} -void weapon_lightning (void) {weapon_crylink();} -void weapon_railgun (void) {weapon_nex();} -void weapon_bfg (void) {weapon_hagar();} -void item_slugs (void) {item_cells();} -void item_lightning (void) {item_cells();} -void item_armorshard (void) {item_armor1();} -void item_armorbody (void) {item_armor25();} -void item_armor_shard (void) {item_armor1();} -void item_armor_body (void) {item_armor25();} -void item_armor_combat (void) {item_armor25();} -void item_health_small (void) {item_health1();} -void item_health_large (void) {item_health25();} -void item_health_mega (void) {item_health100();} diff --git a/TeamNexuiz/game/gamec/t_teleporters.c b/TeamNexuiz/game/gamec/t_teleporters.c deleted file mode 100644 index 846fcb2b2..000000000 --- a/TeamNexuiz/game/gamec/t_teleporters.c +++ /dev/null @@ -1,308 +0,0 @@ -void Damage (entity targ, entity inflictor, entity attacker, float -damage, float deathtype, vector hitloc, vector force); - -void() tdeath_touch = -{ - if (other == self.owner) - return; - // so teleporting shots etc can't telefrag - if (!self.owner.takedamage) - return; - if (!other.takedamage) - return; - - if ((self.owner.classname == "player") && (self.owner.health >= 1)) - Damage (other, self, self.owner, 10000, DEATH_TELEFRAG, other.origin, '0 0 0'); - else if (other.health < 1) // corpses gib - Damage (other, self, self.owner, 10000, DEATH_TELEFRAG, other.origin, '0 0 0'); - else // dead bodies and monsters gib themselves instead of telefragging - Damage (self.owner, self, self.owner, 10000, DEATH_TELEFRAG, self.owner.origin, '0 0 0'); -}; - -// org2 is where they will return to if the teleport fails -void(vector org, entity death_owner, vector org2) spawn_tdeath = -{ - local entity death; - - death = spawn(); -// death.classname = "teledeath"; - death.movetype = MOVETYPE_NONE; - death.solid = SOLID_TRIGGER; - death.angles = '0 0 0'; - death.dest2 = org2; - setsize (death, death_owner.mins - '1 1 1', death_owner.maxs + '1 1 1'); - setorigin (death, org); - death.touch = tdeath_touch; - death.nextthink = time + 0.2; - death.think = SUB_Remove; - death.owner = death_owner; - - force_retouch = 2; // make sure even still objects get hit -}; - -/*void Teleport_Touch (void) -{ - if (other.health < 1) - return; - if (other.classname != "player") // FIXME: Make missiles firable through the teleport too - return; - - // Make teleport effect where the player left - sound (other, CHAN_ITEM, "misc/teleport.wav", 1, ATTN_NORM); - te_teleport (other.origin); - - dest = find (world, targetname, self.target); - if (!dest) - objerror ("Teleporter with nonexistant target"); - - // Make teleport effect where the player arrived - sound (other, CHAN_ITEM, "misc/teleport.wav", 1, ATTN_NORM); - makevectors (dest.mangle); - te_teleport (dest.origin + v_forward * 32); - - spawn_tdeath(dest.origin, other, other.origin); - - // Relocate the player - //setorigin (other, dest.origin); - setorigin (other, dest.origin + '0 0 1' * (1 - other.mins_z - 24)); - other.angles = dest.mangle; - other.fixangle = TRUE; - - other.velocity = '0 0 0'; - - other.flags = other.flags - (other.flags & FL_ONGROUND); -} - -void info_teleport_destination (void) -{ - self.mangle = self.angles; - self.angles = '0 0 0'; - - //setorigin (self, self.origin + '0 0 27'); // To fix a mappers' habit as old as Quake - setorigin (self, self.origin); - - if (!self.targetname) - objerror ("Teleport destination without a targetname"); -}*/ -/* -void misc_teleporter_dest (void) // Moved down -{ - info_teleport_destination(); -} -*/ -/* -void trigger_teleport (void) -{ - self.angles = '0 0 0'; - - self.solid = SOLID_TRIGGER; - self.movetype = MOVETYPE_NONE; - - setmodel (self, self.model); - - self.model = ""; - self.modelindex = 0; - - self.touch = Teleport_Touch; - - if (!self.target) - objerror ("Teleporter with no target"); -} -*/ - -// TF Teleporters -entity s; -void() SUB_UseTargets; - -void () play_teleport = -{ - local float v; - local string tmpstr; - - v = (random () * 5); - if ((v < 1)) - { - tmpstr = "misc/teleport.wav"; - } - else - { - if ((v < 2)) - { - tmpstr = "misc/teleport.wav"; - } - else - { - if ((v < 3)) - { - tmpstr = "misc/teleport.wav"; - } - else - { - if ((v < 4)) - { - tmpstr = "misc/teleport.wav"; - } - else - { - tmpstr = "misc/teleport.wav"; - } - } - } - } - sound (self, 2, tmpstr, 1, 1); - remove (self); -}; - -void (vector org) spawn_tfog = -{ - s = spawn (); - s.origin = org; - s.nextthink = (time + 0.2); - s.think = play_teleport; - WriteByte (0, 23); - WriteByte (0, 11); - WriteCoord (0, org_x); - WriteCoord (0, org_y); - WriteCoord (0, org_z); -}; - -void () teleport_touch = -{ - local entity t; - local entity te; - local vector org; - - if (self.targetname) - { - if ((self.nextthink < time)) - { - return; - } - } - if ((self.spawnflags & 1)) - { - if ((other.classname != "player")) - { - return; - } - } - if (!Activated (self, other)) - { - if ((self.else_goal != 0)) - { - te = Findgoal (self.else_goal); - if (te) - { - AttemptToActivate (te, other, self); - } - } - return; - } - if (((other.health <= 0) || (other.solid != 3))) - { - return; - } - SUB_UseTargets (); - spawn_tfog (other.origin); - t = find (world, targetname, self.target); - if (!t) - { - objerror ("couldn't find target"); - } - makevectors (t.mangle); - org = (t.origin + (32 * v_forward)); - spawn_tfog (org); - spawn_tdeath (t.origin, other); - if (!other.health) - { - other.origin = t.origin; - other.velocity = ((v_forward * other.velocity_x) + (v_forward * other.velocity_y)); - return; - } - setorigin (other, t.origin); - other.angles = t.mangle; - if ((other.classname == "player")) - { - if (((other.weapon == 1)/* && other.hook_out*/)) // Hook out code needs replacement - { - sound (other, 1, "weapons/bounce2.wav", 1, 1); -// other.on_hook = 0; -// other.hook_out = 0; -// other.fire_held_down = 0; - other.weaponframe = 0; - other.attack_finished = (time + 0.75); - } - other.fixangle = 1; - other.teleport_time = (time + 0.7); - if ((other.flags & 512)) - { - other.flags = (other.flags - 512); - } - other.velocity = (v_forward * 300); - } - other.flags = (other.flags - (other.flags & 512)); -}; - -void () teleport_use = -{ - self.nextthink = (time + 0.2); - force_retouch = 2; - self.think = SUB_Null; -}; - -void () info_teleport_destination = -{ - if ((CheckExistence () == 0)) - { - dremove (self); - return; - } - self.mangle = self.angles; - self.angles = '0 0 0'; - self.model = ""; - self.origin = (self.origin + '0 0 27'); - if (!self.targetname) - { - objerror ("no targetname"); - } -}; - -void () trigger_teleport = -{ - if (self.allowteams == "red") - { - self.team_no = 2; - self.owned_by = 2; - } - if (self.allowteams == "blue") - { - self.owned_by = 1; - self.team_no = 1; - } - - local vector o; - - if ((CheckExistence () == 0)) - { - dremove (self); - return; - } - InitTrigger (); - self.touch = teleport_touch; - if (!self.target) - { - objerror ("no target"); - } - self.use = teleport_use; - if (!(self.spawnflags & 2)) - { - precache_sound ("ambience/hum1.wav"); - o = ((self.mins + self.maxs) * 0.5); - ambientsound (o, "ambience/hum1.wav", 0.5, 3); - } -}; - -void misc_teleporter_dest (void) // Moved from above -{ - info_teleport_destination(); -} \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/tfai.c b/TeamNexuiz/game/gamec/tfai.c deleted file mode 100644 index fdefd9558..000000000 --- a/TeamNexuiz/game/gamec/tfai.c +++ /dev/null @@ -1,48 +0,0 @@ -void() t_movetarget = -{ - local entity temp; - if (other.movetarget != self) - { - return; - } - if (other.enemy) - { - return; - } - temp = self; - self = other; - other = temp; - if (self.classname == "monster_ogre") - { - sound(self, 2, "ogre/ogdrag.wav", TF_FLARE_OFF, 2); - } - self.goalentity = self.movetarget = find(world, targetname, other.target); - self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); - if (!(self.movetarget)) - { - self.pausetime = time + 999999; - self.th_stand(); - return; - } -}; - -void() movetarget_f = -{ - if (!(self.targetname)) - { - objerror("monster_movetarget: no targetname"); - } - self.solid = TF_FLARE_OFF; - self.touch = t_movetarget; - setsize(self, '-8 -8 -8', '8 8 8'); -}; - -void() path_corner = -{ - if (CheckExistence() == TF_FLARE_LIT) - { - dremove(self); - return; - } - movetarget_f(); -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/tfbuttons.c b/TeamNexuiz/game/gamec/tfbuttons.c deleted file mode 100644 index 83d4ac0dd..000000000 --- a/TeamNexuiz/game/gamec/tfbuttons.c +++ /dev/null @@ -1,169 +0,0 @@ -void () button_return; - -void () button_wait = -{ - self.state = 0; - self.nextthink = (self.ltime + self.wait); - self.think = button_return; - activator = self.enemy; - SUB_UseTargets (); -// self.frame = 1; // causes crash :(( -}; - -void () button_done = -{ - self.state = 1; -}; - -void () button_return = -{ - self.goal_state = 2; - self.state = 3; - SUB_CalcMove (self.pos1, self.speed, button_done); - self.frame = 0; - if (self.health) - { - self.takedamage = 1; - } -}; - -void () button_blocked = -{ -}; - -void () button_fire = -{ - if (((self.state == 2) || (self.state == 0))) - { - return; - } - sound (self, 2, self.noise, 1, 1); - self.state = 2; - SUB_CalcMove (self.pos2, self.speed, button_wait); -}; - -void () button_use = -{ - self.enemy = activator; - button_fire (); -}; - -float () button_touch = -{ - local entity te; - - if ((cb_prematch_time > time)) - { - return; - } - if ((other.classname != "player")) - { - return; - } - if ((self.goal_activation & 8)) - { - return; - } - if ((other.playerclass == 0)) - { - return (0); - } - if (!Activated (self, other)) - { - if ((self.else_goal != 0)) - { - te = Findgoal (self.else_goal); - if (te) - { - AttemptToActivate (te, other, self); - } - } - return; - } - self.enemy = other; - button_fire (); -}; - -void () button_killed = -{ - if ((self.goal_activation & 8)) - { - return; - } - self.enemy = damage_attacker; - self.health = self.max_health; - self.takedamage = 0; - button_fire (); -}; - -void () func_button = -{ - local float gtemp; - local float ftemp; - - if (self.activetarget != "") - { - self.target = self.activetarget; - } - - if ((CheckExistence () == 0)) - { - dremove (self); - return; - } - if ((self.sounds == 0)) - { - precache_sound ("buttons/airbut1.wav"); - self.noise = "buttons/airbut1.wav"; - } - if ((self.sounds == 1)) - { - precache_sound ("buttons/switch21.wav"); - self.noise = "buttons/switch21.wav"; - } - if ((self.sounds == 2)) - { - precache_sound ("buttons/switch02.wav"); - self.noise = "buttons/switch02.wav"; - } - if ((self.sounds == 3)) - { - precache_sound ("buttons/switch04.wav"); - self.noise = "buttons/switch04.wav"; - } - SetMovedir (); - self.movetype = 7; - self.solid = 4; - setmodel (self, self.model); - self.blocked = button_blocked; - self.use = button_use; - if (self.health) - { - self.max_health = self.health; - self.th_die = button_killed; - self.takedamage = 1; - } - else - { - self.touch = button_touch; - } - if (!self.speed) - { - self.speed = 40; - } - if (!self.wait) - { - self.wait = 1; - } - if (!self.lip) - { - self.lip = 4; - } - self.state = 1; - self.pos1 = self.origin; - self.pos2 = (self.pos1 + (self.movedir * (fabs ((self.movedir * self.size)) - self.lip))); - if ((self.spawnflags & 32)) - { - button_fire (); - } -}; diff --git a/TeamNexuiz/game/gamec/tfclient.c b/TeamNexuiz/game/gamec/tfclient.c deleted file mode 100644 index 9c4d620d7..000000000 --- a/TeamNexuiz/game/gamec/tfclient.c +++ /dev/null @@ -1,98 +0,0 @@ -float intermission_running; // This was moved here from mauvebot.c -float intermission_exittime; // This was moved here from g_world.c -void (entity AD) ParseTFDetect; - -entity () FindIntermission = -{ - local entity spot; - local float cyc; - - spot = find (world, classname, "info_intermission"); - if (spot) - { - cyc = (random () * 1); - return (spot); - } - spot = find (world, classname, "info_player_start"); - if (spot) - { - return (spot); - } - spot = find (world, classname, "info_player_deathmatch"); - if (spot) - { - cyc = (random () * 6); - while ((cyc > 1)) - { - spot = find (spot, classname, "info_player_deathmatch"); - if (!spot) - { - spot = find (spot, classname, "info_player_deathmatch"); - } - cyc = (cyc - 1); - } - return (spot); - } - objerror ("FindIntermission: no spot"); -}; - -void () DecodeLevelParms = -{ - if (parems_decoded == 1) - return; - - else { - local entity decent; - decent = find (world, classname, "info_tfdetect"); - if ((decent != world)) - { -// teamplay = cvar ("teamplay"); -// if ((teamplay == 0)) -// { - cvar_set ("teamplay", "21?TeamFortress"); -// } - ParseTFDetect (decent); - if (((number_of_teams <= 0.000000) || (number_of_teams >= 5.000000))) - { - number_of_teams = 4.000000; - } - } - } - parems_decoded = 1; -}; - -// Execute Change Level -void () execute_changelevel = -{ - local entity pos; - - intermission_running = 1; - if (deathmatch) - { - intermission_exittime = (time + 5); - } - else - { - intermission_exittime = (time + 2); - } - WriteByte (2, 32); - WriteByte (2, 3); - WriteByte (2, 3); - pos = FindIntermission (); - other = find (world, classname, "player"); - while ((other != world)) - { - other.view_ofs = '0 0 0'; - other.v_angle = pos.mangle; - other.angles = pos.mangle; - other.fixangle = 1; - other.nextthink = (time + 0.5); - other.takedamage = 0; - other.solid = 0; - other.movetype = 0; - other.modelindex = 0; - setorigin (other, pos.origin); - other = find (other, classname, "player"); - } - WriteByte (2, 30); -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/tfcombat.c b/TeamNexuiz/game/gamec/tfcombat.c deleted file mode 100644 index fb5472cf6..000000000 --- a/TeamNexuiz/game/gamec/tfcombat.c +++ /dev/null @@ -1,630 +0,0 @@ -void () T_MissileTouch; -void () info_player_start; -void (entity targ, entity attacker) ClientObituary; -void (entity Goal, entity AP, float addb) DoResults; -float (entity Goal, entity AP) Activated; -float (entity targ, entity attacker, float damage) TeamEqualiseDamage; - -// Death MSG Caller -float deathmsg; // Gonna have to make this work with NexTF's - -//compiler-satisfying vars (Add these to defs) -.void() th_die; // Note to self: figure out wtf these 2 do -.void(entity attacker, float damage) th_pain; //// -float skill; // Skill level. Moot in NexTF (no SP, and bots use some other var) -.float super_damage_finished; //quad damage over <- convert this to work with nex! -entity damage_attacker; -.float immune_to_check; // as it says -float rj; // not sure, really.. - - -// COMBAT -void () monster_death_use = -{ - local entity ent; - local entity otemp; - local entity stemp; - - if ((self.flags & 1)) - { - self.flags = (self.flags - 1); - } - if ((self.flags & 2)) - { - self.flags = (self.flags - 2); - } - if (!self.target) - { - return; - } - activator = self.enemy; - SUB_UseTargets (); -}; - -float (entity targ, entity inflictor) CanDamage = -{ - if ((targ.movetype == 7)) - { - traceline (inflictor.origin, (0.5 * (targ.absmin + targ.absmax)), 1, self); - if ((trace_fraction == 1)) - { - return (1); - } - if ((trace_ent == targ)) - { - return (1); - } - return (0); - } - traceline (inflictor.origin, targ.origin, 1, self); - if ((trace_fraction == 1)) - { - return (1); - } - traceline (inflictor.origin, (targ.origin + '15 15 0'), 1, self); - if ((trace_fraction == 1)) - { - return (1); - } - traceline (inflictor.origin, (targ.origin + '-15 -15 0'), 1, self); - if ((trace_fraction == 1)) - { - return (1); - } - traceline (inflictor.origin, (targ.origin + '-15 15 0'), 1, self); - if ((trace_fraction == 1)) - { - return (1); - } - traceline (inflictor.origin, (targ.origin + '15 -15 0'), 1, self); - if ((trace_fraction == 1)) - { - return (1); - } - return (0); -}; - -void (entity targ, entity attacker) Killed = -{ - local entity oself; - local string db; - - oself = self; - self = targ; - if ((self.health < -99)) - { - self.health = -99; - } - if (((self.movetype == 7) || (self.movetype == 0))) - { - self.th_die (); - self = oself; - return; - } - self.enemy = attacker; - if ((self.flags & 32)) - { - killed_monsters = (killed_monsters + 1); - WriteByte (2, 27); - } -// ClientObituary (self, attacker); // causing crash :/ -// Obituary (attacker, targ, deathmsg); - self.takedamage = 0; - self.touch = SUB_Null; - monster_death_use (); -// self.th_die (); -// (float unnatural_death, entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force - PlayerKilled (0, targ, attacker, 0, deathmsg); - self = oself; -}; - -void (entity targ, entity inflictor, entity attacker, float damage) T_Damage = -{ - local vector dir; - local entity oldself; - local entity te; - local float save; - local float take; - - local float damagearmor; - - if (targ.team_no < 1 && targ.classname != "func_button" && targ.classname != "door") // TEMP - { //// - return; //// - } //// - - if (!targ.takedamage) - { - return; - } - if ((attacker.classname == "player")) - { - damage = (damage * 0.9); - } - if ((attacker.classname == "player")) - { - if ((attacker.super_damage_finished > time)) - { - damage = (damage * 4); - } - if (((targ.classname != "player") && (targ.classname != "bot"))) - { - if (!Activated (targ, attacker)) - { - if ((targ.else_goal != 0)) - { - te = Findgoal (targ.else_goal); - if (te) - { - AttemptToActivate (te, attacker, targ); - } - } - return; - } - } - } - damage_attacker = attacker; - if ((teamplay & (64 | 32))) - { - damage = TeamEqualiseDamage (targ, attacker, damage); - } - save = ceil ((targ.armortype * damage)); - if ((save >= targ.armorvalue)) - { - save = targ.armorvalue; - targ.armortype = 0; - targ.armorclass = 0; - targ.items = (targ.items - (targ.items & ((8192 | 16384) | 32768))); - } - - targ.armorvalue = (targ.armorvalue - save); - take = ceil ((damage - save)); - if ((targ.flags & 8)) - { - targ.dmg_take = (targ.dmg_take + take); - targ.dmg_save = (targ.dmg_save + save); - targ.dmg_inflictor = inflictor; - } - if (((inflictor != world) && (targ.movetype == 3))) - { - targ.immune_to_check = (time + (damage / 20)); - dir = (targ.origin - ((inflictor.absmin + inflictor.absmax) * 0.5)); - dir = normalize (dir); - if ((((damage < 60) & ((attacker.classname == "player") & (targ.classname == "player"))) & (attacker.netname != targ.netname))) - { - targ.velocity = (targ.velocity + ((dir * damage) * 11)); - } - else - { - targ.velocity = (targ.velocity + ((dir * damage) * 8)); - } - if ((((rj > 1) & ((attacker.classname == "player") & (targ.classname == "player"))) & (attacker.netname == targ.netname))) - { - targ.velocity = (targ.velocity + ((dir * damage) * rj)); - } - } - if ((targ.flags & 64)) - { - return; - } - if ((targ.invincible_finished >= time)) - { - if ((self.invincible_sound < time)) - { - sound (targ, 3, "items/protect3.wav", 1, 1); - self.invincible_sound = (time + 2); - } - return; - } - if (((attacker.classname == "player") && ((targ.classname == "player") || (targ.classname == "building_sentrygun")))) - { - if ((((targ.team_no > 0) && (targ.team_no == attacker.team_no)) && (targ != attacker))) - { - if ((teamplay & 16)) - { - return; - } - else - { - if ((teamplay & 8)) - { - take = (take / 2); - } - } - } - } - - // MOVED HERE FROM PlayerDamage -- need to port the rest - // how much damage to deal to armor - damagearmor = bound(0, damage * 0.2 * (targ.armorvalue / 50) * cvar("g_balance_armor_takedamage"), targ.armorvalue); - // how much damage armor blocks - save = bound(0, damage * (targ.armorvalue / 100) * cvar("g_balance_armor_effectiveness"), damage); - // how much damage to deal to player - take = bound(0, damage - save, damage); - targ.armorvalue = targ.armorvalue - damagearmor; - DelayArmorRegen(targ); - - if (((take < 1) && (take != 0))) - { - take = 1; - } - targ.health = (targ.health - take); - if ((targ.armorvalue < 1)) - { - targ.armorclass = 0; - targ.armorvalue = 0; - } - if ((targ.health <= 0)) - { - Killed (targ, attacker); - return; - } - oldself = self; - self = targ; - if (self.th_pain) - { - self.th_pain (attacker, take); - if ((skill >= 3)) - { - self.pain_finished = (time + 5); - } - } - self = oldself; -}; - -void (entity targ, entity inflictor, entity attacker, float damage, float T_flags, float T_AttackType) TF_T_Damage = -{ - local vector dir; - local entity oldself; - local entity te; - local float save; - local float take; - local float olddmsg; - local float no_damage; - local float moment; - - if (targ.team_no < 1 && targ.classname != "func_button" && targ.classname != "door") // TEMP - { //// - return; //// - } //// - if ((targ.takedamage == 0)) - { - return; - } - if ((T_AttackType & 256)) - { - targ.health = damage; - return; - } - /*if (cease_fire) // this aint needed - { - return; - }*/ - no_damage = 0; - if ((attacker.classname == "player")) - { - damage = (damage * 0.9); - if ((attacker.super_damage_finished > time)) - { - damage = (damage * 4); - } - if (((((((targ.classname != "player") && (targ.classname != "bot")) && (targ.classname != "building_sentrygun")) && (targ.classname != "building_dispenser")) && (targ.classname != "building_teleporter_entrance")) && (targ.classname != "building_teleporter_exit"))) - { - if (!Activated (targ, attacker)) - { - if ((targ.else_goal != 0)) - { - te = Findgoal (targ.else_goal); - if (te) - { - AttemptToActivate (te, attacker, targ); - } - } - return; - } - } - } - damage_attacker = attacker; - if ((teamplay & (64 | 32))) - { - damage = TeamEqualiseDamage (targ, attacker, damage); - } - if (((targ.armorclass != 0) && (T_AttackType != 0))) - { - if (((targ.armorclass & 1) && (T_AttackType & 1))) - { - damage = floor ((damage * 0.5)); - } - if (((targ.armorclass & 2) && (T_AttackType & 2))) - { - damage = floor ((damage * 0.5)); - } - if (((targ.armorclass & 4) && (T_AttackType & 4))) - { - damage = floor ((damage * 0.5)); - } - if (((targ.armorclass & 8) && (T_AttackType & 8))) - { - damage = floor ((damage * 0.5)); - } - if (((targ.armorclass & 16) && (T_AttackType & 16))) - { - damage = floor ((damage * 0.5)); - } - } - if ((T_flags & 1)) - { - take = damage; - save = 0; - } - else - { - save = ceil ((targ.armortype * damage)); - if ((((((attacker.classname == "player") && (targ.team_no > 0)) && (targ.team_no == attacker.team_no)) && (targ != attacker)) && (T_flags & 2))) - { - if ((T_AttackType & 4)) - { - if ((teamplay & 1024)) - { - save = 0; - } - else - { - if ((teamplay & 512)) - { - save = (save / 2); - } - } - } - else - { - if ((teamplay & 256)) - { - save = 0; - } - else - { - if ((teamplay & 128)) - { - save = (save / 2); - } - } - } - } - if ((save >= targ.armorvalue)) - { - save = targ.armorvalue; - targ.armortype = 0; - targ.armorclass = 0; - targ.items = (targ.items - (targ.items & ((8192 | 16384) | 32768))); - } - targ.armorvalue = (targ.armorvalue - save); - take = ceil ((damage - save)); - } - if ((targ.flags & 8)) - { - targ.dmg_take = (targ.dmg_take + take); - targ.dmg_save = (targ.dmg_save + save); - targ.dmg_inflictor = inflictor; - } - if ((((inflictor != world) && (targ.movetype == 3)) && !(targ.tfstate & 65536))) - { - if ((deathmsg != 9)) - { - targ.immune_to_check = (time + (damage / 20)); - dir = (targ.origin - ((inflictor.absmin + inflictor.absmax) * 0.5)); - dir = normalize (dir); - /*if ((targ.class == 6)) // moot function -- NexTF doesnt have an HWGuy - { - moment = (damage / 4); - if ((damage <= 50)) - { - moment = 0; - } - } - else*/ - { - moment = damage; - } - if ((((moment < 60) && ((attacker.classname == "player") && (targ.classname == "player"))) && (attacker.netname != targ.netname))) - { - targ.velocity = (targ.velocity + ((dir * moment) * 11)); - } - else - { - targ.velocity = (targ.velocity + ((dir * moment) * 8)); - } - if ((((rj > 1) && ((attacker.classname == "player") && (targ.classname == "player"))) && (attacker.netname == targ.netname))) - { - targ.velocity = (targ.velocity + ((dir * moment) * rj)); - } - } - } - if ((targ.flags & 64)) - { - return; - } - if ((targ.invincible_finished >= time)) - { - if ((self.invincible_sound < time)) - { - sound (targ, 3, "items/protect3.wav", 1, 1); - self.invincible_sound = (time + 2); - } - return; - } - if (((attacker.classname == "player") && (((((targ.classname == "player") || (targ.classname == "building_sentrygun")) || (targ.classname == "building_dispenser")) || (targ.classname == "building_teleporter_entrance")) || (targ.classname == "building_teleporter_exit")))) - { - if (((((targ.team_no > 0) && (targ.team_no == attacker.team_no)) && (targ != attacker)) && (T_flags & 2))) - { - if ((T_AttackType & 4)) - { - if ((teamplay & 16)) - { - no_damage = 1; - } - else - { - if ((teamplay & 8)) - { - take = (take / 2); - } - } - } - else - { - if ((teamplay & 4)) - { - no_damage = 1; - } - else - { - if ((teamplay & 2)) - { - take = (take / 2); - } - } - } - } - } - if ((T_flags & 4)) - { - if ((targ == attacker)) - { - return; - } - } - - local float damagearmor; - // MOVED HERE FROM PlayerDamage -- need to port the rest - // how much damage to deal to armor - damagearmor = bound(0, damage * 0.2 * (targ.armorvalue / 50) * cvar("g_balance_armor_takedamage"), targ.armorvalue); - // how much damage armor blocks - save = bound(0, damage * (targ.armorvalue / 100) * cvar("g_balance_armor_effectiveness"), damage); - // how much damage to deal to player - take = bound(0, damage - save, damage); - targ.armorvalue = targ.armorvalue - damagearmor; - DelayArmorRegen(targ); - - if ((take < 1)) - { - take = 1; - } - take = rint (take); - if ((no_damage == 0)) - { - targ.health = (targ.health - take); - } - if (((attacker.classname == "player") && (((((targ.classname == "player") || (targ.classname == "building_sentrygun")) || (targ.classname == "building_dispenser")) || (targ.classname == "building_teleporter_entrance")) || (targ.classname == "building_teleporter_exit")))) - { - if (((((targ.team_no > 0) && (targ.team_no == attacker.team_no)) && (targ != attacker)) && (T_flags & 2))) - { - olddmsg = deathmsg; - if ((T_AttackType & 4)) - { - deathmsg = 37; - if ((teamplay & 16384)) - { - TF_T_Damage (attacker, world, world, take, 1, 0); - } - else - { - if ((teamplay & 8192)) - { - TF_T_Damage (attacker, world, world, (take / 2), 1, 0); - } - } - } - else - { - deathmsg = 37; - if ((teamplay & 4096)) - { - TF_T_Damage (attacker, world, world, take, 1, 0); - } - else - { - if ((teamplay & 2048)) - { - TF_T_Damage (attacker, world, world, (take / 2), 1, 0); - } - } - } - deathmsg = olddmsg; - } - } - if ((no_damage == 1)) - { - return; - } - if ((targ.armorvalue < 1)) - { - targ.armorclass = 0; - targ.armorvalue = 0; - } - if ((targ.health <= 0)) - { - if ((((inflictor.classname == "detpack") && (inflictor.weaponmode == 1)) && (inflictor.enemy == targ))) - { - deathmsg = 16; - } - Killed (targ, attacker); - return; - } - oldself = self; - self = targ; - if (self.th_pain) - { - self.th_pain (attacker, take); - if ((skill >= 3)) - { - self.pain_finished = (time + 5); - } - } - self = oldself; -}; - -void (entity inflictor, entity attacker, float damage, entity ignore) T_RadiusDamage = -{ - local float points; - local entity head; - local entity te; - local vector org; //// - - head = findradius (inflictor.origin, (damage + 40)); - while (head) - { - if ((head != ignore)) - { - if (head.takedamage) - { - org = (head.origin + ((head.mins + head.maxs) * 0.5)); - points = (0.5 * vlen ((inflictor.origin - org))); - if ((points < 0)) - { - points = 0; - } - points = (damage - points); - if ((head == attacker)) - { - points = (points * 0.75); - } - if ((points > 0)) - { - if (CanDamage (head, inflictor)) - { - if ((head.classname == "monster_shambler")) - { - T_Damage (head, inflictor, attacker, (points * 0.5)); - } - else - { - TF_T_Damage (head, inflictor, attacker, points, 2, 4); - } - } - } - } - } - head = head.chain; - } -}; diff --git a/TeamNexuiz/game/gamec/tfdefs.c b/TeamNexuiz/game/gamec/tfdefs.c deleted file mode 100644 index d628b6e70..000000000 --- a/TeamNexuiz/game/gamec/tfdefs.c +++ /dev/null @@ -1,221 +0,0 @@ -/************************************* - Team:Nexuiz (NexTF) Definitions -*************************************/ - -/********************* General ***************************/ -float TF_FLARE_LIT = 0; // Woes of a decompiler, eh? -float TF_FLARE_OFF = 1; //// -float CTF_Map; -float (entity e, float healamount, float ignore) T_Heal; - -// Temporary Defs (till I implement real systems for these) -//float joinorder; // menu implemented :) - -// Team Scores -float team1score; -float team2score; -float team3score; -float team4score; - -// Team Colors -float team1col; -float team2col; -float team3col; -float team4col; - -// Last Spawn Place of Team -entity lastspawn_team1; -entity lastspawn_team2; -entity lastspawn_team3; -entity lastspawn_team4; - -// Death Message (we should incorporate this into Team:Nexuiz some time) -float deathmsg; - -// Hmm? -.float has_abbreviated; // for NetQuake's UpdateAbbreviation fucntion -.float hn_i_g; -.float hasnt_item_from_group; -float flagem_checked; -.float tp_grenades_1; -.float tp_grenades_2; -.float camdist; -.vector camangle; -.entity observer_list; -float cb_prematch_time; - -float civilianteams; // Are civilian teams allowed? - -float parems_decoded; // Have the parameters already been decoded - XavioR - -//Team Frags (old function -- possibly moot) -float team1frags; -float team2frags; -float team3frags; -float team4frags; - -//FlagExists floats so that a team flag isnt spawned twice by the Q3F conversion code -float redflagexists; -float blueflagexists; - -.void() th_die; // wtf is this again.. -.void() th_stand; -.void() th_walk; -.void() th_run; -.void() th_missile; -.void() th_melee; - -// Weapon Clips -.float reload_time; -.float clip_crylink; -.float clip_rockets; -.float clip_pipegrenades; -float CLIP_MAX_CRYLINK = 8; -float CLIP_MAX_ROCKETS = 4; -float CLIP_MAX_PIPEGRENADES = 6; - -.float playerclass; // TF's recognition of players. This will be set in accordance to tf playerclasses - -.float is_dead; // temp // player is dead - -.float immune_to_check; // How long player is immune to cheat check? - //// Personally i think I'm jsut gonna implement krimzon's - //// ParseClientCommand to check color change cheats. - XavioR -.float axhitme; // Goal Item (I think) -- if ax hits then blah - // There's no axe in nexuiz tho.... :/ -.float armor_allowed; // -.float maxarmor; //// -.float ammo_medikit; -.float maxammo_medikit; -.float ammo_detpack; -.float maxammo_detpack; -.float maxammo_shells; -.float maxammo_nails; -.float maxammo_cells; -.float maxammo_rockets; -.float last_impulse; -.float real_frags; -.float items_allowed; -.float super_time; // no idea(?) -.float super_sound; //// -.float invisible_finished; // Not a NexTF function(?) -.float invisible_time; //// -.float radsuit_finished; // BioSuit(?) -.float rad_time; //// -.float distance; // My guess is that this is whatever TF uses to store entity distances - // from each other? -.float volume; -.float option5; - -.float worldtype; // Not sure - -.float armorclass; // How will nexTF's armor class work? - // It's a good thing to have in anyways I guess. - -.float weaponmode; // I think only demoman and HWGuy use this, and since they're not in nextf.. poof - - // The TF State -.float tfstate; // State of the player according to quake TF. - // I will try to satisfy it for NexTF after the goal porting is done. -.float maxfbspeed; -.float maxstrafespeed; -.float StatusRefreshTime; // The Status Bar -.float StatusBarSize; //// -.float StatusBarRes; //// - -// MENU STUFF -.float current_menu; -.float menu_count; - -.float heat; // What tf uses for powering up weapons. Could be useful later? - -entity otemp; -entity stemp; - -.entity trigger_field; - -.string noise4; // MTF fucntion -- possibly moot. -.string deathtype; // "You have the flag" - -.string team_str_home; -.string team_str_moved; -.string team_str_carried; - -void (entity targ, entity inflictor, entity attacker, float damage) T_Damage; -void (entity targ, entity inflictor, entity attacker, float damage, float T_flags, float T_AttackType) TF_T_Damage; -void (entity Viewer, float pc, float rpc) TeamFortress_PrintClassName; -void (float classnum) SetMaxAmmoFor; - -/*********************************************************/ -/////////////////////////////////////////////////////////// -/******************* Moved from:**************************/ -//tffunctions -void (string halias, float himpulse1, float himpulse2) TeamFortress_Alias; - -// tfcombat: -.float invincible_time; //Pent effect time -.float invincible_sound; //Pent hit sound -void (entity inflictor, entity attacker, float damage, entity ignore) T_RadiusDamage; - -// tfmapitems: -.float tf_items; -.float tf_items_flags; -.float goal_no; -.float group_no; -.float goal_state; -.float goal_activation; -.float goal_effects; -.float goal_group; -.float activate_goal_no; -.float inactivate_goal_no; -.float if_goal_is_active; -.float if_goal_is_inactive; -.float if_goal_is_removed; -.float if_group_is_active; -.float if_group_is_inactive; -.float if_group_is_removed; -.float remove_goal_no; -.float restore_goal_no; -.float activate_group_no; -.float inactivate_group_no; -.float remove_group_no; -.float restore_group_no; -.float has_item_from_group; -.float remove_item_group; -.float return_item_no; - -// tfplats -.float height; -.entity movetarget; -void () SUB_CalcMoveDone; -void (vector tdest, float tspeed, void() func) SUB_CalcMove; -void (entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt; - -// tfq3fitems -.string is_converted_goal; // This is used to identify converted goals (helps me determine spawn in q3f maps) -float q3fdetect; -.vector orig_origin; -.string activetarget; -.string allowteams; -void () i_p_t; - -// tfgrenades -void () TeamFortress_PrimeGrenade; -void () TeamFortress_ThrowGrenade; -void () NormalGrenadeTouch; -void () NormalGrenadeExplode; -float () crandom; - -// tfsubs -.float dont_do_triggerwork; -void (entity Goal, entity AP) DoGroupWork; -void (entity Goal, entity AP) DoGoalWork; -void () button_wait; - -/******************* End Moved From Section **************/ -/////////////////////////////////////////////////////////// -/*************** Defs that need functions ****************/ -.float lives; // Amount of lives -float toggleflags; -.float is_unabletospy; // picking up tfgoal makes the spy unable to go undercover -.float owned_by; // Item is owned by team # \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/tffunctions.c b/TeamNexuiz/game/gamec/tffunctions.c deleted file mode 100644 index 8b66d74fe..000000000 --- a/TeamNexuiz/game/gamec/tffunctions.c +++ /dev/null @@ -1,1574 +0,0 @@ -// TF fucntions -.float goal_no; // goal number - pair with defs file -.float goal_result; // pair with defs -.float else_goal; // not sure -.float goal_result; -.float is_removed; // entity is removed? -float (entity _p_10934, entity _p_10935) Activated; -float (float tno) TeamFortress_TeamGetScore; -float (float tno) TeamFortress_TeamGetColor; -void (entity _p_10980, entity _p_10981, float _p_10982) DoResults; //< - score increase thing -void (entity Item, entity AP, float method) tfgoalitem_RemoveFromPlayer; -void(entity client, string s) CenterPrint = #73; - -// misc stuff (move to TFDefs file) -entity newmis; // This is what tf uses for spawning entities -.float has_disconnected; //has the player disconnected? -.float no_grenades_1; -.float no_grenades_2; -.float no_grenades_3; -.float pausetime; // not sure -float team1lives; -float team2lives; -float team3lives; -float team4lives; -float team1maxplayers; -float team2maxplayers; -float team3maxplayers; -float team4maxplayers; -float team1advantage; -float team2advantage; -float team3advantage; -float team4advantage; - -// stuff that still needs a function -float number_of_teams; // Number of teams == IMPORTANT - -// Color/Teamchange cheat detection (using DP functions instead of tf) -void (entity ent, float colors) setcolor; - -void SV_ChangeTeam(float color) -{ -// if (self.playerclass == 8) // Spies can change team color right? -// return; - if (self.team_no == 1 && color != 13) - { - setcolor(self, 13,13); - } - if (self.team_no == 2 && color != 4) - { - setcolor(self, 4,4); -// stuffcmd(self, "color 4\n"); - } -}; - - -void(entity targ, entity attacker) ClientObituary = -{ - ClientObituary(targ,attacker); // TEMP -- SOON I WILL ADD REAL DEATH MESSAGES -}; - -void () DoTFAliases = -{ - TeamFortress_Alias("primeone", 150, TF_FLARE_LIT); - TeamFortress_Alias("primetwo", 151, TF_FLARE_LIT); - TeamFortress_Alias("throwgren", 152, TF_FLARE_LIT); - TeamFortress_Alias("+gren1", 150, TF_FLARE_LIT); - TeamFortress_Alias("+gren2", 151, TF_FLARE_LIT); - TeamFortress_Alias("-gren1", 152, TF_FLARE_LIT); - TeamFortress_Alias("-gren2", 152, TF_FLARE_LIT); -}; - -void (entity tempent) dremove = -{ - if ((tempent == world)) - { - dprint ("***BUG BUG BUG BUG BUG BUG BUG BUG BUG BUG***\n"); - dprint ("WORLD has nearly been removed. Don't worry\n"); - dprint ("***BUG BUG BUG BUG BUG BUG BUG BUG BUG BUG***\n"); - return; - } - if ((tempent.is_removed == 1.000000)) - { - return; - } - tempent.is_removed = 1.000000; - remove (tempent); -}; - -entity (float gno) Findgoal = -{ - local entity tg; - local string st; - - tg = find (world, classname, "info_tfgoal"); - while (tg) - { - if ((tg.goal_no == gno)) - { - return (tg); - } - tg = find (tg, classname, "info_tfgoal"); - } - dprint ("Could not find a goal with a goal_no of "); - st = ftos (gno); - dprint (st); - dprint (".\n"); - //return (tg); -}; - -void(entity Goal, entity AP, entity ActivatingGoal) AttemptToActivate = -{ - local entity te; - local string st; - if (Activated(Goal, AP)) - { - if (ActivatingGoal == Goal) - { - DoResults(Goal, AP, TF_FLARE_OFF); - } - else - { - if (ActivatingGoal != world) - { - DoResults(Goal, AP, ActivatingGoal.goal_result & 2); - } - else - { - DoResults(Goal, AP, TF_FLARE_LIT); - } - } - } - else - { - if (Goal.else_goal != TF_FLARE_LIT) - { - te = Findgoal(Goal.else_goal); - if (te) - { - AttemptToActivate(te, AP, ActivatingGoal); - } - } - } -}; - -void (entity p) TeamFortress_SetSpeed = -{ - local string sp; - local float tf; - local entity te; - - stuffcmd (p, "cl_movespeedkey 1\n"); - if ((p.tfstate & 65536)) - { - if ((0 == 1)) - { - stuffcmd (p, "m_forward 0\n"); - stuffcmd (p, "m_side 0\n"); - } - p.velocity = '0 0 0'; - stuffcmd (p, "cl_backspeed 0\n"); - stuffcmd (p, "cl_forwardspeed 0\n"); - stuffcmd (p, "cl_sidespeed 0\n"); - return; - } - else - { - if ((0 == 1)) - { - stuffcmd (p, "m_forward 1\n"); - stuffcmd (p, "m_side 0.8\n"); - } - } - if ((p.class == 1)) //scout speed - { - p.maxfbspeed = 450; - p.maxstrafespeed = 450; - } - else - { - if ((p.class == 2.1)) // No sniper in nextf - { - p.maxfbspeed = 300; - p.maxstrafespeed = 300; - } - else - { - if ((p.class == 4)) //soldier speed - { - p.maxfbspeed = 240; - p.maxstrafespeed = 240; - } - else - { - if ((p.class == 4.1)) // No demoman in nextf - { - p.maxfbspeed = 280; - p.maxstrafespeed = 280; - } - else - { - if ((p.class == 16)) // Medic Speed - { - p.maxfbspeed = 320; - p.maxstrafespeed = 320; - } - else - { - if ((p.class == 6.1)) // No HWGuy in nextf - { - p.maxfbspeed = 230; - p.maxstrafespeed = 230; - } - else - { - if ((p.class == 8)) // Pyro Speed - { - p.maxfbspeed = 300; - p.maxstrafespeed = 300; - } - else - { - if ((p.class == 11)) // Wazat -- We need a Civ class - { - p.maxfbspeed = 240; - p.maxstrafespeed = 240; - } - else - { - if ((p.class == 2)) // Spy Speed - { - p.maxfbspeed = 300; - p.maxstrafespeed = 300; - } - else - { - if ((p.class == 32)) // Engineer Speed - { - p.maxfbspeed = 300; - p.maxstrafespeed = 300; - } - else - { - if ((p.class == 0)) // No class - { - p.maxfbspeed = 320; - p.maxstrafespeed = 320; - return; - } - } - } - } - } - } - } - } - } - } - } - tf = 0; - te = find (world, classname, "item_tfgoal"); - while (((te != world) && (tf == 0))) - { - if ((te.owner == p)) - { - if ((te.goal_activation & 2)) - { - tf = 1; - p.maxfbspeed = (p.maxfbspeed / 2); - p.maxstrafespeed = (p.maxstrafespeed / 2); - } - } - te = find (te, classname, "item_tfgoal"); - } - if ((p.tfstate & 32768)) - { - p.maxfbspeed = (p.maxfbspeed / 2); - p.maxstrafespeed = (p.maxstrafespeed / 2); - } - /* (p.leg_damage) // No leg damage if no snipers, eh? - { - if ((p.leg_damage > 6)) - { - p.leg_damage = 6; - } - p.maxfbspeed = (p.maxfbspeed * ((10 - p.leg_damage) / 10)); - p.maxstrafespeed = ((p.maxstrafespeed * (10 - p.leg_damage)) / 10); - }*/ - if ((p.tfstate & 2048)) - { - if ((p.maxfbspeed > 80)) - { - p.maxfbspeed = 80; - } - if ((p.maxstrafespeed > 80)) - { - p.maxstrafespeed = 80; - } - } - sp = ftos (p.maxfbspeed); - stuffcmd (p, "cl_backspeed "); - stuffcmd (p, sp); - stuffcmd (p, "\n"); - stuffcmd (p, "cl_forwardspeed "); - stuffcmd (p, sp); - stuffcmd (p, "\n"); - sp = ftos (p.maxstrafespeed); - stuffcmd (p, "cl_sidespeed "); - stuffcmd (p, sp); - stuffcmd (p, "\n"); -}; - -float (entity Retriever, float AmmoType) TeamFortress_GetMaxAmmo = -{ - if ((AmmoType == 256)) - { - return (Retriever.maxammo_shells); - } - else - { - if ((AmmoType == 512)) - { - return (Retriever.maxammo_nails); - } - else - { - if ((AmmoType == 2048)) - { - return (Retriever.maxammo_cells); - } - else - { - if ((AmmoType == 1024)) - { - return (Retriever.maxammo_rockets); - } - else - { - if ((AmmoType == 4)) - { - return (Retriever.maxammo_medikit); - } - else - { - if ((AmmoType == 131072)) - { - return (Retriever.maxammo_detpack); - } - } - } - } - } - } - dprint ("Error in TeamFortress_GetMaxAmmo()\n"); - dprint ("Invalid ammo type passed.\n"); - return (0); -}; - -void () TeamFortress_CheckClassStats = -{ -// Wazat - Implement your armor system here, eh? -/* if ((self.armortype > self.armor_allowed)) - { - self.armortype = self.armor_allowed; - }*/ - if ((self.armorvalue > self.max_armor)) - { - self.armorvalue = self.max_armor; - } - if ((self.armortype < 0)) - { - self.armortype = 0; - } - if ((self.armorvalue < 0)) - { - self.armorvalue = 0; - } - if ((self.ammo_shells > TeamFortress_GetMaxAmmo (self, 256))) - { - self.ammo_shells = TeamFortress_GetMaxAmmo (self, 256); - } - if ((self.ammo_shells < 0)) - { - self.ammo_shells = 0; - } - if ((self.ammo_nails > TeamFortress_GetMaxAmmo (self, 512))) - { - self.ammo_nails = TeamFortress_GetMaxAmmo (self, 512); - } - if ((self.ammo_nails < 0)) - { - self.ammo_nails = 0; - } - if ((self.ammo_rockets > (TeamFortress_GetMaxAmmo (self, 1024) * 3))) - { - self.ammo_rockets = (TeamFortress_GetMaxAmmo (self, 1024) * 3); - } - if ((self.ammo_rockets < 0)) - { - self.ammo_rockets = 0; - } - if ((self.ammo_cells > TeamFortress_GetMaxAmmo (self, 2048))) - { - self.ammo_cells = TeamFortress_GetMaxAmmo (self, 2048); - } - if ((self.ammo_cells < 0)) - { - self.ammo_cells = 0; - } - if ((self.ammo_medikit > TeamFortress_GetMaxAmmo (self, 4))) - { - self.ammo_medikit = TeamFortress_GetMaxAmmo (self, 4); - } - if ((self.ammo_medikit < 0)) - { - self.ammo_medikit = 0; - } - if ((self.ammo_detpack > TeamFortress_GetMaxAmmo (self, 131072))) - { - self.ammo_detpack = TeamFortress_GetMaxAmmo (self, 131072); - } - if ((self.ammo_detpack < 0)) - { - self.ammo_detpack = 0; - } - if ((self.no_grenades_1 < 0)) - { - self.no_grenades_1 = 0; - } - if ((self.no_grenades_2 < 0)) - { - self.no_grenades_2 = 0; - } -// NexTF uses auto-rot, so there's no need for this function. -// if (((self.health > self.max_health) && !(self.items & 65536))) -// { -// TF_T_Damage (self, world, world, (self.max_health - self.health), 0, 256); -// } - if ((self.health < 0)) - { - T_Heal (self, (self.health - self.health), 0); - } - self.items = (self.items - (self.items & ((8192 | 16384) | 32768))); - if ((self.armortype >= 0.8)) - { - self.items = (self.items | 32768); - } - else - { - if ((self.armortype >= 0.6)) - { - self.items = (self.items | 16384); - } - else - { - if ((self.armortype >= 0.3)) - { - self.items = (self.items | 8192); - } - } - } - weapon_action(self.weapon, WR_UPDATECOUNTS); // update ammo now -}; - -// TF Get Score Frags -float (float tno) TeamFortress_TeamGetScoreFrags = -{ - if (((toggleflags & 128) || (toggleflags & 2048))) - { - if ((tno == 1)) - { - return (team1score); - } - if ((tno == 2)) - { - return (team2score); - } - if ((tno == 3)) - { - return (team3score); - } - if ((tno == 4)) - { - return (team4score); - } - } - else - { - if ((tno == 1)) - { - return (team1frags); - } - if ((tno == 2)) - { - return (team2frags); - } - if ((tno == 3)) - { - return (team3frags); - } - if ((tno == 4)) - { - return (team4frags); - } - } - return (0); -}; - -// TF Get Team Winner -float () TeamFortress_TeamGetWinner = -{ - local float i; - local float j; - local float highest; - local float highestteam; - - i = 1; - highest = 0; - highestteam = 0; - while ((i < (number_of_teams + 1))) - { - j = TeamFortress_TeamGetScoreFrags (i); - if ((j > highest)) - { - highest = j; - highestteam = i; - } - i = (i + 1); - } - return (highestteam); -}; - -// TF Score Increaser -void (float tno, float scoretoadd) TeamFortress_TeamIncreaseScore = -{ - local entity e; - - if (((tno == 0) || (scoretoadd == 0))) - { - return; - } - if ((tno == 1)) - { - team1score = (team1score + scoretoadd); - } - if ((tno == 2)) - { - team2score = (team2score + scoretoadd); - } - if ((tno == 3)) - { - team3score = (team3score + scoretoadd); - } - if ((tno == 4)) - { - team4score = (team4score + scoretoadd); - } - if (((toggleflags & 128) || (toggleflags & 2048))) - { - e = find (world, classname, "player"); - while (e) - { - if ((e.team_no == tno)) - { - e.frags = TeamFortress_TeamGetScore (tno); - } - e = find (e, classname, "player"); - } - } -}; - -// Returns Team Color Name (String) -string (float tno) TeamFortress_TeamGetColorString = -{ - local float col; - - col = TeamFortress_TeamGetColor (tno); - if ((col == 1)) - { - return ("White"); - } - if ((col == 2)) - { - return ("Brown"); - } - if ((col == 3)) - { - return ("Blue"); - } - if ((col == 4)) - { - return ("Green"); - } - if ((col == 5)) - { - return ("Red"); - } - if ((col == 6)) - { - return ("Tan"); - } - if ((col == 7)) - { - return ("Pink"); - } - if ((col == 8)) - { - return ("Orange"); - } - if ((col == 9)) - { - return ("Purple"); - } - if ((col == 10)) - { - return ("DarkPurple"); - } - if ((col == 11)) - { - return ("Grey"); - } - if ((col == 12)) - { - return ("DarkGreen"); - } - if ((col == 13)) - { - return ("Yellow"); - } - return ("DarkBlue"); -}; - -// Is civilian? -float (float tno) TeamFortress_TeamIsCivilian = -{ - local entity te; - - if ((tno == 1)) - { - if ((civilianteams & 1)) - { - return (1); - } - } - else - { - if ((tno == 2)) - { - if ((civilianteams & 2)) - { - return (1); - } - } - else - { - if ((tno == 3)) - { - if ((civilianteams & 4)) - { - return (1); - } - } - else - { - if ((civilianteams & 8)) - { - return (1); - } - } - } - } - return (0); -}; - -// Change Class -// You use a different method of handling this tho Wazat? -void () TeamFortress_ChangeClass = -{ - /*local entity spot; - local entity te; - local float tc; - local string st; - - if ((self.playerclass != 0)) - { - if (((deathmatch != 3) && (cb_prematch_time < time))) - { - return; - } - if (TeamFortress_TeamIsCivilian (self.team_no)) - { - sprint (self, "You cannot change class.\n"); - return; - } - if (!IsLegalClass ((self.impulse - 100))) - { - sprint (self, "Your team cannot play that class.\n"); - TeamFortress_DisplayLegalClasses (); - return; - } - if (((spy_off == 1) && ((self.impulse - 100) == 8))) - { - sprint (self, "The spy class has been disabled on the server by the administrator.\n"); - return; - } - self.nextpc = (self.impulse - 100); - sprint (self, "After dying, you will return as a "); - TeamFortress_PrintClassName (self, self.nextpc, (self.tfstate & 8)); - self.immune_to_check = (time + 10); - return; - } - if ((teamplay && (self.team_no == 0))) - { - if ((toggleflags & 64)) - { - if ((TeamFortress_TeamPutPlayerInTeam () == 0)) - { - return; - } - } - else - { - sprint (self, "You must join a team first. \n"); - sprint (self, "use imin1, imin2, imin3, or imin4\n"); - return; - } - } - if ((self.lives == 0)) - { - sprint (self, "You have no lives left.\n"); - return; - } - if ((!IsLegalClass ((self.impulse - 100)) && (self.impulse != 1))) - { - sprint (self, "You cannot play that playerclass on this map. \n"); - TeamFortress_DisplayLegalClasses (); - return; - } - if (((spy_off == 1) && ((self.impulse - 100) == 8))) - { - sprint (self, "The spy class has been disabled on the server by the administrator.\n"); - return; - } - if ((self.impulse != 1)) - { - self.playerclass = (self.impulse - 100); - } - else - { - self.playerclass = 11; - } - self.nextpc = 0; - self.takedamage = 2; - self.movetype = 3; - self.flags = (8 | 512); - self.waterlevel = 0; - self.air_finished = (time + 12); - self.solid = 3; - self.pausetime = 0; - spot = SelectSpawnPoint (); - self.origin = (spot.origin + '0 0 1'); - self.angles = spot.angles; - self.fixangle = 1; - setmodel (self, string_null); - modelindex_null = self.modelindex; - setmodel (self, "progs/eyes.mdl"); - modelindex_eyes = self.modelindex; - setmodel (self, "progs/player.mdl"); - modelindex_player = self.modelindex; - setsize (self, '-16 -16 -24', '16 16 32'); - self.view_ofs = '0 0 22'; - player_stand1 (); - if ((deathmatch || coop)) - { - makevectors (self.angles); - spawn_tfog ((self.origin + (v_forward * 20))); - } - if ((self.playerclass == 10)) - { - sprint (self, "Random Playerclass.\n"); - self.tfstate = (self.tfstate | 8); - self.playerclass = (1 + floor ((random () * (10 - 1)))); - } - if (((spot.classname == "info_player_teamspawn") && (cb_prematch_time < time))) - { - if ((spot.items != 0)) - { - te = Finditem (spot.items); - if (te) - { - tfgoalitem_GiveToPlayer (te, self, self); - } - if (!(spot.goal_activation & 1)) - { - spot.items = 0; - } - } - if (spot.message) - { - CenterPrint (self, spot.message); - if (!(spot.goal_activation & 2)) - { - spot.message = string_null; - } - } - if ((spot.activate_goal_no != 0)) - { - te = Findgoal (spot.activate_goal_no); - if (te) - { - AttemptToActivate (te, self, spot); - } - } - if ((spot.goal_effects == 1)) - { - spot.classname = "deadpoint"; - spot.team_str_home = string_null; - spot.nextthink = (time + 1); - spot.think = SUB_Remove; - } - } - spot = find (world, classname, "player"); - while (spot) - { - if (((spot.team_no == self.team_no) && (spot != self))) - { - sprint (spot, 2, self.netname); - sprint (spot, 2, " is playing as a "); - TeamFortress_PrintClassName (spot, self.playerclass, (self.tfstate & 8)); - } - spot = find (spot, classname, "player"); - } - TeamFortress_PrintClassName (self, self.playerclass, (self.tfstate & 8)); - TeamFortress_SetEquipment (); - TeamFortress_SetHealth (); - TeamFortress_SetSpeed (self); - TeamFortress_SetSkin (self); - if (cease_fire) - { - sprint (self, "\n\nCEASE FIRE MODE\n"); - self.immune_to_check = (time + 10); - self.tfstate = (self.tfstate | 65536); - TeamFortress_SetSpeed (self); - }*/ -}; - -// Show what class each member of the team is -- NEEDS AN IMPULSE CALL FUNCTION -void (entity Player) TeamFortress_TeamShowMemberClasses = -{ - local entity e; - local float found; - - found = 0; - e = find (world, classname, "player"); - while (e) - { - if ((((e.team_no == Player.team_no) || (e.team_no == 0)) && (e != Player))) - { - if ((e.model != string_null)) - { - if (!found) - { - found = 1; - sprint (self, "The other members of your team are:\n"); - } - sprint (Player, e.netname); - sprint (Player, " : "); -// TeamFortress_PrintClassName (Player, e.playerclass, (e.tfstate & 8)); - TeamFortress_PrintClassName (Player, e.class, (e.tfstate & 8)); - } - } - e = find (e, classname, "player"); - } - if (!found) - { - sprint (Player, "There are no other players on your team.\n"); - } -}; - -// Returns class name value -string (float pc) TeamFortress_GetClassName = -{ - if ((pc == 1)) // Scout is class 1 (normal) - { - return ("Scout"); - } - else - { - if ((pc == 2.1)) - { - return ("Sniper"); // Player Class 2 is Spy in NexTF -- no Snipers - } - else - { - if ((pc == 4)) // Player Class 4 is soldier in NexTF - { - return ("Soldier"); - } - else - { - if ((pc == 4.1)) // No DemoMan in NexTF - { - return ("Demolitions Man"); - } - else - { - if ((pc == 16)) - { - return ("Combat Medic"); // Medic is Class 16 in NexTF - } - else - { - if ((pc == 6.1)) - { - return ("Heavy Weapons Guy"); // No HWGuy in NexTF - } - else - { - if ((pc == 8)) - { - return ("Pyro"); // Pyro is class 8 in NexTF - } - else - { - if ((pc == 2)) - { - return ("Spy"); // Spy is class 2 in NexTF - } - else - { - if ((pc == 32)) - { - return ("Engineer"); // Engineer is class 32 in nextf - } - else - { - if ((pc == 11)) // Wazat- we need to make civ class - { - return ("Civilian"); - } - else - { - if ((pc == 0)) - { - return ("Observer"); - } - else - { - if ((pc == 10)) // Wazat- we need to add "random class" feature - { - return ("Random Playerclass"); - } - } - } - } - } - } - } - } - } - } - } - } -}; - -// Prints the classname using TeamFortress_GetClassName function -void (entity Viewer, float pc, float rpc) TeamFortress_PrintClassName = -{ - local string st; - - st = TeamFortress_GetClassName (pc); - sprint (Viewer, st); - if ((rpc != 0)) - { - sprint (Viewer, " (Random)"); - } - sprint (Viewer, "\n"); -}; - -// Returns Team Color Value -// This is causing crashes in bringit -- I will attempt to fix -float (float tno) TeamFortress_TeamGetColor = -{ - if ((tno == 1)) - { - return (14); - } - if ((tno == 2)) - { - return (5); - } - if ((tno == 3)) - { - return (13); - } - if ((tno == 4)) - { - return (12); - } - return (0); -}; - -// Returns Team Score Value -float (float tno) TeamFortress_TeamGetScore = -{ - if ((tno == 1)) - { - return (team1score); - } - if ((tno == 2)) - { - return (team2score); - } - if ((tno == 3)) - { - return (team3score); - } - if ((tno == 4)) - { - return (team4score); - } - return (0); -}; - -// Get Team Lives -float (float tno) TeamFortress_TeamGetLives = -{ - if ((tno == 1)) - { - return (team1lives); - } - if ((tno == 2)) - { - return (team2lives); - } - if ((tno == 3)) - { - return (team3lives); - } - if ((tno == 4)) - { - return (team4lives); - } - return (0); -}; - -// Show Team Scores -void (float all) TeamFortress_TeamShowScores = -{ - local string st; - local float i; - local float j; - - i = 1; - if ((all == 2)) - { - while ((i <= number_of_teams)) - { - if ((TeamFortress_TeamGetColor (i) > 0)) - { - j = TeamFortress_TeamGetScore (i); - st = TeamFortress_TeamGetColorString (i); -// bprint (st); -// bprint (": "); - bprint (st); - bprint (": "); - st = ftos (j); - //bprint (st); - //bprint (" "); - bprint (st); - bprint (" "); - } - i = (i + 1); - } -// bprint ("\n"); - bprint ("\n"); - return; - } - while ((i <= number_of_teams)) - { - if ((TeamFortress_TeamGetColor (i) > 0)) - { - if (all) - { - bprint ("Team "); - } - else - { - sprint (self, "Team "); - } - st = ftos (i); - if (all) - { - bprint (st); - } - else - { - sprint (self, st); - } - if (all) - { - bprint (" ("); - } - else - { - sprint (self, " ("); - } - st = TeamFortress_TeamGetColorString (i); - if (all) - { - bprint (st); - } - else - { - sprint (self, st); - } - if (all) - { - bprint (") : "); - } - else - { - sprint (self, ") : "); - } - j = TeamFortress_TeamGetScore (i); - st = ftos (j); - if (all) - { - bprint (st); - } - else - { - sprint (self, st); - } - if (all) - { - bprint ("\n"); - } - else - { - sprint (self, "\n"); - } - } - i = (i + 1); - } -}; - -// Get Number Of Players On Team -float (float tno) TeamFortress_TeamGetNoPlayers = -{ - local float size_team; - local entity search; - - search = find (world, classname, "player"); - while ((search != world)) - { - if ((search.team_no == tno)) - { - size_team = (size_team + 1); - } - search = find (search, classname, "player"); - } - return (size_team); -}; - -// Get general number of players -float () TeamFortress_GetNoPlayers = -{ - local float nump; - local entity search; - - search = find (world, classname, "player"); - while ((search != world)) - { - if ((search.netname != string_null)) - { - nump = (nump + 1); - } - search = find (search, classname, "player"); - } - return (nump); -}; - -// Get max players for a team -float (float tno) TeamFortress_TeamGetMaxPlayers = -{ - if ((tno == 1)) - { - return (team1maxplayers); - } - if ((tno == 2)) - { - return (team2maxplayers); - } - if ((tno == 3)) - { - return (team3maxplayers); - } - if ((tno == 4)) - { - return (team4maxplayers); - } - return (0); -}; - -// Set The Team Color -void (float tno) TeamFortress_TeamSetColor = -{ - if ((tno == 1)) - { - team1col = 14; - return; - } - if ((tno == 2)) - { - team2col = 5; - return; - } - if ((tno == 3)) - { - team3col = 13; - return; - } - if ((tno == 4)) - { - team4col = 12; - return; - } -}; - -// Set The Team Number -float (float tno) TeamFortress_TeamSet = -{ - local string st; - local float tc; - - if ((teamplay < 1)) - { - sprint (self, "Teamplay is not On, so FortressTeams are inactive.\n"); - return (0); - } - if (((tno > number_of_teams) && (number_of_teams != 0))) - { - sprint (self, "There can be only "); - st = ftos (number_of_teams); - sprint (self, st); - sprint (self, " teams on this map.\nTry again\n"); - return (0); - } - if ((self.team_no > 0)) - { - sprint (self, "You're already in Team No "); - st = ftos (self.team_no); - sprint (self, st); - sprint (self, ".\n"); - return (0); - } - tc = TeamFortress_TeamGetNoPlayers (tno); - if ((tc >= TeamFortress_TeamGetMaxPlayers (tno))) - { - sprint (self, "That team is full. Pick another.\n"); - return (0); - } - if ((TeamFortress_TeamGetColor (tno) == 0)) - { - TeamFortress_TeamSetColor (tno); - if ((TeamFortress_TeamGetColor (tno) == 0)) - { - sprint (self, "You can't start a new team with your color, since another "); - sprint (self, "already using that color. Change your pants color, then try again.\n"); - return (0); - } - bprint (self.netname); - bprint (" has started Team No "); - st = ftos (tno); - bprint (st); - bprint (".\n"); - self.immune_to_check = (time + 10); - if (((toggleflags & 128) || (toggleflags & 2048))) - { - self.frags = TeamFortress_TeamGetScore (tno); - } - stuffcmd (self, "color "); - tc = (TeamFortress_TeamGetColor (tno) - 1); - st = ftos (tc); - stuffcmd (self, st); - stuffcmd (self, "\n"); - self.team_no = tno; - self.lives = TeamFortress_TeamGetLives (tno); - //if ((self.playerclass == 0)) - if ((self.class == 0)) - { - if (TeamFortress_TeamIsCivilian (self.team_no)) - { - self.impulse = 1; - TeamFortress_ChangeClass (); - } - } - return (1); - } - bprint (self.netname); - bprint (" has joined Team No "); - st = ftos (tno); - bprint (st); - bprint (".\n"); - stuffcmd (self, "color "); - tc = (TeamFortress_TeamGetColor (tno) - 1); - st = ftos (tc); - stuffcmd (self, st); - stuffcmd (self, "\n"); - self.team_no = tno; - self.immune_to_check = (time + 10); - self.lives = TeamFortress_TeamGetLives (tno); - if (((toggleflags & 128) || (toggleflags & 2048))) - { - self.frags = TeamFortress_TeamGetScore (tno); - } - TeamFortress_TeamShowMemberClasses (self); - //if ((self.playerclass == 0)) - if ((self.class == 0)) - { - if (TeamFortress_TeamIsCivilian (self.team_no)) - { - self.impulse = 1; - TeamFortress_ChangeClass (); - } - } - return (1); -}; - -// Get team score (used in conjunction with autoteam..) -float (float tno) TeamFortress_GetRealScore = -{ - local entity te; - local float total; - - te = find (world, classname, "player"); - while (te) - { - if (te.team_no == tno) - { - total = total + te.real_frags; - } - te = find (te, classname, "player"); - } - return total; -} - -// Find best team for player (autoteam?) -float() TeamFortress_TeamPutPlayerInTeam = -{ - local float i; - local float j; - local float score1; - local float score2; - - local float lowest; - local float likely_team; - - i = 1; - likely_team = random() * number_of_teams; - likely_team = ceil(likely_team); - if (likely_team == 0) - { - likely_team = number_of_teams; - } - - lowest = 33; - while (i < number_of_teams + 1) - { - j = TeamFortress_TeamGetNoPlayers(i); - - if (j < lowest) - { - if (TeamFortress_TeamGetMaxPlayers(i) > j) - { - lowest = j; - likely_team = i; - } - } - // pablo. fancier autoteam for even teams. - else if (j == lowest) - { - - if (TeamFortress_TeamGetMaxPlayers(i) > j) - { - score1 = TeamFortress_GetRealScore(i); - score2 = TeamFortress_GetRealScore(likely_team); - - if ( score1 < score2 ) - { - likely_team = i; - } - else if (score1 == score2) - { - if (random() > 0.5) - { - likely_team = i; - } - } - } - } - // - i = i + 1; - } - return TeamFortress_TeamSet(likely_team); -}; - -// Remove item_tfgoal timers -void() TeamFortress_RemoveTimers = -{ - local entity te; -// self.leg_damage = 0; // No Snipers -// self.is_undercover = 0; // I think this function is called in PlayerKill -// self.is_building = 0; // To Be Added ? -// self.building = world; // To Be Added ? - if (self.tfstate & 2048) - { - self.tfstate = self.tfstate - 2048; - TeamFortress_SetSpeed(self); - self.heat = 0; - } - te = find(world, classname, "timer"); - while (te != world) - { - if (te.owner == self) - { - dremove(te); - te = find(world, classname, "timer"); - } - else - { - te = find(te, classname, "timer"); - } - } - te = find(world, classname, "item_tfgoal"); - while (te) - { - if (te.owner == self) - { - if (!(te.goal_activation & 256)) - { - tfgoalitem_RemoveFromPlayer(te, self, 0); - } - if (CTF_Map == 1 && te.goal_no == 1) - { - bprint(self.netname); - bprint(" ÌÏÓÔ the ÂÌÕÅ flag!\n"); - } - else - { - if (CTF_Map == 1 && te.goal_no == 2) - { - bprint(self.netname); - bprint(" ÌÏÓÔ the ÒÅÄ flag!\n"); - } - } - } - te = find(te, classname, "item_tfgoal"); - } - te = find(world, classname, "detpack"); - while (te) - { - if (te.weaponmode == 1 && te.enemy == self) - { - te.weaponmode = 0; - } - te = find(te, classname, "detpack"); - } -// TeamFortress_DetonatePipebombs(); gold. this is the old code for removing pipebombs on quitting. new one written by pablo is below. - // NO PIPEBOMBS IN NEXTF -/* te = find(world, classname, "pipebomb"); - while (te != world) - { - if(te.owner == self) - { - decrement_team_pipebombs(self.team_no); - deathmsg = te.weapon; - te.weapon = 10; - T_RadiusDamage(te, self, 120, world); - WriteByte(4, 23); - WriteByte(4, 3); - WriteCoord(4, te.origin_x); - WriteCoord(4, te.origin_y); - WriteCoord(4, te.origin_z); - multicast(te.origin, TF_FLARE_OFF); - dremove(te); - } - te = find(te, classname, "pipebomb"); - }*/ -// stuffcmd(self, "v_idlescale 0\n"); -// stuffcmd(self, "v_cshift 0 0 0 0\n"); -// self.item_list = 0; // To Be Added? -// self.FlashTime = 0; - CenterPrint(self, "\n"); - self.menu_count = 25; // Menu Stuff - important - self.current_menu = 1; //// - self.impulse = 0; -}; - -// TF's Become Explosion -void() BecomeExplosion = -{ - dremove(self); -}; - -// TF Alias Maker -void(string halias, float himpulse1, float himpulse2) TeamFortress_Alias = -{ - local string imp; - stuffcmd(self, "alias "); - stuffcmd(self, halias); - stuffcmd(self, " \"impulse "); - imp = ftos(himpulse1); - stuffcmd(self, imp); - if (himpulse2 != 0) - { - stuffcmd(self, ";wait; impulse "); - imp = ftos(himpulse2); - stuffcmd(self, imp); - } - stuffcmd(self, "\"\n"); -}; - -// XavioR's new TF reload function -void (float o, float m, void () g) weapon_thinkf; -void () Reload_Restore_Weapon = -{ - self.owner.weaponentity.pos1 = '0 0 0'; - self.owner.weaponentity.lip = PLAYER_WEAPONSELECTION_SPEED; - dremove(self); -}; - -void (float rweapon, float amount) DoReload = -{ - local float rtime; - - if (self.reload_time > time) - return; - if (amount == 0) - return; - - weapon_action(self.weapon, WR_UPDATECOUNTS); // update ammo now - sprint(self, "Reloading...\n"); - if (rweapon == 2) // CryLink (flak cannon) - { - rtime = (amount * .80); - self.clip_crylink = CLIP_MAX_CRYLINK; - } - if (rweapon == 3) // Rocket launcher - { - rtime = (amount * 1.30); - self.clip_rockets = 4; - } - if (rweapon == 4) // Pipe Grenade Launcher - { - rtime = (amount * 1.05); - self.clip_pipegrenades = 6; - } - - self.weaponentity.pos1 = PLAYER_WEAPONSELECTION_RANGE; - self.weaponentity.lip = PLAYER_WEAPONSELECTION_SPEED; - newmis = spawn(); - newmis.owner = self; - newmis.think = Reload_Restore_Weapon; - newmis.nextthink = time + rtime; - self.reload_time = time + rtime; -}; - -// CENTERPRINT -void (entity pl, string s1, string s2) CenterPrint2 = -{ - centerprint (pl, s1, s2); - pl.StatusRefreshTime = (time + 1.5); -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/tfgrenades.c b/TeamNexuiz/game/gamec/tfgrenades.c deleted file mode 100644 index dcbae33d5..000000000 --- a/TeamNexuiz/game/gamec/tfgrenades.c +++ /dev/null @@ -1,712 +0,0 @@ -entity msg_entity; -void () TeamFortress_GrenadePrimed; -.float grenade_timer; -void () CP_Timer; - -// TF Recoil? Anyhoo, this entity causes oddities :/ -void(float psize, entity p) KickPlayer = -{ - return; // temp - msg_entity = p; - if (psize > -3) - { - WriteByte(1, 34); - } - else - { - WriteByte(1, 35); - } -}; - -void() TeamFortress_ExplodePerson = -{ - local entity te; - self.owner.tfstate = self.owner.tfstate - (self.owner.tfstate & 1); - KickPlayer(-2, self.owner); // Doesnt wanna work right - newmis = spawn(); - newmis.movetype = 10; - newmis.solid = 2; - newmis.classname = "grenade"; - newmis.team_no = self.owner.team_no; - newmis.owner = self.owner; - newmis.velocity = '0 0 0'; - newmis.angles = vectoangles(newmis.velocity); - newmis.think = SUB_Null; -// newmis.think = NormalGrenadeExplode; - newmis.nextthink = time + 0.1; -// if (self.weapon == 1) -// { - newmis.touch = NormalGrenadeTouch; - newmis.think = NormalGrenadeExplode; - newmis.skin = 0; - newmis.avelocity = '300 300 300'; - self.owner.velocity = (((v_forward * 900) + '0 0 250') + (v_up * 100)); // Shoot the player hehe -// setmodel(newmis, "progs/hgren2.mdl"); - setmodel(newmis, "models/grenades/fragnade.md3"); - -// } -/* else - { - if (self.weapon == 2) - { - newmis.touch = ConcussionGrenadeTouch; - newmis.think = ConcussionGrenadeExplode; - newmis.skin = 1; - newmis.avelocity = '300 300 300'; - setmodel(newmis, "progs/hgren2.mdl"); - } - else - { - if (self.weapon == 3) - { - newmis.touch = NailGrenadeTouch; - newmis.think = NailGrenadeExplode; - newmis.skin = 1; - newmis.avelocity = '0 300 0'; - setmodel(newmis, "progs/biggren.mdl"); - } - else - { - if (self.weapon == 4) - { - newmis.touch = MirvGrenadeTouch; - newmis.think = MirvGrenadeExplode; - newmis.skin = 0; - newmis.avelocity = '0 300 0'; - setmodel(newmis, "progs/biggren.mdl"); - } - else - { - if (self.weapon == 5) - { - newmis.touch = NapalmGrenadeTouch; - newmis.think = NapalmGrenadeExplode; - newmis.skin = 2; - newmis.avelocity = '0 300 0'; - setmodel(newmis, "progs/biggren.mdl"); - } - else - { - if (self.weapon == 6) - { - sprint(self.owner, 2, "Flare lit.\n"); - te = spawn(); - te.touch = SUB_Null; - te.think = RemoveFlare; - te.nextthink = time + 25; - te.owner = self.owner; - te.solid = 0; - self.owner.effects = self.owner.effects | 4; - dremove(self); - dremove(newmis); - return; - } - else - { - if (self.weapon == 7) - { - newmis.touch = GasGrenadeTouch; - newmis.think = GasGrenadeExplode; - newmis.skin = 2; - newmis.avelocity = '300 300 300'; - setmodel(newmis, "progs/grenade2.mdl"); - } - else - { - if (self.weapon == 8) - { - newmis.touch = EMPGrenadeTouch; - newmis.think = EMPGrenadeExplode; - newmis.skin = 4; - newmis.avelocity = '300 300 300'; - setmodel(newmis, "progs/grenade2.mdl"); - } - else - { - if (self.weapon == 9) - { - newmis.touch = FlashGrenadeTouch; - newmis.think = FlashGrenadeExplode; - newmis.skin = 1; - newmis.avelocity = '300 300 300'; - setmodel(newmis, "progs/grenade2.mdl"); - } - } - } - } - } - } - } - } - }*/ - setsize(newmis, '0 0 0', '0 0 0'); - setorigin(newmis, self.owner.origin); - bprint("No "); - bprint(self.owner.netname); - bprint(", throw the grenade, not the pin!\n"); - dremove(self); -}; - -void() NormalGrenadeTouch = -{ - if (other == self.owner) - { - return; - } - sound(self, 1, "weapons/bounce.wav", 1, 1); - if (self.velocity == '0 0 0') - { - self.avelocity = '0 0 0'; - } -}; - -void () NormalGrenadeExplode = -{ - deathmsg = 88; - T_RadiusDamage (self, self.owner, 180, world); - WriteByte (0, 23); - WriteByte (0, 3); - WriteCoord (0, self.origin_x); - WriteCoord (0, self.origin_y); - WriteCoord (0, self.origin_z); - BecomeExplosion (); -}; - -// TF Prime Grenade Function -void () TeamFortress_PrimeGrenade = -{ - local float gtype; - local string gs; - local string ptime; - local entity tGrenade; - - if (((self.tfstate & 1) || (self.tfstate & 1024))) - { - return; - } - if ((self.impulse == 150)) - { - gtype = self.tp_grenades_1; - /* - if ((self.tp_grenades_1 == 2)) - { - gs = "Concussion grenade"; - } - else - { - if ((self.tp_grenades_1 == 3)) - { - gs = "Nail grenade"; - } - else - { - if ((self.tp_grenades_1 == 4)) - { - gs = "Mirv grenade"; - } - else - { - if ((self.tp_grenades_1 == 5)) - { - gs = "Napalm grenade"; - } - else - { - if ((self.tp_grenades_1 == 6)) - { - gs = "Flare"; - } - else - { - if ((self.tp_grenades_1 == 7)) - { - gs = "Gas grenade"; - } - else - { - if ((self.tp_grenades_1 == 8)) - { - gs = "EMP grenade"; - } - else - { - if ((self.tp_grenades_1 == 10)) - { - gs = "Caltrop canister"; - } - else - { - if ((self.tp_grenades_1 == 9)) - { - gs = "Flash grenade"; - } - else - { - gs = "Grenade"; - } - } - } - } - } - } - } - } - }*/ - gs = "Grenade"; - - if ((self.no_grenades_1 > 0)) - { - self.no_grenades_1 = (self.no_grenades_1 - 1); - /*if ((gtype == 6)) - { - newmis = spawn (); - newmis.owner = self; - newmis.movetype = 6; - newmis.solid = 2; - newmis.classname = "grenade"; - makevectors (self.v_angle); - newmis.velocity = ((v_forward * 600) + (v_up * 25)); - newmis.velocity = (newmis.velocity * 700); - newmis.angles = vectoangles (newmis.velocity); - newmis.weapon = self.team_no; - newmis.think = FlareGrenadeExplode; - newmis.nextthink = (time + 0.8); - newmis.touch = FlareGrenadeTouch; - newmis.skin = 1; - newmis.mdl = "flare"; - setmodel (newmis, "progs/flare.mdl"); - setsize (newmis, '0 0 0', '0 0 0'); - setorigin (newmis, self.origin); - return; - }*/ - if ((gtype == 10)) - { - ptime = ftos (0.5); - sprint (self, "Opening "); - sprint (self, gs); - sprint (self, "...\n"); - } - else - { - sound (self, CHAN_WEAPON, "weapons/prime.wav", 1, ATTN_STATIC); - stuffcmd (self, "play weapons/gren.wav\n"); - ptime = ftos (3); - sprint (self, gs); - sprint (self, " primed, "); - sprint (self, ptime); - sprint (self, " seconds...\n"); - } - } - else - { - sprint (self, "No "); - sprint (self, gs); - sprint (self, "s left.\n"); - return; - } - } -/* if ((self.impulse == 151)) - { - gtype = self.tp_grenades_2; - if ((self.tp_grenades_2 == 2)) - { - gs = "Concussion grenade"; - } - else - { - if ((self.tp_grenades_2 == 3)) - { - gs = "Nail grenade"; - } - else - { - if ((self.tp_grenades_2 == 4)) - { - gs = "Mirv grenade"; - } - else - { - if ((self.tp_grenades_2 == 5)) - { - gs = "Napalm grenade"; - } - else - { - if ((self.tp_grenades_2 == 6)) - { - gs = "Flare"; - } - else - { - if ((self.tp_grenades_2 == 7)) - { - gs = "Gas grenade"; - } - else - { - if ((self.tp_grenades_2 == 8)) - { - gs = "EMP grenade"; - } - else - { - if ((self.tp_grenades_2 == 9)) - { - gs = "Flash grenade"; - } - else - { - gs = "Grenade"; - } - } - } - } - } - } - } - } - if ((self.no_grenades_2 > 0)) - { - self.no_grenades_2 = (self.no_grenades_2 - 1); - if ((gtype == 6)) - { - newmis = spawn (); - newmis.owner = self; - newmis.movetype = 6; - newmis.solid = 2; - newmis.classname = "grenade"; - makevectors (self.v_angle); - if (self.v_angle_x) - { - newmis.velocity = ((v_forward * 1200) + (v_up * 200)); - } - else - { - newmis.velocity = aim (self, 10000); - newmis.velocity = (newmis.velocity * 1200); - newmis.velocity_z = 75; - } - newmis.angles = vectoangles (newmis.velocity); - newmis.weapon = self.team_no; - newmis.think = FlareGrenadeExplode; - newmis.nextthink = (time + 0.8); - newmis.touch = FlareGrenadeTouch; - newmis.skin = 1; - newmis.mdl = "flare"; - setmodel (newmis, "progs/flare.mdl"); - setsize (newmis, '0 0 0', '0 0 0'); - setorigin (newmis, self.origin); - return; - } - if ((gtype == 10)) - { - ptime = ftos (0.5); - sprint (self, 2, "Opening "); - sprint (self, 2, gs); - sprint (self, 2, "...\n"); - } - else - { - ptime = ftos (3); - sprint (self, 2, gs); - sprint (self, 2, " primed, "); - sprint (self, 2, ptime); - sprint (self, 2, " seconds...\n"); - } - } - else - { - sprint (self, 2, "No "); - sprint (self, 2, gs); - sprint (self, 2, "s left.\n"); - return; - } - }*/ - self.tfstate = (self.tfstate | 1); - tGrenade = spawn (); - tGrenade.owner = self; - tGrenade.weapon = gtype; - tGrenade.classname = "primer"; - tGrenade.impulse = self.impulse; - tGrenade.nextthink = (time + 0.8); - tGrenade.heat = time + 4; - -/* // Make Centerprint timer // Taken out due to the fact that the function sucked - newmis = spawn (); - newmis.owner = self; - newmis.classname = "primedtimer"; - newmis.think = CP_Timer; - newmis.nextthink = (time); - self.grenade_timer = time; */ - /*if ((gtype == 10)) - { - tGrenade.heat = ((time + 0.5) + 0.5); - } - else - { - tGrenade.heat = ((time + 3) + 0.8); - }*/ - tGrenade.think = TeamFortress_GrenadePrimed; -}; - -void () TeamFortress_GrenadePrimed = -{ - local entity user; - local entity oldself; - - user = self.owner; - if ((!(user.tfstate & 1024) && !user.deadflag)) - { - self.nextthink = (time + 0.1); - if (!self.think) - { - dremove (self); - } - if ((time > self.heat)) - { - TeamFortress_ExplodePerson (); - } - return; - } - if (!(user.tfstate & 1)) - { - dprint ("GrenadePrimed logic error\n"); - } - user.tfstate = (user.tfstate - (user.tfstate & 1)); - user.tfstate = (user.tfstate - (user.tfstate & 1024)); -// sound (user, 1, "weapons/grenade.wav", 1, 1); - KickPlayer (-1, user); - newmis = spawn (); - newmis.owner = user; - newmis.movetype = 10; - newmis.solid = 2; - newmis.classname = "grenade"; - makevectors (user.v_angle); - if (user.deadflag) - { - newmis.velocity = '0 0 200'; - } - else - { - if (user.v_angle_x) - { - newmis.velocity = ((((v_forward * 600) + (v_up * 200)) + ((crandom () * v_right) * 10)) + ((crandom () * v_up) * 10)); - } - else - { - newmis.velocity = aim (user, 10000); - newmis.velocity = (newmis.velocity * 600); - newmis.velocity_z = 200; - } - } - newmis.angles = vectoangles (newmis.velocity); - newmis.think = SUB_Null; - newmis.nextthink = self.heat; -// if ((self.weapon == 1)) -// { - newmis.touch = NormalGrenadeTouch; - newmis.think = NormalGrenadeExplode; - newmis.skin = 0; - newmis.avelocity = '300 300 300'; -// setmodel (newmis, "progs/hgren2.mdl"); - setmodel(newmis, "models/grenades/fragnade.md3"); -// } -/* else - { - if ((self.weapon == 2)) - { - newmis.touch = ConcussionGrenadeTouch; - newmis.think = ConcussionGrenadeExplode; - newmis.skin = 1; - newmis.avelocity = '300 300 300'; - setmodel (newmis, "progs/hgren2.mdl"); - } - else - { - if ((self.weapon == 3)) - { - newmis.touch = NailGrenadeTouch; - newmis.think = NailGrenadeExplode; - newmis.skin = 1; - newmis.avelocity = '0 300 0'; - setmodel (newmis, "progs/biggren.mdl"); - } - else - { - if ((self.weapon == 4)) - { - newmis.touch = MirvGrenadeTouch; - newmis.think = MirvGrenadeExplode; - newmis.skin = 0; - newmis.avelocity = '0 300 0'; - setmodel (newmis, "progs/biggren.mdl"); - } - else - { - if ((self.weapon == 5)) - { - newmis.touch = NapalmGrenadeTouch; - newmis.think = NapalmGrenadeExplode; - newmis.skin = 2; - newmis.avelocity = '0 300 0'; - setmodel (newmis, "progs/biggren.mdl"); - } - else - { - if ((self.weapon == 6)) - { - newmis.touch = FlareGrenadeTouch; - newmis.weapon = self.team_no; - newmis.think = FlareGrenadeExplode; - newmis.skin = 1; - newmis.avelocity = '300 300 300'; - newmis.mdl = "flare"; - setmodel (newmis, "progs/flare.mdl"); - } - else - { - if ((self.weapon == 7)) - { - newmis.touch = GasGrenadeTouch; - newmis.think = GasGrenadeExplode; - newmis.skin = 3; - newmis.avelocity = '300 300 300'; - setmodel (newmis, "progs/grenade2.mdl"); - } - else - { - if ((self.weapon == 8)) - { - newmis.touch = EMPGrenadeTouch; - newmis.think = EMPGrenadeExplode; - newmis.skin = 4; - newmis.avelocity = '300 300 300'; - setmodel (newmis, "progs/grenade2.mdl"); - } - else - { - if ((self.weapon == 10)) - { - newmis.touch = CanisterTouch; - newmis.think = ScatterCaltrops; - newmis.skin = 0; - newmis.avelocity = '0 0 0'; - } - else - { - if ((self.weapon == 9)) - { - newmis.touch = FlashGrenadeTouch; - newmis.think = FlashGrenadeExplode; - newmis.skin = 2; - newmis.avelocity = '300 300 300'; - setmodel (newmis, "progs/hgren2.mdl"); - } - } - } - } - } - } - } - } - } - }*/ - setsize (newmis, '0 0 0', '0 0 0'); - setorigin (newmis, user.origin); - oldself = self; - self = self.owner; - self = oldself; - dremove (self); -}; - -void () TeamFortress_ThrowGrenade = -{ - if (!(self.tfstate & 1)) - { - return; - } - sound(self, 3, "weapons/throw.wav", 1, 1); - self.tfstate = (self.tfstate | 1024); -}; - -// TF Grenade CenterPrint Timer - it sucks so I took it out:x -void () CP_Timer = -{ - local float countdown; - - countdown = (time - self.owner.grenade_timer); - - if (countdown > 0) - { - CenterPrint (self.owner, "^7€‚^1\n"); - } - if (countdown > .25) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > .5) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > .75) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > 1) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > 1.25) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > 1.5) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > 1.75) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > 2) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > 2.25) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > 2.5) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > 2.75) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > 3) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > 3.25) - { - CenterPrint (self.owner, "^1€^7‚\n"); - } - if (countdown > 3.5) - { - CenterPrint (self.owner, "^1€‚^7\n"); - } - if (countdown > 3.75) - { - CenterPrint (self.owner, "^3€‚^7\n"); - } - if (countdown > 4) - { - CenterPrint (self.owner, "\n"); - dremove(self); - } - else - { - self.nextthink = (time + .25); - } -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/tfitems.c b/TeamNexuiz/game/gamec/tfitems.c deleted file mode 100644 index 04dfb00f3..000000000 --- a/TeamNexuiz/game/gamec/tfitems.c +++ /dev/null @@ -1,40 +0,0 @@ -float (entity e, float healamount, float ignore) T_Heal = -{ - if ((e.health <= 0)) - { - return (0); - } - if ((!ignore && (e.health >= e.max_health))) - { - return (0); - } - healamount = ceil (healamount); - e.health = (e.health + healamount); - if ((!ignore && (e.health >= e.max_health))) - { - e.health = e.max_health; - } - if ((e.health > 250)) - { - - e.health = 250; - } - /* // There are no snipers in NexTF - if (e.leg_damage) - { - if ((e.health > 95)) - { - e.leg_damage = 0; - } - else - { - e.leg_damage = (e.leg_damage - ceil ((e.health / 20))); - } - if ((e.leg_damage < 1)) - { - e.leg_damage = 0; - } - TeamFortress_SetSpeed (e); - }*/ - return (1); -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/tfmapitems.c b/TeamNexuiz/game/gamec/tfmapitems.c deleted file mode 100644 index 5da8dc3ac..000000000 --- a/TeamNexuiz/game/gamec/tfmapitems.c +++ /dev/null @@ -1,3089 +0,0 @@ -/**************** - XavioR's Team Fortress Map Entities conversion - ************/ -/* -// Things needed to be added (probably): -prematch -*/ - -// Goal stuff - - -.float if_item_has_moved; -.float if_item_hasnt_moved; -.float remove_spawnpoint; -.float restore_spawnpoint; -.float remove_spawngroup; -.float restore_spawngroup; -.float display_item_status1; -.float display_item_status2; -.float display_item_status3; -.float display_item_status4; -.string team_str_home; -.string team_str_moved; -.string team_str_carried; -.string non_team_str_home; -.string non_team_str_moved; -.string non_team_str_carried; -.float ex_skill_min; -.float ex_skill_max; -.float increase_team1; -.float increase_team2; -.float increase_team3; -.float increase_team4; - - -// Temp defs that need to be moved to TFDefs -.string broadcast; -.string team_broadcast; -.string non_team_broadcast; -.string owners_team_broadcast; -.string netname_broadcast; -.string netname_team_broadcast; -.string netname_non_team_broadcast; -.string netname_owners_team_broadcast; -.string team_drop; -.string non_team_drop; -.string netname_team_drop; -.string netname_non_team_drop; -string team_menu_string/* = ""*/; -.float all_active; -.float item_list; -float item_list_bit; -.float delay_time; -.float dont_do_triggerwork; -.float g_a; -.float g_e; -.string t_s_h; -.string t_s_m; -.string t_s_c; -.string n_s_h; -.string n_s_m; -.string n_s_c; -.string b_b; -.string b_t; -.string b_n; -.string b_o; -.string n_b; -.string n_t; -.string n_n; -.string n_o; -.string d_t; -.string d_n; -.string d_n_t; -.string d_n_n; -float illegalclasses/* = 0*/; -float illegalclasses1; -float illegalclasses2; -float illegalclasses3; -float illegalclasses4; -float civilianteams; - -// Temp defs that need functions -float prematch; - - -.float h_i_g, r_i_g, a_s, a_n, a_r, a_c, rv_s_h, rs_s_h, rv_gr, rs_gr, rs_g; -.float rv_g; -.vector goal_min, goal_max; - -.entity tent; - -// Prototypes -// Team Functions -void(float tno, float scoretoadd) TeamFortress_TeamIncreaseScore; -void(float all) TeamFortress_TeamShowScores; -float() TeamFortress_TeamGetWinner; - -// Functions to handle entity placement when spawned -void() TF_PlaceItem; -void() TF_StartItem; -void() TF_PlaceGoal; -void() TF_StartGoal; - -// Spawn functions for all Map Entities -float() CheckExistence; -void() info_tfdetect; -void() info_player_teamspawn; -void() info_tfgoal; -void() info_tfgoal_timer; -void() item_tfgoal; - -// AutoDetection Function -void(entity AD) ParseTFDetect; - -// Generic Functions -entity(float ino) Finditem; -entity(float gno) Findgoal; -entity(float gno) Findteamspawn; -void(entity Goal) InactivateGoal; -void(entity Goal) RestoreGoal; -void(entity Goal) RemoveGoal; -float(entity Goal, entity Player, entity AP) IsAffectedBy; -//void(entity Goal, entity Player, entity AP, float addb) Apply_Results; -//float(entity Goal, entity AP) APMeetsCriteria; -void(entity Goal) SetupRespawn; -void() DoRespawn; -void(entity Goal, entity AP) DoGoalWork; -void(entity Goal, entity AP) DoGroupWork; -void(entity Item, entity AP) DoItemGroupWork; -void(entity Goal, entity AP) DoTriggerWork; -void(entity Goal, entity AP, float addb) DoResults; -//void(entity Goal, entity Player) RemoveResults; - -// Goal Functions -void() tfgoal_touch; -void() info_tfgoal_use; - -// Timer Goal Functions -void() tfgoal_timer_tick; - -// Item Functions -void() item_tfgoal_touch; -void(entity Item, entity AP, entity Goal) tfgoalitem_GiveToPlayer; -void(entity Item, entity AP, float method) tfgoalitem_RemoveFromPlayer; -void() tfgoalitem_remove; -void(entity Item) tfgoalitem_drop; -void(entity Item) tfgoalitem_checkgoalreturn; -void() ReturnItem; -void(entity Goal, entity Player, entity Item) DisplayItemStatus; - -// CTF Support Functions -void() CTF_FlagCheck; - - -void () TF_PlaceItem; -void () TF_StartItem; -void () TF_PlaceGoal; -void () TF_StartGoal; -//void () TF_PlaceCamp; -//void () TF_StartCamp; -void () info_tfdetect; -//void () info_tfnocamp; -void () info_player_teamspawn; -void () info_tfgoal; -void () info_tfgoal_timer; -void () item_tfgoal; -entity (float gno) Findgoal; -entity (float gno) Findteamspawn; -void (entity Goal) InactivateGoal; -void (entity Goal) RestoreGoal; -void (entity Goal) RemoveGoal; -float (entity Goal,entity Player,entity AP) IsAffectedBy; -void (entity Goal,entity Player,entity AP,float addb) Apply_Results; -float (entity Goal,entity AP) APMeetsCriteria; -void (entity Goal) SetupRespawn; -void () DoRespawn; -void (entity Item,entity AP) DoItemGroupWork; -void (entity Goal,entity AP) DoTriggerWork; -void (entity Goal,entity Player) RemoveResults; -void () info_tfgoal_use; -void () tfgoal_timer_tick; -void () item_tfgoal_touch; -void () tfgoalitem_remove; -void (entity Item) tfgoalitem_drop; -void (entity Item) tfgoalitem_checkgoalreturn; -void () ReturnItem; - - -void() MoveFlag = -{ - local vector v; - - if ( (prematch) )// && (self.owner.items & 131072) ) - { - T_Damage (self.owner, self.owner, self.owner, 500); - } - - makevectors(self.owner.v_angle); - setorigin(self, self.owner.origin - v_forward * 25 + '0 0 20'); - self.angles_x = self.owner.angles_z; - self.angles_y = self.owner.angles_y + 90; - self.angles_z = 0 - self.owner.angles_x; - self.nextthink = time + 0.010000; - self.think = MoveFlag; - if (self.owner.deadflag) - { - // pablo - //self.movetype = 10; - //self.velocity = '0 0 100'; - // - self.owner.effects = self.owner.effects - (self.owner.effects & 128); - self.owner.effects = self.owner.effects - (self.owner.effects & 64); - dremove(self); - } - if (!(self.owner.items & 131072) && !(self.owner.items & 262144)) - { - self.owner.effects = self.owner.effects - (self.owner.effects & 128); - self.owner.effects = self.owner.effects - (self.owner.effects & 64); - dremove(self); - } -}; - -void (entity Goal) UpdateAbbreviations = -{ - local string st; - - if ((Goal.has_abbreviated == 0)) - { - if (((Goal.g_a != 0) && (Goal.goal_activation == 0))) - { - Goal.goal_activation = Goal.g_a; - } - if (((Goal.g_e != 0) && (Goal.goal_effects == 0))) - { - Goal.goal_effects = Goal.g_e; - } - if (((Goal.g_e != 0) && (Goal.goal_effects == 0))) - { - Goal.goal_effects = Goal.g_e; - } - if (((Goal.h_i_g != 0) && (Goal.has_item_from_group == 0))) - { - Goal.has_item_from_group = Goal.h_i_g; - } - if (((Goal.hn_i_g != 0) && (Goal.hasnt_item_from_group == 0))) - { - Goal.hasnt_item_from_group = Goal.hn_i_g; - } - if (((Goal.r_i_g != 0) && (Goal.remove_item_group == 0))) - { - Goal.remove_item_group = Goal.r_i_g; - } - if (((Goal.a_s != 0) && (Goal.ammo_shells == 0))) - { - Goal.ammo_shells = Goal.a_s; - } - if (((Goal.a_n != 0) && (Goal.ammo_nails == 0))) - { - Goal.ammo_nails = Goal.a_n; - } - if (((Goal.a_r != 0) && (Goal.ammo_rockets == 0))) - { - Goal.ammo_rockets = Goal.a_r; - } - if (((Goal.a_c != 0) && (Goal.ammo_cells == 0))) - { - Goal.ammo_cells = Goal.a_c; - } - if (((Goal.rv_s_h != 0) && (Goal.remove_spawngroup == 0))) - { - Goal.remove_spawngroup = Goal.rv_s_h; - } - if (((Goal.rs_s_h != 0) && (Goal.restore_spawngroup == 0))) - { - Goal.restore_spawngroup = Goal.rs_s_h; - } - if (((Goal.rv_gr != 0) && (Goal.remove_group_no == 0))) - { - Goal.remove_group_no = Goal.rv_gr; - } - if (((Goal.rs_gr != 0) && (Goal.restore_group_no == 0))) - { - Goal.restore_group_no = Goal.rs_gr; - } - if (((Goal.rv_g != 0) && (Goal.remove_goal_no == 0))) - { - Goal.remove_goal_no = Goal.rv_g; - } - if (((Goal.rs_g != 0) && (Goal.restore_goal_no == 0))) - { - Goal.restore_goal_no = Goal.rs_g; - } - if ((Goal.t_s_h != string_null)) - { - Goal.team_str_home = Goal.t_s_h; - } - if ((Goal.t_s_m != string_null)) - { - Goal.team_str_moved = Goal.t_s_m; - } - if ((Goal.t_s_c != string_null)) - { - Goal.team_str_carried = Goal.t_s_c; - } - if ((Goal.n_s_h != string_null)) - { - Goal.non_team_str_home = Goal.n_s_h; - } - if ((Goal.n_s_m != string_null)) - { - Goal.non_team_str_moved = Goal.n_s_m; - } - if ((Goal.n_s_c != string_null)) - { - Goal.non_team_str_carried = Goal.n_s_c; - } - if ((Goal.b_b != string_null)) - { - Goal.broadcast = Goal.b_b; - } - if ((Goal.b_t != string_null)) - { - Goal.team_broadcast = Goal.b_t; - } - if ((Goal.b_n != string_null)) - { - Goal.non_team_broadcast = Goal.b_n; - } - if ((Goal.b_o != string_null)) - { - Goal.owners_team_broadcast = Goal.b_o; - } - if ((Goal.n_b != string_null)) - { - Goal.netname_broadcast = Goal.n_b; - } - if ((Goal.n_t != string_null)) - { - Goal.netname_team_broadcast = Goal.n_t; - } - if ((Goal.n_n != string_null)) - { - Goal.netname_non_team_broadcast = Goal.n_n; - } - if ((Goal.n_o != string_null)) - { - Goal.netname_owners_team_broadcast = Goal.n_o; - } - if ((Goal.d_t != string_null)) - { - Goal.team_drop = Goal.d_t; - } - if ((Goal.d_n != string_null)) - { - Goal.non_team_drop = Goal.d_n; - } - if ((Goal.d_n_t != string_null)) - { - Goal.netname_team_drop = Goal.d_n_t; - } - if ((Goal.d_n_n != string_null)) - { - Goal.netname_non_team_drop = Goal.d_n_n; - } - if ((flagem_checked == 0)) - { - if ((cvar ("temp1") & 4096)) - { - toggleflags = (toggleflags | 4096); - } - if ((cvar ("temp1") & 8192)) - { - toggleflags = (toggleflags | 8192); - } - flagem_checked = 1; - } - if (((toggleflags & 4096) && !(toggleflags & 8192))) - { - if ((((Goal.mdl == "progs/b_s_key.mdl") || (Goal.mdl == "progs/m_s_key.mdl")) || (Goal.mdl == "progs/w_s_key.mdl"))) - { - Goal.mdl = "progs/tf_flag.mdl"; - Goal.skin = 1; - } - else - { - if ((((Goal.mdl == "progs/b_g_key.mdl") || (Goal.mdl == "progs/m_g_key.mdl")) || (Goal.mdl == "progs/w_g_key.mdl"))) - { - Goal.mdl = "progs/tf_flag.mdl"; - Goal.skin = 2; - } - } - } - if ((toggleflags & 8192)) - { - if ((((Goal.mdl == "progs/b_s_key.mdl") || (Goal.mdl == "progs/m_s_key.mdl")) || (Goal.mdl == "progs/w_s_key.mdl"))) - { - Goal.mdl = "progs/tf_stan.mdl"; - Goal.skin = 1; - } - else - { - if ((((Goal.mdl == "progs/b_g_key.mdl") || (Goal.mdl == "progs/m_g_key.mdl")) || (Goal.mdl == "progs/w_g_key.mdl"))) - { - Goal.mdl = "progs/tf_stan.mdl"; - Goal.skin = 2; - } - else - { - if ((Goal.mdl == "progs/tf_flag.mdl")) - { - Goal.mdl = "progs/tf_stan.mdl"; - } - } - } - } - Goal.has_abbreviated = 1; - } -}; - -void () TF_PlaceItem = -{ - local float _l_10795; - - self.flags = 256.000000; - self.movetype = 0.000000; - self.velocity = '0.000000 0.000000 0.000000'; - self.oldorigin = self.origin; - if ((self.goal_activation & 512.000000)) - { - self.effects = (self.effects | 8.000000); - } - if ((item_list_bit == 0.000000)) - { - item_list_bit = 1.000000; - } - self.item_list = item_list_bit; - item_list_bit = item_list_bit * 2.000000; -}; - -void () TF_StartItem = -{ - - UpdateAbbreviations (self); - self.nextthink = (time + 0.200000); - self.think = TF_PlaceItem; - if ((self.goal_state == 3.000000)) - { - RemoveGoal (self); - } -}; - -void () TF_PlaceGoal = -{ - local float _l_10808; - - if ((self.classname != "info_tfgoal_timer")) - { - if ((self.goal_activation & 1.000000)) - { - self.touch = tfgoal_touch; - } - } - else - { - self.think = tfgoal_timer_tick; - self.nextthink = (time + self.search_time); - self.classname = "info_tfgoal"; - } - self.flags = 256.000000; - self.movetype = 0.000000; - self.velocity = '0.000000 0.000000 0.000000'; - self.oldorigin = self.origin; -}; - -void () TF_StartGoal = -{ - - UpdateAbbreviations (self); - self.nextthink = (time + 0.200000); - self.think = TF_PlaceGoal; - self.use = info_tfgoal_use; - if ((self.goal_state == 3.000000)) - { - RemoveGoal (self); - } -}; - -float() CheckExistence = -{ - - UpdateAbbreviations (self); - if ((self.ex_skill_min && (skill <= self.ex_skill_min))) - { - return (0.000000); - } - else - { - if ((self.ex_skill_max && (skill >= self.ex_skill_max))) - { - return (0.000000); - } - } - return (1.000000); -}; - -/* // ORIG NETQUAKETF INFO_TFDETECT -void () info_tfdetect = -{ - UpdateAbbreviations (self); -}; -*/ - -/*void () info_tfdetect = -{ - local entity te; - local string st; - - UpdateAbbreviations (self); - - //TIMELEFT TIMER - te = find (world,classname,"countdown"); - if (te != world) - { - return; - } - - st = infokey (world,"time"); // Unfortunately DP Engine doesnt support this (qw funct) - if (st == "off") - { - return; - } - newmis = spawn (); - newmis.classname = "countdown"; - newmis.no_grenades_1 = 0; - st = infokey (world,"timelimit"); - newmis.health = stof(st); - newmis.think = review_timeleft; - newmis.nextthink = (time + 1); - - -// MESSAGE DISP CODE - if (haltloop1 != 1) - { - local string msg1timer; - - msg1timer = infokey (world, "svmsg1"); - msg1time = stof(msg1timer); - - if (msg1time > 0) - { - display_message (); - } - haltloop1 = 1; - } - - if (haltloop2 != 1) - { - local string msg2timer; - - msg2timer = infokey (world, "svmsg2"); - msg2time = stof(msg2timer); - - if (msg2time > 0) - { - pre_messagetimer2 (); - } - haltloop2 = 1; - } - - if (haltloop3 != 1) - { - local string msg3timer; - - msg3timer = infokey (world, "svmsg3"); - msg3time = stof(msg3timer); - - if (msg3time > 0) - { - pre_messagetimer3 (); - } - haltloop3 = 1; - } - if (quotestart != 1) { - quotetimer (); - quotestart = 1; - } -// Auto Level-change fix -};*/ - -/* Gold. this is the old info_tfdetect... new one is above*/ -void() info_tfdetect = -{ - UpdateAbbreviations(self); - /*gold. next 6 lines are part of plexi's code for the "timeleft" command. - newmis = spawn (); - newmis.classname = "countdown"; - newmis.netname = "countdown"; - newmis.no_grenades_1 = 0; - newmis.think = review_timeleft; - newmis.nextthink = (time + 1);*/ -}; - -void() info_player_teamspawn = -{ - local entity te; - if (CheckExistence() == 0) - { - dremove(self); - return; - } - if (number_of_teams < self.team_no) - { - number_of_teams = self.team_no; - } - if (self.team_no <= 0) - { - dprint("no team_no associated with info_player_teamspawn\n"); - dremove(self); - } - if (self.items != 0) - { - te = Finditem(self.items); - if (!te) - { - dprint("info_player_teamspawn specifies a GoalItem that does not exist\n"); - dremove(self); - } - } - if (self.team_no == 1) - { - self.team_str_home = "ts1"; - } - else - { - if (self.team_no == 2) - { - self.team_str_home = "ts2"; - } - else - { - if (self.team_no == 3) - { - self.team_str_home = "ts3"; - } - else - { - if (self.team_no == 4) - { - self.team_str_home = "ts4"; - } - } - } - } -}; - -void() i_p_t = -{ - self.classname = "info_player_teamspawn"; - info_player_teamspawn(); -}; - -void() info_tfgoal = -{ - if (CheckExistence() == 0) - { - dremove(self); - return; - } - if (self.mdl) - { - precache_model(self.mdl); - precache_model2(self.mdl); - setmodel(self, self.mdl); - } - if (self.noise) - { - precache_sound(self.noise); - precache_sound2(self.noise); - } - else - { - if (self.mdl == "progs/backpack.mdl") - { - precache_sound("items/backpack.wav"); - precache_sound2("items/backpack.wav"); - self.noise = "items/backpack.wav"; - } - } - precache_sound("items/protect.wav"); - precache_sound("items/protect2.wav"); - precache_sound("items/protect3.wav"); - precache_sound("items/suit.wav"); - precache_sound("items/suit2.wav"); - precache_sound("items/inv1.wav"); - precache_sound("items/inv2.wav"); - precache_sound("items/inv3.wav"); - precache_sound("items/damage.wav"); - precache_sound("items/damage2.wav"); - precache_sound("items/damage3.wav"); - self.solid = 1; - if (self.goal_state == 0) - { - self.goal_state = 2; - } - if (self.goal_min != '0 0 0') - { - setsize(self, self.goal_min, self.goal_max); - } - else - { - setsize(self, '-16 -16 -24', '16 16 32'); - } - TF_StartGoal(); -}; - -void() i_t_g = -{ - self.classname = "info_tfgoal"; - info_tfgoal(); -}; - -void() info_tfgoal_timer = -{ - if (CheckExistence() == 0) - { - dremove(self); - return; - } - if (self.mdl) - { - precache_model(self.mdl); - precache_model2(self.mdl); - setmodel(self, self.mdl); - } - if (self.noise) - { - precache_sound(self.noise); - precache_sound2(self.noise); - } - if (self.search_time <= 0) - { - dprint("Timer Goal created with no specified time.\n"); - dremove(self); - } - self.solid = 0; - if (self.goal_state == 0) - { - self.goal_state = 2; - } - setsize(self, '-16 -16 -24', '16 16 32'); - TF_StartGoal(); -}; - -void() i_t_t = -{ - self.classname = "info_tfgoal_timer"; - info_tfgoal_timer(); -}; - -void() item_tfgoal = -{ - if (CheckExistence() == 0) - { - dremove(self); - return; - } - if (self.mdl) - { - precache_model(self.mdl); - precache_model2(self.mdl); - setmodel(self, self.mdl); - } - else - { - self.mdl = ""; - setmodel(self, ""); - } - precache_sound2("items/itembk2.wav"); - if (self.noise) - { - precache_sound(self.noise); - precache_sound2(self.noise); - } - self.touch = item_tfgoal_touch; - if (self.goal_state == 0) - { - self.goal_state = 2; - } - self.solid = 1; - setorigin(self, self.origin); - if (!(self.netname)) - { - self.netname = "goalitem"; - } - if (self.pausetime <= 0) - { - self.pausetime = 60; - } - if (self.delay != 0 && self.pausetime == 0) - { - self.pausetime = self.delay; - } - setsize(self, '-16 -16 -24', '16 16 32'); - TF_StartItem(); -}; - -void (entity AD) ParseTFDetect = -{ - if ((AD.team_broadcast != string_null)) - { - team_menu_string = AD.team_broadcast; - } - localcmd (AD.message); - cvar_set ("sv_maxspeed", "500"); - team1lives = AD.ammo_shells; - team2lives = AD.ammo_nails; - team3lives = AD.ammo_rockets; - team4lives = AD.ammo_cells; - if ((team1lives == 0)) - { - team1lives = -1; - } - if ((team2lives == 0)) - { - team2lives = -1; - } - if ((team3lives == 0)) - { - team3lives = -1; - } - if ((team4lives == 0)) - { - team4lives = -1; - } - /*if ((AD.hook_out == 1)) // Hook always allowed, right? - { - allow_hook = 0; - }*/ - team1maxplayers = AD.ammo_medikit; - team2maxplayers = AD.ammo_detpack; - team3maxplayers = AD.maxammo_medikit; - team4maxplayers = AD.maxammo_detpack; - if ((team1maxplayers == 0)) - { - team1maxplayers = 100; - } - if ((team2maxplayers == 0)) - { - team2maxplayers = 100; - } - if ((team3maxplayers == 0)) - { - team3maxplayers = 100; - } - if ((team4maxplayers == 0)) - { - team4maxplayers = 100; - } -// illegalclasses = AD.playerclass; - illegalclasses = AD.class; - illegalclasses1 = AD.maxammo_shells; - illegalclasses2 = AD.maxammo_nails; - illegalclasses3 = AD.maxammo_rockets; - illegalclasses4 = AD.maxammo_cells; - civilianteams = 0; - if ((illegalclasses1 == -1)) - { - illegalclasses1 = 0; - civilianteams = (civilianteams | 1); - } - if ((illegalclasses2 == -1)) - { - illegalclasses2 = 0; - civilianteams = (civilianteams | 2); - } - if ((illegalclasses3 == -1)) - { - illegalclasses3 = 0; - civilianteams = (civilianteams | 4); - } - if ((illegalclasses4 == -1)) - { - illegalclasses4 = 0; - civilianteams = (civilianteams | 8); - } -}; - -entity(float ino) Finditem = -{ - local entity tg; - local string st; - tg = find(world, classname, "item_tfgoal"); - while (tg) - { - if (tg.goal_no == ino) - { - return tg; - } - tg = find(tg, classname, "item_tfgoal"); - } - dprint("Could not find an item with a goal_no of "); - st = ftos(ino); - dprint(st); - dprint(".\n"); - return world; -}; - -/*entity(float gno) Findgoal = // moved to tffunctions -{ - local entity tg; - local string st; - tg = find(world, classname, "info_tfgoal"); - while (tg) - { - if (tg.goal_no == gno) - { - return tg; - } - tg = find(tg, classname, "info_tfgoal"); - } - dprint("Could not find a goal with a goal_no of "); - st = ftos(gno); - dprint(st); - dprint(".\n"); -};*/ - -entity(float gno) Findteamspawn = -{ - local entity tg; - local string st; - tg = find(world, classname, "info_player_teamspawn"); - while (tg) - { - if (tg.goal_no == gno) - { - return tg; - } - tg = find(tg, classname, "info_player_teamspawn"); - } - dprint("Could not find a Teamspawn with a goal_no of "); - st = ftos(gno); - dprint(st); - dprint(".\n"); -}; - -void(entity Goal) InactivateGoal = -{ - if (Goal.goal_state == 1) - { - if (Goal.search_time == 0) - { - Goal.solid = 1; - } - Goal.goal_state = 2; - if (Goal.mdl != string_null) - { - setmodel(Goal, Goal.mdl); - } - } -}; - -void(entity Goal) RestoreGoal = -{ - if (Goal.goal_state == 3) - { - if (Goal.search_time == 0) - { - Goal.solid = 1; - } - else - { - Goal.nextthink = time + Goal.search_time; - } - Goal.goal_state = 2; - if (Goal.mdl != string_null) - { - setmodel(Goal, Goal.mdl); - } - } -}; - -void(entity Goal) RemoveGoal = -{ - Goal.solid = 0; - Goal.goal_state = 3; - if (Goal.mdl != string_null) - { - setmodel(Goal, string_null); - } -}; - -float(entity Goal, entity Player, entity AP) IsAffectedBy = -{ - local float genv; - //if (Player.playerclass == 0) - if (Player.class == 0) - { - return 0; - } - if (Goal.goal_effects & 32) - { - genv = pointcontents(Goal.origin); - if (pointcontents(Player.origin) != genv) - { - return 0; - } - } - if (Goal.t_length != 0) - { - if (vlen(Goal.origin - Player.origin) <= Goal.t_length) - { - if (Goal.goal_effects & 16) - { - traceline(Goal.origin, Player.origin, 1, Goal); - if (trace_fraction == 1) - { - return 1; - } - } - else - { - return 1; - } - } - } - if (Goal.classname != "info_tfgoal_timer") - { - if (Goal.goal_effects & 1 && Player == AP) - { - return 1; - } - if (Goal.goal_effects & 2 && AP.team_no == Player.team_no) - { - return 1; - } - if (Goal.goal_effects & 4 && AP.team_no != Player.team_no) - { - return 1; - } - if (Goal.goal_effects & 8 && Player != AP) - { - return 1; - } - } - if (Goal.maxammo_shells != 0 && Player.team_no == Goal.maxammo_shells) - { - return 1; - } - if (Goal.maxammo_nails != 0 && Player.team_no != Goal.maxammo_shells) - { - return 1; - } - return 0; -}; - -void(entity Goal, entity Player, entity AP, float addb) Apply_Results = -{ - local entity oldself; - local entity te; - local entity oldte; - local float tc; - local float oa; - local string st; - stuffcmd(Player, "bf\n"); - if (Goal.classname == "item_tfgoal") - { - Player.item_list = Player.item_list | Goal.item_list; - } - if (Player == AP) - { - if (Goal.count != 0) - { - if (Player.team_no > 0) - { - TeamFortress_TeamIncreaseScore(Player.team_no, Goal.count); - TeamFortress_TeamShowScores(2); - } - } - } - if (addb) - { - if (Player.health > 0) - { - if (Goal.health > 0) - { - T_Heal(Player, Goal.health, 0); - } - if (Goal.health < 0) - { - if (0 - Player.health > Goal.health) - { - Player.armorvalue = 0; - T_Damage(Player, Goal, Goal, Player.health + 1); - } - else - { - oa = Player.armorvalue; - Player.armorvalue = 0; - T_Damage(Player, Goal, Goal, 0 - Goal.health); - Player.armorvalue = oa; - } - } - } - if (Player.health > 0) - { - if (Goal.armortype) - { - // Temp (i hope) -// Player.armortype = Goal.armortype; // Armor type needs to be tweaked in this game - } - Player.armorvalue = Player.armorvalue + Goal.armorvalue; - if (Goal.armorclass) - { - Player.armorclass = Goal.armorclass; - } - if (Goal.gravity > 0) - { - Player.gravity = Goal.gravity; - } - Player.ammo_shells = Player.ammo_shells + Goal.ammo_shells; - Player.ammo_nails = Player.ammo_nails + Goal.ammo_nails; - Player.ammo_rockets = Player.ammo_rockets + Goal.ammo_rockets; - Player.ammo_cells = Player.ammo_cells + Goal.ammo_cells; - Player.ammo_medikit = Player.ammo_medikit + Goal.ammo_medikit; - Player.ammo_detpack = Player.ammo_detpack + Goal.ammo_detpack; - Player.no_grenades_1 = Player.no_grenades_1 + Goal.no_grenades_1; - Player.no_grenades_2 = Player.no_grenades_2 + Goal.no_grenades_2; - if (Player.no_grenades_1 > 4) - { - Player.no_grenades_1 = 4; - } - if (Player.no_grenades_2 > 4) - { - Player.no_grenades_2 = 4; - } - if (Player.ammo_detpack > Player.maxammo_detpack) - { - Player.ammo_detpack = Player.maxammo_detpack; - } - if (Goal.invincible_finished > 0) - { - Player.items = Player.items | 1048576; - Player.invincible_time = 1; - Player.invincible_finished = time + Goal.invincible_finished; - if (Goal.classname == "item_tfgoal") - { - Player.tfstate = Player.tfstate | 32; - Player.invincible_finished = time + 666; - } - } - /*if (Goal.invisible_finished > 0) // NexTF doesnt support invisibility? - { - Player.items = Player.items | 524288; - Player.invisible_time = 1; - Player.invisible_finished = time + Goal.invisible_finished; - if (Goal.classname == "item_tfgoal") - { - Player.tfstate = Player.tfstate | 64; - Player.invisible_finished = time + 666; - } - }*/ - if (Goal.super_damage_finished > 0) - { - Player.items = Player.items | 4194304; - Player.super_time = 1; - Player.super_damage_finished = time + Goal.super_damage_finished; - if (Goal.classname == "item_tfgoal") - { - Player.tfstate = Player.tfstate | 128; - Player.super_damage_finished = time + 666; - } - } - if (Goal.radsuit_finished > 0) - { - Player.items = Player.items | 2097152; - Player.rad_time = 1; - Player.radsuit_finished = time + Goal.radsuit_finished; - if (Goal.classname == "item_tfgoal") - { - Player.tfstate = Player.tfstate | 256; - Player.radsuit_finished = time + 666; - } - } - } - Player.lives = Player.lives + Goal.lives; - Player.real_frags = /*Player.real_frags + */Goal.frags + Player.frags; // Fixed? - if (!(toggleflags & 128)) - { - Player.frags = Player.real_frags; - } - - oldself = self; - self = Player; - TeamFortress_CheckClassStats(); - //W_SetCurrentAmmo(); // This is automatic in nexuiz right? - self = oldself; - } - //if (Player.playerclass == 8 && (Goal.goal_result & 16)) // In nextf, spy class is "2" - if (Player.class == 2 && (Goal.goal_result & 16)) - { - self.immune_to_check = time + 4; - //Spy_RemoveDisguise(Player); // Wazat -- help [incomplete] - } - if (Goal.items != 0 && Goal.classname != "item_tfgoal") - { - te = Finditem(Goal.items); - if (te) - { - tfgoalitem_GiveToPlayer(te, Player, Goal); - } - } - if (Goal.axhitme != 0) - { - te = Finditem(Goal.axhitme); - if (te.owner == Player) - { - tfgoalitem_RemoveFromPlayer(te, Player, 1); - } - } - if (Goal.remove_item_group != 0) - { - te = find(world, classname, "item_tfgoal"); - while (te) - { - if (te.group_no == Goal.remove_item_group && te.owner == AP) - { - oldte = te; - te = find(te, classname, "item_tfgoal"); - tfgoalitem_RemoveFromPlayer(oldte, Player, 1); - } - else - { - te = find(te, classname, "item_tfgoal"); - } - } - } - if (Goal.display_item_status1 != 0) - { - te = Finditem(Goal.display_item_status1); - if (te) - { - DisplayItemStatus(Goal, Player, te); - } - else - { - sprint(Player,"Item is missing.\n"); - } - } - if (Goal.display_item_status2 != 0) - { - te = Finditem(Goal.display_item_status2); - if (te) - { - DisplayItemStatus(Goal, Player, te); - } - else - { - sprint(Player,"Item is missing.\n"); - } - } - if (Goal.display_item_status3 != 0) - { - te = Finditem(Goal.display_item_status3); - if (te) - { - DisplayItemStatus(Goal, Player, te); - } - else - { - sprint(Player,"Item is missing.\n"); - } - } - if (Goal.display_item_status4 != 0) - { - te = Finditem(Goal.display_item_status4); - if (te) - { - DisplayItemStatus(Goal, Player, te); - } - else - { - sprint(Player,"Item is missing.\n"); - } - } - /*if (Player.autodiscard) //Not a function in NexTF - { - oldself = self; - self = Player; - TeamFortress_Discard (); - self = oldself; - }*/ -}; - -void(entity Goal, entity Player) RemoveResults = -{ - local entity oldself; - local entity te; - local float puinvin; - local float puinvis; - local float puquad; - local float purad; - if (Goal.classname == "item_tfgoal") - { - if (!(Player.item_list & Goal.item_list)) - { - return; - } - if (Goal.goal_activation & 1024) - { - return; - } - Player.item_list = Player.item_list - (Player.item_list & Goal.item_list); - } - if (Goal.health > 0) - { - TF_T_Damage(Player, Goal, Goal, Goal.health, 1, 0); - } - if (Goal.health < 0) - { - T_Heal(Player, 0 - Goal.health, 0); - } - Player.lives = Player.lives - Goal.lives; - Player.armortype = Player.armortype - Goal.armortype; - Player.armorvalue = Player.armorvalue - Goal.armorvalue; - Player.armorclass = Player.armorclass - (Player.armorclass & Goal.armorclass); - Player.real_frags = Player.real_frags - Goal.frags; - if (!(toggleflags & 128)) - { - Player.frags = Player.real_frags; - } - Player.ammo_shells = Player.ammo_shells - Goal.ammo_shells; - Player.ammo_nails = Player.ammo_nails - Goal.ammo_nails; - Player.ammo_rockets = Player.ammo_rockets - Goal.ammo_rockets; - Player.ammo_cells = Player.ammo_cells - Goal.ammo_cells; - Player.ammo_medikit = Player.ammo_medikit - Goal.ammo_medikit; - Player.ammo_detpack = Player.ammo_detpack - Goal.ammo_detpack; - Player.no_grenades_1 = Player.no_grenades_1 - Goal.no_grenades_1; - Player.no_grenades_2 = Player.no_grenades_2 - Goal.no_grenades_2; - puinvin = 0; - puinvis = 0; - puquad = 0; - purad = 0; - te = find(world, classname, "item_tfgoal"); - while (te) - { - if (te.owner == Player && te != Goal) - { - if (te.invincible_finished > 0) - { - puinvin = 1; - } - if (te.invisible_finished > 0) - { - puinvis = 1; - } - if (te.super_damage_finished > 0) - { - puquad = 1; - } - if (te.radsuit_finished > 0) - { - purad = 1; - } - } - te = find(te, classname, "item_tfgoal"); - } - if (Goal.invincible_finished > 0 && !puinvin) - { - Player.tfstate = Player.tfstate - (Player.tfstate & 32); - Player.items = Player.items | 1048576; - Player.invincible_time = 1; - Player.invincible_finished = time + Goal.invincible_finished; - } - if (Goal.invisible_finished > 0 && !puinvis) - { - Player.tfstate = Player.tfstate - (Player.tfstate & 64); - Player.items = Player.items | 524288; - Player.invisible_time = 1; - Player.invisible_finished = time + Goal.invisible_finished; - } - if (Goal.super_damage_finished > 0 && !puquad) - { - Player.tfstate = Player.tfstate - (Player.tfstate & 128); - Player.items = Player.items | 4194304; - Player.super_time = 1; - Player.super_damage_finished = time + Goal.super_damage_finished; - } - if (Goal.radsuit_finished > 0 && !purad) - { - Player.tfstate = Player.tfstate - (Player.tfstate & 256); - Player.items = Player.items | 2097152; - Player.rad_time = 1; - Player.radsuit_finished = time + Goal.radsuit_finished; - } - oldself = self; - self = Player; - TeamFortress_CheckClassStats(); - //W_SetCurrentAmmo(); // automatic in nexuiz? - self = oldself; -}; - -float(entity Goal, entity AP) APMeetsCriteria = -{ - local float gotone; - local entity te; - local string db; - if (AP != world) - { - if (Goal.team_no) - { - if (Goal.team_no != AP.team_no) - { - return 0; - } - } -/* if (Goal.playerclass) - { - if (Goal.playerclass != AP.playerclass) - { - return 0; - } - }*/ - if (Goal.class) - { - if (Goal.class != AP.class) - { - return 0; - } - } - if (Goal.items_allowed) - { - te = Finditem(Goal.items_allowed); - if (te.owner != AP) - { - return 0; - } - } - } - if (Goal.if_goal_is_active) - { - te = Findgoal(Goal.if_goal_is_active); - if (te.goal_state != 1) - { - return 0; - } - } - if (Goal.if_goal_is_inactive) - { - te = Findgoal(Goal.if_goal_is_inactive); - if (te.goal_state != 2) - { - return 0; - } - } - if (Goal.if_goal_is_removed) - { - te = Findgoal(Goal.if_goal_is_removed); - if (te.goal_state != 3) - { - return 0; - } - } - if (Goal.if_group_is_active) - { - te = find(world, classname, "info_tfgoal"); - while (te) - { - if (te.group_no == Goal.if_group_is_active) - { - if (te.goal_state != 1) - { - return 0; - } - } - te = find(te, classname, "info_tfgoal"); - } - } - if (Goal.if_group_is_inactive) - { - te = find(world, classname, "info_tfgoal"); - while (te) - { - if (te.group_no == Goal.if_group_is_inactive) - { - if (te.goal_state != 2) - { - return 0; - } - } - te = find(te, classname, "info_tfgoal"); - } - } - if (Goal.if_group_is_removed) - { - te = find(world, classname, "info_tfgoal"); - while (te) - { - if (te.group_no == Goal.if_group_is_removed) - { - if (te.goal_state != 3) - { - return 0; - } - } - te = find(te, classname, "info_tfgoal"); - } - } - if (Goal.if_item_has_moved) - { - te = Finditem(Goal.if_item_has_moved); - if (te) - { - if (te.goal_state != 1 && te.origin == te.oldorigin) - { - return 0; - } - } - } - if (Goal.if_item_hasnt_moved) - { - te = Finditem(Goal.if_item_hasnt_moved); - if (te) - { - if (te.goal_state == 1 || te.origin != te.oldorigin) - { - return 0; - } - } - } - if (AP != world) - { - gotone = 0; - if (Goal.has_item_from_group) - { - te = find(world, classname, "item_tfgoal"); - while (te != world && !gotone) - { - if (te.group_no == Goal.has_item_from_group && te.owner == AP) - { - gotone = 1; - } - te = find(te, classname, "item_tfgoal"); - } - if (!gotone) - { - return 0; - } - } - } - return 1; -}; - -void(entity Goal) SetupRespawn = -{ - if (Goal.search_time != 0) - { - InactivateGoal(Goal); - Goal.think = tfgoal_timer_tick; - Goal.nextthink = time + Goal.search_time; - return; - } - if (Goal.goal_result & 1) - { - RemoveGoal(Goal); - return; - } - if (Goal.wait > 0) - { - Goal.nextthink = time + Goal.wait; - Goal.think = DoRespawn; - return; - } - else - { - if (Goal.wait == -1) - { - return; - } - } - InactivateGoal(Goal); -}; - -void() DoRespawn = -{ - RestoreGoal(self); - InactivateGoal(self); -}; - -float(entity Goal, entity AP) Activated = -{ - local float APMet; - local float RevAct; - local float Act; - if (Goal.goal_state == 1) - { - return 0; - } - if (Goal.goal_state == 3) - { - return 0; - } - if (Goal.goal_state == 4) - { - return 0; - } - APMet = APMeetsCriteria(Goal, AP); - if (Goal.classname == "item_tfgoal") - { - RevAct = Goal.goal_activation & 64; - } - else - { - RevAct = Goal.goal_activation & 4; - } - Act = 0; - if (APMet) - { - if (!RevAct) - { - Act = 1; - } - } - else - { - if (RevAct) - { - Act = 1; - } - } - return Act; -}; - -void(entity Goal, entity AP) DoGoalWork = -{ - local entity te; - local entity RI; - if (Goal.activate_goal_no != 0) - { - te = Findgoal(Goal.activate_goal_no); - if (te) - { - AttemptToActivate(te, AP, Goal); - } - } - if (Goal.inactivate_goal_no != 0) - { - te = Findgoal(Goal.inactivate_goal_no); - if (te) - { - InactivateGoal(te); - } - } - if (Goal.restore_goal_no != 0) - { - te = Findgoal(Goal.restore_goal_no); - if (te) - { - RestoreGoal(te); - } - } - if (Goal.remove_goal_no != 0) - { - te = Findgoal(Goal.remove_goal_no); - if (te) - { - RemoveGoal(te); - } - } - if (Goal.return_item_no != 0) - { - te = Finditem(Goal.return_item_no); - if (te) - { - if (te.goal_state == 1) - { - tfgoalitem_RemoveFromPlayer(te, te.owner, 1); - } - RI = spawn(); - RI.enemy = te; - RI.think = ReturnItem; - RI.nextthink = time + 0.1; - te.solid = 0; - } - } - if (Goal.remove_spawnpoint != 0) - { - te = Findteamspawn(Goal.remove_spawnpoint); - if (te) - { - te.goal_state = 3; - te.team_str_home = string_null; - } - } - if (Goal.restore_spawnpoint != 0) - { - te = Findteamspawn(Goal.restore_spawnpoint); - if (te) - { - if (te.goal_state == 3) - { - te.goal_state = 2; - if (te.team_no == 1) - { - te.team_str_home = "ts1"; - } - else - { - if (te.team_no == 2) - { - te.team_str_home = "ts2"; - } - else - { - if (te.team_no == 3) - { - te.team_str_home = "ts3"; - } - else - { - if (te.team_no == 4) - { - te.team_str_home = "ts4"; - } - } - } - } - } - } - } -}; - -void(entity Goal, entity AP) DoGroupWork = -{ - local string st; - local entity tg; - local float allset; - if (Goal.all_active != 0) - { - if (Goal.last_impulse == 0) - { - dprint("Goal "); - st = ftos(Goal.goal_no); - dprint(st); - dprint(" has a .all_active specified, but no .last_impulse\n"); - } - else - { - allset = 1; - tg = find(world, classname, "info_tfgoal"); - while (tg) - { - if (tg.group_no == Goal.all_active) - { - if (tg.goal_state != 1) - { - allset = 0; - } - } - tg = find(tg, classname, "info_tfgoal"); - } - if (allset) - { - tg = Findgoal(Goal.last_impulse); - if (tg) - { - DoResults(tg, AP, Goal.goal_result & 2); - } - } - } - } - if (Goal.activate_group_no != 0) - { - tg = find(world, classname, "info_tfgoal"); - while (tg) - { - if (tg.group_no == Goal.activate_group_no) - { - DoResults(tg, AP, 0); - } - tg = find(tg, classname, "info_tfgoal"); - } - } - if (Goal.inactivate_group_no != 0) - { - tg = find(world, classname, "info_tfgoal"); - while (tg) - { - if (tg.group_no == Goal.inactivate_group_no) - { - InactivateGoal(tg); - } - tg = find(tg, classname, "info_tfgoal"); - } - } - if (Goal.remove_group_no != 0) - { - tg = find(world, classname, "info_tfgoal"); - while (tg) - { - if (tg.group_no == Goal.remove_group_no) - { - RemoveGoal(tg); - } - tg = find(tg, classname, "info_tfgoal"); - } - } - if (Goal.restore_group_no != 0) - { - tg = find(world, classname, "info_tfgoal"); - while (tg) - { - if (tg.group_no == Goal.restore_group_no) - { - RestoreGoal(tg); - } - tg = find(tg, classname, "info_tfgoal"); - } - } - if (Goal.remove_spawngroup != 0) - { - tg = find(world, classname, "info_player_teamspawn"); - while (tg) - { - if (tg.group_no == Goal.remove_spawngroup) - { - tg.goal_state = 3; - tg.team_str_home = string_null; - } - tg = find(tg, classname, "info_player_teamspawn"); - } - } - if (Goal.restore_spawngroup != 0) - { - tg = find(world, classname, "info_player_teamspawn"); - while (tg) - { - if (tg.group_no == Goal.restore_spawngroup) - { - tg.goal_state = 2; - if (tg.team_no == 1) - { - tg.team_str_home = "ts1"; - } - else - { - if (tg.team_no == 2) - { - tg.team_str_home = "ts2"; - } - else - { - if (tg.team_no == 3) - { - tg.team_str_home = "ts3"; - } - else - { - if (tg.team_no == 4) - { - tg.team_str_home = "ts4"; - } - } - } - } - } - tg = find(tg, classname, "info_player_teamspawn"); - } - } -}; - -void(entity Item, entity AP) DoItemGroupWork = -{ - local entity tg; - local entity carrier; - local float allcarried; - local string st; - allcarried = 1; - if (Item.distance != 0) - { - if (Item.pain_finished == 0) - { - dprint("GoalItem "); - st = ftos(Item.goal_no); - dprint(st); - dprint(" has a .distance specified, but no .pain_finished\n"); - } - tg = find(world, classname, "item_tfgoal"); - while (tg) - { - if (tg.group_no == Item.distance) - { - if (tg.goal_state != 1) - { - allcarried = 0; - } - } - tg = find(tg, classname, "item_tfgoal"); - } - if (allcarried == 1) - { - tg = Findgoal(Item.pain_finished); - if (tg) - { - DoResults(tg, AP, Item.goal_result & 2); - } - } - } - allcarried = 1; - if (Item.speed != 0) - { - if (Item.attack_finished == 0) - { - dprint("GoalItem "); - st = ftos(Item.goal_no); - dprint(st); - dprint(" has a .speed specified, but no .attack_finished\n"); - } - carrier = world; - tg = find(world, classname, "item_tfgoal"); - while (tg) - { - if (tg.group_no == Item.speed) - { - if (tg.goal_state != 1) - { - allcarried = 0; - } - else - { - if (carrier == world) - { - carrier = tg.owner; - } - else - { - if (carrier != tg.owner) - { - allcarried = 0; - } - } - } - } - tg = find(tg, classname, "item_tfgoal"); - } - if (allcarried == 1) - { - tg = Findgoal(Item.attack_finished); - if (tg) - { - DoResults(tg, AP, Item.goal_result & 2); - } - } - } -}; - -void(entity Goal, entity AP) DoTriggerWork = -{ - local entity t; - if (Goal.killtarget) - { - t = world; - do - { - t = find(t, targetname, Goal.killtarget); - if (t != world) - { - remove(t); - } - } while (t != world); - } - if (Goal.target) - { - t = world; - activator = AP; - do - { - t = find(t, targetname, Goal.target); - if (t == world) - { - return; - } - stemp = self; - otemp = other; - self = t; - other = stemp; - if (self.use != SUB_Null) - { - if (self.use) - { - self.use(); - } - } - self = stemp; - other = otemp; - activator = AP; - } while (t != world); - } -}; - -void() DelayedResult = -{ - if (self.enemy.goal_state == 4) - { - DoResults(self.enemy, self.owner, self.weapon); - } - dremove(self); -}; - -void(entity Goal, entity AP, float addb) DoResults = -{ - local entity te; - local entity oldself; - local string st; - local float winners; - - if (Goal.goal_state == 1) - { - return; - } - if (Goal.delay_time > 0 && Goal.goal_state != 4) - { - Goal.goal_state = 4; - te = spawn(); - te.think = DelayedResult; - te.nextthink = time + Goal.delay_time; - te.owner = AP; - te.enemy = Goal; - te.weapon = addb; - return; - } - UpdateAbbreviations(Goal); - Goal.goal_state = 2; - if (Goal.noise) - { - if (Goal.volume == 1) - { - sound(other, 3, Goal.noise, 1, 0); - } - else - { - sound(other, 3, Goal.noise, 1, 1); - } - } - winners = 0; - if (Goal.increase_team1 != 0) - { - TeamFortress_TeamIncreaseScore(1, Goal.increase_team1); - winners = 1; - } - if (Goal.increase_team2 != 0) - { - TeamFortress_TeamIncreaseScore(2, Goal.increase_team2); - winners = 1; - } - if (Goal.increase_team3 != 0) - { - TeamFortress_TeamIncreaseScore(3, Goal.increase_team3); - winners = 1; - } - if (Goal.increase_team4 != 0) - { - TeamFortress_TeamIncreaseScore(4, Goal.increase_team4); - winners = 1; - } - if (winners == 1) - { - TeamFortress_TeamShowScores(2); - } - te = find(world, classname, "player"); - while (te != world) - { - if (Goal.broadcast != string_null && CTF_Map == 0) - { - CenterPrint2(te, "\n\n\n", Goal.broadcast); - } - if (Goal.netname_broadcast != string_null && CTF_Map == 0) - { - sprint(te,AP.netname); - sprint(te,Goal.netname_broadcast); - } - if (AP == te) - { - if (Goal.message != string_null) - { - CenterPrint2(te, Goal.message, AP.netname); - } - } - else - { - if (AP.team_no == te.team_no) - { - if (Goal.owners_team_broadcast != string_null && te.team_no == Goal.owned_by) - { - CenterPrint2(te, Goal.owners_team_broadcast, AP.netname); - } - else - { - if (Goal.team_broadcast != string_null) - { - CenterPrint2(te, Goal.team_broadcast, AP.netname); - } - } - if (Goal.netname_owners_team_broadcast != string_null && te.team_no == Goal.owned_by) - { - sprint(te,AP.netname); - sprint(te,Goal.netname_owners_team_broadcast); - } - else - { - if (Goal.netname_team_broadcast != string_null) - { - sprint(te,AP.netname); - sprint(te,Goal.netname_team_broadcast); - } - } - } - else - { - if (Goal.owners_team_broadcast != string_null && te.team_no == Goal.owned_by) - { - CenterPrint2(te, Goal.owners_team_broadcast, AP.netname); - } - else - { - if (Goal.non_team_broadcast != string_null) - { - CenterPrint2(te, Goal.non_team_broadcast, AP.netname); - } - } - if (Goal.netname_owners_team_broadcast != string_null && te.team_no == Goal.owned_by) - { - sprint(te,AP.netname); - sprint(te,Goal.netname_owners_team_broadcast); - } - else - { - if (Goal.netname_non_team_broadcast != string_null) - { - sprint(te,AP.netname); - sprint(te,Goal.netname_non_team_broadcast); - } - } - } - } - if (IsAffectedBy(Goal, te, AP)) - { - if (Goal.search_time != 0 && (Goal.goal_effects & 64)) - { - if (APMeetsCriteria(Goal, te)) - { - Apply_Results(Goal, te, AP, addb); - } - } - else - { - Apply_Results(Goal, te, AP, addb); - } - } - te = find(te, classname, "player"); - } - if (Goal.classname != "item_tfgoal") - { - Goal.goal_state = 1; - } - if (Goal.goal_result & 4) - { - TeamFortress_TeamShowScores(1); - winners = TeamFortress_TeamGetWinner(); - te = find(world, classname, "player"); - while (te) - { - te.takedamage = 0; - te.movetype = 0; - te.velocity = '0 0 0'; - te.avelocity = '0 0 0'; - te = find(te, classname, "player"); - } - te = spawn(); - te.nextthink = time + 5; - te.think = execute_changelevel; -// te.think = changelevel; // Wazat -- may need fixing - dremove(Goal); - return; - } - - DoGroupWork(Goal, AP); - DoGoalWork(Goal, AP); - DoTriggerWork(Goal, AP); - if (Goal.classname == "info_tfgoal") - { - SetupRespawn(Goal); - } -}; - -void() tfgoal_touch = -{ - local entity te; - if (!(self.goal_activation & 1)) - { - return; - } - if (other.classname != "player") - { - return; - } - if (other.is_dead == 1) // TEMP - { - return; - } - if (self.goal_state == 1) - { - return; - } - AttemptToActivate(self, other, self); -}; - -void() info_tfgoal_use = -{ - AttemptToActivate(self, activator, self); -}; - -void() tfgoal_timer_tick = -{ - if (self.goal_state != 3) - { - if (APMeetsCriteria(self, world)) - { - DoResults(self, world, 1); - } - else - { - InactivateGoal(self); - self.think = tfgoal_timer_tick; - self.nextthink = time + self.search_time; - } - } -}; - -void() item_tfgoal_touch = -{ - local string st; - local entity te; - if (other.is_dead == 1) // TEMP - { - return; - } - if (other.classname != "player") - { - return; - } - if (other.health <= 0) - { - return; - } - // for flag dropping - if ( (self.tent == other) && (time < self.option5) ) - { - return; - } - if (Activated(self, other)) - { - tfgoalitem_GiveToPlayer(self, other, self); - self.goal_state = 1; - } - else - { - if (self.else_goal != 0) - { - te = Findgoal(self.else_goal); - if (te) - { - AttemptToActivate(te, other, self); - } - } - } -}; - -void(entity Item, entity AP, entity Goal) tfgoalitem_GiveToPlayer = -{ - local string sp; - Item.owner = AP; - if (Item.mdl != string_null) - { - setmodel(Item, string_null); - } - Item.solid = 0; - if (Item.goal_activation & 1) - { - AP.effects = AP.effects | 8; - } - if (Item.goal_activation & 2) - { - TeamFortress_SetSpeed(AP); - } - if (Item.goal_activation & 512) - { - Item.effects = Item.effects - (Item.effects | 8); - } -// NexTF Flags - if (Item.items & 133701) - { - AP.items = AP.items | 262144; - AP.effects = AP.effects | 128; - newmis = spawn(); - newmis.owner = AP; - newmis.movetype = 4; - newmis.solid = 0; - setsize(newmis, '0 0 0', '0 0 0'); - newmis.angles = AP.angles; - newmis.nextthink = time + 0.5; - newmis.think = MoveFlag; - newmis.skin = 2; - setmodel(newmis, Item.mdl); - setorigin(newmis, AP.origin); - } - else { - if (Item.items & 131072) - { - AP.items = AP.items | 131072; - AP.effects = AP.effects | 64; - newmis = spawn(); - newmis.owner = AP; - newmis.movetype = 4; - newmis.solid = 0; - setsize(newmis, '0 0 0', '0 0 0'); - newmis.angles = AP.angles; - newmis.nextthink = time + 0.5; - newmis.think = MoveFlag; - newmis.skin = 1; - setmodel(newmis, "progs/tf_flag.mdl"); - setorigin(newmis, AP.origin); - } - if (Item.items & 262144) - { - AP.items = AP.items | 262144; - AP.effects = AP.effects | 128; - newmis = spawn(); - newmis.owner = AP; - newmis.movetype = 4; - newmis.solid = 0; - setsize(newmis, '0 0 0', '0 0 0'); - newmis.angles = AP.angles; - newmis.nextthink = time + 0.5; - newmis.think = MoveFlag; - newmis.skin = 2; - setmodel(newmis, "progs/tf_flag.mdl"); - setorigin(newmis, AP.origin); - } - } - if (Goal != Item) - { - if (Goal.goal_result & 8) - { - Item.goal_state = 1; - return; - } - } -/* if (AP.playerclass == 8 && (Item.goal_result & 16)) - { - AP.is_unabletospy = 1; - }*/ - if (AP.class == 2 && (Item.goal_result & 16)) - { - AP.is_unabletospy = 1; - } - DoResults(Item, AP, 1); - DoItemGroupWork(Item, AP); -}; - -void() ReturnItem = -{ - self.enemy.goal_state = 2; - self.enemy.solid = 1; - self.enemy.movetype = 0; - self.enemy.touch = item_tfgoal_touch; - self.enemy.origin = self.enemy.oldorigin; - if (self.enemy.mdl != string_null) - { - setmodel(self.enemy, self.enemy.mdl); - } - setorigin(self.enemy, self.enemy.origin); - //sound(self.enemy,"items/itembk2.wav", 1, 1); - sound (self.enemy, 2, "items/itembk2.wav", 1, 1); - tfgoalitem_checkgoalreturn(self.enemy); - dremove(self); -}; - -void (entity Item, entity AP, float method) tfgoalitem_RemoveFromPlayer = -{ - local entity te; - local float lighton; - local float slowon; - local float key1on; - local float key2on; - local float spyoff; - local string db1; - local entity DelayReturn; - - if ((Item == world)) - { - objerror ("error: tfgoalitem_RemoveFromPlayer(): Item == world"); - return; - } - lighton = 0; - slowon = 0; - key1on = 0; - key2on = 0; - spyoff = 0; - te = find (world, classname, "item_tfgoal"); - while (te) - { - if (((te.owner == AP) && (te != Item))) - { - if ((te.goal_activation & 1)) - { - lighton = 1; - } - if ((te.goal_activation & 2)) - { - slowon = 1; - } - if ((te.items & 131072)) - { - key1on = 1; - } - if ((te.items & 262144)) - { - key2on = 1; - } - if ((te.goal_result & 16)) - { - spyoff = 1; - } - } - te = find (te, classname, "item_tfgoal"); - } - if (!lighton) - { - if ((AP.invincible_finished > (time + 3))) - { - lighton = 1; - } - else - { - if ((AP.super_damage_finished > (time + 3))) - { - lighton = 1; - } - } - } - if (!lighton) - { - AP.effects = (AP.effects - (AP.effects & 8)); - AP.effects = (AP.effects - (AP.effects & 64)); - AP.effects = (AP.effects - (AP.effects & 128)); - } - if ((Item.goal_activation & 512)) - { - Item.effects = (Item.effects | 8); - } - if (!spyoff) - { - AP.is_unabletospy = 0; - } - if (!key1on) - { - AP.items = (AP.items - (AP.items & 131072)); - } - if (!key2on) - { - AP.items = (AP.items - (AP.items & 262144)); - } - te = find (world, classname, "player"); - while ((te != world)) - { - if (IsAffectedBy (Item, te, AP)) - { - RemoveResults (Item, te); - } - te = find (te, classname, "player"); - } - if (((method == 0) || (method == 2))) - { - te = find (world, classname, "player"); - while ((te != world)) - { - if ((te.team_no == Item.owned_by)) - { - if ((Item.team_drop != string_null)) - { - CenterPrint2 (te, "\n\n\n", Item.team_drop); - } - if ((Item.netname_team_drop != string_null)) - { - sprint (te, AP.netname); - sprint (te, Item.netname_team_drop); - } - } - else - { - if ((Item.non_team_drop != string_null)) - { - CenterPrint2 (te, "\n\n\n", Item.non_team_drop); - } - if ((Item.netname_non_team_drop != string_null)) - { - sprint (te, AP.netname); - sprint (te, Item.netname_non_team_drop); - } - } - te = find (te, classname, "player"); - } - if ((Item.goal_activation & 8)) - { - DelayReturn = spawn (); - DelayReturn.enemy = Item; - if ((method == 0)) - { - DelayReturn.weapon = 0; - } - else - { - DelayReturn.weapon = 1; - } - DelayReturn.think = ReturnItem; - DelayReturn.nextthink = (time + 0.5); - } - else - { - if ((Item.goal_activation & 4)) - { - if (((method == 2) && (Item.goal_activation & 4096))) - { - tfgoalitem_drop (Item, 1, AP); - } - else - { - tfgoalitem_drop (Item, 0, AP); - } - } - else - { - Item.owner = world; - dremove (Item); - TeamFortress_SetSpeed (AP); - return; - } - } - Item.owner = world; - Item.flags = (Item.flags - (Item.flags & 512)); - setsize (Item, Item.goal_min, Item.goal_max); - TeamFortress_SetSpeed (AP); - return; - } - else - { - if (method == 1) - { - if (Item.goal_activation & 16) - { - DelayReturn = spawn(); - DelayReturn.enemy = Item; - DelayReturn.think = ReturnItem; - DelayReturn.nextthink = time + 0.5; - Item.owner = world; - TeamFortress_SetSpeed(AP); - return; - } - Item.solid = 0; - Item.owner = world; - TeamFortress_SetSpeed(AP); - return; - } - } - objerror ("Invalid method passed into tfgoalitem_RemoveFromPlayer\n"); -}; - -// MTF's remove from player function -/*void(entity Item, entity AP, float method) tfgoalitem_RemoveFromPlayer = -{ - local entity te; - local float lighton; - local float slowon; - local float key1on; - local float key2on; - local float spyoff; - local string db1; - local entity DelayReturn; - if (Item == world) - { - dprint("error: tfgoalitem_RemoveFromPlayer(): Item == world"); - return; - } - lighton = 0; - slowon = 0; - key1on = 0; - key2on = 0; - spyoff = 0; - te = find(world, classname, "item_tfgoal"); - while (te) - { - if (te.owner == AP && te != Item) - { - if (te.goal_activation & 1) - { - lighton = 1; - } - if (te.goal_activation & 2) - { - slowon = 1; - } - if (te.items & 131072) - { - key1on = 1; - } - if (te.items & 262144) - { - key2on = 1; - } - if (te.goal_result & 16) - { - spyoff = 1; - } - } - te = find(te, classname, "item_tfgoal"); - } - if (!lighton) - { - if (AP.invincible_finished > time + 3) - { - lighton = 1; - } - } - if (!lighton) - { - AP.effects = AP.effects - (AP.effects & 8); - } - if (Item.goal_activation & 512) - { - Item.effects = Item.effects | 8; - } - if (!spyoff) - { - AP.is_unabletospy = 0; - } - if (!key1on) - { - AP.items = AP.items - (AP.items & 131072); - } - if (!key2on) - { - AP.items = AP.items - (AP.items & 262144); - } - te = find(world, classname, "player"); - while (te != world) - { - if (IsAffectedBy(Item, te, AP)) - { - RemoveResults(Item, te); - } - te = find(te, classname, "player"); - } - if ((method == 0) || (method == 2)) - { - te = find(world, classname, "player"); - while (te != world) - { - if (te.team_no == Item.owned_by) - { - if (Item.team_drop != string_null) - { - CenterPrint2(te, "\n\n\n", Item.team_drop); - } - if (Item.netname_team_drop != string_null) - { - sprint(te,AP.netname); - sprint(te,Item.netname_team_drop); - } - } - else - { - if (Item.non_team_drop != string_null) - { - CenterPrint2(te, "\n\n\n", Item.non_team_drop); - } - if (Item.netname_non_team_drop != string_null) - { - sprint(te,AP.netname); - sprint(te,Item.netname_non_team_drop); - } - } - te = find(te, classname, "player"); - } - if (Item.goal_activation & 8) - { - DelayReturn = spawn(); - DelayReturn.enemy = Item; - DelayReturn.think = ReturnItem; - DelayReturn.nextthink = time + 0.5; - } - else - { - if (Item.goal_activation & 4) - { - if (method == 0) - tfgoalitem_drop(Item); - } - else - { - Item.owner = world; - dremove(Item); - TeamFortress_SetSpeed(AP); - return; - } - } - Item.owner = world; - TeamFortress_SetSpeed(AP); - return; - } - if (method == 1) - { - if (Item.goal_activation & 16) - { - DelayReturn = spawn(); - DelayReturn.enemy = Item; - DelayReturn.think = ReturnItem; - DelayReturn.nextthink = time + 0.5; - Item.owner = world; - TeamFortress_SetSpeed(AP); - return; - } - Item.solid = 0; - Item.owner = world; - TeamFortress_SetSpeed(AP); - return; - } - - dprint("Invalid method passed into tfgoalitem_RemoveFromPlayer\n"); -};*/ - -void() tfgoalitem_dropthink = -{ - local float pos; - self.movetype = 10; //6; - if (self.pausetime != 0) - { - pos = pointcontents(self.origin); - if (pos == -4) - { - self.nextthink = time + self.pausetime / 4; - } - else - { - if (pos == -5) - { - self.nextthink = time + 5; - } - else - { - if (pos == -2 || pos == -6) - { - self.nextthink = time + 2; - } - else - { - self.nextthink = time + self.pausetime; - } - } - } - self.think = tfgoalitem_remove; - } -}; - -void(entity Item) tfgoalitem_drop = -{ - Item.origin = Item.owner.origin - '0 0 8'; - //Item.velocity_z = 400; - //Item.velocity_x = -50 + random() * 100; - //Item.velocity_y = -50 + random() * 100; - Item.velocity_z = 1; - Item.velocity_x = 0; - Item.velocity_y = 0; - Item.goal_state = 2; - Item.movetype = 6; - Item.solid = 1; - Item.touch = item_tfgoal_touch; - setorigin(Item, Item.origin - '0 0 16'); - setsize(Item, '-16 -16 0', '16 16 56'); - if (Item.mdl != string_null) - { - setmodel(Item, Item.mdl); - } - Item.nextthink = time + 5; - Item.think = tfgoalitem_dropthink; -}; - -void() tfgoalitem_remove = -{ - local entity te; - if (self.goal_state == 1) - { - return; - } - if (self.goal_activation & 32) - { - self.solid = 1; - self.touch = item_tfgoal_touch; - self.origin = self.oldorigin; - if (self.mdl != string_null) - { - setmodel(self, self.mdl); - } - setorigin(self, self.origin); - //sound(self,"items/itembk2.wav", 1, 1); - tfgoalitem_checkgoalreturn(self); - if (self.noise3 != string_null || self.noise4 != string_null) - { - te = find(world, classname, "player"); - while (te) - { - if (te.team_no == self.owned_by) - { - CenterPrint2(te, "\n\n\n", self.noise3); - } - else - { - CenterPrint2(te, "\n\n\n", self.noise4); - } - te = find(te, classname, "player"); - } - } - return; - } - dremove(self); -}; - -void(entity Item) tfgoalitem_checkgoalreturn = -{ - local string st; - local entity te; - if (Item.impulse != 0) - { - te = Findgoal(Item.impulse); - if (te) - { - te = Findgoal(Item.impulse); - if (te) - { - AttemptToActivate(te, world, Item); - } - } - } -}; - -void(entity Goal, entity Player, entity Item) DisplayItemStatus = -{ - if (Item.goal_state == 1) - { - if (Player.team_no == Item.owned_by) - { - sprint(Player,Goal.team_str_carried); - } - else - { - sprint(Player,Goal.non_team_str_carried); - } - sprint(Player," "); - if (Player == Item.owner) - { - sprint(Player," You"); - } - else - { - sprint(Player,Item.owner.netname); - } - sprint(Player,"."); - } - else - { - if (Item.origin != Item.oldorigin) - { - if (Player.team_no == Item.owned_by) - { - sprint(Player,Goal.team_str_moved); - } - else - { - sprint(Player,Goal.non_team_str_moved); - } - } - else - { - if (Player.team_no == Item.owned_by) - { - sprint(Player,Goal.team_str_home); - } - else - { - sprint(Player,Goal.non_team_str_home); - } - } - } - sprint(Player,"\n"); -}; - -void() info_player_team1 = -{ - CTF_Map = 1; - self.classname = "info_player_teamspawn"; - self.team_no = 2; - self.goal_effects = 1; - self.team_str_home = "ts2"; -}; - -void() info_player_team2 = -{ - CTF_Map = 1; - self.classname = "info_player_teamspawn"; - self.team_no = 1; - self.goal_effects = 1; - self.team_str_home = "ts1"; -}; - -void() item_flag_team2 = -{ - team2maxplayers = 4; //TEMP - local entity dp; - CTF_Map = 1; - precache_model("progs/w_s_key.mdl"); - precache_sound("ogre/ogwake.wav"); - precache_sound("boss2/pop2.wav"); - self.classname = "item_tfgoal"; - self.netname = "Team 1 Flag"; - self.broadcast = " ÇÏÔ the enemy team's flag!\n"; - self.deathtype = "You've got the enemy flag!\n"; - self.noise = "ogre/ogwake.wav"; - self.mdl = "progs/tf_flag.mdl"; - self.skin = 0; - setmodel(self, self.mdl); - self.goal_no = 1; - self.goal_activation = 1 | 4 | 128 | 32 | 16 | 512; - self.goal_effects = 1; - self.pausetime = 128; - setsize(self, '-16 -16 -24', '16 16 32'); - self.touch = item_tfgoal_touch; - self.goal_state = 2; - self.solid = 1; - setorigin(self, self.origin); - self.nextthink = time + 0.2; - self.think = TF_PlaceItem; - dp = spawn(); - dp.origin = self.origin; - dp.classname = "info_tfgoal"; - dp.goal_activation = 1; - dp.team_no = 1; - dp.items_allowed = 2; - dp.goal_no = 3; - dp.goal_effects = 3; - dp.broadcast = " ÃÁÐÔÕÒÅÄ the enemy flag!\n"; - dp.message = "You ÃÁÐÔÕÒÅÄ the enemy flag!\n"; - dp.noise = "boss2/pop2.wav"; - dp.goal_result = 2; - dp.activate_goal_no = 5; - dp.axhitme = 2; - dp.count = 10; - dp.frags = 10; - dp.solid = 1; - dp.goal_state = 2; - setsize(dp, '-16 -16 -24', '16 16 32'); - dp.nextthink = time + 0.2; - dp.think = TF_PlaceGoal; - dp = spawn(); - dp.origin = dp.origin; - dp.classname = "info_tfgoal"; - dp.goal_effects = 1; - dp.frags = 5; - dp.goal_activation = 0; - dp.goal_no = 5; - dp.solid = 0; - dp.goal_state = 2; - setsize(dp, '-16 -16 -24', '16 16 32'); - dp.nextthink = time + 0.2; - dp.think = TF_PlaceGoal; -}; - -void() item_flag_team1 = -{ - team1maxplayers = 4; //TEMP - local entity dp; - CTF_Map = 1; - precache_model("progs/tf_flag.mdl"); - precache_sound("ogre/ogwake.wav"); - precache_sound("boss2/pop2.wav"); - self.classname = "item_tfgoal"; - self.netname = "Team 2 Flag"; - self.broadcast = " ÇÏÔ the enemy team's flag!\n"; - self.deathtype = "You've got the enemy flag!\n"; - self.noise = "ogre/ogwake.wav"; - self.mdl = "progs/tf_flag.mdl"; - setmodel(self, self.mdl); - self.skin = 1; - self.goal_no = 2; - self.goal_activation = 1 | 4 | 128 | 32 | 16 | 512; - self.goal_effects = 1; - self.pausetime = 128; - setsize(self, '-16 -16 -24', '16 16 32'); - self.touch = item_tfgoal_touch; - self.goal_state = 2; - self.solid = 1; - setorigin(self, self.origin); - self.nextthink = time + 0.2; - self.think = TF_PlaceItem; - dp = spawn(); - dp.origin = self.origin; - dp.classname = "info_tfgoal"; - dp.goal_activation = 1; - dp.team_no = 2; - dp.items_allowed = 1; - dp.goal_no = 4; - dp.goal_effects = 3; - dp.broadcast = " ÃÁÐÔÕÒÅÄ the enemy flag!\n"; - dp.message = "You ÃÁÐÔÕÒÅÄ the enemy flag!\n"; - dp.noise = "boss2/pop2.wav"; - dp.goal_result = 2; - dp.activate_goal_no = 6; - dp.axhitme = 1; - dp.count = 10; - dp.frags = 10; - dp.solid = 1; - dp.goal_state = 2; - setsize(dp, '-16 -16 -24', '16 16 32'); - dp.nextthink = time + 0.2; - dp.think = TF_PlaceGoal; - dp = spawn(); - dp.origin = dp.origin; - dp.classname = "info_tfgoal"; - dp.goal_effects = 1; - dp.frags = 5; - dp.goal_activation = 0; - dp.goal_no = 6; - dp.solid = 0; - dp.goal_state = 2; - setsize(dp, '-16 -16 -24', '16 16 32'); - dp.nextthink = time + 0.2; - dp.think = TF_PlaceGoal; -}; - -void() CTF_FlagCheck = -{ - local entity te; - local float flagcount; - local float pos; - flagcount = 0; - te = find(world, classname, "item_tfgoal"); - while (te != world) - { - if (te.goal_no == 1) - { - pos = pointcontents(te.origin); - if (pos == -2 || pos == -6) - { - dprint("*****BUG*****\nFlag(s) outside world.\nPlease report this.\n"); - te.nextthink = time + 0.2; - te.think = tfgoalitem_remove; - } - flagcount = flagcount + 1; - } - else - { - if (te.goal_no == 2) - { - pos = pointcontents(te.origin); - if (pos == -2 || pos == -6) - { - dprint("*****BUG*****\nFlag(s) outside world.\nPlease report this.\n"); - te.nextthink = time + 0.2; - te.think = tfgoalitem_remove; - } - flagcount = flagcount + 1; - } - } - te = find(te, classname, "item_tfgoal"); - } - if (flagcount != 2) - { - dprint("*****BUG*****\nFlag(s) missing.\nPlease report this.\n"); - } - self.nextthink = time + 30; -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/tfplats.c b/TeamNexuiz/game/gamec/tfplats.c deleted file mode 100644 index 1b6674429..000000000 --- a/TeamNexuiz/game/gamec/tfplats.c +++ /dev/null @@ -1,499 +0,0 @@ - -void() SUB_Null; -float() CheckExistence; -void() train_next; -void() func_train_find; -void() plat_center_touch; -void() plat_outside_touch; -void() plat_trigger_use; -void() plat_go_up; -void() plat_go_down; -void() plat_crush; - - - -void() plat_spawn_inside_trigger = -{ - local entity trigger; - local vector tmin; - local vector tmax; - trigger = spawn(); - trigger.touch = plat_center_touch; - trigger.movetype = 0; - trigger.solid = 1; - trigger.enemy = self; - trigger.team_no = self.team_no; - trigger.playerclass = self.playerclass; - trigger.items_allowed = self.items_allowed; - trigger.activate_goal_no = self.activate_goal_no; - trigger.inactivate_goal_no = self.inactivate_goal_no; - trigger.remove_goal_no = self.remove_goal_no; - trigger.restore_goal_no = self.restore_goal_no; - trigger.activate_group_no = self.activate_group_no; - trigger.inactivate_group_no = self.inactivate_group_no; - trigger.remove_group_no = self.remove_group_no; - trigger.restore_group_no = self.restore_group_no; - trigger.goal_activation = self.goal_activation; - trigger.goal_effects = self.goal_effects; - trigger.goal_result = self.goal_result; - trigger.goal_group = self.goal_group; - tmin = self.mins + '25 25 0'; - tmax = self.maxs - '25 25 -8'; - tmin_z = tmax_z - (self.pos1_z - self.pos2_z + 8); - if (self.spawnflags & 1) - { - tmax_z = tmin_z + 8; - } - if (self.size_x <= 50) - { - tmin_x = (self.mins_x + self.maxs_x) / 2; - tmax_x = tmin_x + 1; - } - if (self.size_y <= 50) - { - tmin_y = (self.mins_y + self.maxs_y) / 2; - tmax_y = tmin_y + 1; - } - setsize(trigger, tmin, tmax); -}; - -void() plat_hit_top = -{ - sound(self, 2, self.noise1, 1, 1); - self.state = 0; - self.think = plat_go_down; - self.nextthink = self.ltime + 3; -}; - -void() plat_hit_bottom = -{ - sound(self, 2, self.noise1, 1, 1); - self.state = 1; -}; - -void() plat_go_down = -{ - sound(self, 2, self.noise, 1, 1); - self.state = 3; - SUB_CalcMove(self.pos2, self.speed, plat_hit_bottom); -}; - -void() plat_go_up = -{ - sound(self, 2, self.noise, 1, 1); - self.state = 2; - SUB_CalcMove(self.pos1, self.speed, plat_hit_top); -}; - -void() plat_center_touch = -{ - local entity te; - if (other.classname != "player") - { - return; - } - if (!Activated(self, other)) - { - if (self.else_goal != 0) - { - te = Findgoal(self.else_goal); - if (te) - { - DoResults(te, other, self.goal_result & 2); - } - } - return; - } - if (other.health <= 0) - { - return; - } - self = self.enemy; - if (self.state == 1) - { - plat_go_up(); - } - else - { - if (self.state == 0) - { - self.nextthink = self.ltime + 1; - } - } -}; - -void() plat_outside_touch = -{ - local entity te; - if (other.classname != "player") - { - return; - } - if (!Activated(self, other)) - { - if (self.else_goal != 0) - { - te = Findgoal(self.else_goal); - if (te) - { - DoResults(te, other, self.goal_result & 2); - } - } - return; - } - if (other.health <= 0) - { - return; - } - self = self.enemy; - if (self.state == 0) - { - plat_go_down(); - } -}; - -void() plat_trigger_use = -{ - if (self.think) - { - return; - } - plat_go_down(); -}; - -void() plat_crush = -{ - T_Damage(other, self, self, 1); - if (self.state == 2) - { - plat_go_down(); - } - else - { - if (self.state == 3) - { - plat_go_up(); - } - else - { - objerror("plat_crush: bad self.state\n"); - } - } -}; - -void() plat_use = -{ - self.use = SUB_Null; - if (self.state != 2) - { - objerror("plat_use: not in up state"); - } - plat_go_down(); -}; - -void() func_plat = -{ - local entity t; - - // Q3F/ETF support - if (self.allowteams == "red") - { - self.team_no = 2; - } - if (self.allowteams == "blue") - { - self.team_no = 1; - } - - if (CheckExistence() == 0) - { - dremove(self); - return; - } - if (!(self.t_length)) - { - self.t_length = 80; - } - if (!(self.t_width)) - { - self.t_width = 10; - } - if (self.sounds == 0) - { - self.sounds = 2; - } - if (self.sounds == 1) - { - precache_sound("plats/plat1.wav"); - precache_sound("plats/plat2.wav"); - self.noise = "plats/plat1.wav"; - self.noise1 = "plats/plat2.wav"; - } - if (self.sounds == 2) - { - precache_sound("plats/medplat1.wav"); - precache_sound("plats/medplat2.wav"); - self.noise = "plats/medplat1.wav"; - self.noise1 = "plats/medplat2.wav"; - } - if (self.sounds == 4) - { - precache_sound("plats/track_st.wav"); - precache_sound("plats/track_e.wav"); - self.noise = "plats/track_st.wav"; - self.noise1 = "plats/track_e.wav"; - } - self.mangle = self.angles; - self.angles = '0 0 0'; - self.classname = "plat"; - self.solid = 4; - self.movetype = 7; - setorigin(self, self.origin); - setmodel(self, self.model); - setsize(self, self.mins, self.maxs); - self.blocked = plat_crush; - if (!(self.speed)) - { - self.speed = 150; - } - self.pos1 = self.origin; - self.pos2 = self.origin; - if (self.height) - { - self.pos2_z = self.origin_z - self.height; - } - else - { - self.pos2_z = self.origin_z - self.size_z + 8; - } - self.use = plat_trigger_use; - plat_spawn_inside_trigger(); - if (self.targetname) - { - self.state = 2; - self.use = plat_use; - } - else - { - setorigin(self, self.pos2); - self.state = 1; - } -}; - -void() train_blocked = -{ - if (time < self.attack_finished) - { - return; - } - self.attack_finished = time + 0.5; - T_Damage(other, self, self, self.dmg); -}; - -void() train_use = -{ - if (self.think != func_train_find) - { - return; - } - train_next(); -}; - -void() train_wait = -{ - if (self.wait) - { - self.nextthink = self.ltime + self.wait; - if (self.wait == -1) - { - self.think = func_train_find; - } - self.sounds = 4; - if (4) - { - sound(self, 2, self.noise, 1, 0); - } - else - { - sound(self, 2, self.noise, 1, 1); - } - } - else - { - self.nextthink = self.ltime + 0.1; - } - self.think = train_next; -}; - -void() train_next = -{ - local entity targ; - targ = find(world, targetname, self.target); - self.target = targ.target; - if (!(self.target)) - { - objerror("train_next: no next target"); - } - if (targ.wait) - { - self.wait = targ.wait; - } - else - { - self.wait = 0; - } - self.sounds = 4; -// if (4) -// { -// sound(self, 2, self.noise1, 1, 0); -// } -// else -// { - sound(self, 2, self.noise1, 1, 1); -// } - SUB_CalcMove(targ.origin - self.mins, self.speed, train_wait); -}; - -void() func_train_find = -{ - local entity targ; - targ = find(world, targetname, self.target); - self.target = targ.target; - setorigin(self, targ.origin - self.mins); - if (!(self.targetname)) - { - self.nextthink = self.ltime + 0.1; - self.think = train_next; - } -}; - -void() followtrain = -{ - setorigin(self, self.owner.origin); - self.nextthink = time + 0.1; - self.think = followtrain; -}; - -void() func_train = -{ - local entity bob; - if (CheckExistence() == 0) - { - dremove(self); - return; - } - if (!(self.speed)) - { - self.speed = 100; - } - if (!(self.target)) - { - objerror("func_train without a target"); - } - if (!(self.dmg)) - { - self.dmg = 2; - } - if (self.sounds == 0) - { - self.noise = "misc/null.wav"; - precache_sound("misc/null.wav"); - self.noise1 = "misc/null.wav"; - precache_sound("misc/null.wav"); - } - if (self.sounds == 1) - { - self.noise = "plats/train2.wav"; - precache_sound("plats/train2.wav"); - self.noise1 = "plats/train1.wav"; - precache_sound("plats/train1.wav"); - } - if (self.sounds == 4) - { - precache_sound("plats/track_st.wav"); - precache_sound("plats/track_e.wav"); - self.noise = "plats/track_e.wav"; - self.noise1 = "plats/track_st.wav"; - } - self.cnt = 1; - self.solid = 4; - self.movetype = 7; - self.blocked = train_blocked; - self.use = train_use; - self.classname = "train"; - setmodel(self, self.model); - setsize(self, self.mins, self.maxs); - setorigin(self, self.origin); - self.nextthink = self.ltime + 0.1; - self.think = func_train_find; -}; - -void() light_move = -{ - if (CheckExistence() == 0) - { - dremove(self); - return; - } - if (!(self.speed)) - { - self.speed = 100; - } - if (!(self.target)) - { - objerror("light_move without a target"); - } - self.noise = "misc/null.wav"; - precache_sound("misc/null.wav"); - self.noise1 = "misc/null.wav"; - precache_sound("misc/null.wav"); - self.cnt = 1; - if (!(self.effects)) - { - self.effects = 4; - } - self.solid = 4; - self.movetype = 7; - self.classname = "movelight"; - precache_model("progs/s_null.spr"); - setmodel(self, "progs/s_null.spr"); - setsize(self, '0 0 0', '0 0 0'); - setorigin(self, self.origin); - self.nextthink = self.ltime + 0.1; - self.think = func_train_find; -}; - -void() misc_teleporttrain = -{ - if (CheckExistence() == 0) - { - dremove(self); - return; - } - if (!(self.speed)) - { - self.speed = 100; - } - if (!(self.target)) - { - objerror("func_train without a target"); - } - self.cnt = 1; - self.solid = 0; - self.movetype = 7; - self.blocked = train_blocked; - self.use = train_use; - self.avelocity = '100 200 300'; - self.noise = "misc/null.wav"; - precache_sound("misc/null.wav"); - self.noise1 = "misc/null.wav"; - precache_sound("misc/null.wav"); - precache_model2("progs/teleport.mdl"); - setmodel(self, "progs/teleport.mdl"); - setsize(self, self.mins, self.maxs); - setorigin(self, self.origin); - self.nextthink = self.ltime + 0.1; - self.think = func_train_find; -}; - - diff --git a/TeamNexuiz/game/gamec/tfq3fitems.c b/TeamNexuiz/game/gamec/tfq3fitems.c deleted file mode 100644 index 1037f80ae..000000000 --- a/TeamNexuiz/game/gamec/tfq3fitems.c +++ /dev/null @@ -1,303 +0,0 @@ -/* -============= - XavioR's Q3F/ETF Entity recognition - ============== -*/ -// q3f_forts seems to work almost perfectly -- -//any other map will probably need a small to large amount of entity editing; -//still, this code does do a lot of work for you so give it a look :) -.string groupname; -//.string allowteams; -.string give; -.string active_all_sound; -.string carried_message; -.string active_all_message; -.string carried_sound; -.string holding; -.float gameindex; -.float teamscore; -.float floating; -//.vector orig_origin; - -// Q3F/ETF Maps dont have info_tfdetects, so this calls it. -void () DoTFDetect = -{ - if (q3fdetect == 1) - return; -self.display_item_status1 = 1; -self.n_s_c = "ÅÎÅÍÙ flag: carried by"; -self.display_item_status2 = 2; -self.impulse = 64; -//self.classname = "info_tfdetect"; -self.b_n = "\n"; -self.t_s_h = "ÙÏÕÒ flag: base."; -//self.origin = '-80 -60 108'; -self.t_s_c = "ÙÏÕÒ flag: carried by"; -self.n_s_h = "ÅÎÅÍÙ flag: base."; -self.b_t = "Amnesia\nžŸ CHOOSE YOUR TEAM žŸ\n\n..… BLUE TEAM\n..… ÒÅÄ TEAM \n\n—.… AUTO TEAM\n"; -self.b_b = "TeamFortress"; -self.n_s_m = "ÅÎÅÍÙ flag: down."; -self.t_s_m = "ÙÏÕÒ flag: down."; -q3fdetect = 1; -info_tfdetect(); -}; - -void () PossiblyDoTFDetect = -{ - if (q3fdetect != 1) - { - newmis = spawn(); - newmis.classname = "info_tfdetect"; - newmis.nextthink = time; - newmis.think = DoTFDetect; - } -} - -// Converts item to FLAG -void (float tno) ConvertToFlag = -{ - PossiblyDoTFDetect(); - local string droppedmsg; - - if (self.allowteams == "red") - { -// if (redflagexists == 1) -// return; - self.team_no = 2; - self.owned_by = 1; - self.n_b = " took the Blue Æìáç!\n"; - droppedmsg = " Dropped the Blue flag\n"; - self.netname = "Red Flag"; - redflagexists = 1; - - if (!self.goal_no) - self.goal_no = 200; // Temp Goal Number, can be overridden by a "goal" def in the entity - } - if (self.allowteams == "blue") - { -// if (blueflagexists == 1) -// return; - self.team_no = 1; - self.owned_by = 2; - self.n_b = " took the Red Æìáç!\n"; - droppedmsg = " Dropped the Red flag\n"; - self.netname = "Blue Flag"; - blueflagexists = 1; - - if (!self.goal_no) - self.goal_no = 100; // Temp Goal Number, can be overridden by a "goal" def in the entity - } - self.classname = "item_tfgoal"; - self.message = self.carried_message; - - self.d_t = "the ÅÎÅÍÙ ìïóô your flag!\n"; // The enemy stole your flag msg - self.b_o = "Your flag has been stolen!\n"; - - self.noise = self.carried_sound; -// self.noise3 = self.inactive_all_message; - self.noise3 = "Your flag has returned to base!\n"; -// self.noise4 = self.inactive_all_message; - self.noise4 = "The enemy flag has returned to base!\n"; - -// self.impulse = 9; - self.items = 133701; - - self.mdl = self.model; - -// self.mdl = "models/flag.md3"; - - if (!self.delay) - self.delay = self.wait; - - self.d_n_n = droppedmsg; - self.d_n_t = droppedmsg; - - self.g_a = 2741; - self.g_e = 17; - - - item_tfgoal(); -}; - -// Simulate animation for converted tfgoal backpack -// Very unorthodox -- i cant find out why self.owner.velocity has no effect -void () PackFloat = -{ - self.owner.angles_y = self.owner.angles_y + 10; - - if (self.floating == -17) - { - self.floating = 9; - } - if (self.floating == 0) - { - self.floating = 9; - } - if (self.floating > 0) - { - self.owner.origin_z = self.owner.origin_z + 3; - self.floating = self.floating - 1; - } - if (self.floating == 0) - { - self.floating = -9; - } - if (self.floating < 0) - { - self.owner.origin_z = self.owner.origin_z - 3; - self.floating = self.floating + 1; - } - self.owner.movetype = 9; - -// self.nextthink = (time + 0.500000); - self.nextthink = time + 0.01; - self.think = PackFloat; -}; - -// This is the function that will convert an item to a backpack -//(happens with any item that has a "give" value). -void () ConvertToBackPack = -{ - PossiblyDoTFDetect(); - if (self.give == "") - return; - -// self.classname = "i_t_g"; - if (self.allowteams == "red") - { - self.team_no = 2; - self.owned_by = 2; - } - if (self.allowteams == "blue") - { - self.team_no = 1; - self.owned_by = 1; - } - - self.message = "Resupplied!\n"; - if (self.carried_message != "") - self.message = self.carried_message; - if (self.active_all_message != "") - self.message = self.active_all_message; - - self.mdl = self.model; - self.noise = self.active_all_sound; - self.g_e = 1; - self.g_a = 1; - - self.flags = self.flags & FL_ITEM & FL_WEAPON; // makes it turn around -- much more bandwidth efficient - -/* self.orig_origin = self.origin; // old pack float code - newmis = spawn(); // thx savagex for making me aware of cl_itembobheight - newmis.floating = -17; - newmis.owner = self; - newmis.think = PackFloat; - newmis.nextthink = (time + 1.000000);*/ - - // If no ammo amount is specified in the entity, it will default to these values. - // The reason for this is because q3f/etf uses "give" commands to add ammo, and I can't - //convert those easily :( - if (!(self.ammo_nails || self.ammo_cells || self.ammo_rockets || self.health)) - { - self.health = 50; - self.ammo_nails = 50; - self.ammo_nails = 100; - self.ammo_rockets = 15; - self.armorvalue = 100; - self.no_grenades_1 = 2; - } - i_t_g (); -}; - -// Converts Q3F/ETF Team Spawn points to tf-recognized ones. -/*void () info_player_start = -{ - if (self.allowteams == "blue") - self.team_no = 1; - if (self.allowteams == "red") - self.team_no = 2; - i_p_t(); -};*/ - -void() info_notnull = -{ - if (self.give != "") - { - ConvertToBackPack (); - } - if (self.groupname == "blueflag") - ConvertToFlag(1); - if (self.groupname == "redflag") - ConvertToFlag(2); -}; - -void() func_goalinfo = -{ - if (self.give != "") - { - ConvertToBackPack (); - } - if (self.groupname == "blueflag") - ConvertToFlag(1); - if (self.groupname == "redflag") - ConvertToFlag(2); -}; - -void() func_goalitem = -{ - if (self.give != "") - { - ConvertToBackPack (); - } - if (self.groupname == "blueflag" && self.gameindex != 3) { - ConvertToFlag(1); - } - if (self.groupname == "redflag" && self.gameindex != 3) { - ConvertToFlag(2); - } -}; - -// Converts trigger_multiples to Flag Goals (the point(s) where the flag is capped). -//This works for q3f_forts and machse and a couple other ones. -void(float tno) ConvertToGoal = -{ - if (!self.teamscore) - return; - if (tno == 1) - { - self.team_no = 2; - self.axhitme = 200; - self.items_allowed = 200; - } - if (tno == 2) - { - self.team_no = 1; - self.axhitme = 100; - self.items_allowed = 100; - } - - self.is_converted_goal = "yes"; // used with spawn point finder, no connnection with the actual conversion - - self.goal_result = 2; - self.noise = self.active_all_sound; - self.frags = self.teamscore; - self.count = self.teamscore; - self.classname = "i_t_g"; - - self.g_a = 1; - self.g_e = 3; - - i_t_g(); -}; - -void() CheckIfQ3FTrigger = // Handles trigger_multiples from Q3F/ETF -- called from trigger_multiple -{ - if (self.holding == "blueflag") - ConvertToGoal (1); - if (self.holding == "redflag") - ConvertToGoal (2); - if (self.holding == "oneflag" && self.allowteams == "blue") - ConvertToGoal (1); - if (self.holding == "oneflag" && self.allowteams == "red") - ConvertToGoal (2); -}; diff --git a/TeamNexuiz/game/gamec/w_bombletts.c b/TeamNexuiz/game/gamec/w_bombletts.c deleted file mode 100644 index 6cd5e79d9..000000000 --- a/TeamNexuiz/game/gamec/w_bombletts.c +++ /dev/null @@ -1,129 +0,0 @@ -void() bombletts_ready_01; -void() bombletts_fire1_01; -void() bombletts_deselect_01; -void() bombletts_select_01; - -float() bombletts_check = -{ - return TRUE; -} - -void(float req) w_bombletts = -{ - if (req == WR_IDLE) - bombletts_ready_01(); - else if (req == WR_FIRE1) - weapon_prepareattack(bombletts_check, bombletts_check, bombletts_fire1_01, cvar("g_balance_bombletts_refire")); - else if (req == WR_RAISE) - bombletts_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = 1; - else if (req == WR_DROP) - bombletts_deselect_01(); - else if (req == WR_SETUP) - { - weapon_setup(WEP_BOMBLETTS, "w_bombletts.zym", IT_ROCKETS); - //self.weaponentity.colormod = '0 4 0'; - //self.weaponentity.scale = 0.65; - } - else if (req == WR_CHECKAMMO) - weapon_hasammo = bombletts_check(); -} - -void W_Bombletts_Explode (void) -{ - vector org2; - org2 = findbetterlocation (self.origin); - te_explosion (org2); - effect (org2, "models/sprites/grenadeexplosion.spr32", 0, 20, 30); - sound (self, CHAN_BODY, "weapons/grenade_impact.wav", 1, ATTN_NORM); - - self.event_damage = SUB_Null; - RadiusDamage (self, self.owner, cvar("g_balance_bombletts_damage"), cvar("g_balance_bombletts_edgedamage"), cvar("g_balance_bombletts_radius"), world, cvar("g_balance_bombletts_force"), WEP_BOMBLETTS); - - remove (self); -} - -void W_Bombletts_Touch (void) -{ - sound (self, CHAN_IMPACT, "weapons/grenade_bounce.wav", 1, ATTN_NORM); - self.velocity = self.velocity * cvar("g_balance_bombletts_bounce_speed"); -} - -void W_Bombletts_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - self.health = self.health - damage; - if (self.health <= 0) - W_Bombletts_Explode(); -} - -void W_Bombletts_Think (void) -{ - self.nextthink = time; - if (time > self.cnt) - { - W_Bombletts_Explode (); - return; - } - if (self.owner) - { - if (self.owner.deadflag) - self.owner = self; - else if (self.owner.wpn == WEP_BOMBLETTS && self.owner.button3) - W_Bombletts_Explode (); - } -} - -void W_Bombletts_Attack (void) -{ - local entity gren; - local vector org; - - sound (self, CHAN_WEAPON, "weapons/grenade_fire.wav", 1, ATTN_NORM); - self.punchangle_x = -4; - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -12; - - gren = spawn (); - gren.owner = self; - gren.classname = "grenade"; - gren.movetype = MOVETYPE_BOUNCE; - gren.solid = SOLID_BBOX; - setmodel(gren, "models/grenademodel.md3"); - setsize(gren, '-6 -6 -3', '6 6 3'); - setorigin(gren, org); - - gren.cnt = time + 1.5 + random()*0.5; - gren.think = W_Bombletts_Think; - gren.nextthink = time + 0.1; - //gren.think = W_Bombletts_Explode; - gren.touch = W_Bombletts_Touch; - gren.takedamage = DAMAGE_YES; - gren.health = 2; - //gren.damageforcescale = 4; - gren.event_damage = W_Bombletts_Damage; - gren.velocity = v_forward * cvar("g_balance_bombletts_speed") - + v_up * cvar("g_balance_bombletts_speed_up"); - gren.avelocity = '100 150 100'; - - gren.angles = vectoangles (gren.velocity); - - gren.scale = 0.5; - gren.colormod = '1 .5 0'*4;//'0 0 1.9'; - - self.clip_pipegrenades = self.clip_pipegrenades - 1; - if (self.clip_pipegrenades <= 0) - { - DoReload (4, 6); // weapon type 4 is Pipe Grenade, and reload 6 Grenades. - } -} - -// weapon frames - -void() bombletts_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, bombletts_ready_01); self.weaponentity.state = WS_READY;}; -void() bombletts_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() bombletts_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() bombletts_fire1_01 = -{ - weapon_doattack(bombletts_check, bombletts_check, W_Bombletts_Attack); - weapon_thinkf(WFRAME_FIRE1, 0.3, bombletts_ready_01); -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/w_common.c b/TeamNexuiz/game/gamec/w_common.c deleted file mode 100644 index 525b5ec6c..000000000 --- a/TeamNexuiz/game/gamec/w_common.c +++ /dev/null @@ -1,977 +0,0 @@ - -// increments sprite frame, loops when end is hit.. simple - -float TE_SMOKE =77; -void (vector vec) WriteVec = -{ - WriteCoord (MSG_BROADCAST, vec_x); - WriteCoord (MSG_BROADCAST, vec_y); - WriteCoord (MSG_BROADCAST, vec_z); -} -void (vector org, vector dir, float counts) W_Smoke = -{ - WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte (MSG_BROADCAST, TE_SMOKE); - WriteVec (org); - WriteVec (dir); - WriteByte (MSG_BROADCAST, counts); -} - -// increments sprite frame, loops when end is hit.. simple -void animate_sprite (float startframe, float frame_count) -{ - if ((self.frame - startframe) >= (frame_count - 1 )) - self.frame = startframe; - else - self.frame = self.frame + 1; -} - -void W_UpdateAmmo (void) -{ - /* - self.items = self.items - (self.items & (IT_NAILS | IT_SHELLS | IT_ROCKETS | IT_CELLS)); - - if (self.weapon == IT_LASER) - self.currentammo = 1; - else if (self.weapon == IT_SHOTGUN) - { - self.currentammo = self.ammo_shells; - self.items = self.items | IT_SHELLS; - } - else if (self.weapon == IT_UZI) - { - self.currentammo = self.ammo_nails; - self.items = self.items | IT_NAILS; - } - else if (self.weapon == IT_GRENADE_LAUNCHER || self.weapon == IT_HAGAR || self.weapon == IT_ROCKET_LAUNCHER) - { - self.currentammo = self.ammo_rockets; - self.items = self.items | IT_ROCKETS; - } - else if (self.weapon == IT_ELECTRO || self.weapon == IT_NEX || self.weapon == IT_CRYLINK) - { - self.currentammo = self.ammo_cells; - self.items = self.items | IT_CELLS; - } - */ -} - -void W_UpdateWeapon (void) -{ - /* - if (self.weapon == IT_LASER) - self.weaponmodel = "models/weapons/w_laser.zym"; - else if (self.weapon == IT_SHOTGUN) - self.weaponmodel = "models/weapons/w_shotgun.zym"; - else if (self.weapon == IT_UZI) - self.weaponmodel = "models/weapons/w_uzi.zym"; - else if (self.weapon == IT_GRENADE_LAUNCHER) - self.weaponmodel = "models/weapons/w_gl.zym"; - else if (self.weapon == IT_ELECTRO) - self.weaponmodel = "models/weapons/w_electro.zym"; - else if (self.weapon == IT_CRYLINK) - self.weaponmodel = "models/weapons/w_crylink.zym"; - else if (self.weapon == IT_NEX) - self.weaponmodel = "models/weapons/w_nex.zym"; - else if (self.weapon == IT_HAGAR) - self.weaponmodel = "models/weapons/w_hagar.zym"; - else if (self.weapon == IT_ROCKET_LAUNCHER) - self.weaponmodel = "models/weapons/w_rl.zym"; - else - objerror ("Illegal weapon - please register your guns please!"); - */ -} - -float W_GetBestWeapon (entity e) -{ - /* - if ((e.items & IT_ROCKET_LAUNCHER) && e.ammo_rockets) - return IT_ROCKET_LAUNCHER; - else if ((e.items & IT_NEX) && e.ammo_cells) - return IT_NEX; - else if ((e.items & IT_HAGAR) && e.ammo_rockets) - return IT_HAGAR; - else if ((e.items & IT_GRENADE_LAUNCHER) && e.ammo_rockets) - return IT_GRENADE_LAUNCHER; - else if ((e.items & IT_ELECTRO) && e.ammo_cells) - return IT_ELECTRO; - else if ((e.items & IT_CRYLINK) && e.ammo_cells) - return IT_CRYLINK; - else if ((e.items & IT_UZI) && e.ammo_nails) - return IT_UZI; - else if ((e.items & IT_SHOTGUN) && e.ammo_shells) - return IT_SHOTGUN; - else - - */ - return IT_LASER; -} - -void ResetExtraWeapon() -{ - if(self.wpn5 == world) - { - self.wpn5 = spawn(); - } - - self.wpn5.weapon = 0; - self.wpn5.mass = 0; - self.items = self.items - (self.items & IT_WEP5); -} - -void W_GiveWeapon (entity e, float wep, string name, float wmass) -{ - entity oldself; - - if (!wep) - return; - - //e.items = e.items | wep; - - oldself = self; - self = e; - - self.wpn5.weapon = wep; - self.wpn5.mass = wmass; - - self.items = self.items | IT_WEP5; - - weapon_action(self.weapon, WR_UPDATECOUNTS); - if(self.weapon == WEP5) // if using carrying # 5 already - { - //bprint("reset wep5\n"); - self.wpn = self.wpn5.weapon; - self.switchweapon = WEP5; - weapon_action(self.weapon, WR_DROP); - self.weapon = 0; - //weapon_action(self.wpn, WR_SETUP); // update the weapon we're holding - //weapon_action(self.wpn, WR_RAISE); // update the weapon we're holding - } - - if (other.classname == "player") - { - sprint (other, "You got the ^2"); - sprint (other, name); - sprint (other, "\n"); - } - - -/* - W_UpdateWeapon (); - W_UpdateAmmo (); -*/ - self = oldself; -} - -/* -void W_SwitchWeapon (float wep) -{ - float nextwep; - var float noammo = FALSE; - - if (wep == 1) - nextwep = IT_LASER; - else if (wep == 2) - { - nextwep = IT_SHOTGUN; - if (!self.ammo_shells) - noammo = TRUE; - } - else if (wep == 3) - { - nextwep = IT_UZI; - if (!self.ammo_nails) - noammo = TRUE; - } - else if (wep == 4) - { - nextwep = IT_CRYLINK; - if (!self.ammo_cells) - noammo = TRUE; - } - else if (wep == 5) - { - nextwep = IT_ELECTRO; - if (!self.ammo_cells) - noammo = TRUE; - } - else if (wep == 6) - { - nextwep = IT_GRENADE_LAUNCHER; - if (!self.ammo_rockets) - noammo = TRUE; - } - else if (wep == 7) - { - nextwep = IT_HAGAR; - if (!self.ammo_rockets) - noammo = TRUE; - } - else if (wep == 8) - { - nextwep = IT_NEX; - if (!self.ammo_cells) - noammo = TRUE; - } - else if (wep == 9) - { - nextwep = IT_ROCKET_LAUNCHER; - if (!self.ammo_rockets) - noammo = TRUE; - } - - - if (!(self.items & nextwep)) - { - sprint (self, "You don't own that weapon\n"); - return; - } - else if (noammo) - { - sprint (self, "You don't have any ammo for that weapon\n"); - return; - } - - self.weapon = nextwep; - W_UpdateWeapon (); - W_UpdateAmmo (); - self.attack_finished = time + 0.2; - if (self.viewzoom != 1) - self.viewzoom = 1; -} - -void W_NextWeapon (void) -{ - float noammo; - - while (TRUE) - { - noammo = FALSE; - - if (self.weapon == IT_ROCKET_LAUNCHER) - self.weapon = IT_LASER; - else if (self.weapon == IT_LASER) - { - self.weapon = IT_SHOTGUN; - if (!self.ammo_shells) - noammo = TRUE; - } - else if (self.weapon == IT_SHOTGUN) - { - self.weapon = IT_UZI; - if (!self.ammo_nails) - noammo = TRUE; - } - else if (self.weapon == IT_UZI) - { - self.weapon = IT_CRYLINK; - if (!self.ammo_cells) - noammo = TRUE; - } - else if (self.weapon == IT_CRYLINK) - { - self.weapon = IT_ELECTRO; - if (!self.ammo_cells) - noammo = TRUE; - } - else if (self.weapon == IT_ELECTRO) - { - self.weapon = IT_GRENADE_LAUNCHER; - if (!self.ammo_cells) - noammo = TRUE; - } - else if (self.weapon == IT_GRENADE_LAUNCHER) - { - self.weapon = IT_HAGAR; - if (!self.ammo_rockets) - noammo = TRUE; - } - else if (self.weapon == IT_HAGAR) - { - self.weapon = IT_NEX; - if (!self.ammo_rockets) - noammo = TRUE; - } - else if (self.weapon == IT_NEX) - { - self.weapon = IT_ROCKET_LAUNCHER; - if (!self.ammo_cells) - noammo = TRUE; - } - - if ((self.items & self.weapon) && !noammo) - { - W_UpdateWeapon (); - W_UpdateAmmo (); - return; - } - } -} - -void W_PreviousWeapon (void) -{ - float noammo; - - while (TRUE) - { - noammo = FALSE; - - if (self.weapon == IT_SHOTGUN) - self.weapon = IT_LASER; - else if (self.weapon == IT_UZI) - { - self.weapon = IT_SHOTGUN; - if (!self.ammo_shells) - noammo = TRUE; - } - else if (self.weapon == IT_CRYLINK) - { - self.weapon = IT_UZI; - if (!self.ammo_nails) - noammo = TRUE; - } - else if (self.weapon == IT_ELECTRO) - { - self.weapon = IT_CRYLINK; - if (!self.ammo_cells) - noammo = TRUE; - } - else if (self.weapon == IT_GRENADE_LAUNCHER) - { - self.weapon = IT_ELECTRO; - if (!self.ammo_cells) - noammo = TRUE; - } - else if (self.weapon == IT_HAGAR) - { - self.weapon = IT_GRENADE_LAUNCHER; - if (!self.ammo_rockets) - noammo = TRUE; - } - else if (self.weapon == IT_NEX) - { - self.weapon = IT_HAGAR; - if (!self.ammo_rockets) - noammo = TRUE; - } - else if (self.weapon == IT_ROCKET_LAUNCHER) - { - self.weapon = IT_NEX; - if (!self.ammo_cells) - noammo = TRUE; - } - else if (self.weapon == IT_LASER) - { - self.weapon = IT_ROCKET_LAUNCHER; - if (!self.ammo_rockets) - noammo = TRUE; - } - - if ((self.items & self.weapon) && !noammo) - { - W_UpdateWeapon (); - W_UpdateAmmo (); - return; - } - } -} -*/ -float W_CheckAmmo (void) -{ - if ((cvar("g_instagib") == 1) | (cvar("g_rocketarena") == 1)) - return TRUE; - - W_UpdateAmmo (); - if (self.weapon == IT_LASER) - return TRUE; - else if (self.currentammo) - return TRUE; - - self.weapon = W_GetBestWeapon (self); - W_UpdateWeapon (); - - return FALSE; -} - -/* -void FireRailgunBullet (vector src, float bdamage, vector dir, float spread, float deathtype) -{ - vector v, lastpos; - entity saveself, last; - vector org; - org = self.origin + self.view_ofs; - if (bdamage < 1) - return; - - last = self; - lastpos = src; - - while (bdamage > 0) - { - traceline_hitcorpse (self, org, org + v_forward * 4096 + v_right * crandom () * spread + v_up * crandom () * spread, FALSE, self); - last = trace_ent; - lastpos = trace_endpos; - if (trace_fraction != 1.0) - { - if (pointcontents(trace_endpos - dir*4) == CONTENT_SKY) - return; - - if (trace_ent.takedamage || trace_ent.classname == "case") - { - if (trace_ent.classname == "player" || trace_ent.classname == "corpse" || trace_ent.classname == "gib") - te_blood (trace_endpos, dir * bdamage * 16, bdamage); - Damage (trace_ent, self, self, bdamage, deathtype, trace_endpos, dir * bdamage); - } - } - if (last.solid == SOLID_BSP) - bdamage = 0; - } -} -*/ - -//vector railgun_hitlocation; -void FireRailgunBullet (vector start, vector end, float bdamage, float deathtype) -{ - local vector hitloc, force; - local entity ent; - //local entity explosion; - - force = normalize(end - start) * 800; //(bdamage * 10); - - // find how far the beam can go until it hits a wall - traceline (start, end, TRUE, self); - // go a little bit into the wall because we need to hit this wall later - end = trace_endpos + normalize(end - start); - - // trace multiple times until we hit a wall, each obstacle will be made - // non-solid so we can hit the next, while doing this we spawn effects and - // note down which entities were hit so we can damage them later - while (1) - { - traceline_hitcorpse (self, start, end, FALSE, self); - - // if it is world we can't hurt it so stop now - if (trace_ent == world || trace_fraction == 1) - break; - - // make the entity non-solid so we can hit the next one - trace_ent.railgunhit = TRUE; - trace_ent.railgunhitloc = trace_endpos; - trace_ent.railgunhitsolidbackup = trace_ent.solid; - - // stop if this is a wall - if (trace_ent.solid == SOLID_BSP) - break; - - // make the entity non-solid - trace_ent.solid = SOLID_NOT; - } - - // find all the entities the railgun hit and restore their solid state - ent = findfloat(world, railgunhit, TRUE); - while (ent) - { - // restore their solid type - ent.solid = ent.railgunhitsolidbackup; - ent = findfloat(ent, railgunhit, TRUE); - } - - // spawn a temporary explosion entity for RadiusDamage calls - //explosion = spawn(); - - // find all the entities the railgun hit and hurt them - ent = findfloat(world, railgunhit, TRUE); - while (ent) - { - // get the details we need to call the damage function - hitloc = ent.railgunhitloc; - ent.railgunhitloc = '0 0 0'; - ent.railgunhitsolidbackup = SOLID_NOT; - ent.railgunhit = FALSE; - - // apply the damage - if (ent.takedamage || ent.classname == "case") - Damage (ent, self, self, bdamage, deathtype, hitloc, force); - - // create a small explosion to throw gibs around (if applicable) - //setorigin (explosion, hitloc); - //RadiusDamage (explosion, self, 10, 0, 50, world, 300, deathtype); - - // advance to the next entity - ent = findfloat(ent, railgunhit, TRUE); - } - - // we're done with the explosion entity, remove it - //remove(explosion); -} - -void fireBullet2 (vector start, vector dir, float spread, float damage, float dtype, float tracer, float force) -{ - vector end; - float r; - local entity e; - - // use traceline_hitcorpse to make sure it can hit gibs and corpses too - dir = dir + randomvec() * spread; - end = start + dir * 4096; - traceline_hitcorpse (self, start, end, FALSE, self); - - if (tracer) - { - e = spawn(); - e.owner = self; - e.movetype = MOVETYPE_FLY; - e.solid = SOLID_NOT; - e.think = SUB_Remove; - e.nextthink = time + vlen(trace_endpos - start) / 6000; - e.velocity = dir * 6000; - e.angles = vectoangles(e.velocity); - setmodel (e, "models/tracer.mdl"); - setsize (e, '0 0 0', '0 0 0'); - setorigin (e, start); - e.effects = e.effects | EF_ADDITIVE; - } - - // FIXME - causes excessive 'tinking'. Hopefully remove "tink1.wav" from the ricochets with csqc - if ((trace_fraction != 1.0) && (pointcontents (trace_endpos) != CONTENT_SKY)) - { - if (trace_ent.solid == SOLID_BSP) - { - pointcontents (self.origin); - te_gunshot (trace_endpos); - r = random (); - if (r < 0.10) - PointSound (trace_endpos, "weapons/ric1.wav", 1, ATTN_NORM); - else if (r < 0.20) - PointSound (trace_endpos, "weapons/ric2.wav", 1, ATTN_NORM); - else if (r < 0.30) - PointSound (trace_endpos, "weapons/ric3.wav", 1, ATTN_NORM); - } - else if (trace_ent.classname == "player" || trace_ent.classname == "corpse" || trace_ent.classname == "gib") - sound (self, CHAN_BODY, "misc/hit.wav", 1, ATTN_NORM); - Damage (trace_ent, self, self, damage, dtype, trace_endpos, dir * force); - } -} - -void fireBullet (vector start, vector dir, float spread, float damage, float dtype, float tracer) -{ - fireBullet2(start, dir, spread, damage, dtype, tracer, damage * 5); // default force value -} - -/* -void W_Attack (void) -{ - if (self.deadflag != DEAD_NO) - { - if (self.death_time < time) - PutClientInServer(); - - return; - } - - if (!W_CheckAmmo ()) - return; - - makevectors (self.v_angle); - //if (self.weapon == IT_LASER) - // W_Laser_Attack (); - //if (self.weapon == IT_SHOTGUN) - //W_Shotgun_Attack (); - //else if (self.weapon == IT_UZI) - //W_Uzi_Attack (); - if (self.weapon == IT_CRYLINK) - W_Crylink_Attack (); - else if (self.weapon == IT_ELECTRO) - { - W_Electro_Attack (self.electrocount); - self.electrocount = self.electrocount + 1; - if (self.electrocount == 3) - self.electrocount = 0; - } - else if (self.weapon == IT_GRENADE_LAUNCHER) - W_Grenade_Attack (); - else if (self.weapon == IT_HAGAR) - W_Hagar_Attack (); - else if (self.weapon == IT_NEX) - W_Nex_Attack (); - //else if (self.weapon == IT_ROCKET_LAUNCHER) - // W_Rocket_Attack (); - - W_UpdateAmmo (); -} - -void W_SecondaryAttack (void) -{ - if (self.deadflag != DEAD_NO) - { - if (self.death_time < time) - PutClientInServer(); - - return; - } - - if (!W_CheckAmmo ()) - return; - - makevectors (self.v_angle); - //if (self.weapon == IT_LASER) - //W_Laser_Attack2 (); - //if (self.weapon == IT_SHOTGUN) - //W_Shotgun_Attack2 (); - //else if (self.weapon == IT_UZI) - //W_Uzi_Attack2 (); - else if (self.weapon == IT_CRYLINK) - W_Crylink_Attack2 (); - else if (self.weapon == IT_ELECTRO) { - W_Electro_Attack2 (self.electrocount); - self.electrocount = self.electrocount + 1; - if (self.electrocount == 3) - self.electrocount = 0; - } - else if (self.weapon == IT_GRENADE_LAUNCHER) - W_Grenade_Attack2 (); - else if (self.weapon == IT_HAGAR) - W_Hagar_Attack2 (); - else if (self.weapon == IT_NEX) - W_Nex_Attack2 (); - //else if (self.weapon == IT_ROCKET_LAUNCHER) - //W_Rocket_Attack2 (); - - W_UpdateAmmo (); -} - -void W_ThirdAttack (void) -{ - if (self.deadflag != DEAD_NO) - { - if (self.death_time < time) - PutClientInServer(); - - return; - } - - if (!W_CheckAmmo ()) - return; - - makevectors (self.v_angle); - //if (self.weapon == IT_LASER) - //W_Laser_Attack2 (); - //if (self.weapon == IT_SHOTGUN) - //W_Shotgun_Attack2 (); - //else if (self.weapon == IT_UZI) - //W_Uzi_Attack3 (); - else if (self.weapon == IT_CRYLINK) - W_Crylink_Attack2 (); - else if (self.weapon == IT_ELECTRO) { - W_Electro_Attack3 (self.electrocount); - self.electrocount = self.electrocount + 1; - if (self.electrocount == 3) - self.electrocount = 0; - } - else if (self.weapon == IT_GRENADE_LAUNCHER) - W_Grenade_Attack3 (); - else if (self.weapon == IT_HAGAR) - W_Hagar_Attack3 (); - else if (self.weapon == IT_NEX) - W_Nex_Attack2 (); - //else if (self.weapon == IT_ROCKET_LAUNCHER) - //W_Rocket_Attack3 (); - - W_UpdateAmmo (); -} -*/ - -float RateFlameDamage(float flametime, float flamedmg, float flamerate) -{ - // return (how much longer flame will last) * (how much to damage per think / how often to think) - return (flametime - time) * (flamedmg / flamerate); -} - -/*void FlamePuffThink() -{ - self.nextthink = time + self.cnt; - self.frame = self.frame + 1; - if(self.frame >= self.count) - self.think = SUB_Remove; -} -*/ -void FlameBurnTarget(); - - -entity CreateFlame(entity targ, entity attacker) -{ - entity f; - f = targ.onfire = spawn(); - f.classname = "burning"; - f.owner = attacker; - f.enemy = targ; - f.dmg = 0; - f.ltime = 0; - f.wait = 0; - f.think = FlameBurnTarget; - f.onfire = spawn(); - - f.effects = f.onfire.effects = EF_ADDITIVE; - f.scale = f.onfire.scale = 2; - - setmodel(f, "models/sprites/fire_top.spr32"); - setattachment(f, f.enemy, ""); - setmodel(f.onfire, "models/sprites/fire_base.spr32"); - - setorigin(f.onfire, '0 0 -5' * f.scale); - setorigin(f, '0 0 2' * f.scale + '0 0 20'); - setattachment(f.onfire, f, ""); - - return f; -} - -entity IgniteTarget (entity targ, entity attacker, float flametime, float flamedmg, float flamerate, float rateflame) -{ - entity f; - - //bprint("ignite targets?\n"); - - if(targ.class == CLASS_PYRO) - { - //flametime = flametime / 5; // pyros don't stay on fire for long - return world; // don't set pyros on fire - } - - if(targ.class == CLASS_MEDIC) - { - //flametime = flametime / 3; // medics don't stay on fire for long - return world; // don't set medics on fire - } - - f = targ.onfire; - if(f == world) - { - f = CreateFlame(targ, attacker); - } - else - { - if(f.nextthink <= 0) - f.nextthink = time + flamerate; - } - - -// bprint(ftos(f.wait), ", ", ftos(f.dmg), ", ", ftos(f.ltime), "\n"); - //bprint(ftos(flametime), ", ", ftos(flamedmg), ", ", ftos(flamerate), "\n"); -// bprint(ftos(RateFlameDamage(f.wait, f.dmg, f.ltime)), ", ", ftos(RateFlameDamage(flametime, flamedmg, flamerate)), "\n"); - - if(rateflame && RateFlameDamage(f.wait, f.dmg, f.ltime) > RateFlameDamage(time + flametime, flamedmg, flamerate)) - { - f.owner = attacker; // give the new attacker ownership of the burn damage - return f; // current damage rating is larger, don't replace it - } - - //bprint("burning success: ", ftos(flametime), "\n"); - - f.dmg = flamedmg; - f.ltime = flamerate; - f.wait = time + flametime; - - if(!f.nextthink || f.nextthink > time + f.ltime) - f.nextthink = time + f.ltime; - - return f; -} - -void ExtinguishFlame(entity targ) -{ - entity f, b; - if(!targ.onfire)//targ.onfire.classname != "burning") - return; - //bprint(strcat("ExtinguishFlame(", targ.classname, ") ", targ.onfire.classname, "\n")); - - f = targ.onfire; - b = targ.onfire.onfire; - - // fixme: hiss sound - - if(b) - { - b.think = SUB_Null; - b.nextthink = -1; - setmodel(b, "models/sprites/null.spr"); - setattachment(b, world, ""); - remove(b); // remove base model - //targ.onfire.onfire.think = SUB_Remove; - //targ.onfire.onfire.nextthink = time + 0.1; - f.onfire = world; - } - f.think = SUB_Null; - f.nextthink = -1; - setmodel(f, "models/sprites/null.spr"); - setattachment(f, world, ""); - //targ.onfire.think = SUB_Remove; - //targ.onfire.nextthink = time + 0.1; - remove(f); - targ.onfire = world; -} - -void FlameBurnTarget() -{ - entity head; - float flametime, flametimemax, radius, flameratio, distratio, edgeratio, damage; - //bprint("flame burn target\n"); - - if(self.enemy == world || self.enemy.classname == "gib") - { - if(self.enemy != world) - { - //bprint("on a gib, remove flame\n"); - //self.enemy.onfire = world; - ExtinguishFlame(self.enemy); - return; - } - //bprint("enemy is world, remove flame\n"); - self.think = SUB_Null; - self.nextthink = -1; - setmodel(self, "models/sprites/null.spr"); - setattachment(self, world, ""); - if(self.onfire) - { - self.onfire.think = SUB_Null; - self.onfire.nextthink = -1; - setmodel(self.onfire, "models/sprites/null.spr"); - setattachment(self.onfire, world, ""); - remove(self.onfire); - self.onfire = world; - } - remove(self); - return; - } - - if(self.wait < time || self.enemy.waterlevel > 2 || (!self.enemy.takedamage && self.enemy.classname != "grenade")) - { - /*if(self.enemy != world) - { - self.enemy.effects = self.enemy.effects - (self.enemy.effects & EF_FLAME); - self.enemy.onfire = world; - } - remove(self);*/ - ExtinguishFlame(self.enemy); - return; - } - self.nextthink = time + self.ltime; - - Damage (self.enemy, self, self.owner, self.dmg, DEATH_BURNING, self.enemy.origin - '0 0 5', '0 0 0');//'0 0 -1' * self.dmg); - - // flames spread to other targets - - radius = cvar("g_balance_heat_radius"); - head = findradius(self.enemy.origin, radius); - while(head) - { - if((head.takedamage || head.classname == "grenade") && head != self.enemy) - { - //bprint(strcat("maybe burn ", head.classname, "\n")); - // don't harm or spread to allies or pyros - //if(!(head.classname == "player" && (head.team == self.owner.team || head.class == CLASS_PYRO)) ) - if(head.classname == "player") - { - if(head.class == CLASS_PYRO || head.class == CLASS_MEDIC) // pyros & medics are mostly immune to fire - { head = head.chain; continue;} - if(head.team == self.owner.team && teamplay) // don't hurt teammates - { head = head.chain; continue;} - } - - traceline(self.enemy.origin, head.origin, TRUE, self); - if(trace_fraction >= 1) - { - //bprint(strcat("burn ", head.classname, "\n")); - edgeratio = cvar("g_balance_heat_edgeratio"); - distratio = ( 1 - (vlen(self.enemy.origin - head.origin) / radius) ); - flameratio = edgeratio + distratio*(1 - edgeratio); - - // increase the player's heat; if it goes over the max it'll get capped automatically by the cooldown code - //head.flame_heat = cvar("g_balance_maxheat"); - head.flame_heat = head.flame_heat + flameratio * cvar("g_balance_heatup_rate") * self.ltime; - //head.flame_heat_time = time; - - // deal direct damage from the heat radiated by the fire - damage = flameratio * self.dmg*cvar("g_balance_heat_damage"); - Damage (head, self, self.owner, damage, DEATH_BURNING, self.enemy.origin, '0 0 0'); - - if(head.flame_heat >= 1.0 && head.takedamage == DAMAGE_AIM && head.health > 0) - { - flametimemax = cvar("g_balance_heat_timemax"); - flametime = (self.wait - time) * cvar("g_balance_heat_transfer"); - if(flametime > flametimemax) - flametime = flametimemax; - - - //bprint(ftos(time), " - flame transfer - ", ftos(flametime), "\n"); - - - IgniteTarget(head, self.owner, flametime, self.dmg, self.ltime, TRUE); - } - } - } - head = head.chain; - } -} - - -void PoisonTarget(entity targ, float poisonDamage, float poisonTime, float ratepoison) -{ - if(targ.class == CLASS_MEDIC) - { - return; // don't poison medics - } - - if(ratepoison && targ.poison_damage > poisonDamage) - return; // current damage rating is larger, don't replace it - - targ.poison_damage = poisonDamage; - targ.poison_rate = poisonDamage / poisonTime; -} - - - - - - - - - - - -float W_LimitNumEnts(string clname, float num_allowed, void() DeathFunc) -{ - float num, oldest; - local entity e, selected; - e = world; - oldest = time + 1; - num = 0; - do - { - e = find(e, classname, clname); - if(e != world && e.owner == self) - { - num = num + 1; - if(e.create_time < oldest) - { - selected = e; - oldest = e.create_time; - } - } - }while(e); - - if(num > num_allowed) - { - if(selected != world) - { - e = self; - self = selected; - DeathFunc(); - self = e; - return TRUE; - } - else - bprint("error (W_LimitNumEnts): cannot find oldest entity\n"); - } - return FALSE; -} - diff --git a/TeamNexuiz/game/gamec/w_crylink.c b/TeamNexuiz/game/gamec/w_crylink.c deleted file mode 100644 index 9fa594e07..000000000 --- a/TeamNexuiz/game/gamec/w_crylink.c +++ /dev/null @@ -1,113 +0,0 @@ -void() crylink_ready_01; -void() crylink_fire1_01; -void() crylink_deselect_01; -void() crylink_select_01; - -.float gravity; - -float() crylink_check = -{ - if (self.ammo_cells >= 1) - return TRUE; - return FALSE; -}; - -void(float req) w_crylink = -{ - if (req == WR_IDLE) - crylink_ready_01(); - else if (req == WR_FIRE1 || req == WR_FIRE2) - weapon_prepareattack(crylink_check, crylink_check, crylink_fire1_01, cvar("g_balance_crylink_refire")); - else if (req == WR_RAISE) - crylink_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = self.ammo_cells; - else if (req == WR_DROP) - crylink_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_CRYLINK, "w_crylink.zym", IT_CELLS); - else if (req == WR_CHECKAMMO) - weapon_hasammo = crylink_check(); -}; - - -void W_Crylink_Touch (void) -{ - self.event_damage = SUB_Null; - //te_smallflash(self.origin); - RadiusDamage (self, self.owner, cvar("g_balance_crylink_damage"), cvar("g_balance_crylink_edgedamage"), cvar("g_balance_crylink_radius"), world, cvar("g_balance_crylink_force"), WEP_CRYLINK); - self.touch = SUB_Null; - setmodel (self, "models/plasma.mdl"); - setsize (self, '0 0 0', '0 0 0'); - self.gravity = 1; - self.glow_size = 0; - self.glow_color = 0; - self.think = SUB_Remove; - //self.movetype = MOVETYPE_NONE; - self.effects = EF_LOWPRECISION; - SUB_SetFade(self, time, 1); - //remove (self); -} - -void W_Crylink_Attack (void) -{ - local float counter; - local vector org; - local entity proj; - - sound (self, CHAN_WEAPON, "weapons/crylink.wav", 1, ATTN_NORM); - self.ammo_cells = self.ammo_cells - 1; - self.punchangle_x = -2; - org = self.origin + self.view_ofs + v_forward * 10 + v_right * 5 + v_up * -14; - te_smallflash(org); - - while (counter < 5) - { - proj = spawn (); - proj.owner = self; - proj.classname = "spike"; - - proj.movetype = MOVETYPE_BOUNCE; - proj.solid = SOLID_BBOX; - proj.gravity = 0.001; - - setmodel (proj, "models/plasmatrail.mdl"); - setsize (proj, '0 0 0', '0 0 0'); - setorigin (proj, org); - - if (self.button3) - proj.velocity = (v_forward + (counter / 2 - 1) * v_right * cvar("g_balance_crylink_spread")) * cvar("g_balance_crylink_speed"); - else - proj.velocity = (v_forward + (counter / 5) * randomvec() * cvar("g_balance_crylink_spread")) * cvar("g_balance_crylink_speed"); - proj.touch = W_Crylink_Touch; - proj.think = SUB_Remove; - proj.nextthink = time + 9; - - proj.angles = vectoangles (proj.velocity); - - //proj.glow_size = 20; - - proj.effects = proj.effects | EF_FULLBRIGHT; - //proj.effects = proj.effects | EF_ADDITIVE; - proj.effects = proj.effects | EF_LOWPRECISION; - counter = counter + 1; - } - - self.clip_crylink -= 1; - if (self.clip_crylink <= 0) - { - DoReload (2, CLIP_MAX_CRYLINK); // Crylink is weapon 2, reloads for max clip of weapon. - } -} - - -// weapon frames -void() crylink_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, crylink_ready_01); self.weaponentity.state = WS_READY;}; -void() crylink_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() crylink_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() crylink_fire1_01 = -{ - weapon_doattack(crylink_check, crylink_check, W_Crylink_Attack); - weapon_thinkf(WFRAME_FIRE1, 0.15, crylink_ready_01); -}; - diff --git a/TeamNexuiz/game/gamec/w_electro.c b/TeamNexuiz/game/gamec/w_electro.c deleted file mode 100644 index 8f2490d3a..000000000 --- a/TeamNexuiz/game/gamec/w_electro.c +++ /dev/null @@ -1,137 +0,0 @@ -void() electro_ready_01; -void() electro_fire1_01; -void() electro_deselect_01; -void() electro_select_01; - -float() electro_check = -{ - if (self.ammo_cells > 2) - return TRUE; - return FALSE; -}; - -void(float req) w_electro = -{ - if (req == WR_IDLE) - electro_ready_01(); - else if (req == WR_FIRE1 || req == WR_FIRE2) - weapon_prepareattack(electro_check, electro_check, electro_fire1_01, cvar("g_balance_electro_refire")); - else if (req == WR_RAISE) - electro_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = floor(self.ammo_cells / 2); - else if (req == WR_DROP) - electro_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_ELECTRO, "w_electro.zym", IT_CELLS); - else if (req == WR_CHECKAMMO) - weapon_hasammo = electro_check(); -}; - -void W_Plasma_Explode (void) -{ - WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte (MSG_BROADCAST, 79); - WriteCoord (MSG_BROADCAST, self.origin_x); - WriteCoord (MSG_BROADCAST, self.origin_y); - WriteCoord (MSG_BROADCAST, self.origin_z); - WriteCoord (MSG_BROADCAST, 0); // SeienAbunae: groan... Useless clutter - WriteCoord (MSG_BROADCAST, 0); - WriteCoord (MSG_BROADCAST, 0); - WriteByte (MSG_BROADCAST, 155); - - self.event_damage = SUB_Null; - RadiusDamage (self, self.owner, cvar("g_balance_electro_damage"), cvar("g_balance_electro_edgedamage"), cvar("g_balance_electro_radius"), world, cvar("g_balance_electro_force"), WEP_ELECTRO); - sound (self, CHAN_BODY, "weapons/electro_impact.wav", 1, ATTN_NORM); - - remove (self); -} - -void W_Plasma_Touch (void) -{ - if (other.classname == "player" || other.classname == "corpse") - W_Plasma_Explode (); - else - sound (self, CHAN_IMPACT, "weapons/grenade_bounce.wav", 1, ATTN_NORM); -} - -void W_Plasma_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - self.health = self.health - damage; - if (self.health <= 0) - W_Plasma_Explode (); -} - -void() W_Electro_Attack -{ - local entity proj; - local vector org; - local float postion; - - postion = self.electrocount; - sound (self, CHAN_WEAPON, "weapons/electro_fire.wav", 1, ATTN_NORM); - - self.punchangle_x = -2; - - self.ammo_cells = self.ammo_cells - 2; - - if (self.electrocount == 0) - { - self.electrocount = 1; - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -14; - } - else if (self.electrocount == 1) - { - self.electrocount = 2; - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 10 + v_up * -12; - } - else - { - self.electrocount = 0; - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 15 + v_up * -14; - } - - proj = spawn (); - proj.classname = "plasma"; - proj.owner = self; - proj.effects = EF_BRIGHTFIELD | EF_ADDITIVE; - proj.think = W_Plasma_Explode; - proj.nextthink = time + 2; - proj.solid = SOLID_BBOX; - setorigin(proj, org); - - if (self.button3) - { - proj.movetype = MOVETYPE_BOUNCE; - proj.velocity = v_forward * cvar("g_balance_electro_ballspeed") + v_up * cvar("g_balance_electro_ballspeed_up"); - proj.touch = W_Plasma_Touch; - setmodel(proj, "models/ebomb.mdl"); - setsize(proj, '-6 -6 -3', '6 6 3'); - proj.takedamage = DAMAGE_YES; - proj.damageforcescale = 4; - proj.health = 5; - proj.event_damage = W_Plasma_Damage; - } - else - { - proj.movetype = MOVETYPE_FLY; - proj.velocity = v_forward * cvar("g_balance_electro_speed"); - proj.angles = vectoangles(proj.velocity); - proj.touch = W_Plasma_Explode; - setmodel(proj, "models/elaser.mdl"); - setsize(proj, '0 0 0', '0 0 0'); - } - sound (proj, CHAN_BODY, "weapons/electro_fly.wav", 1, ATTN_NORM); -} - -// weapon frames - -void() electro_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, electro_ready_01); self.weaponentity.state = WS_READY;}; -void() electro_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() electro_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() electro_fire1_01 = -{ - weapon_doattack(electro_check, electro_check, W_Electro_Attack); - weapon_thinkf(WFRAME_FIRE1, 0.3, electro_ready_01); -}; - diff --git a/TeamNexuiz/game/gamec/w_flamer.c b/TeamNexuiz/game/gamec/w_flamer.c deleted file mode 100644 index 2d7440454..000000000 --- a/TeamNexuiz/game/gamec/w_flamer.c +++ /dev/null @@ -1,139 +0,0 @@ -void() flamer_ready_01; -void() flamer_fire1_01; -void() flamer_deselect_01; -void() flamer_select_01; - -float() flamer_check = -{ - if (self.ammo_nails >= 4) - return TRUE; - return FALSE; -}; - -void(float req) w_flamer = -{ - if (req == WR_IDLE) - flamer_ready_01(); - else if (req == WR_FIRE1 || req == WR_FIRE2) - weapon_prepareattack(flamer_check, flamer_check, flamer_fire1_01, cvar("g_balance_flamer_refire")); - else if (req == WR_RAISE) - flamer_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = floor(self.ammo_nails/4); - else if (req == WR_DROP) - flamer_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_FLAMER, "w_flamer.zym", IT_ROCKETS); - else if (req == WR_CHECKAMMO) - weapon_hasammo = flamer_check(); -}; - -void W_Flamer_Touch (void) -{ - float wasliving, burntime, minburntime, maxburntime; - if (other == self.owner) - return; - else if (pointcontents (self.origin) == CONTENT_SKY) - { - remove (self); - return; - } - -// dillute = 1 - 0.65*(1 - self.alpha); -// dillute = 1 - cvar("g_balance_flamer_dillute")*(self.frame / 20); - - wasliving = other.health; - if(!self.cnt) // direct damage only if haven't touched once before - { - RadiusDamage (self, self.owner, cvar("g_balance_flamer_damage"), cvar("g_balance_flamer_edgedamage"), cvar("g_balance_flamer_radius"), world, cvar("g_balance_flamer_force"), WEP_FLAMER); - - if(other.takedamage == DAMAGE_AIM)//health > 2) - { // ignite target or renew fire damage - burntime = other.onfire.wait - time; - minburntime = cvar("g_balance_flamer_burntime"); - maxburntime = cvar("g_balance_flamer_burntime_max"); - if(burntime < minburntime) - burntime = minburntime; - else - burntime = burntime + cvar("g_balance_flamer_burntime_inc"); - - if(burntime > maxburntime) - burntime = maxburntime; - - - IgniteTarget(other, self.owner, - burntime, - cvar("g_balance_flamer_burndamage"), - cvar("g_balance_flamer_burnrate"), - TRUE); - } - } - - if(wasliving > 2) - self.cnt = 1; // once it's touched something it can damage, it can't directly damage anymore, or set on fire or renew the flame damage (just for looks) - self.velocity_x = self.velocity_x * 0.5; - self.velocity_y = self.velocity_y * 0.5; -} - -// fade the flame off, the only way the fire can be destroyed -void W_Flamer_Dissipate () -{ - if (self.alpha < 0.01 || pointcontents (self.origin) == CONTENT_WATER)// || self.frame >= 20) - { - remove(self); - return; - } - self.scale = self.scale + 0.35;//0.2; - self.alpha = self.alpha - 0.08;//0.04; - self.frame = self.frame + 1; - if(self.frame > 20) - self.frame = 20; - self.think = W_Flamer_Dissipate; - self.nextthink = time + 0.1; - //if(self.colormod_y > 0) - self.colormod = self.colormod - '0 0.004 0.01' * 25;//'0 0.2 0.12'; // fade to red! -}; - -void W_Flamer_Attack (void) -{ - local entity missile; - local vector org; - - sound (self, CHAN_WEAPON, "weapons/flamer.wav", 1, ATTN_NORM); - self.ammo_nails = self.ammo_nails - 4; - org = self.origin + self.view_ofs + v_forward * 1 + v_right * 5 + v_up * -8; - - missile = spawn (); - missile.owner = self; - missile.classname = "flame"; - missile.think = W_Flamer_Dissipate; - missile.nextthink = time + 0.01; - missile.touch = W_Flamer_Touch; - missile.solid = SOLID_BBOX; - setorigin (missile, org); - setmodel (missile, "models/sprites/hagarexplosion.spr32"); - setsize (missile, '0 0 0', '0 0 0'); - missile.effects = EF_LOWPRECISION | EF_ADDITIVE; - missile.alpha = 0.7;//0.3; - missile.scale = 0.005;//0.015;//0.15; - missile.colormod = '1 1 1'; // set full colors, then reduce later - missile.frame = random() * 4 + 2; - - missile.movetype = MOVETYPE_BOUNCE; - missile.gravity = -0.07; // fall lightly up - missile.velocity = (v_forward + v_right * crandom() * 0.035 + v_up * crandom() * 0.015) * cvar("g_balance_flamer_speed"); - - missile.angles = vectoangles (missile.velocity); -} - -// weapon frames -void() flamer_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, flamer_ready_01); self.weaponentity.state = WS_READY;}; -void() flamer_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() flamer_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() flamer_fire1_01 = -{ - weapon_doattack(flamer_check, flamer_check, W_Flamer_Attack); - //weapon_thinkf(WFRAME_IDLE, 0.003, flamer_ready_01); - flamer_ready_01(); -}; - diff --git a/TeamNexuiz/game/gamec/w_grenadelauncher.c b/TeamNexuiz/game/gamec/w_grenadelauncher.c deleted file mode 100644 index 615e60c4e..000000000 --- a/TeamNexuiz/game/gamec/w_grenadelauncher.c +++ /dev/null @@ -1,112 +0,0 @@ -void() glauncher_ready_01; -void() glauncher_fire1_01; -void() glauncher_deselect_01; -void() glauncher_select_01; - -float() glauncher_check = -{ - if (self.ammo_rockets >= 2) - return TRUE; - return FALSE; -}; - -void(float req) w_glauncher = -{ - if (req == WR_IDLE) - glauncher_ready_01(); - else if (req == WR_FIRE1 || req == WR_FIRE2) - weapon_prepareattack(glauncher_check, glauncher_check, glauncher_fire1_01, cvar("g_balance_grenadelauncher_refire")); - else if (req == WR_RAISE) - glauncher_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = floor(self.ammo_rockets / 2); - else if (req == WR_DROP) - glauncher_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_GRENADE_LAUNCHER, "w_gl.zym", IT_ROCKETS); - else if (req == WR_CHECKAMMO) - weapon_hasammo = glauncher_check(); -}; - -void W_Grenade_Explode (void) -{ - vector org2; - org2 = findbetterlocation (self.origin); - te_explosion (org2); - effect (org2, "models/sprites/grenadeexplosion.spr32", 0, 20, 30); - sound (self, CHAN_BODY, "weapons/grenade_impact.wav", 1, ATTN_NORM); - - self.event_damage = SUB_Null; - RadiusDamage (self, self.owner, cvar("g_balance_grenadelauncher_damage"), cvar("g_balance_grenadelauncher_edgedamage"), cvar("g_balance_grenadelauncher_radius"), world, cvar("g_balance_grenadelauncher_force"), WEP_GRENADE_LAUNCHER); - - remove (self); -} - -void W_Grenade_Touch (void) -{ - if (other.classname == "player" || other.classname == "corpse") - W_Grenade_Explode (); - else - sound (self, CHAN_IMPACT, "weapons/grenade_bounce.wav", 1, ATTN_NORM); -} - -void W_Grenade_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - self.health = self.health - damage; - if (self.health <= 0) - W_Grenade_Explode(); -} - -void W_Grenade_Attack (void) -{ - local entity gren; - local vector org; - - sound (self, CHAN_WEAPON, "weapons/grenade_fire.wav", 1, ATTN_NORM); - self.punchangle_x = -4; - self.ammo_rockets = self.ammo_rockets - 2; - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -12; - - gren = spawn (); - gren.owner = self; - gren.classname = "grenade"; - gren.movetype = MOVETYPE_BOUNCE; - gren.solid = SOLID_BBOX; - setmodel(gren, "models/grenademodel.md3"); - setsize(gren, '-6 -6 -3', '6 6 3'); - setorigin(gren, org); - - if (self.button3) - { - gren.nextthink = time + 2.5; - gren.think = W_Grenade_Explode; - gren.touch = W_Grenade_Touch; - gren.takedamage = DAMAGE_YES; - gren.health = 10; - gren.damageforcescale = 4; - gren.event_damage = W_Grenade_Damage; - gren.velocity = v_forward * cvar("g_balance_grenadelauncher_speed2") + v_up * cvar("g_balance_grenadelauncher_speed2_up"); - gren.avelocity = '100 150 100'; - } - else - { - gren.nextthink = time + 30; - gren.think = W_Grenade_Explode; - gren.touch = W_Grenade_Explode; - gren.velocity = v_forward * cvar("g_balance_grenadelauncher_speed") + v_up * cvar("g_balance_grenadelauncher_speed_up"); - gren.avelocity_x = random () * -500 - 500; - } - - gren.angles = vectoangles (gren.velocity); -} - -// weapon frames - -void() glauncher_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, glauncher_ready_01); self.weaponentity.state = WS_READY;}; -void() glauncher_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() glauncher_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() glauncher_fire1_01 = -{ - weapon_doattack(glauncher_check, glauncher_check, W_Grenade_Attack); - weapon_thinkf(WFRAME_FIRE1, 0.3, glauncher_ready_01); -}; \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/w_grenades.c b/TeamNexuiz/game/gamec/w_grenades.c deleted file mode 100644 index d18134dc1..000000000 --- a/TeamNexuiz/game/gamec/w_grenades.c +++ /dev/null @@ -1,841 +0,0 @@ -void W_Grenade_DefaultTouch (void) -{ - if (!self.state & 1 && (other.classname == "player" || other.classname == "corpse")) - self.think(); // assume my think was an explosion function - else - sound (self, CHAN_IMPACT, "weapons/grenade_bounce.wav", 1, ATTN_NORM); -} - -void W_Grenade_DefaultDamage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - self.health = self.health - damage; - if (self.health <= 0) - self.think(); // assume my think was an explosion function -} - -float W_ThrowGrenade(void() GrenadeSpecial) -{ - local entity gren, oself; - local vector org; - - if(self.ammo_shells < 10) - { - sprint(self, "Not enough grenade ammo\n"); - self.grenade_time = time + 0.3; - return FALSE; - } - self.ammo_shells = self.ammo_shells - 10; - -// sound (self, CHAN_WEAPON, "weapons/grenade_fire.wav", 1, ATTN_NORM); - self.punchangle_x = -2; - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -12; - - gren = spawn (); - gren.owner = self; - gren.classname = "grenade"; - gren.movetype = MOVETYPE_BOUNCE; - gren.solid = SOLID_BBOX; - setorigin(gren, org); - - gren.takedamage = DAMAGE_YES; - gren.health = 10; - //gren.damageforcescale = 4; - gren.event_damage = W_Grenade_DefaultDamage; - - oself = self; - self = gren; - - GrenadeSpecial(); - - self = oself; - - return TRUE; -} - -//-------------------------------------------- - -void InflictStunStatus(entity targ, float stuntime) -{ - if(targ.classname != "player") - return; // only players can be stunned (fixme: turrets? vehicles?) - - // stun target by increasing attack_finished so he can't attack - if(targ.attack_finished < time + stuntime) - targ.attack_finished = time + stuntime; - - // also prevent use of grenades - // disabled, since the point of the grenades is being - // able to attack when weapon is busy or disabled - //if(targ.grenade_time < time + stuntime) - // targ.grenade_time = time + stuntime; -} - -//-------------------------------------------- - -void ExtinguishFirebomb(entity e) -{ - entity f, b; - if(e.enemy == world) - { - //bprint("ExtinguishFirebomb failed, no enemy!\n"); - return; - } - //bprint(strcat("ExtinguishFirebomb(", e.classname, ") ", e.enemy.classname, "\n")); - - f = e.enemy; - b = e.enemy.enemy; - - e.enemy = world; - f.enemy = world; - - f.think = SUB_Null; - f.nextthink = -1; - setmodel(f, "models/sprites/null.spr"); - setattachment(f, world, ""); - if(b) - { - b.think = SUB_Null; - b.nextthink = -1; - setmodel(b, "models/sprites/null.spr"); - setattachment(b, world, ""); - remove(b); - //b.think = SUB_Remove; - //b.nextthink = time + 2; - } - setmodel(e, ""); - //f.think = SUB_Remove; - //f.nextthink = time + 2; - //eprint(f); - remove(f); - //eprint(f); -} - -void Firebomb_Flame_Check() -{ - if(self.owner == world || self.owner.model == "") - { - if(self.owner != world && self.owner.enemy == self) - { - //bprint("Firebomb flame calls ExtinguishFirebomb on owner\n"); - - ExtinguishFirebomb(self.owner); - self.owner.enemy = world; - return; - } - //bprint("Firebomb flame resorts to deleting itself!\n"); - setattachment(self, world, ""); - setattachment(self.enemy, world, ""); - setmodel(self, ""); - setmodel(self.enemy, ""); - self.think = self.enemy.think = SUB_Remove; - self.nextthink = self.enemy.nextthink = time + 1; - } - - self.nextthink = time + 0.5; -} - -void W_Firebomb_Think () -{ - entity head; - float flametime, flamedmg, flamerate, flameedge, flameradius, distratio; - - self.nextthink = time + cvar("g_balance_grenade_firebomb_burnrate"); - - if(self.wait < time || self.enemy == world) - { - //bprint("Firebomb deletes its flame\n"); - ExtinguishFirebomb(self); - - setmodel(self, ""); - self.think = SUB_Remove; - self.nextthink = time + 2.2; - return; - } - - flameradius = cvar("g_balance_grenade_firebomb_burnradius"); - flamedmg = cvar("g_balance_grenade_firebomb_flamedmg"); - flamerate = cvar("g_balance_grenade_firebomb_flamerate"); - flametime = cvar("g_balance_grenade_firebomb_flametime"); - flameedge = cvar("g_balance_grenade_firebomb_edgeratio"); - - RadiusDamage (self, self.owner, - cvar("g_balance_grenade_firebomb_burndmg"), - cvar("g_balance_grenade_firebomb_burndmg")*flameedge, - cvar("g_balance_grenade_firebomb_burnradius"), world, - 0, DEATH_BURNING); - - head = findradius(self.origin, flameradius); - while(head) - { - if(head.takedamage == DAMAGE_AIM)//head.classname == "player" || head.classname == "turret") - { - traceline(self.origin, head.origin, TRUE, self); - if(trace_fraction >= 1) - { - distratio = 1 - (vlen(head.origin - self.origin) / flameradius); - IgniteTarget(head, self.owner, - (flametime*flameedge) + (flametime - flameedge)*distratio, - flamedmg, - flamerate, - TRUE); - } - } - head = head.chain; - } - - -/* radius = cvar("g_balance_grenade_firebomb_burnradius"); - head = findradius(self.origin, radius); - while(head) - { - //bprint("firebomb see target\n"); - if((head.takedamage || head.classname == "grenade") && head != self.enemy && head != self) - { - //bprint("firebomb try to burn target\n"); - // don't harm or spread to allies or pyros - if(!(head.classname == "player" && (head.team == self.team || head.class == CLASS_PYRO)) ) - { - //bprint("firebomb burn target\n"); - edgeratio = cvar("g_balance_heat_edgeratio"); - distratio = ( 1 - (vlen(self.enemy.origin - head.origin) / radius) ); - flameratio = edgeratio + distratio*(1 - edgeratio); - - // deal direct damage from the heat radiated by the fire - damage = flameratio * cvar("g_balance_grenade_firebomb_burndmg"); - Damage (head, self, self.owner, damage, DEATH_BURNING, self.enemy.origin, '0 0 0'); - - if(head.takedamage == DAMAGE_AIM) - { - IgniteTarget(head, self.owner, - cvar("g_balance_grenade_firebomb_flametime"), - cvar("g_balance_grenade_firebomb_flamedmg"), - cvar("g_balance_grenade_firebomb_flamerate"), TRUE); - } - } - } - head = head.chain; - } - */ -} - -void W_Firebomb_Activate (void) -{ - // set bomb on fire visually -/* CreateFlame(self, self.owner); - self.onfire.think = SUB_Null; - self.onfire.nextthink = -1; - self.onfire.colormod = self.onfire.onfire.colormod = '128 255 128'*(1/255)*1;//'255 128 64'*(1/255)*1;//3; -*/ - - entity f; - f = self.enemy = spawn(); - f.enemy = spawn(); - f.classname = f.enemy.classname = "firebomb_flame"; - f.owner = self; - f.dmg = 0; - f.ltime = 0; - f.wait = 0; - f.think = Firebomb_Flame_Check; - f.nextthink = time; - - f.colormod = f.enemy.colormod = - stov(cvar_string("g_balance_grenade_firebomb_flamecolor"))*(1/255) - *cvar("g_balance_grenade_firebomb_flamec_strength");//0.3;//'128 128 255'*(1/255)*3;//'255 128 64'*(1/255)*1;//3; - //f.alpha = f.enemy.alpha = 0.6; - f.effects = f.enemy.effects = EF_ADDITIVE; - f.scale = f.enemy.scale = 2; - - setmodel(f, "models/sprites/fire_top.spr32"); - setmodel(f.enemy, "models/sprites/fire_base.spr32"); - - setorigin(f.enemy, '0 0 -5' * f.scale); - setorigin(f, '0 0 2' * f.scale + '0 0 20'); - - setattachment(f, f.owner, ""); - setattachment(f.enemy, f, ""); - - // burn targets each frame - self.wait = time + cvar("g_balance_grenade_firebomb_burntime"); - self.event_damage = SUB_Null; - self.takedamage = 0; - self.movetype = MOVETYPE_TOSS; - self.angles = '0 0 0'; - self.touch = SUB_Null; - self.think = W_Firebomb_Think; - self.nextthink = time; -} - -void W_Firebomb() -{ - setmodel(self, "models/grenademodel.md3"); - setsize(self, '-6 -6 -3', '6 6 3'); - - self.classname = "firebomb"; // don't get bounced around like other grenades - - self.nextthink = time + 3; - self.think = W_Firebomb_Activate; - self.touch = W_Firebomb_Activate; - self.state = 1; // don't explode on contact with player - self.velocity = v_forward * cvar("g_balance_grenade_firebomb_speed") - + v_up * cvar("g_balance_grenade_frag_firebomb_up"); - self.avelocity = '-500 0 0'; - //self.event_damage = SUB_Null; - - self.colormod = '255 128 0'*(1/255)*2; - self.scale = 1.5; - - self.angles = vectoangles (self.velocity); -} - -//-------------------------------------------- - -void W_ConcussionGrenade_Explode (void) -{ - vector org2; - float radius, spd, spd_up, stuntime, sim_jump_pad; - entity head; - - org2 = findbetterlocation (self.origin); - te_explosionrgb (org2, (1/255)*'255 128 0'); - // fixme: need different sound - sound (self, CHAN_VOICE, "weapons/grenade_impact.wav", 1, ATTN_NORM); - - self.event_damage = SUB_Null; - - radius = cvar("g_balance_grenade_concussion_radius"); - spd = cvar("g_balance_grenade_concussion_force"); - spd_up = cvar("g_balance_grenade_concussion_force_up"); - stuntime = cvar("g_balance_grenade_concussion_stuntime"); - sim_jump_pad = !cvar("g_balance_grenade_concussion_restrictflight"); - - // extinguish flames in radius (even those not burning a player) - head = world; - do - { - head = find(head, classname, "burning"); - if(head != world && vlen(head.enemy.origin - self.origin) <= radius) - { - traceline(self.origin, head.enemy.origin, TRUE, self); - if(trace_fraction >= 1) - { - ExtinguishFlame(head.enemy); - } - } - }while(head); - - - - // extinguish firebombs - head = world; - do - { - head = find(head, classname, "firebomb"); - if(head != world && vlen(head.origin - self.origin) <= radius) - { - traceline(self.origin, head.origin, TRUE, self); - if(trace_fraction >= 1) - { - ExtinguishFirebomb(head); - } - } - }while(head); - - - - // also extinguish napalm - head = world; - do - { - head = find(head, classname, "napalm"); - if(head != world && vlen(head.origin - self.origin) <= radius) - { - traceline(self.origin, head.origin, TRUE, self); - if(trace_fraction >= 1) - { - head.think = SUB_Remove; - head.nextthink = time; - //remove(head); - //return; - } - } - }while(head); - - - - - // throw hapless players - head = world; - do - { - head = findfloat(head, movetype, MOVETYPE_WALK); - if(head != world && vlen(head.origin - self.origin) <= radius) - { - traceline(self.origin, head.origin, TRUE, self); - if(trace_fraction >= 1) - { - if(sim_jump_pad && head.classname == "player" && !head.jump_pad) - head.jump_pad = 1; - head.velocity = head.velocity + normalize(head.origin - self.origin) * spd + '0 0 1'*spd_up; - - // stun status - InflictStunStatus(head, stuntime); - } - } - }while(head); - - remove (self); -} - -void W_ConcussionGrenade() -{ - setmodel(self, "models/grenademodel.md3"); - setsize(self, '-6 -6 -3', '6 6 3'); - - self.nextthink = time + 1.5 + random()*0.5; - self.think = W_ConcussionGrenade_Explode; - self.touch = W_Grenade_DefaultTouch; - self.state = 1; // don't explode on contact with player - self.velocity = v_forward * cvar("g_balance_grenade_concussion_speed") - + v_up * cvar("g_balance_grenade_concussion_speed_up"); - self.avelocity = '100 150 100'; - - self.angles = vectoangles (self.velocity); -} - -//-------------------------------------------- - -// touch the player and go *poke* -void W_NailGrenade_Spike_Poke (void) -{ - if (other == self.owner) - return; - else if (pointcontents (self.origin) == CONTENT_SKY) - { - remove (self); - return; - } - - if(other.takedamage) - Damage (other, self, self.enemy, self.dmg, WEP_NAMEK, self.origin, normalize(self.velocity) * cvar("g_balance_grenade_nail_spikeforce")); - else - { - te_spark(self.origin, normalize(self.velocity) * -70 - '0 0 100', 30); - te_gunshot(self.origin); - } - - remove (self); -} - -void W_NailGrenade_Spike(vector org, vector vel, float damage) -{ - entity spike; - spike = spawn (); - spike.enemy = self.owner; - spike.owner = self; - spike.classname = "spike"; - - // some downward curving - spike.movetype = MOVETYPE_BOUNCE; - spike.gravity = cvar("g_balance_grenade_nail_spikegrav"); - spike.solid = SOLID_BBOX; - setmodel(spike, "models/plasmatrail.mdl"); - setsize(spike, '0 0 0', '0 0 0'); - setorigin(spike, org); - - spike.dmg = damage; - - spike.nextthink = time + 3 + random()*0.5; - spike.think = SUB_Remove; - spike.touch = W_NailGrenade_Spike_Poke; - spike.velocity = vel; - spike.angles = vectoangles (spike.velocity); - spike.scale = 0.75; -} - -void W_NailGrenade_Attack (void) -{ - float r, num, maxnum, is_odd, spread, starty, incy; - vector ang; - - r = ceil(random()*3); - if(r == 1) - sound (self, CHAN_IMPACT, "weapons/ric1.wav", 1, ATTN_NORM); - else if(r == 2) - sound (self, CHAN_IMPACT, "weapons/ric2.wav", 1, ATTN_NORM); - else - sound (self, CHAN_IMPACT, "weapons/ric3.wav", 1, ATTN_NORM); - - num = 0; - maxnum = cvar("g_balance_grenade_nail_numspikes"); - spread = cvar("g_balance_grenade_nail_spread"); - - is_odd = (floor(maxnum / 2) != maxnum / 2); //true if maxnum is an odd number - - if(is_odd) - { - incy = (1 / maxnum) * spread; - starty = self.mangle_y - (incy * maxnum/2) + incy*0.5; - } - else - { - incy = (1 / maxnum) * spread; - starty = self.mangle_y - (incy * maxnum/2) + incy*0.5; - } - - ang_z = self.mangle_z; - ang_x = self.mangle_x; - ang_y = starty; - - while(num < maxnum) - { - makevectors(ang); - W_NailGrenade_Spike(self.origin, v_forward*cvar("g_balance_grenade_nail_spikespeed") , cvar("g_balance_grenade_nail_spikedamage")); - W_NailGrenade_Spike(self.origin, v_forward*cvar("g_balance_grenade_nail_spikespeed") * -1, cvar("g_balance_grenade_nail_spikedamage")); - num = num + 1; - ang_y = ang_y + incy; - } - - self.count = self.count - 1; - - if(self.count > 0) - { - // change shooting angle and fire again - self.mangle_y = self.mangle_y + cvar("g_balance_grenade_nail_anglechange"); - self.think = W_NailGrenade_Attack; - self.nextthink = time + cvar("g_balance_grenade_nail_cluster_rate"); - } - else - { - // fall to ground & disappear - self.alpha = 0.5; - self.gravity = 0; - self.touch = SUB_Remove; - self.think = self.touch; - self.nextthink = time + 3; - self.movetype = MOVETYPE_TOSS; - self.solid = SOLID_BBOX; - self.velocity = '0 0 20'; - self.avelocity = '300 200 100'; - setorigin(self, self.origin); - } -} - -void W_NailGrenade_Activate (void) -{ - self.velocity = '0 0 0'; - self.think = W_NailGrenade_Attack; - self.nextthink = time + 0.3; -// self.origin = self.dest1; - - self.count = cvar("g_balance_grenade_nail_numclusters"); -} - -// lift into air -void W_NailGrenade_Deploy (void) -{ - float thtime, dheight, spd; - entity oldself; - - self.touch = SUB_Null; - - dheight = cvar("g_balance_grenade_nail_deployheight"); - thtime = cvar("g_balance_grenade_nail_deploytime"); - spd = dheight / thtime; - - // GRRR! Quake's floor fetish is driving me crazy. - // The ONLY way I've found to get the grenade off the floor once it's on - // is to delete it and spawn a new entity in its place. - - oldself = self; - self = spawn(); - self.owner = oldself.owner; - self.angles_y = oldself.angles_y; - self.angles_x = self.angles_z = 0; // point upright - self.mangle = oldself.mangle; - - setmodel(self, oldself.model); - setsize(self, '0 0 0', '0 0 0'); - setorigin(self, oldself.origin); - self.flags = self.flags - (self.flags & FL_ONGROUND); - self.oldorigin = self.origin; - - //self.flags = self.flags - (self.flags & FL_ONGROUND); - self.movetype = MOVETYPE_FLY; - self.solid = SOLID_NOT; - self.velocity = '0 0 1' * spd; - self.nextthink = time + thtime; - self.think = W_NailGrenade_Activate; - - self.dest1 = self.origin + '0 0 1'*dheight; - traceline(self.origin, self.dest1, TRUE, self); - self.dest1 = trace_endpos; - - remove(oldself); -} - -void W_NailGrenade_Touch (void) -{ - sound (self, CHAN_IMPACT, "weapons/grenade_bounce.wav", 1, ATTN_NORM); - traceline(self.origin, self.origin - '0 0 10', TRUE, self); - if(self.flags & FL_ONGROUND || trace_fraction < 1) - W_NailGrenade_Deploy(); -} - -void W_NailGrenade() -{ - setmodel(self, "models/grenademodel.md3"); - setsize(self, '-6 -6 -3', '6 6 3'); - - self.takedamage = DAMAGE_NO; - self.event_damage = SUB_Null; - - self.nextthink = time + 2.5; - self.think = W_NailGrenade_Activate; - self.touch = W_NailGrenade_Touch; - self.state = 1; // don't explode on contact with player - self.velocity = v_forward * cvar("g_balance_grenade_nail_speed") - + v_up * cvar("g_balance_grenade_nail_speed_up"); - self.avelocity = '100 150 100'; - - self.angles = vectoangles (self.velocity); - - // decide on a direction to fire in - self.mangle_y = self.angles_y;// + 45; - self.mangle_z = 0; - self.mangle_x = 0; -} - -//-------------------------------------------- - -void W_MirvGrenade_Explode (void) -{ - vector org2; - org2 = findbetterlocation (self.origin); - te_explosion (org2); - effect (org2, "models/sprites/grenadeexplosion.spr32", 0, 20, 30); - sound (self, CHAN_BODY, "weapons/grenade_impact.wav", 1, ATTN_NORM); - - self.event_damage = SUB_Null; - RadiusDamage (self, self.owner, cvar("g_balance_grenade_mirv_damage"), cvar("g_balance_grenade_mirv_edgedamage"), cvar("g_balance_grenade_mirv_radius"), world, cvar("g_balance_grenade_mirv_force"), WEP_GRENADE_MIRV); - - remove (self); -} - -void W_MirvBomb(vector org, vector vel) -{ - entity gren; - gren = spawn (); - gren.owner = self.owner; - gren.classname = "grenade"; - gren.movetype = MOVETYPE_BOUNCE; - gren.solid = SOLID_BBOX; - setmodel(gren, "models/grenademodel.md3"); - //setsize(self, '-6 -6 -3', '6 6 3'); - setsize(gren, '0 0 0', '0 0 0'); - setorigin(gren, org); - - gren.nextthink = time + 2 + crandom()*0.15; - gren.think = W_MirvGrenade_Explode; - gren.touch = W_Grenade_DefaultTouch; - gren.state = 1; // don't explode on contact - gren.takedamage = DAMAGE_YES; - gren.health = 20; - gren.damageforcescale = 4; - gren.event_damage = W_Grenade_DefaultDamage; - gren.velocity = vel; - gren.avelocity = '100 150 100' * (1 + crandom()*0.5); - gren.angles = vectoangles (gren.velocity); - gren.scale = 0.75; -} - -void W_MirvGrenade_Split (void) -{ - float num, maxnum, spread; - vector dir, vel; - sound (self, CHAN_IMPACT, "weapons/grenade_bounce.wav", 1, ATTN_NORM); - - if(self.flags & FL_ONGROUND) - { - //traceline(self.origin, self.origin - '0 0 5', TRUE, self); - //dir = normalize(self.velocity) + trace_plane_normal + '0 0 1'; - //dir = normalize(dir * (1/3)); - dir = normalize(self.velocity)*0.2 + normalize('0 0 1'); - dir = normalize(dir); - } - else - { - dir = normalize(self.velocity); - } - - spread = cvar("g_balance_grenade_mirv_spread"); - - maxnum = cvar("g_balance_grenade_mirv_count"); - for (num = 0; num < maxnum; num = num + 1) - { - vel_x = dir_x + crandom()*spread; - vel_y = dir_y + crandom()*spread; - vel_z = dir_z + crandom()*spread; - vel = normalize(vel) * cvar("g_balance_grenade_mirv_speed2"); - W_MirvBomb(self.origin, vel); - } - remove(self); -} - -void W_MirvGrenade() -{ - setmodel(self, "models/grenademodel.md3"); - setsize(self, '-6 -6 -3', '6 6 3'); - - self.nextthink = time + 2.5; - self.think = W_MirvGrenade_Split; - self.touch = W_MirvGrenade_Split; - self.velocity = v_forward * cvar("g_balance_grenade_mirv_speed") - + v_up * cvar("g_balance_grenade_mirv_speed_up"); - self.avelocity = '100 150 100'; - - self.angles = vectoangles (self.velocity); - self.scale = 2.5; -} - -//-------------------------------------------- - -void W_FragGrenade_Explode (void) -{ - vector org2; - org2 = findbetterlocation (self.origin); - te_explosion (org2); - effect (org2, "models/sprites/grenadeexplosion.spr32", 0, 20, 30); - sound (self, CHAN_BODY, "weapons/rocket_impact.wav", 1, ATTN_NORM); - sound (self, CHAN_VOICE, "weapons/grenade_impact.wav", 1, ATTN_NORM); - - self.event_damage = SUB_Null; - RadiusDamage (self, self.owner, cvar("g_balance_grenade_frag_damage"), cvar("g_balance_grenade_frag_edgedamage"), cvar("g_balance_grenade_frag_radius"), world, cvar("g_balance_grenade_frag_force"), WEP_GRENADE_FRAG); - - remove (self); -} - -void W_FragGrenade() -{ - setmodel(self, "models/grenademodel.md3"); - setsize(self, '-6 -6 -3', '6 6 3'); - - self.nextthink = time + 2;//1.5 + random()*0.5; - self.think = W_FragGrenade_Explode; - self.touch = W_Grenade_DefaultTouch; - self.state = 1; // don't explode on contact with player - self.velocity = v_forward * cvar("g_balance_grenade_frag_speed") - + v_up * cvar("g_balance_grenade_frag_speed_up"); - self.avelocity = '100 150 100'; - - self.angles = vectoangles (self.velocity); -} - -//-------------------------------------------- - -void PoisonGrenadeGib(entity gib, string mdlname, vector org, vector v, float destroyontouch) -{ - entity e; - e = TossGib(gib, mdlname, org, v, destroyontouch); - e.colormod = 5 * '0 1 0'; // bright green - e.scale = 0.2; - e.gravity = 0.8; - e.velocity = e.velocity * e.gravity;// * 0.8; -} - -void W_PoisonGrenade_Explode (void) -{ - vector org2, org1; - entity head; - - org2 = findbetterlocation (self.origin); - org1 = org2 + '0 0 5'; - te_explosionrgb (org2, (1/255)*'0 255 0'); - sound (trace_ent, CHAN_VOICE, "misc/gib.wav", 1, ATTN_NORM); - PoisonGrenadeGib (world, "models/gibs/gib5.md3", org1, '-500 0 450',1); - PoisonGrenadeGib (world, "models/gibs/gib6.md3", org1, '0 500 450',1); - PoisonGrenadeGib (world, "models/gibs/gib6.md3", org1, '0 -500 450',1); - PoisonGrenadeGib (world, "models/gibs/gib6.md3", org1, '500 0 450',1); - PoisonGrenadeGib (world, "models/gibs/chunk.mdl", org1, '0 0 450',1); - - - head = findradius(self.origin, cvar("g_balance_grenade_poison_radius")); - while(head) - { - if(head.classname == "player") // only players can be poisoned - { - traceline(self.origin, head.origin, TRUE, self); - if(trace_fraction >= 1) - { - PoisonTarget(head, cvar("g_balance_grenade_poison_damage"), cvar("g_balance_grenade_poison_duration"), TRUE); - //bprint(strcat(head.netname, " is poisoned for ", ftos(head.poison_damage), " damage\n")); - } - } - head = head.chain; - } - - remove (self); -} - -void W_PoisonGrenade() -{ - setmodel(self, "models/grenademodel.md3"); - setsize(self, '-6 -6 -3', '6 6 3'); - - self.nextthink = time + 1.5 + random()*0.5; - self.think = W_PoisonGrenade_Explode; - self.touch = W_Grenade_DefaultTouch; - self.state = 1; // don't explode on contact with player - self.velocity = v_forward * cvar("g_balance_grenade_poison_speed") - + v_up * cvar("g_balance_grenade_poison_speed_up"); - self.avelocity = '100 150 100'; - - self.angles = vectoangles (self.velocity); -} - -//-------------------------------------------- - -void W_ArmorGrenade_Explode (void) -{ - entity head; - vector org2; - - org2 = findbetterlocation (self.origin); - te_explosion (org2); - effect (org2, "models/sprites/grenadeexplosion.spr32", 0, 20, 30); - sound (self, CHAN_BODY, "weapons/grenade_impact.wav", 1, ATTN_NORM); - - head = findradius(self.origin, cvar("g_balance_grenade_armor_radius")); - while(head) - { - if(head.classname == "player") // only players are affected - { - traceline(self.origin, head.origin, TRUE, self); - if(trace_fraction >= 1) - { - head.armorvalue = 0; // wipe out target's armor - } - } - head = head.chain; - } - - remove (self); -} - -void W_ArmorGrenade() -{ - setmodel(self, "models/grenademodel.md3"); - setsize(self, '-6 -6 -3', '6 6 3'); - - self.nextthink = time + 1.5 + random()*0.5; - self.think = W_ArmorGrenade_Explode; - self.touch = W_Grenade_DefaultTouch; - self.state = 1; // don't explode on contact with player - self.velocity = v_forward * cvar("g_balance_grenade_armor_speed") - + v_up * cvar("g_balance_grenade_armor_speed_up"); - self.avelocity = '100 150 100'; - - self.angles = vectoangles (self.velocity); -} - -//-------------------------------------------- - diff --git a/TeamNexuiz/game/gamec/w_hagar.c b/TeamNexuiz/game/gamec/w_hagar.c deleted file mode 100644 index 7d9c30aea..000000000 --- a/TeamNexuiz/game/gamec/w_hagar.c +++ /dev/null @@ -1,122 +0,0 @@ -void() hagar_ready_01; -void() hagar_fire1_01; -void() hagar_deselect_01; -void() hagar_select_01; - -float() hagar_check = -{ - if (self.ammo_rockets >= 1) - return TRUE; - return FALSE; -}; - -void(float req) w_hagar = -{ - if (req == WR_IDLE) - hagar_ready_01(); - else if (req == WR_FIRE1 || req == WR_FIRE2) - weapon_prepareattack(hagar_check, hagar_check, hagar_fire1_01, cvar("g_balance_hagar_refire")); - else if (req == WR_RAISE) - hagar_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = self.ammo_rockets; - else if (req == WR_DROP) - hagar_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_HAGAR, "w_hagar.zym", IT_ROCKETS); - else if (req == WR_CHECKAMMO) - weapon_hasammo = hagar_check(); -}; - -void W_Hagar_Explode (void) -{ - vector org2; - float b; - org2 = findbetterlocation (self.origin); - effect (org2, "models/sprites/hagarexplosion.spr32", 0, 20, 30); - b = crandom(); - if (b<-0.7) - sound (self, CHAN_BODY, "weapons/hagexp1.wav", 1, ATTN_NORM); - else if (b<0.4) - sound (self, CHAN_BODY, "weapons/hagexp2.wav", 1, ATTN_NORM); - else if (b<1) - sound (self, CHAN_BODY, "weapons/hagexp3.wav", 1, ATTN_NORM); - - self.event_damage = SUB_Null; - RadiusDamage (self, self.owner, cvar("g_balance_hagar_damage"), cvar("g_balance_hagar_edgedamage"), cvar("g_balance_hagar_radius"), world, cvar("g_balance_hagar_force"), WEP_HAGAR); - - remove (self); -} - -void W_Hagar_Touch (void) -{ - if (other == self.owner) - return; - else if (pointcontents (self.origin) == CONTENT_SKY) - { - remove (self); - return; - } - - W_Hagar_Explode (); -} - -void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - self.health = self.health - damage; - if (self.health <= 0) - W_Hagar_Explode(); -} - -void W_Hagar_Attack (void) -{ - local entity missile; - local vector org; - - sound (self, CHAN_WEAPON, "weapons/hagar_fire.wav", 1, ATTN_NORM); - self.ammo_rockets = self.ammo_rockets - 1; - self.punchangle_x = -2; - org = self.origin + self.view_ofs + v_forward * 25 + v_right * 5 + v_up * -8; - - missile = spawn (); - missile.owner = self; - missile.classname = "missile"; - missile.touch = W_Hagar_Touch; - missile.think = W_Hagar_Explode; - missile.nextthink = time + 10; - missile.solid = SOLID_BBOX; - missile.scale = 0.4; // BUG: the model is too big - setorigin (missile, org); - setmodel (missile, "models/hagarmissile.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - //missile.takedamage = DAMAGE_YES; - //missile.damageforcescale = 4; - //missile.health = 10; - //missile.event_damage = W_Hagar_Damage; - missile.effects = EF_LOWPRECISION; - - if (self.button3) - { - missile.movetype = MOVETYPE_TOSS; - missile.velocity = v_forward * cvar("g_balance_hagar_speed2") + v_up * cvar("g_balance_hagar_speed2_up"); - missile.avelocity = '100 10 10'; - } - else - { - missile.movetype = MOVETYPE_FLY; - missile.velocity = (v_forward + v_right * crandom() * 0.035 + v_up * crandom() * 0.015) * cvar("g_balance_hagar_speed"); - } - - missile.angles = vectoangles (missile.velocity); -} - -// weapon frames -void() hagar_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, hagar_ready_01); self.weaponentity.state = WS_READY;}; -void() hagar_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() hagar_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() hagar_fire1_01 = -{ - weapon_doattack(hagar_check, hagar_check, W_Hagar_Attack); - weapon_thinkf(WFRAME_FIRE1, 0.15, hagar_ready_01); -}; - diff --git a/TeamNexuiz/game/gamec/w_hook.c b/TeamNexuiz/game/gamec/w_hook.c deleted file mode 100644 index 6b88f7913..000000000 --- a/TeamNexuiz/game/gamec/w_hook.c +++ /dev/null @@ -1,250 +0,0 @@ -void() grapple_ready_01; -void() grapple_fire1_01; -void() grapple_deselect_01; -void() grapple_select_01; - -float() grapple_check = -{ - return TRUE; -} - -void(float req) w_grapple = -{ - if (req == WR_IDLE) - grapple_ready_01(); - else if (req == WR_FIRE1) - weapon_prepareattack(grapple_check, grapple_check, grapple_fire1_01, cvar("g_balance_grapple_refire")); - else if (req == WR_RAISE) - grapple_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = 1; - else if (req == WR_DROP) - grapple_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_GRAPPLE, "w_grapple.zym", 0); - else if (req == WR_CHECKAMMO) - weapon_hasammo = grapple_check(); -} - -void RemoveGrapplingHook(entity pl) -{ - if(pl.hook == world) - return; - remove(pl.hook); - pl.hook = world; - if(pl.movetype == MOVETYPE_FLY) - pl.movetype = MOVETYPE_WALK; -} - -void GrapplingHookThink() -{ - float spd, dist, minlength, pullspeed, pullspeed2, totalmass, m1, m2, dropspd1, dropspd2; - vector dir, org, end; - - makevectors(self.owner.v_angle); - org = self.owner.origin + self.owner.view_ofs + v_forward * 15 - v_right * 5 + v_up * -12; - - traceline(self.origin, org, TRUE, self); - if(self.owner.health <= 2 // owner died - || self.owner.hook != self // owner fired a different hook - || !self.owner.button0 // owner let go of button - || trace_fraction < 1) // owner not visible - { - remove(self); - return; - } - - self.nextthink = time + 0.1; - dropspd1 = cvar("sv_gravity") * 0.1; // thinks this often - dropspd2 = dropspd1; - if(self.owner.gravity) - dropspd1 = dropspd1 * self.owner.gravity; - if(self.enemy.gravity) - dropspd2 = dropspd2 * self.enemy.gravity; - self.owner.attack_finished = max(self.owner.attack_finished, time + cvar("g_balance_grapple_refire")); - - - // testing - self.owner.jump_pad = 1; - - - if(self.state == 1) - { - pullspeed = cvar("g_balance_grapple_pullspeed"); - if(self.enemy != world) // pull both players toward each other at different speeds based on mass - { - m1 = self.owner.mass; - m2 = self.enemy.mass; - if(m1 <= 0) - m1 = 1; - if(m2 <= 0) - m2 = 1; - totalmass = m1 + m2; - pullspeed2 = (m1 / totalmass) * pullspeed; - pullspeed = (m2 / totalmass) * pullspeed; - } - minlength = 50; - dir = self.origin - org; - dist = vlen(dir); - dir = normalize(dir); - - end = self.origin - dir*minlength; - - dist = vlen(end - org); - - if(dist < 200 && self.enemy == world) - spd = dist * (pullspeed / 200); - else - spd = pullspeed; - if(spd < 50) - spd = 0; - - if(!(dist < 200 && !self.owner.flags & FL_ONGROUND && self.enemy != world)) - self.owner.velocity = dir*spd; - self.owner.movetype = MOVETYPE_FLY; - self.owner.flags = self.owner.flags - (self.owner.flags & FL_ONGROUND); - - org = org + dir*50; // get the beam out of the player's eyes - - if(self.enemy != world) - { - self.origin = 0.5*(self.enemy.absmin+self.enemy.absmax) + '0 0 10'; // follow enemy's body - - if(dist < 200) - spd = dist * (pullspeed2 / 200 + 150); - else - spd = pullspeed2; - if(spd < 50) - spd = 0; - - - if(dist < 200 && !self.owner.flags & FL_ONGROUND) - { - //self.enemy.velocity = self.enemy.velocity + '0 0 -1'*dropspd1; - self.owner.velocity = self.owner.velocity + '0 0 -1'*dropspd2; // fake effects of gravity, and don't pull enemy toward me - } - else - self.enemy.velocity = dir * spd * -1; - - if(self.attack_finished < time) - { - self.attack_finished = time + cvar("g_balance_grapple_hurtrate"); - Damage (self.enemy, self, self.owner, cvar("g_balance_grapple_damage2"), WEP_GRAPPLE, self.origin, '0 0 0'); - } - if(self.enemy.health <= 0) // gib the dead player - { - Damage (self.enemy, self, self.owner, 100, WEP_GRAPPLE, self.origin, '0 0 0'); - self.enemy = world; - self.owner.hook = world; - remove(self); - return; - } - } - } - - WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte (MSG_BROADCAST, TE_BEAM); - WriteEntity (MSG_BROADCAST, self); - WriteCoord (MSG_BROADCAST, self.origin_x); - WriteCoord (MSG_BROADCAST, self.origin_y); - WriteCoord (MSG_BROADCAST, self.origin_z); - WriteCoord (MSG_BROADCAST, org_x); - WriteCoord (MSG_BROADCAST, org_y); - WriteCoord (MSG_BROADCAST, org_z); - //WriteCoord (MSG_BROADCAST, 0); - //WriteCoord (MSG_BROADCAST, 0); - //WriteCoord (MSG_BROADCAST, 0); -} - -void GrapplingHookTouch (void) -{ - if (other == self.owner) - return; - else if (pointcontents (self.origin) == CONTENT_SKY) - { - RemoveGrapplingHook(self.owner); - return; - } - - self.event_damage = SUB_Null; // fixme: ability to dislodge a player by damaging hook? - sound (self, CHAN_BODY, "weapons/laserimpact.wav", 1, ATTN_NORM); - - self.state = 1; - self.think = GrapplingHookThink; - self.nextthink = time + 0.1; - self.touch = SUB_Null; - self.velocity = '0 0 0'; - self.movetype = MOVETYPE_NONE; - - if((other.classname == "player" || other.classname == "body") && other.health > 0) - { - self.enemy = other; - } - - Damage (other, self, self.owner, cvar("g_balance_grapple_damage"), WEP_GRAPPLE, self.origin, normalize(self.velocity)*cvar("g_balance_grapple_force")); -} - -void FireGrapplingHook (void) -{ - - // fixme: drop the CTF flag - - - local entity missile; - local vector org; - - makevectors(self.v_angle); - - sound (self, CHAN_WEAPON, "weapons/lasergun_fire.wav", 1, ATTN_NORM); - org = self.origin + self.view_ofs + v_forward * 15 - v_right * 5 + v_up * -12; - te_customflash(org, 160, 0.2, '1 0 0'); - - missile = spawn (); - missile.owner = self; - self.hook = missile; - missile.classname = "laserbolt"; - - missile.movetype = MOVETYPE_FLY; - missile.solid = SOLID_BBOX; - - setmodel (missile, "models/ebomb.mdl");//laser.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, org); - - missile.state = 0; // not latched onto anything - - missile.velocity = v_forward * cvar("g_balance_grapple_speed"); - missile.angles = vectoangles (missile.velocity); - //missile.glow_color = 250; // 244, 250 - //missile.glow_size = 120; - missile.touch = GrapplingHookTouch; - missile.think = GrapplingHookThink; - missile.nextthink = time + 0.1; - - missile.effects = EF_FULLBRIGHT | EF_ADDITIVE | EF_LOWPRECISION; -} - -void GrapplingHookFrame() -{ - // if I have no hook or it's not pulling yet, make sure I'm not flying! - if((self.hook == world || !self.hook.state) && self.movetype == MOVETYPE_FLY && self.health > 2) - { - self.movetype = MOVETYPE_WALK; - } - if(!self.button0) - { - // remove hook, reset movement type - RemoveGrapplingHook(self); - return; - } - // note: The hook entity does the actual pulling -} - -void() grapple_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, grapple_ready_01); self.weaponentity.state = WS_READY;}; -void() grapple_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() grapple_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() grapple_fire1_01 = -{ - weapon_doattack(grapple_check, grapple_check, FireGrapplingHook); - weapon_thinkf(WFRAME_FIRE1, 0.3, grapple_ready_01); -} diff --git a/TeamNexuiz/game/gamec/w_hotbombs.c b/TeamNexuiz/game/gamec/w_hotbombs.c deleted file mode 100644 index e4323ae2b..000000000 --- a/TeamNexuiz/game/gamec/w_hotbombs.c +++ /dev/null @@ -1,267 +0,0 @@ -void() hotbombs_ready_01; -void() hotbombs_fire1_01; -void() hotbombs_fire2_01; -void() hotbombs_deselect_01; -void() hotbombs_select_01; - -float AMMO_COST_HOTBOMBS = 5; - -float() hotbombs_check = -{ - return TRUE; -} - -float() hotbombs_check2 = -{ - if (self.ammo_cells >= AMMO_COST_HOTBOMBS) - return TRUE; - return FALSE; -} - -void(float req) w_hotbombs = -{ - if (req == WR_IDLE) - hotbombs_ready_01(); - else if (req == WR_FIRE1 || req == WR_FIRE2) - { - if(req == WR_FIRE2) - weapon_prepareattack(hotbombs_check, hotbombs_check, hotbombs_fire2_01, cvar("g_balance_hotbombs_refire")); - else - weapon_prepareattack(hotbombs_check, hotbombs_check, hotbombs_fire1_01, cvar("g_balance_hotbombs_refire2")); - } - else if (req == WR_RAISE) - hotbombs_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = floor(self.ammo_cells/AMMO_COST_HOTBOMBS); - else if (req == WR_DROP) - hotbombs_deselect_01(); - else if (req == WR_SETUP) - { - weapon_setup(WEP_BOMBLETTS, "w_hotbombs.zym", IT_ROCKETS); - //self.weaponentity.colormod = '0 4 0'; - //self.weaponentity.scale = 0.65; - } - else if (req == WR_CHECKAMMO) - weapon_hasammo = hotbombs_check(); -} - -void W_Hotbomb_Explode (void) -{ - vector org2; - entity head; - - float flametime, flamedmg, flamerate, flameedge, flameradius, distratio; - - flameradius = cvar("g_balance_hotbombs_burnradius"); - flamedmg = cvar("g_balance_hotbombs_burndamage"); - flamerate = cvar("g_balance_hotbombs_burnrate"); - flametime = cvar("g_balance_hotbombs_burntime"); - flameedge = cvar("g_balance_hotbombs_burnedge_ratio"); - - org2 = findbetterlocation (self.origin); - te_explosion (org2); - if(random() > 0.5) - { - effect (org2, "models/sprites/grenadeexplosion.spr32", 0, 20, 30); - sound (self, CHAN_BODY, "weapons/grenade_impact.wav", 1, ATTN_NORM); - } - else - { - effect (org2, "models/sprites/rocketexplosion.spr32", 0, 20, 40); - sound (self, CHAN_BODY, "weapons/rocket_impact.wav", 1, ATTN_NORM); - } - - - self.event_damage = SUB_Null; - RadiusDamage (self, self.owner, cvar("g_balance_hotbombs_damage"), cvar("g_balance_hotbombs_edgedamage"), cvar("g_balance_hotbombs_radius"), world, cvar("g_balance_hotbombs_force"), WEP_HOTBOMBS); - - // fixme: need better way to set on fire... - head = findradius(self.origin, flameradius); - while(head) - { - if(head.takedamage == DAMAGE_AIM)//head.classname == "player" || head.classname == "turret") - { - traceline(self.origin, head.origin, TRUE, self); - if(trace_fraction >= 1) - { - distratio = 1 - (vlen(head.origin - self.origin) / flameradius); - IgniteTarget(head, self.owner, - (flametime*flameedge) + (flametime - flameedge)*distratio, - flamedmg, - flamerate, - TRUE); - } - } - head = head.chain; - } - - - remove (self); -} - -void W_Hotbomb_Detonate (entity gren) -{ - gren.classname = "hotbombdet"; - gren.takedamage = 0; - gren.think = W_Hotbomb_Explode; - gren.nextthink = time + random()*0.1; - gren.movetype = MOVETYPE_TOSS; -} - -void W_HotbombThink () -{ - self.nextthink = time + 1; - if(self.owner.class != CLASS_PYRO) - { - remove(self); - return; - } - if(self.movetype == MOVETYPE_WALK) - { - if(!self.flags & FL_ONGROUND) - { - self.movetype = MOVETYPE_TOSS; - //self.think = SUB_Null; - //self.nextthink = -1; - } - - self.velocity = self.velocity*0.9; - - if(vlen(self.velocity) < 25) - { - self.velocity = '0 0 0'; - self.movetype = MOVETYPE_TOSS; - self.ltime = time + 0.5; // don't bounce or start over on accident - } - else - self.nextthink = time + 0.1; - } -} - -void W_Hotbombs_Touch (void) -{ - if(self.think != W_HotbombThink) - { - if(self.ltime > time) - return; - sound (self, CHAN_IMPACT, "weapons/grenade_bounce.wav", 1, ATTN_NORM); - if(self.flags & FL_ONGROUND) - { - self.movetype = MOVETYPE_WALK; - self.think = W_HotbombThink; - self.nextthink = time + 0.1; - } - } -} - -void W_Hotbombs_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - self.health = self.health - damage; - if (self.health <= 0 || deathtype == DEATH_BURNING) - { - W_Hotbomb_Detonate(self); - //self.think = W_Hotbombs_Explode; - //self.nextthink = time + random()*0.1; - //self.takedamage = 0; - //self.classname = "hotbombdet"; - //self.movetype = MOVETYPE_TOSS; - } -} - -void W_Hotbombs_Attack (void) -{ - local entity gren; - local vector org; - - // only allow a limited number of hotbombs - W_LimitNumEnts("hotbomb", cvar("g_balance_hotbombs_allowed") - 1, SUB_Remove); - - - //sound (self, CHAN_WEAPON, "weapons/grenade_fire.wav", 1, ATTN_NORM); - self.punchangle_x = -4; - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -12; - self.ammo_cells = self.ammo_cells - AMMO_COST_HOTBOMBS; - - gren = spawn (); - gren.create_time = time; // for W_LimitNumEnts - gren.owner = self; - gren.classname = "hotbomb"; - gren.movetype = MOVETYPE_WALK; - gren.solid = SOLID_BBOX; - setmodel(gren, "models/grenademodel.md3"); - setsize(gren, '-6 -6 -3', '6 6 3'); - setorigin(gren, org); - - gren.nextthink = time + 100; - gren.think = W_Hotbomb_Explode; - gren.touch = W_Hotbombs_Touch; - gren.takedamage = DAMAGE_YES; - gren.health = 40; // a bit harder to destroy - gren.damageforcescale = 4; - gren.event_damage = W_Hotbombs_Damage; - gren.velocity = v_forward * cvar("g_balance_hotbombs_speed"); - - gren.angles = vectoangles (gren.velocity); - gren.angles_x = -90; - - gren.scale = 2; - //gren.colormod = '0.5 0.5 0.5'; -} - -void W_Hotbombs_Attack2 (void) -{ - local entity gren; - gren = world; - do - { - gren = find(gren, classname, "hotbomb"); - if(gren.owner == self) - { - W_Hotbomb_Detonate(gren); - } - }while(gren); -} - -float W_Hotbombs_CheckEmpty () -{ - local entity gren; - - if(hotbombs_check2()) - return FALSE; // I still have ammo, don't auto switch - - gren = world; - do - { - gren = find(gren, classname, "hotbomb"); - if(gren.owner == self) - { - return FALSE; // I still have a grenade I can explode, don't auto switch - } - }while(gren); - - self.switchweapon = w_getbestweapon(self); - return TRUE; -} - -// weapon frames - -void() hotbombs_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, hotbombs_ready_01); self.weaponentity.state = WS_READY;}; -void() hotbombs_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() hotbombs_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() hotbombs_fire1_01 = -{ - if(W_Hotbombs_CheckEmpty()) - return; // auto-switch weapons and leave - if(!hotbombs_check2()) - return; // can't use primary, but alt-fire will still work - weapon_doattack(hotbombs_check, hotbombs_check, W_Hotbombs_Attack); - weapon_thinkf(WFRAME_FIRE1, 0.3, hotbombs_ready_01); -}; - -void() hotbombs_fire2_01 = -{ - if(W_Hotbombs_CheckEmpty()) - return; // out of ammo and no bombs to detonate - weapon_doattack(hotbombs_check, hotbombs_check, W_Hotbombs_Attack2); - weapon_thinkf(WFRAME_IDLE, 0.1, hotbombs_ready_01); -}; diff --git a/TeamNexuiz/game/gamec/w_incendiary_r.c b/TeamNexuiz/game/gamec/w_incendiary_r.c deleted file mode 100644 index 904f997cf..000000000 --- a/TeamNexuiz/game/gamec/w_incendiary_r.c +++ /dev/null @@ -1,166 +0,0 @@ -void() rincendiary_ready_01; -void() rincendiary_fire1_01; -void() rincendiary_deselect_01; -void() rincendiary_select_01; - -float() rincendiary_check = -{ - if (self.ammo_rockets >= 5) - return TRUE; - return FALSE; -}; - -void(float req) w_rincendiary = -{ - if (req == WR_IDLE) - rincendiary_ready_01(); - else if (req == WR_FIRE1) - weapon_prepareattack(rincendiary_check, rincendiary_check, rincendiary_fire1_01, cvar("g_balance_incendiaryrocket_refire")); - else if (req == WR_RAISE) - rincendiary_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = floor(self.ammo_rockets / 5); - else if (req == WR_DROP) - rincendiary_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_ROCKET_INCENDIARY, "w_rli.zym", IT_ROCKETS); - else if (req == WR_CHECKAMMO) - weapon_hasammo = rincendiary_check(); -}; - - -void W_IncendiaryRocket_Explode (void) -{ - vector org2; - entity head; - - float flametime, flamedmg, flamerate, flameedge, flameradius, distratio; - - flameradius = cvar("g_balance_incendiaryrocket_burnradius"); - flamedmg = cvar("g_balance_incendiaryrocket_burndamage"); - flamerate = cvar("g_balance_incendiaryrocket_burnrate"); - flametime = cvar("g_balance_incendiaryrocket_burntime"); - flameedge = cvar("g_balance_incendiaryrocket_burnedge_ratio"); - - org2 = findbetterlocation (self.origin); - te_explosion (org2); - effect (org2, "models/sprites/rocketexplosion.spr32", 0, 20, 40); - sound (self, CHAN_BODY, "weapons/rocket_impact.wav", 1, ATTN_NORM); - - self.event_damage = SUB_Null; - RadiusDamage (self, self.owner, cvar("g_balance_incendiaryrocket_damage"), cvar("g_balance_incendiaryrocket_edgedamage"), cvar("g_balance_incendiaryrocket_radius"), world, cvar("g_balance_incendiaryrocket_force"), WEP_ROCKET_INCENDIARY); - - // fixme: need better way to set on fire... - head = findradius(self.origin, flameradius); - while(head) - { - if(head.takedamage == DAMAGE_AIM)//head.classname == "player" || head.classname == "turret") - { - traceline(self.origin, head.origin, TRUE, self); - if(trace_fraction >= 1) - { - distratio = 1 - (vlen(head.origin - self.origin) / flameradius); - IgniteTarget(head, self.owner, - (flametime*flameedge) + (flametime - flameedge)*distratio, - flamedmg, - flamerate, - TRUE); - } - } - head = head.chain; - } - - remove (self); -} - -void W_IncendiaryRocket_Think (void) -{ - self.nextthink = time; - if (time > self.cnt) - { - W_IncendiaryRocket_Explode (); - return; - } - if (self.owner) - { - if (self.owner.deadflag) - self.owner = self; - else if (self.owner.wpn == WEP_ROCKET_INCENDIARY && self.owner.button3) - W_IncendiaryRocket_Explode (); - } -} - -void W_IncendiaryRocket_Touch (void) -{ - if (pointcontents (self.origin) == CONTENT_SKY) - { - remove (self); - return; - } - else - W_IncendiaryRocket_Explode (); -} - -void W_IncendiaryRocket_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - self.health = self.health - damage; - if (self.health <= 0) - W_IncendiaryRocket_Explode(); -} - -void W_IncendiaryRocket_Attack (void) -{ - local entity missile; - local entity flash; - local vector org; - sound (self, CHAN_WEAPON, "weapons/rocket_fire.wav", 1, ATTN_NORM); - if (cvar("g_rocketarena") == 0) - self.ammo_rockets = self.ammo_rockets - 5; - self.punchangle_x = -4; - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 3 + v_up * -11; - te_smallflash(org); - - missile = spawn (); - missile.owner = self; - missile.classname = "missile"; - - missile.takedamage = DAMAGE_YES; - //missile.damageforcescale = 4; - missile.health = 30; - missile.event_damage = W_IncendiaryRocket_Damage; - - missile.movetype = MOVETYPE_FLY; - missile.solid = SOLID_BBOX; - setmodel (missile, "models/rocket.md3"); - setsize (missile, '0 0 0', '0 0 0'); - - setorigin (missile, org); - missile.velocity = v_forward * cvar("g_balance_incendiaryrocket_speed"); - missile.angles = vectoangles (missile.velocity); - - missile.touch = W_IncendiaryRocket_Touch; - missile.think = W_IncendiaryRocket_Think; - missile.nextthink = time; - missile.cnt = time + 9; - sound (missile, CHAN_BODY, "weapons/rocket_fly.wav", 0.4, ATTN_NORM); - - flash = spawn (); - setorigin (flash, org); - setmodel (flash, "models/flash.md3"); - flash.velocity = v_forward * 20; - flash.angles = vectoangles (flash.velocity); - SUB_SetFade (flash, time, 0.4); - flash.effects = flash.effects | EF_ADDITIVE | EF_FULLBRIGHT; -} - -// weapon frames - -void() rincendiary_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, rincendiary_ready_01); self.weaponentity.state = WS_READY;}; -void() rincendiary_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() rincendiary_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() rincendiary_fire1_01 = -{ - weapon_doattack(rincendiary_check, rincendiary_check, W_IncendiaryRocket_Attack); - weapon_thinkf(WFRAME_FIRE1, 0.3, rincendiary_ready_01); -}; - diff --git a/TeamNexuiz/game/gamec/w_laser.c b/TeamNexuiz/game/gamec/w_laser.c deleted file mode 100644 index 4514c009d..000000000 --- a/TeamNexuiz/game/gamec/w_laser.c +++ /dev/null @@ -1,101 +0,0 @@ -void() laser_ready_01; -void() laser_fire1_01; -void() laser_deselect_01; -void() laser_select_01; - -float() laser_check = {return TRUE;}; - -void(float req) w_laser = -{ - if (req == WR_IDLE) - laser_ready_01(); - else if (req == WR_FIRE1) - weapon_prepareattack(laser_check, laser_check, laser_fire1_01, cvar("g_balance_laser_refire")); - else if (req == WR_RAISE) - laser_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = 1; - else if (req == WR_DROP) - laser_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_LASER, "w_laser.zym", 0); - else if (req == WR_CHECKAMMO) - weapon_hasammo = laser_check(); -}; - -void W_Laser_Touch (void) -{ - vector dir; - - if (other == self.owner) - return; - else if (pointcontents (self.origin) == CONTENT_SKY) - { - remove (self); - return; - } - - dir = normalize (self.owner.origin - self.origin); - - WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte (MSG_BROADCAST, TE_FLAMEJET); - WriteCoord (MSG_BROADCAST, self.origin_x); - WriteCoord (MSG_BROADCAST, self.origin_y); - WriteCoord (MSG_BROADCAST, self.origin_z); - WriteCoord (MSG_BROADCAST, 0); // SeienAbunae: groan... Useless clutter - WriteCoord (MSG_BROADCAST, 0); - WriteCoord (MSG_BROADCAST, 0); - WriteByte (MSG_BROADCAST, 155); - - te_customflash(self.origin, 160, 0.2, '1 0 0'); - - - self.event_damage = SUB_Null; - RadiusDamage (self, self.owner, cvar("g_balance_laser_damage"), cvar("g_balance_laser_edgedamage"), cvar("g_balance_laser_radius"), world, cvar("g_balance_laser_force"), WEP_LASER); - sound (self, CHAN_BODY, "weapons/laserimpact.wav", 1, ATTN_NORM); - - remove (self); -} - -void W_Laser_Attack (void) -{ - local entity missile; - local vector org; - - sound (self, CHAN_WEAPON, "weapons/lasergun_fire.wav", 1, ATTN_NORM); - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 5 + v_up * -12; - //te_customflash(org, 160, 0.2, '1 0 0'); - - missile = spawn (); - missile.owner = self; - missile.classname = "laserbolt"; - - missile.movetype = MOVETYPE_FLY; - missile.solid = SOLID_BBOX; - - setmodel (missile, "models/laser.mdl"); - setsize (missile, '0 0 0', '0 0 0'); - setorigin (missile, org); - - missile.velocity = v_forward * cvar("g_balance_laser_speed"); - missile.angles = vectoangles (missile.velocity); - //missile.glow_color = 250; // 244, 250 - //missile.glow_size = 120; - missile.touch = W_Laser_Touch; - missile.think = SUB_Remove; - missile.nextthink = time + 9; - - missile.effects = EF_FULLBRIGHT | EF_ADDITIVE | EF_LOWPRECISION; -} - -// weapon frames - -void() laser_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, laser_ready_01); self.weaponentity.state = WS_READY;}; -void() laser_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() laser_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() laser_fire1_01 = -{ - weapon_doattack(laser_check, laser_check, W_Laser_Attack); - weapon_thinkf(WFRAME_FIRE1, 0.3, laser_ready_01); -}; - diff --git a/TeamNexuiz/game/gamec/w_namek.c b/TeamNexuiz/game/gamec/w_namek.c deleted file mode 100644 index d931329be..000000000 --- a/TeamNexuiz/game/gamec/w_namek.c +++ /dev/null @@ -1,138 +0,0 @@ -void() namek_ready_01; -void() namek_fire1_01; -void() namek_fire2_01; -void() namek_deselect_01; -void() namek_select_01; - -float() namek_check = -{ - if (self.ammo_nails > 2) - return TRUE; - return FALSE; -}; - -void(float req) w_namek = -{ - if (req == WR_IDLE) - namek_ready_01(); - else if (req == WR_FIRE1) - weapon_prepareattack(namek_check, namek_check, namek_fire1_01, cvar("g_balance_namek_refire")); - else if (req == WR_FIRE2) - weapon_prepareattack(namek_check, namek_check, namek_fire2_01, cvar("g_balance_namek_refire2")); - else if (req == WR_RAISE) - namek_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = floor(self.ammo_nails / 2); - else if (req == WR_DROP) - namek_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_NAMEK, "w_namek.zym", IT_CELLS); - else if (req == WR_CHECKAMMO) - weapon_hasammo = namek_check(); -}; - -void W_Namek_Touch (void) -{ - if (other == self.owner) - return; - else if (pointcontents (self.origin) == CONTENT_SKY) - { - remove (self); - return; - } - - te_spark(self.origin, normalize(self.velocity) * -70 - '0 0 100', 30); - - if(other.takedamage) - Damage (other, self, self.owner, self.dmg, WEP_NAMEK, self.origin, normalize(self.velocity) * cvar("g_balance_namek_force")); - - remove (self); -} - -void FireNamekBullet(vector org, vector vel, float damage, float brange) -{ - entity proj; - float livetime; - - livetime = brange / vlen(vel); - - //bprint(ftos(livetime), ": ", ftos(brange), ", ", ftos(vlen(vel)), "\n"); - - proj = spawn (); - proj.classname = "spike"; - proj.owner = self; - proj.effects = EF_ADDITIVE | EF_FULLBRIGHT; - proj.think = SUB_Remove; - proj.nextthink = time + livetime; - proj.solid = SOLID_BBOX; - proj.movetype = MOVETYPE_FLY; - proj.dmg = damage; - setorigin(proj, org); - - proj.velocity = vel; - proj.angles = vectoangles(proj.velocity); - proj.touch = W_Namek_Touch; - setmodel(proj, "models/weapons/namekb.mdl"); - setsize(proj, '0 0 0', '0 0 0'); -} - -void W_Namek_Attack() -{ - vector org, dir; - float spread, brange, brange2; - - sound (self, CHAN_WEAPON, "weapons/namek_fire.wav", 1, ATTN_NORM); - - self.punchangle_x = -2; - - self.ammo_nails = self.ammo_nails - 2; - - org = self.origin + self.view_ofs + v_forward * 10 + v_right * 15 + v_up * -14; - - spread = cvar("g_balance_namek_spread"); - dir_x = v_forward_x + crandom()*spread; - dir_y = v_forward_y + crandom()*spread; - dir_z = v_forward_z + crandom()*spread; - dir = normalize(dir); - - brange = cvar("g_balance_namek_range_min"); - brange2 = cvar("g_balance_namek_range_max") - brange; - brange = brange + random()*brange2; - - FireNamekBullet(org, dir * cvar("g_balance_namek_speed"), cvar("g_balance_namek_damage"), brange); -} - -void W_Namek_Attack2() -{ - vector org; - float brange; - - sound (self, CHAN_WEAPON, "weapons/namek_fire.wav", 1, ATTN_NORM); - - self.punchangle_x = -2; - - self.ammo_nails = self.ammo_nails - 2; - - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 10 + v_up * -14; - brange = cvar("g_balance_namek_range2"); - - FireNamekBullet(org + '0 0 1', v_forward * cvar("g_balance_namek_speed2"), cvar("g_balance_namek_damage2"), brange); - FireNamekBullet(org - '0 0 2', v_forward * cvar("g_balance_namek_speed2"), cvar("g_balance_namek_damage2"), brange); -} - -// weapon frames - -void() namek_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, namek_ready_01); self.weaponentity.state = WS_READY;}; -void() namek_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() namek_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() namek_fire1_01 = -{ - weapon_doattack(namek_check, namek_check, W_Namek_Attack); - weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_namek_refire") - 0.05, namek_ready_01); -}; -void() namek_fire2_01 = -{ - weapon_doattack(namek_check, namek_check, W_Namek_Attack2); - weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_namek_refire2") - 0.05, namek_ready_01); -}; - diff --git a/TeamNexuiz/game/gamec/w_nex.c b/TeamNexuiz/game/gamec/w_nex.c deleted file mode 100644 index 3e99328c3..000000000 --- a/TeamNexuiz/game/gamec/w_nex.c +++ /dev/null @@ -1,103 +0,0 @@ -void() nex_ready_01; -void() nex_fire1_01; -void() nex_deselect_01; -void() nex_select_01; - -float() nex_check = -{ - if (self.ammo_cells >= 5) - return TRUE; - return FALSE; -}; - -void(float req) w_nex = -{ - if (req == WR_IDLE) - nex_ready_01(); - else if (req == WR_FIRE1) - weapon_prepareattack(nex_check, nex_check, nex_fire1_01, cvar("g_balance_nex_refire")); - else if (req == WR_RAISE) - nex_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = floor(self.ammo_cells / 5); - else if (req == WR_DROP) - nex_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_NEX, "w_nex.zym", IT_CELLS); - else if (req == WR_CHECKAMMO) - weapon_hasammo = nex_check(); -}; - - -void W_Nex_Attack (void) -{ - local vector org; - local vector end; - local entity flash; - - sound (self, CHAN_WEAPON, "weapons/nexfire.wav", 1, ATTN_NORM); - self.punchangle_x = -5; - org = self.origin + self.view_ofs + v_forward * 5 + v_right * 14 + v_up * -7; - end = self.origin + self.view_ofs + v_forward * 4096; - - FireRailgunBullet (org, end, cvar("g_balance_nex_damage"), WEP_NEX); - - // trace as if shot started inside gun - traceline (org, end, TRUE, self); - // show as if shot started outside of gun - org = self.origin + self.view_ofs + v_forward * 28 + v_right * 14 + v_up * -7; - // muzzleflash light - te_smallflash (org); - // beam effect - WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte (MSG_BROADCAST, 76); - WriteCoord (MSG_BROADCAST, org_x); - WriteCoord (MSG_BROADCAST, org_y); - WriteCoord (MSG_BROADCAST, org_z); - WriteCoord (MSG_BROADCAST, trace_endpos_x); - WriteCoord (MSG_BROADCAST, trace_endpos_y); - WriteCoord (MSG_BROADCAST, trace_endpos_z); - WriteCoord (MSG_BROADCAST, 0); - WriteCoord (MSG_BROADCAST, 0); - WriteCoord (MSG_BROADCAST, 0); - // flash and burn the wall - te_plasmaburn (trace_endpos); - /* - // flame effect at impact - dir = trace_plane_normal * 100; - WriteByte (MSG_BROADCAST, SVC_TEMPENTITY); - WriteByte (MSG_BROADCAST, TE_FLAMEJET); - WriteCoord (MSG_BROADCAST, trace_endpos_x); - WriteCoord (MSG_BROADCAST, trace_endpos_y); - WriteCoord (MSG_BROADCAST, trace_endpos_z); - WriteCoord (MSG_BROADCAST, dir_x); - WriteCoord (MSG_BROADCAST, dir_y); - WriteCoord (MSG_BROADCAST, dir_z); - WriteByte (MSG_BROADCAST, 255); - */ - // play a sound - PointSound (trace_endpos, "weapons/neximpact.wav", 1, ATTN_NORM); - - if (cvar("g_instagib") == 0) - self.ammo_cells = self.ammo_cells - 5; - - flash = spawn (); - org = self.origin + self.view_ofs + v_forward * 33 + v_right * 14 + v_up * -7; - setorigin (flash, org); - setmodel (flash, "models/nexflash.md3"); - flash.velocity = v_forward * 20; - flash.angles = vectoangles (flash.velocity); - SUB_SetFade (flash, time, 0.4); - flash.effects = flash.effects | EF_ADDITIVE | EF_FULLBRIGHT; -} - -// weapon frames -void() nex_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, nex_ready_01); self.weaponentity.state = WS_READY;}; -void() nex_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() nex_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() nex_fire1_01 = -{ - weapon_doattack(nex_check, nex_check, W_Nex_Attack); - weapon_thinkf(WFRAME_FIRE1, 0.3, nex_ready_01); -}; - diff --git a/TeamNexuiz/game/gamec/w_rocketlauncher.c b/TeamNexuiz/game/gamec/w_rocketlauncher.c deleted file mode 100644 index 29d9c9fee..000000000 --- a/TeamNexuiz/game/gamec/w_rocketlauncher.c +++ /dev/null @@ -1,141 +0,0 @@ -void() rlauncher_ready_01; -void() rlauncher_fire1_01; -void() rlauncher_deselect_01; -void() rlauncher_select_01; - -float() rlauncher_check = -{ - if (self.ammo_rockets >= 3) - return TRUE; - return FALSE; -}; - -void(float req) w_rlauncher = -{ - if (req == WR_IDLE) - rlauncher_ready_01(); - else if (req == WR_FIRE1) - weapon_prepareattack(rlauncher_check, rlauncher_check, rlauncher_fire1_01, cvar("g_balance_rocketlauncher_refire")); - else if (req == WR_RAISE) - rlauncher_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = floor(self.ammo_rockets / 3); - else if (req == WR_DROP) - rlauncher_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_ROCKET_LAUNCHER, "w_rl.zym", IT_ROCKETS); - else if (req == WR_CHECKAMMO) - weapon_hasammo = rlauncher_check(); -}; - - -void W_Rocket_Explode (void) -{ - vector org2; - org2 = findbetterlocation (self.origin); - te_explosion (org2); - effect (org2, "models/sprites/rocketexplosion.spr32", 0, 20, 40); - sound (self, CHAN_BODY, "weapons/rocket_impact.wav", 1, ATTN_NORM); - - self.event_damage = SUB_Null; - RadiusDamage (self, self.owner, cvar("g_balance_rocketlauncher_damage"), cvar("g_balance_rocketlauncher_edgedamage"), cvar("g_balance_rocketlauncher_radius"), world, cvar("g_balance_rocketlauncher_force"), WEP_ROCKET_LAUNCHER); - - remove (self); -} - -void W_Rocket_Think (void) -{ - self.nextthink = time; - if (time > self.cnt) - { - W_Rocket_Explode (); - return; - } - if (self.owner) - { - if (self.owner.deadflag) - self.owner = self; - else if (self.owner.wpn == WEP_ROCKET_LAUNCHER && self.owner.button3) - W_Rocket_Explode (); - } -} - -void W_Rocket_Touch (void) -{ - if (pointcontents (self.origin) == CONTENT_SKY) - { - remove (self); - return; - } - else - W_Rocket_Explode (); -} - -void W_Rocket_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force) -{ - self.health = self.health - damage; - if (self.health <= 0) - W_Rocket_Explode(); -} - -void W_Rocket_Attack (void) -{ - local entity missile; - local entity flash; - local vector org; - sound (self, CHAN_WEAPON, "weapons/rocket_fire.wav", 1, ATTN_NORM); - if (cvar("g_rocketarena") == 0) - self.ammo_rockets = self.ammo_rockets - 3; - self.punchangle_x = -4; - org = self.origin + self.view_ofs + v_forward * 15 + v_right * 3 + v_up * -11; - te_smallflash(org); - - missile = spawn (); - missile.owner = self; - missile.classname = "missile"; - - missile.takedamage = DAMAGE_YES; - missile.damageforcescale = 4; - missile.health = 30; - missile.event_damage = W_Rocket_Damage; - - missile.movetype = MOVETYPE_FLY; - missile.solid = SOLID_BBOX; - setmodel (missile, "models/rocket.md3"); - setsize (missile, '0 0 0', '0 0 0'); - - setorigin (missile, org); - missile.velocity = v_forward * cvar("g_balance_rocketlauncher_speed"); - missile.angles = vectoangles (missile.velocity); - - missile.touch = W_Rocket_Touch; - missile.think = W_Rocket_Think; - missile.nextthink = time; - missile.cnt = time + 9; - sound (missile, CHAN_BODY, "weapons/rocket_fly.wav", 0.4, ATTN_NORM); - - flash = spawn (); - setorigin (flash, org); - setmodel (flash, "models/flash.md3"); - flash.velocity = v_forward * 20; - flash.angles = vectoangles (flash.velocity); - SUB_SetFade (flash, time, 0.4); - flash.effects = flash.effects | EF_ADDITIVE | EF_FULLBRIGHT; - self.clip_rockets = self.clip_rockets - 1; - if (self.clip_rockets == 0) - { - DoReload (3, 4); // weapon type 3 is RL, and reload 4 rockets. - } -} - -// weapon frames - -void() rlauncher_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, rlauncher_ready_01); self.weaponentity.state = WS_READY;}; -void() rlauncher_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() rlauncher_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() rlauncher_fire1_01 = -{ - weapon_doattack(rlauncher_check, rlauncher_check, W_Rocket_Attack); - weapon_thinkf(WFRAME_FIRE1, 0.3, rlauncher_ready_01); -}; - diff --git a/TeamNexuiz/game/gamec/w_setrope.c b/TeamNexuiz/game/gamec/w_setrope.c deleted file mode 100644 index e7da110ff..000000000 --- a/TeamNexuiz/game/gamec/w_setrope.c +++ /dev/null @@ -1,84 +0,0 @@ -void() setrope_ready_01; -void() setrope_fire1_01; -void() setrope_deselect_01; -void() setrope_select_01; - -float() setrope_check = -{ - return TRUE; -} - -void(float req) w_setrope = -{ - if (req == WR_IDLE) - setrope_ready_01(); - else if (req == WR_FIRE1) - weapon_prepareattack(setrope_check, setrope_check, setrope_fire1_01, cvar("g_balance_setrope_refire")); - else if (req == WR_RAISE) - setrope_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = 1; - else if (req == WR_DROP) - setrope_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_SETROPE, "w_setrope.zym", 0); - else if (req == WR_CHECKAMMO) - weapon_hasammo = setrope_check(); -} - -void RemoveRope() -{ -} - -void RopeThink() -{ -} - -void RopeTouch (void) -{ - if (other.classname != "player" || other.health < 1) - return; - other.ladder_time = time + 0.1; - other.ladder_entity = self; -} - -void W_SetRope (void) -{ - local entity ropestand, oself; - local vector org; - - makevectors(self.v_angle); - org = self.origin + self.view_ofs + v_forward * 15 - v_right * 5 + v_up * -12; - - ropestand = spawn (); - ropestand.owner = self; - ropestand.classname = "ropestand"; - - ropestand.movetype = MOVETYPE_NONE; - ropestand.solid = SOLID_BBOX; - - setmodel (ropestand, "models/ropebase.mdl"); - setsize (ropestand, '0 0 0', '0 0 0'); - setorigin (ropestand, org); - - oself = self; - self = ropestand; - droptofloor(); - self = oself; - - ropestand.angles = self.angles; - ropestand.angles_x = ropestand.angles_z = 0; - - //ropestand.touch = RopeStandTouch; - ropestand.think = RopeExtend; - ropestand.nextthink = time + 0.1; -} - -void() setrope_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, setrope_ready_01); self.weaponentity.state = WS_READY;}; -void() setrope_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() setrope_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() setrope_fire1_01 = -{ - weapon_doattack(setrope_check, setrope_check, W_SetRope); - weapon_thinkf(WFRAME_FIRE1, 0.3, setrope_ready_01); -} diff --git a/TeamNexuiz/game/gamec/w_shotgun.c b/TeamNexuiz/game/gamec/w_shotgun.c deleted file mode 100644 index 9b5476277..000000000 --- a/TeamNexuiz/game/gamec/w_shotgun.c +++ /dev/null @@ -1,119 +0,0 @@ -void() shotgun_ready_01; -void() shotgun_fire1_01; -void() shotgun_fire2_01; -void() shotgun_deselect_01; -void() shotgun_select_01; - -float() shotgun_check = -{ -// if (self.ammo_shells >= 1) - return TRUE; -// return FALSE; -}; - -void(float req) w_shotgun = -{ - if (req == WR_IDLE) - shotgun_ready_01(); - else if (req == WR_FIRE1) - weapon_prepareattack(shotgun_check, shotgun_check, shotgun_fire1_01, cvar("g_balance_shotgun_refire")); - else if (req == WR_FIRE2) - weapon_prepareattack(shotgun_check, shotgun_check, shotgun_fire2_01, cvar("g_balance_shotgun_loadclip")); - else if (req == WR_RAISE) - shotgun_select_01(); - else if (req == WR_UPDATECOUNTS) - return;//self.currentammo = self.ammo_shells; - else if (req == WR_DROP) - shotgun_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_SHOTGUN, "w_shotgun.zym", IT_SHELLS); - else if (req == WR_CHECKAMMO) - weapon_hasammo = shotgun_check(); -}; - -void W_Shotgun_Attack (void) -{ - local vector org; - float sc; - float bullets; - float d; - float spread; - - sound (self, CHAN_WEAPON, "weapons/shotgun_fire.wav", 1, ATTN_NORM); - bullets = cvar("g_balance_shotgun_bullets"); - d = cvar("g_balance_shotgun_damage"); - - org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 8) + (v_forward * 5); - spread = cvar("g_balance_shotgun_spread"); - for (sc = 0;sc < bullets;sc = sc + 1) - fireBullet2 (org, v_forward, spread, d, WEP_SHOTGUN, sc < 3, cvar("g_balance_shotgun_force")); - self.currentammo = self.currentammo - 1; - - // casing code - if (cvar("g_casings") >= 1) - { - org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 8) + (v_forward * 10); - SpawnCasing (org, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 + 10) * v_up), 2, v_forward,'0 250 0', 100, 1); - } - - org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 8) + (v_forward * 20); - W_Smoke(org, v_forward, 12); - //te_smallflash(org); - - self.punchangle_x = -5; -} - -// weapon frames - -void() shotgun_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, shotgun_ready_01); self.weaponentity.state = WS_READY;}; -void() shotgun_select_01 = { - self.currentammo = cvar("g_balance_shotgun_clipsize"); - weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0'); -} -void() shotgun_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; - -void() shotgun_reload_02 = -{ - self.currentammo = self.currentammo + 1; - shotgun_ready_01(); // return to ready state if not already there -} - -void() shotgun_reload_01 = -{ - if(self.currentammo >= cvar("g_balance_shotgun_clipsize")) - { // already full - if(self.weaponentity.state != WS_READY) - shotgun_ready_01(); // return to ready state if not already there - return; - } - // if we somehow reached negative, fix that first - if(self.currentammo < 0) - self.currentammo = 0; - - sound (self, CHAN_WEAPON, "weapons/shotgun_reload.wav", 1, ATTN_NORM); - - // load a shell - weapon_thinkf(WFRAME_FIRE2, cvar("g_balance_shotgun_loadclip2"), shotgun_reload_02); -} - -// after firing, call this funtion to check if the shotgun is empty -void() shotgun_checkempty_01 = -{ - if(self.currentammo >= 1) - { // we don't need to force a reload - shotgun_ready_01(); - return; - } - // load a shell - shotgun_reload_01(); -} - -void() shotgun_fire1_01 = -{ - weapon_doattack(shotgun_check, shotgun_check, W_Shotgun_Attack); - weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_shotgun_refire"), shotgun_checkempty_01); -} -void() shotgun_fire2_01 = -{ - shotgun_reload_01(); -} \ No newline at end of file diff --git a/TeamNexuiz/game/gamec/w_uzi.c b/TeamNexuiz/game/gamec/w_uzi.c deleted file mode 100644 index ac6e8d17d..000000000 --- a/TeamNexuiz/game/gamec/w_uzi.c +++ /dev/null @@ -1,92 +0,0 @@ -void() uzi_ready_01; -void() uzi_fire1_01; -void() uzi_deselect_01; -void() uzi_select_01; - -float() uzi_check = -{ - if (self.ammo_nails >= 1) - return TRUE; - return FALSE; -}; - -void(float req) w_uzi = -{ - if (req == WR_IDLE) - uzi_ready_01(); - else if (req == WR_FIRE1 || req == WR_FIRE2) - weapon_prepareattack(uzi_check, uzi_check, uzi_fire1_01, cvar("g_balance_uzi_refire")); - else if (req == WR_RAISE) - uzi_select_01(); - else if (req == WR_UPDATECOUNTS) - self.currentammo = self.ammo_nails; - else if (req == WR_DROP) - uzi_deselect_01(); - else if (req == WR_SETUP) - weapon_setup(WEP_UZI, "w_uzi.zym", IT_NAILS); - else if (req == WR_CHECKAMMO) - weapon_hasammo = uzi_check(); -}; - -.float uzi_bulletcounter; -void W_Uzi_Attack (void) -{ - local vector org; - entity flash; - sound (self, CHAN_WEAPON, "weapons/uzi_fire.wav", 1, ATTN_NORM); - self.ammo_nails = self.ammo_nails - 1; - self.punchangle_x = random () - 0.5; - self.punchangle_y = random () - 0.5; - org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 8) + (v_forward * 15); - - // this attack_finished just enforces a cooldown at the end of a burst - self.attack_finished = time + cvar("g_balance_uzi_refire2"); - - if (self.uzi_bulletcounter == 1) - fireBullet (org, v_forward, cvar("g_balance_uzi_spread2"), cvar("g_balance_uzi_damage2"), WEP_UZI, (self.uzi_bulletcounter & 3) == 0); - else - fireBullet (org, v_forward, cvar("g_balance_uzi_spread"), cvar("g_balance_uzi_damage"), WEP_UZI, (self.uzi_bulletcounter & 3) == 0); - - // casing code - if (cvar("g_casings") >= 2) - { - org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 8) + (v_forward * 10); - SpawnCasing (org, ((random () * 50 + 50) * v_right) - ((random () * 25 + 25) * v_forward) - ((random () * 5 + 10) * v_up), 2, v_forward,'0 250 0', 100, 2); - } - - flash = spawn (); - org = self.origin + self.view_ofs + (v_right * 6) - (v_up * 10) + (v_forward * 40); - setorigin (flash, org); - setmodel (flash, "models/uziflash.md3"); - flash.velocity = v_forward * 20; - flash.angles = vectoangles (flash.velocity); - flash.angles_z=flash.v_angle_z + random () * 180; - flash.scale = 0.75; - flash.alpha = 0.5; - SUB_SetFade (flash, time, 0.2); - flash.effects = flash.effects | EF_ADDITIVE | EF_FULLBRIGHT; - -} -// weapon frames - -void() uzi_ready_01 = {weapon_thinkf(WFRAME_IDLE, 0.1, uzi_ready_01); self.weaponentity.state = WS_READY;}; -void() uzi_select_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_ready); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, '0 0 0');}; -void() uzi_deselect_01 = {weapon_thinkf(-1, cvar("g_balance_weaponswitchdelay"), w_clear); weapon_boblayer1(PLAYER_WEAPONSELECTION_SPEED, PLAYER_WEAPONSELECTION_RANGE);}; -void() uzi_fire1_02 = -{ - if (self.button0) - { - self.uzi_bulletcounter = self.uzi_bulletcounter + 1; - weapon_doattack(uzi_check, uzi_check, W_Uzi_Attack); - weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_refire"), uzi_fire1_02); - } - else - weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_refire"), uzi_ready_01); -}; -void() uzi_fire1_01 = -{ - self.uzi_bulletcounter = 1; - weapon_doattack(uzi_check, uzi_check, W_Uzi_Attack); - weapon_thinkf(WFRAME_FIRE1, cvar("g_balance_uzi_refire"), uzi_fire1_02); -}; - -- 2.39.2