- fixed: In Heretic an active Tome of Power should not freeze a teleporting player.
This was implemented by adding a new inventory flag INVENTORY.NOTELEPORTFREEZE so that the effect can both be activated for other items and deactivated for the two that currently have it.
This commit is contained in:
parent
2ed3cec4db
commit
2d58a28cc3
7 changed files with 41 additions and 3 deletions
|
|
@ -72,7 +72,7 @@ bool APowerupGiver::Use (bool pickup)
|
|||
power->Strength = Strength;
|
||||
}
|
||||
|
||||
power->ItemFlags |= ItemFlags & (IF_ALWAYSPICKUP|IF_ADDITIVETIME);
|
||||
power->ItemFlags |= ItemFlags & (IF_ALWAYSPICKUP|IF_ADDITIVETIME|IF_NOTELEPORTFREEZE);
|
||||
if (power->CallTryPickup (Owner))
|
||||
{
|
||||
return true;
|
||||
|
|
@ -342,6 +342,18 @@ void APowerup::OwnerDied ()
|
|||
Destroy ();
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AInventory :: GetNoTeleportFreeze
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
bool APowerup::GetNoTeleportFreeze ()
|
||||
{
|
||||
if (ItemFlags & IF_NOTELEPORTFREEZE) return true;
|
||||
return Super::GetNoTeleportFreeze();
|
||||
}
|
||||
|
||||
// Invulnerability Powerup ---------------------------------------------------
|
||||
|
||||
IMPLEMENT_CLASS (APowerInvulnerable)
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ public:
|
|||
virtual AInventory *CreateTossable ();
|
||||
virtual void Serialize (FArchive &arc);
|
||||
virtual void OwnerDied ();
|
||||
virtual bool GetNoTeleportFreeze();
|
||||
virtual PalEntry GetBlend ();
|
||||
virtual bool DrawPowerup (int x, int y);
|
||||
|
||||
|
|
|
|||
|
|
@ -850,6 +850,25 @@ fixed_t AInventory::GetSpeedFactor ()
|
|||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AInventory :: GetNoTeleportFreeze
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
bool AInventory::GetNoTeleportFreeze ()
|
||||
{
|
||||
// do not check the flag here because it's only active when used on PowerUps, not on PowerupGivers.
|
||||
if (Inventory != NULL)
|
||||
{
|
||||
return Inventory->GetNoTeleportFreeze();
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AInventory :: AlterWeaponSprite
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ enum
|
|||
IF_TOSSED = 1<<22, // Was spawned by P_DropItem (i.e. as a monster drop)
|
||||
IF_ALWAYSRESPAWN = 1<<23, // Always respawn, regardless of dmflag
|
||||
IF_TRANSFER = 1<<24, // All inventory items that the inventory item contains is also transfered to the pickuper
|
||||
IF_NOTELEPORTFREEZE = 1<<25, // does not 'freeze' the player right after teleporting.
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -201,6 +202,7 @@ public:
|
|||
virtual void AbsorbDamage (int damage, FName damageType, int &newdamage);
|
||||
virtual void ModifyDamage (int damage, FName damageType, int &newdamage, bool passive);
|
||||
virtual fixed_t GetSpeedFactor();
|
||||
virtual bool GetNoTeleportFreeze();
|
||||
virtual int AlterWeaponSprite (visstyle_t *vis);
|
||||
|
||||
virtual PalEntry GetBlend ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue