XIII
Class LHarpon

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

class LHarpon
extends XIII.XIIIWeapon

//----------------------------------------------------------- // //-----------------------------------------------------------
States
Idle

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


State Idle Function Summary



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class LHarpon 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	
00031	    if ( !HasAmmo() )
00032	      return -2;
00033	    if (instigator.controller.enemy!=none)
00034	    {
00035	      distance=Vsize(instigator.controller.enemy.location-instigator.location);
00036	      if (distance>2500)
00037	        return 0.61;
00038	    }
00039	    return AIRating;
00040	}
00041	
00042	//_____________________________________________________________________________
00043	state Idle
00044	{
00045	    simulated function ForceReload()
00046	    { // ELR check here that we have enough ammo to reload
00047	
00048	      Log("  ForceReload Call in Idle");
00049	      if ( ReLoadCount == 0 )
00050	      {
00051	        ServerForceReload();
00052	        if ( HasAmmo() )
00053	          GotoState('Reloading');
00054	      }
00055	    }
00056	}
00057	
00058	//_____________________________________________________________________________
00059	simulated function PlayIdleAnim()
00060	{
00061	    if ( ReLoadCount > 0 )
00062	    {
00063	      if ( bHaveBoredSfx && Pawn(Owner).IsPlayerPawn() && (iBoredCount > BOREDSFXTHRESHOLD) )
00064	      {
00065	        iBoredCount = 0;
00066	        if ( Instigator.IsLocallyControlled() || (Level.NetMode == NM_StandAlone) )
00067	          Instigator.PlayRolloffSound(hActWaitSound, self, 0, int(Pawn(Owner).IsPlayerPawn()), 0 );
00068	        PlayAnim('WaitAct', 1.0, 0.3);
00069	      }
00070	      else
00071	        PlayAnim('Wait', 1.0, 0.3);
00072	    }
00073	    else
00074	    {
00075	      if ( bHaveBoredSfx && Pawn(Owner).IsPlayerPawn() && (iBoredCount > BOREDSFXTHRESHOLD) )
00076	      {
00077	        iBoredCount = 0;
00078	        if ( Instigator.IsLocallyControlled() || (Level.NetMode == NM_StandAlone) )
00079	          Instigator.PlayRolloffSound(hActWaitSound, self, 0, int(Pawn(Owner).IsPlayerPawn()), 0 );
00080	        PlayAnim('WaitActVide', 1.0, 0.3);
00081	      }
00082	      else
00083	        PlayAnim('WaitVide', 1.0, 0.3);
00084	    }
00085	}
00086	
00087	//_____________________________________________________________________________
00088	simulated function PlaySelect()
00089	{
00090	    if (ReLoadCount > 0)
00091	      PlayAnim('Select');
00092	    else
00093	      PlayAnim('SelectVide');
00094	    if ( Instigator.IsLocallyControlled() || (Level.NetMode == NM_StandAlone) )
00095	      Instigator.PlayRolloffSound(hSelectWeaponSound, self, 0, int(Pawn(Owner).IsPlayerPawn()) );
00096	}
00097	
00098	//_____________________________________________________________________________
00099	simulated function TweenDown()
00100	{
00101	    if ( ReLoadCount > 0 )
00102	      PlayAnim('Down', 1.0);
00103	    else
00104	      PlayAnim('DownVide', 1.0);
00105	}
00106	
00107	//    Mesh=SkeletalMesh'XIIIArmes.FpsLanceHarponM'
00108	//    CrossHair=Texture'XIIIMenu.MireHarpon'
00109	//    PickupClass=Class'XIII.LHarponPick'
00110	//    Icon=texture'XIIIMenu.FHarponIcon'
00111	
00112	
00113	defaultproperties
00114	{
00115	     WeaponOnoClass=Class'XIDSpec.TKnifeWeaponOno'
00116	     bHaveAltFire=True
00117	     bAllowEmptyShot=False
00118	     bUnderWaterWork=True
00119	     bAutoReload=True
00120	     bHaveBoredSfx=True
00121	     WHand=WHA_2HShot
00122	     AmmoName=Class'XIII.HarponAmmo'
00123	     AltAmmoName=Class'XIII.HarponAltAmmo'
00124	     PickupAmmoCount=1
00125	     ReloadCount=1
00126	     MeshName="XIIIArmes.FpsLanceHarponM"
00127	     FireOffset=(X=5.000000,Y=7.000000,Z=-4.000000)
00128	     AltFireOffset=(X=15.000000,Y=-1.000000,Z=-4.000000)
00129	     CrossHair=Texture'XIIIMenu.HUD.MireCouteau'
00130	     ShotTime=0.300000
00131	     FiringMode="FM_2H"
00132	     FireNoise=0.157000
00133	     ReLoadNoise=0.000000
00134	     AltFireNoise=0.000000
00135	     LoadedFiringAnim="Firevide"
00136	     EmptyFiringAnim="firevide_b"
00137	     LoadedAltFiringAnim="FireAlt"
00138	     RumbleFXNum=17
00139	     AIRating=0.840000
00140	     TraceDist=50.000000
00141	     hFireSound=Sound'XIIIsound.Guns__HarpFire.HarpFire__hHarpFire'
00142	     hReloadSound=Sound'XIIIsound.Guns__HarpRel.HarpRel__hHarpRel'
00143	     hNoAmmoSound=Sound'XIIIsound.Guns__HarpDryFire.HarpDryFire__hHarpDry'
00144	     hSelectWeaponSound=Sound'XIIIsound.Guns__HarpSelWp.HarpSelWp__hHarpSelWp'
00145	     hAltFireSound=Sound'XIIIsound.Guns__HarpFireAlt.HarpFireAlt__hHarpFireAlt'
00146	     hActWaitSound=Sound'XIIIsound.Guns__HarpWait.HarpWait__hHarpWait'
00147	     InventoryGroup=8
00148	     PickupClassName="XIII.LHarponPick"
00149	     PlayerViewOffset=(X=5.000000,Y=9.000000)
00150	     ThirdPersonRelativeLocation=(X=25.000000,Y=-4.000000,Z=16.000000)
00151	     ThirdPersonRelativeRotation=(Pitch=7000)
00152	     AttachmentClass=Class'XIII.LHarponAttach'
00153	     ItemName="HARPOON GUN"
00154	     DrawScale=0.300000
00155	}

End Source Code