actor STG-44 : Weapon
{
  Game Doom
  Weapon.SelectionOrder 1500
  weapon.ammotype "STGClip"
  weapon.ammouse 1
  weapon.ammogive 999
  weapon.ammogive2 999
  weapon.ammotype2 "STGAmmo"
  Obituary "$OB_MPPISTOL" // "%o was tickled by %k's pea shooter."
  Inventory.Pickupmessage "$PICKUP_PISTOL_DROPPED" // "Picked up a pistol."
  States
  {
  Ready:
    STGA K 0 acs_executeAlways(675,0,0,0,0)
	STGA A 0 A_JumpIfInventory("thrownade",1,"ThrowGrenade")
    STGA A 0 A_JumpIfInventory("IsReloading",1,"Reload")
	STGA A 0 A_JumpIfInventory("Kinfeammo",1,"UseKnife")  
    STGA A 1 A_WeaponReady
    loop  
  TrueReady: 
    STGA D 0 acs_executeAlways(675,0,0,0,0)
    STGA D 0 A_JumpIfNoAmmo("ReloadStartAim")
    STGA D 0 A_JumpIfInventory("IsReloading",1,"ReloadStartAim")
	STGA D 0 A_JumpIfInventory("thrownade",1,"ThrowGrenade")
	STGA D 0 A_JumpIfInventory("Kinfeammo",1,"UseKnife")
    STGA D 1 A_WeaponReady(WRF_NOBOB)
  loop 
  Deselect: 
    STGA A 0 A_Lower
    STGA A 0 A_Lower
    STGA A 1 A_Lower
    STGA A 0 acs_executeAlways(675,0,0,0,0)
    loop
  Select:
    STGA A 0 A_Raise
    STGA A 0 A_Raise
    STGA A 1 A_Raise
    STGA A 0 acs_executeAlways(675,0,0,0,0)
    loop
  Fire:
    STGA L 0 A_JumpIfInventory("Aiming",1,"FireAim")
    STGA L 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA L 0 A_jumpifnoammo("Reload")
    STGA L 0 A_jumpifinventory("deadshot",1,"Fire_deadshot")
    STGA L 0 A_jumpifinventory("Doubletap",1,"Fire_Doubletap")
    STGA H 1 A_playsound("STG/FIRE")
    STGA I 1 bright A_FireBullets (2.4,1.7,-1,random(2500,2500),"BulletPuff")
    STGA J 2
	TNTT J 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    STGA JI 1
    STGA A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA A 0 A_jumpifnoammo("Reload")
	goto ready
  Fire_deadshot:
    STGA L 0 A_JumpIfInventory("Aiming",1,"FireAim")
    STGA L 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA L 0 A_jumpifnoammo("Reload")
    STGA L 0 A_jumpifinventory("Doubletap",1,"Fire_deadshotDoubletap")
    STGA H 1 A_playsound("STG/FIRE")
    STGA I 1 bright A_FireBullets (1.5,1,-1,random(2500,2500),"BulletPuff")
    STGA J 2
	TNTT J 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    STGA JI 1
    STGA A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA A 0 A_jumpifnoammo("Reload")
	goto ready
  Fire_Doubletap:
    STGA L 0 A_JumpIfInventory("Aiming",1,"FireAim")
    STGA L 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA L 0 A_jumpifnoammo("Reload")
    STGA H 1 A_playsound("STG/FIRE")
    STGA I 1 bright A_FireBullets (2.4,1.7,-1,random(2500,2500),"BulletPuff")
    STGA J 1
	TNTT J 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    STGA JI 1
    STGA A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA A 0 A_jumpifnoammo("Reload")
	goto ready
  Fire_deadshotDoubletap:
    STGA L 0 A_JumpIfInventory("Aiming",1,"FireAim")
    STGA L 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA L 0 A_jumpifnoammo("Reload")
    STGA H 1 A_playsound("STG/FIRE")
    STGA I 1 bright A_FireBullets (1.5,1,-1,random(2500,2500),"BulletPuff")
    STGA J 1
	TNTT J 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    STGA JI 1
    STGA A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA A 0 A_jumpifnoammo("Reload")
	goto ready
  altfire:
    STGA B 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    STGA B 0 A_ZoomFactor(1.2)
    STGA BC 2
    STGA C 0 A_GiveInventory("Aiming",1)
    goto TrueReady
   AltFire2:
    STGA C 0 A_ZoomFactor(1.0)
    STGA CB 2
    STGA B 0 A_TakeInventory("Aiming",1)
    goto Ready
  ReloadStartAim:
    STGA C 0 A_ZoomFactor(1.0)
    STGA CB 2
    STGA B 0 A_TakeInventory("Aiming",1)
    STGA B 0 acs_executeAlways(675,0,0,0,0)
    goto reload
  FireAim:
    STGA K 0 A_JumpIfInventory("IsReloading",1,"ReloadStartAim") 
    STGA K 0 A_jumpifnoammo("ReloadStartAim")
    STGA K 0 A_jumpifinventory("Doubletap",1,"FireAim_Doubletap")
    STGA K 0 A_jumpifinventory("deadshot",1,"FireAim_deadshot")
    STGA P 0 A_playsound("STG/FIRE")
	STGA E 1 bright A_FireBullets (1.5,1,-1,random(2500,2500),"BulletPuff")
	STGA F 2 A_FireCustomMissile("BulletCasingSpawner",0,0,3,0)
	STGA G 0 
	STGA GF 1 
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    STGA Q 0 A_ReFire
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    Goto TrueReady
  FireAim_deadshot:
    STGA K 0 A_JumpIfInventory("IsReloading",1,"ReloadStartAim") 
    STGA K 0 A_jumpifnoammo("ReloadStartAim")
    STGA K 0 A_jumpifinventory("Doubletap",1,"")
    STGA K 0 A_jumpifinventory("deadshot",1,"")
    STGA P 0 A_playsound("STG/FIRE")
	STGA E 1 bright A_FireBullets (1,1,-1,random(2500,2500),"BulletPuff")
	STGA F 2 A_FireCustomMissile("BulletCasingSpawner",0,0,3,0)
	STGA G 0 
	STGA GF 1 
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    STGA Q 0 A_ReFire
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    Goto TrueReady
  FireAim_Doubletap:
    STGA K 0 A_JumpIfInventory("IsReloading",1,"ReloadStartAim") 
    STGA K 0 A_jumpifnoammo("ReloadStartAim")
    STGA K 0 A_jumpifinventory("deadshot",1,"FireAim_deadshotDoubletap")
    STGA P 0 A_playsound("STG/FIRE")
	STGA E 1 bright A_FireBullets (1.5,1,-1,random(2500,2500),"BulletPuff")
	STGA F 1 A_FireCustomMissile("BulletCasingSpawner",0,0,3,0)
	STGA G 0 
	STGA GF 1 
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    STGA Q 0 A_ReFire
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    Goto TrueReady
  FireAim_deadshotDoubletap:
    STGA K 0 A_JumpIfInventory("IsReloading",1,"ReloadStartAim") 
    STGA K 0 A_jumpifnoammo("ReloadStartAim")
    STGA K 0 A_jumpifinventory("deadshot",1,"")
    STGA P 0 A_playsound("STG/FIRE")
	STGA E 1 bright A_FireBullets (1,1,-1,random(2500,2500),"BulletPuff")
	STGA F 1 A_FireCustomMissile("BulletCasingSpawner",0,0,3,0)
	STGA G 0 
	STGA GF 1 
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    STGA Q 0 A_ReFire
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    Goto TrueReady
  Reload:
    STGA K 0 acs_executeAlways(675,0,0,0,0)
	STGA A 0 A_TakeInventory("IsReloading",1)
    STGA A 0 A_jumpifinventory("Speedcola", 1,"Reload_speed")
    STGA A 0 A_jumpifinventory("STGClip", 30,"ready")
	STGA A 0 A_jumpifinventory("STGammo", 1, 1)
	goto ready
	STGA KLM 2
	STGA M 20 A_playsound("STG/Clipout")
	goto reload2
  Reload2:
    STGA O 0 A_Giveinventory("STGclip",1)
	STGA O 0 A_Takeinventory("STGammo",1)
    STGA O 0 A_jumpifinventory("STGclip",30,"reloaddone")
	STGA O 0 A_jumpifinventory("STGammo",1,"reload2")
	goto reloaddone
  reloaddone:
	STGA N 2
	STGA N 15 A_playsound("STG/Clipin")
	STGA O 2
	goto ready
  Reload_speed:
	STGA A 0 A_TakeInventory("IsReloading",1)
    STGA A 0 A_jumpifinventory("STGClip", 30,"ready")
	STGA A 0 A_jumpifinventory("STGammo", 1, 1)
	goto ready
	STGA KLM 1
	STGA M 10 A_playsound("STG/Clipout")
	goto reload2_speed
  Reload2_speed:
    STGA O 0 A_Giveinventory("STGclip",1)
	STGA O 0 A_Takeinventory("STGammo",1)
    STGA O 0 A_jumpifinventory("STGclip",30,"reloaddone_speed")
	STGA O 0 A_jumpifinventory("STGammo",1,"reload2_speed")
	goto reloaddone_speed
  reloaddone_speed:
	STGA N 1
	STGA N 7 A_playsound("STG/Clipin")
	STGA O 1
	goto ready
  ThrowGrenade:
     HNDG BCD 1
     HNDG E 1 A_PlaySound("weapons/grenadepin")
     HNDG FGHH 1
     HNDG I 1 A_PlaySound("weapons/grenadethr") 
     HNDG J 0 A_FireCustomMissile("ThrownGrenade",0,0,0,0)
     HNDG J 0 A_PlaySound("weapons/grenadethr")
     HNDG JKLMNOPQ 1
     HNDG Q 0 A_TakeInventory("thrownade")
     Goto Ready
  Useknife:
     KNFG A 0 A_jumpifinventory("Machete",1,"UseMachete")
     KNFG ABC 2
	 KNFG C 0 A_CustomPunch (110,1,0,"KnifePuff")
	 KNFG DEF 2
	 KNFG F 0 A_TakeInventory("Kinfeammo")
	 goto ready
  UseMachete:
     MHT4 ABC 2
	 MHT4 C 0 A_CustomPunch (450,1,0,"Machetepuff")
	 MHT4 DEFG 2
	 MHT4 G 0 A_TakeInventory("Kinfeammo")
	 goto ready
  Flash:
    TNTT A 0
	stop
  Spawn:
    GEWE Z -1
	stop
  }
}


