Actor KyleMortarGun : Weapon 30004
{
     Weapon.AmmoType1 "MortarShells"
	 Weapon.AmmoUse1 1
	 Weapon.AmmoGive1 3
	 Inventory.PickupMessage "Mortar Gun"
     Inventory.PickupSound "ItemPickup"
	 Weapon.BobStyle InverseSmooth
	 Weapon.BobSpeed 0.9	 
	 +AMMO_OPTIONAL
	 +NOAUTOAIM
	 States
	 {
	 Ready:
	    DF07 A 1 A_WeaponReady
		Loop
	//-------Spesial Select and Deselect animations, using offset------//	
	 Select:
	    NULL A 0 A_PlaySound("WeaponSelect")
		DF07 A 1 offset(27, 68)
		DF07 A 1 offset(21, 60)
		DF07 A 1 offset(15, 52)
		DF07 A 1 offset(9, 44)
		DF07 A 1 offset(3, 36)	
		DF07 AAAAAAAAAAAAAAAAAAAA 0 A_Raise
	    DF07 A 1 A_Raise
	    Goto Select+6
	 Deselect:
	    DF07 A 1 offset(3, 36)
		DF07 A 1 offset(9, 44)
		DF07 A 1 offset(15, 52)
		DF07 A 1 offset(21, 60)
		DF07 A 1 offset(27, 68)
		TNT1 A 0 A_TakeInventory("UseAmmo", 999)
		DF07 AAAAAAAAAAAAAAAAAAA 0 A_Lower
	    DF07 A 1 A_Lower
		Goto Deselect+6
	//-------------------------------------------------------------------//	
	//----------------Fire----------------------------------------//	
	 Fire:
	    TNT1 A 0 A_JumpIfInventory("PowerWeaponsSuper", 1, "FastFire")
	    NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
		NULL A 0 A_PlaySound("MortarGunFire")
	    DF07 B 1 Bright A_FireCustomMissile("MortarShell", 0, 1, 6, -4, 0, 12)  
		DF07 B 13 Bright
		NULL A 0 A_PlaySound("MortarGunReload", 6)
		DF07 C 3 Bright
		DF07 D 3 Bright
		DF07 A 4 
		Goto Ready
		
	//--------Weapon Supercharge!-------//
	  FastFire:
	    TNT1 A 0 A_JumpIfInventory("UseAmmo", 1, "FastFireUseAmmo")
	    NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
		NULL A 0 A_PlaySound("MortarGunFire")
	    DF07 B 1 Bright A_FireCustomMissile("MortarShell", 0, 0, 6, -4, 0, 12)
		TNT1 A 0 A_GiveInventory("UseAmmo", 1)
		DF07 B 7 Bright
		NULL A 0 A_PlaySound("MortarGunReload", 6)
		DF07 C 2 Bright
		DF07 D 2 Bright
		DF07 A 2 
		Goto Ready
		FastFireUseAmmo:
	    NULL A 0 A_JumpIfNoAmmo("OutOfAmmo")
		NULL A 0 A_PlaySound("MortarGunFire")
	    DF07 B 1 Bright A_FireCustomMissile("MortarShell", 0, 1, 6, -4, 0, 12)  
		TNT1 A 0 A_TakeInventory("UseAmmo", 1)
		DF07 B 7 Bright
		NULL A 0 A_PlaySound("MortarGunReload", 6)
		DF07 C 2 Bright
		DF07 D 2 Bright
		DF07 A 2 
		Goto Ready
		
	//--------------Out Of Ammo------------//
	OutOfAmmo:
	    DF07 A 2 A_WeaponReady
		NULL A 0 A_PlaySound("MortarGunOut")
		Goto Ready
	//-------------------------------------//
	//-----Spawn on map Mortar Gun---//
	Spawn:
	    DFW4 A -1
		Stop
	//-------------------------------//	
		}
}

//------------Mortar Shell--------------//
Actor MortarShell
{
	Radius 5
	Height 5
	Speed 30
	scale 1.0
	Damage (42)
	Projectile
	-NOGRAVITY
	DeathSound "MortarGunExplode"
	States
	{
	Spawn: 
		DFP6 ABCDEF 5 Bright
		Loop
	Death:
	    NULL A 0
	    NULL A 1 A_Explode(42, 250)
		NULL A 0 A_SpawnItem("MortarShellExplode")
		Stop
	XDeath:
	    NULL A 0
	    NULL A 1 A_Explode(42, 250)
		NULL A 0 A_SpawnItem("MortarShellExplode")
		Stop	
	}
}

//--------Explode Sprites for Mortar Shell-------//
Actor MortarShellExplode
{
    +NOGRAVITY
	+NOBLOCKMAP
	-SOLID
	scale 2.0
	States
	{
	Spawn:
	   DFP6 GHIJKLMNOPQRST 3 Bright
	   Stop
	}
}	
//-------------------------------------------------//
		 