diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/server/tf/bot/behavior/sniper/tf_bot_sniper_attack.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/server/tf/bot/behavior/sniper/tf_bot_sniper_attack.h')
| -rw-r--r-- | game/server/tf/bot/behavior/sniper/tf_bot_sniper_attack.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/game/server/tf/bot/behavior/sniper/tf_bot_sniper_attack.h b/game/server/tf/bot/behavior/sniper/tf_bot_sniper_attack.h new file mode 100644 index 0000000..7a65102 --- /dev/null +++ b/game/server/tf/bot/behavior/sniper/tf_bot_sniper_attack.h @@ -0,0 +1,37 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// tf_bot_sniper_attack.h +// Attack a threat as a Sniper +// Michael Booth, February 2009 + +#ifndef TF_BOT_SNIPER_ATTACK_H +#define TF_BOT_SNIPER_ATTACK_H + +#include "Path/NextBotChasePath.h" + +class CTFBotSniperAttack : public Action< CTFBot > +{ +public: + static bool IsPossible( CTFBot *me ); // return true if this Action has what it needs to perform right now + + virtual ActionResult< CTFBot > OnStart( CTFBot *me, Action< CTFBot > *priorAction ); + virtual ActionResult< CTFBot > Update( CTFBot *me, float interval ); + void OnEnd( CTFBot *me, Action< CTFBot > *nextAction ); + virtual ActionResult< CTFBot > OnSuspend( CTFBot *me, Action< CTFBot > *interruptingAction ); + virtual ActionResult< CTFBot > OnResume( CTFBot *me, Action< CTFBot > *interruptingAction ); + + virtual Vector SelectTargetPoint( const INextBot *me, const CBaseCombatCharacter *subject ) const; // given a subject, return the world space position we should aim at + + virtual const CKnownEntity * SelectMoreDangerousThreat( const INextBot *me, + const CBaseCombatCharacter *subject, + const CKnownEntity *threat1, + const CKnownEntity *threat2 ) const; // return the more dangerous of the two threats to 'subject', or NULL if we have no opinion + + virtual const char *GetName( void ) const { return "SniperAttack"; }; + +private: + CountdownTimer m_lingerTimer; + + bool IsImmediateThreat( const CBaseCombatCharacter *subject, const CKnownEntity *threat ) const; +}; + +#endif // TF_BOT_SNIPER_ATTACK_H |