actor "IMI Desert Eagle" : RGUWeapon
{
  obituary "%k mutilated %o with the Desert Eagle."
  inventory.pickupmessage "You got the IMI Desert Eagle. Bring the pain."
  //attacksound "deagle/fire"
  weapon.selectionorder 19
  weapon.ammotype "DeagleClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "DeagleAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    TNT1 A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    DEGA ABCDEFGHI 1 A_WeaponReady(WRF_ALLOWZOOM)
    DEGA JK 2 A_WeaponReady(WRF_ALLOWZOOM)
	G18A I 0 A_JumpIfInventory("DEToken",1,"Reload")
    DEGA L 0 A_JumpIfNoAmmo("Reload")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    DEGA L 0 A_JumpIfInventory("Aiming",1,5)
    DEGA L 0 A_JumpIfInventory("Reloading",1,"Reload")
    DEGA L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    DEGA L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGA L 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+16
    DEGC F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    DEGC F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    DEGC F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    DEGC F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
  Deselect:
    DEGA L 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    DEGA L 0 A_TakeInventory("Firing",1)
    DEGA L 0 A_TakeInventory("Aiming",1)
    DEGA L 0 A_TakeInventory("Reloading",1)
    DEGA L 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    DEGA L 0 A_ZoomFactor(1.0)
    DEGA L 0 A_Lower
    DEGA L 1 A_Lower
    Goto Deselect+6
  Select:
    DEGA A 0
    DEGA A 0 A_TakeInventory("Firing",1)
    DEGA A 0 A_Raise
    Goto Select+2
  Fire:
    DEGA L 0 A_JumpIfInventory("Aiming",1,"FireAim")
    DEGA L 1 A_JumpIfNoAmmo("ReloadStart")
    DEGB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    DEGB A 0 A_JumpIfInventory("Firing",1,"FireHold")
    DEGB A 0 A_PlayWeaponSound("deagle/fire")
    DEGB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,4)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGB A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-6.00,6.00), 1, 0, 4, 0, frandom(-6.00,6.00))
	DEGA A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,5,40-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGB A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGB B 1 BRIGHT A_GunFlash
    DEGB B 0 A_GiveInventory("Firing",1)
    DEGB CDEFGHI 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGA L 0 A_TakeInventory("Firing",1)
    DEGA L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+16
    DEGA L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireEmpty:
    DEGB B 1 BRIGHT A_GunFlash
    DEGB C 1 A_PlaySound("m9/lock")
    DEGB DEFGH 1
    DEGB I 1 A_GiveInventory("DeagleBolt",1)
    DEGA L 0 A_TakeInventory("Firing",1)
    DEGA L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+16
    DEGA L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireHold:
    DEGB A 0 A_JumpIfNoAmmo("Reload")
    DEGB A 0 A_PlayWeaponSound("deagle/fire")
    DEGB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,4)
    DEGB A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-10.00,10.00), 1, 0, 4, 0, frandom(-10.00,10.00))
	DEGA A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,5,40-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGB A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGB B 1 BRIGHT A_GunFlash
    DEGB B 0 A_GiveInventory("Firing",1)
    DEGB CDEFGHI 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGA L 0 A_TakeInventory("Firing",1)
    DEGA L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+16
    DEGA L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireAim:
    DEGC F 1 A_JumpIfNoAmmo("ReloadStart")
    DEGD A 0 A_JumpIfInventory("Firing",1,"FireAimHold")
    DEGD A 0 A_PlayWeaponSound("deagle/fire")
    DEGD A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,8)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGD A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-1.20,1.20), 1, 0, 4, 0, frandom(-1.20,1.20))
	DEGD A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,0,42-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGD A 0 A_JumpIfNoAmmo("FireAimEmpty")
    DEGD B 1 BRIGHT A_GunFlash
    DEGD B 0 A_GiveInventory("Firing",1)
    DEGD CDEFGHI 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGC F 0 A_TakeInventory("Firing",1)
    DEGC F 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+22
    DEGC F 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+22
  FireAimHold:
    DEGD A 0 A_PlayWeaponSound("deagle/fire")
    DEGD A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,8)
    DEGD A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-3.60,3.60), 1, 0, 4, 0, frandom(-3.60,3.60))
	DEGD A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,0,42-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGD A 0 A_JumpIfNoAmmo("FireAimEmpty")
    DEGD B 1 BRIGHT A_GunFlash
    DEGD B 0 A_GiveInventory("Firing",1)
    DEGD CDEFGHI 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGC F 0 A_TakeInventory("Firing",1)
    DEGC F 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+22
    DEGC F 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+22
  FireAimEmpty:
    DEGD B 1 BRIGHT A_GunFlash
    DEGD C 1 A_PlaySound("m9/lock")
    DEGD DEFGH 1
    DEGD I 1 A_GiveInventory("DeagleBolt",1)
    DEGC F 0 A_TakeInventory("Firing",1)
    DEGC F 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+22
    DEGC F 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+22
  Reload: //AltFire:
    DEGE A 0 A_JumpIfInventory("DeagleClip",7,2)
    DEGE A 0 A_JumpIfInventory("DeagleAmmo",1,"ReloadStart")
    DEGE A 0 A_TakeInventory("Reloading",1)
    DEGE A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+19
  ReloadStart:
    DEGE A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    DEGE A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    DEGE A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    DEGE A 3 A_JumpIfInventory("DeagleBolt",1,"ReloadStartBolt")
	DEGE A 0 A_JumpIfInventory("DEToken",1,"Reload2")
    DEGE BCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGE E 3 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGE E 0 A_FireCustomMissile("MP40EmptyMagSpawner",0,0,0,1)
	DEGE E 0 A_GiveInventory("DEToken",1)
    DEGE FGH 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload2
  Reload2:
    DEGE IJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGE LMNOP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGE Q 3 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGE R 3 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo
  ReloadAmmo:
    DEGE R 0 A_JumpIfInventory("DeagleClip",7,"ReloadEnd")
	DEGE P 0 A_TakeInventory("DEToken",1)
    DEGE R 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEnd
    DEGE R 0 A_GiveInventory("DeagleClip",1)
    DEGE R 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmo
  ReloadEnd:
    DEGE STUVW 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  ReloadStartBolt:
    DEGE A 0 A_JumpIfInventory("DEToken",1,"Reload4")
    DEGF ABCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGF E 3 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGE E 0 A_FireCustomMissile("MP40EmptyMagSpawner",0,0,0,1)
	DEGE E 0 A_GiveInventory("DEToken",1)
    DEGF FGH 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload4
  Reload4:
    DEGF IJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGF LMNOP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGF Q 3 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGF R 3 A_TakeInventory("Reloading",1)
    Goto ReloadAmmoBolt
  ReloadAmmoBolt:
    DEGF R 0 A_JumpIfInventory("DeagleClip",7,"ReloadEndBolt")
	DEGE P 0 A_TakeInventory("DEToken",1)
    DEGF R 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEndBolt
    DEGF R 0 A_GiveInventory("DeagleClip",1)
    DEGF R 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmoBolt
  ReloadEndBolt:
    DEGF S 3 A_TakeInventory("DeagleBolt",1)
    DEGF S 0 A_PlaySoundEx("deagle/bolt","SoundSlot5")
    DEGF T 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGE TUVW 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto Ready+16
  Zoom:
  PostReloadAlt:
    G18A I 0 A_JumpIfInventory("DEToken",1,"Reload")
    DEGC F 0 A_ZoomFactor(1.15)
    DEGC E 0 A_GiveInventory("Aiming",1)
	DEGC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    DEGC ABCDEF 1
    Goto AltHold
  ReloadBreak:
    DEGC F 0 A_ZoomFactor(1.0)
    DEGC FE 1
    DEGC E 0 A_TakeInventory("Aiming",1)
    DEGC DCBA 1
    DEGC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  ClearRefire:
    DEGC F 1 A_ClearReFire
	Goto AltHold
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("DeagleClip",1,2)
	TNT1 A 0 A_GiveInventory("DeagleBolt",1)
	Goto ReloadBreak
    DEGD A 0 A_PlayWeaponSound("deagle/fire")
	GRNA L 0 A_TakeInventory("DeagleClip",1)
    DEGD A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,8)
	"####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGD A 0 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-2.60,2.60), 1, 0, 4, 0, frandom(-2.60,2.60))
	DEGD A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,0,42-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGD A 0 A_JumpIfNoAmmo("FireAimEmpty")
    DEGD BCD 1 BRIGHT A_GunFlash
    "####" "#" 0 A_JumpIfInventory("DeagleClip",1,2)
	TNT1 A 0 A_GiveInventory("DeagleBolt",1)
	Goto ReloadBreak
	A12C A 0 A_ClearReFire
    Goto AltHold
  AltHold:
    A12C C 0 A_JumpIfInventory("FireHeld",1,"ClearRefire")
    DEGC 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+18
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    G18A I 0 A_JumpIfInventory("DEToken",1,"Reload")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    DEGC A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    DEGC A 0 A_ZoomFactor(1.15)
    DEGC AB 1
    DEGC B 0 A_GiveInventory("Aiming",1)
    DEGC CDEF 1
    DEGC F 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	A12C F 0 A_Refire("AltHold")
    Goto Ready+22
  AltFire2:
    DEGC F 0 A_ZoomFactor(1.0)
    DEGC FE 1
    DEGC E 0 A_TakeInventory("Aiming",1)
    DEGC DCBA 1
    DEGC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto Ready+16
  AltFire3:
    DEGC F 0 A_ZoomFactor(1.0)
    DEGC FE 1
    DEGC E 0 A_TakeInventory("Aiming",1)
    DEGC DCBA 1
    DEGC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	goto DropWeapon
  ReloadStartAim:
    DEGC F 0 A_ZoomFactor(1.0)
    DEGC FE 1
    DEGC E 0 A_TakeInventory("Aiming",1)
    DEGC DCBA 1
    DEGC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    WEP2 D 0
    WEP2 D 0 A_SpawnItem("DeagleDrop")
    stop
  ReloadStart_SOH:
    DEGE A 2 A_JumpIfInventory("DeagleBolt",1,"ReloadStartBolt_SOH")
	DEGE A 0 A_JumpIfInventory("DEToken",1,"Reload3")
    DEGE BCD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGE E 2 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGE E 0 A_FireCustomMissile("MP40EmptyMagSpawner",0,0,0,1)
	DEGE E 0 A_GiveInventory("DEToken",1)
    DEGE FGH 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload3
  Reload3:
    DEGE IJK 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGE LMNOP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGE Q 2 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGE R 2 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    DEGE P 0 A_JumpIfInventory("DeagleClip",7,"ReloadEnd_SOH")
	DEGE P 0 A_TakeInventory("DEToken",1)
    DEGE P 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEnd_SOH
    DEGE P 0 A_GiveInventory("DeagleClip",1)
    DEGE P 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    DEGE STUVW 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  ReloadStartBolt_SOH:
    DEGE A 0 A_JumpIfInventory("DEToken",1,"Reload5")
    DEGF ABCD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGF E 2 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGE E 0 A_FireCustomMissile("MP40EmptyMagSpawner",0,0,0,1)
	DEGE E 0 A_GiveInventory("DEToken",1)
    DEGF FGH 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload5
  Reload5:
    DEGF IJK 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGF LMNOP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGF Q 2 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGF R 2 A_TakeInventory("Reloading",1)
    Goto ReloadAmmoBolt_SOH
  ReloadAmmoBolt_SOH:
    DEGF P 0 A_JumpIfInventory("DeagleClip",7,"ReloadEndBolt_SOH")
	DEGE P 0 A_TakeInventory("DEToken",1)
    DEGF P 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEndBolt_SOH
    DEGF P 0 A_GiveInventory("DeagleClip",1)
    DEGF P 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmoBolt_SOH
  ReloadEndBolt_SOH:
    DEGF S 2 A_TakeInventory("DeagleBolt",1)
    DEGF S 0 A_PlaySoundEx("deagle/bolt","SoundSlot5")
    DEGF T 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGE TUVW 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto Ready+16
  Fire_SteadyAim:
    DEGB A 0 A_JumpIfInventory("Firing",1,"FireHold_SteadyAim")
    DEGB A 0 A_PlayWeaponSound("deagle/fire")
    DEGB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,4)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGB A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-4.00,4.00), 1, 0, 4, 0, frandom(-4.00,4.00))
	DEGB A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,5,40-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGB A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGB B 1 BRIGHT A_GunFlash
    DEGB B 0 A_GiveInventory("Firing",1)
    DEGB CDEFGHI 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGA L 0 A_TakeInventory("Firing",1)
    DEGA L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+16
    DEGA L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireHold_SteadyAim:
    DEGB A 0 A_JumpIfNoAmmo("Reload")
    DEGB A 0 A_PlayWeaponSound("deagle/fire")
    DEGB A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,4)
    DEGB A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	DEGB A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,5,40-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGB A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGB B 1 BRIGHT A_GunFlash
    DEGB B 0 A_GiveInventory("Firing",1)
    DEGB CDEFGHI 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGA L 0 A_TakeInventory("Firing",1)
    DEGA L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+16
    DEGA L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  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)
    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)
    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:
    DEGA JIHGFEDCBA 2 A_WeaponReady(WRF_NOPRIMARY)
    DEGA 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("DeagleDropped",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("DeagleThrown",0,0,7,2)
	stop
  }
}

