mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +00:00
- added MaxEffectTics
field to Powerup
This commit is contained in:
parent
e3f8230035
commit
40cb7f14d0
1 changed files with 4 additions and 3 deletions
|
@ -64,7 +64,7 @@ class PowerupGiver : Inventory
|
|||
|
||||
class Powerup : Inventory
|
||||
{
|
||||
int EffectTics;
|
||||
int EffectTics, MaxEffectTics;
|
||||
color BlendColor;
|
||||
Name Mode; // Meaning depends on powerup - used for Invulnerability and Invisibility
|
||||
double Strength; // Meaning depends on powerup - currently used only by Invisibility
|
||||
|
@ -121,6 +121,7 @@ class Powerup : Inventory
|
|||
if (power.bAdditiveTime)
|
||||
{
|
||||
EffectTics += power.EffectTics;
|
||||
MaxEffectTics = Max(EffectTics, MaxEffectTics);
|
||||
BlendColor = power.BlendColor;
|
||||
}
|
||||
// If it's not blinking yet, you can't replenish the power unless the
|
||||
|
@ -132,7 +133,7 @@ class Powerup : Inventory
|
|||
// Reset the effect duration.
|
||||
else if (power.EffectTics > EffectTics)
|
||||
{
|
||||
EffectTics = power.EffectTics;
|
||||
EffectTics = MaxEffectTics = power.EffectTics;
|
||||
BlendColor = power.BlendColor;
|
||||
}
|
||||
power.bPickupGood = true;
|
||||
|
@ -150,7 +151,7 @@ class Powerup : Inventory
|
|||
override Inventory CreateCopy (Actor other)
|
||||
{
|
||||
// Get the effective effect time.
|
||||
EffectTics = abs (EffectTics);
|
||||
EffectTics = MaxEffectTics = abs (EffectTics);
|
||||
// Abuse the Owner field to tell the
|
||||
// InitEffect method who started it;
|
||||
// this should be cleared afterwards,
|
||||
|
|
Loading…
Reference in a new issue