actor STGAmmo : Ammo
{
    inventory.amount 180
    inventory.maxamount 180
    +IGNORESKILL 
}

Actor STGClip : Ammo
{
 Inventory.Amount 1
 Inventory.MaxAmount 30
}

actor Spatz-447 : Weapon
{
  Game Doom
  Weapon.SelectionOrder 1500
  weapon.ammotype "PAPSTGClip"
  weapon.ammouse 1
  weapon.ammogive 999
  weapon.ammogive2 999
  weapon.ammotype2 "PAPSTGAmmo"
  Obituary "$OB_MPPISTOL" // "%o was tickled by %k's pea shooter."
  Inventory.Pickupmessage "$PICKUP_PISTOL_DROPPED" // "Picked up a pistol."
  States
  {
  Ready:
    STGA K 0 acs_executeAlways(675,0,0,0,0)
	STGA A 0 A_JumpIfInventory("thrownade",1,"ThrowGrenade")
    STGA A 0 A_JumpIfInventory("IsReloading",1,"Reload")
	STGA A 0 A_JumpIfInventory("Kinfeammo",1,"UseKnife")  
    STGA A 1 A_WeaponReady
    loop  
  TrueReady: 
    STGA D 0 acs_executeAlways(675,0,0,0,0)
    STGA D 0 A_JumpIfNoAmmo("ReloadStartAim")
    STGA D 0 A_JumpIfInventory("IsReloading",1,"ReloadStartAim")
	STGA D 0 A_JumpIfInventory("thrownade",1,"ThrowGrenade")
	STGA D 0 A_JumpIfInventory("Kinfeammo",1,"UseKnife")
    STGA D 1 A_WeaponReady(WRF_NOBOB)
  loop 
  Deselect: 
    STGA A 0 A_Lower
    STGA A 0 A_Lower
    STGA A 1 A_Lower
    STGA A 0 acs_executeAlways(675,0,0,0,0)
    loop
  Select:
    STGA A 0 A_Raise
    STGA A 0 A_Raise
    STGA A 1 A_Raise
    STGA A 0 acs_executeAlways(675,0,0,0,0)
    loop
  Fire:
    STGA L 0 A_JumpIfInventory("Aiming",1,"FireAim")
    STGA L 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA L 0 A_jumpifnoammo("Reload")
    STGA L 0 A_jumpifinventory("deadshot",1,"Fire_deadshot")
    STGA L 0 A_jumpifinventory("Doubletap",1,"Fire_Doubletap")
    STGA H 1 A_playsound("PAPSTG/FIRE")
    STGA I 1 bright A_FireBullets (2.4,1.7,-1,random(5000,5000),"BulletPuff")
    STGA J 2
	TNTT J 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    STGA JI 1
    STGA A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA A 0 A_jumpifnoammo("Reload")
	goto ready
  Fire_deadshot:
    STGA L 0 A_JumpIfInventory("Aiming",1,"FireAim")
    STGA L 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA L 0 A_jumpifnoammo("Reload")
    STGA L 0 A_jumpifinventory("Doubletap",1,"Fire_deadshotDoubletap")
    STGA H 1 A_playsound("PAPSTG/FIRE")
    STGA I 1 bright A_FireBullets (1.5,1,-1,random(5000,5000),"BulletPuff")
    STGA J 2
	TNTT J 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    STGA JI 1
    STGA A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA A 0 A_jumpifnoammo("Reload")
	goto ready
  Fire_Doubletap:
    STGA L 0 A_JumpIfInventory("Aiming",1,"FireAim")
    STGA L 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA L 0 A_jumpifnoammo("Reload")
    STGA H 1 A_playsound("PAPSTG/FIRE")
    STGA I 1 bright A_FireBullets (2.4,1.7,-1,random(5000,5000),"BulletPuff")
    STGA J 1
	TNTT J 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    STGA JI 1
    STGA A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA A 0 A_jumpifnoammo("Reload")
	goto ready
  Fire_deadshotDoubletap:
    STGA L 0 A_JumpIfInventory("Aiming",1,"FireAim")
    STGA L 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA L 0 A_jumpifnoammo("Reload")
    STGA H 1 A_playsound("PAPSTG/FIRE")
    STGA I 1 bright A_FireBullets (1.5,1,-1,random(5000,5000),"BulletPuff")
    STGA J 1
	TNTT J 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    STGA JI 1
    STGA A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    STGA A 0 A_jumpifnoammo("Reload")
	goto ready
  altfire:
    STGA B 0 A_JumpIfInventory("Aiming",1,"AltFire2")
    STGA B 0 A_ZoomFactor(1.2)
    STGA BC 2
    STGA C 0 A_GiveInventory("Aiming",1)
    goto TrueReady
   AltFire2:
    STGA C 0 A_ZoomFactor(1.0)
    STGA CB 2
    STGA B 0 A_TakeInventory("Aiming",1)
    goto Ready
  ReloadStartAim:
    STGA C 0 A_ZoomFactor(1.0)
    STGA CB 2
    STGA B 0 A_TakeInventory("Aiming",1)
    STGA B 0 acs_executeAlways(675,0,0,0,0)
    goto reload
  FireAim:
    STGA K 0 A_JumpIfInventory("IsReloading",1,"ReloadStartAim") 
    STGA K 0 A_jumpifnoammo("ReloadStartAim")
    STGA K 0 A_jumpifinventory("Doubletap",1,"FireAim_Doubletap")
    STGA K 0 A_jumpifinventory("deadshot",1,"FireAim_deadshot")
    STGA P 0 A_playsound("PAPSTG/FIRE")
	STGA E 1 bright A_FireBullets (1.5,1,-1,random(5000,5000),"BulletPuff")
	STGA F 2 A_FireCustomMissile("BulletCasingSpawner",0,0,3,0)
	STGA G 0 
	STGA GF 1 
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    STGA Q 0 A_ReFire
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    Goto TrueReady
  FireAim_deadshot:
    STGA K 0 A_JumpIfInventory("IsReloading",1,"ReloadStartAim") 
    STGA K 0 A_jumpifnoammo("ReloadStartAim")
    STGA K 0 A_jumpifinventory("Doubletap",1,"")
    STGA K 0 A_jumpifinventory("deadshot",1,"")
    STGA P 0 A_playsound("PAPSTG/FIRE")
	STGA E 1 bright A_FireBullets (1,1,-1,random(5000,5000),"BulletPuff")
	STGA F 2 A_FireCustomMissile("BulletCasingSpawner",0,0,3,0)
	STGA G 0 
	STGA GF 1 
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    STGA Q 0 A_ReFire
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    Goto TrueReady
  FireAim_Doubletap:
    STGA K 0 A_JumpIfInventory("IsReloading",1,"ReloadStartAim") 
    STGA K 0 A_jumpifnoammo("ReloadStartAim")
    STGA K 0 A_jumpifinventory("deadshot",1,"FireAim_deadshotDoubletap")
    STGA P 0 A_playsound("PAPSTG/FIRE")
	STGA E 1 bright A_FireBullets (1.5,1,-1,random(5000,5000),"BulletPuff")
	STGA F 1 A_FireCustomMissile("BulletCasingSpawner",0,0,3,0)
	STGA G 0 
	STGA GF 1 
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    STGA Q 0 A_ReFire
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    Goto TrueReady
  FireAim_deadshotDoubletap:
    STGA K 0 A_JumpIfInventory("IsReloading",1,"ReloadStartAim") 
    STGA K 0 A_jumpifnoammo("ReloadStartAim")
    STGA K 0 A_jumpifinventory("deadshot",1,"")
    STGA P 0 A_playsound("PAPSTG/FIRE")
	STGA E 1 bright A_FireBullets (1,1,-1,random(5000,5000),"BulletPuff")
	STGA F 1 A_FireCustomMissile("BulletCasingSpawner",0,0,3,0)
	STGA G 0 
	STGA GF 1 
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    STGA Q 0 A_ReFire
    STGA Q 0 A_jumpifnoammo("ReloadStartAim")
    Goto TrueReady
  Reload:
    STGA K 0 acs_executeAlways(675,0,0,0,0)
	STGA A 0 A_TakeInventory("IsReloading",1)
    STGA A 0 A_jumpifinventory("Speedcola", 1,"Reload_speed")
    STGA A 0 A_jumpifinventory("PAPSTGClip", 60,"ready")
	STGA A 0 A_jumpifinventory("PAPSTGammo", 1, 1)
	goto ready
	STGA KLM 2
	STGA M 20 A_playsound("STG/Clipout")
	goto reload2
  Reload2:
    STGA O 0 A_Giveinventory("PAPSTGclip",1)
	STGA O 0 A_Takeinventory("PAPSTGammo",1)
    STGA O 0 A_jumpifinventory("PAPSTGclip",60,"reloaddone")
	STGA O 0 A_jumpifinventory("PAPSTGammo",1,"reload2")
	goto reloaddone
  reloaddone:
	STGA N 2
	STGA N 15 A_playsound("STG/Clipin")
	STGA O 2
	goto ready
  Reload_speed:
	STGA A 0 A_TakeInventory("IsReloading",1)
    STGA A 0 A_jumpifinventory("PAPSTGClip", 60,"ready")
	STGA A 0 A_jumpifinventory("PAPSTGammo", 1, 1)
	goto ready
	STGA KLM 1
	STGA M 10 A_playsound("STG/Clipout")
	goto reload2_speed
  Reload2_speed:
    STGA O 0 A_Giveinventory("PAPSTGclip",1)
	STGA O 0 A_Takeinventory("PAPSTGammo",1)
    STGA O 0 A_jumpifinventory("PAPSTGclip",60,"reloaddone_speed")
	STGA O 0 A_jumpifinventory("PAPSTGammo",1,"reload2_speed")
	goto reloaddone_speed
  reloaddone_speed:
	STGA N 1
	STGA N 7 A_playsound("STG/Clipin")
	STGA O 1
	goto ready
  ThrowGrenade:
     HNDG BCD 1
     HNDG E 1 A_PlaySound("weapons/grenadepin")
     HNDG FGHH 1
     HNDG I 1 A_PlaySound("weapons/grenadethr") 
     HNDG J 0 A_FireCustomMissile("ThrownGrenade",0,0,0,0)
     HNDG J 0 A_PlaySound("weapons/grenadethr")
     HNDG JKLMNOPQ 1
     HNDG Q 0 A_TakeInventory("thrownade")
     Goto Ready
  Useknife:
     KNFG A 0 A_jumpifinventory("Machete",1,"UseMachete")
     KNFG ABC 2
	 KNFG C 0 A_CustomPunch (110,1,0,"KnifePuff")
	 KNFG DEF 2
	 KNFG F 0 A_TakeInventory("Kinfeammo")
	 goto ready
  UseMachete:
     MHT4 ABC 2
	 MHT4 C 0 A_CustomPunch (450,1,0,"Machetepuff")
	 MHT4 DEFG 2
	 MHT4 G 0 A_TakeInventory("Kinfeammo")
	 goto ready
  Flash:
    TNTT A 0
	stop
  Spawn:
    GEWE Z -1
	stop
  }
}


actor PAPSTGAmmo : Ammo
{
    inventory.amount 420
    inventory.maxamount 420
    +IGNORESKILL 
}

Actor PAPSTGClip : Ammo
{
 Inventory.Amount 1
 Inventory.MaxAmount 60
}