actor DeagleBolt : Inventory
{
    inventory.amount 0
    inventory.maxamount 1
}
actor DeagleClip : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 0
    inventory.maxamount 7
    ammo.backpackamount 0
    ammo.backpackmaxamount 7
    +IGNORESKILL
}
actor "IMI Desert Eagle Ex Mags" : "IMI Desert Eagle"
{
  obituary "%k mutilated %o with the Desert Eagle."
  inventory.pickupmessage "You got the IMI Desert Eagle. Bring the pain."
  //attacksound "deagle/fire"
  weapon.selectionorder 19
  weapon.ammotype "DeagleClip2"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "DeagleAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    TNT1 A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    DEGA ABCDEFGHI 1 A_WeaponReady(WRF_ALLOWZOOM)
    DEGA JK 2 A_WeaponReady(WRF_ALLOWZOOM)
	G18A I 0 A_JumpIfInventory("DEToken",1,"Reload")
    DEGA L 0 A_JumpIfNoAmmo("Reload")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    DEGA L 0 A_JumpIfInventory("Aiming",1,5)
    DEGA L 0 A_JumpIfInventory("Reloading",1,"Reload")
    DEGA L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    DEGA L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGA L 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+16
    DEGC F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    DEGC F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    DEGC F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    DEGC F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
  Reload: //AltFire:
    DEGE A 0 A_JumpIfInventory("DeagleClip2",11,2)
    DEGE A 0 A_JumpIfInventory("DeagleAmmo",1,"ReloadStart")
    DEGE A 0 A_TakeInventory("Reloading",1)
    DEGE A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+19
  ReloadStart:
    DEGE A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    DEGE A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    DEGE A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    DEGE A 3 A_JumpIfInventory("DeagleBolt",1,"ReloadStartBolt")
	DEGE A 0 A_JumpIfInventory("DEToken",1,"Reload2")
    DEGE BCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGE E 3 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGE E 0 A_FireCustomMissile("DEEmptyMagExtendedSpawner",0,0,0,1)
	DEGE E 0 A_GiveInventory("DEToken",1)
    DEGE FGH 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload2
  Reload2:
    DEGE IJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGE LMNOP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGE Q 3 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGE R 3 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo
  ReloadAmmo:
    DEGE P 0 A_JumpIfInventory("DeagleClip2",11,"ReloadEnd")
	DEGE P 0 A_TakeInventory("DEToken",1)
    DEGE P 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEnd
    DEGE P 0 A_GiveInventory("DeagleClip2",1)
    DEGE P 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmo
  ReloadEnd:
    DEGE STUVW 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  ReloadStartBolt:
    DEGE A 0 A_JumpIfInventory("DEToken",1,"Reload4")
    DEGF ABCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGF E 3 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGE E 0 A_FireCustomMissile("DEEmptyMagExtendedSpawner",0,0,0,1)
	DEGE E 0 A_GiveInventory("DEToken",1)
    DEGF FGH 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload4
  Reload4:
    DEGF IJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGF LMNOP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGF Q 3 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGF R 3 A_TakeInventory("Reloading",1)
    Goto ReloadAmmoBolt
  ReloadAmmoBolt:
    DEGF R 0 A_JumpIfInventory("DeagleClip2",11,"ReloadEndBolt")
	DEGE P 0 A_TakeInventory("DEToken",1)
    DEGF R 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEndBolt
    DEGF R 0 A_GiveInventory("DeagleClip2",1)
    DEGF R 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmoBolt
  ReloadEndBolt:
    DEGF S 3 A_TakeInventory("DeagleBolt",1)
    DEGF S 0 A_PlaySoundEx("deagle/bolt","SoundSlot5")
    DEGF T 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGE TUVW 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto Ready+16
  ReloadStartAim:
    DEGC F 0 A_ZoomFactor(1.0)
    DEGC FE 1
    DEGC E 0 A_TakeInventory("Aiming",1)
    DEGC DCBA 1
    DEGC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  ReloadStart_SOH:
    DEGE A 2 A_JumpIfInventory("DeagleBolt",1,"ReloadStartBolt_SOH")
	DEGE A 0 A_JumpIfInventory("DEToken",1,"Reload3")
    DEGE BCD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGE E 2 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGE E 0 A_FireCustomMissile("DEEmptyMagExtendedSpawner",0,0,0,1)
	DEGE E 0 A_GiveInventory("DEToken",1)
    DEGE FGH 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload3
  Reload3:
    DEGE IJK 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGE LMNOP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGE Q 2 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGE R 2 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    DEGE P 0 A_JumpIfInventory("DeagleClip2",11,"ReloadEnd_SOH")
	DEGE P 0 A_TakeInventory("DEToken",1)
    DEGE P 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEnd_SOH
    DEGE P 0 A_GiveInventory("DeagleClip2",1)
    DEGE P 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    DEGE STUVW 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  ReloadStartBolt_SOH:
    DEGE A 0 A_JumpIfInventory("DEToken",1,"Reload5")
    DEGF ABCD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGF E 2 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGE E 0 A_FireCustomMissile("DEEmptyMagExtendedSpawner",0,0,0,1)
	DEGE E 0 A_GiveInventory("DEToken",1)
    DEGF FGH 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload5
  Reload5:
    DEGF IJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGF LMNOP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGF Q 2 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGF R 2 A_TakeInventory("Reloading",1)
    Goto ReloadAmmoBolt_SOH
  ReloadAmmoBolt_SOH:
    DEGF P 0 A_JumpIfInventory("DeagleClip2",11,"ReloadEndBolt_SOH")
	DEGE P 0 A_TakeInventory("DEToken",1)
    DEGF P 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEndBolt_SOH
    DEGF P 0 A_GiveInventory("DeagleClip2",1)
    DEGF P 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmoBolt_SOH
  ReloadEndBolt_SOH:
    DEGF S 2 A_TakeInventory("DeagleBolt",1)
    DEGF S 0 A_PlaySoundEx("deagle/bolt","SoundSlot5")
    DEGF T 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGE TUVW 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto Ready+16
  PostReloadAlt:
    G18A I 0 A_JumpIfInventory("DEToken",1,"Reload")
    DEGC F 0 A_ZoomFactor(1.15)
    DEGC E 0 A_GiveInventory("Aiming",1)
	DEGC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    DEGC ABCDEF 1
    Goto AltHold
  ReloadBreak:
    DEGC F 0 A_ZoomFactor(1.0)
    DEGC FE 1
    DEGC E 0 A_TakeInventory("Aiming",1)
    DEGC DCBA 1
    DEGC A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  ClearRefire:
    DEGC F 1 A_ClearReFire
	Goto AltHold
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("DeagleClip2",1,2)
	TNT1 A 0 A_GiveInventory("DeagleBolt",1)
	Goto ReloadBreak
    DEGD A 0 A_PlayWeaponSound("deagle/fire")
	GRNA L 0 A_TakeInventory("DeagleClip2",1)
    DEGD A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,8)
	"####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGD A 0 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-2.60,2.60), 1, 0, 4, 0, frandom(-2.60,2.60))
	DEGD A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,0,42-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGD A 0 A_JumpIfNoAmmo("FireAimEmpty")
    DEGD BCD 1 BRIGHT A_GunFlash
    "####" "#" 0 A_JumpIfInventory("DeagleClip2",1,2)
	TNT1 A 0 A_GiveInventory("DeagleBolt",1)
	Goto ReloadBreak
	A12C A 0 A_ClearReFire
    Goto AltHold
  AltHold:
    A12C C 0 A_JumpIfInventory("FireHeld",1,"ClearRefire")
    DEGC 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+18
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    G18A I 0 A_JumpIfInventory("DEToken",1,"Reload")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    DEGC A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    DEGC A 0 A_ZoomFactor(1.15)
    DEGC AB 1
    DEGC B 0 A_GiveInventory("Aiming",1)
    DEGC CDEF 1
    DEGC F 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	A12C F 0 A_Refire("AltHold")
    Goto Ready+22
  }
}

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

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

