mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-03-02 23:01:50 +00:00
Conflicts: src/actor.h src/fragglescript/t_func.cpp src/g_doom/a_bossbrain.cpp src/g_doom/a_revenant.cpp src/g_heretic/a_hereticartifacts.cpp src/g_heretic/a_hereticweaps.cpp src/g_heretic/a_knight.cpp src/g_hexen/a_bishop.cpp src/g_hexen/a_clericholy.cpp src/g_hexen/a_dragon.cpp src/g_hexen/a_firedemon.cpp src/g_hexen/a_flechette.cpp src/g_hexen/a_heresiarch.cpp src/g_hexen/a_hexenspecialdecs.cpp src/g_hexen/a_iceguy.cpp src/g_hexen/a_korax.cpp src/g_hexen/a_magelightning.cpp src/g_hexen/a_serpent.cpp src/g_hexen/a_spike.cpp src/g_hexen/a_wraith.cpp src/g_raven/a_minotaur.cpp src/g_shared/a_bridge.cpp src/g_shared/a_pickups.cpp src/g_shared/a_randomspawner.cpp src/g_strife/a_alienspectres.cpp src/g_strife/a_crusader.cpp src/g_strife/a_entityboss.cpp src/g_strife/a_inquisitor.cpp src/g_strife/a_loremaster.cpp src/g_strife/a_programmer.cpp src/g_strife/a_sentinel.cpp src/g_strife/a_spectral.cpp src/g_strife/a_strifestuff.cpp src/g_strife/a_strifeweapons.cpp src/g_strife/a_thingstoblowup.cpp src/p_local.h src/r_utility.cpp
88 lines
1.6 KiB
C++
88 lines
1.6 KiB
C++
/*
|
|
#include "actor.h"
|
|
#include "m_random.h"
|
|
#include "a_action.h"
|
|
#include "p_local.h"
|
|
#include "p_enemy.h"
|
|
#include "s_sound.h"
|
|
#include "thingdef/thingdef.h"
|
|
*/
|
|
|
|
static FRandom pr_stalker ("Stalker");
|
|
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_StalkerChaseDecide)
|
|
{
|
|
PARAM_ACTION_PROLOGUE;
|
|
|
|
if (!(self->flags & MF_NOGRAVITY))
|
|
{
|
|
self->SetState (self->FindState("SeeFloor"));
|
|
}
|
|
else if (self->ceilingz > self->Top())
|
|
{
|
|
self->SetState (self->FindState("Drop"));
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_StalkerLookInit)
|
|
{
|
|
PARAM_ACTION_PROLOGUE;
|
|
|
|
FState *state;
|
|
if (self->flags & MF_NOGRAVITY)
|
|
{
|
|
state = self->FindState("LookCeiling");
|
|
}
|
|
else
|
|
{
|
|
state = self->FindState("LookFloor");
|
|
}
|
|
if (self->state->NextState != state)
|
|
{
|
|
self->SetState (state);
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_StalkerDrop)
|
|
{
|
|
PARAM_ACTION_PROLOGUE;
|
|
|
|
self->flags5 &= ~MF5_NOVERTICALMELEERANGE;
|
|
self->flags &= ~MF_NOGRAVITY;
|
|
return 0;
|
|
}
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_StalkerAttack)
|
|
{
|
|
PARAM_ACTION_PROLOGUE;
|
|
|
|
if (self->flags & MF_NOGRAVITY)
|
|
{
|
|
self->SetState (self->FindState("Drop"));
|
|
}
|
|
else if (self->target != NULL)
|
|
{
|
|
A_FaceTarget (self);
|
|
if (self->CheckMeleeRange ())
|
|
{
|
|
int damage = (pr_stalker() & 7) * 2 + 2;
|
|
|
|
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
|
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_StalkerWalk)
|
|
{
|
|
PARAM_ACTION_PROLOGUE;
|
|
|
|
S_Sound (self, CHAN_BODY, "stalker/walk", 1, ATTN_NORM);
|
|
A_Chase (stack, self);
|
|
return 0;
|
|
}
|
|
|