Actor Satanic_DarkChaos : Weapon Replaces BFG9000
{
	SpawnID 31
	Height 20
    Weapon.SelectionOrder 7
	Weapon.AmmoType "Satanic_SoulAmmo"
    Inventory.PickupSound "misc/w_pkup"
	Inventory.PickupMessage "the fury of dark chaos magic is now yours to command."
	Scale 0.75
    Tag "Dark Chaos"
	Weapon.BobStyle "Alpha"
	Weapon.BobSpeed 1.5
	//+NO_AUTO_SWITCH
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Satanic_DarkChaos",1,"RemoveAndSpawnMana",AAPTR_PLAYER1)
		TNT1 A 0 A_SpawnItemEx("ChaosWisp",0,0,0,frandom(-1,1),frandom(-1,1),frandom(-1,1),0,SXF_NOCHECKPOSITION)
		DKCH A 1 A_SpawnItemEx("ChaosWisp",0,0,0,frandom(-1,1),frandom(-1,1),frandom(-1,1),0,SXF_NOCHECKPOSITION)
		Loop
	RemoveAndSpawnMana:
		TNT1 A 0 A_SpawnItemEx("Satanic_SoulAmmoNotTheLastOne")
		Stop
	Ready:
		CONE A 1 A_WeaponReady
		Goto Ready
	Deselect:
		TNT1 A 0 A_TakeInventory("WeapWithNoTertChecker",1)
	DeseLoop:	
		CONE A 0 A_Lower
		CONE A 1 A_Lower
		Loop
	Select:
		TNT1 A 0 A_GiveInventory("WeapWithNoTertChecker",1)
		TNT1 A 0 A_JumpIfInventory("PWCIsOff",1,"DefXHair")
		TNT1 A 0 A_SetCrosshair(74)
		Goto SeLoop
	DefXHair:	
		TNT1 A 0 A_SetCrosshair(0)
	SeLoop:	
		CONE A 0 A_Raise
		CONE A 1 A_Raise
		Loop
	Fire:
		CONE B 0 Acs_ExecuteAlways(769,0,150,0,0)
		CONE B 0 A_PlaySound("Satanic/Weapons/BellRing")
		CONE BCE 8
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-15,4)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,22,8)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,20,1)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-13,2)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,12,16)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,18,7)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-21,2)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,14,4)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,26,5)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,11,6)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-11,12)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-15,1)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,20,2)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-22,9)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,18,3)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-25,6)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-25,4)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,32,8)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,30,1)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-23,2)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,32,16)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,28,7)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-31,2)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,24,4)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,36,5)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,21,6)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-21,12)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-25,1)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,30,2)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-22,9)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,28,3)
		CONE E 1 A_FireCustomMissile("Satanic_DarkChaosBatSpawner",0,0,-25,6)
		CONE FG 8
		Goto Ready
	Flash:
		CONE B 8 A_Light2
		CONE B 0 A_Light0
		Stop
	}
}

Actor Satanic_DarkChaos2 : Satanic_DarkChaos
{
	+CHEATNOTWEAPON
}

ACTOR ChaosWisp
{
	RenderStyle "Add"
	Scale 0.75
	Alpha 0.25
	States
	{
	Spawn:
		DKCH A 1 BRIGHT A_FadeOut(0.05,1)
		Loop
	}
}
	


Actor Satanic_DarkChaosBatSpawner
{ 
	Radius 	8 
	Height 	8 
	Speed 	24 
	Damage 	0 
	Scale 		0.7 
	PROJECTILE 
	+RANDOMIZE 
	States 
	{ 
	Spawn: 
		DBAT AABB 2 Bright 
		Goto Death 
	Death: 
		DBAT C 4 Bright A_SpawnItem ("Satanic_DarkChaosBat",1,0,0) 
		Stop 
	} 
} 


Actor Satanic_DarkChaosBat
{
	Health		32
	Radius		8
	Height		8
	Speed		24
	MeleeDamage	2
	Scale 0.7
	MONSTER
	-SOLID 
	-SHOOTABLE 
	+NOGRAVITY 
	+FLOAT 
	+FRIENDLY 
	+LOOKALLAROUND 
	+DROPOFF 
	+NOTELEPORT 
	+NOBLOCKMONST 
	States
	{
	Spawn:
		DBAT ABCDABCDABCDABCDABCD 2 A_Chase
		DBAT D 0 A_PlaySound("Satanic/Weapons/Bats")
		DBAT ABCDABCDABCDABCDABCD 2 A_Chase
		DBAT D 0 A_PlaySound("Satanic/Weapons/Bats")
		DBAT ABCDABCDABCDABCDABCD 2 A_Chase
		DBAT D 0 A_PlaySound("Satanic/Weapons/Bats")
		Goto Death
	Melee:
		DBAT AB 3 A_FaceTarget
		DBAT CD 2 A_MeleeAttack
		Goto Spawn
	Death:
		DBAT E 4
		DBAT F 4 A_XScream
		DBAT GHI 4
		Stop
	}	
}