Actor ExplosiveRifle : Weapon 30392
{
Scale 0.8
+WEAPON.NOAUTOAIM
Weapon.SelectionOrder 7988
Weapon.KickBack 50
Weapon.AmmoType1 "BulletMag"
Weapon.AmmoType2 "BulletMag"
Weapon.AmmoGive1 50
Weapon.AmmoGive2 50
Weapon.AmmoUse1 3
Weapon.AmmoUse2 3
Inventory.PickupSound "items/assaultrifle"
Inventory.PickupMessage "Explosive Rifle."
Obituary "%o was blown to shit by %k's Explosive Rifle."
Tag "Explosive Rifle"
States
	{
	Spawn:
		PGND A -1
		Loop
	Ready:
		EBGN A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("HandGrenadeAction",1,"GrenadeCheck")
		TNT1 A 0 A_JumpIfInventory("MineAction",1,"MineCheck")
		Loop
	Select:
		EBGN A 1 A_Raise
		Loop
	Deselect:
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
		TNT1 A 0 A_TakeInventory("MineAction",1)
		TNT1 A 0 A_TakeInventory("RailgunAction",1)
	DeselectLoop:
		EBGN A 1 A_Lower
		Loop
	Fire:
		EBGN A 2
		EBGN B 1 Bright A_Light1
		TNT1 A 0 Radius_Quake(4,2,0,1,0)
		TNT1 A 0 A_PlaySound("PulseNail/fire",0,1.0,0)
		TNT1 A 0 A_FireCustomMissile("PlayerExplosiveTracer2",0,0,0,6)
		TNT1 A 0 A_FireCustomMissile("ExplosiveBullet",0,1,0,6,0,0)
		TNT1 A 0 A_Recoil(1)
		EBGN C 1 Bright A_Light2
		EBGN DED 1 A_Light0
		EBGN A 8
		TNT1 A 0 A_Refire
		GoTo Ready
	AltFire:
		EBGN A 2
	AltHold:
		EBGN B 1 Bright A_Light1
		TNT1 A 0 Radius_Quake(4,2,0,1,0)
		TNT1 A 0 A_PlaySound("PulseNail/fire",0,1.0,0)
		TNT1 A 0 A_FireCustomMissile("PlayerExplosiveTracer2",Random(-5,5),0,0,6,0,Random(-5,5))
		TNT1 A 0 A_FireCustomMissile("ExplosiveBullet",random(-5,5),1,0,6,0,random(-5,5))
		TNT1 A 0 A_Recoil(1)
		EBGN C 1 Bright A_Light2
		EBGN DED 1 A_Light0
		EBGN B 1 Bright A_Light1
		TNT1 A 0 Radius_Quake(4,2,0,1,0)
		TNT1 A 0 A_PlaySound("PulseNail/fire",0,1.0,0)
		TNT1 A 0 A_FireCustomMissile("PlayerExplosiveTracer2",Random(-5,5),0,0,6,0,Random(-5,5))
		TNT1 A 0 A_FireCustomMissile("ExplosiveBullet",random(-5,5),1,0,6,0,random(-5,5))
		TNT1 A 0 A_Recoil(1)
		EBGN C 1 Bright A_Light2
		EBGN DED 1 A_Light0
		EBGN B 1 Bright A_Light1
		TNT1 A 0 Radius_Quake(4,2,0,1,0)
		TNT1 A 0 A_PlaySound("PulseNail/fire",0,1.0,0)
		TNT1 A 0 A_FireCustomMissile("PlayerExplosiveTracer2",Random(-5,5),0,0,6,0,Random(-5,5))
		TNT1 A 0 A_FireCustomMissile("ExplosiveBullet",random(-5,5),1,0,6,0,random(-5,5))
		TNT1 A 0 A_Recoil(1)
		EBGN C 1 Bright A_Light2
		EBGN DED 1 A_Light0
		EBGN B 1 Bright A_Light1
		TNT1 A 0 Radius_Quake(4,2,0,1,0)
		TNT1 A 0 A_PlaySound("PulseNail/fire",0,1.0,0)
		TNT1 A 0 A_FireCustomMissile("PlayerExplosiveTracer2",Random(-5,5),0,0,6,0,Random(-5,5))
		TNT1 A 0 A_FireCustomMissile("ExplosiveBullet",random(-5,5),1,0,6,0,random(-5,5))
		TNT1 A 0 A_Recoil(1)
		EBGN C 1 Bright A_Light2
		EBGN DED 1 A_Light0
		TNT1 A 0 A_Refire
		EBGN A 8
		GoTo Ready
	GrenadeCheck:
		TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,"GrenadeToss")
		TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
		Goto Ready
	GrenadeToss:
		TNT1 A 0 A_GiveInventory("Hand Grenade")
		TNT1 A 0 A_SelectWeapon("Hand Grenade")
		Goto Deselect
	MineCheck:
		TNT1 A 0 A_JumpIfInventory("MineAmmo",1,"MineToss")
		TNT1 A 0 A_TakeInventory("MineAction",1)
		Goto Ready
	MineToss:
		TNT1 A 0 A_GiveInventory("Land Mine")
		TNT1 A 0 A_SelectWeapon("Land Mine")
		Goto Deselect
	}
}

Actor ExplosiveBullet : ZPulseNail
{
Species "Player"
Damagetype "None"
Damage (random(20,25))
}