ACTOR Ithaca : BrutalWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.SelectionOrder 2500
	Weapon.AmmoType1 "AmmoShell"
	Weapon.AmmoType2 "ShotgunAmmo"
	Obituary "%o was shot down by %k's Shotgun."
    Inventory.PickupSound "CLIPIN"
	Inventory.Pickupmessage "$GOTShotgun"
    +WEAPON.NOALERT
	+WEAPON.NOAUTOFIRE
	+FORCEXYBILLBOARD
	Tag "Ithaca 37 Shotgun"
	States
	{
	
	Spawn:
		TNT1 A 1
		TNT1 A 0 A_SpawnItemEx("IthacaWeapon", 0, 0, 0, momx, momy, momz)
		Stop
	
	Ready:
	Ready3:
		SHTN A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		SHTN A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
        SHTN A 0 A_JumpIfInventory("Reloading",1,"Reload")
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		"----" # 0 A_JumpIfInventory("UsedBandage", 1, "UseBandages")
		Loop
	
	Deselect:
		SHTN A 0
		SHTN A 0 A_TakeInventory("TossGrenade", 1)
        SHTN A 0 A_TakeInventory("Reloading",1)
		SHTN A 0 A_TakeInventory("Unloading",1)
        SHTN A 0 A_ZoomFactor(1.0)
		SHTN AAA 1 A_Lower
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Wait
		
	Select:
		SHTN A 0
		SHTN AAA 1 A_Raise
		TNT1 A 0 A_TakeInventory("IthacaFlame", 1)
		TNT1 AAAAAAAAA 0 A_Raise
		Goto Ready3
	
    Fire:
        SHTN A 0 A_JumpIfInventory("ShotgunAmmo",1,2)
        Goto NoAmmo
        TNT1 AA 0
		SHTN A 0 A_AlertMonsters
		SHTN A 0 A_PlaySound("weapons/sg", 1)
		TNT1 A 0 A_FireBullets (2.0, 1.0, 2, 10, "ShotgunPuff", FBF_NORANDOM)
		SHTA A 1 BRIGHT
		SHTA B 1 A_FireBullets (6.0, 3.0, 6, 10, "ShotgunPuff", FBF_NORANDOM)
		SHTN A 0 A_FireCustomMissile("SmokeSpawner", random(-0.3,0.3), 0, 0, 0, 0, random(-0.3,0.3))
		SHTN A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
        SHTN A 0 A_ZoomFactor(0.96)
		SHTN A 0 A_SetPitch(pitch-4.0)
		SHTN A 0 A_Takeinventory("ShotgunAmmo",1)
		SHTA C 1 A_FireCustomMissile("SmokeSpawner", random(-0.3,0.3), 0, 0, 0, 0, random(-0.3,0.3))
		SHTN A 0 A_SetPitch(pitch+0.5)
		SHTN A 0 A_ZoomFactor(1.0)
		SHTA DE 1 A_SetPitch(pitch+0.5)
		SHTN AAAA 1 A_SetPitch(pitch+0.5)
		
		SHTN BCD 1
		SHTN D 2
		SHTN A 0 A_FireCustomMissile("ShotCaseSpawn",40,0,-8,-26)
		SHTN A 0 A_PlaySound("weapons/sgpump", 3)
		SHTN EFGHHHH 1
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick2")
		SHTN GFED 1
		SHTN D 2
		SHTN CB 1
		Goto Ready3
		
	DoKick:
		SHTM AB 1
		TNT1 A 2
	DoKick2:	
		SHTM CDE 1
		TNT1 A 0 A_PlaySound("KICK")
		KNIF A 0 A_FireCustomMissile("KnifeAttack2", 0, 0, 0, 0, 0, 0)
		KNIF A 0 A_ZoomFactor(0.97)
		SHTM F 1
		TNT1 A 0 A_TakeInventory("Kicking", 1)
		M72G A 0 A_ZoomFactor(1.0)
		SHTM F 6
		SHTM EDC 1
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick2")
		TNT1 A 2
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick2")
		SHTM BA 1
		TNT1 A 0 A_TakeInventory("Kicking", 1)
		Goto Ready3
	
     Fire2:
	
    Reload:
		SHTN A 1 A_WeaponReady
		SHTN A 0 A_ZoomFactor(1.0)
		SHTN A 0 A_Takeinventory("Reloading",1)
		SHTN A 0 A_Takeinventory("ADSmode",1)
		SHTN A 0 A_Takeinventory("Zoomed",1)
		SHTN A 0 A_JumpIfInventory("ShotgunAmmo",6,"Ready3")
        SHTN A 0 A_JumpIfInventory("AmmoShell",1,3)
        Goto FinishReloading
        TNT1 AAA 0
		SHTN A 0 A_Takeinventory("Zoomed",1)
		SHTN A 0 A_GiveInventory ("Pumping", 1)
		SHTN A 0 A_Takeinventory("Reloading",1)
		
		SHTN BCD 1
		Goto InsertBullets
		
		
	InsertBullets:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("FiredPrimary", 1)
		SHTN A 0 A_JumpIfInventory("ShotgunAmmo",6,"FinishReloading")
		SHTN A 0 A_JumpIfInventory("AmmoShell",1,3)
		Goto FinishReload3
        TNT1 AAAAAA 0
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick2")
		SSHR H 10 A_WeaponReady(WRF_NOPRIMARY)
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick2")
		SHTN A 0 A_JumpIfInventory("Reloading",1,"FinishReloading")
		SHTN A 0 A_JumpIfInventory("FiredPirmary",1,"FinishReloading")
		SSHR AB 1
		TNT1 A 0 A_PlaySound("insertshell")
		SSHR CDEFGH 1 A_JumpIfInventory("Kicking",1,"DoKick2")
		SHTN A 0 A_Giveinventory("ShotgunAmmo",1)
		SHTN A 0 A_Takeinventory("AmmoShell",1)
		Goto InsertBullets
		
		
	FinishReloading:
		SHTN A 0
		SHTN A 0 A_JumpIfInventory("ShotgunWasEmpty",1,"FinishReloading2")
		TNT1 A 0 A_TakeInventory("Reloading", 1)
		SHTN DCB 1
		SHTN A 0 A_Refire
		Goto Ready3

	FinishReloading2:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("ShotgunWasEmpty", 1)
		SHTN A 0 A_PlaySound("weapons/sgpump", 3)
		SHTN EFGHHHH 1
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick2")
		SHTN GFED 1
		SHTN D 2
		SHTN CB 1
		SHTN A 0 A_Refire
		Goto Ready3
		
		
		
	NoAmmo:
		SHTN A 0
		SHTN A 0 A_ZoomFactor(1.0)
		SHTN A 0 A_Giveinventory("ShotgunWasEmpty",1)
		SHTN A 0 A_Takeinventory("Zoomed",1)
		SHTN A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_PlaySound("weapons/empty", 4)
	NoAmmo2:
		SHTN A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
        SHTN A 0 A_JumpIfInventory("Reloading",1,"Reload")
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		SHTN A 5 A_WeaponReady(WRF_ALLOWRELOAD | WRF_NOPRIMARY)
		SHTN A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("NoAutoReload", 1, "NoAmmo2")
		SHTN A 0 A_JumpIfInventory("AmmoShell",1,"Reload")
		Goto Ready3

	AltFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIFInventory("AmmoFireShell", 1, 2)
		Goto CantSwitch
		TNT1 A 0
		TNT1 A 0 A_Print("Switching to Dragonbreath Rounds")
		Goto UnloadToSwitch

	CantSwitch:
		SHTN A 3
		TNT1 A 0 A_Print("You don`t have alt ammo.")
		Goto Ready3

	UnloadToSwitch:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("FiredPrimary", 1)
		SHTN A 0 A_JumpIfInventory("ShotgunAmmo",1,2)
		Goto FinishUnloading
		TNT1 A 0
		SHTN A 0 A_Takeinventory("ShotgunAmmo",1)
		SHTN A 0 A_Giveinventory("AmmoShell",1)
		SHTN A 1
		Loop
		
		
	FinishUnloading:
		SHTN A 0
		TNT1 A 0 A_GiveInventory("IthacaFlame", 1)
		TNT1 A 0 A_SelectWeapon("IthacaFlame")
		Goto Ready3
	}
}

