actor M16 : Weapon
{
  Game Doom
  Weapon.SelectionOrder 1000
  weapon.ammotype "M16Clip"
  weapon.ammouse 1
  weapon.ammogive2 999
  weapon.ammogive1 999
  weapon.ammotype2 "M16Ammo"
  Obituary "$OB_MPPISTOL" // "%o was tickled by %k's pea shooter."
  Inventory.Pickupmessage "You go the M16 bitchen!" 
  States
  {
  Ready:
	M1GE A 0 A_JumpIfInventory("thrownade",1,"ThrowGrenade")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
	AK47 A 0 A_JumpIfInventory("Kinfeammo",1,"UseKnife")
    M16G A 1 A_WeaponReady
    Loop
  Deselect:
    M16G A 0 A_Lower
    M16G A 0 A_Lower
    M16G A 1 A_Lower
    Loop
  Select:
    M16G A 0 A_Raise
    M16G A 0 A_Raise
    M16G A 1 A_Raise
    Loop
  Fire:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 0 A_jumpifnoammo("Reload")
    M16F A 0 A_jumpifinventory("deadshot",1,"Fire_deadshot")
    M16F A 0 A_jumpifinventory("doubletap",1,"Fire_doubletap")
    M16F A 0 A_playsound("m16/fire")
    M16F A 4 A_FireBullets(5.5,3.3,1,random(283,283),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16F B 0 A_playsound("m16/fire")
	M16F B 4 A_FireBullets(5.5,3.3,1,random(283,283),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16F A 0 A_playsound("m16/fire")
    M16F A 4 A_FireBullets(5.5,3.3,1,random(283,283),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16G A 5
    M16G A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 2 A_Refire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 0 A_jumpifnoammo("Reload")
    Goto Ready
  Fire_deadshot:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 0 A_jumpifnoammo("Reload")
    M16F A 0 A_jumpifinventory("doubletap",1,"Fire_doubletapdeadshot")
    M16F A 0 A_playsound("m16/fire")
    M16F A 4 A_FireBullets(2,1.3,1,random(283,283),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16F B 0 A_playsound("m16/fire")
	M16F B 4 A_FireBullets(2,1.3,1,random(283,283),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16F A 0 A_playsound("m16/fire")
    M16F A 4 A_FireBullets(2,1.3,1,random(283,283),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16G A 5
    M16G A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 2 A_Refire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 0 A_jumpifnoammo("Reload")
    Goto Ready
  Fire_doubletapdeadshot:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 0 A_jumpifnoammo("Reload")
    M16F A 0 A_playsound("m16/fire")
    M16F A 3 A_FireBullets(2,1.3,1,random(283,283),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16F B 0 A_playsound("m16/fire")
	M16F B 3 A_FireBullets(2,1.3,1,random(283,283),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16F A 0 A_playsound("m16/fire")
    M16F A 3 A_FireBullets(2,1.3,1,random(283,283),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16G A 4
    M16G A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 1 A_Refire
    M16G A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    Goto Ready
  Fire_doubletap:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 0 A_jumpifnoammo("Reload")
    M16F A 0 A_playsound("m16/fire")
    M16F A 3 A_FireBullets(5.5,3.3,1,random(283,283),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16F B 0 A_playsound("m16/fire")
	M16F B 3 A_FireBullets(5.5,3.3,1,random(283,283),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16F A 0 A_playsound("m16/fire")
    M16F A 3 A_FireBullets(5.5,3.3,1,random(283,283),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16G A 4
    M16G A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 1 A_Refire
    M16G A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    Goto Ready
  Flash:
    TNTT A 2 Bright A_Light1
    Goto LightDone  
  Reload:	
    PIRE A 0 A_takeinventory("IsReloading",1)
    M6RE A 0 A_jumpifinventory("SpeedCola",1,"Reload_speed")
	M6RE A 0 A_jumpifInventory("m16Clip",30,"Ready")
    M6RE A 0 A_JumpIfInventory("m16ammo", 1, 1)
	goto ready+1
	M6RE E 0 A_playsound("m16/clipout")
    M6RE ABCDE 2
    M6RE E 20
	goto reload2
  Reload2:
	M6RE E 0 A_giveinventory("m16clip",1)
	M6RE E 0 A_takeinventory("m16ammo",1)
	M6RE E 0 
	M6RE E 0 A_jumpifinventory("m16clip",30,"ReloadDone")
	M6RE E 0 A_jumpifinventory("m16ammo",1,"reload2")
	goto reloaddone
  Reloaddone:
    M6RE E 15 
    M6RE E 0 A_playsound("m16/clipin")
    M6RE E 16 
    M6RE E 4 A_playsound("m16/bolt")
	M6RE EDCBA 2
	goto ready
  Reload_speed:
	M6RE A 0 A_jumpifInventory("m16Clip",30,"Ready")
    M6RE A 0 A_JumpIfInventory("m16ammo", 1, 1)
	goto ready+1
	M6RE E 0 A_playsound("m16/clipout")
    M6RE ABCDE 1
    M6RE E 15
	goto reload2_speed
  Reload2_speed:
	M6RE E 0 A_giveinventory("m16clip",1)
	M6RE E 0 A_takeinventory("m16ammo",1)
	M6RE E 0 
	M6RE E 0 A_jumpifinventory("m16clip",30,"ReloadDone_speed")
	M6RE E 0 A_jumpifinventory("m16ammo",1,"reload2_speed")
	goto reloaddone_speed
  Reloaddone_speed:
    M6RE E 10 
    M6RE E 0 A_playsound("m16/clipin")
    M6RE E 10 
    M6RE E 2 A_playsound("m16/bolt")
	M6RE EDCBA 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
  Spawn:
    M16P A -1
    Stop
  }
}


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


actor M16Ammo : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 60
    inventory.maxamount 120
    ammo.backpackamount 60
    ammo.backpackmaxamount 120
    +IGNORESKILL
    inventory.pickupmessage "Got Pistol! rounds!"  
    States
    {
    Spawn:
      CLIP A -1
      Stop
    }
}

actor PAPM16Ammo : Ammo
{
    inventory.icon "CLIPA0"
    inventory.amount 60
    inventory.maxamount 420
    ammo.backpackamount 60
    ammo.backpackmaxamount 420
    +IGNORESKILL
    inventory.pickupmessage "Got Pistol! rounds!"  
    States
    {
    Spawn:
      CLIP A -1
      Stop
    }
}

actor PAPM16 : Weapon
{
  Game Doom
  Weapon.SelectionOrder 1900
  weapon.ammotype "PAPM16Clip"
  weapon.ammouse 1
  weapon.ammogive2 999
  weapon.ammogive1 999
  weapon.ammotype2 "PAPM16Ammo"
  Obituary "$OB_MPPISTOL" // "%o was tickled by %k's pea shooter."
  Inventory.Pickupmessage "You go the Skullcrusher bitchen!" 
  States
  {
  Ready:
	M1GE A 0 A_JumpIfInventory("thrownade",1,"ThrowGrenade")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
	AK47 A 0 A_JumpIfInventory("Kinfeammo",1,"UseKnife")
    M16G A 1 A_WeaponReady
    Loop
  Deselect:
    M16G A 0 A_Lower
    M16G A 0 A_Lower
    M16G A 1 A_Lower
    Loop
  Select:
    M16G A 0 A_Raise
    M16G A 0 A_Raise
    M16G A 1 A_Raise
    Loop
  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
  Fire:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 0 A_jumpifnoammo("Reload")
    M16F A 0 A_jumpifinventory("deadshot",1,"Fire_deadshot")
    M16F A 0 A_jumpifinventory("doubletap",1,"Fire_doubletap")
    M16F A 0 A_playsound("m16/fire")
    M16F A 4 A_FireBullets(2.9,1.5,1,random(1450,1450),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16F B 0 A_playsound("m16/fire")
	M16F B 4 A_FireBullets(2.9,1.5,1,random(1450,1450),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2) 
    M16G A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 4 A_Refire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload")  
    M16G A 0 A_jumpifnoammo("Reload")
    Goto ready
  Fire_deadshot:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 0 A_jumpifnoammo("Reload")
    M16F A 0 A_jumpifinventory("doubletap",1,"Fire_doubletapdeadshot")
    M16F A 0 A_playsound("m16/fire")
    M16F A 4 A_FireBullets(1.6,1,1,random(1450,1450),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16F B 0 A_playsound("m16/fire")
	M16F B 4 A_FireBullets(1.6,1,1,random(1450,1450),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2) 
    M16G A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 4 A_Refire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload")  
    M16G A 0 A_jumpifnoammo("Reload")
    Goto ready
  Fire_doubletapdeadshot:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 0 A_jumpifnoammo("Reload")
    M16F A 0 A_playsound("m16/fire")
    M16F A 3 A_FireBullets(1.6,1,1,random(1450,1450),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16F B 0 A_playsound("m16/fire")
	M16F B 3 A_FireBullets(1.6,1,1,random(1450,1450),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16G A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 3 A_Refire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 0 A_jumpifnoammo("Reload")
    Goto Ready
  Fire_doubletap:
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 0 A_jumpifnoammo("Reload")
    M16F A 0 A_playsound("m16/fire")
    M16F A 3 A_FireBullets(2.9,1.5,1,random(1450,1450),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16F B 0 A_playsound("m16/fire")
	M16F B 3 A_FireBullets(2.9,1.5,1,random(1450,1450),"bulletPuff",1)
	TNTT A 0 A_FireCustomMissile("BulletCasingSpawner",0,0,-6,2)
    M16G A 0 A_jumpifnoammo("Reload")
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 3 A_Refire
    AUG1 A 0 A_JumpIfInventory("IsReloading",1,"Reload") 
    M16G A 0 A_jumpifnoammo("Reload")
    Goto Ready
  Flash:
    TNTT A 0 Bright A_Light1
    Goto LightDone  
  Reload:	
    PIRE A 0 A_takeinventory("IsReloading",1)
    M6RE A 0 A_jumpifinventory("SpeedCola",1,"Reload_speed")
	M6RE A 0 A_jumpifInventory("PAPm16Clip",30,"Ready")
    M6RE A 0 A_JumpIfInventory("PAPm16ammo", 1, 1)
	goto ready+1
	M6RE E 0 A_playsound("m16/clipout")
    M6RE ABCDE 2
    M6RE E 20
	goto reload2
  Reload2:
	M6RE E 0 A_giveinventory("PAPm16clip",1)
	M6RE E 0 A_takeinventory("PAPm16ammo",1)
	M6RE E 0 
	M6RE E 0 A_jumpifinventory("PAPm16clip",30,"ReloadDone")
	M6RE E 0 A_jumpifinventory("PAPm16ammo",1,"reload2")
	goto reloaddone
  Reloaddone:
    M6RE E 15 
    M6RE E 0 A_playsound("m16/clipin")
    M6RE E 16 
    M6RE E 4 A_playsound("m16/bolt")
	M6RE EDCBA 2
	goto ready
  Reload_speed:
	M6RE A 0 A_jumpifInventory("PAPm16Clip",30,"Ready")
    M6RE A 0 A_JumpIfInventory("PAPm16ammo", 1, 1)
	goto ready+1
	M6RE E 0 A_playsound("m16/clipout")
    M6RE ABCDE 1
    M6RE E 15
	goto reload2_speed
  Reload2_speed:
	M6RE E 0 A_giveinventory("PAPm16clip",1)
	M6RE E 0 A_takeinventory("PAPm16ammo",1)
	M6RE E 0 
	M6RE E 0 A_jumpifinventory("PAPm16clip",30,"ReloadDone_speed")
	M6RE E 0 A_jumpifinventory("PAPm16ammo",1,"reload2_speed")
	goto reloaddone_speed
  Reloaddone_speed:
    M6RE E 10 
    M6RE E 0 A_playsound("m16/clipin")
    M6RE E 11 
    M6RE E 2 A_playsound("m16/bolt")
	M6RE EDCBA 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
  Spawn:
    M16P A -1
    Stop
  }
}


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