mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-31 22:49:19 +00:00
upload "kind" alien swarm
This commit is contained in:
+52
-13
@@ -1,4 +1,4 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Hooks and classes for the support of humanoid NPCs with
|
||||
// groovy facial animation capabilities, aka, "Actors"
|
||||
@@ -26,6 +26,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
enum PoseParameter_t { POSE_END=INT_MAX };
|
||||
enum FlexWeight_t { FLEX_END=INT_MAX };
|
||||
class CInfoRemarkable;
|
||||
|
||||
struct AILookTargetArgs_t
|
||||
{
|
||||
@@ -45,10 +46,8 @@ class CAI_BaseActor : public CAI_ExpresserHost<CAI_BaseHumanoid>
|
||||
//friend CPoseParameter;
|
||||
//friend CFlexWeight;
|
||||
|
||||
#pragma region PoseParameter and FlexWeight get/set
|
||||
public:
|
||||
|
||||
// FIXME: this method is lame, isn't there some sort of template thing that would get rid of the Outer pointer?
|
||||
|
||||
void Init( PoseParameter_t &index, const char *szName ) { index = (PoseParameter_t)LookupPoseParameter( szName ); };
|
||||
void Set( PoseParameter_t index, float flValue ) { SetPoseParameter( (int)index, flValue ); }
|
||||
float Get( PoseParameter_t index ) { return GetPoseParameter( (int)index ); }
|
||||
@@ -70,7 +69,7 @@ public:
|
||||
}
|
||||
void Set( FlexWeight_t index, float flValue ) { SetFlexWeight( (LocalFlexController_t)index, flValue ); }
|
||||
float Get( FlexWeight_t index ) { return GetFlexWeight( (LocalFlexController_t)index ); }
|
||||
|
||||
#pragma endregion
|
||||
|
||||
public:
|
||||
CAI_BaseActor()
|
||||
@@ -85,7 +84,8 @@ public:
|
||||
m_iszAlertExpression( NULL_STRING ),
|
||||
m_iszCombatExpression( NULL_STRING ),
|
||||
m_iszDeathExpression( NULL_STRING ),
|
||||
m_iszExpressionOverride( NULL_STRING )
|
||||
m_iszExpressionOverride( NULL_STRING ),
|
||||
m_bRemarkablePolling( false )
|
||||
{
|
||||
memset( m_flextarget, 0, 64 * sizeof( m_flextarget[0] ) );
|
||||
}
|
||||
@@ -129,24 +129,26 @@ public:
|
||||
virtual void ClearLookTarget( CBaseEntity *pTarget );
|
||||
virtual void ExpireCurrentRandomLookTarget() { m_flNextRandomLookTime = gpGlobals->curtime - 0.1f; }
|
||||
|
||||
virtual void StartTaskRangeAttack1( const Task_t *pTask );
|
||||
|
||||
virtual void AddLookTarget( CBaseEntity *pTarget, float flImportance, float flDuration, float flRamp = 0.0 );
|
||||
virtual void AddLookTarget( const Vector &vecPosition, float flImportance, float flDuration, float flRamp = 0.0 );
|
||||
|
||||
virtual void MaintainLookTargets( float flInterval );
|
||||
virtual bool ValidEyeTarget(const Vector &lookTargetPos);
|
||||
virtual bool ValidHeadTarget(const Vector &lookTargetPos);
|
||||
virtual float HeadTargetValidity(const Vector &lookTargetPos);
|
||||
|
||||
virtual void StartTaskRangeAttack1( const Task_t *pTask );
|
||||
|
||||
virtual void SetHeadDirection( const Vector &vTargetPos, float flInterval );
|
||||
|
||||
void UpdateBodyControl( void );
|
||||
void UpdateHeadControl( const Vector &vHeadTarget, float flHeadInfluence );
|
||||
virtual float GetHeadDebounce( void ) { return 0.3; } // how much of previous head turn to use
|
||||
|
||||
virtual void MaintainLookTargets( float flInterval );
|
||||
virtual bool ValidEyeTarget(const Vector &lookTargetPos);
|
||||
virtual bool ValidHeadTarget(const Vector &lookTargetPos);
|
||||
virtual float HeadTargetValidity(const Vector &lookTargetPos);
|
||||
|
||||
virtual bool ShouldBruteForceFailedNav() { return true; }
|
||||
|
||||
virtual void GatherConditions( void );
|
||||
|
||||
void AccumulateIdealYaw( float flYaw, float flIntensity );
|
||||
bool SetAccumulatedYawAndUpdate( void );
|
||||
|
||||
@@ -157,6 +159,32 @@ public:
|
||||
|
||||
virtual void OnStateChange( NPC_STATE OldState, NPC_STATE NewState );
|
||||
|
||||
//-- Code for responding to INFO_REMARKABLES --
|
||||
#pragma region Info_Remarkable Code
|
||||
// INFO_REMARKABLEs are objects in the world for which AIs poll and
|
||||
// potentially say context-sensitive things.
|
||||
// The code is here because for the moment only AI_BaseActors do this.
|
||||
// However any other ExpresserHost theoretically could; if you want this
|
||||
// on, say, a player, we'd need to create some new common base class or
|
||||
// some such.
|
||||
|
||||
// called from GatherConditions() for now because can't think of a better
|
||||
// place to poll it from. Returns true if speaking was tried.
|
||||
bool UpdateRemarkableSpeech();
|
||||
|
||||
inline void EnableRemarkables( bool bEnabled ) { m_bRemarkablePolling = bEnabled; }
|
||||
|
||||
protected:
|
||||
/// true iff the character is allowed to poll for remarkables at all (eg,
|
||||
/// rate limiting). You can make it virtual if you need to.
|
||||
bool CanPollRemarkables();
|
||||
|
||||
/// Test to see if a particular remarkable can be commented upon.
|
||||
virtual bool TestRemarkingUpon( CInfoRemarkable * pRemarkable );
|
||||
|
||||
public:
|
||||
|
||||
#pragma endregion
|
||||
//---------------------------------
|
||||
|
||||
virtual void PlayExpressionForState( NPC_STATE state );
|
||||
@@ -179,6 +207,10 @@ public:
|
||||
SCENE_AI_DISABLEAI
|
||||
};
|
||||
|
||||
public:
|
||||
//---------------------------------
|
||||
virtual void Teleport( const Vector *newPosition, const QAngle *newAngles, const Vector *newVelocity );
|
||||
void InvalidateBoneCache( void );
|
||||
|
||||
DECLARE_DATADESC();
|
||||
private:
|
||||
@@ -237,6 +269,12 @@ protected:
|
||||
string_t m_iszCombatExpression;
|
||||
string_t m_iszDeathExpression;
|
||||
|
||||
|
||||
bool m_bRemarkablePolling;
|
||||
float m_fNextIdleVocalizeTime; ///< Not a CoundownTimer because it doesn't need to be networked
|
||||
float m_fNextRemarkPollTime; ///< we only poll for TLK_REMARK once per second or so
|
||||
|
||||
#pragma region PoseParameters and FlexWeights
|
||||
private:
|
||||
//---------------------------------
|
||||
|
||||
@@ -272,6 +310,7 @@ private:
|
||||
PoseParameter_t m_ParameterGestureWidth; // "gesture_width"
|
||||
FlexWeight_t m_FlexweightGestureUpDown; // "gesture_updown"
|
||||
FlexWeight_t m_FlexweightGestureRightLeft; // "gesture_rightleft"
|
||||
#pragma endregion Cached indices
|
||||
|
||||
private:
|
||||
//---------------------------------
|
||||
|
||||
Reference in New Issue
Block a user