//=============================================================================
// WeaponCombatKnife.
//=============================================================================
class ArenaCombatKnife extends ArenaWeapon;

var bool bJab;
var bool bSlash;
var bool bSlice;

replication
{
    reliable if ( Role == ROLE_Authority )
    SetDamageStuff;
}

simulated function PlaySelectiveFiring()
{
	local Pawn aPawn;
	local float rnd;
	local Name anim;

	anim = 'Shoot';

	if (bHandToHand)
	{
		if( bJab )
			anim = 'Attack3';

		if ( bSlash )
			anim = 'Attack2';

		if ( bSlice )
			anim = 'Attack';
	}

	if (( Level.NetMode == NM_Standalone ) || ( DeusExPlayer(Owner) == DeusExPlayer(GetPlayerPawn())) )
	{
		if (bAutomatic)
			LoopAnim(anim,, 0.1);
		else
			PlayAnim(anim,,0.1);
	}
	else if ( Role == ROLE_Authority )
	{
		for ( aPawn = Level.PawnList; aPawn != None; aPawn = aPawn.nextPawn )
		{
			if ( aPawn.IsA('DeusExPlayer') && ( DeusExPlayer(Owner) != DeusExPlayer(aPawn) ) )
			{
				// If they can't see the weapon, don't bother
				if ( DeusExPlayer(aPawn).FastTrace( DeusExPlayer(aPawn).Location, Location ))
					DeusExPlayer(aPawn).ClientPlayAnimation( Self, anim, 0.1, bAutomatic );
			}
		}
	}
}

simulated function SetDamageStuff( int dmg )
{
	HitDamage = dmg;
}

simulated function PreBeginPlay()
{
	Super.PreBeginPlay();

	// If this is a netgame, then override defaults
	if ( Level.NetMode != NM_StandAlone )
	{
		HitDamage = mpHitDamage;
		BaseAccuracy = mpBaseAccuracy;
		ReloadTime = mpReloadTime;
		AccurateRange = mpAccurateRange;
		MaxRange = mpMaxRange;
	}
}


function CycleAmmo()
{
	local Pawn P;


	P = Pawn(Owner);

	if (P == None)
		return;
	if (bJab)
	{
		P.ClientMessage("Slash attack style selected");
		bSlice = False;
		bJab = False;
		bSlash = True;
		SetClientAmmoParams( True, False, 1.100000, FireSound, ProjectileClass, ProjectileSpeed );
		SetDamageStuff(30);
		return;
	}
	if (bSlash)
	{
		P.ClientMessage("Slice attack style selected");
		bJab = False;
		bSlash = False;
		bSlice = True;
		SetClientAmmoParams( True, False, 0.900000, FireSound, ProjectileClass, ProjectileSpeed );
		SetDamageStuff(25);
		return;
	}
	else if (bSlice)
	{
		P.ClientMessage("Jab attack style selected");
		bJab = True;
		bSlash = False;
		bSlice = False;
		SetClientAmmoParams( True, False, 0.100000, FireSound, ProjectileClass, ProjectileSpeed );
		SetDamageStuff(17);
		return;
	}

}

defaultproperties
{
     bJab=True
     LowAmmoWaterMark=0
     GoverningSkill=Class'DeusEx.SkillWeaponLowTech'
     NoiseLevel=0.050000
     EnemyEffective=ENMEFF_Organic
     Concealability=CONC_Visual
     reloadTime=0.000000
     HitDamage=5
     maxRange=100
     AccurateRange=100
     BaseAccuracy=0.800000
     bHasMuzzleFlash=False
     bHandToHand=True
     bFallbackWeapon=True
     mpHitDamage=20
     mpBaseAccuracy=0.800000
     mpAccurateRange=100
     mpMaxRange=100
     AmmoName=Class'DeusEx.AmmoNone'
     ReloadCount=0
     bInstantHit=True
     FireOffset=(X=-5.000000,Y=8.000000,Z=14.000000)
     shakemag=20.000000
     FireSound=Sound'DeusExSounds.Weapons.CombatKnifeFire'
     SelectSound=Sound'DeusExSounds.Weapons.CombatKnifeSelect'
     Misc1Sound=Sound'DeusExSounds.Weapons.CombatKnifeHitFlesh'
     Misc2Sound=Sound'DeusExSounds.Weapons.CombatKnifeHitHard'
     Misc3Sound=Sound'DeusExSounds.Weapons.CombatKnifeHitSoft'
     InventoryGroup=11
     ItemName="Combat Knife"
     PlayerViewOffset=(X=5.000000,Y=-8.000000,Z=-14.000000)
     PlayerViewMesh=LodMesh'DeusExItems.CombatKnife'
     PickupViewMesh=LodMesh'DeusExItems.CombatKnifePickup'
     ThirdPersonMesh=LodMesh'DeusExItems.CombatKnife3rd'
     Icon=Texture'DeusExUI.Icons.BeltIconCombatKnife'
     largeIcon=Texture'DeusExUI.Icons.LargeIconCombatKnife'
     largeIconWidth=49
     largeIconHeight=45
     Description="An ultra-high carbon stainless steel knife."
     beltDescription="KNIFE"
     Mesh=LodMesh'DeusExItems.CombatKnifePickup'
     CollisionRadius=12.650000
     CollisionHeight=0.800000
}
