// --------------------------------------------------------------------------
//
//	Beretta M92FS
//
// --------------------------------------------------------------------------

ACTOR Beretta : BaseWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive1 10
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Magazine9mm"
	Weapon.AmmoType2 "BerettaAmmo"
	Weapon.SelectionOrder 15000
	Weapon.UpSound "weapons/weaponholster"
	-WEAPON.CHEATNOTWEAPON
	Weapon.SisterWeapon "DualBeretta"
	Inventory.PickupSound "weapons/pistolup"
	Inventory.Pickupmessage "You got the Pistol!"
	Obituary "%o was shot down by %k's Beretta."
	tag "Pistol"
	Scale 0.6
	States
	{
	Spawn:
		BERT A -1
		Stop

	Select:
		TNT1 A 0 A_JumpIfInventory("IsPlayingAsPurist",1,"PuristGun")
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1001,1)==0,"VanillaGun")
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_Giveinventory("PistolSelected",1)
		TNT1 A 0 A_TakeInventory("StartDualWield",1)
		TNT1 A 0 A_TakeInventory("Unloading",1)
		TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_TakeInventory("TossGrenade",1)
		TNT1 A 0 A_TakeInventory("WeapSpecial",1)
		TNT1 A 0 A_TakeInventory("SwitchFlashlight",1)
		TNT1 A 0 A_TakeInventory("Taunting",1)
		TNT1 A 0 A_TakeInventory("IdleCounter",200)
		TNT1 A 6
		TNT1 A 0 A_Raise
		Wait
		
	Deselect:
		TNT1 A 0 A_PlaySound("weapons/changing")
		TNT1 A 0 A_TakeInventory("Zoomed",1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_SetCrosshair(0)
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,7)
		BERG ABCDE 1
		TNT1 A 0 A_Jump(256,6)
		BE5G ABCDE 1
		TNT1 A 1 A_TakeInventory("PistolFlashlightON",1)
		TNT1 A 0 A_TakeInventory("ADSmode",1)
		TNT1 A 0 A_GunFlash("FlashlightTurnOFF")
		TNT1 A 0 A_TakeInventory("PistolSelected",1)
		TNT1 A 0 A_Lower
		Wait
		
	Ready:
		TNT1 A 0 A_JumpIfInventory("JustStartedGame",1,"WarmUp")
		TNT1 A 0 A_JumpIfInventory("GoFatality",1,"Steady")
		TNT1 A 0 A_PlaySound("weapons/pistolup",5)
	Ready1:
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,6)
		BERG EDCB 1
		TNT1 A 0 A_Jump(256,5)
		BE5G EDCB 1
	Ready2:
		TNT1 A 0 //A_GunFlash
	Ready3:
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"ReadyZoom")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("Taunting",1,"TauntL")
		TNT1 A 0 A_JumpIfInventory("Salute1",1,"Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2",1,"Salute")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload")
		TNT1 A 0 A_JumpIfInventory("WeapSpecial",1,"WeapSpecial")
		TNT1 A 0 A_JumpIfInventory("SwitchFlashlight",1,"WeapSpecial")
		TNT1 A 0 A_JumpIfInventory("StartDualWield",1,"DualWield")
		TNT1 A 0 A_JumpIfInventory("IdleCounter",200,"PlayerIsIdle")
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,2)
		BERG A 1 A_WeaponReady
		Loop
		BE5G A 1 A_WeaponReady
		Loop

	ReadyZoom:
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"ZoomOut")
		TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("Taunting",1,"ZoomOut")
		TNT1 A 0 A_JumpIfInventory("Salute1",1,"ZoomOut")
		TNT1 A 0 A_JumpIfInventory("Salute2",1,"ZoomOut")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"ZoomOut")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"ZoomOut")
		TNT1 A 0 A_JumpIfInventory("WeapSpecial",1,"WeapSpecial")
		TNT1 A 0 A_JumpIfInventory("SwitchFlashlight",1,"WeapSpecial")
		TNT1 A 0 A_JumpIfInventory("StartDualWield",1,"ZoomOut")
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1029)==1,2)
		BERZ D 1 A_WeaponReady
		Loop
		BERZ D 1 A_WeaponReady(WRF_NOSECONDARY)
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1,"ReadyZoom")
		Goto ZoomOut

