158 lines
4.0 KiB
C
Raw Normal View History

2013-12-02 19:31:46 -08:00
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "Color.h"
#ifndef COMBINE_MINE_H
#define COMBINE_MINE_H
#ifdef _WIN32
#pragma once
#endif
class CSoundPatch;
//---------------------------------------------------------
//---------------------------------------------------------
#define BOUNCEBOMB_HOOK_RANGE 64
#define BOUNCEBOMB_WARN_RADIUS 245.0 // Must be slightly less than physcannon!
#define BOUNCEBOMB_DETONATE_RADIUS 100.0
#define BOUNCEBOMB_EXPLODE_RADIUS 125.0
#define BOUNCEBOMB_EXPLODE_DAMAGE 150.0
#include "player_pickup.h"
Merged dev changes 9/28/2019 - Experimental RPC stuff for the future - Fixed players running over allies with vehicles (kind of) - Modified redirect filter infrastructure to support when there's no target filter (meaning it will just make sure the entity exists) - Fixed SDK_EyeRefract - Fixed env_beam SetStart/EndEntity - New "OnStateChange" output on NPCs - scripted_face removed (use generic facing VCDs instead) - Fixed RPC - View ID nodraw keyvalue + reflective glass view ID fix - CopyAnimationDataFrom expansion (more variables copied) - Fixed pre-Mapbase env_projectedtextures not updating after loading a save - Fixed(?) player companion grenade throwing being interrupted - Added convars for secondary and NPC shotgun pellet amounts - NPC fade distance/scale transfers to its ragdoll - Made node graph rebuild occur sooner after map load - Added option to disable "node graph out of date" message - Fixed ent_fire delay (decimals discarded before) - "SetFilter" on func_clip_vphysics - Fixed func_tank zero barrel (untested) - Fixed npc_turret_ground parenting fix - Added toggle-able weapon_crossbow experimental hit location code - Fixed ally grenades being considered Combine grenades - Added SDK_MonitorScreen and SDK_UnlitTwoTexture - Updated README - Added !activator/!caller support to logic_collision_pair - Fixed ortho not working in script_intro - Added Nbc66's closed captioning language fix - Applied fade fix to server ragdolls - Added combine_mine friend/foe filters - Fixed env_starfield pausing - Reworked PickupWeapon/Item inputs - Fixed context response system $ usage - Fixed env_break_shooter velocity/speed - Made func_breakable "Spawn on break" support other entities - Fixed OnThrowGrenade > point_entity_replace blip - Added mapname to logic_externaldata - Added "Random Template" to point_template - Added "Use LOS" to trigger_look - Added flags based on L4D(2) to trigger_playermovement - Added npc_combine_s "Alternate Capable" keyvalue that enables both grenades and alt-fire at the same time regardless of elite status - Fixed npc_combine_s DropGrenade input - Miscellaneous code and comment changes
2019-09-28 22:56:52 +00:00
#ifdef MAPBASE
#include "filters.h"
#endif
2013-12-02 19:31:46 -08:00
class CBounceBomb : public CBaseAnimating, public CDefaultPlayerPickupVPhysics
{
DECLARE_CLASS( CBounceBomb, CBaseAnimating );
public:
#ifdef MAPBASE
CBounceBomb() { m_pWarnSound = NULL; m_bPlacedByPlayer = false; m_flExplosionDelay = 0.5f; }
#else
2013-12-02 19:31:46 -08:00
CBounceBomb() { m_pWarnSound = NULL; m_bPlacedByPlayer = false; }
#endif
2013-12-02 19:31:46 -08:00
void Precache();
void Spawn();
void OnRestore();
int DrawDebugTextOverlays(void);
void SetMineState( int iState );
int GetMineState() { return m_iMineState; }
bool IsValidLocation();
void Flip( const Vector &vecForce, const AngularImpulse &torque );
void SearchThink();
void BounceThink();
void SettleThink();
void CaptiveThink();
void ExplodeThink();
void ExplodeTouch( CBaseEntity *pOther );
void CavernBounceThink(); ///< an alternative style of bouncing used for the citizen modded bouncers
bool IsAwake() { return m_bAwake; }
void Wake( bool bWake );
float FindNearestNPC();
void SetNearestNPC( CBaseEntity *pNearest ) { m_hNearestNPC.Set( pNearest ); }
int OnTakeDamage( const CTakeDamageInfo &info );
bool IsFriend( CBaseEntity *pEntity );
void UpdateLight( bool bTurnOn, unsigned int r, unsigned int g, unsigned int b, unsigned int a );
bool IsLightOn() { return m_hSprite.Get() != NULL; }
void OnPhysGunPickup( CBasePlayer *pPhysGunUser, PhysGunPickup_t reason = PICKED_UP_BY_CANNON );
void OnPhysGunDrop( CBasePlayer *pPhysGunUser, PhysGunDrop_t reason );
bool ForcePhysgunOpen( CBasePlayer *pPlayer ) { return true; }
bool HasPreferredCarryAnglesForPlayer( CBasePlayer *pPlayer ) { return true; }
virtual QAngle PreferredCarryAngles( void ) { return vec3_angle; }
CBasePlayer *HasPhysicsAttacker( float dt );
bool IsPlayerPlaced() { return m_bPlacedByPlayer; }
bool CreateVPhysics()
{
VPhysicsInitNormal( SOLID_VPHYSICS, 0, false );
return true;
}
void Pickup();
void OpenHooks( bool bSilent = false );
void CloseHooks();
DECLARE_DATADESC();
static string_t gm_iszFloorTurretClassname;
static string_t gm_iszGroundTurretClassname;
private:
float m_flExplosionDelay;
bool m_bAwake;
bool m_bBounce;
EHANDLE m_hNearestNPC;
EHANDLE m_hSprite;
Color m_LastSpriteColor;
float m_flHookPositions;
int m_iHookN;
int m_iHookE;
int m_iHookS;
int m_iAllHooks;
CSoundPatch *m_pWarnSound;
bool m_bLockSilently;
bool m_bFoeNearest;
float m_flIgnoreWorldTime;
bool m_bDisarmed;
#ifdef MAPBASE
int m_iInitialState;
#endif
2013-12-02 19:31:46 -08:00
bool m_bPlacedByPlayer;
bool m_bHeldByPhysgun;
int m_iFlipAttempts;
int m_iModification;
CHandle<CBasePlayer> m_hPhysicsAttacker;
float m_flLastPhysicsInfluenceTime;
float m_flTimeGrabbed;
IPhysicsConstraint *m_pConstraint;
int m_iMineState;
Merged dev changes 9/28/2019 - Experimental RPC stuff for the future - Fixed players running over allies with vehicles (kind of) - Modified redirect filter infrastructure to support when there's no target filter (meaning it will just make sure the entity exists) - Fixed SDK_EyeRefract - Fixed env_beam SetStart/EndEntity - New "OnStateChange" output on NPCs - scripted_face removed (use generic facing VCDs instead) - Fixed RPC - View ID nodraw keyvalue + reflective glass view ID fix - CopyAnimationDataFrom expansion (more variables copied) - Fixed pre-Mapbase env_projectedtextures not updating after loading a save - Fixed(?) player companion grenade throwing being interrupted - Added convars for secondary and NPC shotgun pellet amounts - NPC fade distance/scale transfers to its ragdoll - Made node graph rebuild occur sooner after map load - Added option to disable "node graph out of date" message - Fixed ent_fire delay (decimals discarded before) - "SetFilter" on func_clip_vphysics - Fixed func_tank zero barrel (untested) - Fixed npc_turret_ground parenting fix - Added toggle-able weapon_crossbow experimental hit location code - Fixed ally grenades being considered Combine grenades - Added SDK_MonitorScreen and SDK_UnlitTwoTexture - Updated README - Added !activator/!caller support to logic_collision_pair - Fixed ortho not working in script_intro - Added Nbc66's closed captioning language fix - Applied fade fix to server ragdolls - Added combine_mine friend/foe filters - Fixed env_starfield pausing - Reworked PickupWeapon/Item inputs - Fixed context response system $ usage - Fixed env_break_shooter velocity/speed - Made func_breakable "Spawn on break" support other entities - Fixed OnThrowGrenade > point_entity_replace blip - Added mapname to logic_externaldata - Added "Random Template" to point_template - Added "Use LOS" to trigger_look - Added flags based on L4D(2) to trigger_playermovement - Added npc_combine_s "Alternate Capable" keyvalue that enables both grenades and alt-fire at the same time regardless of elite status - Fixed npc_combine_s DropGrenade input - Miscellaneous code and comment changes
2019-09-28 22:56:52 +00:00
#ifdef MAPBASE
// Makes the filters the exclusive factor in determining friend/foe
bool m_bFilterExclusive;
string_t m_iszEnemyFilter;
CHandle<CBaseFilter> m_hEnemyFilter;
void InputSetEnemyFilter( inputdata_t &inputdata );
string_t m_iszFriendFilter;
CHandle<CBaseFilter> m_hFriendFilter;
void InputSetFriendFilter( inputdata_t &inputdata );
#endif
2013-12-02 19:31:46 -08:00
COutputEvent m_OnPulledUp;
void InputDisarm( inputdata_t &inputdata );
#ifdef MAPBASE
void InputBounce( inputdata_t &inputdata );
void InputBounceAtTarget( inputdata_t &inputdata );
COutputEvent m_OnTriggered;
COutputEvent m_OnExplode;
#endif
2013-12-02 19:31:46 -08:00
};
#endif // COMBINE_MINE_H