//==============================================================================
// Luger P-58 (Based on Wolf: TNO's Handgun 1960 & 1945)
//==============================================================================
// Dual Wielding code from Project Brutality adapted by YukesVonFaust
//==============================================================================

ACTOR PSZoomed 	 : Inventory { Inventory.MaxAmount 1 }
ACTOR FireRight3 : Inventory { Inventory.MaxAmount 1 }

ACTOR HDPistol : KriegslandLightWeapon
{
	+WEAPON.NOAUTOFIRE
	+INVENTORY.UNDROPPABLE
	Weapon.SelectionOrder 100
	Weapon.AmmoUse 1
	Weapon.SlotNumber 2
	Weapon.AmmoGive 10
	Weapon.AmmoType "BOCL1"
	Inventory.Pickupmessage "You got the Luger P-58!"
	Inventory.PickupSound 	"weapons/generic/pickup1"
	Obituary "%o got shot in the chest by %k's Luger P-58."
	Tag "Luger P-58"
	Scale 0.25
	States
	{
	Deselect:
		NULL A 0 A_ZoomFactor(1.0)
		NULL A 0 A_TakeInventory("PSZoomed",1)
		NULL A 0 A_StopSound(6)
		WP2G A 1 Offset(2, 34)
		WP2G A 1 Offset(7, 39)
		WP2G A 1 Offset(10, 47)
		WP2G A 1 Offset(22, 58)
		WP2G A 1 Offset(32, 69)
		WP2G A 1 Offset(54, 81)
		WP2G A 1 Offset(67, 100)
		WP2G A 1 A_Lower
		Wait 
	StartGame:
		WP2G A 1 A_PlaySound("Misc/StartGame",7)
		NULL A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		NULL A 0 A_TakeInventory("StartToken",9)
		NULL A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		Goto Ready
	Ready:
		TNT1 A 0 A_JumpIfInventory("PSZoomed",1,"ReadyZoomed")
		WP2G A 1 A_WeaponReady(WRF_ALLOWZOOM)
		NULL A 0 A_JumpIfInventory("StartToken",1,"StartGame")
		NULL A 0 A_JumpifInventory("IsBombing",1,"ThrowGrenade")
		NULL A 0 A_JumpIfInventory("SlidePlayer",1,"IsSliding")
		NULL A 0 A_JumpifInventory("IsKicking",1,"Kick")
		NULL A 0 A_JumpifInventory("IsKnifing",1,"Knife")
		NULL A 0 A_JumpifInventory("IsCrossing",1,"Cross")
		NULL A 0 A_TakeInventory("IAmUnzooming",1)
		Loop
	ReadyZoomed:
		NULL A 0 A_PlaySound("FKPlayer/breath",6,0.7,1)
		W2ZG A 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_NOSECONDARY)
		NULL A 0 A_SetAngle(angle-frandom(-0.12,0.12))
		NULL A 0 A_SetPitch(pitch-frandom(-0.12,0.12))
		W2ZG A 1 A_WeaponReady(WRF_ALLOWZOOM|WRF_NOSECONDARY)
		NULL A 0 A_SetAngle(angle+frandom(-0.12,0.12))
		NULL A 0 A_SetPitch(pitch-frandom(-0.12,0.12))
		NULL A 0 A_JumpifInventory("IsKicking",1,"Kick")
		NULL A 0 A_JumpIfInventory("IsKnifing",1,"Knife")
		NULL A 0 A_JumpIfInventory("SlidePlayer",1,"IsSliding")
		NULL A 0 A_JumpifInventory("IsBombing",1,"ThrowGrenade")
		NULL A 0 A_TakeInventory("IAmZooming",1)
		Goto Ready
	Select:
		TNT1 A 0 A_Playsound("weapons/generic/select1",7)
		WP2G A 1 Offset(67, 100)
		WP2G A 1 Offset(54, 81)
		WP2G A 1 Offset(32, 69)
		WP2G A 1 Offset(22, 58)
		WP2G A 1 Offset(10, 47)
		WP2G A 1 Offset(7, 39)
		WP2G A 1 Offset(2, 34)
		WP2G A 1 A_Raise
		Wait
	Fire:	
		TNT1 A 0 A_JumpIfInventory("BOCL1",1,1)
		Goto Dryfire
		TNT1 A 0 A_JumpIfInventory("PSZoomed",1,"FireZoomed")
		TNT1 A 0 A_Playsound("weapons/P58/fire",6)
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_FireBullets(2.8, 2.8, 1, 6,"Bullet_Puff")
		TNT1 A 0 A_FireCustomMissile("FKLightCasingSpawn",345+random(-8,8),0,-4,-5,0)
		TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner",0,0,8,0,0,0)
		TNT1 A 0 A_Gunflash
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2F B 1 BRIGHT
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("RecoilToggle")==0,2)
		TNT1 A 0 A_SetPitch(pitch -0.3)
		WP2G B 1 Offset(2,34)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2G B 1 Offset(4,38)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2G C 1 Offset(8,42)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2G C 1 Offset(6,41)
		TNT1 A 0 A_WeaponReady(WRF_NoSecondary|WRF_NoSwitch)
		WP2G D 1 Offset(4,39)
		TNT1 A 0 A_WeaponReady(WRF_NoSecondary|WRF_NoSwitch)
		WP2G D 1 Offset(2,36)
		TNT1 A 0 A_WeaponReady(WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 Offset(0,33)
		Goto Ready
	FireZoomed:	
		TNT1 A 0 A_JumpIfInventory("BOCL1",1,1)
		Goto Dryfire
		TNT1 A 0 A_Playsound("weapons/P58/fire",7)
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_FireBullets(2.1, 2.1, 1, 6,"Bullet_Puff")
		TNT1 A 0 A_FireCustomMissile("FKLightCasingSpawn",0+random(-8,8),0,0,6,0)
		TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner",0,0,0)
		TNT1 A 0 A_Light2
		TNT1 A 0 A_Light1
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		W2ZF A 1 BRIGHT
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("RecoilToggle")==0,2)
		TNT1 A 0 A_SetPitch(pitch -0.3)
		W2ZG B 1 Offset(0,31) A_ZoomFactor(1.54)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		W2ZG C 1 Offset(0,26) A_ZoomFactor(1.53)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		W2ZG D 1 Offset(0,24) A_ZoomFactor(1.52)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		W2ZG D 1 Offset(0,28) A_ZoomFactor(1.51)
		TNT1 A 0 A_WeaponReady(WRF_NoSecondary|WRF_NoSwitch)
		W2ZG E 1 Offset(0,30) A_ZoomFactor(1.5)
		TNT1 A 0 A_WeaponReady(WRF_NoSecondary|WRF_NoSwitch)
		W2ZG E 1 Offset(0,32)
		TNT1 A 0 A_WeaponReady(WRF_NoSecondary|WRF_NoSwitch)
		W2ZG B 1
		TNT1 A 0 A_WeaponReady(WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_Refire
		Goto Ready
	Dryfire:
		TNT1 A 0 A_Print("No ammo",1)
		Goto Ready
	Zoom:
		TNT1 A 0 A_JumpIfInventory("IAmUnzooming",1,"Ready")
		TNT1 A 0 A_JumpIfInventory("IAmZooming",1,"ReadyZoomed")
		TNT1 A 0 A_JumpIfInventory("PSZoomed",1,"UnZoom")
		TNT1 A 0 A_GiveInventory("PSZoomed",1)
		TNT1 A 0 A_PlaySound("weapons/generic/select")
		TNT1 A 0 A_ZoomFactor(1.5)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2Z A 1 Offset(4, 34)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2Z B 1 Offset(8, 38)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2Z C 1 Offset(12, 42)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2Z D 1 Offset(8, 38)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		W2ZG A 1 Offset(4, 34)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		W2ZG A 0 Offset(0, 33)
		TNT1 A 0 A_GiveInventory("IAmZooming",3)
		Goto Ready
	UnZoom:
		NULL A 0 A_PlaySound("weapons/generic/select")
		NULL A 0 A_StopSound(6)
		NULL A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2Z D 1 Offset(4, 34)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2Z C 1 Offset(8, 38)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2Z B 1 Offset(12, 42)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2Z A 1 Offset(8, 38)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2G A 1 Offset(4, 34)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2G A 0 Offset(0, 33)
		TNT1 A 0 A_TakeInventory("PSZoomed",1)
		NULL A 0 A_GiveInventory("IAmUnzooming",6)
		Goto Ready
	Altfire:
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2G A 2 A_JumpIfInventory("HDPistolX2",1,"SelectAkimbo")
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		Goto Ready
	SelectAkimbo:
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2G A 1 A_SelectWeapon("HDPistolX2")
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		Goto Ready
	Cross:
		WP2G A 1
		TNT1 A 0 A_JumpIfInventory("HDHandgun",1,"SelectCross")
		Goto Ready
	SelectCross:
		NULL A 0 A_GiveInventory("HDCrossAkimbo1",1)
		WP2G A 1 A_SelectWeapon("HDCrossAkimbo1")
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		Goto Ready
	Kick:
		TNT1 A 0 A_JumpIfInventory("PSZoomed",1,"UnZoom")
		WP2Z AB 1
		TNT1 A 1
		KICF A 1 Offset(-10,32)
		KICF CE 1
		KICF FG 1 A_Recoil(-1)
		TNT1 A 0 A_Jump(128,2)
		TNT1 A 0 A_PlaySound("FKPlayer/Grunt")
		KICF H 5 A_CustomPunch(6,0,0,"FightPuff") 
		KICF IGFEDC 1 
		KICF BA 1 A_Recoil(+0.5)
		TNT1 A 1
		WP2Z BA 1 Offset(0,32)
		Goto Ready
	IsSliding:
		TNT1 A 0 A_JumpIfInventory("PSZoomed",1,"UnZoom")
		TNT1 A 0 A_TakeInventory("SlidePlayer",1)
		TNT1 A 0 A_JumpIfInventory("CrouchPlayer",1,"Ready")
		WP2Z AB 1
		TNT1 A 0 A_PlaySound("FKPlayer/slide/start",4)
		TNT1 A 0 A_PlaySound("FKPlayer/slide/loop",5,0.5,TRUE)
		TNT1 A 0 A_SetPitch(pitch+0.8)
		SLDK ABCDEF 2
		TNT1 A 0 A_SetPitch(pitch-0.8)
		SLDK G 6 A_FireCustomMissile("KickAttack",0,0,0,0)
		TNT1 A 0 A_StopSound(5)
		TNT1 A 0 A_PlaySound("FKPlayer/slide/end",6)
		SLDK HI 2
		Goto Ready
	Knife:
		TNT1 A 0 A_JumpIfInventory("PSZoomed",1,"UnZoom")
		WP2Z AB 1
		NULL A 0 Offset(-10,32)
		NULL A 1
		WP1L AB 1
		NULL A 0 A_Jump(86,2)
		NULL A 0 A_PlaySound("FKPlayer/Grunt")
		WP1L C 1 A_CustomPunch(8,0,0,"KnifePuff")
		WP1L DEF 1
		NULL A 1
		WP2Z BA 1 Offset(0,32)
		Goto Ready
	Throwgrenade:
		TNT1 A 0 A_JumpIfInventory("PSZoomed",1,"UnZoom")
		TNT1 A 0 A_JumpIf(waterlevel>2,"Dryfire")
		TNT1 A 0 A_JumpIfInventory("BOGR1",1,1)
		Goto Dryfire
		WP2Z AB 1
		TNT1 A 0 A_StopSound(1)
		TNT1 A 1 Offset(-20,32)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 A 1 Offset(0,28)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 B 1 Offset(0,24)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 C 1 Offset(0,23)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 D 1 Offset(0,26) A_PlaySound("weapons/SHG/throw")
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 D 1 Offset(0,28)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_SpawnItemEx("RealGrenade",0,1,24,cos(pitch)*40,0,sin(-pitch)*40,3,SXF_TRANSFERPITCH|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_TakeInventory("BOGR1",1)
		MND2 E 1 Offset(-3,30)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 E 1 Offset(-6,31)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 F 1 Offset(-9,32)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 F 1 Offset(-12,33)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_TakeInventory("GetOnWithIt", 100)
		TNT1 A 0 A_JumpIfNoAmmo("Dryfire")
		TNT1 A 5 Offset (75, 152)
		TNT1 A 1 Offset (6, 42)
		WP2Z BA 1
		Goto Ready
	Flash:
		TNT1 A 0 BRIGHT A_Light1
		Goto LightDone
		TNT1 A 0 BRIGHT A_Light1
		Goto LightDone
 	Spawn:
		WP2P A -1
		Stop
	}
}

