IsFrozen

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.


Actor

bool IsFrozen()

Usage

Checks if the actor is frozen. This doesn't account for the FROZEN flags but instead checks to see if the level is frozen. This will return false if the Actor has the NOTIMEFREEZE flag set or is a player. Players will only be frozen if they're not on the same team as the activator of a time freeze powerup.

Return value

Returns true if the Actor is currently frozen.

Examples

This version of the Imp's fireball will spawn a trail every tic. The trail will fade out and become smaller while it exists, before disappearing.

class FireBallWithTrail : DoomImpBall
{
	override void Tick()
	{
		super.Tick();
		if (!IsFrozen())
		{
			Spawn("FireBallTrail", pos);
		}
	}
}

class FireBallTrail : Actor
{
	Default
	{
		+BRIGHT
		+NOINTERACTION
		+NOBLOCKMAP
		Renderstyle 'Add';
	}

	States 
	{
	Spawn:
		BAL1 A 1 
		{
			A_FadeOut(0.05);
			scale *= 0.95;
		}
		loop;
	}
}