ACTOR ShotgunAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 6
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 6
   Inventory.Icon "RIFLA0"
}









//









ACTOR IthacaFlame : BrutalWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.SelectionOrder 2500
	Weapon.AmmoType1 "AmmoFireShell"
	Weapon.AmmoType2 "ShotgunAmmo"
	Obituary "%o was shot down by %k's Shotgun."
    Inventory.PickupSound "CLIPIN"
	Inventory.Pickupmessage "$GOTShotgun"
    +WEAPON.NOAUTOAIM
    +WEAPON.NOALERT
	+WEAPON.NOAUTOFIRE
	+FORCEXYBILLBOARD
	Tag "Ithaca 37 Shotgun"
	States
	{
	
	Spawn:
		TNT1 A 1
		TNT1 A 0 A_SpawnItemEx("IthacaWeapon", 0, 0, 0, momx, momy, momz)
		Stop
	
	Ready:
	Ready3:
		SHTN A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		SHTN A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
        SHTN A 0 A_JumpIfInventory("Reloading",1,"Reload")
		"----" # 0 A_JumpIfInventory("UsedBandage", 1, "UseBandages")
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		Loop
	
	Deselect:
		SHTN A 0
		SHTN A 0 A_TakeInventory("TossGrenade", 1)
        SHTN A 0 A_TakeInventory("Reloading",1)
		SHTN A 0 A_TakeInventory("Unloading",1)
        SHTN A 0 A_ZoomFactor(1.0)
		SHTN AAA 1 A_Lower
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Wait
		
	Select:
		SHTN A 0
		SHTN AAA 1 A_Raise
		TNT1 A 0 A_TakeInventory("Ithaca", 1)
		TNT1 AAAAAAAAA 0 A_Raise
		Goto Ready3
	
    Fire:
        SHTN A 0 A_JumpIfInventory("ShotgunAmmo",1,2)
        Goto NoAmmo
        TNT1 AA 0
		SHTN A 0 A_AlertMonsters
		SHTN A 0 A_PlaySound("weapons/sg", 1)
		RIFF A 0 A_FireCustomMissile("DistantFireSoundShotgun", random(-1,1), 0, 0, 0, 0, random(-1,1))
		TNT1 A 0 A_FireCustomMissile("DragonsBreathFire1", 0, 1, 0, 0, 0, 0)
		RIFF AAAA 0 A_FireCustomMissile("DragonsBreathProjectile", random(-6.6,6.6), 0, 0, 0, 0, random(-2.6,2.6))
		SHTA A 1 BRIGHT
		SHTA B 1 A_FireCustomMissile("SmokeSpawner", random(-0.3,0.3), 0, 0, 0, 0, random(-0.3,0.3))
		SHTN A 0 A_SpawnItemEx("PlayerMuzzle1",30,5,30)
        SHTN A 0 A_ZoomFactor(0.96)
		SHTN A 0 A_SetPitch(pitch-4.0)
		SHTN A 0 A_Takeinventory("ShotgunAmmo",1)
		SHTA C 1 A_FireCustomMissile("SmokeSpawner", random(-0.3,0.3), 0, 0, 0, 0, random(-0.3,0.3))
		SHTN A 0 A_SetPitch(pitch+0.5)
		SHTN A 0 A_ZoomFactor(1.0)
		SHTA DE 1 A_SetPitch(pitch+0.5)
		SHTN AAAA 1 A_SetPitch(pitch+0.5)
		
		SHTN BCD 1
		SHTN D 2
		SHTN A 0 A_FireCustomMissile("ShotCaseSpawn",40,0,-8,-26)
		SHTN A 0 A_PlaySound("weapons/sgpump", 3)
		SHTN EFGHHHH 1
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick2")
		SHTN GFED 1
		SHTN D 2
		SHTN CB 1
		Goto Ready3
		
	DoKick:
		SHTM AB 1
		TNT1 A 2
	DoKick2:	
		SHTM CDE 1
		TNT1 A 0 A_PlaySound("KICK")
		KNIF A 0 A_FireCustomMissile("KnifeAttack2", 0, 0, 0, 0, 0, 0)
		KNIF A 0 A_ZoomFactor(0.97)
		SHTM F 1
		TNT1 A 0 A_TakeInventory("Kicking", 1)
		M72G A 0 A_ZoomFactor(1.0)
		SHTM F 6
		SHTM EDC 1
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick2")
		TNT1 A 2
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick2")
		SHTM BA 1
		TNT1 A 0 A_TakeInventory("Kicking", 1)
		Goto Ready3
	
     Fire2:
	
    Reload:
		SHTN A 1 A_WeaponReady
		SHTN A 0 A_ZoomFactor(1.0)
		SHTN A 0 A_Takeinventory("Reloading",1)
		SHTN A 0 A_Takeinventory("ADSmode",1)
		SHTN A 0 A_Takeinventory("Zoomed",1)
		SHTN A 0 A_JumpIfInventory("ShotgunAmmo",6,"Ready3")
        SHTN A 0 A_JumpIfInventory("AmmoFireShell",1,3)
        Goto FinishReloading
        TNT1 AAA 0
		SHTN A 0 A_Takeinventory("Zoomed",1)
		SHTN A 0 A_GiveInventory ("Pumping", 1)
		SHTN A 0 A_Takeinventory("Reloading",1)
		
		SHTN BCD 1
		Goto InsertBullets
		
		
	InsertBullets:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("FiredPrimary", 1)
		SHTN A 0 A_JumpIfInventory("ShotgunAmmo",6,"FinishReloading")
		SHTN A 0 A_JumpIfInventory("AmmoFireShell",1,3)
		Goto FinishReload3
        TNT1 AAAAAA 0
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick2")
		SSHR H 10 A_WeaponReady(WRF_NOPRIMARY)
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick2")
		SHTN A 0 A_JumpIfInventory("Reloading",1,"FinishReloading")
		SHTN A 0 A_JumpIfInventory("FiredPirmary",1,"FinishReloading")
		SSHR AB 1
		TNT1 A 0 A_PlaySound("insertshell")
		SSHR CDEFGH 1 A_JumpIfInventory("Kicking",1,"DoKick2")
		SHTN A 0 A_Giveinventory("ShotgunAmmo",1)
		SHTN A 0 A_Takeinventory("AmmoFireShell",1)
		Goto InsertBullets
		
		
	FinishReloading:
		SHTN A 0
		SHTN A 0 A_JumpIfInventory("ShotgunWasEmpty",1,"FinishReloading2")
		TNT1 A 0 A_TakeInventory("Reloading", 1)
		SHTN DCB 1
		SHTN A 0 A_Refire
		Goto Ready3

	FinishReloading2:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("ShotgunWasEmpty", 1)
		SHTN A 0 A_PlaySound("weapons/sgpump", 3)
		SHTN EFGHHHH 1
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick2")
		SHTN GFED 1
		SHTN D 2
		SHTN CB 1
		SHTN A 0 A_Refire
		Goto Ready3
		
		
		
	NoAmmo:
		SHTN A 0
		SHTN A 0 A_ZoomFactor(1.0)
		SHTN A 0 A_Giveinventory("ShotgunWasEmpty",1)
		SHTN A 0 A_Takeinventory("Zoomed",1)
		SHTN A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_PlaySound("weapons/empty", 4)
	NoAmmo2:
		SHTN A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
        SHTN A 0 A_JumpIfInventory("Reloading",1,"Reload")
		SHTN A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		SHTN A 5 A_WeaponReady(WRF_ALLOWRELOAD | WRF_NOPRIMARY)
		SHTN A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("NoAutoReload", 1, "NoAmmo2")
		SHTN A 0 A_JumpIfInventory("AmmoFireShell",1,"Reload")
		Goto Ready3

	AltFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIFInventory("AmmoShell", 1, 2)
		Goto CantSwitch
		TNT1 A 0
		TNT1 A 0 A_Print("Switching to 00 Buck Rounds")
		Goto UnloadToSwitch

	CantSwitch:
		SHTN A 3
		TNT1 A 0 A_Print("You don`t have alt ammo.")
		Goto Ready3

	UnloadToSwitch:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("FiredPrimary", 1)
		SHTN A 0 A_JumpIfInventory("ShotgunAmmo",1,2)
		Goto FinishUnloading
		TNT1 A 0
		SHTN A 0 A_Takeinventory("ShotgunAmmo",1)
		SHTN A 0 A_Giveinventory("AmmoFireShell",1)
		SHTN A 1
		Loop
		
		
	FinishUnloading:
		SHTN A 0
		TNT1 A 0 A_GiveInventory("Ithaca", 1)
		TNT1 A 0 A_SelectWeapon("Ithaca")
		Goto Ready3
	}
}