source-sdk-2013-mapbase/sp/src/game/shared/ammodef.h
Blixibon 87cd9b24bb Mapbase v6.1
- Added postprocess_controller entity from later versions of Source
- Added env_dof_controller entity from later versions of Source
- Added SDK_Engine_Post and DepthOfField shaders from the Momentum repo/Alien Swarm SDK
- Fixed auto-breaking game_text/choreo text not null terminating
- Fixed console groups showing up at the wrong developer levels
- Added more mesages to console groups, including a new "NPC AI" console group
- Fixed typos and added elaboration in various cvars, console messages, etc.
- Fixed npc_metropolice not using frag grenades correctly when allowed to use them
- Fixed npc_metropolice not registering stitching squad slots in AI
- Fixed SetModel input late precache warning
- Fixed env_global_light angles resetting upon loading a save
- Fixed an issue with ScriptKeyValuesRead using the wrong name and having a memory leak
- Allowed VScript functions which return null strings to actually return null instead of empty strings
- Added VScript member variable documentation
- Fixed VScript documentation lines sometimes mixing together
- Fixed VScript singletons having a ! at the beginning of descriptions
- Added Color struct to VScript and allowed color-related inputs to use it
- Added more VScript functions for weapons, ammo, ragdolling, and response contexts
- Added GameRules singleton for VScript
- Exposed AI interaction system to VScript
- Recovered some lost documentation from older revisions of the Mapbase wiki
- Added a way to get the current game's load type in VScript
- Fixed Precache/SpawnEntityFromTable not accounting for a few important field types
- Added VScript functions for getting a player's eye vectors
- Fixed a crash caused by removing the active weapon of a Combine soldier while it's firing
- Changed the way metrocops deploy their manhacks so they could use their manhack death response properly
- Fixed "Use Server" keyvalue on game_convar_mod not working
- Adjusted CAI_Expresser in VScript
2020-12-17 03:38:23 +00:00

112 lines
2.9 KiB
C++

//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Holds defintion for game ammo types
//
// $Workfile: $
// $Date: $
// $NoKeywords: $
//=============================================================================//
#ifndef AI_AMMODEF_H
#define AI_AMMODEF_H
#ifdef _WIN32
#pragma once
#endif
class ConVar;
struct Ammo_t
{
char *pName;
int nDamageType;
int eTracerType;
float physicsForceImpulse;
int nMinSplashSize;
int nMaxSplashSize;
int nFlags;
// Values for player/NPC damage and carrying capability
// If the integers are set, they override the CVars
int pPlrDmg; // CVar for player damage amount
int pNPCDmg; // CVar for NPC damage amount
int pMaxCarry; // CVar for maximum number can carry
const ConVar* pPlrDmgCVar; // CVar for player damage amount
const ConVar* pNPCDmgCVar; // CVar for NPC damage amount
const ConVar* pMaxCarryCVar; // CVar for maximum number can carry
};
// Used to tell AmmoDef to use the cvars, not the integers
#define USE_CVAR -1
// Ammo is infinite
#define INFINITE_AMMO -2
enum AmmoTracer_t
{
TRACER_NONE,
TRACER_LINE,
TRACER_RAIL,
TRACER_BEAM,
TRACER_LINE_AND_WHIZ,
};
enum AmmoFlags_t
{
AMMO_FORCE_DROP_IF_CARRIED = 0x1,
AMMO_INTERPRET_PLRDAMAGE_AS_DAMAGE_TO_PLAYER = 0x2,
};
#include "shareddefs.h"
//=============================================================================
// >> CAmmoDef
//=============================================================================
class CAmmoDef
{
public:
int m_nAmmoIndex;
Ammo_t m_AmmoType[MAX_AMMO_TYPES];
Ammo_t *GetAmmoOfIndex(int nAmmoIndex);
#ifdef MAPBASE
const char* Name(int nAmmoIndex);
#endif
int Index(const char *psz);
int PlrDamage(int nAmmoIndex);
int NPCDamage(int nAmmoIndex);
int MaxCarry(int nAmmoIndex);
int DamageType(int nAmmoIndex);
int TracerType(int nAmmoIndex);
float DamageForce(int nAmmoIndex);
int MinSplashSize(int nAmmoIndex);
int MaxSplashSize(int nAmmoIndex);
int Flags(int nAmmoIndex);
void AddAmmoType(char const* name, int damageType, int tracerType, int plr_dmg, int npc_dmg, int carry, float physicsForceImpulse, int nFlags, int minSplashSize = 4, int maxSplashSize = 8 );
void AddAmmoType(char const* name, int damageType, int tracerType, char const* plr_cvar, char const* npc_var, char const* carry_cvar, float physicsForceImpulse, int nFlags, int minSplashSize = 4, int maxSplashSize = 8 );
CAmmoDef(void);
virtual ~CAmmoDef( void );
private:
bool AddAmmoType(char const* name, int damageType, int tracerType, int nFlags, int minSplashSize, int maxSplashSize );
#ifdef MAPBASE_VSCRIPT
ALLOW_SCRIPT_ACCESS();
int GetNumAmmoTypes() { return m_nAmmoIndex; }
#endif
};
// Get the global ammodef object. This is usually implemented in each mod's game rules file somewhere,
// so the mod can setup custom ammo types.
CAmmoDef* GetAmmoDef();
#endif // AI_AMMODEF_H