mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-09 09:10:51 +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
85 lines
2 KiB
C++
85 lines
2 KiB
C++
/*
|
|
#include "info.h"
|
|
#include "a_pickups.h"
|
|
#include "a_artifacts.h"
|
|
#include "gstrings.h"
|
|
#include "p_local.h"
|
|
#include "s_sound.h"
|
|
#include "ravenshared.h"
|
|
#include "thingdef/thingdef.h"
|
|
#include "g_level.h"
|
|
*/
|
|
|
|
void A_Summon (AActor *);
|
|
|
|
// Dark Servant Artifact ----------------------------------------------------
|
|
|
|
class AArtiDarkServant : public AInventory
|
|
{
|
|
DECLARE_CLASS (AArtiDarkServant, AInventory)
|
|
public:
|
|
bool Use (bool pickup);
|
|
};
|
|
|
|
IMPLEMENT_CLASS (AArtiDarkServant)
|
|
|
|
//============================================================================
|
|
//
|
|
// Activate the summoning artifact
|
|
//
|
|
//============================================================================
|
|
|
|
bool AArtiDarkServant::Use (bool pickup)
|
|
{
|
|
AActor *mo = P_SpawnPlayerMissile (Owner, PClass::FindActor("SummoningDoll"));
|
|
if (mo)
|
|
{
|
|
mo->target = Owner;
|
|
mo->tracer = Owner;
|
|
mo->velz = 5*FRACUNIT;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
//============================================================================
|
|
//
|
|
// A_Summon
|
|
//
|
|
//============================================================================
|
|
|
|
DEFINE_ACTION_FUNCTION(AActor, A_Summon)
|
|
{
|
|
PARAM_ACTION_PROLOGUE;
|
|
|
|
AMinotaurFriend *mo;
|
|
|
|
mo = Spawn<AMinotaurFriend> (self->Pos(), ALLOW_REPLACE);
|
|
if (mo)
|
|
{
|
|
if (P_TestMobjLocation(mo) == false || !self->tracer)
|
|
{ // Didn't fit - change back to artifact
|
|
mo->Destroy ();
|
|
AActor *arti = Spawn<AArtiDarkServant> (self->Pos(), ALLOW_REPLACE);
|
|
if (arti) arti->flags |= MF_DROPPED;
|
|
return 0;
|
|
}
|
|
|
|
mo->StartTime = level.maptime;
|
|
if (self->tracer->flags & MF_CORPSE)
|
|
{ // Master dead
|
|
mo->tracer = NULL; // No master
|
|
}
|
|
else
|
|
{
|
|
mo->tracer = self->tracer; // Pointer to master
|
|
AInventory *power = Spawn<APowerMinotaur> (0, 0, 0, NO_REPLACE);
|
|
power->CallTryPickup (self->tracer);
|
|
mo->SetFriendPlayer(self->tracer->player);
|
|
}
|
|
|
|
// Make smoke puff
|
|
Spawn ("MinotaurSmoke", self->Pos(), ALLOW_REPLACE);
|
|
S_Sound (self, CHAN_VOICE, mo->ActiveSound, 1, ATTN_NORM);
|
|
}
|
|
return 0;
|
|
}
|