mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-01-18 21:21:36 +00:00
- 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->Strength = Strength;
|
||||||
}
|
}
|
||||||
|
|
||||||
power->ItemFlags |= ItemFlags & (IF_ALWAYSPICKUP|IF_ADDITIVETIME);
|
power->ItemFlags |= ItemFlags & (IF_ALWAYSPICKUP|IF_ADDITIVETIME|IF_NOTELEPORTFREEZE);
|
||||||
if (power->CallTryPickup (Owner))
|
if (power->CallTryPickup (Owner))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -342,6 +342,18 @@ void APowerup::OwnerDied ()
|
||||||
Destroy ();
|
Destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//===========================================================================
|
||||||
|
//
|
||||||
|
// AInventory :: GetNoTeleportFreeze
|
||||||
|
//
|
||||||
|
//===========================================================================
|
||||||
|
|
||||||
|
bool APowerup::GetNoTeleportFreeze ()
|
||||||
|
{
|
||||||
|
if (ItemFlags & IF_NOTELEPORTFREEZE) return true;
|
||||||
|
return Super::GetNoTeleportFreeze();
|
||||||
|
}
|
||||||
|
|
||||||
// Invulnerability Powerup ---------------------------------------------------
|
// Invulnerability Powerup ---------------------------------------------------
|
||||||
|
|
||||||
IMPLEMENT_CLASS (APowerInvulnerable)
|
IMPLEMENT_CLASS (APowerInvulnerable)
|
||||||
|
|
|
@ -18,6 +18,7 @@ public:
|
||||||
virtual AInventory *CreateTossable ();
|
virtual AInventory *CreateTossable ();
|
||||||
virtual void Serialize (FArchive &arc);
|
virtual void Serialize (FArchive &arc);
|
||||||
virtual void OwnerDied ();
|
virtual void OwnerDied ();
|
||||||
|
virtual bool GetNoTeleportFreeze();
|
||||||
virtual PalEntry GetBlend ();
|
virtual PalEntry GetBlend ();
|
||||||
virtual bool DrawPowerup (int x, int y);
|
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
|
// AInventory :: AlterWeaponSprite
|
||||||
|
|
|
@ -137,6 +137,7 @@ enum
|
||||||
IF_TOSSED = 1<<22, // Was spawned by P_DropItem (i.e. as a monster drop)
|
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_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_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 AbsorbDamage (int damage, FName damageType, int &newdamage);
|
||||||
virtual void ModifyDamage (int damage, FName damageType, int &newdamage, bool passive);
|
virtual void ModifyDamage (int damage, FName damageType, int &newdamage, bool passive);
|
||||||
virtual fixed_t GetSpeedFactor();
|
virtual fixed_t GetSpeedFactor();
|
||||||
|
virtual bool GetNoTeleportFreeze();
|
||||||
virtual int AlterWeaponSprite (visstyle_t *vis);
|
virtual int AlterWeaponSprite (visstyle_t *vis);
|
||||||
|
|
||||||
virtual PalEntry GetBlend ();
|
virtual PalEntry GetBlend ();
|
||||||
|
|
|
@ -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)
|
if (thing->player && (useFog || !keepOrientation) && bHaltVelocity)
|
||||||
{
|
{
|
||||||
// Freeze player for about .5 sec
|
// Freeze player for about .5 sec
|
||||||
if (thing->Inventory == NULL || thing->Inventory->GetSpeedFactor() <= FRACUNIT)
|
if (thing->Inventory == NULL || !thing->Inventory->GetNoTeleportFreeze())
|
||||||
thing->reactiontime = 18;
|
thing->reactiontime = 18;
|
||||||
}
|
}
|
||||||
if (thing->flags & MF_MISSILE)
|
if (thing->flags & MF_MISSILE)
|
||||||
|
|
|
@ -331,9 +331,11 @@ static FFlagDef InventoryFlagDefs[] =
|
||||||
DEFINE_FLAG(IF, TOSSED, AInventory, ItemFlags),
|
DEFINE_FLAG(IF, TOSSED, AInventory, ItemFlags),
|
||||||
DEFINE_FLAG(IF, ALWAYSRESPAWN, AInventory, ItemFlags),
|
DEFINE_FLAG(IF, ALWAYSRESPAWN, AInventory, ItemFlags),
|
||||||
DEFINE_FLAG(IF, TRANSFER, AInventory, ItemFlags),
|
DEFINE_FLAG(IF, TRANSFER, AInventory, ItemFlags),
|
||||||
|
DEFINE_FLAG(IF, NOTELEPORTFREEZE, AInventory, ItemFlags),
|
||||||
|
|
||||||
DEFINE_DEPRECATED_FLAG(PICKUPFLASH),
|
DEFINE_DEPRECATED_FLAG(PICKUPFLASH),
|
||||||
DEFINE_DEPRECATED_FLAG(INTERHUBSTRIP),};
|
DEFINE_DEPRECATED_FLAG(INTERHUBSTRIP),
|
||||||
|
};
|
||||||
|
|
||||||
static FFlagDef WeaponFlagDefs[] =
|
static FFlagDef WeaponFlagDefs[] =
|
||||||
{
|
{
|
||||||
|
|
|
@ -225,6 +225,7 @@ ACTOR PowerWeaponLevel2 : Powerup native
|
||||||
{
|
{
|
||||||
Powerup.Duration -40
|
Powerup.Duration -40
|
||||||
Inventory.Icon "SPINBK0"
|
Inventory.Icon "SPINBK0"
|
||||||
|
+INVENTORY.NOTELEPORTFREEZE
|
||||||
}
|
}
|
||||||
|
|
||||||
ACTOR PowerSpeed : Powerup native
|
ACTOR PowerSpeed : Powerup native
|
||||||
|
@ -232,6 +233,7 @@ ACTOR PowerSpeed : Powerup native
|
||||||
Powerup.Duration -45
|
Powerup.Duration -45
|
||||||
Speed 1.5
|
Speed 1.5
|
||||||
Inventory.Icon "SPBOOT0"
|
Inventory.Icon "SPBOOT0"
|
||||||
|
+INVENTORY.NOTELEPORTFREEZE
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player Speed Trail (used by the Speed Powerup) ----------------------------
|
// Player Speed Trail (used by the Speed Powerup) ----------------------------
|
||||||
|
|
Loading…
Reference in a new issue