summaryrefslogtreecommitdiff
path: root/game/server/tf/halloween/merasmus/merasmus_behavior/merasmus_aoe_attack.h
diff options
context:
space:
mode:
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.h51
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