vkdoom_m/src/g_strife/a_entityboss.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

132 lines
3.3 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"
#include "g_level.h"
*/
static FRandom pr_entity ("Entity");
DEFINE_ACTION_FUNCTION(AActor, A_SubEntityDeath)
{
PARAM_ACTION_PROLOGUE;
if (CheckBossDeath (self))
{
G_ExitLevel (0, false);
}
return 0;
}
void A_SpectralMissile (AActor *self, const char *missilename)
{
if (self->target != NULL)
{
AActor *missile = P_SpawnMissileXYZ (self->PosPlusZ(32*FRACUNIT),
self, self->target, PClass::FindActor(missilename), false);
if (missile != NULL)
{
missile->tracer = self->target;
P_CheckMissileSpawn(missile, self->radius);
}
}
}
DECLARE_ACTION(A_SpotLightning)
DECLARE_ACTION(A_Spectre3Attack)
DEFINE_ACTION_FUNCTION(AActor, A_EntityAttack)
{
PARAM_ACTION_PROLOGUE;
// Apparent Strife bug: Case 5 was unreachable because they used % 5 instead of % 6.
// I've fixed that by making case 1 duplicate it, since case 1 did nothing.
switch (pr_entity() % 5)
{
case 0:
CALL_ACTION(A_SpotLightning, self);
break;
case 2:
A_SpectralMissile (self, "SpectralLightningH3");
break;
case 3:
CALL_ACTION(A_Spectre3Attack, self);
break;
case 4:
A_SpectralMissile (self, "SpectralLightningBigV2");
break;
case 1:
case 5:
A_SpectralMissile (self, "SpectralLightningBigBall2");
break;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_SpawnEntity)
{
PARAM_ACTION_PROLOGUE;
AActor *entity = Spawn("EntityBoss", self->PosPlusZ(70*FRACUNIT), ALLOW_REPLACE);
if (entity != NULL)
{
entity->angle = self->angle;
entity->CopyFriendliness(self, true);
entity->velz = 5*FRACUNIT;
entity->tracer = self;
}
return 0;
}
DEFINE_ACTION_FUNCTION(AActor, A_EntityDeath)
{
PARAM_ACTION_PROLOGUE;
AActor *second;
fixed_t secondRadius = GetDefaultByName("EntitySecond")->radius * 2;
angle_t an;
AActor *spot = self->tracer;
if (spot == NULL) spot = self;
fixedvec3 pos = spot->Vec3Angle(secondRadius, self->angle, self->tracer? 70*FRACUNIT : 0);
an = self->angle >> ANGLETOFINESHIFT;
second = Spawn("EntitySecond", pos, ALLOW_REPLACE);
second->CopyFriendliness(self, true);
//second->target = self->target;
A_FaceTarget (second);
an = second->angle >> ANGLETOFINESHIFT;
second->velx += FixedMul (finecosine[an], 320000);
second->vely += FixedMul (finesine[an], 320000);
pos = spot->Vec3Angle(secondRadius, self->angle + ANGLE_90, self->tracer? 70*FRACUNIT : 0);
an = (self->angle + ANGLE_90) >> ANGLETOFINESHIFT;
second = Spawn("EntitySecond", pos, ALLOW_REPLACE);
second->CopyFriendliness(self, true);
//second->target = self->target;
second->velx = FixedMul (secondRadius, finecosine[an]) << 2;
second->vely = FixedMul (secondRadius, finesine[an]) << 2;
A_FaceTarget (second);
pos = spot->Vec3Angle(secondRadius, self->angle - ANGLE_90, self->tracer? 70*FRACUNIT : 0);
an = (self->angle - ANGLE_90) >> ANGLETOFINESHIFT;
second = Spawn("EntitySecond", pos, ALLOW_REPLACE);
second->CopyFriendliness(self, true);
//second->target = self->target;
second->velx = FixedMul (secondRadius, finecosine[an]) << 2;
second->vely = FixedMul (secondRadius, finesine[an]) << 2;
A_FaceTarget (second);
return 0;
}