Like Quake's handling of Powerups in that when the timer is running out, a sound effect (and generally visual a-la Doom) is played to indicate to the player the powerup is timing out.
Doom and it's derivative source ports have a similar effect, albeit only the capability to flash the Powerup.Color or Shadow effect in and out during the last couple of seconds the powerup is active. Theoretically a TimeoutSound should be easy enough to hook it in, and would save a lot of people time (rather than having to worry about integer timer spam in Tick() wasting processing time or ACS trickery) Like other Sound properties it should default to empty and be an optional property.
Powerup.TimeoutSound
Moderator: GZDoom Developers
-
- Posts: 382
- Joined: Mon May 09, 2016 1:38 am
- Location: Anywhere but here
-
- Posts: 4935
- Joined: Sun Nov 14, 2010 12:59 am
- Graphics Processor: ATI/AMD (Modern GZDoom)
Re: Powerup.TimeoutSound
Code: Select all
class Boo : PowerDamage
{
override void DoEffect ()
{
Super.DoEffect();
if (Owner && EffectTics > 0 && EffectTics <= BLINKTHRESHOLD)
{
Owner.A_StartSound("misc/p_pkup", CHAN_5, CHANF_NOSTOP, 1.0, ATTN_NONE);
}
}
}