- scriptified the weapon piece functions.

- fixed: ClearInventory did not process depleted items properly.
- changed HexenArmor from UNDROPPABLE to UNTOSSABLE because this allowed to remove some special handling in ClearInventory. The only other place which checks this flag also checks UNTOSSABLE.
This commit is contained in:
Christoph Oelckers 2017-01-18 17:26:12 +01:00
commit 30a8541a15
12 changed files with 290 additions and 313 deletions

View file

@ -79,71 +79,6 @@ void PClassInventory::Finalize(FStateDefinitions &statedef)
((AActor*)Defaults)->flags |= MF_SPECIAL;
}
//---------------------------------------------------------------------------
//
// PROC A_RestoreSpecialThing1
//
// Make a special thing visible again.
//
//---------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AInventory, A_RestoreSpecialThing1)
{
PARAM_SELF_PROLOGUE(AInventory);
self->renderflags &= ~RF_INVISIBLE;
if (self->DoRespawn ())
{
S_Sound (self, CHAN_VOICE, "misc/spawn", 1, ATTN_IDLE);
}
return 0;
}
//---------------------------------------------------------------------------
//
// PROC A_RestoreSpecialThing2
//
//---------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AInventory, A_RestoreSpecialThing2)
{
PARAM_SELF_PROLOGUE(AInventory);
self->flags |= MF_SPECIAL;
if (!(self->GetDefault()->flags & MF_NOGRAVITY))
{
self->flags &= ~MF_NOGRAVITY;
}
self->SetState (self->SpawnState);
return 0;
}
//---------------------------------------------------------------------------
//
// PROC A_RestoreSpecialDoomThing
//
//---------------------------------------------------------------------------
DEFINE_ACTION_FUNCTION(AInventory, A_RestoreSpecialDoomThing)
{
PARAM_SELF_PROLOGUE(AInventory);
self->renderflags &= ~RF_INVISIBLE;
self->flags |= MF_SPECIAL;
if (!(self->GetDefault()->flags & MF_NOGRAVITY))
{
self->flags &= ~MF_NOGRAVITY;
}
if (self->DoRespawn ())
{
self->SetState (self->SpawnState);
S_Sound (self, CHAN_VOICE, "misc/spawn", 1, ATTN_IDLE);
Spawn ("ItemFog", self->Pos(), ALLOW_REPLACE);
}
return 0;
}
int AInventory::StaticLastMessageTic;
FString AInventory::StaticLastMessage;
@ -907,7 +842,7 @@ void AInventory::Touch (AActor *toucher)
// real player to make noise.
if (player != NULL)
{
PlayPickupSound (player->mo);
CallPlayPickupSound (player->mo);
if (!(ItemFlags & IF_NOSCREENFLASH))
{
player->bonuscount = BONUSADD;
@ -915,7 +850,7 @@ void AInventory::Touch (AActor *toucher)
}
else
{
PlayPickupSound (toucher);
CallPlayPickupSound (toucher);
}
}
@ -1272,6 +1207,11 @@ bool AInventory::DoRespawn ()
return true;
}
DEFINE_ACTION_FUNCTION(AInventory, DoRespawn)
{
PARAM_SELF_PROLOGUE(AInventory);
ACTION_RETURN_BOOL(self->DoRespawn());
}
//===========================================================================
//