- Updates from Puzl with latest version of the game (my backups were old compared to his working copy).

- Removed really strict anti exploit detection (that was never used)
- This should be the latest released version of NS!
This commit is contained in:
Flayra 2014-01-14 11:43:04 -08:00
parent a3194c3cd0
commit af3128ec1a
142 changed files with 91371 additions and 89440 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

View file

@ -1,62 +1,64 @@
/***
*
* Copyright (c) 1999, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
#ifndef __AMMO_H__
#define __AMMO_H__
#define MAX_WEAPON_NAME 128
#define WEAPON_FLAGS_SELECTIONEMPTY 1
struct WEAPON
{
char szName[MAX_WEAPON_NAME];
int iAmmoType;
int iAmmo2Type;
int iMax1;
int iMax2;
int iSlot;
int iSlotPos;
int iFlags;
int iId;
int iClip;
// puzl: 497 - weapon enable state
int iEnabled;
int iCount; // # of itesm in plist
HSPRITE hActive;
wrect_t rcActive;
HSPRITE hInactive;
wrect_t rcInactive;
HSPRITE hAmmo;
wrect_t rcAmmo;
HSPRITE hAmmo2;
wrect_t rcAmmo2;
HSPRITE hCrosshair;
wrect_t rcCrosshair;
HSPRITE hAutoaim;
wrect_t rcAutoaim;
HSPRITE hZoomedCrosshair;
wrect_t rcZoomedCrosshair;
HSPRITE hZoomedAutoaim;
wrect_t rcZoomedAutoaim;
};
typedef int AMMO;
/***
*
* Copyright (c) 1999, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
#ifndef __AMMO_H__
#define __AMMO_H__
#define MAX_WEAPON_NAME 128
#define WEAPON_FLAGS_SELECTIONEMPTY 1
struct WEAPON
{
char szName[MAX_WEAPON_NAME];
int iAmmoType;
int iAmmo2Type;
int iMax1;
int iMax2;
int iSlot;
int iSlotPos;
int iFlags;
int iId;
int iClip;
// : 497 - weapon enable state
int iEnabled;
int iCount; // # of itesm in plist
HSPRITE hActive;
wrect_t rcActive;
HSPRITE hInactive;
wrect_t rcInactive;
HSPRITE hAmmo;
wrect_t rcAmmo;
HSPRITE hAmmo2;
wrect_t rcAmmo2;
HSPRITE hCrosshair;
wrect_t rcCrosshair;
/* HSPRITE hAutoaim;
wrect_t rcAutoaim;
HSPRITE hZoomedCrosshair;
wrect_t rcZoomedCrosshair;
HSPRITE hZoomedAutoaim;
wrect_t rcZoomedAutoaim;
*/
};
typedef int AMMO;
#endif

View file

@ -38,7 +38,7 @@ public:
void Init( void );
void Reset( void );
void LoadWeaponSprites( WEAPON* wp );
void LoadWeaponSprites( WEAPON* wp, int custom );
void LoadAllWeaponSprites( void );
WEAPON* GetWeapon( int iId );
@ -62,6 +62,8 @@ public:
//CONSIDER: Should the selection functions be in the menu with the selection variables?
void UserCmd_LastInv( void );
void UserCmd_MovementOn( void );
void UserCmd_MovementOff( void );
void SetValidWeapon( void );
void SetCurrentWeapon( WEAPON* wp );
void SelectSlot( int iSlot, int fAdvance, int iDirection );

View file

@ -155,6 +155,8 @@ int CL_DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion )
memcpy(&gEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t));
EV_HookEvents();
gHUD.InitExploitPrevention();
// get tracker interface, if any
char szDir[512];
if (!gEngfuncs.COM_ExpandFilename("Bin/TrackerUI.dll", szDir, sizeof(szDir)))
@ -190,6 +192,7 @@ so the HUD can reinitialize itself.
int CL_DLLEXPORT HUD_VidInit( void )
{
gHUD.InitExploitPrevention();
RecClHudVidInit();
gHUD.VidInit();

View file

@ -1,497 +1,499 @@
#ifndef CHUDMISC_H
#define CHUDMISC_H
#define RGB_YELLOWISH 0x00FFA000 //255,160,0
#define RGB_REDISH 0x00FF1010 //255,160,0
#define RGB_GREENISH 0x0000A000 //0,160,0
#define RGB_MARINE_BLUE 0x000099FF //0 153 255
#define RGB_MARINE_SELECTED 0x006EE6FF //110, 230, 255
#define RGB_MARINE_PARASITED 0x00E3F03D //227, 240, 61
#include "wrect.h"
#include "cl_dll.h"
#include "ammo.h"
#include "game_shared/teamconst.h"
#define DHN_DRAWZERO 1
#define DHN_2DIGITS 2
#define DHN_3DIGITS 4
#define MIN_ALPHA 100
#define HUDELEM_ACTIVE 1
typedef struct {
int x, y;
} POSITION;
typedef struct {
unsigned char r,g,b,a;
} RGBA;
typedef struct cvar_s cvar_t;
#define HUD_ACTIVE 1
#define HUD_INTERMISSION 2
#define MAX_PLAYER_NAME_LENGTH 32
#define MAX_MOTD_LENGTH 1536
//
//-----------------------------------------------------
//
class CHudBase
{
public:
POSITION m_pos;
int m_type;
int m_iFlags; // active, moving,
virtual ~CHudBase() {}
virtual int Init( void ) {return 0;}
virtual int VidInit( void ) {return 0;}
virtual int Draw(float flTime) {return 0;}
virtual void Think(void) {return;}
virtual void Reset(void) {return;}
virtual void InitHUDData( void ) {} // called every time a server is connected to
};
struct HUDLIST {
CHudBase *p;
HUDLIST *pNext;
};
//
//-----------------------------------------------------
//
#include "..\game_shared\voice_status.h"
#include "hud_spectator.h"
//
//-----------------------------------------------------
//
class CHudAmmo: public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw(float flTime);
void Think(void);
void Reset(void);
int DrawWList(float flTime);
int MsgFunc_CurWeapon(const char *pszName, int iSize, void *pbuf);
int MsgFunc_WeaponList(const char *pszName, int iSize, void *pbuf);
int MsgFunc_AmmoX(const char *pszName, int iSize, void *pbuf);
int MsgFunc_AmmoPickup( const char *pszName, int iSize, void *pbuf );
int MsgFunc_WeapPickup( const char *pszName, int iSize, void *pbuf );
int MsgFunc_ItemPickup( const char *pszName, int iSize, void *pbuf );
int MsgFunc_HideWeapon( const char *pszName, int iSize, void *pbuf );
void SlotInput( int iSlot );
void _cdecl UserCmd_Slot1( void );
void _cdecl UserCmd_Slot2( void );
void _cdecl UserCmd_Slot3( void );
void _cdecl UserCmd_Slot4( void );
void _cdecl UserCmd_Slot5( void );
void _cdecl UserCmd_Slot6( void );
void _cdecl UserCmd_Slot7( void );
void _cdecl UserCmd_Slot8( void );
void _cdecl UserCmd_Slot9( void );
void _cdecl UserCmd_Slot10( void );
void _cdecl UserCmd_Close( void );
void _cdecl UserCmd_NextWeapon( void );
void _cdecl UserCmd_PrevWeapon( void );
void SetCurrentClip(int inClip);
private:
float m_fFade;
RGBA m_rgba;
WEAPON *m_pWeapon;
int m_HUD_bucket0;
int m_HUD_selection;
};
//
//-----------------------------------------------------
//
class CHudAmmoSecondary: public CHudBase
{
public:
int Init( void );
int VidInit( void );
void Reset( void );
int Draw(float flTime);
int MsgFunc_SecAmmoVal( const char *pszName, int iSize, void *pbuf );
int MsgFunc_SecAmmoIcon( const char *pszName, int iSize, void *pbuf );
private:
enum {
MAX_SEC_AMMO_VALUES = 4
};
int m_HUD_ammoicon; // sprite indices
int m_iAmmoAmounts[MAX_SEC_AMMO_VALUES];
float m_fFade;
};
#include "health.h"
#define FADE_TIME 100
//
//-----------------------------------------------------
//
class CHudGeiger: public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw(float flTime);
int MsgFunc_Geiger(const char *pszName, int iSize, void *pbuf);
private:
int m_iGeigerRange;
};
//
//-----------------------------------------------------
//
class CHudTrain: public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw(float flTime);
int MsgFunc_Train(const char *pszName, int iSize, void *pbuf);
private:
HSPRITE m_hSprite;
int m_iPos;
};
//
//-----------------------------------------------------
//
class CHudStatusBar : public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw( float flTime );
const char* GetStatusString() const;
void Reset( void );
void ParseStatusString( int line_num );
int MsgFunc_StatusText( const char *pszName, int iSize, void *pbuf );
int MsgFunc_StatusValue( const char *pszName, int iSize, void *pbuf );
protected:
void ReparseStringIfNeeded();
enum {
MAX_STATUSTEXT_LENGTH = 128,
MAX_STATUSBAR_VALUES = 8,
MAX_STATUSBAR_LINES = 2,
};
char m_szStatusText[MAX_STATUSBAR_LINES][MAX_STATUSTEXT_LENGTH]; // a text string describing how the status bar is to be drawn
char m_szStatusBar[MAX_STATUSBAR_LINES][MAX_STATUSTEXT_LENGTH]; // the constructed bar that is drawn
int m_iStatusValues[MAX_STATUSBAR_VALUES]; // an array of values for use in the status bar
int m_bReparseString; // set to TRUE whenever the m_szStatusBar needs to be recalculated
// an array of colors...one color for each line
float *m_pflNameColors[MAX_STATUSBAR_LINES];
};
class ScoreboardIcon;
// puzl: 0001073
#define CUSTOM_ICON_LENGTH 32
struct extra_player_info_t
{
short score;
short lastScore;
float timeOfLastScoreChange;
short frags;
short deaths;
short playerclass;
short auth;
short teamnumber;
char teamname[MAX_TEAM_NAME];
char customicon[CUSTOM_ICON_LENGTH + 3]; //last 3 characters is the color.
ScoreboardIcon* icon;
};
struct team_info_t
{
char name[MAX_TEAM_NAME];
short score;
short frags;
short deaths;
short ping;
short packetloss;
short ownteam;
short players;
int already_drawn;
int scores_overriden;
int teamnumber;
};
extern hud_player_info_t g_PlayerInfoList[MAX_PLAYERS+1]; // player info from the engine
extern extra_player_info_t g_PlayerExtraInfo[MAX_PLAYERS+1]; // additional player info sent directly to the client dll
extern team_info_t g_TeamInfo[MAX_TEAMS+1];
extern int g_IsSpectator[MAX_PLAYERS+1];
//
//-----------------------------------------------------
//
class CHudDeathNotice : public CHudBase
{
public:
int Init( void );
void InitHUDData( void );
int VidInit( void );
int Draw( float flTime );
int MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbuf );
private:
int m_HUD_d_skull; // sprite index of skull icon
};
//
//-----------------------------------------------------
//
class CHudMenu : public CHudBase
{
public:
int Init( void );
void InitHUDData( void );
int VidInit( void );
void Reset( void );
int Draw( float flTime );
int MsgFunc_ShowMenu( const char *pszName, int iSize, void *pbuf );
void SelectMenuItem( int menu_item );
int m_fMenuDisplayed;
int m_bitsValidSlots;
float m_flShutoffTime;
int m_fWaitingForMore;
};
//
//-----------------------------------------------------
//
class CHudSayText : public CHudBase
{
public:
int Init( void );
void InitHUDData( void );
int VidInit( void );
int Draw( float flTime );
int MsgFunc_SayText( const char *pszName, int iSize, void *pbuf );
void SayTextPrint( const char *pszBuf, int iBufSize, int clientIndex = -1 );
void EnsureTextFitsInOneLineAndWrapIfHaveTo( int line );
friend class CHud;
friend class CHudSpectator;
private:
struct cvar_s * m_HUD_saytext;
struct cvar_s * m_HUD_saytext_time;
};
//
//-----------------------------------------------------
//
class CHudBattery: public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw(float flTime);
int MsgFunc_Battery(const char *pszName, int iSize, void *pbuf );
private:
HSPRITE m_hSprite1;
HSPRITE m_hSprite2;
wrect_t *m_prc1;
wrect_t *m_prc2;
int m_iBat;
float m_fFade;
int m_iHeight; // width of the battery innards
};
//
//-----------------------------------------------------
//
class CHudFlashlight: public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw(float flTime);
void Reset( void );
int MsgFunc_Flashlight(const char *pszName, int iSize, void *pbuf );
int MsgFunc_FlashBat(const char *pszName, int iSize, void *pbuf );
private:
HSPRITE m_hSprite1;
HSPRITE m_hSprite2;
HSPRITE m_hBeam;
wrect_t *m_prc1;
wrect_t *m_prc2;
wrect_t *m_prcBeam;
float m_flBat;
int m_iBat;
int m_fOn;
float m_fFade;
int m_iWidth; // width of the battery innards
};
//
//-----------------------------------------------------
//
const int maxHUDMessages = 16;
struct message_parms_t
{
client_textmessage_t *pMessage;
float time;
int x, y;
int totalWidth, totalHeight;
int width;
int lines;
int lineLength;
int length;
int r, g, b;
int text;
int fadeBlend;
float charTime;
float fadeTime;
};
//
//-----------------------------------------------------
//
class CHudTextMessage: public CHudBase
{
public:
int Init( void );
static char *LocaliseTextString( const char *msg, char *dst_buffer, int buffer_size );
static char *BufferedLocaliseTextString( const char *msg );
char *LookupString( const char *msg_name, int *msg_dest = NULL );
int MsgFunc_TextMsg(const char *pszName, int iSize, void *pbuf);
};
//
//-----------------------------------------------------
//
class CHudMessage: public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw(float flTime);
int MsgFunc_HudText(const char *pszName, int iSize, void *pbuf);
int MsgFunc_HudText2(const char *pszName, int iSize, void *pbuf);
int MsgFunc_GameTitle(const char *pszName, int iSize, void *pbuf);
float FadeBlend( float fadein, float fadeout, float hold, float localTime );
int XPosition( float x, int width, int lineWidth );
int YPosition( float y, int height );
void MessageAddPlayerID(const char* pName, bool inEnemy);
void MessageAdd( const char *pName, float time );
bool MessageRemove( const char *pName );
void MessageDrawScan( client_textmessage_t *pMessage, float time );
void MessageScanStart( void );
void MessageScanNextChar( void );
void Reset( void );
private:
bool DrawMessage(client_textmessage_t* inMessage, float inStartTime, float inCurrentTime);
void SetPlayerIDPosition();
client_textmessage_t *m_pMessages[maxHUDMessages];
float m_startTime[maxHUDMessages];
message_parms_t m_parms;
float m_gameTitleTime;
client_textmessage_t *m_pGameTitle;
client_textmessage_t mPlayerIDMessage;
float mPlayerIDTime;
char* mPlayerID;
int m_HUD_title_life;
int m_HUD_title_half;
};
//
//-----------------------------------------------------
//
#define MAX_SPRITE_NAME_LENGTH 24
class CHudStatusIcons: public CHudBase
{
public:
int Init( void );
int VidInit( void );
void Reset( void );
int Draw(float flTime);
enum {
MAX_ICONSPRITENAME_LENGTH = MAX_SPRITE_NAME_LENGTH,
MAX_ICONSPRITES = 4,
};
//had to make these public so CHud could access them (to enable concussion icon)
//could use a friend declaration instead...
void EnableIcon( char *pszIconName, unsigned char red, unsigned char green, unsigned char blue );
void DisableIcon( char *pszIconName );
private:
typedef struct
{
char szSpriteName[MAX_ICONSPRITENAME_LENGTH];
HSPRITE spr;
wrect_t rc;
unsigned char r, g, b;
} icon_sprite_t;
icon_sprite_t m_IconList[MAX_ICONSPRITES];
};
typedef struct cvar_s cvar_t;
#ifndef CHUDMISC_H
#define CHUDMISC_H
#define RGB_YELLOWISH 0x00FFA000 //255,160,0
#define RGB_REDISH 0x00FF1010 //255,160,0
#define RGB_GREENISH 0x0000A000 //0,160,0
#define RGB_MARINE_BLUE 0x000099FF //0 153 255
#define RGB_MARINE_SELECTED 0x006EE6FF //110, 230, 255
#define RGB_MARINE_PARASITED 0x00E3F03D //227, 240, 61
#include "wrect.h"
#include "cl_dll.h"
#include "ammo.h"
#include "game_shared/teamconst.h"
#define DHN_DRAWZERO 1
#define DHN_2DIGITS 2
#define DHN_3DIGITS 4
#define MIN_ALPHA 100
#define HUDELEM_ACTIVE 1
typedef struct {
int x, y;
} POSITION;
typedef struct {
unsigned char r,g,b,a;
} RGBA;
typedef struct cvar_s cvar_t;
#define HUD_ACTIVE 1
#define HUD_INTERMISSION 2
#define MAX_PLAYER_NAME_LENGTH 32
#define MAX_MOTD_LENGTH 1536
//
//-----------------------------------------------------
//
class CHudBase
{
public:
POSITION m_pos;
int m_type;
int m_iFlags; // active, moving,
virtual ~CHudBase() {}
virtual int Init( void ) {return 0;}
virtual int VidInit( void ) {return 0;}
virtual int Draw(float flTime) {return 0;}
virtual void Think(void) {return;}
virtual void Reset(void) {return;}
virtual void InitHUDData( void ) {} // called every time a server is connected to
};
struct HUDLIST {
CHudBase *p;
HUDLIST *pNext;
};
//
//-----------------------------------------------------
//
#include "..\game_shared\voice_status.h"
#include "hud_spectator.h"
//
//-----------------------------------------------------
//
class CHudAmmo: public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw(float flTime);
void Think(void);
void Reset(void);
int DrawWList(float flTime);
int MsgFunc_CurWeapon(const char *pszName, int iSize, void *pbuf);
int MsgFunc_WeaponList(const char *pszName, int iSize, void *pbuf);
int MsgFunc_AmmoX(const char *pszName, int iSize, void *pbuf);
int MsgFunc_AmmoPickup( const char *pszName, int iSize, void *pbuf );
int MsgFunc_WeapPickup( const char *pszName, int iSize, void *pbuf );
int MsgFunc_ItemPickup( const char *pszName, int iSize, void *pbuf );
int MsgFunc_HideWeapon( const char *pszName, int iSize, void *pbuf );
void SlotInput( int iSlot );
void _cdecl UserCmd_Slot1( void );
void _cdecl UserCmd_Slot2( void );
void _cdecl UserCmd_Slot3( void );
void _cdecl UserCmd_Slot4( void );
void _cdecl UserCmd_Slot5( void );
void _cdecl UserCmd_Slot6( void );
void _cdecl UserCmd_Slot7( void );
void _cdecl UserCmd_Slot8( void );
void _cdecl UserCmd_Slot9( void );
void _cdecl UserCmd_Slot10( void );
void _cdecl UserCmd_Close( void );
void _cdecl UserCmd_NextWeapon( void );
void _cdecl UserCmd_PrevWeapon( void );
void SetCurrentClip(int inClip);
private:
float m_fFade;
RGBA m_rgba;
WEAPON *m_pWeapon;
int m_HUD_bucket0;
int m_HUD_selection;
int m_customCrosshair;
};
//
//-----------------------------------------------------
//
class CHudAmmoSecondary: public CHudBase
{
public:
int Init( void );
int VidInit( void );
void Reset( void );
int Draw(float flTime);
int MsgFunc_SecAmmoVal( const char *pszName, int iSize, void *pbuf );
int MsgFunc_SecAmmoIcon( const char *pszName, int iSize, void *pbuf );
private:
enum {
MAX_SEC_AMMO_VALUES = 4
};
int m_HUD_ammoicon; // sprite indices
int m_iAmmoAmounts[MAX_SEC_AMMO_VALUES];
float m_fFade;
};
#include "health.h"
#define FADE_TIME 100
//
//-----------------------------------------------------
//
class CHudGeiger: public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw(float flTime);
int MsgFunc_Geiger(const char *pszName, int iSize, void *pbuf);
private:
int m_iGeigerRange;
};
//
//-----------------------------------------------------
//
class CHudTrain: public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw(float flTime);
int MsgFunc_Train(const char *pszName, int iSize, void *pbuf);
private:
HSPRITE m_hSprite;
int m_iPos;
};
//
//-----------------------------------------------------
//
class CHudStatusBar : public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw( float flTime );
const char* GetStatusString() const;
void Reset( void );
void ParseStatusString( int line_num );
int MsgFunc_StatusText( const char *pszName, int iSize, void *pbuf );
int MsgFunc_StatusValue( const char *pszName, int iSize, void *pbuf );
protected:
void ReparseStringIfNeeded();
enum {
MAX_STATUSTEXT_LENGTH = 128,
MAX_STATUSBAR_VALUES = 8,
MAX_STATUSBAR_LINES = 2,
};
char m_szStatusText[MAX_STATUSBAR_LINES][MAX_STATUSTEXT_LENGTH]; // a text string describing how the status bar is to be drawn
char m_szStatusBar[MAX_STATUSBAR_LINES][MAX_STATUSTEXT_LENGTH]; // the constructed bar that is drawn
int m_iStatusValues[MAX_STATUSBAR_VALUES]; // an array of values for use in the status bar
int m_bReparseString; // set to TRUE whenever the m_szStatusBar needs to be recalculated
// an array of colors...one color for each line
float *m_pflNameColors[MAX_STATUSBAR_LINES];
};
class ScoreboardIcon;
// : 0001073
#define CUSTOM_ICON_LENGTH 32
struct extra_player_info_t
{
short score;
short lastScore;
float timeOfLastScoreChange;
short frags;
short deaths;
short playerclass;
short extra;
short auth;
short teamnumber;
char teamname[MAX_TEAM_NAME];
char customicon[CUSTOM_ICON_LENGTH + 3]; //last 3 characters is the color.
short health;
ScoreboardIcon* icon;
};
struct team_info_t
{
char name[MAX_TEAM_NAME];
short score;
short frags;
short deaths;
short ping;
short packetloss;
short ownteam;
short players;
int already_drawn;
int scores_overriden;
int teamnumber;
};
extern hud_player_info_t g_PlayerInfoList[MAX_PLAYERS+1]; // player info from the engine
extern extra_player_info_t g_PlayerExtraInfo[MAX_PLAYERS+1]; // additional player info sent directly to the client dll
extern team_info_t g_TeamInfo[MAX_TEAMS+1];
extern int g_IsSpectator[MAX_PLAYERS+1];
//
//-----------------------------------------------------
//
class CHudDeathNotice : public CHudBase
{
public:
int Init( void );
void InitHUDData( void );
int VidInit( void );
int Draw( float flTime );
int MsgFunc_DeathMsg( const char *pszName, int iSize, void *pbuf );
private:
int m_HUD_d_skull; // sprite index of skull icon
};
//
//-----------------------------------------------------
//
class CHudMenu : public CHudBase
{
public:
int Init( void );
void InitHUDData( void );
int VidInit( void );
void Reset( void );
int Draw( float flTime );
int MsgFunc_ShowMenu( const char *pszName, int iSize, void *pbuf );
void SelectMenuItem( int menu_item );
int m_fMenuDisplayed;
int m_bitsValidSlots;
float m_flShutoffTime;
int m_fWaitingForMore;
};
//
//-----------------------------------------------------
//
class CHudSayText : public CHudBase
{
public:
int Init( void );
void InitHUDData( void );
int VidInit( void );
int Draw( float flTime );
int MsgFunc_SayText( const char *pszName, int iSize, void *pbuf );
void SayTextPrint( const char *pszBuf, int iBufSize, int clientIndex = -1 );
void EnsureTextFitsInOneLineAndWrapIfHaveTo( int line );
friend class CHud;
friend class CHudSpectator;
private:
struct cvar_s * m_HUD_saytext;
struct cvar_s * m_HUD_saytext_time;
};
//
//-----------------------------------------------------
//
class CHudBattery: public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw(float flTime);
int MsgFunc_Battery(const char *pszName, int iSize, void *pbuf );
private:
HSPRITE m_hSprite1;
HSPRITE m_hSprite2;
wrect_t *m_prc1;
wrect_t *m_prc2;
int m_iBat;
float m_fFade;
int m_iHeight; // width of the battery innards
};
//
//-----------------------------------------------------
//
class CHudFlashlight: public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw(float flTime);
void Reset( void );
int MsgFunc_Flashlight(const char *pszName, int iSize, void *pbuf );
int MsgFunc_FlashBat(const char *pszName, int iSize, void *pbuf );
private:
HSPRITE m_hSprite1;
HSPRITE m_hSprite2;
HSPRITE m_hBeam;
wrect_t *m_prc1;
wrect_t *m_prc2;
wrect_t *m_prcBeam;
float m_flBat;
int m_iBat;
int m_fOn;
float m_fFade;
int m_iWidth; // width of the battery innards
};
//
//-----------------------------------------------------
//
const int maxHUDMessages = 16;
struct message_parms_t
{
client_textmessage_t *pMessage;
float time;
int x, y;
int totalWidth, totalHeight;
int width;
int lines;
int lineLength;
int length;
int r, g, b;
int text;
int fadeBlend;
float charTime;
float fadeTime;
};
//
//-----------------------------------------------------
//
class CHudTextMessage: public CHudBase
{
public:
int Init( void );
static char *LocaliseTextString( const char *msg, char *dst_buffer, int buffer_size );
static char *BufferedLocaliseTextString( const char *msg );
char *LookupString( const char *msg_name, int *msg_dest = NULL );
int MsgFunc_TextMsg(const char *pszName, int iSize, void *pbuf);
};
//
//-----------------------------------------------------
//
class CHudMessage: public CHudBase
{
public:
int Init( void );
int VidInit( void );
int Draw(float flTime);
int MsgFunc_HudText(const char *pszName, int iSize, void *pbuf);
int MsgFunc_HudText2(const char *pszName, int iSize, void *pbuf);
int MsgFunc_GameTitle(const char *pszName, int iSize, void *pbuf);
float FadeBlend( float fadein, float fadeout, float hold, float localTime );
int XPosition( float x, int width, int lineWidth );
int YPosition( float y, int height );
void MessageAddPlayerID(const char* pName, bool inEnemy);
void MessageAdd( const char *pName, float time );
bool MessageRemove( const char *pName );
void MessageDrawScan( client_textmessage_t *pMessage, float time );
void MessageScanStart( void );
void MessageScanNextChar( void );
void Reset( void );
private:
bool DrawMessage(client_textmessage_t* inMessage, float inStartTime, float inCurrentTime);
void SetPlayerIDPosition();
client_textmessage_t *m_pMessages[maxHUDMessages];
float m_startTime[maxHUDMessages];
message_parms_t m_parms;
float m_gameTitleTime;
client_textmessage_t *m_pGameTitle;
client_textmessage_t mPlayerIDMessage;
float mPlayerIDTime;
char* mPlayerID;
int m_HUD_title_life;
int m_HUD_title_half;
};
//
//-----------------------------------------------------
//
#define MAX_SPRITE_NAME_LENGTH 24
class CHudStatusIcons: public CHudBase
{
public:
int Init( void );
int VidInit( void );
void Reset( void );
int Draw(float flTime);
enum {
MAX_ICONSPRITENAME_LENGTH = MAX_SPRITE_NAME_LENGTH,
MAX_ICONSPRITES = 4,
};
//had to make these public so CHud could access them (to enable concussion icon)
//could use a friend declaration instead...
void EnableIcon( char *pszIconName, unsigned char red, unsigned char green, unsigned char blue );
void DisableIcon( char *pszIconName );
private:
typedef struct
{
char szSpriteName[MAX_ICONSPRITENAME_LENGTH];
HSPRITE spr;
wrect_t rc;
unsigned char r, g, b;
} icon_sprite_t;
icon_sprite_t m_IconList[MAX_ICONSPRITES];
};
typedef struct cvar_s cvar_t;
#endif

View file

@ -27,7 +27,7 @@
Optimization="0"
OptimizeForProcessor="0"
AdditionalIncludeDirectories=""$(SolutionDir)";U:\inlcude\stlport;U:\include\vgui;U:\include\nexus;U:\include\libpng;U:\include\fmod;U:\include\lua;U:\include\particle;U:\include\zlib"
PreprocessorDefinitions="_DEBUG;_MBCS;DEBUG;WIN32;_WINDOWS;AVH_CLIENT;$(NoInherit)"
PreprocessorDefinitions="_DEBUG;_MBCS;DEBUG;WIN32;_WINDOWS;AVH_CLIENT;$(NoInherit);USE_OLDAUTH"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
SmallerTypeCheck="TRUE"
@ -113,7 +113,7 @@
EnableIntrinsicFunctions="TRUE"
OptimizeForProcessor="0"
AdditionalIncludeDirectories=""$(SolutionDir)";U:\inlcude\stlport;U:\include\vgui;U:\include\nexus;U:\include\libpng;U:\include\fmod;U:\include\lua;U:\include\particle;U:\include\zlib"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;AVH_CLIENT;AVH_PLAYTEST_BUILD;$(NOINHERIT)"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;AVH_CLIENT;USE_OLDAUTH;$(NOINHERIT)"
StringPooling="TRUE"
RuntimeLibrary="0"
RuntimeTypeInfo="TRUE"
@ -5949,31 +5949,6 @@
RelativePath="..\textrep\TRTagValuePair.h">
</File>
</Filter>
<Filter
Name="scriptengine"
Filter="">
<File
RelativePath="..\scriptengine\AvHLUA.cpp">
</File>
<File
RelativePath="..\scriptengine\AvHLUA.h">
</File>
<File
RelativePath="..\scriptengine\AvHLUABase.cpp">
</File>
<File
RelativePath="..\scriptengine\AvHLUABase.h">
</File>
<File
RelativePath="..\scriptengine\AvHLUATime.cpp">
</File>
<File
RelativePath="..\scriptengine\AvHLUAUtil.cpp">
</File>
<File
RelativePath="..\scriptengine\AvHLUAUtil.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>

View file

@ -100,6 +100,7 @@ void CL_DLLEXPORT Demo_ReadBuffer( int size, unsigned char *buffer )
int type;
int i = 0;
bool theMouseVisibility = false;
int particleIndex=0;
type = *( int * )buffer;
i += sizeof( int );
@ -176,7 +177,7 @@ void CL_DLLEXPORT Demo_ReadBuffer( int size, unsigned char *buffer )
break;
case TYPE_PARTICLES:
i += gParticleTemplateList.InitializeDemoPlayback(size, (unsigned char*)&buffer[i]);
i += gParticleTemplateList.InitializeDemoPlayback(size, (unsigned char*)&buffer[i], particleIndex++);
break;
case TYPE_BASESTATE2:

View file

@ -297,7 +297,7 @@ void MoveModel( void )
}
#endif
*/
//#define TRACE_TEST
#if defined( TRACE_TEST )
@ -328,7 +328,7 @@ void TraceModel( void )
}
#endif
*/
/*
void ParticleCallback( struct particle_s *particle, float frametime )
@ -545,11 +545,11 @@ void CL_DLLEXPORT HUD_CreateEntities( void )
#if defined( TEST_IT )
MoveModel();
#endif
*/
#if defined( TRACE_TEST )
TraceModel();
#endif
*/
/*
Particles();
*/

View file

@ -104,6 +104,15 @@ qboolean EV_IsLocal( int idx )
return gEngfuncs.pEventAPI->EV_IsLocal( idx - 1 ) ? true : false;
}
qboolean EV_IsSpec( int idx )
{
// check if we are in some way in first person spec mode
if ( IS_FIRSTPERSON_SPEC )
return (g_iUser2 == idx);
else
return false;
}
/*
=================
EV_GetGunPosition

View file

@ -21,6 +21,7 @@ void EV_EjectBrass( float *origin, float *velocity, float rotation, int model, i
void EV_GetGunPosition( struct event_args_s *args, float *pos, float *origin );
void EV_GetDefaultShellInfo( struct event_args_s *args, float *origin, float *velocity, float *ShellVelocity, float *ShellOrigin, float *forward, float *right, float *up, float forwardScale, float upScale, float rightScale );
qboolean EV_IsLocal( int idx );
qboolean EV_IsSpec( int idx );
qboolean EV_IsPlayer( int idx );
void EV_CreateTracer( float *start, float *end );

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,77 +1,77 @@
/***
*
* Copyright (c) 1999, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
//
// hud_msg.cpp
//
#include "hud.h"
#include "cl_util.h"
#include "common/r_efx.h"
#include "mod/AvHNetworkMessages.h"
// tankefugl: duck toggle
extern bool g_bDuckToggled;
// :tankefugl
#define MAX_CLIENTS 32
#if !defined( _TFC )
extern BEAM *pBeam;
extern BEAM *pBeam2;
#endif
/// USER-DEFINED SERVER MESSAGE HANDLERS
int CHud :: MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf )
{
NetMsg_ResetHUD( pbuf, iSize );
// clear all hud data
HUDLIST *pList = m_pHudList;
while ( pList )
{
if ( pList->p )
pList->p->Reset();
pList = pList->pNext;
}
// reset sensitivity
m_flMouseSensitivity = 0;
// tankefugl: duck toggle
g_bDuckToggled = false;
// :tankefugl
return 0;
}
void CAM_ToFirstPerson(void);
void CHud :: MsgFunc_ViewMode( const char *pszName, int iSize, void *pbuf )
{
CAM_ToFirstPerson();
}
void CHud :: MsgFunc_InitHUD( const char *pszName, int iSize, void *pbuf )
{
// prepare all hud data
HUDLIST *pList = m_pHudList;
while (pList)
{
if ( pList->p )
pList->p->InitHUDData();
pList = pList->pNext;
}
}
/***
*
* Copyright (c) 1999, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
//
// hud_msg.cpp
//
#include "hud.h"
#include "cl_util.h"
#include "common/r_efx.h"
#include "mod/AvHNetworkMessages.h"
// : duck toggle
extern bool g_bDuckToggled;
// :
#define MAX_CLIENTS 32
#if !defined( _TFC )
extern BEAM *pBeam;
extern BEAM *pBeam2;
#endif
/// USER-DEFINED SERVER MESSAGE HANDLERS
int CHud :: MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf )
{
NetMsg_ResetHUD( pbuf, iSize );
// clear all hud data
HUDLIST *pList = m_pHudList;
while ( pList )
{
if ( pList->p )
pList->p->Reset();
pList = pList->pNext;
}
// reset sensitivity
m_flMouseSensitivity = 0;
// : duck toggle
g_bDuckToggled = false;
// :
return 0;
}
void CAM_ToFirstPerson(void);
void CHud :: MsgFunc_ViewMode( const char *pszName, int iSize, void *pbuf )
{
CAM_ToFirstPerson();
}
void CHud :: MsgFunc_InitHUD( const char *pszName, int iSize, void *pbuf )
{
// prepare all hud data
HUDLIST *pList = m_pHudList;
while (pList)
{
if ( pList->p )
pList->p->InitHUDData();
pList = pList->pNext;
}
}

View file

@ -390,8 +390,10 @@ int CHudSpectator::Draw(float flTime)
// draw only in spectator mode
if ( !g_iUser1 )
return 0;
// string error;
// gHUD.Update( flTime, error);
// Removed by mmcguire.
// Removed by mmcguire.
/*
// if user pressed zoom, aplly changes
if ( (m_zoomDelta != 0.0f) && ( g_iUser1 == OBS_MAP_FREE ) )
@ -515,7 +517,7 @@ void CHudSpectator::DrawOverviewMap()
theDrawInfo.mY = YRES(SPECTATOR_PANEL_HEIGHT + 4);
theDrawInfo.mWidth = ScreenWidth() - theDrawInfo.mX - XRES(4);
theDrawInfo.mHeight = ScreenHeight() - YRES(SPECTATOR_PANEL_HEIGHT + 4) - theDrawInfo.mY;
theDrawInfo.mZoomScale = 1.0f;
AvHMapExtents theMapExtents;
theOverviewMap.GetMapExtents(theMapExtents);
@ -1924,6 +1926,7 @@ void CHudSpectator::Reset()
void CHudSpectator::InitHUDData()
{
gHUD.InitHUDData();
m_lastPrimaryObject = m_lastSecondaryObject = 0;
m_flNextObserverInput = 0.0f;
m_lastHudMessage = 0;

File diff suppressed because it is too large Load diff

View file

@ -427,7 +427,7 @@ void IN_MouseMove ( float frametime, float ioRotationDeltas[3], float ioTranslat
}
}
/*
//#define TRACE_TEST
#if defined( TRACE_TEST )
{
@ -437,7 +437,7 @@ void IN_MouseMove ( float frametime, float ioRotationDeltas[3], float ioTranslat
V_Move( mx, my );
}
#endif
*/
}
/*

View file

@ -1,376 +1,378 @@
/***
*
* Copyright (c) 1999, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
//
// saytext.cpp
//
// implementation of CHudSayText class
//
#include "hud.h"
#include "cl_util.h"
#include "mod/AvHNetworkMessages.h"
#include <string.h>
#include <stdio.h>
#include "vgui_TeamFortressViewport.h"
#include "mod/AvHClientUtil.h"
#include "ui/ChatPanel.h"
float* GetClientColor(int clientIndex);
#define MAX_LINES 5
#define MAX_CHARS_PER_LINE 256 /* it can be less than this, depending on char size */
// allow 20 pixels on either side of the text
#define MAX_LINE_WIDTH ( ScreenWidth() - 40 )
#define LINE_START 10
static float SCROLL_SPEED = 5;
static char g_szLineBuffer[ MAX_LINES + 1 ][ MAX_CHARS_PER_LINE ];
static float *g_pflNameColors[ MAX_LINES + 1 ];
static int g_iNameLengths[ MAX_LINES + 1 ];
static float flScrollTime = 0; // the time at which the lines next scroll up
static int Y_START = 0;
static int line_height = 0;
DECLARE_MESSAGE( m_SayText, SayText );
int CHudSayText :: Init( void )
{
gHUD.AddHudElem( this );
HOOK_MESSAGE( SayText );
InitHUDData();
m_HUD_saytext = gEngfuncs.pfnRegisterVariable( "hud_saytext", "1", 0 );
m_HUD_saytext_time = gEngfuncs.pfnRegisterVariable( "hud_saytext_time", "5", 0 );
m_iFlags |= HUD_INTERMISSION; // is always drawn during an intermission
return 1;
}
void CHudSayText :: InitHUDData( void )
{
memset( g_szLineBuffer, 0, sizeof g_szLineBuffer );
memset( g_pflNameColors, 0, sizeof g_pflNameColors );
memset( g_iNameLengths, 0, sizeof g_iNameLengths );
}
int CHudSayText :: VidInit( void )
{
return 1;
}
int ScrollTextUp( void )
{
ConsolePrint( g_szLineBuffer[0] ); // move the first line into the console buffer
g_szLineBuffer[MAX_LINES][0] = 0;
memmove( g_szLineBuffer[0], g_szLineBuffer[1], sizeof(g_szLineBuffer) - sizeof(g_szLineBuffer[0]) ); // overwrite the first line
memmove( &g_pflNameColors[0], &g_pflNameColors[1], sizeof(g_pflNameColors) - sizeof(g_pflNameColors[0]) );
memmove( &g_iNameLengths[0], &g_iNameLengths[1], sizeof(g_iNameLengths) - sizeof(g_iNameLengths[0]) );
g_szLineBuffer[MAX_LINES-1][0] = 0;
if ( g_szLineBuffer[0][0] == ' ' ) // also scroll up following lines
{
g_szLineBuffer[0][0] = 2;
return 1 + ScrollTextUp();
}
return 1;
}
int CHudSayText :: Draw( float flTime )
{
int y = Y_START;
if ( ( gViewPort && gViewPort->AllowedToPrintText() == FALSE) || !m_HUD_saytext->value )
return 1;
// make sure the scrolltime is within reasonable bounds, to guard against the clock being reset
flScrollTime = min( flScrollTime, flTime + m_HUD_saytext_time->value );
// make sure the scrolltime is within reasonable bounds, to guard against the clock being reset
flScrollTime = min( flScrollTime, flTime + m_HUD_saytext_time->value );
if ( flScrollTime <= flTime )
{
if ( *g_szLineBuffer[0] )
{
flScrollTime = flTime + m_HUD_saytext_time->value;
// push the console up
ScrollTextUp();
}
else
{ // buffer is empty, just disable drawing of this section
m_iFlags &= ~HUD_ACTIVE;
}
}
for ( int i = 0; i < MAX_LINES; i++ )
{
if ( *g_szLineBuffer[i] )
{
if ( *g_szLineBuffer[i] == 2 && g_pflNameColors[i] )
{
// it's a saytext string
static char buf[MAX_PLAYER_NAME_LENGTH+32];
// draw the first x characters in the player color
strncpy( buf, g_szLineBuffer[i], min(g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH+32) );
buf[ min(g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH+31) ] = 0;
DrawSetTextColor( g_pflNameColors[i][0], g_pflNameColors[i][1], g_pflNameColors[i][2] );
// If we're an alien, move chat over a bit so it doesn't overlap energy bar
int theDrawX = LINE_START;
//if(gHUD.GetIsAlien())
//{
// theDrawX += .07f*ScreenWidth;
//}
int x = DrawConsoleString(theDrawX, y, buf );
// color is reset after each string draw
DrawConsoleString( x, y, g_szLineBuffer[i] + g_iNameLengths[i] );
}
else
{
// normal draw
DrawConsoleString( LINE_START, y, g_szLineBuffer[i] );
}
}
y += line_height;
}
return 1;
}
int CHudSayText :: MsgFunc_SayText( const char *pszName, int iSize, void *pbuf )
{
int client_index;
string content, location;
NetMsg_SayText( pbuf, iSize, client_index, content, location );
string theTranslatedLocation;
if(LocalizeString(location.c_str(), theTranslatedLocation))
{
// If player is on our team, add location
cl_entity_s* theEntity = gEngfuncs.GetEntityByIndex(client_index);
cl_entity_s* theLocalPlayer = gEngfuncs.GetLocalPlayer();
if(theEntity && theLocalPlayer && (theEntity->curstate.team == theLocalPlayer->curstate.team))
{
// Search for first : so we can insert location
int theColonIndex = (int)content.find_first_of(":");
if((theColonIndex > 0) && (theColonIndex < (int)content.length()))
{
AvHCUTrimExtraneousLocationText(theTranslatedLocation);
// Insert location
string theNewMessage = content.substr(0, theColonIndex);
theNewMessage += " (";
theNewMessage += theTranslatedLocation;
theNewMessage += ")";
theNewMessage += content.substr(theColonIndex);
// Replace the message with new one
content = theNewMessage;
}
}
}
SayTextPrint(content.c_str(), (int)content.length(), client_index );
return 1;
}
void CHudSayText :: SayTextPrint( const char *pszBuf, int iBufSize, int clientIndex )
{
if ( gViewPort && gViewPort->AllowedToPrintText() == FALSE )
{
// Print it straight to the console
ConsolePrint( pszBuf );
return;
}
// find an empty string slot
for ( int i = 0; i < MAX_LINES; i++ )
{
if ( ! *g_szLineBuffer[i] )
break;
}
if ( i == MAX_LINES )
{
// force scroll buffer up
ScrollTextUp();
i = MAX_LINES - 1;
}
g_iNameLengths[i] = 0;
g_pflNameColors[i] = NULL;
// if it's a say message, search for the players name in the string
if ( *pszBuf == 2 && clientIndex > 0 )
{
GetPlayerInfo( clientIndex, &g_PlayerInfoList[clientIndex] );
const char *pName = g_PlayerInfoList[clientIndex].name;
if ( pName )
{
const char *nameInString = strstr( pszBuf, pName );
if ( nameInString )
{
g_iNameLengths[i] = (int)strlen( pName ) + (nameInString - pszBuf);
g_pflNameColors[i] = GetClientColor(clientIndex);
}
}
}
strncpy( g_szLineBuffer[i], pszBuf, min(iBufSize -1, MAX_CHARS_PER_LINE-1) );
// make sure the text fits in one line
EnsureTextFitsInOneLineAndWrapIfHaveTo( i );
// Set scroll time
if ( i == 0 )
{
flScrollTime = gHUD.m_flTime + m_HUD_saytext_time->value;
}
m_iFlags |= HUD_ACTIVE;
//PlaySound( "misc/talk.wav", 1 );
gHUD.PlayHUDSound("misc/talk.wav", 1);
Y_START = ScreenHeight()*.7f;
ChatPanel* theChatPanel = gViewPort->GetChatPanel();
if (theChatPanel != NULL)
{
int theX;
int theY;
int theWidth;
int theHeight;
gViewPort->GetChatPanel()->getPos(theX, theY);
gViewPort->GetChatPanel()->getSize(theWidth, theHeight);
//Y_START = theY + theHeight + 5; //voogru: this is too high imo.
//KGP: then move the viewport
Y_START = theY + theHeight + 5;
}
}
void CHudSayText :: EnsureTextFitsInOneLineAndWrapIfHaveTo( int line )
{
int line_width = 0;
GetConsoleStringSize( g_szLineBuffer[line], &line_width, &line_height );
if ( (line_width + LINE_START) > MAX_LINE_WIDTH )
{ // string is too long to fit on line
// scan the string until we find what word is too long, and wrap the end of the sentence after the word
int length = LINE_START;
int tmp_len = 0;
char *last_break = NULL;
for ( char *x = g_szLineBuffer[line]; *x != 0; x++ )
{
// check for a color change, if so skip past it
if ( x[0] == '/' && x[1] == '(' )
{
x += 2;
// skip forward until past mode specifier
while ( *x != 0 && *x != ')' )
x++;
if ( *x != 0 )
x++;
if ( *x == 0 )
break;
}
char buf[2];
buf[1] = 0;
if ( *x == ' ' && x != g_szLineBuffer[line] ) // store each line break, except for the very first character
last_break = x;
buf[0] = *x; // get the length of the current character
GetConsoleStringSize( buf, &tmp_len, &line_height );
length += tmp_len;
if ( length > MAX_LINE_WIDTH )
{ // needs to be broken up
if ( !last_break )
last_break = x-1;
x = last_break;
// find an empty string slot
int j;
do
{
for ( j = 0; j < MAX_LINES; j++ )
{
if ( ! *g_szLineBuffer[j] )
break;
}
if ( j == MAX_LINES )
{
// need to make more room to display text, scroll stuff up then fix the pointers
int linesmoved = ScrollTextUp();
line -= linesmoved;
last_break = last_break - (sizeof(g_szLineBuffer[0]) * linesmoved);
}
}
while ( j == MAX_LINES );
// copy remaining string into next buffer, making sure it starts with a space character
if ( (char)*last_break == (char)' ' )
{
int linelen = (int)strlen(g_szLineBuffer[j]);
int remaininglen = (int)strlen(last_break);
if ( (linelen - remaininglen) <= MAX_CHARS_PER_LINE )
strcat( g_szLineBuffer[j], last_break );
}
else
{
if ( (strlen(g_szLineBuffer[j]) - strlen(last_break) - 2) < MAX_CHARS_PER_LINE )
{
strcat( g_szLineBuffer[j], " " );
strcat( g_szLineBuffer[j], last_break );
}
}
*last_break = 0; // cut off the last string
EnsureTextFitsInOneLineAndWrapIfHaveTo( j );
break;
}
}
}
/***
*
* Copyright (c) 1999, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
//
// saytext.cpp
//
// implementation of CHudSayText class
//
#include "hud.h"
#include "cl_util.h"
#include "mod/AvHNetworkMessages.h"
#include <string.h>
#include <stdio.h>
#include "vgui_TeamFortressViewport.h"
#include "mod/AvHClientUtil.h"
#include "ui/ChatPanel.h"
float* GetClientColor(int clientIndex);
#define MAX_LINES 5
#define MAX_CHARS_PER_LINE 256 /* it can be less than this, depending on char size */
// allow 20 pixels on either side of the text
#define MAX_LINE_WIDTH ( ScreenWidth() - 40 )
#define LINE_START 10
static float SCROLL_SPEED = 5;
static char g_szLineBuffer[ MAX_LINES + 1 ][ MAX_CHARS_PER_LINE ];
static float *g_pflNameColors[ MAX_LINES + 1 ];
static int g_iNameLengths[ MAX_LINES + 1 ];
static float flScrollTime = 0; // the time at which the lines next scroll up
static int Y_START = 0;
static int line_height = 0;
DECLARE_MESSAGE( m_SayText, SayText );
int CHudSayText :: Init( void )
{
gHUD.AddHudElem( this );
HOOK_MESSAGE( SayText );
InitHUDData();
m_HUD_saytext = gEngfuncs.pfnRegisterVariable( "hud_saytext", "1", 0 );
m_HUD_saytext_time = gEngfuncs.pfnRegisterVariable( "hud_saytext_time", "5", 0 );
m_iFlags |= HUD_INTERMISSION; // is always drawn during an intermission
return 1;
}
void CHudSayText :: InitHUDData( void )
{
memset( g_szLineBuffer, 0, sizeof g_szLineBuffer );
memset( g_pflNameColors, 0, sizeof g_pflNameColors );
memset( g_iNameLengths, 0, sizeof g_iNameLengths );
}
int CHudSayText :: VidInit( void )
{
return 1;
}
int ScrollTextUp( void )
{
ConsolePrint( g_szLineBuffer[0] ); // move the first line into the console buffer
g_szLineBuffer[MAX_LINES][0] = 0;
memmove( g_szLineBuffer[0], g_szLineBuffer[1], sizeof(g_szLineBuffer) - sizeof(g_szLineBuffer[0]) ); // overwrite the first line
memmove( &g_pflNameColors[0], &g_pflNameColors[1], sizeof(g_pflNameColors) - sizeof(g_pflNameColors[0]) );
memmove( &g_iNameLengths[0], &g_iNameLengths[1], sizeof(g_iNameLengths) - sizeof(g_iNameLengths[0]) );
g_szLineBuffer[MAX_LINES-1][0] = 0;
if ( g_szLineBuffer[0][0] == ' ' ) // also scroll up following lines
{
g_szLineBuffer[0][0] = 2;
return 1 + ScrollTextUp();
}
return 1;
}
int CHudSayText :: Draw( float flTime )
{
int y = Y_START;
if ( ( gViewPort && gViewPort->AllowedToPrintText() == FALSE) || !m_HUD_saytext->value )
return 1;
// make sure the scrolltime is within reasonable bounds, to guard against the clock being reset
flScrollTime = min( flScrollTime, flTime + m_HUD_saytext_time->value );
// make sure the scrolltime is within reasonable bounds, to guard against the clock being reset
flScrollTime = min( flScrollTime, flTime + m_HUD_saytext_time->value );
if ( flScrollTime <= flTime )
{
if ( *g_szLineBuffer[0] )
{
flScrollTime = flTime + m_HUD_saytext_time->value;
// push the console up
ScrollTextUp();
}
else
{ // buffer is empty, just disable drawing of this section
m_iFlags &= ~HUD_ACTIVE;
}
}
for ( int i = 0; i < MAX_LINES; i++ )
{
if ( *g_szLineBuffer[i] )
{
if ( *g_szLineBuffer[i] == 2 && g_pflNameColors[i] )
{
// it's a saytext string
static char buf[MAX_PLAYER_NAME_LENGTH+32];
// draw the first x characters in the player color
strncpy( buf, g_szLineBuffer[i], min(g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH+32) );
buf[ min(g_iNameLengths[i], MAX_PLAYER_NAME_LENGTH+31) ] = 0;
DrawSetTextColor( g_pflNameColors[i][0], g_pflNameColors[i][1], g_pflNameColors[i][2] );
// If we're an alien, move chat over a bit so it doesn't overlap energy bar
int theDrawX = LINE_START;
//if(gHUD.GetIsAlien())
//{
// theDrawX += .07f*ScreenWidth;
//}
int x = DrawConsoleString(theDrawX, y, buf );
// color is reset after each string draw
DrawConsoleString( x, y, g_szLineBuffer[i] + g_iNameLengths[i] );
}
else
{
// normal draw
DrawConsoleString( LINE_START, y, g_szLineBuffer[i] );
}
}
y += line_height;
}
return 1;
}
int CHudSayText :: MsgFunc_SayText( const char *pszName, int iSize, void *pbuf )
{
int client_index;
string content, location;
NetMsg_SayText( pbuf, iSize, client_index, content, location );
string theTranslatedLocation;
if(LocalizeString(location.c_str(), theTranslatedLocation))
{
// If player is on our team, add location
cl_entity_s* theEntity = gEngfuncs.GetEntityByIndex(client_index);
cl_entity_s* theLocalPlayer = gEngfuncs.GetLocalPlayer();
if(theEntity && theLocalPlayer && (theEntity->curstate.team == theLocalPlayer->curstate.team))
{
// Search for first : so we can insert location
int theColonIndex = (int)content.find_first_of(":");
if((theColonIndex > 0) && (theColonIndex < (int)content.length()))
{
AvHCUTrimExtraneousLocationText(theTranslatedLocation);
// Insert location
string theNewMessage = content.substr(0, theColonIndex);
theNewMessage += " (";
theNewMessage += theTranslatedLocation;
theNewMessage += ")";
theNewMessage += content.substr(theColonIndex);
// Replace the message with new one
content = theNewMessage;
}
}
}
SayTextPrint(content.c_str(), (int)content.length(), client_index );
return 1;
}
void CHudSayText :: SayTextPrint( const char *pszBuf, int iBufSize, int clientIndex )
{
if ( gViewPort && gViewPort->AllowedToPrintText() == FALSE )
{
// Print it straight to the console
ConsolePrint( pszBuf );
return;
}
// find an empty string slot
for ( int i = 0; i < MAX_LINES; i++ )
{
if ( ! *g_szLineBuffer[i] )
break;
}
if ( i == MAX_LINES )
{
// force scroll buffer up
ScrollTextUp();
i = MAX_LINES - 1;
}
g_iNameLengths[i] = 0;
g_pflNameColors[i] = NULL;
// if it's a say message, search for the players name in the string
if ( *pszBuf == 2 && clientIndex > 0 )
{
GetPlayerInfo( clientIndex, &g_PlayerInfoList[clientIndex] );
const char *pName = g_PlayerInfoList[clientIndex].name;
if ( pName )
{
const char *nameInString = strstr( pszBuf, pName );
if ( nameInString )
{
g_iNameLengths[i] = (int)strlen( pName ) + (nameInString - pszBuf);
g_pflNameColors[i] = GetClientColor(clientIndex);
}
}
}
// : 0001087
// don't strip last character ( often resulted in no carriage returns in the log )
strncpy( g_szLineBuffer[i], pszBuf, min(iBufSize, MAX_CHARS_PER_LINE-1) );
// make sure the text fits in one line
EnsureTextFitsInOneLineAndWrapIfHaveTo( i );
// Set scroll time
if ( i == 0 )
{
flScrollTime = gHUD.m_flTime + m_HUD_saytext_time->value;
}
m_iFlags |= HUD_ACTIVE;
//PlaySound( "misc/talk.wav", 1 );
gHUD.PlayHUDSound("misc/talk.wav", 1);
Y_START = ScreenHeight()*.7f;
ChatPanel* theChatPanel = gViewPort->GetChatPanel();
if (theChatPanel != NULL)
{
int theX;
int theY;
int theWidth;
int theHeight;
gViewPort->GetChatPanel()->getPos(theX, theY);
gViewPort->GetChatPanel()->getSize(theWidth, theHeight);
//Y_START = theY + theHeight + 5; //: this is too high imo.
//KGP: then move the viewport
Y_START = theY + theHeight + 5;
}
}
void CHudSayText :: EnsureTextFitsInOneLineAndWrapIfHaveTo( int line )
{
int line_width = 0;
GetConsoleStringSize( g_szLineBuffer[line], &line_width, &line_height );
if ( (line_width + LINE_START) > MAX_LINE_WIDTH )
{ // string is too long to fit on line
// scan the string until we find what word is too long, and wrap the end of the sentence after the word
int length = LINE_START;
int tmp_len = 0;
char *last_break = NULL;
for ( char *x = g_szLineBuffer[line]; *x != 0; x++ )
{
// check for a color change, if so skip past it
if ( x[0] == '/' && x[1] == '(' )
{
x += 2;
// skip forward until past mode specifier
while ( *x != 0 && *x != ')' )
x++;
if ( *x != 0 )
x++;
if ( *x == 0 )
break;
}
char buf[2];
buf[1] = 0;
if ( *x == ' ' && x != g_szLineBuffer[line] ) // store each line break, except for the very first character
last_break = x;
buf[0] = *x; // get the length of the current character
GetConsoleStringSize( buf, &tmp_len, &line_height );
length += tmp_len;
if ( length > MAX_LINE_WIDTH )
{ // needs to be broken up
if ( !last_break )
last_break = x-1;
x = last_break;
// find an empty string slot
int j;
do
{
for ( j = 0; j < MAX_LINES; j++ )
{
if ( ! *g_szLineBuffer[j] )
break;
}
if ( j == MAX_LINES )
{
// need to make more room to display text, scroll stuff up then fix the pointers
int linesmoved = ScrollTextUp();
line -= linesmoved;
last_break = last_break - (sizeof(g_szLineBuffer[0]) * linesmoved);
}
}
while ( j == MAX_LINES );
// copy remaining string into next buffer, making sure it starts with a space character
if ( (char)*last_break == (char)' ' )
{
int linelen = (int)strlen(g_szLineBuffer[j]);
int remaininglen = (int)strlen(last_break);
if ( (linelen - remaininglen) <= MAX_CHARS_PER_LINE )
strcat( g_szLineBuffer[j], last_break );
}
else
{
if ( (strlen(g_szLineBuffer[j]) - strlen(last_break) - 2) < MAX_CHARS_PER_LINE )
{
strcat( g_szLineBuffer[j], " " );
strcat( g_szLineBuffer[j], last_break );
}
}
*last_break = 0; // cut off the last string
EnsureTextFitsInOneLineAndWrapIfHaveTo( j );
break;
}
}
}
}

View file

@ -162,7 +162,7 @@ int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf
int destination;
StringList message;
NetMsg_TextMsg( pbuf, iSize, destination, message );
if ( gViewPort && gViewPort->AllowedToPrintText() == FALSE )
return 1;
@ -176,6 +176,24 @@ int CHudTextMessage::MsgFunc_TextMsg( const char *pszName, int iSize, void *pbuf
psz[0] = 1;
origin = psz + 1;
}
// Ensure that message[0] does not contain exessive %'s, max 4x%s, all other %'s removed.
size_t lastpos = 0; size_t pos; int count = 0;
while(true)
{
pos = message[0].find("%", lastpos);
if (pos == string::npos)
break;
if ((message[0].substr(pos + 1, 1) == "s") && (count < 4))
count++;
else
message[0].replace(pos, 1, " ");
lastpos = pos + 1;
}
sprintf( origin, message[0].c_str(), message[1].c_str(), message[2].c_str(), message[3].c_str(), message[4].c_str() );
ConvertCRtoNL(psz);

File diff suppressed because it is too large Load diff

View file

@ -20,13 +20,16 @@
#define COLUMN_RANK_ICON 1
#define COLUMN_NAME 2
#define COLUMN_CLASS 3
#define COLUMN_SCORE 4
#define COLUMN_KILLS 5
#define COLUMN_DEATHS 6
#define COLUMN_LATENCY 7
#define COLUMN_VOICE 8
#define COLUMN_BLANK 9
#define NUM_COLUMNS 10
#define COLUMN_EXTRA 4
#define COLUMN_WELD 5
#define COLUMN_MINE 6
#define COLUMN_SCORE 7
#define COLUMN_KILLS 8
#define COLUMN_DEATHS 9
#define COLUMN_LATENCY 10
#define COLUMN_VOICE 11
#define COLUMN_BLANK 12
#define NUM_COLUMNS 13
#define NUM_ROWS (MAX_PLAYERS + (MAX_SCOREBOARD_TEAMS * 2))
using namespace vgui;
@ -86,6 +89,13 @@ private:
vgui::BitmapTGA *m_pContribIcon;
vgui::BitmapTGA *m_pCheatingDeathIcon;
vgui::BitmapTGA *m_pVeteranIcon;
vgui::BitmapTGA *m_pHMG;
vgui::BitmapTGA *m_pMine;
vgui::BitmapTGA *m_pWeld;
vgui::BitmapTGA *m_pGL;
vgui::BitmapTGA *m_pSG;
vector< pair <vgui::BitmapTGA *, string> > m_CustomIconList;
unsigned int m_iIconFrame;

View file

@ -89,15 +89,15 @@ void SpectatorPanel::StateChanged(CCheckButton2* pButton)
gHUD.m_Spectator.SetMode(theMode);
if (m_autoDirectorButton != NULL)
if (m_autoDirectorButton != NULL && pButton == m_autoDirectorButton )
{
if (m_autoDirectorButton->IsChecked())
{
gEngfuncs.Cvar_SetValue("spec_autodirector", 1);
gEngfuncs.Cvar_SetValue("spec_autodirector", 0);
}
else
{
gEngfuncs.Cvar_SetValue("spec_autodirector", 0);
gEngfuncs.Cvar_SetValue("spec_autodirector", 1);
}
}

File diff suppressed because it is too large Load diff

View file

@ -7,6 +7,7 @@
// view/refresh setup functions
#include "hud.h"
#include "cl_util.h"
#include "common/cvardef.h"
@ -20,6 +21,7 @@
#include "pm_shared/pm_movevars.h"
#include "pm_shared/pm_shared.h"
#include "pm_shared/pm_defs.h"
#include "pm_shared/pm_debug.h"
#include "common/event_api.h"
#include "common/pmtrace.h"
#include "common/screenfade.h"
@ -41,8 +43,8 @@ extern float gTopDownViewAngles[3];
#ifndef M_PI
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
#endif
void PM_ParticleLine( float *start, float *end, int pcolor, float life, float vert);
//#include "pm_shared/pm_debug.h"
//void PM_ParticleLine(vec3_t start, vec3_t end, int pcolor, float life, float vert);
int PM_GetVisEntInfo( int ent );
int PM_GetPhysEntInfo( int ent );
void InterpolateAngles( float *start, float *end, float *output, float frac );
@ -2385,7 +2387,32 @@ float CalcFov (float fov_x, float width, float height)
}
int hitent = -1;
extern playermove_t *pmove;
void PM_ParticleLine(vec3_t start, vec3_t end, int pcolor, float life, float vert)
{
float linestep = 2.0f;
float curdist;
float len;
vec3_t curpos;
vec3_t diff;
int i;
// Determine distance;
VectorSubtract(end, start, diff);
len = VectorNormalize(diff);
curdist = 0;
while (curdist <= len)
{
for (i = 0; i < 3; i++)
curpos[i] = start[i] + curdist * diff[i];
pmove->PM_Particle( curpos, pcolor, life, 0, vert);
curdist += linestep;
}
}
void V_Move( int mx, int my )
{
float fov;
@ -2399,10 +2426,10 @@ void V_Move( int mx, int my )
vec3_t farpoint;
pmtrace_t tr;
fov = CalcFov( in_fov, (float)ScreenWidth, (float)ScreenHeight );
fov = CalcFov( in_fov, (float)ScreenWidth(), (float)ScreenHeight() );
c_x = (float)ScreenWidth / 2.0;
c_y = (float)ScreenHeight / 2.0;
c_x = (float)ScreenWidth() / 2.0;
c_y = (float)ScreenHeight() / 2.0;
dx = (float)mx - c_x;
dy = (float)my - c_y;
@ -2430,7 +2457,7 @@ void V_Move( int mx, int my )
if ( tr.fraction != 1.0 && tr.ent != 0 )
{
hitent = PM_GetPhysEntInfo( tr.ent );
PM_ParticleLine( (float *)&v_origin, (float *)&tr.endpos, 5, 1.0, 0.0 );
PM_ParticleLine( (vec3_t)v_origin, (vec3_t)tr.endpos, 5, 1.0, 0.0 );
}
else
{

View file

@ -25,6 +25,7 @@
#include "cbase.h"
#include "doors.h"
#include "mod/AvHSpecials.h"
#include "mod/AvHServerVariables.h"
extern DLL_GLOBAL Vector g_vecAttackDir;
@ -255,7 +256,7 @@ LINK_ENTITY_TO_CLASS( func_monsterclip, CFuncMonsterClip );
void CFuncMonsterClip::Spawn( void )
{
CFuncWall::Spawn();
if ( CVAR_GET_FLOAT("showtriggers") == 0 )
if ( ns_cvar_float(showtriggers) == 0 )
pev->effects = EF_NODRAW;
pev->flags |= FL_MONSTERCLIP;
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -22,6 +22,8 @@
#include "decals.h"
#include "func_break.h"
#include "engine/shake.h"
#include "mod/AvHServerVariables.h"
extern cvar_t avh_killdelay;
#define SF_GIBSHOOTER_REPEATABLE 1 // allows a gibshooter to be refired
@ -1454,7 +1456,7 @@ void CGibShooter::Spawn( void )
CGib *CGibShooter :: CreateGib ( void )
{
if ( CVAR_GET_FLOAT("violence_hgibs") == 0 )
if ( ns_cvar_float(violence_hgibs) == 0 )
return NULL;
CGib *pGib = GetClassPtr( (CGib *)NULL );

View file

@ -82,6 +82,15 @@ ENGINE_FORCE_UNMODIFIED(force_exactfile, NULL, NULL, s);
(*g_engfuncs.pfnPrecacheModel)(s);
#endif
#ifdef AVH_SERVER
#define PRECACHE_UNMODIFIED_GENERIC(s) \
(*g_engfuncs.pfnPrecacheGeneric)(s); \
ENGINE_FORCE_UNMODIFIED(force_exactfile, NULL, NULL, s);
#else
#define PRECACHE_UNMODIFIED_GENERIC(s) \
(*g_engfuncs.pfnPrecacheGeneric)(s);
#endif
#ifdef AVH_SERVER
#define PRECACHE_UNMODIFIED_SOUND(s) \
(*g_engfuncs.pfnPrecacheSound)(s); \

View file

@ -110,6 +110,7 @@ cvar_t avh_team1damagepercent = {kvTeam1DamagePercent, "100", FCVAR_SERVER}
cvar_t avh_team2damagepercent = {kvTeam2DamagePercent, "100", FCVAR_SERVER};
cvar_t avh_team3damagepercent = {kvTeam3DamagePercent, "100", FCVAR_SERVER};
cvar_t avh_team4damagepercent = {kvTeam4DamagePercent, "100", FCVAR_SERVER};
cvar_t avh_structurelimit = {kvStructureLimit, "300", FCVAR_SERVER};
cvar_t avh_votecasttime = {kvVoteCastTime, "2", FCVAR_SERVER};
cvar_t avh_votedowntime = {kvVoteDownTime, "180", FCVAR_SERVER};
cvar_t avh_minvotesneeded = {kvMinVotesNeeded, "2", FCVAR_SERVER};
@ -120,6 +121,15 @@ cvar_t avh_autoconcede = {kvAutoConcede, "4", FCVAR_SERVER};
cvar_t avh_combattime = {kvCombatTime, "10", FCVAR_SERVER};
cvar_t avh_mapvoteratio = {kvMapVoteRatio, ".6", FCVAR_SERVER};
cvar_t avh_blockscripts = {kvBlockScripts, "1", FCVAR_SERVER};
#ifdef DEBUG
cvar_t avh_testing = {kvTesting, "0", FCVAR_SERVER};
#endif
cvar_t *avh_cheats=0;
cvar_t *showtriggers=0;
cvar_t *violence_ablood=0;
cvar_t *violence_agibs=0;
cvar_t *violence_hblood=0;
cvar_t *violence_hgibs=0;
// TODO: Remove
cvar_t avh_ironman = {kvIronMan, "0", FCVAR_SERVER};
@ -130,7 +140,6 @@ cvar_t avh_spawninvulnerabletime = {kvSpawnInvulnerableTime, "0", FCVAR_SERVER};
cvar_t avh_trainingmode = {kvTrainingMode,"0", FCVAR_SERVER };
cvar_t avh_assert = {kvAssert, "1", FCVAR_SERVER };
cvar_t avh_bulletcam = {kvBulletCam, "0", FCVAR_SERVER };
cvar_t avh_testing = {kvTesting, "0", FCVAR_SERVER };
cvar_t avh_drawinvisible = {kvDrawInvisible, "0", FCVAR_SERVER };
cvar_t avh_serverscripts = {kvServerScripts, "0", FCVAR_SERVER};
#endif
@ -154,406 +163,6 @@ cvar_t *g_psv_gravity = NULL;
cvar_t *g_psv_aim = NULL;
cvar_t *g_footsteps = NULL;
//CVARS FOR SKILL LEVEL SETTINGS
// Agrunt
cvar_t sk_agrunt_health1 = {"sk_agrunt_health1","0"};
cvar_t sk_agrunt_health2 = {"sk_agrunt_health2","0"};
cvar_t sk_agrunt_health3 = {"sk_agrunt_health3","0"};
cvar_t sk_agrunt_dmg_punch1 = {"sk_agrunt_dmg_punch1","0"};
cvar_t sk_agrunt_dmg_punch2 = {"sk_agrunt_dmg_punch2","0"};
cvar_t sk_agrunt_dmg_punch3 = {"sk_agrunt_dmg_punch3","0"};
// Apache
cvar_t sk_apache_health1 = {"sk_apache_health1","0"};
cvar_t sk_apache_health2 = {"sk_apache_health2","0"};
cvar_t sk_apache_health3 = {"sk_apache_health3","0"};
// Barney
cvar_t sk_barney_health1 = {"sk_barney_health1","0"};
cvar_t sk_barney_health2 = {"sk_barney_health2","0"};
cvar_t sk_barney_health3 = {"sk_barney_health3","0"};
// Bullsquid
cvar_t sk_bullsquid_health1 = {"sk_bullsquid_health1","0"};
cvar_t sk_bullsquid_health2 = {"sk_bullsquid_health2","0"};
cvar_t sk_bullsquid_health3 = {"sk_bullsquid_health3","0"};
cvar_t sk_bullsquid_dmg_bite1 = {"sk_bullsquid_dmg_bite1","0"};
cvar_t sk_bullsquid_dmg_bite2 = {"sk_bullsquid_dmg_bite2","0"};
cvar_t sk_bullsquid_dmg_bite3 = {"sk_bullsquid_dmg_bite3","0"};
cvar_t sk_bullsquid_dmg_whip1 = {"sk_bullsquid_dmg_whip1","0"};
cvar_t sk_bullsquid_dmg_whip2 = {"sk_bullsquid_dmg_whip2","0"};
cvar_t sk_bullsquid_dmg_whip3 = {"sk_bullsquid_dmg_whip3","0"};
cvar_t sk_bullsquid_dmg_spit1 = {"sk_bullsquid_dmg_spit1","0"};
cvar_t sk_bullsquid_dmg_spit2 = {"sk_bullsquid_dmg_spit2","0"};
cvar_t sk_bullsquid_dmg_spit3 = {"sk_bullsquid_dmg_spit3","0"};
// Big Momma
cvar_t sk_bigmomma_health_factor1 = {"sk_bigmomma_health_factor1","1.0"};
cvar_t sk_bigmomma_health_factor2 = {"sk_bigmomma_health_factor2","1.0"};
cvar_t sk_bigmomma_health_factor3 = {"sk_bigmomma_health_factor3","1.0"};
cvar_t sk_bigmomma_dmg_slash1 = {"sk_bigmomma_dmg_slash1","50"};
cvar_t sk_bigmomma_dmg_slash2 = {"sk_bigmomma_dmg_slash2","50"};
cvar_t sk_bigmomma_dmg_slash3 = {"sk_bigmomma_dmg_slash3","50"};
cvar_t sk_bigmomma_dmg_blast1 = {"sk_bigmomma_dmg_blast1","100"};
cvar_t sk_bigmomma_dmg_blast2 = {"sk_bigmomma_dmg_blast2","100"};
cvar_t sk_bigmomma_dmg_blast3 = {"sk_bigmomma_dmg_blast3","100"};
cvar_t sk_bigmomma_radius_blast1 = {"sk_bigmomma_radius_blast1","250"};
cvar_t sk_bigmomma_radius_blast2 = {"sk_bigmomma_radius_blast2","250"};
cvar_t sk_bigmomma_radius_blast3 = {"sk_bigmomma_radius_blast3","250"};
// Gargantua
cvar_t sk_gargantua_health1 = {"sk_gargantua_health1","0"};
cvar_t sk_gargantua_health2 = {"sk_gargantua_health2","0"};
cvar_t sk_gargantua_health3 = {"sk_gargantua_health3","0"};
cvar_t sk_gargantua_dmg_slash1 = {"sk_gargantua_dmg_slash1","0"};
cvar_t sk_gargantua_dmg_slash2 = {"sk_gargantua_dmg_slash2","0"};
cvar_t sk_gargantua_dmg_slash3 = {"sk_gargantua_dmg_slash3","0"};
cvar_t sk_gargantua_dmg_fire1 = {"sk_gargantua_dmg_fire1","0"};
cvar_t sk_gargantua_dmg_fire2 = {"sk_gargantua_dmg_fire2","0"};
cvar_t sk_gargantua_dmg_fire3 = {"sk_gargantua_dmg_fire3","0"};
cvar_t sk_gargantua_dmg_stomp1 = {"sk_gargantua_dmg_stomp1","0"};
cvar_t sk_gargantua_dmg_stomp2 = {"sk_gargantua_dmg_stomp2","0"};
cvar_t sk_gargantua_dmg_stomp3 = {"sk_gargantua_dmg_stomp3","0"};
// Hassassin
cvar_t sk_hassassin_health1 = {"sk_hassassin_health1","0"};
cvar_t sk_hassassin_health2 = {"sk_hassassin_health2","0"};
cvar_t sk_hassassin_health3 = {"sk_hassassin_health3","0"};
// Headcrab
cvar_t sk_headcrab_health1 = {"sk_headcrab_health1","0"};
cvar_t sk_headcrab_health2 = {"sk_headcrab_health2","0"};
cvar_t sk_headcrab_health3 = {"sk_headcrab_health3","0"};
cvar_t sk_headcrab_dmg_bite1 = {"sk_headcrab_dmg_bite1","0"};
cvar_t sk_headcrab_dmg_bite2 = {"sk_headcrab_dmg_bite2","0"};
cvar_t sk_headcrab_dmg_bite3 = {"sk_headcrab_dmg_bite3","0"};
// Hgrunt
cvar_t sk_hgrunt_health1 = {"sk_hgrunt_health1","0"};
cvar_t sk_hgrunt_health2 = {"sk_hgrunt_health2","0"};
cvar_t sk_hgrunt_health3 = {"sk_hgrunt_health3","0"};
cvar_t sk_hgrunt_kick1 = {"sk_hgrunt_kick1","0"};
cvar_t sk_hgrunt_kick2 = {"sk_hgrunt_kick2","0"};
cvar_t sk_hgrunt_kick3 = {"sk_hgrunt_kick3","0"};
cvar_t sk_hgrunt_pellets1 = {"sk_hgrunt_pellets1","0"};
cvar_t sk_hgrunt_pellets2 = {"sk_hgrunt_pellets2","0"};
cvar_t sk_hgrunt_pellets3 = {"sk_hgrunt_pellets3","0"};
cvar_t sk_hgrunt_gspeed1 = {"sk_hgrunt_gspeed1","0"};
cvar_t sk_hgrunt_gspeed2 = {"sk_hgrunt_gspeed2","0"};
cvar_t sk_hgrunt_gspeed3 = {"sk_hgrunt_gspeed3","0"};
// Houndeye
cvar_t sk_houndeye_health1 = {"sk_houndeye_health1","0"};
cvar_t sk_houndeye_health2 = {"sk_houndeye_health2","0"};
cvar_t sk_houndeye_health3 = {"sk_houndeye_health3","0"};
cvar_t sk_houndeye_dmg_blast1 = {"sk_houndeye_dmg_blast1","0"};
cvar_t sk_houndeye_dmg_blast2 = {"sk_houndeye_dmg_blast2","0"};
cvar_t sk_houndeye_dmg_blast3 = {"sk_houndeye_dmg_blast3","0"};
// ISlave
cvar_t sk_islave_health1 = {"sk_islave_health1","0"};
cvar_t sk_islave_health2 = {"sk_islave_health2","0"};
cvar_t sk_islave_health3 = {"sk_islave_health3","0"};
cvar_t sk_islave_dmg_claw1 = {"sk_islave_dmg_claw1","0"};
cvar_t sk_islave_dmg_claw2 = {"sk_islave_dmg_claw2","0"};
cvar_t sk_islave_dmg_claw3 = {"sk_islave_dmg_claw3","0"};
cvar_t sk_islave_dmg_clawrake1 = {"sk_islave_dmg_clawrake1","0"};
cvar_t sk_islave_dmg_clawrake2 = {"sk_islave_dmg_clawrake2","0"};
cvar_t sk_islave_dmg_clawrake3 = {"sk_islave_dmg_clawrake3","0"};
cvar_t sk_islave_dmg_zap1 = {"sk_islave_dmg_zap1","0"};
cvar_t sk_islave_dmg_zap2 = {"sk_islave_dmg_zap2","0"};
cvar_t sk_islave_dmg_zap3 = {"sk_islave_dmg_zap3","0"};
// Icthyosaur
cvar_t sk_ichthyosaur_health1 = {"sk_ichthyosaur_health1","0"};
cvar_t sk_ichthyosaur_health2 = {"sk_ichthyosaur_health2","0"};
cvar_t sk_ichthyosaur_health3 = {"sk_ichthyosaur_health3","0"};
cvar_t sk_ichthyosaur_shake1 = {"sk_ichthyosaur_shake1","0"};
cvar_t sk_ichthyosaur_shake2 = {"sk_ichthyosaur_shake2","0"};
cvar_t sk_ichthyosaur_shake3 = {"sk_ichthyosaur_shake3","0"};
// Leech
cvar_t sk_leech_health1 = {"sk_leech_health1","0"};
cvar_t sk_leech_health2 = {"sk_leech_health2","0"};
cvar_t sk_leech_health3 = {"sk_leech_health3","0"};
cvar_t sk_leech_dmg_bite1 = {"sk_leech_dmg_bite1","0"};
cvar_t sk_leech_dmg_bite2 = {"sk_leech_dmg_bite2","0"};
cvar_t sk_leech_dmg_bite3 = {"sk_leech_dmg_bite3","0"};
// Controller
cvar_t sk_controller_health1 = {"sk_controller_health1","0"};
cvar_t sk_controller_health2 = {"sk_controller_health2","0"};
cvar_t sk_controller_health3 = {"sk_controller_health3","0"};
cvar_t sk_controller_dmgzap1 = {"sk_controller_dmgzap1","0"};
cvar_t sk_controller_dmgzap2 = {"sk_controller_dmgzap2","0"};
cvar_t sk_controller_dmgzap3 = {"sk_controller_dmgzap3","0"};
cvar_t sk_controller_speedball1 = {"sk_controller_speedball1","0"};
cvar_t sk_controller_speedball2 = {"sk_controller_speedball2","0"};
cvar_t sk_controller_speedball3 = {"sk_controller_speedball3","0"};
cvar_t sk_controller_dmgball1 = {"sk_controller_dmgball1","0"};
cvar_t sk_controller_dmgball2 = {"sk_controller_dmgball2","0"};
cvar_t sk_controller_dmgball3 = {"sk_controller_dmgball3","0"};
// Nihilanth
cvar_t sk_nihilanth_health1 = {"sk_nihilanth_health1","0"};
cvar_t sk_nihilanth_health2 = {"sk_nihilanth_health2","0"};
cvar_t sk_nihilanth_health3 = {"sk_nihilanth_health3","0"};
cvar_t sk_nihilanth_zap1 = {"sk_nihilanth_zap1","0"};
cvar_t sk_nihilanth_zap2 = {"sk_nihilanth_zap2","0"};
cvar_t sk_nihilanth_zap3 = {"sk_nihilanth_zap3","0"};
// Scientist
cvar_t sk_scientist_health1 = {"sk_scientist_health1","0"};
cvar_t sk_scientist_health2 = {"sk_scientist_health2","0"};
cvar_t sk_scientist_health3 = {"sk_scientist_health3","0"};
// Snark
cvar_t sk_snark_health1 = {"sk_snark_health1","0"};
cvar_t sk_snark_health2 = {"sk_snark_health2","0"};
cvar_t sk_snark_health3 = {"sk_snark_health3","0"};
cvar_t sk_snark_dmg_bite1 = {"sk_snark_dmg_bite1","0"};
cvar_t sk_snark_dmg_bite2 = {"sk_snark_dmg_bite2","0"};
cvar_t sk_snark_dmg_bite3 = {"sk_snark_dmg_bite3","0"};
cvar_t sk_snark_dmg_pop1 = {"sk_snark_dmg_pop1","0"};
cvar_t sk_snark_dmg_pop2 = {"sk_snark_dmg_pop2","0"};
cvar_t sk_snark_dmg_pop3 = {"sk_snark_dmg_pop3","0"};
// Zombie
cvar_t sk_zombie_health1 = {"sk_zombie_health1","0"};
cvar_t sk_zombie_health2 = {"sk_zombie_health2","0"};
cvar_t sk_zombie_health3 = {"sk_zombie_health3","0"};
cvar_t sk_zombie_dmg_one_slash1 = {"sk_zombie_dmg_one_slash1","0"};
cvar_t sk_zombie_dmg_one_slash2 = {"sk_zombie_dmg_one_slash2","0"};
cvar_t sk_zombie_dmg_one_slash3 = {"sk_zombie_dmg_one_slash3","0"};
cvar_t sk_zombie_dmg_both_slash1 = {"sk_zombie_dmg_both_slash1","0"};
cvar_t sk_zombie_dmg_both_slash2 = {"sk_zombie_dmg_both_slash2","0"};
cvar_t sk_zombie_dmg_both_slash3 = {"sk_zombie_dmg_both_slash3","0"};
//Turret
cvar_t sk_turret_health1 = {"sk_turret_health1","0"};
cvar_t sk_turret_health2 = {"sk_turret_health2","0"};
cvar_t sk_turret_health3 = {"sk_turret_health3","0"};
// MiniTurret
cvar_t sk_miniturret_health1 = {"sk_miniturret_health1","0"};
cvar_t sk_miniturret_health2 = {"sk_miniturret_health2","0"};
cvar_t sk_miniturret_health3 = {"sk_miniturret_health3","0"};
// Sentry Turret
cvar_t sk_sentry_health1 = {"sk_sentry_health1","0"};
cvar_t sk_sentry_health2 = {"sk_sentry_health2","0"};
cvar_t sk_sentry_health3 = {"sk_sentry_health3","0"};
// PLAYER WEAPONS
// Crowbar whack
cvar_t sk_plr_crowbar1 = {"sk_plr_crowbar1","0"};
cvar_t sk_plr_crowbar2 = {"sk_plr_crowbar2","0"};
cvar_t sk_plr_crowbar3 = {"sk_plr_crowbar3","0"};
// Glock Round
cvar_t sk_plr_9mm_bullet1 = {"sk_plr_9mm_bullet1","0"};
cvar_t sk_plr_9mm_bullet2 = {"sk_plr_9mm_bullet2","0"};
cvar_t sk_plr_9mm_bullet3 = {"sk_plr_9mm_bullet3","0"};
// 357 Round
cvar_t sk_plr_357_bullet1 = {"sk_plr_357_bullet1","0"};
cvar_t sk_plr_357_bullet2 = {"sk_plr_357_bullet2","0"};
cvar_t sk_plr_357_bullet3 = {"sk_plr_357_bullet3","0"};
// MP5 Round
cvar_t sk_plr_9mmAR_bullet1 = {"sk_plr_9mmAR_bullet1","0"};
cvar_t sk_plr_9mmAR_bullet2 = {"sk_plr_9mmAR_bullet2","0"};
cvar_t sk_plr_9mmAR_bullet3 = {"sk_plr_9mmAR_bullet3","0"};
// M203 grenade
cvar_t sk_plr_9mmAR_grenade1 = {"sk_plr_9mmAR_grenade1","0"};
cvar_t sk_plr_9mmAR_grenade2 = {"sk_plr_9mmAR_grenade2","0"};
cvar_t sk_plr_9mmAR_grenade3 = {"sk_plr_9mmAR_grenade3","0"};
// Shotgun buckshot
cvar_t sk_plr_buckshot1 = {"sk_plr_buckshot1","0"};
cvar_t sk_plr_buckshot2 = {"sk_plr_buckshot2","0"};
cvar_t sk_plr_buckshot3 = {"sk_plr_buckshot3","0"};
// Crossbow
cvar_t sk_plr_xbow_bolt_client1 = {"sk_plr_xbow_bolt_client1","0"};
cvar_t sk_plr_xbow_bolt_client2 = {"sk_plr_xbow_bolt_client2","0"};
cvar_t sk_plr_xbow_bolt_client3 = {"sk_plr_xbow_bolt_client3","0"};
cvar_t sk_plr_xbow_bolt_monster1 = {"sk_plr_xbow_bolt_monster1","0"};
cvar_t sk_plr_xbow_bolt_monster2 = {"sk_plr_xbow_bolt_monster2","0"};
cvar_t sk_plr_xbow_bolt_monster3 = {"sk_plr_xbow_bolt_monster3","0"};
// RPG
cvar_t sk_plr_rpg1 = {"sk_plr_rpg1","0"};
cvar_t sk_plr_rpg2 = {"sk_plr_rpg2","0"};
cvar_t sk_plr_rpg3 = {"sk_plr_rpg3","0"};
// Zero Point Generator
cvar_t sk_plr_gauss1 = {"sk_plr_gauss1","0"};
cvar_t sk_plr_gauss2 = {"sk_plr_gauss2","0"};
cvar_t sk_plr_gauss3 = {"sk_plr_gauss3","0"};
// Tau Cannon
cvar_t sk_plr_egon_narrow1 = {"sk_plr_egon_narrow1","0"};
cvar_t sk_plr_egon_narrow2 = {"sk_plr_egon_narrow2","0"};
cvar_t sk_plr_egon_narrow3 = {"sk_plr_egon_narrow3","0"};
cvar_t sk_plr_egon_wide1 = {"sk_plr_egon_wide1","0"};
cvar_t sk_plr_egon_wide2 = {"sk_plr_egon_wide2","0"};
cvar_t sk_plr_egon_wide3 = {"sk_plr_egon_wide3","0"};
// Hand Grendade
cvar_t sk_plr_hand_grenade1 = {"sk_plr_hand_grenade1","0"};
cvar_t sk_plr_hand_grenade2 = {"sk_plr_hand_grenade2","0"};
cvar_t sk_plr_hand_grenade3 = {"sk_plr_hand_grenade3","0"};
// Satchel Charge
cvar_t sk_plr_satchel1 = {"sk_plr_satchel1","0"};
cvar_t sk_plr_satchel2 = {"sk_plr_satchel2","0"};
cvar_t sk_plr_satchel3 = {"sk_plr_satchel3","0"};
// Tripmine
cvar_t sk_plr_tripmine1 = {"sk_plr_tripmine1","0"};
cvar_t sk_plr_tripmine2 = {"sk_plr_tripmine2","0"};
cvar_t sk_plr_tripmine3 = {"sk_plr_tripmine3","0"};
// WORLD WEAPONS
cvar_t sk_12mm_bullet1 = {"sk_12mm_bullet1","0"};
cvar_t sk_12mm_bullet2 = {"sk_12mm_bullet2","0"};
cvar_t sk_12mm_bullet3 = {"sk_12mm_bullet3","0"};
cvar_t sk_9mmAR_bullet1 = {"sk_9mmAR_bullet1","0"};
cvar_t sk_9mmAR_bullet2 = {"sk_9mmAR_bullet2","0"};
cvar_t sk_9mmAR_bullet3 = {"sk_9mmAR_bullet3","0"};
cvar_t sk_9mm_bullet1 = {"sk_9mm_bullet1","0"};
cvar_t sk_9mm_bullet2 = {"sk_9mm_bullet2","0"};
cvar_t sk_9mm_bullet3 = {"sk_9mm_bullet3","0"};
// HORNET
cvar_t sk_hornet_dmg1 = {"sk_hornet_dmg1","0"};
cvar_t sk_hornet_dmg2 = {"sk_hornet_dmg2","0"};
cvar_t sk_hornet_dmg3 = {"sk_hornet_dmg3","0"};
// HEALTH/CHARGE
cvar_t sk_suitcharger1 = { "sk_suitcharger1","0" };
cvar_t sk_suitcharger2 = { "sk_suitcharger2","0" };
cvar_t sk_suitcharger3 = { "sk_suitcharger3","0" };
cvar_t sk_battery1 = { "sk_battery1","0" };
cvar_t sk_battery2 = { "sk_battery2","0" };
cvar_t sk_battery3 = { "sk_battery3","0" };
cvar_t sk_healthcharger1 = { "sk_healthcharger1","0" };
cvar_t sk_healthcharger2 = { "sk_healthcharger2","0" };
cvar_t sk_healthcharger3 = { "sk_healthcharger3","0" };
cvar_t sk_healthkit1 = { "sk_healthkit1","0" };
cvar_t sk_healthkit2 = { "sk_healthkit2","0" };
cvar_t sk_healthkit3 = { "sk_healthkit3","0" };
cvar_t sk_scientist_heal1 = { "sk_scientist_heal1","0" };
cvar_t sk_scientist_heal2 = { "sk_scientist_heal2","0" };
cvar_t sk_scientist_heal3 = { "sk_scientist_heal3","0" };
// monster damage adjusters
cvar_t sk_monster_head1 = { "sk_monster_head1","2" };
cvar_t sk_monster_head2 = { "sk_monster_head2","2" };
cvar_t sk_monster_head3 = { "sk_monster_head3","2" };
cvar_t sk_monster_chest1 = { "sk_monster_chest1","1" };
cvar_t sk_monster_chest2 = { "sk_monster_chest2","1" };
cvar_t sk_monster_chest3 = { "sk_monster_chest3","1" };
cvar_t sk_monster_stomach1 = { "sk_monster_stomach1","1" };
cvar_t sk_monster_stomach2 = { "sk_monster_stomach2","1" };
cvar_t sk_monster_stomach3 = { "sk_monster_stomach3","1" };
cvar_t sk_monster_arm1 = { "sk_monster_arm1","1" };
cvar_t sk_monster_arm2 = { "sk_monster_arm2","1" };
cvar_t sk_monster_arm3 = { "sk_monster_arm3","1" };
cvar_t sk_monster_leg1 = { "sk_monster_leg1","1" };
cvar_t sk_monster_leg2 = { "sk_monster_leg2","1" };
cvar_t sk_monster_leg3 = { "sk_monster_leg3","1" };
// player damage adjusters
cvar_t sk_player_head1 = { "sk_player_head1","2" };
cvar_t sk_player_head2 = { "sk_player_head2","2" };
cvar_t sk_player_head3 = { "sk_player_head3","2" };
cvar_t sk_player_chest1 = { "sk_player_chest1","1" };
cvar_t sk_player_chest2 = { "sk_player_chest2","1" };
cvar_t sk_player_chest3 = { "sk_player_chest3","1" };
cvar_t sk_player_stomach1 = { "sk_player_stomach1","1" };
cvar_t sk_player_stomach2 = { "sk_player_stomach2","1" };
cvar_t sk_player_stomach3 = { "sk_player_stomach3","1" };
cvar_t sk_player_arm1 = { "sk_player_arm1","1" };
cvar_t sk_player_arm2 = { "sk_player_arm2","1" };
cvar_t sk_player_arm3 = { "sk_player_arm3","1" };
cvar_t sk_player_leg1 = { "sk_player_leg1","1" };
cvar_t sk_player_leg2 = { "sk_player_leg2","1" };
cvar_t sk_player_leg3 = { "sk_player_leg3","1" };
// END Cvars for Skill Level settings
// Register your console variables here
@ -595,6 +204,14 @@ void GameDLLInit( void )
CVAR_REGISTER (&avh_deathmatchmode);
CVAR_REGISTER (&avh_countdowntime);
avh_cheats=CVAR_GET_POINTER("sv_cheats");
showtriggers=CVAR_GET_POINTER("showtriggers");
violence_ablood=CVAR_GET_POINTER("violence_ablood");
violence_agibs=CVAR_GET_POINTER("violence_agibs");
violence_hblood=CVAR_GET_POINTER("violence_hblood");
violence_hgibs=CVAR_GET_POINTER("violence_hgibs");
CVAR_REGISTER (&avh_latejointime);
CVAR_REGISTER (&avh_logdetail);
//CVAR_REGISTER (&avh_teamsizehandicapping);
@ -602,6 +219,7 @@ void GameDLLInit( void )
CVAR_REGISTER (&avh_team2damagepercent);
CVAR_REGISTER (&avh_team3damagepercent);
CVAR_REGISTER (&avh_team4damagepercent);
CVAR_REGISTER (&avh_structurelimit);
CVAR_REGISTER (&avh_votecasttime);
CVAR_REGISTER (&avh_votedowntime);
CVAR_REGISTER (&avh_minvotesneeded);
@ -639,407 +257,5 @@ void GameDLLInit( void )
CVAR_REGISTER (&avh_uplink);
CVAR_REGISTER (&avh_killdelay);
// REGISTER CVARS FOR SKILL LEVEL STUFF
// Agrunt
CVAR_REGISTER ( &sk_agrunt_health1 );// {"sk_agrunt_health1","0"};
CVAR_REGISTER ( &sk_agrunt_health2 );// {"sk_agrunt_health2","0"};
CVAR_REGISTER ( &sk_agrunt_health3 );// {"sk_agrunt_health3","0"};
CVAR_REGISTER ( &sk_agrunt_dmg_punch1 );// {"sk_agrunt_dmg_punch1","0"};
CVAR_REGISTER ( &sk_agrunt_dmg_punch2 );// {"sk_agrunt_dmg_punch2","0"};
CVAR_REGISTER ( &sk_agrunt_dmg_punch3 );// {"sk_agrunt_dmg_punch3","0"};
// Apache
CVAR_REGISTER ( &sk_apache_health1 );// {"sk_apache_health1","0"};
CVAR_REGISTER ( &sk_apache_health2 );// {"sk_apache_health2","0"};
CVAR_REGISTER ( &sk_apache_health3 );// {"sk_apache_health3","0"};
// Barney
CVAR_REGISTER ( &sk_barney_health1 );// {"sk_barney_health1","0"};
CVAR_REGISTER ( &sk_barney_health2 );// {"sk_barney_health2","0"};
CVAR_REGISTER ( &sk_barney_health3 );// {"sk_barney_health3","0"};
// Bullsquid
CVAR_REGISTER ( &sk_bullsquid_health1 );// {"sk_bullsquid_health1","0"};
CVAR_REGISTER ( &sk_bullsquid_health2 );// {"sk_bullsquid_health2","0"};
CVAR_REGISTER ( &sk_bullsquid_health3 );// {"sk_bullsquid_health3","0"};
CVAR_REGISTER ( &sk_bullsquid_dmg_bite1 );// {"sk_bullsquid_dmg_bite1","0"};
CVAR_REGISTER ( &sk_bullsquid_dmg_bite2 );// {"sk_bullsquid_dmg_bite2","0"};
CVAR_REGISTER ( &sk_bullsquid_dmg_bite3 );// {"sk_bullsquid_dmg_bite3","0"};
CVAR_REGISTER ( &sk_bullsquid_dmg_whip1 );// {"sk_bullsquid_dmg_whip1","0"};
CVAR_REGISTER ( &sk_bullsquid_dmg_whip2 );// {"sk_bullsquid_dmg_whip2","0"};
CVAR_REGISTER ( &sk_bullsquid_dmg_whip3 );// {"sk_bullsquid_dmg_whip3","0"};
CVAR_REGISTER ( &sk_bullsquid_dmg_spit1 );// {"sk_bullsquid_dmg_spit1","0"};
CVAR_REGISTER ( &sk_bullsquid_dmg_spit2 );// {"sk_bullsquid_dmg_spit2","0"};
CVAR_REGISTER ( &sk_bullsquid_dmg_spit3 );// {"sk_bullsquid_dmg_spit3","0"};
CVAR_REGISTER ( &sk_bigmomma_health_factor1 );// {"sk_bigmomma_health_factor1","1.0"};
CVAR_REGISTER ( &sk_bigmomma_health_factor2 );// {"sk_bigmomma_health_factor2","1.0"};
CVAR_REGISTER ( &sk_bigmomma_health_factor3 );// {"sk_bigmomma_health_factor3","1.0"};
CVAR_REGISTER ( &sk_bigmomma_dmg_slash1 );// {"sk_bigmomma_dmg_slash1","50"};
CVAR_REGISTER ( &sk_bigmomma_dmg_slash2 );// {"sk_bigmomma_dmg_slash2","50"};
CVAR_REGISTER ( &sk_bigmomma_dmg_slash3 );// {"sk_bigmomma_dmg_slash3","50"};
CVAR_REGISTER ( &sk_bigmomma_dmg_blast1 );// {"sk_bigmomma_dmg_blast1","100"};
CVAR_REGISTER ( &sk_bigmomma_dmg_blast2 );// {"sk_bigmomma_dmg_blast2","100"};
CVAR_REGISTER ( &sk_bigmomma_dmg_blast3 );// {"sk_bigmomma_dmg_blast3","100"};
CVAR_REGISTER ( &sk_bigmomma_radius_blast1 );// {"sk_bigmomma_radius_blast1","250"};
CVAR_REGISTER ( &sk_bigmomma_radius_blast2 );// {"sk_bigmomma_radius_blast2","250"};
CVAR_REGISTER ( &sk_bigmomma_radius_blast3 );// {"sk_bigmomma_radius_blast3","250"};
// Gargantua
CVAR_REGISTER ( &sk_gargantua_health1 );// {"sk_gargantua_health1","0"};
CVAR_REGISTER ( &sk_gargantua_health2 );// {"sk_gargantua_health2","0"};
CVAR_REGISTER ( &sk_gargantua_health3 );// {"sk_gargantua_health3","0"};
CVAR_REGISTER ( &sk_gargantua_dmg_slash1 );// {"sk_gargantua_dmg_slash1","0"};
CVAR_REGISTER ( &sk_gargantua_dmg_slash2 );// {"sk_gargantua_dmg_slash2","0"};
CVAR_REGISTER ( &sk_gargantua_dmg_slash3 );// {"sk_gargantua_dmg_slash3","0"};
CVAR_REGISTER ( &sk_gargantua_dmg_fire1 );// {"sk_gargantua_dmg_fire1","0"};
CVAR_REGISTER ( &sk_gargantua_dmg_fire2 );// {"sk_gargantua_dmg_fire2","0"};
CVAR_REGISTER ( &sk_gargantua_dmg_fire3 );// {"sk_gargantua_dmg_fire3","0"};
CVAR_REGISTER ( &sk_gargantua_dmg_stomp1 );// {"sk_gargantua_dmg_stomp1","0"};
CVAR_REGISTER ( &sk_gargantua_dmg_stomp2 );// {"sk_gargantua_dmg_stomp2","0"};
CVAR_REGISTER ( &sk_gargantua_dmg_stomp3 );// {"sk_gargantua_dmg_stomp3","0"};
// Hassassin
CVAR_REGISTER ( &sk_hassassin_health1 );// {"sk_hassassin_health1","0"};
CVAR_REGISTER ( &sk_hassassin_health2 );// {"sk_hassassin_health2","0"};
CVAR_REGISTER ( &sk_hassassin_health3 );// {"sk_hassassin_health3","0"};
// Headcrab
CVAR_REGISTER ( &sk_headcrab_health1 );// {"sk_headcrab_health1","0"};
CVAR_REGISTER ( &sk_headcrab_health2 );// {"sk_headcrab_health2","0"};
CVAR_REGISTER ( &sk_headcrab_health3 );// {"sk_headcrab_health3","0"};
CVAR_REGISTER ( &sk_headcrab_dmg_bite1 );// {"sk_headcrab_dmg_bite1","0"};
CVAR_REGISTER ( &sk_headcrab_dmg_bite2 );// {"sk_headcrab_dmg_bite2","0"};
CVAR_REGISTER ( &sk_headcrab_dmg_bite3 );// {"sk_headcrab_dmg_bite3","0"};
// Hgrunt
CVAR_REGISTER ( &sk_hgrunt_health1 );// {"sk_hgrunt_health1","0"};
CVAR_REGISTER ( &sk_hgrunt_health2 );// {"sk_hgrunt_health2","0"};
CVAR_REGISTER ( &sk_hgrunt_health3 );// {"sk_hgrunt_health3","0"};
CVAR_REGISTER ( &sk_hgrunt_kick1 );// {"sk_hgrunt_kick1","0"};
CVAR_REGISTER ( &sk_hgrunt_kick2 );// {"sk_hgrunt_kick2","0"};
CVAR_REGISTER ( &sk_hgrunt_kick3 );// {"sk_hgrunt_kick3","0"};
CVAR_REGISTER ( &sk_hgrunt_pellets1 );
CVAR_REGISTER ( &sk_hgrunt_pellets2 );
CVAR_REGISTER ( &sk_hgrunt_pellets3 );
CVAR_REGISTER ( &sk_hgrunt_gspeed1 );
CVAR_REGISTER ( &sk_hgrunt_gspeed2 );
CVAR_REGISTER ( &sk_hgrunt_gspeed3 );
// Houndeye
CVAR_REGISTER ( &sk_houndeye_health1 );// {"sk_houndeye_health1","0"};
CVAR_REGISTER ( &sk_houndeye_health2 );// {"sk_houndeye_health2","0"};
CVAR_REGISTER ( &sk_houndeye_health3 );// {"sk_houndeye_health3","0"};
CVAR_REGISTER ( &sk_houndeye_dmg_blast1 );// {"sk_houndeye_dmg_blast1","0"};
CVAR_REGISTER ( &sk_houndeye_dmg_blast2 );// {"sk_houndeye_dmg_blast2","0"};
CVAR_REGISTER ( &sk_houndeye_dmg_blast3 );// {"sk_houndeye_dmg_blast3","0"};
// ISlave
CVAR_REGISTER ( &sk_islave_health1 );// {"sk_islave_health1","0"};
CVAR_REGISTER ( &sk_islave_health2 );// {"sk_islave_health2","0"};
CVAR_REGISTER ( &sk_islave_health3 );// {"sk_islave_health3","0"};
CVAR_REGISTER ( &sk_islave_dmg_claw1 );// {"sk_islave_dmg_claw1","0"};
CVAR_REGISTER ( &sk_islave_dmg_claw2 );// {"sk_islave_dmg_claw2","0"};
CVAR_REGISTER ( &sk_islave_dmg_claw3 );// {"sk_islave_dmg_claw3","0"};
CVAR_REGISTER ( &sk_islave_dmg_clawrake1 );// {"sk_islave_dmg_clawrake1","0"};
CVAR_REGISTER ( &sk_islave_dmg_clawrake2 );// {"sk_islave_dmg_clawrake2","0"};
CVAR_REGISTER ( &sk_islave_dmg_clawrake3 );// {"sk_islave_dmg_clawrake3","0"};
CVAR_REGISTER ( &sk_islave_dmg_zap1 );// {"sk_islave_dmg_zap1","0"};
CVAR_REGISTER ( &sk_islave_dmg_zap2 );// {"sk_islave_dmg_zap2","0"};
CVAR_REGISTER ( &sk_islave_dmg_zap3 );// {"sk_islave_dmg_zap3","0"};
// Icthyosaur
CVAR_REGISTER ( &sk_ichthyosaur_health1 );// {"sk_ichthyosaur_health1","0"};
CVAR_REGISTER ( &sk_ichthyosaur_health2 );// {"sk_ichthyosaur_health2","0"};
CVAR_REGISTER ( &sk_ichthyosaur_health3 );// {"sk_ichthyosaur_health3","0"};
CVAR_REGISTER ( &sk_ichthyosaur_shake1 );// {"sk_ichthyosaur_health3","0"};
CVAR_REGISTER ( &sk_ichthyosaur_shake2 );// {"sk_ichthyosaur_health3","0"};
CVAR_REGISTER ( &sk_ichthyosaur_shake3 );// {"sk_ichthyosaur_health3","0"};
// Leech
CVAR_REGISTER ( &sk_leech_health1 );// {"sk_leech_health1","0"};
CVAR_REGISTER ( &sk_leech_health2 );// {"sk_leech_health2","0"};
CVAR_REGISTER ( &sk_leech_health3 );// {"sk_leech_health3","0"};
CVAR_REGISTER ( &sk_leech_dmg_bite1 );// {"sk_leech_dmg_bite1","0"};
CVAR_REGISTER ( &sk_leech_dmg_bite2 );// {"sk_leech_dmg_bite2","0"};
CVAR_REGISTER ( &sk_leech_dmg_bite3 );// {"sk_leech_dmg_bite3","0"};
// Controller
CVAR_REGISTER ( &sk_controller_health1 );
CVAR_REGISTER ( &sk_controller_health2 );
CVAR_REGISTER ( &sk_controller_health3 );
CVAR_REGISTER ( &sk_controller_dmgzap1 );
CVAR_REGISTER ( &sk_controller_dmgzap2 );
CVAR_REGISTER ( &sk_controller_dmgzap3 );
CVAR_REGISTER ( &sk_controller_speedball1 );
CVAR_REGISTER ( &sk_controller_speedball2 );
CVAR_REGISTER ( &sk_controller_speedball3 );
CVAR_REGISTER ( &sk_controller_dmgball1 );
CVAR_REGISTER ( &sk_controller_dmgball2 );
CVAR_REGISTER ( &sk_controller_dmgball3 );
// Nihilanth
CVAR_REGISTER ( &sk_nihilanth_health1 );// {"sk_nihilanth_health1","0"};
CVAR_REGISTER ( &sk_nihilanth_health2 );// {"sk_nihilanth_health2","0"};
CVAR_REGISTER ( &sk_nihilanth_health3 );// {"sk_nihilanth_health3","0"};
CVAR_REGISTER ( &sk_nihilanth_zap1 );
CVAR_REGISTER ( &sk_nihilanth_zap2 );
CVAR_REGISTER ( &sk_nihilanth_zap3 );
// Scientist
CVAR_REGISTER ( &sk_scientist_health1 );// {"sk_scientist_health1","0"};
CVAR_REGISTER ( &sk_scientist_health2 );// {"sk_scientist_health2","0"};
CVAR_REGISTER ( &sk_scientist_health3 );// {"sk_scientist_health3","0"};
// Snark
CVAR_REGISTER ( &sk_snark_health1 );// {"sk_snark_health1","0"};
CVAR_REGISTER ( &sk_snark_health2 );// {"sk_snark_health2","0"};
CVAR_REGISTER ( &sk_snark_health3 );// {"sk_snark_health3","0"};
CVAR_REGISTER ( &sk_snark_dmg_bite1 );// {"sk_snark_dmg_bite1","0"};
CVAR_REGISTER ( &sk_snark_dmg_bite2 );// {"sk_snark_dmg_bite2","0"};
CVAR_REGISTER ( &sk_snark_dmg_bite3 );// {"sk_snark_dmg_bite3","0"};
CVAR_REGISTER ( &sk_snark_dmg_pop1 );// {"sk_snark_dmg_pop1","0"};
CVAR_REGISTER ( &sk_snark_dmg_pop2 );// {"sk_snark_dmg_pop2","0"};
CVAR_REGISTER ( &sk_snark_dmg_pop3 );// {"sk_snark_dmg_pop3","0"};
// Zombie
CVAR_REGISTER ( &sk_zombie_health1 );// {"sk_zombie_health1","0"};
CVAR_REGISTER ( &sk_zombie_health2 );// {"sk_zombie_health3","0"};
CVAR_REGISTER ( &sk_zombie_health3 );// {"sk_zombie_health3","0"};
CVAR_REGISTER ( &sk_zombie_dmg_one_slash1 );// {"sk_zombie_dmg_one_slash1","0"};
CVAR_REGISTER ( &sk_zombie_dmg_one_slash2 );// {"sk_zombie_dmg_one_slash2","0"};
CVAR_REGISTER ( &sk_zombie_dmg_one_slash3 );// {"sk_zombie_dmg_one_slash3","0"};
CVAR_REGISTER ( &sk_zombie_dmg_both_slash1 );// {"sk_zombie_dmg_both_slash1","0"};
CVAR_REGISTER ( &sk_zombie_dmg_both_slash2 );// {"sk_zombie_dmg_both_slash2","0"};
CVAR_REGISTER ( &sk_zombie_dmg_both_slash3 );// {"sk_zombie_dmg_both_slash3","0"};
//Turret
CVAR_REGISTER ( &sk_turret_health1 );// {"sk_turret_health1","0"};
CVAR_REGISTER ( &sk_turret_health2 );// {"sk_turret_health2","0"};
CVAR_REGISTER ( &sk_turret_health3 );// {"sk_turret_health3","0"};
// MiniTurret
CVAR_REGISTER ( &sk_miniturret_health1 );// {"sk_miniturret_health1","0"};
CVAR_REGISTER ( &sk_miniturret_health2 );// {"sk_miniturret_health2","0"};
CVAR_REGISTER ( &sk_miniturret_health3 );// {"sk_miniturret_health3","0"};
// Sentry Turret
CVAR_REGISTER ( &sk_sentry_health1 );// {"sk_sentry_health1","0"};
CVAR_REGISTER ( &sk_sentry_health2 );// {"sk_sentry_health2","0"};
CVAR_REGISTER ( &sk_sentry_health3 );// {"sk_sentry_health3","0"};
// PLAYER WEAPONS
// Crowbar whack
CVAR_REGISTER ( &sk_plr_crowbar1 );// {"sk_plr_crowbar1","0"};
CVAR_REGISTER ( &sk_plr_crowbar2 );// {"sk_plr_crowbar2","0"};
CVAR_REGISTER ( &sk_plr_crowbar3 );// {"sk_plr_crowbar3","0"};
// Glock Round
CVAR_REGISTER ( &sk_plr_9mm_bullet1 );// {"sk_plr_9mm_bullet1","0"};
CVAR_REGISTER ( &sk_plr_9mm_bullet2 );// {"sk_plr_9mm_bullet2","0"};
CVAR_REGISTER ( &sk_plr_9mm_bullet3 );// {"sk_plr_9mm_bullet3","0"};
// 357 Round
CVAR_REGISTER ( &sk_plr_357_bullet1 );// {"sk_plr_357_bullet1","0"};
CVAR_REGISTER ( &sk_plr_357_bullet2 );// {"sk_plr_357_bullet2","0"};
CVAR_REGISTER ( &sk_plr_357_bullet3 );// {"sk_plr_357_bullet3","0"};
// MP5 Round
CVAR_REGISTER ( &sk_plr_9mmAR_bullet1 );// {"sk_plr_9mmAR_bullet1","0"};
CVAR_REGISTER ( &sk_plr_9mmAR_bullet2 );// {"sk_plr_9mmAR_bullet2","0"};
CVAR_REGISTER ( &sk_plr_9mmAR_bullet3 );// {"sk_plr_9mmAR_bullet3","0"};
// M203 grenade
CVAR_REGISTER ( &sk_plr_9mmAR_grenade1 );// {"sk_plr_9mmAR_grenade1","0"};
CVAR_REGISTER ( &sk_plr_9mmAR_grenade2 );// {"sk_plr_9mmAR_grenade2","0"};
CVAR_REGISTER ( &sk_plr_9mmAR_grenade3 );// {"sk_plr_9mmAR_grenade3","0"};
// Shotgun buckshot
CVAR_REGISTER ( &sk_plr_buckshot1 );// {"sk_plr_buckshot1","0"};
CVAR_REGISTER ( &sk_plr_buckshot2 );// {"sk_plr_buckshot2","0"};
CVAR_REGISTER ( &sk_plr_buckshot3 );// {"sk_plr_buckshot3","0"};
// Crossbow
CVAR_REGISTER ( &sk_plr_xbow_bolt_monster1 );// {"sk_plr_xbow_bolt1","0"};
CVAR_REGISTER ( &sk_plr_xbow_bolt_monster2 );// {"sk_plr_xbow_bolt2","0"};
CVAR_REGISTER ( &sk_plr_xbow_bolt_monster3 );// {"sk_plr_xbow_bolt3","0"};
CVAR_REGISTER ( &sk_plr_xbow_bolt_client1 );// {"sk_plr_xbow_bolt1","0"};
CVAR_REGISTER ( &sk_plr_xbow_bolt_client2 );// {"sk_plr_xbow_bolt2","0"};
CVAR_REGISTER ( &sk_plr_xbow_bolt_client3 );// {"sk_plr_xbow_bolt3","0"};
// RPG
CVAR_REGISTER ( &sk_plr_rpg1 );// {"sk_plr_rpg1","0"};
CVAR_REGISTER ( &sk_plr_rpg2 );// {"sk_plr_rpg2","0"};
CVAR_REGISTER ( &sk_plr_rpg3 );// {"sk_plr_rpg3","0"};
// Gauss Gun
CVAR_REGISTER ( &sk_plr_gauss1 );// {"sk_plr_gauss1","0"};
CVAR_REGISTER ( &sk_plr_gauss2 );// {"sk_plr_gauss2","0"};
CVAR_REGISTER ( &sk_plr_gauss3 );// {"sk_plr_gauss3","0"};
// Egon Gun
CVAR_REGISTER ( &sk_plr_egon_narrow1 );// {"sk_plr_egon_narrow1","0"};
CVAR_REGISTER ( &sk_plr_egon_narrow2 );// {"sk_plr_egon_narrow2","0"};
CVAR_REGISTER ( &sk_plr_egon_narrow3 );// {"sk_plr_egon_narrow3","0"};
CVAR_REGISTER ( &sk_plr_egon_wide1 );// {"sk_plr_egon_wide1","0"};
CVAR_REGISTER ( &sk_plr_egon_wide2 );// {"sk_plr_egon_wide2","0"};
CVAR_REGISTER ( &sk_plr_egon_wide3 );// {"sk_plr_egon_wide3","0"};
// Hand Grendade
CVAR_REGISTER ( &sk_plr_hand_grenade1 );// {"sk_plr_hand_grenade1","0"};
CVAR_REGISTER ( &sk_plr_hand_grenade2 );// {"sk_plr_hand_grenade2","0"};
CVAR_REGISTER ( &sk_plr_hand_grenade3 );// {"sk_plr_hand_grenade3","0"};
// Satchel Charge
CVAR_REGISTER ( &sk_plr_satchel1 );// {"sk_plr_satchel1","0"};
CVAR_REGISTER ( &sk_plr_satchel2 );// {"sk_plr_satchel2","0"};
CVAR_REGISTER ( &sk_plr_satchel3 );// {"sk_plr_satchel3","0"};
// Tripmine
CVAR_REGISTER ( &sk_plr_tripmine1 );// {"sk_plr_tripmine1","0"};
CVAR_REGISTER ( &sk_plr_tripmine2 );// {"sk_plr_tripmine2","0"};
CVAR_REGISTER ( &sk_plr_tripmine3 );// {"sk_plr_tripmine3","0"};
// WORLD WEAPONS
CVAR_REGISTER ( &sk_12mm_bullet1 );// {"sk_12mm_bullet1","0"};
CVAR_REGISTER ( &sk_12mm_bullet2 );// {"sk_12mm_bullet2","0"};
CVAR_REGISTER ( &sk_12mm_bullet3 );// {"sk_12mm_bullet3","0"};
CVAR_REGISTER ( &sk_9mmAR_bullet1 );// {"sk_9mm_bullet1","0"};
CVAR_REGISTER ( &sk_9mmAR_bullet2 );// {"sk_9mm_bullet1","0"};
CVAR_REGISTER ( &sk_9mmAR_bullet3 );// {"sk_9mm_bullet1","0"};
CVAR_REGISTER ( &sk_9mm_bullet1 );// {"sk_9mm_bullet1","0"};
CVAR_REGISTER ( &sk_9mm_bullet2 );// {"sk_9mm_bullet2","0"};
CVAR_REGISTER ( &sk_9mm_bullet3 );// {"sk_9mm_bullet3","0"};
// HORNET
CVAR_REGISTER ( &sk_hornet_dmg1 );// {"sk_hornet_dmg1","0"};
CVAR_REGISTER ( &sk_hornet_dmg2 );// {"sk_hornet_dmg2","0"};
CVAR_REGISTER ( &sk_hornet_dmg3 );// {"sk_hornet_dmg3","0"};
// HEALTH/SUIT CHARGE DISTRIBUTION
CVAR_REGISTER ( &sk_suitcharger1 );
CVAR_REGISTER ( &sk_suitcharger2 );
CVAR_REGISTER ( &sk_suitcharger3 );
CVAR_REGISTER ( &sk_battery1 );
CVAR_REGISTER ( &sk_battery2 );
CVAR_REGISTER ( &sk_battery3 );
CVAR_REGISTER ( &sk_healthcharger1 );
CVAR_REGISTER ( &sk_healthcharger2 );
CVAR_REGISTER ( &sk_healthcharger3 );
CVAR_REGISTER ( &sk_healthkit1 );
CVAR_REGISTER ( &sk_healthkit2 );
CVAR_REGISTER ( &sk_healthkit3 );
CVAR_REGISTER ( &sk_scientist_heal1 );
CVAR_REGISTER ( &sk_scientist_heal2 );
CVAR_REGISTER ( &sk_scientist_heal3 );
// monster damage adjusters
CVAR_REGISTER ( &sk_monster_head1 );
CVAR_REGISTER ( &sk_monster_head2 );
CVAR_REGISTER ( &sk_monster_head3 );
CVAR_REGISTER ( &sk_monster_chest1 );
CVAR_REGISTER ( &sk_monster_chest2 );
CVAR_REGISTER ( &sk_monster_chest3 );
CVAR_REGISTER ( &sk_monster_stomach1 );
CVAR_REGISTER ( &sk_monster_stomach2 );
CVAR_REGISTER ( &sk_monster_stomach3 );
CVAR_REGISTER ( &sk_monster_arm1 );
CVAR_REGISTER ( &sk_monster_arm2 );
CVAR_REGISTER ( &sk_monster_arm3 );
CVAR_REGISTER ( &sk_monster_leg1 );
CVAR_REGISTER ( &sk_monster_leg2 );
CVAR_REGISTER ( &sk_monster_leg3 );
// player damage adjusters
CVAR_REGISTER ( &sk_player_head1 );
CVAR_REGISTER ( &sk_player_head2 );
CVAR_REGISTER ( &sk_player_head3 );
CVAR_REGISTER ( &sk_player_chest1 );
CVAR_REGISTER ( &sk_player_chest2 );
CVAR_REGISTER ( &sk_player_chest3 );
CVAR_REGISTER ( &sk_player_stomach1 );
CVAR_REGISTER ( &sk_player_stomach2 );
CVAR_REGISTER ( &sk_player_stomach3 );
CVAR_REGISTER ( &sk_player_arm1 );
CVAR_REGISTER ( &sk_player_arm2 );
CVAR_REGISTER ( &sk_player_arm3 );
CVAR_REGISTER ( &sk_player_leg1 );
CVAR_REGISTER ( &sk_player_leg2 );
CVAR_REGISTER ( &sk_player_leg3 );
// END REGISTER CVARS FOR SKILL LEVEL STUFF
SERVER_COMMAND( "exec skill.cfg\n" );
}

View file

@ -109,196 +109,6 @@ BOOL CGameRules::CanHavePlayerItem( CBasePlayer *pPlayer, CBasePlayerItem *pWeap
//=========================================================
void CGameRules::RefreshSkillData ( void )
{
int iSkill;
iSkill = (int)CVAR_GET_FLOAT("skill");
g_iSkillLevel = iSkill;
if ( iSkill < 1 )
{
iSkill = 1;
}
else if ( iSkill > 3 )
{
iSkill = 3;
}
gSkillData.iSkillLevel = iSkill;
ALERT ( at_console, "\nGAME SKILL LEVEL:%d\n",iSkill );
//Agrunt
gSkillData.agruntHealth = GetSkillCvar( "sk_agrunt_health" );
gSkillData.agruntDmgPunch = GetSkillCvar( "sk_agrunt_dmg_punch");
// Apache
gSkillData.apacheHealth = GetSkillCvar( "sk_apache_health");
// Barney
gSkillData.barneyHealth = GetSkillCvar( "sk_barney_health");
// Big Momma
gSkillData.bigmommaHealthFactor = GetSkillCvar( "sk_bigmomma_health_factor" );
gSkillData.bigmommaDmgSlash = GetSkillCvar( "sk_bigmomma_dmg_slash" );
gSkillData.bigmommaDmgBlast = GetSkillCvar( "sk_bigmomma_dmg_blast" );
gSkillData.bigmommaRadiusBlast = GetSkillCvar( "sk_bigmomma_radius_blast" );
// Bullsquid
gSkillData.bullsquidHealth = GetSkillCvar( "sk_bullsquid_health");
gSkillData.bullsquidDmgBite = GetSkillCvar( "sk_bullsquid_dmg_bite");
gSkillData.bullsquidDmgWhip = GetSkillCvar( "sk_bullsquid_dmg_whip");
gSkillData.bullsquidDmgSpit = GetSkillCvar( "sk_bullsquid_dmg_spit");
// Gargantua
gSkillData.gargantuaHealth = GetSkillCvar( "sk_gargantua_health");
gSkillData.gargantuaDmgSlash = GetSkillCvar( "sk_gargantua_dmg_slash");
gSkillData.gargantuaDmgFire = GetSkillCvar( "sk_gargantua_dmg_fire");
gSkillData.gargantuaDmgStomp = GetSkillCvar( "sk_gargantua_dmg_stomp");
// Hassassin
gSkillData.hassassinHealth = GetSkillCvar( "sk_hassassin_health");
// Headcrab
gSkillData.headcrabHealth = GetSkillCvar( "sk_headcrab_health");
gSkillData.headcrabDmgBite = GetSkillCvar( "sk_headcrab_dmg_bite");
// Hgrunt
gSkillData.hgruntHealth = GetSkillCvar( "sk_hgrunt_health");
gSkillData.hgruntDmgKick = GetSkillCvar( "sk_hgrunt_kick");
gSkillData.hgruntShotgunPellets = GetSkillCvar( "sk_hgrunt_pellets");
gSkillData.hgruntGrenadeSpeed = GetSkillCvar( "sk_hgrunt_gspeed");
// Houndeye
gSkillData.houndeyeHealth = GetSkillCvar( "sk_houndeye_health");
gSkillData.houndeyeDmgBlast = GetSkillCvar( "sk_houndeye_dmg_blast");
// ISlave
gSkillData.slaveHealth = GetSkillCvar( "sk_islave_health");
gSkillData.slaveDmgClaw = GetSkillCvar( "sk_islave_dmg_claw");
gSkillData.slaveDmgClawrake = GetSkillCvar( "sk_islave_dmg_clawrake");
gSkillData.slaveDmgZap = GetSkillCvar( "sk_islave_dmg_zap");
// Icthyosaur
gSkillData.ichthyosaurHealth = GetSkillCvar( "sk_ichthyosaur_health");
gSkillData.ichthyosaurDmgShake = GetSkillCvar( "sk_ichthyosaur_shake");
// Leech
gSkillData.leechHealth = GetSkillCvar( "sk_leech_health");
gSkillData.leechDmgBite = GetSkillCvar( "sk_leech_dmg_bite");
// Controller
gSkillData.controllerHealth = GetSkillCvar( "sk_controller_health");
gSkillData.controllerDmgZap = GetSkillCvar( "sk_controller_dmgzap");
gSkillData.controllerSpeedBall = GetSkillCvar( "sk_controller_speedball");
gSkillData.controllerDmgBall = GetSkillCvar( "sk_controller_dmgball");
// Nihilanth
gSkillData.nihilanthHealth = GetSkillCvar( "sk_nihilanth_health");
gSkillData.nihilanthZap = GetSkillCvar( "sk_nihilanth_zap");
// Scientist
gSkillData.scientistHealth = GetSkillCvar( "sk_scientist_health");
// Snark
gSkillData.snarkHealth = GetSkillCvar( "sk_snark_health");
gSkillData.snarkDmgBite = GetSkillCvar( "sk_snark_dmg_bite");
gSkillData.snarkDmgPop = GetSkillCvar( "sk_snark_dmg_pop");
// Zombie
gSkillData.zombieHealth = GetSkillCvar( "sk_zombie_health");
gSkillData.zombieDmgOneSlash = GetSkillCvar( "sk_zombie_dmg_one_slash");
gSkillData.zombieDmgBothSlash = GetSkillCvar( "sk_zombie_dmg_both_slash");
//Turret
gSkillData.turretHealth = GetSkillCvar( "sk_turret_health");
// MiniTurret
gSkillData.miniturretHealth = GetSkillCvar( "sk_miniturret_health");
// Sentry Turret
gSkillData.sentryHealth = GetSkillCvar( "sk_sentry_health");
// PLAYER WEAPONS
// Crowbar whack
gSkillData.plrDmgCrowbar = GetSkillCvar( "sk_plr_crowbar");
// Glock Round
gSkillData.plrDmg9MM = GetSkillCvar( "sk_plr_9mm_bullet");
// 357 Round
gSkillData.plrDmg357 = GetSkillCvar( "sk_plr_357_bullet");
// MP5 Round
gSkillData.plrDmgMP5 = GetSkillCvar( "sk_plr_9mmAR_bullet");
// M203 grenade
gSkillData.plrDmgM203Grenade = GetSkillCvar( "sk_plr_9mmAR_grenade");
// Shotgun buckshot
gSkillData.plrDmgBuckshot = GetSkillCvar( "sk_plr_buckshot");
// Crossbow
gSkillData.plrDmgCrossbowClient = GetSkillCvar( "sk_plr_xbow_bolt_client");
gSkillData.plrDmgCrossbowMonster = GetSkillCvar( "sk_plr_xbow_bolt_monster");
// RPG
gSkillData.plrDmgRPG = GetSkillCvar( "sk_plr_rpg");
// Gauss gun
gSkillData.plrDmgGauss = GetSkillCvar( "sk_plr_gauss");
// Egon Gun
gSkillData.plrDmgEgonNarrow = GetSkillCvar( "sk_plr_egon_narrow");
gSkillData.plrDmgEgonWide = GetSkillCvar( "sk_plr_egon_wide");
// Hand Grendade
gSkillData.plrDmgHandGrenade = GetSkillCvar( "sk_plr_hand_grenade");
// Satchel Charge
gSkillData.plrDmgSatchel = GetSkillCvar( "sk_plr_satchel");
// Tripmine
gSkillData.plrDmgTripmine = GetSkillCvar( "sk_plr_tripmine");
// MONSTER WEAPONS
gSkillData.monDmg12MM = GetSkillCvar( "sk_12mm_bullet");
gSkillData.monDmgMP5 = GetSkillCvar ("sk_9mmAR_bullet" );
gSkillData.monDmg9MM = GetSkillCvar( "sk_9mm_bullet");
// MONSTER HORNET
gSkillData.monDmgHornet = GetSkillCvar( "sk_hornet_dmg");
// PLAYER HORNET
// Up to this point, player hornet damage and monster hornet damage were both using
// monDmgHornet to determine how much damage to do. In tuning the hivehand, we now need
// to separate player damage and monster hivehand damage. Since it's so late in the project, we've
// added plrDmgHornet to the SKILLDATA struct, but not to the engine CVar list, so it's inaccesible
// via SKILLS.CFG. Any player hivehand tuning must take place in the code. (sjb)
gSkillData.plrDmgHornet = 7;
// HEALTH/CHARGE
gSkillData.suitchargerCapacity = GetSkillCvar( "sk_suitcharger" );
gSkillData.batteryCapacity = GetSkillCvar( "sk_battery" );
gSkillData.healthchargerCapacity = GetSkillCvar ( "sk_healthcharger" );
gSkillData.healthkitCapacity = GetSkillCvar ( "sk_healthkit" );
gSkillData.scientistHeal = GetSkillCvar ( "sk_scientist_heal" );
// monster damage adj
gSkillData.monHead = GetSkillCvar( "sk_monster_head" );
gSkillData.monChest = GetSkillCvar( "sk_monster_chest" );
gSkillData.monStomach = GetSkillCvar( "sk_monster_stomach" );
gSkillData.monLeg = GetSkillCvar( "sk_monster_leg" );
gSkillData.monArm = GetSkillCvar( "sk_monster_arm" );
// player damage adj
gSkillData.plrHead = GetSkillCvar( "sk_player_head" );
gSkillData.plrChest = GetSkillCvar( "sk_player_chest" );
gSkillData.plrStomach = GetSkillCvar( "sk_player_stomach" );
gSkillData.plrLeg = GetSkillCvar( "sk_player_leg" );
gSkillData.plrArm = GetSkillCvar( "sk_player_arm" );
}
//=========================================================

View file

@ -30,6 +30,7 @@
#include "mod/AvHServerVariables.h"
#include "mod/AvHMarineWeaponConstants.h"
#include "mod/AvHGamerules.h"
#include "mod/AvHServerVariables.h"
#include "util/MathUtil.h"
#include "common/vec_op.h"
@ -44,12 +45,16 @@ LINK_ENTITY_TO_CLASS( grenade, CGrenade );
//
// Grenade Explode
//
void CGrenade::Explode( Vector vecSrc, Vector vecAim )
void CGrenade::SetDamageType(int inDamageType) {
this->m_damageType=inDamageType;
}
void CGrenade::Explode( Vector vecSrc, Vector vecAim)
{
TraceResult tr;
UTIL_TraceLine ( pev->origin, pev->origin + Vector ( 0, 0, -32 ), ignore_monsters, ENT(pev), & tr);
Explode( &tr, NS_DMG_BLAST);
Explode( &tr, this->m_damageType);
}
// UNDONE: temporary scorching for PreAlpha - find a less sleazy permenant solution.
@ -207,15 +212,17 @@ void CGrenade::Detonate( void )
TraceResult tr;
Vector vecSpot;// trace starts here!
if(CVAR_GET_FLOAT(kvBulletCam))
#ifdef DEBUG
if(ns_cvar_float(&avh_bulletcam))
{
SET_VIEW(this->pev->owner, this->pev->owner);
}
#endif
vecSpot = pev->origin + Vector ( 0 , 0 , 8 );
UTIL_TraceLine ( vecSpot, vecSpot + Vector ( 0, 0, -40 ), ignore_monsters, ENT(pev), & tr);
Explode( &tr, NS_DMG_BLAST);
Explode( &tr, this->m_damageType);
}
//
@ -252,7 +259,7 @@ void CGrenade::ExplodeTouch( CBaseEntity *pOther )
vecSpot = pev->origin - pev->velocity.Normalize() * 32;
UTIL_TraceLine( vecSpot, vecSpot + pev->velocity.Normalize() * 64, ignore_monsters, ENT(pev), &tr );
Explode( &tr, NS_DMG_BLAST);
Explode( &tr, this->m_damageType);
}
@ -315,7 +322,7 @@ void CGrenade::BounceTouch( CBaseEntity *pOther )
{
TraceResult tr = UTIL_GetGlobalTrace( );
ClearMultiDamage( );
pOther->TraceAttack(pevOwner, 1, gpGlobals->v_forward, &tr, NS_DMG_BLAST);
pOther->TraceAttack(pevOwner, 1, gpGlobals->v_forward, &tr, this->m_damageType);
ApplyMultiDamage( pev, pevOwner);
}
m_flNextAttack = gpGlobals->time + 1.0; // debounce
@ -452,6 +459,7 @@ void CGrenade:: Spawn( void )
UTIL_SetSize(pev, Vector( 0, 0, 0), Vector(0, 0, 0));
m_fRegisteredSound = FALSE;
m_damageType = NS_DMG_BLAST;
}
@ -481,9 +489,10 @@ CGrenade *CGrenade::ShootContact( entvars_t *pevOwner, Vector vecStart, Vector v
return pGrenade;
}
CGrenade* CGrenade::ShootExplosiveTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time )
CGrenade* CGrenade::ShootExplosiveTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, int inDamageType)
{
CGrenade *pGrenade = CGrenade::ShootTimed(pevOwner, vecStart, vecVelocity, time);
pGrenade->SetDamageType(inDamageType);
pGrenade->SetTouch(&CGrenade::ExplosiveBounceTouch);
return pGrenade;
}
@ -500,10 +509,12 @@ CGrenade * CGrenade:: ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector v
pGrenade->SetTouch( &CGrenade::BounceTouch ); // Bounce if touched
if(CVAR_GET_FLOAT(kvBulletCam))
#ifdef DEBUG
if(ns_cvar_float(&avh_bulletcam))
{
SET_VIEW(ENT(pevOwner), ENT(pGrenade->pev));
}
#endif
// Take one second off of the desired detonation time and set the think to PreDetonate. PreDetonate
// will insert a DANGER sound into the world sound list and delay detonation for one second so that

View file

@ -27,7 +27,7 @@
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="TRUE"
AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;U:\include\stlport;U:\include\nexus;U:\include\lua;U:\include\particle;U:\include"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;QUIVER;VOXEL;QUAKE2;VALVE_DLL;AVH_SERVER;AVH_PLAYTEST_BUILD;$(NOINHERIT)"
PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;QUIVER;VOXEL;QUAKE2;VALVE_DLL;AVH_SERVER;AVH_SECURE_PRERELEASE_BUILD;USE_OLDAUTH;$(NOINHERIT)"
StringPooling="TRUE"
MinimalRebuild="TRUE"
RuntimeLibrary="0"
@ -99,7 +99,7 @@
Optimization="0"
OptimizeForProcessor="1"
AdditionalIncludeDirectories="&quot;$(SolutionDir)&quot;;U:\include\stlport;U:\include\nexus;U:\include\lua;U:\include\particle;U:\include"
PreprocessorDefinitions="_DEBUG;DEBUG;WIN32;_WINDOWS;QUIVER;VOXEL;QUAKE2;VALVE_DLL;AVH_SERVER;$(NOINHERIT)"
PreprocessorDefinitions="_DEBUG;DEBUG;WIN32;_WINDOWS;QUIVER;VOXEL;QUAKE2;VALVE_DLL;AVH_SERVER;AVH_SECURE_PRERELEASE_BUILD;USE_OLDAUTH;$(NOINHERIT)"
RuntimeLibrary="1"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
@ -2783,12 +2783,6 @@
<File
RelativePath="..\mod\AvHNexusTunnelToClient.h">
</File>
<File
RelativePath="..\mod\AvHObjective.cpp">
</File>
<File
RelativePath="..\mod\AvHObjective.h">
</File>
<File
RelativePath="..\mod\AvHOrder.cpp">
<FileConfiguration
@ -5055,40 +5049,6 @@
RelativePath="..\textrep\TRTagValuePair.h">
</File>
</Filter>
<Filter
Name="scriptengine"
Filter="">
<File
RelativePath="..\scriptengine\AvHLUA.cpp">
</File>
<File
RelativePath="..\scriptengine\AvHLUA.h">
</File>
<File
RelativePath="..\scriptengine\AvHLUABase.cpp">
</File>
<File
RelativePath="..\scriptengine\AvHLUABase.h">
</File>
<File
RelativePath="..\scriptengine\AvHLUAServerEntity.cpp">
</File>
<File
RelativePath="..\scriptengine\AvHLUAServerEvents.cpp">
</File>
<File
RelativePath="..\scriptengine\AvHLUAServerTeam.cpp">
</File>
<File
RelativePath="..\scriptengine\AvHLUATime.cpp">
</File>
<File
RelativePath="..\scriptengine\AvHLUAUtil.cpp">
</File>
<File
RelativePath="..\scriptengine\AvHLUAUtil.h">
</File>
</Filter>
</Files>
<Globals>
</Globals>

View file

@ -29,6 +29,7 @@
#include "mod/AvHServerUtil.h"
#include "common/hltv.h"
#include "mod/AvHNetworkMessages.h"
#include "mod/AvHServerVariables.h"
extern DLL_GLOBAL CGameRules *g_pGameRules;
extern DLL_GLOBAL BOOL g_fGameOver;
@ -74,7 +75,7 @@ CHalfLifeMultiplay :: CHalfLifeMultiplay()
{
//g_VoiceGameMgr.Init(&g_GameMgrHelper, gpGlobals->maxClients);
RefreshSkillData();
//RefreshSkillData();
m_flIntermissionEndTime = 0;
g_flIntermissionStartTime = 0;
@ -130,7 +131,7 @@ BOOL CHalfLifeMultiplay::ClientCommand( CBasePlayer *pPlayer, const char *pcmd )
void CHalfLifeMultiplay::RefreshSkillData( void )
{
// load all default values
CGameRules::RefreshSkillData();
//CGameRules::RefreshSkillData();
// override some values for multiplay.
@ -201,7 +202,7 @@ void CHalfLifeMultiplay :: Think ( void )
if ( g_fGameOver ) // someone else quit the game already
{
// bounds check
int time = (int)CVAR_GET_FLOAT( "mp_chattime" );
int time = (int)ns_cvar_float( &mp_chattime );
if ( time < 10 )
CVAR_SET_STRING( "mp_chattime", "10" );
else if ( time > MAX_INTERMISSION_TIME )
@ -1012,7 +1013,7 @@ void CHalfLifeMultiplay :: GoToIntermission( void )
MESSAGE_END();
// bounds check
int time = (int)CVAR_GET_FLOAT( "mp_chattime" );
int time = (int)ns_cvar_float( &mp_chattime );
if ( time < 10 )
CVAR_SET_STRING( "mp_chattime", "10" );
else if ( time > MAX_INTERMISSION_TIME )

File diff suppressed because it is too large Load diff

View file

@ -34,7 +34,7 @@ extern int gmsgMOTD;
//=========================================================
CHalfLifeRules::CHalfLifeRules( void )
{
RefreshSkillData();
//RefreshSkillData();
}
//=========================================================

View file

@ -95,12 +95,12 @@ void CHalfLifeTeamplay :: Think ( void )
return;
}
float flTimeLimit = CVAR_GET_FLOAT("mp_timelimit") * 60;
float flTimeLimit = ns_cvar_float(&timelimit) * 60;
time_remaining = (int)(flTimeLimit ? ( flTimeLimit - gpGlobals->time ) : 0);
// Don't map switch in tourny mode, it signals the end of the match instead
bool theIsTournyMode = (CVAR_GET_FLOAT(kvTournamentMode) > 0);
bool theIsTournyMode = (ns_cvar_int(&avh_tournamentmode) > 0);
if ( flTimeLimit != 0 && (gpGlobals->time >= flTimeLimit) && !theIsTournyMode)
{
GoToIntermission();

View file

@ -28,6 +28,7 @@
#include "trains.h" // trigger_camera has train functionality
#include "gamerules.h"
#include "dlls/triggers.h"
#include "mod/AvHServerVariables.h"
#define SF_TRIGGER_PUSH_START_OFF 2//spawnflag that makes trigger_push spawn turned OFF
#define SF_TRIGGER_HURT_TARGETONCE 1// Only fire hurt target once
@ -535,7 +536,7 @@ void CBaseTrigger::InitTrigger( )
pev->solid = SOLID_TRIGGER;
pev->movetype = MOVETYPE_NONE;
SET_MODEL(ENT(pev), STRING(pev->model)); // set size and link into world
if ( CVAR_GET_FLOAT("showtriggers") == 0 )
if ( ns_cvar_float(showtriggers) == 0 )
SetBits( pev->effects, EF_NODRAW );
}
@ -1738,7 +1739,7 @@ void CLadder :: Precache( void )
// Do all of this in here because we need to 'convert' old saved games
pev->solid = SOLID_NOT;
pev->skin = CONTENTS_LADDER;
if ( CVAR_GET_FLOAT("showtriggers") == 0 )
if ( ns_cvar_float(showtriggers) == 0 )
{
pev->rendermode = kRenderTransTexture;
pev->renderamt = 0;

View file

@ -32,6 +32,7 @@
#include "gamerules.h"
#include "mod/AvHServerUtil.h"
#include "mod/AvHNetworkMessages.h"
#include "mod/AvHServerVariables.h"
//#include "mod/AvHSharedUtil.h"
//#include "mod/AvHGamerules.h"
@ -1189,12 +1190,12 @@ BOOL UTIL_ShouldShowBlood( int color )
{
if ( color == BLOOD_COLOR_RED )
{
if ( CVAR_GET_FLOAT("violence_hblood") != 0 )
if ( ns_cvar_float(violence_hblood) != 0 )
return TRUE;
}
else
{
if ( CVAR_GET_FLOAT("violence_ablood") != 0 )
if ( ns_cvar_float(violence_ablood) != 0 )
return TRUE;
}
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -54,8 +54,8 @@ public:
typedef enum { SATCHEL_DETONATE = 0, SATCHEL_RELEASE } SATCHELCODE;
static CGrenade *ShootExplosiveTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time );
static CGrenade *ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time );
static CGrenade *ShootExplosiveTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time, int inDamageType );
static CGrenade *ShootTimed( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity, float time);
static CGrenade *ShootContact( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity );
static CGrenade *ShootSatchelCharge( entvars_t *pevOwner, Vector vecStart, Vector vecVelocity );
static void UseSatchelCharges( entvars_t *pevOwner, SATCHELCODE code );
@ -77,8 +77,11 @@ public:
virtual void BounceSound( void );
virtual int BloodColor( void ) { return DONT_BLEED; }
virtual void Killed( entvars_t *pevAttacker, int iGib );
virtual void SetDamageType(int inDamageType);
BOOL m_fRegisteredSound;// whether or not this grenade has issued its DANGER sound to the world sound list yet.
private:
int m_damageType;
};
@ -380,6 +383,8 @@ public:
int m_iDefaultAmmo;// how much ammo you get when you pick up this weapon as placed by a level designer.
bool PrevAttack2Status; // HACK: For +movement weapon animations
float m_flLastAnimationPlayed;
};

View file

@ -35,6 +35,7 @@
#include "gamerules.h"
#include "teamplay_gamerules.h"
#include "mod/AvHGamerules.h"
#include "mod/AvHServerVariables.h"
#include "pm_shared/pm_defs.h"
extern CGraph WorldGraph;
@ -480,7 +481,7 @@ void CWorld :: Spawn( void )
{
g_fGameOver = FALSE;
Precache( );
g_flWeaponCheat = CVAR_GET_FLOAT( "sv_cheats" ); // Is the impulse 101 command allowed?
g_flWeaponCheat = ns_cvar_float(avh_cheats ); // Is the impulse 101 command allowed?
}
void CWorld :: Precache( void )

View file

@ -96,9 +96,17 @@ typedef struct hud_player_info_s
char *model;
short topcolor;
short bottomcolor;
char padding[8];
} hud_player_info_t;
#define MAX_ALIAS_NAME 32
typedef struct cmdalias_s
{
struct cmdalias_s *next;
char name[MAX_ALIAS_NAME];
char *value;
} cmdalias_t;
// this is by no means complete, or even accurate
typedef struct cl_enginefuncs_s
@ -251,6 +259,41 @@ typedef struct cl_enginefuncs_s
void ( *pfnGetMousePos )( struct tagPOINT *ppt );
void ( *pfnSetMousePos )( int x, int y );
void ( *pfnSetMouseEnable )( qboolean fEnable );
// missing functions from alfred reynolds. Return type and parameters unknown
void (* GetFirstCvarPtr)(void);
void (* GetFirstCmdFunctionHandle)(void);
void (* GetNextCmdFunctionHandle)(void);
void (* GetCmdFunctionName)(void);
void (* hudGetClientOldTime)(void);
void (* hudGetServerGravityValue)(void);
void (* hudGetModelByIndex)(void);
void (* pfnSetFilterMode)(void);
void (* pfnSetFilterColor)(void);
void (* pfnSetFilterBrightness)(void);
void (* pfnSequenceGet)(void);
void (* pfnSPR_DrawGeneric)(void);
void (* pfnSequencePickSentence)(void);
void (* pfnDrawString)(void);
void (* pfnDrawStringReverse)(void);
void (* LocalPlayerInfo_ValueForKey)(void);
void (* pfnVGUI2DrawCharacter)(void);
void (* pfnVGUI2DrawCharacterAdd)(void);
void (* COM_GetApproxWavePlayLength)(void);
void (* pfnGetCareerUI)(void);
void (* Cvar_Set)(void);
void (* pfnIsCareerMatch)(void);
void (* pfnPlaySoundVoiceByName)(void);
void (* pfnPrimeMusicStream)(void);
void (* GetAbsoluteTime)(void);
void (* pfnProcessTutorMessageDecayBuffer)(void);
void (* pfnConstructTutorMessageDecayBuffer)(void);
void (* pfnResetTutorMessageDecayData)(void);
void (* pfnPlaySoundByNameAtPitch)(void);
void (* pfnFillRGBABlend)(void);
void (* pfnGetAppID)(void);
// end: missing functions from alfred reynolds. Return type and parameters unknown
cmdalias_t* (*pfnGetAliases) ( void );
} cl_enginefunc_t;
#ifndef IN_BUTTONS_H

View file

@ -260,6 +260,7 @@ typedef struct enginefuncs_s
qboolean (*pfnVoice_SetClientListening)(int iReceiver, int iSender, qboolean bListen);
const char* (*pfnGetPlayerAuthId) ( edict_t *e );
void (*pfnQueryClientCvarValue2)( const edict_t *player, const char *cvarName, int requestID );
} enginefuncs_t;
// ONLY ADD NEW FUNCTIONS TO THE END OF THIS STRUCT. INTERFACE VERSION IS FROZEN AT 138
@ -480,6 +481,8 @@ typedef struct
void (*pfnOnFreeEntPrivateData)(edict_t *pEnt);
void (*pfnGameShutdown)(void);
int (*pfnShouldCollide)( edict_t *pentTouched, edict_t *pentOther );
void (*pfnCvarValue)( const edict_t *pEnt, const char *value );
void (*pfnCvarValue2)( const edict_t *pEnt, int requestID, const char *cvarName, const char *value );
} NEW_DLL_FUNCTIONS;
typedef int (*NEW_DLL_FUNCTIONS_FN)( NEW_DLL_FUNCTIONS *pFunctionTable, int *interfaceVersion );

View file

@ -1,35 +1,35 @@
//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: teamconst.h $
// $Date: 2002/07/23 16:49:42 $
//
//-------------------------------------------------------------------------------
// $Log: teamconst.h,v $
// Revision 1.2 2002/07/23 16:49:42 Flayra
// - Added document header, new player constant
//
//===============================================================================
#ifndef TEAM_CONST_H
#define TEAM_CONST_H
#define MAX_PLAYERS 32//voogru: Why was this 64?!
#define MAX_PLAYERS_PER_TEAM 16
//#define MAX_TEAMS 64
#define MAX_TEAMS 6
#define MAX_TEAM_NAME 16
#define MAX_TEAMNAME_LENGTH 16
#define TEAMPLAY_TEAMLISTLENGTH MAX_TEAMS*MAX_TEAMNAME_LENGTH
//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: teamconst.h $
// $Date: 2002/07/23 16:49:42 $
//
//-------------------------------------------------------------------------------
// $Log: teamconst.h,v $
// Revision 1.2 2002/07/23 16:49:42 Flayra
// - Added document header, new player constant
//
//===============================================================================
#ifndef TEAM_CONST_H
#define TEAM_CONST_H
#define MAX_PLAYERS 32//: Why was this 64?!
#define MAX_PLAYERS_PER_TEAM 16
//#define MAX_TEAMS 64
#define MAX_TEAMS 6
#define MAX_TEAM_NAME 16
#define MAX_TEAMNAME_LENGTH 16
#define TEAMPLAY_TEAMLISTLENGTH MAX_TEAMS*MAX_TEAMNAME_LENGTH
#endif

View file

@ -1,100 +1,100 @@
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#include "../cl_dll/wrect.h"
#include "../cl_dll/cl_dll.h"
#include "vgui.h"
#include "vgui_loadtga.h"
#include "vgui_inputstream.h"
//#include "ui/MemoryInputStream.h"
// tankefugl: HACK
// Implemented old MemoryInputStream to work around bugs(?) in the other implementation or in
// the vgui's handling of the other one
class MemoryInputStream2 : public vgui::InputStream
{
public:
MemoryInputStream2()
{
m_pData = NULL;
m_DataLen = m_ReadPos = 0;
}
virtual void seekStart(bool& success) {m_ReadPos=0; success=true;}
virtual void seekRelative(int count,bool& success) {m_ReadPos+=count; success=true;}
virtual void seekEnd(bool& success) {m_ReadPos=m_DataLen; success=true;}
virtual int getAvailable(bool& success) {success=false; return 0;} // This is what vgui does for files...
virtual uchar readUChar(bool& success)
{
if(m_ReadPos>=0 && m_ReadPos<m_DataLen)
{
success=true;
uchar ret = m_pData[m_ReadPos];
++m_ReadPos;
return ret;
}
else
{
success=false;
return 0;
}
}
virtual void readUChar(uchar* buf,int count,bool& success)
{
for(int i=0; i < count; i++)
buf[i] = readUChar(success);
}
virtual void close(bool& success)
{
m_pData = NULL;
m_DataLen = m_ReadPos = 0;
}
uchar *m_pData;
int m_DataLen;
int m_ReadPos;
};
// :tankefugl
vgui::BitmapTGA* vgui_LoadTGANoInvertAlpha(char const *pFilename)
{ return vgui_LoadTGA(pFilename,false); }
vgui::BitmapTGA* vgui_LoadTGA(char const *pFilename, bool bInvertAlpha)
{
// tankefugl:
MemoryInputStream2 stream;
stream.m_pData = gEngfuncs.COM_LoadFile((char*)pFilename, 5, &stream.m_DataLen);
if(!stream.m_pData)
return NULL;
stream.m_ReadPos = 0;
vgui::BitmapTGA *pRet = new vgui::BitmapTGA(&stream, bInvertAlpha);
gEngfuncs.COM_FreeFile(stream.m_pData);
return pRet;
// :tankefugl
/* // New implementation:
int nLength = 0;
uchar* pData = gEngfuncs.COM_LoadFile((char*)pFilename, 5, &nLength);
if( !pData )
return NULL;
MemoryInputStream stream(pData,nLength);
vgui::BitmapTGA *pRet = new vgui::BitmapTGA(&stream, bInvertAlpha);
gEngfuncs.COM_FreeFile(pData);
return pRet;*/
}
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#include "../cl_dll/wrect.h"
#include "../cl_dll/cl_dll.h"
#include "vgui.h"
#include "vgui_loadtga.h"
#include "vgui_inputstream.h"
//#include "ui/MemoryInputStream.h"
// : HACK
// Implemented old MemoryInputStream to work around bugs(?) in the other implementation or in
// the vgui's handling of the other one
class MemoryInputStream2 : public vgui::InputStream
{
public:
MemoryInputStream2()
{
m_pData = NULL;
m_DataLen = m_ReadPos = 0;
}
virtual void seekStart(bool& success) {m_ReadPos=0; success=true;}
virtual void seekRelative(int count,bool& success) {m_ReadPos+=count; success=true;}
virtual void seekEnd(bool& success) {m_ReadPos=m_DataLen; success=true;}
virtual int getAvailable(bool& success) {success=false; return 0;} // This is what vgui does for files...
virtual uchar readUChar(bool& success)
{
if(m_ReadPos>=0 && m_ReadPos<m_DataLen)
{
success=true;
uchar ret = m_pData[m_ReadPos];
++m_ReadPos;
return ret;
}
else
{
success=false;
return 0;
}
}
virtual void readUChar(uchar* buf,int count,bool& success)
{
for(int i=0; i < count; i++)
buf[i] = readUChar(success);
}
virtual void close(bool& success)
{
m_pData = NULL;
m_DataLen = m_ReadPos = 0;
}
uchar *m_pData;
int m_DataLen;
int m_ReadPos;
};
// :
vgui::BitmapTGA* vgui_LoadTGANoInvertAlpha(char const *pFilename)
{ return vgui_LoadTGA(pFilename,false); }
vgui::BitmapTGA* vgui_LoadTGA(char const *pFilename, bool bInvertAlpha)
{
// :
MemoryInputStream2 stream;
stream.m_pData = gEngfuncs.COM_LoadFile((char*)pFilename, 5, &stream.m_DataLen);
if(!stream.m_pData)
return NULL;
stream.m_ReadPos = 0;
vgui::BitmapTGA *pRet = new vgui::BitmapTGA(&stream, bInvertAlpha);
gEngfuncs.COM_FreeFile(stream.m_pData);
return pRet;
// :
/* // New implementation:
int nLength = 0;
uchar* pData = gEngfuncs.COM_LoadFile((char*)pFilename, 5, &nLength);
if( !pData )
return NULL;
MemoryInputStream stream(pData,nLength);
vgui::BitmapTGA *pRet = new vgui::BitmapTGA(&stream, bInvertAlpha);
gEngfuncs.COM_FreeFile(pData);
return pRet;*/
}

View file

@ -9,7 +9,7 @@
#include <stdio.h>
#include "voice_banmgr.h"
#include "dlls/extdll.h"
#include "localassert.h"
#define BANMGR_FILEVERSION 1
char const *g_pBanMgrFilename = "voice_ban.dt";
@ -18,12 +18,12 @@ char const *g_pBanMgrFilename = "voice_ban.dt";
// Hash a player ID to a byte.
unsigned char HashPlayerID(char const playerID[16])
{
unsigned char curHash = 0;
char curHash = 0;
for(int i=0; i < 16; i++)
curHash += (unsigned char)(playerID[i] & 0xFF);
curHash += (char)(playerID[i]);
return curHash;
return (unsigned char)curHash;
}
@ -169,7 +169,7 @@ void CVoiceBanMgr::Clear()
CVoiceBanMgr::BannedPlayer* CVoiceBanMgr::InternalFindPlayerSquelch(char const playerID[16])
{
int index = HashPlayerID(playerID);
int index = (int)HashPlayerID(playerID) & 0xFF;
BannedPlayer *pListHead = &m_PlayerHash[index];
for(BannedPlayer *pCur=pListHead->m_pNext; pCur != pListHead; pCur=pCur->m_pNext)
{

View file

@ -12,7 +12,7 @@
#include "dlls/util.h"
#include "dlls/cbase.h"
#include "dlls/player.h"
#include "mod/AvHServerVariables.h"
#define UPDATE_INTERVAL 0.3
@ -217,7 +217,7 @@ void CVoiceGameMgr::UpdateMasks()
{
m_UpdateInterval = 0;
bool bAllTalk = !!g_engfuncs.pfnCVarGetFloat( "sv_alltalk" );
bool bAllTalk = !!ns_cvar_float(&sv_alltalk);
for(int iClient=0; iClient < m_nMaxPlayers; iClient++)
{

File diff suppressed because it is too large Load diff

View file

@ -31,7 +31,9 @@ TEXT_OBJDIR=$(TEXT_SRCDIR)/obj
UTIL_OBJDIR=$(UTIL_SRCDIR)/obj
OUTPUT_DIR=../../hlds_l/ns/dlls
BASE_CFLAGS=-Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -DAVH_SERVER -DLINUX -DVALVE_DLL -DQUIVER -DVOXEL -DQUAKE2 -DDEDICATED -DSWDS -D_STLP_USE_GLIBC -DAVH_PLAYTEST_BUILD -DUSE_OLDAUTH -DAVH_SECURE_PRERELEASE_BUILD
BASE_CFLAGS=-Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -DAVH_SERVER -DLINUX -DVALVE_DLL -DQUIVER -DVOXEL -DQUAKE2 -DDEDICATED -DSWDS -D_STLP_USE_GLIBC -DUSE_OLDAUTH
# -DAVH_SECURE_PRERELEASE_BUILD for CM testing
#full optimization
CFLAGS=$(BASE_CFLAGS) -w -Wall -nostdinc++ -ffor-scope -fPIC -mcpu=i486 -O3 -pipe -funroll-loops -fdelayed-branch -malign-loops=4 -malign-jumps=4 -malign-functions=4

File diff suppressed because it is too large Load diff

View file

@ -57,6 +57,9 @@
#include "cl_dll/hud.h"
#include "mod/AvHHud.h"
extern int g_runfuncs;
void IN_Attack2Down();
void IN_Attack2Up();
bool CheckInAttack();
#endif
LINK_ENTITY_TO_CLASS(kwLeap, AvHLeap);
@ -123,8 +126,8 @@ void AvHLeap::Precache(void)
PRECACHE_UNMODIFIED_SOUND(kLeapSound);
PRECACHE_UNMODIFIED_SOUND(kLeapHitSound1);
PRECACHE_UNMODIFIED_SOUND(kLeapKillSound);
this->mEvent = PRECACHE_EVENT(1, kLeapEventName);
this->mLeapEvent = PRECACHE_EVENT(1, kLeapEventName);
this->mAbilityEvent = PRECACHE_EVENT(1, kAbilityEventName);
}
@ -144,11 +147,23 @@ void AvHLeap::Spawn()
FallInit();// get ready to fall down.
}
float AvHLeap::GetRateOfFire(void) const
{
return (float)BALANCE_VAR(kLeapROF);// * 0.5f;
}
bool AvHLeap::UsesAmmo(void) const
{
return false;
}
void AvHLeap::SecondaryAttack()
{
#ifdef AVH_CLIENT
this->FireProjectiles();
#endif
}
void AvHLeap::FireProjectiles(void)
{
#ifdef AVH_SERVER
@ -161,6 +176,8 @@ void AvHLeap::FireProjectiles(void)
#ifdef AVH_CLIENT
if(g_runfuncs)
{
//IN_Attack2Down();
//CBasePlayerWeapon::SendWeaponAnim(3);
gHUD.SetAlienAbility(this->GetAbilityImpulse());
}
#endif
@ -220,7 +237,7 @@ int AvHCharge::GetDeployAnimation() const
float AvHCharge::GetDeployTime() const
{
return .6f;
return 0.0f; //.6f;
}
bool AvHCharge::GetFiresUnderwater() const
@ -250,7 +267,7 @@ void AvHCharge::Precache(void)
PRECACHE_UNMODIFIED_MODEL(kLevel5ViewModel);
PRECACHE_UNMODIFIED_MODEL(kNullModel);
PRECACHE_UNMODIFIED_SOUND(kChargeSound);
PRECACHE_UNMODIFIED_SOUND(kChargeSound2);
PRECACHE_UNMODIFIED_SOUND(kChargeKillSound);
this->mEvent = PRECACHE_EVENT(1, kChargeEventName);
@ -278,14 +295,30 @@ bool AvHCharge::UsesAmmo(void) const
return false;
}
void AvHCharge::SecondaryAttack()
{
#ifdef AVH_CLIENT
this->FireProjectiles();
#endif
}
void AvHCharge::FireProjectiles(void)
{
#ifdef AVH_CLIENT
if (CheckInAttack())
IN_Attack2Down();
else
IN_Attack2Up();
//gHUD.SetAlienAbility(this->GetAbilityImpulse());
#endif
// Event is played back. Mark pmove with proper flag so the alien Charges forward.
PLAYBACK_EVENT_FULL(0, this->m_pPlayer->edict(), this->mAbilityEvent, 0, this->m_pPlayer->pev->origin, (float *)&g_vecZero, 0.0, 0.0, this->GetAbilityImpulse(), 0, 1, 0 );
//PLAYBACK_EVENT_FULL(0, this->m_pPlayer->edict(), this->mAbilityEvent, 0, this->m_pPlayer->pev->origin, (float *)&g_vecZero, 0.0, 0.0, this->GetAbilityImpulse(), 0, 1, 0 );
// Send fire anim
//SendWeaponAnim(5);
this->PlaybackEvent(this->mWeaponAnimationEvent, 5);
//this->PlaybackEvent(this->mWeaponAnimationEvent, 5);
}
void AvHCharge::Init()
@ -295,6 +328,6 @@ void AvHCharge::Init()
float AvHCharge::GetRateOfFire() const
{
// Approximate length of charge sound
return 5.0f;
return 1.0f;
}

View file

@ -45,7 +45,9 @@ class AvHAlienAbilityWeapon : public AvHAlienWeapon
{
public:
virtual AvHMessageID GetAbilityImpulse() const = 0;
virtual void PlaybackLeapEvent(void) { this->PlaybackEvent(this->mLeapEvent, this->GetShootAnimation());};
int mAbilityEvent;
int mLeapEvent;
};
class AvHLeap : public AvHAlienAbilityWeapon
@ -83,6 +85,10 @@ public:
virtual bool UsesAmmo(void) const;
virtual BOOL GetTakesEnergy() { return FALSE; }
void SecondaryAttack();
virtual float GetRateOfFire(void) const;
protected:
virtual void FireProjectiles(void);
@ -129,6 +135,8 @@ public:
virtual bool UsesAmmo(void) const;
virtual BOOL GetTakesEnergy() { return FALSE; }
void SecondaryAttack();
protected:
virtual void FireProjectiles(void);
@ -174,6 +182,8 @@ public:
virtual bool UsesAmmo(void) const;
virtual float GetRateOfFire() const;
void SecondaryAttack();
protected:
virtual void FireProjectiles(void);

View file

@ -1,70 +1,74 @@
//======== (C) Copyright 2001 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHAlienAbilityConstants.h$
// $Date: 2002/11/22 22:01:00 $
//
//-------------------------------------------------------------------------------
// $Log: AvHAlienAbilityConstants.h,v $
// Revision 1.8 2002/11/22 22:01:00 Flayra
// - Case-sensitive problem that is now an issue for linux with mp_consistency
//
// Revision 1.7 2002/10/16 00:45:44 Flayra
// - Toned down leap and charge damage (is this frame-rate dependent?)
//
// Revision 1.6 2002/08/16 02:31:01 Flayra
// - Big balance change: all weapons reduced by 20% damage
//
// Revision 1.5 2002/06/25 17:26:29 Flayra
// - Regular update for leap and charge
//
// Revision 1.4 2002/06/03 16:20:35 Flayra
// - Removed outdated v_leap.mdl (!)
//
// Revision 1.3 2002/05/23 02:34:00 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#ifndef AVH_ALIEN_ABILITY_CONSTANTS_H
#define AVH_ALIEN_ABILITY_CONSTANTS_H
// Leap constants.
const int kLeapRange = 600;
const float kLeapPunch = 2.5;
#define kLeapSound "weapons/leap1.wav"
#define kLeapHitSound1 "weapons/leaphit1.wav"
#define kLeapKillSound "weapons/leapkill.wav"
#define kLeapEventName "events/Leap.sc"
#define kLeapPModel "models/null.mdl"
const float kLeapROF = 1.5f;
const float kLeapDuration = 1.0f;
// Charge constants.
const float kChargePunch = 2.5;
#define kChargeSound "weapons/charge1.wav"
#define kChargeKillSound "weapons/chargekill.wav"
#define kChargeEventName "events/Charge.sc"
const float kChargeROF = 5.0f;
#define kAlienSightOnSound "misc/aliensighton.wav"
#define kAlienSightOffSound "misc/aliensightoff.wav"
const int kAlienCloakRenderMode = kRenderTransTexture;
const int kAlienCloakAmount = 25;
// puzl: 1061 full cloaking
const int kAlienStructureCloakAmount = 0;
// :puzl
const int kAlienSelfCloakingBaseOpacity = 130;
const int kAlienCloakViewModelRenderMode = kRenderTransAdd;
const int kAlienCloakViewModelAmount = 35;
const int kAlienCloakViewModelLevelAmount = 10;
//======== (C) Copyright 2001 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHAlienAbilityConstants.h$
// $Date: 2002/11/22 22:01:00 $
//
//-------------------------------------------------------------------------------
// $Log: AvHAlienAbilityConstants.h,v $
// Revision 1.8 2002/11/22 22:01:00 Flayra
// - Case-sensitive problem that is now an issue for linux with mp_consistency
//
// Revision 1.7 2002/10/16 00:45:44 Flayra
// - Toned down leap and charge damage (is this frame-rate dependent?)
//
// Revision 1.6 2002/08/16 02:31:01 Flayra
// - Big balance change: all weapons reduced by 20% damage
//
// Revision 1.5 2002/06/25 17:26:29 Flayra
// - Regular update for leap and charge
//
// Revision 1.4 2002/06/03 16:20:35 Flayra
// - Removed outdated v_leap.mdl (!)
//
// Revision 1.3 2002/05/23 02:34:00 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#ifndef AVH_ALIEN_ABILITY_CONSTANTS_H
#define AVH_ALIEN_ABILITY_CONSTANTS_H
// Leap constants.
const int kLeapRange = 600;
const float kLeapPunch = 2.5;
#define kLeapSound "weapons/leap1.wav"
#define kLeapHitSound1 "weapons/leaphit1.wav"
#define kLeapKillSound "weapons/leapkill.wav"
#define kLeapEventName "events/Leap.sc"
#define kLeapPModel "models/null.mdl"
const float kLeapDuration = 1.0f;
// Charge constants.
const float kChargePunch = 2.5;
#define kChargeSound "weapons/charge1.wav"
#define kChargeSound2 "weapons/charge2.wav"
#define kChargeKillSound "weapons/chargekill.wav"
#define kChargeEventName "events/Charge.sc"
const float kChargeROF = 5.0f;
#define kAlienSightOnSound "misc/aliensighton.wav"
#define kAlienSightOffSound "misc/aliensightoff.wav"
// Blink constants
#define kBlinkSound "weapons/blinksuccess.wav"
const int kAlienCloakRenderMode = kRenderTransTexture;
const int kAlienCloakAmount = 25;
// : 1061 full cloaking
const int kAlienStructureCloakAmount = 0;
// :
const int kAlienSelfCloakingBaseOpacity = 130;
const int kAlienSelfCloakingMinOpacity = 186;
const int kAlienCloakViewModelRenderMode = kRenderTransAdd;
const int kAlienCloakViewModelAmount = 35;
const int kAlienCloakViewModelLevelAmount = 10;
#endif

View file

@ -389,16 +389,18 @@ void AvHDefenseChamber::RegenAliensThink()
{
AvHBaseBuildable* theBuildable = dynamic_cast<AvHBaseBuildable*>(theBaseEntity);
AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(theBaseEntity);
float thePercent=BALANCE_VAR(kDefensiveChamberRegenPercent)/100.0f;
float amount=BALANCE_VAR(kDefensiveChamberRegenAmount) + (theBaseEntity->pev->max_health*thePercent);
if(thePlayer && thePlayer->IsAlive())
{
if(thePlayer->Heal(BALANCE_VAR(kDefensiveChamberRegenAmount)))
if(thePlayer->Heal(amount, true, true))
{
theNumEntsHealed++;
}
}
else if(theBuildable && theBuildable->GetIsBuilt() && (theBuildable != this))
{
if(theBuildable->Regenerate(BALANCE_VAR(kDefensiveChamberRegenAmount)))
if(theBuildable->Regenerate(amount, true, true))
{
theNumEntsHealed++;
}
@ -605,7 +607,7 @@ void AvHMovementChamber::TeleportUse(CBaseEntity* inActivator, CBaseEntity* inCa
{
bool theHiveIsUnderAttack = GetGameRules()->GetIsEntityUnderAttack(theEntity->entindex());
if(theEntity->GetIsActive() || theHiveIsUnderAttack)
if(theEntity->GetIsActive() || theHiveIsUnderAttack || theEntity->GetEmergencyUse() )
{
float theCurrentDistance = VectorDistance(theEntity->pev->origin, inActivator->pev->origin);
bool theHiveIsFarther = (theCurrentDistance > theFarthestDistance);
@ -655,7 +657,7 @@ void AvHMovementChamber::TeleportUse(CBaseEntity* inActivator, CBaseEntity* inCa
{
thePlayer->SetPosition(theOriginToSpawn);
thePlayer->pev->velocity = Vector(0, 0, 0);
thePlayer->TriggerUncloak();
// Play teleport sound before and after
EMIT_SOUND(inActivator->edict(), CHAN_AUTO, kAlienSightOffSound, 1.0f, ATTN_NORM);
}

View file

@ -70,6 +70,9 @@ const float kWebThinkInterval = .1f;
const int kWebStrandWidth = 60;
const int kWebStrandLifetime = 50;
#define kWebStrandBreakSound "misc/web_break.wav"
#define kWebStrandHardenSound "misc/web_harden.wav"
#define kWebStrandFormSound "misc/web_form.wav"
#define kWebStrandHitSound "misc/web_hit.wav"
#define kAlienResourceTowerModel "models/ba_resource.mdl"

View file

@ -305,7 +305,7 @@ void AvHAlienTurret::Shoot(const Vector &inOrigin, const Vector &inToEnemy, cons
Vector theNetworkDirToEnemy;
VectorScale(theDirToEnemy, 100.0f, theNetworkDirToEnemy);
PLAYBACK_EVENT_FULL(0, this->edict(), this->mEvent, 0, theOrigin, theNetworkDirToEnemy, 1.0f, 0.0, /*theWeaponIndex*/ 0, 0, 0, 0 );
PLAYBACK_EVENT_FULL(0, 0, this->mEvent, 0, theOrigin, theNetworkDirToEnemy, 1.0f, 0.0, /*theWeaponIndex*/ this->entindex(), 0, 0, 0 );
// Play attack anim
this->PlayAnimationAtIndex(6, true);

View file

@ -1,287 +1,300 @@
//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHAlienWeapon.cpp $
// $Date: 2002/10/03 18:37:32 $
//
//-------------------------------------------------------------------------------
// $Log: AvHAlienWeapon.cpp,v $
// Revision 1.9 2002/10/03 18:37:32 Flayra
// - Moved alien energy to fuser3
//
// Revision 1.8 2002/09/23 22:08:59 Flayra
// - Updates to allow marine weapons stick around
//
// Revision 1.7 2002/08/31 18:01:00 Flayra
// - Work at VALVe
//
// Revision 1.6 2002/08/16 02:32:09 Flayra
// - Added damage types
// - Swapped umbra and bile bomb
//
// Revision 1.5 2002/07/08 16:43:26 Flayra
// - Web change?
//
// Revision 1.4 2002/06/25 17:29:56 Flayra
// - Better default behavior
//
// Revision 1.3 2002/06/03 16:25:10 Flayra
// - Switch alien weapons quickly, renamed CheckValidAttack()
//
// Revision 1.2 2002/05/28 17:37:14 Flayra
// - Reduced times where alien weapons are dropped and picked up again (but didn't eliminate, they are still being instantiated somewhere)
//
// Revision 1.1 2002/05/23 02:34:00 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#include "mod/AvHAlienWeapon.h"
#include "mod/AvHMovementUtil.h"
#include "mod/AvHSpecials.h"
#ifdef AVH_CLIENT
#include "cl_dll/wrect.h"
#include "cl_dll/cl_dll.h"
#include "cl_dll/hud.h"
#include "cl_dll/cl_util.h"
extern int g_runfuncs;
#include "cl_dll/com_weapons.h"
#include "pm_shared/pm_defs.h"
#include "pm_shared/pm_shared.h"
#include "pm_shared/pm_movevars.h"
extern playermove_t *pmove;
#endif
#include "mod/AvHSharedUtil.h"
#include "util/Balance.h"
AvHAlienWeapon::AvHAlienWeapon()
{
#ifdef AVH_SERVER
this->SetGroundLifetime(0);
#endif
}
bool AvHAlienWeapon::ProcessValidAttack(void)
{
bool theCanAttack = false;
if(AvHBasePlayerWeapon::ProcessValidAttack())
{
if(this->IsUseable())
{
theCanAttack = true;
}
}
return theCanAttack;
}
void AvHAlienWeapon::DeductCostForShot(void)
{
if(this->GetTakesEnergy())
{
AvHBasePlayerWeapon::DeductCostForShot();
float theEnergyCost = this->GetEnergyForAttack();
float& theFuser = this->GetEnergyLevel();
AvHMUDeductAlienEnergy(theFuser, theEnergyCost);
}
}
// Cannot ever drop alien weapons
void AvHAlienWeapon::Drop(void)
{
}
bool AvHAlienWeapon::GetAllowedForUser3(AvHUser3 inUser3)
{
bool theAllowed = false;
// Alien weapons for aliens. Don't take into account exact roles until needed (and until weapons have stabilized)
switch(inUser3)
{
case AVH_USER3_ALIEN_PLAYER1:
case AVH_USER3_ALIEN_PLAYER2:
case AVH_USER3_ALIEN_PLAYER3:
case AVH_USER3_ALIEN_PLAYER4:
case AVH_USER3_ALIEN_PLAYER5:
theAllowed = true;
break;
}
return theAllowed;
}
int AvHAlienWeapon::GetDamageType() const
{
// Assume melee attack, piercing
//return NS_DMG_PIERCING;
return NS_DMG_NORMAL;
}
float AvHAlienWeapon::GetDeployTime() const
{
// Aliens are Quake-style/arcadey, make weapon switch fast
return .1f;
}
float AvHAlienWeapon::GetEnergyForAttack() const
{
float theEnergy = 0.0f;
AvHMUGetEnergyCost((AvHWeaponID)(this->m_iId), theEnergy);
return theEnergy;
}
bool AvHAlienWeapon::GetFiresUnderwater() const
{
return true;
}
// Never live on ground
int AvHAlienWeapon::GetGroundLifetime() const
{
return 0;
}
float& AvHAlienWeapon::GetEnergyLevel()
{
#ifdef AVH_CLIENT
float& theFuser = pmove->fuser3;
#endif
#ifdef AVH_SERVER
float& theFuser = this->m_pPlayer->pev->fuser3;
#endif
return theFuser;
}
bool AvHAlienWeapon::GetIsDroppable() const
{
return false;
}
bool AvHAlienWeapon::GetIsGunPositionValid() const
{
// Check to make sure our gun barrel isn't coming out on the other side of a wall.
vec3_t theBarrelOrigin;
vec3_t theBarrelEnd;
#ifdef AVH_CLIENT
extern vec3_t v_view_ofs; // In view.cpp
extern vec3_t v_cl_angles;
cl_entity_s* thePlayer = gHUD.GetVisiblePlayer();
VectorAdd(thePlayer->curstate.origin, v_view_ofs, theBarrelOrigin);
vec3_t theBarrelDirection;
AngleVectors(v_angles, theBarrelDirection, NULL, NULL);
VectorMA(theBarrelOrigin, GetBarrelLength(), theBarrelDirection, theBarrelEnd);
#endif
#ifdef AVH_SERVER
VectorCopy(m_pPlayer->GetGunPosition(), theBarrelOrigin);
VectorCopy(GetWorldBarrelPoint(), theBarrelEnd);
#endif
return AvHTraceLineAgainstWorld(theBarrelOrigin, theBarrelEnd) == 1;
}
float AvHAlienWeapon::ComputeAttackInterval() const
{
float theROF = this->GetRateOfFire();
int theUser4 = this->m_pPlayer->pev->iuser4;
#ifdef AVH_CLIENT
cl_entity_t* theLocalPlayer = gEngfuncs.GetLocalPlayer();
if(theLocalPlayer)
{
theUser4 = theLocalPlayer->curstate.iuser4;
}
#endif
// Speed attack if in range of primal scream
if(GetHasUpgrade(theUser4, MASK_BUFFED))
{
float thePrimalScreamROFFactor = 1.0f + BALANCE_VAR(kPrimalScreamROFFactor);
theROF /= thePrimalScreamROFFactor;
}
// Check for focus
if(AvHSHUGetIsWeaponFocusable(AvHWeaponID(this->m_iId)))
{
int theFocusLevel = AvHGetAlienUpgradeLevel(theUser4, MASK_UPGRADE_8);
if(theFocusLevel > 0)
{
// Slow down ROF by x% for each level
const float theFocusROFPercentSlowdownPerLevel = BALANCE_VAR(kFocusROFPercentSlowdownPerLevel);
float theSlowDownPercentage = 1.0f + theFocusLevel*theFocusROFPercentSlowdownPerLevel;
theROF *= theSlowDownPercentage;
}
}
return theROF;
}
void AvHAlienWeapon::Precache(void)
{
AvHBasePlayerWeapon::Precache();
}
void AvHAlienWeapon::Spawn()
{
AvHBasePlayerWeapon::Spawn();
this->pev->iuser3 = AVH_USER3_NONE;
#ifdef AVH_SERVER
this->SetGroundLifetime(0);
#endif
}
BOOL AvHAlienWeapon::IsUseable(void)
{
BOOL theIsUseable = FALSE;
// Make sure we have enough energy for this attack
float theEnergyCost = this->GetEnergyForAttack();
float& theFuser = this->GetEnergyLevel();
if(AvHMUHasEnoughAlienEnergy(theFuser, theEnergyCost) && this->GetEnabledState())
{
theIsUseable = TRUE;
}
return theIsUseable;
}
bool AvHAlienWeapon::UsesAmmo(void) const
{
return false;
}
BOOL AvHAlienWeapon::UseDecrement(void)
{
return true;
}
//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHAlienWeapon.cpp $
// $Date: 2002/10/03 18:37:32 $
//
//-------------------------------------------------------------------------------
// $Log: AvHAlienWeapon.cpp,v $
// Revision 1.9 2002/10/03 18:37:32 Flayra
// - Moved alien energy to fuser3
//
// Revision 1.8 2002/09/23 22:08:59 Flayra
// - Updates to allow marine weapons stick around
//
// Revision 1.7 2002/08/31 18:01:00 Flayra
// - Work at VALVe
//
// Revision 1.6 2002/08/16 02:32:09 Flayra
// - Added damage types
// - Swapped umbra and bile bomb
//
// Revision 1.5 2002/07/08 16:43:26 Flayra
// - Web change?
//
// Revision 1.4 2002/06/25 17:29:56 Flayra
// - Better default behavior
//
// Revision 1.3 2002/06/03 16:25:10 Flayra
// - Switch alien weapons quickly, renamed CheckValidAttack()
//
// Revision 1.2 2002/05/28 17:37:14 Flayra
// - Reduced times where alien weapons are dropped and picked up again (but didn't eliminate, they are still being instantiated somewhere)
//
// Revision 1.1 2002/05/23 02:34:00 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#include "mod/AvHAlienWeapon.h"
#include "mod/AvHMovementUtil.h"
#include "mod/AvHSpecials.h"
#ifdef AVH_CLIENT
#include "cl_dll/wrect.h"
#include "cl_dll/cl_dll.h"
#include "cl_dll/hud.h"
#include "cl_dll/cl_util.h"
extern int g_runfuncs;
#include "cl_dll/com_weapons.h"
#include "common/net_api.h"
#include "pm_shared/pm_defs.h"
#include "pm_shared/pm_shared.h"
#include "pm_shared/pm_movevars.h"
extern playermove_t *pmove;
#endif
#include "mod/AvHSharedUtil.h"
#include "util/Balance.h"
AvHAlienWeapon::AvHAlienWeapon()
{
#ifdef AVH_SERVER
this->SetGroundLifetime(0);
#endif
}
bool AvHAlienWeapon::ProcessValidAttack(void)
{
bool theCanAttack = false;
if(AvHBasePlayerWeapon::ProcessValidAttack())
{
if(this->IsUseable())
{
theCanAttack = true;
}
}
return theCanAttack;
}
void AvHAlienWeapon::DeductCostForShot(void)
{
if(this->GetTakesEnergy())
{
AvHBasePlayerWeapon::DeductCostForShot();
float theEnergyCost = this->GetEnergyForAttack();
float& theFuser = this->GetEnergyLevel();
AvHMUDeductAlienEnergy(theFuser, theEnergyCost);
}
}
// Cannot ever drop alien weapons
void AvHAlienWeapon::Drop(void)
{
}
bool AvHAlienWeapon::GetAllowedForUser3(AvHUser3 inUser3)
{
bool theAllowed = false;
// Alien weapons for aliens. Don't take into account exact roles until needed (and until weapons have stabilized)
switch(inUser3)
{
case AVH_USER3_ALIEN_PLAYER1:
case AVH_USER3_ALIEN_PLAYER2:
case AVH_USER3_ALIEN_PLAYER3:
case AVH_USER3_ALIEN_PLAYER4:
case AVH_USER3_ALIEN_PLAYER5:
theAllowed = true;
break;
}
return theAllowed;
}
int AvHAlienWeapon::GetDamageType() const
{
// Assume melee attack, piercing
//return NS_DMG_PIERCING;
return NS_DMG_NORMAL;
}
float AvHAlienWeapon::GetDeployTime() const
{
// Aliens are Quake-style/arcadey, make weapon switch fast
return .1f;
}
float AvHAlienWeapon::GetEnergyForAttack() const
{
float theEnergy = 0.0f;
AvHMUGetEnergyCost((AvHWeaponID)(this->m_iId), theEnergy);
return theEnergy;
}
bool AvHAlienWeapon::GetFiresUnderwater() const
{
return true;
}
// Never live on ground
int AvHAlienWeapon::GetGroundLifetime() const
{
return 0;
}
float& AvHAlienWeapon::GetEnergyLevel()
{
#ifdef AVH_CLIENT
float& theFuser = pmove->fuser3;
#endif
#ifdef AVH_SERVER
float& theFuser = this->m_pPlayer->pev->fuser3;
#endif
return theFuser;
}
bool AvHAlienWeapon::GetIsDroppable() const
{
return false;
}
bool AvHAlienWeapon::GetIsGunPositionValid() const
{
// Check to make sure our gun barrel isn't coming out on the other side of a wall.
vec3_t theBarrelOrigin;
vec3_t theBarrelEnd;
#ifdef AVH_CLIENT
extern vec3_t v_view_ofs; // In view.cpp
extern vec3_t v_cl_angles;
cl_entity_s* thePlayer = gHUD.GetVisiblePlayer();
VectorAdd(thePlayer->curstate.origin, v_view_ofs, theBarrelOrigin);
vec3_t theBarrelDirection;
AngleVectors(v_angles, theBarrelDirection, NULL, NULL);
VectorMA(theBarrelOrigin, GetBarrelLength(), theBarrelDirection, theBarrelEnd);
#endif
#ifdef AVH_SERVER
VectorCopy(m_pPlayer->GetGunPosition(), theBarrelOrigin);
VectorCopy(GetWorldBarrelPoint(), theBarrelEnd);
#endif
return AvHTraceLineAgainstWorld(theBarrelOrigin, theBarrelEnd) == 1;
}
float AvHAlienWeapon::ComputeAttackInterval() const
{
float theROF = this->GetRateOfFire();
int theUser4 = this->m_pPlayer->pev->iuser4;
#ifdef AVH_CLIENT
cl_entity_t* theLocalPlayer = gEngfuncs.GetLocalPlayer();
if(theLocalPlayer)
{
theUser4 = theLocalPlayer->curstate.iuser4;
}
#endif
// Speed attack if in range of primal scream
if(GetHasUpgrade(theUser4, MASK_BUFFED))
{
float thePrimalScreamROFFactor = 1.0f + BALANCE_VAR(kPrimalScreamROFFactor);
theROF /= thePrimalScreamROFFactor;
}
// Check for focus
if(AvHSHUGetIsWeaponFocusable(AvHWeaponID(this->m_iId)))
{
int theFocusLevel = AvHGetAlienUpgradeLevel(theUser4, MASK_UPGRADE_8);
if(theFocusLevel > 0)
{
// Slow down ROF by x% for each level
const float theFocusROFPercentSlowdownPerLevel = BALANCE_VAR(kFocusROFPercentSlowdownPerLevel);
float theSlowDownPercentage = 1.0f + theFocusLevel*theFocusROFPercentSlowdownPerLevel;
theROF *= theSlowDownPercentage;
}
}
return theROF;
}
void AvHAlienWeapon::Precache(void)
{
AvHBasePlayerWeapon::Precache();
}
void AvHAlienWeapon::Spawn()
{
AvHBasePlayerWeapon::Spawn();
this->pev->iuser3 = AVH_USER3_NONE;
#ifdef AVH_SERVER
this->SetGroundLifetime(0);
#endif
}
BOOL AvHAlienWeapon::IsUseable(void)
{
BOOL theIsUseable = FALSE;
// Make sure we have enough energy for this attack
float theEnergyCost = this->GetEnergyForAttack();
float& theFuser = this->GetEnergyLevel();
float theLatency = 0.0f;
#ifdef AVH_CLIENT
// : 991 -- added latency-based prediction for the ammount of energy available to the alien
net_status_s current_status;
gEngfuncs.pNetAPI->Status(&current_status);
theLatency = max(0.0f, current_status.latency);
int theNumLevels = AvHGetAlienUpgradeLevel(this->m_pPlayer->pev->iuser4, MASK_UPGRADE_5);
if(theNumLevels > 0)
theLatency *= (1.0 + theNumLevels * BALANCE_VAR(kAdrenalineEnergyPercentPerLevel));
#endif
if(AvHMUHasEnoughAlienEnergy(theFuser, theEnergyCost, theLatency) && this->GetEnabledState())
{
theIsUseable = TRUE;
}
return theIsUseable;
}
bool AvHAlienWeapon::UsesAmmo(void) const
{
return false;
}
BOOL AvHAlienWeapon::UseDecrement(void)
{
return true;
}

View file

@ -339,7 +339,7 @@ const float kBileBombPunch = 8.0;
const int kBileBombBarrelLength = 20;
const float kBileBombFrictionConstant = .8f;
const int kBileBombVelocity = 750;
const int kBileBombVelocity = 650;
// The bile bomb size must be small so that the collision results on the server
// are close to the collision results for the temp entity on the client.

File diff suppressed because it is too large Load diff

View file

@ -163,7 +163,7 @@ public:
virtual void Precache(void);
virtual bool Regenerate(float inRegenerationAmount, bool inPlaySound = true);
virtual bool Regenerate(float inRegenerationAmount, bool inPlaySound = true, bool dcHealing = false);
virtual void ResetEntity();
@ -183,6 +183,7 @@ public:
virtual void UpdateOnRecycle();
virtual Vector EyePosition( );
protected:
virtual bool GetHasBeenKilled() const;
@ -253,8 +254,10 @@ private:
float mTimeRecycleStarted;
float mTimeRecycleDone;
float mTimeOfLastDCRegeneration;
bool mKilled;
bool mGhost;
};
#endif

File diff suppressed because it is too large Load diff

View file

@ -72,6 +72,7 @@ const int kShootEmptyAnimation = 4;
const int kDeployAnimation = 5;
Vector UTIL_GetRandomSpreadDir(unsigned int inSeed, int inShotNumber, const Vector& inBaseDirection, const Vector& inRight, const Vector& inUp, const Vector& inSpread);
Vector UTIL_GetRandomSpreadDirFrom(unsigned int inSeed, int inShotNumber, const Vector& inBaseDirection, const Vector& inRight, const Vector& inUp, const Vector& inSpread, const Vector& inFromSpread);
class AvHBasePlayerWeapon : public CBasePlayerWeapon
{

View file

@ -13,6 +13,7 @@ extern playermove_t* pmove;
#include "cl_dll/hud.h"
#include "mod/AvHHud.h"
extern int g_runfuncs;
void IN_Attack2Down();
#endif
#include "mod/AvHAlienAbilities.h"
@ -102,6 +103,13 @@ AvHMessageID AvHBlinkGun::GetAbilityImpulse() const
return ALIEN_ABILITY_BLINK;
}
void AvHBlinkGun::SecondaryAttack()
{
#ifdef AVH_CLIENT
//this->FireProjectiles();
#endif
}
void AvHBlinkGun::FireProjectiles(void)
{
#ifdef AVH_CLIENT
@ -117,12 +125,12 @@ void AvHBlinkGun::FireProjectiles(void)
thePlayer->TriggerUncloak();
}
#endif
if(this->mTimeOfNextBlinkEvent <= 0)
{
const float kEventDelay = 2.0f;
this->PlaybackEvent(this->mBlinkSuccessEvent, this->GetShootAnimation());
this->mTimeOfNextBlinkEvent = UTIL_WeaponTimeBase() + kEventDelay;
}
// if(this->mTimeOfNextBlinkEvent <= 0)
// {
// const float kEventDelay = 2.0f;
// this->PlaybackEvent(this->mBlinkSuccessEvent, this->GetShootAnimation());
// this->mTimeOfNextBlinkEvent = UTIL_WeaponTimeBase() + kEventDelay;
// }
}
bool AvHBlinkGun::GetMustPressTriggerForEachShot() const

View file

@ -82,6 +82,8 @@ void AvHBuildable::TriggerRemoveTech() const
if(theTeam)
{
theTeam->TriggerRemoveTech(this->mTechID);
if ( this->mTechID == TECH_ADVANCED_ARMORY )
theTeam->TriggerRemoveTech(TECH_ARMORY);
}
}

View file

@ -1,59 +1,63 @@
//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHClientVariables.h $
// $Date: 2002/08/02 22:02:02 $
//
//-------------------------------------------------------------------------------
// $Log: AvHClientVariables.h,v $
// Revision 1.6 2002/08/02 22:02:02 Flayra
// - Renamed centerid variable (because it tells info about everything, not just players)
//
// Revision 1.5 2002/05/23 02:34:00 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#ifndef AVH_CLIENTVARIABLES_H
#define AVH_CLIENTVARIABLES_H
#include "common/cvardef.h"
extern cvar_t* cl_cmhotkeys;
extern cvar_t* cl_highdetail;
extern cvar_t* cl_musicenabled;
extern cvar_t* cl_musicdelay;
extern cvar_t* cl_musicvolume;
extern cvar_t* cl_particleinfo;
extern cvar_t* cl_quickselecttime;
extern cvar_t* cl_musicdir;
// Variables
#define kvAutoHelp "cl_autohelp"
// puzl: 1064 The cl var that controls the display of labelled minimaps
#define kvLabelMaps "cl_labelmaps"
// :puzl
// tankefugl: 0001070 - enables forced gamma ramp loading
#define kvGammaRamp "cl_gammaramp"
// :tankefugl
#define kvCMHotKeys "cl_cmhotkeys"
#define kvForceDefaultFOV "cl_forcedefaultfov"
#define kvCenterEntityID "cl_centerentityid"
#define kvHighDetail "cl_highdetail"
#define kvCMHotkeys "cl_cmhotkeys"
#define kvMusicEnabled "cl_musicenabled"
#define kvMusicDirectory "cl_musicdirectory"
#define kvMusicDelay "cl_musicdelay"
#define kvMusicVolume "cl_musicvolume"
#define kvParticleInfo "cl_particleinfo"
#define kvQuickSelectTime "cl_quickselecttime"
#define kvDynamicLights "cl_dynamiclights"
#define kvBuildMessages "cl_buildmessages"
#endif
//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHClientVariables.h $
// $Date: 2002/08/02 22:02:02 $
//
//-------------------------------------------------------------------------------
// $Log: AvHClientVariables.h,v $
// Revision 1.6 2002/08/02 22:02:02 Flayra
// - Renamed centerid variable (because it tells info about everything, not just players)
//
// Revision 1.5 2002/05/23 02:34:00 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#ifndef AVH_CLIENTVARIABLES_H
#define AVH_CLIENTVARIABLES_H
#include "common/cvardef.h"
extern cvar_t* cl_cmhotkeys;
extern cvar_t* cl_highdetail;
extern cvar_t* cl_musicenabled;
extern cvar_t* cl_musicdelay;
extern cvar_t* cl_musicvolume;
extern cvar_t* cl_particleinfo;
extern cvar_t* cl_quickselecttime;
extern cvar_t* cl_musicdir;
// Variables
#define kvAutoHelp "cl_autohelp"
// : 1064 The cl var that controls the display of labelled minimaps
#define kvLabelMaps "cl_labelmaps"
// :
// : 0001070 - enables forced gamma ramp loading
#define kvGammaRamp "cl_gammaramp"
#define kvLabelHivesight "cl_labelhivesight"
#define kvCustomCrosshair "cl_customcrosshair"
#define kvHudMapZoom "cl_hudmapzoom"
// :
#define kvCMHotKeys "cl_cmhotkeys"
#define kvForceDefaultFOV "cl_forcedefaultfov"
#define kvCenterEntityID "cl_centerentityid"
#define kvHighDetail "cl_highdetail"
#define kvCMHotkeys "cl_cmhotkeys"
#define kvMusicEnabled "cl_musicenabled"
#define kvMusicDirectory "cl_musicdirectory"
#define kvMusicDelay "cl_musicdelay"
#define kvMusicVolume "cl_musicvolume"
#define kvParticleInfo "cl_particleinfo"
#define kvQuickSelectTime "cl_quickselecttime"
#define kvDynamicLights "cl_dynamiclights"
#define kvBuildMessages "cl_buildmessages"
#endif

View file

@ -1,139 +1,140 @@
#include "mod/AvHCloakable.h"
#include "dlls/extdll.h"
#include "dlls/util.h"
#include "util/Balance.h"
AvHCloakable::AvHCloakable()
{
this->Init();
}
void AvHCloakable::Init()
{
this->mCurrentSpeed = 0.0f;
this->mMaxSpeed = 0.0f;
this->mMaxWalkSpeed = 0.0f;
this->mTimeOfLastCloak = -1;
this->mTimeOfLastUncloak = -1;
this->mOpacity = 1.0f;
this->mTimeOfLastUpdate = 0;
}
bool AvHCloakable::GetCanCloak() const
{
bool theCanCloak = ((this->mTimeOfLastUncloak == -1) || (this->GetTime() > this->mTimeOfLastUncloak + this->GetUncloakTime()));
if(!theCanCloak)
{
int a = 0;
}
return theCanCloak;
}
float AvHCloakable::GetCloakTime() const
{
return BALANCE_VAR(kCloakTime);
}
bool AvHCloakable::GetIsCloaked() const
{
return (this->mOpacity < 0.1f);
}
bool AvHCloakable::GetIsPartiallyCloaked() const
{
return (this->mOpacity < 0.6f);
}
float AvHCloakable::GetUncloakTime() const
{
return BALANCE_VAR(kUncloakTime);
}
void AvHCloakable::ResetCloaking()
{
this->Init();
}
void AvHCloakable::Update()
{
float theCurrentTime = this->GetTime();
float theTimePassed = theCurrentTime - this->mTimeOfLastUpdate;
float theOldOpacity=this->mOpacity;
if((this->mTimeOfLastCloak != -1) || (this->mTimeOfLastUncloak != -1))
{
if( this->mTimeOfLastCloak > this->mTimeOfLastUncloak )
{
// Cloaking
this->mOpacity -= theTimePassed/this->GetCloakTime();
if ( this->mOpacity < 0.45f && this->mCurrentSpeed > this->mMaxWalkSpeed )
{
float theExtraSpeed = max(0.0f, this->mCurrentSpeed - this->mMaxWalkSpeed);
float theSpeedRange = max(0.0f, this->mMaxSpeed - this->mMaxWalkSpeed);
float thePercent=theExtraSpeed/theSpeedRange;
this->mOpacity=0.30f * thePercent;
if ( this->mCurrentSpeed > this->mMaxSpeed ) {
//ALERT(at_console, "exceeded the speed limit %f\n", this->mCurrentSpeed);
this->mOpacity=0.30f + 0.30f * ((this->mCurrentSpeed - this->mMaxSpeed) / this->mMaxSpeed / 2.0f );
}
this->mOpacity = min(max(0.0f, this->mOpacity), 0.45f);
}
}
else
{
// Uncloaking
this->mOpacity += theTimePassed/this->GetUncloakTime();
}
this->mOpacity = min(max(0.0f, this->mOpacity), 1.0f);
}
this->mTimeOfLastUpdate = theCurrentTime;
}
float AvHCloakable::GetOpacity() const
{
return this->mOpacity;
}
void AvHCloakable::SetSpeeds(float inCurrentSpeed, float inMaxSpeed, float inMaxWalkSpeed)
{
this->mCurrentSpeed=inCurrentSpeed;
this->mMaxSpeed=inMaxSpeed;
this->mMaxWalkSpeed=inMaxWalkSpeed;
}
void AvHCloakable::Cloak(bool inNoFade)
{
// puzl: 864
if ( (this->GetTime() > this->mTimeOfLastUncloak + BALANCE_VAR(kRecloakTime)) || inNoFade ) {
if(this->GetCanCloak())
{
this->mTimeOfLastCloak = this->GetTime();
this->mTimeOfLastUncloak = -1;
if(inNoFade)
{
this->mOpacity = 0.0f;
}
}
}
}
void AvHCloakable::Uncloak(bool inNoFade)
{
this->mTimeOfLastUncloak = this->GetTime();
this->mTimeOfLastCloak = -1;
if(inNoFade)
{
this->mOpacity = 1.0f;
}
}
float AvHCloakable::GetTime() const
{
return gpGlobals->time;
}
#include "mod/AvHCloakable.h"
#include "dlls/extdll.h"
#include "dlls/util.h"
#include "util/Balance.h"
AvHCloakable::AvHCloakable()
{
this->Init();
}
void AvHCloakable::Init()
{
this->mCurrentSpeed = 0.0f;
this->mMaxSpeed = 0.0f;
this->mMaxWalkSpeed = 0.0f;
this->mTimeOfLastCloak = -1;
this->mTimeOfLastUncloak = -1;
this->mOpacity = 1.0f;
this->mTimeOfLastUpdate = 0;
}
bool AvHCloakable::GetCanCloak() const
{
bool theCanCloak = ((this->mTimeOfLastUncloak == -1) || (this->GetTime() > this->mTimeOfLastUncloak + this->GetUncloakTime()));
if(!theCanCloak)
{
int a = 0;
}
return theCanCloak;
}
float AvHCloakable::GetCloakTime() const
{
return BALANCE_VAR(kCloakTime);
}
bool AvHCloakable::GetIsCloaked() const
{
return (this->mOpacity < 0.1f);
}
bool AvHCloakable::GetIsPartiallyCloaked() const
{
return (this->mOpacity < 0.6f);
}
float AvHCloakable::GetUncloakTime() const
{
return BALANCE_VAR(kUncloakTime);
}
void AvHCloakable::ResetCloaking()
{
this->Init();
}
void AvHCloakable::Update()
{
float theCurrentTime = this->GetTime();
float theTimePassed = theCurrentTime - this->mTimeOfLastUpdate;
if((this->mTimeOfLastCloak != -1) || (this->mTimeOfLastUncloak != -1))
{
float newOpacity=this->mOpacity;
if( this->mTimeOfLastCloak > this->mTimeOfLastUncloak )
{
// Cloaking
newOpacity -= theTimePassed/this->GetCloakTime();
// Adjust for movement
if ( this->mOpacity < 0.45f && this->mCurrentSpeed > this->mMaxWalkSpeed ) {
newOpacity=this->mOpacity;
if ( this->mCurrentSpeed > this->mMaxSpeed ) {
newOpacity += theTimePassed / this->GetUncloakTime();
}
else {
newOpacity += theTimePassed/this->GetUncloakTime() / 2.0f;
}
newOpacity = min(max(0.0f, newOpacity), 0.45f);
}
}
else
{
// Uncloaking
newOpacity += theTimePassed/this->GetUncloakTime();
}
this->mOpacity = min(max(0.0f, newOpacity), 1.0f);
}
this->mTimeOfLastUpdate = theCurrentTime;
}
float AvHCloakable::GetOpacity() const
{
return this->mOpacity;
}
void AvHCloakable::SetSpeeds(float inCurrentSpeed, float inMaxSpeed, float inMaxWalkSpeed)
{
this->mCurrentSpeed=inCurrentSpeed;
this->mMaxSpeed=inMaxSpeed;
this->mMaxWalkSpeed=inMaxWalkSpeed;
}
void AvHCloakable::Cloak(bool inNoFade)
{
// : 864
if ( (this->GetTime() > this->mTimeOfLastUncloak + BALANCE_VAR(kRecloakTime)) || inNoFade ) {
if(this->GetCanCloak())
{
this->mTimeOfLastCloak = this->GetTime();
this->mTimeOfLastUncloak = -1;
if(inNoFade)
{
this->mOpacity = 0.0f;
}
}
}
}
void AvHCloakable::Uncloak(bool inNoFade)
{
this->mTimeOfLastUncloak = this->GetTime();
this->mTimeOfLastCloak = -1;
if(inNoFade)
{
this->mOpacity = 1.0f;
}
}
float AvHCloakable::GetTime() const
{
return gpGlobals->time;
}

File diff suppressed because it is too large Load diff

View file

@ -19,6 +19,7 @@
// Commands
//#define kcBuyReinforcements "buyreinforcements"
#define kcReadyRoom "readyroom"
#define kcMenuReadyRoom "menureadyroom"
#define kcJoinTeamOne "jointeamone"
#define kcJoinTeamTwo "jointeamtwo"
#define kcJoinTeamThree "jointeamthree"
@ -82,6 +83,7 @@
#define kcOrderSelf "orderself"
#define kcParasite "parasite"
#define kcKillAll "killall"
#define kcAuth "auth"
#define kcStun "stun"
#define kcBoxes "boxes"
#define kcOverflow "overflow"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1658,7 +1658,7 @@ void AvHTriggerScript::Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TY
}
AvHWebStrand::AvHWebStrand()
AvHWebStrand::AvHWebStrand() : mSolid(false)
{
}
@ -1666,6 +1666,7 @@ void AvHWebStrand::Break()
{
EMIT_SOUND(ENT(this->pev), CHAN_AUTO, kWebStrandBreakSound, 1.0, ATTN_IDLE);
UTIL_Remove(this);
SetThink(NULL);
// Decrement number of strands
AvHTeam* theTeam = GetGameRules()->GetTeam((AvHTeamNumber)this->pev->team);
@ -1685,20 +1686,24 @@ void AvHWebStrand::Precache(void)
// Precache web strand sprite
PRECACHE_UNMODIFIED_MODEL(kWebStrandSprite);
PRECACHE_UNMODIFIED_SOUND(kWebStrandBreakSound);
PRECACHE_UNMODIFIED_SOUND(kWebStrandHardenSound);
PRECACHE_UNMODIFIED_SOUND(kWebStrandFormSound);
}
void AvHWebStrand::Setup(const Vector& inPointOne, const Vector& inPointTwo)
{
// Create a new entity with CBeam private data
this->BeamInit(kWebStrandSprite, kWebStrandWidth);
this->BeamInit(kWebStrandSprite, 40); //kWebStrandWidth);
this->PointsInit(inPointOne, inPointTwo);
this->SetColor( 255, 255, 255 );
this->SetScrollRate( 0 );
this->SetFrame(0);
//this->SetBrightness( 64 );
this->SetBrightness( 8 );
this->SetBrightness( 16 );
this->pev->classname = MAKE_STRING(kesTeamWebStrand);
this->pev->rendermode = kRenderNormal;
}
void AvHWebStrand::Spawn(void)
@ -1713,15 +1718,28 @@ void AvHWebStrand::Spawn(void)
//this->pev->solid = SOLID_BBOX;
this->pev->health = kWebHitPoints;
this->pev->takedamage = DAMAGE_YES;
this->mSolid=false;
this->pev->nextthink = gpGlobals->time + BALANCE_VAR(kWebWarmupTime);
SetThink(&AvHWebStrand::StrandThink);
//SetBits(this->pev->flags, FL_MONSTER);
this->RelinkBeam();
EMIT_SOUND(ENT(this->pev), CHAN_AUTO, kWebStrandFormSound, 1.0, ATTN_IDLE);
//SetThink(StrandExpire);
//this->pev->nextthink = gpGlobals->time + kWebStrandLifetime;
}
void AvHWebStrand::StrandThink()
{
EMIT_SOUND(ENT(this->pev), CHAN_AUTO, kWebStrandHardenSound, 1.0, ATTN_IDLE);
this->SetBrightness( 32 );
this->SetColor( 255, 255, 255 );
this->SetFrame(1);
this->mSolid=true;
SetThink(NULL);
}
void AvHWebStrand::StrandExpire()
{
this->Break();
@ -1734,15 +1752,20 @@ void AvHWebStrand::StrandTouch( CBaseEntity *pOther )
//if(GetGameRules()->CanEntityDoDamageTo(this, pOther))
if(pOther->pev->team != this->pev->team)
{
AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(pOther);
if(thePlayer && thePlayer->GetCanBeAffectedByEnemies())
{
// Break web and ensnare player if possible (players can't be too webbed)
if(thePlayer->SetEnsnareState(true))
if ( this->mSolid ) {
AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(pOther);
if(thePlayer && thePlayer->GetCanBeAffectedByEnemies())
{
this->Break();
// Break web and ensnare player if possible (players can't be too webbed)
if(thePlayer->SetEnsnareState(true))
{
this->Break();
}
}
}
else {
this->Break();
}
}
}

View file

@ -522,8 +522,10 @@ public:
void EXPORT StrandExpire();
virtual int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType );
void EXPORT StrandThink();
private:
bool mSolid;
};
class AvHFuncResource : public CBaseAnimating

View file

@ -68,6 +68,9 @@ AvHEntityHierarchy::AvHEntityHierarchy()
void AvHEntityHierarchy::Clear()
{
mNumMovement=0;
mNumSensory=0;
mNumDefence=0;
this->mEntityList.clear();
}
@ -95,6 +98,18 @@ void AvHEntityHierarchy::GetEntityInfoList(MapEntityMap& outList) const
outList = mEntityList;
}
int AvHEntityHierarchy::GetNumSensory() const {
return this->mNumSensory;
}
int AvHEntityHierarchy::GetNumMovement() const {
return this->mNumMovement;
}
int AvHEntityHierarchy::GetNumDefense() const {
return this->mNumDefence;
}
////////////////
// end shared //
////////////////
@ -130,31 +145,51 @@ int GetHotkeyGroupContainingPlayer(AvHPlayer* player)
}
void AvHEntityHierarchy::BuildFromTeam(const AvHTeam* inTeam, BaseEntityListType& inBaseEntityList)
{
this->Clear();
int mc=0, sc=0, dc=0;
if (inTeam->GetTeamType() == AVH_CLASS_TYPE_MARINE ||
inTeam->GetTeamType() == AVH_CLASS_TYPE_ALIEN)
{
// Loop through all entities in the world
for(BaseEntityListType::iterator theIter = inBaseEntityList.begin(); theIter != inBaseEntityList.end(); theIter++)
{
{
CBaseEntity* theBaseEntity = *theIter;
int theEntityIndex = theBaseEntity->entindex();
bool theEntityIsVisible = (theBaseEntity->pev->team == (int)(inTeam->GetTeamNumber())) ||
GetHasUpgrade(theBaseEntity->pev->iuser4, MASK_VIS_SIGHTED);
bool theEntityIsDetected = GetHasUpgrade(theBaseEntity->pev->iuser4, MASK_VIS_DETECTED);
bool theEntityIsUnderAttack = GetGameRules()->GetIsEntityUnderAttack(theEntityIndex);
if ( theEntityIsUnderAttack )
{
int a=0;
}
// Don't send ammo, health, weapons, or scans
bool theIsTransient = ((AvHUser3)(theBaseEntity->pev->iuser3) == AVH_USER3_MARINEITEM) || (theBaseEntity->pev->classname == MAKE_STRING(kwsScan));
MapEntity mapEntity;
if ( inTeam->GetTeamType() == AVH_CLASS_TYPE_ALIEN && theBaseEntity->pev->team == (int)(inTeam->GetTeamNumber()) ) {
AvHBuildable *theBuildable=dynamic_cast<AvHBuildable *>(theBaseEntity);
if ( theBuildable && theBuildable->GetHasBeenBuilt() ) {
if ( theBaseEntity->pev->iuser3 == AVH_USER3_MOVEMENT_CHAMBER ) {
mc++;
}
if ( theBaseEntity->pev->iuser3 == AVH_USER3_SENSORY_CHAMBER ) {
sc++;
}
if ( theBaseEntity->pev->iuser3 == AVH_USER3_DEFENSE_CHAMBER ) {
dc++;
}
}
}
MapEntity mapEntity;
mapEntity.mX = theBaseEntity->pev->origin.x;
mapEntity.mY = theBaseEntity->pev->origin.y;
@ -167,6 +202,7 @@ void AvHEntityHierarchy::BuildFromTeam(const AvHTeam* inTeam, BaseEntityListType
mapEntity.mAngle = theBaseEntity->pev->angles[1];
mapEntity.mTeam = (AvHTeamNumber)(theBaseEntity->pev->team);
mapEntity.mSquadNumber = 0;
mapEntity.mUnderAttack = theEntityIsUnderAttack ? 1 : 0;
bool sendEntity = false;
@ -191,7 +227,6 @@ void AvHEntityHierarchy::BuildFromTeam(const AvHTeam* inTeam, BaseEntityListType
}
else if ((theEntityIsVisible || theEntityIsDetected) && !(theBaseEntity->pev->effects & EF_NODRAW) && !theIsTransient)
{
AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(theBaseEntity);
if (thePlayer)
@ -241,20 +276,136 @@ void AvHEntityHierarchy::BuildFromTeam(const AvHTeam* inTeam, BaseEntityListType
mEntityList[theEntityIndex] = mapEntity;
}
}
if ( inTeam->GetTeamType() == AVH_CLASS_TYPE_ALIEN ) {
sc=min(3, sc);
dc=min(3,dc);
mc=min(3,mc);
if ( this->mNumSensory != sc || this->mNumDefence != dc || this->mNumMovement != mc ) {
this->mNumSensory=sc;
this->mNumDefence=dc;
this->mNumMovement=mc;
}
}
}
}
void AvHEntityHierarchy::BuildForSpec(BaseEntityListType& inBaseEntityList)
{
this->Clear();
// Loop through all entities in the world
for(BaseEntityListType::iterator theIter = inBaseEntityList.begin(); theIter != inBaseEntityList.end(); theIter++)
{
CBaseEntity* theBaseEntity = *theIter;
int theEntityIndex = theBaseEntity->entindex();
bool theEntityIsVisible = false;
if ( theBaseEntity->pev->team == TEAM_ONE || theBaseEntity->pev->team == TEAM_TWO || theBaseEntity->pev->team == TEAM_THREE || theBaseEntity->pev->team == TEAM_FOUR )
theEntityIsVisible=true;
bool theEntityIsUnderAttack = GetGameRules()->GetIsEntityUnderAttack(theEntityIndex);
// Don't send ammo, health, weapons, or scans
bool theIsTransient = ((AvHUser3)(theBaseEntity->pev->iuser3) == AVH_USER3_MARINEITEM) || (theBaseEntity->pev->classname == MAKE_STRING(kwsScan));
MapEntity mapEntity;
mapEntity.mX = theBaseEntity->pev->origin.x;
mapEntity.mY = theBaseEntity->pev->origin.y;
mapEntity.mUser3 = (AvHUser3)(theBaseEntity->pev->iuser3);
mapEntity.mAngle = theBaseEntity->pev->angles[1];
mapEntity.mTeam = (AvHTeamNumber)(theBaseEntity->pev->team);
mapEntity.mSquadNumber = 0;
mapEntity.mUnderAttack = theEntityIsUnderAttack ? 1 : 0;
bool sendEntity = false;
if (mapEntity.mUser3 == AVH_USER3_HIVE)
{
if (!theEntityIsVisible)
{
mapEntity.mTeam = TEAM_IND;
}
sendEntity = true;
}
else if (mapEntity.mUser3 == AVH_USER3_WELD)
{
vec3_t theEntityOrigin = AvHSHUGetRealLocation(theBaseEntity->pev->origin, theBaseEntity->pev->mins, theBaseEntity->pev->maxs);
mapEntity.mX = theEntityOrigin.x;
mapEntity.mY = theEntityOrigin.y;
sendEntity = true;
}
else if (mapEntity.mUser3 == AVH_USER3_FUNC_RESOURCE)
{
sendEntity = true;
}
else if (theEntityIsVisible && !(theBaseEntity->pev->effects & EF_NODRAW) && !theIsTransient)
{
AvHPlayer* thePlayer = dynamic_cast<AvHPlayer*>(theBaseEntity);
if (thePlayer)
{
ASSERT(theEntityIndex > 0);
ASSERT(theEntityIndex <= 32);
mapEntity.mSquadNumber = GetHotkeyGroupContainingPlayer(thePlayer) + 1;
if ((thePlayer->GetPlayMode() == PLAYMODE_PLAYING) && !thePlayer->GetIsSpectator())
{
sendEntity = true;
// If the player has the heavy armor upgrade switch the
// user3 to something that will let us reconstruct that later.
if (thePlayer->pev->iuser3 == AVH_USER3_MARINE_PLAYER &&
GetHasUpgrade(thePlayer->pev->iuser4, MASK_UPGRADE_13))
{
mapEntity.mUser3 = AVH_USER3_HEAVY;
}
}
}
else
{
if (mapEntity.mUser3 != AVH_USER3_HEAVY)
{
sendEntity = true;
}
}
}
if (sendEntity)
{
//const AvHMapExtents& theMapExtents = GetGameRules()->GetMapExtents();
// commented this out here, commented out corresponding shift in AvHOverviewMap::Draw at line 771
// float theMinMapX = theMapExtents.GetMinMapX();
// float theMinMapY = theMapExtents.GetMinMapY();
// mapEntity.mX -= theMinMapX;
// mapEntity.mY -= theMinMapY;
mEntityList[theEntityIndex] = mapEntity;
// debug the entity hierarchy message size
// if ( mapEntity.mUser3 == AVH_USER3_COMMANDER_STATION ) {
// for (int i=0; i<200; i++ ) {
// mEntityList[100+i] = mapEntity;
// }
// }
}
}
}
// Returns true when something was sent
bool AvHEntityHierarchy::SendToNetworkStream(AvHEntityHierarchy& inClientHierarchy, entvars_t* inPlayer)
bool AvHEntityHierarchy::SendToNetworkStream(AvHEntityHierarchy& inClientHierarchy, entvars_t* inPlayer, bool spectating)
{
// Get iterators for both hierarchies
MapEntityMap::const_iterator clientIter = inClientHierarchy.mEntityList.begin();
MapEntityMap::const_iterator clientEnd = inClientHierarchy.mEntityList.end();
MapEntityMap::const_iterator serverIter = mEntityList.begin();
MapEntityMap::iterator serverIter = mEntityList.begin();
MapEntityMap::const_iterator serverEnd = mEntityList.end();
// Create maps for changes
@ -262,42 +413,63 @@ bool AvHEntityHierarchy::SendToNetworkStream(AvHEntityHierarchy& inClientHierarc
EntityListType OldItems; //to be deleted
//TODO : replace OldItems with vector<int>
int entityCount=0;
// HACK
// If we update more than kMaxSpecEntity then we need to clean out the remaining ones so they get sent next time.
const int kMaxSpecEntity=100;
while (clientIter != clientEnd && serverIter != serverEnd)
{
if (serverIter->first < clientIter->first)
{
NewItems.insert( *serverIter );
if ( entityCount < kMaxSpecEntity ) {
if (serverIter->first < clientIter->first)
{
NewItems.insert( *serverIter );
entityCount++;
++serverIter;
continue;
}
if (serverIter->first > clientIter->first)
{
OldItems.push_back( clientIter->first );
entityCount++;
++clientIter;
continue;
}
if (clientIter->second != serverIter->second )
{
entityCount++;
NewItems.insert( *serverIter );
}
++serverIter;
continue;
}
if (serverIter->first > clientIter->first)
{
OldItems.push_back( clientIter->first );
++clientIter;
continue;
}
if (clientIter->second != serverIter->second)
{
NewItems.insert( *serverIter );
else {
mEntityList.erase(serverIter++);
}
++serverIter;
++clientIter;
}
while(serverIter != serverEnd)
{
NewItems.insert( *serverIter );
++serverIter;
if ( entityCount < kMaxSpecEntity ) {
entityCount++;
NewItems.insert( *serverIter );
++serverIter;
}
else {
mEntityList.erase(serverIter++);
}
}
while(clientIter != clientEnd)
{
OldItems.push_back( clientIter->first );
if ( entityCount < kMaxSpecEntity ) {
entityCount++;
OldItems.push_back( clientIter->first );
}
++clientIter;
}
NetMsg_UpdateEntityHierarchy( inPlayer, NewItems, OldItems );
ASSERT(entityCount < kMaxSpecEntity +1);
NetMsg_UpdateEntityHierarchy( inPlayer, NewItems, OldItems, spectating );
return (!NewItems.empty() || !OldItems.empty());
}
@ -319,4 +491,4 @@ bool AvHEntityHierarchy::DeleteEntity( const int inIndex )
{ return false; }
this->mEntityList.erase(loc);
return true;
}
}

View file

@ -54,7 +54,7 @@ const int kNumStatusTypes = 15;
class MapEntity
{
public:
MapEntity(void) : mUser3(AVH_USER3_NONE), mTeam(TEAM_IND), mX(0.0f), mY(0.0f), mAngle(0.0f), mSquadNumber(0) {}
MapEntity(void) : mUser3(AVH_USER3_NONE), mTeam(TEAM_IND), mX(0.0f), mY(0.0f), mAngle(0.0f), mSquadNumber(0), mUnderAttack(0) {}
AvHUser3 mUser3;
AvHTeamNumber mTeam;
@ -62,6 +62,7 @@ public:
float mY;
float mAngle;
int mSquadNumber;
int mUnderAttack;
bool operator==(const MapEntity& e) const
{
@ -70,6 +71,7 @@ public:
mX == e.mX &&
mY == e.mY &&
mAngle == e.mAngle &&
mUnderAttack == e.mUnderAttack &&
mSquadNumber == e.mSquadNumber;
}
@ -93,8 +95,9 @@ public:
void Clear();
#ifdef AVH_SERVER
bool SendToNetworkStream(AvHEntityHierarchy& inClientHierarchy, entvars_t* inPlayer);
bool SendToNetworkStream(AvHEntityHierarchy& inClientHierarchy, entvars_t* inPlayer, bool spectating);
void BuildFromTeam(const AvHTeam* inTeam, BaseEntityListType& inBaseEntityList);
void BuildForSpec(BaseEntityListType& inBaseEntityList);
#endif
bool GetHasBaseLineBeenSent() const;
@ -108,13 +111,18 @@ public:
bool operator!=(const AvHEntityHierarchy& inHierarchy) const;
bool operator==(const AvHEntityHierarchy& inHierarchy) const;
int GetNumSensory() const;
int GetNumDefense() const;
int GetNumMovement() const;
private:
// The encoded entity info that has been sent to clients
MapEntityMap mEntityList;
int mNumMovement;
int mNumSensory;
int mNumDefence;
};
#endif

View file

@ -757,8 +757,13 @@ void EV_MachineGun(struct event_args_s* args)
// General x-punch axis
if ( EV_IsLocal( idx ) )
{
// Multiply punch by upgrade level
float theHalfSpread = (kMGXPunch/4.0f)*(theUpgradeLevel+1);
//float theHalfSpread = (kMGXPunch/4.0f)*(theUpgradeLevel+1);
// Changed to ignore upgrade level
float theHalfSpread = (kMGXPunch/4.0f);
if(theHalfSpread > 0.0f)
{
V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -theHalfSpread, theHalfSpread ) );
@ -843,7 +848,11 @@ void EV_Pistol(struct event_args_s* args)
if ( EV_IsLocal( idx ) )
{
// Multiply punch by upgrade level
float theHalfSpread = (kHGXPunch/3.0f)*(theUpgradeLevel+1);
//float theHalfSpread = (kHGXPunch/3.0f)*(theUpgradeLevel+1);
// Changed to ignore upgrade level
float theHalfSpread = (kHGXPunch/3.0f);
if(theHalfSpread > 0.0f)
{
V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -theHalfSpread, theHalfSpread ) );
@ -934,7 +943,12 @@ void EV_SonicGun(struct event_args_s* args)
// General x-punch axis
if ( EV_IsLocal( idx ) )
{
float theHalfSpread = (kSGXPunch/3.0f)*(theUpgradeLevel+1);
//float theHalfSpread = (kSGXPunch/3.0f)*(theUpgradeLevel+1);
// Changed to ignore upgrade level
float theHalfSpread = (kSGXPunch/3.0f);
if(theHalfSpread > 0.0f)
{
V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -theHalfSpread, theHalfSpread ) );
@ -1033,7 +1047,11 @@ void EV_HeavyMachineGun(struct event_args_s* args)
// General x-punch axis
if ( EV_IsLocal( idx ) )
{
float theHalfSpread = (kHMGXPunch/4.0f)*(theUpgradeLevel+1);
//float theHalfSpread = (kHMGXPunch/4.0f)*(theUpgradeLevel+1);
// Changed to ignore upgrade level
float theHalfSpread = (kHMGXPunch/4.0f);
if(theHalfSpread > 0.0f)
{
V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -theHalfSpread, theHalfSpread ) );
@ -1112,7 +1130,11 @@ void EV_GrenadeGun(struct event_args_s* inArgs)
// General x-punch axis
if ( EV_IsLocal( idx ) )
{
float theHalfSpread = (kGGXPunch/2.0f)*(theUpgradeLevel+1);
//float theHalfSpread = (kGGXPunch/2.0f)*(theUpgradeLevel+1);
// Changed to ignore upgrade level
float theHalfSpread = (kGGXPunch/2.0f);
if(theHalfSpread > 0.0f)
{
V_PunchAxis( 0, gEngfuncs.pfnRandomFloat( -theHalfSpread, theHalfSpread ) );
@ -1465,7 +1487,7 @@ void EV_OffenseChamber(struct event_args_s* inArgs)
theTempEntity->hitcallback = SpikeHit;
theTempEntity->flags = (FTENT_COLLIDEALL | FTENT_PERSIST | FTENT_COLLIDEKILL);
theTempEntity->die += kSpikeLifetime;
theTempEntity->clientIndex = inArgs->entindex; // Entity to ignore collisions with
theTempEntity->clientIndex = inArgs->iparam1; // Entity to ignore collisions with
//theTempEntity->entity.curstate.framerate = 30;
//theTempEntity->frameMax = 4;//theModel->numframes;
@ -1478,7 +1500,6 @@ void EV_OffenseChamber(struct event_args_s* inArgs)
//VectorCopy(inArgs->angles, theTempEntity->entity.angles);
}
//
//
// ASSERT(inArgs);
@ -2409,17 +2430,17 @@ void EV_Welder(struct event_args_s* inArgs)
float thePercentage;
AvHSHUGetBuildResearchState(thePhysEnt->iuser3, thePhysEnt->iuser4, thePhysEnt->fuser1, theIsBuilding, theIsResearching, thePercentage);
if(thePhysEnt->iuser3 == AVH_USER3_WELD)
{
if((thePercentage < 1.0f) && (thePercentage != -1))
{
gHUD.SetProgressStatus(thePercentage);
}
else
{
gHUD.HideProgressStatus();
}
}
// if(thePhysEnt->iuser3 == AVH_USER3_WELD)
// {
// if((thePercentage < 1.0f) && (thePercentage != -1))
// {
// gHUD.SetProgressStatus(thePercentage);
// }
// else
// {
// gHUD.HideProgressStatus();
// }
// }
}
}
// Fire light smoke from muzzle
@ -2994,11 +3015,14 @@ void EV_Leap(struct event_args_s* inArgs)
{
char* theSoundToPlay = kLeapSound;
gEngfuncs.pEventAPI->EV_PlaySound(inArgs->entindex, inArgs->origin, CHAN_WEAPON, theSoundToPlay, inArgs->fparam1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ));
if (EV_IsLocal(inArgs->entindex))
if (EV_IsSpec(inArgs->entindex))
{
gEngfuncs.pEventAPI->EV_WeaponAnimation(inArgs->iparam2, 2);
gEngfuncs.pEventAPI->EV_PlaySound(inArgs->entindex, inArgs->origin, CHAN_WEAPON, theSoundToPlay, inArgs->fparam1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ));
}
if (!EV_IsLocal(inArgs->entindex)) {
gEngfuncs.pEventAPI->EV_PlaySound(inArgs->entindex, inArgs->origin, CHAN_WEAPON, theSoundToPlay, inArgs->fparam1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ));
}
}
@ -3264,7 +3288,8 @@ void EV_MetabolizeSuccess(struct event_args_s* inArgs)
void WebHit(struct tempent_s* ent, struct pmtrace_s* ptr)
{
gEngfuncs.pEventAPI->EV_PlaySound(ent->entity.index, ptr->endpos, CHAN_AUTO, kWebSpinSound1, 1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ));
gEngfuncs.pEventAPI->EV_PlaySound(ent->entity.index, ptr->endpos, CHAN_AUTO, kWebStrandHitSound, 1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ));
//gEngfuncs.pEventAPI->EV_PlaySound(ent->entity.index, ptr->endpos, CHAN_AUTO, kWebSpinSound1, 1, ATTN_NORM, 0, 94 + gEngfuncs.pfnRandomLong( 0, 0xf ));
if(ptr && ent)
{
ent->die = gEngfuncs.GetClientTime();

File diff suppressed because it is too large Load diff

View file

@ -1,419 +1,436 @@
//======== (C) Copyright 2001 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose: NS high-level game rules
//
// $Workfile: AvHGamerules.h $
// $Date: 2002/11/15 04:46:18 $
//
//-------------------------------------------------------------------------------
// $Log: AvHGamerules.h,v $
// Revision 1.52 2002/11/15 04:46:18 Flayra
// - Changes to for profiling and for improving AddToFullPack performance
//
// Revision 1.51 2002/11/12 02:24:57 Flayra
// - HLTV updates
//
// Revision 1.50 2002/11/06 01:40:01 Flayra
// - Damage refactoring (TakeDamage assumes caller has already adjusted for friendly fire, etc.)
//
// Revision 1.49 2002/11/03 04:49:45 Flayra
// - Moved constants into .dll out of .cfg
// - Particle systems update much less often, big optimization
// - Team balance fixes
//
// Revision 1.48 2002/10/28 20:34:53 Flayra
// - Reworked game reset slightly, to meter out network usage during game reset
//
// Revision 1.47 2002/10/20 21:10:41 Flayra
// - Optimizations
//
// Revision 1.46 2002/10/16 00:56:22 Flayra
// - Prototyped curl support for NS stats
// - Added player auth stuff (server string)
// - Added concept of secondary weapons
// - Removed disconnect sound
// - Fixed MOTD
// - Added "order needed" alert
//
// Revision 1.45 2002/10/03 18:44:03 Flayra
// - Play disconnected sound quieter because of mass exodus effect
// - Added functionality to allow players to join a team and run around freely before game countdown starts. Game resets when countdown starts.
// - Added new alien alerts
//
// Revision 1.44 2002/09/23 22:16:01 Flayra
// - Added game victory status logging
// - Fixed commander alerts
// - Added new alerts
// - Particle system changes, only send them down when connecting or map changes
//
// Revision 1.43 2002/09/09 19:51:13 Flayra
// - Removed gamerules dictating alien respawn time, now it's in server variable
//
// Revision 1.42 2002/08/16 02:35:09 Flayra
// - Blips now update once per second, instead of once per player per second
//
// Revision 1.41 2002/08/09 01:01:42 Flayra
// - Removed error condition for map validity, allow marines to have only one primary weapon, adjust weapon weights
//
// Revision 1.40 2002/08/02 22:00:23 Flayra
// - New alert system that's not so annoying and is more helpful. Tweaks for new help system.
//
// Revision 1.39 2002/07/24 18:45:41 Flayra
// - Linux and scripting changes
//
// Revision 1.38 2002/07/23 17:03:21 Flayra
// - Resource model changes, refactoring spawning to fix level 5 redemption bug without code duplication
//
// Revision 1.37 2002/07/08 16:59:14 Flayra
// - Don't pick up empty weapons, added handicapping, check map validity when loaded, reset players just like all other entities, fixed spawn bug code where it was counting non-team spawns
//
// Revision 1.36 2002/07/01 21:32:44 Flayra
// - Visibility update now updates world for primal scream and umbra, don't update reliable network messages every tick (big optimization)
//
// Revision 1.35 2002/06/25 17:59:03 Flayra
// - Added timelimit (switches map after a game finishes), added info_locations, tried adding team balance (not sure it works yet), give resources for kills
//
// Revision 1.34 2002/06/10 19:54:30 Flayra
// - New minimap support, more attempts to fix picking up of alien weapons
//
// Revision 1.33 2002/05/28 17:40:32 Flayra
// - Minimap refactoring, hive sight "under attack", reinforcement refactoring, don't delete entities marked as permanent (it was deleting hives!), allow players to join the opposite team until this can be fixed for real (server retry gets around this code so this is just an inconvenience), things build fast with cheats
//
// Revision 1.32 2002/05/23 02:33:42 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#ifndef AVH_GAMERULES_H
#define AVH_GAMERULES_H
#include "dlls/gamerules.h"
//#include "mod/AvHCOCRuleset.h"
#include "mod/AvHTeam.h"
#include "mod/AvHMarineWeapons.h"
#include "types.h"
#include "mod/AvHMessage.h"
#include "mod/AvHEntityHierarchy.h"
#include "mod/AvHEntities.h"
#include "mod/AvHMiniMap.h"
#include "dlls/teamplay_gamerules.h"
#include "mod/AvHDramaticPriority.h"
#include "mod/AvHMapExtents.h"
#include "util/Tokenizer.h"
#include "mod/AvHSpawn.h"
class AvHPlayer;
class TeamPurchase
{
public:
TeamPurchase(edict_t* inPlayer, AvHMessageID inMessageID) : mPlayer(inPlayer), mUpgrade(inMessageID)
{}
edict_t* mPlayer;
AvHMessageID mUpgrade;
};
typedef vector< pair <string, int> > MapVoteListType;
typedef map< int, int > PlayerMapVoteListType;
typedef map< int, float > PlayerVoteTimeType;
// puzl: 0001073
#ifdef USE_OLDAUTH
typedef vector< pair<string, string> > AuthIDListType;
typedef map<AvHPlayerAuthentication, AuthIDListType> AuthMaskListType;
#endif
class AvHGamerules : public CHalfLifeTeamplay //public CHalfLifeMultiplay/*, public AvHCOCRuleset*/
{
public:
AvHGamerules();
virtual ~AvHGamerules();
// puzl: 0001073
#ifdef USE_OLDAUTH
virtual BOOL GetIsClientAuthorizedToPlay(edict_t* inEntity, bool inDisplayMessage, bool inForcePending = false) const;
virtual bool PerformHardAuthorization(AvHPlayer* inPlayer) const;
virtual int GetAuthenticationMask(const string& inAuthID) const;
const AuthIDListType& GetServerOpList() const;
void UpdateUplink();
#endif
// this is the game name that gets seen in the server browser
virtual int AmmoShouldRespawn( CBasePlayerAmmo *pAmmo );
virtual void BuildableBuilt(AvHBuildable* inBuildable);
virtual void BuildableKilled(AvHBuildable* inBuildable);
virtual void BuildMiniMap(AvHPlayer* inPlayer);
virtual BOOL CanHavePlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
virtual void ClientUserInfoChanged( CBasePlayer *pPlayer, char *infobuffer );
virtual const char* GetGameDescription(void);
virtual int WeaponShouldRespawn( CBasePlayerItem *pWeapon );
virtual void DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
virtual BOOL FShouldSwitchWeapon(CBasePlayer* inPlayer, CBasePlayerItem* inWeapon);
virtual bool GetCountdownStarted(void) const;
virtual bool GetGameStarted(void) const;
virtual int GetGameTime() const;
virtual void SetGameStarted(bool inGameStarted);
AvHEntityHierarchy& GetEntityHierarchy(AvHTeamNumber inTeam);
bool GetIsPlayerSelectableByPlayer(AvHPlayer* inTargetPlayer, AvHPlayer* inByPlayer);
virtual int IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled);
void ProcessTeamUpgrade(AvHMessageID inUpgrade, AvHTeamNumber inNumber, int inEntity, bool inGive = true);
// Playtest functionality
void BalanceChanged();
// This isn't called yet, add in hooks?
void ClientKill( edict_t *pEntity );
virtual BOOL CanHaveAmmo( CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry );// can this player take more of this ammo?
virtual bool CanPlayerBeKilled(CBasePlayer* inPlayer);
virtual void ChangePlayerTeam(CBasePlayer *pPlayer, const char *pTeamName, BOOL bKill, BOOL bGib);
virtual BOOL ClientCommand( CBasePlayer *pPlayer, const char *pcmd );
virtual BOOL ClientConnected( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] );
virtual void ClientDisconnected( edict_t *pClient );
virtual int DeadPlayerAmmo( CBasePlayer *pPlayer );
virtual int DeadPlayerWeapons( CBasePlayer *pPlayer );
virtual BOOL FAllowMonsters( void );
virtual BOOL FPlayerCanRespawn( CBasePlayer *pPlayer );
virtual BOOL FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker );
// TODO: Add splash damage parameter and outgoing float percentage damage? This way splash damage could do some damage in non-tourny mode?
virtual bool CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBaseEntity* inReceiver, float* outScalar = NULL);
//virtual edict_t* GetPlayerSpawnSpot( CBasePlayer *pPlayer );
virtual void PlayerThink( CBasePlayer *pPlayer );
void ComputeWorldChecksum(Checksum& outChecksum) const;
float GetMapGamma();
int GetNumCommandersOnTeam(AvHTeamNumber inTeam);
int GetNumActiveHives(AvHTeamNumber inTeam) const;
int GetNumEntities() const;
const AvHGameplay& GetGameplay() const;
const AvHMapExtents& GetMapExtents();
virtual BOOL IsMultiplayer( void );
virtual BOOL IsDeathmatch( void );
virtual BOOL IsCoOp( void );
virtual void InitHUD( CBasePlayer *pPlayer );
virtual void PlayerGotWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
virtual void PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor );
virtual void PlayerSpawn( CBasePlayer *pPlayer );
virtual void ProcessRespawnCostForPlayer(AvHPlayer* inPlayer);
virtual void RewardPlayerForKill(AvHPlayer* inPlayer, CBaseEntity* inTarget, entvars_t* inInflictor = NULL);
bool RoamingAllowedForPlayer(CBasePlayer* inPlayer) const;
virtual void Think(void);
void RegisterServerVariable(const char* inName);
int GetNumServerVariables() const;
const std::string& GetServerVariable(int i) const;
bool GetCheatsEnabled(void) const;
bool GetIsCheatEnabled(const string& inCheatName) const;
void SetCheatEnabled(const string& inCheatName, bool inEnabledState = true);
float GetFirstScanThinkTime() const;
bool GetDrawInvisibleEntities() const;
bool GetEntityExists(const char* inName) const;
bool GetIsTesting(void) const;
bool GetIsValidFutureTeam(AvHPlayer inPlayer, int inTeamNumber) const;
bool GetCanJoinTeamInFuture(AvHPlayer* inPlayer, AvHTeamNumber theTeamNumber, string& outString) const;
const AvHBaseInfoLocationListType& GetInfoLocations() const;
int GetMaxWeight(void) const;
const char* GetSpawnEntityName(AvHPlayer* inPlayer) const;
Vector GetSpawnAreaCenter(AvHTeamNumber inTeamNumber) const;
float GetTimeGameStarted() const;
int GetTimeLimit() const;
int GetWeightForItemAndAmmo(AvHWeaponID inWeapon, int inNumRounds) const;
bool AttemptToJoinTeam(AvHPlayer* inPlayer, AvHTeamNumber theTeamNumber, bool inDisplayErrorMessage = true);
const AvHTeam* GetTeam(AvHTeamNumber inTeamNumber) const;
const AvHTeam* GetTeamA() const;
const AvHTeam* GetTeamB() const;
AvHTeam* GetTeam(AvHTeamNumber inTeamNumber);
AvHTeam* GetTeamA();
AvHTeam* GetTeamB();
AvHMapMode GetMapMode(void) const;
int GetServerTick() const;
AvHTeamNumber GetVictoryTeam() const;
float GetVictoryTime() const;
//void QueueTeamUpgrade(edict_t* inPlayer, AvHMessageID inUpgrade);
void DeleteAndResetEntities();
void PlayerDeathEnd(AvHPlayer* inPlayer);
void PostWorldPrecacheReset(bool inNewMap);
void PreWorldPrecacheReset();
void RegisterSpawnPoint(const string& inClassName, const Vector& inOrigin, const Vector& inAngles, const AvHTeamNumber& inTeamNumber);
void RespawnPlayer(AvHPlayer* inPlayer);
void TriggerAlert(AvHTeamNumber inTeamNumber, AvHAlertType inAlertType, int inEntIndex, AvHMessageID inMessageID = MESSAGE_NULL);
bool GetIsEntityUnderAttack(int inEntityIndex) const;
virtual bool GetArePlayersAllowedToJoinImmediately(void) const;
virtual bool GetIsTournamentMode(void) const;
virtual bool GetIsHamboneMode(void) const;
virtual bool GetIsIronMan(void) const;
virtual bool GetIsCombatMode(void) const;
virtual AvHTeamNumber GetCombatAttackingTeamNumber() const;
virtual bool GetIsNSMode(void) const;
virtual bool GetIsScriptedMode(void) const;
virtual bool GetIsTrainingMode(void) const;
int GetBaseHealthForMessageID(AvHMessageID inMessageID) const;
int GetBuildTimeForMessageID(AvHMessageID inMessageID) const;
int GetCostForMessageID(AvHMessageID inMessageID) const;
CBaseEntity* GetRandomHiveSpawnPoint(CBaseEntity* inPlayer, const Vector& inOrigin, float inMaxDistance) const;
virtual edict_t* SelectSpawnPoint(CBaseEntity* inPlayer) const;
bool CanPlayerBeacon(CBaseEntity *inPlayer);
edict_t* SelectSpawnPoint(CBaseEntity* inEntity, const string& inSpawnEntityName) const;
const char* SetDefaultPlayerTeam(CBasePlayer *pPlayer);
void MarkDramaticEvent(int inPriority, CBaseEntity* inPrimaryEntity, bool inDramatic = false, CBaseEntity* inSecondaryEntity = NULL) const;
void MarkDramaticEvent(int inPriority, short inPrimaryEntityIndex, bool inDramatic = false, short inSecondaryEntityIndex = 0) const;
void MarkDramaticEvent(int inPriority, short inPrimaryEntityIndex, bool inDramatic, entvars_t* inSecondaryEntity) const;
virtual void RecalculateHandicap(void);
void ServerExit();
void VoteMap(int inPlayerIndex, int inMapIndex);
bool GetMapVoteStrings(StringList& outMapVoteList);
void RemovePlayerFromVotemap(int inPlayerIndex);
protected:
void AutoAssignPlayer(AvHPlayer* inPlayer);
void PerformMapValidityCheck();
virtual void RecalculateMapMode( void );
bool GetDeathMatchMode(void) const;
//void PutPlayerIntoSpectateMode(AvHPlayer* inPlayer) const;
virtual void SendMOTDToClient( edict_t *client );
// puzl: 0001073
#ifdef USE_OLDAUTH
void AddAuthStatus(AvHPlayerAuthentication inAuthMask, const string& inWONID, const string& inSteamID);
void DisplayVersioning();
void InitializeAuthentication();
#endif
private:
void AwardExperience(AvHPlayer* inPlayer, int inTargetLevel, bool inAwardFriendliesInRange = true);
void CalculateMapExtents();
void CalculateMapGamma();
void CopyDataToSpawnEntity(const AvHSpawn& inSpawnEntity) const;
void JoinTeam(AvHPlayer* inPlayer, AvHTeamNumber theTeamNumber, bool inDisplayErrorMessage, bool inForce);
void PreWorldPrecacheInitParticles();
void PostWorldPrecacheInitParticles();
void InitializeMapVoteList();
int GetVotesNeededForMapChange() const;
void InitializeTechNodes();
void InternalResetGameRules();
int GetNumberOfPlayers() const;
void TallyVictoryStats() const;
void PostVictoryStatsToWeb(const string& inFormParams) const;
bool ReadyToStartCountdown();
void ResetGame(bool inPreserveTeams = false);
void SendGameTimeUpdate(bool inReliable = false);
void ProcessTeamUpgrades();
void ResetEntities();
CBaseEntity* SelectRandomSpawn(CBaseEntity* inPlayer, const string& inSpawnName) const;
void UpdateCheats();
void UpdateHLTVProxy();
void UpdatePlaytesting();
void UpdateCountdown(float inTime);
void UpdateEntitiesUnderAttack();
void UpdateGameTime();
void UpdateLOS();
void UpdateScripts();
void UpdateServerCommands();
void UpdateTimeLimit();
void UpdateWorldEntities();
void UpdateVictory(void);
void UpdateVictoryStatus(void);
bool mFirstUpdate;
bool mPreserveTeams;
bool mGameStarted;
AvHTeamNumber mVictoryTeam;
float mTimeCountDownStarted;
float mTimeGameStarted;
float mTimeOfLastHLTVProxyUpdate;
float mTimeOfLastGameTimeUpdate;
float mTimeSentCountdown;
float mTimeLastWontStartMessageSent;
float mTimeWorldReset;
bool mStartedCountdown;
bool mSentCountdownMessage;
bool mVictoryDraw;
AvHTeam mTeamA;
AvHTeam mTeamB;
float mVictoryTime;
AvHMapMode mMapMode;
// puzl: 0001073
#ifdef USE_OLDAUTH
bool mUpdatedUplink;
AuthIDListType mServerOpList;
#endif
float mLastParticleUpdate;
float mLastNetworkUpdate;
float mLastWorldEntityUpdate;
float mLastCloakableUpdate;
float mLastVictoryUpdate;
float mLastMapChange;
float mTimeOfLastPlaytestUpdate;
float mTimeOfLastHandicapUpdate;
float mTimeUpdatedScripts;
typedef vector<TeamPurchase> TeamPurchaseListType;
TeamPurchaseListType mPendingTeamUpgrades;
// Potentially marines vs. marines
AvHEntityHierarchy mTeamAEntityHierarchy;
AvHEntityHierarchy mTeamBEntityHierarchy;
AvHGameplay mGameplay;
bool mCalculatedMapGamma;
float mMapGamma;
typedef map<int, float> EntityUnderAttackListType;
EntityUnderAttackListType mEntitiesUnderAttack;
AvHMiniMap mMiniMap;
AvHMapExtents mMapExtents;
StringList mCheats;
AvHBaseInfoLocationListType mInfoLocations;
float mSavedTimeCountDownStarted;
SpawnListType mSpawnList;
mutable CBaseEntity* mSpawnEntity;
// Map voting
MapVoteListType mMapVoteList;
PlayerMapVoteListType mPlayersVoted;
PlayerVoteTimeType mPlayersVoteTime;
std::vector<std::string> mServerVariableList;
AvHTeamNumber mCombatAttackingTeamNumber;
};
AvHGamerules* GetGameRules();
void SetGameRules(AvHGamerules* inGameRules);
#endif
//======== (C) Copyright 2001 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose: NS high-level game rules
//
// $Workfile: AvHGamerules.h $
// $Date: 2002/11/15 04:46:18 $
//
//-------------------------------------------------------------------------------
// $Log: AvHGamerules.h,v $
// Revision 1.52 2002/11/15 04:46:18 Flayra
// - Changes to for profiling and for improving AddToFullPack performance
//
// Revision 1.51 2002/11/12 02:24:57 Flayra
// - HLTV updates
//
// Revision 1.50 2002/11/06 01:40:01 Flayra
// - Damage refactoring (TakeDamage assumes caller has already adjusted for friendly fire, etc.)
//
// Revision 1.49 2002/11/03 04:49:45 Flayra
// - Moved constants into .dll out of .cfg
// - Particle systems update much less often, big optimization
// - Team balance fixes
//
// Revision 1.48 2002/10/28 20:34:53 Flayra
// - Reworked game reset slightly, to meter out network usage during game reset
//
// Revision 1.47 2002/10/20 21:10:41 Flayra
// - Optimizations
//
// Revision 1.46 2002/10/16 00:56:22 Flayra
// - Prototyped curl support for NS stats
// - Added player auth stuff (server string)
// - Added concept of secondary weapons
// - Removed disconnect sound
// - Fixed MOTD
// - Added "order needed" alert
//
// Revision 1.45 2002/10/03 18:44:03 Flayra
// - Play disconnected sound quieter because of mass exodus effect
// - Added functionality to allow players to join a team and run around freely before game countdown starts. Game resets when countdown starts.
// - Added new alien alerts
//
// Revision 1.44 2002/09/23 22:16:01 Flayra
// - Added game victory status logging
// - Fixed commander alerts
// - Added new alerts
// - Particle system changes, only send them down when connecting or map changes
//
// Revision 1.43 2002/09/09 19:51:13 Flayra
// - Removed gamerules dictating alien respawn time, now it's in server variable
//
// Revision 1.42 2002/08/16 02:35:09 Flayra
// - Blips now update once per second, instead of once per player per second
//
// Revision 1.41 2002/08/09 01:01:42 Flayra
// - Removed error condition for map validity, allow marines to have only one primary weapon, adjust weapon weights
//
// Revision 1.40 2002/08/02 22:00:23 Flayra
// - New alert system that's not so annoying and is more helpful. Tweaks for new help system.
//
// Revision 1.39 2002/07/24 18:45:41 Flayra
// - Linux and scripting changes
//
// Revision 1.38 2002/07/23 17:03:21 Flayra
// - Resource model changes, refactoring spawning to fix level 5 redemption bug without code duplication
//
// Revision 1.37 2002/07/08 16:59:14 Flayra
// - Don't pick up empty weapons, added handicapping, check map validity when loaded, reset players just like all other entities, fixed spawn bug code where it was counting non-team spawns
//
// Revision 1.36 2002/07/01 21:32:44 Flayra
// - Visibility update now updates world for primal scream and umbra, don't update reliable network messages every tick (big optimization)
//
// Revision 1.35 2002/06/25 17:59:03 Flayra
// - Added timelimit (switches map after a game finishes), added info_locations, tried adding team balance (not sure it works yet), give resources for kills
//
// Revision 1.34 2002/06/10 19:54:30 Flayra
// - New minimap support, more attempts to fix picking up of alien weapons
//
// Revision 1.33 2002/05/28 17:40:32 Flayra
// - Minimap refactoring, hive sight "under attack", reinforcement refactoring, don't delete entities marked as permanent (it was deleting hives!), allow players to join the opposite team until this can be fixed for real (server retry gets around this code so this is just an inconvenience), things build fast with cheats
//
// Revision 1.32 2002/05/23 02:33:42 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#ifndef AVH_GAMERULES_H
#define AVH_GAMERULES_H
#include "dlls/gamerules.h"
//#include "mod/AvHCOCRuleset.h"
#include "mod/AvHTeam.h"
#include "mod/AvHMarineWeapons.h"
#include "types.h"
#include "mod/AvHMessage.h"
#include "mod/AvHEntityHierarchy.h"
#include "mod/AvHEntities.h"
#include "mod/AvHMiniMap.h"
#include "dlls/teamplay_gamerules.h"
#include "mod/AvHDramaticPriority.h"
#include "mod/AvHMapExtents.h"
#include "util/Tokenizer.h"
#include "mod/AvHSpawn.h"
class AvHPlayer;
class TeamPurchase
{
public:
TeamPurchase(edict_t* inPlayer, AvHMessageID inMessageID) : mPlayer(inPlayer), mUpgrade(inMessageID)
{}
edict_t* mPlayer;
AvHMessageID mUpgrade;
};
typedef vector< pair <string, int> > MapVoteListType;
typedef map< int, int > PlayerMapVoteListType;
typedef map< int, float > PlayerVoteTimeType;
// : 0001073
#ifdef USE_OLDAUTH
typedef vector< pair<string, string> > AuthIDListType;
typedef map<AvHPlayerAuthentication, AuthIDListType> AuthMaskListType;
#endif
class AvHGamerules : public CHalfLifeTeamplay //public CHalfLifeMultiplay/*, public AvHCOCRuleset*/
{
public:
AvHGamerules();
virtual ~AvHGamerules();
// : 0001073
#ifdef USE_OLDAUTH
virtual BOOL GetIsClientAuthorizedToPlay(edict_t* inEntity, bool inDisplayMessage, bool inForcePending = false) const;
virtual bool PerformHardAuthorization(AvHPlayer* inPlayer) const;
virtual int GetAuthenticationMask(const string& inAuthID) const;
const AuthIDListType& GetServerOpList() const;
void UpdateUplink();
#endif
// this is the game name that gets seen in the server browser
virtual int AmmoShouldRespawn( CBasePlayerAmmo *pAmmo );
virtual void BuildableBuilt(AvHBuildable* inBuildable);
virtual void BuildableKilled(AvHBuildable* inBuildable);
virtual void BuildMiniMap(AvHPlayer* inPlayer);
virtual BOOL CanHavePlayerItem(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
virtual void ClientUserInfoChanged( CBasePlayer *pPlayer, char *infobuffer );
virtual const char* GetGameDescription(void);
virtual int WeaponShouldRespawn( CBasePlayerItem *pWeapon );
virtual void DeathNotice( CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor);
virtual BOOL FShouldSwitchWeapon(CBasePlayer* inPlayer, CBasePlayerItem* inWeapon);
virtual bool GetCountdownStarted(void) const;
virtual bool GetGameStarted(void) const;
virtual int GetGameTime() const;
virtual void SetGameStarted(bool inGameStarted);
AvHEntityHierarchy& GetEntityHierarchy(AvHTeamNumber inTeam);
bool GetIsPlayerSelectableByPlayer(AvHPlayer* inTargetPlayer, AvHPlayer* inByPlayer);
virtual int IPointsForKill(CBasePlayer *pAttacker, CBasePlayer *pKilled);
void ProcessTeamUpgrade(AvHMessageID inUpgrade, AvHTeamNumber inNumber, int inEntity, bool inGive = true);
// Playtest functionality
void BalanceChanged();
// This isn't called yet, add in hooks?
void ClientKill( edict_t *pEntity );
virtual BOOL CanHaveAmmo( CBasePlayer *pPlayer, const char *pszAmmoName, int iMaxCarry );// can this player take more of this ammo?
virtual bool CanPlayerBeKilled(CBasePlayer* inPlayer);
virtual void ChangePlayerTeam(CBasePlayer *pPlayer, const char *pTeamName, BOOL bKill, BOOL bGib);
virtual BOOL ClientCommand( CBasePlayer *pPlayer, const char *pcmd );
virtual BOOL ClientConnected( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] );
virtual void ClientDisconnected( edict_t *pClient );
virtual int DeadPlayerAmmo( CBasePlayer *pPlayer );
virtual int DeadPlayerWeapons( CBasePlayer *pPlayer );
virtual BOOL FAllowMonsters( void );
virtual BOOL FPlayerCanRespawn( CBasePlayer *pPlayer );
virtual BOOL FPlayerCanTakeDamage( CBasePlayer *pPlayer, CBaseEntity *pAttacker );
// TODO: Add splash damage parameter and outgoing float percentage damage? This way splash damage could do some damage in non-tourny mode?
virtual bool CanEntityDoDamageTo(const CBaseEntity* inAttacker, const CBaseEntity* inReceiver, float* outScalar = NULL);
//virtual edict_t* GetPlayerSpawnSpot( CBasePlayer *pPlayer );
virtual void PlayerThink( CBasePlayer *pPlayer );
void ComputeWorldChecksum(Checksum& outChecksum) const;
float GetMapGamma();
int GetNumCommandersOnTeam(AvHTeamNumber inTeam);
int GetNumActiveHives(AvHTeamNumber inTeam) const;
int GetNumEntities() const;
const AvHGameplay& GetGameplay() const;
const AvHMapExtents& GetMapExtents();
virtual BOOL IsMultiplayer( void );
virtual BOOL IsDeathmatch( void );
virtual BOOL IsCoOp( void );
virtual void InitHUD( CBasePlayer *pPlayer );
virtual void PlayerGotWeapon(CBasePlayer *pPlayer, CBasePlayerItem *pWeapon);
virtual void PlayerKilled( CBasePlayer *pVictim, entvars_t *pKiller, entvars_t *pInflictor );
virtual void PlayerSpawn( CBasePlayer *pPlayer );
virtual void ProcessRespawnCostForPlayer(AvHPlayer* inPlayer);
virtual void RewardPlayerForKill(AvHPlayer* inPlayer, CBaseEntity* inTarget, entvars_t* inInflictor = NULL);
bool RoamingAllowedForPlayer(CBasePlayer* inPlayer) const;
virtual void Think(void);
void RegisterServerVariable(const cvar_t* inCvar);
int GetNumServerVariables() const;
const cvar_t* GetServerVariable(int i) const;
bool GetCheatsEnabled(void) const;
bool GetIsCheatEnabled(const string& inCheatName) const;
void SetCheatEnabled(const string& inCheatName, bool inEnabledState = true);
float GetFirstScanThinkTime() const;
bool GetDrawInvisibleEntities() const;
bool GetEntityExists(const char* inName) const;
bool GetIsTesting(void) const;
bool GetIsValidFutureTeam(AvHPlayer inPlayer, int inTeamNumber) const;
bool GetCanJoinTeamInFuture(AvHPlayer* inPlayer, AvHTeamNumber theTeamNumber, string& outString) const;
const AvHBaseInfoLocationListType& GetInfoLocations() const;
int GetMaxWeight(void) const;
const char* GetSpawnEntityName(AvHPlayer* inPlayer) const;
Vector GetSpawnAreaCenter(AvHTeamNumber inTeamNumber) const;
float GetTimeGameStarted() const;
int GetTimeLimit() const;
int GetWeightForItemAndAmmo(AvHWeaponID inWeapon, int inNumRounds) const;
bool AttemptToJoinTeam(AvHPlayer* inPlayer, AvHTeamNumber theTeamNumber, bool inDisplayErrorMessage = true);
const AvHTeam* GetTeam(AvHTeamNumber inTeamNumber) const;
const AvHTeam* GetTeamA() const;
const AvHTeam* GetTeamB() const;
AvHTeam* GetTeam(AvHTeamNumber inTeamNumber);
AvHTeam* GetTeamA();
AvHTeam* GetTeamB();
AvHMapMode GetMapMode(void) const;
int GetServerTick() const;
AvHTeamNumber GetVictoryTeam() const;
float GetVictoryTime() const;
//void QueueTeamUpgrade(edict_t* inPlayer, AvHMessageID inUpgrade);
void DeleteAndResetEntities();
void PlayerDeathEnd(AvHPlayer* inPlayer);
void PostWorldPrecacheReset(bool inNewMap);
void PreWorldPrecacheReset();
void RegisterSpawnPoint(const string& inClassName, const Vector& inOrigin, const Vector& inAngles, const AvHTeamNumber& inTeamNumber);
void RespawnPlayer(AvHPlayer* inPlayer);
void TriggerAlert(AvHTeamNumber inTeamNumber, AvHAlertType inAlertType, int inEntIndex, AvHMessageID inMessageID = MESSAGE_NULL);
bool GetIsEntityUnderAttack(int inEntityIndex) const;
virtual bool GetArePlayersAllowedToJoinImmediately(void) const;
virtual bool GetIsTournamentMode(void) const;
virtual bool GetIsHamboneMode(void) const;
virtual bool GetIsIronMan(void) const;
virtual bool GetIsCombatMode(void) const;
virtual AvHTeamNumber GetCombatAttackingTeamNumber() const;
virtual bool GetIsNSMode(void) const;
virtual bool GetIsTrainingMode(void) const;
int GetBaseHealthForMessageID(AvHMessageID inMessageID) const;
int GetBuildTimeForMessageID(AvHMessageID inMessageID) const;
int GetCostForMessageID(AvHMessageID inMessageID) const;
CBaseEntity* GetRandomHiveSpawnPoint(CBaseEntity* inPlayer, const Vector& inOrigin, float inMaxDistance) const;
virtual edict_t* SelectSpawnPoint(CBaseEntity* inPlayer) const;
bool CanPlayerBeacon(CBaseEntity *inPlayer);
edict_t* SelectSpawnPoint(CBaseEntity* inEntity, const string& inSpawnEntityName) const;
const char* SetDefaultPlayerTeam(CBasePlayer *pPlayer);
void MarkDramaticEvent(int inPriority, CBaseEntity* inPrimaryEntity, bool inDramatic = false, CBaseEntity* inSecondaryEntity = NULL) const;
void MarkDramaticEvent(int inPriority, short inPrimaryEntityIndex, bool inDramatic = false, short inSecondaryEntityIndex = 0) const;
void MarkDramaticEvent(int inPriority, short inPrimaryEntityIndex, bool inDramatic, entvars_t* inSecondaryEntity) const;
virtual void RecalculateHandicap(void);
void ServerExit();
void VoteMap(int inPlayerIndex, int inMapIndex);
bool GetMapVoteStrings(StringList& outMapVoteList);
void RemovePlayerFromVotemap(int inPlayerIndex);
bool GetIsGameInReset() {return this->mGameInReset; };
int GetStructureLimit();
void RemoveEntityUnderAttack(int entIndex);
protected:
void AutoAssignPlayer(AvHPlayer* inPlayer);
void PerformMapValidityCheck();
virtual void RecalculateMapMode( void );
bool GetDeathMatchMode(void) const;
//void PutPlayerIntoSpectateMode(AvHPlayer* inPlayer) const;
virtual void SendMOTDToClient( edict_t *client );
// : 0001073
#ifdef USE_OLDAUTH
void AddAuthStatus(AvHPlayerAuthentication inAuthMask, const string& inWONID, const string& inSteamID);
void DisplayVersioning();
void InitializeAuthentication();
#endif
private:
void AwardExperience(AvHPlayer* inPlayer, int inTargetLevel, bool inAwardFriendliesInRange = true);
void CalculateMapExtents();
void CalculateMapGamma();
void CopyDataToSpawnEntity(const AvHSpawn& inSpawnEntity) const;
void JoinTeam(AvHPlayer* inPlayer, AvHTeamNumber theTeamNumber, bool inDisplayErrorMessage, bool inForce);
void PreWorldPrecacheInitParticles();
void PostWorldPrecacheInitParticles();
void InitializeMapVoteList();
int GetVotesNeededForMapChange() const;
void InitializeTechNodes();
void InternalResetGameRules();
int GetNumberOfPlayers(bool inPlayingGame=false) const;
void TallyVictoryStats() const;
void PostVictoryStatsToWeb(const string& inFormParams) const;
bool ReadyToStartCountdown();
void ResetGame(bool inPreserveTeams = false);
void ResetPlayers();
void SendGameTimeUpdate(bool inReliable = false);
void ProcessTeamUpgrades();
void ResetEntities();
CBaseEntity* SelectRandomSpawn(CBaseEntity* inPlayer, const string& inSpawnName) const;
void UpdateCheats();
void UpdateHLTVProxy();
void UpdatePlaytesting();
void UpdateCountdown(float inTime);
void UpdateEntitiesUnderAttack();
void UpdateGameTime();
void UpdateLOS();
void UpdateScripts();
void UpdateServerCommands();
void UpdateTimeLimit();
void UpdateWorldEntities();
void UpdateVictory(void);
void UpdateVictoryStatus(void);
bool mFirstUpdate;
bool mPreserveTeams;
bool mGameStarted;
float mLastJoinMessage;
AvHTeamNumber mVictoryTeam;
float mTimeCountDownStarted;
float mTimeGameStarted;
float mTimeOfLastHLTVProxyUpdate;
float mTimeOfForcedLastHLTVProxyUpdate;
float mTimeOfLastHLTVParticleTemplateSending;
int mHLTVNumParticleTemplatesSent;
int mHLTVCurrentPlayer;
AvHEntityHierarchy mHLTVEntityHierarchy;
float mTimeOfLastGameTimeUpdate;
float mTimeSentCountdown;
float mTimeLastWontStartMessageSent;
float mTimeWorldReset;
bool mStartedCountdown;
bool mSentCountdownMessage;
bool mVictoryDraw;
AvHTeam mTeamA;
AvHTeam mTeamB;
float mVictoryTime;
AvHMapMode mMapMode;
// : 0001073
#ifdef USE_OLDAUTH
bool mUpdatedUplink;
AuthIDListType mServerOpList;
#endif
float mLastParticleUpdate;
float mLastNetworkUpdate;
float mLastWorldEntityUpdate;
float mLastCloakableUpdate;
float mLastVictoryUpdate;
float mLastMapChange;
float mTimeOfLastPlaytestUpdate;
float mTimeOfLastHandicapUpdate;
float mTimeUpdatedScripts;
typedef vector<TeamPurchase> TeamPurchaseListType;
TeamPurchaseListType mPendingTeamUpgrades;
// Potentially marines vs. marines
AvHEntityHierarchy mTeamAEntityHierarchy;
AvHEntityHierarchy mTeamBEntityHierarchy;
AvHEntityHierarchy mSpecEntityHierarchy;
AvHGameplay mGameplay;
bool mCalculatedMapGamma;
float mMapGamma;
typedef map<int, float> EntityUnderAttackListType;
EntityUnderAttackListType mEntitiesUnderAttack;
bool mGameInReset;
AvHMiniMap mMiniMap;
AvHMapExtents mMapExtents;
StringList mCheats;
AvHBaseInfoLocationListType mInfoLocations;
float mSavedTimeCountDownStarted;
SpawnListType mSpawnList;
mutable CBaseEntity* mSpawnEntity;
// Map voting
MapVoteListType mMapVoteList;
PlayerMapVoteListType mPlayersVoted;
PlayerVoteTimeType mPlayersVoteTime;
std::vector<const cvar_t *> mServerVariableList;
AvHTeamNumber mCombatAttackingTeamNumber;
bool mHasPlayersToReset;
float mLastPlayerResetTime;
};
AvHGamerules* GetGameRules();
void SetGameRules(AvHGamerules* inGameRules);
#endif

View file

@ -103,9 +103,7 @@ int AvHGrenade::GetDeployAnimation() const
char* AvHGrenade::GetDeploySound() const
{
//return kGRDeploySound;
return NULL;
return kGRDeploySound;
}
float AvHGrenade::GetDeployTime() const
@ -301,7 +299,7 @@ void AvHGrenade::Precache(void)
AvHMarineWeapon::Precache();
PRECACHE_UNMODIFIED_SOUND(kGRFireSound1);
//PRECACHE_UNMODIFIED_SOUND(kGRDeploySound);
PRECACHE_UNMODIFIED_SOUND(kGRDeploySound);
PRECACHE_UNMODIFIED_SOUND(kGRExplodeSound);
PRECACHE_UNMODIFIED_SOUND(kGRHitSound);
@ -380,7 +378,7 @@ void AvHGrenade::CreateProjectile()
}
// How to handle this? Only generate entity on server, but we should do SOMETHING on the client, no?
CGrenade* theGrenade = AvHSUShootServerGrenade(this->m_pPlayer->pev, theStartPosition, theVelocity, BALANCE_VAR(kGrenDetonateTime), true);
CGrenade* theGrenade = AvHSUShootServerGrenade(this->m_pPlayer->pev, theStartPosition, theVelocity, BALANCE_VAR(kHandGrenDetonateTime), true);
ASSERT(theGrenade);
theGrenade->pev->dmg = this->mDamage;

View file

@ -165,11 +165,12 @@ void AvHHealingSpray::FireProjectiles(void)
while((theCurrentEntity = UTIL_FindEntityInSphere(theCurrentEntity, theOriginatingPosition, kHealingSprayRange)) != NULL)
{
bool isSelf=(theCurrentEntity == this->m_pPlayer);
// Can't affect self
if(theCurrentEntity != this->m_pPlayer)
{
// if(theCurrentEntity != this->m_pPlayer)
// {
// If entity is in view cone, and within range
if(this->m_pPlayer->FInViewCone(&theCurrentEntity->pev->origin))
if(isSelf || this->m_pPlayer->FInViewCone(&theCurrentEntity->pev->origin) )
{
// UTIL_FindEntityInSphere doesn't seem to take height into account. Make sure the entity is within range.
float theMaxEntitySize = max(Length(theCurrentEntity->pev->mins), Length(theCurrentEntity->pev->maxs));
@ -208,6 +209,7 @@ void AvHHealingSpray::FireProjectiles(void)
// Players heal by base amount, plus percentage of health
float thePercentage = BALANCE_VAR(kHealingSprayPlayerPercent)/100.0f;
theDamage += thePercentage*theCurrentEntity->pev->max_health;
if ( isSelf ) theDamage *= 0.5f;
thePlayer->Heal(theDamage, true);
}
else if(theBuildable)
@ -240,7 +242,7 @@ void AvHHealingSpray::FireProjectiles(void)
}
}
}
}
// }
}
#endif

File diff suppressed because it is too large Load diff

View file

@ -152,10 +152,15 @@ public:
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);
virtual void TriggerDeathAudioVisuals();
virtual void TriggerDeathAudioVisuals(bool isRecycled=false);
virtual void Spawn();
virtual void SetEmergencyUse();
virtual bool GetEmergencyUse() const;
void EXPORT TeleportUse(CBaseEntity* inActivator, CBaseEntity* inCaller, USE_TYPE inUseType, float inValue);
//virtual void UpdateReinforcements();
protected:
@ -179,6 +184,10 @@ private:
float mTimeLastWoundSound;
float mTimeOfNextUmbra;
float mEnergy;
float mLastTimeScannedHives;
float mTimeEmergencyUseEnabled;
int mTeleportHiveIndex;
};
#endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -90,9 +90,7 @@ float AvHKnife::GetDeployTime() const
char* AvHKnife::GetDeploySound() const
{
//return kKNDeploySound;
return NULL;
return kKNDeploySound;
}
char* AvHKnife::GetHeavyViewModel() const
@ -157,8 +155,6 @@ void AvHKnife::FireProjectiles(void)
// Do trace hull here
float theDamage = this->mDamage;
CBaseEntity* pHurt = this->m_pPlayer->CheckTraceHullAttack(kKNRange, theDamage, DMG_SLASH);
if(pHurt)
{
char* theSoundToPlay = NULL;
@ -189,7 +185,6 @@ void AvHKnife::FireProjectiles(void)
}
}
#endif
}

File diff suppressed because it is too large Load diff

View file

@ -1,473 +1,473 @@
//======== (C) Copyright 2001 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHMarineEquipment.h $
// $Date: 2002/11/06 01:40:17 $
//
//-------------------------------------------------------------------------------
// $Log: AvHMarineEquipment.h,v $
// Revision 1.29 2002/11/06 01:40:17 Flayra
// - Turrets now need an active turret factory to keep firing
//
// Revision 1.28 2002/10/24 21:32:16 Flayra
// - All heavy armor to be given via console
// - Fix for AFKers on inf portals, also for REIN players when recycling portals
//
// Revision 1.27 2002/10/16 20:54:30 Flayra
// - Added phase gate sound
// - Fixed ghostly command station view model problem after building it
//
// Revision 1.26 2002/10/16 01:00:33 Flayra
// - Phasegates play looping sound, and stop it when they are destroyed
//
// Revision 1.25 2002/09/23 22:21:21 Flayra
// - Added jetpack and heavy armor
// - Added "cc online" sound
// - Turret factories now upgrade to advanced turret factories for siege
// - Added automatic resupply at armory, but removed it
// - Observatories scan in 2D now, to match commander range overlay
//
// Revision 1.24 2002/09/09 19:59:39 Flayra
// - Fixed up phase gates (no longer teleport you unless you have two, and they work properly now)
// - Refactored reinforcements
// - Fixed bug where secondary command station couldn't be built
//
// Revision 1.23 2002/07/26 23:05:54 Flayra
// - Numerical event feedback
// - Started to add sparks when buildings were hit but didn't know the 3D point to play it at
//
// Revision 1.22 2002/07/23 17:11:47 Flayra
// - Phase gates must be built and can be destroyed, observatories decloak aliens, hooks for fast reinforcements upgrade, nuke damage increased, commander banning
//
// Revision 1.21 2002/07/08 17:02:57 Flayra
// - Refactored reinforcements, updated entities for new artwork
//
// Revision 1.20 2002/06/25 18:04:43 Flayra
// - Renamed some buildings, armory is now upgraded to advanced armory
//
// Revision 1.19 2002/06/03 16:50:35 Flayra
// - Renamed weapons factory and armory, added ammo resupplying
//
// Revision 1.18 2002/05/28 17:51:34 Flayra
// - Tried to make nuke sound play, extended shake duration to sound length, reinforcement refactoring, mark command stations as mapper placed, so they aren't deleted on level cleanup, support for point-entity buildable command stations
//
// Revision 1.17 2002/05/23 02:33:42 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#ifndef AVHMARINEEQUIPMENT_H
#define AVHMARINEEQUIPMENT_H
#include "util/nowarnings.h"
#include "dlls/weapons.h"
#include "mod/AvHBasePlayerWeapon.h"
#include "mod/AvHConstants.h"
#include "mod/AvHMarineWeapons.h"
#include "dlls/turret.h"
#include "mod/AvHEntities.h"
#include "dlls/ctripmine.h"
#include "mod/AvHReinforceable.h"
class AvHDeployedMine : public CBasePlayerItem
{
public:
void EXPORT ActiveThink();
void EXPORT ActiveTouch(CBaseEntity* inOther);
void Detonate();
void Precache(void);
void EXPORT PowerupThink();
void SetPlacer(entvars_t* inPlacer);
void Spawn(void);
void Killed(entvars_t* inAttacker, int inGib);
int TakeDamage(entvars_t *inInflictor, entvars_t *inAttacker, float inDamage, int inBitsDamageType);
private:
void DetonateIfOwnerInvalid();
void Explode(TraceResult* inTrace, int inBitsDamageType);
void EXPORT Smoke();
Vector mVecDir;
Vector mVecEnd;
Vector mOwnerOrigin;
Vector mOwnerAngles;
float mTimePlaced;
float mLastTimeTouched;
bool mDetonated;
bool mPoweredUp;
EHANDLE mOwner;
entvars_t* mPlacer;
};
class AvHPlayerEquipment : public CBasePlayerItem
{
public:
AvHPlayerEquipment();
virtual int GetLifetime() const;
virtual bool GetIsPersistent() const;
virtual void SetPersistent();
virtual void KeyValue(KeyValueData* pkvd);
private:
bool mIsPersistent;
int mLifetime;
};
class AvHHealth : public AvHPlayerEquipment
{
public:
// puzl: 1017 GiveHealth now takes the amount as a paramater.
static BOOL GiveHealth(CBaseEntity* inOther, float points);
void Precache( void );
void Spawn( void );
void EXPORT Touch(CBaseEntity* inOther);
};
class AvHCatalyst : public AvHPlayerEquipment
{
public:
static BOOL GiveCatalyst(CBaseEntity* inOther);
void Precache( void );
void Spawn( void );
void EXPORT Touch(CBaseEntity* inOther);
};
class AvHGenericAmmo : public CBasePlayerAmmo
{
public:
static BOOL GiveAmmo(CBaseEntity* inOther);
BOOL AddAmmo( CBaseEntity *pOther );
void Precache( void );
void Spawn( void );
void EXPORT Dropped(void);
private:
bool mDropped;
};
class AvHHeavyArmor : public AvHPlayerEquipment
{
public:
void Precache( void );
void Spawn( void );
void EXPORT Touch(CBaseEntity* inOther);
};
class AvHJetpack : public AvHPlayerEquipment
{
public:
void Precache( void );
void Spawn( void );
void EXPORT Touch(CBaseEntity* inOther);
};
class AvHAmmoPack : public AvHPlayerEquipment
{
public:
char m_szAmmoType[32];
int m_iMaxAmmo;
int m_iAmmoAmt;
int m_iWeaponID; //weapon id this is for.
float m_flNoTouch; //Dont let anyone touch it while its falling
void Precache( void );
void Spawn( void );
void EXPORT Touch(CBaseEntity* inOther);
};
class AvHScan : public CBaseAnimating
{
public:
AvHScan();
void Precache(void);
void Spawn(void);
void ScanThink();
private:
float mTimeCreated;
};
class AvHMarineBaseBuildable : public AvHBaseBuildable
{
public:
AvHMarineBaseBuildable(AvHTechID inTechID, AvHMessageID inMessageID, char* inClassName, int inUser3);
virtual char* GetDeploySound() const;
virtual char* GetKilledSound() const;
virtual int GetPointValue() const;
virtual int GetTakeDamageAnimation() const;
virtual void ResetEntity();
virtual int TakeDamage(entvars_t* inInflictor, entvars_t* inAttacker, float inDamage, int inBitsDamageType);
virtual bool GetIsTechnologyAvailable(AvHMessageID inMessageID) const;
virtual void TechnologyBuilt(AvHMessageID inMessageID);
protected:
void SetEnergy(float inEnergy);
float mEnergy;
};
const float kPhaseGateIdleThink = 1.0f;
class AvHPhaseGate : public AvHMarineBaseBuildable
{
public:
AvHPhaseGate();
virtual int GetIdleAnimation() const;
bool GetIsEnabled() const;
virtual int GetSequenceForBoundingBox() const;
void Killed(entvars_t* inAttacker, int inGib);
void Precache(void);
void EXPORT IdleThink();
virtual void ResetEntity();
virtual void SetHasBeenBuilt();
void SetTimeOfLastDeparture(float timeOfLastDeparture);
bool IsReadyToUse();
bool HasWarmedUp() const;
void EXPORT TeleportUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
//void EXPORT TeleportTouch(CBaseEntity *pOther);
virtual void UpdateOnRecycle(void);
virtual void UpdateOnRemove(void);
private:
void KillBuildablesTouchingPlayer(AvHPlayer* inPlayer, entvars_t* inInflictor);
bool GetAreTeammatesBlocking(AvHPlayer* thePlayer, const Vector& inOrigin) const;
void SetEnabled(bool inEnabledState);
bool mEnabled;
bool mHasWarmedUp;
float mTimeOfLastDeparture;
};
class AvHNuke : public AvHMarineBaseBuildable
{
public:
AvHNuke();
virtual void Precache();
void EXPORT ActiveThink();
void EXPORT DeathThink();
virtual char* GetDeploySound() const;
virtual char* GetKilledSound() const;
virtual void Spawn();
private:
bool mActive;
float mTimeActivated;
};
class AvHInfantryPortal : public AvHMarineBaseBuildable, public AvHReinforceable
{
public:
AvHInfantryPortal();
virtual void Killed(entvars_t* inAttacker, int inGib);
virtual float GetReinforceTime() const;
void EXPORT PortalThink();
virtual void Precache();
virtual void ResetEntity();
virtual void SetHasBeenBuilt();
// From AvHReinforceable
virtual void CueRespawnEffect(AvHPlayer* inPlayer);
virtual bool GetCanReinforce() const;
virtual bool GetSpawnLocationForPlayer(CBaseEntity* inPlayer, Vector& outLocation) const;
virtual AvHTeamNumber GetReinforceTeamNumber() const;
virtual void UpdateOnRecycle(void);
virtual void UpdateOnRemove(void);
virtual int GetIdleAnimation() const;
virtual int GetIdle1Animation() const;
virtual int GetIdle2Animation() const;
virtual int GetDeployAnimation() const;
virtual int GetSpawnAnimation() const;
protected:
virtual void ResetReinforcingPlayer(bool inSuccess);
};
class AvHCommandStation : public AvHMarineBaseBuildable
{
public:
AvHCommandStation();
void EXPORT CommandTouch( CBaseEntity *pOther );
void EXPORT CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
virtual int GetIdleAnimation() const;
virtual bool GetIsTechnologyAvailable(AvHMessageID inMessageID) const;
virtual char* GetKilledSound() const;
virtual int GetPointValue() const;
virtual void Killed( entvars_t *pevAttacker, int iGib );
virtual void Materialize();
virtual int ObjectCaps(void);
virtual void Precache(void);
virtual void SetHasBeenBuilt();
virtual void SetInactive();
virtual void Spawn(void);
virtual int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType );
private:
void EXPORT ActivateThink(void);
void EXPORT CommanderUsingThink(void);
void EjectCommander();
int mCommanderAtThisStation;
float mTimeToPlayOnlineSound;
};
class AvHTurretFactory : public AvHMarineBaseBuildable
{
public:
AvHTurretFactory();
virtual int GetIdle1Animation() const;
virtual int GetIdle2Animation() const;
virtual int GetResearchAnimation() const;
virtual bool GetSupportsTechID(AvHTechID inTechID) const;
virtual void SetHasBeenBuilt();
virtual void TriggerAddTech() const;
virtual void TriggerRemoveTech() const;
virtual void Upgrade();
private:
virtual void CheckTurretEnabledState() const;
};
class AvHArmory : public AvHMarineBaseBuildable
{
public:
AvHArmory();
virtual int GetActiveAnimation() const;
virtual int GetIdle1Animation() const;
virtual int GetIdle2Animation() const;
virtual int GetResearchAnimation() const;
virtual int GetSequenceForBoundingBox() const;
virtual bool GetSupportsTechID(AvHTechID inTechID) const;
virtual void Precache();
//void EXPORT ResupplyThink();
void EXPORT ResupplyUse(CBaseEntity* inActivator, CBaseEntity* inCaller, USE_TYPE inUseType, float inValue);
virtual void SetHasBeenBuilt();
virtual void Upgrade();
};
class AvHArmsLab : public AvHMarineBaseBuildable
{
public:
AvHArmsLab();
virtual int GetResearchAnimation() const;
virtual int GetSequenceForBoundingBox() const;
};
class AvHPrototypeLab : public AvHMarineBaseBuildable
{
public:
AvHPrototypeLab();
};
class AvHObservatory : public AvHMarineBaseBuildable
{
public:
AvHObservatory();
virtual int GetSequenceForBoundingBox() const;
virtual void Materialize();
void EXPORT ObservatoryThink();
virtual void ResetEntity();
virtual void SetHasBeenBuilt();
virtual void Spawn();
virtual int GetActiveAnimation() const;
virtual int GetIdle1Animation() const;
virtual int GetIdle2Animation() const;
virtual int GetResearchAnimation() const;
};
//class AvHChemLab : public AvHMarineBaseBuildable
//{
//public:
// AvHChemLab();
//};
//
//class AvHMedLab : public AvHMarineBaseBuildable
//{
//public:
// AvHMedLab();
//};
//
//class AvHNukePlant : public AvHMarineBaseBuildable
//{
//public:
// AvHNukePlant();
//};
#endif
//======== (C) Copyright 2001 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHMarineEquipment.h $
// $Date: 2002/11/06 01:40:17 $
//
//-------------------------------------------------------------------------------
// $Log: AvHMarineEquipment.h,v $
// Revision 1.29 2002/11/06 01:40:17 Flayra
// - Turrets now need an active turret factory to keep firing
//
// Revision 1.28 2002/10/24 21:32:16 Flayra
// - All heavy armor to be given via console
// - Fix for AFKers on inf portals, also for REIN players when recycling portals
//
// Revision 1.27 2002/10/16 20:54:30 Flayra
// - Added phase gate sound
// - Fixed ghostly command station view model problem after building it
//
// Revision 1.26 2002/10/16 01:00:33 Flayra
// - Phasegates play looping sound, and stop it when they are destroyed
//
// Revision 1.25 2002/09/23 22:21:21 Flayra
// - Added jetpack and heavy armor
// - Added "cc online" sound
// - Turret factories now upgrade to advanced turret factories for siege
// - Added automatic resupply at armory, but removed it
// - Observatories scan in 2D now, to match commander range overlay
//
// Revision 1.24 2002/09/09 19:59:39 Flayra
// - Fixed up phase gates (no longer teleport you unless you have two, and they work properly now)
// - Refactored reinforcements
// - Fixed bug where secondary command station couldn't be built
//
// Revision 1.23 2002/07/26 23:05:54 Flayra
// - Numerical event feedback
// - Started to add sparks when buildings were hit but didn't know the 3D point to play it at
//
// Revision 1.22 2002/07/23 17:11:47 Flayra
// - Phase gates must be built and can be destroyed, observatories decloak aliens, hooks for fast reinforcements upgrade, nuke damage increased, commander banning
//
// Revision 1.21 2002/07/08 17:02:57 Flayra
// - Refactored reinforcements, updated entities for new artwork
//
// Revision 1.20 2002/06/25 18:04:43 Flayra
// - Renamed some buildings, armory is now upgraded to advanced armory
//
// Revision 1.19 2002/06/03 16:50:35 Flayra
// - Renamed weapons factory and armory, added ammo resupplying
//
// Revision 1.18 2002/05/28 17:51:34 Flayra
// - Tried to make nuke sound play, extended shake duration to sound length, reinforcement refactoring, mark command stations as mapper placed, so they aren't deleted on level cleanup, support for point-entity buildable command stations
//
// Revision 1.17 2002/05/23 02:33:42 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#ifndef AVHMARINEEQUIPMENT_H
#define AVHMARINEEQUIPMENT_H
#include "util/nowarnings.h"
#include "dlls/weapons.h"
#include "mod/AvHBasePlayerWeapon.h"
#include "mod/AvHConstants.h"
#include "mod/AvHMarineWeapons.h"
#include "dlls/turret.h"
#include "mod/AvHEntities.h"
#include "dlls/ctripmine.h"
#include "mod/AvHReinforceable.h"
class AvHDeployedMine : public CBasePlayerItem
{
public:
void EXPORT ActiveThink();
void EXPORT ActiveTouch(CBaseEntity* inOther);
void Detonate();
void Precache(void);
void EXPORT PowerupThink();
void SetPlacer(entvars_t* inPlacer);
void Spawn(void);
void Killed(entvars_t* inAttacker, int inGib);
int TakeDamage(entvars_t *inInflictor, entvars_t *inAttacker, float inDamage, int inBitsDamageType);
private:
void DetonateIfOwnerInvalid();
void Explode(TraceResult* inTrace, int inBitsDamageType);
void EXPORT Smoke();
Vector mVecDir;
Vector mVecEnd;
Vector mOwnerOrigin;
Vector mOwnerAngles;
float mTimePlaced;
float mLastTimeTouched;
bool mDetonated;
bool mPoweredUp;
EHANDLE mOwner;
entvars_t* mPlacer;
};
class AvHPlayerEquipment : public CBasePlayerItem
{
public:
AvHPlayerEquipment();
virtual int GetLifetime() const;
virtual bool GetIsPersistent() const;
virtual void SetPersistent();
virtual void KeyValue(KeyValueData* pkvd);
private:
bool mIsPersistent;
int mLifetime;
};
class AvHHealth : public AvHPlayerEquipment
{
public:
// : 1017 GiveHealth now takes the amount as a paramater.
static BOOL GiveHealth(CBaseEntity* inOther, float points);
void Precache( void );
void Spawn( void );
void EXPORT Touch(CBaseEntity* inOther);
};
class AvHCatalyst : public AvHPlayerEquipment
{
public:
static BOOL GiveCatalyst(CBaseEntity* inOther);
void Precache( void );
void Spawn( void );
void EXPORT Touch(CBaseEntity* inOther);
};
class AvHGenericAmmo : public CBasePlayerAmmo
{
public:
static BOOL GiveAmmo(CBaseEntity* inOther);
BOOL AddAmmo( CBaseEntity *pOther );
void Precache( void );
void Spawn( void );
void EXPORT Dropped(void);
private:
bool mDropped;
};
class AvHHeavyArmor : public AvHPlayerEquipment
{
public:
void Precache( void );
void Spawn( void );
void EXPORT Touch(CBaseEntity* inOther);
};
class AvHJetpack : public AvHPlayerEquipment
{
public:
void Precache( void );
void Spawn( void );
void EXPORT Touch(CBaseEntity* inOther);
};
class AvHAmmoPack : public AvHPlayerEquipment
{
public:
char m_szAmmoType[32];
int m_iMaxAmmo;
int m_iAmmoAmt;
int m_iWeaponID; //weapon id this is for.
float m_flNoTouch; //Dont let anyone touch it while its falling
void Precache( void );
void Spawn( void );
void EXPORT Touch(CBaseEntity* inOther);
};
class AvHScan : public CBaseAnimating
{
public:
AvHScan();
void Precache(void);
void Spawn(void);
void ScanThink();
private:
float mTimeCreated;
};
class AvHMarineBaseBuildable : public AvHBaseBuildable
{
public:
AvHMarineBaseBuildable(AvHTechID inTechID, AvHMessageID inMessageID, char* inClassName, int inUser3);
virtual char* GetDeploySound() const;
virtual char* GetKilledSound() const;
virtual int GetPointValue() const;
virtual int GetTakeDamageAnimation() const;
virtual void ResetEntity();
virtual int TakeDamage(entvars_t* inInflictor, entvars_t* inAttacker, float inDamage, int inBitsDamageType);
virtual bool GetIsTechnologyAvailable(AvHMessageID inMessageID) const;
virtual void TechnologyBuilt(AvHMessageID inMessageID);
protected:
void SetEnergy(float inEnergy);
float mEnergy;
};
const float kPhaseGateIdleThink = 1.0f;
class AvHPhaseGate : public AvHMarineBaseBuildable
{
public:
AvHPhaseGate();
virtual int GetIdleAnimation() const;
bool GetIsEnabled() const;
virtual int GetSequenceForBoundingBox() const;
void Killed(entvars_t* inAttacker, int inGib);
void Precache(void);
void EXPORT IdleThink();
virtual void ResetEntity();
virtual void SetHasBeenBuilt();
void SetTimeOfLastDeparture(float timeOfLastDeparture);
bool IsReadyToUse();
bool HasWarmedUp() const;
void EXPORT TeleportUse(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
//void EXPORT TeleportTouch(CBaseEntity *pOther);
virtual void UpdateOnRecycle(void);
virtual void UpdateOnRemove(void);
private:
void KillBuildablesTouchingPlayer(AvHPlayer* inPlayer, entvars_t* inInflictor);
bool GetAreTeammatesBlocking(AvHPlayer* thePlayer, const Vector& inOrigin) const;
void SetEnabled(bool inEnabledState);
bool mEnabled;
bool mHasWarmedUp;
float mTimeOfLastDeparture;
};
class AvHNuke : public AvHMarineBaseBuildable
{
public:
AvHNuke();
virtual void Precache();
void EXPORT ActiveThink();
void EXPORT DeathThink();
virtual char* GetDeploySound() const;
virtual char* GetKilledSound() const;
virtual void Spawn();
private:
bool mActive;
float mTimeActivated;
};
class AvHInfantryPortal : public AvHMarineBaseBuildable, public AvHReinforceable
{
public:
AvHInfantryPortal();
virtual void Killed(entvars_t* inAttacker, int inGib);
virtual float GetReinforceTime() const;
void EXPORT PortalThink();
virtual void Precache();
virtual void ResetEntity();
virtual void SetHasBeenBuilt();
// From AvHReinforceable
virtual void CueRespawnEffect(AvHPlayer* inPlayer);
virtual bool GetCanReinforce() const;
virtual bool GetSpawnLocationForPlayer(CBaseEntity* inPlayer, Vector& outLocation) const;
virtual AvHTeamNumber GetReinforceTeamNumber() const;
virtual void UpdateOnRecycle(void);
virtual void UpdateOnRemove(void);
virtual int GetIdleAnimation() const;
virtual int GetIdle1Animation() const;
virtual int GetIdle2Animation() const;
// virtual int GetDeployAnimation() const;
// virtual int GetSpawnAnimation() const;
protected:
virtual void ResetReinforcingPlayer(bool inSuccess);
};
class AvHCommandStation : public AvHMarineBaseBuildable
{
public:
AvHCommandStation();
void EXPORT CommandTouch( CBaseEntity *pOther );
void EXPORT CommandUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value );
virtual int GetIdleAnimation() const;
virtual bool GetIsTechnologyAvailable(AvHMessageID inMessageID) const;
virtual char* GetKilledSound() const;
virtual int GetPointValue() const;
virtual void Killed( entvars_t *pevAttacker, int iGib );
virtual void Materialize();
virtual int ObjectCaps(void);
virtual void Precache(void);
virtual void SetHasBeenBuilt();
virtual void SetInactive();
virtual void Spawn(void);
virtual int TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType );
private:
void EXPORT ActivateThink(void);
void EXPORT CommanderUsingThink(void);
void EjectCommander();
int mCommanderAtThisStation;
float mTimeToPlayOnlineSound;
};
class AvHTurretFactory : public AvHMarineBaseBuildable
{
public:
AvHTurretFactory();
virtual int GetIdle1Animation() const;
virtual int GetIdle2Animation() const;
virtual int GetResearchAnimation() const;
virtual bool GetSupportsTechID(AvHTechID inTechID) const;
virtual void SetHasBeenBuilt();
virtual void TriggerAddTech() const;
virtual void TriggerRemoveTech() const;
virtual void Upgrade();
private:
virtual void CheckTurretEnabledState() const;
};
class AvHArmory : public AvHMarineBaseBuildable
{
public:
AvHArmory();
virtual int GetActiveAnimation() const;
virtual int GetIdle1Animation() const;
virtual int GetIdle2Animation() const;
virtual int GetResearchAnimation() const;
virtual int GetSequenceForBoundingBox() const;
virtual bool GetSupportsTechID(AvHTechID inTechID) const;
virtual void Precache();
//void EXPORT ResupplyThink();
void EXPORT ResupplyUse(CBaseEntity* inActivator, CBaseEntity* inCaller, USE_TYPE inUseType, float inValue);
virtual void SetHasBeenBuilt();
virtual void Upgrade();
};
class AvHArmsLab : public AvHMarineBaseBuildable
{
public:
AvHArmsLab();
virtual int GetResearchAnimation() const;
virtual int GetSequenceForBoundingBox() const;
};
class AvHPrototypeLab : public AvHMarineBaseBuildable
{
public:
AvHPrototypeLab();
};
class AvHObservatory : public AvHMarineBaseBuildable
{
public:
AvHObservatory();
virtual int GetSequenceForBoundingBox() const;
virtual void Materialize();
void EXPORT ObservatoryThink();
virtual void ResetEntity();
virtual void SetHasBeenBuilt();
virtual void Spawn();
virtual int GetActiveAnimation() const;
virtual int GetIdle1Animation() const;
virtual int GetIdle2Animation() const;
virtual int GetResearchAnimation() const;
};
//class AvHChemLab : public AvHMarineBaseBuildable
//{
//public:
// AvHChemLab();
//};
//
//class AvHMedLab : public AvHMarineBaseBuildable
//{
//public:
// AvHMedLab();
//};
//
//class AvHNukePlant : public AvHMarineBaseBuildable
//{
//public:
// AvHNukePlant();
//};
#endif

View file

@ -1,247 +1,247 @@
//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHMarineWeapon.cpp $
// $Date: 2002/11/22 21:28:16 $
//
//-------------------------------------------------------------------------------
// $Log: AvHMarineWeapon.cpp,v $
// Revision 1.4 2002/11/22 21:28:16 Flayra
// - mp_consistency changes
//
// Revision 1.3 2002/10/03 18:58:15 Flayra
// - Added heavy view models
//
// Revision 1.2 2002/06/25 17:50:59 Flayra
// - Reworking for correct player animations and new enable/disable state, new view model artwork, alien weapon refactoring
//
// Revision 1.1 2002/05/23 02:33:42 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#include "mod/AvHMarineWeapon.h"
#include "mod/AvHMarineWeaponConstants.h"
#include "mod/AvHSpecials.h"
#include "util/Balance.h"
bool AvHMarineWeapon::GetAllowedForUser3(AvHUser3 inUser3)
{
bool theAllowed = false;
// Alien weapons for aliens. Don't take into account exact roles until needed (and until weapons have stabilized)
switch(inUser3)
{
case AVH_USER3_MARINE_PLAYER:
theAllowed = true;
break;
}
return theAllowed;
}
float AvHMarineWeapon::GetDeploySoundVolume() const
{
return kDeployMarineWeaponVolume;
}
char* AvHMarineWeapon::GetHeavyViewModel() const
{
return NULL;
}
float AvHMarineWeapon::ComputeAttackInterval() const
{
float theROF = this->GetRateOfFire();
int theUser4 = this->m_pPlayer->pev->iuser4;
// Speed attack if in range of primal scream
if(GetHasUpgrade(theUser4, MASK_BUFFED))
{
float theCatalystROFFactor = 1.0f + BALANCE_VAR(kCatalystROFFactor);
theROF /= theCatalystROFFactor;
}
return theROF;
}
char* AvHMarineWeapon::GetActiveViewModel() const
{
char* theViewModel = this->GetViewModel();
// If we're a marine with heavy armor, use the heavy view model
if(this->m_pPlayer && (this->m_pPlayer->pev->iuser3 == AVH_USER3_MARINE_PLAYER || this->m_pPlayer->pev->iuser3 == AVH_USER3_COMMANDER_PLAYER) && (GetHasUpgrade(this->m_pPlayer->pev->iuser4, MASK_UPGRADE_13)))
{
char* theHeavyViewModel = this->GetHeavyViewModel();
if(theHeavyViewModel)
{
theViewModel = theHeavyViewModel;
}
}
return theViewModel;
}
void AvHMarineWeapon::Precache()
{
AvHBasePlayerWeapon::Precache();
char* theHeavyViewModel = this->GetHeavyViewModel();
if(theHeavyViewModel)
{
PRECACHE_UNMODIFIED_MODEL(theHeavyViewModel);
}
}
// AvHReloadableMarineWeapon
const int kSpecialReloadNone = 0;
const int kSpecialReloadGotoReload = 1;
const int kSpecialReloadReloadShell = 2;
void AvHReloadableMarineWeapon::DeductCostForShot(void)
{
AvHMarineWeapon::DeductCostForShot();
// Stop reload if we were in the middle of one
if(this->mSpecialReload != kSpecialReloadNone)
{
this->mSpecialReload = kSpecialReloadNone;
}
}
int AvHReloadableMarineWeapon::DefaultReload( int iClipSize, int iAnim, float fDelay )
{
// Needed to prevet super fast default reload
return FALSE;
}
void AvHReloadableMarineWeapon::Holster( int skiplocal)
{
AvHMarineWeapon::Holster(skiplocal);
// Cancel any reload in progress.
this->mSpecialReload = kSpecialReloadNone;
}
void AvHReloadableMarineWeapon::Init()
{
this->mSpecialReload = kSpecialReloadNone;
this->mNextReload = 0;
}
void AvHReloadableMarineWeapon::Reload(void)
{
int theReloadAnimation = this->GetReloadAnimation();
float theReloadTime = this->GetReloadTime();
int theClipSize = this->GetClipSize();
if((this->m_pPlayer->m_rgAmmo[this->m_iPrimaryAmmoType] > 0) && (m_iClip < theClipSize))
{
// don't reload until recoil is done
if(this->m_flNextPrimaryAttack <= UTIL_WeaponTimeBase())
{
if(this->mSpecialReload == kSpecialReloadNone)
{
// Start reload
this->mSpecialReload = kSpecialReloadGotoReload;
this->SendWeaponAnim(this->GetGotoReloadAnimation());
float theGotoReloadAnimationTime = this->GetGotoReloadAnimationTime();
this->m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime;
this->m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime;
this->m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime; // 1.0f
this->m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime; // 1.0f
this->m_pPlayer->SetAnimation(PLAYER_RELOAD_START);
}
else if(this->mSpecialReload == kSpecialReloadGotoReload)
{
if (m_flTimeWeaponIdle <= UTIL_WeaponTimeBase())
{
// was waiting for gun to move to side
this->mSpecialReload = kSpecialReloadReloadShell;
this->SendWeaponAnim(this->GetShellReloadAnimation());
float theShellReloadTime = this->GetShellReloadAnimationTime();
this->mNextReload = UTIL_WeaponTimeBase() + theShellReloadTime;
this->m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + theShellReloadTime;
this->m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + theShellReloadTime;
this->m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + theShellReloadTime;
this->m_pPlayer->SetAnimation(PLAYER_RELOAD_INSERT);
}
}
else if(this->mSpecialReload == kSpecialReloadReloadShell)
{
//DefaultReload(theClipSize, theReloadAnimation, theReloadTime);
// Don't idle for a bit
//this->SetNextIdle();
// Add them to the clip
this->m_iClip += 1;
this->m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] -= 1;
this->mSpecialReload = kSpecialReloadGotoReload;
this->m_pPlayer->SetAnimation(PLAYER_RELOAD_END);
}
}
}
}
void AvHReloadableMarineWeapon::WeaponIdle(void)
{
// tankefugl: 0000484 - ensures that all idle weapons can fire the empty sound
ResetEmptySound();
if(this->m_flTimeWeaponIdle < UTIL_WeaponTimeBase())
{
if((this->m_iClip == 0) && (this->mSpecialReload == kSpecialReloadNone) && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
{
this->Reload();
}
else if(this->mSpecialReload != kSpecialReloadNone)
{
if((m_iClip != this->GetClipSize()) && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
{
this->Reload();
}
else
{
// reload debounce has timed out
this->mSpecialReload = kSpecialReloadNone;
this->SendWeaponAnim(this->GetEndReloadAnimation());
float theEndReloadAnimationTime = this->GetEndReloadAnimationTime();
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + theEndReloadAnimationTime;
}
}
else
{
// Hack to prevent idle animation from playing mid-reload. Not sure how to fix this right, but all this special reloading is happening server-side, client doesn't know about it
if(m_iClip == this->GetClipSize())
{
AvHMarineWeapon::WeaponIdle();
}
}
}
}
//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHMarineWeapon.cpp $
// $Date: 2002/11/22 21:28:16 $
//
//-------------------------------------------------------------------------------
// $Log: AvHMarineWeapon.cpp,v $
// Revision 1.4 2002/11/22 21:28:16 Flayra
// - mp_consistency changes
//
// Revision 1.3 2002/10/03 18:58:15 Flayra
// - Added heavy view models
//
// Revision 1.2 2002/06/25 17:50:59 Flayra
// - Reworking for correct player animations and new enable/disable state, new view model artwork, alien weapon refactoring
//
// Revision 1.1 2002/05/23 02:33:42 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#include "mod/AvHMarineWeapon.h"
#include "mod/AvHMarineWeaponConstants.h"
#include "mod/AvHSpecials.h"
#include "util/Balance.h"
bool AvHMarineWeapon::GetAllowedForUser3(AvHUser3 inUser3)
{
bool theAllowed = false;
// Alien weapons for aliens. Don't take into account exact roles until needed (and until weapons have stabilized)
switch(inUser3)
{
case AVH_USER3_MARINE_PLAYER:
theAllowed = true;
break;
}
return theAllowed;
}
float AvHMarineWeapon::GetDeploySoundVolume() const
{
return kDeployMarineWeaponVolume;
}
char* AvHMarineWeapon::GetHeavyViewModel() const
{
return NULL;
}
float AvHMarineWeapon::ComputeAttackInterval() const
{
float theROF = this->GetRateOfFire();
int theUser4 = this->m_pPlayer->pev->iuser4;
// Speed attack if in range of primal scream
if(GetHasUpgrade(theUser4, MASK_BUFFED))
{
float theCatalystROFFactor = 1.0f + BALANCE_VAR(kCatalystROFFactor);
theROF /= theCatalystROFFactor;
}
return theROF;
}
char* AvHMarineWeapon::GetActiveViewModel() const
{
char* theViewModel = this->GetViewModel();
// If we're a marine with heavy armor, use the heavy view model
if(this->m_pPlayer && (this->m_pPlayer->pev->iuser3 == AVH_USER3_MARINE_PLAYER || this->m_pPlayer->pev->iuser3 == AVH_USER3_COMMANDER_PLAYER) && (GetHasUpgrade(this->m_pPlayer->pev->iuser4, MASK_UPGRADE_13)))
{
char* theHeavyViewModel = this->GetHeavyViewModel();
if(theHeavyViewModel)
{
theViewModel = theHeavyViewModel;
}
}
return theViewModel;
}
void AvHMarineWeapon::Precache()
{
AvHBasePlayerWeapon::Precache();
char* theHeavyViewModel = this->GetHeavyViewModel();
if(theHeavyViewModel)
{
PRECACHE_UNMODIFIED_MODEL(theHeavyViewModel);
}
}
// AvHReloadableMarineWeapon
const int kSpecialReloadNone = 0;
const int kSpecialReloadGotoReload = 1;
const int kSpecialReloadReloadShell = 2;
void AvHReloadableMarineWeapon::DeductCostForShot(void)
{
AvHMarineWeapon::DeductCostForShot();
// Stop reload if we were in the middle of one
if(this->mSpecialReload != kSpecialReloadNone)
{
this->mSpecialReload = kSpecialReloadNone;
}
}
int AvHReloadableMarineWeapon::DefaultReload( int iClipSize, int iAnim, float fDelay )
{
// Needed to prevet super fast default reload
return FALSE;
}
void AvHReloadableMarineWeapon::Holster( int skiplocal)
{
AvHMarineWeapon::Holster(skiplocal);
// Cancel any reload in progress.
this->mSpecialReload = kSpecialReloadNone;
}
void AvHReloadableMarineWeapon::Init()
{
this->mSpecialReload = kSpecialReloadNone;
this->mNextReload = 0;
}
void AvHReloadableMarineWeapon::Reload(void)
{
int theReloadAnimation = this->GetReloadAnimation();
float theReloadTime = this->GetReloadTime();
int theClipSize = this->GetClipSize();
if((this->m_pPlayer->m_rgAmmo[this->m_iPrimaryAmmoType] > 0) && (m_iClip < theClipSize))
{
// don't reload until recoil is done
if(this->m_flNextPrimaryAttack <= UTIL_WeaponTimeBase())
{
if(this->mSpecialReload == kSpecialReloadNone)
{
// Start reload
this->mSpecialReload = kSpecialReloadGotoReload;
this->SendWeaponAnim(this->GetGotoReloadAnimation());
float theGotoReloadAnimationTime = this->GetGotoReloadAnimationTime();
this->m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime;
this->m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime;
this->m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime; // 1.0f
this->m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + theGotoReloadAnimationTime; // 1.0f
this->m_pPlayer->SetAnimation(PLAYER_RELOAD_START);
}
else if(this->mSpecialReload == kSpecialReloadGotoReload)
{
if (m_flTimeWeaponIdle <= UTIL_WeaponTimeBase())
{
// was waiting for gun to move to side
this->mSpecialReload = kSpecialReloadReloadShell;
this->SendWeaponAnim(this->GetShellReloadAnimation());
float theShellReloadTime = this->GetShellReloadAnimationTime();
this->mNextReload = UTIL_WeaponTimeBase() + theShellReloadTime;
this->m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + theShellReloadTime;
this->m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + theShellReloadTime;
this->m_flNextSecondaryAttack = UTIL_WeaponTimeBase() + theShellReloadTime;
this->m_pPlayer->SetAnimation(PLAYER_RELOAD_INSERT);
}
}
else if(this->mSpecialReload == kSpecialReloadReloadShell)
{
//DefaultReload(theClipSize, theReloadAnimation, theReloadTime);
// Don't idle for a bit
//this->SetNextIdle();
// Add them to the clip
this->m_iClip += 1;
this->m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] -= 1;
this->mSpecialReload = kSpecialReloadGotoReload;
this->m_pPlayer->SetAnimation(PLAYER_RELOAD_END);
}
}
}
}
void AvHReloadableMarineWeapon::WeaponIdle(void)
{
// : 0000484 - ensures that all idle weapons can fire the empty sound
ResetEmptySound();
if(this->m_flTimeWeaponIdle < UTIL_WeaponTimeBase())
{
if((this->m_iClip == 0) && (this->mSpecialReload == kSpecialReloadNone) && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
{
this->Reload();
}
else if(this->mSpecialReload != kSpecialReloadNone)
{
if((m_iClip != this->GetClipSize()) && m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType])
{
this->Reload();
}
else
{
// reload debounce has timed out
this->mSpecialReload = kSpecialReloadNone;
this->SendWeaponAnim(this->GetEndReloadAnimation());
float theEndReloadAnimationTime = this->GetEndReloadAnimationTime();
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + theEndReloadAnimationTime;
}
}
else
{
// Hack to prevent idle animation from playing mid-reload. Not sure how to fix this right, but all this special reloading is happening server-side, client doesn't know about it
if(m_iClip == this->GetClipSize())
{
AvHMarineWeapon::WeaponIdle();
}
}
}
}

View file

@ -152,7 +152,7 @@ const int kHGBarrelLength = 10;
#define kHGSpread VECTOR_CONE_1DEGREES
// Sonic/Shot gun constants.
const int kSGRange = 8192;
const int kSGRange = 700;
const float kSGXPunch = .8f;
#define kSGEjectModel "models/shotshell.mdl"
#define kSGEventName "events/SonicGun.sc"
@ -169,7 +169,8 @@ const float kSGXPunch = .8f;
#define kSGDeploySound "weapons/sg-deploy.wav"
const int kSGBarrelLength = 25;
#define kSGSpread VECTOR_CONE_20DEGREES
#define kSGInnerSpread VECTOR_CONE_7DEGREES
#define kSGMidSpread VECTOR_CONE_8DEGREES
#define kSGInnerSpread VECTOR_CONE_3DEGREES
// Heavy machine gun
const int kHMGRange = 6000;

View file

@ -1,353 +1,355 @@
//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose: This is the weapon that marines use to deploy mines (not the mines themselves)
//
// $Workfile: AvHMine.cpp $
// $Date: 2002/10/25 21:48:21 $
//
//-------------------------------------------------------------------------------
// $Log: AvHMine.cpp,v $
// Revision 1.10 2002/10/25 21:48:21 Flayra
// - Fixe for wrong player model when holding mines
//
// Revision 1.9 2002/10/16 20:53:09 Flayra
// - Removed weapon upgrade sounds
//
// Revision 1.8 2002/10/16 01:01:58 Flayra
// - Fixed mines being resupplied from armory
//
// Revision 1.7 2002/10/03 18:46:17 Flayra
// - Added heavy view model
//
// Revision 1.6 2002/07/24 19:09:17 Flayra
// - Linux issues
//
// Revision 1.5 2002/07/24 18:55:52 Flayra
// - Linux case sensitivity stuff
//
// Revision 1.4 2002/07/24 18:45:42 Flayra
// - Linux and scripting changes
//
// Revision 1.3 2002/06/25 17:47:14 Flayra
// - Fixed mine, refactored for new disabled/enabled state
//
// Revision 1.2 2002/06/03 16:37:31 Flayra
// - Constants and tweaks to make weapon anims and times correct with new artwork, added different deploy times (this should be refactored a bit more)
//
// Revision 1.1 2002/05/23 02:33:42 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#include "mod/AvHMarineWeapons.h"
#include "mod/AvHPlayer.h"
#ifdef AVH_CLIENT
#include "cl_dll/eventscripts.h"
#include "cl_dll/in_defs.h"
#include "cl_dll/wrect.h"
#include "cl_dll/cl_dll.h"
#endif
#include "common/hldm.h"
#include "common/event_api.h"
#include "common/event_args.h"
#include "common/vector_util.h"
#include "mod/AvHMarineWeapons.h"
#include "mod/AvHMarineEquipmentConstants.h"
#ifdef AVH_SERVER
#include "mod/AvHGamerules.h"
#include "mod/AvHMarineEquipment.h"
#include "mod/AvHSharedUtil.h"
#include "mod/AvHServerUtil.h"
#endif
LINK_ENTITY_TO_CLASS(kwMine, AvHMine);
void AvHMine::DeductCostForShot(void)
{
AvHBasePlayerWeapon::DeductCostForShot();
//this->m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;
//if(this->m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
if(!this->m_iClip)
{
// no more mines!
RetireWeapon();
}
}
bool AvHMine::GetCanBeResupplied() const
{
return false;
}
int AvHMine::GetDeployAnimation() const
{
return 2;
}
char* AvHMine::GetHeavyViewModel() const
{
return kTripmineHVVModel;
}
char* AvHMine::GetPlayerModel() const
{
return kTripminePModel;
}
char* AvHMine::GetWorldModel() const
{
return kTripmineWModel;
}
char* AvHMine::GetViewModel() const
{
return kTripmineVModel;
}
int AvHMine::GetShootAnimation() const
{
// Return deploy animation for now, this should play fire animation, then a little later, play the deploy animation
return 2;
}
void AvHMine::Holster(int skiplocal)
{
if(!this->m_iClip)
{
// Out of mines
SetThink(&AvHMine::DestroyItem);
this->pev->nextthink = gpGlobals->time + 0.1;
}
AvHMarineWeapon::Holster(skiplocal);
}
void AvHMine::Init()
{
this->mRange = kMineRange;
this->mDamage = 0; // What to do here? Is it taking damage from CGrenade?
}
bool AvHMine::ProcessValidAttack(void)
{
bool theSuccess = AvHMarineWeapon::ProcessValidAttack();
// This test is not necessary since the new collision code makes it so
// that interpenetrating objects are not a problem.
/*
if(theSuccess)
{
#ifdef AVH_SERVER
theSuccess = false;
Vector theDropLocation;
Vector theDropAngles;
if(this->GetDropLocation(theDropLocation, &theDropAngles))
{
Vector theMineMinSize = Vector (kMineMinSize);
Vector theMineMaxSize = Vector (kMineMaxSize);
// TODO: Rotate extents by theDropAngles, to test bounding box extents as the mine would be placed
if(AvHSHUGetIsAreaFree(theDropLocation, theMineMinSize, theMineMaxSize))
{
theSuccess = true;
}
}
#endif
}
*/
#ifdef AVH_SERVER
if(theSuccess)
{
Vector theMineOrigin;
Vector theMineAngles;
theSuccess = this->GetDropLocation(theMineOrigin, &theMineAngles);
}
#endif
return theSuccess;
}
#ifdef AVH_SERVER
bool AvHMine::GetDropLocation(Vector& outLocation, Vector* outAngles) const
{
bool theSuccess = false;
UTIL_MakeVectors( m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle );
Vector vecSrc = m_pPlayer->GetGunPosition( );
Vector vecAiming = gpGlobals->v_forward;
TraceResult tr;
UTIL_TraceLine( vecSrc, vecSrc + vecAiming*this->mRange, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr );
if (tr.flFraction < 1.0)
{
CBaseEntity* theEntity = CBaseEntity::Instance( tr.pHit );
// puzl: 981
// Mines can't be planted on players or buildings
if (!dynamic_cast<AvHDeployedMine*>(theEntity) && !dynamic_cast<AvHPlayer *>(theEntity) && !dynamic_cast<AvHBaseBuildable *>(theEntity))
{
int kOffset = 8;
Vector thePotentialOrigin = tr.vecEndPos + tr.vecPlaneNormal * kOffset;
BaseEntityListType theEntityList;
theEntityList.push_back(theEntity);
// Make sure there isn't an entity nearby that this would block
theEntity = NULL;
const int kMineSearchRadius = 15;
while((theEntity = UTIL_FindEntityInSphere(theEntity, thePotentialOrigin, kMineSearchRadius)) != NULL)
{
theEntityList.push_back(theEntity);
}
// For the mine placement to be valid, the entity it hit, and all the entities nearby must be valid and non-blocking
theSuccess = true;
for(BaseEntityListType::iterator theIter = theEntityList.begin(); theIter != theEntityList.end(); theIter++)
{
// puzl: 225 make sure there are no mines within kMineSearchRadius of each other ( 15 units )
CBaseEntity* theCurrentEntity = *theIter;
if(!theCurrentEntity || (theCurrentEntity->pev->flags & FL_CONVEYOR) || AvHSUGetIsExternalClassName(STRING(theCurrentEntity->pev->classname)) || dynamic_cast<CBaseDoor*>(theCurrentEntity) || dynamic_cast<CRotDoor*>(theCurrentEntity)
|| dynamic_cast<AvHDeployedMine*>(theCurrentEntity) )
{
theSuccess = false;
break;
}
}
if(theSuccess)
{
VectorCopy(thePotentialOrigin, outLocation);
if(outAngles)
{
VectorCopy(UTIL_VecToAngles( tr.vecPlaneNormal ), *outAngles)
}
}
}
}
return theSuccess;
}
#endif
void AvHMine::FireProjectiles(void)
{
#ifdef AVH_SERVER
Vector theMineOrigin;
Vector theMineAngles;
if(this->GetDropLocation(theMineOrigin, &theMineAngles))
{
GetGameRules()->MarkDramaticEvent(kMinePlacePriority, this->m_pPlayer);
AvHDeployedMine* theMine = dynamic_cast<AvHDeployedMine*>(CBaseEntity::Create( kwsDeployedMine, theMineOrigin, theMineAngles, m_pPlayer->edict() ));
ASSERT(theMine);
// Set the team so it doesn't blow us up, remember the owner so proper credit can be given
theMine->pev->team = m_pPlayer->pev->team;
//theMine->pev->owner = m_pPlayer->edict();
theMine->SetPlacer(this->m_pPlayer->pev);
// Set it as a marine item so it gets damage upgrades
// Set any team-wide upgrades
AvHTeam* theTeam = GetGameRules()->GetTeam(AvHTeamNumber(m_pPlayer->pev->team));
ASSERT(theTeam);
theMine->pev->iuser4 |= theTeam->GetTeamWideUpgrades();
}
#endif
}
int AvHMine::GetBarrelLength() const
{
return kMineBarrellLength;
}
float AvHMine::GetRateOfFire() const
{
return kMineROF;
}
bool AvHMine::GetFiresUnderwater() const
{
return true;
}
BOOL AvHMine::PlayEmptySound()
{
// None
return 0;
}
void AvHMine::Precache()
{
AvHMarineWeapon::Precache();
UTIL_PrecacheOther(kwsDeployedMine);
this->mEvent = PRECACHE_EVENT(1, kWeaponAnimationEvent);
}
bool AvHMine::Resupply()
{
return false;
}
void AvHMine::Spawn()
{
this->Precache();
AvHMarineWeapon::Spawn();
this->m_iId = AVH_WEAPON_MINE;
// Set our class name
this->pev->classname = MAKE_STRING(kwsMine);
SET_MODEL(ENT(pev), kTripmineW2Model);
FallInit();// get ready to fall down.
int theNumMines = BALANCE_VAR(kMineMaxAmmo);
#ifdef AVH_SERVER
if(GetGameRules()->GetIsCombatMode())
{
theNumMines = BALANCE_VAR(kMineMaxAmmoCombat);
}
#endif
this->m_iDefaultAmmo = theNumMines;
}
bool AvHMine::UsesAmmo(void) const
{
return true;
}
BOOL AvHMine::UseDecrement(void)
{
return true;
}
//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose: This is the weapon that marines use to deploy mines (not the mines themselves)
//
// $Workfile: AvHMine.cpp $
// $Date: 2002/10/25 21:48:21 $
//
//-------------------------------------------------------------------------------
// $Log: AvHMine.cpp,v $
// Revision 1.10 2002/10/25 21:48:21 Flayra
// - Fixe for wrong player model when holding mines
//
// Revision 1.9 2002/10/16 20:53:09 Flayra
// - Removed weapon upgrade sounds
//
// Revision 1.8 2002/10/16 01:01:58 Flayra
// - Fixed mines being resupplied from armory
//
// Revision 1.7 2002/10/03 18:46:17 Flayra
// - Added heavy view model
//
// Revision 1.6 2002/07/24 19:09:17 Flayra
// - Linux issues
//
// Revision 1.5 2002/07/24 18:55:52 Flayra
// - Linux case sensitivity stuff
//
// Revision 1.4 2002/07/24 18:45:42 Flayra
// - Linux and scripting changes
//
// Revision 1.3 2002/06/25 17:47:14 Flayra
// - Fixed mine, refactored for new disabled/enabled state
//
// Revision 1.2 2002/06/03 16:37:31 Flayra
// - Constants and tweaks to make weapon anims and times correct with new artwork, added different deploy times (this should be refactored a bit more)
//
// Revision 1.1 2002/05/23 02:33:42 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#include "mod/AvHMarineWeapons.h"
#include "mod/AvHPlayer.h"
#ifdef AVH_CLIENT
#include "cl_dll/eventscripts.h"
#include "cl_dll/in_defs.h"
#include "cl_dll/wrect.h"
#include "cl_dll/cl_dll.h"
#endif
#include "common/hldm.h"
#include "common/event_api.h"
#include "common/event_args.h"
#include "common/vector_util.h"
#include "mod/AvHMarineWeapons.h"
#include "mod/AvHMarineEquipmentConstants.h"
#ifdef AVH_SERVER
#include "mod/AvHGamerules.h"
#include "mod/AvHMarineEquipment.h"
#include "mod/AvHSharedUtil.h"
#include "mod/AvHServerUtil.h"
#endif
LINK_ENTITY_TO_CLASS(kwMine, AvHMine);
void AvHMine::DeductCostForShot(void)
{
AvHBasePlayerWeapon::DeductCostForShot();
//this->m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;
//if(this->m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] <= 0)
if(!this->m_iClip)
{
if ( this->m_pPlayer )
this->m_pPlayer->EffectivePlayerClassChanged();
// no more mines!
RetireWeapon();
}
}
bool AvHMine::GetCanBeResupplied() const
{
return false;
}
int AvHMine::GetDeployAnimation() const
{
return 2;
}
char* AvHMine::GetHeavyViewModel() const
{
return kTripmineHVVModel;
}
char* AvHMine::GetPlayerModel() const
{
return kTripminePModel;
}
char* AvHMine::GetWorldModel() const
{
return kTripmineWModel;
}
char* AvHMine::GetViewModel() const
{
return kTripmineVModel;
}
int AvHMine::GetShootAnimation() const
{
// Return deploy animation for now, this should play fire animation, then a little later, play the deploy animation
return 2;
}
void AvHMine::Holster(int skiplocal)
{
if(!this->m_iClip)
{
// Out of mines
SetThink(&AvHMine::DestroyItem);
this->pev->nextthink = gpGlobals->time + 0.1;
}
AvHMarineWeapon::Holster(skiplocal);
}
void AvHMine::Init()
{
this->mRange = kMineRange;
this->mDamage = 0; // What to do here? Is it taking damage from CGrenade?
}
bool AvHMine::ProcessValidAttack(void)
{
bool theSuccess = AvHMarineWeapon::ProcessValidAttack();
// This test is not necessary since the new collision code makes it so
// that interpenetrating objects are not a problem.
/*
if(theSuccess)
{
#ifdef AVH_SERVER
theSuccess = false;
Vector theDropLocation;
Vector theDropAngles;
if(this->GetDropLocation(theDropLocation, &theDropAngles))
{
Vector theMineMinSize = Vector (kMineMinSize);
Vector theMineMaxSize = Vector (kMineMaxSize);
// TODO: Rotate extents by theDropAngles, to test bounding box extents as the mine would be placed
if(AvHSHUGetIsAreaFree(theDropLocation, theMineMinSize, theMineMaxSize))
{
theSuccess = true;
}
}
#endif
}
*/
#ifdef AVH_SERVER
if(theSuccess)
{
Vector theMineOrigin;
Vector theMineAngles;
theSuccess = this->GetDropLocation(theMineOrigin, &theMineAngles);
}
#endif
return theSuccess;
}
#ifdef AVH_SERVER
bool AvHMine::GetDropLocation(Vector& outLocation, Vector* outAngles) const
{
bool theSuccess = false;
UTIL_MakeVectors( m_pPlayer->pev->v_angle + m_pPlayer->pev->punchangle );
Vector vecSrc = m_pPlayer->GetGunPosition( );
Vector vecAiming = gpGlobals->v_forward;
TraceResult tr;
UTIL_TraceLine( vecSrc, vecSrc + vecAiming*this->mRange, dont_ignore_monsters, ENT( m_pPlayer->pev ), &tr );
if (tr.flFraction < 1.0)
{
CBaseEntity* theEntity = CBaseEntity::Instance( tr.pHit );
// : 981
// Mines can't be planted on players or buildings
if (!dynamic_cast<AvHDeployedMine*>(theEntity) && !dynamic_cast<AvHPlayer *>(theEntity) && !dynamic_cast<AvHBaseBuildable *>(theEntity))
{
int kOffset = 8;
Vector thePotentialOrigin = tr.vecEndPos + tr.vecPlaneNormal * kOffset;
BaseEntityListType theEntityList;
theEntityList.push_back(theEntity);
// Make sure there isn't an entity nearby that this would block
theEntity = NULL;
const int kMineSearchRadius = 15;
while((theEntity = UTIL_FindEntityInSphere(theEntity, thePotentialOrigin, kMineSearchRadius)) != NULL)
{
theEntityList.push_back(theEntity);
}
// For the mine placement to be valid, the entity it hit, and all the entities nearby must be valid and non-blocking
theSuccess = true;
for(BaseEntityListType::iterator theIter = theEntityList.begin(); theIter != theEntityList.end(); theIter++)
{
// : 225 make sure there are no mines within kMineSearchRadius of each other ( 15 units )
CBaseEntity* theCurrentEntity = *theIter;
if(!theCurrentEntity || (theCurrentEntity->pev->flags & FL_CONVEYOR) || AvHSUGetIsExternalClassName(STRING(theCurrentEntity->pev->classname)) || dynamic_cast<CBaseDoor*>(theCurrentEntity) || dynamic_cast<CRotDoor*>(theCurrentEntity)
|| dynamic_cast<AvHDeployedMine*>(theCurrentEntity) )
{
theSuccess = false;
break;
}
}
if(theSuccess)
{
VectorCopy(thePotentialOrigin, outLocation);
if(outAngles)
{
VectorCopy(UTIL_VecToAngles( tr.vecPlaneNormal ), *outAngles)
}
}
}
}
return theSuccess;
}
#endif
void AvHMine::FireProjectiles(void)
{
#ifdef AVH_SERVER
Vector theMineOrigin;
Vector theMineAngles;
if(this->GetDropLocation(theMineOrigin, &theMineAngles))
{
GetGameRules()->MarkDramaticEvent(kMinePlacePriority, this->m_pPlayer);
AvHDeployedMine* theMine = dynamic_cast<AvHDeployedMine*>(CBaseEntity::Create( kwsDeployedMine, theMineOrigin, theMineAngles, m_pPlayer->edict() ));
ASSERT(theMine);
// Set the team so it doesn't blow us up, remember the owner so proper credit can be given
theMine->pev->team = m_pPlayer->pev->team;
//theMine->pev->owner = m_pPlayer->edict();
theMine->SetPlacer(this->m_pPlayer->pev);
// Set it as a marine item so it gets damage upgrades
// Set any team-wide upgrades
AvHTeam* theTeam = GetGameRules()->GetTeam(AvHTeamNumber(m_pPlayer->pev->team));
ASSERT(theTeam);
theMine->pev->iuser4 |= theTeam->GetTeamWideUpgrades();
}
#endif
}
int AvHMine::GetBarrelLength() const
{
return kMineBarrellLength;
}
float AvHMine::GetRateOfFire() const
{
return kMineROF;
}
bool AvHMine::GetFiresUnderwater() const
{
return true;
}
BOOL AvHMine::PlayEmptySound()
{
// None
return 0;
}
void AvHMine::Precache()
{
AvHMarineWeapon::Precache();
UTIL_PrecacheOther(kwsDeployedMine);
this->mEvent = PRECACHE_EVENT(1, kWeaponAnimationEvent);
}
bool AvHMine::Resupply()
{
return false;
}
void AvHMine::Spawn()
{
this->Precache();
AvHMarineWeapon::Spawn();
this->m_iId = AVH_WEAPON_MINE;
// Set our class name
this->pev->classname = MAKE_STRING(kwsMine);
SET_MODEL(ENT(pev), kTripmineW2Model);
FallInit();// get ready to fall down.
int theNumMines = BALANCE_VAR(kMineMaxAmmo);
#ifdef AVH_SERVER
if(GetGameRules()->GetIsCombatMode())
{
theNumMines = BALANCE_VAR(kMineMaxAmmoCombat);
}
#endif
this->m_iDefaultAmmo = theNumMines;
}
bool AvHMine::UsesAmmo(void) const
{
return true;
}
BOOL AvHMine::UseDecrement(void)
{
return true;
}

File diff suppressed because it is too large Load diff

View file

@ -1,91 +1,91 @@
#ifndef AVH_MINIMAP_H
#define AVH_MINIMAP_H
#include "types.h"
#ifdef AVH_CLIENT
#include "cl_dll/hud.h"
#endif
#include "mod/AvHMapExtents.h"
const int kSpriteWidth = 512;
const int kSpriteHeight = 512;
const int kSpriteDataPixels = kSpriteWidth*kSpriteHeight;
class AvHPlayer;
class AvHMiniMap
{
public:
AvHMiniMap();
virtual ~AvHMiniMap();
bool GetIsProcessing(float* outPercentageDone = NULL) const;
#ifdef AVH_SERVER
void BuildMiniMap(const char* inMapName, AvHPlayer* inPlayer, const AvHMapExtents& inMapExtents);
bool Process();
#endif
#ifdef AVH_CLIENT
// puzl: 1064
// Allow the caller to specify the use of the labelled minimap
static string GetSpriteNameFromMap(int inSpriteWidth, const string& inMapName, int useLabels);
int ReceiveFromNetworkStream(void* const buffer, const int size);
bool WriteSpritesIfJustFinished();
#endif
private:
#ifdef AVH_CLIENT
void DrawEdges(uint8* inMap, int width, int height);
void InitializePalette();
bool WriteMapToSprite();
void WriteMapToSprite(FILE* inFileHandle);
#endif
uint8* mMap;
int mMapWidth;
int mMapHeight;
#ifdef AVH_SERVER
AvHPlayer* mPlayer;
#endif
#ifdef AVH_CLIENT
uint8 mPalette[256*3];
uint8 mSpriteData[kSpriteDataPixels];
uint8 mCommanderSpriteData[kSpriteDataPixels / 4];
#endif
float mMinX;
float mMinY;
float mMaxX;
float mMaxY;
float mMinViewHeight;
float mMaxViewHeight;
int mNumSamplesToProcess;
int mNumSamplesProcessed;
bool mIsProcessing;
string mMapName;
#ifdef AVH_CLIENT
// Sprite stuff
byte* byteimage;
byte* lbmpalette;
int byteimagewidth;
int byteimageheight;
byte* lumpbuffer;
byte* plump;
char spritedir[1024];
char spriteoutname[1024];
int framesmaxs[2];
int framecount;
#endif
};
#ifndef AVH_MINIMAP_H
#define AVH_MINIMAP_H
#include "types.h"
#ifdef AVH_CLIENT
#include "cl_dll/hud.h"
#endif
#include "mod/AvHMapExtents.h"
const int kSpriteWidth = 512;
const int kSpriteHeight = 512;
const int kSpriteDataPixels = kSpriteWidth*kSpriteHeight;
class AvHPlayer;
class AvHMiniMap
{
public:
AvHMiniMap();
virtual ~AvHMiniMap();
bool GetIsProcessing(float* outPercentageDone = NULL) const;
#ifdef AVH_SERVER
void BuildMiniMap(const char* inMapName, AvHPlayer* inPlayer, const AvHMapExtents& inMapExtents);
bool Process();
#endif
#ifdef AVH_CLIENT
// : 1064
// Allow the caller to specify the use of the labelled minimap
static string GetSpriteNameFromMap(int inSpriteWidth, const string& inMapName, int useLabels);
int ReceiveFromNetworkStream(void* const buffer, const int size);
bool WriteSpritesIfJustFinished();
#endif
private:
#ifdef AVH_CLIENT
void DrawEdges(uint8* inMap, int width, int height);
void InitializePalette();
bool WriteMapToSprite();
void WriteMapToSprite(FILE* inFileHandle);
#endif
uint8* mMap;
int mMapWidth;
int mMapHeight;
#ifdef AVH_SERVER
AvHPlayer* mPlayer;
#endif
#ifdef AVH_CLIENT
uint8 mPalette[256*3];
uint8 mSpriteData[kSpriteDataPixels];
uint8 mCommanderSpriteData[kSpriteDataPixels / 4];
#endif
float mMinX;
float mMinY;
float mMaxX;
float mMaxY;
float mMinViewHeight;
float mMaxViewHeight;
int mNumSamplesToProcess;
int mNumSamplesProcessed;
bool mIsProcessing;
string mMapName;
#ifdef AVH_CLIENT
// Sprite stuff
byte* byteimage;
byte* lbmpalette;
int byteimagewidth;
int byteimageheight;
byte* lumpbuffer;
byte* plump;
char spritedir[1024];
char spriteoutname[1024];
int framesmaxs[2];
int framecount;
#endif
};
#endif

View file

@ -1,364 +1,373 @@
//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHMovementUtil.cpp $
// $Date: 2002/10/24 21:34:02 $
//
//-------------------------------------------------------------------------------
// $Log: AvHMovementUtil.cpp,v $
// Revision 1.20 2002/10/24 21:34:02 Flayra
// - Less rockets
//
// Revision 1.19 2002/10/04 18:04:27 Flayra
// - Fixed floating gestation sacs
// - Aliens now fall all the way to ground during countdown (instead of floating and shaking)
//
// Revision 1.18 2002/10/03 18:59:04 Flayra
// - Refactored energy
//
// Revision 1.17 2002/09/09 20:00:10 Flayra
// - Balance changes
//
// Revision 1.16 2002/08/16 02:40:14 Flayra
// - Regular balance update
//
// Revision 1.15 2002/08/09 01:08:30 Flayra
// - Regular update
//
// Revision 1.14 2002/08/02 21:53:47 Flayra
// - Various energy tweaks, so melee attacks don't run out when attacking buildings as often, and so fliers can fly and bite/spike
//
// Revision 1.13 2002/07/23 17:14:45 Flayra
// - Energy updates
//
// Revision 1.12 2002/07/08 17:12:05 Flayra
// - Regular update
//
// Revision 1.11 2002/07/01 21:38:46 Flayra
// - Primal scream gives energy back faster, added energy usage for new weapons
//
// Revision 1.10 2002/06/25 18:08:40 Flayra
// - Energy costs tweaking, added new weapons, added charging
//
// Revision 1.9 2002/06/03 16:52:36 Flayra
// - Tweaked spike energy cost
//
// Revision 1.8 2002/05/28 17:54:45 Flayra
// - Tweaked costs for swipe and web
//
// Revision 1.7 2002/05/23 02:33:20 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#include "mod/AvHMovementUtil.h"
#include "mod/AvHSpecials.h"
#include "mod/AvHAlienWeaponConstants.h"
#include "mod/AvHMarineEquipmentConstants.h"
#include "mod/AvHHulls.h"
#include "mod/AvHConstants.h"
#include "util/Balance.h"
#include "types.h"
int AvHMUGetHull(bool inIsDucking, int inUserVar)
{
int theHull = 0;
// For marines and level 4
theHull = inIsDucking ? kHLCrouchHullIndex : kHLStandHullIndex;
// Set the hull for our special sized players
if(inUserVar == AVH_USER3_ALIEN_PLAYER1)
{
// Always use small hull, even when ducking
theHull = kHLCrouchHullIndex;
}
else if(inUserVar == AVH_USER3_ALIEN_PLAYER2)
{
theHull = kHLCrouchHullIndex;
}
else if(inUserVar == AVH_USER3_ALIEN_PLAYER3)
{
theHull = kHLCrouchHullIndex;
}
else if(inUserVar == AVH_USER3_ALIEN_EMBRYO)
{
theHull = kHLCrouchHullIndex;
}
else if(inUserVar == AVH_USER3_ALIEN_PLAYER5)
{
// Use human hull when ducking, largest otherwise
theHull = inIsDucking ? kHLStandHullIndex : kNSHugeHullIndex;
}
return theHull;
}
int AvHMUGetOriginOffsetForUser3(AvHUser3 inUser3)
{
int theOffset = 20;
if(inUser3 == AVH_USER3_ALIEN_PLAYER5)
{
theOffset = 40;
}
return theOffset;
}
int AvHMUGetOriginOffsetForMessageID(AvHMessageID inMessageID)
{
AvHUser3 theUser3 = AVH_USER3_NONE;
if(inMessageID == ALIEN_LIFEFORM_FIVE)
{
theUser3 = AVH_USER3_ALIEN_PLAYER5;
}
return AvHMUGetOriginOffsetForUser3(theUser3);
}
bool AvHMUGetCanDuck(int inUser3)
{
bool theCanDuck = true;
if((inUser3 == AVH_USER3_ALIEN_PLAYER1) || (inUser3 == AVH_USER3_ALIEN_PLAYER2) || (inUser3 == AVH_USER3_ALIEN_PLAYER3) || (inUser3 == AVH_USER3_ALIEN_EMBRYO) )
{
theCanDuck = false;
}
return theCanDuck;
}
bool AvHMUDeductAlienEnergy(float& ioFuser, float inNormAmount)
{
bool theSuccess = false;
if(AvHMUHasEnoughAlienEnergy(ioFuser, inNormAmount))
{
float theCurrentEnergy = ioFuser/kNormalizationNetworkFactor;
theCurrentEnergy -= inNormAmount;
theCurrentEnergy = max(theCurrentEnergy, 0.0f);
ioFuser = theCurrentEnergy*kNormalizationNetworkFactor;
theSuccess = true;
}
return theSuccess;
}
bool AvHMUGiveAlienEnergy(float& ioFuser, float inNormAmount)
{
bool theSuccess = false;
float theCurrentEnergy = ioFuser/kNormalizationNetworkFactor;
if(theCurrentEnergy < 1.0f)
{
theCurrentEnergy += inNormAmount;
theCurrentEnergy = min(max(theCurrentEnergy, 0.0f), 1.0f);
ioFuser = theCurrentEnergy*kNormalizationNetworkFactor;
theSuccess = true;
}
return theSuccess;
}
bool AvHMUGetEnergyCost(AvHWeaponID inWeaponID, float& outEnergyCost)
{
bool theSuccess = false;
float theCost = 0.0f;
switch(inWeaponID)
{
case AVH_WEAPON_CLAWS:
theCost = (float)BALANCE_VAR(kClawsEnergyCost);
break;
case AVH_WEAPON_SPIT:
theCost = (float)BALANCE_VAR(kSpitEnergyCost);
break;
case AVH_WEAPON_SPORES:
theCost = (float)BALANCE_VAR(kSporesEnergyCost);
break;
case AVH_WEAPON_SPIKE:
theCost = (float)BALANCE_VAR(kSpikeEnergyCost);
break;
case AVH_WEAPON_BITE:
theCost = (float)BALANCE_VAR(kBiteEnergyCost);
break;
case AVH_WEAPON_BITE2:
theCost = (float)BALANCE_VAR(kBite2EnergyCost);
break;
case AVH_WEAPON_SWIPE:
theCost = (float)BALANCE_VAR(kSwipeEnergyCost);
break;
case AVH_WEAPON_BLINK:
theCost = (float)BALANCE_VAR(kBlinkEnergyCost);
break;
case AVH_WEAPON_WEBSPINNER:
theCost = (float)BALANCE_VAR(kWebEnergyCost);
break;
case AVH_WEAPON_PARASITE:
theCost = (float)BALANCE_VAR(kParasiteEnergyCost);
break;
case AVH_WEAPON_DIVINEWIND:
theCost = (float)BALANCE_VAR(kDivineWindEnergyCost);
break;
case AVH_WEAPON_HEALINGSPRAY:
theCost = (float)BALANCE_VAR(kHealingSprayEnergyCost);
break;
case AVH_WEAPON_METABOLIZE:
theCost = (float)BALANCE_VAR(kMetabolizeEnergyCost);
break;
case AVH_WEAPON_UMBRA:
theCost = (float)BALANCE_VAR(kUmbraEnergyCost);
break;
case AVH_WEAPON_PRIMALSCREAM:
theCost = (float)BALANCE_VAR(kPrimalScreamEnergyCost);
break;
case AVH_WEAPON_BILEBOMB:
theCost = (float)BALANCE_VAR(kBileBombEnergyCost);
break;
case AVH_WEAPON_ACIDROCKET:
theCost = (float)BALANCE_VAR(kAcidRocketEnergyCost);
break;
case AVH_WEAPON_STOMP:
theCost = (float)BALANCE_VAR(kStompEnergyCost);
break;
case AVH_WEAPON_DEVOUR:
theCost = (float)BALANCE_VAR(kDevourEnergyCost);
break;
// Abilities
case AVH_ABILITY_LEAP:
theCost = (float)BALANCE_VAR(kLeapEnergyCost);
break;
case AVH_ABILITY_CHARGE:
theCost = (float)BALANCE_VAR(kChargeEnergyCost);
break;
}
outEnergyCost = theCost;
if(theCost > 0.0f)
{
theSuccess = true;
}
return theSuccess;
}
float AvHMUGetWalkSpeedFactor(AvHUser3 inUser3)
{
float theMoveSpeed = .1f;
switch(inUser3)
{
case AVH_USER3_MARINE_PLAYER:
theMoveSpeed = .095f;
break;
case AVH_USER3_ALIEN_PLAYER1:
//theMoveSpeed = .04f;
theMoveSpeed = .14f;
break;
case AVH_USER3_ALIEN_PLAYER2:
theMoveSpeed = .08f;
break;
case AVH_USER3_ALIEN_PLAYER3:
theMoveSpeed = .11f;
break;
case AVH_USER3_ALIEN_PLAYER4:
theMoveSpeed = .09f;
break;
case AVH_USER3_ALIEN_PLAYER5:
theMoveSpeed = .09f;
break;
}
return theMoveSpeed;
}
bool AvHMUHasEnoughAlienEnergy(float& ioFuser, float inNormAmount)
{
bool theSuccess = false;
float theCurrentEnergy = ioFuser/kNormalizationNetworkFactor;
if(theCurrentEnergy >= inNormAmount)
{
theSuccess = true;
}
return theSuccess;
}
void AvHMUUpdateAlienEnergy(float inTimePassed, int inUser3, int inUser4, float& ioFuser)
{
if( (inUser3 == AVH_USER3_ALIEN_PLAYER1) ||
(inUser3 == AVH_USER3_ALIEN_PLAYER2) ||
(inUser3 == AVH_USER3_ALIEN_PLAYER3) ||
(inUser3 == AVH_USER3_ALIEN_PLAYER4) ||
(inUser3 == AVH_USER3_ALIEN_PLAYER5))
{
if(!GetHasUpgrade(inUser4, MASK_PLAYER_STUNNED))
{
// Percentage (0-1) per second
float theAlienEnergyRate = (float)BALANCE_VAR(kAlienEnergyRate);
//float kFadeChargingDeplectionRate = -2.8f*kAlienEnergyRate;
float kChargingDepletionRate = -BALANCE_VAR(kChargingEnergyScalar)*theAlienEnergyRate;
const float kMultiplier = GetHasUpgrade(inUser4, MASK_BUFFED) ? (1.0f + BALANCE_VAR(kPrimalScreamEnergyFactor)) : 1.0f;
float theEnergyRate = theAlienEnergyRate*kMultiplier;
float theUpgradeFactor = 1.0f;
int theNumLevels = AvHGetAlienUpgradeLevel(inUser4, MASK_UPGRADE_5);
if(theNumLevels > 0)
{
theUpgradeFactor += theNumLevels*BALANCE_VAR(kAdrenalineEnergyPercentPerLevel);
}
float theCurrentEnergy = ioFuser/kNormalizationNetworkFactor;
float theNewEnergy = theCurrentEnergy + inTimePassed*theAlienEnergyRate*theUpgradeFactor;
// If we're charging, reduce energy
if(GetHasUpgrade(inUser4, MASK_ALIEN_MOVEMENT))
{
if(inUser3 == AVH_USER3_ALIEN_PLAYER4)
{
// theNewEnergy += inTimePassed*kFadeChargingDeplectionRate;
}
else
{
theNewEnergy += inTimePassed*kChargingDepletionRate;
}
}
theNewEnergy = min(max(theNewEnergy, 0.0f), 1.0f);
ioFuser = theNewEnergy*kNormalizationNetworkFactor;
}
}
}
void AvHMUUpdateJetpackEnergy(bool inIsJetpacking, float theTimePassed, float& ioJetpackEnergy)
{
if(inIsJetpacking)
{
ioJetpackEnergy -= theTimePassed*kJetpackEnergyLossRate;
}
else
{
ioJetpackEnergy += theTimePassed*kJetpackEnergyGainRate;
}
ioJetpackEnergy = min(1.0f, ioJetpackEnergy);
ioJetpackEnergy = max(0.0f, ioJetpackEnergy);
}
//======== (C) Copyright 2002 Charles G. Cleveland All rights reserved. =========
//
// The copyright to the contents herein is the property of Charles G. Cleveland.
// The contents may be used and/or copied only with the written permission of
// Charles G. Cleveland, or in accordance with the terms and conditions stipulated in
// the agreement/contract under which the contents have been supplied.
//
// Purpose:
//
// $Workfile: AvHMovementUtil.cpp $
// $Date: 2002/10/24 21:34:02 $
//
//-------------------------------------------------------------------------------
// $Log: AvHMovementUtil.cpp,v $
// Revision 1.20 2002/10/24 21:34:02 Flayra
// - Less rockets
//
// Revision 1.19 2002/10/04 18:04:27 Flayra
// - Fixed floating gestation sacs
// - Aliens now fall all the way to ground during countdown (instead of floating and shaking)
//
// Revision 1.18 2002/10/03 18:59:04 Flayra
// - Refactored energy
//
// Revision 1.17 2002/09/09 20:00:10 Flayra
// - Balance changes
//
// Revision 1.16 2002/08/16 02:40:14 Flayra
// - Regular balance update
//
// Revision 1.15 2002/08/09 01:08:30 Flayra
// - Regular update
//
// Revision 1.14 2002/08/02 21:53:47 Flayra
// - Various energy tweaks, so melee attacks don't run out when attacking buildings as often, and so fliers can fly and bite/spike
//
// Revision 1.13 2002/07/23 17:14:45 Flayra
// - Energy updates
//
// Revision 1.12 2002/07/08 17:12:05 Flayra
// - Regular update
//
// Revision 1.11 2002/07/01 21:38:46 Flayra
// - Primal scream gives energy back faster, added energy usage for new weapons
//
// Revision 1.10 2002/06/25 18:08:40 Flayra
// - Energy costs tweaking, added new weapons, added charging
//
// Revision 1.9 2002/06/03 16:52:36 Flayra
// - Tweaked spike energy cost
//
// Revision 1.8 2002/05/28 17:54:45 Flayra
// - Tweaked costs for swipe and web
//
// Revision 1.7 2002/05/23 02:33:20 Flayra
// - Post-crash checkin. Restored @Backup from around 4/16. Contains changes for last four weeks of development.
//
//===============================================================================
#include "mod/AvHMovementUtil.h"
#include "mod/AvHSpecials.h"
#include "mod/AvHAlienWeaponConstants.h"
#include "mod/AvHMarineEquipmentConstants.h"
#include "mod/AvHHulls.h"
#include "mod/AvHConstants.h"
#include "util/Balance.h"
#include "types.h"
int AvHMUGetHull(bool inIsDucking, int inUserVar)
{
int theHull = 0;
// For marines and level 4
theHull = inIsDucking ? kHLCrouchHullIndex : kHLStandHullIndex;
// Set the hull for our special sized players
if(inUserVar == AVH_USER3_ALIEN_PLAYER1)
{
// Always use small hull, even when ducking
theHull = kHLCrouchHullIndex;
}
else if(inUserVar == AVH_USER3_ALIEN_PLAYER2)
{
theHull = kHLCrouchHullIndex;
}
else if(inUserVar == AVH_USER3_ALIEN_PLAYER3)
{
theHull = kHLCrouchHullIndex;
}
else if(inUserVar == AVH_USER3_ALIEN_EMBRYO)
{
theHull = kHLCrouchHullIndex;
}
else if(inUserVar == AVH_USER3_ALIEN_PLAYER5)
{
// Use human hull when ducking, largest otherwise
theHull = inIsDucking ? kHLStandHullIndex : kNSHugeHullIndex;
}
return theHull;
}
int AvHMUGetOriginOffsetForUser3(AvHUser3 inUser3)
{
int theOffset = 20;
if(inUser3 == AVH_USER3_ALIEN_PLAYER5)
{
theOffset = 40;
}
return theOffset;
}
int AvHMUGetOriginOffsetForMessageID(AvHMessageID inMessageID)
{
AvHUser3 theUser3 = AVH_USER3_NONE;
if(inMessageID == ALIEN_LIFEFORM_FIVE)
{
theUser3 = AVH_USER3_ALIEN_PLAYER5;
}
return AvHMUGetOriginOffsetForUser3(theUser3);
}
bool AvHMUGetCanDuck(int inUser3)
{
bool theCanDuck = true;
if((inUser3 == AVH_USER3_ALIEN_PLAYER1) || (inUser3 == AVH_USER3_ALIEN_PLAYER2) || (inUser3 == AVH_USER3_ALIEN_PLAYER3) || (inUser3 == AVH_USER3_ALIEN_EMBRYO) )
{
theCanDuck = false;
}
return theCanDuck;
}
bool AvHMUDeductAlienEnergy(float& ioFuser, float inNormAmount)
{
bool theSuccess = false;
if(AvHMUHasEnoughAlienEnergy(ioFuser, inNormAmount))
{
float theCurrentEnergy = ioFuser/kNormalizationNetworkFactor;
theCurrentEnergy -= inNormAmount;
theCurrentEnergy = max(theCurrentEnergy, 0.0f);
ioFuser = theCurrentEnergy*kNormalizationNetworkFactor;
theSuccess = true;
}
return theSuccess;
}
bool AvHMUGiveAlienEnergy(float& ioFuser, float inNormAmount)
{
bool theSuccess = false;
float theCurrentEnergy = ioFuser/kNormalizationNetworkFactor;
if(theCurrentEnergy < 1.0f)
{
theCurrentEnergy += inNormAmount;
theCurrentEnergy = min(max(theCurrentEnergy, 0.0f), 1.0f);
ioFuser = theCurrentEnergy*kNormalizationNetworkFactor;
theSuccess = true;
}
return theSuccess;
}
bool AvHMUGetEnergyCost(AvHWeaponID inWeaponID, float& outEnergyCost)
{
bool theSuccess = false;
float theCost = 0.0f;
switch(inWeaponID)
{
case AVH_WEAPON_CLAWS:
theCost = (float)BALANCE_VAR(kClawsEnergyCost);
break;
case AVH_WEAPON_SPIT:
theCost = (float)BALANCE_VAR(kSpitEnergyCost);
break;
case AVH_WEAPON_SPORES:
theCost = (float)BALANCE_VAR(kSporesEnergyCost);
break;
case AVH_WEAPON_SPIKE:
theCost = (float)BALANCE_VAR(kSpikeEnergyCost);
break;
case AVH_WEAPON_BITE:
theCost = (float)BALANCE_VAR(kBiteEnergyCost);
break;
case AVH_WEAPON_BITE2:
theCost = (float)BALANCE_VAR(kBite2EnergyCost);
break;
case AVH_WEAPON_SWIPE:
theCost = (float)BALANCE_VAR(kSwipeEnergyCost);
break;
case AVH_WEAPON_BLINK:
theCost = (float)BALANCE_VAR(kBlinkEnergyCost);
break;
case AVH_WEAPON_WEBSPINNER:
theCost = (float)BALANCE_VAR(kWebEnergyCost);
break;
case AVH_WEAPON_PARASITE:
theCost = (float)BALANCE_VAR(kParasiteEnergyCost);
break;
case AVH_WEAPON_DIVINEWIND:
theCost = (float)BALANCE_VAR(kDivineWindEnergyCost);
break;
case AVH_WEAPON_HEALINGSPRAY:
theCost = (float)BALANCE_VAR(kHealingSprayEnergyCost);
break;
case AVH_WEAPON_METABOLIZE:
theCost = (float)BALANCE_VAR(kMetabolizeEnergyCost);
break;
case AVH_WEAPON_UMBRA:
theCost = (float)BALANCE_VAR(kUmbraEnergyCost);
break;
case AVH_WEAPON_PRIMALSCREAM:
theCost = (float)BALANCE_VAR(kPrimalScreamEnergyCost);
break;
case AVH_WEAPON_BILEBOMB:
theCost = (float)BALANCE_VAR(kBileBombEnergyCost);
break;
case AVH_WEAPON_ACIDROCKET:
theCost = (float)BALANCE_VAR(kAcidRocketEnergyCost);
break;
case AVH_WEAPON_STOMP:
theCost = (float)BALANCE_VAR(kStompEnergyCost);
break;
case AVH_WEAPON_DEVOUR:
theCost = (float)BALANCE_VAR(kDevourEnergyCost);
break;
// Abilities
case AVH_ABILITY_LEAP:
theCost = (float)BALANCE_VAR(kLeapEnergyCost);
break;
case AVH_ABILITY_CHARGE:
// Charge cost deducted in pm_shared now
theCost = 0.0f; // (float)BALANCE_VAR(kChargeEnergyCost);
break;
}
outEnergyCost = theCost;
if(theCost > 0.0f)
{
theSuccess = true;
}
return theSuccess;
}
float AvHMUGetWalkSpeedFactor(AvHUser3 inUser3)
{
float theMoveSpeed = .1f;
switch(inUser3)
{
case AVH_USER3_MARINE_PLAYER:
theMoveSpeed = .095f;
break;
case AVH_USER3_ALIEN_PLAYER1:
//theMoveSpeed = .04f;
theMoveSpeed = .14f;
break;
case AVH_USER3_ALIEN_PLAYER2:
theMoveSpeed = .08f;
break;
case AVH_USER3_ALIEN_PLAYER3:
theMoveSpeed = .11f;
break;
case AVH_USER3_ALIEN_PLAYER4:
theMoveSpeed = .09f;
break;
case AVH_USER3_ALIEN_PLAYER5:
theMoveSpeed = .09f;
break;
}
return theMoveSpeed;
}
// : 991 -- added latency-based prediction for the ammount of energy available to the alien
bool AvHMUHasEnoughAlienEnergy(float& ioFuser, float inNormAmount, float latency)
{
bool theSuccess = false;
float theCurrentEnergy = ioFuser/kNormalizationNetworkFactor;
float thePredictedByLatency = 0.0f;
#ifdef AVH_CLIENT
float theAlienEnergyRate = (float)BALANCE_VAR(kAlienEnergyRate);
float theUpgradeFactor = 1.0f;
thePredictedByLatency = (latency / 1000) * theAlienEnergyRate * theUpgradeFactor;
#endif
if((theCurrentEnergy + thePredictedByLatency) >= inNormAmount)
{
theSuccess = true;
}
return theSuccess;
}
void AvHMUUpdateAlienEnergy(float inTimePassed, int inUser3, int inUser4, float& ioFuser)
{
if( (inUser3 == AVH_USER3_ALIEN_PLAYER1) ||
(inUser3 == AVH_USER3_ALIEN_PLAYER2) ||
(inUser3 == AVH_USER3_ALIEN_PLAYER3) ||
(inUser3 == AVH_USER3_ALIEN_PLAYER4) ||
(inUser3 == AVH_USER3_ALIEN_PLAYER5))
{
if(!GetHasUpgrade(inUser4, MASK_PLAYER_STUNNED))
{
// Percentage (0-1) per second
float theAlienEnergyRate = (float)BALANCE_VAR(kAlienEnergyRate);
//float kFadeChargingDeplectionRate = -2.8f*kAlienEnergyRate;
float kChargingDepletionRate = -BALANCE_VAR(kChargingEnergyScalar)*theAlienEnergyRate;
const float kMultiplier = GetHasUpgrade(inUser4, MASK_BUFFED) ? (1.0f + BALANCE_VAR(kPrimalScreamEnergyFactor)) : 1.0f;
float theEnergyRate = theAlienEnergyRate*kMultiplier;
float theUpgradeFactor = 1.0f;
int theNumLevels = AvHGetAlienUpgradeLevel(inUser4, MASK_UPGRADE_5);
if(theNumLevels > 0)
{
theUpgradeFactor += theNumLevels*BALANCE_VAR(kAdrenalineEnergyPercentPerLevel);
}
float theCurrentEnergy = ioFuser/kNormalizationNetworkFactor;
float theNewEnergy = theCurrentEnergy + inTimePassed*theAlienEnergyRate*theUpgradeFactor;
// If we're charging, reduce energy
if(GetHasUpgrade(inUser4, MASK_ALIEN_MOVEMENT))
{
if(inUser3 == AVH_USER3_ALIEN_PLAYER4)
{
// theNewEnergy += inTimePassed*kFadeChargingDeplectionRate;
}
else
{
theNewEnergy += inTimePassed*kChargingDepletionRate;
}
}
theNewEnergy = min(max(theNewEnergy, 0.0f), 1.0f);
ioFuser = theNewEnergy*kNormalizationNetworkFactor;
}
}
}
void AvHMUUpdateJetpackEnergy(bool inIsJetpacking, float theTimePassed, float& ioJetpackEnergy)
{
if(inIsJetpacking)
{
ioJetpackEnergy -= theTimePassed*kJetpackEnergyLossRate;
}
else
{
ioJetpackEnergy += theTimePassed*kJetpackEnergyGainRate;
}
ioJetpackEnergy = min(1.0f, ioJetpackEnergy);
ioJetpackEnergy = max(0.0f, ioJetpackEnergy);
}

View file

@ -35,7 +35,7 @@ bool AvHMUGiveAlienEnergy(float& ioFuser, float inNormAmount);
bool AvHMUGetEnergyCost(AvHWeaponID inWeaponID, float& outEnergyCost);
float AvHMUGetWalkSpeedFactor(AvHUser3 inUser3);
bool AvHMUHasEnoughAlienEnergy(float& ioFuser, float inNormAmount);
bool AvHMUHasEnoughAlienEnergy(float& ioFuser, float inNormAmount, float latency = 0.0f);
void AvHMUUpdateAlienEnergy(float inTimePassed, int inUser3, int inUser4, float& ioFuser);
void AvHMUUpdateJetpackEnergy(bool inIsJetpacking, float theTimePassed, float& ioJetpackEnergy);

File diff suppressed because it is too large Load diff

View file

@ -34,11 +34,6 @@
#include "AvHEntityHierarchy.h"
#include "../engine/shake.h"
#include "../common/weaponinfo.h"
extern "C" {
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
}
//FUNCTION PROTOTYPES
#ifdef AVH_SERVER
@ -70,7 +65,7 @@ extern "C" {
void NetMsg_StatusValue( entvars_t* const pev, const int location, const int state );
void NetMsg_TeamInfo( entvars_t* const pev, const int player_index, const string& team_id );
void NetMsg_TeamNames( entvars_t* const pev, const vector<string>& team_names );
void NetMsg_TeamScore( entvars_t* const pev, const string& team_name, const int score, const int deaths );
void NetMsg_TeamScore( entvars_t* const pev, const string& team_name, const int score, const int reset );
void NetMsg_TextMsg( entvars_t* const pev, const int destination, const vector<string>& message );
void NetMsg_Train( entvars_t* const pev, const int state );
void NetMsg_WeaponList( entvars_t* const pev, const WeaponList& weapon );
@ -95,12 +90,15 @@ extern "C" {
void NetMsg_GameStatus_State( entvars_t* const pev, const int status_code, const int map_mode );
void NetMsg_GameStatus_UnspentLevels( entvars_t* const pev, const int status_code, const int map_mode, const int unspent_levels );
void NetMsg_ListPS( entvars_t* const pev, const string& system_name );
void NetMsg_HUDSetUpgrades( int upgradeMask );
void NetMsg_HUDSetUpgrades( entvars_t* const pev, int upgradeMask );
void NetMsg_PlayHUDNotification( entvars_t* const pev, const int flags, const int sound, const float location_x, const float location_y );
void NetMsg_ProgressBar( entvars_t* const pev, const int entity_number, const int progress );
void NetMsg_ServerVar( entvars_t* const pev, const string& name, const string& value );
void NetMsg_ProgressBar( entvars_t* const pev, const int entity_number, const int progress, int percent=0 );
void NetMsg_ServerVar( entvars_t* const pev, const string& name, const int& value );
void NetMsg_SetGammaRamp( entvars_t* const pev, const float gamma );
void NetMsg_SetOrder( entvars_t* const pev, const AvHOrder& order );
void NetMsg_SetParticleTemplate( entvars_t* const pev, const AvHParticleTemplate& particle_template );
void NetMsg_DelParts( entvars_t* const pev);
void NetMsg_SetParticleTemplate( entvars_t* const pev, const int index, const AvHParticleTemplate& particle_template );
void NetMsg_SetRequest( entvars_t* pev, const int request_type, const int request_count );
void NetMsg_SetSelect( entvars_t* const pev, Selection& selection );
void NetMsg_SetSoundNames( entvars_t* pev, const bool reset, const string& sound_name );
@ -110,9 +108,9 @@ extern "C" {
void NetMsg_SetTopDown_TechSlots( entvars_t* const pev, const int tech_slots );
void NetMsg_SetupMap_Extents( entvars_t* const pev, const string& name, const float* const min_extents, const float* const max_extents, const bool draw_background );
void NetMsg_SetupMap_Location( entvars_t* const pev, const string& name, const float* const min_extents, const float* const max_extents );
void NetMsg_UpdateEntityHierarchy( entvars_t* const pev, const MapEntityMap& NewItems, const EntityListType& OldItems );
void NetMsg_UpdateEntityHierarchy( entvars_t* const pev, const MapEntityMap& NewItems, const EntityListType& OldItems, bool specMsg);
void NetMsg_DelEntityHierarchy( entvars_t* const pev);
void NetMsg_IssueOrder(entvars_t* const pev, const int ordertype, const int ordersource, const int ordertarget);
void NetMsg_LUAMessage(entvars_t* const pev, lua_State *L);
//BROADCAST MESSAGE TRANSMISSION
void NetMsg_DeathMsg( const int killer_index, const int victim_index, string& weapon_name );
@ -120,9 +118,10 @@ extern "C" {
void NetMsg_GameStatus_Time( const int status_code, const int map_mode, const int game_time, const int timelimit, const int attacking_team_number, const bool is_reliable );
void NetMsg_SayText( const int entity_index, const string& text, const string& location );
void NetMsg_TeamInfo( const int player_index, const string& team_id );
void NetMsg_TeamScore( const string& team_name, const int score, const int deaths );
void NetMsg_TeamScore( const string& team_name, const int score, const int reset );
void NetMsg_TextMsg( const int destination, const vector<string>& message );
void NetMsg_ScoreInfo( const ScoreInfo& info );
void NetMsgSpec_ScoreInfo( const ScoreInfo& info );
void NetMsg_UpdateCountdown( const int countdown );
//SPECTATOR MESSAGE TRANSMISSION
@ -166,7 +165,7 @@ extern "C" {
void NetMsg_StatusValue( void* const buffer, const int size, int& location, int& state );
void NetMsg_TeamInfo( void* const buffer, const int size, int& player_index, string& team_id );
void NetMsg_TeamNames( void* const buffer, const int size, vector<string>& team_names );
void NetMsg_TeamScore( void* const buffer, const int size, string& team_name, int& score, int& deaths );
void NetMsg_TeamScore( void* const buffer, const int size, string& team_name, int& score, int& reset );
void NetMsg_TextMsg( void* const buffer, const int size, int& destination, vector<string>& message );
//30
void NetMsg_Train( void* const buffer, const int size, int& state );
@ -184,13 +183,15 @@ extern "C" {
void NetMsg_Fog( void* const buffer, const int size, bool& enabled, int& R, int& G, int& B, float& start, float& end );
void NetMsg_GameStatus( void* const buffer, const int size, int& status_code, AvHMapMode& map_mode, int& game_time, int& timelimit, int& misc_data );
void NetMsg_ListPS( void* const buffer, const int size, string& system_name );
void NetMsg_HUDSetUpgrades( void* const buffer, const int size, int& upgradeMask );
void NetMsg_PlayHUDNotification( void* const buffer, const int size, int& flags, int& sound, float& location_x, float& location_y );
void NetMsg_ProgressBar( void* const buffer, const int size, int& entity_number, int& progress );
void NetMsg_ProgressBar( void* const buffer, const int size, int& entity_number, int& progress, int &percent);
//45
void NetMsg_ServerVar( void* const buffer, const int size, string& name, string& value );
void NetMsg_ServerVar( void* const buffer, const int size, string& name, int& value );
void NetMsg_SetGammaRamp( void* const buffer, const int size, float& gamma );
void NetMsg_SetOrder( void* const buffer, const int size, AvHOrder& order );
void NetMsg_SetParticleTemplate( void* const buffer, const int size, AvHParticleTemplate& particle_template );
void NetMsg_SetParticleTemplate( void* const buffer, const int size, int &index, AvHParticleTemplate& particle_template );
void NetMsg_DelParts( void* const buffer, const int size);
void NetMsg_SetRequest( void* const buffer, const int size, int& request_type, int& request_count );
//50
void NetMsg_SetSelect( void* const buffer, const int size, Selection& selection );
@ -202,9 +203,8 @@ extern "C" {
void NetMsg_SetupMap( void* const buffer, const int size, bool& is_location, string& name, float* min_extents, float* max_extents, bool& draw_background );
void NetMsg_UpdateCountdown( void* const buffer, const int size, int& countdown );
void NetMsg_UpdateEntityHierarchy( void* const buffer, const int size, MapEntityMap& NewItems, EntityListType& OldItems );
void NetMsg_DelEntityHierarchy( void* const buffer, const int size);
void NetMsg_IssueOrder( void* const buffer, const int size, int& ordertype, int& ordersource, int& ordertarget );
void NetMsg_LUAMessage( void* const buffer, const int size, lua_State *L, int &arguments);
// 60
#endif //AVH_SERVER

Some files were not shown because too many files have changed in this diff Show more