class OvoltExplosion : SquareActor
{
	Default
	{
		+NOGRAVITY;
		+NOBLOCKMAP;
		+NOCLIP;
		+RANDOMIZE;
		Scale 1.0;
		DamageType "OvoltExp";
		Obituary "$OB_OVOLTEXPLOSION";
	}
	States
	{
	Spawn:
		ZAPX A 3;
		ZAPX B 3 Bright A_PlaySound("world/electric/explosion", CHAN_AUTO);
		ZAPX C 4 Bright A_Explode(30,64);
		ZAPX DEF 4 Bright;
		TNT1 A 18; // Prevent sound cutoff
		Stop;
	}
}

class RevoltExplosion : OvoltExplosion
{
	Default
	{
		Translation "98:102=178:182";
		Scale 1.5;
	}
	States
	{
	Spawn:
		ZAPX A 3;
		ZAPX B 3 Bright A_PlaySound("world/electric/explosion", CHAN_AUTO);
		ZAPX C 4 Bright A_Explode(60,96);
		ZAPX DEF 4 Bright;
		TNT1 A 18; // Prevent sound cutoff
		Stop;
	}
}

class CommonOvolt : SquareMonster
{
	Default
	{
		Health 70;
		Speed 6;
		Radius 21;
		Height 42;
		FastSpeed 10;
		BloodColor "ff d9 30";
		Obituary "$OB_OVOLT";
		HitObituary "$OB_OVOLTHIT";

		SeeSound "ovolt/sight";
		ActiveSound "ovolt/active";
		PainSound "ovolt/pain";
		DeathSound "ovolt/death";

		DamageFactor "OvoltExp" ,0;
		DamageFactor "Vacuum", 0.0;

		+FLOATBOB;
	}
	States
	{
	Spawn:
		#### A 7 A_Look();
		Loop;
	See:
		#### AA 1 A_SpawnItemEx("OvoltHover", 0, 0, 0, 0, 0, -4.0);
		#### A 0 A_Chase();
		Loop;
	Missile:
		#### ADEF 4 A_FaceTarget();
		#### G 4 Bright A_CustomComboAttack("OvoltBall", 32, 3 * random(1, 8), "ovolt/melee");
		Goto See;
	Pain:
		#### H 3;
		#### H 3 A_Pain();
		Goto See;
	Death:
		#### H 1 Bright;
		#### H 2 Bright A_Scream();
		#### H 0 Bright A_SpawnItem("CrystalGibSpawner");
		#### H 0 Bright A_SpawnItem("GibSpawnerOvolt");
		#### H 0 Bright A_SpawnItem("OvoltExplosion", 0, 24);
		#### HH 0 A_SpawnItemEx("GibAntenna", random[SquareGibRandom](-32,32), random[SquareGibRandom](-4,4), random[SquareGibRandom](4,12), random[SquareGibRandom](-4,4), random[SquareGibRandom](-4,4), random[SquareGibRandom](0,8), 0, 1);
		TNT1 A 18;
		Stop;
	}
}

class Ovolt : CommonOvolt
{
	States
	{
	Spawn:
		OVLT A 0;
		Goto Super::Spawn;
	See:
		#### AA 1 A_SpawnItemEx("OvoltHover", 0, 0, 10, 0, 0, -4.0);
		#### A 0 A_Chase();
		Loop;
	}
}

class Airvolt : CommonOvolt
{
	Default
	{
		Height 38;
		BloodColor "00 ff ff";
		Obituary "$OB_AIRVOLT";
		HitObituary "$OB_AIRVOLTHIT";
		Speed 10;
		FastSpeed 14;
		+NOGRAVITY;
		+FLOAT;
	}
	States
	{
	Spawn:
		AVLT A 0;
		Goto Super::Spawn;
	Death:
		#### H 1 Bright;
		#### H 2 Bright A_Scream();
		#### H 0 Bright A_SpawnItem("CrystalGibSpawner");
		#### H 0 Bright A_SpawnItem("GibSpawnerAirvolt");
		#### H 0 Bright A_SpawnItem("OvoltExplosion", 0, 24);
		#### HH 0 A_SpawnItemEx("GibAntenna", random[SquareGibRandom](-32,32), random[SquareGibRandom](-4,4), random[SquareGibRandom](4,12), random[SquareGibRandom](-4,4), random[SquareGibRandom](-4,4), random[SquareGibRandom](0,8), 0, 1);
		TNT1 A 18;
		Stop;
	}
}

class Revolt : CommonOvolt
{
	Default
	{
		Health 100;
		Speed 8;
		FastSpeed 14;
		BloodColor "ff 00 00";
		Obituary "$OB_REVOLT";
		HitObituary "$OB_REVOLTHIT";
		+NOGRAVITY;
		+FLOAT;
	}
	States
	{
	Spawn:
		RVLT A 0;
		Goto Super::Spawn;
	See:
		#### AA 1 A_SpawnItemEx("OvoltHover", 0, 0, 0, 0, 0, -4.0);
		#### A 0 A_Chase();
		#### BB 1 A_SpawnItemEx("OvoltHover", 0, 0, 0, 0, 0, -4.0);
		#### B 0 A_Chase();
		#### CC 1 A_SpawnItemEx("OvoltHover", 0, 0, 0, 0, 0, -4.0);
		#### C 0 A_Chase();
		Loop;
	Missile:
		#### ADEF 4 A_FaceTarget();
		#### G 4 Bright A_CustomComboAttack("RevoltBall", 32, 3 * random(1, 8), "ovolt/melee");
		#### F 4 Bright A_FaceTarget();
		#### G 4 Bright A_CustomComboAttack("RevoltBall", 32, 3 * random(1, 8), "ovolt/melee");
		Goto See;
	Death:
		#### H 1 Bright;
		#### H 2 Bright A_Scream();
		#### H 0 Bright A_SpawnItem("CrystalGibSpawner");
		#### H 0 Bright A_SpawnItem("GibSpawnerRevolt");
		#### H 0 Bright A_SpawnItem("RevoltExplosion", 0, 24);
		#### HH 0 A_SpawnItemEx("GibAntenna", random[SquareGibRandom](-32,32), random[SquareGibRandom](-4,4), random[SquareGibRandom](4,12), random[SquareGibRandom](-4,4), random[SquareGibRandom](-4,4), random[SquareGibRandom](0,8), 0, 1);
		TNT1 A 18;
		Stop;
	}
}

class OvoltHover : SquareActor
{
	Default
	{
		+NOGRAVITY;
		+NOBLOCKMAP;
		+NOCLIP;
		+DONTSPLASH;
		RenderStyle 'Add';
		Speed 4;
	}
	States
	{
	Spawn:
		OVHV ABCD 1 Bright;
		Stop;
	}
}
