mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 12:11:25 +00:00
- added PinkSilver's A_Respawn enhancement patch.
SVN r1837 (trunk)
This commit is contained in:
parent
e5357d1b65
commit
45842e28bd
4 changed files with 46 additions and 9 deletions
|
@ -1,4 +1,5 @@
|
|||
September 15, 2009 (Changes by Graf Zahl)
|
||||
- added PinkSilver's A_Respawn enhancement patch.
|
||||
- added RandomSpawner update from Gez's experimental build.
|
||||
- added thing activation types for BUMPSPECIAL and USESPECIAL. Also added
|
||||
a new ClearSpecial flag to the activation type.
|
||||
|
|
|
@ -2122,27 +2122,58 @@ static void CheckStopped(AActor *self)
|
|||
// A_Respawn
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
enum RS_Flags
|
||||
{
|
||||
RSF_FOG=1,
|
||||
RSF_KEEPTARGET=2,
|
||||
RSF_TELEFRAG=4,
|
||||
};
|
||||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Respawn)
|
||||
{
|
||||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_BOOL(fog, 0);
|
||||
ACTION_PARAM_INT(flags, 0);
|
||||
|
||||
fixed_t x = self->SpawnPoint[0];
|
||||
fixed_t y = self->SpawnPoint[1];
|
||||
bool oktorespawn = false;
|
||||
sector_t *sec;
|
||||
|
||||
self->flags |= MF_SOLID;
|
||||
sec = P_PointInSector (x, y);
|
||||
self->SetOrigin (x, y, sec->floorplane.ZatPoint (x, y));
|
||||
self->height = self->GetDefault()->height;
|
||||
if (P_TestMobjLocation (self))
|
||||
|
||||
if (flags & RSF_TELEFRAG)
|
||||
{
|
||||
// [KS] DIE DIE DIE DIE erm *ahem* =)
|
||||
if (P_TeleportMove (self, x, y, sec->floorplane.ZatPoint (x, y), true)) oktorespawn = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->SetOrigin (x, y, sec->floorplane.ZatPoint (x, y));
|
||||
if (P_TestMobjLocation (self)) oktorespawn = true;
|
||||
}
|
||||
|
||||
if (oktorespawn)
|
||||
{
|
||||
AActor *defs = self->GetDefault();
|
||||
self->health = defs->health;
|
||||
|
||||
// [KS] Don't keep target, because it could be self if the monster committed suicide
|
||||
self->target = NULL;
|
||||
self->LastHeard = NULL;
|
||||
|
||||
// [KS] Don't keep target, because it could be self if the monster committed suicide
|
||||
// ...Actually it's better off an option, so you have better control over monster behavior.
|
||||
if (!(flags & RSF_KEEPTARGET))
|
||||
{
|
||||
self->target = NULL;
|
||||
self->LastHeard = NULL;
|
||||
self->lastenemy = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't attack yourself (Re: "Marine targets itself after suicide")
|
||||
if (self->target == self) self->target = NULL;
|
||||
if (self->lastenemy == self) self->lastenemy = NULL;
|
||||
}
|
||||
|
||||
self->flags = (defs->flags & ~MF_FRIENDLY) | (self->flags & MF_FRIENDLY);
|
||||
self->flags2 = defs->flags2;
|
||||
|
@ -2152,7 +2183,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Respawn)
|
|||
self->SetState (self->SpawnState);
|
||||
self->renderflags &= ~RF_INVISIBLE;
|
||||
|
||||
if (fog)
|
||||
if (flags & RSF_FOG)
|
||||
{
|
||||
Spawn<ATeleportFog> (x, y, self->z + TELEFOGHEIGHT, ALLOW_REPLACE);
|
||||
}
|
||||
|
|
|
@ -230,7 +230,7 @@ ACTOR Actor native //: Thinker
|
|||
action native A_RadiusThrust(int force = 128, int distance = -1, bool affectsource = true);
|
||||
action native A_Explode(int damage = -1, int distance = -1, bool hurtsource = true, bool alert = false, int fulldamagedistance = 0, int nails = 0, int naildamage = 10);
|
||||
action native A_Stop();
|
||||
action native A_Respawn(bool fog = true);
|
||||
action native A_Respawn(int flags = 1);
|
||||
action native A_BarrelDestroy();
|
||||
action native A_QueueCorpse();
|
||||
action native A_DeQueueCorpse();
|
||||
|
|
|
@ -33,6 +33,11 @@ const int LOF_DONTCHASEGOAL = 4;
|
|||
const int LOF_NOSEESOUND = 8;
|
||||
const int LOF_FULLVOLSEESOUND = 16;
|
||||
|
||||
// Flags for A_Respawn
|
||||
const int RSF_FOG = 1;
|
||||
const int RSF_KEEPTARGET = 2;
|
||||
const int RSF_TELEFRAG = 4;
|
||||
|
||||
// Flags for A_ChangeVelocity
|
||||
const int CVF_RELATIVE = 1;
|
||||
const int CVF_REPLACE = 2;
|
||||
|
|
Loading…
Reference in a new issue