mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-26 22:01:13 +00:00
- added IF_NOSCREENBLINK flag, see http://mantis.zdoom.org/view.php?id=9
This commit is contained in:
parent
d9efeb206d
commit
3696d34806
5 changed files with 24 additions and 4 deletions
|
@ -167,7 +167,7 @@ void APowerup::Serialize(FSerializer &arc)
|
|||
|
||||
PalEntry APowerup::GetBlend ()
|
||||
{
|
||||
if (EffectTics <= BLINKTHRESHOLD && !(EffectTics & 8))
|
||||
if (isBlinking())
|
||||
return 0;
|
||||
|
||||
if (IsSpecialColormap(BlendColor)) return 0;
|
||||
|
@ -202,6 +202,22 @@ void APowerup::CallInitEffect()
|
|||
else InitEffect();
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// APowerup :: isBlinking
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
bool APowerup::isBlinking() const
|
||||
{
|
||||
return (EffectTics <= BLINKTHRESHOLD && (EffectTics & 8) && !(ItemFlags & IF_NOSCREENBLINK));
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(APowerup, isBlinking)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(APowerup);
|
||||
ACTION_RETURN_BOOL(self->isBlinking());
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
|
@ -222,7 +238,7 @@ void APowerup::DoEffect ()
|
|||
|
||||
if (Colormap != NOFIXEDCOLORMAP)
|
||||
{
|
||||
if (EffectTics > BLINKTHRESHOLD || (EffectTics & 8))
|
||||
if (!isBlinking())
|
||||
{
|
||||
Owner->player->fixedcolormap = Colormap;
|
||||
}
|
||||
|
@ -294,7 +310,7 @@ bool APowerup::DrawPowerup (int x, int y)
|
|||
{
|
||||
return false;
|
||||
}
|
||||
if (EffectTics > BLINKTHRESHOLD || !(EffectTics & 16))
|
||||
if (!isBlinking())
|
||||
{
|
||||
FTexture *pic = TexMan(Icon);
|
||||
screen->DrawTexture (pic, x, y,
|
||||
|
@ -903,7 +919,7 @@ void APowerLightAmp::DoEffect ()
|
|||
|
||||
if (Owner->player != NULL && Owner->player->fixedcolormap < NUMCOLORMAPS)
|
||||
{
|
||||
if (EffectTics > BLINKTHRESHOLD || (EffectTics & 8))
|
||||
if (!isBlinking())
|
||||
{
|
||||
Owner->player->fixedlightlevel = 1;
|
||||
}
|
||||
|
|
|
@ -30,6 +30,7 @@ public:
|
|||
virtual void InitEffect ();
|
||||
virtual void DoEffect () override;
|
||||
virtual void EndEffect ();
|
||||
bool isBlinking() const;
|
||||
|
||||
protected:
|
||||
void CallInitEffect();
|
||||
|
|
|
@ -46,6 +46,7 @@ enum
|
|||
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.
|
||||
IF_NOSCREENBLINK = 1<<26, // Does not blink the screen overlay when expiring.
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -408,6 +408,7 @@ static FFlagDef InventoryFlagDefs[] =
|
|||
DEFINE_FLAG(IF, ALWAYSRESPAWN, AInventory, ItemFlags),
|
||||
DEFINE_FLAG(IF, TRANSFER, AInventory, ItemFlags),
|
||||
DEFINE_FLAG(IF, NOTELEPORTFREEZE, AInventory, ItemFlags),
|
||||
DEFINE_FLAG(IF, NOSCREENBLINK, AInventory, ItemFlags),
|
||||
|
||||
DEFINE_DUMMY_FLAG(FORCERESPAWNINSURVIVAL, false),
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ class Powerup : Inventory native
|
|||
|
||||
native virtual void InitEffect();
|
||||
native virtual void EndEffect();
|
||||
native bool isBlinking();
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue