class Smoke : SquareActor
{
	Default
	{
		Projectile;
		-SOLID;
		+DONTBLAST;
		+RANDOMIZE;
		+CLIENTSIDEONLY;
		Radius 4;
		Height 4;
		RenderStyle 'Translucent';
		Alpha 0.8;
		Scale 0.15; // Grows
	}
	States
	{
	Spawn:
		SMOK A 0;
		"####" AAAA 1 A_SetScale(scale.x * 1.6);
	SpawnRest:
		"####" A 40;
	Death:
		"####" AAAAA 2 A_SetScale(scale.x * 0.9);
	DeathLoop:
		"####" A 0 A_SetScale(scale.x * 0.9);
		"####" A 2 A_FadeOut(0.05);
		Goto DeathLoop;
	}
}

class LightSmoke1 : Smoke
{
	Default
	{
		Translation "0:0=17:17";
	}
}

class LightSmoke2 : Smoke
{
	Default
	{
		Translation "0:0=24:24";
	}
}

class LightSmokeRandom : RandomSpawner
{
	Default
	{
		DropItem 'LightSmoke1';
		DropItem 'LightSmoke2';
	}
}

class Steam : Smoke
{
	Default
	{
		Translation "0:0=16:16";
		Alpha 0.4;
	}
}

class GooVapor : Steam
{
	Default
	{
		Scale 0.05;
		RenderStyle 'Add';
		Translation "0:0=113:113";
	}
}

class GooVaporRed : GooVapor { Default { Translation "0:0=194:194"; } }


/**
 * These do not damage anything.
 */
class Explosion : SquareActor
{
	Default
	{
		+NOGRAVITY
		+NOBLOCKMAP
		+NOCLIP;
		DeathSound "world/explosion";
		RenderStyle 'Add';
	}
	States
	{
	Spawn:
		MISL A 0;
		MISL A 0 A_Scream();
		MISL BCDEF 4 Bright A_SpawnItemEx("LightSmokeRandom", random[SquareEffectRandom](-20,20), random[SquareEffectRandom](-20,20), 0, 0, 0, random[SquareEffectRandom](1, 4) * 0.5, 0, 0, 96);
		Stop;
	}
}

class ExplosionSilent : Explosion
{
	Default
	{
		DeathSound "";
	}
}

class ExplosionLoud : Explosion
{
	Default
	{
		DeathSound "world/bigexplosion"; // explosion with large rolloff.
	}
}

class ExplosionSmall : Explosion { default { Scale 0.425; } }

class ExplosionAlt : Explosion
{
	Default
	{
		DeathSound "effects/explosion/lite";
	}
}

class ExplosionChain : SquareActor
{
	Default
	{
		+NOGRAVITY;
		+NOBLOCKMAP;
		+NOCLIP;
		+FULLVOLDEATH;
		DeathSound "world/explosion";
		RenderStyle 'Add';
	}
	States
	{
	Spawn:
		MISL A 0;
		MISL A 0 A_Scream();
		MISL BCDEF 4 Bright A_SpawnItemEx("ExplosionLoud", random[SquareExplosionRandom](-60,60),	random[SquareExplosionRandom](-60,60),	random[SquareExplosionRandom](-15,15), 0, 0, 0, 0, SXF_TRANSFERPOINTERS);
		Stop;
	}
}

class ExplosionGreen : ExplosionSilent
{
	Default
	{
		Translation "144:159=112:127";
	}
}

class ExplosionFizzo : SquareActor
{
	Default
	{
		+NOGRAVITY;
		+NOBLOCKMAP;
		+NOCLIP;
		Translation "144:159=112:127";
		RenderStyle 'Add';
	}
	
}

class JetpackEffect : SquareActor // [XA] huh, we really need to remove this. :P
{
	Default
	{
		Height 0;
		+NOBLOCKMAP;
		+NOGRAVITY;
		+INVISIBLE;
	}
	States
	{
	Spawn:
	Active:
		JETJ A 1;
		JETJ A 1 A_SpawnItemEx("JetpackFlameEffect", 0, 0, 0, frandom[SquareEffectRandom](0.0, 0.1), frandom[SquareEffectRandom](0.0, 0.1), -2.0, 0, SXF_NOCHECKPOSITION);
		Goto Active+1;
	Inactive:
		JETJ A 1;
		Wait;
	}
}

class JetpackFlame : SquareActor
{
	Default
	{
		Projectile;
		+DONTBLAST;
		+DONTSPLASH;
		+FORCEXYBILLBOARD;
		DamageFunction (1);
		DamageType 'Enemy';
		RenderStyle 'Add';
		Scale 0.75;
	}
	States
	{
	Spawn:
		SAUB A 1 A_FadeOut(0.1);
		Loop;
	}
}