actor "IMI Desert Eagle Akimbo" : "IMI Desert Eagle"
{
  obituary "%k mutilated %o with TWO Desert Eagles. Poor %o."
  inventory.pickupmessage "You got the IMI Desert Eagle. Bring the pain."
  //attacksound "u45/fire6"
  weapon.selectionorder 19
  weapon.ammotype "DeagleClip3"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "DeagleAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Ready:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    TNT1 A 2 A_PlaySoundEx("weapon/draw","SoundSlot5")
    DEGG ABCDEFGHI 1 A_WeaponReady(WRF_NOFIRE)
    DEGG JK 2 A_WeaponReady(WRF_NOFIRE)
	G18A I 0 A_JumpIfInventory("DEToken",1,"Reload")
    DEGG K 0 A_JumpIfNoAmmo("Reload")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    DEGG K 0 A_JumpIfInventory("Reloading",1,"Reload")
    DEGG K 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    DEGG K 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGG K 1 A_WeaponReady(WRF_ALLOWRELOAD)
    Goto Ready+14
  Deselect:
    DEGG K 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    DEGG K 0 A_TakeInventory("Aiming",1)
    DEGG K 0 A_TakeInventory("Reloading",1)
    DEGG K 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    DEGG K 0 A_ZoomFactor(1.0)
    DEGG K 0 A_Lower
    DEGG K 1 A_Lower
    Goto Deselect+5
  Select:
    DEGG A 0 A_Raise
    Loop
  Fire: //Right
    DEGG K 1 A_JumpIfNoAmmo("ReloadStart")
    DEGI A 0 A_JumpIfInventory("FireSwitch",1,"FireLeft")
    DEGI A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    DEGI A 0 A_PlayWeaponSound("deagle/fire")
    DEGI A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,19,3)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGI A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLEA", frandom(-9.00,9.00), 1, 0, 4, 0, frandom(-9.00,9.00))
	DEGI A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,19,37-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGI A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGI A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGI B 1 BRIGHT A_GunFlash
    DEGI B 0 A_GiveInventory("FireSwitch",1)
    DEGI B 0 A_JumpIfInventory("DeagleClip3",2,2)
    DEGI B 0 BRIGHT A_PlaySound("m9/lock")
    DEGI CDEEFF 1 A_WeaponReady
    DEGI A 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+14
    DEGI A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireLeft:
    DEGH A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"FireLeft_SteadyAim")
    DEGH A 0 A_PlaySoundEx("deagle/fire","SoundSlot6")
    DEGH A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,-19,5)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGH A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLEA", frandom(-9.00,9.00), 1, 0, 4, 0, frandom(-9.00,9.00))
	DEGH A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,-19,37-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGH A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGH A 0 A_JumpIfNoAmmo("FireEmptyLeft")
    DEGH B 1 BRIGHT A_GunFlash
    DEGH B 0 A_TakeInventory("FireSwitch",1)
    DEGH B 0 A_JumpIfInventory("DeagleClip3",2,2)
    DEGH B 0 BRIGHT A_PlaySound("m9/lock")
    DEGH CDEEFF 1 A_WeaponReady
    DEGH A 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+14
    DEGH A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireEmpty:
    DEGI B 1 BRIGHT A_GunFlash
    DEGI C 1 BRIGHT A_PlaySound("m9/lock")
    DEGI DEEF 1
    DEGI F 1 A_GiveInventory("DeagleBolt",1)
    DEGI A 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+14
    DEGI A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireEmptyLeft:
    DEGH B 1 BRIGHT A_GunFlash
    DEGH C 1 BRIGHT A_PlaySound("m9/lock")
    DEGH DEEF 1
    DEGH F 1 A_GiveInventory("DeagleBolt",1)
    DEGH A 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+14
    DEGH A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  AltFire: //Does nothing
    DEGG K 1 A_WeaponReady(WRF_NOSECONDARY|WRF_ALLOWRELOAD)
    Goto Ready+14
  Reload: //AltFire:
    DEGG A 0 A_JumpIfInventory("DeagleClip3",14,2)
    DEGG A 0 A_JumpIfInventory("DeagleAmmo",1,"ReloadStart")
    DEGG A 0 A_TakeInventory("Reloading",1)
    Goto Ready+17
  ReloadStart:
	DEGJ A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
	DEGJ A 0 A_TakeInventory("FireSwitch",1)
    DEGJ A 3 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
	DEGJ A 0 A_JumpIfInventory("DEToken",1,"Reload2")
    DEGJ BCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGJ E 3 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGE E 0 A_FireCustomMissile("MP40EmptyMagSpawner",0,0,0,1)
    DEGJ F 3 A_PlaySoundEx("deagle/clipout","SoundSlot7")
	DEGE E 0 A_FireCustomMissile("MP40EmptyMagSpawner",0,0,0,1)
	DEGE F 0 A_GiveInventory("DEToken",1)
    DEGJ GH 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload2
  Reload2:
    DEGJ IJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGJ LMNOP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGJ Q 3 A_TakeInventory("Reloading",1)
    DEGJ R 12 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGJ R 3 A_PlayWeaponSound("deagle/clipin")
    Goto ReloadAmmo
  ReloadAmmo:
    DEGJ R 0 A_JumpIfInventory("DeagleClip3",14,"ReloadEnd")
	DEGJ P 0 A_TakeInventory("DEToken",1)
    DEGJ R 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEnd
    DEGJ R 0 A_GiveInventory("DeagleClip3",1)
    DEGJ R 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmo
  ReloadEnd:
    DEGG A 3 A_JumpIfInventory("DeagleBolt",1,"ReloadEndBolt")
    DEGG BCDEF 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGG GHIJK 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto Ready+12
  ReloadEndBolt:
    DEGJ RR 3
    DEGJ O 0 A_TakeInventory("DeagleBolt",1)
    DEGG A 3 A_PlaySoundEx("deagle/bolt","SoundSlot5")
    DEGG BCDEF 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGG GHIJK 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto Ready+14
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  ReloadStart_SOH:
    DEGJ A 0 A_JumpIfInventory("DEToken",1,"Reload3")
    DEGJ A 2
    DEGJ BCD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGJ E 2 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGE E 0 A_FireCustomMissile("MP40EmptyMagSpawner",0,0,0,1)
    DEGJ F 2 A_PlaySoundEx("deagle/clipout","SoundSlot7")
	DEGE E 0 A_FireCustomMissile("MP40EmptyMagSpawner",0,0,0,1)
	DEGE F 0 A_GiveInventory("DEToken",1)
    DEGJ GH 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload3
  Reload3:
    DEGJ IJK 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGJ LMNOP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGJ Q 2 A_TakeInventory("Reloading",1)
    DEGJ R 10 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGJ R 2 A_PlayWeaponSound("deagle/clipin")
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    DEGJ R 0 A_JumpIfInventory("DeagleClip3",14,"ReloadEnd_SOH")
	DEGJ P 0 A_TakeInventory("DEToken",1)
    DEGJ R 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEnd_SOH
    DEGJ R 0 A_GiveInventory("DeagleClip3",1)
    DEGJ R 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    DEGG A 2 A_JumpIfInventory("DeagleBolt",1,"ReloadEndBolt_SOH")
    DEGG BCDEF 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGG GHIJK 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto Ready+14
  ReloadEndBolt_SOH:
    DEGJ RR 2
    DEGJ O 0 A_TakeInventory("DeagleBolt",1)
    DEGG A 2 A_PlaySoundEx("deagle/bolt","SoundSlot5")
    DEGG BCDEF 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGG GHIJK 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto Ready+14
  Fire_SteadyAim: //Right
    DEGI A 0 A_PlayWeaponSound("deagle/fire")
    DEGI A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,19,3)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGI A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLEA", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	DEGI A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,19,37-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGI A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGI A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGI B 1 BRIGHT A_GunFlash
    DEGI B 0 A_GiveInventory("FireSwitch",1)
    DEGI B 0 A_JumpIfInventory("DeagleClip3",2,2)
    DEGI B 0 BRIGHT A_PlaySound("m9/lock")
    DEGI CDEEFF 1 A_WeaponReady
    DEGI A 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+14
    DEGI A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+14
  FireLeft_SteadyAim:
    DEGH A 0 A_PlaySoundEx("deagle/fire","SoundSlot6")
    DEGH A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,-19,5)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGH A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLEA", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	DEGH A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,-19,37-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGH A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGH A 0 A_JumpIfNoAmmo("FireEmptyLeft")
    DEGH B 1 BRIGHT A_GunFlash
    DEGH B 0 A_TakeInventory("FireSwitch",1)
    DEGH B 0 A_JumpIfInventory("DeagleClip3",2,2)
    DEGH B 0 BRIGHT A_PlaySound("m9/lock")
    DEGH CDEEFF 1 A_WeaponReady
    DEGH A 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+14
    DEGH 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)
    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
    Goto Ready+2
  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
    Goto Ready+2
  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)
    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)
    Goto Ready+2
  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)
    Goto Ready+2
  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)
    Goto Ready+2
  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)
    Goto Ready+2
  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
    Goto Ready+2
  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
    Goto Ready+2
  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
    Goto Ready+2
  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
    Goto Ready+2
  DropWeapon:
    DEGG JIHGFEDCBA 2 A_WeaponReady(WRF_NOPRIMARY)
    DEGG 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("DeagleDropped",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("DeagleThrown",0,0,7,2)
	stop
  }
}

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

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

