ACTOR 1911 : Weapon
{
	Weapon.SelectionOrder 1911
	Weapon.SlotNumber 8
	Weapon.AmmoType "Bullets"
	Weapon.AmmoGive 4
	Weapon.AmmoUse 1
	Weapon.AmmoType2 "ACP"
	Weapon.AmmoUse2 1
	Inventory.Pickupmessage "You got the 1911!"
	Inventory.PickupSound "weapons/fist/swing"
	Obituary "%o was liberated by %k's 1911"
	+WEAPON.NOALERT
	+WEAPON.AMMO_CHECKBOTH
	Tag "1911"
	Weapon.BobStyle "Smooth"
	Weapon.BobSpeed 2.0
	Weapon.BobRangeX 0.30
	Weapon.BobRangeY 0.40
	States
	{
	Deselect:
		1911 A 1 Offset(-5,35)
		1911 A 1 Offset(-15,39)
		1911 A 1 Offset(-30,45)
		1911 A 1 Offset(-40,52)
		HGRL P 1 Offset(-45,60)
		HGRL P 1 Offset(-49,75)
		HGRL P 1 Offset(-51,90)
		TNT1 A 3 Offset(0,32)
		TNT1 A 0 A_Lower
		Wait
	Select:
		TNT1 A 0 A_Raise
		Loop
	Ready:
		TNT1 A 0 A_PlaySound("weapons/1911/reload")
		HGRL P 1 Offset(-90,79)
		HGRL P 1 Offset(-75,69)
		HGRL P 1 Offset(-60,60)
		1911 A 1 Offset(-45,52)
		1911 A 1 Offset(-30,45)
		1911 A 1 Offset(-15,39)
		1911 A 1 Offset(-1,35)
		TNT1 A 0 Offset(0,32)
	ReadyII:
		1911 A 0 A_JumpIfInventory("ACP",0,2)
		1911 A 0 A_JumpIfInventory("Bullets",1,2)
		1911 A 1 A_WeaponReady
		Loop
		1911 A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		Loop
	Fire:
		TNT1 A 0 A_JumpIfInventory("ACP",1,1)
		Goto ReloadCheck
		TNT1 A 0 A_TakeInventory("ACP",1,TIF_NOTAKEINFINITE)
		1911 B 1 A_GunFlash
		TNT1 A 0 A_PlaySound("weapons/1911/fire",7)
		TNT1 A 0 A_SetPitch (pitch+0.2)
		1911 B 1 Bright A_FireBullets(4,4,-1,18,"AltPuff2",0)
		TNT1 A 0 A_ZoomFactor(0.996)
		TNT1 A 0 A_SetPitch (pitch-0.2)
		1911 C 1 Offset(0,34) A_AlertMonsters
		TNT1 A 0 A_ZoomFactor(0.998)
		TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner",0,0,8,0)
		TNT1 A 0 A_FireCustomMissile("45CasingSpawner",0,0,6,-2)
		1911 D 1 Offset(0,32) A_ZoomFactor(1.0)
		1911 ED 1
		1911 B 1 offset(0,34)
		1911 B 1 offset(0,33)
		1911 B 1 offset(0,32)
		TNT1 A 0 A_ReFire
		Goto ReadyII
	AltFire:
		TNT1 A 0 A_JumpIfInventory("PowerStrength", 1, "BerserkPistolKick")
		TNT1 A 0 A_PlaySound("weapons/foot/swing")
		PKCK ABC 2
		BOOT D 1 A_ZoomFactor(0.995)
		TNT1 A 0 A_Custompunch(2*random(5,15),1,0,"FootPuff",96)
		TNT1 A 0 A_RadiusThrust(5000, 64, RTF_NOIMPACTDAMAGE)
		TNT1 A 0  A_ZoomFactor(1.0)
		TNT1 A 0 A_JumpIfInventory("MeleeAlarm", 1, "PistolKickAlert")
		Goto KickEnd
	BerserkPistolKick:
		TNT1 A 0 A_PlaySound("weapons/foot/swing")
		PKCK ABC 2
		BOOT D 1 A_ZoomFactor(0.995)
		TNT1 A 0 A_Custompunch(20*random(5,15),1,0,"FootPuff",96)
		TNT1 A 0 A_RadiusThrust(5000, 64, RTF_NOIMPACTDAMAGE)
		TNT1 A 0  A_ZoomFactor(1.0)
		TNT1 A 0 A_JumpIfInventory("MeleeAlarm", 1, "PistolKickAlert")
		Goto KickEnd
	PistolKickAlert:
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_TakeInventory("MeleeAlarm",1)
	KickEnd:
		KICK EFGGE 1
		BOOT D 2
		PKCK CCBBA 1
		1911 B 2
		Goto ReadyII
	Flash:
		GNFL A 1 Bright A_Light2
		GNFL B 1 Bright A_Light1
		Goto LightDone
	ReloadCheck:
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("NineteenElevenReload")==0, "NoReloadLoop")
		Goto Reload
	Reload:
		TNT1 A 0 A_JumpIfInventory ("ACP",1,"Reload2")
		1911 B 4 A_PlaySound("weapons/1911/slide")
		1911 C 2
		HGRL ABCDE 2
		HGRL F 8
		Goto ReloadLoop
	Reload2:
		1911 B 3 A_PlaySound("weapons/1911/slide")
		HGLL ABCDE 2
		HGLL F 4
		Goto ReloadLoop2
	ReloadLoop:
		TNT1 A 0 A_GiveInventory("ACP")
		TNT1 A 0 A_TakeInventory("Bullets",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_JumpIfInventory("ACP",7,"ReloadEnd")
		TNT1 A 0 A_JumpIfInventory("Bullets",1,"ReloadLoop")
		Goto ReloadEnd
	ReloadLoop2:
		TNT1 A 0 A_GiveInventory("ACP")
		TNT1 A 0 A_TakeInventory("Bullets",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_JumpIfInventory("ACP",8,"ReloadEnd2")
		TNT1 A 0 A_JumpIfInventory("Bullets",1,"ReloadLoop2")
		Goto ReloadEnd2
	NoReloadLoop:
		TNT1 A 0 A_GiveInventory("ACP")
		TNT1 A 0 A_TakeInventory("Bullets",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_JumpIfInventory("ACP",7,"ReadyII")
		TNT1 A 0 A_JumpIfInventory("Bullets",1,"NoReloadLoop")
		Goto ReadyII
	NoReloadLoop2:
		TNT1 A 0 A_GiveInventory("ACP")
		TNT1 A 0 A_TakeInventory("Bullets",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_JumpIfInventory("ACP",8,"ReadyII")
		TNT1 A 0 A_JumpIfInventory("Bullets",1,"NoReloadLoop2")
		Goto ReadyII
	ReloadEnd:
		TNT1 A 0 A_PlaySound("weapons/1911/reload")
		HGRL G 2
		HGRL HI 2
		HGRL JK 3
		TNT1 A 0 A_PlaySound("weapons/1911/snap")
		HGRL L 4
		HGRL M 3
		HGRL NNOOP 1
		Goto ReadyII
	ReloadEnd2:
		TNT1 A 0 A_PlaySound("weapons/1911/reload")
		HGLL G 2
		HGLL HI 2
		HGLL JK 3
		HGRL L 3
		HGRL M 3
		HGRL NNOOP 1
		Goto ReadyII
	Spawn:
		COLP A -1
		Stop
	}
}

ACTOR ACP : Ammo
{
	+IGNORESKILL
	Inventory.MaxAmount 8
}