Commit ceb4c185 authored by Arthurdead's avatar Arthurdead

wip asw npcs

messy only tested if compiles
parent 3d626753
......@@ -124,6 +124,10 @@
//Half-Life Deathmatch: Source - If you have this mounted you obviously also need HL:S mounted
game "|all_source_engine_paths|../Half-Life 1 Source Deathmatch/hl1mp/hl1mp_pak.vpk"
game "|all_source_engine_paths|../Half-Life 1 Source Deathmatch/hl1mp"
//Alien Swarm
game "|all_source_engine_paths|../Alien Swarm/swarm/pak01_dir.vpk"
game "|all_source_engine_paths|../Alien Swarm/swarm"
//And then we put this last so random files downloaded from MP game servers don't clutter up your game folder
game+download |gameinfo_path|download
......
......@@ -14,7 +14,7 @@ $Configuration
{
$Compiler
{
$AdditionalIncludeDirectories ".\smod;$SRCDIR\game\shared\smod;.\hl2;.\hl2\elements;$SRCDIR\game\shared\hl2;$SRCDIR\game\shared\episodic;..\..\public;,$SRCDIR\game\shared\hl1;.\hl1,$BASE"
$AdditionalIncludeDirectories ".\swarm;$SRCDIR\game\shared\swarm;.\smod;$SRCDIR\game\shared\smod;.\hl2;.\hl2\elements;$SRCDIR\game\shared\hl2;$SRCDIR\game\shared\episodic;..\..\public;,$SRCDIR\game\shared\hl1;.\hl1,$BASE"
$PreprocessorDefinitions "$BASE;HL2_CLIENT_DLL;HL2_EPISODIC;SMOD;SOURCE_2013;ARGG"
$TreatWarningsAsErrors "No (/WX-)"
}
......@@ -209,5 +209,27 @@ $Project "Client"
$File "$SRCDIR\game\client\ShaderEditor\Grass\CGrassCluster.cpp"
}
}
$Folder "Swarm"
{
$File "swarm\c_asw_alien.cpp"
$File "swarm\c_asw_alien.h"
$File "swarm\iasw_client_aim_target.h"
$Folder "Shared"
{
$File "$SRCDIR\game\shared\swarm\asw_alien_shared.cpp"
$File "$SRCDIR\game\shared\swarm\asw_alien_shared.h"
$File "$SRCDIR\game\shared\swarm\asw_alien_shared_classmembers.h"
$File "$SRCDIR\game\shared\swarm\asw_shareddefs.cpp"
$File "$SRCDIR\game\shared\swarm\asw_shareddefs.h"
$File "$SRCDIR\game\shared\swarm\asw_fx_shared.cpp"
$File "$SRCDIR\game\shared\swarm\asw_fx_shared.h"
$File "$SRCDIR\game\shared\swarm\asw_trace_filter_melee.cpp"
$File "$SRCDIR\game\shared\swarm\asw_trace_filter_melee.h"
$File "$SRCDIR\game\shared\swarm\asw_trace_filter_shot.cpp"
$File "$SRCDIR\game\shared\swarm\asw_trace_filter_shot.h"
}
}
}
}
This diff is collapsed.
#ifndef _INCLUDED_C_ASW_ALIEN_H
#define _INCLUDED_C_ASW_ALIEN_H
#include "asw_alien_shared.h"
#include "c_ai_basenpc.h"
#include "iasw_client_aim_target.h"
#include "asw_shareddefs.h"
#include "glow_outline_effect.h"
//#include "object_motion_blur_effect.h"
class CNewParticleEffect;
class C_ASW_Alien : public C_AI_BaseNPC, public IASW_Client_Aim_Target
{
public:
DECLARE_CLASS( C_ASW_Alien, C_AI_BaseNPC );
DECLARE_CLIENTCLASS();
#include "asw_alien_shared_classmembers.h"
C_ASW_Alien();
virtual ~C_ASW_Alien();
virtual void PostDataUpdate( DataUpdateType_t updateType );
// death;
virtual void TraceAttack( const CTakeDamageInfo &info, const Vector &vecDir, trace_t *ptr );
virtual void Bleed( const CTakeDamageInfo &info, const Vector &vecPos, const Vector &vecDir, trace_t *ptr );
virtual void DoBloodDecal( float flDamage, const Vector &vecPos, const Vector &vecDir, trace_t *ptr, int bitsDamageType );
virtual const char *GetDeathParticleEffectName( void ) { return "drone_death"; }
virtual const char *GetBigDeathParticleEffectName( void ) { return "drone_death_big"; }
virtual const char *GetSmallDeathParticleEffectName( void ) { return "drone_death_sml"; }
virtual const char *GetRagdollGibParticleEffectName( void ) { return "drone_ragdoll_gib"; }
virtual C_ClientRagdoll* CreateClientRagdoll( bool bRestoring = false );
virtual C_BaseAnimating* BecomeRagdollOnClient( void );
DeathStyle_t m_nDeathStyle;
inline bool IsHurler(); ///< is this drone set to go flinging at the camera
inline bool IsMeleeThrown();
virtual bool HasCustomDeathForce(){ return false; };
virtual Vector GetCustomDeathForce(){ return vec3_origin; };
// footsteps
void FireEvent( const Vector& origin, const QAngle& angles, int event, const char *options );
void MarineStepSound( surfacedata_t *psurface, const Vector &vecOrigin, const Vector &vecVelocity );
surfacedata_t* GetGroundSurface();
void PlayStepSound( Vector &vecOrigin, surfacedata_t *psurface, float fvol, bool force );
virtual void DoAlienFootstep( Vector &vecOrigin, float fvol );
bool m_bStepSideLeft;
// stun
CNetworkVar(bool, m_bElectroStunned);
float m_fNextElectroStunEffect;
// electro shocked
//CNetworkVar(bool, m_bElectroShockSmall);
//CNetworkVar(bool, m_bElectroShockBig);
// fire
CNetworkVar(bool, m_bOnFire);
bool m_bClientOnFire;
CUtlReference<CNewParticleEffect> m_pBurningEffect;
virtual void UpdateFireEmitters();
virtual void UpdateOnRemove();
// aim target interface
IMPLEMENT_AUTO_LIST_GET();
virtual float GetRadius() { return 23; }
virtual bool IsAimTarget() { return GetHealth() > 0; }
virtual const Vector& GetAimTargetPos(const Vector &vecFiringSrc, bool bWeaponPrefersFlatAiming) { return m_vecLastRenderedPos; }
virtual const Vector& GetAimTargetRadiusPos(const Vector &vecFiringSrc) { return m_vecAutoTargetRadiusPos; }
virtual Vector GetLocalAutoTargetRadiusPos();
// custom shadow
virtual bool GetShadowCastDirection( Vector *pDirection, ShadowType_t shadowType ) const;
ShadowType_t ShadowCastType();
void GetShadowFromFlashlight(Vector &vecDir, float &fContribution) const;
float m_fLastCustomContribution;
Vector m_vecLastCustomDir;
int m_iLastCustomFrame;
int m_nLastSetModel;
virtual void ASWUpdateClientSideAnimation();
virtual void ClientThink();
// storing our location for autoaim
Vector m_vecLastRenderedPos;
Vector m_vecAutoTargetRadiusPos;
// health
virtual int GetHealth() const { return m_iHealth; }
int GetMaxHealth( void ) const { return m_iMaxHealth; }
int m_iMaxHealth;
virtual float GetInterpolationAmount( int flags );
// Glows are enabled when the sniper scope is used
#ifdef GLOWS_ENABLE
CGlowObject m_GlowObject;
#endif
//CMotionBlurObject m_MotionBlurObject;
private:
C_ASW_Alien( const C_ASW_Alien & ); // not defined, not accessible
static float sm_flLastFootstepTime;
};
extern ConVar asw_drone_ridiculous;
inline bool C_ASW_Alien::IsHurler()
{
return m_nDeathStyle == kDIE_HURL || asw_drone_ridiculous.GetBool();
}
inline bool C_ASW_Alien::IsMeleeThrown()
{
return m_nDeathStyle == kDIE_MELEE_THROW;
}
#endif /* _INCLUDED_C_ASW_ALIEN_H */
\ No newline at end of file
#ifndef _INCLUDED_ASW_CLIENT_AIM_TARGET_H
#define _INCLUDED_ASW_CLIENT_AIM_TARGET_H
DECLARE_AUTO_LIST( IClientAimTargetsAutoList );
abstract_class IASW_Client_Aim_Target : public IClientAimTargetsAutoList
{
public:
IASW_Client_Aim_Target( bool bAutoAdd = true ) : IClientAimTargetsAutoList( bAutoAdd ) {}
virtual float GetRadius() = 0;
virtual bool IsAimTarget() = 0;
virtual const Vector& GetAimTargetPos(const Vector &vecFiringSrc, bool bWeaponPrefersFlatAiming=false) = 0;
virtual const Vector& GetAimTargetRadiusPos(const Vector &vecFiringSrc) = 0;
};
#endif // _INCLUDED_ASW_CLIENT_AIM_TARGET_H
\ No newline at end of file
......@@ -132,6 +132,8 @@ void CAI_BaseNPC::InitDefaultActivitySR(void)
ADD_ACTIVITY_TO_SR( ACT_CROUCHIDLE );
ADD_ACTIVITY_TO_SR( ACT_STAND );
ADD_ACTIVITY_TO_SR( ACT_USE );
ADD_ACTIVITY_TO_SR( ACT_ALIEN_BURROW_IDLE );
ADD_ACTIVITY_TO_SR( ACT_ALIEN_BURROW_OUT );
ADD_ACTIVITY_TO_SR( ACT_SIGNAL1 );
ADD_ACTIVITY_TO_SR( ACT_SIGNAL2 );
ADD_ACTIVITY_TO_SR( ACT_SIGNAL3 );
......
......@@ -607,6 +607,7 @@ public:
virtual bool ShouldAlwaysThink();
void ForceGatherConditions() { m_bForceConditionsGather = true; SetEfficiency( AIE_NORMAL ); } // Force an NPC out of PVS to call GatherConditions on next think
bool IsForceGatherConditionsSet() { return m_bForceConditionsGather; }
virtual float LineOfSightDist( const Vector &vecDir = vec3_invalid, float zEye = FLT_MAX );
......@@ -767,8 +768,11 @@ private:
bool m_bUsingStandardThinkTime;
float m_flLastRealThinkTime;
int m_iFrameBlocked;
protected:
bool m_bInChoreo;
private:
static int gm_iNextThinkRebalanceTick;
static float gm_flTimeLastSpawn;
static int gm_nSpawnedThisFrame;
......
......@@ -517,12 +517,14 @@ private:
void BackBridge_HandleAnimEvent( animevent_t *pEvent );
protected:
CAI_BehaviorBase **AccessBehaviors();
int NumBehaviors();
CAI_BehaviorBase * m_pCurBehavior;
CUtlVector<CAI_BehaviorBase *> m_Behaviors;
private:
bool m_bCalledBehaviorSelectSchedule;
#ifdef DEBUG
......
......@@ -46,6 +46,8 @@ public:
CAI_Motor(CAI_BaseNPC *pOuter);
virtual ~CAI_Motor();
friend class CAI_BaseNPC;
void Init( IAI_MovementSink *pMovementServices );
// --------------------------------
......@@ -185,10 +187,12 @@ protected:
AIMotorMoveResult_t MoveGroundExecuteWalk( const AILocalMoveGoal_t &move, float speed, float dist, AIMoveTrace_t *pTraceResult );
virtual AIMotorMoveResult_t MoveFlyExecute( const AILocalMoveGoal_t &move, AIMoveTrace_t *pTraceResult );
protected: // made protected while animation transition details worked out, private:
public: // made protected while animation transition details worked out, private:
// --------------------------------
void SetMoveVel(const Vector &velocity) { m_vecVelocity = velocity; }
protected:
float IdealVelocity(); // how fast should I be moving in an ideal state?
// --------------------------------
......
......@@ -106,10 +106,12 @@ private:
bool WaitingUntilSeen( CBaseEntity *pSightEnt );
protected:
void BeginGather();
void NoteSeenEntity( CBaseEntity *pSightEnt );
void EndGather( int nSeen, CUtlVector<EHANDLE> *pResult );
private:
bool Look( CBaseEntity *pSightEnt );
#ifdef PORTAL
bool LookThroughPortal( const CProp_Portal *pPortal, CBaseEntity *pSightEnt );
......
......@@ -13,7 +13,7 @@ $Configuration
{
$Compiler
{
$AdditionalIncludeDirectories "$BASE;$SRCDIR\game\shared\hl2;$SRCDIR\game\shared\episodic;.\hl2;.\hl1;$SRCDIR\game\shared\hl1,.\episodic;$SRCDIR\game\shared\smod;.\smod"
$AdditionalIncludeDirectories "$BASE;$SRCDIR\game\shared\hl2;$SRCDIR\game\shared\episodic;.\hl2;.\hl1;$SRCDIR\game\shared\hl1,.\episodic;$SRCDIR\game\shared\smod;.\smod;.\swarm;$SRCDIR\game\shared\swarm"
$PreprocessorDefinitions "$BASE;HL2_DLL;HL2_EPISODIC;USES_SAVERESTORE;SMOD;ARGG"
$TreatWarningsAsErrors "No (/WX-)"
}
......@@ -474,5 +474,49 @@ $Project "Server"
$File "smod\weapon_ar2x.cpp"
$File "smod\weapon_m249.cpp"
}
$Folder "Swarm"
{
$File "swarm\asw_ai_senses.cpp"
$File "swarm\asw_ai_senses.h"
$File "swarm\asw_alien.cpp"
$File "swarm\asw_alien.h"
$File "swarm\asw_lag_compensation.cpp"
$File "swarm\asw_lag_compensation.h"
$File "swarm\asw_base_spawner.cpp"
$File "swarm\asw_base_spawner.h"
$File "swarm\asw_burning.cpp"
$File "swarm\asw_burning.h"
$File "swarm\asw_tesla_trap.cpp"
$File "swarm\asw_tesla_trap.h"
$File "swarm\iasw_spawnable_npc.h"
$Folder "Behaviors"
{
$File "swarm\asw_ai_behavior.cpp"
$File "swarm\asw_ai_behavior.h"
$File "swarm\asw_ai_behavior_combat_stun.cpp"
$File "swarm\asw_ai_behavior_combat_stun.h"
$File "swarm\asw_ai_behavior_flinch.cpp"
$File "swarm\asw_ai_behavior_flinch.h"
$File "swarm\asw_ai_behavior_sleep.cpp"
$File "swarm\asw_ai_behavior_sleep.h"
}
$Folder "Shared"
{
$File "$SRCDIR\game\shared\swarm\asw_alien_shared.cpp"
$File "$SRCDIR\game\shared\swarm\asw_alien_shared.h"
$File "$SRCDIR\game\shared\swarm\asw_alien_shared_classmembers.h"
$File "$SRCDIR\game\shared\swarm\asw_shareddefs.cpp"
$File "$SRCDIR\game\shared\swarm\asw_shareddefs.h"
$File "$SRCDIR\game\shared\swarm\asw_fx_shared.cpp"
$File "$SRCDIR\game\shared\swarm\asw_fx_shared.h"
$File "$SRCDIR\game\shared\swarm\asw_trace_filter_melee.cpp"
$File "$SRCDIR\game\shared\swarm\asw_trace_filter_melee.h"
$File "$SRCDIR\game\shared\swarm\asw_trace_filter_shot.cpp"
$File "$SRCDIR\game\shared\swarm\asw_trace_filter_shot.h"
}
}
}
}
//========= Copyright 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "cbase.h"
#include "beam_shared.h"
#include "ai_motor.h"
#include "asw_ai_behavior.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
BEGIN_DATADESC( CAI_ASW_Behavior )
END_DATADESC();
static CUtlSymbolTable BehaviorSymbols;
CUtlSymbol CAI_ASW_Behavior::GetSymbol( const char *pszText )
{
return BehaviorSymbols.AddString( pszText );
}
const char *CAI_ASW_Behavior::GetSymbolText( CUtlSymbol &Symbol )
{
return BehaviorSymbols.String( Symbol );
}
//------------------------------------------------------------------------------
// Purpose: constructor
//------------------------------------------------------------------------------
CAI_ASW_Behavior::CAI_ASW_Behavior( )
{
m_StatusParm = UTL_INVAL_SYMBOL;
m_nNumRequiredParms = 0;
m_flScheduleChance = 100.0f;
m_flScheduleChanceRate = -1;
m_flScheduleChanceNextCheck = gpGlobals->curtime;
}
bool CAI_ASW_Behavior::KeyValue( const char *szKeyName, const char *szValue )
{
if ( V_stricmp( szKeyName, "requires_param" ) == 0 )
{
char *pszTemp = ( char * )stackalloc( strlen( szValue ) + 1 );
strcpy( pszTemp, szValue );
while( 1 )
{
char *pszKey, *pszOperator, *pszValue;
pszKey = strtok( pszTemp, " " );
pszTemp = NULL;
pszOperator = strtok( NULL, " " );
pszValue = strtok( NULL, " ," );
if ( pszKey == NULL || pszOperator == NULL || pszValue == NULL )
{
break;
}
m_RequiredParm[ m_nNumRequiredParms ] = GetSymbol( pszKey );
m_nRequiredParmValue[ m_nNumRequiredParms ] = atoi( pszValue );
m_nNumRequiredParms++;
}
#if 0
strcpy( pszTemp, szValue );
pszPosKey = pszTemp;
while( ( *pszPosKey ) != 0 && ( *pszPosKey ) != ' ' && ( *pszPosKey ) != ',' )
{
pszPosKey++;
}
if ( ( *pszPosKey ) != 0 )
{
pszPosValue = pszPosKey;
while( ( *pszPosValue ) != 0 && ( ( *pszPosValue ) == ' ' || ( *pszPosValue ) == ',' ) )
{
pszPosValue++;
}
if ( ( *pszPosKey ) != 0 && ( *pszPosValue ) != 0 )
{
*pszPosKey = 0;
m_RequiredParm = pszTemp;
m_nRequiredParmValue = atoi( pszPosValue );
}
}
#endif
return true;
}
else if ( V_stricmp( szKeyName, "status_param" ) == 0 )
{
m_StatusParm = GetSymbol( szValue );
return true;
}
else if ( V_stricmp( szKeyName, "schedule_chance" ) == 0 )
{
m_flScheduleChance = atof( szValue );
return true;
}
else if ( V_stricmp( szKeyName, "schedule_chance_rate" ) == 0 )
{
m_flScheduleChanceRate = atof( szValue );
return true;
}
return BaseClass::KeyValue( szKeyName, szValue );
}
bool CAI_ASW_Behavior::CanSelectSchedule( )
{
if ( m_nNumRequiredParms != 0 )
{
for( int i = 0; i < m_nNumRequiredParms; i++ )
{
if ( GetBehaviorParam( m_RequiredParm[ i ] ) != m_nRequiredParmValue[ i ] )
{
return false;
}
}
}
if ( m_flScheduleChance < 100.0f )
{
if ( m_flScheduleChanceRate > 0.0f )
{
if ( m_flScheduleChanceNextCheck > gpGlobals->curtime )
{
return false;
}
m_flScheduleChanceNextCheck = gpGlobals->curtime + m_flScheduleChanceRate;
}
if ( RandomFloat( 0.0f, 100.0f ) > m_flScheduleChance )
{
return false;
}
}
return true;
}
void CAI_ASW_Behavior::GatherConditions( )
{
BaseClass::GatherConditions();
GatherCommonConditions();
}
void CAI_ASW_Behavior::GatherConditionsNotActive( )
{
BaseClass::GatherConditions();
GatherCommonConditions();
}
AI_BEGIN_CUSTOM_SCHEDULE_PROVIDER( CAI_ASW_Behavior )
DECLARE_CONDITION( COND_CHARGE_CAN_CHARGE )
AI_END_CUSTOM_SCHEDULE_PROVIDER()
#include "tier0/memdbgoff.h"
\ No newline at end of file
//========= Copyright 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: blah blah blah
//
// $Workfile: $
// $Date: $
//
//-----------------------------------------------------------------------------
// $Log: $
//
// $NoKeywords: $
//=============================================================================//
#ifndef ASW_AI_BEHAVIOR_H
#define ASW_AI_BEHAVIOR_H
#ifdef _WIN32
#pragma once
#endif
#include "tier1/utlsymbol.h"
#include "ai_behavior.h"
#include "asw_alien.h"
// Be sure to expose these to vscript in
// void CASW_Alien::LinkEnumsToScope( CScriptScope &hScope )
enum BehaviorEvent_t
{
BEHAVIOR_EVENT_START_HEAL = 0,
BEHAVIOR_EVENT_FINISH_HEAL,
BEHAVIOR_EVENT_MORTAR_FIRE,
BEHAVIOR_EVENT_MELEE1_HULL_ATTACK,
BEHAVIOR_EVENT_MELEE1_SPHERE_ATTACK,
BEHAVIOR_EVENT_FLICK,
BEHAVIOR_EVENT_TOOK_DAMAGE,
BEHAVIOR_EVENT_DEFLECTED_DAMAGE,
BEHAVIOR_EVENT_EXPLODE,
BEHAVIOR_EVENT_AWAKEN,
BEHAVIOR_EVENT_SLEEP,
BEHAVIOR_EVENT_POUNCE,
BEHAVIOR_EVENT_JUMP,
BEHAVIOR_EVENT_MAX
};
#if 0
enum BehaviorParam_t
{
BEHAVIOR_PARAM_SPEED_MODIFIER = 0,
BEHAVIOR_PARAM_IS_SHIELDED,
BEHAVIOR_PARAM_MAX
};
#endif
#define MAX_REQUIRED_PARMS 2
//=============================================================================
enum BehaviorClass_T
{
BEHAVIOR_CLASS_UNKNOWN = 0,
BEHAVIOR_CLASS_ADVANCE,
BEHAVIOR_CLASS_BACKOFF,
BEHAVIOR_CLASS_CALL_GROUP,
BEHAVIOR_CLASS_CHARGE,
BEHAVIOR_CLASS_CHASE_ENEMY,
BEHAVIOR_CLASS_COMBAT_STUN,
BEHAVIOR_CLASS_EXPLODE,
BEHAVIOR_CLASS_FEAR,
BEHAVIOR_CLASS_FLICK,
BEHAVIOR_CLASS_HEAL_OTHER,
BEHAVIOR_CLASS_IDLE,
BEHAVIOR_CLASS_MELEE,
BEHAVIOR_CLASS_MORTAR,
BEHAVIOR_CLASS_SCUTTLE,
BEHAVIOR_CLASS_SHIELD,
BEHAVIOR_CLASS_SLEEP,
BEHAVIOR_CLASS_RANGED_ATTACK,
BEHAVIOR_CLASS_RETREAT,
BEHAVIOR_CLASS_WANDER,
BEHAVIOR_CLASS_PROTECT,
BEHAVIOR_CLASS_POUNCE,
BEHAVIOR_CLASS_PREPARE_TO_ENGAGE,
BEHAVIOR_CLASS_FLINCH,
BEHAVIOR_CLASS_JUMP,
BEHAVIOR_CLASS_MAX
};
//=============================================================================
class CAI_ASW_Behavior : public CAI_SimpleBehavior
{
DECLARE_CLASS( CAI_ASW_Behavior, CAI_SimpleBehavior );
public:
static CUtlSymbol GetSymbol( const char *pszText );
static const char *GetSymbolText( CUtlSymbol &Symbol );
public:
CAI_ASW_Behavior( );
virtual BehaviorClass_T Classify( void ) { return ( BehaviorClass_T )BEHAVIOR_CLASS_UNKNOWN; }
virtual bool KeyValue( const char *szKeyName, const char *szValue );
virtual void Init() {}
virtual bool CanSelectSchedule( );
virtual void GatherConditions( );
virtual void GatherConditionsNotActive( );
virtual void BehaviorThink( void ) { }
virtual void HandleBehaviorEvent( CBaseEntity *pInflictor, BehaviorEvent_t eEvent, int nParm ) {}
virtual bool BehaviorHandleAnimEvent( animevent_t *pEvent ) { return false; }
// virtual bool GetBehaviorParam( BehaviorParam_t eParam, float &flResult ) { return false; }
// virtual bool GetBehaviorParam( BehaviorParam_t eParam, bool &bResult ) { return false; }
// called when this is the primary behavior and the NPC touches something
virtual void StartTouch( CBaseEntity *pOther ) { }
virtual bool CanYieldTargetSlot() { return true; } // will this behavior allow target slot to be yielded when it's the primary behavior?
enum
{
COND_CHARGE_CAN_CHARGE = BaseClass::NEXT_CONDITION,
NEXT_CONDITION,
};
DEFINE_CUSTOM_SCHEDULE_PROVIDER;
protected:
inline int GetBehaviorParam( CUtlSymbol ParmName );
inline void SetBehaviorParam( CUtlSymbol ParmName, int nValue );
virtual void GatherCommonConditions( ) { }
CUtlSymbol m_RequiredParm[ MAX_REQUIRED_PARMS ];
int m_nRequiredParmValue[ MAX_REQUIRED_PARMS ];
int m_nNumRequiredParms;
CUtlSymbol m_StatusParm;
float m_flScheduleChance;
float m_flScheduleChanceRate;
float m_flScheduleChanceNextCheck;
private:
DECLARE_DATADESC();
};
int CAI_ASW_Behavior::GetBehaviorParam( CUtlSymbol ParmName )
{
return static_cast< CASW_Alien * >( GetOuter() )->GetBehaviorParam( ParmName );
}
void CAI_ASW_Behavior::SetBehaviorParam( CUtlSymbol ParmName, int nValue )
{
static_cast< CASW_Alien * >( GetOuter() )->SetBehaviorParam( ParmName, nValue );
}
#endif // ASW_AI_BEHAVIOR_H
//========= Copyright 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================//
#include "cbase.h"
#include "beam_shared.h"
#include "ai_motor.h"
#include "asw_ai_behavior_combat_stun.h"
#include "ai_hint.h"
#include "ai_navigator.h"
#include "ai_memory.h"
#include "asw_alien.h"
#include "player.h"
#include "particle_parse.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
BEGIN_DATADESC( CAI_ASW_CombatStunBehavior )
END_DATADESC();
//LINK_BEHAVIOR_TO_CLASSNAME( CAI_ASW_CombatStunBehavior );
// todo: if we want more varied stuns, tie this to damage, etc
static const float COMBAT_STUN_DURATION = 2.5f;