actor "Model 1887" : RGUWeapon
{
  obituary "%k made sure %o felt 1887 times."
  inventory.pickupmessage "You got the Model 1887 lever-action shotgun. Terminate them all!"
  //attacksound "spas/fire"
  weapon.selectionorder 9
  weapon.ammotype "M1887Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M1887Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    W18A A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    W18A BC 3 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	W18A DEFGHI 3 A_WeaponReady(WRF_ALLOWZOOM)
    W18A J 2 A_WeaponReady(WRF_ALLOWZOOM)
	G18A I 0 A_JumpIfInventory("M1887Token",1,"Reload")
    W18A J 0 A_JumpIfNoAmmo("Reload")
	W18A J 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    W18A J 0 A_JumpIfInventory("Aiming",1,5)
    W18A J 0 A_JumpIfInventory("Reloading",1,"Reload")
    W18A J 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    W18A J 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18A J 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+14
    W18C F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    W18C F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    W18C F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	W18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    W18C F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+20
  Deselect:
    W18A J 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    W18A J 0 A_TakeInventory("Aiming",1)
    W18A J 0 A_TakeInventory("Reloading",1)
    W18A J 0 A_TakeInventory("ReloadingShot",1)
    W18A J 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    W18A J 0 A_ZoomFactor(1.0)
    W18A J 0 A_Lower
    W18A J 1 A_Lower
    Goto Deselect+6
  Select:
    W18A A 0
    W18A A 0 A_TakeInventory("ReloadingShot",1)
    W18A A 0 A_Raise
    Goto Select+2
  Fire:
    W18E X 0 A_TakeInventory("M1887Token",1)
    W18A P 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEnd")
    W18A P 0 A_JumpIfInventory("Aiming",1,"FireAim")
    W18A J 1 A_JumpIfNoAmmo("ReloadStart")
    W18B B 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
	W18B B 0 A_JumpIfInventory("M1887Clip",2,1)
	Goto FireEmpty
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    W18B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-5.00,5.00))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B G 2
    W18B H 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18B IJKL 2
	W18B L 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18B M 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18B NOPQ 2
    W18B RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireEmpty:
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    W18B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-5.00,5.00))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireAim:
    W18C F 1 A_JumpIfNoAmmo("ReloadStart")
	W18C F 0 A_JumpIfInventory("M1887Clip",2,1)
	Goto FireAimEmpty
    W18D A 0 A_PlayWeaponSound("m1887/fire")
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-1.95,1.95), 0, 0, 4, 0, frandom(-1.95,1.95))
    W18D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.95,1.95), 0, 0, 4, 0, frandom(-1.95,1.95))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.95,1.95), 1, 0, 4, 0, frandom(-1.95,1.95))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 2 BRIGHT
    W18D CDEF 2
    W18D G 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18D HIJK 2
	W18D K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18D L 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18D MNOPQ 2
    W18D RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18D A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+20
    W18D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+20
  FireAimEmpty:
    W18D A 0 A_PlayWeaponSound("m1887/fire")
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-1.60,1.60), 0, 0, 4, 0, frandom(-1.60,1.60))
    W18D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.60,1.60), 0, 0, 4, 0, frandom(-1.60,1.60))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.60,1.60), 1, 0, 4, 0, frandom(-1.60,1.60))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 2 BRIGHT
    W18D CDEF 2
    W18D A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+20
    W18D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+20
  Reload: //AltFire:
    W18E A 0 A_JumpIfInventory("M1887Clip",7,2)
    W18E A 0 A_JumpIfInventory("M1887Ammo",1,"ReloadStart")
    W18E A 0 A_TakeInventory("Reloading",1)
    W18E A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+17
  ReloadStart:
    W18E A 0 A_JumpIfInventory("M1887Clip",5,2)
    W18E A 0 ACS_NamedExecuteAlways("RefSpeak",0,4,0,0)
    W18E A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    W18E A 0 A_JumpIfInventory("M1887Clip",1,"ReloadStartFull")
    W18E A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	W18E A 0 A_JumpIfInventory("M1887Token",1,"Reload2")
    W18E B 3 A_GiveInventory("ReloadingShot",1)
    W18E C 3 A_PlaySoundEx("m1887/open","SoundSlot5")
	W18E C 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	W18E B 0 A_GiveInventory("M1887Token",1)
	W18E DEFGHI 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	Goto Reload2
  Reload2:
    W18E B 0 A_GiveInventory("ReloadingShot",1)
    W18E JKLMN 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E O 0 A_GiveInventory("M1887Clip",1)
    W18E O 0 A_TakeInventory("M1887Ammo",1)
    W18E O 3 A_PlaySoundEx("m1887/insert","SoundSlot5")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E QR 3
    W18E STU 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18E X 0 A_JumpIfInventory("M1887Clip",7,"ReloadEnd")
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,"ReloadAmmo")
    Goto ReloadEnd
  ReloadAmmo:
    W18E X 0 A_JumpIfInventory("M1887Clip",7,"ReloadEnd")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto ReloadEnd
    W18F KLM 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F N 0 A_GiveInventory("M1887Clip",1)
    W18F N 0 A_TakeInventory("M1887Ammo",1)
    W18F N 3 A_PlaySoundEx("m1887/insert","SoundSlot6")
    W18E QR 3
    W18E STU 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    Goto ReloadAmmo
  ReloadEnd:
    W18E A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadEnd_SOH")
    W18E WXYZ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F AB 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F C 3 A_PlaySoundEx("m1887/close","SoundSlot6")
    W18F DEFGHIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F B 0 A_TakeInventory("ReloadingShot",1)
    W18F B 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+14
  ReloadStartFull:
    W18F I 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStartFull_SOH")
    W18F H 3 A_GiveInventory("ReloadingShot",1)
    W18F GF 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F C 3 A_PlaySoundEx("m1887/open","SoundSlot5")
    W18F BA 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E ZYXWTU 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo
  Zoom:
  PostReloadAlt:
    W18E A 0 A_JumpIfInventory("M1887Token",1,"Reload")
    W18C F 0 A_ZoomFactor(1.2)
    W18C E 0 A_GiveInventory("Aiming",1)
	W18C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    W18C ABCDEF 1
    Goto AltHold
  ReloadBreak:
    W18C F 0 A_ZoomFactor(1.0)
    W18C FE 1
    W18C E 0 A_TakeInventory("Aiming",1)
    W18C DCBA 1
    W18C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  ClearRefire: 
    W18C F 1 A_ClearReFire
	Goto AltHold
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M1887Clip",1,1)
	Goto ReloadBreak
	W18F B 0 A_TakeInventory("M1887Clip",1)
    W18D A 0 A_PlayWeaponSound("m1887/fire")
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-1.95,1.95), 0, 0, 4, 0, frandom(-1.95,1.95))
    W18D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.95,1.95), 0, 0, 4, 0, frandom(-1.95,1.95))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.95,1.95), 1, 0, 4, 0, frandom(-1.95,1.95))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 2 BRIGHT
	W18C F 0 A_JumpIfInventory("M1887Clip",1,1)
	Goto ReloadBreak
    W18D CDEF 2
    W18D G 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18D HIJK 2
	W18D K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18D L 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18D MNOPQ 2
    W18D RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("M1887Clip",1,1)
	Goto ReloadBreak
	TNT1 A 0 
    Goto AltHold
  AltHold:
    A12C C 0 A_JumpIfInventory("FireHeld",1,"ClearRefire")
    W18C F 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+20
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
	W18E A 0 A_JumpIfInventory("M1887Token",1,"Reload")
    W18C A 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEnd")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    W18C A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    W18C A 0 A_ZoomFactor(1.2)
    W18C AB 1
    W18C B 0 A_GiveInventory("Aiming",1)
    W18C CDEF 1
    W18C F 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	A12C F 0 A_Refire("AltHold")
    Goto Ready+20
  AltFire2:
    W18C F 0 A_ZoomFactor(1.0)
    W18C FE 1
    W18C E 0 A_TakeInventory("Aiming",1)
    W18C DCBA 1
    W18C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto Ready+14
  AltFire3:
    W18C A 0 A_ZoomFactor(1.0)
    W18C FEDCBA 1
    W18C A 0 A_TakeInventory("Aiming",1)
    W18C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    goto DropWeapon
  ReloadStartAim:
    W18C F 0 A_ZoomFactor(1.0)
    W18C FE 1
    W18C E 0 A_TakeInventory("Aiming",1)
    W18C DCBA 1
    W18C 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 J 0
    WEP2 J 0 A_SpawnItem("M1887Drop")
    stop
  ReloadStart_SOH:
    W18E A 0 A_JumpIfInventory("M1887Token",1,"Reload3")
    W18E A 2 A_JumpIfInventory("M1887Clip",1,"ReloadStartFull_SOH")
    W18E B 2 A_GiveInventory("ReloadingShot",1)
    W18E C 2 A_PlaySoundEx("m1887/open","SoundSlot5")
	W18E C 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	W18E B 0 A_GiveInventory("M1887Token",1)
    W18E DEFGHI 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	Goto Reload3
	Reload3:
	W18E B 0 A_GiveInventory("ReloadingShot",1)
    W18E JKLMN 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E O 0 A_GiveInventory("M1887Clip",1)
    W18E O 0 A_TakeInventory("M1887Ammo",1)
    W18E O 2 A_PlaySoundEx("m1887/insert","SoundSlot5")
    W18E QR 2
    W18E STU 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18E X 0 A_JumpIfInventory("M1887Clip",7,"ReloadEnd_SOH")
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,"ReloadAmmo_SOH")
    Goto ReloadEnd_SOH
  ReloadAmmo_SOH:
    W18E X 0 A_JumpIfInventory("M1887Clip",7,"ReloadEnd_SOH")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto ReloadEnd_SOH
    W18F KLM 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F N 0 A_GiveInventory("M1887Clip",1)
    W18F N 0 A_TakeInventory("M1887Ammo",1)
    W18F N 2 A_PlaySoundEx("m1887/insert","SoundSlot6")
    W18E QR 2
    W18E STU 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    W18E WXYZ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F AB 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F C 2 A_PlaySoundEx("m1887/close","SoundSlot6")
    W18F DEFGHIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F B 0 A_TakeInventory("ReloadingShot",1)
    W18F B 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+14
  ReloadStartFull_SOH:
    W18F I 2
    W18F H 2 A_GiveInventory("ReloadingShot",1)
    W18F GF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F C 2 A_PlaySoundEx("m1887/open","SoundSlot5")
    W18F BA 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E ZYXWTU 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo_SOH
  Fire_SteadyAim:
    W18E X 0 A_TakeInventory("M1887Token",1)
	W18B B 0 A_JumpIfInventory("M1887Clip",2,1)
	Goto FireEmpty_SteadyAim
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B G 2
    W18B H 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18B IJKL 2
	W18B L 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18B M 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18B NOPQ 2
    W18B RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireEmpty_SteadyAim:
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  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:
    W18A JIHGFEDCB 2 A_WeaponReady(WRF_NOPRIMARY)
	W18A 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("M1887Dropped",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("M1887Thrown",0,0,7,2)
	stop
  }
}

