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/engineer/tf_bot_engineer_building.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/engineer/tf_bot_engineer_building.h')
| -rw-r--r-- | game/server/tf/bot/behavior/engineer/tf_bot_engineer_building.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/game/server/tf/bot/behavior/engineer/tf_bot_engineer_building.h b/game/server/tf/bot/behavior/engineer/tf_bot_engineer_building.h new file mode 100644 index 0000000..e5928ce --- /dev/null +++ b/game/server/tf/bot/behavior/engineer/tf_bot_engineer_building.h @@ -0,0 +1,64 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// tf_bot_engineer_building.h +// At building location, constructing buildings +// Michael Booth, May 2010 + +#ifndef TF_BOT_ENGINEER_BUILDING_H +#define TF_BOT_ENGINEER_BUILDING_H + +class CTFBotHintSentrygun; + + +class CTFBotEngineerBuilding : public Action< CTFBot > +{ +public: + CTFBotEngineerBuilding( void ); + CTFBotEngineerBuilding( CTFBotHintSentrygun *sentryBuildHint ); + + virtual ActionResult< CTFBot > OnStart( CTFBot *me, Action< CTFBot > *priorAction ); + virtual ActionResult< CTFBot > Update( CTFBot *me, float interval ); + virtual void OnEnd( CTFBot *me, Action< CTFBot > *nextAction ); + + virtual ActionResult< CTFBot > OnResume( CTFBot *me, Action< CTFBot > *interruptingAction ); + + virtual EventDesiredResult< CTFBot > OnTerritoryLost( CTFBot *me, int territoryID ); + virtual EventDesiredResult< CTFBot > OnTerritoryCaptured( CTFBot *me, int territoryID ); + + virtual const char *GetName( void ) const { return "EngineerBuilding"; }; + +private: + CountdownTimer m_searchTimer; + CountdownTimer m_getAmmoTimer; + CountdownTimer m_repathTimer; + CountdownTimer m_buildTeleporterExitTimer; + + int m_sentryTriesLeft; + + CountdownTimer m_dispenserRetryTimer; + CountdownTimer m_teleportExitRetryTimer; + + PathFollower m_path; + + CHandle< CTFBotHintSentrygun > m_sentryBuildHint; + + bool m_hasBuiltSentry; + + enum NearbyMetalType + { + NEARBY_METAL_UNKNOWN, + NEARBY_METAL_NONE, + NEARBY_METAL_EXISTS + }; + + NearbyMetalType m_nearbyMetalStatus; + + CountdownTimer m_territoryRangeTimer; + bool m_isSentryOutOfPosition; + bool CheckIfSentryIsOutOfPosition( CTFBot *me ) const; + + void UpgradeAndMaintainBuildings( CTFBot *me ); + bool IsMetalSourceNearby( CTFBot *me ) const; +}; + + +#endif // TF_BOT_ENGINEER_BUILDING_H |