class JetpackFlameEffect : JetpackFlame
{
	Default
	{
		PROJECTILE;
		+DONTBLAST;
		+THRUACTORS;
		Damage 0;
		RenderStyle 'Add';
		Scale 0.75;
		Radius 2;
		Height 2;
	}
	States
	{
	Spawn:
		SAUB A 1 A_FadeOut(0.1);
		Loop;
	}
}

class RocketFlameEffect : JetpackFlame
{
	Default
	{
		Projectile;
		+DONTBLAST;
		+THRUACTORS;
		Damage 0;
		RenderStyle 'Translucent';
		Alpha 1.0;
		Scale 0.75;
		Radius 2;
		Height 2;
	}
	States
	{
	Spawn:
		RKFX ABAB 3 Bright;
		RKFX CDCD 3 Bright;
		RKFX EFEF 3 Bright;
		RKFX GHGH 3 Bright A_FadeOut(0.01);
		RKFX IJIJ 3 Bright A_FadeOut(0.01);
		RKFX KLKL 3 Bright A_FadeOut(0.01);
	Smokin:
		RKFX MNMN 3 Bright A_FadeOut(0.01);
		Loop;
	}
}

class SteamSpawner : SwitchableDecoration
{
	//args[0] chance to NOT spawn a steam thingy

	Default
	{
		+NOBLOCKMAP;
	}
	States
	{
	Spawn:
	Active:
		TNT1 A 2 A_SpawnItemEx("Steam", frandom[SquareEffectRandom](-7.0,7.0), frandom[SquareEffectRandom](-7.0,7.0), 4.0, 0, 0, 2, 0, 0, args[0]);
		Loop;
	Inactive:
		TNT1 A 1;
		Loop;
	}
}

class SmokeSpawner : SwitchableDecoration
{
	//args[0] chance to NOT spawn a steam thingy

	Default
	{
		+NOBLOCKMAP;
	}
	States
	{
	Spawn:
	Active:
		TNT1 A 2 A_SpawnItemEx("Smoke", frandom[SquareEffectRandom](-7.0,7.0), frandom[SquareEffectRandom](-7.0,7.0), 4.0, 0, 0, 2, 0, 0, args[0]);
		Loop;
	Inactive:
		TNT1 A 1;
		Loop;
	}
}

class SteamSpawnerNoGravity : SteamSpawner
{
	//args[0] chance to NOT spawn a steam thingy

	Default
	{
		+NOGRAVITY;
	}
}

class SmokeSpawnerNoGravity : SmokeSpawner
{
	//args[0] chance to NOT spawn a steam thingy

	Default
	{
		+NOGRAVITY;
	}
}

class FancyPantsExplosion : SquareActor // [XA] e2a9's wall-explosion effect
{
	Default
	{
		+NOGRAVITY;
		+NOBLOCKMAP;
		+THRUACTORS;
	}
	States
	{
	Spawn:
		TNT1 A 0;
		TNT1 A 4 Bright A_SpawnItemEx("ExplosionChain", random[SquareFancyPantsExplosionRandom](-256,256), 0, random[SquareFancyPantsExplosionRandom](-64,64), 0, 0, 0, 0, SXF_TRANSFERPOINTERS);
		Loop;
	HarderBetterFasterStronger:
		TNT1 A 2 Bright A_SpawnItemEx("ExplosionChain", random[SquareFancyPantsExplosionRandom](-256,256), 0, random[SquareFancyPantsExplosionRandom](-64,64), 0, 0, 0, 0, SXF_TRANSFERPOINTERS);
		Wait;
	CrankItUpToEleven:
		TNT1 AAAAAA 2 Bright A_SpawnItemEx("ExplosionChain", random[SquareFancyPantsExplosionRandom](-192,192), 0, random[SquareFancyPantsExplosionRandom](-64,64), 0, 0, 0, 0, SXF_TRANSFERPOINTERS);
		TNT1 AAAAAA 2 Bright A_SpawnItemEx("ExplosionChain", random[SquareFancyPantsExplosionRandom](-128,128), 0, random[SquareFancyPantsExplosionRandom](-64,64), 0, 0, 0, 0, SXF_TRANSFERPOINTERS);
		TNT1 A      2 Bright A_SpawnItemEx("ExplosionChain", random[SquareFancyPantsExplosionRandom](- 96, 96), 0, random[SquareFancyPantsExplosionRandom](-64,64), 0, 0, 0, 0, SXF_TRANSFERPOINTERS);
		Wait;
	Death:
		TNT1 A 0;
		Stop;
	}
}
