// Machinegun

ACTOR Machinegun : IDMWeapon
{
	Weapon.SelectionOrder 900
	Weapon.KickBack 100
	Weapon.AmmoType "IDMClip"
	Weapon.AmmoGive 40
	Weapon.AmmoUse 1
	//Weapon.PreferredSkin "MachinegunMarine"
	Inventory.PickupSound "misc/w_pkup" 
	Inventory.PickupMessage "Machinegun! (Slot 2)"
	Obituary "%o was lit up by %k's Machinegun."
	AttackSound "weapons/machinegun"
	Tag "Machinegun"
 	Decal BulletChip
	Damagetype "Bullet"
	+WEAPON.ALLOW_WITH_RESPAWN_INVUL
	+WEAPON.NOLMS
	States 
	{  
	Ready: 
		TNT1 A 0 A_WeaponReady  
		TNT1 A 0 A_WeaponReady  
		RGUN A 1 A_WeaponReady 
		Loop 
	Deselect: 
		TNT1 A 0 A_Lower  
		TNT1 A 0 A_Lower  
		RGUN 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  
		RGUN 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")
		RGUN C 1 Bright A_FireBullets(3.5, 1.775, -1, 16, "IDMBulletPuff")
		RGUN B 2 Bright A_GunFlash
		RGUN C 1 Bright A_FireBullets(3.5, 1.775, -1, 16, "IDMBulletPuff")
		RGUN B 2 Bright A_GunFlash("Flash2")
		RGUN C 1 Bright A_FireBullets(3.5, 1.775, -1, 16, "IDMBulletPuff")
		RGUN B 2 Bright A_GunFlash
		RGUN A 4
		RGUN A 3 A_Refire
		Goto Ready
	Level2:
		TNT1 A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2")
		RGUN C 1 A_FireBullets(3.5, 1.775, 2, 16, "IDMBulletPuff")
		RGUN B 1 A_GunFlash
		RGUN C 1 A_FireBullets(3.5, 1.775, 2, 16, "IDMBulletPuff")
		RGUN B 1 A_GunFlash("Flash2")
		RGUN C 1 A_FireBullets(3.5, 1.775, 2, 16, "IDMBulletPuff")
		RGUN B 1 A_GunFlash
		RGUN C 1 A_FireBullets(3.5, 1.775, 2, 16, "IDMBulletPuff")
		RGUN B 1 A_GunFlash("Flash2")
		RGUN A 4
		RGUN A 3 A_Refire
		Goto Ready 
	Quad:
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(3.5, 1.775, -1, 16, "ExtremePuff")
		RGUN B 2 A_GunFlash
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(3.5, 1.775, -1, 16, "ExtremePuff")
		RGUN B 2 A_GunFlash("Flash2")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(3.5, 1.775, -1, 16, "ExtremePuff")
		RGUN B 2 A_GunFlash
		RGUN A 4
		RGUN A 3 A_Refire
		Goto Ready
	QuadLevel2:
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(3.5, 1.775, 2, 16, "ExtremePuff")
		RGUN B 1 A_GunFlash
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(3.5, 1.775, 2, 16, "ExtremePuff")
		RGUN B 1 A_GunFlash("Flash2")
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(3.5, 1.775, 2, 16, "ExtremePuff")
		RGUN B 1 A_GunFlash
		TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5,1)
		RGUN C 1 A_FireBullets(3.5, 1.775, 2, 16, "ExtremePuff")
		RGUN B 1 A_GunFlash("Flash2")
		RGUN A 4
		RGUN A 3 A_Refire
		Goto Ready
	Flash:
		TNT1 A 2 Bright A_Light1
		Goto LightDone
	Flash2:
		TNT1 AA 2 Bright A_Light1
        Goto LightDone
	Spawn:
		RGUP A -1 Bright
		Stop
	}
}