## XIII
Class XIIIWeaponAttachment

source: C:\XIII\XIII\Classes\XIIIWeaponAttachment.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.InventoryAttachment
             |
             +--Engine.WeaponAttachment
                |
                +--XIII.XIIIWeaponAttachment

Direct Known Subclasses:Johansson_Attachment, ArbaleteAttach, ArbaleteX3Attach, AshTrayAttach, BarSitAttach, BazookAttach, BerettaAttach, BouteilleAttach, BrikAttach, BroomAttach, ChaiseAttach, CueAttach, DartAttach, FGrenadAttach, FistsAttach, FullMedKitAttach, FusilChasseAttach, FusilPompeAttach, FusilSnipeAttach, GlassShardAttach, GrenadAttach, KalashAttach, LHarponAttach, M16Attach, M60Attach, MagnumAttach, MedKitAttach, MicroAttach, MiniUziAttach, PhoneAttach, ShovelSandAttach, ShovelSnowAttach, TKnifeAttach, UnLockerAttach, WBallAttach, FlashBangAttach, MPBombAttach

class XIIIWeaponAttachment
extends Engine.WeaponAttachment

Variables
`BulletTrail` | `BT` BulletTrail once spawned to handle update
`Shells` | `BulletShellFX`
`int` | `ClientImpactNb` Visual Impact SFX to run when impacting
`BulletScorch` | `DecalProjector` projector to update (to avoid spawn each time)
`class` | `DecalProjectorClass` Visual Impact to leave on geometry
`class` | `ImpactEmitterMem` Visual Impact SFX to run when impacting
`class` | `MuzzleClass`
`MuzzleFlashAttachment` | `MuzzleFlash`
`vector` | `MuzzleOffset`
`rotator` | `MuzzleRotationOffset`
`vector` | `ShellEffectOffset`
`vector` | `ShellFirstPersonOffset`
`class` | `ShellSFXEmitter`
`class` | `TraceClass` Class of BulletTrace to spawn
`float` | `TraceFrequency` Frequency of spawn for above class
`int` | `TrailDist` Trail distance to draw, for on-line
`class` | `WeaponClass` to get default third person relatives on clients (w/out knowing real weapon)
`rotator` | `WeaponThirdPersonRelativeRotation` to get default third person relatives on clients (w/out knowing real weapon)
`bool` | `bMuzzleRandRotation`
`bool` | `bSpawnShells`
`bool` | `bTrace`
`float` | `fShellDelay`
`int` | `iBulletShellCount`

Function Summary
`simulated` | `HandleClientImpact()`
    //_____________________________________________________________________________
    // we don't want to replicate emitter/decal spawns so make it local
`simulated` | `HandleLocalClientImpact()`
    //_____________________________________________________________________________
    // we don't want to replicate emitter/decal spawns so make it local
`simulated` | `MuzzleAttach()`
    //_____________________________________________________________________________
`simulated` | `SetUpImpactEmitter(Sound S)`
    //_____________________________________________________________________________
`simulated` | `SpawnDecal(vector HL, vector HN)`
    //_____________________________________________________________________________

