// --------------------------------------------------------------------------
//
// Bumpmine (Weapon)
//
// --------------------------------------------------------------------------

ACTOR "Bumpmine" : CSDMOWeapon //5010
{

+CHEATNOTWEAPON
//+AMMO_OPTIONAL

	Weapon.SelectionOrder 1900
  weapon.ammotype "BumpmineClip"
  weapon.ammouse 1
  weapon.ammogive 0
  weapon.ammotype2 "9mmAmmo"
  weapon.ammouse2 0
  weapon.ammogive2 0 //30
	obituary "%k killed %o with Bumpmine."
	+WEAPON.WIMPY_WEAPON
	Inventory.Pickupmessage "Picked up a Bumpmine"
	Tag "Bumpmine"
	Weapon.UpSound "Bumpmine/Ready"
	//AttackSound "Bumpmine/Fire"
	Scale 0.16

	States
	{
	Ready:
		W47C A 1 A_WeaponReady
		Loop



	Deselect:
TNT1 A 1 A_TakeInventory("Grenade_BlockMemo",1)
	TNT1 A 0 ACS_NamedExecuteAlways("HSPreviousWeapon", 0, 2, 0, 0)
    TNT1 A 0
	Goto DeselectLoop

	Select:
	TNT1 A 1 A_Raise
	TNT1 AA 0 A_Raise
	TNT1 A 0 ACS_ExecuteAlways(798, 0, 220, 0, 0)//Weapon Weight
	W47A B 1 A_TakeInventory("CrosshairType",2)

	TNT1 A 0 ACS_NamedExecuteAlways("HSPreviousWeapon", 0, 1, 0, 0)
    TNT1 A 0 A_JumpIfInventory("RAT_Trigger",1,"RAT_TriggerSelect")

		W47A CDEFGHIJKLMNOPQR 1 A_WEAPONREADY(WRF_NOFIRE)
		W47A STUVWXYZ 1 A_WeaponReady
		W47B CDEFGH 1 A_WEAPONREADY
		Goto Ready

	Rat_TriggerSelect:
    TNT1 A 0 A_TakeInventory("Rat_Trigger",1)

		W47A CDEFGHIJKLMNOPQR 1 A_WEAPONREADY(WRF_NOFIRE)
		W47A STUVWXYZ 1 A_WeaponReady
		W47B CDEFGH 1 A_WEAPONREADY
		Goto Ready

	Fire:

	W47C A 0 A_JumpIfNoAmmo("Ready")
	
	
		W47D A 0 A_GunFlash
		W47D ABCDEFGHIJKLMNOPQRSTUVWXY 1 A_WeaponReady(WRF_NOFIRE)
		TNT1 A 0 A_Refire
		Goto Ready







	Flash:
	TNT1 A 0 ACS_ExecuteAlways(799, 0, 0, 0, 0)
	TNT1 A 0 A_GiveInventory("CrosshairGrow", 6)
	TNT1 A 0 A_FireCustomMissile("WeaponSmokePuff",0,0,16,1)
		TNT1 A 0 Bright A_Light1
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_PlaySound ("Bumpmine/FIRE")
//		TNT1 A 0 A_PlaySound("Bumpmine/Distant", 7)
		TNT1 A 0 A_FireCustomMissile(HEGRENADEPROJECTILE,0,1,0,3,0,4)//A_GunFlash
		Goto LightDone
 	Spawn:
		W47Z A -1
		Stop
	}
}