2006-02-24 04:48:15 +00:00
|
|
|
#include "actor.h"
|
|
|
|
#include "info.h"
|
|
|
|
#include "m_random.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "p_enemy.h"
|
|
|
|
#include "a_hereticglobal.h"
|
|
|
|
#include "a_action.h"
|
|
|
|
#include "gstrings.h"
|
|
|
|
|
|
|
|
static FRandom pr_wizatk3 ("WizAtk3");
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_GhostOff
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void A_GhostOff (AActor *actor)
|
|
|
|
{
|
|
|
|
actor->RenderStyle = STYLE_Normal;
|
|
|
|
actor->flags3 &= ~MF3_GHOST;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_WizAtk1
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void A_WizAtk1 (AActor *actor)
|
|
|
|
{
|
|
|
|
A_FaceTarget (actor);
|
|
|
|
A_GhostOff (actor);
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_WizAtk2
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void A_WizAtk2 (AActor *actor)
|
|
|
|
{
|
|
|
|
A_FaceTarget (actor);
|
|
|
|
actor->alpha = HR_SHADOW;
|
|
|
|
actor->RenderStyle = STYLE_Translucent;
|
|
|
|
actor->flags3 |= MF3_GHOST;
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_WizAtk3
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void A_WizAtk3 (AActor *actor)
|
|
|
|
{
|
|
|
|
AActor *mo;
|
|
|
|
|
|
|
|
A_GhostOff (actor);
|
|
|
|
if (!actor->target)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2008-06-15 02:25:09 +00:00
|
|
|
S_Sound (actor, CHAN_WEAPON, actor->AttackSound, 1, ATTN_NORM);
|
2006-02-24 04:48:15 +00:00
|
|
|
if (actor->CheckMeleeRange())
|
|
|
|
{
|
|
|
|
int damage = pr_wizatk3.HitDice (4);
|
2006-10-31 14:53:21 +00:00
|
|
|
P_DamageMobj (actor->target, actor, actor, damage, NAME_Melee);
|
2006-02-24 04:48:15 +00:00
|
|
|
P_TraceBleed (damage, actor->target, actor);
|
|
|
|
return;
|
|
|
|
}
|
2008-07-21 17:03:30 +00:00
|
|
|
const PClass *fx = PClass::FindClass("WizardFX1");
|
|
|
|
mo = P_SpawnMissile (actor, actor->target, fx);
|
2006-02-24 04:48:15 +00:00
|
|
|
if (mo != NULL)
|
|
|
|
{
|
2008-07-21 17:03:30 +00:00
|
|
|
P_SpawnMissileAngle(actor, fx, mo->angle-(ANG45/8), mo->momz);
|
|
|
|
P_SpawnMissileAngle(actor, fx, mo->angle+(ANG45/8), mo->momz);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
}
|