// --------------------------------------------------------------------------
//
//	Fire
//
// --------------------------------------------------------------------------
		
	Fire:
		TNT1 A 0 A_JumpIfInventory("BerettaAmmo",1,3)
		TNT1 A 0 A_JumpIfInventory("Magazine9mm",1,1)
		Goto DryFire
		TNT1 A 0
		Goto Reload
		TNT1 A 0 A_SpawnItemEx("PlayerMuzzle1",30,0,45)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"FireZoom")
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,"FireSilencer")
		TNT1 A 0 A_PlaySound("PISFIRE",1)
		TNT1 A 0 A_ZoomFactor(0.98)
		BERF A 1 BRIGHT A_FireBullets (1.2,1.2,-1,9,"HitPuff",1)
		TNT1 A 0 A_setpitch(pitch-0.6)
		TNT1 A 0 A_FireCustomMissile("Tracer",frandom(-2,2),0,-1,0,0,frandom(-2,2))
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor",0,0,0,0)
		TNT1 A 0 A_TakeInventory("BerettaAmmo",1)
		BERF B 1 A_setpitch(pitch+0.1)
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_ZoomFactor(1.00)
		TNT1 A 0 A_FireCustomMissile("9mmCaseSpawn",5,0,6,-8)
		BERF CDC 1 A_setpitch(pitch+0.1)
		BERG A 7 A_WeaponReady
		Goto Ready2

	FireSilencer:
		TNT1 A 0 A_PlaySound("PISFIRE",1,0.3)
		TNT1 A 0 A_PlaySound("SPIFIR",5)
		TNT1 A 0 A_ZoomFactor(0.99)
		BE5F A 1 BRIGHT A_FireBullets (1.2,1.2,-1,9,"HitPuff",1)
		TNT1 A 0 A_setpitch(pitch-0.4)
		TNT1 A 0 A_FireCustomMissile("Tracer",frandom(-2,2),0,-1,0,0,frandom(-2,2))
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor",0,0,0,0)
		TNT1 A 0 A_TakeInventory("BerettaAmmo",1)
		BE5F B 1 A_setpitch(pitch+0.1)
		TNT1 A 0 A_ZoomFactor(1.00)
		TNT1 A 0 A_FireCustomMissile("9mmCaseSpawn",5,0,6,-8)
		BE5F CD 1 A_setpitch(pitch+0.1)
		BE5G A 1
		BE5G A 7 A_WeaponReady
		Goto Ready2

	FireZoom:
		TNT1 A 0 A_ZoomFactor(1.48)
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,4)
		BERZ E 1 BRIGHT A_PlaySound("PISFIRE",1)
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_Jump(256,3)
		BERZ F 1 BRIGHT A_PlaySound("PISFIRE",1,0.3)
		TNT1 A 0 A_PlaySound("SPIFIR",5)
		TNT1 A 0 A_FireBullets (0.6,0.6,-1,9,"HitPuff",1)
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,3)
		TNT1 A 0 A_setpitch(pitch-0.5)
		TNT1 A 0 A_Jump(256,2)
		TNT1 A 0 A_setpitch(pitch-0.3)
		TNT1 A 0 A_FireCustomMissile("Tracer",frandom(-1,1),0,-1,0,0,frandom(-1,1))
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor",0,0,0,0)
		TNT1 A 0 A_TakeInventory("BerettaAmmo",1)
		TNT1 A 0 A_FireCustomMissile("9mmCaseSpawn",5,0,6,-2)
		TNT1 A 0 A_ZoomFactor(1.5)
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,5)
		BERZ GHI 1 A_setpitch(pitch+0.1)
		TNT1 A 0 A_Jump(256,4)
		BERZ GH 1 A_setpitch(pitch+0.1)
		BERZ I 1
		TNT1 A 0
		Goto ReadyZoom

	AltFire:
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"ZoomOut")
		TNT1 A 0 A_Giveinventory("Zoomed",1)
		TNT1 A 0 A_Giveinventory("ADSmode",1)
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_ZoomFactor(1.5)
		BERZ ABCD 1
		TNT1 A 0 A_SetCrosshair(41)
		Goto ReadyZoom
		
	ZoomOut:
		TNT1 A 0 A_TakeInventory("Zoomed",1)
		TNT1 A 0 A_TakeInventory("ADSmode",1)
		TNT1 A 0 A_Giveinventory("GoSpecial",1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_SetCrosshair(0)
		BERZ DCBA 1
		Goto Ready2

// --------------------------------------------------------------------------
//
//	Unload and reload
//
// --------------------------------------------------------------------------

	Reload:
		TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("BerettaAmmo",16,"Ready2")//Don't reload if magazine is full,and there is a bullet in the chamber.
		TNT1 A 0 A_JumpIfInventory("Magazine9mm",1,1)//Do we have any ammo to reload with?
		Goto Ready2
		TNT1 A 0 A_JumpIfInventory("TurboReload",1,"ReloadLoop")
		TNT1 A 0 A_GiveInventory("Pumping",1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_SetCrosshair(0)
		TNT1 A 0 A_TakeInventory("Zoomed",1)
		TNT1 A 0 A_TakeInventory("ADSmode",1)
		TNT1 A 0 A_JumpIfInventory("BerettaAmmo",1,"Reload2")//If there is a bullet in the chamber,go to Reload2.
		TNT1 A 0 A_PlaySound("PistolReload1")
		TNT1 A 0 A_JumpIfInventory("PistolFlashlight",1,"ReloadFlashlight")//If we have a flashlight,show those sprites.
		BERR ZYWXABBCCDDEE 1
		TNT1 A 0 A_JumpIfInventory("HasUnloaded_Pistol",1,2)
		TNT1 A 0 A_FireCustomMissile("EmptyMag9mm",5,0,8,-4)
		BERR FFFFFFFFFFFFGG 1
		BERR HIJ 2
		BERR KKLLLLMMNNOQP 1
		TNT1 A 0 A_TakeInventory("Reloading",1)
		Goto ReloadLoop

	ReloadFlashlight:
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,"ReloadSilencer")//If we also have a silencer,show those sprites.
		BE4R ZYWXABBCCDDEE 1
		TNT1 A 0 A_JumpIfInventory("HasUnloaded_Pistol",1,2)
		TNT1 A 0 A_FireCustomMissile("EmptyMag9mm",5,0,8,-4)
		BE4R FFFFFFFFFFFFGG 1
		BE4R HIJ 2
		BE4R KKLLLLMMNNOQP 1
		TNT1 A 0 A_TakeInventory("Reloading",1)
		Goto ReloadLoop

	ReloadSilencer:
		BE6R ZYWXABBCCDDEE 1
		TNT1 A 0 A_JumpIfInventory("HasUnloaded_Pistol",1,2)
		TNT1 A 0 A_FireCustomMissile("EmptyMag9mm",5,0,8,-4)
		BE6R FFFFFFFFFFFFGG 1
		BE6R HIJ 2
		BE6R KKLLLLMMNNOQP 1
		TNT1 A 0 A_TakeInventory("Reloading",1)
		Goto ReloadLoop

	Reload2:
		TNT1 A 0 A_PlaySound("FASTPISR")
		TNT1 A 0 A_JumpIfInventory("PistolFlashlight",1,"ReloadFlashlight2")//If we have a flashlight,show those sprites.
		BERR ZYWX 1
		BE2R ABBCCDDE 1
		BE2R FFFFFFFFFFFFGG 1
		BE2R HIJ 2
		BE2R KKL 1
		BERR MMNNOQP 1
		TNT1 A 0 A_TakeInventory("Reloading",1)
		Goto ReloadLoop2

	ReloadFlashlight2:
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,"ReloadSilencer2")//If we have a flashlight,show those sprites.
		BE4R ZYWX 1
		BE3R ABBCCDDE 1
		BE3R FFFFFFFFFFFFGG 1
		BE3R HIJ 2
		BE3R KKL 1
		BE4R MMNNOQP 1
		TNT1 A 0 A_TakeInventory("Reloading",1)
		Goto ReloadLoop2

	ReloadSilencer2:
		BE6R ZYWX 1
		BE5R ABBCCDDE 1
		BE5R FFFFFFFFFFFFGG 1
		BE5R HIJ 2
		BE5R KKL 1
		BE6R MMNNOQP 1
		TNT1 A 0 A_TakeInventory("Reloading",1)
		Goto ReloadLoop2

	ReloadLoop:
		TNT1 A 0 A_JumpIfInventory("BerettaAmmo",15,"ReloadDone")
		TNT1 A 0 A_JumpIfInventory("Magazine9mm",1,1)
		Goto ReloadDone
		TNT1 A 0 A_Giveinventory("BerettaAmmo",1)
		TNT1 A 0 A_TakeInventory("Magazine9mm",1)
		Goto ReloadLoop

	ReloadLoop2:
		TNT1 A 0 A_JumpIfInventory("BerettaAmmo",16,"ReloadDone")
		TNT1 A 0 A_JumpIfInventory("Magazine9mm",1,1)
		Goto ReloadDone
		TNT1 A 0 A_Giveinventory("BerettaAmmo",1)
		TNT1 A 0 A_TakeInventory("Magazine9mm",1)
		Goto ReloadLoop2
		
	ReloadDone:
		TNT1 A 0 A_TakeInventory("Reloading",1)
		TNT1 A 0 A_TakeInventory("HasUnloaded_Pistol",1)
		TNT1 A 0 A_Refire
		Goto Ready2
		
	Unload:
		TNT1 A 0 A_TakeInventory("Unloading",1)
		TNT1 A 0 A_JumpIfInventory("BerettaAmmo",1,1)//Check if we have any ammo to unload.
		Goto Ready2
		TNT1 A 0 A_PlaySound("PistolReload1")
		TNT1 A 0 A_GiveInventory("Pumping",1)
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,"UnloadSilencer")//If we have a silencer,show those sprites.
		TNT1 A 0 A_JumpIfInventory("PistolFlashlight",1,"UnloadFlashlight")//If we have a flashlight,show those sprites.
		BERR PQONNMMLKK 1
		BERR JIH 2
		
	UnloadLoop:
		TNT1 A 0 A_JumpIfInventory("BerettaAmmo",1,1)
		Goto UnloadDone
		TNT1 A 0 A_TakeInventory("BerettaAmmo",1)
		TNT1 A 0 A_Giveinventory("Magazine9mm",1)
		Goto UnloadLoop
	
	UnloadDone:
		BERR GGFFFFFFFFFFFFEEDDIIJJKKLLLLMMNNOQP 1
		TNT1 A 0 A_GiveInventory("HasUnloaded_Pistol",1)
		TNT1 A 0 A_TakeInventory("Unloading",1)
		Goto Ready2
		
	UnloadFlashlight:
		BE4R PQONNMMLKK 1
		BE4R JIH 2
		
	UnloadLoopFlashlight:
		TNT1 A 0 A_JumpIfInventory("BerettaAmmo",1,1)
		Goto UnloadDoneFlashlight
		TNT1 A 0 A_TakeInventory("BerettaAmmo",1)
		TNT1 A 0 A_Giveinventory("Magazine9mm",1)
		Goto UnloadLoopFlashlight
	
	UnloadDoneFlashlight:
		BE4R GGFFFFFFFFFFFFEEDDIIJJKKLLLLMMNNOQP 1
		TNT1 A 0 A_GiveInventory("HasUnloaded_Pistol",1)
		TNT1 A 0 A_TakeInventory("Unloading",1)
		Goto Ready2

	UnloadSilencer:
		BE6R PQONNMMLKK 1
		BE6R JIH 2
		
	UnloadLoopSilencer:
		TNT1 A 0 A_JumpIfInventory("BerettaAmmo",1,1)
		Goto UnloadDoneSilencer
		TNT1 A 0 A_TakeInventory("BerettaAmmo",1)
		TNT1 A 0 A_Giveinventory("Magazine9mm",1)
		Goto UnloadLoopSilencer
	
	UnloadDoneSilencer:
		BE6R GGFFFFFFFFFFFFEEDDIIJJKKLLLLMMNNOQP 1
		TNT1 A 0 A_GiveInventory("HasUnloaded_Pistol",1)
		TNT1 A 0 A_TakeInventory("Unloading",1)
		Goto Ready2

