diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/game/server/hl2/ai_behavior_functank.h | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/game/server/hl2/ai_behavior_functank.h')
| -rw-r--r-- | mp/src/game/server/hl2/ai_behavior_functank.h | 238 |
1 files changed, 119 insertions, 119 deletions
diff --git a/mp/src/game/server/hl2/ai_behavior_functank.h b/mp/src/game/server/hl2/ai_behavior_functank.h index 3c1e26cb..a8d61466 100644 --- a/mp/src/game/server/hl2/ai_behavior_functank.h +++ b/mp/src/game/server/hl2/ai_behavior_functank.h @@ -1,120 +1,120 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-//=============================================================================//
-
-#ifndef AI_BEHAVIOR_FUNCTANK_H
-#define AI_BEHAVIOR_FUNCTANK_H
-#ifdef _WIN32
-#pragma once
-#endif
-
-#include "simtimer.h"
-#include "ai_behavior.h"
-#include "func_tank.h"
-
-#define AI_FUNCTANK_BEHAVIOR_BUSYTIME 10.0f
-
-enum
-{
- FUNCTANK_SENTENCE_MOVE_TO_MOUNT = SENTENCE_BASE_BEHAVIOR_INDEX,
- FUNCTANK_SENTENCE_JUST_MOUNTED,
- FUNCTANK_SENTENCE_SCAN_FOR_ENEMIES,
- FUNCTANK_SENTENCE_DISMOUNTING,
-};
-
-
-//-----------------------------------------------------------------------------
-// Purpose:
-//-----------------------------------------------------------------------------
-class CAI_FuncTankBehavior : public CAI_SimpleBehavior
-{
- DECLARE_CLASS( CAI_FuncTankBehavior, CAI_SimpleBehavior );
- DEFINE_CUSTOM_SCHEDULE_PROVIDER;
- DECLARE_DATADESC();
-
-public:
- // Contructor/Deconstructor
- CAI_FuncTankBehavior();
- ~CAI_FuncTankBehavior();
-
- void UpdateOnRemove();
-
- // Identifier
- const char *GetName() { return "FuncTank"; }
-
- // Schedule
- bool CanSelectSchedule();
- void BeginScheduleSelection();
- void EndScheduleSelection();
- void PrescheduleThink();
-
- Activity NPC_TranslateActivity( Activity activity );
-
- // Conditions:
- virtual void GatherConditions();
-
- enum
- {
- SCHED_MOVE_TO_FUNCTANK = BaseClass::NEXT_SCHEDULE,
- SCHED_FIRE_FUNCTANK,
- SCHED_SCAN_WITH_FUNCTANK,
- SCHED_FAIL_MOVE_TO_FUNCTANK,
- };
-
- // Tasks
- void StartTask( const Task_t *pTask );
- void RunTask( const Task_t *pTask );
-
- enum
- {
- TASK_GET_PATH_TO_FUNCTANK = BaseClass::NEXT_TASK,
- TASK_FACE_FUNCTANK,
- TASK_HOLSTER_WEAPON,
- TASK_FIRE_FUNCTANK,
- TASK_SCAN_LEFT_FUNCTANK,
- TASK_SCAN_RIGHT_FUNCTANK,
- TASK_FORGET_ABOUT_FUNCTANK,
- TASK_FUNCTANK_ANNOUNCE_SCAN,
- };
-
- enum
- {
- COND_FUNCTANK_DISMOUNT = BaseClass::NEXT_CONDITION,
- NEXT_CONDITION,
- };
-
- // Combat.
- CBaseEntity *BestEnemy( void );
- void Event_Killed( const CTakeDamageInfo &info );
-
- bool HasFuncTank( void ) { return ( m_hFuncTank != NULL ); }
- void SetFuncTank( CHandle<CFuncTank> hFuncTank );
- CFuncTank *GetFuncTank() { return m_hFuncTank; }
- void AimGun( void );
-
- void Dismount( void );
-
- int OnTakeDamage_Alive( const CTakeDamageInfo &info );
-
- // Time.
- void SetBusy( float flTime ) { m_flBusyTime = flTime; }
- bool IsBusy( void ) { return ( gpGlobals->curtime < m_flBusyTime ); }
-
- bool IsMounted( void ) { return m_bMounted; }
-
-private:
-
- // Schedule
- int SelectSchedule();
-
-private:
-
- CHandle<CFuncTank> m_hFuncTank;
- bool m_bMounted;
- float m_flBusyTime;
- bool m_bSpottedPlayerOutOfCover;
-};
-
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +//=============================================================================// + +#ifndef AI_BEHAVIOR_FUNCTANK_H +#define AI_BEHAVIOR_FUNCTANK_H +#ifdef _WIN32 +#pragma once +#endif + +#include "simtimer.h" +#include "ai_behavior.h" +#include "func_tank.h" + +#define AI_FUNCTANK_BEHAVIOR_BUSYTIME 10.0f + +enum +{ + FUNCTANK_SENTENCE_MOVE_TO_MOUNT = SENTENCE_BASE_BEHAVIOR_INDEX, + FUNCTANK_SENTENCE_JUST_MOUNTED, + FUNCTANK_SENTENCE_SCAN_FOR_ENEMIES, + FUNCTANK_SENTENCE_DISMOUNTING, +}; + + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +class CAI_FuncTankBehavior : public CAI_SimpleBehavior +{ + DECLARE_CLASS( CAI_FuncTankBehavior, CAI_SimpleBehavior ); + DEFINE_CUSTOM_SCHEDULE_PROVIDER; + DECLARE_DATADESC(); + +public: + // Contructor/Deconstructor + CAI_FuncTankBehavior(); + ~CAI_FuncTankBehavior(); + + void UpdateOnRemove(); + + // Identifier + const char *GetName() { return "FuncTank"; } + + // Schedule + bool CanSelectSchedule(); + void BeginScheduleSelection(); + void EndScheduleSelection(); + void PrescheduleThink(); + + Activity NPC_TranslateActivity( Activity activity ); + + // Conditions: + virtual void GatherConditions(); + + enum + { + SCHED_MOVE_TO_FUNCTANK = BaseClass::NEXT_SCHEDULE, + SCHED_FIRE_FUNCTANK, + SCHED_SCAN_WITH_FUNCTANK, + SCHED_FAIL_MOVE_TO_FUNCTANK, + }; + + // Tasks + void StartTask( const Task_t *pTask ); + void RunTask( const Task_t *pTask ); + + enum + { + TASK_GET_PATH_TO_FUNCTANK = BaseClass::NEXT_TASK, + TASK_FACE_FUNCTANK, + TASK_HOLSTER_WEAPON, + TASK_FIRE_FUNCTANK, + TASK_SCAN_LEFT_FUNCTANK, + TASK_SCAN_RIGHT_FUNCTANK, + TASK_FORGET_ABOUT_FUNCTANK, + TASK_FUNCTANK_ANNOUNCE_SCAN, + }; + + enum + { + COND_FUNCTANK_DISMOUNT = BaseClass::NEXT_CONDITION, + NEXT_CONDITION, + }; + + // Combat. + CBaseEntity *BestEnemy( void ); + void Event_Killed( const CTakeDamageInfo &info ); + + bool HasFuncTank( void ) { return ( m_hFuncTank != NULL ); } + void SetFuncTank( CHandle<CFuncTank> hFuncTank ); + CFuncTank *GetFuncTank() { return m_hFuncTank; } + void AimGun( void ); + + void Dismount( void ); + + int OnTakeDamage_Alive( const CTakeDamageInfo &info ); + + // Time. + void SetBusy( float flTime ) { m_flBusyTime = flTime; } + bool IsBusy( void ) { return ( gpGlobals->curtime < m_flBusyTime ); } + + bool IsMounted( void ) { return m_bMounted; } + +private: + + // Schedule + int SelectSchedule(); + +private: + + CHandle<CFuncTank> m_hFuncTank; + bool m_bMounted; + float m_flBusyTime; + bool m_bSpottedPlayerOutOfCover; +}; + #endif // AI_BEHAVIOR_FUNCTANK_H
\ No newline at end of file |