mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-20 20:46:03 +08:00
Update from SDK 2013
This commit is contained in:

committed by
Nicholas Hastings

parent
6d5c024820
commit
94b660e16e
@ -1,88 +1,85 @@
|
||||
//========= Copyright <20> 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef WEAPON_SDKBASE_H
|
||||
#define WEAPON_SDKBASE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "sdk_playeranimstate.h"
|
||||
#include "sdk_weapon_parse.h"
|
||||
|
||||
#if defined( CLIENT_DLL )
|
||||
#define CWeaponSDKBase C_WeaponSDKBase
|
||||
#endif
|
||||
|
||||
class CSDKPlayer;
|
||||
|
||||
// These are the names of the ammo types that the weapon script files reference.
|
||||
#define AMMO_BULLETS "AMMO_BULLETS"
|
||||
#define AMMO_ROCKETS "AMMO_ROCKETS"
|
||||
#define AMMO_GRENADE "AMMO_GRENADE"
|
||||
#define AMMO_GAUSS "AMMO_GAUSS"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// Weapon IDs for all SDK Game weapons
|
||||
//
|
||||
typedef enum
|
||||
{
|
||||
WEAPON_NONE = 0,
|
||||
|
||||
WEAPON_MP5,
|
||||
WEAPON_SHOTGUN,
|
||||
WEAPON_GRENADE,
|
||||
|
||||
WEAPON_MAX, // number of weapons weapon index
|
||||
} SDKWeaponID;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
Primary_Mode = 0,
|
||||
Secondary_Mode,
|
||||
} SDKWeaponMode;
|
||||
|
||||
const char *WeaponIDToAlias( int id );
|
||||
|
||||
class CWeaponSDKBase : public CBaseCombatWeapon
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS( CWeaponSDKBase, CBaseCombatWeapon );
|
||||
DECLARE_NETWORKCLASS();
|
||||
DECLARE_PREDICTABLE();
|
||||
|
||||
CWeaponSDKBase();
|
||||
|
||||
#ifdef GAME_DLL
|
||||
DECLARE_DATADESC();
|
||||
#endif
|
||||
#ifdef CLIENT_DLL
|
||||
virtual bool ShouldPredict();
|
||||
#endif
|
||||
// All predicted weapons need to implement and return true
|
||||
virtual bool IsPredicted() const { return true; }
|
||||
virtual SDKWeaponID GetWeaponID( void ) const { return WEAPON_NONE; }
|
||||
|
||||
// Get SDK weapon specific weapon data.
|
||||
CSDKWeaponInfo const &GetSDKWpnData() const;
|
||||
|
||||
// Get a pointer to the player that owns this weapon
|
||||
CSDKPlayer* GetPlayerOwner() const;
|
||||
|
||||
// override to play custom empty sounds
|
||||
virtual bool PlayEmptySound();
|
||||
|
||||
#ifdef GAME_DLL
|
||||
virtual void SendReloadEvents();
|
||||
#endif
|
||||
|
||||
private:
|
||||
CWeaponSDKBase( const CWeaponSDKBase & );
|
||||
};
|
||||
|
||||
|
||||
#endif // WEAPON_SDKBASE_H
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
//=============================================================================//
|
||||
|
||||
#ifndef WEAPON_SDKBASE_H
|
||||
#define WEAPON_SDKBASE_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "sdk_playeranimstate.h"
|
||||
#include "sdk_weapon_parse.h"
|
||||
|
||||
#if defined( CLIENT_DLL )
|
||||
#define CWeaponSDKBase C_WeaponSDKBase
|
||||
#endif
|
||||
|
||||
class CSDKPlayer;
|
||||
|
||||
// These are the names of the ammo types that the weapon script files reference.
|
||||
#define AMMO_BULLETS "AMMO_BULLETS"
|
||||
#define AMMO_ROCKETS "AMMO_ROCKETS"
|
||||
#define AMMO_GRENADE "AMMO_GRENADE"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// Weapon IDs for all SDK Game weapons
|
||||
//
|
||||
typedef enum
|
||||
{
|
||||
WEAPON_NONE = 0,
|
||||
|
||||
WEAPON_MP5,
|
||||
WEAPON_SHOTGUN,
|
||||
WEAPON_GRENADE,
|
||||
|
||||
WEAPON_MAX, // number of weapons weapon index
|
||||
} SDKWeaponID;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
Primary_Mode = 0,
|
||||
Secondary_Mode,
|
||||
} SDKWeaponMode;
|
||||
|
||||
const char *WeaponIDToAlias( int id );
|
||||
|
||||
class CWeaponSDKBase : public CBaseCombatWeapon
|
||||
{
|
||||
public:
|
||||
DECLARE_CLASS( CWeaponSDKBase, CBaseCombatWeapon );
|
||||
DECLARE_NETWORKCLASS();
|
||||
DECLARE_PREDICTABLE();
|
||||
|
||||
CWeaponSDKBase();
|
||||
|
||||
#ifdef GAME_DLL
|
||||
DECLARE_DATADESC();
|
||||
#endif
|
||||
|
||||
// All predicted weapons need to implement and return true
|
||||
virtual bool IsPredicted() const { return true; }
|
||||
virtual SDKWeaponID GetWeaponID( void ) const { return WEAPON_NONE; }
|
||||
|
||||
// Get SDK weapon specific weapon data.
|
||||
CSDKWeaponInfo const &GetSDKWpnData() const;
|
||||
|
||||
// Get a pointer to the player that owns this weapon
|
||||
CSDKPlayer* GetPlayerOwner() const;
|
||||
|
||||
// override to play custom empty sounds
|
||||
virtual bool PlayEmptySound();
|
||||
|
||||
#ifdef GAME_DLL
|
||||
virtual void SendReloadEvents();
|
||||
#endif
|
||||
|
||||
private:
|
||||
CWeaponSDKBase( const CWeaponSDKBase & );
|
||||
};
|
||||
|
||||
|
||||
#endif // WEAPON_SDKBASE_H
|
||||
|
Reference in New Issue
Block a user