XIII
Class M16AmmoPeace

source: C:\XIII\XIII\Classes\M16AmmoPeace.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Inventory
         |
         +--Engine.Ammunition
            |
            +--XIII.XIIIAmmo
               |
               +--XIII.XIIIBulletsAmmo
                  |
                  +--XIII.M16Ammo
                     |
                     +--XIII.M16AmmoPeace
Direct Known Subclasses:None

class M16AmmoPeace
extends XIII.M16Ammo

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

Function Summary
 void ProcessTraceHit(Weapon W, Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
     
//_____________________________________________________________________________



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class M16AmmoPeace extends M16Ammo;
00005	
00006	//_____________________________________________________________________________
00007	function ProcessTraceHit(Weapon W, Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
00008	{
00009	    Local int ActualDamages;
00010	    local int Loc;
00011	    local ImpactEmitter B;
00012	
00013	    if (AmmoAmount > 0)
00014	      AmmoAmount -= 1; // Fire
00015	    else
00016	      return; // EmptyShot.
00017	
00018	    if ( Other == None )
00019	      return;
00020	
00021	    ActualDamages = 0;
00022	//    log(self@"shot for"@ActualDamages@"range"@VSize(HitLocation - W.Location)); // ::DBUG::
00023	
00024	    if ( Other.bWorldGeometry )
00025	    {
00026	      B = Spawn(class'BulletDustEmitter',,, HitLocation+HitNormal, Rotator(HitNormal));
00027	      if (B!=none)
00028	      {
00029	        B.NoiseMake(XIIIPawn(Owner), ImpactNoise);
00030	        if ( bPlayHitSound )
00031	        {
00032	          bPlayHitSound = false;
00033	          B.PlaySound(HitSoundMem, HitSoundType);
00034	        }
00035	      }
00036	      if ( (DecalProjectorClass != None) && (!Other.bNoImpact) )
00037	        SpawnDecal(HitLocation, HitNormal);
00038	    }
00039	    else if ( (Other != self) && (Other != Owner) )
00040	    {
00041	      if ( XIIIPawn(Other) != none )
00042	        Loc = XIIIPawn(Other).GetDamageLocation( HitLocation, Other.Location - Instigator.Location );
00043	      if ( Loc <= 1 )
00044	      {
00045	        Other.TakeDamage(ActualDamages, Pawn(Owner), HitLocation, 30000.0*X, MyDamageType);
00046	        if ( Pawn(Other)!=none )
00047	        {
00048	          if ( (Level.Game != none) && (Level.Game.GoreLevel == 0) )
00049	            Spawn(class'XIIIDamageType'.default.BloodShotEmitterClass,Other,, HitLocation+HitNormal, Rotator(-X));
00050	
00051	          if (B != none)
00052	            B.NoiseMake(XIIIPawn(Owner), SoftImpactNoise);
00053	        }
00054	      }
00055	      else
00056	      {
00057	        B = Spawn(class'BulletDustEmitter',,, HitLocation+HitNormal, Rotator(HitNormal));
00058	        if (B != none)
00059	        {
00060	          B.NoiseMake(XIIIPawn(Owner), ImpactNoise);
00061	          if ( bPlayHitSound )
00062	          {
00063	            bPlayHitSound = false;
00064	            B.PlaySound(HitSoundMem, HitSoundType);
00065	          }
00066	        }
00067	      }
00068	    }
00069	}
00070	
00071	
00072	
00073	defaultproperties
00074	{
00075	     bInfiniteAmmo=True
00076	     MaxAmmo=999
00077	     PlayerTransferClassName="XIII.M16Ammo"
00078	     ItemName="5.56 Peace&Love Model"
00079	}

End Source Code