- fixed: A_KeenDie should not drop items.

SVN r2300 (trunk)
This commit is contained in:
Christoph Oelckers 2010-04-23 08:12:47 +00:00
parent bd40bba37c
commit 674c63d66c
7 changed files with 50 additions and 44 deletions

View file

@ -15,7 +15,7 @@
//
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_KeenDie)
{
CALL_ACTION(A_NoBlocking, self);
A_Unblock(self, false);
// scan the remaining thinkers to see if all Keens are dead
AActor *other;

View file

@ -162,7 +162,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PainDie)
self->flags &= ~MF_FRIENDLY;
}
const PClass *spawntype = GetSpawnType(PUSH_PARAMINFO);
CALL_ACTION(A_NoBlocking, self);
A_Unblock(self, true);
A_PainShootSkull (self, self->angle + ANG90, spawntype);
A_PainShootSkull (self, self->angle + ANG180, spawntype);
A_PainShootSkull (self, self->angle + ANG270, spawntype);

View file

@ -57,7 +57,7 @@ IMPLEMENT_CLASS (ASwitchingDecoration)
//
//----------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AActor, A_NoBlocking)
void A_Unblock(AActor *self, bool drop)
{
// [RH] Andy Baker's stealth monsters
if (self->flags & MF_STEALTH)
@ -78,8 +78,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_NoBlocking)
self->Conversation = NULL;
// If the self has attached metadata for items to drop, drop those.
if (!self->IsKindOf (RUNTIME_CLASS (APlayerPawn))) // [GRB]
// If the actor has attached metadata for items to drop, drop those.
if (drop && !self->IsKindOf (RUNTIME_CLASS (APlayerPawn))) // [GRB]
{
FDropItem *di = self->GetDropItems();
@ -98,9 +98,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_NoBlocking)
}
}
DEFINE_ACTION_FUNCTION(AActor, A_NoBlocking)
{
A_Unblock(self, true);
}
DEFINE_ACTION_FUNCTION(AActor, A_Fall)
{
CALL_ACTION(A_NoBlocking, self);
A_Unblock(self, true);
}
//==========================================================================
@ -301,7 +306,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
{
CALL_ACTION(A_BossDeath, self);
}
CALL_ACTION(A_NoBlocking, self);
A_Unblock(self, true);
self->SetState(self->FindState(NAME_Null));
}

View file

@ -85,7 +85,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AlienSpectreDeath)
int log;
int i;
CALL_ACTION(A_NoBlocking, self); // [RH] Need this for Sigil rewarding
A_Unblock(self, true); // [RH] Need this for Sigil rewarding
if (!CheckBossDeath (self))
{
return;

View file

@ -2784,7 +2784,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_XScream)
DEFINE_ACTION_FUNCTION(AActor, A_ScreamAndUnblock)
{
CALL_ACTION(A_Scream, self);
CALL_ACTION(A_NoBlocking, self);
A_Unblock(self, true);
}
//===========================================================================
@ -2810,7 +2810,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ActiveSound)
DEFINE_ACTION_FUNCTION(AActor, A_ActiveAndUnblock)
{
CALL_ACTION(A_ActiveSound, self);
CALL_ACTION(A_NoBlocking, self);
A_Unblock(self, true);
}
//---------------------------------------------------------------------------

View file

@ -55,6 +55,7 @@ AInventory *P_DropItem (AActor *source, const PClass *type, int special, int cha
void P_TossItem (AActor *item);
bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params);
void A_Weave(AActor *self, int xyspeed, int zspeed, fixed_t xydist, fixed_t zdist);
void A_Unblock(AActor *self, bool drop);
DECLARE_ACTION(A_Look)
DECLARE_ACTION(A_Wander)

View file

@ -2119,47 +2119,47 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst)
ACTION_PARAM_START(1);
ACTION_PARAM_CLASS(chunk, 0);
int i, numChunks;
AActor * mo;
int i, numChunks;
AActor * mo;
if (chunk == NULL) return;
if (chunk == NULL) return;
self->velx = self->vely = self->velz = 0;
self->height = self->GetDefault()->height;
self->velx = self->vely = self->velz = 0;
self->height = self->GetDefault()->height;
// [RH] In Hexen, this creates a random number of shards (range [24,56])
// with no relation to the size of the self shattering. I think it should
// base the number of shards on the size of the dead thing, so bigger
// things break up into more shards than smaller things.
// An self with radius 20 and height 64 creates ~40 chunks.
numChunks = MAX<int> (4, (self->radius>>FRACBITS)*(self->height>>FRACBITS)/32);
i = (pr_burst.Random2()) % (numChunks/4);
for (i = MAX (24, numChunks + i); i >= 0; i--)
{
mo = Spawn(chunk,
self->x + (((pr_burst()-128)*self->radius)>>7),
self->y + (((pr_burst()-128)*self->radius)>>7),
self->z + (pr_burst()*self->height/255), ALLOW_REPLACE);
// [RH] In Hexen, this creates a random number of shards (range [24,56])
// with no relation to the size of the self shattering. I think it should
// base the number of shards on the size of the dead thing, so bigger
// things break up into more shards than smaller things.
// An self with radius 20 and height 64 creates ~40 chunks.
numChunks = MAX<int> (4, (self->radius>>FRACBITS)*(self->height>>FRACBITS)/32);
i = (pr_burst.Random2()) % (numChunks/4);
for (i = MAX (24, numChunks + i); i >= 0; i--)
{
mo = Spawn(chunk,
self->x + (((pr_burst()-128)*self->radius)>>7),
self->y + (((pr_burst()-128)*self->radius)>>7),
self->z + (pr_burst()*self->height/255), ALLOW_REPLACE);
if (mo)
{
mo->velz = FixedDiv(mo->z - self->z, self->height)<<2;
mo->velx = pr_burst.Random2 () << (FRACBITS-7);
mo->vely = pr_burst.Random2 () << (FRACBITS-7);
mo->RenderStyle = self->RenderStyle;
mo->alpha = self->alpha;
mo->CopyFriendliness(self, true);
}
}
if (mo)
{
mo->velz = FixedDiv(mo->z - self->z, self->height)<<2;
mo->velx = pr_burst.Random2 () << (FRACBITS-7);
mo->vely = pr_burst.Random2 () << (FRACBITS-7);
mo->RenderStyle = self->RenderStyle;
mo->alpha = self->alpha;
mo->CopyFriendliness(self, true);
}
}
// [RH] Do some stuff to make this more useful outside Hexen
if (self->flags4 & MF4_BOSSDEATH)
{
// [RH] Do some stuff to make this more useful outside Hexen
if (self->flags4 & MF4_BOSSDEATH)
{
CALL_ACTION(A_BossDeath, self);
}
CALL_ACTION(A_NoBlocking, self);
}
A_Unblock(self, true);
self->Destroy ();
self->Destroy ();
}
//===========================================================================