XIII
Class c9mmAmmoPeace

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

class c9mmAmmoPeace
extends XIII.c9mmAmmo

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

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 c9mmAmmoPeace extends c9mmAmmo;
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	            B = Spawn(class'XIIIDamageType'.default.BloodShotEmitterClass,Other,, HitLocation+HitNormal, Rotator(-X));
00050	          if (B != none)
00051	            B.NoiseMake(XIIIPawn(Owner), SoftImpactNoise);
00052	        }
00053	      }
00054	      else
00055	      {
00056	        if ( (Level.Game != none) && (Level.Game.GoreLevel == 0) )
00057	          B = Spawn(class'XIIIDamageType'.default.BloodShotEmitterClass,,, 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	defaultproperties
00073	{
00074	     bInfiniteAmmo=True
00075	     MaxAmmo=999
00076	     AmmoAmount=30
00077	     PlayerTransferClassName="XIII.c9mmAmmo"
00078	     ItemName="9mm Peace&Love ammo"
00079	}

End Source Code