Move platform files over, rebuild weapons against Nuclide
This commit is contained in:
parent
92722445aa
commit
2b300e45b0
220 changed files with 6517 additions and 2306 deletions
1
PROJECT
Normal file
1
PROJECT
Normal file
|
@ -0,0 +1 @@
|
|||
RadTherapy
|
|
@ -1,5 +1,6 @@
|
|||
# FreeHL
|
||||
Clean-room reimplementation of Half-Life: Deathmatch and Half-Life (Experimental, this means Singleplayer is NOT complete).
|
||||
# Rad-Therapy (FreeHL)
|
||||
|
||||
Clean-room reimplementation of Valve Corporation's Half-Life: Deathmatch and Half-Life (Experimental, this means Singleplayer is NOT complete).
|
||||
|
||||
Similar to FreeCS, this aims to recreate the feeling of the original game.
|
||||
It's designed to work with the content from the CD version of the game.
|
||||
|
|
251
engine.h
Normal file
251
engine.h
Normal file
|
@ -0,0 +1,251 @@
|
|||
/***
|
||||
*
|
||||
* Copyright (c) 2000-2022, Vera Visions. All rights reserved.
|
||||
*
|
||||
****/
|
||||
|
||||
#define FULLENGINENAME "Rad-Therapy"
|
||||
#define GAME_SHORTNAME "HL"
|
||||
#define GAME_BASEGAMES "valve"
|
||||
#define GAME_PROTOCOL "FTE-HalfLife"
|
||||
|
||||
#define BRANDING_ICON "freecs.ico"
|
||||
#define DISTRIBUTION "FHL"
|
||||
#define DISTRIBUTIONLONG "eukara"
|
||||
#define GAME_FULLNAME FULLENGINENAME
|
||||
#define GAME_DEFAULTPORT 23000
|
||||
#define ENGINEWEBSITE "https://www.frag-net.com/"
|
||||
|
||||
#ifndef GLQUAKE
|
||||
#define GLQUAKE
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifndef VKQUAKE
|
||||
#define VKQUAKE
|
||||
#endif
|
||||
*/
|
||||
#undef VKQUAKE /* not yet, needs more testing */
|
||||
|
||||
/* disable quake specific hacks and overrides */
|
||||
#define QUAKETC
|
||||
#define NOBUILTINMENUS
|
||||
#define NOLEGACY
|
||||
|
||||
/* engine behaviour */
|
||||
#define PLUGINS /* enables fteplug_ files */
|
||||
#define AVAIL_ZLIB /* we need this for pk3 and ogg vorbis */
|
||||
#define CL_MASTER /* allows for serverbrowser builtins */
|
||||
#define CSQC_DAT /* clientside qcvm */
|
||||
#define MENU_DAT /* persistent qcvm */
|
||||
#define PSET_SCRIPT /* scripts defining particles */
|
||||
#define LOADERTHREAD /* multithreading related */
|
||||
#define USEAREAGRID /* leave it on, improves performance */
|
||||
#define AVAIL_DINPUT /* input for Windows */
|
||||
#define AVAIL_FREETYPE /* for truetype font rendering */
|
||||
#define AVAIL_STBI /* avoid libpng/libjpeg dependancies */
|
||||
#define ENGINE_ROUTING /* engine-side, fast routing */
|
||||
|
||||
#ifndef LEGACY_GPU
|
||||
#define RTLIGHTS
|
||||
#else
|
||||
#undef RTLIGHTS
|
||||
#endif
|
||||
|
||||
#undef D3D9QUAKE /* MICROS~1 trash */
|
||||
#undef D3D11QUAKE /* MICROS~1 trash */
|
||||
#undef D3D8QUAKE /* MICROS~1 trash */
|
||||
|
||||
/* uncompressed textures */
|
||||
#define IMAGEFMT_BMP /* sprays */
|
||||
#define IMAGEFMT_TGA
|
||||
|
||||
/* compressed textures */
|
||||
#define IMAGEFMT_KTX
|
||||
#define DECOMPRESS_ETC2
|
||||
#define DECOMPRESS_RGTC
|
||||
#define DECOMPRESS_S3TC
|
||||
|
||||
/* To be able to comm with Frag-Net.com */
|
||||
#define HAVE_PACKET
|
||||
#define SUPPORT_ICE
|
||||
#define HAVE_TCP
|
||||
#define HAVE_GNUTLS /* linux tls/dtls support */
|
||||
#define HAVE_WINSSPI /* windows tls/dtls support */
|
||||
#define WEBCLIENT /* uri_get+any internal downloads etc */
|
||||
|
||||
#ifndef MULTITHREAD
|
||||
#define MULTITHREAD
|
||||
#endif
|
||||
|
||||
#ifndef DEBUG
|
||||
/* if 2, disables writing fteextensions.qc completely. */
|
||||
#define NOQCDESCRIPTIONS 2
|
||||
#endif
|
||||
|
||||
/* various package formats */
|
||||
#define PACKAGE_PK3
|
||||
#define PACKAGE_TEXWAD
|
||||
#define PACKAGE_Q1PAK
|
||||
|
||||
/* level formats */
|
||||
#define Q3BSPS
|
||||
#define Q1BSPS
|
||||
#define TERRAIN
|
||||
|
||||
/* audio */
|
||||
#undef AVAIL_DSOUND
|
||||
#define AVAIL_OPENAL
|
||||
#define AVAIL_OGGVORBIS
|
||||
#define HAVE_OPUS
|
||||
#define VOICECHAT
|
||||
|
||||
/* todo: make OpenAL only */
|
||||
#define HAVE_MIXER
|
||||
|
||||
/* Model formats, IQM/VVM and HLMDL for legacy maps */
|
||||
#define INTERQUAKEMODELS
|
||||
#define HALFLIFEMODELS
|
||||
|
||||
/* physics */
|
||||
#undef USE_INTERNAL_ODE
|
||||
#undef USE_INTERNAL_BULLET
|
||||
#define USERBE
|
||||
#define RAGDOLL
|
||||
|
||||
/* we don't need any of these */
|
||||
#undef IMAGEFMT_PCX
|
||||
#undef PACKAGE_DOOMWAD
|
||||
#undef DOOMWADS
|
||||
#undef MAP_PROC
|
||||
#undef Q2BSPS
|
||||
#define RFBSPS
|
||||
#define VERTEXINDEXBYTES 2 //16bit indexes work everywhere but may break some file types, 32bit indexes are optional in gles<=2 and d3d<=9 and take more memory/copying but allow for bigger batches/models. Plugins need to be compiled the same way so this is no longer set per-renderer.
|
||||
#define SPRMODELS
|
||||
#undef SP2MODELS
|
||||
#undef DSPMODELS
|
||||
#undef MD1MODELS
|
||||
#undef MD2MODELS
|
||||
#undef MD3MODELS
|
||||
#undef MD5MODELS
|
||||
#undef ZYMOTICMODELS
|
||||
#undef DPMMODELS
|
||||
#undef PSKMODELS
|
||||
#undef MENU_NATIVECODE /* native menu replacing menuQC */
|
||||
#undef MVD_RECORDING /* server can record MVDs. */
|
||||
#undef AVAIL_WASAPI /* windows advanced sound api */
|
||||
//#undef AVAIL_DSOUND /* MICROS~1 trash */
|
||||
#undef BOTLIB_STATIC /* q3 botlib */
|
||||
#undef AVAIL_XZDEC /* .xz decompression */
|
||||
#undef HAVE_SPEEX /* .xz decompression */
|
||||
#undef AVAIL_GZDEC /* .gz decompression */
|
||||
#undef PACKAGE_DZIP /* .dzip special-case archive support */
|
||||
#undef AVAIL_PNGLIB /* .png image format support (read+screenshots) */
|
||||
#undef AVAIL_JPEGLIB /* .jpeg image format support (read+screenshots) */
|
||||
#undef AVAIL_MP3_ACM /* .mp3 support (in windows). */
|
||||
#undef IMAGEFMT_DDS
|
||||
#undef IMAGEFMT_PKM
|
||||
#undef IMAGEFMT_BLP
|
||||
#undef NETPREPARSE /* allows for running both nq+qw on the same server (if not, protocol used must match gamecode) */
|
||||
#undef USE_SQLITE /* sql-database-as-file support */
|
||||
#undef QUAKESTATS /* defines STAT_HEALTH etc. if omitted, you'll need to provide that functionality yourself */
|
||||
#undef QUAKEHUD /* support for drawing the vanilla hud */
|
||||
#undef QWSKINS /* disabling this means no qw .pcx skins nor enemy/team skin/colour forcing */
|
||||
#undef SVRANKING /* legacy server-side ranking system */
|
||||
#define HUFFNETWORK /* crappy network compression. probably needs reseeding */
|
||||
#undef SVCHAT /* ancient lame builtin to support NPC-style chat.. */
|
||||
#undef VM_Q1 /* q1qvm implementation, to support ktx */
|
||||
#undef Q2SERVER /* q2 server+gamecode */
|
||||
#undef Q2CLIENT /* q2 client. file formats enabled separately */
|
||||
#undef Q3CLIENT /* q3 client stuff */
|
||||
#undef Q3SERVER /* q3 server stuff */
|
||||
#undef HEXEN2 /* runs hexen2 gamecode, supports hexen2 file formats */
|
||||
#undef NQPROT /* act as an nq client/server, with nq gamecode */
|
||||
#undef WEBSERVER /* sv_ftp + sv_http cvars */
|
||||
#undef RUNTIMELIGHTING /* automatic generation of .lit files */
|
||||
#undef R_XFLIP /* old silly thing */
|
||||
#undef TEXTEDITOR /* because emacs */
|
||||
#undef TCPCONNECT /* support for playing over tcp sockets, instead of just udp. compatible with qizmo */
|
||||
#undef IRCCONNECT /* lame support for routing game packets via irc server. not a good idea */
|
||||
#undef PSET_CLASSIC /* support the 'classic' particle system, for that classic quake feel */
|
||||
#undef HAVE_CDPLAYER /* Redbook CD Audio */
|
||||
#undef QTERM
|
||||
#undef SIDEVIEWS
|
||||
#undef MAX_SPLITS
|
||||
#undef SUBSERVERS /* multi-map */
|
||||
#undef VM_LUA /* lua game-logic */
|
||||
#undef HLCLIENT /* regressed, unfinished*/
|
||||
#undef HLSERVER /* regressed, unfinished */
|
||||
#undef FTPSERVER
|
||||
#undef HAVE_JUKEBO /* includes built-in jukebox */
|
||||
#define HAVE_MEDIA_DECODER /* can play cin/roq, more with plugins */
|
||||
#undef HAVE_MEDIA_ENCODER /* capture/capturedemo work */
|
||||
#undef HAVE_SPEECHTOTEXT /* Windows speech-to-text thing */
|
||||
#undef SAVEDGAMES
|
||||
#undef PACKAGEMANAGER /* enable/disable/download packages and plugins */
|
||||
#undef HEADLESSQUAKE
|
||||
#undef WAYLANDQUAKE
|
||||
#undef SERVER_DEMO_PLAYBACK /* deprecated */
|
||||
#undef DECOMPRESS_BPTC
|
||||
#undef IMAGEFMT_HDR
|
||||
#undef IMAGEFMT_PBM
|
||||
#undef IMAGEFMT_PSD
|
||||
#undef IMAGEFMT_XCF
|
||||
#undef IMAGEFMT_LMP
|
||||
#undef IMAGEFMT_PNG
|
||||
#undef IMAGEFMT_JPG
|
||||
#undef IMAGEFMT_GIF
|
||||
#undef IMAGEFMT_EXR
|
||||
#undef IPLOG
|
||||
#undef AVAIL_BOTLIB
|
||||
#undef AVAIL_BZLIB
|
||||
#undef DECOMPRESS_ASTC
|
||||
#undef IMAGEFMT_ASTC
|
||||
#undef HAVE_HTTPSV
|
||||
#undef MODELFMT_MDX
|
||||
#undef MODELFMT_OBJ
|
||||
#undef MODELFMT_GLTF
|
||||
|
||||
#ifdef COMPILE_OPTS
|
||||
/* things to configure qclib, which annoyingly doesn't include this
|
||||
* file itself */
|
||||
-DOMIT_QCC /* disable the built-in qcc */
|
||||
//-DSIMPLE_QCVM /* disable qc debugging and 32bit opcodes */
|
||||
#ifndef AVAIL_ZLIB
|
||||
-DNO_ZLIB /* disable zlib */
|
||||
#endif
|
||||
#ifdef AVAIL_PNGLIB
|
||||
-DLINK_PNG
|
||||
#endif
|
||||
#ifdef AVAIL_JPEGLIB
|
||||
-DLINK_JPEG
|
||||
#endif
|
||||
#ifdef AVAIL_FREETYPE
|
||||
-DLINK_FREETYPE
|
||||
#endif
|
||||
|
||||
/* makefile will respond to this by trying to link bullet into the
|
||||
* engine itself, instead of as a plugin. */
|
||||
#ifdef USE_INTERNAL_BULLET
|
||||
-DLINK_INTERNAL_BULLET
|
||||
#endif
|
||||
|
||||
#ifdef USE_INTERNAL_ODE
|
||||
-DODE_STATIC
|
||||
#endif
|
||||
|
||||
/* disable static speex */
|
||||
#ifdef HAVE_SPEEX
|
||||
-DNO_SPEEX
|
||||
#endif
|
||||
|
||||
/* disable static botlib */
|
||||
#ifndef BOTLIB_STATIC
|
||||
-DNO_BOTLIB
|
||||
#endif
|
||||
|
||||
-DLIBVORBISFILE_STATIC
|
||||
|
||||
/* optimise for size instead of speed. less cpu cache needed means that
|
||||
* its sometimes faster.*/
|
||||
#endif
|
19
manifest.fmf
19
manifest.fmf
|
@ -1,19 +0,0 @@
|
|||
FTEMANIFEST 1
|
||||
GAME valve
|
||||
NAME "Half-Life"
|
||||
BASEGAME platform
|
||||
BASEGAME valve
|
||||
|
||||
// you don't really want to change these
|
||||
RTCBROKER master.frag-net.com:27950
|
||||
PROTOCOLNAME "FTE-HalfLife"
|
||||
MAINCONFIG game.cfg
|
||||
DOWNLOADSURL "http://www.frag-net.com/dl/packages"
|
||||
|
||||
-exec platform_default.cfg
|
||||
|
||||
// load ffmpeg for the logo.avi file
|
||||
-plug_load ffmpeg
|
||||
|
||||
// override some liblist.gam entries
|
||||
-set gameinfo_chatroom "halflife"
|
|
@ -1,6 +1,6 @@
|
|||
CC=fteqcc
|
||||
QCC=fteqcc
|
||||
|
||||
all:
|
||||
cd client && $(MAKE)
|
||||
cd server && $(MAKE)
|
||||
cd menu && $(MAKE)
|
||||
cd menu && $(MAKE)
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2022 Vera Visions LLC.
|
||||
* Copyright (c) 2016-2020 Marco Cawthorne <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
|
@ -12,14 +12,52 @@
|
|||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
*/
|
||||
|
||||
class
|
||||
HLWeaponSelect
|
||||
{
|
||||
void HLWeaponSelect(void);
|
||||
|
||||
virtual void Draw(void);
|
||||
virtual void SelectSlot(bool);
|
||||
virtual void SelectNext(bool);
|
||||
virtual void SelectPrevious(bool);
|
||||
virtual void SelectBest(bool);
|
||||
};
|
||||
|
||||
void
|
||||
Game_ServerModelEvent(float flTimeStamp, int iCode, string strData)
|
||||
HLWeaponSelect::HLWeaponSelect(void)
|
||||
{
|
||||
switch (iCode) {
|
||||
default:
|
||||
Event_ServerModelEvent(flTimeStamp, iCode, strData);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
HLWeaponSelect::Draw(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
HLWeaponSelect::SelectSlot(bool fastSwitch)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
HLWeaponSelect::SelectNext(bool fastSwitch)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
HLWeaponSelect::SelectPrevious(bool fastSwitch)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
HLWeaponSelect::SelectBest(bool fastSwitch)
|
||||
{
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
CC=fteqcc
|
||||
QCC=fteqcc
|
||||
|
||||
all:
|
||||
$(CC) progs.src
|
||||
$(QCC) progs.src
|
||||
|
|
|
@ -21,6 +21,9 @@ ClientGame_ConsoleCommand(void)
|
|||
case "chooseteam":
|
||||
sendevent("HLDM_Chooseteam", "s", argv(1));
|
||||
break;
|
||||
case "hudSort":
|
||||
HLWeapon_SortWeaponChain((NSClientPlayer)pSeat->m_ePlayer);
|
||||
break;
|
||||
default:
|
||||
return (0);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "obituary.h"
|
||||
#include "particles.h"
|
||||
#include "hud_sprite.h"
|
||||
|
||||
var int autocvar_cl_autoweaponswitch = TRUE;
|
||||
|
||||
|
@ -65,4 +66,6 @@ void HUD_DrawAmmo1(void);
|
|||
void HUD_DrawAmmo2(void);
|
||||
void HUD_DrawAmmo3(void);
|
||||
void HUD_DrawAmmoBar(vector pos, float val, float max, float a);
|
||||
void HUD_WeaponPickupNotify(int);
|
||||
void HUD_WeaponPickupNotify(int);
|
||||
|
||||
NSWeapon HLWeapon_SortWeaponChain(NSClientPlayer targetPlayer);
|
||||
|
|
|
@ -19,7 +19,17 @@ ClientGame_EntityUpdate(float id, float new)
|
|||
{
|
||||
switch (id) {
|
||||
case ENT_TRIPMINE:
|
||||
w_tripmine_parse();
|
||||
NSENTITY_READENTITY(HLTripmine, new)
|
||||
break;
|
||||
case ENT_WEAPON:
|
||||
NSENTITY_READENTITY(HLWeapon, new)
|
||||
break;
|
||||
case ENT_PLAYER:
|
||||
#ifndef GEARBOX
|
||||
NSENTITY_READENTITY(HLPlayer, new)
|
||||
#else
|
||||
NSENTITY_READENTITY(OP4Player, new)
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
return (0);
|
||||
|
|
|
@ -138,7 +138,7 @@ void
|
|||
HUD_DrawHealth(void)
|
||||
{
|
||||
vector pos;
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
|
||||
if (pl.health != pSeatLocal->m_iHealthOld) {
|
||||
pSeatLocal->m_flHealthAlpha = 1.0;
|
||||
|
@ -185,7 +185,7 @@ void
|
|||
HUD_DrawArmor(void)
|
||||
{
|
||||
vector pos;
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
|
||||
pos = g_hudmins + [198, g_hudres[1] - 42];
|
||||
|
||||
|
@ -232,7 +232,7 @@ HUD_DrawArmor(void)
|
|||
void
|
||||
HUD_DrawAmmo1(void)
|
||||
{
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
vector pos;
|
||||
|
||||
if (pl.a_ammo1 != pSeatLocal->m_iAmmo1Old) {
|
||||
|
@ -255,7 +255,7 @@ HUD_DrawAmmo1(void)
|
|||
void
|
||||
HUD_DrawAmmo2(void)
|
||||
{
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
vector pos;
|
||||
|
||||
if (pl.a_ammo2 != pSeatLocal->m_iAmmo2Old) {
|
||||
|
@ -277,7 +277,7 @@ HUD_DrawAmmo2(void)
|
|||
void
|
||||
HUD_DrawAmmo3(void)
|
||||
{
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
vector pos;
|
||||
|
||||
if (pl.a_ammo3 != pSeatLocal->m_iAmmo3Old) {
|
||||
|
@ -313,7 +313,7 @@ void
|
|||
HUD_DrawFlashlight(void)
|
||||
{
|
||||
vector pos;
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
pos = g_hudmins + [g_hudres[0] - 48, 16];
|
||||
|
||||
/* both on, draw both sprites at full intensity */
|
||||
|
@ -389,7 +389,7 @@ HUD_DrawLogo(void)
|
|||
void
|
||||
HUD_DrawNotify(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
NSClientPlayer pl = (NSClientPlayer)self;
|
||||
vector pos;
|
||||
float a;
|
||||
|
||||
|
@ -404,7 +404,7 @@ HUD_DrawNotify(void)
|
|||
|
||||
a = bound(0.0, pSeatLocal->m_flPickupAlpha, 1.0);
|
||||
pos[1] += 48 * (1.0 - a);
|
||||
Weapons_HUDPic(pl, pSeatLocal->m_iPickupWeapon, 1, pos, a);
|
||||
//Weapons_HUDPic(pl, pSeatLocal->m_iPickupWeapon, 1, pos, a);
|
||||
HUD_ItemNotify_Draw(pos);
|
||||
HUD_AmmoNotify_Draw(pos);
|
||||
pSeatLocal->m_flPickupAlpha -= (clframetime * 0.5);
|
||||
|
@ -413,6 +413,7 @@ HUD_DrawNotify(void)
|
|||
void
|
||||
HUD_WeaponPickupNotify(int w)
|
||||
{
|
||||
#if 0
|
||||
#if defined (VALVE) || defined (GEARBOX)
|
||||
switch (w) {
|
||||
case WEAPON_SNARK:
|
||||
|
@ -426,7 +427,7 @@ HUD_WeaponPickupNotify(int w)
|
|||
default:
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
pSeatLocal->m_iPickupWeapon = w;
|
||||
pSeatLocal->m_flPickupAlpha = 2.5f;
|
||||
}
|
||||
|
@ -471,7 +472,7 @@ HUD_TimeRemaining(void)
|
|||
void
|
||||
HUD_Draw(void)
|
||||
{
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
|
||||
#ifndef TFC
|
||||
#ifndef GEARBOX
|
||||
|
@ -487,7 +488,9 @@ HUD_Draw(void)
|
|||
#endif
|
||||
|
||||
/* little point in not drawing these, even if you don't have a suit */
|
||||
Weapons_DrawCrosshair(pl);
|
||||
if (pl.m_activeWeapon)
|
||||
pl.m_activeWeapon.UpdateGUI();
|
||||
|
||||
HUD_DrawDamageIndicator();
|
||||
HUD_DrawWeaponSelect();
|
||||
Obituary_Draw();
|
||||
|
@ -495,7 +498,7 @@ HUD_Draw(void)
|
|||
|
||||
HUD_TimeRemaining();
|
||||
|
||||
if (!(pl.g_items & ITEM_SUIT)) {
|
||||
if (pl.HasItem("item_suit") == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,26 +98,26 @@ HUD_AmmoNotify_Insert(int type, int count)
|
|||
|
||||
/* called whenever we should check for pickup updates */
|
||||
void
|
||||
HUD_AmmoNotify_Check(player pl)
|
||||
HUD_AmmoNotify_Check(NSClientPlayer pl)
|
||||
{
|
||||
HUD_AmmoNotify_Insert(0, pl.ammo_9mm - pl.ammo_9mm_net);
|
||||
HUD_AmmoNotify_Insert(1, pl.ammo_357 - pl.ammo_357_net);
|
||||
HUD_AmmoNotify_Insert(2, pl.ammo_m203_grenade - pl.ammo_m203_grenade_net);
|
||||
HUD_AmmoNotify_Insert(3, pl.ammo_buckshot - pl.ammo_buckshot_net);
|
||||
HUD_AmmoNotify_Insert(4, pl.ammo_bolt - pl.ammo_bolt_net);
|
||||
HUD_AmmoNotify_Insert(5, pl.ammo_rocket - pl.ammo_rocket_net);
|
||||
HUD_AmmoNotify_Insert(6, pl.ammo_uranium - pl.ammo_uranium_net);
|
||||
HUD_AmmoNotify_Insert(7, pl.ammo_hornet - pl.ammo_hornet_net);
|
||||
HUD_AmmoNotify_Insert(8, pl.ammo_handgrenade - pl.ammo_handgrenade_net);
|
||||
HUD_AmmoNotify_Insert(9, pl.ammo_satchel - pl.ammo_satchel_net);
|
||||
HUD_AmmoNotify_Insert(10, pl.ammo_snark - pl.ammo_snark_net);
|
||||
HUD_AmmoNotify_Insert(11, pl.ammo_tripmine - pl.ammo_tripmine_net);
|
||||
HUD_AmmoNotify_Insert(0, pl.m_iAmmoTypes[1] - pl.m_iAmmoTypes_net[1]);
|
||||
HUD_AmmoNotify_Insert(1, pl.m_iAmmoTypes[2] - pl.m_iAmmoTypes_net[2]);
|
||||
HUD_AmmoNotify_Insert(2, pl.m_iAmmoTypes[12] - pl.m_iAmmoTypes_net[12]);
|
||||
HUD_AmmoNotify_Insert(3, pl.m_iAmmoTypes[3] - pl.m_iAmmoTypes_net[3]);
|
||||
HUD_AmmoNotify_Insert(4, pl.m_iAmmoTypes[4] - pl.m_iAmmoTypes_net[4]);
|
||||
HUD_AmmoNotify_Insert(5, pl.m_iAmmoTypes[5] - pl.m_iAmmoTypes_net[5]);
|
||||
HUD_AmmoNotify_Insert(6, pl.m_iAmmoTypes[6] - pl.m_iAmmoTypes_net[6]);
|
||||
HUD_AmmoNotify_Insert(7, pl.m_iAmmoTypes[11] - pl.m_iAmmoTypes_net[11]);
|
||||
HUD_AmmoNotify_Insert(8, pl.m_iAmmoTypes[7] - pl.m_iAmmoTypes_net[7]);
|
||||
HUD_AmmoNotify_Insert(9, pl.m_iAmmoTypes[8] - pl.m_iAmmoTypes_net[8]);
|
||||
HUD_AmmoNotify_Insert(10, pl.m_iAmmoTypes[10] - pl.m_iAmmoTypes_net[10]);
|
||||
HUD_AmmoNotify_Insert(11, pl.m_iAmmoTypes[9] - pl.m_iAmmoTypes_net[9]);
|
||||
|
||||
#ifdef GEARBOX
|
||||
HUD_AmmoNotify_Insert(12, pl.ammo_556 - pl.ammo_556_net);
|
||||
HUD_AmmoNotify_Insert(13, pl.ammo_762 - pl.ammo_762_net);
|
||||
HUD_AmmoNotify_Insert(14, pl.ammo_spore - pl.ammo_spore_net);
|
||||
HUD_AmmoNotify_Insert(15, pl.ammo_shock - pl.ammo_shock_net);
|
||||
HUD_AmmoNotify_Insert(16, pl.ammo_penguin - pl.ammo_penguin_net);
|
||||
HUD_AmmoNotify_Insert(12, pl.m_iAmmoTypes[13] - pl.m_iAmmoTypes_net[13]);
|
||||
HUD_AmmoNotify_Insert(13, pl.m_iAmmoTypes[14] - pl.m_iAmmoTypes_net[14]);
|
||||
HUD_AmmoNotify_Insert(14, pl.m_iAmmoTypes[15] - pl.m_iAmmoTypes_net[15]);
|
||||
HUD_AmmoNotify_Insert(15, pl.m_iAmmoTypes[16] - pl.m_iAmmoTypes_net[16]);
|
||||
HUD_AmmoNotify_Insert(16, pl.m_iAmmoTypes[17] - pl.m_iAmmoTypes_net[17]);
|
||||
#endif
|
||||
}
|
|
@ -76,8 +76,9 @@ HUD_ItemNotify_Insert(int type, int count)
|
|||
|
||||
/* called whenever we should check for pickup updates */
|
||||
void
|
||||
HUD_ItemNotify_Check(player pl)
|
||||
HUD_ItemNotify_Check(NSClientPlayer pl)
|
||||
{
|
||||
#if 0
|
||||
int healthdiff = (int)bound(0, pl.health - pSeatLocal->m_iHealthOld, 100);
|
||||
int armordiff = (int)bound(0, pl.armor - pSeatLocal->m_iArmorOld, 100);
|
||||
bool ljDiff = ((pl.g_items & ITEM_LONGJUMP) > (pSeatLocal->m_iItemsOld & ITEM_LONGJUMP)) ? true : false;
|
||||
|
@ -107,4 +108,5 @@ HUD_ItemNotify_Check(player pl)
|
|||
}
|
||||
|
||||
pSeatLocal->m_iItemsOld = pl.g_items;
|
||||
#endif
|
||||
}
|
19
src/client/hud_sprite.h
Normal file
19
src/client/hud_sprite.h
Normal file
|
@ -0,0 +1,19 @@
|
|||
typedef struct
|
||||
{
|
||||
string m_strImage;
|
||||
vector m_vecSize;
|
||||
vector m_vecCanvasSize;
|
||||
vector m_vecCanvasPos;
|
||||
} hlsprite_t;
|
||||
|
||||
void HLSprite_Init(void);
|
||||
|
||||
void HLSprite_Draw_RGBA(string spriteName, vector spritePos, vector spriteColor, float spriteAlpha, bool isAdditive);
|
||||
|
||||
void HLSprite_Draw(string spriteName, vector spritePos, bool isAdditive);
|
||||
|
||||
void HLSprite_Draw_A(string spriteName, vector spritePos, float spriteAlpha, bool isAdditive);
|
||||
|
||||
void HLSprite_Draw_RGB(string spriteName, vector spritePos, vector spriteColor, bool isAdditive);
|
||||
|
||||
void HLSprite_DrawCrosshair(string spriteName);
|
|
@ -14,35 +14,61 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
string m_strImage;
|
||||
vector m_vecSize;
|
||||
vector m_vecCanvasSize;
|
||||
vector m_vecCanvasPos;
|
||||
} hlsprite_t;
|
||||
|
||||
hlsprite_t *g_hlsprites;
|
||||
var hashtable g_hashhlsprite;
|
||||
var int g_hlSpriteCount;
|
||||
|
||||
void
|
||||
HLSprite_Init(void)
|
||||
static int
|
||||
HLSprite_CountEntriesInFile(string fileName)
|
||||
{
|
||||
filestream hudFile;
|
||||
vector imgSize;
|
||||
int spriteCount = 0i;
|
||||
int i = 0i;
|
||||
int c = 0i;
|
||||
filestream hudFile;
|
||||
string line;
|
||||
int c = 0i;
|
||||
|
||||
hudFile = fopen("sprites/hud.txt", FILE_READ);
|
||||
hudFile = fopen(fileName, FILE_READ);
|
||||
|
||||
if (hudFile < 0) {
|
||||
NSError("Missing file sprites/hud.txt");
|
||||
return;
|
||||
NSError("Missing file %S", fileName);
|
||||
return (-1i);
|
||||
}
|
||||
|
||||
/* count valid entries */
|
||||
while ((line = fgets(hudFile))) {
|
||||
c = tokenize_console(line);
|
||||
|
||||
if (c != 7) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (argv(1) != "640") {
|
||||
continue;
|
||||
}
|
||||
|
||||
spriteCount += 1i;
|
||||
}
|
||||
|
||||
fclose(hudFile);
|
||||
|
||||
return (spriteCount);
|
||||
}
|
||||
|
||||
static bool
|
||||
HLSprite_LoadFromFile(string fileName, string prefix)
|
||||
{
|
||||
filestream hudFile;
|
||||
int c = 0i;
|
||||
vector imgSize = g_vec_null;
|
||||
string line = "";
|
||||
string sheetName;
|
||||
|
||||
hudFile = fopen(fileName, FILE_READ);
|
||||
|
||||
if (hudFile < 0) {
|
||||
NSError("Missing file %S", fileName);
|
||||
return (false);
|
||||
}
|
||||
|
||||
while ((line = fgets(hudFile))) {
|
||||
c = tokenize_console(line);
|
||||
|
||||
|
@ -52,7 +78,45 @@ HLSprite_Init(void)
|
|||
if (argv(1) != "640")
|
||||
continue;
|
||||
|
||||
spriteCount++;
|
||||
if (prefix != "")
|
||||
sheetName = strcat(prefix, argv(0));
|
||||
else
|
||||
sheetName = argv(0);
|
||||
|
||||
//printf("%S %S\n", sheetName, prefix);
|
||||
|
||||
g_hlsprites[g_hlSpriteCount].m_strImage = spriteframe(sprintf("sprites/%s.spr", argv(2)), 0, 0.0f);
|
||||
g_hlsprites[g_hlSpriteCount].m_vecSize[0] = stof(argv(5));
|
||||
g_hlsprites[g_hlSpriteCount].m_vecSize[1] = stof(argv(6));
|
||||
imgSize = drawgetimagesize(g_hlsprites[g_hlSpriteCount].m_strImage);
|
||||
g_hlsprites[g_hlSpriteCount].m_vecCanvasPos[0] = stof(argv(3)) / imgSize[0];
|
||||
g_hlsprites[g_hlSpriteCount].m_vecCanvasPos[1] = stof(argv(4)) / imgSize[1];
|
||||
g_hlsprites[g_hlSpriteCount].m_vecCanvasSize[0] = g_hlsprites[g_hlSpriteCount].m_vecSize[0] / imgSize[0];
|
||||
g_hlsprites[g_hlSpriteCount].m_vecCanvasSize[1] = g_hlsprites[g_hlSpriteCount].m_vecSize[1] / imgSize[1];
|
||||
hash_add(g_hashhlsprite, sheetName, (int)g_hlSpriteCount);
|
||||
g_hlSpriteCount += 1i;
|
||||
}
|
||||
|
||||
fclose(hudFile);
|
||||
return (true);
|
||||
}
|
||||
|
||||
void
|
||||
HLSprite_Init(void)
|
||||
{
|
||||
int spriteCount = 0i;
|
||||
searchhandle sh;
|
||||
string hudFile;
|
||||
string prefix;
|
||||
|
||||
g_hlSpriteCount = 0i;
|
||||
spriteCount = HLSprite_CountEntriesInFile("sprites/hud.txt");
|
||||
|
||||
sh = search_begin("sprites/weapon_*.txt", TRUE, TRUE);
|
||||
|
||||
for (int i = 0; i < search_getsize(sh); i++) {
|
||||
hudFile = search_getfilename(sh, i);
|
||||
spriteCount += HLSprite_CountEntriesInFile(hudFile);
|
||||
}
|
||||
|
||||
/* if we couldn't find anything, don't bother */
|
||||
|
@ -64,33 +128,19 @@ HLSprite_Init(void)
|
|||
g_hashhlsprite = hash_createtab(2, HASH_ADD);
|
||||
}
|
||||
|
||||
/* to the beginning we go. */
|
||||
fseek(hudFile, 0);
|
||||
/* allocate valid entries */
|
||||
g_hlsprites = memalloc(sizeof(hlsprite_t) * spriteCount);
|
||||
|
||||
/* read the data into our banks */
|
||||
while ((line = fgets(hudFile))) {
|
||||
c = tokenize_console(line);
|
||||
HLSprite_LoadFromFile("sprites/hud.txt", "");
|
||||
|
||||
if (c != 7)
|
||||
continue;
|
||||
|
||||
if (argv(1) != "640")
|
||||
continue;
|
||||
|
||||
g_hlsprites[i].m_strImage = spriteframe(sprintf("sprites/%s.spr", argv(2)), 0, 0.0f);
|
||||
g_hlsprites[i].m_vecSize[0] = stof(argv(5));
|
||||
g_hlsprites[i].m_vecSize[1] = stof(argv(6));
|
||||
imgSize = drawgetimagesize(g_hlsprites[i].m_strImage);
|
||||
g_hlsprites[i].m_vecCanvasPos[0] = stof(argv(3)) / imgSize[0];
|
||||
g_hlsprites[i].m_vecCanvasPos[1] = stof(argv(4)) / imgSize[1];
|
||||
g_hlsprites[i].m_vecCanvasSize[0] = g_hlsprites[i].m_vecSize[0] / imgSize[0];
|
||||
g_hlsprites[i].m_vecCanvasSize[1] = g_hlsprites[i].m_vecSize[1] / imgSize[1];
|
||||
hash_add(g_hashhlsprite, argv(0), (int)i);
|
||||
i++;
|
||||
for (int i = 0; i < search_getsize(sh); i++) {
|
||||
hudFile = search_getfilename(sh, i);
|
||||
prefix = substring(hudFile, 8, -4);
|
||||
HLSprite_LoadFromFile(hudFile, prefix);
|
||||
}
|
||||
|
||||
|
||||
search_end(sh);
|
||||
NSLog("...initialized %i HL sprites.", spriteCount);
|
||||
}
|
||||
|
||||
|
@ -134,4 +184,23 @@ void
|
|||
HLSprite_Draw_RGB(string spriteName, vector spritePos, vector spriteColor, bool isAdditive)
|
||||
{
|
||||
HLSprite_Draw_RGBA(spriteName, spritePos, spriteColor, 1.0f, isAdditive);
|
||||
}
|
||||
|
||||
void
|
||||
HLSprite_DrawCrosshair(string spriteName)
|
||||
{
|
||||
int spriteNum = -1i;
|
||||
|
||||
if (!spriteName) {
|
||||
return;
|
||||
}
|
||||
|
||||
spriteNum = (int)hash_get(g_hashhlsprite, spriteName, -1i);
|
||||
|
||||
if (spriteNum == -1i) {
|
||||
NSError("Cannot draw sprite %S!", spriteName);
|
||||
return;
|
||||
}
|
||||
|
||||
Cross_DrawSub(g_hlsprites[spriteNum].m_strImage, g_hlsprites[spriteNum].m_vecSize, g_hlsprites[spriteNum].m_vecCanvasPos, g_hlsprites[spriteNum].m_vecCanvasSize);
|
||||
}
|
|
@ -14,7 +14,80 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
void View_ForceChange(player pl, int targetWeapon);
|
||||
.NSWeapon m_nextWeapon;
|
||||
.NSWeapon m_prevWeapon;
|
||||
|
||||
void View_ForceChange(NSClientPlayer pl, int targetWeapon);
|
||||
|
||||
NSWeapon
|
||||
HLWeapon_SortWeaponChain(NSClientPlayer targetPlayer)
|
||||
{
|
||||
NSWeapon itemChain = targetPlayer.m_itemList;
|
||||
int heighestSlot = -1i;
|
||||
int heighestPos = -1i;
|
||||
NSWeapon firstWeapon, lastWeapon;
|
||||
|
||||
firstWeapon = lastWeapon = __NULL__;
|
||||
|
||||
if (!targetPlayer.m_itemList) {
|
||||
return __NULL__;
|
||||
}
|
||||
|
||||
/* first we determine the range of our hud buckets. */
|
||||
while (itemChain) {
|
||||
if (itemChain.IsWeapon() == true) {
|
||||
int hudSlot = itemChain.GetDefInt("hudSlot");
|
||||
int hudPos = itemChain.GetDefInt("hudSlotPos");
|
||||
|
||||
if (hudSlot > heighestSlot) {
|
||||
heighestSlot = hudSlot;
|
||||
}
|
||||
if (hudPos > heighestPos) {
|
||||
heighestPos = hudPos;
|
||||
}
|
||||
}
|
||||
|
||||
itemChain = itemChain.chain;
|
||||
}
|
||||
|
||||
for (int hS = 0i; hS <= heighestSlot; hS++) {
|
||||
for (int hP = 0i; hP <= heighestPos; hP++) {
|
||||
itemChain = targetPlayer.m_itemList;
|
||||
|
||||
while (itemChain) {
|
||||
if (itemChain.IsWeapon() == true) {
|
||||
int hudSlot = itemChain.GetDefInt("hudSlot");
|
||||
int hudPos = itemChain.GetDefInt("hudSlotPos");
|
||||
|
||||
if (hudSlot == hS && hudPos == hP) {
|
||||
/* first weapon in the chain? */
|
||||
if (!lastWeapon) {
|
||||
firstWeapon = itemChain;
|
||||
lastWeapon = firstWeapon;
|
||||
} else {
|
||||
/* assign this weapon to the last weapon of our chain. */
|
||||
lastWeapon.m_nextWeapon = itemChain;
|
||||
itemChain.m_prevWeapon = lastWeapon;
|
||||
lastWeapon = itemChain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
itemChain = itemChain.chain;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* test */
|
||||
NSWeapon weaponTest = firstWeapon;
|
||||
while (weaponTest) {
|
||||
weaponTest = weaponTest.m_nextWeapon;
|
||||
}
|
||||
|
||||
firstWeapon.m_prevWeapon = lastWeapon;
|
||||
|
||||
return (firstWeapon);
|
||||
}
|
||||
|
||||
vector g_vecHUDNums[6] =
|
||||
{
|
||||
|
@ -27,104 +100,74 @@ vector g_vecHUDNums[6] =
|
|||
};
|
||||
|
||||
bool
|
||||
HUD_DrawWeaponSelect_CanSwitch(player pl)
|
||||
HUD_DrawWeaponSelect_CanSwitch(NSClientPlayer pl)
|
||||
{
|
||||
if (!pl.activeweapon)
|
||||
if (!pl.m_activeWeapon)
|
||||
return false;
|
||||
|
||||
for (int i = 1; i < g_weapons.length; i++) {
|
||||
if (pl.g_items & g_weapons[i].id && g_weapons[i].isempty(pl) == false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
HUD_DrawWeaponSelect_Forward(void)
|
||||
HUD_SelectWeapon(NSWeapon nextWeapon)
|
||||
{
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
|
||||
if (HUD_DrawWeaponSelect_CanSwitch(pl) == false) {
|
||||
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
|
||||
if (!nextWeapon) {
|
||||
pSeat->m_iHUDWeaponSelected = 0i;
|
||||
return;
|
||||
}
|
||||
|
||||
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
|
||||
pl.StartSoundDef("Player.WeaponSelectionOpen", CHAN_ITEM, false);
|
||||
} else {
|
||||
pl.StartSoundDef("Player.WeaponSelectionMoveSlot", CHAN_ITEM, false);
|
||||
pSeat->m_iHUDWeaponSelected = nextWeapon.GetSharedID();
|
||||
}
|
||||
|
||||
pSeat->m_iHUDWeaponSelected--;
|
||||
if (pSeat->m_iHUDWeaponSelected <= 0) {
|
||||
pSeat->m_iHUDWeaponSelected = g_weapons.length - 1;
|
||||
}
|
||||
/* Select the next item in the list. */
|
||||
void
|
||||
HUD_DrawWeaponSelect_Forward(void)
|
||||
{
|
||||
NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
NSWeapon firstWeapon;
|
||||
|
||||
if (HUD_DrawWeaponSelect_CanSwitch(pl) = false) {
|
||||
return;
|
||||
}
|
||||
|
||||
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||
firstWeapon = HLWeapon_SortWeaponChain(pl);
|
||||
|
||||
if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id)
|
||||
HUD_DrawWeaponSelect_Forward();
|
||||
else if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty)
|
||||
if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty(pl))
|
||||
HUD_DrawWeaponSelect_Forward();
|
||||
if (pl.m_activeWeapon.m_nextWeapon) {
|
||||
HUD_SelectWeapon(pl.m_activeWeapon.m_nextWeapon);
|
||||
} else {
|
||||
HUD_SelectWeapon(firstWeapon);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
HUD_DrawWeaponSelect_Back(void)
|
||||
{
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
NSWeapon firstWeapon;
|
||||
|
||||
if (HUD_DrawWeaponSelect_CanSwitch(pl) == false) {
|
||||
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
|
||||
if (HUD_DrawWeaponSelect_CanSwitch(pl) = false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pSeat->m_flHUDWeaponSelectTime < time) {
|
||||
pSeat->m_iHUDWeaponSelected = pl.activeweapon;
|
||||
pl.StartSoundDef("Player.WeaponSelectionOpen", CHAN_ITEM, false);
|
||||
firstWeapon = HLWeapon_SortWeaponChain(pl);
|
||||
|
||||
if (pl.m_activeWeapon.m_prevWeapon) {
|
||||
HUD_SelectWeapon(pl.m_activeWeapon.m_prevWeapon);
|
||||
} else {
|
||||
pl.StartSoundDef("Player.WeaponSelectionMoveSlot", CHAN_ITEM, false);
|
||||
|
||||
pSeat->m_iHUDWeaponSelected++;
|
||||
if (pSeat->m_iHUDWeaponSelected >= g_weapons.length) {
|
||||
pSeat->m_iHUDWeaponSelected = 1;
|
||||
}
|
||||
HUD_SelectWeapon(firstWeapon);
|
||||
}
|
||||
|
||||
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||
|
||||
if not (pl.g_items & g_weapons[pSeat->m_iHUDWeaponSelected].id)
|
||||
HUD_DrawWeaponSelect_Back();
|
||||
else if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty)
|
||||
if (g_weapons[pSeat->m_iHUDWeaponSelected].isempty(pl))
|
||||
HUD_DrawWeaponSelect_Back();
|
||||
}
|
||||
|
||||
void
|
||||
HUD_DrawWeaponSelect_Trigger(void)
|
||||
{
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
|
||||
if (pl.activeweapon != pSeat->m_iHUDWeaponSelected)
|
||||
View_ForceChange(pl, pSeat->m_iHUDWeaponSelected);
|
||||
|
||||
|
||||
Sound_Play(pSeat->m_ePlayer, CHAN_ITEM, "Player.WeaponSelected");
|
||||
pSeat->m_iHUDWeaponSelected = pSeat->m_flHUDWeaponSelectTime = 0;
|
||||
}
|
||||
|
||||
void
|
||||
HUD_DrawWeaponSelect_Last(void)
|
||||
{
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
if (pl.g_items & g_weapons[pSeat->m_iOldWeapon].id) {
|
||||
View_ForceChange(pl, pSeat->m_iOldWeapon);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -136,23 +179,15 @@ HUD_DrawWeaponSelect_Num(vector vecPos, float fValue)
|
|||
int
|
||||
HUD_InSlotPos(int slot, int pos)
|
||||
{
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
for (int i = 1; i < g_weapons.length; i++) {
|
||||
if (g_weapons[i].slot == slot && g_weapons[i].slot_pos == pos) {
|
||||
if (pl.g_items & g_weapons[i].id) {
|
||||
return i;
|
||||
} else {
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
void
|
||||
HUD_SlotSelect(int slot)
|
||||
{
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
#if 0
|
||||
NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
int curslot = g_weapons[pSeat->m_iHUDWeaponSelected].slot;
|
||||
int i;
|
||||
|
||||
|
@ -201,12 +236,14 @@ HUD_SlotSelect(int slot)
|
|||
pSeat->m_flHUDWeaponSelectTime = time + 3;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
HUD_DrawWeaponSelect(void)
|
||||
{
|
||||
player pl = (player)pSeat->m_ePlayer;
|
||||
#if 0
|
||||
NSClientPlayer pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
if (!pl.activeweapon) {
|
||||
return;
|
||||
}
|
||||
|
@ -254,4 +291,5 @@ HUD_DrawWeaponSelect(void)
|
|||
vecPos[0] += 25;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ ClientGame_Init(float apilevel, string enginename, float engineversion)
|
|||
{
|
||||
Obituary_Init();
|
||||
registercommand("chooseteam");
|
||||
registercommand("hudSort");
|
||||
}
|
||||
|
||||
void VGUI_ShowMOTD();
|
||||
|
@ -56,6 +57,8 @@ ClientGame_RendererRestart(string rstr)
|
|||
MUZZLE_SMALL = (int)getmodelindex("sprites/muzzleflash2.spr");
|
||||
MUZZLE_WEIRD = (int)getmodelindex("sprites/muzzleflash3.spr");
|
||||
|
||||
HLSprite_Init();
|
||||
|
||||
Damage_Precache();
|
||||
Obituary_Precache();
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
void
|
||||
Obituary_Init(void)
|
||||
{
|
||||
#if 0
|
||||
int c;
|
||||
int i;
|
||||
filestream fh;
|
||||
|
@ -74,6 +75,7 @@ Obituary_Init(void)
|
|||
}
|
||||
|
||||
fclose(fh);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -86,6 +88,7 @@ Obituary_Precache(void)
|
|||
void
|
||||
Obituary_KillIcon(int id, float w)
|
||||
{
|
||||
#if 0
|
||||
if (w > 0)
|
||||
for (int i = 0; i < g_obtype_count; i++) {
|
||||
if (g_weapons[w].name == g_obtypes[i].name) {
|
||||
|
@ -101,11 +104,13 @@ Obituary_KillIcon(int id, float w)
|
|||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
Obituary_Add(string attacker, string victim, float weapon, float flags)
|
||||
{
|
||||
#if 0
|
||||
int i;
|
||||
int x, y;
|
||||
x = OBITUARY_LINES;
|
||||
|
@ -143,6 +148,7 @@ Obituary_Add(string attacker, string victim, float weapon, float flags)
|
|||
print("\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma target fte_5768
|
||||
//#pragma flag enable assumeint
|
||||
#pragma progs_dat "../../csprogs.dat"
|
||||
#pragma progs_dat "../../zpak001.pk3dir/csprogs.dat"
|
||||
|
||||
#define CSQC
|
||||
#define CLIENT
|
||||
|
|
|
@ -29,7 +29,7 @@ Scores_Init(void)
|
|||
}
|
||||
|
||||
void
|
||||
Scores_DrawTeam(player pl, vector pos)
|
||||
Scores_DrawTeam(NSClientPlayer pl, vector pos)
|
||||
{
|
||||
drawfill(pos, [290, 1], SCORE_LINE_C, 1.0f, DRAWFLAG_ADDITIVE);
|
||||
|
||||
|
@ -135,7 +135,7 @@ Scores_DrawTeam(player pl, vector pos)
|
|||
}
|
||||
|
||||
void
|
||||
Scores_DrawNormal(player pl, vector pos)
|
||||
Scores_DrawNormal(NSClientPlayer pl, vector pos)
|
||||
{
|
||||
drawfill(pos, [290, 1], SCORE_LINE_C, 1.0f, DRAWFLAG_ADDITIVE);
|
||||
|
||||
|
@ -192,9 +192,9 @@ void
|
|||
Scores_Draw(void)
|
||||
{
|
||||
vector pos;
|
||||
player pl;
|
||||
NSClientPlayer pl;
|
||||
|
||||
pl = (player)pSeat->m_ePlayer;
|
||||
pl = (NSClientPlayer)pSeat->m_ePlayer;
|
||||
|
||||
if (autocvar_cl_centerscores) {
|
||||
int c = 10;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CC=fteqcc
|
||||
QCC=fteqcc
|
||||
|
||||
all:
|
||||
$(CC) progs.src
|
||||
$(QCC) progs.src
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma target fte_5768_5768
|
||||
//#pragma flag enable assumeint
|
||||
#pragma progs_dat "../../menu.dat"
|
||||
#pragma progs_dat "../../zpak001.pk3dir/menu.dat"
|
||||
#define MENU
|
||||
#define GAME_DIR "valve"
|
||||
#define MODEL_PREVIEW
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CC=fteqcc
|
||||
QCC=fteqcc
|
||||
|
||||
all:
|
||||
$(CC) progs.src
|
||||
$(QCC) progs.src
|
||||
|
|
|
@ -22,7 +22,7 @@ void Flashlight_Toggle(void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef VALVE
|
||||
#if 0
|
||||
player pl = (player)self;
|
||||
if (!(pl.g_items & ITEM_SUIT)) {
|
||||
return;
|
||||
|
|
|
@ -18,7 +18,6 @@ class HLGameRules:CGameRules
|
|||
{
|
||||
virtual void PlayerConnect(NSClientPlayer);
|
||||
virtual void PlayerDisconnect(NSClientPlayer);
|
||||
virtual void PlayerKill(NSClientPlayer);
|
||||
virtual void PlayerPostFrame(NSClientPlayer);
|
||||
|
||||
virtual void LevelDecodeParms(NSClientPlayer);
|
||||
|
|
|
@ -21,9 +21,8 @@ HLGameRules::IsMultiplayer(void)
|
|||
}
|
||||
|
||||
void
|
||||
HLGameRules::LevelDecodeParms(NSClientPlayer pp)
|
||||
HLGameRules::LevelDecodeParms(NSClientPlayer pl)
|
||||
{
|
||||
player pl = (player)pp;
|
||||
g_landmarkpos[0] = parm1;
|
||||
g_landmarkpos[1] = parm2;
|
||||
g_landmarkpos[2] = parm3;
|
||||
|
@ -36,6 +35,7 @@ HLGameRules::LevelDecodeParms(NSClientPlayer pp)
|
|||
pl.activeweapon = parm11;
|
||||
pl.flags = parm64;
|
||||
|
||||
#if 0
|
||||
pl.ammo_9mm = parm12;
|
||||
pl.ammo_357 = parm13;
|
||||
pl.ammo_buckshot = parm14;
|
||||
|
@ -56,19 +56,12 @@ HLGameRules::LevelDecodeParms(NSClientPlayer pp)
|
|||
pl.crossbow_mag = parm28;
|
||||
pl.rpg_mag = parm29;
|
||||
pl.satchel_chg = parm30;
|
||||
|
||||
/* reset bounds */
|
||||
if (pl.HasFlags(FL_CROUCHING)) {
|
||||
pl.SetSize(VEC_CHULL_MIN, VEC_CHULL_MAX);
|
||||
} else {
|
||||
pl.SetSize(VEC_HULL_MIN, VEC_HULL_MAX);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
HLGameRules::LevelChangeParms(NSClientPlayer pp)
|
||||
HLGameRules::LevelChangeParms(NSClientPlayer pl)
|
||||
{
|
||||
player pl = (player)pp;
|
||||
parm1 = g_landmarkpos[0];
|
||||
parm2 = g_landmarkpos[1];
|
||||
parm3 = g_landmarkpos[2];
|
||||
|
@ -81,6 +74,8 @@ HLGameRules::LevelChangeParms(NSClientPlayer pp)
|
|||
parm64 = pl.GetFlags();
|
||||
parm10 = pl.g_items;
|
||||
parm11 = pl.activeweapon;
|
||||
|
||||
#if 0
|
||||
parm12 = pl.ammo_9mm;
|
||||
parm13 = pl.ammo_357;
|
||||
parm14 = pl.ammo_buckshot;
|
||||
|
@ -100,6 +95,7 @@ HLGameRules::LevelChangeParms(NSClientPlayer pp)
|
|||
parm28 = pl.crossbow_mag;
|
||||
parm29 = pl.rpg_mag;
|
||||
parm30 = pl.satchel_chg;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -132,12 +128,6 @@ HLGameRules::PlayerDisconnect(NSClientPlayer pl)
|
|||
super::PlayerDisconnect(pl);
|
||||
}
|
||||
|
||||
void
|
||||
HLGameRules::PlayerKill(NSClientPlayer pl)
|
||||
{
|
||||
Damage_Apply(pl, pl, pl.health, WEAPON_NONE, DMG_SKIP_ARMOR);
|
||||
}
|
||||
|
||||
void
|
||||
TriggerFlashlight(NSClient target)
|
||||
{
|
||||
|
|
|
@ -122,9 +122,9 @@ HLMultiplayerRules::PlayerDeath(NSClientPlayer pl)
|
|||
|
||||
#ifdef VALVE
|
||||
/* explode all satchels */
|
||||
s_satchel_detonate((entity)pl);
|
||||
//s_satchel_detonate((entity)pl);
|
||||
/* drop their posessions into a weaponbox item */
|
||||
weaponbox_spawn((player)pl);
|
||||
//weaponbox_spawn(pl);
|
||||
#endif
|
||||
|
||||
/* either gib, or make a corpse */
|
||||
|
@ -133,6 +133,7 @@ HLMultiplayerRules::PlayerDeath(NSClientPlayer pl)
|
|||
float gibStrength = g_dmg_iDamage * 2.0f;
|
||||
BreakModel_Entity(pl, gibDir, gibStrength);
|
||||
} else {
|
||||
#if 0
|
||||
float deathAnimation = ANIM_DIESIMPLE;
|
||||
|
||||
switch (g_dmg_iHitBody) {
|
||||
|
@ -159,16 +160,16 @@ HLMultiplayerRules::PlayerDeath(NSClientPlayer pl)
|
|||
break;
|
||||
}
|
||||
|
||||
NSEntity newCorpse = (NSEntity)FX_Corpse_Spawn((player)pl, deathAnimation);
|
||||
NSEntity newCorpse = (NSEntity)FX_Corpse_Spawn(pl, deathAnimation);
|
||||
|
||||
/* if we were crouching, adjust the bbox (thx 2 lack of crouch death animation) */
|
||||
if (pl.flags & FL_CROUCHING) {
|
||||
if (pl.IsCrouching()) {
|
||||
newCorpse.SetSize(VEC_HULL_MIN, [16, 16, -16]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* now let's make the real client invisible */
|
||||
pl.Death();
|
||||
pl.SetTakedamage(DAMAGE_NO);
|
||||
pl.gflags &= ~GF_FLASHLIGHT;
|
||||
pl.gflags &= ~GF_EGONBEAM;
|
||||
|
@ -185,9 +186,8 @@ HLMultiplayerRules::PlayerDeath(NSClientPlayer pl)
|
|||
}
|
||||
|
||||
void
|
||||
HLMultiplayerRules::PlayerSpawn(NSClientPlayer pp)
|
||||
HLMultiplayerRules::PlayerSpawn(NSClientPlayer pl)
|
||||
{
|
||||
player pl = (player)pp;
|
||||
string playerModel;
|
||||
/* this is where the mods want to deviate */
|
||||
entity spot;
|
||||
|
@ -239,21 +239,20 @@ HLMultiplayerRules::PlayerSpawn(NSClientPlayer pp)
|
|||
pl.SetInfoKey("*dead", "0");
|
||||
pl.SetInfoKey("*deaths", ftos(pl.deaths));
|
||||
pl.SetPropData("actor_human");
|
||||
pl.SetCanBleed(true);
|
||||
pl.EnableBleeding();
|
||||
|
||||
LevelNewParms();
|
||||
LevelDecodeParms(pl);
|
||||
|
||||
#if defined (VALVE) || defined (GEARBOX)
|
||||
pl.g_items = ITEM_CROWBAR | ITEM_GLOCK | ITEM_SUIT;
|
||||
pl.activeweapon = WEAPON_GLOCK;
|
||||
pl.glock_mag = 18;
|
||||
pl.ammo_9mm = 44;
|
||||
pl.GiveItem("item_suit");
|
||||
pl.GiveItem("weapon_9mmhandgun");
|
||||
pl.GiveItem("weapon_crowbar");
|
||||
//pl.ammo_9mm = 44;
|
||||
#endif
|
||||
|
||||
spot = Spawn_SelectRandom("info_player_deathmatch");
|
||||
pl.Transport(spot.origin, spot.angles);
|
||||
Weapons_RefreshAmmo(pl);
|
||||
Client_FixAngle(pl, pl.angles);
|
||||
}
|
||||
|
||||
|
@ -293,7 +292,7 @@ void
|
|||
CSEv_HLDM_Chooseteam_s(string teamName)
|
||||
{
|
||||
HLGameRules rules = (HLGameRules)g_grMode;
|
||||
player pl = (player)self;
|
||||
NSClientPlayer pl = (NSClientPlayer)self;
|
||||
|
||||
if (!teamName)
|
||||
return;
|
||||
|
@ -310,7 +309,9 @@ CSEv_HLDM_Chooseteam_s(string teamName)
|
|||
for (int i = 0; i < c; i++) {
|
||||
if (argv(i) == teamName) {
|
||||
pl.SetTeam((float)i + 1);
|
||||
Damage_Apply(pl, pl, 100, 0, DMG_SKIP_ARMOR);
|
||||
pl.SetHealth(-100);
|
||||
pl.Death(pl, pl, 100i, g_vec_null, 0i);
|
||||
//Damage_Apply(pl, pl, 100, 0, DMG_SKIP_ARMOR);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ HLSingleplayerRules::PlayerDeath(NSClientPlayer pl)
|
|||
corpse.movetype = MOVETYPE_TOSS;
|
||||
corpse.solid = SOLID_TRIGGER;
|
||||
corpse.modelindex = pl.modelindex;
|
||||
corpse.frame = ANIM_DIESIMPLE;
|
||||
//corpse.frame = ANIM_DIESIMPLE;
|
||||
corpse.angles = pl.angles;
|
||||
corpse.velocity = pl.velocity;
|
||||
}
|
||||
|
@ -85,31 +85,32 @@ HLSingleplayerRules::PlayerSpawn(NSClientPlayer pl)
|
|||
pl.ClearVelocity();
|
||||
pl.SetInfoKey("*spec", "0");
|
||||
pl.SetInfoKey("*deaths", ftos(pl.deaths));
|
||||
pl.SetCanBleed(true);
|
||||
pl.EnableBleeding();
|
||||
|
||||
if (startspot != "") {
|
||||
LevelDecodeParms(pl);
|
||||
pl.SetOrigin(Landmark_GetSpot());
|
||||
pl.Physics_Run();
|
||||
} else {
|
||||
entity spawnPoint;
|
||||
LevelNewParms();
|
||||
spawnPoint = find(world, ::classname, "info_player_start");
|
||||
pl.Transport(spawnPoint.origin, spawnPoint.angles);
|
||||
pl.Physics_Run();
|
||||
}
|
||||
|
||||
Weapons_RefreshAmmo(pl);
|
||||
Client_FixAngle(pl, pl.angles);
|
||||
}
|
||||
|
||||
bool
|
||||
HLSingleplayerRules::ImpulseCommand(NSClient bp, float num)
|
||||
HLSingleplayerRules::ImpulseCommand(NSClient pl, float num)
|
||||
{
|
||||
switch (num) {
|
||||
case 101:
|
||||
player pl = (player)bp;
|
||||
pl.SetHealth(100);
|
||||
pl.SetMaxHealth(100);
|
||||
pl.SetArmor(100);
|
||||
#if 0
|
||||
pl.g_items |= ITEM_SUIT;
|
||||
Weapons_AddItem(pl, WEAPON_CROWBAR, -1);
|
||||
Weapons_AddItem(pl, WEAPON_GLOCK, -1);
|
||||
|
@ -137,10 +138,11 @@ HLSingleplayerRules::ImpulseCommand(NSClient bp, float num)
|
|||
Weapons_AddItem(pl, WEAPON_SNIPERRIFLE, -1);
|
||||
Weapons_AddItem(pl, WEAPON_SPORELAUNCHER, -1);
|
||||
Weapons_AddItem(pl, WEAPON_SHOCKRIFLE, -1);
|
||||
#endif
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
return super::ImpulseCommand(bp, num);
|
||||
return super::ImpulseCommand(pl, num);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
/* PICKUP ITEMS */
|
||||
class item_pickup:NSRenderableEntity
|
||||
{
|
||||
|
@ -30,3 +31,4 @@ class item_pickup:NSRenderableEntity
|
|||
virtual void SetFloating(int);
|
||||
virtual void PickupRespawn(void);
|
||||
};
|
||||
#endif
|
|
@ -14,19 +14,6 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
void Weapons_Draw(player pl);
|
||||
|
||||
void
|
||||
CSEv_PlayerSwitchWeapon_i(int w)
|
||||
{
|
||||
player pl = (player)self;
|
||||
|
||||
if (pl.activeweapon != w) {
|
||||
pl.activeweapon = w;
|
||||
Weapons_Draw(pl);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Player_Precache(void)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma target fte_5768
|
||||
//#pragma flag enable assumeint
|
||||
#pragma progs_dat "../../progs.dat"
|
||||
#pragma progs_dat "../../zpak001.pk3dir/progs.dat"
|
||||
|
||||
#define QWSSQC
|
||||
#define SERVER
|
||||
|
@ -20,19 +20,19 @@ defs.h
|
|||
../shared/include.src
|
||||
|
||||
player.qc
|
||||
items.qc
|
||||
item_longjump.qc
|
||||
item_suit.qc
|
||||
item_healthkit.qc
|
||||
item_battery.qc
|
||||
item_weaponbox.qc
|
||||
world_items.qc
|
||||
//items.qc
|
||||
//item_longjump.qc
|
||||
//item_suit.qc
|
||||
//item_healthkit.qc
|
||||
//item_battery.qc
|
||||
//item_weaponbox.qc
|
||||
//world_items.qc
|
||||
xen_spore_small.qc
|
||||
xen_spore_medium.qc
|
||||
xen_spore_large.qc
|
||||
xen_hair.qc
|
||||
xen_plantlight.qc
|
||||
ammo.qc
|
||||
//ammo.qc
|
||||
|
||||
../../../src/botlib/include.src
|
||||
|
||||
|
@ -42,7 +42,6 @@ gamerules_multiplayer.qc
|
|||
server.qc
|
||||
damage.qc
|
||||
flashlight.qc
|
||||
modelevent.qc
|
||||
|
||||
spawn.qc
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ Game_Worldspawn(void)
|
|||
|
||||
precache_model("models/player.mdl");
|
||||
precache_model("models/w_weaponbox.mdl");
|
||||
Weapons_Init();
|
||||
Player_Precache();
|
||||
FX_Corpse_Init();
|
||||
}
|
||||
|
|
|
@ -33,10 +33,9 @@ class xen_hair:NSRenderableEntity
|
|||
void
|
||||
xen_hair::Respawn(void)
|
||||
{
|
||||
super::Respawn();
|
||||
SetSolid(SOLID_SLIDEBOX);
|
||||
SetMovetype(MOVETYPE_WALK);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -33,10 +33,9 @@ class xen_plantlight:NSRenderableEntity
|
|||
void
|
||||
xen_plantlight::Respawn(void)
|
||||
{
|
||||
super::Respawn();
|
||||
SetSolid(SOLID_SLIDEBOX);
|
||||
SetMovetype(MOVETYPE_WALK);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -33,10 +33,9 @@ class xen_spore_large:NSRenderableEntity
|
|||
void
|
||||
xen_spore_large::Respawn(void)
|
||||
{
|
||||
super::Respawn();
|
||||
SetSolid(SOLID_SLIDEBOX);
|
||||
SetMovetype(MOVETYPE_WALK);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -33,10 +33,9 @@ class xen_spore_medium:NSRenderableEntity
|
|||
void
|
||||
xen_spore_medium::Respawn(void)
|
||||
{
|
||||
super::Respawn();
|
||||
SetSolid(SOLID_SLIDEBOX);
|
||||
SetMovetype(MOVETYPE_WALK);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -33,10 +33,9 @@ class xen_spore_small:NSRenderableEntity
|
|||
void
|
||||
xen_spore_small::Respawn(void)
|
||||
{
|
||||
super::Respawn();
|
||||
SetSolid(SOLID_SLIDEBOX);
|
||||
SetMovetype(MOVETYPE_WALK);
|
||||
SetModel(GetSpawnModel());
|
||||
SetOrigin(GetSpawnOrigin());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
88
src/shared/HLGaussBeam.qc
Normal file
88
src/shared/HLGaussBeam.qc
Normal file
|
@ -0,0 +1,88 @@
|
|||
#ifdef SERVER
|
||||
class
|
||||
HLGaussBeam:NSProjectile
|
||||
{
|
||||
void HLGaussBeam(void);
|
||||
|
||||
virtual void Launch(vector, vector, float, float, float);
|
||||
nonvirtual void GaussAttack(float);
|
||||
};
|
||||
|
||||
void
|
||||
HLGaussBeam::HLGaussBeam(void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
HLGaussBeam::Launch(vector startPos, vector launchDir, float fuseOffset, float powerMultiplier, float dmgMultiplier)
|
||||
{
|
||||
GaussAttack(fuseOffset);
|
||||
|
||||
if (fuseOffset > 0.0f)
|
||||
FX_GaussBeam(startPos, launchDir, 6, owner);
|
||||
else
|
||||
FX_GaussBeam(startPos, launchDir, 0, owner);
|
||||
|
||||
NSError("fuseOffset: %f", fuseOffset);
|
||||
}
|
||||
|
||||
void
|
||||
HLGaussBeam::GaussAttack(float fuseOffset)
|
||||
{
|
||||
NSClientPlayer ourOwner = (NSClientPlayer)owner;
|
||||
int iLoop = 6i;
|
||||
vector vecCurPlane;
|
||||
vector vecCurPos;
|
||||
vector vecSrc;
|
||||
vector vecEndPos;
|
||||
vector vecDir;
|
||||
|
||||
vecDir = anglesToForward(ourOwner.GetViewAngle());
|
||||
vecSrc = ourOwner.GetEyePos();
|
||||
vecEndPos = vecSrc + v_forward * 1024;
|
||||
traceline(vecSrc, vecEndPos, FALSE, ourOwner);
|
||||
vecCurPlane = trace_plane_normal;
|
||||
vecCurPos = trace_endpos;
|
||||
|
||||
int iDamage;
|
||||
|
||||
if (fuseOffset > 0.0) {
|
||||
iDamage = (int)rint(lerp(20, 150, fuseOffset / 5.0f));
|
||||
} else {
|
||||
iDamage = 20i;
|
||||
}
|
||||
|
||||
if (serverkeyfloat("*bspversion") == BSPVER_HL)
|
||||
if (getsurfacetexture(trace_ent, getsurfacenearpoint(trace_ent, trace_endpos)) == "sky") {
|
||||
return;
|
||||
}
|
||||
|
||||
if (trace_ent.takedamage == DAMAGE_YES) {
|
||||
//Damage_Apply(trace_ent, ourOwner, iDamage, WEAPON_GAUSS, DMG_ELECTRO);
|
||||
sound(trace_ent, CHAN_ITEM, sprintf("weapons/electro%d.wav", random(0,3)+4), 1, ATTN_NORM);
|
||||
}
|
||||
|
||||
// reflection equation:
|
||||
trace_plane_normal = vecCurPlane;
|
||||
trace_endpos = vecCurPos;
|
||||
|
||||
while (iLoop > 0i) {
|
||||
vector newDir;
|
||||
trace_plane_normal = vecCurPlane;
|
||||
trace_endpos = vecCurPos;
|
||||
newDir = vecDir - 2 * (vecDir * trace_plane_normal) * trace_plane_normal;
|
||||
vecDir = newDir;
|
||||
vecSrc = trace_endpos + (vecDir * -1);
|
||||
vecEndPos = trace_endpos + (vecDir * 8192);
|
||||
traceline(vecSrc, vecEndPos, FALSE, ourOwner);
|
||||
vecCurPlane = trace_plane_normal;
|
||||
vecCurPos = trace_endpos;
|
||||
iLoop--;
|
||||
|
||||
if (trace_ent.takedamage == DAMAGE_YES) {
|
||||
//Damage_Apply(trace_ent, ourOwner, iDamage, WEAPON_GAUSS, DMG_ELECTRO);
|
||||
sound(trace_ent, CHAN_ITEM, sprintf("weapons/electro%d.wav", random(0,3)+4), 1, ATTN_NORM);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
217
src/shared/HLWeapon.qc
Normal file
217
src/shared/HLWeapon.qc
Normal file
|
@ -0,0 +1,217 @@
|
|||
/*
|
||||
* Copyright (c) 2024 Marco Cawthorne <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/*! \brief Half-Life weapon base class. */
|
||||
/*!QUAKED HLWeapon (0 0.8 0.8) (-16 -16 0) (16 16 72)
|
||||
# OVERVIEW
|
||||
Half-Life specific weapon based on NSWeapon.
|
||||
|
||||
# NEW KEYS
|
||||
- "ammoIcon" - Which sprites/ image to use. See notes.
|
||||
- "crosshair" - Which sprites/ image to use as a crosshair. See notes.
|
||||
- "hudSlot" - In which weapon selection slot this weapon belongs to.
|
||||
- "hudSlotPos" - The position of the weapon in the respective weapon selection slot.
|
||||
|
||||
# NOTES
|
||||
Both `ammoIcon` and `crosshair` refer to sprite declarations inside the sprites/ directory. FreeHL scans the `sprites/hud.txt` file and and weapon specific files.
|
||||
Since the weapon specific files only contain short names like `ammo` and `crosshair` you have to refer to them with a prefix separated by a `.` period symbol.
|
||||
|
||||
For example, `ammoIcon` being set to `weapon_foobar.ammo` will look up `ammo` inside `sprites/weapon_foobar.txt`.
|
||||
*/
|
||||
class
|
||||
HLWeapon:NSWeapon
|
||||
{
|
||||
void HLWeapon(void);
|
||||
|
||||
bool m_bAltModeSwitch;
|
||||
virtual void AddedToInventory(void);
|
||||
virtual void PrimaryAttack(void);
|
||||
virtual void SecondaryAttack(void);
|
||||
|
||||
#ifdef SERVER
|
||||
virtual void SpawnKey(string, string);
|
||||
#endif
|
||||
|
||||
#ifdef CLIENT
|
||||
int m_iHudSlot;
|
||||
int m_iHudSlotPos;
|
||||
|
||||
string m_ammoIcon;
|
||||
string m_crossHair;
|
||||
NSWeapon m_nextWeapon;
|
||||
virtual void UpdateGUI(void);
|
||||
nonvirtual void DrawLaser(void);
|
||||
#endif
|
||||
};
|
||||
|
||||
void
|
||||
HLWeapon::HLWeapon(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#ifdef SERVER
|
||||
void
|
||||
HLWeapon::SpawnKey(string keyName, string setValue)
|
||||
{
|
||||
switch (keyName) {
|
||||
case "altLaser":
|
||||
case "ammoIcon":
|
||||
case "crosshair":
|
||||
case "hudSlot":
|
||||
case "hudSlotPos":
|
||||
break;
|
||||
default:
|
||||
super::SpawnKey(keyName, setValue);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
HLWeapon::PrimaryAttack(void)
|
||||
{
|
||||
if (m_bAltModeSwitch == true) {
|
||||
if (CanFire() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
//m_iMode = 1 - m_iMode;
|
||||
}
|
||||
|
||||
if (m_iMode) {
|
||||
super::SecondaryAttack();
|
||||
return;
|
||||
}
|
||||
|
||||
super::PrimaryAttack();
|
||||
}
|
||||
|
||||
void
|
||||
HLWeapon::SecondaryAttack(void)
|
||||
{
|
||||
if (m_bAltModeSwitch == true) {
|
||||
if (CanFire() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_iMode = 1 - m_iMode;
|
||||
SetAttackNext(1.0);
|
||||
SetIdleNext(1.0f);
|
||||
return;
|
||||
}
|
||||
|
||||
super::SecondaryAttack();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
HLWeapon::AddedToInventory(void)
|
||||
{
|
||||
super::AddedToInventory();
|
||||
|
||||
#ifdef CLIENT
|
||||
m_ammoIcon = GetDefString("ammoIcon");
|
||||
|
||||
if (m_ammoIcon == "") {
|
||||
m_ammoIcon = sprintf("%s.ammo", strtolower(classname));
|
||||
}
|
||||
|
||||
m_crossHair = GetDefString("crosshair");
|
||||
|
||||
if (m_crossHair == "") {
|
||||
m_crossHair = sprintf("%s.crosshair", strtolower(classname));
|
||||
}
|
||||
|
||||
if (m_ammoIcon == "none") {
|
||||
m_ammoIcon = __NULL__;
|
||||
}
|
||||
|
||||
if (m_crossHair == "none") {
|
||||
m_crossHair = __NULL__;
|
||||
}
|
||||
|
||||
m_iHudSlot = GetDefInt("hudSlot");
|
||||
m_iHudSlotPos = GetDefInt("hudSlotPos");
|
||||
#endif
|
||||
|
||||
m_bAltModeSwitch = GetDefBool("altLaser");
|
||||
}
|
||||
|
||||
#ifdef CLIENT
|
||||
void
|
||||
HLWeapon::UpdateGUI(void)
|
||||
{
|
||||
NSClientPlayer ourOwner = __NULL__;
|
||||
|
||||
/* draw crosshair */
|
||||
HLSprite_DrawCrosshair(m_crossHair);
|
||||
|
||||
/* draw ammo icon */
|
||||
if (m_ammoIcon) {
|
||||
vector ammoPos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
HLSprite_Draw_RGBA(m_ammoIcon, ammoPos, g_hud_color, pSeatLocal->m_flAmmo2Alpha, true);
|
||||
}
|
||||
|
||||
if (m_iMode) {
|
||||
DrawLaser();
|
||||
}
|
||||
|
||||
if (m_bAmmoRequired == false)
|
||||
return;
|
||||
|
||||
ourOwner = (NSClientPlayer)GetOwner();
|
||||
|
||||
if (m_iClipSize > 0i) {
|
||||
ourOwner.a_ammo1 = m_iClip;
|
||||
HUD_DrawAmmo1();
|
||||
}
|
||||
|
||||
ourOwner.a_ammo2 = ourOwner.GetReserveAmmo(m_primaryAmmoType);
|
||||
HUD_DrawAmmo2();
|
||||
|
||||
if (m_secondaryAmmoType && m_primaryAmmoType != m_secondaryAmmoType) {
|
||||
ourOwner.a_ammo3 = ourOwner.GetReserveAmmo(m_secondaryAmmoType);
|
||||
HUD_DrawAmmo3();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
HLWeapon::DrawLaser(void)
|
||||
{
|
||||
NSClientPlayer ourOwner = (NSClientPlayer)GetOwner();
|
||||
float lerpValue;
|
||||
vector laser_pos = g_vec_null;
|
||||
vector jitter = [0.0f, 0.0f, 0.0f];
|
||||
|
||||
vector src = ourOwner.GetEyePos();
|
||||
traceline(src, src + (anglesToForward(ourOwner.v_angle) * 256), FALSE, ourOwner);
|
||||
lerpValue = lerp(18,6, trace_fraction);
|
||||
jitter[0] = (random(0,2) - 2) * (1 - trace_fraction);
|
||||
jitter[1] = (random(0,2) - 2) * (1 - trace_fraction);
|
||||
laser_pos = g_hudmins + (g_hudres / 2) + ([-lerpValue,-lerpValue] / 2);
|
||||
|
||||
drawsubpic(
|
||||
laser_pos + jitter,
|
||||
[lerpValue,lerpValue],
|
||||
g_laser_spr,
|
||||
[0,0],
|
||||
[1.0, 1.0],
|
||||
[1,1,1],
|
||||
1.0f,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
#endif
|
|
@ -90,6 +90,3 @@ enum
|
|||
ANIM_CR_AIMBOW,
|
||||
ANIM_CR_SHOOTBOW
|
||||
};
|
||||
|
||||
void Animation_PlayerTop(player, float, float);
|
||||
void Animation_PlayerBottom(player, float, float);
|
||||
|
|
|
@ -21,6 +21,10 @@
|
|||
.float bonecontrol2;
|
||||
.float bonecontrol3;
|
||||
.float bonecontrol4;
|
||||
.float frame2;
|
||||
.float lerpfrac;
|
||||
.float baselerpfrac;
|
||||
.float baseframe2;
|
||||
|
||||
void Animation_Print(string sWow) {
|
||||
#ifdef CLIENT
|
||||
|
@ -31,7 +35,7 @@ void Animation_Print(string sWow) {
|
|||
}
|
||||
|
||||
void
|
||||
Animation_TimerUpdate(player pl, float ftime)
|
||||
Animation_TimerUpdate(HLPlayer pl, float ftime)
|
||||
{
|
||||
makevectors([0, pl.v_angle[1], 0]);
|
||||
|
||||
|
@ -56,28 +60,28 @@ depending on what the player is doing
|
|||
=================
|
||||
*/
|
||||
void
|
||||
Animation_PlayerUpdate(player pl)
|
||||
Animation_PlayerUpdate(HLPlayer pl)
|
||||
{
|
||||
pl.basebone = gettagindex(pl, "Bip01 Spine1");
|
||||
|
||||
if (pl.anim_top_delay <= 0.0f) {
|
||||
pl.anim_top = Weapons_GetAim(pl, pl.activeweapon);
|
||||
pl.anim_top = 0;//Weapons_GetAim(pl, pl.activeweapon);
|
||||
}
|
||||
|
||||
if (vlen(pl.velocity) == 0) {
|
||||
if (pl.flags & FL_CROUCHING) {
|
||||
if (pl.IsCrouching()) {
|
||||
pl.anim_bottom = ANIM_CROUCHIDLE;
|
||||
} else {
|
||||
pl.anim_bottom = ANIM_IDLE;
|
||||
}
|
||||
} else if (vlen(pl.velocity) < 150) {
|
||||
if (pl.flags & FL_CROUCHING) {
|
||||
if (pl.IsCrouching()) {
|
||||
pl.anim_bottom = ANIM_CRAWL;
|
||||
} else {
|
||||
pl.anim_bottom = ANIM_WALK;
|
||||
}
|
||||
} else if (vlen(pl.velocity) > 150) {
|
||||
if (pl.flags & FL_CROUCHING) {
|
||||
if (pl.IsCrouching()) {
|
||||
pl.anim_bottom = ANIM_CRAWL;
|
||||
} else {
|
||||
pl.anim_bottom = ANIM_RUN;
|
||||
|
@ -112,7 +116,7 @@ Animation_PlayerUpdate(player pl)
|
|||
}
|
||||
|
||||
void
|
||||
Animation_PlayerTop(player pl, float topanim, float timer)
|
||||
Animation_PlayerTop(HLPlayer pl, float topanim, float timer)
|
||||
{
|
||||
pl.anim_top = topanim;
|
||||
pl.anim_top_time = 0.0f;
|
||||
|
@ -120,7 +124,7 @@ Animation_PlayerTop(player pl, float topanim, float timer)
|
|||
}
|
||||
|
||||
void
|
||||
Animation_PlayerBottom(player pl, float botanim, float timer)
|
||||
Animation_PlayerBottom(HLPlayer pl, float botanim, float timer)
|
||||
{
|
||||
pl.anim_bottom = botanim;
|
||||
}
|
||||
|
|
|
@ -55,14 +55,14 @@ FX_Corpse_Update(void)
|
|||
}
|
||||
|
||||
entity
|
||||
FX_Corpse_Spawn(player pl, float anim)
|
||||
FX_Corpse_Spawn(NSClientPlayer pl, float anim)
|
||||
{
|
||||
NSRenderableEntity body_next = (NSRenderableEntity)FX_Corpse_Next();
|
||||
body_next.SetMovetype(MOVETYPE_BOUNCE);
|
||||
body_next.SetSolid(SOLID_CORPSE);
|
||||
body_next.SetModel(pl.GetModel());
|
||||
|
||||
if (pl.flags & FL_CROUCHING) {
|
||||
if (pl.IsCrouching()) {
|
||||
body_next.SetOrigin(pl.GetOrigin() + [0,0,32]);
|
||||
} else {
|
||||
body_next.SetOrigin(pl.GetOrigin());
|
||||
|
|
|
@ -2,32 +2,15 @@
|
|||
../../../valve/src/shared/entities.h
|
||||
../../../valve/src/shared/events.h
|
||||
../../../valve/src/shared/flags.h
|
||||
|
||||
../../../valve/src/shared/player.qc
|
||||
../../../valve/src/shared/weapon_common.h
|
||||
../../../valve/src/shared/animations.h
|
||||
../../../valve/src/shared/animations.qc
|
||||
../../../valve/src/shared/pmove.qc
|
||||
|
||||
../../../valve/src/shared/fx_blood.qc
|
||||
../../../valve/src/shared/fx_gaussbeam.qc
|
||||
../../../valve/src/shared/fx_corpse.qc
|
||||
|
||||
../../../valve/src/shared/items.h
|
||||
../../../valve/src/shared/weapons.h
|
||||
../../../valve/src/shared/w_crossbow.qc
|
||||
../../../valve/src/shared/w_crowbar.qc
|
||||
../../../valve/src/shared/w_egon.qc
|
||||
../../../valve/src/shared/w_gauss.qc
|
||||
../../../valve/src/shared/w_glock.qc
|
||||
../../../valve/src/shared/w_handgrenade.qc
|
||||
../../../valve/src/shared/w_hornetgun.qc
|
||||
../../../valve/src/shared/w_mp5.qc
|
||||
../../../valve/src/shared/w_python.qc
|
||||
../../../valve/src/shared/w_rpg.qc
|
||||
../../../valve/src/shared/w_satchel.qc
|
||||
../../../valve/src/shared/w_shotgun.qc
|
||||
../../../valve/src/shared/w_snark.qc
|
||||
../../../valve/src/shared/HLGaussBeam.qc
|
||||
../../../valve/src/shared/HLWeapon.qc
|
||||
../../../valve/src/shared/w_tripmine.qc
|
||||
../../../valve/src/shared/weapons.qc
|
||||
../../../valve/src/shared/weapon_common.qc
|
||||
#endlist
|
||||
|
|
|
@ -14,24 +14,19 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "animations.h"
|
||||
#include "skeleton.h"
|
||||
|
||||
/* all custom SendFlags bits we can possibly send */
|
||||
enumflags
|
||||
{
|
||||
PLAYER_TOPFRAME = PLAYER_CUSTOMFIELDSTART,
|
||||
PLAYER_BOTTOMFRAME,
|
||||
PLAYER_AMMO1,
|
||||
PLAYER_AMMO2,
|
||||
PLAYER_AMMO3,
|
||||
PLAYER_UNUSED5,
|
||||
PLAYER_UNUSED6,
|
||||
PLAYER_UNUSED7
|
||||
PLAYER_BOTTOMFRAME
|
||||
};
|
||||
|
||||
class player:NSClientPlayer
|
||||
class HLPlayer:NSClientPlayer
|
||||
{
|
||||
void(void) player;
|
||||
void(void) HLPlayer;
|
||||
|
||||
/* animation */
|
||||
PREDICTED_INT(anim_top)
|
||||
|
@ -40,34 +35,6 @@ class player:NSClientPlayer
|
|||
PREDICTED_INT(anim_bottom)
|
||||
PREDICTED_FLOAT(anim_bottom_time)
|
||||
|
||||
/* ammo 1 */
|
||||
PREDICTED_INT(glock_mag)
|
||||
PREDICTED_INT(mp5_mag)
|
||||
PREDICTED_INT(python_mag)
|
||||
PREDICTED_INT(shotgun_mag)
|
||||
PREDICTED_INT(crossbow_mag)
|
||||
PREDICTED_INT(rpg_mag)
|
||||
PREDICTED_INT(satchel_chg)
|
||||
|
||||
/* ammo 2 */
|
||||
PREDICTED_INT(ammo_9mm)
|
||||
PREDICTED_INT(ammo_357)
|
||||
PREDICTED_INT(ammo_buckshot)
|
||||
PREDICTED_INT(ammo_bolt)
|
||||
PREDICTED_INT(ammo_rocket)
|
||||
PREDICTED_INT(ammo_uranium)
|
||||
PREDICTED_INT(ammo_handgrenade)
|
||||
PREDICTED_INT(ammo_satchel)
|
||||
PREDICTED_INT(ammo_tripmine)
|
||||
PREDICTED_INT(ammo_snark)
|
||||
PREDICTED_INT(ammo_hornet)
|
||||
|
||||
/* ammo 3 */
|
||||
PREDICTED_INT(ammo_m203_grenade)
|
||||
PREDICTED_INT(ammo_gauss_volume)
|
||||
PREDICTED_INT(ammo_rpg_state)
|
||||
PREDICTED_INT(mode_tempstate)
|
||||
|
||||
virtual void Physics_Jump(void);
|
||||
virtual void UpdatePlayerAnimation(float);
|
||||
|
||||
|
@ -85,43 +52,24 @@ class player:NSClientPlayer
|
|||
#endif
|
||||
};
|
||||
|
||||
void Animation_PlayerTop(HLPlayer, float, float);
|
||||
void Animation_PlayerBottom(HLPlayer, float, float);
|
||||
|
||||
void
|
||||
player::player(void)
|
||||
HLPlayer::HLPlayer(void)
|
||||
{
|
||||
anim_top = 0;
|
||||
anim_top_time = 0;
|
||||
anim_top_delay = 0;
|
||||
anim_bottom = 0;
|
||||
anim_bottom_time = 0;
|
||||
glock_mag = 0;
|
||||
mp5_mag = 0;
|
||||
python_mag = 0;
|
||||
shotgun_mag = 0;
|
||||
crossbow_mag = 0;
|
||||
rpg_mag = 0;
|
||||
satchel_chg = 0;
|
||||
ammo_9mm = 0;
|
||||
ammo_357 = 0;
|
||||
ammo_buckshot = 0;
|
||||
ammo_bolt = 0;
|
||||
ammo_rocket = 0;
|
||||
ammo_uranium = 0;
|
||||
ammo_handgrenade = 0;
|
||||
ammo_satchel = 0;
|
||||
ammo_tripmine = 0;
|
||||
ammo_snark = 0;
|
||||
ammo_hornet = 0;
|
||||
ammo_m203_grenade = 0;
|
||||
ammo_gauss_volume = 0;
|
||||
ammo_rpg_state = 0;
|
||||
mode_tempstate = 0;
|
||||
}
|
||||
|
||||
void Animation_PlayerUpdate(player);
|
||||
void Animation_TimerUpdate(player, float);
|
||||
void Animation_PlayerUpdate(HLPlayer);
|
||||
void Animation_TimerUpdate(HLPlayer, float);
|
||||
|
||||
void
|
||||
player::UpdatePlayerAnimation(float timelength)
|
||||
HLPlayer::UpdatePlayerAnimation(float timelength)
|
||||
{
|
||||
/* calculate our skeletal progression */
|
||||
Animation_PlayerUpdate(this);
|
||||
|
@ -135,7 +83,7 @@ void Camera_StrafeRoll(__inout vector camera_angle);
|
|||
void Shake_Update(NSClientPlayer);
|
||||
|
||||
void
|
||||
player::UpdateAliveCam(void)
|
||||
HLPlayer::UpdateAliveCam(void)
|
||||
{
|
||||
vector cam_pos = GetEyePos();
|
||||
Camera_RunPosBob(view_angles, cam_pos);
|
||||
|
@ -164,10 +112,10 @@ player::UpdateAliveCam(void)
|
|||
}
|
||||
|
||||
.string oldmodel;
|
||||
string Weapons_GetPlayermodel(player, int);
|
||||
//string Weapons_GetPlayermodel(NSClientPlayer, int);
|
||||
|
||||
void
|
||||
player::UpdatePlayerAttachments(bool visible)
|
||||
HLPlayer::UpdatePlayerAttachments(bool visible)
|
||||
{
|
||||
/* draw the flashlight */
|
||||
if (gflags & GF_FLASHLIGHT) {
|
||||
|
@ -199,7 +147,7 @@ player::UpdatePlayerAttachments(bool visible)
|
|||
return;
|
||||
|
||||
/* what's the current weapon model supposed to be anyway? */
|
||||
p_model.oldmodel = Weapons_GetPlayermodel(this, activeweapon);
|
||||
p_model.oldmodel = 0;//Weapons_GetPlayermodel(this, activeweapon);
|
||||
|
||||
/* we changed weapons, update skeletonindex */
|
||||
if (p_model.model != p_model.oldmodel) {
|
||||
|
@ -244,19 +192,18 @@ player::UpdatePlayerAttachments(bool visible)
|
|||
}
|
||||
}
|
||||
|
||||
void Weapons_AmmoUpdate(entity);
|
||||
void HUD_AmmoNotify_Check(player pl);
|
||||
void HUD_ItemNotify_Check(player pl);
|
||||
void HUD_AmmoNotify_Check(NSClientPlayer pl);
|
||||
void HUD_ItemNotify_Check(NSClientPlayer pl);
|
||||
/*
|
||||
=================
|
||||
player::ReceiveEntity
|
||||
HLPlayer::ReceiveEntity
|
||||
=================
|
||||
*/
|
||||
void
|
||||
player::ReceiveEntity(float new, float flChanged)
|
||||
HLPlayer::ReceiveEntity(float new, float flChanged)
|
||||
{
|
||||
/* the generic client attributes */
|
||||
NSClientPlayer::ReceiveEntity(new, flChanged);
|
||||
super::ReceiveEntity(new, flChanged);
|
||||
|
||||
/* animation */
|
||||
READENTITY_BYTE(anim_top, PLAYER_TOPFRAME)
|
||||
|
@ -265,34 +212,9 @@ player::ReceiveEntity(float new, float flChanged)
|
|||
READENTITY_BYTE(anim_bottom, PLAYER_BOTTOMFRAME)
|
||||
READENTITY_FLOAT(anim_bottom_time, PLAYER_BOTTOMFRAME)
|
||||
|
||||
READENTITY_BYTE(glock_mag, PLAYER_AMMO1)
|
||||
READENTITY_BYTE(mp5_mag, PLAYER_AMMO1)
|
||||
READENTITY_BYTE(python_mag, PLAYER_AMMO1)
|
||||
READENTITY_BYTE(shotgun_mag, PLAYER_AMMO1)
|
||||
READENTITY_BYTE(crossbow_mag, PLAYER_AMMO1)
|
||||
READENTITY_BYTE(rpg_mag, PLAYER_AMMO1)
|
||||
READENTITY_BYTE(satchel_chg, PLAYER_AMMO1)
|
||||
|
||||
READENTITY_BYTE(ammo_9mm, PLAYER_AMMO2)
|
||||
READENTITY_BYTE(ammo_357, PLAYER_AMMO2)
|
||||
READENTITY_BYTE(ammo_buckshot, PLAYER_AMMO2)
|
||||
READENTITY_BYTE(ammo_bolt, PLAYER_AMMO2)
|
||||
READENTITY_BYTE(ammo_rocket, PLAYER_AMMO2)
|
||||
READENTITY_BYTE(ammo_uranium, PLAYER_AMMO2)
|
||||
READENTITY_BYTE(ammo_handgrenade, PLAYER_AMMO2)
|
||||
READENTITY_BYTE(ammo_satchel, PLAYER_AMMO2)
|
||||
READENTITY_BYTE(ammo_tripmine, PLAYER_AMMO2)
|
||||
READENTITY_BYTE(ammo_snark, PLAYER_AMMO2)
|
||||
READENTITY_BYTE(ammo_hornet, PLAYER_AMMO2)
|
||||
|
||||
READENTITY_BYTE(ammo_m203_grenade, PLAYER_AMMO3)
|
||||
READENTITY_BYTE(ammo_gauss_volume, PLAYER_AMMO3)
|
||||
READENTITY_BYTE(ammo_rpg_state, PLAYER_AMMO3)
|
||||
READENTITY_BYTE(mode_tempstate, PLAYER_AMMO3)
|
||||
|
||||
setorigin(this, origin);
|
||||
|
||||
/* these only concern the current player */
|
||||
/* these only concern the current HLPlayer */
|
||||
CSQC_UpdateSeat();
|
||||
if (this != pSeat->m_ePlayer)
|
||||
return;
|
||||
|
@ -301,8 +223,7 @@ player::ReceiveEntity(float new, float flChanged)
|
|||
if (flChanged == UPDATE_ALL)
|
||||
PredictPreFrame();
|
||||
|
||||
if (flChanged & PLAYER_AMMO1 || flChanged & PLAYER_AMMO2 || flChanged & PLAYER_AMMO3) {
|
||||
Weapons_AmmoUpdate(this);
|
||||
if (flChanged & PLAYER_AMMOTYPES ) {
|
||||
HUD_AmmoNotify_Check(this);
|
||||
}
|
||||
|
||||
|
@ -312,99 +233,48 @@ player::ReceiveEntity(float new, float flChanged)
|
|||
|
||||
/*
|
||||
=================
|
||||
player::PredictPostFrame
|
||||
HLPlayer::PredictPostFrame
|
||||
|
||||
Save the last valid server values away in the _net variants of each field
|
||||
so we can roll them back later.
|
||||
=================
|
||||
*/
|
||||
void
|
||||
player::PredictPreFrame(void)
|
||||
HLPlayer::PredictPreFrame(void)
|
||||
{
|
||||
/* the generic client attributes */
|
||||
NSClientPlayer::PredictPreFrame();
|
||||
super::PredictPreFrame();
|
||||
|
||||
SAVE_STATE(anim_top)
|
||||
SAVE_STATE(anim_top_delay)
|
||||
SAVE_STATE(anim_top_time)
|
||||
SAVE_STATE(anim_bottom)
|
||||
SAVE_STATE(anim_bottom_time)
|
||||
|
||||
SAVE_STATE(glock_mag)
|
||||
SAVE_STATE(mp5_mag)
|
||||
SAVE_STATE(python_mag)
|
||||
SAVE_STATE(shotgun_mag)
|
||||
SAVE_STATE(crossbow_mag)
|
||||
SAVE_STATE(rpg_mag)
|
||||
SAVE_STATE(satchel_chg)
|
||||
|
||||
SAVE_STATE(ammo_9mm)
|
||||
SAVE_STATE(ammo_357)
|
||||
SAVE_STATE(ammo_buckshot)
|
||||
SAVE_STATE(ammo_bolt)
|
||||
SAVE_STATE(ammo_rocket)
|
||||
SAVE_STATE(ammo_uranium)
|
||||
SAVE_STATE(ammo_handgrenade)
|
||||
SAVE_STATE(ammo_satchel)
|
||||
SAVE_STATE(ammo_tripmine)
|
||||
SAVE_STATE(ammo_snark)
|
||||
SAVE_STATE(ammo_hornet)
|
||||
|
||||
SAVE_STATE(ammo_m203_grenade)
|
||||
SAVE_STATE(ammo_gauss_volume)
|
||||
SAVE_STATE(ammo_rpg_state)
|
||||
SAVE_STATE(mode_tempstate)
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
player::PredictPostFrame
|
||||
HLPlayer::PredictPostFrame
|
||||
|
||||
Where we roll back our values to the ones last sent/verified by the server.
|
||||
=================
|
||||
*/
|
||||
void
|
||||
player::PredictPostFrame(void)
|
||||
HLPlayer::PredictPostFrame(void)
|
||||
{
|
||||
/* the generic client attributes */
|
||||
NSClientPlayer::PredictPostFrame();
|
||||
super::PredictPostFrame();
|
||||
|
||||
ROLL_BACK(anim_top)
|
||||
ROLL_BACK(anim_top_delay)
|
||||
ROLL_BACK(anim_top_time)
|
||||
ROLL_BACK(anim_bottom)
|
||||
ROLL_BACK(anim_bottom_time)
|
||||
|
||||
ROLL_BACK(glock_mag)
|
||||
ROLL_BACK(mp5_mag)
|
||||
ROLL_BACK(python_mag)
|
||||
ROLL_BACK(shotgun_mag)
|
||||
ROLL_BACK(crossbow_mag)
|
||||
ROLL_BACK(rpg_mag)
|
||||
ROLL_BACK(satchel_chg)
|
||||
|
||||
ROLL_BACK(ammo_9mm)
|
||||
ROLL_BACK(ammo_357)
|
||||
ROLL_BACK(ammo_buckshot)
|
||||
ROLL_BACK(ammo_m203_grenade)
|
||||
ROLL_BACK(ammo_bolt)
|
||||
ROLL_BACK(ammo_rocket)
|
||||
ROLL_BACK(ammo_uranium)
|
||||
ROLL_BACK(ammo_handgrenade)
|
||||
ROLL_BACK(ammo_satchel)
|
||||
ROLL_BACK(ammo_tripmine)
|
||||
ROLL_BACK(ammo_snark)
|
||||
ROLL_BACK(ammo_hornet)
|
||||
|
||||
ROLL_BACK(ammo_m203_grenade)
|
||||
ROLL_BACK(ammo_gauss_volume)
|
||||
ROLL_BACK(ammo_rpg_state)
|
||||
ROLL_BACK(mode_tempstate)
|
||||
}
|
||||
|
||||
#else
|
||||
void
|
||||
player::Save(float handle)
|
||||
HLPlayer::Save(float handle)
|
||||
{
|
||||
super::Save(handle);
|
||||
|
||||
|
@ -413,38 +283,10 @@ player::Save(float handle)
|
|||
SaveFloat(handle, "anim_top_delay", anim_top_delay);
|
||||
SaveInt(handle, "anim_bottom", anim_bottom);
|
||||
SaveFloat(handle, "anim_bottom_time", anim_bottom_time);
|
||||
|
||||
/* ammo 1 */
|
||||
SaveInt(handle, "glock_mag", glock_mag);
|
||||
SaveInt(handle, "mp5_mag", mp5_mag);
|
||||
SaveInt(handle, "python_mag", python_mag);
|
||||
SaveInt(handle, "shotgun_mag", shotgun_mag);
|
||||
SaveInt(handle, "crossbow_mag", crossbow_mag);
|
||||
SaveInt(handle, "rpg_mag", rpg_mag);
|
||||
SaveInt(handle, "satchel_chg", satchel_chg);
|
||||
|
||||
/* ammo 2 */
|
||||
SaveInt(handle, "ammo_9mm", ammo_9mm);
|
||||
SaveInt(handle, "ammo_357", ammo_357);
|
||||
SaveInt(handle, "ammo_buckshot", ammo_buckshot);
|
||||
SaveInt(handle, "ammo_bolt", ammo_bolt);
|
||||
SaveInt(handle, "ammo_rocket", ammo_rocket);
|
||||
SaveInt(handle, "ammo_uranium", ammo_uranium);
|
||||
SaveInt(handle, "ammo_handgrenade", ammo_handgrenade);
|
||||
SaveInt(handle, "ammo_satchel", ammo_satchel);
|
||||
SaveInt(handle, "ammo_tripmine", ammo_tripmine);
|
||||
SaveInt(handle, "ammo_snark", ammo_snark);
|
||||
SaveInt(handle, "ammo_hornet", ammo_hornet);
|
||||
|
||||
/* ammo 3 */
|
||||
SaveInt(handle, "ammo_m203_grenade", ammo_m203_grenade);
|
||||
SaveInt(handle, "ammo_gauss_volume", ammo_gauss_volume);
|
||||
SaveInt(handle, "ammo_rpg_state", ammo_rpg_state);
|
||||
SaveInt(handle, "mode_tempstate", mode_tempstate);
|
||||
}
|
||||
|
||||
void
|
||||
player::Restore(string strKey, string strValue)
|
||||
HLPlayer::Restore(string strKey, string strValue)
|
||||
{
|
||||
switch (strKey) {
|
||||
case "anim_top":
|
||||
|
@ -462,82 +304,13 @@ player::Restore(string strKey, string strValue)
|
|||
case "anim_bottom_time":
|
||||
anim_bottom_time = ReadFloat(strValue);
|
||||
break;
|
||||
/* AMMO 1 */
|
||||
case "glock_mag":
|
||||
glock_mag = ReadInt(strValue);
|
||||
break;
|
||||
case "mp5_mag":
|
||||
mp5_mag = ReadInt(strValue);
|
||||
break;
|
||||
case "python_mag":
|
||||
python_mag = ReadInt(strValue);
|
||||
break;
|
||||
case "shotgun_mag":
|
||||
shotgun_mag = ReadInt(strValue);
|
||||
break;
|
||||
case "crossbow_mag":
|
||||
crossbow_mag = ReadInt(strValue);
|
||||
break;
|
||||
case "rpg_mag":
|
||||
rpg_mag = ReadInt(strValue);
|
||||
break;
|
||||
case "satchel_chg":
|
||||
satchel_chg = ReadInt(strValue);
|
||||
break;
|
||||
/* AMMO 2 */
|
||||
case "ammo_9mm":
|
||||
ammo_9mm = ReadInt(strValue);
|
||||
break;
|
||||
case "ammo_357":
|
||||
ammo_357 = ReadInt(strValue);
|
||||
break;
|
||||
case "ammo_buckshot":
|
||||
ammo_buckshot = ReadInt(strValue);
|
||||
break;
|
||||
case "ammo_bolt":
|
||||
ammo_bolt = ReadInt(strValue);
|
||||
break;
|
||||
case "ammo_rocket":
|
||||
ammo_rocket = ReadInt(strValue);
|
||||
break;
|
||||
case "ammo_uranium":
|
||||
ammo_uranium = ReadInt(strValue);
|
||||
break;
|
||||
case "ammo_handgrenade":
|
||||
ammo_handgrenade = ReadInt(strValue);
|
||||
break;
|
||||
case "ammo_satchel":
|
||||
ammo_satchel = ReadInt(strValue);
|
||||
break;
|
||||
case "ammo_tripmine":
|
||||
ammo_tripmine = ReadInt(strValue);
|
||||
break;
|
||||
case "ammo_snark":
|
||||
ammo_snark = ReadInt(strValue);
|
||||
break;
|
||||
case "ammo_hornet":
|
||||
ammo_hornet = ReadInt(strValue);
|
||||
break;
|
||||
/* AMMO 3 */
|
||||
case "ammo_m203_grenade":
|
||||
ammo_m203_grenade = ReadInt(strValue);
|
||||
break;
|
||||
case "ammo_gauss_volume":
|
||||
ammo_gauss_volume = ReadInt(strValue);
|
||||
break;
|
||||
case "ammo_rpg_state":
|
||||
ammo_rpg_state = ReadInt(strValue);
|
||||
break;
|
||||
case "mode_tempstate":
|
||||
mode_tempstate = ReadInt(strValue);
|
||||
break;
|
||||
default:
|
||||
super::Restore(strKey, strValue);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
player::EvaluateEntity(void)
|
||||
HLPlayer::EvaluateEntity(void)
|
||||
{
|
||||
/* the generic client attributes */
|
||||
NSClientPlayer::EvaluateEntity();
|
||||
|
@ -548,45 +321,21 @@ player::EvaluateEntity(void)
|
|||
EVALUATE_FIELD(anim_bottom, PLAYER_BOTTOMFRAME)
|
||||
EVALUATE_FIELD(anim_bottom_time, PLAYER_BOTTOMFRAME)
|
||||
|
||||
EVALUATE_FIELD(glock_mag, PLAYER_AMMO1)
|
||||
EVALUATE_FIELD(mp5_mag, PLAYER_AMMO1)
|
||||
EVALUATE_FIELD(python_mag, PLAYER_AMMO1)
|
||||
EVALUATE_FIELD(shotgun_mag, PLAYER_AMMO1)
|
||||
EVALUATE_FIELD(crossbow_mag, PLAYER_AMMO1)
|
||||
EVALUATE_FIELD(rpg_mag, PLAYER_AMMO1)
|
||||
EVALUATE_FIELD(satchel_chg, PLAYER_AMMO1)
|
||||
|
||||
EVALUATE_FIELD(ammo_9mm, PLAYER_AMMO2)
|
||||
EVALUATE_FIELD(ammo_357, PLAYER_AMMO2)
|
||||
EVALUATE_FIELD(ammo_buckshot, PLAYER_AMMO2)
|
||||
EVALUATE_FIELD(ammo_bolt, PLAYER_AMMO2)
|
||||
EVALUATE_FIELD(ammo_rocket, PLAYER_AMMO2)
|
||||
EVALUATE_FIELD(ammo_uranium, PLAYER_AMMO2)
|
||||
EVALUATE_FIELD(ammo_handgrenade, PLAYER_AMMO2)
|
||||
EVALUATE_FIELD(ammo_satchel, PLAYER_AMMO2)
|
||||
EVALUATE_FIELD(ammo_tripmine, PLAYER_AMMO2)
|
||||
EVALUATE_FIELD(ammo_snark, PLAYER_AMMO2)
|
||||
EVALUATE_FIELD(ammo_hornet, PLAYER_AMMO2)
|
||||
|
||||
EVALUATE_FIELD(ammo_m203_grenade, PLAYER_AMMO3)
|
||||
EVALUATE_FIELD(ammo_gauss_volume, PLAYER_AMMO3)
|
||||
EVALUATE_FIELD(ammo_rpg_state, PLAYER_AMMO3)
|
||||
EVALUATE_FIELD(mode_tempstate, PLAYER_AMMO3)
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
player::SendEntity
|
||||
HLPlayer::SendEntity
|
||||
=================
|
||||
*/
|
||||
float
|
||||
player::SendEntity(entity ePEnt, float flChanged)
|
||||
HLPlayer::SendEntity(entity ePEnt, float flChanged)
|
||||
{
|
||||
/* just-in-case. */
|
||||
if (classname != "player")
|
||||
if (IsPlayer() == false)
|
||||
return (0);
|
||||
|
||||
/* don't broadcast invisible players */
|
||||
/* don't broadcast invisible HLPlayers */
|
||||
if (IsFakeSpectator() && ePEnt != this)
|
||||
return (0);
|
||||
if (!GetModelindex() && ePEnt != this)
|
||||
|
@ -594,9 +343,6 @@ player::SendEntity(entity ePEnt, float flChanged)
|
|||
|
||||
flChanged = OptimiseChangedFlags(ePEnt, flChanged);
|
||||
|
||||
WriteByte(MSG_ENTITY, ENT_PLAYER);
|
||||
WriteFloat(MSG_ENTITY, flChanged);
|
||||
|
||||
/* the generic client attributes */
|
||||
NSClientPlayer::SendEntity(ePEnt, flChanged);
|
||||
|
||||
|
@ -606,31 +352,6 @@ player::SendEntity(entity ePEnt, float flChanged)
|
|||
SENDENTITY_BYTE(anim_bottom, PLAYER_BOTTOMFRAME)
|
||||
SENDENTITY_FLOAT(anim_bottom_time, PLAYER_BOTTOMFRAME)
|
||||
|
||||
SENDENTITY_BYTE(glock_mag, PLAYER_AMMO1)
|
||||
SENDENTITY_BYTE(mp5_mag, PLAYER_AMMO1)
|
||||
SENDENTITY_BYTE(python_mag, PLAYER_AMMO1)
|
||||
SENDENTITY_BYTE(shotgun_mag, PLAYER_AMMO1)
|
||||
SENDENTITY_BYTE(crossbow_mag, PLAYER_AMMO1)
|
||||
SENDENTITY_BYTE(rpg_mag, PLAYER_AMMO1)
|
||||
SENDENTITY_BYTE(satchel_chg, PLAYER_AMMO1)
|
||||
|
||||
SENDENTITY_BYTE(ammo_9mm, PLAYER_AMMO2)
|
||||
SENDENTITY_BYTE(ammo_357, PLAYER_AMMO2)
|
||||
SENDENTITY_BYTE(ammo_buckshot, PLAYER_AMMO2)
|
||||
SENDENTITY_BYTE(ammo_bolt, PLAYER_AMMO2)
|
||||
SENDENTITY_BYTE(ammo_rocket, PLAYER_AMMO2)
|
||||
SENDENTITY_BYTE(ammo_uranium, PLAYER_AMMO2)
|
||||
SENDENTITY_BYTE(ammo_handgrenade, PLAYER_AMMO2)
|
||||
SENDENTITY_BYTE(ammo_satchel, PLAYER_AMMO2)
|
||||
SENDENTITY_BYTE(ammo_tripmine, PLAYER_AMMO2)
|
||||
SENDENTITY_BYTE(ammo_snark, PLAYER_AMMO2)
|
||||
SENDENTITY_BYTE(ammo_hornet, PLAYER_AMMO2)
|
||||
|
||||
SENDENTITY_BYTE(ammo_m203_grenade, PLAYER_AMMO3)
|
||||
SENDENTITY_BYTE(ammo_gauss_volume, PLAYER_AMMO3)
|
||||
SENDENTITY_BYTE(ammo_rpg_state, PLAYER_AMMO3)
|
||||
SENDENTITY_BYTE(mode_tempstate, PLAYER_AMMO3)
|
||||
|
||||
return (1);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -23,15 +23,20 @@
|
|||
#define PMOVE_AIRACCELERATE 10
|
||||
#define PMOVE_WATERACCELERATE 10
|
||||
#define PMOVE_ACCELERATE 10
|
||||
#define PMOVE_MAXSPEED 270
|
||||
#define PMOVE_STEP_WALKSPEED 135
|
||||
#define PMOVE_STEP_RUNSPEED 220
|
||||
#define PHY_VIEWPOS [0,0,28]
|
||||
#define PHY_VIEWPOS_CROUCHED [0,0,12]
|
||||
#define PMOVE_STEP_WALKSPEED 270
|
||||
#define PMOVE_STEP_CROUCHSPEED 90
|
||||
#define PMOVE_BOXCENTER true
|
||||
#define PMOVE_NORMAL_HEIGHT 72
|
||||
#define PMOVE_NORMAL_VIEWHEIGHT 64
|
||||
#define PMOVE_CROUCH_HEIGHT 36
|
||||
#define PMOVE_CROUCH_VIEWHEIGHT 30
|
||||
|
||||
/* disable prone, run and lean */
|
||||
#define PMOVE_STEP_RUNSPEED 0
|
||||
#define PMOVE_PRONE_HEIGHT 0
|
||||
|
||||
void
|
||||
player::Physics_Jump(void)
|
||||
HLPlayer::Physics_Jump(void)
|
||||
{
|
||||
if (waterlevel >= 2) {
|
||||
if (watertype == CONTENT_WATER) {
|
||||
|
@ -43,7 +48,7 @@ player::Physics_Jump(void)
|
|||
}
|
||||
} else {
|
||||
/* Half-Life: Longjump module */
|
||||
if (flags & FL_CROUCHING && g_items & 0x00008000i) {
|
||||
if (IsCrouching() && HasItem("item_longjump")) {
|
||||
makevectors([0, v_angle[1], 0]);
|
||||
velocity = v_forward * 512;
|
||||
velocity[2] += 100;
|
||||
|
|
|
@ -48,7 +48,7 @@ w_crossbow_precache(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_crossbow_updateammo(player pl)
|
||||
w_crossbow_updateammo(NSClientPlayer pl)
|
||||
{
|
||||
Weapons_UpdateAmmo(pl, pl.crossbow_mag, pl.ammo_bolt, -1);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ w_crossbow_wmodel(void)
|
|||
}
|
||||
|
||||
string
|
||||
w_crossbow_pmodel(player pl)
|
||||
w_crossbow_pmodel(NSClientPlayer pl)
|
||||
{
|
||||
return "models/p_crossbow.mdl";
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ w_crossbow_deathmsg(void)
|
|||
}
|
||||
|
||||
int
|
||||
w_crossbow_pickup(player pl, int new, int startammo)
|
||||
w_crossbow_pickup(NSClientPlayer pl, int new, int startammo)
|
||||
{
|
||||
#ifdef SERVER
|
||||
int addAmmo = (startammo == -1) ? 5 : startammo;
|
||||
|
@ -94,7 +94,7 @@ w_crossbow_pickup(player pl, int new, int startammo)
|
|||
}
|
||||
|
||||
void
|
||||
w_crossbow_draw(player pl)
|
||||
w_crossbow_draw(NSClientPlayer pl)
|
||||
{
|
||||
Weapons_SetModel("models/v_crossbow.mdl");
|
||||
|
||||
|
@ -105,13 +105,13 @@ w_crossbow_draw(player pl)
|
|||
}
|
||||
|
||||
void
|
||||
w_crossbow_holster(player pl)
|
||||
w_crossbow_holster(NSClientPlayer pl)
|
||||
{
|
||||
Weapons_ViewAnimation(pl, CROSSBOW_HOLSTER1);
|
||||
}
|
||||
|
||||
void
|
||||
w_crossbow_primary(player pl)
|
||||
w_crossbow_primary(NSClientPlayer pl)
|
||||
{
|
||||
if (pl.w_attack_next > 0.0)
|
||||
return;
|
||||
|
@ -182,7 +182,7 @@ w_crossbow_primary(player pl)
|
|||
Weapons_ViewAnimation(pl, CROSSBOW_FIRE3);
|
||||
}
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTBOW, 0.25f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTBOW, 0.25f);
|
||||
|
@ -307,7 +307,7 @@ w_crossbow_crosshair(player pl)
|
|||
float
|
||||
w_crossbow_aimanim(player pl)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMBOW : ANIM_AIMBOW;
|
||||
return pl.IsCrouching() ? ANIM_CR_AIMBOW : ANIM_AIMBOW;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -28,7 +28,7 @@ enum
|
|||
};
|
||||
|
||||
void
|
||||
w_crowbar_precache(void)
|
||||
HLCrowbar::Precache(void)
|
||||
{
|
||||
#ifdef SERVER
|
||||
Sound_Precache("weapon_crowbar.hit");
|
||||
|
@ -65,20 +65,20 @@ w_crowbar_deathmsg(void)
|
|||
}
|
||||
|
||||
void
|
||||
w_crowbar_draw(player pl)
|
||||
HLCrowbar::Draw(player pl)
|
||||
{
|
||||
Weapons_SetModel("models/v_crowbar.mdl");
|
||||
Weapons_ViewAnimation(pl, CBAR_DRAW);
|
||||
}
|
||||
|
||||
void
|
||||
w_crowbar_holster(player pl)
|
||||
HLCrowbar::Holster(player pl)
|
||||
{
|
||||
Weapons_ViewAnimation(pl, CBAR_HOLSTER);
|
||||
}
|
||||
|
||||
void
|
||||
w_crowbar_primary(player pl)
|
||||
HLCrowbar::Primary(player pl)
|
||||
{
|
||||
int anim = 0;
|
||||
vector src;
|
||||
|
@ -115,7 +115,7 @@ w_crowbar_primary(player pl)
|
|||
Weapons_ViewAnimation(pl, trace_fraction >= 1 ? CBAR_ATTACK3MISS:CBAR_ATTACK3HIT);
|
||||
}
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTCROWBAR, 0.41f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTCROWBAR, 0.5f);
|
||||
|
@ -145,7 +145,7 @@ w_crowbar_primary(player pl)
|
|||
}
|
||||
|
||||
void
|
||||
w_crowbar_release(player pl)
|
||||
HLCrowbar::Release(player pl)
|
||||
{
|
||||
if (pl.w_idle_next) {
|
||||
return;
|
||||
|
@ -156,13 +156,13 @@ w_crowbar_release(player pl)
|
|||
}
|
||||
|
||||
float
|
||||
w_crowbar_aimanim(player pl)
|
||||
HLCrowbar::PlayerAnim(player pl)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
return pl.IsCrouching() ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
w_crowbar_hudpic(player pl, int selected, vector pos, float a)
|
||||
HLCrowbar::WeaponIcon(player pl, int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
if (selected) {
|
||||
|
@ -192,12 +192,13 @@ w_crowbar_hudpic(player pl, int selected, vector pos, float a)
|
|||
}
|
||||
|
||||
int
|
||||
w_crowbar_isempty(player pl)
|
||||
HLCrowbar::IsEmpty(player pl)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
weapontype_t w_crowbar_type(player pl)
|
||||
weapontype_t
|
||||
HLCrowbar::Type(player pl)
|
||||
{
|
||||
return WPNTYPE_CLOSE;
|
||||
}
|
||||
|
|
|
@ -272,7 +272,7 @@ void w_egon_crosshair(player pl)
|
|||
|
||||
float w_egon_aimanim(player pl)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMEGON : ANIM_AIMEGON;
|
||||
return pl.IsCrouching() ? ANIM_CR_AIMEGON : ANIM_AIMEGON;
|
||||
}
|
||||
|
||||
void w_egon_hudpic(player pl, int selected, vector pos, float a)
|
||||
|
|
|
@ -182,7 +182,7 @@ void w_gauss_primary(player pl)
|
|||
|
||||
pl.ammo_uranium -= 2;
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTGAUSS, 0.43f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTGAUSS, 0.43f);
|
||||
|
@ -224,7 +224,7 @@ void w_gauss_release(player pl)
|
|||
} else if (pl.mode_tempstate == GAUSSTATE_FULL) {
|
||||
Weapons_ViewAnimation(pl, GAUSS_FIRE1);
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTGAUSS, 0.43f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTGAUSS, 0.43f);
|
||||
|
@ -382,7 +382,7 @@ void w_gauss_crosshair(player pl)
|
|||
|
||||
float w_gauss_aimanim(player pl)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMGAUSS : ANIM_AIMGAUSS;
|
||||
return pl.IsCrouching() ? ANIM_CR_AIMGAUSS : ANIM_AIMGAUSS;
|
||||
}
|
||||
|
||||
void w_gauss_hudpic(player pl, int selected, vector pos, float a)
|
||||
|
|
|
@ -178,7 +178,7 @@ w_glock_primary(player pl)
|
|||
Weapons_ViewAnimation(pl, GLOCK_SHOOT_EMPTY);
|
||||
}
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOT1HAND, 0.2f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOT1HAND, 0.2f);
|
||||
|
@ -222,7 +222,7 @@ w_glock_secondary(player pl)
|
|||
Weapons_ViewAnimation(pl, GLOCK_SHOOT_EMPTY);
|
||||
}
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOT1HAND, 0.2f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOT1HAND, 0.2f);
|
||||
|
@ -302,7 +302,7 @@ w_glock_release(player pl)
|
|||
float
|
||||
w_glock_aimanim(player pl)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND;
|
||||
return pl.IsCrouching() ? ANIM_CR_AIM1HAND : ANIM_AIM1HAND;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -162,7 +162,7 @@ void w_handgrenade_release(player pl)
|
|||
pl.w_attack_next = 1.0f;
|
||||
pl.w_idle_next = 0.5f;
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTCROWBAR, 0.41f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTCROWBAR, 0.5f);
|
||||
|
@ -191,7 +191,7 @@ void w_handgrenade_release(player pl)
|
|||
float
|
||||
w_handgrenade_aimanim(player pl)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
return pl.IsCrouching() ? ANIM_CR_AIMCROWBAR : ANIM_AIMCROWBAR;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -173,7 +173,7 @@ w_hornetgun_primary(player pl)
|
|||
pl.ammo_hornet--;
|
||||
Weapons_ViewAnimation(pl, HORNETGUN_SHOOT);
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTHIVE, 0.43f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTHIVE, 0.43f);
|
||||
|
@ -203,7 +203,7 @@ w_hornetgun_secondary(player pl)
|
|||
pl.ammo_hornet--;
|
||||
Weapons_ViewAnimation(pl, HORNETGUN_SHOOT);
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTHIVE, 0.43f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTHIVE, 0.43f);
|
||||
|
@ -239,7 +239,7 @@ w_hornetgun_crosshair(player pl)
|
|||
float
|
||||
w_hornetgun_aimanim(player pl)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMHIVE : ANIM_AIMHIVE;
|
||||
return pl.IsCrouching() ? ANIM_CR_AIMHIVE : ANIM_AIMHIVE;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1,418 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2021 Marco Cawthorne <marco@icculus.org>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
enum
|
||||
{
|
||||
MP5_IDLE1,
|
||||
MP5_IDLE2,
|
||||
MP5_GRENADE,
|
||||
MP5_RELOAD,
|
||||
MP5_DRAW,
|
||||
#ifdef GEARBOX
|
||||
MP5_DEPLOY, /* not sure what this is about */
|
||||
#endif
|
||||
MP5_FIRE1,
|
||||
MP5_FIRE2,
|
||||
MP5_FIRE3
|
||||
};
|
||||
|
||||
#ifdef CLIENT
|
||||
void w_mp5_ejectshell(void)
|
||||
{
|
||||
static void w_mp5_ejectshell_death(void) {
|
||||
remove(self);
|
||||
}
|
||||
static void w_mp5_ejectshell_touch(void) {
|
||||
if (other == world)
|
||||
Sound_Play(self, CHAN_BODY, "modelevent_shell.land");
|
||||
}
|
||||
entity eShell = spawn();
|
||||
setmodel(eShell, "models/shell.mdl");
|
||||
eShell.solid = SOLID_BBOX;
|
||||
eShell.movetype = MOVETYPE_BOUNCE;
|
||||
eShell.drawmask = MASK_ENGINE;
|
||||
eShell.angles = [pSeat->m_eViewModel.angles[0], pSeat->m_eViewModel.angles[1], 0];
|
||||
eShell.velocity = pSeat->m_vecPredictedVelocity;
|
||||
|
||||
float r = random(0.0, 50.0);
|
||||
makevectors(pSeat->m_eViewModel.angles);
|
||||
eShell.velocity += (v_forward * 0);
|
||||
eShell.velocity += (v_right * 45);
|
||||
eShell.velocity += (v_up * (145 + r));
|
||||
eShell.touch = w_mp5_ejectshell_touch;
|
||||
|
||||
eShell.avelocity = [0,45,900];
|
||||
eShell.think = w_mp5_ejectshell_death;
|
||||
eShell.nextthink = time + 2.5f;
|
||||
setsize(eShell, [0,0,0], [0,0,0]);
|
||||
setorigin(eShell, pSeat->m_eViewModel.origin + (v_forward * 30) + (v_right * 8) + (v_up * -15));
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
w_mp5_precache(void)
|
||||
{
|
||||
#ifdef SERVER
|
||||
Sound_Precache("weapon_mp5.shoot");
|
||||
Sound_Precache("weapon_mp5.gl");
|
||||
Sound_Precache("weapon_mp5.empty");
|
||||
precache_model("models/w_9mmar.mdl");
|
||||
precache_model("models/grenade.mdl");
|
||||
#else
|
||||
precache_model("models/v_9mmar.mdl");
|
||||
precache_model("models/p_9mmar.mdl");
|
||||
Sound_Precache("modelevent_shell.land");
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
w_mp5_pickup(player pl, int new, int startammo)
|
||||
{
|
||||
#ifdef SERVER
|
||||
#ifdef GEARBOX
|
||||
int addAmmo = (startammo == -1) ? 50 : startammo;
|
||||
#else
|
||||
int addAmmo = (startammo == -1) ? 25 : startammo;
|
||||
#endif
|
||||
|
||||
if (new) {
|
||||
pl.mp5_mag = addAmmo;
|
||||
return (1);
|
||||
}
|
||||
|
||||
if (pl.ammo_9mm < MAX_A_9MM) {
|
||||
pl.ammo_9mm = bound(0, pl.ammo_9mm + addAmmo, MAX_A_9MM);
|
||||
} else {
|
||||
if (!new)
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
w_mp5_updateammo(player pl)
|
||||
{
|
||||
Weapons_UpdateAmmo(pl, pl.mp5_mag, pl.ammo_9mm, pl.ammo_m203_grenade);
|
||||
}
|
||||
|
||||
string
|
||||
w_mp5_wmodel(void)
|
||||
{
|
||||
return "models/w_9mmar.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_mp5_pmodel(player pl)
|
||||
{
|
||||
return "models/p_9mmar.mdl";
|
||||
}
|
||||
|
||||
string
|
||||
w_mp5_deathmsg(void)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
void
|
||||
w_mp5_draw(player pl)
|
||||
{
|
||||
Weapons_SetModel("models/v_9mmar.mdl");
|
||||
Weapons_ViewAnimation(pl, MP5_DRAW);
|
||||
}
|
||||
|
||||
void
|
||||
w_mp5_holster(player pl)
|
||||
{
|
||||
Weapons_ViewAnimation(pl, MP5_DRAW);
|
||||
}
|
||||
|
||||
void
|
||||
w_mp5_primary(player pl)
|
||||
{
|
||||
if (pl.w_attack_next > 0.0f)
|
||||
return;
|
||||
if (pl.gflags & GF_SEMI_TOGGLED)
|
||||
return;
|
||||
|
||||
/* Ammo check */
|
||||
bool out_of_ammo = (pl.mp5_mag <= 0i) ? true : false;
|
||||
if (out_of_ammo || (pl.WaterLevel() >= WATERLEVEL_SUBMERGED)) {
|
||||
#ifdef SERVER
|
||||
Sound_Play(pl, CHAN_AUTO, "weapon_mp5.empty");
|
||||
#endif
|
||||
pl.gflags |= GF_SEMI_TOGGLED;
|
||||
return;
|
||||
}
|
||||
|
||||
pl.mp5_mag--;
|
||||
|
||||
/* Actual firing */
|
||||
int r = floor(pseudorandom() * 3.0f);
|
||||
switch (r) {
|
||||
case 1:
|
||||
Weapons_ViewAnimation(pl, MP5_FIRE1);
|
||||
break;
|
||||
case 2:
|
||||
Weapons_ViewAnimation(pl, MP5_FIRE2);
|
||||
break;
|
||||
default:
|
||||
Weapons_ViewAnimation(pl, MP5_FIRE3);
|
||||
break;
|
||||
}
|
||||
|
||||
Weapons_ViewPunchAngle(pl, [-2,0,0]);
|
||||
|
||||
#ifdef CLIENT
|
||||
View_SetMuzzleflash(MUZZLE_RIFLE);
|
||||
View_AddEvent(w_mp5_ejectshell, 0.0f);
|
||||
#else
|
||||
/* singleplayer is more accurate */
|
||||
if (cvar("sv_playerslots") == 1) {
|
||||
TraceAttack_FireBulletsWithDecal(1, Weapons_GetCameraPos(pl), Skill_GetValue("plr_9mmAR_bullet", 5), [0.025,0.025], WEAPON_MP5, "Impact.BigShot");
|
||||
} else {
|
||||
TraceAttack_FireBulletsWithDecal(1, Weapons_GetCameraPos(pl), Skill_GetValue("plr_9mmAR_bullet", 5), [0.05,0.05], WEAPON_MP5, "Impact.BigShot");
|
||||
}
|
||||
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_mp5.shoot");
|
||||
#endif
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTMP5, 0.1f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTMP5, 0.1f);
|
||||
|
||||
pl.w_attack_next = 0.085f;
|
||||
pl.w_idle_next = 10.0f;
|
||||
}
|
||||
|
||||
void
|
||||
w_mp5_secondary(player pl)
|
||||
{
|
||||
if (pl.w_attack_next > 0.0f)
|
||||
return;
|
||||
if (pl.gflags & GF_SEMI_TOGGLED)
|
||||
return;
|
||||
|
||||
/* Ammo check */
|
||||
bool out_of_ammo = (pl.ammo_m203_grenade <= 0i) ? true : false;
|
||||
if (out_of_ammo || pl.WaterLevel() >= WATERLEVEL_SUBMERGED) {
|
||||
#ifdef SERVER
|
||||
Sound_Play(pl, CHAN_AUTO, "weapon_mp5.empty");
|
||||
#endif
|
||||
pl.gflags |= GF_SEMI_TOGGLED;
|
||||
return;
|
||||
}
|
||||
|
||||
pl.ammo_m203_grenade--;
|
||||
|
||||
#ifdef SERVER
|
||||
NSProjectile_SpawnDef("projectile_ARgrenade", pl);
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_mp5.gl");
|
||||
#endif
|
||||
|
||||
Weapons_ViewPunchAngle(pl, [-10.0f, 0.0f, 0.0f]);
|
||||
Weapons_ViewAnimation(pl, MP5_GRENADE);
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTMP5, 0.45f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTMP5, 0.45f);
|
||||
|
||||
pl.w_attack_next = 1.0f;
|
||||
pl.w_idle_next = 10.0f;
|
||||
}
|
||||
|
||||
void
|
||||
w_mp5_reload(player pl)
|
||||
{
|
||||
if (pl.w_attack_next) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Ammo check */
|
||||
if (pl.mp5_mag >= 50) {
|
||||
return;
|
||||
}
|
||||
if (pl.ammo_9mm <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Weapons_ViewAnimation(pl, MP5_RELOAD);
|
||||
|
||||
#ifdef SERVER
|
||||
static void w_mp5_reload_done(void) {
|
||||
player pl = (player)self;
|
||||
Weapons_ReloadWeapon(pl, player::mp5_mag, player::ammo_9mm, 50);
|
||||
}
|
||||
|
||||
pl.think = w_mp5_reload_done;
|
||||
pl.nextthink = time + 1.4f;
|
||||
#endif
|
||||
|
||||
pl.w_attack_next = 1.5f;
|
||||
pl.w_idle_next = 10.0f;
|
||||
}
|
||||
|
||||
void
|
||||
w_mp5_release(player pl)
|
||||
{
|
||||
|
||||
/* auto-reload if need be */
|
||||
if (pl.w_attack_next <= 0.0)
|
||||
if (pl.mp5_mag == 0 && pl.ammo_9mm > 0) {
|
||||
Weapons_Reload(pl);
|
||||
return;
|
||||
}
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
int r = floor(pseudorandom() * 3.0f);
|
||||
if (r == 1) {
|
||||
Weapons_ViewAnimation(pl, MP5_IDLE1);
|
||||
} else {
|
||||
Weapons_ViewAnimation(pl, MP5_IDLE2);
|
||||
}
|
||||
|
||||
pl.w_idle_next = 15.0f;
|
||||
}
|
||||
|
||||
void
|
||||
w_mp5_crosshair(player pl)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
vector aicon_pos;
|
||||
|
||||
Cross_DrawSub(g_cross_spr, [24,24], [0,48/128], [0.1875, 0.1875]);
|
||||
|
||||
HUD_DrawAmmo1();
|
||||
HUD_DrawAmmo2();
|
||||
HUD_DrawAmmo3();
|
||||
|
||||
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
drawsubpic(
|
||||
aicon_pos,
|
||||
[24,24],
|
||||
g_hud7_spr,
|
||||
[0,72/128],
|
||||
[24/256, 24/128],
|
||||
g_hud_color,
|
||||
pSeatLocal->m_flAmmo2Alpha,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
|
||||
aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 74];
|
||||
drawsubpic(
|
||||
aicon_pos,
|
||||
[24,24],
|
||||
g_hud7_spr,
|
||||
[48/256,72/128],
|
||||
[24/256, 24/128],
|
||||
g_hud_color,
|
||||
pSeatLocal->m_flAmmo3Alpha,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
float
|
||||
w_mp5_aimanim(player pl)
|
||||
{
|
||||
return pl.flags & ANIM_CR_AIMMP5 ? ANIM_CR_AIMCROWBAR : ANIM_AIMMP5;
|
||||
}
|
||||
|
||||
void
|
||||
w_mp5_hudpic(player pl, int selected, vector pos, float a)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
vector hud_col;
|
||||
|
||||
if (pl.mp5_mag == 0 && pl.ammo_9mm == 0 && pl.ammo_m203_grenade == 0)
|
||||
hud_col = [1,0,0];
|
||||
else
|
||||
hud_col = g_hud_color;
|
||||
|
||||
if (selected) {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
g_hud4_spr,
|
||||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
hud_col,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
} else {
|
||||
drawsubpic(
|
||||
pos,
|
||||
[170,45],
|
||||
g_hud1_spr,
|
||||
[0,135/256],
|
||||
[170/256,45/256],
|
||||
hud_col,
|
||||
a,
|
||||
DRAWFLAG_ADDITIVE
|
||||
);
|
||||
}
|
||||
|
||||
HUD_DrawAmmoBar(pos, pl.ammo_9mm, MAX_A_9MM, a);
|
||||
HUD_DrawAmmoBar(pos + [25, 0], pl.ammo_m203_grenade, MAX_A_M203_GRENADE, a);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
w_mp5_isempty(player pl)
|
||||
{
|
||||
|
||||
if (pl.mp5_mag <= 0 && pl.ammo_9mm <= 0 && pl.ammo_m203_grenade <= 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
weapontype_t
|
||||
w_mp5_type(player pl)
|
||||
{
|
||||
return WPNTYPE_RANGED;
|
||||
}
|
||||
|
||||
weapon_t w_mp5 =
|
||||
{
|
||||
.name = "9mmAR",
|
||||
.id = ITEM_MP5,
|
||||
.slot = 2,
|
||||
.slot_pos = 0,
|
||||
.weight = 15,
|
||||
.draw = w_mp5_draw,
|
||||
.holster = w_mp5_holster,
|
||||
.primary = w_mp5_primary,
|
||||
.secondary = w_mp5_secondary,
|
||||
.reload = w_mp5_reload,
|
||||
.release = w_mp5_release,
|
||||
.postdraw = w_mp5_crosshair,
|
||||
.precache = w_mp5_precache,
|
||||
.pickup = w_mp5_pickup,
|
||||
.updateammo = w_mp5_updateammo,
|
||||
.wmodel = w_mp5_wmodel,
|
||||
.pmodel = w_mp5_pmodel,
|
||||
.deathmsg = w_mp5_deathmsg,
|
||||
.aimanim = w_mp5_aimanim,
|
||||
.isempty = w_mp5_isempty,
|
||||
.type = w_mp5_type,
|
||||
.hudpic = w_mp5_hudpic
|
||||
};
|
|
@ -136,7 +136,7 @@ w_python_primary(player pl)
|
|||
Weapons_ViewPunchAngle(pl, [-10,0,0]);
|
||||
Weapons_ViewAnimation(pl, PYTHON_FIRE1);
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTPYTHON, 0.43f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTPYTHON, 0.43f);
|
||||
|
@ -274,7 +274,7 @@ w_python_crosshair(player pl)
|
|||
float
|
||||
w_python_aimanim(player pl)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMPYTHON : ANIM_AIMPYTHON;
|
||||
return pl.IsCrouching() ? ANIM_CR_AIMPYTHON : ANIM_AIMPYTHON;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -128,7 +128,7 @@ void w_rpg_primary(player pl)
|
|||
Weapons_ViewAnimation(pl, RPG_FIRE2);
|
||||
Weapons_ViewPunchAngle(pl, [-10,0,0]);
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTRPG, 0.43f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTRPG, 0.43f);
|
||||
|
@ -214,7 +214,7 @@ void w_rpg_secondary(player pl)
|
|||
|
||||
float w_rpg_aimanim(player pl)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMRPG : ANIM_AIMRPG;
|
||||
return pl.IsCrouching() ? ANIM_CR_AIMRPG : ANIM_AIMRPG;
|
||||
}
|
||||
|
||||
void w_rpg_hudpic(player pl, int selected, vector pos, float a)
|
||||
|
@ -245,19 +245,19 @@ void w_rpg_hud(player pl)
|
|||
|
||||
/* crosshair/laser */
|
||||
if (pl.ammo_rpg_state == 1) {
|
||||
float lerp;
|
||||
float lerpValue;
|
||||
vector jitter = [0.0f, 0.0f, 0.0f];
|
||||
Weapons_MakeVectors(pl);
|
||||
vector src = pl.origin + pl.view_ofs;
|
||||
traceline(src, src + (v_forward * 256), FALSE, pl);
|
||||
lerp = Math_Lerp(18,6, trace_fraction);
|
||||
lerpValue = lerp(18,6, trace_fraction);
|
||||
jitter[0] = (random(0,2) - 2) * (1 - trace_fraction);
|
||||
jitter[1] = (random(0,2) - 2) * (1 - trace_fraction);
|
||||
laser_pos = g_hudmins + (g_hudres / 2) + ([-lerp,-lerp] / 2);
|
||||
laser_pos = g_hudmins + (g_hudres / 2) + ([-lerpValue,-lerpValue] / 2);
|
||||
|
||||
drawsubpic(
|
||||
laser_pos + jitter,
|
||||
[lerp,lerp],
|
||||
[lerpValue,lerpValue],
|
||||
g_laser_spr,
|
||||
[0,0],
|
||||
[1.0, 1.0],
|
||||
|
|
|
@ -143,7 +143,7 @@ w_satchel_primary(player pl)
|
|||
pl.ammo_satchel--;
|
||||
pl.mode_tempstate = 1; /* mark us as having deployed something */
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTSQUEAK, 0.41f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTSQUEAK, 0.5f);
|
||||
|
@ -192,7 +192,7 @@ w_satchel_secondary(player pl)
|
|||
NSProjectile_SpawnDef("projectile_satchel", pl);
|
||||
#endif
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTSQUEAK, 0.41f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTSQUEAK, 0.5f);
|
||||
|
@ -238,7 +238,7 @@ w_satchel_release(player pl)
|
|||
float
|
||||
w_satchel_aimanim(player pl)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMSQUEAK : ANIM_AIMSQUEAK;
|
||||
return pl.IsCrouching() ? ANIM_CR_AIMSQUEAK : ANIM_AIMSQUEAK;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -219,7 +219,7 @@ w_shotgun_primary(player pl)
|
|||
Weapons_ViewAnimation(pl, SHOTGUN_FIRE1);
|
||||
Weapons_ViewPunchAngle(pl, [-5,0,0]);
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTSHOTGUN, 0.41f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTSHOTGUN, 0.5f);
|
||||
|
@ -272,7 +272,7 @@ w_shotgun_secondary(player pl)
|
|||
Weapons_ViewAnimation(pl, SHOTGUN_FIRE2);
|
||||
Weapons_ViewPunchAngle(pl, [-10,0,0]);
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTSHOTGUN, 0.41f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTSHOTGUN, 0.5f);
|
||||
|
@ -383,7 +383,7 @@ w_shotgun_crosshair(player pl)
|
|||
float
|
||||
w_shotgun_aimanim(player pl)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMSHOTGUN : ANIM_AIMSHOTGUN;
|
||||
return pl.IsCrouching() ? ANIM_CR_AIMSHOTGUN : ANIM_AIMSHOTGUN;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -194,7 +194,7 @@ void w_snark_primary(player pl)
|
|||
/* Audio-Visual Bit */
|
||||
Weapons_ViewAnimation(pl, SNARK_THROW);
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
if (pl.IsCrouching())
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTSQUEAK, 0.41f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTSQUEAK, 0.5f);
|
||||
|
@ -284,7 +284,7 @@ string w_snark_deathmsg(void)
|
|||
|
||||
float w_snark_aimanim(player pl)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMSQUEAK : ANIM_AIMSQUEAK;
|
||||
return pl.IsCrouching() ? ANIM_CR_AIMSQUEAK : ANIM_AIMSQUEAK;
|
||||
}
|
||||
|
||||
void w_snark_hud(player pl)
|
||||
|
|
|
@ -32,95 +32,58 @@ enum
|
|||
* Because not being able to place it around levels would be boring.
|
||||
* Some maps, such as subtransit and a few singleplayer chapters have this. */
|
||||
|
||||
#ifdef SERVER
|
||||
class monster_tripmine:NSMonster
|
||||
class HLTripmine:NSSurfacePropEntity
|
||||
{
|
||||
vector m_vecEndPos;
|
||||
void(void) monster_tripmine;
|
||||
void HLTripmine(void);
|
||||
|
||||
virtual float(entity, float) SendEntity;
|
||||
virtual void(int) Trip;
|
||||
virtual void(void) Damaged;
|
||||
virtual void(void) Ready;
|
||||
virtual void(void) Respawn;
|
||||
#ifdef SERVER
|
||||
virtual void Respawn(void);
|
||||
virtual void Spawned(void);
|
||||
virtual void Ready(void);
|
||||
virtual void Pain(entity, entity, int, vector, int);
|
||||
virtual void Death(entity, entity, int, vector, int);
|
||||
virtual float SendEntity(entity, float);
|
||||
#endif
|
||||
|
||||
#ifdef CLIENT
|
||||
virtual float predraw(void);
|
||||
virtual void ReceiveEntity(float, float);
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
vector m_vecEndPos;
|
||||
|
||||
#ifdef CLIENT
|
||||
int m_iActive;
|
||||
#endif
|
||||
};
|
||||
|
||||
float
|
||||
monster_tripmine::SendEntity(entity pvsent, float flags)
|
||||
void
|
||||
HLTripmine::HLTripmine(void)
|
||||
{
|
||||
WriteByte(MSG_ENTITY, ENT_TRIPMINE);
|
||||
WriteCoord(MSG_ENTITY, origin[0]);
|
||||
WriteCoord(MSG_ENTITY, origin[1]);
|
||||
WriteCoord(MSG_ENTITY, origin[2]);
|
||||
WriteCoord(MSG_ENTITY, angles[0]);
|
||||
WriteCoord(MSG_ENTITY, angles[1]);
|
||||
WriteCoord(MSG_ENTITY, angles[2]);
|
||||
WriteCoord(MSG_ENTITY, m_vecEndPos[0]);
|
||||
WriteCoord(MSG_ENTITY, m_vecEndPos[1]);
|
||||
WriteCoord(MSG_ENTITY, m_vecEndPos[2]);
|
||||
WriteByte(MSG_ENTITY, health);
|
||||
return (1);
|
||||
#ifdef CLIENT
|
||||
solid = SOLID_BBOX;
|
||||
movetype = MOVETYPE_NONE;
|
||||
drawmask = MASK_ENGINE;
|
||||
frame = TRIPMINE_WORLD;
|
||||
m_iActive = FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef SERVER
|
||||
void
|
||||
HLTripmine::Respawn(void)
|
||||
{
|
||||
super::Respawn();
|
||||
RestoreAngles();
|
||||
}
|
||||
|
||||
void
|
||||
monster_tripmine::Trip(int walkthrough)
|
||||
HLTripmine::Spawned(void)
|
||||
{
|
||||
vector explosionPos = GetOrigin();
|
||||
float explosionDamage = Skill_GetValue("plr_tripmine", 150);
|
||||
float explosionRadius = explosionDamage * 2.5f;
|
||||
super::Spawned();
|
||||
|
||||
if (!walkthrough) {
|
||||
real_owner = g_dmg_eAttacker;
|
||||
}
|
||||
|
||||
/* This is to prevent infinite loops in Damage_Radius */
|
||||
SetPainCallback(__NULL__);
|
||||
SetDeathCallback(__NULL__);
|
||||
SetTakedamage(DAMAGE_NO);
|
||||
|
||||
pointparticles(particleeffectnum("fx_explosion.main"), GetOrigin(), [0,0,0], 1);
|
||||
Damage_Radius(explosionPos, real_owner, explosionDamage, explosionRadius, true, WEAPON_TRIPMINE);
|
||||
StartSoundDef("fx.explosion", CHAN_VOICE, true);
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void
|
||||
monster_tripmine::Damaged(void)
|
||||
{
|
||||
Trip(0);
|
||||
}
|
||||
|
||||
void
|
||||
monster_tripmine::Ready(void)
|
||||
{
|
||||
traceline(origin, origin + GetForward() * 2048, FALSE, this);
|
||||
|
||||
/* first time we're marked as ready, we play a sound and set the distance */
|
||||
if (CanBeDamaged() == false) {
|
||||
/* Laser calibrated to N units! */
|
||||
m_vecEndPos = trace_endpos;
|
||||
SetHealth(1);
|
||||
SetTakedamage(DAMAGE_YES);
|
||||
StartSoundDef("weapon_tripmine.activate", CHAN_WEAPON, true);
|
||||
SetSolid(SOLID_BBOX);
|
||||
SetPainCallback(Damaged);
|
||||
SetDeathCallback(Damaged);
|
||||
ForceNetworkUpdate();
|
||||
}
|
||||
|
||||
/* laser shorter than when calibrated, explode! */
|
||||
if (trace_endpos != m_vecEndPos) {
|
||||
Trip(1);
|
||||
return;
|
||||
}
|
||||
|
||||
/* run this method again next frame */
|
||||
ScheduleThink(Ready, 0.0f);
|
||||
}
|
||||
|
||||
void
|
||||
monster_tripmine::Respawn(void)
|
||||
{
|
||||
SetTakedamage(DAMAGE_NO);
|
||||
SetSolid(SOLID_NOT);
|
||||
SetMovetype(MOVETYPE_NONE);
|
||||
|
@ -135,276 +98,103 @@ monster_tripmine::Respawn(void)
|
|||
}
|
||||
|
||||
void
|
||||
monster_tripmine::monster_tripmine(void)
|
||||
HLTripmine::Death(entity inflictor, entity attacker, int damage, vector dir, int location)
|
||||
{
|
||||
Respawn();
|
||||
}
|
||||
#else
|
||||
class csitem_tripmine
|
||||
{
|
||||
int m_iActive;
|
||||
vector m_vecEndPos;
|
||||
vector explosionPos = GetOrigin();
|
||||
float explosionDamage = Skill_GetValue("plr_tripmine", 150);
|
||||
float explosionRadius = explosionDamage * 2.5f;
|
||||
|
||||
void(void) csitem_tripmine;
|
||||
virtual float(void) predraw;
|
||||
};
|
||||
/* This is to prevent infinite loops in Damage_Radius */
|
||||
SetTakedamage(DAMAGE_NO);
|
||||
|
||||
float csitem_tripmine::predraw(void)
|
||||
{
|
||||
if (m_iActive) {
|
||||
trailparticles(BEAM_TRIPMINE, this, origin, m_vecEndPos);
|
||||
}
|
||||
pointparticles(particleeffectnum("fx_explosion.main"), GetOrigin(), [0,0,0], 1);
|
||||
|
||||
addentity(this);
|
||||
return PREDRAW_NEXT;
|
||||
radiusDamage(explosionPos, explosionRadius, 0i, (int)explosionDamage, attacker);
|
||||
StartSoundDef("fx.explosion", CHAN_VOICE, true);
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void
|
||||
csitem_tripmine::csitem_tripmine(void)
|
||||
HLTripmine::Pain(entity inflictor, entity attacker, int damage, vector dir, int location)
|
||||
{
|
||||
solid = SOLID_BBOX;
|
||||
movetype = MOVETYPE_NONE;
|
||||
drawmask = MASK_ENGINE;
|
||||
frame = TRIPMINE_WORLD;
|
||||
m_iActive = FALSE;
|
||||
}
|
||||
|
||||
void w_tripmine_parse(void)
|
||||
{
|
||||
csitem_tripmine tm = (csitem_tripmine)self;
|
||||
spawnfunc_csitem_tripmine();
|
||||
|
||||
tm.origin[0] = readcoord();
|
||||
tm.origin[1] = readcoord();
|
||||
tm.origin[2] = readcoord();
|
||||
tm.angles[0] = readcoord();
|
||||
tm.angles[1] = readcoord();
|
||||
tm.angles[2] = readcoord();
|
||||
tm.m_vecEndPos[0] = readcoord();
|
||||
tm.m_vecEndPos[1] = readcoord();
|
||||
tm.m_vecEndPos[2] = readcoord();
|
||||
tm.m_iActive = readbyte();
|
||||
setmodel(tm, "models/v_tripmine.mdl");
|
||||
|
||||
setcustomskin(tm, "", "geomset 0 2\ngeomset 1 2\n");
|
||||
setorigin(tm, tm.origin);
|
||||
setsize(tm, [-8,-8,-8], [8,8,8]);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* The WEAPON_TRIPMINE code
|
||||
*
|
||||
* Here is where the actual 'weapon' logic happens that the player itself
|
||||
* runs. It obviously won't work without MONSTER_TRIPMINE */
|
||||
|
||||
void w_tripmine_precache(void)
|
||||
{
|
||||
#ifdef SERVER
|
||||
Sound_Precache("weapon_tripmine.deploy");
|
||||
Sound_Precache("weapon_tripmine.charge");
|
||||
Sound_Precache("weapon_tripmine.activate");
|
||||
precache_model("models/v_tripmine.mdl");
|
||||
#else
|
||||
precache_model("models/p_tripmine.mdl");
|
||||
precache_model("models/v_tripmine.mdl");
|
||||
#endif
|
||||
}
|
||||
|
||||
void w_tripmine_updateammo(player pl)
|
||||
{
|
||||
Weapons_UpdateAmmo(pl, -1, pl.ammo_tripmine, -1);
|
||||
}
|
||||
|
||||
string w_tripmine_wmodel(void)
|
||||
{
|
||||
return "models/v_tripmine.mdl";
|
||||
}
|
||||
|
||||
string w_tripmine_pmodel(player pl)
|
||||
{
|
||||
return "models/p_tripmine.mdl";
|
||||
}
|
||||
|
||||
string w_tripmine_deathmsg(void)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
int w_tripmine_pickup(player pl, int new, int startammo)
|
||||
{
|
||||
#ifdef SERVER
|
||||
int addAmmo = (startammo == -1) ? 1 : startammo;
|
||||
|
||||
if (pl.ammo_tripmine < MAX_A_TRIPMINE) {
|
||||
pl.ammo_tripmine = bound(0, pl.ammo_tripmine + addAmmo, MAX_A_TRIPMINE);
|
||||
} else {
|
||||
if (!new)
|
||||
return (0);
|
||||
}
|
||||
#endif
|
||||
return (1);
|
||||
}
|
||||
|
||||
void w_tripmine_draw(player pl)
|
||||
{
|
||||
Weapons_SetModel("models/v_tripmine.mdl");
|
||||
Weapons_ViewAnimation(pl, TRIPMINE_DRAW);
|
||||
}
|
||||
|
||||
void w_tripmine_holster(player pl)
|
||||
{
|
||||
|
||||
Death(trace_ent, attacker, 0, g_vec_null, 0);
|
||||
}
|
||||
|
||||
void
|
||||
w_tripmine_primary(player pl)
|
||||
HLTripmine::Ready(void)
|
||||
{
|
||||
vector src;
|
||||
traceline(origin, origin + GetForward() * 2048, FALSE, this);
|
||||
|
||||
if (pl.w_attack_next > 0.0) {
|
||||
/* first time we're marked as ready, we play a sound and set the distance */
|
||||
if (takedamage == DAMAGE_NO) {
|
||||
/* Laser calibrated to N units! */
|
||||
m_vecEndPos = trace_endpos;
|
||||
SetHealth(1);
|
||||
SetTakedamage(DAMAGE_YES);
|
||||
StartSoundDef("weapon_tripmine.activate", CHAN_WEAPON, true);
|
||||
SetSolid(SOLID_BBOX);
|
||||
ForceNetworkUpdate();
|
||||
}
|
||||
|
||||
/* laser shorter than when calibrated, explode! */
|
||||
if (trace_endpos != m_vecEndPos) {
|
||||
Death(trace_ent, real_owner, 0, g_vec_null, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pl.ammo_tripmine <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
src = Weapons_GetCameraPos(pl);
|
||||
Weapons_MakeVectors(pl);
|
||||
traceline(src, src + v_forward * 64, FALSE, pl);
|
||||
|
||||
if (trace_fraction >= 1.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
pl.ammo_tripmine--;
|
||||
|
||||
Weapons_ViewAnimation(pl, TRIPMINE_FIRE2);
|
||||
|
||||
if (pl.flags & FL_CROUCHING)
|
||||
Animation_PlayerTop(pl, ANIM_CR_SHOOTTRIPMINE, 0.41f);
|
||||
else
|
||||
Animation_PlayerTop(pl, ANIM_SHOOTTRIPMINE, 0.5f);
|
||||
|
||||
#ifdef SERVER
|
||||
vector ang = vectoangles(trace_plane_normal);
|
||||
monster_tripmine mine = spawn(monster_tripmine, real_owner: pl, angles: ang, spawnflags: MSF_MULTIPLAYER);
|
||||
mine.health = 0;
|
||||
mine.SetOrigin(trace_endpos + (trace_plane_normal * 8));
|
||||
|
||||
Sound_Play(pl, CHAN_WEAPON, "weapon_tripmine.deploy");
|
||||
Sound_Play(mine, CHAN_WEAPON, "weapon_tripmine.charge");
|
||||
#endif
|
||||
|
||||
pl.a_ammo3 = 1;
|
||||
pl.w_attack_next =
|
||||
pl.w_idle_next = 0.5f;
|
||||
}
|
||||
|
||||
void
|
||||
w_tripmine_release(player pl)
|
||||
{
|
||||
if (pl.w_idle_next > 0.0) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pl.a_ammo3 == 1) {
|
||||
Weapons_ViewAnimation(pl, TRIPMINE_DRAW);
|
||||
#ifdef SERVER
|
||||
if (pl.ammo_tripmine <= 0) {
|
||||
Weapons_RemoveItem(pl, WEAPON_TRIPMINE);
|
||||
}
|
||||
#endif
|
||||
pl.a_ammo3 = 0;
|
||||
pl.w_attack_next = 0.5f;
|
||||
pl.w_idle_next = 3.0f;
|
||||
return;
|
||||
}
|
||||
|
||||
int r = (float)input_sequence % 3.0f;
|
||||
switch (r) {
|
||||
case 1:
|
||||
Weapons_ViewAnimation(pl, TRIPMINE_IDLE1);
|
||||
pl.w_idle_next = 3.0f;
|
||||
break;
|
||||
case 2:
|
||||
Weapons_ViewAnimation(pl, TRIPMINE_IDLE2);
|
||||
pl.w_idle_next = 2.0f;
|
||||
break;
|
||||
default:
|
||||
Weapons_ViewAnimation(pl, TRIPMINE_FIDGET);
|
||||
pl.w_idle_next = 3.34f;
|
||||
break;
|
||||
}
|
||||
/* run this method again next frame */
|
||||
ScheduleThink(Ready, 0.0f);
|
||||
}
|
||||
|
||||
float
|
||||
w_tripmine_aimanim(player pl)
|
||||
HLTripmine::SendEntity(entity ePEnt, float flChanged)
|
||||
{
|
||||
return pl.flags & FL_CROUCHING ? ANIM_CR_AIMTRIPMINE : ANIM_AIMTRIPMINE;
|
||||
WriteByte(MSG_ENTITY, ENT_TRIPMINE);
|
||||
WriteFloat(MSG_ENTITY, flChanged);
|
||||
WriteCoord(MSG_ENTITY, origin[0]);
|
||||
WriteCoord(MSG_ENTITY, origin[1]);
|
||||
WriteCoord(MSG_ENTITY, origin[2]);
|
||||
WriteCoord(MSG_ENTITY, angles[0]);
|
||||
WriteCoord(MSG_ENTITY, angles[1]);
|
||||
WriteCoord(MSG_ENTITY, angles[2]);
|
||||
WriteCoord(MSG_ENTITY, m_vecEndPos[0]);
|
||||
WriteCoord(MSG_ENTITY, m_vecEndPos[1]);
|
||||
WriteCoord(MSG_ENTITY, m_vecEndPos[2]);
|
||||
WriteByte(MSG_ENTITY, health);
|
||||
return (1);
|
||||
}
|
||||
|
||||
void
|
||||
w_tripmine_hud(player pl)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
HUD_DrawAmmo2();
|
||||
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
drawsubpic(aicon_pos, [24,24], g_hud7_spr, [120/256,96/128], [24/256, 24/128], g_hud_color, pSeatLocal->m_flAmmo2Alpha, DRAWFLAG_ADDITIVE);
|
||||
#endif
|
||||
|
||||
#ifdef CLIENT
|
||||
void
|
||||
HLTripmine::ReceiveEntity(float flNew, float flChanged)
|
||||
{
|
||||
this.origin[0] = readcoord();
|
||||
this.origin[1] = readcoord();
|
||||
this.origin[2] = readcoord();
|
||||
this.angles[0] = readcoord();
|
||||
this.angles[1] = readcoord();
|
||||
this.angles[2] = readcoord();
|
||||
this.m_vecEndPos[0] = readcoord();
|
||||
this.m_vecEndPos[1] = readcoord();
|
||||
this.m_vecEndPos[2] = readcoord();
|
||||
this.m_iActive = readbyte();
|
||||
|
||||
setmodel(this, "models/v_tripmine.mdl");
|
||||
|
||||
setcustomskin(this, "", "geomset 0 2\ngeomset 1 2\n");
|
||||
SetSize([-8,-8,-8], [8,8,8]);
|
||||
Relink();
|
||||
}
|
||||
|
||||
void
|
||||
w_tripmine_hudpic(player pl, int selected, vector pos, float a)
|
||||
float
|
||||
HLTripmine::predraw(void)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
if (selected) {
|
||||
drawsubpic(pos, [170,45], g_hud6_spr, [0,90/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
} else {
|
||||
drawsubpic(pos, [170,45], g_hud3_spr, [0,90/256], [170/256,45/256], g_hud_color, a, DRAWFLAG_ADDITIVE);
|
||||
if (m_iActive) {
|
||||
trailparticles(BEAM_TRIPMINE, this, GetOrigin(), m_vecEndPos);
|
||||
}
|
||||
|
||||
HUD_DrawAmmoBar(pos, pl.ammo_tripmine, MAX_A_TRIPMINE, a);
|
||||
addentity(this);
|
||||
return (PREDRAW_NEXT);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
w_tripmine_isempty(player pl)
|
||||
{
|
||||
if (pl.ammo_tripmine <= 0)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
weapontype_t
|
||||
w_tripmine_type(player pl)
|
||||
{
|
||||
return WPNTYPE_CLOSE;
|
||||
}
|
||||
|
||||
weapon_t w_tripmine =
|
||||
{
|
||||
.name = "tripmine",
|
||||
.id = ITEM_TRIPMINE,
|
||||
.slot = 4,
|
||||
.slot_pos = 2,
|
||||
.weight = -10,
|
||||
.draw = w_tripmine_draw,
|
||||
.holster = w_tripmine_holster,
|
||||
.primary = w_tripmine_primary,
|
||||
.secondary = __NULL__,
|
||||
.reload = __NULL__,
|
||||
.release = w_tripmine_release,
|
||||
.postdraw = w_tripmine_hud,
|
||||
.precache = w_tripmine_precache,
|
||||
.pickup = w_tripmine_pickup,
|
||||
.updateammo = w_tripmine_updateammo,
|
||||
.wmodel = w_tripmine_wmodel,
|
||||
.pmodel = w_tripmine_pmodel,
|
||||
.deathmsg = w_tripmine_deathmsg,
|
||||
.aimanim = w_tripmine_aimanim,
|
||||
.isempty = w_tripmine_isempty,
|
||||
.type = w_tripmine_type,
|
||||
.hudpic = w_tripmine_hudpic
|
||||
};
|
|
@ -1,99 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2022 Vera Visions LLC.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef NEW_INVENTORY
|
||||
/* for AI identification purposes */
|
||||
typedef enum
|
||||
{
|
||||
WPNTYPE_INVALID, /* no logic */
|
||||
WPNTYPE_RANGED, /* will want to keep their distance mostly */
|
||||
WPNTYPE_THROW, /* has to keep some distance, but not too far */
|
||||
WPNTYPE_CLOSE, /* have to get really close */
|
||||
WPNTYPE_FULLAUTO, /* for things that need to be held down */
|
||||
WPNTYPE_SEMI /* semi automatic */
|
||||
} weapontype_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
string name;
|
||||
int id; /* bitflag id */
|
||||
int slot;
|
||||
int slot_pos;
|
||||
int allow_drop;
|
||||
int weight; /* required for bestweapon */
|
||||
void(void) precache;
|
||||
string() wmodel;
|
||||
string() deathmsg;
|
||||
|
||||
/* player specific */
|
||||
string(player) pmodel;
|
||||
float(player) aimanim;
|
||||
weapontype_t(player) type; /* required for bot-AI */
|
||||
void(player) draw;
|
||||
void(player) holster;
|
||||
void(player) primary;
|
||||
void(player) secondary;
|
||||
void(player) reload;
|
||||
void(player) release;
|
||||
int(player, int, int) pickup;
|
||||
void(player) updateammo;
|
||||
|
||||
void(player, int) predraw; /* predraw... */
|
||||
void(player) postdraw; /* postdraw... */
|
||||
|
||||
int(player) isempty; /* kinda handy */
|
||||
void(player, int, vector, float) hudpic;
|
||||
} weapon_t;
|
||||
|
||||
void Weapons_Holster(player pl);
|
||||
void Weapons_Primary(player pl);
|
||||
void Weapons_Secondary(player pl);
|
||||
void Weapons_Reload(player pl);
|
||||
void Weapons_Release(player pl);
|
||||
void Weapons_PreDraw(player pl, int);
|
||||
|
||||
float Weapons_GetAim(player, int);
|
||||
int Weapons_IsEmpty(player, int);
|
||||
void Weapons_DrawCrosshair(player pl);
|
||||
void Weapons_MakeVectors(player pl);
|
||||
vector Weapons_GetCameraPos(player pl);
|
||||
void Weapons_ViewAnimation(player pl, int);
|
||||
void Weapons_ViewPunchAngle(player pl, vector);
|
||||
int Weapons_IsPresent(player, int);
|
||||
void Weapons_UpdateAmmo(player, int, int, int);
|
||||
int Weapons_GetAnimation(player pl);
|
||||
void Weapons_EnableModel(void);
|
||||
void Weapons_DisableModel(void);
|
||||
weapontype_t Weapons_GetType(player, int);
|
||||
|
||||
void Weapons_SetLeftModel(string);
|
||||
void Weapons_SetRightModel(string);
|
||||
|
||||
void Weapons_SetRightGeomset(string);
|
||||
void Weapons_SetLeftGeomset(string);
|
||||
|
||||
/* compat */
|
||||
void Weapons_SetGeomset(string);
|
||||
void Weapons_SetModel(string);
|
||||
|
||||
void Weapons_Sound(entity, float, string);
|
||||
|
||||
#ifdef CLIENT
|
||||
string Weapons_GetPlayermodel(player, int);
|
||||
void Weapons_HUDPic(player, int, int, vector, float);
|
||||
#endif
|
||||
#else
|
||||
#endif
|
|
@ -1,480 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2022 Vera Visions LLC.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
|
||||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef NEW_INVENTORY
|
||||
var int g_weapon_weights[g_weapons.length];
|
||||
|
||||
#ifdef CLIENT
|
||||
var int g_weapon_order[g_weapons.length];
|
||||
#endif
|
||||
|
||||
void
|
||||
Weapons_Init(void)
|
||||
{
|
||||
/* in the future we'll have no internal weapon table, then this will fill
|
||||
* one up... */
|
||||
/*searchhandle sh;
|
||||
filestream fh;
|
||||
string line;
|
||||
sh = search_begin("scripts/weapon_*.txt", TRUE, TRUE);
|
||||
for (int i = 0; i < search_getsize(sh); i++) {
|
||||
fh = fopen(search_getfilename(sh, i), FILE_READ);
|
||||
if (fh < 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
while ((line = fgets(fh))) {
|
||||
int w = tokenize(line);
|
||||
switch (argv(0)) {
|
||||
case "name":
|
||||
break;
|
||||
case "slot":
|
||||
break;
|
||||
case "slot_pos":
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(fh);
|
||||
}*/
|
||||
|
||||
for (int i = 0; i < g_weapons.length; i++)
|
||||
if (g_weapons[i].precache != __NULL__)
|
||||
g_weapons[i].precache();
|
||||
|
||||
/* check our weapon weights */
|
||||
int max = 0;
|
||||
for (int i = 0; i < g_weapons.length; i++)
|
||||
if (g_weapons[i].weight > max)
|
||||
max = g_weapons[i].weight;
|
||||
|
||||
/* don't bother building the list if we've got no weights */
|
||||
if (max <= 0)
|
||||
return;
|
||||
|
||||
/* position in the weight array */
|
||||
int w = 0;
|
||||
|
||||
/* loop through all weights */
|
||||
for (int b = 0; b <= max; b++) {
|
||||
/* loop through all weapons */
|
||||
for (int i = 0; i < g_weapons.length; i++) {
|
||||
/* if we've found a valid weight, add the weapon to the list */
|
||||
if (g_weapons[i].weight == b) {
|
||||
g_weapon_weights[w] = i;
|
||||
w++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
for (int i = 0; i < g_weapons.length; i++)
|
||||
print(sprintf("Weapon-Weight order: %s, %i\n", g_weapons[g_weapon_weights[i]].name, i));
|
||||
#endif
|
||||
|
||||
#ifdef CLIENT
|
||||
/* build our slot-order table */
|
||||
int st = 0;
|
||||
|
||||
int max_slots = 0;
|
||||
for (int i = 0; i < g_weapons.length; i++)
|
||||
if (g_weapons[i].slot > max_slots)
|
||||
max_slots = g_weapons[i].slot;
|
||||
int max_pos = 0;
|
||||
for (int i = 0; i < g_weapons.length; i++)
|
||||
if (g_weapons[i].slot_pos > max_pos)
|
||||
max_pos = g_weapons[i].slot_pos;
|
||||
|
||||
/* loop through all slots */
|
||||
for (int s = 0; s <= max_slots; s++) {
|
||||
/* loop through all positions */
|
||||
for (int p = 0; p < max_pos; p++) {
|
||||
/* loop through all the weapons */
|
||||
for (int i = 0; i < g_weapons.length; i++) {
|
||||
if (g_weapons[i].slot == s && g_weapons[i].slot_pos == p) {
|
||||
g_weapon_order[st] = i;
|
||||
st++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
for (int i = 0; i < g_weapons.length; i++)
|
||||
print(sprintf("Weapon-List order: %s, %i\n", g_weapons[g_weapon_order[i]].name, i));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_SetLeftModel(string mdl)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
setmodel(pSeat->m_eViewModelL, mdl);
|
||||
setsize(pSeat->m_eViewModelL, [0,0,0], [0,0,0]);
|
||||
pSeat->m_eViewModelL.effects |= EF_NOSHADOW;
|
||||
#endif
|
||||
}
|
||||
void
|
||||
Weapons_SetRightModel(string mdl)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
setmodel(pSeat->m_eViewModel, mdl);
|
||||
setsize(pSeat->m_eViewModel, [0,0,0], [0,0,0]);
|
||||
pSeat->m_eViewModel.effects |= EF_NOSHADOW;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_SetModel(string mdl)
|
||||
{
|
||||
Weapons_SetRightModel(mdl);
|
||||
Weapons_SetLeftModel("");
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_SetRightGeomset(string set)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
setcustomskin(pSeat->m_eViewModel, "", set);
|
||||
#endif
|
||||
}
|
||||
void
|
||||
Weapons_SetLeftGeomset(string set)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
setcustomskin(pSeat->m_eViewModelL, "", set);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_SetGeomset(string set)
|
||||
{
|
||||
Weapons_SetRightGeomset(set);
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_Draw(player pl)
|
||||
{
|
||||
int i = pl.activeweapon;
|
||||
|
||||
/* In case the previous weapon hid the model */
|
||||
Weapons_EnableModel();
|
||||
|
||||
#ifdef CLIENT
|
||||
View_SetMuzzleflash(0);
|
||||
#endif
|
||||
|
||||
pl.w_attack_next = 0.5f;
|
||||
pl.w_idle_next = 2.5f;
|
||||
pl.viewzoom = 1.0f;
|
||||
pl.weapontime = 0.0f;
|
||||
|
||||
/* we're meant to respawn when we're dead, don't unset! */
|
||||
if (pl.health > 0) {
|
||||
pl.think = __NULL__;
|
||||
pl.nextthink = 0.0f;
|
||||
}
|
||||
|
||||
/* make sure this is all wiped */
|
||||
pl.a_ammo1 = pl.a_ammo2 = pl.a_ammo3 = 0;
|
||||
|
||||
if (g_weapons[i].draw != __NULL__)
|
||||
g_weapons[i].draw(pl);
|
||||
|
||||
if (g_weapons[i].updateammo != __NULL__)
|
||||
g_weapons[i].updateammo(pl);
|
||||
|
||||
pl.gflags |= GF_SEMI_TOGGLED;
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_Holster(player pl)
|
||||
{
|
||||
int i = pl.activeweapon;
|
||||
|
||||
if (g_weapons[i].holster != __NULL__)
|
||||
g_weapons[i].holster(pl);
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_Primary(player pl)
|
||||
{
|
||||
int i = pl.activeweapon;
|
||||
|
||||
if (pl.gflags & GF_SEMI_TOGGLED)
|
||||
return;
|
||||
|
||||
if (g_weapons[i].primary != __NULL__)
|
||||
g_weapons[i].primary(pl);
|
||||
|
||||
if (g_weapons[i].updateammo != __NULL__)
|
||||
g_weapons[i].updateammo(pl);
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_AmmoUpdate(entity target)
|
||||
{
|
||||
player pl = (player)target;
|
||||
int i = pl.activeweapon;
|
||||
|
||||
if (g_weapons[i].updateammo != __NULL__)
|
||||
g_weapons[i].updateammo(pl);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_Secondary(player pl)
|
||||
{
|
||||
int i = pl.activeweapon;
|
||||
|
||||
if (g_weapons[i].secondary != __NULL__)
|
||||
g_weapons[i].secondary(pl);
|
||||
|
||||
if (g_weapons[i].updateammo != __NULL__)
|
||||
g_weapons[i].updateammo(pl);
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_Reload(player pl)
|
||||
{
|
||||
int i = pl.activeweapon;
|
||||
|
||||
if (g_weapons[i].reload != __NULL__)
|
||||
g_weapons[i].reload(pl);
|
||||
|
||||
if (g_weapons[i].updateammo != __NULL__)
|
||||
g_weapons[i].updateammo(pl);
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_Release(player pl)
|
||||
{
|
||||
int i = pl.activeweapon;
|
||||
|
||||
if (g_weapons[i].release != __NULL__)
|
||||
g_weapons[i].release(pl);
|
||||
|
||||
pl.gflags &= ~GF_SEMI_TOGGLED;
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_PreDraw(player pl, int thirdperson)
|
||||
{
|
||||
int i = pl.activeweapon;
|
||||
|
||||
if (g_weapons[i].predraw != __NULL__)
|
||||
g_weapons[i].predraw(pl, thirdperson);
|
||||
}
|
||||
|
||||
int
|
||||
Weapons_IsEmpty(player pl, int w)
|
||||
{
|
||||
int r = 0;
|
||||
|
||||
entity oself = self;
|
||||
self = pl;
|
||||
|
||||
if (g_weapons[w].isempty != __NULL__)
|
||||
r = g_weapons[w].isempty(pl);
|
||||
|
||||
self = oself;
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
||||
|
||||
weapontype_t
|
||||
Weapons_GetType(player pl, int w)
|
||||
{
|
||||
weapontype_t r = WPNTYPE_INVALID;
|
||||
|
||||
entity oself = self;
|
||||
self = pl;
|
||||
|
||||
if (g_weapons[w].type != __NULL__)
|
||||
r = g_weapons[w].type(pl);
|
||||
|
||||
self = oself;
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_DrawCrosshair(player pl)
|
||||
{
|
||||
int i = pl.activeweapon;
|
||||
|
||||
if (g_weapons[i].postdraw != __NULL__)
|
||||
g_weapons[i].postdraw(pl);
|
||||
}
|
||||
|
||||
string
|
||||
Weapons_GetWorldmodel(int id)
|
||||
{
|
||||
if (g_weapons[id].wmodel != __NULL__)
|
||||
return g_weapons[id].wmodel();
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
string
|
||||
Weapons_GetPlayermodel(player pl, int id)
|
||||
{
|
||||
if (g_weapons[id].pmodel != __NULL__)
|
||||
return g_weapons[id].pmodel(pl);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
string
|
||||
Weapons_GetDeathmessage(int id)
|
||||
{
|
||||
if (g_weapons[id].deathmsg != __NULL__)
|
||||
return g_weapons[id].deathmsg();
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
float
|
||||
Weapons_GetAim(player pl, int id)
|
||||
{
|
||||
if (g_weapons[id].aimanim != __NULL__)
|
||||
return g_weapons[id].aimanim(pl);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef CLIENT
|
||||
void
|
||||
Weapons_HUDPic(player pl, int id, int s, vector pos, float a)
|
||||
{
|
||||
if (g_weapons[id].hudpic != __NULL__)
|
||||
g_weapons[id].hudpic(pl, s, pos, a);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
Weapons_MakeVectors(player pl)
|
||||
{
|
||||
#ifdef SERVER
|
||||
makevectors(pl.v_angle);
|
||||
#else
|
||||
makevectors(view_angles);
|
||||
#endif
|
||||
}
|
||||
|
||||
vector
|
||||
Weapons_GetCameraPos(player pl)
|
||||
{
|
||||
#ifdef SERVER
|
||||
return (pl.origin + pl.view_ofs);
|
||||
#else
|
||||
return getproperty(VF_ORIGIN);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_ViewAnimation(player pl, int i)
|
||||
{
|
||||
pl.weaponframe = i;
|
||||
pl.weapontime = 0.0f;
|
||||
}
|
||||
|
||||
#ifdef CLIENT
|
||||
int View_GetAnimation(void);
|
||||
#endif
|
||||
|
||||
int
|
||||
Weapons_GetAnimation(player pl)
|
||||
{
|
||||
return pl.weaponframe;
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_ViewPunchAngle(player pl, vector add)
|
||||
{
|
||||
pl.punchangle += add;
|
||||
}
|
||||
|
||||
int
|
||||
Weapons_IsPresent(player pl, int w)
|
||||
{
|
||||
if (pl.g_items & g_weapons[w].id) {
|
||||
return (1);
|
||||
} else {
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_EnableModel(void)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
View_EnableViewmodel();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_DisableModel(void)
|
||||
{
|
||||
#ifdef CLIENT
|
||||
View_DisableViewmodel();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
Weapons_UpdateAmmo
|
||||
|
||||
Sets .a_ammoX fields and clamps them so they can be networked as a single byte.
|
||||
=================
|
||||
*/
|
||||
void
|
||||
Weapons_UpdateAmmo(player pl, int a1, int a2, int a3)
|
||||
{
|
||||
/* no change */
|
||||
if (a1 == -1)
|
||||
a1 = pl.a_ammo1;
|
||||
if (a2 == -1)
|
||||
a2 = pl.a_ammo2;
|
||||
if (a3 == -1)
|
||||
a3 = pl.a_ammo3;
|
||||
|
||||
/* networked as bytes, since we don't need more. Clamp to avoid errors */
|
||||
pl.a_ammo1 = a1;
|
||||
pl.a_ammo2 = a2;
|
||||
pl.a_ammo3 = a3;
|
||||
}
|
||||
|
||||
void
|
||||
Weapons_Sound(entity pl, float channel, string snd)
|
||||
{
|
||||
#if 0
|
||||
#ifdef SERVER
|
||||
float prev = pl.dimension_see;
|
||||
pl.dimension_see=0;
|
||||
Sound_Play(pl, channel, snd);
|
||||
pl.dimension_see = prev;
|
||||
#else
|
||||
/* client side == immediately */
|
||||
Sound_Play(pl, channel, snd);
|
||||
#endif
|
||||
#else
|
||||
#ifdef SERVER
|
||||
Sound_Play(pl, channel, snd);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
1
zpak001.pk3dir/PAK_NAME
Normal file
1
zpak001.pk3dir/PAK_NAME
Normal file
|
@ -0,0 +1 @@
|
|||
package_valve.pk3
|
|
@ -196,12 +196,9 @@ set sk_plr_buckshot3 "5"
|
|||
set sk_plr_crowbar1 "10"
|
||||
set sk_plr_crowbar2 "10"
|
||||
set sk_plr_crowbar3 "10"
|
||||
set sk_plr_egon_narrow1 "6"
|
||||
set sk_plr_egon_narrow2 "6"
|
||||
set sk_plr_egon_narrow3 "6"
|
||||
set sk_plr_egon_wide1 "14"
|
||||
set sk_plr_egon_wide2 "14"
|
||||
set sk_plr_egon_wide3 "14"
|
||||
set sk_plr_egon1 "6"
|
||||
set sk_plr_egon2 "6"
|
||||
set sk_plr_egon3 "6"
|
||||
set sk_plr_gauss1 "20"
|
||||
set sk_plr_gauss2 "20"
|
||||
set sk_plr_gauss3 "20"
|
||||
|
|
BIN
zpak001.pk3dir/csprogs.dat
Normal file
BIN
zpak001.pk3dir/csprogs.dat
Normal file
Binary file not shown.
BIN
zpak001.pk3dir/csprogs.lno
Normal file
BIN
zpak001.pk3dir/csprogs.lno
Normal file
Binary file not shown.
163
zpak001.pk3dir/cvar_defaults.cfg
Normal file
163
zpak001.pk3dir/cvar_defaults.cfg
Normal file
|
@ -0,0 +1,163 @@
|
|||
set ai_debugAlerts "0" // Show prints when AI gets alerted to a position.
|
||||
set ai_debugLogic "0" // Show prints when AI makes decisions regarding thinking.
|
||||
set ai_debugNav "0" // Show prints when AI makes decisions regarding navigation.
|
||||
set ai_debugScripts "0" // Show prints when AI interacts with scripted sequences.
|
||||
set ai_runSpeed "320" // Default run speed chosen by AI characters, in units per second.
|
||||
set ai_walkSpeed "150" // Default walk speed chosen by AI characters, in units per second.
|
||||
|
||||
set bot_aimless
|
||||
set bot_backspeed
|
||||
set bot_crouch
|
||||
set bot_debug
|
||||
set bot_developer
|
||||
set bot_dont_shoot
|
||||
set bot_enable
|
||||
set bot_fastChat
|
||||
set bot_forwardspeed
|
||||
set bot_minClients
|
||||
set bot_noChat
|
||||
set bot_pause
|
||||
set bot_prefix
|
||||
set bot_prone
|
||||
set bot_sidespeed
|
||||
set bot_skill
|
||||
set bot_walk
|
||||
|
||||
set cg_chatEnabled
|
||||
set cg_damageShake
|
||||
set cg_hudAspect
|
||||
set cg_muzzleDLight
|
||||
set cg_muzzleDLightColor
|
||||
set cg_viewZSmoothingMax
|
||||
set cg_viewZSmoothingMin
|
||||
set cg_viewZSmoothingTime
|
||||
set cg_viewmodelFlip
|
||||
set cg_viewmodelFov
|
||||
set cg_viewmodelLag
|
||||
set cg_viewmodelOffset
|
||||
set cg_viewmodelPass
|
||||
set cg_viewmodelScale
|
||||
|
||||
set chatplug_filter
|
||||
|
||||
set cl_backspeed
|
||||
set cl_decals
|
||||
set cl_forwardspeed
|
||||
set cl_musicstyle
|
||||
set cl_sidespeed
|
||||
|
||||
set con_color
|
||||
|
||||
set dev_cornerspeed
|
||||
set dev_loddistance
|
||||
set dev_rotspeed
|
||||
set dev_skyscale
|
||||
|
||||
set dsp_soundscapes "1"
|
||||
|
||||
set g_developer "0" // Show debug messages from the game-logic.
|
||||
set g_developerTimestamps "0"
|
||||
set g_gravity "800" // Global gravity setting.
|
||||
|
||||
set in_zoomSensitivity "1.0" // Input sensitivity multiplier for when you're zoomed in.
|
||||
|
||||
set logging_enabled "0" // Enable server-side logging for game specific events.
|
||||
|
||||
set menu_helptext_size "11"
|
||||
set menu_intro "1"
|
||||
set menu_steambg "0"
|
||||
set menu_updating "0"
|
||||
|
||||
set motdfile "motd.txt"
|
||||
|
||||
set mp_allowvote "1"
|
||||
set mp_decals "128"
|
||||
set mp_flashlight "1"
|
||||
set mp_td_dmgToKick "300"
|
||||
set mp_td_dmgToWarn "200"
|
||||
|
||||
set nav_linksize "256"
|
||||
set nav_radius "32"
|
||||
|
||||
set phys_developer "0" // Shows debug prints regarding physics operations when set.
|
||||
set phys_impactforcescale "100"
|
||||
set phys_pushscale "1"
|
||||
|
||||
set pm_accelerate "10"
|
||||
set pm_airaccelerate "10"
|
||||
set pm_airstepsize "0"
|
||||
set pm_boxcenter "1"
|
||||
set pm_boxwidth "32"
|
||||
set pm_crouchheight "36"
|
||||
set pm_crouchspeed "90"
|
||||
set pm_crouchviewheight "30"
|
||||
set pm_edgefriction "1"
|
||||
set pm_friction "4"
|
||||
set pm_gravity "800"
|
||||
set pm_jumpheight "265"
|
||||
set pm_maxviewpitch "89"
|
||||
set pm_minviewpitch "-89"
|
||||
set pm_noclipaccelerate "5"
|
||||
set pm_noclipspeed "500"
|
||||
set pm_normalheight "72"
|
||||
set pm_normalviewheight "64"
|
||||
set pm_nospeedcap "0"
|
||||
set pm_proneheight "0"
|
||||
set pm_pronespeed "40.5"
|
||||
set pm_proneviewheight "16"
|
||||
set pm_runspeed "0"
|
||||
set pm_stairSmoothing "1"
|
||||
set pm_stamina "24"
|
||||
set pm_staminarate "0.75"
|
||||
set pm_staminathreshold "4"
|
||||
set pm_stepsize "18"
|
||||
set pm_stopspeed "100"
|
||||
set pm_thirdPerson "0"
|
||||
set pm_walkspeed "270"
|
||||
set pm_wateraccelerate "10"
|
||||
set pm_waterjumpheight "350"
|
||||
|
||||
set r_autoscale "1" // When set, will ensure the game is at 640x480 type scaling.
|
||||
set r_drawdecals "1" // Shows decal entities managed by the game when set.
|
||||
set r_pixelscale "1" // ???
|
||||
set r_renderEntityInfo "0"
|
||||
set r_showDlights "0"
|
||||
set r_showPhysicsInfo "0"
|
||||
set r_skipGlows "0"
|
||||
set r_skipLensFlares "0"
|
||||
set r_skipWorld "0"
|
||||
|
||||
set rm_unlit_additive "1" // Render entities with the 'additive' rendermode fullbright.
|
||||
set rm_unlit_texture "1" // Render entities with the 'texture' rendermode fullbright.
|
||||
|
||||
set rope_debug "0" // Shows primitive debug rendering of a rope when set.
|
||||
set rope_fast "1" // Don't perform expensive calculations on the rope when set.
|
||||
set rope_maxsegments "-1" // Limit rope segments. -1 means no limit.
|
||||
set rope_sag "2" // Rope sagging multiplier.
|
||||
set rope_swing "2" // Rope swinging multiplier.
|
||||
|
||||
set s_developer "0" // Show debug prints related to the sound system.
|
||||
|
||||
set sp_decals "128"
|
||||
|
||||
set sv_friendlyFire "0" // Team-inflicted damage is possible when set.
|
||||
set sv_levelexec "1" // Will search and execute `<gamedir>/maps/currentmap.cfg` when set.
|
||||
set sv_plugins "1" // Enable the use of server-side plugins when set.
|
||||
|
||||
set vehicle_developer "0" // Shows vehicle related debug prints when set.
|
||||
|
||||
set vgui_color "255 170 0"
// Default primary color for VGUI widgets.
|
||||
|
||||
set vid_brightness "0" // Controls display brightness.
|
||||
set vid_gamma "1" // Controls gamma level.
|
||||
set vid_desktopgamma "0"
|
||||
set vid_hardwaregamma "2"
|
||||
|
||||
set violence_ablood "1" // Enable alien blood.
|
||||
set violence_agibs "1" // Enable alien gibs.
|
||||
set violence_hblood "1" // Enable human blood.
|
||||
set violence_hgibs "1" // Enable human giblets.
|
||||
|
||||
set xr_roomScale "1.0" // XR: Room scale multiplier.
|
||||
set xr_testInputs "0" // XR: Enable fake inputs, to debug the VR camera and weapon inputs.
|
||||
set xr_viewHeight "-48" // XR: Default view-height offset.
|
59
zpak001.pk3dir/def/ammo.def
Normal file
59
zpak001.pk3dir/def/ammo.def
Normal file
|
@ -0,0 +1,59 @@
|
|||
#include "ammo/base.def"
|
||||
#include "ammo/buckshot.def"
|
||||
#include "ammo/357.def"
|
||||
#include "ammo/9mmAR.def"
|
||||
#include "ammo/9mmbox.def"
|
||||
#include "ammo/rpgclip.def"
|
||||
#include "ammo/ARgrenades.def"
|
||||
#include "ammo/9mmclip.def"
|
||||
#include "ammo/crossbow.def"
|
||||
#include "ammo/gaussclip.def"
|
||||
|
||||
// these have to be defined by the game.
|
||||
entityDef ammo_types {
|
||||
"ammo_none" "0"
|
||||
"ammo_9mm" "1"
|
||||
"ammo_357" "2"
|
||||
"ammo_buckshot" "3"
|
||||
"ammo_bolt" "4"
|
||||
"ammo_rocket" "5"
|
||||
"ammo_uranium" "6"
|
||||
"ammo_handgrenade" "7"
|
||||
"ammo_satchel" "8"
|
||||
"ammo_tripmine" "9"
|
||||
"ammo_snark" "10"
|
||||
"ammo_hornet" "11"
|
||||
"ammo_m203_grenade" "12"
|
||||
}
|
||||
|
||||
entityDef ammo_names {
|
||||
"ammo_none" "None"
|
||||
"ammo_9mm" "9mm Bullets"
|
||||
"ammo_357" ".357 Bullets"
|
||||
"ammo_buckshot" "Buckshot Shells"
|
||||
"ammo_bolt" "Bolts"
|
||||
"ammo_rocket" "Rockets"
|
||||
"ammo_uranium" "Uranium"
|
||||
"ammo_handgrenade" "Hand Grenades"
|
||||
"ammo_satchel" "Satchel Charge"
|
||||
"ammo_tripmine" "Tripmines"
|
||||
"ammo_snark" "Squeak Grenades"
|
||||
"ammo_hornet" "Hornets"
|
||||
"ammo_m203_grenade" "M203 Grenades"
|
||||
}
|
||||
|
||||
entityDef ammo_max {
|
||||
"ammo_none" "0"
|
||||
"ammo_9mm" "250"
|
||||
"ammo_357" "36"
|
||||
"ammo_buckshot" "125"
|
||||
"ammo_bolt" "50"
|
||||
"ammo_rocket" "5"
|
||||
"ammo_uranium" "100"
|
||||
"ammo_handgrenade" "10"
|
||||
"ammo_satchel" "5"
|
||||
"ammo_tripmine" "10"
|
||||
"ammo_snark" "10"
|
||||
"ammo_hornet" "8"
|
||||
"ammo_m203_grenade" "10"
|
||||
}
|
6
zpak001.pk3dir/def/ammo/357.def
Normal file
6
zpak001.pk3dir/def/ammo/357.def
Normal file
|
@ -0,0 +1,6 @@
|
|||
entityDef ammo_357
|
||||
{
|
||||
"inherit" "ammo_base"
|
||||
"model" "models/w_357ammobox.mdl"
|
||||
"inv_ammo_357" "6"
|
||||
}
|
6
zpak001.pk3dir/def/ammo/9mmAR.def
Normal file
6
zpak001.pk3dir/def/ammo/9mmAR.def
Normal file
|
@ -0,0 +1,6 @@
|
|||
entityDef ammo_9mmAR
|
||||
{
|
||||
"inherit" "ammo_base"
|
||||
"model" "models/w_9mmarclip.mdl"
|
||||
"inv_ammo_9mm" "50"
|
||||
}
|
6
zpak001.pk3dir/def/ammo/9mmbox.def
Normal file
6
zpak001.pk3dir/def/ammo/9mmbox.def
Normal file
|
@ -0,0 +1,6 @@
|
|||
entityDef ammo_9mmbox
|
||||
{
|
||||
"inherit" "ammo_base"
|
||||
"model" "models/w_chainammo.mdl"
|
||||
"inv_ammo_9mm" "200"
|
||||
}
|
6
zpak001.pk3dir/def/ammo/9mmclip.def
Normal file
6
zpak001.pk3dir/def/ammo/9mmclip.def
Normal file
|
@ -0,0 +1,6 @@
|
|||
entityDef ammo_9mmclip
|
||||
{
|
||||
"inherit" "ammo_base"
|
||||
"model" "models/w_9mmclip.mdl"
|
||||
"inv_ammo_9mm" "17"
|
||||
}
|
6
zpak001.pk3dir/def/ammo/ARgrenades.def
Normal file
6
zpak001.pk3dir/def/ammo/ARgrenades.def
Normal file
|
@ -0,0 +1,6 @@
|
|||
entityDef ammo_ARgrenades
|
||||
{
|
||||
"inherit" "ammo_base"
|
||||
"model" "models/w_argrenade.mdl"
|
||||
"inv_ammo_m203_grenade" "2"
|
||||
}
|
8
zpak001.pk3dir/def/ammo/base.def
Normal file
8
zpak001.pk3dir/def/ammo/base.def
Normal file
|
@ -0,0 +1,8 @@
|
|||
entityDef ammo_base
|
||||
{
|
||||
"spawnclass" "NSItem"
|
||||
"snd_acquire" "ammo.pickup"
|
||||
"snd_respawn" "ammo.respawn"
|
||||
"mins" "-16 -16 0"
|
||||
"maxs" "16 16 16"
|
||||
}
|
6
zpak001.pk3dir/def/ammo/buckshot.def
Normal file
6
zpak001.pk3dir/def/ammo/buckshot.def
Normal file
|
@ -0,0 +1,6 @@
|
|||
entityDef ammo_buckshot
|
||||
{
|
||||
"inherit" "ammo_base"
|
||||
"model" "models/w_shotbox.mdl"
|
||||
"inv_ammo_buckshot" "12"
|
||||
}
|
6
zpak001.pk3dir/def/ammo/crossbow.def
Normal file
6
zpak001.pk3dir/def/ammo/crossbow.def
Normal file
|
@ -0,0 +1,6 @@
|
|||
entityDef ammo_crossbow
|
||||
{
|
||||
"inherit" "ammo_base"
|
||||
"model" "models/w_crossbow_clip.mdl"
|
||||
"inv_ammo_bolt" "5"
|
||||
}
|
6
zpak001.pk3dir/def/ammo/gaussclip.def
Normal file
6
zpak001.pk3dir/def/ammo/gaussclip.def
Normal file
|
@ -0,0 +1,6 @@
|
|||
entityDef ammo_gaussclip
|
||||
{
|
||||
"inherit" "ammo_base"
|
||||
"model" "models/w_gaussammo.mdl"
|
||||
"inv_ammo_uranium" "20"
|
||||
}
|
6
zpak001.pk3dir/def/ammo/rpgclip.def
Normal file
6
zpak001.pk3dir/def/ammo/rpgclip.def
Normal file
|
@ -0,0 +1,6 @@
|
|||
entityDef ammo_rpgclip
|
||||
{
|
||||
"inherit" "ammo_base"
|
||||
"model" "models/w_rpgammo.mdl"
|
||||
"inv_ammo_uranium" "1"
|
||||
}
|
33
zpak001.pk3dir/def/items.def
Normal file
33
zpak001.pk3dir/def/items.def
Normal file
|
@ -0,0 +1,33 @@
|
|||
entityDef item_battery
|
||||
{
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_battery.mdl"
|
||||
"mins" "-16 -16 0"
|
||||
"maxs" "16 16 16"
|
||||
"snd_acquire" "item.battery"
|
||||
"snd_respawn" "item.respawn"
|
||||
"inv_armor" "skill:battery"
|
||||
"requires" "item_suit"
|
||||
}
|
||||
|
||||
entityDef item_healthkit
|
||||
{
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_medkit.mdl"
|
||||
"mins" "-16 -16 0"
|
||||
"maxs" "16 16 16"
|
||||
"snd_acquire" "item.healthkit"
|
||||
"snd_respawn" "item.respawn"
|
||||
"inv_health" "skill:healthkit"
|
||||
}
|
||||
|
||||
entityDef item_suit
|
||||
{
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_suit.mdl"
|
||||
"mins" "-16 -16 0"
|
||||
"maxs" "16 16 16"
|
||||
"snd_acquire" "item.suit"
|
||||
"snd_respawn" "item.respawn"
|
||||
"inv_carry" "1"
|
||||
}
|
|
@ -1,35 +1,36 @@
|
|||
include "monsters/alien_controller.def"
|
||||
include "monsters/alien_grunt.def"
|
||||
include "monsters/alien_slave.def"
|
||||
include "monsters/apache.def"
|
||||
include "monsters/babycrab.def"
|
||||
include "monsters/barnacle.def"
|
||||
include "monsters/barney.def"
|
||||
include "monsters/barney_dead.def"
|
||||
include "monsters/bigmomma.def"
|
||||
include "monsters/bloater.def"
|
||||
include "monsters/bullchicken.def"
|
||||
include "monsters/cockroach.def"
|
||||
include "monsters/flyer_flock.def"
|
||||
include "monsters/gargantua.def"
|
||||
include "monsters/gman.def"
|
||||
include "monsters/headcrab.def"
|
||||
include "monsters/hevsuit_dead.def"
|
||||
include "monsters/hgrunt_dead.def"
|
||||
include "monsters/houndeye.def"
|
||||
include "monsters/human_assassin.def"
|
||||
include "monsters/human_grunt.def"
|
||||
include "monsters/ichthyosaur.def"
|
||||
include "monsters/leech.def"
|
||||
include "monsters/miniturret.def"
|
||||
include "monsters/nihilanth.def"
|
||||
include "monsters/osprey.def"
|
||||
include "monsters/rat.def"
|
||||
include "monsters/scientist.def"
|
||||
include "monsters/scientist_dead.def"
|
||||
include "monsters/sentry.def"
|
||||
include "monsters/sitting_scientist.def"
|
||||
include "monsters/skeleton_dead.def"
|
||||
include "monsters/tentacle.def"
|
||||
include "monsters/turret.def"
|
||||
include "monsters/zombie.def"
|
||||
#include "monsters/alien_controller.def"
|
||||
#include "monsters/alien_grunt.def"
|
||||
#include "monsters/alien_slave.def"
|
||||
#include "monsters/apache.def"
|
||||
#include "monsters/babycrab.def"
|
||||
#include "monsters/barnacle.def"
|
||||
#include "monsters/barney.def"
|
||||
#include "monsters/barney_dead.def"
|
||||
#include "monsters/bigmomma.def"
|
||||
#include "monsters/bloater.def"
|
||||
#include "monsters/bullchicken.def"
|
||||
#include "monsters/cockroach.def"
|
||||
#include "monsters/flyer_flock.def"
|
||||
#include "monsters/gargantua.def"
|
||||
#include "monsters/gman.def"
|
||||
#include "monsters/headcrab.def"
|
||||
#include "monsters/hevsuit_dead.def"
|
||||
#include "monsters/hgrunt_dead.def"
|
||||
#include "monsters/houndeye.def"
|
||||
#include "monsters/human_assassin.def"
|
||||
#include "monsters/human_grunt.def"
|
||||
#include "monsters/ichthyosaur.def"
|
||||
#include "monsters/leech.def"
|
||||
#include "monsters/miniturret.def"
|
||||
#include "monsters/nihilanth.def"
|
||||
#include "monsters/osprey.def"
|
||||
#include "monsters/rat.def"
|
||||
#include "monsters/scientist.def"
|
||||
#include "monsters/scientist_dead.def"
|
||||
#include "monsters/sentry.def"
|
||||
#include "monsters/sitting_scientist.def"
|
||||
#include "monsters/skeleton_dead.def"
|
||||
#include "monsters/tentacle.def"
|
||||
#include "monsters/tripmine.def"
|
||||
#include "monsters/turret.def"
|
||||
#include "monsters/zombie.def"
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
entityDef monster_miniturret
|
||||
{
|
||||
"spawnclass" "NSTalkMonster"
|
||||
"model" "models/miniturret.mdl"
|
||||
"netname" "Mini-Turret"
|
||||
"health" "skill:miniturret_health"
|
||||
"mins" "-16 -16 0"
|
||||
"maxs" "16 16 16"
|
||||
"model" "models/miniturret.mdl"
|
||||
"netname" "Mini-Turret"
|
||||
"health" "skill:miniturret_health"
|
||||
"mins" "-16 -16 0"
|
||||
"maxs" "16 16 16"
|
||||
"eye_height" "64"
|
||||
"team" "2"
|
||||
"propdata" "actor_robot"
|
||||
"team" "2"
|
||||
"propdata" "actor_robot"
|
||||
|
||||
"speed_walk" "0"
|
||||
"speed_run" "0"
|
||||
}
|
||||
"speed_run" "0"
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ entityDef monster_scientist
|
|||
"talk_deny_follow" "!SC_POK"
|
||||
|
||||
// Body Types
|
||||
|
||||
when "body" equals "0" {
|
||||
"pitch" "105"
|
||||
"netname" "Walter"
|
||||
|
|
30
zpak001.pk3dir/def/monsters/snark.def
Normal file
30
zpak001.pk3dir/def/monsters/snark.def
Normal file
|
@ -0,0 +1,30 @@
|
|||
entityDef monster_snark
|
||||
{
|
||||
"spawnclass" "NSMonster"
|
||||
"model" "models/w_squeak.mdl"
|
||||
"netname" "Snark"
|
||||
"health" "skill:snark_health"
|
||||
"mins" "-16 -16 0"
|
||||
"maxs" "16 16 72"
|
||||
"eye_height" "12"
|
||||
"team" "2"
|
||||
"propdata" "actor_alien"
|
||||
"speed_walk" "32"
|
||||
"speed_run" "72"
|
||||
|
||||
"attack_ranged_range" "180" // needs launch attack
|
||||
|
||||
"snd_idle" "monster_snark.idle"
|
||||
"snd_pain" "monster_snark.pain"
|
||||
"snd_death" "monster_snark.death"
|
||||
"leap_damage" "skill:snark_dmg_bite"
|
||||
|
||||
events {
|
||||
jump "AddVelocity" "512 0 250"
|
||||
jump "StartSoundDef" "monster_snark.attack"
|
||||
jump_variation1 "AddVelocity" "512 0 350"
|
||||
jump_variation1 "StartSoundDef" "monster_snark.attack"
|
||||
jump_variation2 "AddVelocity" "512 0 350"
|
||||
jump_variation2 "StartSoundDef" "monster_snark.attack"
|
||||
}
|
||||
}
|
5
zpak001.pk3dir/def/monsters/tripmine.def
Normal file
5
zpak001.pk3dir/def/monsters/tripmine.def
Normal file
|
@ -0,0 +1,5 @@
|
|||
entityDef monster_tripmine
|
||||
{
|
||||
"spawnclass" "HLTripmine"
|
||||
"snd_activate" "weapon_tripmine.activate"
|
||||
}
|
4
zpak001.pk3dir/def/player.def
Normal file
4
zpak001.pk3dir/def/player.def
Normal file
|
@ -0,0 +1,4 @@
|
|||
entityDef player
|
||||
{
|
||||
"spawnclass" "HLPlayer"
|
||||
}
|
15
zpak001.pk3dir/def/projectiles.def
Normal file
15
zpak001.pk3dir/def/projectiles.def
Normal file
|
@ -0,0 +1,15 @@
|
|||
entityDef projectile_bullet_base
|
||||
{
|
||||
"spawnclass" "NSProjectile"
|
||||
"is_bullet" "1"
|
||||
"decal_impact" "Impact.BigShot"
|
||||
"detonate_on_world" "1"
|
||||
}
|
||||
|
||||
entityDef projectile_egonbeam
|
||||
{
|
||||
"spawnclass" "NSProjectile"
|
||||
"is_bullet" "1"
|
||||
"damage" "skill:plr_egon"
|
||||
"detonate_on_world" "0"
|
||||
}
|
26
zpak001.pk3dir/def/spawns.def
Normal file
26
zpak001.pk3dir/def/spawns.def
Normal file
|
@ -0,0 +1,26 @@
|
|||
entityDef info_player_start
|
||||
{
|
||||
"editor_mins" "-16 -16 -36"
|
||||
"editor_maxs" "16 16 36"
|
||||
"editor_description" "Singleplayer Spawn Point"
|
||||
"editor_color" "1 0 0"
|
||||
"spawnclass" "NSSpawnPoint"
|
||||
}
|
||||
|
||||
entityDef info_player_deathmatch
|
||||
{
|
||||
"editor_mins" "-16 -16 -36"
|
||||
"editor_maxs" "16 16 36"
|
||||
"editor_description" "Deathmatch Spawn Point"
|
||||
"editor_color" "1 0 0"
|
||||
"spawnclass" "NSSpawnPoint"
|
||||
}
|
||||
|
||||
entityDef info_player_coop
|
||||
{
|
||||
"editor_mins" "-16 -16 -36"
|
||||
"editor_maxs" "16 16 36"
|
||||
"editor_description" "Cooperative Spawn Point"
|
||||
"editor_color" "1 0 0"
|
||||
"spawnclass" "NSSpawnPoint"
|
||||
}
|
|
@ -1,14 +1,14 @@
|
|||
include "weapons/357.def"
|
||||
include "weapons/9mmAR.def"
|
||||
include "weapons/9mmhandgun.def"
|
||||
include "weapons/crossbow.def"
|
||||
include "weapons/crowbar.def"
|
||||
include "weapons/egon.def"
|
||||
include "weapons/gauss.def"
|
||||
include "weapons/handgrenade.def"
|
||||
include "weapons/hornetgun.def"
|
||||
include "weapons/rpg.def"
|
||||
include "weapons/satchel.def"
|
||||
include "weapons/shotgun.def"
|
||||
include "weapons/snark.def"
|
||||
include "weapons/tripmine.def"
|
||||
#include "weapons/357.def"
|
||||
#include "weapons/9mmAR.def"
|
||||
#include "weapons/9mmhandgun.def"
|
||||
#include "weapons/crossbow.def"
|
||||
#include "weapons/crowbar.def"
|
||||
#include "weapons/egon.def"
|
||||
#include "weapons/gauss.def"
|
||||
#include "weapons/handgrenade.def"
|
||||
#include "weapons/hornetgun.def"
|
||||
#include "weapons/rpg.def"
|
||||
#include "weapons/satchel.def"
|
||||
#include "weapons/shotgun.def"
|
||||
#include "weapons/snark.def"
|
||||
#include "weapons/tripmine.def"
|
||||
|
|
|
@ -1,19 +1,56 @@
|
|||
entityDef weapon_357
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" ".367 Revolver"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_357.mdl"
|
||||
"inv_item" "$WEAPON_PYTHON"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" ".357 Revolver"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_357.mdl"
|
||||
"model_view" "models/v_357.mdl"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
|
||||
// weapon specific
|
||||
"def_fireInfo" "fireInfo_357"
|
||||
"inv_name" ".357 Revolver"
|
||||
"clipSize" "6"
|
||||
|
||||
"actFire" "2"
|
||||
"actHolster" "4"
|
||||
"actReload" "3"
|
||||
"actDraw" "5"
|
||||
"actIdle" "0,1,6,7"
|
||||
|
||||
"snd_fire" "weapon_357.shoot"
|
||||
"snd_empty" "weapon_357.empty"
|
||||
"snd_reload" "weapon_357.reload"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "1"
|
||||
"hudSlotPos" "1"
|
||||
"weight" "15"
|
||||
}
|
||||
|
||||
entityDef weapon_python
|
||||
{
|
||||
"spawnclass" "weapon_357"
|
||||
}
|
||||
}
|
||||
|
||||
entityDef projectile_357
|
||||
{
|
||||
"inherit" "projectile_bullet_base"
|
||||
"damage" "skill:plr_357_bullet"
|
||||
}
|
||||
|
||||
entityDef fireInfo_357
|
||||
{
|
||||
"def_onFire" "projectile_357"
|
||||
"ammoType" "ammo_357"
|
||||
"ammoRequired" "1"
|
||||
"ammoPerShot" "1"
|
||||
"fireRate" ".75"
|
||||
"punchAngle" "-10 0 0"
|
||||
"model_flash" "sprites/muzzleflash2.spr"
|
||||
}
|
||||
|
|
|
@ -1,21 +1,67 @@
|
|||
entityDef weapon_9mmAR
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "9mm AR"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_9mmAR.mdl"
|
||||
"inv_item" "$WEAPON_MP5"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "9mm AR"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_9mmAR.mdl"
|
||||
"model_view" "models/v_9mmAR.mdl"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
|
||||
// NSWeapon specific
|
||||
"def_fireInfo" "fireInfo_9mmAR"
|
||||
"def_altFireInfo" "fireInfo_ARGrenade"
|
||||
"inv_name" "9mm AR"
|
||||
"clipSize" "50"
|
||||
"clipSizeDefault" "25"
|
||||
|
||||
"actFire" "5,6,7"
|
||||
"actHolster" "4"
|
||||
"actReload" "3"
|
||||
"actDraw" "4"
|
||||
"actIdle" "0,1"
|
||||
|
||||
"snd_fire" "weapon_mp5.shoot"
|
||||
"snd_empty" "weapon_mp5.empty"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "2"
|
||||
"hudSlotPos" "0"
|
||||
"weight" "15"
|
||||
}
|
||||
|
||||
entityDef weapon_mp5
|
||||
entityDef projectile_9mmAR
|
||||
{
|
||||
"spawnclass" "weapon_9mmAR"
|
||||
"inherit" "projectile_bullet_base"
|
||||
"damage" "skill:plr_9mmAR_bullet"
|
||||
"spread" "0.025 0.025"
|
||||
}
|
||||
|
||||
entityDef fireInfo_9mmAR
|
||||
{
|
||||
"def_onFire" "projectile_9mmAR"
|
||||
"ammoType" "ammo_9mm"
|
||||
"ammoRequired" "1"
|
||||
"ammoPerShot" "1"
|
||||
"fireRate" "0.085"
|
||||
"punchAngle" "-2 0 0"
|
||||
"model_flash" "sprites/muzzleflash1.spr"
|
||||
}
|
||||
|
||||
entityDef fireInfo_ARGrenade
|
||||
{
|
||||
"def_onFire" "projectile_ARgrenade"
|
||||
"ammoType" "ammo_m203_grenade"
|
||||
"ammoRequired" "1"
|
||||
"ammoPerShot" "1"
|
||||
"fireRate" "1"
|
||||
"punchAngle" "-10 0 0"
|
||||
"snd_fire" "weapon_mp5.gl"
|
||||
"actFire" "2"
|
||||
}
|
||||
|
||||
entityDef projectile_ARgrenade
|
||||
|
@ -33,23 +79,47 @@ entityDef projectile_ARgrenade
|
|||
"detonate_on_death" "1"
|
||||
"detonate_on_world" "1"
|
||||
"detonate_on_actor" "1"
|
||||
"snd_explode" "fx.explosion"
|
||||
"snd_explode" "fx.explosion"
|
||||
"model_detonate" "fx_explosion.main"
|
||||
"decal_detonate" "ExplosionScorch"
|
||||
"smoke_fly" "weapon_9mmAR.nadetrail"
|
||||
|
||||
"def_damage" "damage_ARgrneadeDirect"
|
||||
"def_splash_damage" "damage_ARgrneadeSplash"
|
||||
"def_damage" "damage_ARgrenadeDirect"
|
||||
"def_splash_damage" "damage_ARgrenadeSplash"
|
||||
}
|
||||
|
||||
|
||||
entityDef damage_ARgrneadeDirect
|
||||
entityDef damage_ARgrenadeDirect
|
||||
{
|
||||
"damage" "50"
|
||||
}
|
||||
|
||||
entityDef damage_ARgrneadeSplash
|
||||
entityDef damage_ARgrenadeSplash
|
||||
{
|
||||
"damage" "skill:plr_9mmAR_grenade"
|
||||
"radius" "160"
|
||||
}
|
||||
}
|
||||
|
||||
// multiplayer version
|
||||
entityDef projectile_9mmAR_mp
|
||||
{
|
||||
"inherit" "projectile_bullet_base"
|
||||
"damage" "skill:plr_9mmAR_bullet"
|
||||
"spread" "0.5 0.5"
|
||||
}
|
||||
|
||||
entityDef fireInfo_9mmAR_mp
|
||||
{
|
||||
"def_onFire" "projectile_9mmAR_mp"
|
||||
"ammoType" "ammo_9mm"
|
||||
"ammoRequired" "1"
|
||||
"ammoPerShot" "1"
|
||||
"fireRate" "0.085"
|
||||
"punchAngle" "-2 0 0"
|
||||
"model_flash" "sprites/muzzleflash1.spr"
|
||||
}
|
||||
|
||||
entityDef weapon_9mmAR_mp
|
||||
{
|
||||
"inherit" "weapon_9mmAR"
|
||||
"def_fireInfo" "fireInfo_9mmAR_mp"
|
||||
}
|
||||
|
|
|
@ -1,19 +1,71 @@
|
|||
entityDef weapon_9mmhandgun
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "9mm Handgun"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_9mmhandgun.mdl"
|
||||
"inv_item" "$WEAPON_GLOCK"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "9mm Handgun"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_9mmhandgun.mdl"
|
||||
"model_view" "models/v_9mmhandgun.mdl"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
|
||||
// weapon specific
|
||||
"def_fireInfo" "fireInfo_glock"
|
||||
"def_altFireInfo" "fireInfo_altGlock"
|
||||
"inv_name" "9mm Handgun"
|
||||
"clipSize" "17"
|
||||
"ammoType" "ammo_9mm"
|
||||
"ammoRequired" "1"
|
||||
"ammoPerShot" "1"
|
||||
"punchAngle" "-2 0 0"
|
||||
|
||||
"actFire" "3"
|
||||
"actAltFire" "3"
|
||||
"actFireLast" "4"
|
||||
"actAltFireLast" "4"
|
||||
"actHolster" "8"
|
||||
"actReload" "6"
|
||||
"actReloadEmpty" "5"
|
||||
"actDraw" "7"
|
||||
"actIdle" "0,1,2"
|
||||
|
||||
"snd_fire" "weapon_glock.fire"
|
||||
"snd_altfire" "weapon_glock.fire"
|
||||
"snd_empty" "weapon_glock.empty"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "1"
|
||||
"hudSlotPos" "0"
|
||||
"weight" "10"
|
||||
}
|
||||
|
||||
entityDef weapon_glock
|
||||
entityDef projectile_glock
|
||||
{
|
||||
"spawnclass" "weapon_9mmhandgun"
|
||||
}
|
||||
"inherit" "projectile_bullet_base"
|
||||
"damage" "skill:plr_9mm_bullet"
|
||||
"spread" "0.01 0.01"
|
||||
}
|
||||
|
||||
entityDef projectile_glock_fast
|
||||
{
|
||||
"inherit" "projectile_bullet_base"
|
||||
"damage" "skill:plr_9mm_bullet"
|
||||
"spread" "0.1 0.1"
|
||||
}
|
||||
|
||||
entityDef fireInfo_glock
|
||||
{
|
||||
"def_onFire" "projectile_glock"
|
||||
"fireRate" ".3"
|
||||
"model_flash" "sprites/muzzleflash2.spr"
|
||||
}
|
||||
|
||||
entityDef fireInfo_altGlock
|
||||
{
|
||||
"def_onFire" "projectile_glock_fast"
|
||||
"fireRate" ".2"
|
||||
"model_flash" "sprites/muzzleflash2.spr"
|
||||
}
|
||||
|
|
|
@ -1,16 +1,57 @@
|
|||
entityDef weapon_crossbow
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Crossbow"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_crossbow.mdl"
|
||||
"inv_item" "$WEAPON_CROSSBOW"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Crossbow"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_crossbow.mdl"
|
||||
"model_view" "models/v_crossbow.mdl"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
|
||||
// weapon specific
|
||||
"def_fireInfo" "fireInfo_crossbow"
|
||||
"inv_name" "Crossbow"
|
||||
"clipSize" "5"
|
||||
|
||||
"actFire" "4"
|
||||
"actFireLast" "6"
|
||||
"actHolster" "10"
|
||||
"actHolsterEmpty" "11"
|
||||
"actReload" "7"
|
||||
"actDraw" "8"
|
||||
"actDrawEmpty" "9"
|
||||
"actIdle" "0,2"
|
||||
"actIdleEmpty" "1,3"
|
||||
|
||||
"snd_fire" "weapon_crossbow.fire"
|
||||
"snd_empty" "weapon_crossbow.empty"
|
||||
"snd_reload" "weapon_crossbow.reload"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "2"
|
||||
"hudSlotPos" "2"
|
||||
"weight" "10"
|
||||
"zoomFov" "18"
|
||||
}
|
||||
|
||||
entityDef fireInfo_crossbow
|
||||
{
|
||||
"def_onFire" "projectile_arrow"
|
||||
"ammoType" "ammo_bolt"
|
||||
"ammoRequired" "1"
|
||||
"ammoPerShot" "1"
|
||||
"fireRate" "1.0"
|
||||
"punchAngle" "-2 0 0"
|
||||
}
|
||||
|
||||
entityDef debris_arrow
|
||||
{
|
||||
"spawnclass" "NSProjectile"
|
||||
"model" "models/crossbow_bolt.mdl"
|
||||
}
|
||||
|
||||
entityDef projectile_arrow
|
||||
|
@ -21,13 +62,17 @@ entityDef projectile_arrow
|
|||
"angular_velocity" "0 0 20"
|
||||
"mins" "0 0 0"
|
||||
"maxs" "0 0 0"
|
||||
"def_damage" "damage_arrowDirect"
|
||||
"def_damage" "damage_arrowDirect"
|
||||
"model_detonate" "fx_spark.main"
|
||||
"snd_explode" "fx.spark"
|
||||
"snd_explode" "fx.spark"
|
||||
"detonate_on_fuse" "0"
|
||||
"detonate_on_death" "1"
|
||||
"detonate_on_world" "1"
|
||||
"detonate_on_actor" "1"
|
||||
"projectile_debris" "debris_arrow"
|
||||
"debris_count" "1"
|
||||
"debris_stick" "1"
|
||||
"debris_offset" "-16 0 0"
|
||||
}
|
||||
|
||||
entityDef damage_arrowDirect
|
||||
|
@ -39,10 +84,10 @@ entityDef projectile_arrowExplosive
|
|||
{
|
||||
"inherit" "projectile_arrow"
|
||||
"smoke_fly" "weapon_crossbow.trail"
|
||||
"def_damage" ""
|
||||
"def_splash_damage" "damage_arrowSplash"
|
||||
"def_damage" ""
|
||||
"def_splash_damage" "damage_arrowSplash"
|
||||
"model_detonate" "fx_explosion.main"
|
||||
"snd_explode" "fx.explosion"
|
||||
"snd_explode" "fx.explosion"
|
||||
"decal_detonate" "ExplosionScorch"
|
||||
}
|
||||
|
||||
|
@ -50,4 +95,4 @@ entityDef damage_arrowSplash
|
|||
{
|
||||
"damage" "skill:plr_xbow_bolt_monster"
|
||||
"radius" "125"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,52 @@
|
|||
entityDef weapon_crowbar
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Crowbar"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_crowbar.mdl"
|
||||
"inv_item" "$WEAPON_CROWBAR"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
}
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Crowbar"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_crowbar.mdl"
|
||||
"model_view" "models/v_crowbar.mdl"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
|
||||
// weapon specific
|
||||
"def_melee" "damage_crowbar"
|
||||
"melee_distance" "32"
|
||||
"inv_name" "Crowbar"
|
||||
"clipSize" "6"
|
||||
"ammoType" ""
|
||||
"ammoRequired" "0"
|
||||
"clipSize" "0"
|
||||
"silent_fire" "1"
|
||||
|
||||
"meleeRateMiss" "0.5"
|
||||
"meleeRateHit" "0.25"
|
||||
|
||||
"actIdle" "0"
|
||||
"actDraw" "1"
|
||||
"actHolster" "2"
|
||||
"actMeleeMiss" "4,5,7"
|
||||
"actMeleeHit" "3,6,8"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "0"
|
||||
"hudSlotPos" "0"
|
||||
"weight" "0"
|
||||
"crosshair" "none"
|
||||
"ammoIcon" "none"
|
||||
}
|
||||
|
||||
entityDef damage_crowbar
|
||||
{
|
||||
"damage" "skill:plr_crowbar"
|
||||
// "kickDir" "-1 0 0"
|
||||
// "knockback" "20"
|
||||
// "push" "20000"
|
||||
"gib" "1"
|
||||
|
||||
"snd_hit" "weapon_crowbar.hit"
|
||||
"snd_miss" "weapon_crowbar.miss"
|
||||
}
|
||||
|
|
|
@ -1,14 +1,39 @@
|
|||
// gives 20 ammo
|
||||
entityDef weapon_egon
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Gluon Gun"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_egon.mdl"
|
||||
"inv_item" "$WEAPON_EGON"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
}
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Gluon Gun"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_egon.mdl"
|
||||
"model_view" "models/v_egon.mdl"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
"def_onFire" "projectile_egonbeam"
|
||||
|
||||
"inv_ammo_uranium" "20"
|
||||
"ammoType" "ammo_uranium"
|
||||
"ammoRequired" "1"
|
||||
"actIdle" "0,1"
|
||||
"actDraw" "9"
|
||||
"actFire" "7,8"
|
||||
"actFireLoop" "7,8"
|
||||
"actHolster" "10"
|
||||
"fireRate" "0.2"
|
||||
|
||||
"snd_fire" "weapon_egon.fire"
|
||||
"snd_fire_loop" "weapon_egon.fire_loop"
|
||||
"fx_trail" "weapon_egon.trail"
|
||||
"fx_trail_world" "weapon_egon.trail_world"
|
||||
|
||||
"joint_view_trail" "Gauss"
|
||||
"joint_world_trail" "Gauss"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "3"
|
||||
"hudSlotPos" "2"
|
||||
"weight" "15"
|
||||
}
|
||||
|
|
|
@ -1,14 +1,66 @@
|
|||
entityDef weapon_gauss
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Tau Cannon"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_gauss.mdl"
|
||||
"inv_item" "$WEAPON_GAUSS"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
}
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Tau Cannon"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_gauss.mdl"
|
||||
"model_view" "models/v_gauss.mdl"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
|
||||
// weapon specific
|
||||
"def_fireInfo" "fireInfo_gauss"
|
||||
"def_altFireInfo" "fireInfo_gausscharge"
|
||||
"inv_ammo_uranium" "20"
|
||||
"ammoType" "ammo_uranium"
|
||||
"ammoRequired" "1"
|
||||
"actIdle" "0,1,2"
|
||||
"actDraw" "8"
|
||||
"actHolster" "7"
|
||||
"actLoop" "4"
|
||||
"powerAmmo" "1"
|
||||
"snd_fire" "weapon_gauss.fire"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "3"
|
||||
"hudSlotPos" "1"
|
||||
"weight" "20"
|
||||
}
|
||||
|
||||
entityDef projectile_gauss
|
||||
{
|
||||
"spawnclass" "HLGaussBeam"
|
||||
}
|
||||
|
||||
|
||||
entityDef projectile_gausscharge
|
||||
{
|
||||
"spawnclass" "HLGaussBeam"
|
||||
"charged" "1"
|
||||
}
|
||||
|
||||
entityDef fireInfo_gauss
|
||||
{
|
||||
"def_onFire" "projectile_gauss"
|
||||
"ammoPerShot" "2"
|
||||
"fireRate" ".2"
|
||||
"punchAngle" "-2 0 0"
|
||||
"actFire" "5,6"
|
||||
"model_flash" "sprites/muzzleflash2.spr"
|
||||
}
|
||||
|
||||
entityDef fireInfo_gausscharge
|
||||
{
|
||||
"def_onRelease" "projectile_gausscharge"
|
||||
"ammoPerShot" "5"
|
||||
"fireRate" "2"
|
||||
"punchAngle" "-2 0 0"
|
||||
"model_flash" "sprites/muzzleflash2.spr"
|
||||
"primed_fuse" "5"
|
||||
"actRelease" "5,6"
|
||||
"actFire" "3"
|
||||
}
|
||||
|
|
|
@ -1,16 +1,41 @@
|
|||
|
||||
entityDef weapon_handgrenade
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Hand Grenade"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_grenade.mdl"
|
||||
"inv_item" "$WEAPON_HANDGRENADE"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Hand Grenade"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_grenade.mdl"
|
||||
"model_view" "models/v_grenade.mdl"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
|
||||
"inv_name" "Hand Grenade"
|
||||
"inv_weapon" "weapon_handgrenade"
|
||||
"inv_ammo_handgrenade" "5"
|
||||
"def_onRelease" "projectile_handgrenade"
|
||||
"def_explode_inhand" "env_handgrenade_explodeinhand"
|
||||
"def_damage_inhand" "damage_handgrenadeSplash"
|
||||
"ammoType" "ammo_handgrenade"
|
||||
"ammoRequired" "1"
|
||||
"silent_fire" "1"
|
||||
"primed_fuse" "4"
|
||||
"removeOnEmpty" "1"
|
||||
|
||||
"actIdle" "0,1"
|
||||
"actDraw" "7"
|
||||
"actHolster" "6"
|
||||
"actFire" "2"
|
||||
"actRelease" "3,4,5"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "4"
|
||||
"hudSlotPos" "0"
|
||||
"weight" "5"
|
||||
"crosshair" "none"
|
||||
}
|
||||
|
||||
entityDef projectile_handgrenade
|
||||
|
@ -22,13 +47,14 @@ entityDef projectile_handgrenade
|
|||
"detonate_on_fuse" "1"
|
||||
"bounce" "1"
|
||||
"angular_velocity" "-350 0 0"
|
||||
"velocity" "300 0 40"
|
||||
"model_detonate" "fx_explosion.main"
|
||||
"snd_explode" "fx.explosion"
|
||||
"snd_explode" "fx.explosion"
|
||||
"snd_bounce" "weapon_handgrenade.bounce"
|
||||
"decal_detonate" "ExplosionScorch"
|
||||
|
||||
"def_damage" "damage_handgrenadeDirect"
|
||||
"def_splash_damage" "damage_handgrenadeSplash"
|
||||
"def_damage" "damage_handgrenadeDirect"
|
||||
"def_splash_damage" "damage_handgrenadeSplash"
|
||||
}
|
||||
|
||||
entityDef damage_handgrenadeDirect
|
||||
|
@ -40,4 +66,10 @@ entityDef damage_handgrenadeSplash
|
|||
{
|
||||
"damage" "skill:plr_hand_grenade"
|
||||
"radius" "250"
|
||||
}
|
||||
}
|
||||
|
||||
entityDef env_handgrenade_explodeinhand
|
||||
{
|
||||
"spawnclass" "idAnimatedEntity"
|
||||
"model" "grenadeExplosion.prt"
|
||||
}
|
||||
|
|
|
@ -1,14 +1,47 @@
|
|||
entityDef weapon_hornetgun
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Hornet Gun"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_hgun.mdl"
|
||||
"inv_item" "$WEAPON_HORNETGUN"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
}
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Hornet Gun"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_hgun.mdl"
|
||||
"model_view" "models/v_hgun.mdl"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
|
||||
// weapon specific
|
||||
"def_fireInfo" "fireInfo_hornetgun"
|
||||
"inv_name" "Hornet Gun"
|
||||
"inv_ammo_hornet" "8"
|
||||
|
||||
"actFire" "5"
|
||||
"actHolster" "3"
|
||||
"actDraw" "4"
|
||||
"actIdle" "0,1,2"
|
||||
|
||||
"snd_fire" "weapon_hornetgun.fire"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "3"
|
||||
"hudSlotPos" "3"
|
||||
"weight" "10"
|
||||
}
|
||||
|
||||
entityDef projectile_hornet
|
||||
{
|
||||
"spawnclass" "NSProjectile"
|
||||
"damage" "10"
|
||||
}
|
||||
|
||||
entityDef fireInfo_hornetgun
|
||||
{
|
||||
"def_onFire" "projectile_hornet"
|
||||
"ammoType" "ammo_hornet"
|
||||
"ammoRequired" "1"
|
||||
"ammoPerShot" "1"
|
||||
"fireRate" "1.0"
|
||||
"punchAngle" "-1 0 0"
|
||||
}
|
||||
|
|
|
@ -1,16 +1,40 @@
|
|||
entityDef weapon_rpg
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Rocket Launcher"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_rpg.mdl"
|
||||
"inv_item" "$WEAPON_RPG"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Rocket Launcher"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_rpg.mdl"
|
||||
"model_view" "models/v_rpg.mdl"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
|
||||
"def_fireInfo" "fireInfo_rpg"
|
||||
"def_altFireInfo" "fireInfo_rpg_homing"
|
||||
"ammoType" "ammo_rocket"
|
||||
"clipSize" "1"
|
||||
"ammoRequired" "1"
|
||||
"ammoPerShot" "1"
|
||||
"inv_ammo_rocket" "1"
|
||||
"fireRate" "2.5"
|
||||
|
||||
"actIdle" "0,1"
|
||||
"actIdleEmpty" "8,9"
|
||||
"actHolster" "4"
|
||||
"actHolsterEmpty" "6"
|
||||
"actDraw" "5"
|
||||
"actDrawEmpty" "7"
|
||||
"actFire" "3"
|
||||
"actReload" "2"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "3"
|
||||
"hudSlotPos" "0"
|
||||
"weight" "20"
|
||||
"altLaser" "1"
|
||||
}
|
||||
|
||||
entityDef projectile_rocket
|
||||
|
@ -18,8 +42,8 @@ entityDef projectile_rocket
|
|||
"spawnclass" "NSProjectile"
|
||||
"model" "models/rpgrocket.mdl"
|
||||
|
||||
"def_damage" "damage_rocketDirect"
|
||||
"def_splash_damage" "damage_rocketSplash"
|
||||
"def_damage" "damage_rocketDirect"
|
||||
"def_splash_damage" "damage_rocketSplash"
|
||||
|
||||
"health" "0"
|
||||
"velocity" "250"
|
||||
|
@ -39,15 +63,15 @@ entityDef projectile_rocket
|
|||
"smoke_fly" "weapon_rpg.trail"
|
||||
"decal_detonate" "ExplosionScorch"
|
||||
"model_detonate" "fx_explosion.main"
|
||||
"light_color" "1 0.8 0.4"
|
||||
"light_radius" "160"
|
||||
"light_offset" "0 0 0"
|
||||
|
||||
"explode_light_color" "2 1.6 0.8"
|
||||
"explode_light_radius" "320"
|
||||
"explode_light_fadetime" "0.5"
|
||||
"light_color" "1 0.8 0.4"
|
||||
"light_radius" "160"
|
||||
"light_offset" "0 0 0"
|
||||
|
||||
"snd_explode" "fx.explosion"
|
||||
"explode_light_color" "2 1.6 0.8"
|
||||
"explode_light_radius" "320"
|
||||
"explode_light_fadetime" "0.5"
|
||||
|
||||
"snd_explode" "fx.explosion"
|
||||
}
|
||||
|
||||
entityDef projectile_rocket_homing
|
||||
|
@ -66,4 +90,14 @@ entityDef damage_rocketSplash
|
|||
{
|
||||
"damage" "skill:plr_rpg"
|
||||
"radius" "250"
|
||||
}
|
||||
}
|
||||
|
||||
entityDef fireInfo_rpg
|
||||
{
|
||||
"def_onFire" "projectile_rocket"
|
||||
}
|
||||
|
||||
entityDef fireInfo_rpg_homing
|
||||
{
|
||||
"def_onFire" "projectile_rocket_homing"
|
||||
}
|
||||
|
|
|
@ -1,16 +1,34 @@
|
|||
entityDef weapon_satchel
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Satchel"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_satchel.mdl"
|
||||
"inv_item" "$WEAPON_SATCHEL"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Satchel"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_satchel.mdl"
|
||||
"model_view" "models/v_satchel.mdl"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
|
||||
"ammoType" "ammo_satchel"
|
||||
"inv_ammo_satchel" "1"
|
||||
"ammoRequired" "1"
|
||||
"def_onFire" "projectile_satchel"
|
||||
"detonateOnFire" "projectile_satchel"
|
||||
"fireRate" "1.0"
|
||||
"removeOnEmpty" "1"
|
||||
|
||||
"actIdle" "0,1"
|
||||
"actDraw" "2"
|
||||
"actFire" "3"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "4"
|
||||
"hudSlotPos" "1"
|
||||
"weight" "-20"
|
||||
"crosshair" "none"
|
||||
}
|
||||
|
||||
entityDef projectile_satchel
|
||||
|
@ -28,9 +46,9 @@ entityDef projectile_satchel
|
|||
"snd_bounce" "weapon_satchel.bounce"
|
||||
"inherit_velocity" "1"
|
||||
|
||||
"def_splash_damage" "damage_satchelExplosion"
|
||||
"def_splash_damage" "damage_satchelExplosion"
|
||||
"model_detonate" "fx_explosion.main"
|
||||
"snd_explode" "fx.explosion"
|
||||
"snd_explode" "fx.explosion"
|
||||
"decal_detonate" "ExplosionScorch"
|
||||
|
||||
}
|
||||
|
@ -39,4 +57,4 @@ entityDef damage_satchelExplosion
|
|||
{
|
||||
"damage" "skill:plr_satchel"
|
||||
"radius" "375"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,116 @@
|
|||
entityDef weapon_shotgun
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Shotgun"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_shotgun.mdl"
|
||||
"inv_item" "$WEAPON_SHOTGUN"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
}
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Shotgun"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_shotgun.mdl"
|
||||
"model_view" "models/v_shotgun.mdl"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
|
||||
// weapon specific
|
||||
"def_fireInfo" "fireInfo_shotgun"
|
||||
"def_altFireInfo" "fireInfo_altShotgun"
|
||||
"inv_name" "Shotgun"
|
||||
"clipSize" "8"
|
||||
"inv_ammo_buckshot" "4"
|
||||
"ammoType" "ammo_buckshot"
|
||||
"ammoRequired" "1"
|
||||
|
||||
"actFire" "1"
|
||||
"actHolster" "7"
|
||||
"actReloadStart" "5"
|
||||
"actReload" "3"
|
||||
"actReloadEnd" "4"
|
||||
"actDraw" "6"
|
||||
"actIdle" "0,8,9"
|
||||
|
||||
"snd_fire" "weapon_shotgun.single"
|
||||
"snd_empty" "weapon_shotgun.empty"
|
||||
|
||||
"snd_reload" "weapon_shotgun.reload"
|
||||
"snd_reload_end" "weapon_shotgun.cock"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "2"
|
||||
"hudSlotPos" "1"
|
||||
"weight" "15"
|
||||
}
|
||||
|
||||
entityDef projectile_shotgun
|
||||
{
|
||||
"inherit" "projectile_bullet_base"
|
||||
"damage" "skill:plr_buckshot"
|
||||
"hitscans" "12"
|
||||
"spread" "0.08716 0.08716"
|
||||
}
|
||||
|
||||
entityDef projectile_shotgun_alt
|
||||
{
|
||||
"inherit" "projectile_bullet_base"
|
||||
"damage" "skill:plr_buckshot"
|
||||
"hitscans" "24"
|
||||
"spread" "0.08716 0.08716"
|
||||
}
|
||||
|
||||
entityDef fireInfo_shotgun
|
||||
{
|
||||
"def_onFire" "projectile_shotgun"
|
||||
"ammoPerShot" "1"
|
||||
"fireRate" "0.75"
|
||||
"model_flash" "sprites/muzzleflash2.spr"
|
||||
}
|
||||
|
||||
entityDef fireInfo_altShotgun
|
||||
{
|
||||
"def_onFire" "projectile_shotgun_alt"
|
||||
"ammoPerShot" "2"
|
||||
"fireRate" "1.5"
|
||||
"actFire" "2"
|
||||
"snd_fire" "weapon_shotgun.double"
|
||||
"model_flash" "sprites/muzzleflash2.spr"
|
||||
}
|
||||
|
||||
// multiplayer version
|
||||
entityDef projectile_shotgun_mp
|
||||
{
|
||||
"inherit" "projectile_bullet_base"
|
||||
"damage" "skill:plr_buckshot"
|
||||
"hitscans" "12"
|
||||
"spread" "0.08716 0.04362"
|
||||
}
|
||||
|
||||
entityDef projectile_shotgun_alt_mp
|
||||
{
|
||||
"inherit" "projectile_bullet_base"
|
||||
"damage" "skill:plr_buckshot"
|
||||
"hitscans" "24"
|
||||
"spread" "0.17365 0.04362"
|
||||
}
|
||||
|
||||
entityDef fireInfo_shotgun_mp
|
||||
{
|
||||
"def_onFire" "projectile_shotgun_mp"
|
||||
"ammoPerShot" "1"
|
||||
"fireRate" "1.25"
|
||||
"model_flash" "sprites/muzzleflash2.spr"
|
||||
}
|
||||
|
||||
entityDef fireInfo_altShotgun_mp
|
||||
{
|
||||
"def_onFire" "projectile_shotgun_alt_mp"
|
||||
"ammoPerShot" "2"
|
||||
"fireRate" "1.5"
|
||||
"model_flash" "sprites/muzzleflash2.spr"
|
||||
}
|
||||
|
||||
entityDef weapon_shotgun_mp
|
||||
{
|
||||
"inherit" "weapon_shotgun"
|
||||
"def_fireInfo" "fireInfo_shotgun_mp"
|
||||
"def_altFireInfo" "fireInfo_altShotgun_mp"
|
||||
}
|
||||
|
|
|
@ -1,15 +1,41 @@
|
|||
entityDef weapon_snark
|
||||
{
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Snark"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "NSItem"
|
||||
"model" "models/w_sqknest.mdl"
|
||||
"editor_color" ".3 .3 1"
|
||||
"editor_mins" "-16 -16 -16"
|
||||
"editor_maxs" "16 16 16"
|
||||
"editor_usage" "Snark"
|
||||
"editor_rotatable" "1"
|
||||
|
||||
"spawnclass" "HLWeapon"
|
||||
"model" "models/w_sqknest.mdl"
|
||||
"model_view" "models/v_squeak.mdl"
|
||||
"frame" "1"
|
||||
"inv_item" "$WEAPON_SNARK"
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
}
|
||||
"snd_acquire" "weapon.pickup"
|
||||
"snd_respawn" "item.respawn"
|
||||
|
||||
"inv_name" "Snark"
|
||||
"inv_weapon" "weapon_snark"
|
||||
"inv_ammo_snark" "5"
|
||||
"def_onFire" "projectile_snark"
|
||||
"ammoType" "ammo_snark"
|
||||
"ammoRequired" "1"
|
||||
"silent_fire" "1"
|
||||
"primed_fuse" "4"
|
||||
|
||||
"actIdle" "0,1,2"
|
||||
"actDraw" "4"
|
||||
"actHolster" "3"
|
||||
"actThrow" "5"
|
||||
"removeOnEmpty" "1"
|
||||
|
||||
// HLWeapon specific
|
||||
"hudSlot" "4"
|
||||
"hudSlotPos" "3"
|
||||
"weight" "5"
|
||||
"crosshair" "none"
|
||||
}
|
||||
|
||||
entityDef projectile_snark
|
||||
{
|
||||
"spawnclass" "monster_snark"
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue