Actor KyleAutoGun : Weapon 30002
{
     Weapon.AmmoType1 "PowerCells"
	 Weapon.AmmoType2 "PowerCells"
	 Weapon.AmmoUse1 1
	 Weapon.AmmoUse2 1
	 Weapon.AmmoGive1 30
	 Inventory.PickupMessage "Auto Gun"
     Inventory.PickupSound "ItemPickup"
     Weapon.BobStyle InverseSmooth
	 Weapon.BobSpeed 0.9 
	 +AMMO_OPTIONAL
	 +ALT_AMMO_OPTIONAL
	 States
	 {
	 Ready:
	    DF04 A 1 A_WeaponReady
		Loop
	//-------Spesial Select and Deselect animations, using offset------//	
	 Select:
	    NULL A 0 A_PlaySound("WeaponSelect")
		DF04 A 1 offset(27, 68)
		DF04 A 1 offset(21, 60)
		DF04 A 1 offset(15, 52)
		DF04 A 1 offset(9, 44)
		DF04 A 1 offset(3, 36)	
		DF04 AAAAAAAAAAAAAAAAAAAA 0 A_Raise
	    DF04 A 1 A_Raise
	    Goto Select+5
	 Deselect:
	    NULL A 0 A_StopSound(5)
		NULL A 0 A_ClearReFire
	    DF04 A 1 offset(3, 36)
		DF04 A 1 offset(9, 44)
		DF04 A 1 offset(15, 52)
		DF04 A 1 offset(21, 60)
		DF04 A 1 offset(27, 68)
		TNT1 A 0 A_TakeInventory("UseAmmo", 999)
		DF04 AAAAAAAAAAAAAAAAAAA 0 A_Lower
	    DF04 A 1 A_Lower
		Goto Deselect+8
	//-------------------------------------------------------------------//	
	//----------------Fire----------------------------------------//	
	 Fire:
	    NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
	    DF04 B 2 Bright  
		DF04 C 1 Bright A_FireCustomMissile("AutoGun", 0, 1, 6, 3)
		NULL A 0 A_ReFire
		NULL A 0 A_PlaySound("AutoGunOne")
		DF04 C 3 Bright
		Goto Ready
	//------------------------------------------------------------//
	//-----------------------Hold---------------------------------//
	 Hold:
	    NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
		TNT1 A 0 A_JumpIfInventory("PowerWeaponsSuper", 1, "FastHold")
	    NULL A 0 A_PlaySound("AutoGunLoop", 5, 1.0, 1)
		DF04 C 5 Bright
		DF04 B 1 Bright
		DF04 C 1 Bright A_FireCustomMissile("AutoGun", 0, 1, 6, 3)
		NULL A 0 A_ReFire
		NULL A 0 A_StopSound(5)
		NULL A 0 A_ClearReFire
	    Goto Ready
	//--------------------------------------------------------------//
	    
		//Special Code For Weapon Supercharge
		FastHold:
		TNT1 A 0 A_JumpIfInventory("UseAmmo", 1, "FastHoldUseAmmo")
	    NULL A 0 A_PlaySound("AutoGunLoop", 5, 1.0, 1)
		DF04 C 1 Bright
		DF04 B 1 Bright
		DF04 C 1 Bright A_FireCustomMissile("AutoGun", 0, 0, 6, 3)
		NULL A 0 A_ReFire
		TNT1 A 0 A_GiveInventory("UseAmmo", 1)
		NULL A 0 A_StopSound(5)
		NULL A 0 A_ClearReFire
	    Goto Ready
		FastHoldUseAmmo:
		NULL A 0 A_PlaySound("AutoGunLoop", 5, 1.0, 1)
		DF04 C 1 Bright
		DF04 B 1 Bright
		DF04 C 1 Bright A_FireCustomMissile("AutoGun", 0, 1, 6, 3)
		NULL A 0 A_ReFire
		TNT1 A 0 A_TakeInventory("UseAmmo", 1)
		NULL A 0 A_StopSound(5)
		NULL A 0 A_ClearReFire
	    Goto Ready
		/////////////////////////////////////
	
	
	//--------------Out Of Ammo------------//
	OutOfAmmo:
	    NULL A 0 A_StopSound(5)
	    DF04 A 2 A_WeaponReady
		NULL A 0 A_PlaySound("AutoGunOut")
		Goto Ready
	//-------------------------------------//	
	//----------Alt-Fire----------------------------------//	
	 AltFire:
	    NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
		TNT1 A 0 A_JumpIfInventory("PowerWeaponsSuper", 1, "AltFireFast")
		NULL A 0 A_JumpIfInventory("PowerCells", 3, 3) //Go Here---
		NULL A 0 A_JumpIfInventory("PowerCells", 2, "Fire")//or   |
		NULL A 0 A_JumpIfInventory("PowerCells", 1, "Fire")//fire |
	    NULL A 0 A_PlaySound("AutoGunOne")//-----------------------
	    NULL A 0 A_FireCustomMissile("AutoGun", 0, 1, 6, 3, 0)
		NULL A 0 A_FireCustomMissile("AutoGun", -4, 1, 4, 6, 0,-4)
		NULL A 0 A_FireCustomMissile("AutoGun", 4, 1, 8, 6, 0,-4)
		DF04 B 1 Bright
		DF04 C 5 Bright 
		DF04 A 7
	    Goto Ready
		
	//---------Weapon Super Charge---------//	
		AltFireFast:
		NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
		TNT1 A 0 A_JumpIfInventory("UseAmmo", 1, "AltFireFastUseAmmo")
		NULL A 0 A_JumpIfInventory("PowerCells", 3, 3) //Go Here---
		NULL A 0 A_JumpIfInventory("PowerCells", 2, "Fire")//or   |
		NULL A 0 A_JumpIfInventory("PowerCells", 1, "Fire")//fire |
	    NULL A 0 A_PlaySound("AutoGunOne")//-----------------------
	    NULL A 0 A_FireCustomMissile("AutoGun", 0, 0, 6, 3, 0)
		NULL A 0 A_FireCustomMissile("AutoGun", -4, 0, 4, 6, 0,-4)
		NULL A 0 A_FireCustomMissile("AutoGun", 4, 0, 8, 6, 0,-4)
		TNT1 A 0 A_GiveInventory("UseAmmo", 1)
		DF04 B 1 Bright
		DF04 C 3 Bright 
		DF04 A 2
	    Goto Ready
		
		AltFireFastUseAmmo:
		NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
		NULL A 0 A_JumpIfInventory("PowerCells", 3, 3) //Go Here---
		NULL A 0 A_JumpIfInventory("PowerCells", 2, "Fire")//or   |
		NULL A 0 A_JumpIfInventory("PowerCells", 1, "Fire")//fire |
	    NULL A 0 A_PlaySound("AutoGunOne")//-----------------------
	    NULL A 0 A_FireCustomMissile("AutoGun", 0, 1, 6, 3, 0)
		NULL A 0 A_FireCustomMissile("AutoGun", -4, 1, 4, 6, 0,-4)
		NULL A 0 A_FireCustomMissile("AutoGun", 4, 1, 8, 6, 0,-4)
		TNT1 A 0 A_TakeInventory("UseAmmo", 1)
		DF04 B 1 Bright
		DF04 C 3 Bright 
		DF04 A 2
	    Goto Ready		
		
		
	//-----------------------------------------------------//	
	 Spawn:
	    DFW2 A -1
	    Stop
	 }
}

Actor AutoGun
{
	Radius 2
	Height 2
	Speed 57
	scale 1.0
	Damage (10)
	Projectile
	+NOGRAVITY
	DeathSound "BoltExplode"
	States
	{
	Spawn: 
		DFP2 A 1 Bright
		Loop
	Death:
		DFP2 BCDEFGH 3 Bright
		Stop
	XDeath:
		DFP2 BCDEFGH 3 Bright
		Stop	
	}
}