// --------------------------------------------------------------------------
//
//	Misc.
//
// --------------------------------------------------------------------------
		
	DualWield:
		TNT1 A 0 A_TakeInventory("StartDualWield",1)
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1028)==0,"NoDualWield")
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1028)==2,"Ready2")
		TNT1 A 0 A_JumpIfInventory("TE_Pistols",2,2)
		TNT1 A 0 A_Print("You must have two pistols to dual wield.")
		Goto Ready2
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,7)
		BERG ABCDE 1
		TNT1 A 0 A_Jump(256,6)
		BE5G ABCDE 1
		TNT1 A 6
		TNT1 A 0 A_TakeInventory("StartDualWield",1)
		TNT1 A 0 A_Giveinventory("PowerSphere2",1)
		Goto Ready
		
	NoDualWield:
		TNT1 A 0 A_Print("Dual wielding is disabled.")
		Goto Ready2
	
	DryFire:
		TNT1 A 0 A_PlaySound("weapons/empty2")
		Goto Ready2
	
	WeapSpecial:
		TNT1 A 0 A_TakeInventory("WeapSpecial",1)
		TNT1 A 0 A_TakeInventory("SwitchFlashlight",1)
		TNT1 A 0 A_JumpIfInventory("PistolFlashlight",1,1)//Check if we have a flashlight.
		Goto Ready2
		TNT1 A 0 A_PlaySound("flashlight/click",5)
		TNT1 A 0 A_JumpIfInventory("PistolFlashlightON",1,3)//Turn on or off?
		
		TNT1 A 0 A_Giveinventory("PistolFlashlightON",1)
		TNT1 A 0 A_GunFlash("FlashlightTurnON")
		Goto Ready2
		
		TNT1 A 0 A_TakeInventory("PistolFlashlightON",1)
		TNT1 A 0 A_GunFlash("FlashlightTurnOFF")
		Goto Ready2

	FlashlightTurnOFF:
		TNT1 A 0
		Stop

	FlashlightTurnON:
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1020,2)==0,"FlashlightOnSimple")
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1020,2)==1,"FlashlightOnLQ")
		TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(1020,2)==2,"FlashlightOnHQ")
		Stop

	FlashlightOnHQ:
		TNT1 A 1
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ1",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ2",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ3",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ4",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ5",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ6",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ7",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ8",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ9",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ10",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ11",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ12",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ13",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ14",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ15",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ16",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ17",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ18",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ19",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ20",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ21",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ22",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ23",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ24",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamHQ25",0,0,0,0)
		//Goto Flash
		//Stop
		Loop

	FlashlightOnLQ:
		TNT1 A 1
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamLQ1",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamLQ2",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamLQ3",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamLQ4",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamLQ5",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamLQ6",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamLQ7",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamLQ8",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamLQ9",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamLQ10",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamLQ11",0,0,0,0)
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamLQ12",0,0,0,0)
		//Goto Flash
		//Stop
		Loop

	FlashlightOnSimple:
		TNT1 A 1
		TNT1 A 0 A_FireCustomMissile("FlashLightBeamSimple",0,0,0,0)
		//Goto Flash
		//Stop
		Loop

	PuristGun:
		TNT1 A 0 A_TakeInventory("Beretta",1)
		TNT1 A 0 A_GiveInventory("ClassicPistol",1)
		Goto Deselect
	
	VanillaGun:
		TNT1 A 0 A_TakeInventory("Beretta",1)
		Goto Deselect

	WarmUp:
		TNT1 A 0 A_TakeInventory("JustStartedGame",1)
		TNT1 A 10 A_WeaponReady
		PUNS ABCD 1 A_WeaponReady
		TNT1 A 0 A_PlaySound("Knuckled")
		PUNS E 7 A_WeaponReady
		PUNS FGFE 3 A_WeaponReady
		PUNS DCB 1 A_WeaponReady
		TNT1 A 10 A_WeaponReady
		Goto Ready
		
