2006-02-24 04:48:15 +00:00
|
|
|
#include "actor.h"
|
|
|
|
#include "p_enemy.h"
|
|
|
|
#include "a_action.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "m_random.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "a_strifeglobal.h"
|
2008-08-10 20:48:55 +00:00
|
|
|
#include "thingdef/thingdef.h"
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
static FRandom pr_reaverattack ("ReaverAttack");
|
|
|
|
|
2008-08-10 20:48:55 +00:00
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_ReaverRanged)
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
if (self->target != NULL)
|
|
|
|
{
|
|
|
|
angle_t bangle;
|
|
|
|
int pitch;
|
|
|
|
|
|
|
|
A_FaceTarget (self);
|
|
|
|
S_Sound (self, CHAN_WEAPON, "reaver/attack", 1, ATTN_NORM);
|
|
|
|
bangle = self->angle;
|
|
|
|
pitch = P_AimLineAttack (self, bangle, MISSILERANGE);
|
|
|
|
|
|
|
|
for (int i = 0; i < 3; ++i)
|
|
|
|
{
|
|
|
|
angle_t angle = bangle + (pr_reaverattack.Random2() << 20);
|
|
|
|
int damage = ((pr_reaverattack() & 7) + 1) * 3;
|
2008-08-08 10:24:08 +00:00
|
|
|
P_LineAttack (self, angle, MISSILERANGE, pitch, damage, NAME_None, NAME_StrifePuff);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|