2008-09-15 14:11:05 +00:00
|
|
|
/*
|
2006-02-24 04:48:15 +00:00
|
|
|
#include "actor.h"
|
|
|
|
#include "info.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "p_enemy.h"
|
|
|
|
#include "gstrings.h"
|
|
|
|
#include "a_action.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
|
|
|
|
|
|
|
//
|
|
|
|
// PIT_VileCheck
|
|
|
|
// Detect a corpse that could be raised.
|
|
|
|
//
|
2008-08-10 22:48:37 +00:00
|
|
|
DECLARE_ACTION(A_Fire)
|
2006-11-04 16:19:50 +00:00
|
|
|
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// A_VileStart
|
|
|
|
//
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_VileStart)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
S_Sound (self, CHAN_VOICE, "vile/start", 1, ATTN_NORM);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// A_Fire
|
|
|
|
// Keep fire in front of player unless out of sight
|
|
|
|
//
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_StartFire)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
S_Sound (self, CHAN_BODY, "vile/firestrt", 1, ATTN_NORM);
|
2008-08-10 22:48:37 +00:00
|
|
|
CALL_ACTION(A_Fire, self);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_FireCrackle)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
S_Sound (self, CHAN_BODY, "vile/firecrkl", 1, ATTN_NORM);
|
2008-08-10 22:48:37 +00:00
|
|
|
CALL_ACTION(A_Fire, self);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_Fire)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
AActor *dest;
|
|
|
|
angle_t an;
|
|
|
|
|
|
|
|
dest = self->tracer;
|
|
|
|
if (!dest)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// don't move it if the vile lost sight
|
|
|
|
if (!P_CheckSight (self->target, dest, 0) )
|
|
|
|
return;
|
|
|
|
|
|
|
|
an = dest->angle >> ANGLETOFINESHIFT;
|
|
|
|
|
|
|
|
self->SetOrigin (dest->x + FixedMul (24*FRACUNIT, finecosine[an]),
|
|
|
|
dest->y + FixedMul (24*FRACUNIT, finesine[an]),
|
|
|
|
dest->z);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// A_VileTarget
|
|
|
|
// Spawn the hellfire
|
|
|
|
//
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_VileTarget)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
AActor *fog;
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
if (!self->target)
|
2006-02-24 04:48:15 +00:00
|
|
|
return;
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
A_FaceTarget (self);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
fog = Spawn ("ArchvileFire", self->target->x, self->target->y,
|
|
|
|
self->target->z, ALLOW_REPLACE);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
self->tracer = fog;
|
|
|
|
fog->target = self;
|
|
|
|
fog->tracer = self->target;
|
2008-08-10 22:48:37 +00:00
|
|
|
CALL_ACTION(A_Fire, fog);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// A_VileAttack
|
|
|
|
//
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_VileAttack)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
AActor *fire;
|
|
|
|
int an;
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
if (!self->target)
|
2006-02-24 04:48:15 +00:00
|
|
|
return;
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
A_FaceTarget (self);
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
if (!P_CheckSight (self, self->target, 0) )
|
2006-02-24 04:48:15 +00:00
|
|
|
return;
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
S_Sound (self, CHAN_WEAPON, "vile/stop", 1, ATTN_NORM);
|
|
|
|
P_DamageMobj (self->target, self, self, 20, NAME_None);
|
|
|
|
P_TraceBleed (20, self->target);
|
|
|
|
self->target->momz = 1000 * FRACUNIT / self->target->Mass;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
an = self->angle >> ANGLETOFINESHIFT;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
fire = self->tracer;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
if (!fire)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// move the fire between the vile and the player
|
2008-08-10 20:48:55 +00:00
|
|
|
fire->SetOrigin (self->target->x - FixedMul (24*FRACUNIT, finecosine[an]),
|
|
|
|
self->target->y - FixedMul (24*FRACUNIT, finesine[an]),
|
|
|
|
self->target->z);
|
2006-12-02 15:38:50 +00:00
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
P_RadiusAttack (fire, self, 70, 70, NAME_Fire, false);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|