actor "Benelli M4" : RGUWeapon
{
  obituary "%k smacked %o over with the Benelli M4."
  inventory.pickupmessage "You got the Benelli M4 semi-auto shotgun."
  //attacksound "spas/fire"
  weapon.selectionorder 9
  weapon.ammotype "M1014Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M1014Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    BM4A B 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    BM4A CDEF 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	BM4A GHJKLMNOO 2 A_WeaponReady(WRF_ALLOWZOOM)
    BM4A O 0 A_JumpIfNoAmmo("Reload")
	W18A J 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    BM4A O 0 A_JumpIfInventory("Aiming",1,5)
    BM4A O 0 A_JumpIfInventory("Reloading",1,"Reload")
    BM4A O 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    BM4A O 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4A O 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+17
    BM4C E 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    BM4C E 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    BM4C E 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	W18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    BM4C E 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+23
  Deselect:
    BM4A O 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    BM4A O 0 A_TakeInventory("Aiming",1)
    BM4A O 0 A_TakeInventory("Reloading",1)
    BM4A O 0 A_TakeInventory("ReloadingShot",1)
    BM4A O 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    BM4A O 0 A_ZoomFactor(1.0)
    BM4A O 0 A_Lower
    BM4A O 1 A_Lower
    Goto Deselect+6
  Select:
    BM4A A 0
    BM4A A 0 A_TakeInventory("ReloadingShot",1)
    BM4A A 0 A_Raise
    Goto Select+2
  Fire:
    BM4A O 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEndStop")
    BM4A O 0 A_JumpIfInventory("Aiming",1,"FireAim")
    BM4A O 1 A_JumpIfNoAmmo("ReloadStart")
    BM4B B 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    BM4B A 0 A_PlayWeaponSound("m1014/fire")
    BM4B AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,3)
    BM4B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,3)
    BM4B AAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10141", frandom(-7.00,7.00), 0, 0, 4, 0, frandom(-7.00,7.00))
    BM4B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10142", frandom(-7.00,7.00), 0, 0, 4, 0, frandom(-7.00,7.00))
    BM4B A 1 BRIGHT A_FireCustomMissile("HHCBM10142", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	BM4B A 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,14,35-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BM4B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BM4B A 0 BRIGHT A_JumpIfNoAmmo("FireEmpty")
    BM4B B 1 BRIGHT A_GunFlash
    BM4B CDE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4B FGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4B A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+17
    BM4B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireAim:
    BM4C E 1 A_JumpIfNoAmmo("ReloadStart")
    BM4D A 0 A_PlayWeaponSound("m1014/fire")
    BM4D AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,3)
    BM4D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,3)
    BM4D AAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10141", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    BM4D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10142", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    BM4D A 1 BRIGHT A_FireCustomMissile("HHCBM10142", frandom(-2.00,2.00), 1, 0, 4, 0, frandom(-2.00,2.00))
	BM4D A 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BM4D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BM4D A 0 BRIGHT A_JumpIfNoAmmo("FireAimEmpty")
    BM4D B 1 BRIGHT A_GunFlash
    BM4D CDE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4D FGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4D A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+23
    BM4D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireEmpty:
    BM4B B 1 BRIGHT A_GunFlash
    BM4B CDE 1
    BM4B FGH 1
    BM4B A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+17
    BM4B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireAimEmpty:
    BM4D B 1 BRIGHT A_GunFlash
    BM4D CDE 1
    BM4D FGH 1
    BM4D A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+17
    BM4D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  Reload: //AltFire:
    BM4A A 0 A_JumpIfInventory("M1014Clip",5,2)
    BM4A A 0 A_JumpIfInventory("M1014Ammo",1,"ReloadStart")
    BM4A A 0 A_TakeInventory("Reloading",1)
    BM4A A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+20
  ReloadStart:
    BM4E A 0 A_JumpIfInventory("M1014Clip",2,2)
    BM4E A 0 ACS_NamedExecuteAlways("RefSpeak",0,4,0,0)
    BM4E A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    BM4E A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    BM4E A 3 A_GiveInventory("ReloadingShot",1)
    BM4E BC 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4E DE 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo
  ReloadAmmo:
    BM4E X 0 A_JumpIfInventory("M1014Clip",5,"ReloadEnd")
    BM4E X 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto ReloadEnd
    BM4E FG 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4E H 0 A_GiveInventory("M1014Clip",1)
    BM4E H 0 A_TakeInventory("M1014Ammo",1)
    BM4E H 3 A_PlaySoundEx("m1014/insert","SoundSlot6")
    BM4E IJK 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4E L 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto ReloadAmmo
  ReloadEndStop:
    BM4E M 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadEnd_SOH")
  ReloadEnd:
    BM4E MNO 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BM4E PQ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4E Q 0 A_TakeInventory("ReloadingShot",1)
    BM4E Q 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+17
  Zoom:
  PostReloadAlt:
    BM4C E 0 A_ZoomFactor(1.2)
    BM4C D 0 A_GiveInventory("Aiming",1)
	BM4C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    BM4C ABCDE 1
    Goto AltHold
  ReloadBreak:
    BM4C E 0 A_ZoomFactor(1.0)
    BM4C ED 1
    BM4C D 0 A_TakeInventory("Aiming",1)
    BM4C CBA 1
    BM4C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  ClearRefire: 
    BM4C E 1 A_ClearReFire
	Goto AltHold
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M1014Clip",1,1)
	Goto ReloadBreak
    BM4D A 0 A_PlayWeaponSound("m1014/fire")
	BM4E Q 0 A_TakeInventory("M1014Clip",1)
    BM4D AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,3)
    BM4D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,3)
    BM4D AAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10141", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    BM4D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10142", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    BM4D A 1 BRIGHT A_FireCustomMissile("HHCBM10142", frandom(-2.00,2.00), 1, 0, 4, 0, frandom(-2.00,2.00))
	BM4D A 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BM4D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BM4D B 1 BRIGHT A_GunFlash
    BM4D C 1
    "####" "#" 0 A_JumpIfInventory("M1014Clip",1,1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  AltHold:
    A12C C 0 A_JumpIfInventory("FireHeld",1,"ClearRefire")
    BM4C E 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
	A12C C 0 A_JumpIfInventory("FireHeld",1,"FireAimAltHold")
	A12C C 0 A_JumpIfInventory("Reloading",1,"ReloadBreak")
	U45A L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U45A L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
	A12C F 0 A_Refire("AltHold")
	A12C C 0 A_JumpIfInventory("Aiming",1,"AltFire2")
	Goto Ready+23
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    BM4C A 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEnd")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    BM4C A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    BM4C A 0 A_ZoomFactor(1.2)
    BM4C AB 1
    BM4C B 0 A_GiveInventory("Aiming",1)
    BM4C CDE 1
    BM4C E 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	A12C F 0 A_Refire("AltHold")
    Goto Ready+23
  AltFire2:
    BM4C E 0 A_ZoomFactor(1.0)
    BM4C ED 1
    BM4C D 0 A_TakeInventory("Aiming",1)
    BM4C CBA 1
    BM4C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto Ready+17
  AltFire3:
    BM4C E 0 A_ZoomFactor(1.0)
    BM4C ED 1
    BM4C D 0 A_TakeInventory("Aiming",1)
    BM4C CBA 1
    BM4C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	goto DropWeapon
  ReloadStartAim:
    BM4C E 0 A_ZoomFactor(1.0)
    BM4C ED 1
    BM4C D 0 A_TakeInventory("Aiming",1)
    BM4C CBA 1
    BM4C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+3
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    WEP2 F 0
    WEP2 F 0 A_SpawnItem("M1014Drop")
    stop
  ReloadStart_SOH:
    BM4E A 2 A_GiveInventory("ReloadingShot",1)
    BM4E BC 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4E DE 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    BM4E X 0 A_JumpIfInventory("M1014Clip",5,"ReloadEnd_SOH")
    BM4E X 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto ReloadEnd_SOH
    BM4E FG 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4E H 0 A_GiveInventory("M1014Clip",1)
    BM4E H 0 A_TakeInventory("M1014Ammo",1)
    BM4E H 2 A_PlaySoundEx("m1014/insert","SoundSlot6")
    BM4E IJK 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4E L 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    BM4E MNO 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BM4E PQ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4E Q 0 A_TakeInventory("ReloadingShot",1)
    BM4E Q 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+17
  Fire_SteadyAim:
    BM4B A 0 A_PlayWeaponSound("m1014/fire")
    BM4B AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,3)
    BM4B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,3)
    BM4B AAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10141", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-6.00,6.00))
    BM4B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10142", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-6.00,6.00))
    BM4B A 1 BRIGHT A_FireCustomMissile("HHCBM10142", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-6.00,6.00))
	BM4B A 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,14,35-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BM4B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BM4B A 0 BRIGHT A_JumpIfNoAmmo("FireEmpty")
    BM4B B 1 BRIGHT A_GunFlash
    BM4B CDE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4B FGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4B A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+17
    BM4B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FragGrenade:
    U45F A 0 ACS_NamedExecuteAlways("RefSpeak",0,1,0,0)
    U45F A 0 A_ZoomFactor(1.0)
    U45A L 0 A_TakeInventory("Aiming",1)
    U45A L 0 A_TakeInventory("Reloading",1)
    U45A L 0 A_TakeInventory("ReloadingShot",1)
    U45F A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	M4CA J 0 A_JumpIfInventory("ThrowingStun",1,"StunGrenade")
	M4CA J 0 A_JumpIfInventory("ThrowingIncd",1,"IncGrenade")
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"FragGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 2
    TNT1 A 15
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("GrenadeAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("FragGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  FragGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("GrenadeAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("FragGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    U45F A 0 A_ZoomFactor(1.0)
    U45A L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    U45A L 0 A_TakeInventory("Aiming",1)
    U45A L 0 A_TakeInventory("Reloading",1)
    U45A L 0 A_TakeInventory("ReloadingShot",1)
    U45F A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"KnifeAttack_SOH")
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_Commando")
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    KNFA DEFGHIJKL 1
    TNT1 A 20
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_Commando:
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    KNFA DEFGHIJKL 1
    TNT1 A 20
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH:
    U45C A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_SOH_Commando")
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    KNFA DEFGHIJKL 1
    TNT1 A 10
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH_Commando:
    KNFA A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    KNFA AB 1
    KNFA B 0 A_PlaySound("knife/swing")
    KNFA C 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    KNFA DEFGHIJKL 1
    TNT1 A 10
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  StunGrenade:
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"StunGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 2
    TNT1 A 15
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("StunAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("StunGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  IncGrenade:
    U45A L 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"IncGrenade_SOH")
    GRNA ABC 2
    GRNA D 2 A_PlaySound("grenade/pinpull")
    GRNA EFGH 2
    TNT1 A 15
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 2
    GRNA L 0 A_TakeInventory("IncdAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 2 A_FireCustomMissile("IncGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  StunGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("StunAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("StunGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  IncGrenade_SOH:
    GRNA ABC 1
    GRNA D 1 A_PlaySound("grenade/pinpull")
    GRNA EFGH 1
    TNT1 A 10
    TNT1 A 0 A_PlaySound("grenade/throw")
    GRNA A 0 A_PlaySoundEx("us/grenades","Voice")
    GRNA IJK 1
    GRNA L 0 A_TakeInventory("IncdAmmo",1)
    GRNA L 0 A_TakeInventory("ThrowingGrenade",1)
	GRNA L 0 A_TakeInventory("ThrowingStun",1)
	GRNA L 0 A_TakeInventory("ThrowingIncd",1)
    U45A L 0 A_TakeInventory("Aiming",1)
    GRNA L 0 A_TakeInventory("KnifeAttack",1)
    GRNA L 1 A_FireCustomMissile("IncGrenade",frandom(-2.00,2.00),0,0,16,0,frandom(-1.50,1.50))
    GRNA MN 1
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  DropWeapon:
    BM4A NMLKJIHGFEDCB 2 A_WeaponReady(WRF_NOPRIMARY)
	BM4A A 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CC F 0 A_JumpIfInventory("weapondropper",2,"ThrowWeapon")
    KNFA A 0 ACS_NamedExecuteAlways("RefDropW",0,0,0,0)
	GRNA L 0 A_TakeInventory("weapondropper",1)
	M4CB A 0 A_FireCustomMissile("M1014Dropped",0,0,7,2)
	stop
  ThrowWeapon:
    GRNA IKMN 1
	KNFA B 0 A_PlaySound("knife/swing")
    KNFA A 0 ACS_NamedExecuteAlways("RefDropW",0,0,0,0)
	GRNA L 0 A_TakeInventory("weapondropper",2)
	M4CB A 0 A_FireCustomMissile("M1014Thrown",0,0,7,2)
	stop
  }
}
actor M1014Clip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 5
    ammo.backpackamount 0
    ammo.backpackmaxamount 5
    +IGNORESKILL
}
actor "Benelli M4 Ex Mags" : "Benelli M4"
{
  obituary "%k smacked %o over with the Benelli M4."
  inventory.pickupmessage "You got the Benelli M4 semi-auto shotgun."
  //attacksound "spas/fire"
  weapon.selectionorder 9
  weapon.ammotype "M1014Clip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M1014Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    BM4A B 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    BM4A CDEF 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	BM4A GHJKLMNOO 2 A_WeaponReady(WRF_ALLOWZOOM)
    BM4A O 0 A_JumpIfNoAmmo("Reload")
	W18A J 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    BM4A O 0 A_JumpIfInventory("Aiming",1,5)
    BM4A O 0 A_JumpIfInventory("Reloading",1,"Reload")
    BM4A O 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    BM4A O 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4A O 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+17
    BM4C E 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    BM4C E 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    BM4C E 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	W18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    BM4C E 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+23
  Reload: //AltFire:
    BM4A A 0 A_JumpIfInventory("M1014Clip2",7,2)
    BM4A A 0 A_JumpIfInventory("M1014Ammo",1,"ReloadStart")
    BM4A A 0 A_TakeInventory("Reloading",1)
    BM4A A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+20
  ReloadStart:
    BM4E A 0 A_JumpIfInventory("M1014Clip2",3,2)
    BM4E A 0 ACS_NamedExecuteAlways("RefSpeak",0,4,0,0)
    BM4E A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    BM4E A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    BM4E A 3 A_GiveInventory("ReloadingShot",1)
    BM4E BC 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4E DE 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo
  ReloadAmmo:
    BM4E X 0 A_JumpIfInventory("M1014Clip2",7,"ReloadEnd")
    BM4E X 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto ReloadEnd
    BM4E FG 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4E H 0 A_GiveInventory("M1014Clip2",1)
    BM4E H 0 A_TakeInventory("M1014Ammo",1)
    BM4E H 3 A_PlaySoundEx("m1014/insert","SoundSlot6")
    BM4E IK 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4E L 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto ReloadAmmo
  ReloadEnd:
    BM4E MNO 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BM4E PQ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4E Q 0 A_TakeInventory("ReloadingShot",1)
    BM4E Q 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+17
  ReloadStartAim:
    BM4C E 0 A_ZoomFactor(1.0)
    BM4C ED 1
    BM4C D 0 A_TakeInventory("Aiming",1)
    BM4C CBA 1
    BM4C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+3
  ReloadStart_SOH:
    BM4E A 2 A_GiveInventory("ReloadingShot",1)
    BM4E BC 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4E DE 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    BM4E X 0 A_JumpIfInventory("M1014Clip2",7,"ReloadEnd_SOH")
    BM4E X 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto ReloadEnd_SOH
    BM4E FG 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4E H 0 A_GiveInventory("M1014Clip2",1)
    BM4E H 0 A_TakeInventory("M1014Ammo",1)
    BM4E H 2 A_PlaySoundEx("m1014/insert","SoundSlot6")
    BM4E IK 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4E L 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    BM4E MNO 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    BM4E PQ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    BM4E Q 0 A_TakeInventory("ReloadingShot",1)
    BM4E Q 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+17
  ReloadBreak:
    BM4C E 0 A_ZoomFactor(1.0)
    BM4C ED 1
    BM4C D 0 A_TakeInventory("Aiming",1)
    BM4C CBA 1
    BM4C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M1014Clip2",1,1)
	Goto ReloadBreak
    BM4D A 0 A_PlayWeaponSound("m1014/fire")
	BM4E Q 0 A_TakeInventory("M1014Clip2",1)
    BM4D AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,3)
    BM4D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,3)
    BM4D AAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10141", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    BM4D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10142", frandom(-2.00,2.00), 0, 0, 4, 0, frandom(-2.00,2.00))
    BM4D A 1 BRIGHT A_FireCustomMissile("HHCBM10142", frandom(-2.00,2.00), 1, 0, 4, 0, frandom(-2.00,2.00))
	BM4D A 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BM4D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BM4D B 1 BRIGHT A_GunFlash
    BM4D C 1
    "####" "#" 0 A_JumpIfInventory("M1014Clip2",1,1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  }
}
actor M1014Clip2 : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 7
    ammo.backpackamount 0
    ammo.backpackmaxamount 7
    +IGNORESKILL
}
actor M1014ExMags : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor "Benelli M4 Grip" : "Benelli M4"
{
  obituary "%k smacked %o over with the Benelli M4."
  inventory.pickupmessage "You got the Benelli M4 semi-auto shotgun."
  //attacksound "spas/fire"
  weapon.selectionorder 9
  weapon.ammotype "M1014Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M1014Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Fire:
    BM4A O 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEndStop")
    BM4A O 0 A_JumpIfInventory("Aiming",1,"FireAim")
    BM4A O 1 A_JumpIfNoAmmo("ReloadStart")
    BM4B B 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    BM4B A 0 A_PlayWeaponSound("m1014/fire")
    BM4B AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,3)
    BM4B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,3)
    BM4B AAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10141G", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-6.00,6.00))
    BM4B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10142G", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-6.00,6.00))
    BM4B A 1 BRIGHT A_FireCustomMissile("HHCBM10142G", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-6.00,6.00))
	BM4B A 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,14,35-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BM4B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BM4B A 0 BRIGHT A_JumpIfNoAmmo("FireEmpty")
    BM4B B 1 BRIGHT A_GunFlash
    BM4B CDE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4B FGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4B A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+17
    BM4B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireAim:
    BM4C E 1 A_JumpIfNoAmmo("ReloadStart")
    BM4D A 0 A_PlayWeaponSound("m1014/fire")
    BM4D AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,3)
    BM4D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,3)
    BM4D AAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10141G", frandom(-1.50,1.50), 0, 0, 4, 0, frandom(-1.50,1.50))
    BM4D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10142G", frandom(-1.50,1.50), 0, 0, 4, 0, frandom(-1.50,1.50))
    BM4D A 1 BRIGHT A_FireCustomMissile("HHCBM10142G", frandom(-1.50,1.50), 1, 0, 4, 0, frandom(-1.50,1.50))
	BM4D A 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BM4D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BM4D A 0 BRIGHT A_JumpIfNoAmmo("FireAimEmpty")
    BM4D B 1 BRIGHT A_GunFlash
    BM4D CDE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4D FGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4D A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+23
    BM4D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  Fire_SteadyAim:
    BM4B A 0 A_PlayWeaponSound("m1014/fire")
    BM4B AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,3)
    BM4B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,3)
    BM4B AAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10141G", frandom(-4.00,4.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    BM4B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10142G", frandom(-4.00,4.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    BM4B A 1 BRIGHT A_FireCustomMissile("HHCBM10142G", frandom(-4.00,4.00), 1, 0, 4, 0, frandom(-4.00,4.00))
	BM4B A 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,14,35-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BM4B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BM4B A 0 BRIGHT A_JumpIfNoAmmo("FireEmpty")
    BM4B B 1 BRIGHT A_GunFlash
    BM4B CDE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4B FGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4B A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+17
    BM4B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  ReloadBreak:
    BM4C E 0 A_ZoomFactor(1.0)
    BM4C ED 1
    BM4C D 0 A_TakeInventory("Aiming",1)
    BM4C CBA 1
    BM4C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  ClearRefire: 
    BM4C E 1 A_ClearReFire
	Goto AltHold
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M1014Clip",1,1)
	Goto ReloadBreak
    BM4D A 0 A_PlayWeaponSound("m1014/fire")
	BM4E Q 0 A_TakeInventory("M1014Clip",1)
    BM4D AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,3)
    BM4D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,3)
    BM4D AAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10141G", frandom(-1.50,1.50), 0, 0, 4, 0, frandom(-1.50,1.50))
    BM4D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCBM10142G", frandom(-1.50,1.50), 0, 0, 4, 0, frandom(-1.50,1.50))
    BM4D A 1 BRIGHT A_FireCustomMissile("HHCBM10142G", frandom(-1.50,1.50), 1, 0, 4, 0, frandom(-1.50,1.50))
	BM4D A 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BM4D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BM4D B 1 BRIGHT A_GunFlash
    BM4D C 1 
    "####" "#" 0 A_JumpIfInventory("M1014Clip",1,1)
	Goto ReloadBreak
	TNT1 A 0
    Goto AltHold
  }
}
actor M1014Grip : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor "Benelli M4 Dragon" : "Benelli M4"
{
  obituary "%k lit %o on fire with the Benelli M4."
  inventory.pickupmessage "You got the Benelli M4 semi-auto shotgun."
  //attacksound "spas/fire"
  weapon.selectionorder 9
  weapon.ammotype "M1014Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M1014Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Fire:
    BM4A O 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEndStop")
    BM4A O 0 A_JumpIfInventory("Aiming",1,"FireAim")
    BM4A O 1 A_JumpIfNoAmmo("ReloadStart")
    BM4B A 0 A_PlayWeaponSound("m1014/fire")
    BM4D A 0 A_PlaySound("dragon/fire")
    BM4B AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,3)
    BM4B AA 0 A_FireCustomMissile("FlameThrowerFireLight3",frandom(-9.00,11.00),0,6,random(0,6),0,frandom(-10.00,11.00))
    BM4B AAAA 0 A_FireCustomMissile("FlameThrowerFireLight",frandom(-10.00,12.00),0,6,random(-1,7),0,frandom(-11.00,12.00))
    BM4B AAA 0 A_FireCustomMissile("FlameThrowerFireLight2",frandom(-10.00,12.00),0,6,random(-1,7),0,frandom(-11.00,12.00))
    BM4B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,3)
    BM4B AAA 0 BRIGHT A_FireCustomMissile("HHCBM10141D", frandom(-7.00,7.00), 0, 0, 4, 0, frandom(-7.00,7.00))
    BM4B AA 0 BRIGHT A_FireCustomMissile("HHCBM10142D", frandom(-7.00,7.00), 0, 0, 4, 0, frandom(-7.00,7.00))
    BM4B A 1 BRIGHT A_FireCustomMissile("HHCBM10142D", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	BM4B A 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,14,35-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BM4B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BM4B A 0 BRIGHT A_JumpIfNoAmmo("FireEmpty")
    BM4B A 0 BRIGHT A_JumpIfInventory("CoopCheck",1,"FireCoopCont")
  FireCont:
    BM4B B 1 BRIGHT A_GunFlash
    BM4B C 1
    BM4B DE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4B FGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4B A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+17
    BM4B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireCoopCont:
    BM4B B 1 BRIGHT A_GunFlash
    BM4B CDE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4B FGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4B A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+17
    BM4B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireEmpty:
    BM4B B 1 BRIGHT A_GunFlash
    BM4B CDE 1
    BM4B FGH 1
    BM4B A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+17
    BM4B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  FireAim:
    BM4C E 1 A_JumpIfNoAmmo("ReloadStart")
    BM4D A 0 A_PlayWeaponSound("m1014/fire")
    BM4D A 0 A_PlaySound("dragon/fire")
    BM4D AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,3)
    BM4D AA 0 A_FireCustomMissile("FlameThrowerFireLight3",frandom(-8.00,8.00),0,0,random(0,6),0,frandom(-8.00,9.00))
    BM4D AAAA 0 A_FireCustomMissile("FlameThrowerFireLight",frandom(-9.00,9.00),0,0,random(-1,7),0,frandom(-9.00,10.00))
    BM4D AAA 0 A_FireCustomMissile("FlameThrowerFireLight2",frandom(-9.00,9.00),0,0,random(-1,7),0,frandom(-9.00,10.00))
    BM4D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,3)
    BM4D AAA 0 BRIGHT A_FireCustomMissile("HHCBM10141D", frandom(-2.50,2.50), 0, 0, 4, 0, frandom(-2.50,2.50))
    BM4D AA 0 BRIGHT A_FireCustomMissile("HHCBM10142D", frandom(-2.50,2.50), 0, 0, 4, 0, frandom(-2.50,2.50))
    BM4D A 1 BRIGHT A_FireCustomMissile("HHCBM10142D", frandom(-2.50,2.50), 1, 0, 4, 0, frandom(-2.50,2.50))
	BM4D A 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BM4D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    BM4D A 0 BRIGHT A_JumpIfNoAmmo("FireAimEmpty")
    BM4B A 0 BRIGHT A_JumpIfInventory("CoopCheck",1,"FireAimCoopCont")
  FireAimCont:
    BM4D B 1 BRIGHT A_GunFlash
    BM4D C 1
    BM4D DE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4D FGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4D A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+23
    BM4D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireAimCoopCont:
    BM4D B 1 BRIGHT A_GunFlash
    BM4D CDE 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4D FGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    BM4D A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+23
    BM4D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+23
  FireAimEmpty:
    BM4D B 1 BRIGHT A_GunFlash
    BM4D CDE 1
    BM4D FGH 1
    BM4D A 0 A_JumpIfInventory("M1014Ammo",1,1)
    Goto Ready+17
    BM4D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+17
  ReloadBreak:
    BM4C E 0 A_ZoomFactor(1.0)
    BM4C ED 1
    BM4C D 0 A_TakeInventory("Aiming",1)
    BM4C CBA 1
    BM4C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  ClearRefire: 
    BM4C E 1 A_ClearReFire
	Goto AltHold
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M1014Clip",1,1)
	Goto ReloadBreak
    BM4D A 0 A_PlayWeaponSound("m1014/fire")
	BM4E Q 0 A_TakeInventory("M1014Clip",1)
    BM4D A 0 A_PlaySound("dragon/fire")
    BM4D AA 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,3)
    BM4D AA 0 A_FireCustomMissile("FlameThrowerFireLight3",frandom(-8.00,8.00),0,0,random(0,6),0,frandom(-8.00,9.00))
    BM4D AAAA 0 A_FireCustomMissile("FlameThrowerFireLight",frandom(-9.00,9.00),0,0,random(-1,7),0,frandom(-9.00,10.00))
    BM4D AAA 0 A_FireCustomMissile("FlameThrowerFireLight2",frandom(-9.00,9.00),0,0,random(-1,7),0,frandom(-9.00,10.00))
    BM4D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,3)
    BM4D AAA 0 BRIGHT A_FireCustomMissile("HHCBM10141D", frandom(-2.50,2.50), 0, 0, 4, 0, frandom(-2.50,2.50))
    BM4D AA 0 BRIGHT A_FireCustomMissile("HHCBM10142D", frandom(-2.50,2.50), 0, 0, 4, 0, frandom(-2.50,2.50))
    BM4D A 1 BRIGHT A_FireCustomMissile("HHCBM10142D", frandom(-2.50,2.50), 1, 0, 4, 0, frandom(-2.50,2.50))
	BM4D A 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,-2,32-(Sin(Pitch)*25),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    BM4D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
	"####" "#" 0 A_JumpIfInventory("M1014Clip",1,1)
	Goto ReloadBreak
	BM4D B 1 BRIGHT A_GunFlash
    BM4D C 1
	Goto AltHold
  }
}
actor M1014Dragon : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor M1014Pickup : CustomInventory
{
  inventory.pickupmessage "You got the Benelli M4 semi-auto shotgun."
  inventory.pickupsound "spas/pump"
  +INVENTORY.AUTOACTIVATE
  //inventory.respawntics 70
  scale 0.12
  States
  {
  Spawn:
    WEP2 F -1
    stop
  Pickup:
    WEP2 F 0
    WEP2 F 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",0,0,0)) == 1, "PickupStay")
    WEP2 F 0 A_JumpIfInventory("Benelli M4",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 F 0 A_JumpIfInventory("Benelli M4 Ex Mags",1,"AmmoPickup")
    WEP2 F 0 A_JumpIfInventory("Benelli M4 Grip",1,"AmmoPickup")
    WEP2 F 0 A_JumpIfInventory("Benelli M4 Dragon",1,"AmmoPickup")
    WEP2 F 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 F 0 A_JumpIfInventory("MaxWeaponsFilled",80,"FailPickup2")
	WEP2 F 0 A_GiveInventory("MaxWeaponsFilled",21)
    WEP2 F 0 ACS_NamedExecuteWithResult("RefPickU",32,0,0)
    stop
  PickupStay:
    WEP2 F 0
    WEP2 F 0 A_JumpIfInventory("Benelli M4",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 F 0 A_JumpIfInventory("Benelli M4 Ex Mags",1,"FailPickup")
    WEP2 F 0 A_JumpIfInventory("Benelli M4 Grip",1,"FailPickup")
    WEP2 F 0 A_JumpIfInventory("Benelli M4 Dragon",1,"FailPickup")
    WEP2 F 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 F 0 A_JumpIfInventory("MaxWeaponsFilled",80,"FailPickup2")
	WEP2 F 0 A_GiveInventory("MaxWeaponsFilled",21)
    WEP2 F 0 ACS_NamedExecuteWithResult("RefPickU",32,0,0)
    WEP2 F 0 ACS_NamedExecuteWithResult("RefPickC",32,0,0)
    WEP2 F 0 A_PlaySound("spas/pump")
    fail
  AmmoPickup:
    WEP2 F 0
    WEP2 F 0 A_JumpIfInventory("M1014Ammo",0,"FailPickup")
    WEP2 F 0 A_GiveInventory("M1014Ammo",10)
    stop
  OneManArmy:
    WEP2 F 0
	WEP2 F 0 A_JumpIfInventory("MaxWeaponsFilled",117,"FailPickup2")
	WEP2 F 0 A_GiveInventory("MaxWeaponsFilled",21)
	WEP2 F 0 ACS_NamedExecuteWithResult("RefPickU",32,0,0)
	stop
  FailPickup:
    WEP2 F 1
    fail
  FailPickup2:
    WEP2 F 1
    WEP2 F 0 ACS_NamedExecuteAlways("RefSlots",0,15,0,0)
    fail
  }
}

actor M1014Drop : M1014Pickup
{
  States
  {
  Spawn:
    WEP2 F -1
    stop
  Pickup:
    WEP2 F 0
    WEP2 F 0 A_JumpIfInventory("Benelli M4",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 F 0 A_JumpIfInventory("Benelli M4 Ex Mags",1,"AmmoPickup")
    WEP2 F 0 A_JumpIfInventory("Benelli M4 Grip",1,"AmmoPickup")
    WEP2 F 0 A_JumpIfInventory("Benelli M4 Dragon",1,"AmmoPickup")
    WEP2 F 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 F 0 A_JumpIfInventory("MaxWeaponsFilled",80,"FailPickup2")
	WEP2 F 0 A_GiveInventory("MaxWeaponsFilled",21)
    WEP2 F 0 ACS_NamedExecuteWithResult("RefPickU",32,0,0)
    stop
  }
}

actor M1014Drop2 : M1014Drop
{
  States
  {
  Spawn:
    WEP2 F -1
    stop
  Pickup:
    WEP2 F 0
    WEP2 F 0 A_JumpIfInventory("Benelli M4",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 F 0 A_JumpIfInventory("Benelli M4 Ex Mags",1,"AmmoPickup")
    WEP2 F 0 A_JumpIfInventory("Benelli M4 Grip",1,"AmmoPickup")
    WEP2 F 0 A_JumpIfInventory("Benelli M4 Dragon",1,"AmmoPickup")
    WEP2 F 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 F 0 A_JumpIfInventory("MaxWeaponsFilled",80,"FailPickup2")
	WEP2 F 0 A_GiveInventory("MaxWeaponsFilled",21)
    WEP2 F 0 ACS_NamedExecuteWithResult("RefPickU",32,0,0)
    stop
  AmmoPickup:
    WEP2 F 0
    stop
  }
}

actor HHCBM10141 : HHBullet
{
  damage (random(12,14))
  Speed 200
  decal none
  damagetype "Shotgungib"
  -NOEXTREMEDEATH
  states
  {
  Spawn:
    TNT1 A 1
    TNT1 A 1 A_ScaleVelocity(0.6)
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff_2", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    stop
  XDeath:
    TNT1 A 5 A_PlaySound("generic/ricochets")
    stop
  Crash:
	TNT1 A 0 A_Jump(40,2)
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff_3", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    stop
  }
}
actor HHCBM10142 : HHCBM10141
{
  damage (random(12,14))
  Speed 200
  decal ShotChip
  damagetype "Shotgun"
  +NOEXTREMEDEATH
  states
  {
  Spawn:
    TNT1 A 7
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff_2", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    stop
  XDeath:
	TNT1 A 0 A_Jump(160,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 5 A_PlaySound("generic/ricochets")
    stop
  Crash:
	TNT1 A 0 A_Jump(160,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
	TNT1 A 0 A_Jump(40,2)
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff_3", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    stop
  }
}

actor HHCBM10141G : HHCBM10141
{
  damage (random(12,18))
  Speed 240
}
actor HHCBM10142G : HHCBM10142
{
  damage (random(12,18))
  Speed 240
}

actor HHCBM10141D : HHBullet
{
  damage (random(10,14))
  Speed 200
  decal none
  +FORCERADIUSDMG
  damagetype "Dragon"
  states
  {
  Spawn:
    TNT1 A 2
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("FireballPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_PlaySound("generic/ricochet")
    TNT1 AA 12 A_Explode(2,32,0)
    stop
  XDeath:
	TNT1 A 0 A_Jump(136,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 0 A_SpawnItemEx("FireballPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
	TNT1 A 0 A_Jump(28,2)
    TNT1 A 0 A_PlaySound("generic/ricochets")
    TNT1 AA 12 A_Explode(2,32,0)
    stop
  Crash:
	TNT1 A 0 A_Jump(136,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 0 A_SpawnItemEx("FireballPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_PlaySound("generic/ricochet")
    TNT1 AA 12 A_Explode(2,32,0)
    stop
  }
}
actor HHCBM10142D : HHCBM10141D
{
  damage (random(10,18))
  Speed 200
  decal none
  +FORCERADIUSDMG
  damagetype "Dragon"
  states
  {
  Spawn:
    TNT1 A 2
    TNT1 A 2 A_ScaleVelocity(0.75)
    TNT1 A 1
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("FireballPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_PlaySound("generic/ricochet")
    TNT1 AA 12 A_Explode(2,32,0)
    stop
  XDeath:
	TNT1 A 0 A_Jump(136,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 0 A_SpawnItemEx("FireballPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
	TNT1 A 0 A_Jump(28,2)
    TNT1 A 0 A_PlaySound("generic/ricochets")
    TNT1 AA 12 A_Explode(2,32,0)
    stop
  Crash:
	TNT1 A 0 A_Jump(136,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 0 A_SpawnItemEx("FireballPuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 0 A_PlaySound("generic/ricochet")
    TNT1 AA 12 A_Explode(2,32,0)
    stop
  }
}