gzdoom-gles/src/g_strife/a_crusader.cpp
Christoph Oelckers bc63b70d88 Merge branch 'master' into scripting
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
2016-01-19 13:43:11 +01:00

100 lines
2.4 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 "a_strifeglobal.h"
#include "thingdef/thingdef.h"
*/
static bool CrusaderCheckRange (AActor *self)
{
if (self->reactiontime == 0 && P_CheckSight (self, self->target))
{
return self->AproxDistance (self->target) < 264*FRACUNIT;
}
return false;
}
DEFINE_ACTION_FUNCTION(AActor, A_CrusaderChoose)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL)
return 0;
if (CrusaderCheckRange (self))
{
A_FaceTarget (self);
self->angle -= ANGLE_180/16;
P_SpawnMissileZAimed (self, self->Z() + 40*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile"));
}
else
{
if (P_CheckMissileRange (self))
{
A_FaceTarget (self);
P_SpawnMissileZAimed (self, self->Z() + 56*FRACUNIT, self->target, PClass::FindActor("CrusaderMissile"));
self->angle -= ANGLE_45/32;
P_SpawnMissileZAimed (self, self->Z() + 40*FRACUNIT, self->target, PClass::FindActor("CrusaderMissile"));
self->angle += ANGLE_45/16;
P_SpawnMissileZAimed (self, self->Z() + 40*FRACUNIT, self->target, PClass::FindActor("CrusaderMissile"));
self->angle -= ANGLE_45/16;
self->reactiontime += 15;
}
self->SetState (self->SeeState);
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepLeft)
{
PARAM_ACTION_PROLOGUE;
self->angle += ANGLE_90/16;
AActor *misl = P_SpawnMissileZAimed (self, self->Z() + 48*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile"));
if (misl != NULL)
{
misl->velz += FRACUNIT;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepRight)
{
PARAM_ACTION_PROLOGUE;
self->angle -= ANGLE_90/16;
AActor *misl = P_SpawnMissileZAimed (self, self->Z() + 48*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile"));
if (misl != NULL)
{
misl->velz += FRACUNIT;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CrusaderRefire)
{
PARAM_ACTION_PROLOGUE;
if (self->target == NULL ||
self->target->health <= 0 ||
!P_CheckSight (self, self->target))
{
self->SetState (self->SeeState);
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_CrusaderDeath)
{
PARAM_ACTION_PROLOGUE;
if (CheckBossDeath (self))
{
EV_DoFloor (DFloor::floorLowerToLowest, NULL, 667, FRACUNIT, 0, -1, 0, false);
}
return 0;
}