class BreathSoulburst : Actor
{
	Default
	{
		Renderstyle "Translucent";
		+NOINTERACTION
	}
	
	States
	{
		Spawn:
			"####" "#" 0 NoDelay {
				A_SetTranslation("Curse");
				if(CountInv("PowerTomeEffect",AAPTR_TARGET)) { A_GiveInventory("BreathHealth",2,AAPTR_TARGET); }
				else 										 { A_GiveInventory("BreathHealth",4,AAPTR_TARGET); }
			}
		Looplet:
			"####" "#" 1 {
				A_SetScale(Scale.X*0.97,Scale.Y*1.05);
				A_FadeOut(0.05);
				Return A_JumpIf(Scale.X <= 0.001, "Null");
			}
			Loop;
	}
}

class BreathHealth : GC_ExtendingHealthBonus
{
	Default
	{
		Inventory.Amount 1;
		Inventory.MaxAmount 300;
		Inventory.PickupMessage "Sucked out the soul out of that poor sod.";
	}
	
	States
	{
	Spawn:
		BONB A -1 Bright;
		Stop;
	}
}

class BreathDisintegration : Actor
{
	Default
	{
		+NOINTERACTION
	}
	
	int user_tm;
	int user_c;
	
	States
	{
	Spawn:
		"####" "#" 0 NoDelay {
			if(GetCvar("GC_ToasterMode")) { user_tm = 192; }
			else { user_tm = 64; }
			if(!A_CheckSight("Null")) {
				A_SpawnItemEx("BreathRedLightning",frandom(15.0,-15.0),frandom(15.0,-15.0),frandom(70.0,0.0),
												   frandom(0.5,1.0),frandom(0.5,1.0),random(frandom(0.5,1.0),
												   frandom(-0.5,-1.0)),frandom(360.0,0.0),SXF_CLIENTSIDE,user_tm);
				A_SpawnItemEx("BreathBlackLightning",frandom(15.0,-15.0),frandom(15.0,-15.0),frandom(70.0,0.0),
													 frandom(0.5,1.0),frandom(0.5,1.0),random(frandom(0.5,1.0),
													 frandom(-0.5,-1.0)),frandom(360.0,0.0),SXF_CLIENTSIDE,user_tm);
				A_SpawnItemEx("BreathBlackParticle",frandom(15.0,-15.0),frandom(15.0,-15.0),frandom(50.0,15.0),
													frandom(1.5,6.0),frandom(1.5,6.0),random(frandom(1.5,6.0),
													frandom(-1.5,-6.0)),frandom(360.0,0.0),SXF_CLIENTSIDE,user_tm);
				A_SpawnItemEx("BreathRedParticle",frandom(15.0,-15.0),frandom(15.0,-15.0),frandom(30.0,15.0),
												  frandom(1.5,6.0),frandom(1.5,6.0),random(frandom(1.5,6.0),
												  frandom(-1.5,-6.0)),frandom(360.0,0.0),SXF_CLIENTSIDE,user_tm);
				for(user_c = 0; user_c < 2; user_c++) {
					A_SpawnItemEx("BreathBlackCloud",frandom(15.0,-15.0),frandom(15.0,-15.0),frandom(70.0,0.0),
															frandom(0.5,1.0),frandom(0.5,1.0),random(frandom(0.5,1.0),
															frandom(-0.5,-1.0)),frandom(360.0,0.0),SXF_CLIENTSIDE,user_tm);
					A_SpawnItemEx("BreathRedCloud",frandom(15.0,-15.0),frandom(15.0,-15.0),frandom(70.0,0.0),
															frandom(0.5,1.0),frandom(0.5,1.0),random(frandom(0.5,1.0),
															frandom(-0.5,-1.0)),frandom(360.0,0.0),SXF_CLIENTSIDE,user_tm);
				}
			}
		}
		Stop;
	}
}