1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2024-12-23 01:59:43 +08:00
hl2sdk/game_shared/shareddefs.h

693 lines
25 KiB
C++

//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Definitions that are shared by the game DLL and the client DLL.
//
// $NoKeywords: $
//=============================================================================//
#ifndef SHAREDDEFS_H
#define SHAREDDEFS_H
#ifdef _WIN32
#pragma once
#endif
#define TICK_INTERVAL (gpGlobals->interval_per_tick)
#define TIME_TO_TICKS( dt ) ( (int)( 0.5f + (float)(dt) / TICK_INTERVAL ) )
#define TICKS_TO_TIME( t ) ( TICK_INTERVAL *( t ) )
#define ROUND_TO_TICKS( t ) ( TICK_INTERVAL * TIME_TO_TICKS( t ) )
#define TICK_NEVER_THINK (-1)
#define ANIMATION_CYCLE_BITS 15
#define ANIMATION_CYCLE_MINFRAC (1.0f / (1<<ANIMATION_CYCLE_BITS))
// Each mod defines these for itself.
class CViewVectors
{
public:
CViewVectors() {}
CViewVectors(
Vector vView,
Vector vHullMin,
Vector vHullMax,
Vector vDuckHullMin,
Vector vDuckHullMax,
Vector vDuckView,
Vector vObsHullMin,
Vector vObsHullMax,
Vector vDeadViewHeight )
{
m_vView = vView;
m_vHullMin = vHullMin;
m_vHullMax = vHullMax;
m_vDuckHullMin = vDuckHullMin;
m_vDuckHullMax = vDuckHullMax;
m_vDuckView = vDuckView;
m_vObsHullMin = vObsHullMin;
m_vObsHullMax = vObsHullMax;
m_vDeadViewHeight = vDeadViewHeight;
}
// Height above entity position where the viewer's eye is.
Vector m_vView;
Vector m_vHullMin;
Vector m_vHullMax;
Vector m_vDuckHullMin;
Vector m_vDuckHullMax;
Vector m_vDuckView;
Vector m_vObsHullMin;
Vector m_vObsHullMax;
Vector m_vDeadViewHeight;
};
// Height above entity position where the viewer's eye is.
#define VEC_VIEW g_pGameRules->GetViewVectors()->m_vView
#define VEC_HULL_MIN g_pGameRules->GetViewVectors()->m_vHullMin
#define VEC_HULL_MAX g_pGameRules->GetViewVectors()->m_vHullMax
#define VEC_DUCK_HULL_MIN g_pGameRules->GetViewVectors()->m_vDuckHullMin
#define VEC_DUCK_HULL_MAX g_pGameRules->GetViewVectors()->m_vDuckHullMax
#define VEC_DUCK_VIEW g_pGameRules->GetViewVectors()->m_vDuckView
#define VEC_OBS_HULL_MIN g_pGameRules->GetViewVectors()->m_vObsHullMin
#define VEC_OBS_HULL_MAX g_pGameRules->GetViewVectors()->m_vObsHullMax
#define VEC_DEAD_VIEWHEIGHT g_pGameRules->GetViewVectors()->m_vDeadViewHeight
#define WATERJUMP_HEIGHT 8
#define MAX_CLIMB_SPEED 200
#define TIME_TO_DUCK 0.4
#define TIME_TO_UNDUCK 0.2
#define MAX_WEAPON_SLOTS 6 // hud item selection slots
#define MAX_WEAPON_POSITIONS 20 // max number of items within a slot
#define MAX_ITEM_TYPES 6 // hud item selection slots
#define MAX_WEAPONS 48 // Max number of weapons available
#define MAX_ITEMS 5 // hard coded item types
#define WEAPON_NOCLIP -1 // clip sizes set to this tell the weapon it doesn't use a clip
#define MAX_AMMO_TYPES 32 // ???
#define MAX_AMMO_SLOTS 32 // not really slots
#define HUD_PRINTNOTIFY 1
#define HUD_PRINTCONSOLE 2
#define HUD_PRINTTALK 3
#define HUD_PRINTCENTER 4
//===================================================================================================================
// Close caption flags
#define CLOSE_CAPTION_WARNIFMISSING ( 1<<0 )
#define CLOSE_CAPTION_FROMPLAYER ( 1<<1 )
#define CLOSE_CAPTION_GENDER_MALE ( 1<<2 )
#define CLOSE_CAPTION_GENDER_FEMALE ( 1<<3 )
//===================================================================================================================
// Hud Element hiding flags
#define HIDEHUD_WEAPONSELECTION ( 1<<0 ) // Hide ammo count & weapon selection
#define HIDEHUD_FLASHLIGHT ( 1<<1 )
#define HIDEHUD_ALL ( 1<<2 )
#define HIDEHUD_HEALTH ( 1<<3 ) // Hide health & armor / suit battery
#define HIDEHUD_PLAYERDEAD ( 1<<4 ) // Hide when local player's dead
#define HIDEHUD_NEEDSUIT ( 1<<5 ) // Hide when the local player doesn't have the HEV suit
#define HIDEHUD_MISCSTATUS ( 1<<6 ) // Hide miscellaneous status elements (trains, pickup history, death notices, etc)
#define HIDEHUD_CHAT ( 1<<7 ) // Hide all communication elements (saytext, voice icon, etc)
#define HIDEHUD_CROSSHAIR ( 1<<8 ) // Hide crosshairs
#define HIDEHUD_VEHICLE_CROSSHAIR ( 1<<9 ) // Hide vehicle crosshair
#define HIDEHUD_INVEHICLE ( 1<<10 )
#define HIDEHUD_BITCOUNT 11
//===================================================================================================================
// suit usage bits
#define bits_SUIT_DEVICE_SPRINT 0x00000001
#define bits_SUIT_DEVICE_FLASHLIGHT 0x00000002
#define bits_SUIT_DEVICE_BREATHER 0x00000004
#define MAX_SUIT_DEVICES 3
//===================================================================================================================
// Player Defines
// Max number of players in a game ( see const.h for ABSOLUTE_PLAYER_LIMIT (256 ) )
// The Source engine is really designed for 32 or less players. If you raise this number above 32, you better know what you are doing
// and have a good answer for a bunch of perf question related to player simulation, thinking logic, tracelines, networking overhead, etc.
// But if you are brave or are doing something interesting, go for it... ywb 9/22/03
#if defined( CSTRIKE_DLL )
#define MAX_PLAYERS 64 // Absolute max players supported
#else
#define MAX_PLAYERS 32 // Absolute max players supported
#endif
#define MAX_PLACE_NAME_LENGTH 18
//===================================================================================================================
// Team Defines
#define TEAM_INVALID -1
#define TEAM_UNASSIGNED 0 // not assigned to a team
#define TEAM_SPECTATOR 1 // spectator team
#define MAX_TEAMS 32 // Max number of teams in a game
#define MAX_TEAM_NAME_LENGTH 32 // Max length of a team's name
// Weapon m_iState
#define WEAPON_IS_ONTARGET 0x40
#define WEAPON_NOT_CARRIED 0 // Weapon is on the ground
#define WEAPON_IS_CARRIED_BY_PLAYER 1 // This client is carrying this weapon.
#define WEAPON_IS_ACTIVE 2 // This client is carrying this weapon and it's the currently held weapon
// -----------------------------------------
// Skill Level
// -----------------------------------------
#define SKILL_EASY 1
#define SKILL_MEDIUM 2
#define SKILL_HARD 3
// Weapon flags
// -----------------------------------------
// Flags - NOTE: KEEP g_ItemFlags IN WEAPON_PARSE.CPP UPDATED WITH THESE
// -----------------------------------------
#define ITEM_FLAG_SELECTONEMPTY (1<<0)
#define ITEM_FLAG_NOAUTORELOAD (1<<1)
#define ITEM_FLAG_NOAUTOSWITCHEMPTY (1<<2)
#define ITEM_FLAG_LIMITINWORLD (1<<3)
#define ITEM_FLAG_EXHAUSTIBLE (1<<4) // A player can totally exhaust their ammo supply and lose this weapon
#define ITEM_FLAG_DOHITLOCATIONDMG (1<<5) // This weapon take hit location into account when applying damage
#define ITEM_FLAG_NOAMMOPICKUPS (1<<6) // Don't draw ammo pickup sprites/sounds when ammo is received
// NOTE: KEEP g_ItemFlags IN WEAPON_PARSE.CPP UPDATED WITH THESE
// Humans only have left and right hands, though we might have aliens with more
// than two, sigh
#define MAX_VIEWMODELS 2
#define MAX_BEAM_ENTS 10
#define TRACER_TYPE_DEFAULT 0x00000001
#define TRACER_TYPE_GUNSHIP 0x00000002
#define TRACER_TYPE_STRIDER 0x00000004 // Here ya go, Jay!
#define TRACER_TYPE_GAUSS 0x00000008
#define TRACER_TYPE_WATERBULLET 0x00000010
#define MUZZLEFLASH_TYPE_DEFAULT 0x00000001
#define MUZZLEFLASH_TYPE_GUNSHIP 0x00000002
#define MUZZLEFLASH_TYPE_STRIDER 0x00000004
// Muzzle flash definitions (for the flags field of the "MuzzleFlash" DispatchEffect)
enum
{
MUZZLEFLASH_AR2 = 0,
MUZZLEFLASH_SHOTGUN,
MUZZLEFLASH_SMG1,
MUZZLEFLASH_SMG2,
MUZZLEFLASH_PISTOL,
MUZZLEFLASH_COMBINE,
MUZZLEFLASH_357,
MUZZLEFLASH_RPG,
MUZZLEFLASH_COMBINE_TURRET,
MUZZLEFLASH_FIRSTPERSON = 0x100,
};
// Tracer Flags
#define TRACER_FLAG_WHIZ 0x0001
#define TRACER_FLAG_USEATTACHMENT 0x0002
#define TRACER_DONT_USE_ATTACHMENT -1
// Entity Dissolve types
enum
{
ENTITY_DISSOLVE_NORMAL = 0,
ENTITY_DISSOLVE_ELECTRICAL,
ENTITY_DISSOLVE_ELECTRICAL_LIGHT,
ENTITY_DISSOLVE_CORE,
// NOTE: Be sure to up the bits if you make more dissolve types
ENTITY_DISSOLVE_BITS = 3
};
// ---------------------------
// Hit Group standards
// ---------------------------
#define HITGROUP_GENERIC 0
#define HITGROUP_HEAD 1
#define HITGROUP_CHEST 2
#define HITGROUP_STOMACH 3
#define HITGROUP_LEFTARM 4
#define HITGROUP_RIGHTARM 5
#define HITGROUP_LEFTLEG 6
#define HITGROUP_RIGHTLEG 7
#define HITGROUP_GEAR 10 // alerts NPC, but doesn't do damage or bleed (1/100th damage)
//
// Enumerations for setting player animation.
//
enum PLAYER_ANIM
{
PLAYER_IDLE,
PLAYER_WALK,
PLAYER_JUMP,
PLAYER_SUPERJUMP,
PLAYER_DIE,
PLAYER_ATTACK1,
PLAYER_IN_VEHICLE,
// TF Player animations
PLAYER_RELOAD,
PLAYER_START_AIMING,
PLAYER_LEAVE_AIMING,
};
#ifdef HL2_DLL
// HL2 has 600 gravity by default
// NOTE: The discrete ticks can have quantization error, so these numbers are biased a little to
// make the heights more exact
#define PLAYER_FATAL_FALL_SPEED 922.5f // approx 60 feet sqrt( 2 * gravity * 60 * 12 )
#define PLAYER_MAX_SAFE_FALL_SPEED 526.5f // approx 20 feet sqrt( 2 * gravity * 20 * 12 )
#define PLAYER_LAND_ON_FLOATING_OBJECT 173 // Can fall another 173 in/sec without getting hurt
#define PLAYER_MIN_BOUNCE_SPEED 173
#define PLAYER_FALL_PUNCH_THRESHOLD 303.0f // won't punch player's screen/make scrape noise unless player falling at least this fast - at least a 76" fall (sqrt( 2 * g * 76))
#else
#define PLAYER_FATAL_FALL_SPEED 1024 // approx 60 feet
#define PLAYER_MAX_SAFE_FALL_SPEED 580 // approx 20 feet
#define PLAYER_LAND_ON_FLOATING_OBJECT 200 // Can go another 200 units without getting hurt
#define PLAYER_MIN_BOUNCE_SPEED 200
#define PLAYER_FALL_PUNCH_THRESHOLD (float)350 // won't punch player's screen/make scrape noise unless player falling at least this fast.
#endif
#define DAMAGE_FOR_FALL_SPEED 100.0f / ( PLAYER_FATAL_FALL_SPEED - PLAYER_MAX_SAFE_FALL_SPEED ) // damage per unit per second.
#define AUTOAIM_2DEGREES 0.0348994967025
#define AUTOAIM_5DEGREES 0.08715574274766
#define AUTOAIM_8DEGREES 0.1391731009601
#define AUTOAIM_10DEGREES 0.1736481776669
#define AUTOAIM_20DEGREES 0.3490658503989
#define AUTOAIM_SCALE_DEFAULT 1.0f
#define AUTOAIM_SCALE_DIRECT_ONLY 0.0f
// instant damage
#define DMG_GENERIC 0 // generic damage was done
#define DMG_CRUSH (1 << 0) // crushed by falling or moving object.
// NOTE: It's assumed crush damage is occurring as a result of physics collision, so no extra physics force is generated by crush damage.
// DON'T use DMG_CRUSH when damaging entities unless it's the result of a physics collision. You probably want DMG_CLUB instead.
#define DMG_BULLET (1 << 1) // shot
#define DMG_SLASH (1 << 2) // cut, clawed, stabbed
#define DMG_BURN (1 << 3) // heat burned
#define DMG_VEHICLE (1 << 4) // hit by a vehicle
#define DMG_FALL (1 << 5) // fell too far
#define DMG_BLAST (1 << 6) // explosive blast damage
#define DMG_CLUB (1 << 7) // crowbar, punch, headbutt
#define DMG_SHOCK (1 << 8) // electric shock
#define DMG_SONIC (1 << 9) // sound pulse shockwave
#define DMG_ENERGYBEAM (1 << 10) // laser or other high energy beam
#define DMG_PREVENT_PHYSICS_FORCE (1 << 11) // Prevent a physics force
#define DMG_NEVERGIB (1 << 12) // with this bit OR'd in, no damage type will be able to gib victims upon death
#define DMG_ALWAYSGIB (1 << 13) // with this bit OR'd in, any damage type can be made to gib victims upon death.
#define DMG_DROWN (1 << 14) // Drowning
// time-based damage
#define DMG_TIMEBASED (DMG_PARALYZE | DMG_NERVEGAS | DMG_POISON | DMG_RADIATION | DMG_DROWNRECOVER | DMG_ACID | DMG_SLOWBURN) // mask for time-based damage
#define DMG_PARALYZE (1 << 15) // slows affected creature down
#define DMG_NERVEGAS (1 << 16) // nerve toxins, very bad
#define DMG_POISON (1 << 17) // blood poisoning - heals over time like drowning damage
#define DMG_RADIATION (1 << 18) // radiation exposure
#define DMG_DROWNRECOVER (1 << 19) // drowning recovery
#define DMG_ACID (1 << 20) // toxic chemicals or acid burns
#define DMG_SLOWBURN (1 << 21) // in an oven
#define DMG_REMOVENORAGDOLL (1<<22) // with this bit OR'd in, no ragdoll will be created, and the target will be quietly removed.
// use this to kill an entity that you've already got a server-side ragdoll for
#define DMG_PHYSGUN (1<<23) // Hit by manipulator. Usually doesn't do any damage.
#define DMG_PLASMA (1<<24) // Shot by Cremator
#define DMG_AIRBOAT (1<<25) // Hit by the airboat's gun
#define DMG_DISSOLVE (1<<26) // Dissolving!
#define DMG_BLAST_SURFACE (1<<27) // A blast on the surface of water that cannot harm things underwater
#define DMG_DIRECT (1<<28)
#define DMG_BUCKSHOT (1<<29) // not quite a bullet. Little, rounder, different.
// NOTE: DO NOT ADD ANY MORE CUSTOM DMG_ TYPES. MODS USE THE DMG_LASTGENERICFLAG BELOW, AND
// IF YOU ADD NEW DMG_ TYPES, THEIR TYPES WILL BE HOSED. WE NEED A BETTER SOLUTION.
// TODO: keep this up to date so all the mod-specific flags don't overlap anything.
#define DMG_LASTGENERICFLAG DMG_BUCKSHOT
// these are the damage types that are allowed to gib corpses
#define DMG_GIB_CORPSE ( DMG_CRUSH | DMG_FALL | DMG_BLAST | DMG_SONIC | DMG_CLUB )
// these are the damage types that have client hud art
#define DMG_SHOWNHUD (DMG_POISON | DMG_ACID | DMG_DROWN | DMG_BURN | DMG_SLOWBURN | DMG_NERVEGAS | DMG_RADIATION | DMG_SHOCK)
// these are the damage types that don't have to supply a physics force & position
#define DMG_NO_PHYSICS_FORCE (DMG_FALL | DMG_BURN | DMG_PLASMA | DMG_DROWN | DMG_TIMEBASED | DMG_CRUSH | DMG_PHYSGUN | DMG_PREVENT_PHYSICS_FORCE)
// settings for m_takedamage
#define DAMAGE_NO 0
#define DAMAGE_EVENTS_ONLY 1 // Call damage functions, but don't modify health
#define DAMAGE_YES 2
#define DAMAGE_AIM 3
// Spectator Movement modes
enum {
OBS_MODE_NONE = 0, // not in spectator mode
OBS_MODE_DEATHCAM, // special mode for detah cam animation
OBS_MODE_FIXED, // view from a fixed camera position
OBS_MODE_IN_EYE, // follow a player in first perosn view
OBS_MODE_CHASE, // follow a player in third person view
OBS_MODE_ROAMING, // free roaming
};
// Force Camera Restrictions with mp_forcecamera
#define OBS_ALLOW_ALL 0 // allow all modes, all targets
#define OBS_ALLOW_TEAM 1 // allow only own team & first person, no PIP
#define OBS_ALLOW_NONE 2 // don't allow any spectating after death (fixed & fade to black)
// VGui Screen Flags
enum
{
VGUI_SCREEN_ACTIVE = 0x1,
VGUI_SCREEN_VISIBLE_TO_TEAMMATES = 0x2,
VGUI_SCREEN_ATTACHED_TO_VIEWMODEL=0x4,
VGUI_SCREEN_MAX_BITS = 3
};
typedef enum
{
USE_OFF = 0,
USE_ON = 1,
USE_SET = 2,
USE_TOGGLE = 3
} USE_TYPE;
// basic team colors
#define COLOR_RED Color(255, 64, 64, 255)
#define COLOR_BLUE Color(153, 204, 255, 255)
#define COLOR_YELLOW Color(255, 178, 0, 255)
#define COLOR_GREEN Color(153, 255, 153, 255)
#define COLOR_GREY Color(204, 204, 204, 255)
// All NPCs need this data
#define DONT_BLEED -1
#define BLOOD_COLOR_RED (byte)247
#define BLOOD_COLOR_YELLOW (byte)195
#define BLOOD_COLOR_GREEN BLOOD_COLOR_YELLOW
#define BLOOD_COLOR_MECH (byte)20
//-----------------------------------------------------------------------------
// Vehicles may have more than one passenger.
// This enum may be expanded by derived classes
//-----------------------------------------------------------------------------
enum PassengerRole_t
{
VEHICLE_ROLE_NONE = -1,
VEHICLE_ROLE_DRIVER = 0, // Only one driver
LAST_SHARED_VEHICLE_ROLE,
};
//-----------------------------------------------------------------------------
// Water splash effect flags
//-----------------------------------------------------------------------------
enum
{
FX_WATER_IN_SLIME = 0x1,
};
// Shared think context stuff
#define MAX_CONTEXT_LENGTH 32
#define NO_THINK_CONTEXT -1
// entity flags, CBaseEntity::m_iEFlags
enum
{
EFL_KILLME = (1<<0), // This entity is marked for death -- This allows the game to actually delete ents at a safe time
EFL_DORMANT = (1<<1), // Entity is dormant, no updates to client
EFL_NOCLIP_ACTIVE = (1<<2), // Lets us know when the noclip command is active.
EFL_SETTING_UP_BONES = (1<<3), // Set while a model is setting up its bones.
EFL_KEEP_ON_RECREATE_ENTITIES = (1<<4), // This is a special entity that should not be deleted when we restart entities only
EFL_HAS_PLAYER_CHILD= (1<<4), // One of the child entities is a player.
EFL_DIRTY_SHADOWUPDATE = (1<<5), // Client only- need shadow manager to update the shadow...
EFL_NOTIFY = (1<<6), // Another entity is watching events on this entity (used by teleport)
// The default behavior in ShouldTransmit is to not send an entity if it doesn't
// have a model. Certain entities want to be sent anyway because all the drawing logic
// is in the client DLL. They can set this flag and the engine will transmit them even
// if they don't have a model.
EFL_FORCE_CHECK_TRANSMIT = (1<<7),
EFL_BOT_FROZEN = (1<<8), // This is set on bots that are frozen.
EFL_SERVER_ONLY = (1<<9), // Non-networked entity.
EFL_NO_AUTO_EDICT_ATTACH = (1<<10), // Don't attach the edict; we're doing it explicitly
// Some dirty bits with respect to abs computations
EFL_DIRTY_ABSTRANSFORM = (1<<11),
EFL_DIRTY_ABSVELOCITY = (1<<12),
EFL_DIRTY_ABSANGVELOCITY = (1<<13),
EFL_DIRTY_SURROUNDING_COLLISION_BOUNDS = (1<<14),
EFL_DIRTY_SPATIAL_PARTITION = (1<<15),
EFL_DIRTY_PVS_INFORMATION = (1<<16),
EFL_IN_SKYBOX = (1<<17), // This is set if the entity detects that it's in the skybox.
// This forces it to pass the "in PVS" for transmission.
EFL_USE_PARTITION_WHEN_NOT_SOLID = (1<<18), // Entities with this flag set show up in the partition even when not solid
EFL_TOUCHING_FLUID = (1<<19), // Used to determine if an entity is floating
// FIXME: Not really sure where I should add this...
EFL_IS_BEING_LIFTED_BY_BARNACLE = (1<<20),
EFL_NO_ROTORWASH_PUSH = (1<<21), // I shouldn't be pushed by the rotorwash
EFL_NO_THINK_FUNCTION = (1<<22),
EFL_NO_GAME_PHYSICS_SIMULATION = (1<<23),
EFL_CHECK_UNTOUCH = (1<<24),
EFL_DONTBLOCKLOS = (1<<25), // I shouldn't block NPC line-of-sight
EFL_DONTWALKON = (1<<26), // NPC;s should not walk on this entity
EFL_NO_DISSOLVE = (1<<27), // These guys shouldn't dissolve
EFL_NO_MEGAPHYSCANNON_RAGDOLL = (1<<28), // Mega physcannon can't ragdoll these guys.
EFL_NO_WEAPON_PICKUP = (1<<29), // Characters can't pick up weapons
EFL_NO_PHYSCANNON_INTERACTION = (1<<30), // Physcannon can't pick these up or punt them
EFL_NO_DAMAGE_FORCES = (1<<31), // Doesn't accept forces from physics damage
};
//-----------------------------------------------------------------------------
// EFFECTS
//-----------------------------------------------------------------------------
const int FX_BLOODSPRAY_DROPS = 0x01;
const int FX_BLOODSPRAY_GORE = 0x02;
const int FX_BLOODSPRAY_CLOUD = 0x04;
const int FX_BLOODSPRAY_ALL = 0xFF;
//-----------------------------------------------------------------------------
#define MAX_SCREEN_OVERLAYS 10
// These are the types of data that hang off of CBaseEntities and the flag bits used to mark their presence
enum
{
GROUNDLINK = 0,
TOUCHLINK,
STEPSIMULATION,
MODELWIDTHSCALE,
POSITIONWATCHER,
PHYSICSPUSHLIST,
// Must be last
NUM_DATAOBJECT_TYPES,
};
class CBaseEntity;
//-----------------------------------------------------------------------------
// Bullet firing information
//-----------------------------------------------------------------------------
class CBaseEntity;
enum FireBulletsFlags_t
{
FIRE_BULLETS_FIRST_SHOT_ACCURATE = 0x1, // Pop the first shot with perfect accuracy
FIRE_BULLETS_DONT_HIT_UNDERWATER = 0x2, // If the shot hits its target underwater, don't damage it
FIRE_BULLETS_ALLOW_WATER_SURFACE_IMPACTS = 0x4, // If the shot hits water surface, still call DoImpactEffect
FIRE_BULLETS_TEMPORARY_DANGER_SOUND = 0x8, // Danger sounds added from this impact can be stomped immediately if another is queued
};
struct FireBulletsInfo_t
{
FireBulletsInfo_t()
{
m_iShots = 1;
m_vecSpread.Init( 0, 0, 0 );
m_flDistance = 8192;
m_iTracerFreq = 4;
m_iDamage = 0;
m_iPlayerDamage = 0;
m_pAttacker = NULL;
m_nFlags = 0;
m_pAdditionalIgnoreEnt = NULL;
m_flDamageForceScale = 1.0f;
#ifdef _DEBUG
m_iAmmoType = -1;
m_vecSrc.Init( VEC_T_NAN, VEC_T_NAN, VEC_T_NAN );
m_vecDirShooting.Init( VEC_T_NAN, VEC_T_NAN, VEC_T_NAN );
#endif
}
FireBulletsInfo_t( int nShots, const Vector &vecSrc, const Vector &vecDir, const Vector &vecSpread, float flDistance, int nAmmoType )
{
m_iShots = nShots;
m_vecSrc = vecSrc;
m_vecDirShooting = vecDir;
m_vecSpread = vecSpread;
m_flDistance = flDistance;
m_iAmmoType = nAmmoType;
m_iTracerFreq = 4;
m_iDamage = 0;
m_iPlayerDamage = 0;
m_pAttacker = NULL;
m_nFlags = 0;
m_pAdditionalIgnoreEnt = NULL;
m_flDamageForceScale = 1.0f;
}
int m_iShots;
Vector m_vecSrc;
Vector m_vecDirShooting;
Vector m_vecSpread;
float m_flDistance;
int m_iAmmoType;
int m_iTracerFreq;
int m_iDamage;
int m_iPlayerDamage; // Damage to be used instead of m_iDamage if we hit a player
int m_nFlags; // See FireBulletsFlags_t
float m_flDamageForceScale;
CBaseEntity *m_pAttacker;
CBaseEntity *m_pAdditionalIgnoreEnt;
};
//-----------------------------------------------------------------------------
// Purpose: Data for making the MOVETYPE_STEP entities appear to simulate every frame
// We precompute the simulation and then meter it out each tick during networking of the
// entities origin and orientation. Uses a bit more bandwidth, but it solves the NPCs interacting
// with elevators/lifts bugs.
//-----------------------------------------------------------------------------
struct StepSimulationStep
{
int nTickCount;
Vector vecOrigin;
Quaternion qRotation;
};
struct StepSimulationData
{
// Are we using the Step Simulation Data
bool m_bOriginActive;
bool m_bAnglesActive;
// This is the pre-pre-Think position, orientation (Quaternion) and tick count
StepSimulationStep m_Previous2;
// This is the pre-Think position, orientation (Quaternion) and tick count
StepSimulationStep m_Previous;
// This is a potential mid-think position, orientation (Quaternion) and tick count
// Used to mark motion discontinuities that happen between thinks
StepSimulationStep m_Discontinuity;
// This is the goal or post-Think position and orientation (and Quaternion for blending) and next think time tick
StepSimulationStep m_Next;
QAngle m_angNextRotation;
// This variable is used so that we only compute networked origin/angles once per tick
int m_nLastProcessTickCount;
// The computed/interpolated network origin/angles to use
Vector m_vecNetworkOrigin;
QAngle m_angNetworkAngles;
};
//-----------------------------------------------------------------------------
// Purpose: Simple state tracking for changing model sideways shrinkage during barnacle swallow
//-----------------------------------------------------------------------------
struct ModelWidthScale
{
float m_flModelWidthScaleStart;
float m_flModelWidthScaleGoal;
float m_flModelWidthScaleFinishTime;
float m_flModelWidthScaleStartTime;
};
#include "soundflags.h"
struct CSoundParameters;
typedef short HSOUNDSCRIPTHANDLE;
//-----------------------------------------------------------------------------
// Purpose: Aggregates and sets default parameters for EmitSound function calls
//-----------------------------------------------------------------------------
struct EmitSound_t
{
EmitSound_t() :
m_nChannel( 0 ),
m_pSoundName( 0 ),
m_flVolume( VOL_NORM ),
m_SoundLevel( SNDLVL_NONE ),
m_nFlags( 0 ),
m_nPitch( PITCH_NORM ),
m_pOrigin( 0 ),
m_flSoundTime( 0.0f ),
m_pflSoundDuration( 0 ),
m_bEmitCloseCaption( true ),
m_bWarnOnMissingCloseCaption( false ),
m_bWarnOnDirectWaveReference( false ),
m_nSpeakerEntity( -1 ),
m_UtlVecSoundOrigin(),
m_hSoundScriptHandle( -1 )
{
}
EmitSound_t( const CSoundParameters &src );
int m_nChannel;
char const *m_pSoundName;
float m_flVolume;
soundlevel_t m_SoundLevel;
int m_nFlags;
int m_nPitch;
const Vector *m_pOrigin;
float m_flSoundTime;
float *m_pflSoundDuration;
bool m_bEmitCloseCaption;
bool m_bWarnOnMissingCloseCaption;
bool m_bWarnOnDirectWaveReference;
int m_nSpeakerEntity;
mutable CUtlVector< Vector > m_UtlVecSoundOrigin; // Actual sound origin(s) (can be multiple if sound routed through speaker entity(ies) )
mutable HSOUNDSCRIPTHANDLE m_hSoundScriptHandle;
};
#define MAX_ACTORS_IN_SCENE 16
#endif // SHAREDDEFS_H