// --------------------------------------------------------------------------
//
//	End stuff
//
// --------------------------------------------------------------------------

	TauntFlash:
		TNT1 A 0 A_TakeInventory("PistolFlashlightON",1)
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,"TauntFlashSilencer")
		BERG BCDE 1
		TNT1 A 35
		BERG EDCB 1
		BERG A 1
		Stop
		
	TauntFlashSilencer:
		BE5G BCDE 1
		TNT1 A 35
		BE5G EDCB 1
		BE5G A 1
		Stop

	KickFlash:
		TNT1 A 0 A_TakeInventory("PistolFlashlightON",1)
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,"KickFlashSilencer")
		BERK ABCD 1
		BERK D 8
		BERK DCBA 1
		BERG A 1
		Stop
		
	KickFlashSilencer:
		BE5K ABCD 1
		BE5K D 8
		BE5K DCBA 1
		BE5G A 1
		Stop
		
	AirKickFlash:
		TNT1 A 0 A_TakeInventory("PistolFlashlightON",1)
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,"AirKickFlashSilencer")
		BERK ABCD 1
		BERK D 10
		BERK DCBA 1
		BERG A 1
		Stop
		
	AirKickFlashSilencer:
		BE5K ABCD 1
		BE5K D 10
		BE5K DCBA 1
		BE5G A 1
		Stop
		
	SlideKickStartFlash:
		TNT1 A 0 A_TakeInventory("PistolFlashlightON",1)
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,"SlideKickStartFlashSilencer")
		BERK ABCD 1
		BERK D 17
		Stop
	
	SlideKickEndFlash:
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,"SlideKickEndFlashSilencer")
		BERK DDCBA 2
		BERG A 1
		Stop

	SlideKickStartFlashSilencer:
		BE5K ABCD 1
		BE5K D 17
		Stop
	
	SlideKickEndFlashSilencer:
		BE5K DDCBA 2
		BE5G A 1
		Stop

	GrenadeFlash:
		TNT1 A 0 A_TakeInventory("PistolFlashlightON",1)
		TNT1 A 0 A_JumpIfInventory("PistolSilencerAmmo",1,5)
		BERG BCDE 1
		Stop
		BE5G BCDE 1
		Stop
	}
}

ACTOR BerettaAmmo: Ammo
{
	+INVENTORY.IGNORESKILL
	Inventory.Amount 0
	Inventory.MaxAmount 16
	Ammo.BackpackAmount 0
	Ammo.BackpackMaxAmount 16
   	Inventory.Icon "BERTI0"
}

ACTOR PistolFlashlightON : Inventory { Inventory.MaxAmount 1 }
ACTOR HasUnloaded_Pistol : Inventory { Inventory.MaxAmount 1 }