//This goes into frenzy_main.wad, replacing DBATTERY lump
actor CoreShock
{
	radius 2
	height 4
	scale 0.25
	VSpeed 0
	+LOWGRAVITY
	states
	{
		Spawn:
			CSHK ABC 3 bright
			Stop
	}
}

ACTOR Battery 30001
{
	obituary "%o was killed by a battery... lol!?"
	health 750
	radius 16
	height 56
	speed 0
	painchance 200
        bloodtype "CoreShock"
	MONSTER
	+FRIENDLY
	+FLOORCLIP
	+NOBLOODDECALS
	
	// protect from marine damage
	damagefactor "MarineFire", 0.0
	damageFactor "MarineFire2", 0.0
	DamageFactor "MarineFire3", 0.0
	
	states
	{
		Spawn:
			CORE ABC 2 bright A_Look
			goto Spawn
		See:
			CORE ABC 2 bright A_Chase
			goto See
		Pain:
			CORE A 1 bright A_Pain
			CORE A 1 bright ACS_Execute(122, 0, 0, 0, 0)
			goto See

		Death:
			CORE B 1 bright A_Scream
			CORE B 0 bright A_PlaySound("cv/batteryd")
			CORE C 1 bright A_NoBlocking
			//MISL BCD 5 bright
			NULL A 0 A_SpawnItem("BatteryExplosion",0,32)
			NULL A 35 bright //20 original
			NULL A 1 bright ACS_Execute(102, 0, 0, 0, 0)
			NULL A -1
			stop
		Raise:
			CORE CBA 5 bright
			goto See
	}
}

ACTOR AttackBattery : MorphedMonster 30002
{
	obituary "%o was killed by the core!"
	health 750
	radius 16
	height 56
	speed 0
	painchance 200
        bloodtype "CoreShock"
	MONSTER
	+FRIENDLY
	+FLOORCLIP
	+NOBLOODDECALS
	
	damagefactor "MarineFire", 0.0
	damageFactor "MarineFire2", 0.0
	DamageFactor "MarineFire3", 0.0
	
	states
	{
		Spawn:
			CORE ABC 1 bright A_Look
			goto Spawn
		See:
			CORE ABC 1 bright A_Chase
			goto See
		Pain:
			CORE A 1 bright A_Pain
			CORE A 1 bright ACS_Execute(122, 0, 0, 0, 0)
			goto See
		Missile:
			CORE A 2 bright A_FaceTarget
			CORE B 2 bright A_CustomMissile("BoomerShot", 32)
			CORE C 2 bright
			CORE A 1 bright A_SpidRefire
			goto Missile+1

		Death:
			CORE B 1 bright A_Scream
			CORE B 0 bright A_PlaySound("cv/batteryd")
			CORE C 1 bright A_NoBlocking
			//MISL BCD 5 bright
			NULL A 0 A_SpawnItem("BatteryExplosion",0,32)
			NULL A 35 bright
			NULL A 1 bright ACS_Execute(125, 0, 4, 0, 0)
			NULL A -1
			stop
		Raise:
			CORE CBA 5
			goto See
	}
}

ACTOR BatteryCore 30003
{
	obituary "%o was killed by our Core... lol!?"
	health 1500
	radius 16
	height 56
	speed 0
	painchance 200
        bloodtype "CoreShock"
	MONSTER
	+FRIENDLY
	+FLOORCLIP
	+NOBLOODDECALS
	
	damagefactor "MarineFire", 0.0
	damageFactor "MarineFire2", 0.0
	DamageFactor "MarineFire3", 0.0
	
	states
	{
		Spawn:
			CORE ABC 2 bright A_Look
			goto Spawn
		See:
			CORE ABC 2 bright A_Chase
			goto See
		Pain:
			CORE A 1 bright A_Pain
			CORE A 1 bright ACS_Execute(122, 0, 0, 0, 0)
			goto See

		Death:
			CORE B 1 bright A_Scream
			CORE B 0 bright A_PlaySound("cv/batteryd")
			CORE C 1 bright A_NoBlocking
			//MISL BCD 5 bright
			NULL A 0 A_SpawnItem("CoreExplosion",0,32)
			NULL A 0 Radius_Quake(50.0,50.0,0,50.0,0)
			NULL A 35 bright
			NULL A 1 bright ACS_Execute(125, 0, 4, 0, 0)
			NULL A -1
			stop
		Raise:
			CORE CBA 5 bright
			goto See
	}
}


///explosion - move to right place

ACTOR BatteryExplosion
{
	+NOGRAVITY
        +CLIENTSIDEONLY
	states
	{
		Spawn:
			MISL A 0
			MISL A 0 A_PlaySound("weapons/rocklx")
			MISL BCD 5 bright
			stop	
	}
}

ACTOR CoreExplosion
{
	+NOGRAVITY
        //+CLIENTSIDEONLY
	states
	{
		Spawn:
			MISL BBBBBB 0 A_SpawnItemEx("BatteryExplosion",random(-64,64),random(-64,64),random(0,64))
			MISL B 5 bright A_SpawnItemEx("BatteryExplosion",random(-64,64),random(-64,64),random(0,64))
			MISL BBBBBB 0 A_SpawnItemEx("BatteryExplosion",random(-64,64),random(-64,64),random(0,64))
			MISL C 5 bright A_SpawnItemEx("BatteryExplosion",random(-64,64),random(-64,64),random(0,64))
			MISL BBBBBB 0 A_SpawnItemEx("BatteryExplosion",random(-64,64),random(-64,64),random(0,64))
			MISL D 5 bright A_SpawnItemEx("BatteryExplosion",random(-64,64),random(-64,64),random(0,64))
			MISL BBBBBB 0 A_SpawnItemEx("BatteryExplosion",random(-64,64),random(-64,64),random(0,64))
			stop	
	}
}

