//==============================================================================
// Kampfmesser 84 
//==============================================================================

ACTOR HDKnife : KriegslandLightWeapon replaces Fist
{
	+WEAPON.WIMPY_WEAPON
	+WEAPON.MELEEWEAPON
	+INVENTORY.UNDROPPABLE
	Weapon.SelectionOrder 1000
	Weapon.SlotNumber 1
	Weapon.Kickback 100
	Obituary "%o got beaten in a Phobos Minute by %k."
	Tag "Kampfmesser 84"
	Scale 0.2
	States
	{
	Ready:
		WP1R A 1 A_WeaponReady
		TNT1 A 0 A_JumpifInventory("IsBombing",1,"ThrowGrenade")
		NULL A 0 A_JumpIfInventory("SlidePlayer",1,"IsSliding")
		TNT1 A 0 A_JumpifInventory("IsKicking",1,"Kick")
		TNT1 A 0 A_JumpifInventory("IsKnifing",1,"Fist")
		Loop
	Deselect:
		WP1R A 1 Offset(2, 34)
		WP1R A 1 Offset(7, 39)
		WP1R A 1 Offset(10, 47)
		WP1R A 1 Offset(22, 58)
		WP1R A 1 Offset(32, 69)
		WP1R A 1 Offset(54, 81)
		WP1R A 1 Offset(67, 100)
		WP1R A 1 A_Lower
		Wait 
	Select:
		TNT1 A 0 A_Playsound("weapons/generic/select8",7)
		WP1R A 1 Offset(67, 100)
		WP1R A 1 Offset(54, 81)
		WP1R A 1 Offset(32, 69)
		WP1R A 1 Offset(22, 58)
		WP1R A 1 Offset(10, 47)
		WP1R A 1 Offset(7, 39)
		WP1R A 1 Offset(2, 34)
		WP1R A 1 A_Raise
		Wait
	Fire:
		TNT1 A 0 A_JumpifInventory("SuperBlow",1,"Lambida")
		WP1R A 2
		WP1R B 1
		WP1R C 1
	ContinuetoSlice:
		TNT1 A 0 Offset(0,32)
		WP1G AB 1
		TNT1 A 0 A_Jump(86,2)
		TNT1 A 0 A_PlaySound("FKPlayer/Grunt")
		WP1G C 1 A_CustomPunch(8,0,0,"KnifePuff")
		WP1G DEF 1
		TNT1 A 8
		TNT1 A 0 A_ReFire("ContinueToSlice")
		WP1R A 1 Offset(67, 100)
		WP1R A 1 Offset(32, 69)
		WP1R A 1 Offset(10, 47)
		WP1R A 1 Offset(7, 39)
		Goto Ready
	Lambida:
		WP1R A 1
		WP1R B 1
		WP1R C 1
	ContinuetoSlice2:
		TNT1 A 0 Offset(0,32)
		WP1G AB 1
		TNT1 A 0 A_Jump(128,2)
		TNT1 A 0 A_PlaySound("FKPlayer/Grunt")
		WP1G C 1 A_CustomPunch(10,0,0,"KnifePuff")
		WP1G DEF 1
		TNT1 A 4
		TNT1 A 0 A_ReFire("ContinueToSlice2")
		WP1R A 1 Offset(67, 100)
		WP1R A 1 Offset(32, 69)
		WP1R A 1 Offset(10, 47)
		WP1R A 1 Offset(7, 39)
		Goto Ready
	Fist:
		WP1R A 1 Offset(7, 39)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP1R A 1 Offset(32, 69)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP1R A 1 Offset(67, 100)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 1 Offset(-10,36)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP1S A 1 Offset(-10,32)
		TNT1 A 0 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP1S B 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP1S C 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP1S D 2 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP1S E 2 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 0 A_Jump(128,2)
		TNT1 A 0 A_PlaySound("FKPlayer/Grunt")
		WP1S F 2 A_CustomPunch(6,0,0,"FightPuff") 
		WP1S G 2 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP1S H 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP1S I 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		TNT1 A 1 A_WeaponReady(WRF_NoFire|WRF_NoSecondary|WRF_NoSwitch)
		WP1R A 1 Offset(67, 100)
		WP1R A 1 Offset(32, 69)
		WP1R A 1 Offset(7, 39)
		Goto Ready
	Kick:
		WP1R A 1 Offset(7, 39)
		WP1R A 1 Offset(32, 69)
		WP1R A 1 Offset(67, 100)
		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
		WP1R A 1 Offset(67, 100)
		WP1R A 1 Offset(32, 69)
		WP1R A 1 Offset(7, 39)
		Goto Ready
	IsSliding:
		TNT1 A 0 A_TakeInventory("SlidePlayer",1)
		TNT1 A 0 A_JumpIfInventory("CrouchPlayer",1,"Ready")
		WP1R A 1 Offset(32, 69)
		WP1R A 1 Offset(67, 100)
		TNT1 A 1 Offset(-10,36)
		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
	Throwgrenade:
		TNT1 A 0 A_JumpIf(waterlevel>2,"Dryfire")
		TNT1 A 0 A_JumpIfInventory("BOGR1",1,1)
		Goto Dryfire
		WP1R A 1 Offset(7, 39)
		WP1R A 1 Offset(32, 69)
		WP1R A 1 Offset(67, 100)
		TNT1 A 1 Offset(-20,32)
		TNT1 A 0 A_StopSound(1)
		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 7 Offset (75, 152)
		TNT1 A 1 Offset (5, 40)
		WP1R A 1 Offset(67, 100)
		WP1R A 1 Offset(32, 69)
		WP1R A 1 Offset(7, 39)
		Goto Ready
	Dryfire:
		TNT1 A 0 A_Print("No Grenades",1)
		Goto Ready
 	Spawn:
		WP1P A -1
		Stop
	}
}