mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-13 04:09:09 +00:00
upload "kind" alien swarm
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -69,6 +69,8 @@ BEGIN_DATADESC( CAI_ActBusyBehavior )
|
||||
DEFINE_FIELD( m_iNumEnemiesInSafeZone, FIELD_INTEGER ),
|
||||
END_DATADESC();
|
||||
|
||||
LINK_BEHAVIOR_TO_CLASSNAME( CAI_ActBusyBehavior );
|
||||
|
||||
enum
|
||||
{
|
||||
ACTBUSY_SIGHT_METHOD_FULL = 0, // LOS and Viewcone
|
||||
@@ -677,7 +679,7 @@ bool CAI_ActBusyBehavior::ShouldIgnoreSound( CSound *pSound )
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( pBusyAnim && ( ( pBusyAnim->iBusyInterruptType == BA_INT_AMBUSH ) || ( pBusyAnim->iBusyInterruptType == BA_INT_COMBAT ) ) )
|
||||
if ( pBusyAnim && ( pBusyAnim->iBusyInterruptType == BA_INT_AMBUSH ) || ( pBusyAnim->iBusyInterruptType == BA_INT_COMBAT ) )
|
||||
{
|
||||
/*
|
||||
// Robin: First version ignored sounds in front of the NPC.
|
||||
@@ -952,12 +954,14 @@ Activity CAI_ActBusyBehavior::NPC_TranslateActivity( Activity nActivity )
|
||||
//-----------------------------------------------------------------------------
|
||||
void CAI_ActBusyBehavior::HandleAnimEvent( animevent_t *pEvent )
|
||||
{
|
||||
if( pEvent->event == AE_ACTBUSY_WEAPON_FIRE_ON )
|
||||
int nEvent = pEvent->Event();
|
||||
|
||||
if( nEvent == AE_ACTBUSY_WEAPON_FIRE_ON )
|
||||
{
|
||||
m_bAutoFireWeapon = true;
|
||||
return;
|
||||
}
|
||||
else if( pEvent->event == AE_ACTBUSY_WEAPON_FIRE_OFF )
|
||||
else if( nEvent == AE_ACTBUSY_WEAPON_FIRE_OFF )
|
||||
{
|
||||
m_bAutoFireWeapon = false;
|
||||
return;
|
||||
@@ -1500,7 +1504,7 @@ bool CAI_ActBusyBehavior::ShouldPlayerAvoid( void )
|
||||
{
|
||||
if ( IsCurSchedule ( SCHED_ACTBUSY_START_BUSYING ) )
|
||||
{
|
||||
if ( ( GetCurTask() && GetCurTask()->iTask == TASK_WAIT_FOR_MOVEMENT ) || GetOuter()->GetTask()->iTask == TASK_ACTBUSY_PLAY_ENTRY )
|
||||
if ( GetCurTask() && GetCurTask()->iTask == TASK_WAIT_FOR_MOVEMENT || GetOuter()->GetTask()->iTask == TASK_ACTBUSY_PLAY_ENTRY )
|
||||
return true;
|
||||
}
|
||||
else if ( IsCurSchedule(SCHED_ACTBUSY_STOP_BUSYING) )
|
||||
@@ -1645,7 +1649,7 @@ void CAI_ActBusyBehavior::PlaySoundForActBusy( busyanimparts_t AnimPart )
|
||||
CAI_Expresser *pExpresser = GetOuter()->GetExpresser();
|
||||
if ( pExpresser )
|
||||
{
|
||||
const char *concept = STRING(pBusyAnim->iszSounds[AnimPart]);
|
||||
AIConcept_t concept(STRING(pBusyAnim->iszSounds[AnimPart]));
|
||||
|
||||
// Must be able to speak the concept
|
||||
if ( !pExpresser->IsSpeaking() && pExpresser->CanSpeakConcept( concept ) )
|
||||
@@ -2094,7 +2098,7 @@ void CAI_ActBusyBehavior::RunTask( const Task_t *pTask )
|
||||
// Trace my normal hull over this spot to see if I'm able to stand up right now.
|
||||
trace_t tr;
|
||||
CTraceFilterOnlyNPCsAndPlayer filter( GetOuter(), COLLISION_GROUP_NONE );
|
||||
UTIL_TraceHull( GetOuter()->GetAbsOrigin(), GetOuter()->GetAbsOrigin(), NAI_Hull::Mins( HULL_HUMAN ), NAI_Hull::Maxs( HULL_HUMAN ), MASK_NPCSOLID, &filter, &tr );
|
||||
UTIL_TraceHull( GetOuter()->GetAbsOrigin(), GetOuter()->GetAbsOrigin(), NAI_Hull::Mins( HULL_HUMAN ), NAI_Hull::Maxs( HULL_HUMAN ), GetOuter()->GetAITraceMask(), &filter, &tr );
|
||||
|
||||
if( tr.startsolid )
|
||||
{
|
||||
@@ -2493,7 +2497,7 @@ void CAI_ActBusyGoal::InputForceNPCToActBusy( inputdata_t &inputdata )
|
||||
pHintNode = dynamic_cast<CAI_Hint*>(pEntity);
|
||||
if ( !pHintNode )
|
||||
{
|
||||
Msg("ai_goal_actbusy input ForceNPCToActBusy fired targeting an entity that isn't a hintnode.\n");
|
||||
Msg("ai_goal_actbusy input ForceNPCToActBusy fired targeting an entity that isn't a hintnode.\n", pszParam);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -99,6 +99,8 @@ public:
|
||||
NEXT_CONDITION,
|
||||
};
|
||||
|
||||
static const char *GetClassName() { return "behavior_act_busy"; }
|
||||
virtual const char *GetClassNameV() { return GetClassName(); }
|
||||
virtual const char *GetName() { return "ActBusy"; }
|
||||
|
||||
void Enable( CAI_ActBusyGoal *pGoal, float flRange, bool bVisibleOnly );
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -360,17 +360,17 @@ void CAI_Spotlight::UpdateSpotlightEndpoint( void )
|
||||
// Fade out spotlight end if past max length.
|
||||
if (m_flSpotlightCurLength > 2*m_flSpotlightMaxLength)
|
||||
{
|
||||
m_hSpotlightTarget->SetRenderColorA( 0 );
|
||||
m_hSpotlightTarget->SetRenderAlpha( 0 );
|
||||
m_hSpotlight->SetFadeLength(m_flSpotlightMaxLength);
|
||||
}
|
||||
else if (m_flSpotlightCurLength > m_flSpotlightMaxLength)
|
||||
{
|
||||
m_hSpotlightTarget->SetRenderColorA( (1-((m_flSpotlightCurLength-m_flSpotlightMaxLength)/m_flSpotlightMaxLength)) );
|
||||
m_hSpotlightTarget->SetRenderAlpha( (1-((m_flSpotlightCurLength-m_flSpotlightMaxLength)/m_flSpotlightMaxLength)) );
|
||||
m_hSpotlight->SetFadeLength(m_flSpotlightMaxLength);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_hSpotlightTarget->SetRenderColorA( 1.0 );
|
||||
m_hSpotlightTarget->SetRenderAlpha( 1.0 );
|
||||
m_hSpotlight->SetFadeLength(m_flSpotlightCurLength);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Base class for helicopters & helicopter-type vehicles
|
||||
//
|
||||
@@ -116,6 +116,7 @@ BEGIN_DATADESC( CBaseHelicopter )
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "DisableRotorWash", InputDisableRotorWash ),
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "MoveTopSpeed", InputMoveTopSpeed ),
|
||||
DEFINE_INPUTFUNC( FIELD_FLOAT, "MoveSpecifiedSpeed", InputMoveSpecifiedSpeed ),
|
||||
DEFINE_INPUTFUNC( FIELD_FLOAT, "SetMaxSpeed", InputSetMaxSpeed ),
|
||||
DEFINE_INPUTFUNC( FIELD_STRING, "SetAngles", InputSetAngles ),
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "EnableRotorSound", InputEnableRotorSound ),
|
||||
DEFINE_INPUTFUNC( FIELD_VOID, "DisableRotorSound", InputDisableRotorSound ),
|
||||
@@ -147,8 +148,11 @@ CBaseHelicopter::CBaseHelicopter( void )
|
||||
//------------------------------------------------------------------------------
|
||||
void CBaseHelicopter::Precache( void )
|
||||
{
|
||||
BaseClass::Precache();
|
||||
CRopeKeyframe::PrecacheShakeRopes();
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Purpose :
|
||||
// Input :
|
||||
@@ -660,7 +664,7 @@ void CBaseHelicopter::DoRotorPhysicsPush( const Vector &vecRotorOrigin, float fl
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Updates the enemy
|
||||
// Returns the max distance to search
|
||||
//------------------------------------------------------------------------------
|
||||
float CBaseHelicopter::EnemySearchDistance( )
|
||||
{
|
||||
@@ -1264,14 +1268,14 @@ void CBaseHelicopter::DrawDebugGeometryOverlays(void)
|
||||
// Input :
|
||||
// Output :
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBaseHelicopter::TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator )
|
||||
void CBaseHelicopter::TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr )
|
||||
{
|
||||
// Take no damage from trace attacks unless it's blast damage. RadiusDamage() sometimes calls
|
||||
// TraceAttack() as a means for delivering blast damage. Usually when the explosive penetrates
|
||||
// the target. (RPG missiles do this sometimes).
|
||||
if( info.GetDamageType() & (DMG_BLAST|DMG_AIRBOAT) )
|
||||
{
|
||||
BaseClass::TraceAttack( info, vecDir, ptr, pAccumulator );
|
||||
BaseClass::TraceAttack( info, vecDir, ptr );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1425,6 +1429,11 @@ void CBaseHelicopter::InputDisableRotorWash( inputdata_t &inputdata )
|
||||
// Causes the helicopter to immediately accelerate to its desired velocity
|
||||
//-----------------------------------------------------------------------------
|
||||
void CBaseHelicopter::InputMoveTopSpeed( inputdata_t &inputdata )
|
||||
{
|
||||
MoveTopSpeed( GetMaxSpeed() );
|
||||
}
|
||||
|
||||
void CBaseHelicopter::MoveTopSpeed( float flInstantSpeed )
|
||||
{
|
||||
Vector vecVelocity;
|
||||
ComputeActualTargetPosition( GetMaxSpeed(), 1.0f, 0.0f, &vecVelocity, false );
|
||||
@@ -1436,7 +1445,7 @@ void CBaseHelicopter::InputMoveTopSpeed( inputdata_t &inputdata )
|
||||
GetVectors( &vecVelocity, NULL, NULL );
|
||||
}
|
||||
|
||||
vecVelocity *= GetMaxSpeed();
|
||||
vecVelocity *= flInstantSpeed;
|
||||
SetAbsVelocity( vecVelocity );
|
||||
}
|
||||
|
||||
@@ -1461,6 +1470,11 @@ void CBaseHelicopter::InputMoveSpecifiedSpeed( inputdata_t &inputdata )
|
||||
SetAbsVelocity( vecVelocity );
|
||||
}
|
||||
|
||||
void CBaseHelicopter::InputSetMaxSpeed( inputdata_t &inputdata )
|
||||
{
|
||||
m_flMaxSpeed = inputdata.value.Float();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Input values
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Base class for helicopters & helicopter-type vehicles
|
||||
//
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
virtual void ApplySidewaysDrag( const Vector &vecRight );
|
||||
virtual void ApplyGeneralDrag( void );
|
||||
|
||||
void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator );
|
||||
void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
|
||||
|
||||
virtual bool FireGun( void );
|
||||
|
||||
@@ -227,8 +227,11 @@ protected:
|
||||
void InputDisableRotorWash( inputdata_t &inputdata );
|
||||
void InputMoveTopSpeed( inputdata_t &inputdata ); // Causes the helicopter to immediately accelerate to its desired velocity
|
||||
void InputMoveSpecifiedSpeed( inputdata_t &inputdata );
|
||||
void InputSetMaxSpeed( inputdata_t &inputdata );
|
||||
void InputSetAngles( inputdata_t &inputdata ); // Sets the angles of the helicopter
|
||||
|
||||
void MoveTopSpeed( float flInstantSpeed );
|
||||
|
||||
protected:
|
||||
// Custom conservative collision volumes
|
||||
Vector m_cullBoxMins;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Base class for simple projectiles
|
||||
//
|
||||
@@ -13,7 +13,7 @@
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
LINK_ENTITY_TO_CLASS( baseprojectile, CBaseSpriteProjectile );
|
||||
LINK_ENTITY_TO_CLASS( basespriteprojectile, CBaseSpriteProjectile );
|
||||
|
||||
//---------------------------------------------------------
|
||||
// Save/Restore
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Base class for simple projectiles
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -91,7 +91,7 @@ void CSpeaker::Precache( void )
|
||||
SetNextThink( gpGlobals->curtime + random->RandomFloat(5.0, 15.0) );
|
||||
}
|
||||
|
||||
if ( !m_pInstancedResponseSystem && Q_strlen( STRING(m_iszRuleScriptFile) ) > 0 )
|
||||
if ( !m_pInstancedResponseSystem )
|
||||
{
|
||||
m_pInstancedResponseSystem = PrecacheCustomResponseSystem( STRING( m_iszRuleScriptFile ) );
|
||||
}
|
||||
@@ -139,7 +139,7 @@ int CSpeaker::Restore( IRestore &restore )
|
||||
restore.StartBlock( szResponseSystemBlockName );
|
||||
if ( !Q_stricmp( szResponseSystemBlockName, "InstancedResponseSystem" ) )
|
||||
{
|
||||
if ( !m_pInstancedResponseSystem && Q_strlen( STRING(m_iszRuleScriptFile) ) > 0 )
|
||||
if ( !m_pInstancedResponseSystem )
|
||||
{
|
||||
m_pInstancedResponseSystem = PrecacheCustomResponseSystem( STRING( m_iszRuleScriptFile ) );
|
||||
if ( m_pInstancedResponseSystem )
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -42,7 +42,7 @@ enum FUNCTANK_EFFECT_HANDLING
|
||||
{
|
||||
EH_NONE, // Use the effect settings
|
||||
EH_AR2, // Use AR2 effects
|
||||
EH_COMBINE_CANNON // Large Combine cannon
|
||||
EH_COMBINE_CANNON, // Large Combine cannon
|
||||
};
|
||||
|
||||
enum TANKBULLET
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Projectile shot from the AR2
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Projectile shot by city scanner
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -54,7 +54,7 @@ static CHL2EventLog s_HL2EventLog;
|
||||
//-----------------------------------------------------------------------------
|
||||
// Singleton access
|
||||
//-----------------------------------------------------------------------------
|
||||
IGameSystem* GameLogSystem()
|
||||
CEventLog* GameLogSystem()
|
||||
{
|
||||
return &s_HL2EventLog;
|
||||
}
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2008, Valve Corporation, All rights reserved. ====
|
||||
//
|
||||
// Purpose: Player for HL2.
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef HL2_PLAYER_H
|
||||
#define HL2_PLAYER_H
|
||||
#pragma once
|
||||
|
||||
|
||||
#include "player.h"
|
||||
#include "hl2_playerlocaldata.h"
|
||||
#include "simtimer.h"
|
||||
@@ -27,11 +25,11 @@ enum HL2PlayerPhysFlag_e
|
||||
{
|
||||
// 1 -- 5 are used by enum PlayerPhysFlag_e in player.h
|
||||
|
||||
PFLAG_ONBARNACLE = ( 1<<6 ) // player is hangning from the barnalce
|
||||
PFLAG_ONBARNACLE = ( 1<<6 ), // player is hangning from the barnalce
|
||||
PFLAG_IMMOBILIZED = ( 1<<7 ) // player is immobilized
|
||||
};
|
||||
|
||||
class IPhysicsPlayerController;
|
||||
class CLogicPlayerProxy;
|
||||
|
||||
struct commandgoal_t
|
||||
{
|
||||
@@ -122,6 +120,8 @@ public:
|
||||
|
||||
Class_T Classify ( void );
|
||||
|
||||
void CreateSounds( void );
|
||||
|
||||
// from CBasePlayer
|
||||
virtual void SetupVisibility( CBaseEntity *pViewEntity, unsigned char *pvs, int pvssize );
|
||||
|
||||
@@ -178,6 +178,8 @@ public:
|
||||
bool IsZooming( void );
|
||||
void CheckSuitZoom( void );
|
||||
|
||||
|
||||
|
||||
// Walking
|
||||
void StartWalking( void );
|
||||
void StopWalking( void );
|
||||
@@ -220,15 +222,11 @@ public:
|
||||
virtual bool Weapon_Switch( CBaseCombatWeapon *pWeapon, int viewmodelindex = 0 );
|
||||
virtual bool Weapon_CanSwitchTo( CBaseCombatWeapon *pWeapon );
|
||||
|
||||
void FirePlayerProxyOutput( const char *pszOutputName, variant_t variant, CBaseEntity *pActivator, CBaseEntity *pCaller );
|
||||
|
||||
CLogicPlayerProxy *GetPlayerProxy( void );
|
||||
|
||||
// Flashlight Device
|
||||
void CheckFlashlight( void );
|
||||
int FlashlightIsOn( void );
|
||||
void FlashlightTurnOn( void );
|
||||
void FlashlightTurnOff( void );
|
||||
virtual bool FlashlightTurnOn( bool playSound = false );
|
||||
virtual void FlashlightTurnOff( bool playSound = false );
|
||||
bool IsIlluminatedByFlashlight( CBaseEntity *pEntity, float *flReturnDot );
|
||||
void SetFlashlightPowerDrainScale( float flScale ) { m_flFlashlightPowerDrainScale = flScale; }
|
||||
|
||||
@@ -242,7 +240,7 @@ public:
|
||||
virtual void ForceDropOfCarriedPhysObjects( CBaseEntity *pOnlyIfHoldindThis );
|
||||
virtual float GetHeldObjectMass( IPhysicsObject *pHeldObject );
|
||||
|
||||
virtual bool IsFollowingPhysics( void ) { return (m_afPhysicsFlags & PFLAG_ONBARNACLE) > 0; }
|
||||
virtual bool IsFollowingPhysics( void ) { return (m_afPhysicsFlags & ( PFLAG_ONBARNACLE | PFLAG_IMMOBILIZED ) ) > 0; }
|
||||
void InputForceDropPhysObjects( inputdata_t &data );
|
||||
|
||||
virtual void Event_Killed( const CTakeDamageInfo &info );
|
||||
@@ -259,6 +257,9 @@ public:
|
||||
virtual void RemoveSuit( void );
|
||||
void HandleAdmireGlovesAnimation( void );
|
||||
void StartAdmireGlovesAnimation( void );
|
||||
|
||||
virtual void SetActiveSpecialSuitAbility( CBaseCombatWeapon *pAbility );
|
||||
virtual CBaseCombatWeapon *GetActiveSpecialSuitAbility( void ) const;
|
||||
|
||||
void HandleSpeedChanges( void );
|
||||
|
||||
@@ -292,6 +293,7 @@ protected:
|
||||
virtual void UpdateWeaponPosture( void );
|
||||
|
||||
virtual void ItemPostFrame();
|
||||
virtual void SpecialSuitAbilityPostFrame();
|
||||
virtual void PlayUseDenySound();
|
||||
|
||||
private:
|
||||
@@ -300,9 +302,6 @@ private:
|
||||
void OnSquadMemberKilled( inputdata_t &data );
|
||||
|
||||
Class_T m_nControlClass; // Class when player is controlling another entity
|
||||
// This player's HL2 specific data that should only be replicated to
|
||||
// the player and not to other players.
|
||||
CNetworkVarEmbedded( CHL2PlayerLocalData, m_HL2Local );
|
||||
|
||||
float m_flTimeAllSuitDevicesOff;
|
||||
|
||||
@@ -314,10 +313,16 @@ private:
|
||||
CNetworkVarForDerived( bool, m_fIsWalking );
|
||||
|
||||
protected: // Jeep: Portal_Player needs access to this variable to overload PlayerUse for picking up objects through portals
|
||||
// This player's HL2 specific data that should only be replicated to
|
||||
// the player and not to other players.
|
||||
CNetworkVarEmbedded( CHL2PlayerLocalData, m_HL2Local );
|
||||
|
||||
bool m_bPlayUseDenySound; // Signaled by PlayerUse, but can be unset by HL2 ladder code...
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
CAI_Squad * m_pPlayerAISquad;
|
||||
CSimpleSimTimer m_CommanderUpdateTimer;
|
||||
float m_RealTimeLastSquadCommand;
|
||||
@@ -336,14 +341,17 @@ private:
|
||||
float m_flNextFlashlightCheckTime;
|
||||
float m_flFlashlightPowerDrainScale;
|
||||
|
||||
bool m_bAlt1ToggledOn;
|
||||
bool m_bAlt1ToggledNotReady;
|
||||
|
||||
CHandle<CBaseCombatWeapon> m_hActiveSpecialSuitAbility;
|
||||
|
||||
// Aiming heuristics code
|
||||
float m_flIdleTime; //Amount of time we've been motionless
|
||||
float m_flMoveTime; //Amount of time we've been in motion
|
||||
float m_flLastDamageTime; //Last time we took damage
|
||||
float m_flTargetFindTime;
|
||||
|
||||
EHANDLE m_hPlayerProxy;
|
||||
|
||||
bool m_bFlashlightDisabled;
|
||||
bool m_bUseCappedPhysicsDamageTable;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Implements doors that move when you look at them.
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
// This is a skeleton file for use when creating a new
|
||||
// NPC. Copy and rename this file for the new
|
||||
// NPC and add the copy to the build.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
int RangeAttack1Conditions ( float flDot, float flDist ) { return( 0 ); }
|
||||
|
||||
virtual float GetHitgroupDamageMultiplier( int iHitGroup, const CTakeDamageInfo &info );
|
||||
void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator );
|
||||
void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
|
||||
int OnTakeDamage_Alive( const CTakeDamageInfo &info );
|
||||
virtual float GetReactionDelay( CBaseEntity *pEnemy ) { return 0.0; }
|
||||
|
||||
@@ -239,8 +239,6 @@ public:
|
||||
public:
|
||||
CAI_ActBusyBehavior m_ActBusyBehavior;
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
CSoundPatch *m_pMoanSound;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
void Precache( void );
|
||||
void Spawn( void );
|
||||
int OnTakeDamage_Alive( const CTakeDamageInfo &info );
|
||||
void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator );
|
||||
void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
|
||||
void BuildScheduleTestBits( void );
|
||||
void GatherConditions( void );
|
||||
void PrescheduleThink( void );
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
|
||||
void ClearBurrowPoint( const Vector &origin );
|
||||
|
||||
void Flip( bool bZapped = false );
|
||||
void Flip( bool bZapped = false, Vector vForce = vec3_origin );
|
||||
|
||||
bool CanBecomeRagdoll();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//===== Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ======//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -381,7 +381,7 @@ public:
|
||||
int BloodColor( void ) { return DONT_BLEED; }
|
||||
Class_T Classify ( void ) { return CLASS_COMBINE_GUNSHIP; }
|
||||
virtual int OnTakeDamage_Alive( const CTakeDamageInfo &info );
|
||||
virtual void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator );
|
||||
virtual void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
|
||||
virtual int OnTakeDamage( const CTakeDamageInfo &info );
|
||||
|
||||
// Shot spread
|
||||
@@ -956,6 +956,7 @@ void CNPC_AttackHelicopter::Precache( void )
|
||||
UTIL_PrecacheOther( "env_fire_trail" );
|
||||
Chopper_PrecacheChunks( this );
|
||||
PrecacheModel("models/combine_soldier.mdl");
|
||||
UTIL_PrecacheOther( "env_explosion" );
|
||||
}
|
||||
|
||||
PrecacheScriptSound("NPC_AttackHelicopter.ChargeGun");
|
||||
@@ -980,6 +981,17 @@ void CNPC_AttackHelicopter::Precache( void )
|
||||
|
||||
PrecacheScriptSound( "ReallyLoudSpark" );
|
||||
PrecacheScriptSound( "NPC_AttackHelicopterGrenade.Ping" );
|
||||
|
||||
PrecacheEffect( "ChopperMuzzleFlash" );
|
||||
PrecacheEffect( "TeslaZap" );
|
||||
PrecacheEffect( "TeslaHitboxes" );
|
||||
PrecacheEffect( "HelicopterMegaBomb" );
|
||||
|
||||
const char *pszTracerName = GetTracerType();
|
||||
if ( pszTracerName )
|
||||
{
|
||||
PrecacheEffect( pszTracerName );
|
||||
}
|
||||
}
|
||||
|
||||
int CNPC_AttackHelicopter::ObjectCaps()
|
||||
@@ -1058,6 +1070,7 @@ void CNPC_AttackHelicopter::Spawn( void )
|
||||
InitPathingData( CHOPPER_ARRIVE_DIST, flChaseDist, CHOPPER_AVOID_DIST );
|
||||
SetFarthestPathDist( GetMaxFiringDistance() );
|
||||
|
||||
m_flFrozenMax = 0.0f;
|
||||
m_takedamage = DAMAGE_YES;
|
||||
m_nGunState = GUN_STATE_IDLE;
|
||||
SetHullType( HULL_LARGE_CENTERED );
|
||||
@@ -2740,7 +2753,7 @@ bool CNPC_AttackHelicopter::IsBombDropFair( const Vector &vecBombStartPos, const
|
||||
// dx = 0.5 * a * t^2
|
||||
Vector vecTarget = GetEnemy()->BodyTarget( GetAbsOrigin(), false );
|
||||
float dz = vecBombStartPos.z - vecTarget.z;
|
||||
float dt = (dz > 0.0f) ? sqrt( 2 * dz / GetCurrentGravity() ) : 0.0f;
|
||||
float dt = (dz > 0.0f) ? sqrt( 2 * dz / sv_gravity.GetFloat() ) : 0.0f;
|
||||
|
||||
// Where will the enemy be in that time?
|
||||
Vector vecEnemyVel = GetEnemy()->GetSmoothedVelocity();
|
||||
@@ -2926,7 +2939,7 @@ void CNPC_AttackHelicopter::InputDropBombAtTargetInternal( inputdata_t &inputdat
|
||||
Warning("Bomb target %s is above the chopper!\n", STRING( strBombTarget ) );
|
||||
return;
|
||||
}
|
||||
float dt = sqrt( 2 * dz / GetCurrentGravity() );
|
||||
float dt = sqrt( 2 * dz / sv_gravity.GetFloat() );
|
||||
|
||||
// Compute the velocity that would make it happen
|
||||
Vector vecVelocity;
|
||||
@@ -3470,7 +3483,7 @@ void CNPC_AttackHelicopter::DropCorpse( int nDamage )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CNPC_AttackHelicopter::TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator )
|
||||
void CNPC_AttackHelicopter::TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr )
|
||||
{
|
||||
// Take no damage from trace attacks unless it's blast damage. RadiusDamage() sometimes calls
|
||||
// TraceAttack() as a means for delivering blast damage. Usually when the explosive penetrates
|
||||
@@ -3479,7 +3492,7 @@ void CNPC_AttackHelicopter::TraceAttack( const CTakeDamageInfo &info, const Vect
|
||||
( info.GetInflictor()->Classify() == CLASS_MISSILE ) ||
|
||||
( info.GetAttacker()->Classify() == CLASS_MISSILE ) )
|
||||
{
|
||||
BaseClass::BaseClass::TraceAttack( info, vecDir, ptr, pAccumulator );
|
||||
BaseClass::BaseClass::TraceAttack( info, vecDir, ptr );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4976,6 +4989,10 @@ void CGrenadeHelicopter::Precache( void )
|
||||
PrecacheScriptSound( "NPC_AttackHelicopterGrenade.Ping" );
|
||||
PrecacheScriptSound( "NPC_AttackHelicopterGrenade.PingCaptured" );
|
||||
PrecacheScriptSound( "NPC_AttackHelicopterGrenade.HardImpact" );
|
||||
PrecacheEffect( "HelicopterImpact" );
|
||||
PrecacheEffect( "WaterSurfaceExplosion" );
|
||||
PrecacheEffect( "HelicopterMegaBomb" );
|
||||
UTIL_PrecacheOther( "env_explosion" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Bullseyes act as targets for other NPC's to attack and to trigger
|
||||
// events
|
||||
@@ -89,6 +89,9 @@ BEGIN_DATADESC( CNPC_Bullseye )
|
||||
DEFINE_KEYFIELD( m_fAutoaimRadius, FIELD_FLOAT, "autoaimradius" ),
|
||||
DEFINE_KEYFIELD( m_flFieldOfView, FIELD_FLOAT, "minangle" ),
|
||||
DEFINE_KEYFIELD( m_flMinDistValidEnemy, FIELD_FLOAT, "mindist" ),
|
||||
|
||||
|
||||
|
||||
// DEFINE_FIELD( m_bPerfectAccuracy, FIELD_BOOLEAN ), // Don't save
|
||||
|
||||
// Function Pointers
|
||||
@@ -284,7 +287,7 @@ void CNPC_Bullseye::DecalTrace( trace_t *pOldTrace, char const *decalName )
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
//-----------------------------------------------------------------------------
|
||||
void CNPC_Bullseye::ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName )
|
||||
void CNPC_Bullseye::ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName )
|
||||
{
|
||||
// Get direction of original trace
|
||||
Vector vTraceDir = pTrace->endpos - pTrace->startpos;
|
||||
@@ -369,6 +372,9 @@ bool CNPC_Bullseye::CanBeAnEnemyOf( CBaseEntity *pEnemy )
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
return BaseClass::CanBeAnEnemyOf( pEnemy );
|
||||
}
|
||||
|
||||
@@ -391,7 +397,7 @@ bool CNPC_Bullseye::IsLightDamage( const CTakeDamageInfo &info )
|
||||
// *ptr -
|
||||
// bitsDamageType -
|
||||
//-----------------------------------------------------------------------------
|
||||
void CNPC_Bullseye::TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator )
|
||||
void CNPC_Bullseye::TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr )
|
||||
{
|
||||
//If specified, we must be the enemy of the target
|
||||
if ( m_spawnflags & SF_BULLSEYE_ENEMYDAMAGEONLY )
|
||||
@@ -411,7 +417,7 @@ void CNPC_Bullseye::TraceAttack( const CTakeDamageInfo &info, const Vector &vecD
|
||||
TraceBleed( info.GetDamage(), vecDir, ptr, info.GetDamageType() );
|
||||
}
|
||||
|
||||
BaseClass::TraceAttack( info, vecDir, ptr, pAccumulator );
|
||||
BaseClass::TraceAttack( info, vecDir, ptr );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -34,9 +34,9 @@ public:
|
||||
Class_T Classify( void );
|
||||
void Event_Killed( const CTakeDamageInfo &info );
|
||||
void DecalTrace( trace_t *pTrace, char const *decalName );
|
||||
void ImpactTrace( trace_t *pTrace, int iDamageType, const char *pCustomImpactName );
|
||||
void ImpactTrace( trace_t *pTrace, int iDamageType, char *pCustomImpactName );
|
||||
bool IsLightDamage( const CTakeDamageInfo &info );
|
||||
void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator );
|
||||
void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
|
||||
int OnTakeDamage( const CTakeDamageInfo &info );
|
||||
bool UsePerfectAccuracy( void ) { return m_bPerfectAccuracy; }
|
||||
|
||||
@@ -62,6 +62,8 @@ protected:
|
||||
float m_fAutoaimRadius; // How much to influence player's autoaim.
|
||||
float m_flMinDistValidEnemy;
|
||||
|
||||
|
||||
|
||||
DECLARE_DATADESC();
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: The downtrodden citizens of City 17. Timid when unarmed, they will
|
||||
// rise up against their Combine oppressors when given a weapon.
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
void FixupMattWeapon();
|
||||
|
||||
#ifdef HL2_EPISODIC
|
||||
virtual float GetJumpGravity() const { return 1.8f; }
|
||||
virtual float GetDefaultJumpGravity() const { return 1.8f; }
|
||||
#endif//HL2_EPISODIC
|
||||
|
||||
void OnRestore();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "ai_sentence.h"
|
||||
#include "ai_baseactor.h"
|
||||
|
||||
|
||||
// Used when only what combine to react to what the spotlight sees
|
||||
#define SF_COMBINE_NO_LOOK (1 << 16)
|
||||
#define SF_COMBINE_NO_GRENADEDROP ( 1 << 17 )
|
||||
@@ -30,7 +31,9 @@
|
||||
//=========================================================
|
||||
// >> CNPC_Combine
|
||||
//=========================================================
|
||||
class CNPC_Combine : public CAI_BaseActor
|
||||
class CNPC_Combine :
|
||||
public CAI_BaseActor
|
||||
|
||||
{
|
||||
DECLARE_DATADESC();
|
||||
DEFINE_CUSTOM_AI;
|
||||
@@ -46,13 +49,16 @@ public:
|
||||
bool CheckCanThrowGrenade( const Vector &vecTarget );
|
||||
virtual bool CanGrenadeEnemy( bool bUseFreeKnowledge = true );
|
||||
virtual bool CanAltFireEnemy( bool bUseFreeKnowledge );
|
||||
virtual bool CanTeleportFromEnemy( bool bUseFreeKnowledge = true );
|
||||
virtual bool CanTeleportToLOF( bool bUseFreeKnowledge = true );
|
||||
virtual bool CanTossTeleportGrenade( Vector const &posTarget );
|
||||
int GetGrenadeConditions( float flDot, float flDist );
|
||||
int RangeAttack2Conditions( float flDot, float flDist ); // For innate grenade attack
|
||||
int MeleeAttack1Conditions( float flDot, float flDist ); // For kick/punch
|
||||
bool FVisible( CBaseEntity *pEntity, int traceMask = MASK_BLOCKLOS, CBaseEntity **ppBlocker = NULL );
|
||||
virtual bool IsCurTaskContinuousMove();
|
||||
|
||||
virtual float GetJumpGravity() const { return 1.8f; }
|
||||
virtual float GetDefaultJumpGravity() const { return 1.8f; }
|
||||
|
||||
virtual Vector GetCrouchEyeOffset( void );
|
||||
|
||||
@@ -70,6 +76,7 @@ public:
|
||||
void InputAssault( inputdata_t &inputdata );
|
||||
void InputHitByBugbait( inputdata_t &inputdata );
|
||||
void InputThrowGrenadeAtTarget( inputdata_t &inputdata );
|
||||
void InputThrowTeleportGrenadeAtTarget( inputdata_t &inputdata );
|
||||
|
||||
bool UpdateEnemyMemory( CBaseEntity *pEnemy, const Vector &position, CBaseEntity *pInformer = NULL );
|
||||
|
||||
@@ -126,7 +133,7 @@ public:
|
||||
// Sounds
|
||||
// -------------
|
||||
void DeathSound( void );
|
||||
void PainSound( const CTakeDamageInfo &damageinfo );
|
||||
void PainSound( void );
|
||||
void IdleSound( void );
|
||||
void AlertSound( void );
|
||||
void LostEnemySound( void );
|
||||
@@ -149,6 +156,20 @@ public:
|
||||
|
||||
virtual bool ShouldPickADeathPose( void );
|
||||
|
||||
virtual bool PassesDamageFilter( const CTakeDamageInfo &info );
|
||||
|
||||
protected:
|
||||
virtual bool ComputeTeleportToss(
|
||||
bool bUseFreeKnowledge, bool bPreferCoverPos,
|
||||
float flAngMin, float flAngMax, float flAngPreference,
|
||||
float flDistMin, float flDistMax, float flDistPreference,
|
||||
float flTravelMinDist, float flTravelMaxDist, float flTravelDistPreference );
|
||||
|
||||
virtual void Advisor_OnStartedLevitating();
|
||||
virtual void Advisor_OnFinishedLevitating();
|
||||
virtual void VPhysicsUpdate( IPhysicsObject *pPhysics );
|
||||
virtual void UpdateOnRemove();
|
||||
|
||||
protected:
|
||||
void SetKickDamage( int nDamage ) { m_nKickDamage = nDamage; }
|
||||
CAI_Sentence< CNPC_Combine > *GetSentences() { return &m_Sentences; }
|
||||
@@ -192,6 +213,10 @@ private:
|
||||
SCHED_COMBINE_MOVE_TO_FORCED_GREN_LOS,
|
||||
SCHED_COMBINE_FACE_IDEAL_YAW,
|
||||
SCHED_COMBINE_MOVE_TO_MELEE,
|
||||
SCHED_COMBINE_TELEPORT_GRENADE_FROM_ENEMY,
|
||||
SCHED_COMBINE_TELEPORT_GRENADE_LOF,
|
||||
SCHED_COMBINE_FORCED_TELEPORT_GRENADE_THROW,
|
||||
SCHED_COMBINE_ADVISOR_LEVITATE,
|
||||
NEXT_SCHEDULE,
|
||||
};
|
||||
|
||||
@@ -209,6 +234,8 @@ private:
|
||||
TASK_COMBINE_PLAY_SEQUENCE_FACE_ALTFIRE_TARGET,
|
||||
TASK_COMBINE_GET_PATH_TO_FORCED_GREN_LOS,
|
||||
TASK_COMBINE_SET_STANDING,
|
||||
TASK_WAIT_FOR_TELEPORT,
|
||||
TASK_ADVISOR_LEVITATE,
|
||||
NEXT_TASK
|
||||
};
|
||||
|
||||
@@ -255,6 +282,12 @@ private:
|
||||
virtual bool IsWaitingToRappel( void ) { return m_RappelBehavior.IsWaitingToRappel(); }
|
||||
void BeginRappel() { m_RappelBehavior.BeginRappel(); }
|
||||
|
||||
private:
|
||||
void OnTossedTeleportProjectile( CBaseEntity *pProjectile );
|
||||
void OnTeleportProjectileAction( CBaseEntity *pProjectile, bool bTeleport );
|
||||
|
||||
void FullyLoadWeaponClips();
|
||||
|
||||
private:
|
||||
int m_nKickDamage;
|
||||
Vector m_vecTossVelocity;
|
||||
@@ -277,6 +310,13 @@ private:
|
||||
CAI_Sentence< CNPC_Combine > m_Sentences;
|
||||
|
||||
int m_iNumGrenades;
|
||||
|
||||
int m_iTeleportGrenades;
|
||||
float m_flLastTeleportGrenadeTime;
|
||||
float m_flNextTeleportGrenadeTime;
|
||||
EHANDLE m_hTeleportProjectile;
|
||||
EHANDLE m_hTeleportProjectileForcedTarget;
|
||||
|
||||
CAI_AssaultBehavior m_AssaultBehavior;
|
||||
CCombineStandoffBehavior m_StandoffBehavior;
|
||||
CAI_FollowBehavior m_FollowBehavior;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -56,7 +56,7 @@
|
||||
|
||||
#define GUNSHIP_NUM_DAMAGE_OUTPUTS 4
|
||||
|
||||
extern short g_sModelIndexFireball; // holds the index for the fireball
|
||||
extern int g_sModelIndexFireball; // holds the index for the fireball
|
||||
|
||||
int g_iGunshipEffectIndex = -1;
|
||||
|
||||
@@ -273,7 +273,7 @@ public:
|
||||
void ApplyGeneralDrag( void );
|
||||
void ApplySidewaysDrag( const Vector &vecRight );
|
||||
|
||||
void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator );
|
||||
void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
|
||||
|
||||
void UpdateEnemyTarget( void );
|
||||
|
||||
@@ -364,6 +364,8 @@ private:
|
||||
|
||||
CBaseEntity *m_pRotorWashModel;
|
||||
QAngle m_vecAngAcceleration;
|
||||
float m_fMaxAngAcceleration;
|
||||
Vector m_vMaxAngVelocity;
|
||||
|
||||
float m_flEndDestructTime;
|
||||
|
||||
@@ -429,6 +431,8 @@ BEGIN_DATADESC( CNPC_CombineGunship )
|
||||
DEFINE_SOUNDPATCH( m_pAirBlastSound ),
|
||||
DEFINE_SOUNDPATCH( m_pCannonSound ),
|
||||
DEFINE_FIELD( m_vecAngAcceleration,FIELD_VECTOR ),
|
||||
DEFINE_KEYFIELD( m_fMaxAngAcceleration, FIELD_FLOAT, "MaxAngAccel" ),
|
||||
DEFINE_KEYFIELD( m_vMaxAngVelocity, FIELD_VECTOR, "MaxAngVelocity" ),
|
||||
DEFINE_FIELD( m_flDeltaT, FIELD_FLOAT ),
|
||||
DEFINE_FIELD( m_flTimeNextAttack, FIELD_TIME ),
|
||||
DEFINE_FIELD( m_flNextSeeEnemySound, FIELD_TIME ),
|
||||
@@ -494,6 +498,9 @@ CNPC_CombineGunship::CNPC_CombineGunship( void )
|
||||
m_pCrashingController = NULL;
|
||||
m_hRagdoll = NULL;
|
||||
m_hCrashTarget = NULL;
|
||||
|
||||
m_fMaxAngAcceleration = 1000.0f;
|
||||
m_vMaxAngVelocity = Vector( 300.0f, 120.0f, 300.0f );
|
||||
}
|
||||
|
||||
|
||||
@@ -552,6 +559,8 @@ void CNPC_CombineGunship::Spawn( void )
|
||||
|
||||
m_iMaxHealth = m_iHealth = 100;
|
||||
|
||||
m_flFrozenMax = 0.0f;
|
||||
|
||||
m_flFieldOfView = -0.707; // 270 degrees
|
||||
|
||||
m_fHelicopterFlags |= BITS_HELICOPTER_GUN_ON;
|
||||
@@ -680,6 +689,11 @@ void CNPC_CombineGunship::Precache( void )
|
||||
PrecacheScriptSound( "NPC_CombineGunship.ExhaustSound" );
|
||||
PrecacheScriptSound( "NPC_CombineGunship.RotorBlastSound" );
|
||||
|
||||
PrecacheEffect( "ImpactGunship" );
|
||||
PrecacheEffect( "AR2Explosion" );
|
||||
PrecacheEffect( "GunshipMuzzleFlash" );
|
||||
PrecacheEffect( "GunshipTracer" );
|
||||
|
||||
if ( hl2_episodic.GetBool() == true )
|
||||
{
|
||||
UTIL_PrecacheOther( "env_citadel_energy_core" );
|
||||
@@ -1728,13 +1742,13 @@ void CNPC_CombineGunship::FireCannonRound( void )
|
||||
FireBulletsInfo_t info( 1, vecMuzzle, vecToEnemy, vec3_origin, MAX_COORD_RANGE, m_iAmmoType );
|
||||
info.m_iTracerFreq = 1;
|
||||
CAmmoDef *pAmmoDef = GetAmmoDef();
|
||||
info.m_iPlayerDamage = pAmmoDef->PlrDamage( m_iAmmoType );
|
||||
info.m_flPlayerDamage = pAmmoDef->PlrDamage( m_iAmmoType );
|
||||
|
||||
// If we've already hit the player, do 0 damage. This ensures we don't hit the
|
||||
// player multiple times during a single burst.
|
||||
if ( m_iBurstHits >= GUNSHIP_MAX_HITS_PER_BURST )
|
||||
{
|
||||
info.m_iPlayerDamage = 1;
|
||||
info.m_flPlayerDamage = 1.0f;
|
||||
}
|
||||
|
||||
FireBullets( info );
|
||||
@@ -2194,7 +2208,6 @@ void CNPC_CombineGunship::Flight( void )
|
||||
goalAngAccel.z = 2.0 * (AngleDiff( goalRoll, AngleNormalize( GetLocalAngles().z ) ) - GetLocalAngularVelocity().z * dt) / (dt * dt);
|
||||
|
||||
goalAngAccel.x = clamp( goalAngAccel.x, -300, 300 );
|
||||
//goalAngAccel.y = clamp( goalAngAccel.y, -60, 60 );
|
||||
goalAngAccel.y = clamp( goalAngAccel.y, -120, 120 );
|
||||
goalAngAccel.z = clamp( goalAngAccel.z, -300, 300 );
|
||||
|
||||
@@ -2205,9 +2218,9 @@ void CNPC_CombineGunship::Flight( void )
|
||||
angAccelAccel.y = (goalAngAccel.y - m_vecAngAcceleration.y) / dt;
|
||||
angAccelAccel.z = (goalAngAccel.z - m_vecAngAcceleration.z) / dt;
|
||||
|
||||
angAccelAccel.x = clamp( angAccelAccel.x, -1000, 1000 );
|
||||
angAccelAccel.y = clamp( angAccelAccel.y, -1000, 1000 );
|
||||
angAccelAccel.z = clamp( angAccelAccel.z, -1000, 1000 );
|
||||
angAccelAccel.x = clamp( angAccelAccel.x, -m_fMaxAngAcceleration, m_fMaxAngAcceleration );
|
||||
angAccelAccel.y = clamp( angAccelAccel.y, -m_fMaxAngAcceleration, m_fMaxAngAcceleration );
|
||||
angAccelAccel.z = clamp( angAccelAccel.z, -m_fMaxAngAcceleration, m_fMaxAngAcceleration );
|
||||
|
||||
m_vecAngAcceleration += angAccelAccel * 0.1;
|
||||
|
||||
@@ -2222,9 +2235,9 @@ void CNPC_CombineGunship::Flight( void )
|
||||
QAngle angVel = GetLocalAngularVelocity();
|
||||
angVel += m_vecAngAcceleration * 0.1;
|
||||
|
||||
//angVel.y = clamp( angVel.y, -60, 60 );
|
||||
//angVel.y = clamp( angVel.y, -120, 120 );
|
||||
angVel.y = clamp( angVel.y, -120, 120 );
|
||||
angVel.x = clamp( angVel.x, -m_vMaxAngVelocity.x, m_vMaxAngVelocity.x );
|
||||
angVel.y = clamp( angVel.y, -m_vMaxAngVelocity.y, m_vMaxAngVelocity.y );
|
||||
angVel.z = clamp( angVel.z, -m_vMaxAngVelocity.z, m_vMaxAngVelocity.z );
|
||||
|
||||
SetLocalAngularVelocity( angVel );
|
||||
|
||||
@@ -2502,11 +2515,13 @@ void CNPC_CombineGunship::SelfDestruct( void )
|
||||
|
||||
UTIL_Remove( this );
|
||||
|
||||
#ifndef INFESTED_DLL
|
||||
// Record this so a nearby citizen can respond.
|
||||
if ( GetCitizenResponse() )
|
||||
{
|
||||
GetCitizenResponse()->AddResponseTrigger( CR_PLAYER_KILLED_GUNSHIP );
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HL2_EPISODIC
|
||||
NPCEventResponse()->TriggerEvent( "TLK_CITIZEN_RESPONSE_KILLED_GUNSHIP", false, false );
|
||||
@@ -2828,7 +2843,7 @@ void CNPC_CombineGunship::MakeTracer( const Vector &vecTracerSrc, const trace_t
|
||||
// *ptr -
|
||||
// Output : int
|
||||
//-----------------------------------------------------------------------------
|
||||
void CNPC_CombineGunship::TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr, CDmgAccumulator *pAccumulator )
|
||||
void CNPC_CombineGunship::TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr )
|
||||
{
|
||||
// Reflect bullets
|
||||
if ( info.GetDamageType() & DMG_BULLET )
|
||||
@@ -2850,10 +2865,12 @@ void CNPC_CombineGunship::TraceAttack( const CTakeDamageInfo &info, const Vector
|
||||
// If this is from a player, record it so a nearby citizen can respond.
|
||||
if ( info.GetAttacker()->IsPlayer() )
|
||||
{
|
||||
#ifndef INFESTED_DLL
|
||||
if ( GetCitizenResponse() )
|
||||
{
|
||||
GetCitizenResponse()->AddResponseTrigger( CR_PLAYER_SHOT_GUNSHIP );
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HL2_EPISODIC
|
||||
NPCEventResponse()->TriggerEvent( "TLK_CITIZEN_RESPONSE_SHOT_GUNSHIP", false, false );
|
||||
@@ -2863,7 +2880,7 @@ void CNPC_CombineGunship::TraceAttack( const CTakeDamageInfo &info, const Vector
|
||||
return;
|
||||
}
|
||||
|
||||
BaseClass::TraceAttack( info, vecDir, ptr, pAccumulator );
|
||||
BaseClass::TraceAttack( info, vecDir, ptr );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Bullseyes act as targets for other NPC's to attack and to trigger
|
||||
// events
|
||||
@@ -560,7 +560,7 @@ void CNPC_EnemyFinderCombineCannon::Spawn()
|
||||
}
|
||||
else
|
||||
{
|
||||
DevMsg( this, "Enemyfinder %s can't snap to %s because it doesn't exist\n", GetDebugName(), STRING(m_iszSnapToEnt) );
|
||||
DevMsg( this, "Enemyfinder %s can't snap to %s because it doesn't exist\n", GetDebugName(), m_iszSnapToEnt );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Base class for humanoid NPCs intended to fight along side player in close
|
||||
// environments
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "ai_behavior_lead.h"
|
||||
#include "ai_behavior_actbusy.h"
|
||||
#include "ai_behavior_fear.h"
|
||||
#include "ai_behavior_fightfromcover.h"
|
||||
|
||||
#ifdef HL2_EPISODIC
|
||||
#include "ai_behavior_operator.h"
|
||||
@@ -362,6 +363,7 @@ protected:
|
||||
|
||||
virtual CAI_FollowBehavior &GetFollowBehavior( void ) { return m_FollowBehavior; }
|
||||
|
||||
CAI_FightFromCoverBehavior m_FightFromCoverBehavior;
|
||||
CAI_AssaultBehavior m_AssaultBehavior;
|
||||
CAI_FollowBehavior m_FollowBehavior;
|
||||
CAI_StandoffBehavior m_StandoffBehavior;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright (c) 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
@@ -34,11 +34,7 @@ public:
|
||||
CMissile();
|
||||
~CMissile();
|
||||
|
||||
#ifdef HL1_DLL
|
||||
Class_T Classify( void ) { return CLASS_NONE; }
|
||||
#else
|
||||
Class_T Classify( void ) { return CLASS_MISSILE; }
|
||||
#endif
|
||||
|
||||
void Spawn( void );
|
||||
void Precache( void );
|
||||
@@ -123,6 +119,7 @@ public:
|
||||
|
||||
CAPCMissile();
|
||||
~CAPCMissile();
|
||||
void Precache( void );
|
||||
void IgniteDelay( void );
|
||||
void AugerDelay( float flDelayTime );
|
||||
void ExplodeDelay( float flDelayTime );
|
||||
@@ -204,6 +201,7 @@ public:
|
||||
bool WeaponLOSCondition( const Vector &ownerPos, const Vector &targetPos, bool bSetConditions );
|
||||
int WeaponRangeAttack1Condition( float flDot, float flDist );
|
||||
|
||||
void Operator_ForceNPCFire( CBaseCombatCharacter *pOperator, bool bSecondary, CBaseEntity *pTarget = NULL );
|
||||
void Operator_HandleAnimEvent( animevent_t *pEvent, CBaseCombatCharacter *pOperator );
|
||||
void StartGuiding( void );
|
||||
void StopGuiding( void );
|
||||
|
||||
Reference in New Issue
Block a user