actor "IMI Desert Eagle Tac Knife" : RGUWeapon
{
  obituary "%k mutilated %o with the Desert Eagle."
  inventory.pickupmessage "You got the IMI Desert Eagle. Bring the pain."
  //attacksound "deagle/fire"
  weapon.selectionorder 19
  weapon.ammotype "DeagleClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "DeagleAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Ready:
    M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    GRNA L 0 A_TakeInventory("weapondropper",2)
    TNT1 A 0 A_PlaySoundEx("weapon/draw","SoundSlot5")
    DEGK ABCDEFGHI 1 A_WeaponReady(WRF_ALLOWZOOM)
    DEGK JK 2 A_WeaponReady(WRF_ALLOWZOOM)
	G18A I 0 A_JumpIfInventory("DEToken",1,"Reload")
    DEGK L 0 A_JumpIfNoAmmo("Reload")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"DropWeapon")
    DEGK L 0 A_JumpIfInventory("Aiming",1,5)
    DEGK L 0 A_JumpIfInventory("Reloading",1,"Reload")
    DEGK L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    DEGK L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGK L 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+16
    DEGM F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    DEGM F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    DEGM F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	G18A I 0 A_JumpIfInventory("weapondropper",1,"AltFire3")
    DEGM F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+22
  Deselect:
    DEGK L 0 A_PlaySoundEx("weapon/down","SoundSlot5")
    DEGK L 0 A_TakeInventory("Firing",1)
    DEGK L 0 A_TakeInventory("Aiming",1)
    DEGK L 0 A_TakeInventory("Reloading",1)
    DEGK L 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    DEGK L 0 A_ZoomFactor(1.0)
    DEGK L 0 A_Lower
    DEGK L 1 A_Lower
    Goto Deselect+6
  Select:
    DEGK A 0
    DEGK A 0 A_TakeInventory("Firing",1)
    DEGK A 0 A_Raise
    Goto Select+2
  Fire:
    DEGK L 0 A_JumpIfInventory("Aiming",1,"FireAim")
    DEGK L 1 A_JumpIfNoAmmo("ReloadStart")
    DEGL A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    DEGL A 0 A_JumpIfInventory("Firing",1,"FireHold")
    DEGL A 0 A_PlayWeaponSound("deagle/fire")
    DEGL A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,7)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGL A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-7.00,7.00), 1, 0, 4, 0, frandom(-7.00,7.00))
	DEGL A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,11,39-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGL B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGL A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGL B 1 BRIGHT A_GunFlash
    DEGL B 0 A_GiveInventory("Firing",1)
    DEGL CDEFGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGK L 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGK L 0 A_TakeInventory("Firing",1)
    DEGK L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+16
    DEGK L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireEmpty:
    DEGL B 1 BRIGHT A_GunFlash
    DEGL C 1 A_PlaySound("m9/lock")
    DEGL DEFGH 1
    DEGK L 1 A_GiveInventory("DeagleBolt",1)
    DEGK L 0 A_TakeInventory("Firing",1)
    DEGK L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+16
    DEGK L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireHold:
    DEGL A 0 A_JumpIfNoAmmo("Reload")
    DEGL A 0 A_PlayWeaponSound("deagle/fire")
    DEGL A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,7)
    DEGL A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-11.00,11.00), 1, 0, 4, 0, frandom(-11.00,11.00))
	DEGL A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,11,39-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGL B 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGL A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGL B 1 BRIGHT A_GunFlash
    DEGL B 0 A_GiveInventory("Firing",1)
    DEGL CDEFGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGK L 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGL A 0 A_TakeInventory("Firing",1)
    DEGL A 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+16
    DEGL A 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireAim:
    DEGM F 1 A_JumpIfNoAmmo("ReloadStart")
    DEGN A 0 A_JumpIfInventory("Firing",1,"FireAimHold")
    DEGN A 0 A_PlayWeaponSound("deagle/fire")
    DEGN A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,8)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGN A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-1.40,1.40), 1, 0, 4, 0, frandom(-1.40,1.40))
	DEGN A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,0,42-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGN A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGN A 0 A_JumpIfNoAmmo("FireAimEmpty")
    DEGN B 1 BRIGHT A_GunFlash
    DEGN B 0 A_GiveInventory("Firing",1)
    DEGN CDEFGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGM F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGM F 0 A_TakeInventory("Firing",1)
    DEGM F 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+22
    DEGM F 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+22
  FireAimHold:
    DEGN A 0 A_PlayWeaponSound("deagle/fire")
    DEGN A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,8)
    DEGN A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-4.20,4.20), 1, 0, 4, 0, frandom(-4.20,4.20))
	DEGN A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,0,42-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGN A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGN A 0 A_JumpIfNoAmmo("FireAimEmpty")
    DEGN B 1 BRIGHT A_GunFlash
    DEGN B 0 A_GiveInventory("Firing",1)
    DEGN CDEFGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGM F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGM F 0 A_TakeInventory("Firing",1)
    DEGM F 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+22
    DEGM F 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+22
  FireAimEmpty:
    DEGN B 1 BRIGHT A_GunFlash
    DEGN C 1 A_PlaySound("m9/lock")
    DEGN DEFGH 1
    DEGM F 1 A_GiveInventory("DeagleBolt",1)
    DEGM F 0 A_TakeInventory("Firing",1)
    DEGM F 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+22
    DEGM F 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+22
  Reload: //AltFire:
    DEGO A 0 A_JumpIfInventory("DeagleClip",7,2)
    DEGO A 0 A_JumpIfInventory("DeagleAmmo",1,"ReloadStart")
    DEGO A 0 A_TakeInventory("Reloading",1)
    DEGO A 0 A_JumpIfInventory("Aiming",1,"ReadyAim")
    Goto Ready+19
  ReloadStart:
    DEGO A 0 ACS_NamedExecuteAlways("RefSpeak",0,0,0,0)
    DEGO A 0 A_JumpIfInventory("Aiming",1,"ReloadStartAim")
    DEGO A 0 A_JumpIfInventory("Perk1_SOH",1,"ReloadStart_SOH")
    DEGO A 3 A_JumpIfInventory("DeagleBolt",1,"ReloadStartBolt")
	DEGO A 0 A_JumpIfInventory("DEToken",1,"Reload2")
    DEGO BCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGO E 3 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGO E 0 A_FireCustomMissile("MP40EmptyMagSpawner",0,0,0,1)
	DEGO E 0 A_GiveInventory("DEToken",1)
    DEGO FGH 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload2
  Reload2:
    DEGO IJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGO LMNOP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGO Q 3 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGO R 3 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo
  ReloadAmmo:
    DEGO R 0 A_JumpIfInventory("DeagleClip",7,"ReloadEnd")
	DEGO P 0 A_TakeInventory("DEToken",1)
    DEGO R 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEnd
    DEGO R 0 A_GiveInventory("DeagleClip",1)
    DEGO R 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmo
  ReloadEnd:
    DEGO STUVWX 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  ReloadStartBolt:
    DEGE A 0 A_JumpIfInventory("DEToken",1,"Reload4")
    DEGP ABCD 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGP E 3 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGO E 0 A_FireCustomMissile("MP40EmptyMagSpawner",0,0,0,1)
	DEGE E 0 A_GiveInventory("DEToken",1)
    DEGP FGH 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload4
  Reload4:
    DEGP IJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGP LMNOP 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGP Q 3 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGP R 3 A_TakeInventory("Reloading",1)
    Goto ReloadAmmoBolt
  ReloadAmmoBolt:
    DEGP R 0 A_JumpIfInventory("DeagleClip",7,"ReloadEndBolt")
	DEGE P 0 A_TakeInventory("DEToken",1)
    DEGP R 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEndBolt
    DEGP R 0 A_GiveInventory("DeagleClip",1)
    DEGP R 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmoBolt
  ReloadEndBolt:
    DEGP S 3 A_PlaySoundEx("deagle/bolt","SoundSlot5")
    DEGP S 0 A_TakeInventory("DeagleBolt",1)
    DEGP TUVWXY 3 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto Ready+16
  Zoom:
  PostReloadAlt:
    G18A I 0 A_JumpIfInventory("DEToken",1,"Reload")
    DEGM F 0 A_ZoomFactor(1.15)
    DEGM E 0 A_GiveInventory("Aiming",1)
	DEGM A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    DEGM ABCDEF 1
    Goto AltHold
  ReloadBreak:
    DEGM F 0 A_ZoomFactor(1.0)
    DEGM FE 1
    DEGM E 0 A_TakeInventory("Aiming",1)
    DEGM DCBA 1
    DEGM A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	TNT1 A 0 A_ClearReFire
    Goto Reload
  ClearRefire:
    DEGM F 1 A_ClearReFire
	Goto AltHold
  FireAimAltHold:
    "####" "#" 0 A_JumpIfInventory("DeagleClip",1,2)
	TNT1 A 0 A_GiveInventory("DeagleBolt",1)
	Goto ReloadBreak
    DEGN A 0 A_PlayWeaponSound("deagle/fire")
	GRNA L 0 A_TakeInventory("DeagleClip",1)
    DEGN A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,0,8)
	"####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGN A 0 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-3.20,3.20), 1, 0, 4, 0, frandom(-3.20,3.20))
	DEGN A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,0,42-(Sin(Pitch)*28),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGN A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGN BDE 1 BRIGHT A_GunFlash
	"####" "#" 0 A_JumpIfInventory("DeagleClip",1,2)
	TNT1 A 0 A_GiveInventory("DeagleBolt",1)
	Goto ReloadBreak
	A12C A 0 A_ClearReFire
    Goto AltHold
  AltHold:
    A12C C 0 A_JumpIfInventory("FireHeld",1,"ClearRefire")
    DEGM 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+18
  AltFire:
    GRNA L 0 A_TakeInventory("weapondropper",2)
    G18A I 0 A_JumpIfInventory("DEToken",1,"Reload")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"AltHold")
    DEGM A 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    DEGM A 0 A_ZoomFactor(1.15)
    DEGM AB 1
    DEGM B 0 A_GiveInventory("Aiming",1)
    DEGM CDEF 1
    DEGM F 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	A12C F 0 A_Refire("AltHold")
    Goto Ready+22
  AltFire2:
    DEGM F 0 A_ZoomFactor(1.0)
    DEGM FE 1
    DEGM E 0 A_TakeInventory("Aiming",1)
    DEGM DCBA 1
    DEGM A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto Ready+16
  AltFire3:
    DEGM F 0 A_ZoomFactor(1.0)
    DEGM FE 1
    DEGM E 0 A_TakeInventory("Aiming",1)
    DEGM DCBA 1
    DEGM A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
	goto DropWeapon
  ReloadStartAim:
    DEGM F 0 A_ZoomFactor(1.0)
    DEGM FE 1
    DEGM E 0 A_TakeInventory("Aiming",1)
    DEGM DCBA 1
    DEGM A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    Goto ReloadStart+2
  Flash:
    TNT1 A 2 bright A_Light1
    TNT1 A 0 bright A_Light0
    stop
  Spawn:
    WEP2 D 0
    WEP2 D 0 A_SpawnItem("DeagleDrop")
    stop
  ReloadStart_SOH:
    DEGO A 2 A_JumpIfInventory("DeagleBolt",1,"ReloadStartBolt_SOH")
	DEGE A 0 A_JumpIfInventory("DEToken",1,"Reload3")
    DEGO BCD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGO E 2 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGO E 0 A_FireCustomMissile("MP40EmptyMagSpawner",0,0,0,1)
	DEGE E 0 A_GiveInventory("DEToken",1)
    DEGO FGH 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload3
  Reload3:
    DEGO IJK 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGO LMNOP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGO Q 2 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGO R 2 A_TakeInventory("Reloading",1)
    Goto ReloadAmmo_SOH
  ReloadAmmo_SOH:
    DEGO P 0 A_JumpIfInventory("DeagleClip",7,"ReloadEnd_SOH")
	DEGE P 0 A_TakeInventory("DEToken",1)
    DEGO P 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEnd_SOH
    DEGO P 0 A_GiveInventory("DeagleClip",1)
    DEGO P 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmo_SOH
  ReloadEnd_SOH:
    DEGO STUVWX 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+16
  ReloadStartBolt_SOH:
    DEGE A 0 A_JumpIfInventory("DEToken",1,"Reload5")
    DEGP ABCD 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGP E 2 A_PlaySoundEx("deagle/clipout","SoundSlot5")
	DEGO E 0 A_FireCustomMissile("MP40EmptyMagSpawner",0,0,0,1)
	DEGE E 0 A_GiveInventory("DEToken",1)
    DEGP FGH 2 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
	goto Reload5
  Reload5:
    DEGP IJK 3 A_WeaponReady(WRF_NOBOB|WRF_NOFIRE)
    DEGP LMNOP 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGP Q 2 A_PlaySoundEx("deagle/clipin","SoundSlot5")
    DEGP R 2 A_TakeInventory("Reloading",1)
    Goto ReloadAmmoBolt_SOH
  ReloadAmmoBolt_SOH:
    DEGP P 0 A_JumpIfInventory("DeagleClip",7,"ReloadEndBolt_SOH")
	DEGE P 0 A_TakeInventory("DEToken",1)
    DEGP P 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto ReloadEndBolt_SOH
    DEGP P 0 A_GiveInventory("DeagleClip",1)
    DEGP P 0 A_TakeInventory("DeagleAmmo",1)
    Goto ReloadAmmoBolt_SOH
  ReloadEndBolt_SOH:
    DEGP S 2 A_PlaySoundEx("deagle/bolt","SoundSlot5")
    DEGP S 0 A_TakeInventory("DeagleBolt",1)
    DEGP TUVWXY 2 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    Goto Ready+16
  Fire_SteadyAim:
    DEGL A 0 A_JumpIfInventory("Firing",1,"FireHold_SteadyAim")
    DEGL A 0 A_PlayWeaponSound("deagle/fire")
    DEGL A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,7)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGL A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-5.00,5.00), 1, 0, 4, 0, frandom(-5.00,5.00))
	DEGL A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,11,39-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGL A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGL A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGL B 1 BRIGHT A_GunFlash
    DEGL B 0 A_GiveInventory("Firing",1)
    DEGL CDEFGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGK L 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGK L 0 A_TakeInventory("Firing",1)
    DEGK L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+16
    DEGK L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  FireHold_SteadyAim:
    DEGL A 0 A_JumpIfNoAmmo("Reload")
    DEGL A 0 A_PlayWeaponSound("deagle/fire")
    DEGL A 0 A_FireCustomMissile("WeaponSmokePuff_BigMuzzle",0,0,6,7)
    DEGL A 1 BRIGHT A_FireCustomMissile("HHCBDEAGLE", frandom(-8.00,8.00), 1, 0, 4, 0, frandom(-8.00,8.00))
	DEGL A 0 A_SpawnItemEx("BulletCasing50AE",Cos(Pitch)*30,11,39-(Sin(Pitch)*40),Cos(Pitch)*FRandom(2,4),FRandom(3,6),-Sin(Pitch)*FRandom(3,6),0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
    DEGL A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGL A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGL B 1 BRIGHT A_GunFlash
    DEGL B 0 A_GiveInventory("Firing",1)
    DEGL CDEFGH 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGK L 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGK L 0 A_TakeInventory("Firing",1)
    DEGK L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+16
    DEGK L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+16
  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)
    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)
    DEGQ A 0 A_ZoomFactor(1.0)
    DEGQ A 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    DEGQ A 0 A_TakeInventory("Aiming",1)
    DEGQ A 0 A_TakeInventory("Reloading",1)
    DEGQ A 0 ACS_NamedExecuteAlways("RefSpeed",0,0,0,0)
    DEGQ A 0 A_JumpIfInventory("Perk1_SOH_Pro",1,"KnifeAttack_SOH")
    DEGQ A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_Commando")
    DEGQ A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    DEGQ AB 1
    DEGQ C 1 A_PlaySound("knife/swing")
    DEGQ D 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    DEGQ EF 1
    TNT1 AAA 5
    DEGQ L 0 A_TakeInventory("ThrowingGrenade",1)
    DEGQ L 0 A_TakeInventory("KnifeAttack",1)
    DEGK A 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_Commando:
    DEGQ A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    DEGQ AB 1
    DEGQ C 1 A_PlaySound("knife/swing")
    DEGQ D 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    DEGQ EF 1
    TNT1 AAA 5
    DEGQ L 0 A_TakeInventory("ThrowingGrenade",1)
    DEGQ L 0 A_TakeInventory("KnifeAttack",1)
    DEGK A 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH:
    DEGQ A 0 A_JumpIfInventory("Perk3_Commando",1,"KnifeAttack_SOH_Commando")
    DEGQ A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    DEGQ AB 1
    DEGQ C 1 A_PlaySound("knife/swing")
    DEGQ D 1 A_CustomPunch(102,1,0,"KnifePuff",104)
    DEGQ EF 1
    TNT1 A 5
    DEGQ L 0 A_TakeInventory("ThrowingGrenade",1)
    DEGQ L 0 A_TakeInventory("KnifeAttack",1)
    DEGK A 2
	M4CA C 0 A_JumpIfInventory("AltFireHeld",1,"PostReloadAlt")
    Goto Ready+3
  KnifeAttack_SOH_Commando:
    DEGQ A 0 ACS_NamedExecuteAlways("RefSlash",0,0,0,0)
    DEGQ AB 1
    DEGQ C 1 A_PlaySound("knife/swing")
    DEGQ D 1 A_CustomPunch(102,1,0,"KnifePuff",160)
    DEGQ EF 1
    TNT1 A 5
    DEGQ L 0 A_TakeInventory("ThrowingGrenade",1)
    DEGQ L 0 A_TakeInventory("KnifeAttack",1)
    DEGK A 2
	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:
    DEGK KJIHGFEDCBA 2 A_WeaponReady(WRF_NOPRIMARY)
    DEGK 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("DeagleDropped",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("DeagleThrown",0,0,7,2)
	stop
  }
}

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

