2006-02-24 04:48:15 +00:00
|
|
|
#include "info.h"
|
|
|
|
#include "a_pickups.h"
|
|
|
|
#include "a_artifacts.h"
|
|
|
|
#include "gstrings.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "p_enemy.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "ravenshared.h"
|
|
|
|
|
|
|
|
void A_Summon (AActor *);
|
|
|
|
|
|
|
|
// Dark Servant Artifact ----------------------------------------------------
|
|
|
|
|
|
|
|
class AArtiDarkServant : public AInventory
|
|
|
|
{
|
|
|
|
DECLARE_ACTOR (AArtiDarkServant, AInventory)
|
|
|
|
public:
|
|
|
|
bool Use (bool pickup);
|
|
|
|
};
|
|
|
|
|
|
|
|
FState AArtiDarkServant::States[] =
|
|
|
|
{
|
|
|
|
#define S_ARTI_SUMMON 0
|
|
|
|
S_NORMAL (SUMN, 'A', 350, NULL , &States[S_ARTI_SUMMON]),
|
|
|
|
};
|
|
|
|
|
|
|
|
IMPLEMENT_ACTOR (AArtiDarkServant, Hexen, 86, 16)
|
2006-11-14 16:54:02 +00:00
|
|
|
PROP_Flags (MF_SPECIAL|MF_COUNTITEM)
|
2006-02-24 04:48:15 +00:00
|
|
|
PROP_Flags2 (MF2_FLOATBOB)
|
|
|
|
PROP_SpawnState (S_ARTI_SUMMON)
|
|
|
|
PROP_Inventory_RespawnTics (30+4200)
|
|
|
|
PROP_Inventory_DefMaxAmount
|
2008-02-16 10:23:12 +00:00
|
|
|
PROP_Inventory_PickupFlash (1)
|
|
|
|
PROP_Inventory_FlagsSet (IF_INVBAR|IF_FANCYPICKUPSOUND)
|
2006-02-24 04:48:15 +00:00
|
|
|
PROP_Inventory_Icon ("ARTISUMN")
|
|
|
|
PROP_Inventory_PickupSound ("misc/p_pkup")
|
2006-06-17 20:29:41 +00:00
|
|
|
PROP_Inventory_PickupMessage("$TXT_ARTISUMMON")
|
2006-02-24 04:48:15 +00:00
|
|
|
END_DEFAULTS
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// Activate the summoning artifact
|
|
|
|
//
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
bool AArtiDarkServant::Use (bool pickup)
|
|
|
|
{
|
2008-08-03 16:13:23 +00:00
|
|
|
AActor *mo = P_SpawnPlayerMissile (Owner, PClass::FindClass ("SummoningDoll"));
|
2006-02-24 04:48:15 +00:00
|
|
|
if (mo)
|
|
|
|
{
|
|
|
|
mo->target = Owner;
|
|
|
|
mo->tracer = Owner;
|
|
|
|
mo->momz = 5*FRACUNIT;
|
|
|
|
}
|
2006-04-10 21:54:50 +00:00
|
|
|
return true;
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// A_Summon
|
|
|
|
//
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
void A_Summon (AActor *actor)
|
|
|
|
{
|
2006-04-23 20:12:27 +00:00
|
|
|
AMinotaurFriend *mo;
|
2006-02-24 04:48:15 +00:00
|
|
|
|
2006-07-16 09:10:45 +00:00
|
|
|
mo = Spawn<AMinotaurFriend> (actor->x, actor->y, actor->z, ALLOW_REPLACE);
|
2006-02-24 04:48:15 +00:00
|
|
|
if (mo)
|
|
|
|
{
|
|
|
|
if (P_TestMobjLocation(mo) == false || !actor->tracer)
|
|
|
|
{ // Didn't fit - change back to artifact
|
|
|
|
mo->Destroy ();
|
2006-07-16 09:10:45 +00:00
|
|
|
AActor *arti = Spawn<AArtiDarkServant> (actor->x, actor->y, actor->z, ALLOW_REPLACE);
|
2006-02-24 04:48:15 +00:00
|
|
|
if (arti) arti->flags |= MF_DROPPED;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
mo->StartTime = level.maptime;
|
|
|
|
if (actor->tracer->flags & MF_CORPSE)
|
|
|
|
{ // Master dead
|
|
|
|
mo->tracer = NULL; // No master
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mo->tracer = actor->tracer; // Pointer to master
|
2006-07-16 09:10:45 +00:00
|
|
|
AInventory *power = Spawn<APowerMinotaur> (0, 0, 0, NO_REPLACE);
|
2006-02-24 04:48:15 +00:00
|
|
|
power->TryPickup (actor->tracer);
|
|
|
|
if (actor->tracer->player != NULL)
|
|
|
|
{
|
|
|
|
mo->FriendPlayer = int(actor->tracer->player - players + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Make smoke puff
|
2008-08-03 16:13:23 +00:00
|
|
|
Spawn ("MinotaurSmoke", actor->x, actor->y, actor->z, ALLOW_REPLACE);
|
2008-06-15 02:25:09 +00:00
|
|
|
S_Sound (actor, CHAN_VOICE, mo->ActiveSound, 1, ATTN_NORM);
|
2006-02-24 04:48:15 +00:00
|
|
|
}
|
|
|
|
}
|