class GoopEffects : SwitchableDecoration
{
	//args[0] no sound?

	Default
	{
		+CLIENTSIDEONLY;
		+NOBLOCKMAP;
	}
	
	void SQ_GoopBubble()
	{
		A_SpawnItemEx("BossGooBubble", frandom(-48.0, 48.0), frandom(-48.0, 48.0), 0, frandom(-1.0, 1.0), frandom(-1.0, 1.0), frandom(1.0, 3.0), 0, 0, 96);
	}
	
	void SQ_GoopSteam()
	{
		A_SpawnItemEx("Steam", frandom(-7.0,7.0), frandom(-7.0,7.0), 4.0, 0, 0, 2);
	}
	
	States
	{
	Inactive:
		TNT1 A 0;
		TNT1 A 1 A_StopSound(CHAN_5);
		TNT1 A -1;
		Stop;
	Spawn:
	Active:
		TNT1 A 0 A_Jump(256, 1, 2, 3, 4, 5, 6, 7, 8);
		TNT1 AAAAAAAA 4;
		TNT1 A 0 A_JumpIf(args[0] > 0, "ActiveLoop");
		TNT1 A 0 A_PlaySound("ambience/bubbles", CHAN_5 , 0.5, ATTN_NORM);
	ActiveLoop:
		TNT1 A 0 A_Jump(32, "SteamLoop");
		TNT1 A 0 SQ_GoopBubble();
		TNT1 AAAA 2 SQ_GoopSteam();
		TNT1 A 0 SQ_GoopBubble();
		TNT1 AAAA 2 SQ_GoopSteam();
		Goto Active+2;
	SteamLoop:
		TNT1 A 40;
		TNT1 A 0 A_Jump(128, "ActiveLoop");
		Loop;
	}
}

class BossGooBubble : SquareActor
{
	Default
	{
		Translation "192:207=1:3";
		FloatBobPhase 0;

		+FORCEXYBILLBOARD;
		+NOGRAVITY;
		+FLOATBOB;
		+CLIENTSIDEONLY;
	}
	States
	{
	Spawn:
		BLOB A 0;
		BLOB A 0 A_JumpIf(pos.z-floorz>=192, 2);
		BLOB A 15 A_Jump(64, 1);
		Loop;
		BLOB A 0;
		Stop;
	}
}