actor "Desert Beagle" : "IMI Desert Eagle" // Because Dogs
{
  obituary "%k barked at %o. WAN."
  inventory.pickupmessage "Be proud, Miss Sun! \(^O^)/"
  //attacksound "deagle/fire"
  weapon.selectionorder 49
  weapon.ammotype "DeagleClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "DeagleAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0
  states
  {
  Ready:
    TNT1 A 2 A_PlaySoundEx("weapon/draw","SoundSlot5")
    DEGA ABCDEFGHI 1 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
    DEGA JK 2 A_WeaponReady(WRF_NOPRIMARY|WRF_ALLOWZOOM)
    DEGA L 0 A_JumpIfNoAmmo("Reload")
    DEGA L 0 A_JumpIfInventory("Aiming",1,5)
    DEGA L 0 A_JumpIfInventory("Reloading",1,"Reload")
    DEGA L 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    DEGA L 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGA L 1 A_WeaponReady(WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+12
    DEGC F 0 A_JumpIfInventory("Reloading",1,"Reload")
  ReadyAim:
    DEGC F 0 A_JumpIfInventory("ThrowingGrenade",1,"FragGrenade")
    DEGC F 0 A_JumpIfInventory("KnifeAttack",1,"KnifeAttack")
    DEGC F 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWRELOAD|WRF_ALLOWZOOM)
    Goto Ready+18
  Fire:
    DEGA L 0 A_JumpIfInventory("Aiming",1,"FireAim")
    DEGA L 1 A_JumpIfNoAmmo("ReloadStart")
    DEGB A 0 A_JumpIfInventory("Perk3_SteadyAim",1,"Fire_SteadyAim")
    DEGB A 0 A_JumpIfInventory("Firing",1,"FireHold")
    DEGB A 0 A_PlayWeaponSound("wan/wan0")
    DEGB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,4)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGB A 1 BRIGHT A_FireCustomMissile("HHCBBEAGLE1", frandom(-6.00,6.00), 0, 6, 4, 0, frandom(-6.00,6.00))
    DEGB A 1 BRIGHT A_FireCustomMissile("HHCBBEAGLE2", frandom(-6.00,6.00), 0, 6, 4, 0, frandom(-6.00,6.00))
    DEGB A 1 BRIGHT A_FireCustomMissile("HHCBBEAGLE3", frandom(-6.00,6.00), 1, 6, 4, 0, frandom(-6.00,6.00))
    Goto FireCont
  FireCont:
    DEGB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGB A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGB B 1 BRIGHT A_GunFlash
    DEGB B 0 A_GiveInventory("Firing",1)
    DEGB CDEFGHI 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGA L 0 A_TakeInventory("Firing",1)
    DEGA L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+12
    DEGA L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+12
  FireHold:
    DEGB A 0 A_JumpIfNoAmmo("Reload")
    DEGB A 0 A_PlayWeaponSound("wan/wan0")
    DEGB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,4)
    DEGB A 0 BRIGHT A_FireCustomMissile("HHCBBEAGLE1", frandom(-10.00,10.00), 0, 6, 4, 0, frandom(-10.00,10.00))
    DEGB A 0 BRIGHT A_FireCustomMissile("HHCBBEAGLE2", frandom(-10.00,10.00), 0, 6, 4, 0, frandom(-10.00,10.00))
    DEGB A 1 BRIGHT A_FireCustomMissile("HHCBBEAGLE3", frandom(-10.00,10.00), 1, 6, 4, 0, frandom(-10.00,10.00))
    Goto FireHoldCont
  FireHoldCont:
    DEGB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGB A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGB B 1 BRIGHT A_GunFlash
    DEGB B 0 A_GiveInventory("Firing",1)
    DEGB CDEFGHI 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGA L 0 A_TakeInventory("Firing",1)
    DEGA L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+12
    DEGA L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+12
  FireAim:
    DEGC F 1 A_JumpIfNoAmmo("ReloadStart")
    DEGD A 0 A_JumpIfInventory("Firing",1,"FireAimHold")
    DEGD A 0 A_PlayWeaponSound("wan/wan0")
    DEGD A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,8)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGD A 0 BRIGHT A_FireCustomMissile("HHCBBEAGLE1", frandom(-1.20,1.20), 0, 0, 8, 0, frandom(-1.20,1.20))
    DEGD A 0 BRIGHT A_FireCustomMissile("HHCBBEAGLE2", frandom(-1.20,1.20), 0, 0, 8, 0, frandom(-1.20,1.20))
    DEGD A 1 BRIGHT A_FireCustomMissile("HHCBBEAGLE3", frandom(-1.20,1.20), 1, 0, 8, 0, frandom(-1.20,1.20))
    Goto FireAimCont
  FireAimCont:
    DEGD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGD A 0 A_JumpIfNoAmmo("FireAimEmpty")
    DEGD B 1 BRIGHT A_GunFlash
    DEGD B 0 A_GiveInventory("Firing",1)
    DEGD CDEFGHI 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGC F 0 A_TakeInventory("Firing",1)
    DEGC F 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+18
    DEGC F 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+18
  FireAimHold:
    DEGD A 0 A_PlayWeaponSound("wan/wan0")
    DEGD A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,0,8)
    DEGD A 0 BRIGHT A_FireCustomMissile("HHCBBEAGLE1", frandom(-3.60,3.60), 0, 0, 8, 0, frandom(-3.60,3.60))
    DEGD A 0 BRIGHT A_FireCustomMissile("HHCBBEAGLE2", frandom(-3.60,3.60), 0, 0, 8, 0, frandom(-3.60,3.60))
    DEGD A 1 BRIGHT A_FireCustomMissile("HHCBBEAGLE3", frandom(-3.60,3.60), 1, 0, 8, 0, frandom(-3.60,3.60))
    Goto FireAimHoldCont
  FireAimHoldCont:
    DEGD A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGD A 0 A_JumpIfNoAmmo("FireAimEmpty")
    DEGD B 1 BRIGHT A_GunFlash
    DEGD B 0 A_GiveInventory("Firing",1)
    DEGD CDEFGHI 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGC F 0 A_TakeInventory("Firing",1)
    DEGC F 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+18
    DEGC F 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+18
  Fire_SteadyAim:
    DEGB A 0 A_JumpIfInventory("Firing",1,"FireHold_SteadyAim")
    DEGB A 0 A_PlayWeaponSound("wan/wan0")
    DEGB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,4)
    "####" # 0 A_FireBullets(0.0, 0.0, 0, 0, "HHTag", FBF_NOFLASH, 4096)
    DEGB A 0 BRIGHT A_FireCustomMissile("HHCBBEAGLE1", frandom(-4.00,4.00), 0, 6, 4, 0, frandom(-4.00,4.00))
    DEGB A 0 BRIGHT A_FireCustomMissile("HHCBBEAGLE2", frandom(-4.00,4.00), 0, 6, 4, 0, frandom(-4.00,4.00))
    DEGB A 1 BRIGHT A_FireCustomMissile("HHCBBEAGLE3", frandom(-4.00,4.00), 1, 6, 4, 0, frandom(-4.00,4.00))
    Goto Fire_SteadyAimCont
  Fire_SteadyAimCont:
    DEGB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGB A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGB B 1 BRIGHT A_GunFlash
    DEGB B 0 A_GiveInventory("Firing",1)
    DEGB CDEFGHI 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGA L 0 A_TakeInventory("Firing",1)
    DEGA L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+12
    DEGA L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+12
  FireHold_SteadyAim:
    DEGB A 0 A_JumpIfNoAmmo("Reload")
    DEGB A 0 A_PlayWeaponSound("wan/wan0")
    DEGB A 0 A_FireCustomMissile("WeaponSmokePuffShotgun",0,0,6,4)
    DEGB A 0 BRIGHT A_FireCustomMissile("HHCBBEAGLE1", frandom(-7.00,7.00), 0, 6, 4, 0, frandom(-7.00,7.00))
    DEGB A 0 BRIGHT A_FireCustomMissile("HHCBBEAGLE2", frandom(-7.00,7.00), 0, 6, 4, 0, frandom(-7.00,7.00))
    DEGB A 1 BRIGHT A_FireCustomMissile("HHCBBEAGLE3", frandom(-7.00,7.00), 1, 6, 4, 0, frandom(-7.00,7.00))
    Goto FireHold_SteadyAimCont
  FireHold_SteadyAimCont:
    DEGB A 0 BRIGHT ACS_NamedExecuteAlways("RefKick",0,0,0,0)
    DEGB A 0 A_JumpIfNoAmmo("FireEmpty")
    DEGB B 1 BRIGHT A_GunFlash
    DEGB B 0 A_GiveInventory("Firing",1)
    DEGB CDEFGHI 1 A_WeaponReady(WRF_NOBOB|WRF_ALLOWZOOM)
    DEGA L 0 A_TakeInventory("Firing",1)
    DEGA L 0 A_JumpIfInventory("DeagleAmmo",1,1)
    Goto Ready+12
    DEGA L 0 A_JumpIfNoAmmo("ReloadStart")
    Goto Ready+12
  }
}


