// --------------------------------------------------------------------------
//
// Deagle (Demo weapon)
//
// --------------------------------------------------------------------------



ACTOR "m4a1 silenced_RAT" : "M4A1 Silenced" //5010
{
	+POWERED_UP 
	Weapon.SisterWeapon "M4A1 Silenced"

//+AMMO_OPTIONAL

	Weapon.SelectionOrder 1900

  weapon.ammotype1 "556mmAmmo"
  weapon.ammouse1 1
  weapon.ammogive1 20
	obituary "%k killed %o with m4a1 silenced."
	+WEAPON.WIMPY_WEAPON
	Inventory.Pickupmessage "Picked up a silenced m4a1."
	Tag "M4A1 Silenced"
	Weapon.UpSound "m4a1_sil/Ready"
	//AttackSound "Deagle/Fire" 
	Scale 0.2
	//+NOAUTOFIRE

	States
	{

	
	AltFire:
	TNT1 A 0 ACS_Execute(781, 0, 0, 0, 0)
	Goto Ready
	
	/*

	AltFire:
//				TNT1 A 1 A_ZoomFactor(1.0)
		TNT1 A 0 A_PlayWeaponSound("Knife/Slash")
		W19H ABC 1 A_WeaponReady(WRF_NOFIRE)
//	  TNT1 A 0 A_GiveInventory("RAT_Knife_Activated", 1)
		W19H D 1 A_CustomPunch(32, 0, 0, "KnifePuff2", 128)//, 0.175, 50)//A_GunFlash
		W19H EFGHIJKLMNOPQRSQRS 1 A_WeaponReady(WRF_NOFIRE)
//		W19H LMNOPQRSTUVWXYZ 1 A_WeaponReady(WRF_NOFIRE)
		Goto Select_RAT

	Select_RAT:
		TNT1 A 0 A_PlaySound ("M4A1_sil/Ready")
		Goto Select+5	
		*/
		

	Fire:

	W45F H 0 A_JumpIfNoAmmo("Ready")
	TNT1 A 0 A_JumpIfInventory("M4A1_sil_AltFire", 1, "FireSilencer")
	TNT1 A 0 A_JumpIfInventory("IsBot",1,"BotFire")
	
		45WC A 1 A_GunFlash
		45WC B 1 A_WEAPONREADY(WRF_NOFIRE)
		45WC CD 1 A_WEAPONREADY(WRF_NOFIRE)
		TNT1 A 0 A_Refire
		45WC EFGHIJKLMN 1 A_WeaponReady
		Goto Ready



	FireSilencer:

	W45F H 0 A_JumpIfNoAmmo("Ready")
	TNT1 A 0 A_JumpIfInventory("IsBot",1,"BotFire")
	
		W45C A 1 A_GunFlash
		W45C B 1 A_WEAPONREADY(WRF_NOFIRE)
		W45C CD 1 A_WEAPONREADY(WRF_NOFIRE)
		TNT1 A 0 A_Refire
		W45C EFGHIJKLMN 1 A_WeaponReady
		Goto ReadySilencer





	}
}