actor M1887Clip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 7
    ammo.backpackamount 0
    ammo.backpackmaxamount 7
    +IGNORESKILL
}

actor "Model 1887 Ex Mags" : "Model 1887"
{
  obituary "%k made sure %o felt 1887 times."
  inventory.pickupmessage "You got the Model 1887 lever-action shotgun. Terminate them all!"
  //attacksound "spas/fire"
  weapon.selectionorder 9
  weapon.ammotype "M1887Clip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M1887Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    W18A A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    W18A BC 3 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
	W18A DEFGHI 3 A_WeaponReady(WRF_ALLOWZOOM)
    W18A J 2 A_WeaponReady(WRF_ALLOWZOOM)
	G18A I 0 A_JumpIfInventory("M1887Token",1,"Reload")
    W18A J 0 A_JumpIfNoAmmo("Reload")
	W18A J 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    W18A J 0 A_JumpIfInventory("Aiming",1,5)
    W18A J 0 A_JumpIfInventory("Reloading",1,"Reload")
    W18A J 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    W18A J 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18A J 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+14
    W18C F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    W18C F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    W18C F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	W18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    W18C F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+20
  Fire:
    W18E X 0 A_TakeInventory("M1887Token",1)
    W18A P 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEnd")
    W18A P 0 A_JumpIfInventory("Aiming",1,"FireAim")
    W18A J 1 A_JumpIfNoAmmo("ReloadStart")
    W18B B 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
	W18B B 0 A_JumpIfInventory("M1887Clip2",2,1)
	Goto FireEmpty
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    W18B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-5.00,5.00))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B G 2
    W18B H 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18B IJKL 2
	W18B L 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18B M 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18B NOPQ 2
    W18B RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireAim:
    W18C F 1 A_JumpIfNoAmmo("ReloadStart")
	W18C F 0 A_JumpIfInventory("M1887Clip2",2,1)
	Goto FireAimEmpty
    W18D A 0 A_PlayWeaponSound("m1887/fire")
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-1.95,1.95), 0, 0, 4, 0, frandom(-1.95,1.95))
    W18D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.95,1.95), 0, 0, 4, 0, frandom(-1.95,1.95))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.95,1.95), 1, 0, 4, 0, frandom(-1.95,1.95))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 2 BRIGHT
    W18D CDEF 2
    W18D G 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18D HIJK 2
	W18D K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18D L 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18D MNOPQ 2
    W18D RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18D A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+20
    W18D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+20
  Fire_SteadyAim:
    W18E X 0 A_TakeInventory("M1887Token",1)
	W18B B 0 A_JumpIfInventory("M1887Clip2",2,1)
	Goto FireEmpty_SteadyAim
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B G 2
    W18B H 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18B IJKL 2
	W18B L 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18B M 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18B NOPQ 2
    W18B RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  Reload: //AltFire:
    W18E A 0 A_JumpIfInventory("M1887Clip2",11,2)
    W18E A 0 A_JumpIfInventory("M1887Ammo",1,"ReloadStart")
    W18E A 0 A_TakeInventory("Reloading",1)
    W18E A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+17
  ReloadStart:
    W18E A 0 A_JumpIfInventory("M1887Clip2",6,2)
    W18E A 0 ACS_NamedExecuteAlways("RefSpeak",0,4,0,0)
    W18E A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    W18E A 0 A_JumpIfInventory("M1887Clip2",1,"ReloadStartFull")
    W18E A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	W18E A 0 A_JumpIfInventory("M1887Token",1,"Reload2")
    W18E B 3 A_GiveInventory("ReloadingShot",1)
    W18E C 3 A_PlaySoundEx("m1887/open","SoundSlot5")
	W18E C 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	W18E B 0 A_GiveInventory("M1887Token",1)
    W18E DEFGHI 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	Goto Reload2
  Reload2:
    W18E B 0 A_GiveInventory("ReloadingShot",1)
    W18E JKLMN 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E O 0 A_GiveInventory("M1887Clip2",1)
    W18E O 0 A_TakeInventory("M1887Ammo",1)
    W18E O 3 A_PlaySoundEx("m1887/insert","SoundSlot5")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E QR 3
    W18E ST 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18E X 0 A_JumpIfInventory("M1887Clip2",11,"ReloadEnd")
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,"ReloadAmmo")
    Goto ReloadEnd
  ReloadAmmo:
    W18E X 0 A_JumpIfInventory("M1887Clip2",11,"ReloadEnd")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto ReloadEnd
    W18F KLM 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F N 0 A_GiveInventory("M1887Clip2",1)
    W18F N 0 A_TakeInventory("M1887Ammo",1)
    W18F N 3 A_PlaySoundEx("m1887/insert","SoundSlot6")
    W18E QR 3
    W18E ST 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    Goto ReloadAmmo
  ReloadEnd:
    W18E A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadEnd_SOH")
    W18E WXYZ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F AB 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F C 3 A_PlaySoundEx("m1887/close","SoundSlot6")
    W18F DEFGHIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F B 0 A_TakeInventory("ReloadingShot",1)
    W18F B 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+14
  ReloadStartFull:
    W18F I 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStartFull_SOH")
    W18F H 3 A_GiveInventory("ReloadingShot",1)
    W18F GF 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F C 3 A_PlaySoundEx("m1887/open","SoundSlot5")
    W18F BA 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E ZYXWT 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo
  ReloadStart_SOH:
    W18E A 0 A_JumpIfInventory("M1887Token",1,"Reload3")
    W18E A 2
    W18E B 2 A_GiveInventory("ReloadingShot",1)
    W18E C 2 A_PlaySoundEx("m1887/open","SoundSlot5")
	W18E C 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	W18E B 0 A_GiveInventory("M1887Token",1)
    W18E DEFGHI 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	Goto Reload3
  Reload3:
    W18E B 0 A_GiveInventory("ReloadingShot",1)
    W18E JKLMN 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E O 0 A_GiveInventory("M1887Clip2",1)
    W18E O 0 A_TakeInventory("M1887Ammo",1)
    W18E O 2 A_PlaySoundEx("m1887/insert","SoundSlot5")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E QR 2
    W18E ST 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18E X 0 A_JumpIfInventory("M1887Clip2",11,"ReloadEnd_SOH")
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,"ReloadAmmo_SOH")
    Goto ReloadEnd_SOH
  ReloadAmmo_SOH:
    W18F KLM 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F N 0 A_GiveInventory("M1887Clip2",1)
    W18F N 0 A_TakeInventory("M1887Ammo",1)
    W18F N 2 A_PlaySoundEx("m1887/insert","SoundSlot6")
    W18E QR 2
    W18E ST 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18E X 0 A_JumpIfInventory("M1887Clip2",11,"ReloadEnd_SOH")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,"ReloadAmmo_SOH")
    Goto ReloadEnd_SOH
  ReloadEnd_SOH:
    W18E WXYZ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F AB 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F C 2 A_PlaySoundEx("m1887/close","SoundSlot6")
    W18F DEFGHIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F B 0 A_TakeInventory("ReloadingShot",1)
    W18F B 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+14
  ReloadStartFull_SOH:
    W18F I 2
    W18F H 2 A_GiveInventory("ReloadingShot",1)
    W18F GF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F C 2 A_PlaySoundEx("m1887/open","SoundSlot5")
    W18F BA 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E ZYXWT 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo_SOH
  ReloadBreak:
    W18C F 0 A_ZoomFactor(1.0)
    W18C FE 1
    W18C E 0 A_TakeInventory("Aiming",1)
    W18C DCBA 1
    W18C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M1887Clip2",1,1)
	Goto ReloadBreak
	W18F B 0 A_TakeInventory("M1887Clip2",1)
    W18D A 0 A_PlayWeaponSound("m1887/fire")
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-1.95,1.95), 0, 0, 4, 0, frandom(-1.95,1.95))
    W18D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.95,1.95), 0, 0, 4, 0, frandom(-1.95,1.95))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.95,1.95), 1, 0, 4, 0, frandom(-1.95,1.95))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 2 BRIGHT
	W18C F 0 A_JumpIfInventory("M1887Clip2",1,1)
	Goto ReloadBreak
    W18D CDEF 2
    W18D G 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18D HIJK 2
	W18D K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18D L 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18D MNOPQ 2
    W18D RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("M1887Clip2",1,1)
	Goto ReloadBreak
	TNT1 A 0 
    Goto AltHold
  }
}