actor DeaglePickup : CustomInventory
{
  inventory.pickupmessage "You got the IMI Desert Eagle. Bring the pain."
  inventory.pickupsound "deagle/bolt"
  +INVENTORY.AUTOACTIVATE
  //inventory.respawntics 70
  scale 0.11
  States
  {
  Spawn:
    WEP2 D -1
    stop
  Pickup:
    WEP2 D 0
    WEP2 D 0 A_JumpIf((ACS_NamedExecuteWithResult("RefCheckVar",0,0,0)) == 1, "PickupStay")
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle Ex Mags",1,"AmmoPickup")
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle Akimbo",1,"AmmoPickup")
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle Tac Knife",1,"AmmoPickup")
    WEP2 D 0 A_JumpIfInventory("Desert Beagle",1,"AmmoPickup")
    WEP2 D 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 D 0 A_JumpIfInventory("MaxWeaponsFilled",90,"FailPickup2")
	WEP2 D 0 A_GiveInventory("MaxWeaponsFilled",11)
    WEP2 D 0 ACS_NamedExecuteWithResult("RefPickU",30,0,0)
    stop
  PickupStay:
    WEP2 D 0
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle",1,"FailPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle Ex Mags",1,"FailPickup")
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle Akimbo",1,"FailPickup")
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle Tac Knife",1,"FailPickup")
    WEP2 D 0 A_JumpIfInventory("Desert Beagle",1,"FailPickup")
    WEP2 D 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 D 0 A_JumpIfInventory("MaxWeaponsFilled",90,"FailPickup2")
	WEP2 D 0 A_GiveInventory("MaxWeaponsFilled",11)
    WEP2 D 0 ACS_NamedExecuteWithResult("RefPickU",30,0,0)
    WEP2 D 0 ACS_NamedExecuteWithResult("RefPickC",30,0,0)
    WEP2 D 0 A_PlaySound("deagle/bolt")
    fail
  AmmoPickup:
    WEP2 D 0
    WEP2 D 0 A_JumpIfInventory("DeagleAmmo",0,"FailPickup")
    WEP2 D 0 A_GiveInventory("DeagleAmmo",7)
    stop
  OneManArmy:
    WEP2 D 0
	WEP2 D 0 A_JumpIfInventory("MaxWeaponsFilled",127,"FailPickup2")
	WEP2 D 0 A_GiveInventory("MaxWeaponsFilled",11)
	WEP2 D 0 ACS_NamedExecuteWithResult("RefPickU",30,0,0)
	stop
  FailPickup:
    WEP2 D 1
    fail
  FailPickup2:
    WEP2 D 1
    WEP2 D 0 ACS_NamedExecuteAlways("RefSlots",0,3,0,0)
    fail
  }
}

