// Heavy Machinegun

ACTOR HeavyMachinegun : IDMWeapon
{ 
	Weapon.Kickback 25
	Weapon.SelectionOrder 400
	Weapon.AmmoType "IDMClip"
	Weapon.AmmoGive 80
	Weapon.AmmoUse 2
	Inventory.PickupSound "misc/w_pkup"
	Inventory.PickupMessage "Heavy Machinegun! (Slot 4)"
	Obituary "%o was bursted by %k's Heavy Machinegun."
	Tag "Heavy Machinegun"
	AttackSound "weapons/hmgfire"
	Decal BulletChip
	Damagetype "Bullet"
	+WEAPON.NOLMS
	States 
	{  
	Ready: 	
	  HVMG A 1 A_WeaponReady
	  Loop
	Deselect:
	  TNT1 A 0 A_Lower 
	  TNT1 A 0 A_Lower 
	  HVMG A 1 A_Lower 
	  Loop 
	Select: 
	  TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
	Sloop:
	  TNT1 A 0 A_Raise
	  TNT1 A 0 A_Raise
	  HVMG A 1 A_Raise
	  Loop
	Fire: 
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_JumpIfInventory("PowerIDMWeaponLevel2",1,"Level2")
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"Quad")
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "IDMBulletPuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_GunFlash("Flash2")
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "IDMBulletPuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_GunFlash
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "IDMBulletPuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_GunFlash("Flash2")
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "IDMBulletPuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_GunFlash
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "IDMBulletPuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	  Goto FireEnd
	Quad:
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "ExtremePuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_GunFlash("Flash2")
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "ExtremePuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "ExtremePuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_GunFlash("Flash2")
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "ExtremePuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, -1, 25, "ExtremePuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	FireEnd:
	  HVMG A 2 Offset(0,40) A_PlaySound("weapons/hmgrel",CHAN_AUTO)
	  HVMG A 2 Offset(0,39)
	  HVMG A 2 Offset(0,38)
	  HVMG A 2 Offset(0,35)
	  HVMG A 3 Offset(0,32)
	  TNT1 A 0 A_Refire
	  Goto Ready
	Level2:
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_JumpIfInventory("PowerQuadDamage",1,"QuadLevel2")
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, 2, 25, "IDMBulletPuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_GunFlash("Flash2")
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, 2, 25, "IDMBulletPuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	  HVMG A 2 A_Refire
	  Goto Ready
	QuadLevel2:
	  TNT1 A 0 A_GunFlash
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, 2, 25, "ExtremePuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	  TNT1 A 0 A_GunFlash("Flash2")
	  TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
	  HVMG B 1 Bright A_FireBullets(2.8, 1.775, 2, 25, "ExtremePuff")
	  HVMG C 2 Bright
	  TNT1 A 0 A_CheckReload
	  HVMG A 2 A_Refire
	  Goto Ready
	Flash:
	  TNT1 A 4 Bright A_Light1
	  Goto LightDone
	Flash2:
	  TNT1 A 4 Bright A_Light2
	  Goto LightDone
	Spawn:
	  HVMG W -1 Bright
	  Stop
	}
}