actor M1887Clip2 : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 11
    ammo.backpackamount 0
    ammo.backpackmaxamount 11
    +IGNORESKILL
}

actor Model1887ExMags : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}

actor "Model 1887 Fine Tuned" : "Model 1887"
{
  obituary "%k made sure %o felt 1887 times."
  inventory.pickupmessage "You got the Model 1887 lever-action shotgun. Terminate them all!"
  //attacksound "spas/fire"
  weapon.selectionorder 9
  weapon.ammotype "M1887Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M1887Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Fire:
    W18E X 0 A_TakeInventory("M1887Token",1)
    W18A P 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEnd")
    W18A P 0 A_JumpIfInventory("Aiming",1,"FireAim")
    W18A J 1 A_JumpIfNoAmmo("ReloadStart")
    W18B B 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
	W18B B 0 A_JumpIfInventory("M1887Clip",2,1)
	Goto FireEmpty
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-5.30,5.30), 0, 0, 4, 0, frandom(-5.30,5.30))
    W18B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-5.30,5.30), 0, 0, 4, 0, frandom(-5.30,5.30))
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-5.30,5.30), 1, 0, 4, 0, frandom(-5.30,5.30))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 1 BRIGHT
    W18B CDEF 1
    W18B G 1 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18B HIJKL 1
	W18B L 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18B M 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18B NO 2
    W18B PQRT 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireEmpty:
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-5.15,5.15), 0, 0, 4, 0, frandom(-5.15,5.15))
    W18B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-5.15,5.15), 0, 0, 4, 0, frandom(-5.15,5.15))
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-5.15,5.15), 1, 0, 4, 0, frandom(-5.15,5.15))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireAim:
    W18C F 1 A_JumpIfNoAmmo("ReloadStart")
	W18C F 0 A_JumpIfInventory("M1887Clip",2,1)
	Goto FireAimEmpty
    W18D A 0 A_PlayWeaponSound("m1887/fire")
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-1.85,1.85), 0, 0, 4, 0, frandom(-1.85,1.85))
    W18D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.85,1.85), 0, 0, 4, 0, frandom(-1.85,1.85))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.85,1.85), 1, 0, 4, 0, frandom(-1.85,1.85))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 1 BRIGHT
    W18D CDEF 1
    W18D G 1 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18D HIJKL 1
	W18D K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18D M 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18D NP 2
    W18D RT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18D A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+20
    W18D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+20
  FireAimEmpty:
    W18D A 0 A_PlayWeaponSound("m1887/fire")
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-1.50,1.50), 0, 0, 4, 0, frandom(-1.50,1.50))
    W18D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.50,1.50), 0, 0, 4, 0, frandom(-1.50,1.50))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.50,1.50), 1, 0, 4, 0, frandom(-1.50,1.50))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 2 BRIGHT
    W18D CDEF 2
    W18D A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+20
    W18D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+20
  Fire_SteadyAim:
    W18E X 0 A_TakeInventory("M1887Token",1)
	W18B B 0 A_JumpIfInventory("M1887Clip",2,1)
	Goto FireEmpty_SteadyAim
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 1 BRIGHT
    W18B CDEF 1
    W18B G 1 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18B HIJKL 1
	W18B L 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18B M 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18B NO 2
    W18B PQRT 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireEmpty_SteadyAim:
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-4.20,4.20), 0, 0, 4, 0, frandom(-4.20,4.20))
    W18B AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-4.20,4.20), 0, 0, 4, 0, frandom(-4.20,4.20))
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-4.20,4.20), 1, 0, 4, 0, frandom(-4.20,4.20))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 1
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M1887Clip",1,1)
	Goto ReloadBreak
    W18D A 0 A_PlayWeaponSound("m1887/fire")
	W18F B 0 A_TakeInventory("M1887Clip",1)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D AAAAA 0 BRIGHT A_FireCustomMissile("HHCB18871", frandom(-1.85,1.85), 0, 0, 4, 0, frandom(-1.85,1.85))
    W18D AAAAAAA 0 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.85,1.85), 0, 0, 4, 0, frandom(-1.85,1.85))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872", frandom(-1.85,1.85), 1, 0, 4, 0, frandom(-1.85,1.85))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 1 BRIGHT
	W18C F 0 A_JumpIfInventory("M1887Clip",1,1)
	Goto ReloadBreak
    W18D CDEF 1
    W18D G 1 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18D HIJKL 1
	W18D K 0 A_SpawnItemEx("ShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18D M 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18D NP 2
    W18D RT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("M1887Clip",1,1)
	Goto ReloadBreak
	TNT1 A 0 
    Goto AltHold
  }
}