//==============================================================================
// Zwei Luger P-58
//==============================================================================

ACTOR HDPistolX2 : KriegslandLightWeapon
{
	+INVENTORY.UNDROPPABLE
	Weapon.SelectionOrder 1100
	Weapon.SlotNumber 0
	Weapon.AmmoUse 1
	Weapon.AmmoGive 10
	Weapon.AmmoType "BOCL1"
	Inventory.Pickupmessage "You got the Luger P-58!"
	Inventory.PickupSound 	"weapons/generic/pickup1"
	Tag "Zwei Luger P-58"
	Scale 0.25
	States
	{
	Deselect:
		TNT1 A 0 A_Gunflash("LightDone")
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		TNT1 A 0 A_GiveInventory("StopDualWield", 1)
		WP2R CBA 1 Offset(0,32)
		TNT1 A 1 A_Lower
		Wait 
	Ready:
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		WP2R ABC 1 Offset(0,32)
		TNT1 A 0 A_TakeInventory("StopDualWield", 1)
		TNT1 A 0 A_GunFlash
		Goto ReadyToFire
	ReadyToFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player wants to reload
		W2LG A 1 A_WeaponReady(WRF_NOFIRE|WRF_ALLOWZOOM)// Weapon is ready to fire
		TNT1 A 0 A_JumpifInventory("IsKicking",1,"Kick")
		TNT1 A 0 A_JumpifInventory("IsKnifing",1,"Knife")
		NULL A 0 A_JumpIfInventory("SlidePlayer",1,"IsSliding")
		TNT1 A 0 A_JumpifInventory("IsBombing",1,"ThrowGrenade")
		Loop
	Select:
		TNT1 A 0 A_Playsound("weapons/generic/select1",7)
		TNT1 A 0 Offset(67, 100)
		TNT1 A 0 Offset(54, 81)
		TNT1 A 0 Offset(32, 69)
		TNT1 A 0 Offset(22, 58)
		TNT1 A 0 Offset(10, 47)
		TNT1 A 0 Offset(7, 39)
		TNT1 A 0 Offset(2, 34)
		TNT1 A 0 Offset(0, 32)
		TNT1 A 1 A_Raise
		Wait
	Fire:
		TNT1 A 0
		WP2B A 1
		TNT1 A 0 A_JumpifInventory("IsKicking",1,"Kick")
		TNT1 A 0 A_JumpifInventory("IsKnifing",1,"Knife")
		NULL A 0 A_JumpIfInventory("SlidePlayer",1,"IsSliding")
		TNT1 A 0 A_JumpifInventory("IsBombing",1,"ThrowGrenade")
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
	FireLeftGun:
		TNT1 A 0 A_JumpIfInventory("BOCL1",1,1)
		Goto Dryfire
		TNT1 A 0
		TNT1 A 0 A_Playsound("weapons/P58/fire",6)
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_FireCustomMissile("FKLightCasingL",345+random(-8,8),0,-4,-5,0)
		TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner",0,0,-10,0,0,0)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		W2LF A 1 Bright A_FireBullets(4.2, 4.2, -1, 6,"Bullet_Puff",1)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("RecoilToggle")==0,2)
		TNT1 A 0 A_SetPitch(pitch -0.3)
		W2LG B 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		W2LG C 2 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		W2LG D 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		W2LG E 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		W2LG A 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		W2LG A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
	FireRightGun:
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_GiveInventory("IsFiringSecondary", 1)
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_JumpIfInventory("BOCL1",1,1)
		Goto Dryfire
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_Playsound("weapons/P58/fire",6)
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_FireCustomMissile("FKLightCasingSpawn",345+random(-8,8),0,-4,-5,0)
		TNT1 A 0 A_FireCustomMissile("GunSmokeSpawner",0,0,10,0,0,0)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2F B 1 Bright A_FireBullets(4.2, 4.2, -1, 6,"Bullet_Puff",1)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("RecoilToggle")==0,2)
		TNT1 A 0 A_SetPitch(pitch -0.3)
		WP2G B 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2G C 2 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2G D 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2G E 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2G A 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		WP2G A 0 A_JumpIfInventory("FiredSecondary",1,"FireRightGun")
		Goto Flash
	Zoom:
		TNT1 A 0 A_GunFlash("LightDone")
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP2B A 1 A_SelectWeapon("HDPistol")
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		Goto ReadyToFire
	Dryfire:
		TNT1 A 0 A_Print("No ammo",1)
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		WP2B A 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_GunFlash
		Goto ReadyToFire
	Kick:
		TNT1 A 0 A_GunFlash("LightDone")
		WP2R CBA 1
		TNT1 A 1
		KICF A 1 Offset(-10,32)
		KICF CE 1
		KICF FG 1 A_Recoil(-1)
		TNT1 A 0 A_Jump(128,2)
		TNT1 A 0 A_PlaySound("FKPlayer/Grunt")
		KICF H 5 A_CustomPunch(6,0,0,"FightPuff") 
		KICF IGFEDC 1 
		KICF BA 1 A_Recoil(+0.5)
		TNT1 A 1
		WP2R ABC 1 Offset(0,32)
		TNT1 A 0 A_GunFlash
		Goto ReadyToFire
	IsSliding:
		TNT1 A 0 A_GunFlash("LightDone")
		TNT1 A 0 A_TakeInventory("SlidePlayer",1)
		TNT1 A 0 A_JumpIfInventory("CrouchPlayer",1,"Ready")
		WP2R CBA 1
		TNT1 A 0 A_PlaySound("FKPlayer/slide/start",4)
		TNT1 A 0 A_PlaySound("FKPlayer/slide/loop",5,0.5,TRUE)
		TNT1 A 0 A_SetPitch(pitch+0.8)
		SLDK ABCDEF 2
		TNT1 A 0 A_SetPitch(pitch-0.8)
		SLDK G 6 A_FireCustomMissile("KickAttack",0,0,0,0)
		TNT1 A 0 A_StopSound(5)
		TNT1 A 0 A_PlaySound("FKPlayer/slide/end",6)
		SLDK HI 2
		Goto Ready
	Knife:
		TNT1 A 0 A_GunFlash("LightDone")
		WP2R CBA 1
		NULL A 0 Offset(-10,32)
		NULL A 1
		WP1L AB 1
		NULL A 0 A_Jump(86,2)
		NULL A 0 A_PlaySound("FKPlayer/Grunt")
		WP1L C 1 A_CustomPunch(8,0,0,"KnifePuff")
		WP1L DEF 1
		NULL A 1
		WP2R ABC 1 Offset(0,32)
		TNT1 A 0 A_GunFlash
		Goto ReadyToFire
	Throwgrenade:
		TNT1 A 0 A_GunFlash("LightDone")
		WP2R CBA 1
		TNT1 A 0 Offset(-10,36)
		TNT1 A 0 A_JumpIf(waterlevel>2,"Dryfire")
		TNT1 A 0 A_JumpIfInventory("BOGR1",1,1)
		Goto Dryfire
		TNT1 A 0 A_StopSound(1)
		TNT1 A 1 Offset(-20,32)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 A 1 Offset(0,28)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 B 1 Offset(0,24)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 C 1 Offset(0,23)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 D 1 Offset(0,26) A_PlaySound("weapons/SHG/throw")
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 D 1 Offset(0,28)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_SpawnItemEx("RealGrenade",0,1,24,cos(pitch)*40,0,sin(-pitch)*40,3,SXF_TRANSFERPITCH|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_TakeInventory("BOGR1",1)
		MND2 E 1 Offset(0,30)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 E 1 Offset(0,31)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 F 1 Offset(0,32)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		MND2 F 1 Offset(0,33)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_TakeInventory("GetOnWithIt", 100)
		TNT1 A 0 A_JumpIfNoAmmo("Dryfire")
		TNT1 A 7 Offset (75, 152)
		TNT1 A 1 Offset (6, 42)
		Goto Ready
	Flash:
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		WP2G A 1
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "FireRightGun")
		Loop
	DontFlash:
	    TNT1 A 1
		Goto Flash
	Steady:
		TNT1 A 1
		Goto ReadyToFire		
 	Spawn:
		WP2P A -1
		Stop
	}
}