XIII
Class TKnife

source: C:\XIII\XIII\Classes\TKnife.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Inventory
         |
         +--Engine.Weapon
            |
            +--XIII.XIIIWeapon
               |
               +--XIII.TKnife
Direct Known Subclasses:None

class TKnife
extends XIII.XIIIWeapon

//----------------------------------------------------------- // //-----------------------------------------------------------

Function Summary
 string GetAmmoText(out int)
     
//_____________________________________________________________________________
// ELR Text to be displayed in HUD
 bool HasAltAmmo()
     
//_____________________________________________________________________________
 
simulated
PlayFiring()
     
//_____________________________________________________________________________
 
simulated
PlayIdleAnim()
     
//_____________________________________________________________________________
 float RateSelf()
     
//_____________________________________________________________________________
// FRD
 
simulated
TweenDown()
     
//_____________________________________________________________________________



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class TKnife extends XIIIWeapon;
00005	
00006	//_____________________________________________________________________________
00007	simulated function bool HasAltAmmo()
00008	{ // because we can stun only if we have ammo (bAllowEmptyShot=false, must down weapon after last fire)
00009	    return HasAmmo();
00010	}
00011	
00012	//_____________________________________________________________________________
00013	// ELR Text to be displayed in HUD
00014	simulated function string GetAmmoText(out int bDrawbulletIcon)
00015	{
00016	    local string AmmoText,AltAmmoText;
00017	
00018	    bDrawbulletIcon = 1;
00019	
00020	    // Setup ammotext
00021	    AmmoText = string(Ammotype.AmmoAmount);
00022	    return AmmoText;
00023	}
00024	
00025	//_____________________________________________________________________________
00026	// FRD
00027	function float RateSelf()
00028	{
00029	    local float distance;
00030	    local vector PositionRelative;
00031	
00032	    if ( !HasAmmo() )
00033	      return -2;
00034	    if (instigator.controller.enemy!=none)
00035	    {
00036	      PositionRelative=instigator.controller.enemy.location-instigator.location;
00037	      distance=Vsize(PositionRelative);
00038	      if (distance>1210 || distance<300)
00039	        return 0.21;
00040	      if (PositionRelative.z>400) // enemy au dessus donc pas prendre
00041	        return (AIRating-2);
00042	    }
00043	    return AIRating;
00044	}
00045	
00046	//_____________________________________________________________________________
00047	simulated function PlayIdleAnim()
00048	{
00049	    if ( HasAmmo() )
00050	      Super.PlayIdleAnim();
00051	    else
00052	      PlayAnim('WaitVide', 1.0, 0.3);
00053	}
00054	
00055	//_____________________________________________________________________________
00056	simulated function TweenDown()
00057	{
00058	    if ( HasAmmo() )
00059	      PlayAnim('Down', 1.0);
00060	    else
00061	      PlayAnim('DownVide', 1.0);
00062	}
00063	
00064	
00065	//_____________________________________________________________________________
00066	simulated function PlayFiring()
00067	{
00068	//    if ( HasAmmo() ) // ELR Can't use HasAmmo as the ammo will be used after
00069	    if ( AmmoType.Ammoamount > 1 )
00070	      PlayAnim(LoadedFiringAnim, 1.0);
00071	    else
00072	      PlayAnim(EmptyFiringAnim, 1.0);
00073	    if ( Instigator.IsLocallyControlled() || (Level.NetMode == NM_StandAlone) )
00074	      PlayFiringSound();
00075	
00076	    if ( !HasAmmo() )
00077	      return;
00078	
00079	    IncrementFlashCount();
00080	    if ( bDrawMuzzleflash )
00081	      SetUpMuzzleFlash();
00082	}
00083	
00084	//    Icon=texture'XIIIMenu.TKnifeIcon'
00085	
00086	
00087	defaultproperties
00088	{
00089	     WeaponOnoClass=Class'XIDSpec.TKnifeWeaponOno'
00090	     bHaveAltFire=True
00091	     bAllowEmptyShot=False
00092	     bHaveBoredSfx=True
00093	     WHand=WHA_Throw
00094	     WeaponMode=WM_SemiAuto
00095	     AmmoName=Class'XIII.TKnifeAmmo'
00096	     AltAmmoName=Class'XIII.TKnifeAltAmmo'
00097	     PickupAmmoCount=3
00098	     MeshName="XIIIArmes.FpsCoutoLancM"
00099	     FireOffset=(Y=6.000000)
00100	     AltFireOffset=(X=5.000000,Y=-1.000000,Z=-4.000000)
00101	     CrossHair=Texture'XIIIMenu.HUD.MireCouteau'
00102	     ShotTime=1.000000
00103	     FiringMode="FM_Throw"
00104	     FireNoise=0.000000
00105	     AltFireNoise=0.000000
00106	     LoadedAltFiringAnim="FireAlt"
00107	     AIRating=0.390000
00108	     TraceDist=15.000000
00109	     hFireSound=Sound'XIIIsound.Guns__JetFire.JetFire__hJetFire'
00110	     hSelectWeaponSound=Sound'XIIIsound.Guns__JetSelWp.JetSelWp__hJetSelWp'
00111	     hAltFireSound=Sound'XIIIsound.Guns__JetFireAlt.JetFireAlt__hJetFireAlt'
00112	     hActWaitSound=Sound'XIIIsound.Guns__JetWait.JetWait__hJetWait'
00113	     PickupClassName="XIII.TKnifePick"
00114	     PlayerViewOffset=(X=8.000000,Y=4.000000)
00115	     ThirdPersonRelativeLocation=(X=8.000000,Y=-3.000000,Z=12.000000)
00116	     ThirdPersonRelativeRotation=(Pitch=-16384,Yaw=7000)
00117	     AttachmentClass=Class'XIII.TKnifeAttach'
00118	     ItemName="THROW KNIFE"
00119	     DrawScale=0.300000
00120	}

End Source Code