actor DeagleDrop : DeaglePickup
{
  States
  {
  Spawn:
    WEP2 D -1
    stop
  Pickup:
    WEP2 D 0
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle Ex Mags",1,"AmmoPickup")
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle Akimbo",1,"AmmoPickup")
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle Tac Knife",1,"AmmoPickup")
    WEP2 D 0 A_JumpIfInventory("Desert Beagle",1,"AmmoPickup")
    WEP2 D 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 D 0 A_JumpIfInventory("MaxWeaponsFilled",90,"FailPickup2")
	WEP2 D 0 A_GiveInventory("MaxWeaponsFilled",11)
    WEP2 D 0 ACS_NamedExecuteWithResult("RefPickU",30,0,0)
    stop
  }
}

actor DeagleDrop2 : DeagleDrop
{
  States
  {
  Spawn:
    WEP2 D -1
    stop
  Pickup:
    WEP2 D 0
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle",1,"AmmoPickup") // If the player already has this weapon, they get more ammo for it
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle Ex Mags",1,"AmmoPickup")
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle Akimbo",1,"AmmoPickup")
    WEP2 D 0 A_JumpIfInventory("IMI Desert Eagle Tac Knife",1,"AmmoPickup")
    WEP2 D 0 A_JumpIfInventory("Desert Beagle",1,"AmmoPickup")
    WEP2 D 0 A_JumpIfInventory("Perk1_OneManArmy",1,"OneManArmy")
    WEP2 D 0 A_JumpIfInventory("MaxWeaponsFilled",90,"FailPickup2")
	WEP2 D 0 A_GiveInventory("MaxWeaponsFilled",11)
    WEP2 D 0 ACS_NamedExecuteWithResult("RefPickU",30,0,0)
    stop
  AmmoPickup:
    WEP2 D 0
    stop
  }
}

