ACTOR HexaShotgun : BrutalWeapon
{
	Game Doom
   Weapon.Kickback 76
	Weapon.SelectionOrder 1600
	Weapon.AmmoGive1 4	
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "AmmoShell"
	Weapon.AmmoType2 "HexaAmmo"
	Weapon.AmmoUse1 0
	Weapon.AmmoUse2 0
	Weapon.SlotNumber 7
    +WEAPON.NOAUTOAIM
	+WEAPON.NOAUTOFIRE
	+FORCEXYBILLBOARD
	Inventory.PickupMessage "You got the fuckin' Hexa Shotgun! (Slot 7)"
	Obituary "$OB_MPSSHOTGUN"
    Inventory.PickupSound "CLIPINSS"
	Scale 0.9
	Tag "Hexa Shotgun"
	States
	{
	
    SelectAnimation:    
	Ready:
	Ready3:
	    TNT1 A 0 Offset(0,32)
		TNT1 A 0 A_JumpIfTargetInLOS("BlinkBegin", 0, 0, JLOSF_COMBATANTONLY, 12000) //checks if an enemy/player is in sight
	    HSGF T 1 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_GiveInventory("HexaAltCooldown", 2)
        HSGF T 0 A_JumpIfInventory("Kicking",1,"DoKick")
        HSGF T 0 A_JumpIfInventory("Taunting",1,"Taunt")
		HSGF T 0 A_JumpIfInventory("Salute1", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Salute2", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Reloading",1,"Reload")
		HSGF T 0 A_JumpIfInventory("Unloading",1,"Unload")
		HSGF T 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")	
		HSGF T 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		Loop
		
		BlinkBegin:
		HSGF U 1 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_GiveInventory("HexaAltCooldown", 2)
        HSGF T 0 A_JumpIfInventory("Kicking",1,"DoKick")
        HSGF T 0 A_JumpIfInventory("Taunting",1,"Taunt")
		HSGF T 0 A_JumpIfInventory("Salute1", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Salute2", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Reloading",1,"Reload")
		HSGF T 0 A_JumpIfInventory("Unloading",1,"Unload")
		HSGF T 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")	
		HSGF T 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		HSGF V 1 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_GiveInventory("HexaAltCooldown", 2)
        HSGF T 0 A_JumpIfInventory("Kicking",1,"DoKick")
        HSGF T 0 A_JumpIfInventory("Taunting",1,"Taunt")
		HSGF T 0 A_JumpIfInventory("Salute1", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Salute2", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Reloading",1,"Reload")
		HSGF T 0 A_JumpIfInventory("Unloading",1,"Unload")
		HSGF T 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")	
		HSGF T 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		HSGF W 1 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_GiveInventory("HexaAltCooldown", 2)
        HSGF T 0 A_JumpIfInventory("Kicking",1,"DoKick")
        HSGF T 0 A_JumpIfInventory("Taunting",1,"Taunt")
		HSGF T 0 A_JumpIfInventory("Salute1", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Salute2", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Reloading",1,"Reload")
		HSGF T 0 A_JumpIfInventory("Unloading",1,"Unload")
		HSGF T 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")	
		HSGF T 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		Goto Blink
		
		Blink:
		HSF2 A 1 A_WeaponReady(WRF_ALLOWRELOAD) //Blinking frame
        TNT1 A 0 A_GiveInventory("HexaAltCooldown", 2)
        HSGF T 0 A_JumpIfInventory("Kicking",1,"DoKick")
        HSGF T 0 A_JumpIfInventory("Taunting",1,"Taunt")
        HSGF T 0 A_JumpIfInventory("Salute1", 1, "Salute")
        HSGF T 0 A_JumpIfInventory("Salute2", 1, "Salute")
        HSGF T 0 A_JumpIfInventory("Reloading",1,"Reload")
        HSGF T 0 A_JumpIfInventory("Unloading",1,"Unload")
        HSGF T 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
        HSGF T 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		TNT1 A 0 A_JumpIfTargetInLOS("Blink", 0, 0, JLOSF_COMBATANTONLY, 12000) //Still in sight? Then repeat!
		HSGF W 1 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_GiveInventory("HexaAltCooldown", 2)
        HSGF T 0 A_JumpIfInventory("Kicking",1,"DoKick")
        HSGF T 0 A_JumpIfInventory("Taunting",1,"Taunt")
		HSGF T 0 A_JumpIfInventory("Salute1", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Salute2", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Reloading",1,"Reload")
		HSGF T 0 A_JumpIfInventory("Unloading",1,"Unload")
		HSGF T 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")	
		HSGF T 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		HSGF V 1 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_GiveInventory("HexaAltCooldown", 2)
        HSGF T 0 A_JumpIfInventory("Kicking",1,"DoKick")
        HSGF T 0 A_JumpIfInventory("Taunting",1,"Taunt")
		HSGF T 0 A_JumpIfInventory("Salute1", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Salute2", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Reloading",1,"Reload")
		HSGF T 0 A_JumpIfInventory("Unloading",1,"Unload")
		HSGF T 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")	
		HSGF T 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		HSGF U 1 A_WeaponReady(WRF_ALLOWRELOAD)
		TNT1 A 0 A_GiveInventory("HexaAltCooldown", 2)
        HSGF T 0 A_JumpIfInventory("Kicking",1,"DoKick")
        HSGF T 0 A_JumpIfInventory("Taunting",1,"Taunt")
		HSGF T 0 A_JumpIfInventory("Salute1", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Salute2", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Reloading",1,"Reload")
		HSGF T 0 A_JumpIfInventory("Unloading",1,"Unload")
		HSGF T 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")	
		HSGF T 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		Goto Ready
		
	CheckSprint:
		HSGF T 1 A_WeaponReady(WRF_NOFIRE)
		HSGF T 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		HSGF T 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready
		
	StartSprint:
		HSGF T 1 A_WeaponReady(WRF_NOFIRE)
		HSGF T 0 A_Takeinventory("Zoomed",1)
		HSGF T 0 A_Takeinventory("ADSmode",1)
		HSGF T 0 A_ZoomFactor(1.0)
		HSGF T 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		QSGP A 0 offset(-9,32) 
		HSGF T 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		HSGF T 0 offset(-9,32) A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		PLAY A 0 offset(-9,32) ACS_ExecuteAlways(852, 0, 0, 0, 0)//Makes player faster.
		HSGF T 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
		HSGF T 0 offset(-9,32) A_GiveInventory("UsedStamina", 8)
		HSGF T 0 offset(-9,32)
		HSGS G 1 offset(-9,34) A_SetPitch(pitch -0.5)
		HSGS G 1 offset(-6,36) A_SetPitch(pitch -0.5)
		HSGS G 1 offset(-3,38) A_SetPitch(pitch -0.5)
		HSGS G 1 offset(0,38) A_SetPitch(pitch -0.5)
		HSGS G 1 offset(3,36) A_SetPitch(pitch -0.5)
		HSGS G 1 offset(6,34) A_SetPitch(pitch -0.5)
		HSGS G 1 offset(9,32) A_SetPitch(pitch -0.5)
		HSGF T 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
		HSGF T 0 A_JumpIfInventory("Kicking",1,"DoKick")
        HSGF T 0 A_JumpIfInventory("Taunting",1,"Taunt")
        HSGF T 0 A_JumpIfInventory("Reloading",1,"Reload")
		HSGF T 0 offset(-9,32) A_GiveInventory("UsedStamina", 8)
		HSGF T 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		HSGS G 1 offset(9,34) A_SetPitch(pitch +0.5)
		HSGS G 1 offset(6,36) A_SetPitch(pitch +0.5)
		HSGS G 1 offset(3,38) A_SetPitch(pitch +0.5)
		HSGS G 1 offset(0,38) A_SetPitch(pitch +0.5)
		HSGS G 1 offset(-3,36) A_SetPitch(pitch +0.5)
		HSGS G 1 offset(-6,34) A_SetPitch(pitch +0.5)
		HSGS G 1 offset(-9,32) A_SetPitch(pitch +0.5)
		HSGF T 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
		HSGF T 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint
		
	StopSprintTired:
		HSGF T 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		HSGF T 0 A_PlaySound("Tired", 2)
		HSGF T 0 A_TakeInventory("UsedStamina", 2)
		HSGF T 5 A_WeaponReady
		HSGF T 0 A_TakeInventory("UsedStamina", 2)
		HSGF T 5 A_WeaponReady
		HSGF T 0 A_TakeInventory("UsedStamina", 2)
		HSGF T 5 A_WeaponReady
		HSGF T 0 A_TakeInventory("UsedStamina", 2)
		HSGF T 5 A_WeaponReady
		HSGF T 0 A_TakeInventory("UsedStamina", 2)
		HSGF T 5 A_WeaponReady
		Goto Ready
	StopSprint:
		HSGF T 1
		HSGF T 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		Goto Ready
		
	Deselect:
	    TNT1 A 0 A_giveInventory("HexaAltCooldown", 20)
		HSGF T 0 A_Takeinventory("Zoomed",1)
        HSGF T 0 A_ZoomFactor(1.0)
		HSGF T 0 A_TakeInventory("TossGrenade", 1)
		HSGS ABCDEF 1
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		Wait
	Select:
		HSGF T 0 A_Giveinventory("GoSpecial",1)
		HSGF T 0 A_Takeinventory("FistsSelected",1)
		HSGF T 0 A_Takeinventory("SawSelected",1)
		HSGF T 0 A_Takeinventory("ShotgunSelected",1)
		HSGF T 0 A_Giveinventory("SSGSelected",1)
		HSGF T 0 A_Takeinventory("MinigunSelected",1)
		HSGF T 0 A_Takeinventory("PlasmaGunSelected",1)
		HSGF T 0 A_Takeinventory("RocketLauncherSelected",1)
		HSGF T 0 A_Takeinventory("GrenadeLauncherSelected",1)
		HSGF T 0 A_Takeinventory("BFGSelected",1)
		HSGF T 0 A_Takeinventory("BFG10kSelected",1)
		HSGF T 0 A_Takeinventory("RailGunSelected",1)
		HSGF T 0 A_Takeinventory("SubMachineGunSelected",1)
		HSGF T 0 A_Takeinventory("RevenantLauncherSelected",1)
		HSGF T 0 A_Takeinventory("LostSoulSelected",1)
		HSGF T 0 A_Takeinventory("FlameCannonSelected",1)
		HSGF T 0 A_Takeinventory("HasBarrel",1) 
		HSGF T 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_giveInventory("HexaAltCooldown", 100)
		TNT1 AAAAAAAAAAAAAAA 0 A_Raise
		HSGF T 0 A_GunFlash
		HSGS FEDCBA 1
		TNT1 A 0 A_PlaySound("HEXAOPEN")
		Goto Ready
		

	NoAmmo:
		HSGF T 0
		HSGF T 0 A_ZoomFactor(1.0)
		HSGF T 0 A_Takeinventory("Zoomed",1)
		HSGF T 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_PlaySound("weapons/empty", 4)
		NoAmmo2:
		HSGF T 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
	    HSGF T 0 A_JumpIfInventory("Taunting",1,"Taunt")
		HSGF T 0 A_JumpIfInventory("Salute1", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Salute2", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		HSGF T 0 A_JumpIfInventory("ExecuteDownedEnemy", 1, "DoExecution")
		HSGF T 0 A_JumpIfInventory("Kicking",1,"DoKick")
		HSGF T 3 A_WeaponReady(WRF_ALLOWRELOAD | WRF_NOFIRE)
		HSGF T 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("NoAutoReload", 1, "NoAmmo2")
		HSGF T 0 A_JumpIfInventory("AmmoShell",2,"Reload")
		HSGF T 0 A_JumpIfInventory("FiredPrimary",1,"NoAmmo2")
		Goto Ready3
		
	 Fire:
	    TNT1 A 0 A_GiveInventory("HexaAltCooldown", 50)
		HSGF T 0 A_TakeInventory("Reloading",1)
		HSGF T 0 A_JumpIfInventory("HexaAmmo", 0, 1)
		Goto NoAmmo
		HSGF T 0 A_TakeInventory("HexaAmmo", 6)
		HSGF T 0 A_ZoomFactor(1.5)
		HSGF T 0 A_Recoil(20)
		HSGF T 0 A_FireCustomMissile("DistantFireSoundSSG", random(-1,1), 0, 0, -12, 0, random(-1,1))
		SHO9 A 0 A_firebullets (0,0,1,80,"shotpuff",FBF_NORANDOM,100)
        SHO9 A 0 A_firebullets (0,0,1,60,"shotpuff",FBF_NORANDOM,200)
        SHO9 A 0 A_firebullets (0,0,1,40,"shotpuff",FBF_NORANDOM,300)
		HSGF A 1 BRIGHT
		HSGF T 0 A_ZoomFactor(1.4)
		TNT1 A 0 A_PlaySound("HEXAFIR1",1)
		TNT1 A 0 A_PlaySound("HEXAFIR2",2)
		TNT1 A 0 A_PlaySound("HEXAFIR3",3)
		TNT1 A 0 A_PlaySound("HEXAFIR4",4)
		TNT1 A 0 A_PlaySound("HEXAFIR5",5)
		TNT1 A 0 A_PlaySound("HEXAFIR6",6)
		TNT1 A 0 A_PlaySound("HEXAFIR7",7)
        SHTN A 0 A_PlaySound("PAIN1",8)
		TNT1 AAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("DecorativeTracer", random(-14,14), 0, 0, -12, 0, random(-7,7))
		TNT1 AAAAAAAAAAAAAAAAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles", random(-19,19), 0, -1, 0, 0, random(-9,9))
		TNT1 AAAAAAAAAAAAAAAAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles2", random(-19,19), 0, -1, 0, 0, random(-9,9))
		HSGF T 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
		HSGF T 0 A_FireBullets (7, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		HSGF T 0 A_FireBullets (3, 5, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		HSGF T 0 A_FireBullets (4, 4, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		HSGF T 0 A_FireBullets (6, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		HSGF T 0 A_FireBullets (5, 5, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		HSGF T 0 A_FireBullets (7, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		HSGF T 0 A_FireBullets (5, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		HSGF B 1 BRIGHT
		HSGF T 0 A_SetPitch(pitch-10)
		HSGF T 0 A_ZoomFactor(1.3)
        HSGF C 1 BRIGHT
		HSGF T 0 A_ZoomFactor(1.2)
		TNT1 A 0 A_SetPitch(pitch-8)
		HSGF T 0 A_ZoomFactor(1.00)
        HSGF T 0 A_TakeInventory("Reloading",1)
    
		HSGF DE 1 A_SetPitch(pitch-4)
		HSGF EEEFGH 1 A_SetPitch(pitch+1)
		HSGF IJKLMNOPQR 1 A_SetPitch(pitch+2)
		HSGF S 1 A_GiveInventory("HexaAltCooldown", 2)
		HSGF T 1 Offset(0,34)
		
		HSGF T 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 15)//Tactical Mode takes more time
		QSGF AAA 0 A_SetPitch(pitch+0.5)
		HSGF TT 1 Offset(0,33)
		HSGF T 1 Offset(0,32)
		HSGF T 1 A_WeaponReady(WRF_NOFIRE | WRF_NOBOB)
		QSGF P 1 A_JumpIfInventory("Reloading",1,"Reload")
		HSGF T 0 A_JumpIfInventory("Kicking",1,"DoKick")
        HSGF T 0 A_JumpIfInventory("Taunting",1,"Taunt")
		HSGF T 0 A_JumpIfInventory("Salute1", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("Salute2", 1, "Salute")
		HSGF T 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")	
		HSGF T 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		HSGF T 1 A_WeaponReady(WRF_NOFIRE | WRF_NOBOB)
		Goto NoAmmo2
		
		
		
		
		
	Reload:	
		HSGF T 0
		HSGF T 0 A_TakeInventory("Reloading",1)
		HSGF T 0 A_JumpIfInventory("HexaAmmo", 6, "Ready")//Check if still has a shells in barrels
		
		HSGF T 0 A_JumpIfInventory("AmmoShell", 6, 1)//Check if has any ammo left to reload
		Goto Ready
		//Reload 6 barrels
		TNT1 A 0 Offset(20,48) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
        TNT1 A 0 Offset(0,32) //A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		HSGF T 1 Offset(-2,33)
		HSGF T 1 Offset(-4,34)
		HSGF T 1 Offset(-7,36)
		HSGR ABCDEFG 1 Offset(0,32)
		HSGR H 4 A_GiveInventory("HexaAltCooldown", 2)
		HSGR IJKMOPQR 1 A_GiveInventory("HexaAltCooldown", 2)
		TNT1 A 0 A_PlaySound("HEXAOPEN")
		HSGF T 0 A_JumpIfInventory("HasUnloaded", 1, 3)
		TNT1 AAA 0 A_FireCustomMissile("SSGCaseSpawner",random(3,-3),0,random(-12,-8), random(-16,-24))
		TNT1 AAA 0 A_FireCustomMissile("SSGCaseSpawner",random(1,-1),0,random(-12,-8), random(-16,-24))
		HSGR S 2 Offset(9,38)
		HSGR S 1 Offset(5,35)
		HSGR S 1 Offset(2,33)
		HSGR S 2 Offset(0,32)
		HSGR TUVWWXX 1 A_GiveInventory("HexaAltCooldown", 2)
		QSGR O 0 A_playsound("HEXALOAD")
		HSGF T 0 A_TakeInventory("AmmoShell", 2)
		HSGF T 0 A_GiveInventory("HexaAmmo", 2)
		HSGR YZ 1 A_GiveInventory("HexaAltCooldown", 2)
		HSR2 A 1 A_GiveInventory("HexaAltCooldown", 2)
		HSR2 A 1 Offset(-2,31)
		HSR2 A 1 Offset(-3,31)
		HSR2 A 2 Offset(-4,33)
		HSR2 A 1 Offset(-2,33)
		HSR2 A 2 Offset(0,32)
		HSR2 BCDEEFF 1 A_GiveInventory("HexaAltCooldown", 2)
		QSGR O 0 A_playsound("HEXALOAD")
		HSGF T 0 A_TakeInventory("AmmoShell", 2)
		HSGF T 0 A_GiveInventory("HexaAmmo", 2)
		HSR2 GH 1 A_GiveInventory("HexaAltCooldown", 2)
		HSR2 I 1 Offset(-1,30)
		HSR2 I 1 Offset(-2,29)
		HSR2 I 3 Offset(-4,27)
		HSR2 I 1 Offset(-3,28)
		HSR2 I 2 Offset(-1,31)
		HSR2 JKLMMNN 1 Offset(0,32)
		QSGR O 0 A_playsound("HEXALOAD")
		HSGF T 0 A_TakeInventory("AmmoShell", 2)
		HSGF T 0 A_GiveInventory("HexaAmmo", 2)
		HSR2 OPQRSTUVWX 1 A_GiveInventory("HexaAltCooldown", 2)
		HSR2 YYYZ 1 A_GiveInventory("HexaAltCooldown", 2)
		HSR3 A 1 A_GiveInventory("HexaAltCooldown", 2)
		TNT1 A 0 A_PlaySound("HEXACLOS")
		Goto Ready
		

AltFire:

        RIFG A 0 A_JumpIfInventory("SSG", 1, 2)
		TNT1 A 0 A_PlaySound("weapons/empty", 4)
		Goto Ready
		RIFG A 0 A_JumpIfInventory("AmmoShell", 2, 2)
		TNT1 A 0 A_PlaySound("weapons/empty", 4)
		Goto Ready
		TNT1 A 0 A_JumpIfInventory("HexaAltCooldown", 100, 2)
		TNT1 A 0 A_PlaySound("weapons/empty", 4)
		Goto Ready
        HSGF T 1 Offset(-2,33)
		HSGF T 1 Offset(-4,34)
		HSGF T 1 Offset(-7,36)
		TNT1 A 0 Offset(0,32)
        HS2F OPQRS 1 A_GiveInventory("HexaAltCooldown", 2)
		HS2F NMLK 1 A_GiveInventory("HexaAltCooldown", 2)
		HS2F J 3 A_GiveInventory("HexaAltCooldown", 2)
		HSGF T 0 A_TakeInventory("Reloading",1)
		HSGF T 0 A_JumpIfInventory("AmmoShell", 2, 1)
		Goto NoAmmo
		HSGF T 0 A_TakeInventory("AmmoShell", 2)
		HSGF T 0 A_ZoomFactor(1.6)
		HSGF T 0 A_JumpIfInventory("PowerStrength", 1, 2)
		HSGF T 0 A_Recoil(5)
		HSGF T 0
		HSGF T 0 A_FireCustomMissile("DistantFireSoundSSG", random(-1,1), 0, 0, -12, 0, random(-1,1))
		SHO9 A 0 A_firebullets (0,0,1,40,"shotpuff",FBF_NORANDOM,300)
        SHO9 A 0 BRIGHT A_playsound("SSHFIRE", 5)
		TNT1 AAAAAAAAAAA 0 A_FireCustomMissile("DecorativeTracer", random(-10,10), 0, 0, -12, 0, random(-5,5))
		TNT1 AAAAAAAAAAAAAAAAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles", random(-19,19), 0, -1, 0, 0, random(-9,9))
		TNT1 AAAAAAAAAAAAA 0 BRIGHT A_FireCustomMissile("ShotgunParticles2", random(-19,19), 0, -1, 0, 0, random(-9,9))
		HSGF T 0 A_SpawnItemEx("PlayerMuzzle2",30,5,27)
		HS2F A 1 BRIGHT
		HSGF T 0 A_FireBullets (10, 1, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		HSGF T 0 A_FireBullets (6, 3, 9, 13, "ShotgunPuff", FBF_NORANDOM)
		
		HSGF T 0 A_JumpIfInventory("IsNOTTacticalClass", 1, 3)//Tactical Mode deals extra damage
		SHTN A 0 A_FireBullets (11, 3, 10, 13, "ShotgunPuff2", FBF_NORANDOM)
		HSGF T 0 A_SetPitch(pitch-20)
		TNT1 AA 0
		HSGF T 0 A_SetPitch(pitch-12)
        HS2F B 1 BRIGHT
		HSGF T 0 A_ZoomFactor(1.00)
        HSGF T 0 A_TakeInventory("Reloading",1)
		HS2F CDDDDE 1 A_SetPitch(pitch+2)
		HS2F EFFGI 1 A_GiveInventory("HexaAltCooldown", 2)
		HS2F J 2 A_GiveInventory("HexaAltCooldown", 2)
		HS2F KLMN 1 A_GiveInventory("HexaAltCooldown", 2)
		TNT1 AA 0 A_FireCustomMissile("SSGCaseSpawner",0,0,5, -20)
		HS2F RQPO 1 A_GiveInventory("HexaAltCooldown", 2)
		HSGF T 1 Offset(-7,36)
		HSGF T 1 Offset(-4,34)
		HSGF T 1 Offset(-2,33)
		HSGF T 1 Offset(0,32)
		TNT1 A 0 A_TakeInventory("HexaAltCooldown",100)
        Goto Ready

	Spawn:
		HSGP A -1
		Stop
	
    
		
	
	Unload:
		HSGF T 1 A_WeaponReady
		QSGF P 0 A_ZoomFactor(1.0)
		QSGF P 0 A_Takeinventory("Unloading",1)
		QSGF P 0 A_Takeinventory("ADSmode",1)
		QSGF P 0 A_Takeinventory("Zoomed",1)
        QSGF P 0 A_JumpIfInventory("HexaAmmo",1,3)
        Goto Ready
        TNT1 AAA 0
		QSGF P 0 A_Takeinventory("Zoomed",1)
		QSGF P 0 A_GiveInventory ("Pumping", 1)
		QSGF P 0 A_Takeinventory("Unloading",1)
		HSGS ABCDEF 1 A_GiveInventory("HexaAltCooldown", 2)
		QSGR H 0 A_PlaySound("HEXAOPEN")
		Goto RemoveBullets
		
	RemoveBullets:
		TNT1 AAAA 0
		QSGF P 0 A_JumpIfInventory("HexaAmmo",1,3)
		Goto FinishUnload
        TNT1 AAAAAA 0
		QSGF P 0 A_Takeinventory("HexaAmmo",1)
		QSGF P 0 A_Giveinventory("AmmoShell",1)
		Goto RemoveBullets
	
	FInishUnload:
        TNT1 A 19
		HSR2 QRSTUVWX 1
		HSR2 YYYZ 1
		HSR3 A 1
		QSGF P 0 A_GiveInventory("HasUnloaded", 1)
		QSGF P 0 A_Takeinventory("Unloading",1)
		QSGF P 0 A_GiveInventory ("Pumping", 1)
        QSGF P 0 A_PlaySound("HEXACLOS")
        Goto Ready
	}
}

ACTOR HexaAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 6
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 6
   Inventory.Icon "HSGPA0"
}

ACTOR HexaAltCooldown : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 100
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 100
}

