XIII
Class M60

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

class M60
extends XIII.XIIIWeapon

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

Function Summary
 
simulated
AltFire(float Value)
     
//_____________________________________________________________________________
 void CauseAltFire()
     
//_____________________________________________________________________________
 string GetAmmoText(out int)
     
//_____________________________________________________________________________
// ELR Text to be displayed in HUD
 Name GetBaseWeaponBone()
     
//_____________________________________________________________________________
 bool HasAltAmmo()
     
//_____________________________________________________________________________
 float RateSelf()
     
//_____________________________________________________________________________
// FRD
 
simulated
RumbleFX()
     
//_____________________________________________________________________________
 void ServerAltFire()
     
//_____________________________________________________________________________
 
simulated
UnFire(float Value)
     
//_____________________________________________________________________________



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class M60 extends XIIIWeapon;
00005	
00006	//var M60AmmoAttachment AmmoRibbon;   // ribbon of ammo.
00007	
00008	//_____________________________________________________________________________
00009	simulated function bool HasAltAmmo()
00010	{
00011	    return false;
00012	}
00013	
00014	//_____________________________________________________________________________
00015	function CauseAltFire()
00016	{
00017	    Global.AltFire(0);
00018	}
00019	
00020	//_____________________________________________________________________________
00021	simulated function AltFire( float Value )
00022	{
00023	    if ( Level.NetMode == NM_Client )
00024	    {
00025	      if ( WeaponMode == WM_Auto )
00026	      {
00027	        TraceAccuracy = default.TraceAccuracy / 2.0;
00028	        WeaponMode = WM_Burst;
00029	      }
00030	      else if ( WeaponMode == WM_Burst )
00031	      {
00032	        TraceAccuracy = default.TraceAccuracy;
00033	        WeaponMode = WM_Auto;
00034	      }
00035	    }
00036	    if ( Instigator.IsLocallyControlled() || (Level.NetMode == NM_StandAlone) )
00037	      Instigator.PlayRolloffSound(hAltFireSound, self);
00038	    ServerAltFire();
00039	}
00040	
00041	//_____________________________________________________________________________
00042	function ServerAltFire()
00043	{
00044	    if ( WeaponMode == WM_Auto )
00045	    {
00046	      TraceAccuracy = default.TraceAccuracy / 2.0;
00047	      WeaponMode = WM_Burst;
00048	    }
00049	    else if ( WeaponMode == WM_Burst )
00050	    {
00051	      TraceAccuracy = default.TraceAccuracy;
00052	      WeaponMode = WM_Auto;
00053	    }
00054	}
00055	
00056	
00057	//_____________________________________________________________________________
00058	simulated function UnFire( float Value )
00059	{
00060	    iBurstCount = 0;
00061	}
00062	
00063	//_____________________________________________________________________________
00064	// ELR Text to be displayed in HUD
00065	simulated function string GetAmmoText(out int bDrawbulletIcon)
00066	{
00067	    local string AmmoText,AltAmmoText;
00068	
00069	    bDrawbulletIcon = 1;
00070	
00071	    // Setup ammotext
00072	    AmmoText = ReLoadCount@"|"@(Ammotype.AmmoAmount-ReLoadCount);
00073	    Switch(WeaponMode)
00074	    {
00075	      Case WM_Auto:
00076	        AmmoText = Ammotext@"("$sWeaponModeAuto$")";
00077	        break;
00078	      Case WM_Burst:
00079	        AmmoText = Ammotext@"("$sWeaponModeBurst$")";
00080	        break;
00081	      Case WM_SemiAuto:
00082	        AmmoText = Ammotext@"("$sWeaponModeSemiAuto$")";
00083	        break;
00084	    }
00085	    return AmmoText;
00086	}
00087	
00088	//_____________________________________________________________________________
00089	simulated function Name GetBaseWeaponBone()
00090	{
00091	    return 'M60';
00092	}
00093	
00094	//_____________________________________________________________________________
00095	simulated function RumbleFX()
00096	{
00097	    if( XIIIPlayerController(Instigator.Controller) == none )
00098	        return;
00099	
00100	    if ( (Instigator != none) && Instigator.IsHumanControlled() && Instigator.IsLocallyControlled() )
00101	    {
00102	      if ( ReloadCount%1 == 0 )
00103	        XIIIPlayerController(Instigator.Controller).RumbleFX(RumbleFXNum);
00104	      else
00105	        XIIIPlayerController(Instigator.Controller).RumbleFX(RumbleFXNum+1);
00106	    }
00107	}
00108	
00109	//_____________________________________________________________________________
00110	// FRD
00111	function float RateSelf()
00112	{
00113	    local float distance;
00114	
00115	    if ( !HasAmmo() )
00116	      return -2;
00117	    if (instigator.controller.enemy!=none)
00118	    {
00119	      distance=Vsize(instigator.controller.enemy.location-instigator.location);
00120	      if (distance>2300)
00121	        return 0.7;
00122	    }
00123	    return AIRating;
00124	}
00125	
00126	
00127	
00128	defaultproperties
00129	{
00130	     bSpecialAltFire=True
00131	     WeaponOnoClass=Class'XIDSpec.M60WeaponOno'
00132	     bRapidFire=True
00133	     bHaveAltFire=True
00134	     bShouldGoThroughTraversable=True
00135	     bHeavyWeapon=True
00136	     bDrawMuzzleFlash=True
00137	     WHand=WHA_2HShot
00138	     AmmoName=Class'XIII.M60Ammo'
00139	     PickupAmmoCount=50
00140	     ReloadCount=200
00141	     MeshName="XIIIArmes.FpsM60M"
00142	     FireOffset=(Y=5.000000,Z=-2.000000)
00143	     CrossHair=Texture'XIIIMenu.HUD.MireM60'
00144	     TraceAccuracy=7.000000
00145	     ShotTime=0.166000
00146	     FiringMode="FM_2HHeavy"
00147	     ViewFeedBack=(X=4.000000,Y=4.000000)
00148	     RumbleFXNum=15
00149	     FirstPersonMFClass=Class'XIII.StarFPMF'
00150	     FPMFRelativeLoc=(Y=54.000000,Z=5.000000)
00151	     ShakeMag=700.000000
00152	     shaketime=2.000000
00153	     ShakeVert=(Y=7.000000,Z=7.000000)
00154	     ShakeSpeed=(Y=500.000000,Z=-500.000000)
00155	     ShakeCycles=2.000000
00156	     AIRating=0.850000
00157	     TraceDist=300.000000
00158	     hFireSound=Sound'XIIIsound.Guns__M60Fire.M60Fire__hM60Fire'
00159	     hReloadSound=Sound'XIIIsound.Guns__M60Rel.M60Rel__hM60Rel'
00160	     hNoAmmoSound=Sound'XIIIsound.Guns__M60DryFire.M60DryFire__hM60Dry'
00161	     hSelectWeaponSound=Sound'XIIIsound.Guns__M60SelWp.M60SelWp__hM60SelWp'
00162	     hAltFireSound=Sound'XIIIsound.Interface.SwitchFireType1'
00163	     hActWaitSound=Sound'XIIIsound.Guns__M60Wait.M60Wait__hM60Wait'
00164	     MuzzleScale=3.500000
00165	     FlashOffsetY=0.185000
00166	     FlashOffsetX=0.130000
00167	     InventoryGroup=16
00168	     PickupClassName="XIII.m60pick"
00169	     PlayerViewOffset=(X=9.000000,Y=9.000000,Z=-8.000000)
00170	     ThirdPersonRelativeLocation=(X=29.000000,Y=-5.000000,Z=6.000000)
00171	     AttachmentClass=Class'XIII.M60Attach'
00172	     ItemName="SMG"
00173	     DrawScale=0.300000
00174	}

End Source Code