blob: dc2c08e502554fc9318ed08562d9f26d0414bac0 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef NPC_STALKER_H
#define NPC_STALKER_H
#ifdef _WIN32
#pragma once
#endif
#include "ai_basenpc.h"
#include "entityoutput.h"
#include "ai_behavior.h"
#include "ai_behavior_actbusy.h"
class CBeam;
class CSprite;
class CScriptedTarget;
typedef CAI_BehaviorHost<CAI_BaseNPC> CAI_BaseStalker;
class CNPC_Stalker : public CAI_BaseStalker
{
DECLARE_CLASS( CNPC_Stalker, CAI_BaseStalker );
public:
float m_flNextAttackSoundTime;
float m_flNextBreatheSoundTime;
float m_flNextScrambleSoundTime;
float m_flNextNPCThink;
// ------------------------------
// Laser Beam
// ------------------------------
int m_eBeamPower;
Vector m_vLaserDir;
Vector m_vLaserTargetPos;
float m_fBeamEndTime;
float m_fBeamRechargeTime;
float m_fNextDamageTime;
float m_nextSmokeTime;
float m_bPlayingHitWall;
float m_bPlayingHitFlesh;
CBeam* m_pBeam;
CSprite* m_pLightGlow;
int m_iPlayerAggression;
float m_flNextScreamTime;
void KillAttackBeam(void);
void DrawAttackBeam(void);
void CalcBeamPosition(void);
Vector LaserStartPosition(Vector vStalkerPos);
Vector m_vLaserCurPos; // Last position successfully burned
bool InnateWeaponLOSCondition( const Vector &ownerPos, const Vector &targetPos, bool bSetConditions );
// ------------------------------
// Dormancy
// ------------------------------
CAI_Schedule* WakeUp(void);
void GoDormant(void);
public:
void Spawn( void );
void Precache( void );
bool CreateBehaviors();
float MaxYawSpeed( void );
Class_T Classify ( void );
void PrescheduleThink();
bool IsValidEnemy( CBaseEntity *pEnemy );
void StartTask( const Task_t *pTask );
void RunTask( const Task_t *pTask );
virtual int SelectSchedule ( void );
virtual int TranslateSchedule( int scheduleType );
int OnTakeDamage_Alive( const CTakeDamageInfo &info );
void OnScheduleChange();
void StalkerThink(void);
void NotifyDeadFriend( CBaseEntity *pFriend );
int MeleeAttack1Conditions ( float flDot, float flDist );
int RangeAttack1Conditions ( float flDot, float flDist );
void HandleAnimEvent( animevent_t *pEvent );
bool FValidateHintType(CAI_Hint *pHint);
Activity GetHintActivity( short sHintType, Activity HintsActivity );
float GetHintDelay( short sHintType );
void IdleSound( void );
void DeathSound( const CTakeDamageInfo &info );
void PainSound( const CTakeDamageInfo &info );
void Event_Killed( const CTakeDamageInfo &info );
void DoSmokeEffect( const Vector &position );
void AddZigZagToPath(void);
void StartAttackBeam();
void UpdateAttackBeam();
CNPC_Stalker(void);
DECLARE_DATADESC();
DEFINE_CUSTOM_AI;
private:
CAI_ActBusyBehavior m_ActBusyBehavior;
};
#endif // NPC_STALKER_H
|