actor Model1887RapidFire : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}

actor "Model 1887 Solid Slugs" : "Model 1887"
{
  obituary "%k was far away when %o felt 1887 times."
  inventory.pickupmessage "You got the Model 1887 lever-action shotgun. Terminate them all!"
  //attacksound "spas/fire"
  weapon.selectionorder 9
  weapon.ammotype "M1887Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M1887Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Fire:
    W18E X 0 A_TakeInventory("M1887Token",1)
    W18A P 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEnd")
    W18A P 0 A_JumpIfInventory("Aiming",1,"FireAim")
    W18A J 1 A_JumpIfNoAmmo("ReloadStart")
    W18B B 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
	W18B B 0 A_JumpIfInventory("M1887Clip",2,1)
	Goto FireEmpty
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18871G", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-5.00,5.00))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B G 2
    W18B H 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18B I 2
    W18G JKL 2
	W18G L 0 A_SpawnItemEx("BlueShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18G M 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18B NOPQ 2
    W18B RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireEmpty:
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18871G", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-5.00,5.00))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireAim:
    W18C F 1 A_JumpIfNoAmmo("ReloadStart")
	W18C F 0 A_JumpIfInventory("M1887Clip",2,1)
	Goto FireAimEmpty
    W18D A 0 A_PlayWeaponSound("m1887/fire")
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D A 0 BRIGHT A_FireCustomMissile("HHCB18872G", frandom(-0.50,0.50), 0, 0, 4, 0, frandom(-0.50,0.50))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872G", frandom(-0.50,0.50), 1, 0, 4, 0, frandom(-0.50,0.50))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 2 BRIGHT
    W18D CDEF 2
    W18D G 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18D HIJK 2
	W18D K 0 A_SpawnItemEx("BlueShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18D L 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18D MNOPQ 2
    W18D RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18D A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+20
    W18D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+20
  FireAimEmpty:
    W18D A 0 A_PlayWeaponSound("m1887/fire")
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D A 0 BRIGHT A_FireCustomMissile("HHCB18872G", frandom(-0.50,0.50), 0, 0, 4, 0, frandom(-0.50,0.50))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872G", frandom(-0.50,0.50), 1, 0, 4, 0, frandom(-0.50,0.50))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 2 BRIGHT
    W18D CDEF 2
    W18D A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+20
    W18D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+20
  Fire_SteadyAim:
    W18E X 0 A_TakeInventory("M1887Token",1)
	W18B B 0 A_JumpIfInventory("M1887Clip",2,1)
	Goto FireEmpty_SteadyAim
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18873G", frandom(-3.50,3.50), 1, 0, 4, 0, frandom(-3.50,3.50))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B G 2
    W18B H 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18B I 2
    W18G JKL 2
	W18G L 0 A_SpawnItemEx("BlueShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18G M 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18B NOPQ 2
    W18B RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireEmpty_SteadyAim:
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18873G", frandom(-3.50,3.50), 1, 0, 4, 0, frandom(-3.50,3.50))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  Reload: //AltFire:
    W18E A 0 A_JumpIfInventory("M1887Clip",7,2)
    W18E A 0 A_JumpIfInventory("M1887Ammo",1,"ReloadStart")
    W18E A 0 A_TakeInventory("Reloading",1)
    W18E A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+17
  ReloadStart:
    W18E A 0 A_JumpIfInventory("M1887Clip",5,2)
    W18E A 0 ACS_NamedExecuteAlways("RefSpeak",0,4,0,0)
    W18E A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    W18E A 0 A_JumpIfInventory("M1887Clip",1,"ReloadStartFull")
    W18E A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	W18E A 0 A_JumpIfInventory("M1887Token",1,"Reload2")
    W18E B 3 A_GiveInventory("ReloadingShot",1)
    W18H C 3 A_PlaySoundEx("m1887/open","SoundSlot5")
	W18H C 0 A_SpawnItemEx("BlueShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	W18E B 0 A_GiveInventory("M1887Token",1)
    W18H D 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18E EFGHI 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	Goto Reload2
  Reload2:
    W18E B 0 A_GiveInventory("ReloadingShot",1)
    W18E JKL 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18H MN 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E O 0 A_GiveInventory("M1887Clip",1)
    W18E O 0 A_TakeInventory("M1887Ammo",1)
    W18E O 3 A_PlaySoundEx("m1887/insert","SoundSlot5")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E QR 3
    W18E STU 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18E X 0 A_JumpIfInventory("M1887Clip",7,"ReloadEnd")
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,"ReloadAmmo")
    Goto ReloadEnd
  ReloadAmmo:
    W18E X 0 A_JumpIfInventory("M1887Clip",7,"ReloadEnd")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto ReloadEnd
    W18F K 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18I L 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F M 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F N 0 A_GiveInventory("M1887Clip",1)
    W18F N 0 A_TakeInventory("M1887Ammo",1)
    W18F N 3 A_PlaySoundEx("m1887/insert","SoundSlot6")
    W18E QR 3
    W18E STU 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    Goto ReloadAmmo
  ReloadEnd:
    W18E A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadEnd_SOH")
    W18E WXYZ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F AB 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F C 3 A_PlaySoundEx("m1887/close","SoundSlot6")
    W18F DEFGHIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F B 0 A_TakeInventory("ReloadingShot",1)
    W18F B 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+14
  ReloadStartFull:
    W18F I 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStartFull_SOH")
    W18F H 3 A_GiveInventory("ReloadingShot",1)
    W18F GF 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F C 3 A_PlaySoundEx("m1887/open","SoundSlot5")
    W18F BA 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E ZYXWTU 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo
  Zoom:
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M1887Clip",1,1)
	Goto ReloadBreak
    W18D A 0 A_PlayWeaponSound("m1887/fire")
	W18F B 0 A_TakeInventory("M1887Clip",1)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D A 0 BRIGHT A_FireCustomMissile("HHCB18872G", frandom(-0.50,0.50), 0, 0, 4, 0, frandom(-0.50,0.50))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872G", frandom(-0.50,0.50), 1, 0, 4, 0, frandom(-0.50,0.50))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 2 BRIGHT
	W18C F 0 A_JumpIfInventory("M1887Clip",1,1)
	Goto ReloadBreak
    W18D CDEF 2
    W18D G 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18D HIJK 2
	W18D K 0 A_SpawnItemEx("BlueShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18D L 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18D MNOPQ 2
    W18D RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("M1887Clip",1,1)
	Goto ReloadBreak
	TNT1 A 0 
    Goto AltHold
  AltFire:
    W18E A 0 A_JumpIfInventory("M1887Token",1,"Reload")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    W18C A 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEnd")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    W18C A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    W18C A 0 A_ZoomFactor(1.4)
    W18C AB 1
    W18C B 0 A_GiveInventory("Aiming",1)
    W18C CDEF 1
    W18C F 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	A12C F 0 A_Refire("AltHold")
    Goto Ready+20
  AltFire2:
    W18C F 0 A_ZoomFactor(1.0)
    W18C FE 1
    W18C E 0 A_TakeInventory("Aiming",1)
    W18C DCBA 1
    W18C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto Ready+14
  AltFire3:
    W18C F 0 A_ZoomFactor(1.0)
    W18C FE 1
    W18C E 0 A_TakeInventory("Aiming",1)
    W18C DCBA 1
    W18C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto DropWeapon
  ReloadStartAim:
    W18C F 0 A_ZoomFactor(1.0)
    W18C FE 1
    W18C E 0 A_TakeInventory("Aiming",1)
    W18C DCBA 1
    W18C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+3
  ReloadStart_SOH:
    W18E A 0 A_JumpIfInventory("M1887Token",1,"Reload3")
    W18E A 2
    W18E B 2 A_GiveInventory("ReloadingShot",1)
    W18H C 2 A_PlaySoundEx("m1887/open","SoundSlot5")
	W18H C 0 A_SpawnItemEx("BlueShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	W18E B 0 A_GiveInventory("M1887Token",1)
    W18H D 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18E EFGHI 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	Goto Reload3
  Reload3:
    W18E B 0 A_GiveInventory("ReloadingShot",1)
    W18E JKL 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18H MN 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E O 0 A_GiveInventory("M1887Clip",1)
    W18E O 0 A_TakeInventory("M1887Ammo",1)
    W18E O 2 A_PlaySoundEx("m1887/insert","SoundSlot5")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E QR 2
    W18E STU 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18E X 0 A_JumpIfInventory("M1887Clip",7,"ReloadEnd_SOH")
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,"ReloadAmmo_SOH")
    Goto ReloadEnd_SOH
  ReloadAmmo_SOH:
    W18E X 0 A_JumpIfInventory("M1887Clip",7,"ReloadEnd_SOH")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto ReloadEnd_SOH
    W18F K 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18I L 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F M 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F N 0 A_GiveInventory("M1887Clip",1)
    W18F N 0 A_TakeInventory("M1887Ammo",1)
    W18F N 2 A_PlaySoundEx("m1887/insert","SoundSlot6")
    W18E QR 2
    W18E STU 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    W18E WXYZ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F AB 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F C 2 A_PlaySoundEx("m1887/close","SoundSlot6")
    W18F DEFGHIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F B 0 A_TakeInventory("ReloadingShot",1)
    W18F B 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+14
  ReloadStartFull_SOH:
    W18F I 2
    W18F H 2 A_GiveInventory("ReloadingShot",1)
    W18F GF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F C 2 A_PlaySoundEx("m1887/open","SoundSlot5")
    W18F BA 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E ZYXWTU 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo_SOH
  }
}

actor Model1887Solid : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}

actor "Model 1887 Dragon" : "Model 1887"
{
  obituary "%k's Model 1887 absolutely roasted %o."
  inventory.pickupmessage "You got the Model 1887 lever-action shotgun. Terminate them all!"
  //attacksound "spas/fire"
  weapon.selectionorder 9
  weapon.ammotype "M1887Clip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "M1887Ammo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Fire:
    W18E X 0 A_TakeInventory("M1887Token",1)
    W18A P 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEnd")
    W18A P 0 A_JumpIfInventory("Aiming",1,"FireAim")
    W18A J 1 A_JumpIfNoAmmo("ReloadStart")
	W18B B 0 A_JumpIfInventory("M1887Clip",2,1)
	Goto FireEmpty
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_PlaySound("dragon/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B AAAA 0 A_FireCustomMissile("FlameThrowerFire3",frandom(-8.00,10.00),0,10,random(-2,4),0,frandom(-9.00,10.00))
    W18B AAAAAAAAAAA 0 A_FireCustomMissile("FlameThrowerFire",frandom(-9.00,11.00),0,10,random(-3,5),0,frandom(-10.00,11.00))
    W18B AAAAA 0 A_FireCustomMissile("FlameThrowerFire2",frandom(-9.00,11.00),0,10,random(-3,5),0,frandom(-10.00,11.00))
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B AAA 0 BRIGHT A_FireCustomMissile("HHCB18871D", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    W18B AA 0 BRIGHT A_FireCustomMissile("HHCB18872D", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18872D", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-5.00,5.00))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B G 2
    W18B H 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18B IJKL 2
	W18B L 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18B M 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18B NOPQ 2
    W18B RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireEmpty:
    W18B A 0 A_PlayWeaponSound("m1887/fire")
    W18B A 0 A_PlaySound("dragon/fire")
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,2,2)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,5)
    W18B A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,10,2)
    W18B AAAA 0 A_FireCustomMissile("FlameThrowerFire3",frandom(-8.00,10.00),0,10,random(-2,4),0,frandom(-9.00,10.00))
    W18B AAAAAAAAAAA 0 A_FireCustomMissile("FlameThrowerFire",frandom(-9.00,11.00),0,10,random(-3,5),0,frandom(-10.00,11.00))
    W18B AAAAA 0 A_FireCustomMissile("FlameThrowerFire2",frandom(-9.00,11.00),0,10,random(-3,5),0,frandom(-10.00,11.00))
    W18B A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,6,5)
    W18B AAA 0 BRIGHT A_FireCustomMissile("HHCB18871D", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    W18B AA 0 BRIGHT A_FireCustomMissile("HHCB18872D", frandom(-6.00,6.00), 0, 0, 4, 0, frandom(-5.00,5.00))
    W18B A 1 BRIGHT A_FireCustomMissile("HHCB18872D", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-5.00,5.00))
    W18B A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18B A 1 BRIGHT A_GunFlash
    W18B B 2 BRIGHT
    W18B CDEF 2
    W18B A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+14
    W18B A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireAim:
    W18C F 1 A_JumpIfNoAmmo("ReloadStart")
	W18C F 0 A_JumpIfInventory("M1887Clip",2,1)
	Goto FireAimEmpty
    W18D A 0 A_PlayWeaponSound("m1887/fire")
    W18D A 0 A_PlaySound("dragon/fire")
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D AAAA 0 A_FireCustomMissile("FlameThrowerFire3",frandom(-7.00,7.00),0,0,random(4,10),0,frandom(-7.00,8.00))
    W18D AAAAAAAAAAA 0 A_FireCustomMissile("FlameThrowerFire",frandom(-8.00,8.00),0,0,random(3,11),0,frandom(-8.00,9.00))
    W18D AAAAA 0 A_FireCustomMissile("FlameThrowerFire2",frandom(-8.00,8.00),0,0,random(3,11),0,frandom(-8.00,9.00))
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D AAA 0 BRIGHT A_FireCustomMissile("HHCB18871D", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18D AA 0 BRIGHT A_FireCustomMissile("HHCB18872D", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872D", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 2 BRIGHT
    W18D CDEF 2
    W18D G 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18D HIJK 2
	W18D K 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18D L 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18D MNOPQ 2
    W18D RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18D A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+20
    W18D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+20
  FireAimEmpty:
    W18D A 0 A_PlayWeaponSound("m1887/fire")
    W18D A 0 A_PlaySound("dragon/fire")
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D AAAA 0 A_FireCustomMissile("FlameThrowerFire3",frandom(-7.00,7.00),0,0,random(4,10),0,frandom(-7.00,8.00))
    W18B AAAAAAAAAAA 0 A_FireCustomMissile("FlameThrowerFire",frandom(-8.00,8.00),0,0,random(3,11),0,frandom(-8.00,9.00))
    W18B AAAAA 0 A_FireCustomMissile("FlameThrowerFire2",frandom(-8.00,8.00),0,0,random(3,11),0,frandom(-8.00,9.00))
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D AAA 0 BRIGHT A_FireCustomMissile("HHCB18871D", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18D AA 0 BRIGHT A_FireCustomMissile("HHCB18872D", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872D", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 2 BRIGHT
    W18D CDEF 2
    W18D A 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto Ready+20
    W18D A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+20
  Reload: //AltFire:
    W18E A 0 A_JumpIfInventory("M1887Clip",7,2)
    W18E A 0 A_JumpIfInventory("M1887Ammo",1,"ReloadStart")
    W18E A 0 A_TakeInventory("Reloading",1)
    W18E A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+17
  ReloadStart:
    W18E A 0 A_JumpIfInventory("M1887Clip",5,2)
    W18E A 0 ACS_NamedExecuteAlways("RefSpeak",0,4,0,0)
    W18E A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    W18E A 0 A_JumpIfInventory("M1887Clip",1,"ReloadStartFull")
    W18E A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	W18E A 0 A_JumpIfInventory("M1887Token",1,"Reload2")
    W18E B 3 A_GiveInventory("ReloadingShot",1)
    W18E C 3 A_PlaySoundEx("m1887/open","SoundSlot5")
	W18E C 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	W18E B 0 A_GiveInventory("M1887Token",1)
    W18E DEFGHI 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	Goto Reload2
  Reload2:
    W18E B 0 A_GiveInventory("ReloadingShot",1)
    W18E JKLMN 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E O 0 A_GiveInventory("M1887Clip",1)
    W18E O 0 A_TakeInventory("M1887Ammo",1)
    W18E O 3 A_PlaySoundEx("m1887/insert","SoundSlot5")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E QR 3
    W18E STU 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18E X 0 A_JumpIfInventory("M1887Clip",7,"ReloadEnd")
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,"ReloadAmmo")
    Goto ReloadEnd
  ReloadAmmo:
    W18E X 0 A_JumpIfInventory("M1887Clip",7,"ReloadEnd")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto ReloadEnd
    W18F KLM 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F N 0 A_GiveInventory("M1887Clip",1)
    W18F N 0 A_TakeInventory("M1887Ammo",1)
    W18F N 3 A_PlaySoundEx("m1887/insert","SoundSlot6")
    W18E QR 3
    W18E STU 3 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    Goto ReloadAmmo
  ReloadEnd:
    W18E A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadEnd_SOH")
    W18E WXYZ 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F AB 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F C 3 A_PlaySoundEx("m1887/close","SoundSlot6")
    W18F DEFGHIJ 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F B 0 A_TakeInventory("ReloadingShot",1)
    W18F B 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+14
  ReloadStartFull:
    W18F I 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStartFull_SOH")
    W18F H 3 A_GiveInventory("ReloadingShot",1)
    W18F GF 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F C 3 A_PlaySoundEx("m1887/open","SoundSlot5")
    W18F BA 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E ZYXWTU 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo
  Zoom:
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("M1887Clip",1,1)
	Goto ReloadBreak
    W18D A 0 A_PlayWeaponSound("m1887/fire")
	W18F B 0 A_TakeInventory("M1887Clip",1)
    W18D A 0 A_PlaySound("dragon/fire")
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",3,0,-4,4)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,7)
    W18D A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",-3,0,4,4)
    W18D AAAA 0 A_FireCustomMissile("FlameThrowerFire3",frandom(-7.00,7.00),0,0,random(4,10),0,frandom(-7.00,8.00))
    W18D AAAAAAAAAAA 0 A_FireCustomMissile("FlameThrowerFire",frandom(-8.00,8.00),0,0,random(3,11),0,frandom(-8.00,9.00))
    W18D AAAAA 0 A_FireCustomMissile("FlameThrowerFire2",frandom(-8.00,8.00),0,0,random(3,11),0,frandom(-8.00,9.00))
    W18D A 0 A_FireCustomMissile("WeaponSmokePuff_ShotMuzzle",0,0,0,7)
    W18D AAA 0 BRIGHT A_FireCustomMissile("HHCB18871D", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18D AA 0 BRIGHT A_FireCustomMissile("HHCB18872D", frandom(-5.00,5.00), 0, 0, 4, 0, frandom(-4.00,4.00))
    W18D A 1 BRIGHT A_FireCustomMissile("HHCB18872D", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-4.00,4.00))
    W18D A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    W18D A 1 BRIGHT A_GunFlash
    W18D B 2 BRIGHT
	W18C F 0 A_JumpIfInventory("M1887Clip",1,1)
	Goto ReloadBreak
    W18D CDEF 2
    W18D G 2 A_PlaySoundEx("m1887/click","SoundSlot5")
    W18D HIJK 2
	W18D K 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    W18D L 2 A_PlaySoundEx("m1887/clack","SoundSlot6")
    W18D MNOPQ 2
    W18D RRTT 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    "####" "#" 0 A_JumpIfInventory("M1887Clip",1,1)
	Goto ReloadBreak
	TNT1 A 0 
    Goto AltHold
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    W18E A 0 A_JumpIfInventory("M1887Token",1,"Reload")
    W18C A 0 A_JumpIfInventory("ReloadingShot",1,"ReloadEnd")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    W18C A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    W18C A 0 A_ZoomFactor(1.2)
    W18C AB 1
    W18C B 0 A_GiveInventory("Aiming",1)
    W18C CDEF 1
    W18C F 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	A12C F 0 A_Refire("AltHold")
    Goto Ready+20
  AltFire2:
    W18C F 0 A_ZoomFactor(1.0)
    W18C FE 1
    W18C E 0 A_TakeInventory("Aiming",1)
    W18C DCBA 1
    W18C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto Ready+14
  AltFire3:
    W18C F 0 A_ZoomFactor(1.0)
    W18C FE 1
    W18C E 0 A_TakeInventory("Aiming",1)
    W18C DCBA 1
    W18C A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto DropWeapon
  ReloadStartAim:
    W18C F 0 A_ZoomFactor(1.0)
    W18C FE 1
    W18C E 0 A_TakeInventory("Aiming",1)
    W18C DCBA 1
    W18C 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 J 0
    WEP2 J 0 A_SpawnItem("M1887Drop")
    stop
  ReloadStart_SOH:
    W18E A 0 A_JumpIfInventory("M1887Token",1,"Reload3")
    W18E A 2 A_JumpIfInventory("M1887Clip",1,"ReloadStartFull_SOH")
    W18E B 2 A_GiveInventory("ReloadingShot",1)
    W18E C 2 A_PlaySoundEx("m1887/open","SoundSlot5")
	W18E C 0 A_SpawnItemEx("OrangeShellCasing",Cos(Pitch)*30,-2,25-(Sin(Pitch)*25),Cos(Pitch)*FRandom(-2,-4),FRandom(-3,-6),-Sin(Pitch)*FRandom(-3,-6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	W18E B 0 A_GiveInventory("M1887Token",1)
    W18E DEFGHI 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	Goto Reload3
  Reload3:
    W18E B 0 A_GiveInventory("ReloadingShot",1)
    W18E JKLMN 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E O 0 A_GiveInventory("M1887Clip",1)
    W18E O 0 A_TakeInventory("M1887Ammo",1)
    W18E O 2 A_PlaySoundEx("m1887/insert","SoundSlot5")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E QR 2
    W18E STU 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    W18E X 0 A_JumpIfInventory("M1887Clip",7,"ReloadEnd_SOH")
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,"ReloadAmmo_SOH")
    Goto ReloadEnd_SOH
  ReloadAmmo_SOH:
    W18E X 0 A_JumpIfInventory("M1887Clip",7,"ReloadEnd_SOH")
	W18E X 0 A_TakeInventory("M1887Token",1)
    W18E X 0 A_JumpIfInventory("M1887Ammo",1,1)
    Goto ReloadEnd_SOH
    W18F KLM 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F N 0 A_GiveInventory("M1887Clip",1)
    W18F N 0 A_TakeInventory("M1887Ammo",1)
    W18F N 2 A_PlaySoundEx("m1887/insert","SoundSlot6")
    W18E QR 2
    W18E STU 2 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    W18E WXYZ 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F AB 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18F C 2 A_PlaySoundEx("m1887/close","SoundSlot6")
    W18F DEFGHIJ 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F B 0 A_TakeInventory("ReloadingShot",1)
    W18F B 0 A_TakeInventory("Reloading",1)
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+14
  ReloadStartFull_SOH:
    W18F I 2
    W18F H 2 A_GiveInventory("ReloadingShot",1)
    W18F GF 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    W18F C 2 A_PlaySoundEx("m1887/open","SoundSlot5")
    W18F BA 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    W18E ZYXWTU 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    Goto ReloadAmmo_SOH
  }
}

actor Model1887Dragon : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}

actor M1887Pickup : CustomInventory
{
  inventory.pickupmessage "You got the Model 1887 lever-action shotgun. Terminate them all!"
  inventory.pickupsound "spas/pump"
  +INVENTORY.AUTOACTIVATE
  //inventory.respawntics 70
  scale 0.12
  States
  {
  Spawn:
    WEP2 J -1
    stop
  Pickup:
    WEP2 J 0
    WEP2 J 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",0,0,0)) == 1, "PickupStay")
    WEP2 J 0 A_JumpIfInventory("Model 1887",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 J 0 A_JumpIfInventory("Model 1887 Ex Mags",1,"AmmoPickup")
    WEP2 J 0 A_JumpIfInventory("Model 1887 Fine Tuned",1,"AmmoPickup")
    WEP2 J 0 A_JumpIfInventory("Model 1887 Solid Slugs",1,"AmmoPickup")
    WEP2 J 0 A_JumpIfInventory("Model 1887 Dragon",1,"AmmoPickup")
    WEP2 J 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 J 0 A_JumpIfInventory("MaxWeaponsFilled",82,"FailPickup2")
	WEP2 J 0 A_GiveInventory("MaxWeaponsFilled",19)
    WEP2 J 0 ACS_NamedExecuteWithResult("RefPickU",36,0,0)
    stop
  PickupStay:
    WEP2 J 0
    WEP2 J 0 A_JumpIfInventory("Model 1887",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 J 0 A_JumpIfInventory("Model 1887 Ex Mags",1,"FailPickup")
    WEP2 J 0 A_JumpIfInventory("Model 1887 Fine Tuned",1,"FailPickup")
    WEP2 J 0 A_JumpIfInventory("Model 1887 Solid Slugs",1,"FailPickup")
    WEP2 J 0 A_JumpIfInventory("Model 1887 Dragon",1,"FailPickup")
    WEP2 J 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 J 0 A_JumpIfInventory("MaxWeaponsFilled",82,"FailPickup2")
	WEP2 J 0 A_GiveInventory("MaxWeaponsFilled",19)
    WEP2 J 0 ACS_NamedExecuteWithResult("RefPickU",36,0,0)
    WEP2 J 0 ACS_NamedExecuteWithResult("RefPickC",36,0,0)
    WEP2 J 0 A_PlaySound("spas/pump")
    fail
  AmmoPickup:
    WEP2 J 0
    WEP2 J 0 A_JumpIfInventory("M1887Ammo",0,"FailPickup")
    WEP2 J 0 A_GiveInventory("M1887Ammo",7)
    stop
  OneManArmy:
    WEP2 J 0
	WEP2 J 0 A_JumpIfInventory("MaxWeaponsFilled",119,"FailPickup2")
	WEP2 J 0 A_GiveInventory("MaxWeaponsFilled",19)
	WEP2 J 0 ACS_NamedExecuteWithResult("RefPickU",36,0,0)
	stop
  FailPickup:
    WEP2 J 1
    fail
  FailPickup2:
    WEP2 J 1
    WEP2 J 0 ACS_NamedExecuteAlways("RefSlots",0,13,0,0)
    fail
  }
}

actor M1887Drop : M1887Pickup
{
  States
  {
  Spawn:
    WEP2 J -1
    stop
  Pickup:
    WEP2 J 0
    WEP2 J 0 A_JumpIfInventory("Model 1887",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 J 0 A_JumpIfInventory("Model 1887 Ex Mags",1,"AmmoPickup")
    WEP2 J 0 A_JumpIfInventory("Model 1887 Fine Tuned",1,"AmmoPickup")
    WEP2 J 0 A_JumpIfInventory("Model 1887 Solid Slugs",1,"AmmoPickup")
    WEP2 J 0 A_JumpIfInventory("Model 1887 Dragon",1,"AmmoPickup")
    WEP2 J 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 J 0 A_JumpIfInventory("MaxWeaponsFilled",82,"FailPickup2")
	WEP2 J 0 A_GiveInventory("MaxWeaponsFilled",19)
    WEP2 J 0 ACS_NamedExecuteWithResult("RefPickU",36,0,0)
    stop
  }
}

actor M1887Drop2 : M1887Drop
{
  States
  {
  Spawn:
    WEP2 J -1
    stop
  Pickup:
    WEP2 J 0
    WEP2 J 0 A_JumpIfInventory("Model 1887",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 J 0 A_JumpIfInventory("Model 1887 Ex Mags",1,"AmmoPickup")
    WEP2 J 0 A_JumpIfInventory("Model 1887 Fine Tuned",1,"AmmoPickup")
    WEP2 J 0 A_JumpIfInventory("Model 1887 Solid Slugs",1,"AmmoPickup")
    WEP2 J 0 A_JumpIfInventory("Model 1887 Dragon",1,"AmmoPickup")
    WEP2 J 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 J 0 A_JumpIfInventory("MaxWeaponsFilled",82,"FailPickup2")
	WEP2 J 0 A_GiveInventory("MaxWeaponsFilled",19)
    WEP2 J 0 ACS_NamedExecuteWithResult("RefPickU",36,0,0)
    stop
  AmmoPickup:
    WEP2 J 0
    stop
  }
}

actor HHCB18871 : HHBullet
{
  damage (random(12,14))
  Speed 235
  decal none
  damagetype "Shotgungib"
  -NOEXTREMEDEATH
  states
  {
  Spawn:
    TNT1 A 2
    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_GiveToTarget("HitIndicator",1)//
    TNT1 A 5 A_PlaySound("generic/ricochets")
    stop
  Crash:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)//
	TNT1 A 0 A_Jump(48,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 HHCB18872 : HHCB18871
{
  damage (random(12,14))
  Speed 235
  decal ShotChip
  damagetype "Shotgun"
  +NOEXTREMEDEATH
  states
  {
  Spawn:
    TNT1 A 10
    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(184,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 5 A_PlaySound("generic/ricochets")
    stop
  Crash:
	//TNT1 A 0 A_Jump(184,2)
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
	TNT1 A 0 A_Jump(48,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 HHCB18871G : HHBullet
{
  damage (random(80,100))
  Speed 285
  damagetype "BigPistol"
  States
  {
  Spawn:
    TNT1 A 2
    Loop
  Death:
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
	TNT1 A 10 A_AlertMonsters(136)
    stop
  XDeath:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 5 A_PlaySound("generic/ricochets")
	TNT1 A 10 A_AlertMonsters(136)
    stop
  Crash:
    TNT1 A 0 A_GiveToTarget("HitIndicator",1)
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff_2", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
	TNT1 A 10 A_AlertMonsters(136)
    stop
  }
}
actor HHCB18872G : HHCB18871G
{
  damage (random(40,50))//(71)//(143)//(135)
}
actor HHCB18873G : HHCB18871G
{
  damage (122)//(111)//(105)
}

actor HHCB18871D : HHBullet
{
  damage (random(10,14))
  Speed 200
  decal none
  +FORCERADIUSDMG
  damagetype "Dragon"
  states
  {
  Spawn:
    TNT1 A 2
    TNT1 A 1 A_ScaleVelocity(0.75)
    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(144,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(32,2)
    TNT1 A 0 A_PlaySound("generic/ricochets")
    TNT1 AA 12 A_Explode(2,32,0)
    stop
  Crash:
	//TNT1 A 0 A_Jump(144,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 HHCB18872D : HHCB18871D
{
  damage (random(10,18))
  Speed 200
  decal none
  +FORCERADIUSDMG
  damagetype "Dragon"
  states
  {
  Spawn:
    TNT1 A 4
    TNT1 A 2 A_ScaleVelocity(0.75)
    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(144,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(32,2)
    TNT1 A 0 A_PlaySound("generic/ricochets")
    TNT1 AA 12 A_Explode(2,32,0)
    stop
  Crash:
	//TNT1 A 0 A_Jump(144,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
  }
}