summaryrefslogtreecommitdiff
path: root/game/server/tf/halloween/merasmus/merasmus_behavior/merasmus_dying.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/server/tf/halloween/merasmus/merasmus_behavior/merasmus_dying.cpp
downloadarchived-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_dying.cpp')
-rw-r--r--game/server/tf/halloween/merasmus/merasmus_behavior/merasmus_dying.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/game/server/tf/halloween/merasmus/merasmus_behavior/merasmus_dying.cpp b/game/server/tf/halloween/merasmus/merasmus_behavior/merasmus_dying.cpp
new file mode 100644
index 0000000..216ca92
--- /dev/null
+++ b/game/server/tf/halloween/merasmus/merasmus_behavior/merasmus_dying.cpp
@@ -0,0 +1,60 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+//
+//
+//=============================================================================
+#include "cbase.h"
+
+#include "particle_parse.h"
+#include "tf_gamerules.h"
+
+#include "../merasmus.h"
+#include "merasmus_dying.h"
+#include "tf/halloween/eyeball_boss/teleport_vortex.h"
+
+//---------------------------------------------------------------------------------------------
+ActionResult< CMerasmus > CMerasmusDying::OnStart( CMerasmus *me, Action< CMerasmus > *priorAction )
+{
+ me->GetBodyInterface()->StartActivity( ACT_DIESIMPLE );
+ me->PlayHighPrioritySound( "Halloween.MerasmusBanish" );
+ TFGameRules()->BroadcastSound( 255, "Halloween.Merasmus_Death" );
+
+ return Continue();
+}
+
+
+//---------------------------------------------------------------------------------------------
+ActionResult< CMerasmus > CMerasmusDying::Update( CMerasmus *me, float interval )
+{
+ if ( me->IsActivityFinished() )
+ {
+ me->Break();
+ DispatchParticleEffect( "merasmus_spawn", me->GetAbsOrigin(), me->GetAbsAngles() );
+
+ IGameEvent *event = gameeventmanager->CreateEvent( "merasmus_killed" );
+ if ( event )
+ {
+ event->SetInt( "level", me->GetLevel() );
+ gameeventmanager->FireEvent( event );
+ }
+ me->TriggerLogicRelay( "boss_dead_relay" );
+
+ // create vortex to loot
+ CTeleportVortex *vortex = (CTeleportVortex *)CBaseEntity::Create( "teleport_vortex", me->WorldSpaceCenter(), vec3_angle );
+ if ( vortex )
+ {
+ vortex->SetupVortex( true, true );
+ }
+
+ me->GainLevel();
+
+ me->StartRespawnTimer();
+
+ UTIL_Remove( me );
+
+ return Done();
+ }
+
+ return Continue();
+}
+