Source Code

    00001	class XIIIWeaponAttachment extends WeaponAttachment;
    00002
    00003	var bool bSpawnShells;
    00004	var bool bMuzzleRandRotation;
    00005	var bool bTrace;
    00006
    00007	var shells BulletShellFX;
    00008	var vector ShellEffectOffset;
    00009	var vector ShellFirstPersonOffset;
    00010	var int iBulletShellCount;
    00011	var float fShellDelay;
    00012	var class<Shells> ShellSFXEmitter;
    00013	var MuzzleFlashAttachment MuzzleFlash;
    00014	var class<MuzzleFlashAttachment> MuzzleClass;
    00015	var vector MuzzleOffset;
    00016	var rotator MuzzleRotationOffset;
    00017
    00018	var class<BulletTrail> TraceClass;    // Class of BulletTrace to spawn
    00019	var BulletTrail BT;                   // BulletTrail once spawned to handle update
    00020	var float TraceFrequency;             // Frequency of spawn for above class
    00021	var int TrailDist;                    // Trail distance to draw, for on-line
    00022
    00023	var class<Weapon> WeaponClass;  // to get default third person relatives on clients (w/out knowing real weapon)
    00024	var rotator WeaponThirdPersonRelativeRotation;
    00025
    00026	// To spawn impact SFX on clients ::
    00027	var class<BulletScorch> DecalProjectorClass;  // Visual Impact to leave on geometry
    00028	var BulletScorch DecalProjector;              // projector to update (to avoid spawn each time)
    00029	var class<ImpactEmitter> ImpactEmitterMem;    // Visual Impact SFX to run when impacting
    00030	var int ClientImpactNb;
    00031
    00032	//_____________________________________________________________________________
    00033	replication
    00034	{
    00035	    // Things the server should send to the client.
    00036	/*
    00037	    reliable if (Role==ROLE_Authority)
    00038	      MuzzleFlash;
    00039	*/
    00040	}
    00041
    00042	//_____________________________________________________________________________
    00043	simulated event PostBeginPlay()
    00044	{
    00045	    if ( DBOnline ) Log("WATTACH spawned "$self@"Instigator="$Instigator@"Owner="$Owner);
    00046
    00047	/*
    00048	    FlashCount = Pawn(Owner).FlashCount;
    00049	    AltFlashCount = Pawn(Owner).AltFlashCount;
    00050	    ReloadClientCount = Pawn(Owner).ReloadClientCount;
    00051	*/
    00052
    00053	    Super.PostBeginPlay();
    00054	    Instigator = Pawn(Owner);
    00055	}
    00056
    00057	//_____________________________________________________________________________
    00058	simulated function MuzzleAttach()
    00059	{
    00060	    local name BoneName;
    00061
    00062	    if ( DBOnline ) Log("WATTACH MuzzleAttach "$self@"Instigator.Weapon="$Instigator.Weapon);
    00063	    if ( Instigator == none )
    00064	      Instigator = Pawn(Owner);
    00065	    if ( (Instigator != None) && (MuzzleClass != None) )
    00066	    {
    00067	      MuzzleFlash = spawn(MuzzleClass,Instigator);
    00068	      BoneName = Instigator.GetWeaponBoneFor(Instigator.Weapon);
    00069	      if (BoneName == '')
    00070	      {
    00071	        Instigator.AttachTobone(MuzzleFlash, 'X R Hand');
    00072	//        MuzzleFlash.SetLocation(Instigator.Location);
    00073	//        MuzzleFlash.SetBase(Instigator);
    00074	      }
    00075	      else
    00076	        Instigator.AttachToBone(MuzzleFlash,BoneName);
    00077
    00078	      MuzzleFlash.SetRelativeRotation(MuzzleRotationOffset);
    00079	      MuzzleFlash.SetRelativeLocation(MuzzleOffset >> WeaponThirdPersonRelativeRotation);
    00080	      MuzzleFlash.bUseRandRotation = bMuzzleRandRotation;
    00081	    }
    00082	}
    00083
    00084	//_____________________________________________________________________________
    00085	simulated event Destroyed()
    00086	{
    00087	    if ( DBOnline ) Log("WATTACH destroyed"@self);
    00088
    00089	    if ( Instigator == none )
    00090	      Instigator = Pawn(Owner);
    00091	    Instigator.FlashCount = 0;
    00092	    Instigator.AltFlashCount = 0;
    00093	    Instigator.ReloadClientCount = 0;
    00094
    00095	    if ( BulletShellFX != None )
    00096	      BulletShellFX.Destroy();
    00097	    if ( MuzzleFlash != None )
    00098	      MuzzleFlash.Destroy();
    00099	    if( BT != none )
    00100	      BT.Destroy();
    00101	    if ( DecalProjector != none )
    00102	      DecalProjector.Destroy();
    00103	    Super.Destroyed();
    00104	}
    00105
    00106	//_____________________________________________________________________________
    00107	simulated event ThirdPersonEffects()
    00108	{
    00109	    local bool bSpawnShell;
    00110
    00111	    if ( DBOnline ) Log("WATTACH ThirdPersonEffects call for "$self@"FlashCount="$FlashCount);
    00112
    00113	    Super.ThirdPersonEffects();
    00114
    00115	    if ( MuzzleFlash == none )
    00116	      MuzzleAttach();
    00117	    if (MuzzleFlash != None)
    00118	    {
    00119	      if ( DBOnline ) Log("  FLASHING"@MuzzleFlash);
    00120	      MuzzleFlash.Flash();
    00121	    }
    00122
    00123	    if ( ((Level.NetMode == NM_Client) || (TraceFrequency*3 > fRand())) && (TraceClass != None) )
    00124	    {
    00125	      bTrace = true;
    00126	      SetTimer2(0.05, false);
    00127	    }
    00128
    00129	    if ( bSpawnShells )
    00130	    {
    00131	      if ( fShellDelay !=0.0 )
    00132	      {
    00133	        SetTimer( fShellDelay, false);
    00134	      }
    00135	      else
    00136	      {
    00137	        if ( BulletShellFX == None )
    00138	          BulletShellFX = Spawn(ShellSFXEmitter);
    00139
    00140	        iBulletShellCount ++;
    00141	//        log("iBulletShellCount="$iBulletShellCount$" iBulletShellCount%3="$(iBulletShellCount%3));
    00142	        if ( (Instigator != None) && !Instigator.bIsDead && (Instigator.Weapon != None) )
    00143	        {
    00144	          if ( ( Instigator.controller.bIsBot) || ( ( (Instigator.controller.bIsPlayer) && !XIIIPlayercontroller(Instigator.controller).bBehindView ) ))
    00145	          {
    00146	            bSpawnShell = true;
    00147	            if ( BulletShellFX.Owner != Instigator.Weapon )
    00148	            {
    00149	//              Log("First person view, spawning bullet from Owner="$Instigator.Weapon@"ShellFirstPersonOffset="$ShellFirstPersonOffset);
    00150	              BulletShellFX.SetOwner(Instigator.Weapon);
    00151	              BulletShellFX.Emitters[0].StartLocationOffset = ShellFirstPersonOffset;
    00152	            }
    00153	          }
    00154	          else if ( BulletShellFX.Owner != self )
    00155	          {
    00156	//            Log("not player or behindview, spawning bullet from Owner="$self@"ShellEffectOffset="$ShellEffectOffset);
    00157	            BulletShellFX.SetOwner(self);
    00158	            BulletShellFX.Emitters[0].StartLocationOffset = ShellEffectOffset;
    00159	          }
    00160	        }
    00161	        else if ( BulletShellFX.Owner != self )
    00162	        {
    00163	//          Log("instigator or weapon == none, spawning bullet from Owner="$self@"ShellEffectOffset="$ShellEffectOffset);
    00164	          BulletShellFX.SetOwner(self);
    00165	          BulletShellFX.Emitters[0].StartLocationOffset = ShellEffectOffset;
    00166	        }
    00167	        if ( bSpawnShell || (iBulletShellCount%3 == 0) )
    00168	          BulletShellFX.TriggerParticle();
    00169	      }
    00170	    }
    00171	}
    00172
    00173	//_____________________________________________________________________________
    00174	simulated event ThirdPersonAltEffects()
    00175	{
    00176	    if ( DBOnline ) Log("WATTACH ThirdPersonAltEffects call for "$self@"AltFlashCount="$AltFlashCount);
    00177	    Super.ThirdPersonAltEffects();
    00178	}
    00179
    00180	//_____________________________________________________________________________
    00181	simulated event ThirdPersonSwitchWeapon()
    00182	{
    00183	    if ( DBOnline ) Log("WATTACH ThirdPersonSwitchWeapon call for "$self);
    00184	    if ( XIIIPawn(Instigator) != None )
    00185	      XIIIPawn(Instigator).PlaySwitchingWeapon(1.0, FiringMode);
    00186	//      XIIIPawn(Instigator).PlaySwitchingWeapon(1.0,XIIIWeapon(Instigator.PendingWeapon).FiringMode);
    00187	}
    00188
    00189	//_____________________________________________________________________________
    00190	Simulated event Timer()
    00191	{
    00192	    local bool bSpawnShell;
    00193
    00194	    if ( BulletShellFX == None )
    00195	      BulletShellFX = Spawn(ShellSFXEmitter);
    00196
    00197	    iBulletShellCount ++;
    00198	//    log("iBulletShellCount="$iBulletShellCount$" iBulletShellCount%3="$(iBulletShellCount%3));
    00199	    if ( (Instigator != None) && !Instigator.bIsDead && (Instigator.Weapon != None) )
    00200	    {
    00201	      if ( Instigator.controller.bIsBot || (Instigator.controller.bIsPlayer && !XIIIPlayercontroller(Instigator.controller).bBehindView) )
    00202	      {
    00203	        bSpawnShell = true;
    00204	        if ( BulletShellFX.Owner != Instigator.Weapon )
    00205	        {
    00206	//            Log("First person view, spawning bullet from Owner="$Instigator.Weapon@"ShellFirstPersonOffset="$ShellFirstPersonOffset);
    00207	          BulletShellFX.SetOwner(Instigator.Weapon);
    00208	          BulletShellFX.Emitters[0].StartLocationOffset = ShellFirstPersonOffset;
    00209	        }
    00210	      }
    00211	      else if ( BulletShellFX.Owner != self )
    00212	      {
    00213	//          Log("not player or behindview, spawning bullet from Owner="$self@"ShellEffectOffset="$ShellEffectOffset);
    00214	        BulletShellFX.SetOwner(self);
    00215	        BulletShellFX.Emitters[0].StartLocationOffset = ShellEffectOffset;
    00216	      }
    00217	    }
    00218	    else if ( BulletShellFX.Owner != self )
    00219	    {
    00220	//        Log("instigator or weapon == none, spawning bullet from Owner="$self@"ShellEffectOffset="$ShellEffectOffset);
    00221	      BulletShellFX.SetOwner(self);
    00222	      BulletShellFX.Emitters[0].StartLocationOffset = ShellEffectOffset;
    00223	    }
    00224	    if ( bSpawnShell || (iBulletShellCount%3 == 0) )
    00225	      BulletShellFX.TriggerParticle();
    00226	}
    00227
    00228	//_____________________________________________________________________________
    00229	simulated event Timer2()
    00230	{
    00231	    Local Vector tV, tVRand;
    00232	    local float tF;
    00233
    00234	//    Log(self@"Timer2, bTrace="$bTrace);
    00235	    if ( bTrace )
    00236	    {
    00237	      if (BT == none)
    00238	      {
    00239	        BT = Spawn(TraceClass,self,,Location, Rotation);
    00240	        BT.Instigator = Instigator;
    00241	        BT.bOwnerNoSee = true;
    00242	        BT.ActorOffset = MuzzleOffset - (WeaponClass.default.ThirdPersonRelativeLocation << WeaponClass.default.ThirdPersonRelativeRotation);
    00243	        BT.Init();
    00244	      }
    00245
if ( BT != none ) 00246 { 00247 BT.Reset(); 00248 BT.RibbonColor = BT.default.RibbonColor * fRand(); 00249 BT.OutlineColor = BT.default.OutlineColor * fRand(); 00250 BT.SetDrawType(DT_Trail); 00251 // Add sections to draw bullet traces 00252 if ( (Level.NetMode == NM_StandAlone) && (Instigator.Controller != none) && (Instigator.Controller.Enemy != none) && Instigator.Controller.Enemy.IsPlayerPawn() ) 00253 { // Attempt to draw bullet traces in front of player 00254 tVRand = vRand() * 0.2; 00255 tVRand += vector(Instigator.Controller.Enemy.Controller.Rotation); // little offset vs view 00256 // 10% max offset from real trace going out from gun 00257 tF = vSize(BT.Location + vector(Rotation)*iBTrailDist) * 0.1; 00258 tVRand = normal(tVRand) * tF; 00259 BT.AddSection(BT.Location + vector(Rotation)*iBTrailDist + tVRand); 00260 BT.AddSection(BT.Location); 00261 /* 00262 tVRand = vRand(); 00263 tVRand.X *= 0.2; 00264 tVRand.Y *= 0.2; 00265 tV = Instigator.Controller.Enemy.Location + (vector(Instigator.Controller.Enemy.Controller.Rotation)+tVRand)*120; 00266 tV += vector(Rotation)*300; 00267 if ( vSize(tV) > iBTrailDist ) 00268 tV = Normal(tV)*iBTrailDist; 00269 BT.AddSection(tV); 00270 BT.AddSection(BT.Location); 00271 */ 00272 } 00273 else 00274 { // Std Bullet Traces 00275 if ( Level.NetMode == NM_Client ) 00276 { // Client Spawn impactemitter for other pawns 00277 if ( !Instigator.IsLocallyControlled() ) 00278 HandleClientImpact(); 00279 else 00280 HandleLocalClientImpact(); 00281 } 00282 else 00283 iBTrailDist = TrailDist; 00284 BT.AddSection(BT.Location + vector(Rotation)*iBTrailDist); 00285 BT.AddSection(BT.Location); 00286 } 00287 } 00288 bTrace = false; 00289 SetTimer2(0.5, true); 00290 } 00291 else 00292 { // bullet traces should be reseted often to avoid presence in lot of Leaves & crash the engine 00293 if ( BT != none ) 00294 { 00295 BT.SetDrawType(DT_None); 00296 BT.Reset(); 00297 } 00298 SetTimer2(1.0+fRand(), true); 00299 } 00300 } 00301 00302 //_____________________________________________________________________________ 00303 // we don't want to replicate emitter/decal spawns so make it local 00304 Simulated function HandleClientImpact() 00305 { 00306 Local Actor A; 00307 local vector HitLoc, HitNorm; 00308 local material HitMat; 00309 00310 A = Trace(HitLoc, HitNorm, BT.Location + vector(Rotation)*TrailDist, BT.Location, true, vect(0,0,0), HitMat, TRACETYPE_DiscardIfCanShootThroughWithRayCastingWeapon); 00311 // Log(" "$self@"HandleClientImpact Dist="$TrailDist@"A="$A@"HitMat="$HitMat); 00312 if ( (A != none) && (HitMat != none) && (HitMat.HitSound != none) ) 00313 { 00314 iBTrailDist = vSize(HitLoc - BT.Location); 00315 SetUpImpactEmitter(HitMat.HitSound); 00316 // Log(" DecalClass="$DecalProjectorClass@"ImpactClass="$ImpactEmitterMem); 00317 SpawnDecal(HitLoc, HitNorm); 00318 if ( ImpactEmitterMem != none ) 00319 Spawn(ImpactEmitterMem,,, HitLoc+HitNorm, Rotator(HitNorm)); 00320 } 00321 else if ( Pawn(A) != none ) 00322 { 00323 iBTrailDist = vSize(HitLoc - BT.Location); 00324 Spawn(class'BloodShotEmitter',,, HitLoc+HitNorm, Rotator(HitNorm)); 00325 } 00326 else 00327 iBTrailDist = TrailDist; 00328 } 00329 00330 //_____________________________________________________________________________ 00331 // we don't want to replicate emitter/decal spawns so make it local 00332 Simulated function HandleLocalClientImpact() 00333 { 00334 Local Actor A; 00335 local vector HitLoc, HitNorm; 00336 local material HitMat; 00337 local int i; 00338 00339 // locally controled, use controller rotation to have accurate loc. 00340 for ( i = 0; i < ClientImpactNb; i++) 00341 { 00342 A = Trace(HitLoc, HitNorm, Instigator.Location + Instigator.EyePosition() + (vector(Instigator.Controller.Rotation) * 100.0 + vRand()*Instigator.Weapon.TraceAccuracy) * TrailDist/100.0, Instigator.Location + Instigator.EyePosition(), true, vect(0,0,0), HitMat, TRACETYPE_DiscardIfCanShootThroughWithRayCastingWeapon); 00343 // Log(" "$self@"HandleLocalClientImpact Dist="$TrailDist@"A="$A@"HitMat="$HitMat); 00344 if ( (A != none) && (HitMat != none) && (HitMat.HitSound != none) ) 00345 { 00346 iBTrailDist = vSize(HitLoc - ( Instigator.Location + Instigator.EyePosition())); 00347 SetUpImpactEmitter(HitMat.HitSound); 00348 // Log(" DecalClass="$DecalProjectorClass@"ImpactClass="$ImpactEmitterMem); 00349 SpawnDecal(HitLoc, HitNorm); 00350 if ( ImpactEmitterMem != none ) 00351 Spawn(ImpactEmitterMem,,, HitLoc+HitNorm, Rotator(HitNorm)); 00352 } 00353 else if ( Pawn(A) != none ) 00354 { 00355 iBTrailDist = vSize(HitLoc - ( Instigator.Location + Instigator.EyePosition())); 00356 Spawn(class'BloodShotEmitter',,, HitLoc+HitNorm, Rotator(HitNorm)); 00357 } 00358 else 00359 iBTrailDist = TrailDist; 00360 } 00361 } 00362 00363 //_____________________________________________________________________________ 00364 simulated function SpawnDecal(vector HL, vector HN) 00365 { 00366 if ( (DecalProjector == none) && (DecalProjectorClass != none) ) 00367 { 00368 DecalProjector = Spawn(DecalProjectorClass,Owner,,HL + HN, rotator(-HN)); 00369 } 00370 else if (DecalProjector != none) 00371 { 00372 DecalProjector.SetLocation( HL+HN ); 00373 DecalProjector.SetRotation( rotator(-HN) ); 00374 DecalProjector.UpdateScorch(); 00375 } 00376 } 00377 00378 //_____________________________________________________________________________ 00379 simulated function SetUpImpactEmitter(Sound S) 00380 { 00381 local string Str; 00382 local int i; 00383 00384 // First get rid of the beginning of the sound name just to keep whet is needed 00385 Str = string(S); 00386 i = InStr(S, 'hPlay'); 00387 Str = Right(Str, Len(Str) - i - 5); 00388 // Log("SetUpImpactEmitter Bullet --'"$Str$"'--"); 00389 00390 // Then switch/case the result to setup the SFX class 00391 switch (Str) 00392 { 00393 case "ImpBtE": 00394 case "ImpBtI": 00395 case "ImpCar": 00396 case "ImpMar": 00397 case "ImpTil": 00398 case "ImpPie": 00399 // Concrete type 00400 00401 if ( (DecalProjector != none) && (DecalProjector.Class != Class'XIII.BulletScorch') ) 00402 { 00403 DecalProjector.LifeSpan = 2.0+fRand(); 00404 DecalProjector = none; 00405 } 00406 DecalProjectorClass = Class'XIII.BulletScorch'; 00407 ImpactEmitterMem = class'BulletDustEmitter'; 00408 break; 00409 case "ImpGra": 00410 // Gravel type 00411 if ( (DecalProjector != none) && (DecalProjector.Class != Class'XIII.BulletScorch') ) 00412 { 00413 DecalProjector.LifeSpan = 2.0+fRand(); 00414 DecalProjector = none; 00415 } 00416 DecalProjectorClass = Class'XIII.BulletScorch'; 00417 ImpactEmitterMem = class'GravelDustEmitter'; 00418 break; 00419 case "ImpBoiC": 00420 case "ImpBoiP": 00421 case "ImpPar": 00422 case "ImpFeu": 00423 // Wood type 00424 if ( (DecalProjector != none) && (DecalProjector.Class != Class'XIII.BulletScorchWood') ) 00425 { 00426 DecalProjector.LifeSpan = 2.0+fRand(); 00427 DecalProjector = none; 00428 } 00429 DecalProjectorClass = Class'XIII.BulletScorchWood'; 00430 ImpactEmitterMem = class'WoodDustEmitter'; 00431 break; 00432 case "ImpEau": 00433 // Water type (should not happen but maybe....) 00434 if ( (DecalProjector != none) && (DecalProjector.Class != Class'XIII.BulletScorch') ) 00435 { 00436 DecalProjector.LifeSpan = 2.0+fRand(); 00437 DecalProjector = none; 00438 } 00439 DecalProjectorClass = Class'XIII.BulletScorch'; 00440 ImpactEmitterMem = class'BulletDustEmitter'; 00441 break; 00442 case "ImpGla": 00443 case "ImpVer": 00444 // Glass type 00445 if ( (DecalProjector != none) && (DecalProjector.Class != Class'XIII.BulletScorchGlass') ) 00446 { 00447 DecalProjector.LifeSpan = 2.0+fRand(); 00448 DecalProjector = none; 00449 } 00450 DecalProjectorClass = Class'XIII.BulletScorchGlass'; 00451 ImpactEmitterMem = class'GlassImpactEmitter'; 00452 break; 00453 case "ImpGri": 00454 case "ImpMet": 00455 case "ImpTol": 00456 // Metal type 00457 if ( (DecalProjector != none) && (DecalProjector.Class != Class'XIII.BulletScorchMetal') ) 00458 { 00459 DecalProjector.LifeSpan = 2.0+fRand(); 00460 DecalProjector = none; 00461 } 00462 DecalProjectorClass = Class'XIII.BulletScorchMetal'; 00463 ImpactEmitterMem = class'BulletMetalEmitter'; 00464 break; 00465 case "ImpHrb": 00466 // Grass Type 00467 if ( DecalProjector != none ) 00468 DecalProjector.LifeSpan = 2.0+fRand(); 00469 DecalProjector = none; 00470 DecalProjectorClass = none; 00471 ImpactEmitterMem = class'GrassDustEmitter'; 00472 break; 00473 case "ImpTer": 00474 // Earth type 00475 if ( (DecalProjector != none) && (DecalProjector.Class != Class'XIII.BulletScorch') ) 00476 { 00477 DecalProjector.LifeSpan = 2.0+fRand(); 00478 DecalProjector = none; 00479 } 00480 DecalProjectorClass = Class'XIII.BulletScorch'; 00481 ImpactEmitterMem = class'EarthDustEmitter'; 00482 break; 00483 case "ImpNei": 00484 // Snow 00485 if ( DecalProjector != none ) 00486 DecalProjector.LifeSpan = 2.0+fRand(); 00487 DecalProjector = none; 00488 DecalProjectorClass = none; 00489 ImpactEmitterMem = class'SnowDustEmitter'; 00490 break; 00491 case "ImpMol": 00492 case "ImpMoq": 00493 // Soft Types 00494 if ( DecalProjector != none ) 00495 DecalProjector.LifeSpan = 2.0+fRand(); 00496 DecalProjector = none; 00497 DecalProjectorClass = Class'XIII.BulletScorch'; 00498 ImpactEmitterMem = class'MoqDustEmitter'; 00499 break; 00500 case "ImpCdvr": 00501 // Body Type 00502 if ( (DecalProjector != none) && (DecalProjector.Class != Class'XIII.BulletScorchMetal') ) 00503 { 00504 DecalProjector.LifeSpan = 2.0+fRand(); 00505 DecalProjector = none; 00506 } 00507 DecalProjectorClass = Class'XIII.BulletScorchMetal'; 00508 ImpactEmitterMem = class'BloodShotEmitter'; 00509 break; 00510 case "ImpLin": 00511 default: 00512 // other types, not spawn any SFX 00513 if ( (DecalProjector != none) && (DecalProjector.Class != Class'XIII.BulletScorch') ) 00514 { 00515 DecalProjector.LifeSpan = 2.0+fRand(); 00516 DecalProjector = none; 00517 } 00518 DecalProjectorClass = Class'XIII.BulletScorch'; 00519 ImpactEmitterMem = class'BulletDustEmitter'; 00520 break; 00521 } 00522 } 00523 00524 00525 00526 00527 defaultproperties 00528 { 00529 bMuzzleRandRotation=True 00530 ShellSFXEmitter=Class'XIII.Shells' 00531 TraceFrequency=0.330000 00532 TrailDist=3000 00533 ClientImpactNb=1 00534 FiringMode="FM_2H" 00535 AltFiringMode="FM_Fists" 00536 }

End Source Code