- 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:
Christoph Oelckers 2015-08-16 08:50:22 +02:00
parent 2ed3cec4db
commit 2d58a28cc3
7 changed files with 41 additions and 3 deletions

View File

@ -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)

View File

@ -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);

View File

@ -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

View File

@ -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 ();

View File

@ -211,7 +211,7 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
if (thing->player && (useFog || !keepOrientation) && bHaltVelocity)
{
// Freeze player for about .5 sec
if (thing->Inventory == NULL || thing->Inventory->GetSpeedFactor() <= FRACUNIT)
if (thing->Inventory == NULL || !thing->Inventory->GetNoTeleportFreeze())
thing->reactiontime = 18;
}
if (thing->flags & MF_MISSILE)

View File

@ -331,9 +331,11 @@ static FFlagDef InventoryFlagDefs[] =
DEFINE_FLAG(IF, TOSSED, AInventory, ItemFlags),
DEFINE_FLAG(IF, ALWAYSRESPAWN, AInventory, ItemFlags),
DEFINE_FLAG(IF, TRANSFER, AInventory, ItemFlags),
DEFINE_FLAG(IF, NOTELEPORTFREEZE, AInventory, ItemFlags),
DEFINE_DEPRECATED_FLAG(PICKUPFLASH),
DEFINE_DEPRECATED_FLAG(INTERHUBSTRIP),};
DEFINE_DEPRECATED_FLAG(INTERHUBSTRIP),
};
static FFlagDef WeaponFlagDefs[] =
{

View File

@ -225,6 +225,7 @@ ACTOR PowerWeaponLevel2 : Powerup native
{
Powerup.Duration -40
Inventory.Icon "SPINBK0"
+INVENTORY.NOTELEPORTFREEZE
}
ACTOR PowerSpeed : Powerup native
@ -232,6 +233,7 @@ ACTOR PowerSpeed : Powerup native
Powerup.Duration -45
Speed 1.5
Inventory.Icon "SPBOOT0"
+INVENTORY.NOTELEPORTFREEZE
}
// Player Speed Trail (used by the Speed Powerup) ----------------------------