ACTOR Hexa-Shotgun2 : Hexa-Shotgun replaces Hexa-Shotgun
{
  Weapon.SisterWeapon "PoweredHexa-Shotgun"
  Tag "Hexa-Shotgun"
}

ACTOR PoweredHexa-Shotgun : Hexa-Shotgun2
{
  +WEAPON.POWERED_UP
  Weapon.SisterWeapon "Hexa-Shotgun2"
  States
  {
  Ready:
    TNT1 A 0 A_PlayWeaponSound("weapons/pickuphsg")
	XSRS ABCDEF 1
	XSRS GH 2
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAction",1,"GrenadeCheck")
	TNT1 A 0 A_JumpIfInventory("MineAction",1,"MineCheck")
	XSGN A 1 A_WeaponReady
    Goto Ready+9
  Deselect: 
    TNT1 A 0 A_PlayWeaponSound("weapons/weapondown")
	XSGN A 1 A_Lower
    Goto Deselect+1
  Select:
	TNT1 A 0 A_Raise
    Wait
  Fire:
	TNT1 A 0 A_JumpIfInventory("HexaShell",6,"HexaFire")
	TNT1 A 0 A_JumpIfInventory("NewShell",2,1)
	Goto Empty
	TNT1 A 0 A_JumpIfInventory("HexaShell",4,"ReloadTwoShells")
	TNT1 A 0 A_JumpIfInventory("NewShell",4,1)
	Goto Empty
	TNT1 A 0 A_JumpIfInventory("HexaShell",2,"ReloadFourShells")
	Goto Empty
  HexaFire:
	TNT1 A 0 A_PlaySound("weapons/hsgfire")
	TNT1 A 0 A_AlertMonsters
	TNT1 A 0 A_Recoil(4)
    TNT1 A 0 A_GunFlash
	TNT1 A 0 A_Light1
    TNT1 A 0 Radius_Quake(20,5,0,1,0)
	TNT1 A 0 A_TakeInventory("HexaShell",6)	
	TNT1 AAAAAAAAAAAA 0 A_FireCustomMissile("SGTracer",Random(8,-8),0,0,Random(10,-10))
	XS4F A 1 Bright A_FireBullets(11.8,7.3,52,5,"ModdedBulletPuff")
	XS4F A 1 Bright A_FireBullets(13.8,7.3,26,5,"ModdedBulletPuff")
	XS4F B 2 Bright A_Light2
	TNT1 A 0 A_Light0
	XSGN CFG 1
	XSGN H 2
	XSER A 3
	XSER B 6
	XSGN GFEDC 2
  HexaReloadCheck:
  	TNT1 A 0 A_JumpIfInventory("NewShell",6,2)
	XSGN S 2
	Goto Ready+9
	TNT1 A 0
	Goto ReloadSixShells+3
  AltFire:
    TNT1 A 0 A_JumpIfInventory("HexaShell",6,"FireUpper")
    TNT1 A 0 A_JumpIfInventory("HexaShell",4,"FireMiddle")
	TNT1 A 0 A_JumpIfInventory("HexaShell",2,1)
	Goto Reload
    TNT1 A 0 A_PlaySound("weapons/qsgdoublefire")	
    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_GunFlash
	TNT1 A 0 A_Light1
    TNT1 A 0 Radius_Quake(3,3,0,1,0)
	TNT1 A 0 A_TakeInventory("HexaShell",2)
	TNT1 AAAAAAAA 0 A_FireCustomMissile("SGTracer",Random(8,-8),0,0,Random(8,-8))
	XSGF E 2 Bright A_FireBullets(11.2,7.1,20,5,"ModdedBulletPuff")
	XSGF F 2 Bright A_Light2
	TNT1 A 0 A_Light0
	XSRC ABCDE 1
	XSGN A 1
    Goto Ready+9
  FireUpper:
    TNT1 A 0 A_PlaySound("weapons/qsgdoublefire")	
    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_GunFlash
	TNT1 A 0 A_Light1
    TNT1 A 0 Radius_Quake(3,3,0,1,0)
	TNT1 A 0 A_TakeInventory("HexaShell",2)
	TNT1 AAAAAAAA 0 A_FireCustomMissile("SGTracer",Random(8,-8),0,0,Random(8,-8))
	XSGF A 2 Bright A_FireBullets(11.2,7.1,20,5,"ModdedBulletPuff")
	XSGF B 2 Bright A_Light2
	TNT1 A 0 A_Light0
	XSRC ABCDE 1
	XSGN A 1
    Goto Ready+9	
  FireMiddle:
    TNT1 A 0 A_PlaySound("weapons/qsgdoublefire")	
    TNT1 A 0 A_AlertMonsters
    TNT1 A 0 A_GunFlash
	TNT1 A 0 A_Light1
    TNT1 A 0 Radius_Quake(3,3,0,1,0)
	TNT1 A 0 A_TakeInventory("HexaShell",2)
	TNT1 AAAAAAAA 0 A_FireCustomMissile("SGTracer",Random(8,-8),0,0,Random(8,-8))
	XSGF C 2 Bright A_FireBullets(11.2,7.1,20,5,"ModdedBulletPuff")
	XSGF D 2 Bright A_Light2
	TNT1 A 0 A_Light0
	XSRC ABCDE 1
	XSGN A 1
    Goto Ready+9	
  Empty:
	XSGN A 10 A_PlayWeaponSound("weapons/click")
	TNT1 A 0 A_JumpIfInventory("NewShell",6,"ReloadSixShells")
	Goto Ready+9
  Reload:
	TNT1 A 0 A_JumpIfInventory("HexaShell",2,"ReloadTwoShells")
	TNT1 A 0 A_JumpIfInventory("HexaShell",4,"ReloadFourShells")
	TNT1 A 0 A_JumpIfInventory("NewShell",6,"ReloadSixShells")
	Goto Empty	
  ReloadSixShells:
	XSGN SRQ 2
	XSGN PJ 1
	XSGN K 1
	TNT1 AAAAAA 0 A_SpawnItemEx("SSGShellCasing",25,-2,25,Random(2,4),Random(-3,-6),Random(3,6),0)
	XSGN L 1
	XSGR A 12 A_PlayWeaponSound("weapons/qsgopen")
	XSGR B 1
	XSGR CD 2
	TNT1 A 0 A_TakeInventory("NewShell",2)
	TNT1 A 0 A_GiveInventory("HexaShell",2)
	XSGR E 3 A_PlayWeaponSound("weapons/qsgshellslide")
	XSGR F 3
	XSGR G 2
	XSGR H 1
	XSGR I 8
	XSGR JK 1
	XSGR LM 2
	TNT1 A 0 A_TakeInventory("NewShell",2)
	TNT1 A 0 A_GiveInventory("HexaShell",2)
	XSGR N 3 A_PlayWeaponSound("weapons/qsgshellslide")
	XSGR O 3
	XSGR P 2
	XSGR Q 1
	XSGR R 8
	XSGR ST 1
	XSGR U 2
	TNT1 A 0 A_TakeInventory("NewShell",2)
	TNT1 A 0 A_GiveInventory("HexaShell",2)
	XSGR V 3 A_PlayWeaponSound("weapons/qsgshellslide")	
	XSGR W 3
	XSGR X 2
	XSGR Y 1
	XSGN MNO 1
	XSGN P 1 A_PlayWeaponSound("weapons/qsgclose")
	XSGN QRS 2
	XSGN A 2
    Goto Ready+9
  ReloadFourShells:
    TNT1 A 0 A_JumpIfInventory("NewShell",4,1)
	Goto Ready+9
	XSGN SRQ 2
	XSGN P 1
	XSEX A 1
	XSEX B 1
	TNT1 AAAA 0 A_SpawnItemEx("SSGShellCasing",25,-2,25,Random(2,4),Random(-3,-6),Random(3,6),0)
	XSEX C 1
	XSGR I 12 A_PlayWeaponSound("weapons/qsgopen")
	XSGR JK 1
	XSGR LM 2
	TNT1 A 0 A_TakeInventory("NewShell",2)
	TNT1 A 0 A_GiveInventory("HexaShell",2)
	XSGR N 3 A_PlayWeaponSound("weapons/qsgshellslide")	
	XSGR O 3
	XSGR P 2
	XSGR Q 1
	XSGR RS 1
	XSGR TU 2
	TNT1 A 0 A_TakeInventory("NewShell",2)
	TNT1 A 0 A_GiveInventory("HexaShell",2)
	XSGR V 3 A_PlayWeaponSound("weapons/qsgshellslide")	
	XSGR W 3
	XSGR X 2
	XSGR Y 1
	XSGN MNO 1
	XSGN P 1 A_PlayWeaponSound("weapons/qsgclose")
	XSGN QRS 2
	XSGN A 2
	Goto Ready+9
  ReloadTwoShells:
    TNT1 A 0 A_JumpIfInventory("NewShell",2,1)
	Goto Ready+9
	XSGN SRQ 2
	XSGN P 1
	XSEX A 1
	XSEX B 1
	TNT1 AA 0 A_SpawnItemEx("SSGShellCasing",25,-2,25,Random(2,4),Random(-3,-6),Random(3,6),0)
	XSEX C 1
	XSGR Q 12 A_PlayWeaponSound("weapons/qsgopen")
	XSGR RS 1
	XSGR TU 2
	TNT1 A 0 A_TakeInventory("NewShell",2)
	TNT1 A 0 A_GiveInventory("HexaShell",2)
	XSGR V 3 A_PlayWeaponSound("weapons/qsgshellslide")	
	XSGR W 3
	XSGR X 2
	XSGR Y 1
	XSGN MNO 1
	XSGN P 1 A_PlayWeaponSound("weapons/qsgclose")
	XSGN QRS 2
	XSGN A 2
	Goto Ready+9
  GrenadeCheck:
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,"GrenadeToss")
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	Goto Ready+9
  GrenadeToss:
  	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown") 
	XSHT EDCBA 1
	TNT1 A 4
	HGRN ABC 1
	HGRN D 2
	HGRN EFG 1
	HGRN HI 2
	TNT1 A 15 A_PlayWeaponSound("weapons/hgrenadepin")
	TNT1 A 0 A_PlayWeaponSound("weapons/hgrenadethrow")
	TNT1 A 0 A_TakeInventory("HandGrenadeAmmo",1)
	HGNE A 1 A_FireCustomMissile("ThrownGrenade",0,0,0,0)
	HGRN J 1
	HGRN KLM 2
	HGRN NO 1
	TNT1 A 6
	TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,2)
    TNT1 A 0 A_TakeInventory("Hand Grenade",1)
	TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
	TNT1 A 0
	XSHT ABCDE 1
	Goto Ready+9
  MineCheck:
	TNT1 A 0 A_JumpIfInventory("MineAmmo",1,"MineToss")
	TNT1 A 0 A_TakeInventory("MineAction",1)
	Goto Ready+9
  MineToss:
  	TNT1 A 0 A_PlayWeaponSound("weapons/weapondown") 
	XSHT EDCBA 1
	TNT1 A 8
	TNT1 A 0 A_PlayWeaponSound("weapons/hgrenadethrow")
	MINE ABCDEF 1		
	TNT1 A 0 A_TakeInventory("MineAmmo",1)	  
	MINE G 1 A_FireCustomMissile("ThrownMine",0,0,0,0)
	MINE HI 1
	MINE JK 2
	TNT1 A 0 A_JumpIfInventory("MineAmmo",1,2)
    TNT1 A 0 A_TakeInventory("Land Mine",1)
	TNT1 A 0 A_TakeInventory("MineAction",1)
	TNT1 A 0
	TNT1 A 5
	XSHT ABCDE 1
	Goto Ready+9
  Spawn:
	XSGP A -1
    Stop
    }
}