actor HHCBDEAGLE : HHBullet
{
  damage (random(37,43)) //Don't fuck with .50 AE!
  Speed 400
  damagetype "BigPistol"
  States
  {
  Spawn:
    TNT1 A 10
    stop
  Death:
    TNT1 A 0 A_SpawnItemEx("ImpactSmokePuff", 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_SpawnItemEx("ImpactSmokePuff_2", 0, 0, 0, 0, 0, 0, 0, 128, 0)
    TNT1 A 5 A_PlaySound("generic/ricochet")
    stop
  }
}

actor HHCBDEAGLEA : HHCBDEAGLE
{
  damage (random(38,44))
}

actor HHCBBEAGLE1 // Dev Streams can be the most wonderful thing
{
  Projectile
  damage (20)
  Speed 50
  Scale 0.16
  Radius 3
  Height 3
  decal none
  damagetype "Shotgungib"
  +THRUSPECIES
  species "Player"
  deathsound "wan/wan"
  states
  {
  Spawn:
    WANA A 6
    Goto Fly
  Fly:
    "----" A 0 A_ScaleVelocity(0.9)
    "----" A 6 ThrustThingZ(0,9,1,1)
    Goto Fly
  Death:
	"----" A 175 A_Gravity
	"----" A 5 A_FadeOut
    wait
  XDeath:
	"----" A 0 A_Jump(192,2)
    "----" A 0 A_GiveToTarget("HitIndicator",1)
	"----" A 175 A_Gravity
	"----" A 5 A_FadeOut
    wait
  Crash:
	"----" A 0 A_Jump(192,2)
    "----" A 0 A_GiveToTarget("HitIndicator",1)
	"----" A 175 A_Gravity
	"----" A 5 A_FadeOut
    wait
  }
}

actor HHCBBEAGLE2 : HHCBBEAGLE1
{
  states
  {
  Spawn:
    WANA B 6
    Goto Fly
  }
}

actor HHCBBEAGLE3 : HHCBBEAGLE1
{
  states
  {
  Spawn:
    WANA C 6
    Goto Fly
  }
}
