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
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Deal with weapon being out
//
// $Workfile: $
// $Date: $
//
//-----------------------------------------------------------------------------
// $Log: $
//
// $NoKeywords: $
//=============================================================================//
#ifndef AI_BEHAVIOR_RAPPEL_H
#define AI_BEHAVIOR_RAPPEL_H
#ifdef _WIN32
#pragma once
#endif
#include "ai_behavior.h"
class CBeam;
class CAI_RappelBehavior : public CAI_SimpleBehavior
{
DECLARE_CLASS( CAI_RappelBehavior, CAI_SimpleBehavior );
public:
CAI_RappelBehavior();
void Precache( void );
virtual const char *GetName() { return "Rappel"; }
virtual bool KeyValue( const char *szKeyName, const char *szValue );
virtual bool CanSelectSchedule();
void GatherConditions();
void CleanupOnDeath( CBaseEntity *pCulprit = NULL, bool bFireDeathOutput = true );
//virtual void BeginScheduleSelection();
//virtual void EndScheduleSelection();
void StartTask( const Task_t *pTask );
void RunTask( const Task_t *pTask );
bool IsWaitingToRappel() { return m_bWaitingToRappel; }
void BeginRappel();
void SetDescentSpeed();
void CreateZipline();
void CutZipline();
//void BuildScheduleTestBits();
//int TranslateSchedule( int scheduleType );
//void OnStartSchedule( int scheduleType );
//void InitializeBehavior();
enum
{
SCHED_RAPPEL_WAIT = BaseClass::NEXT_SCHEDULE,
SCHED_RAPPEL,
SCHED_CLEAR_RAPPEL_POINT, // Get out of the way for the next guy
NEXT_SCHEDULE,
TASK_RAPPEL = BaseClass::NEXT_TASK,
TASK_HIT_GROUND,
NEXT_TASK,
COND_BEGIN_RAPPEL = BaseClass::NEXT_CONDITION,
NEXT_CONDITION,
};
DEFINE_CUSTOM_SCHEDULE_PROVIDER;
public:
private:
virtual int SelectSchedule();
//---------------------------------
bool m_bWaitingToRappel;
bool m_bOnGround;
CHandle<CBeam> m_hLine;
Vector m_vecRopeAnchor;
DECLARE_DATADESC();
};
#endif // AI_BEHAVIOR_RAPPEL_H
|