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/halloween/merasmus/merasmus_behavior/merasmus_aoe_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/halloween/merasmus/merasmus_behavior/merasmus_aoe_attack.h')
| -rw-r--r-- | game/server/tf/halloween/merasmus/merasmus_behavior/merasmus_aoe_attack.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/game/server/tf/halloween/merasmus/merasmus_behavior/merasmus_aoe_attack.h b/game/server/tf/halloween/merasmus/merasmus_behavior/merasmus_aoe_attack.h new file mode 100644 index 0000000..76c04cf --- /dev/null +++ b/game/server/tf/halloween/merasmus/merasmus_behavior/merasmus_aoe_attack.h @@ -0,0 +1,51 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// +// +//============================================================================= +#ifndef MERASMUS_AOE_ATTACK_H +#define MERASMUS_AOE_ATTACK_H + +class CMerasmusAOEAttack : public Action< CMerasmus > +{ +public: + virtual ActionResult< CMerasmus > OnStart( CMerasmus *me, Action< CMerasmus > *priorAction ); + virtual ActionResult< CMerasmus > Update( CMerasmus *me, float interval ); + virtual void OnEnd( CMerasmus *me, Action< CMerasmus > *nextAction ); + + virtual const char *GetName( void ) const { return "AOE Attack!"; } // return name of this action +private: + enum AOEState_t + { + AOE_BEGIN, + AOE_FIRING, + }; + AOEState_t m_state; + + CountdownTimer m_aoeStartTimer; + CountdownTimer m_launchTimer; + CountdownTimer m_flyTimer; + CUtlVector< CNavArea * > m_wanderAreaVector; + CountdownTimer m_wanderTimer; + CTFNavArea *m_wanderArea; + + // To save network perf, we don't create all bombs in a single tick. Rather, we fill up a queue of bombs and distribute the creation over time. + // I originally had another property (start position) as part of MerasmusGrenadeCreateSpec_t, but it didn't make sense, since we want to use + // his current position when we actually create -- not the position he was at whenever we actually filled the queue with grenades. I'm leaving + // the struct here, rather than making m_vecGrenadesToCreate a CUtlVector< Vector >, in case we want to add anything else. + struct MerasmusGrenadeCreateSpec_t + { + MerasmusGrenadeCreateSpec_t( const Vector &v ) : m_vecVelocity( v ) {} + Vector m_vecVelocity; + }; + CUtlVector< MerasmusGrenadeCreateSpec_t > m_vecGrenadesToCreate; + + void QueueSingleGrenadeForLaunch( const Vector &vecVelocity ); // Don't call directly - call QueueBombRingsForLaunch() or QueueBombSpokesForLaunch() + void ClearPendingGrenades(); + void LaunchPendingGrenades( CMerasmus *me ); + + void QueueBombRingsForLaunch( CMerasmus *me ); + void QueueBombSpokesForLaunch( CMerasmus *me ); +}; + +#endif // MERASMUS_TELEPORT_AOE_ATTACK_H |