2008-09-15 14:11:05 +00:00
|
|
|
/*
|
2006-02-24 04:48:15 +00:00
|
|
|
#include "templates.h"
|
|
|
|
#include "actor.h"
|
|
|
|
#include "info.h"
|
|
|
|
#include "m_random.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "gstrings.h"
|
2008-08-10 20:48:55 +00:00
|
|
|
#include "thingdef/thingdef.h"
|
2008-09-15 14:11:05 +00:00
|
|
|
*/
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2009-11-27 13:23:02 +00:00
|
|
|
static FRandom pr_impmsatk ("ImpMsAttack");
|
2006-02-24 04:48:15 +00:00
|
|
|
static FRandom pr_imp ("ImpExplode");
|
|
|
|
|
2009-11-27 13:23:02 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_ImpMsAttack
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_ImpMsAttack)
|
|
|
|
{
|
|
|
|
if (!self->target || pr_impmsatk() > 64)
|
|
|
|
{
|
|
|
|
self->SetState (self->SeeState);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
A_SkullAttack(self, 12 * FRACUNIT);
|
|
|
|
}
|
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_ImpExplode
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_ImpExplode)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
AActor *chunk;
|
|
|
|
|
|
|
|
self->flags &= ~MF_NOGRAVITY;
|
|
|
|
|
2008-07-21 17:03:30 +00:00
|
|
|
chunk = Spawn("HereticImpChunk1", self->x, self->y, self->z, ALLOW_REPLACE);
|
2009-06-30 20:57:51 +00:00
|
|
|
chunk->velx = pr_imp.Random2 () << 10;
|
|
|
|
chunk->vely = pr_imp.Random2 () << 10;
|
|
|
|
chunk->velz = 9*FRACUNIT;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-07-21 17:03:30 +00:00
|
|
|
chunk = Spawn("HereticImpChunk2", self->x, self->y, self->z, ALLOW_REPLACE);
|
2009-06-30 20:57:51 +00:00
|
|
|
chunk->velx = pr_imp.Random2 () << 10;
|
|
|
|
chunk->vely = pr_imp.Random2 () << 10;
|
|
|
|
chunk->velz = 9*FRACUNIT;
|
2006-02-24 04:48:15 +00:00
|
|
|
if (self->special1 == 666)
|
|
|
|
{ // Extreme death crash
|
2008-07-21 17:03:30 +00:00
|
|
|
self->SetState (self->FindState("XCrash"));
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_ImpDeath
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_ImpDeath)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
self->flags &= ~MF_SOLID;
|
|
|
|
self->flags2 |= MF2_FLOORCLIP;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_ImpXDeath1
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_ImpXDeath1)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
self->flags &= ~MF_SOLID;
|
|
|
|
self->flags |= MF_NOGRAVITY;
|
|
|
|
self->flags2 |= MF2_FLOORCLIP;
|
|
|
|
self->special1 = 666; // Flag the crash routine
|
|
|
|
}
|
|
|
|
|