## XIII
Class XIIIH2HAmmo

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

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Inventory
             |
             +--Engine.Ammunition
                |
                +--XIII.XIIIAmmo
                   |
                   +--XIII.XIIIH2HAmmo

Direct Known Subclasses:BazookRocketAltAmmo, DecoAmmo, FistsAmmo, HarponAltAmmo, HuntGunAltAmmo, ShotGunAltAmmo, TKnifeAltAmmo

class XIIIH2HAmmo
extends XIII.XIIIAmmo

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

Variables
`int` | `H2HDamages`

Function Summary
`bool` | `HasAmmo()`
    //_____________________________________________________________________________
    // Fists always have ammo
`void` | `ProcessTraceHit(Weapon W, Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)`
    //_____________________________________________________________________________
    // ELR No Ammo used by fists

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class XIIIH2HAmmo extends XIIIAmmo;
    00005
    00006	var int H2HDamages;
    00007
    00008	//_____________________________________________________________________________
    00009	// Fists always have ammo
    00010	simulated function bool HasAmmo()
    00011	{
    00012	    return true;
    00013	}
    00014
    00015	//_____________________________________________________________________________
    00016	// ELR No Ammo used by fists
    00017	function ProcessTraceHit(Weapon W, Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
    00018	{
    00019	    local H2HDustEmitter B;
    00020	    local ImpactEmitter C;
    00021
    00022	    if ( Other == None )
    00023	      return;
    00024
    00025	    if ( Other.bWorldGeometry )
    00026	    {
    00027	      B = Spawn(class'H2HDustEmitter',,, HitLocation+HitNormal, Rotator(HitNormal));
    00028	      if (B!=none)
    00029	      {
    00030	        B.NoiseMake(XIIIPawn(Owner), ImpactNoise);
    00031	        if ( bPlayHitSound )
    00032	        {
    00033	          bPlayHitSound = false;
    00034	          B.PlaySound(HitSoundMem, HitSoundType);
    00035	        }
    00036	      }
    00037	    }
    00038	    else if ( (Other != self) && (Other != Owner) )
    00039	    {
    00040	      Other.TakeDamage(H2HDamages,  Pawn(Owner), HitLocation, 300.0*X, MyDamageType);
    00041	      if ( (Pawn(Other) != none) )
    00042	      {
    00043	        if ( class<XIIIDamageType>(MyDamageType).default.bSpawnBloodFX && (Level.Game != none) && (Level.Game.GoreLevel == 0) )
    00044	          C = Spawn(class'XIIIDamageType'.default.BloodShotEmitterClass,,, HitLocation+HitNormal, Rotator(HitNormal));
    00045	        else
    00046	          C = Spawn(class'H2HDustEmitter',,, HitLocation+HitNormal, Rotator(HitNormal));
    00047	        if (C!=none)
    00048	          C.NoiseMake(XIIIPawn(Owner), SoftImpactNoise);
    00049	      }
    00050	      else
    00051	      {
    00052	        B = Spawn(class'H2HDustEmitter',,, HitLocation+HitNormal, Rotator(HitNormal));
    00053	        if (B!=none)
    00054	        {
    00055	          B.NoiseMake(XIIIPawn(Owner), ImpactNoise);
    00056	          if ( bPlayHitSound )
    00057	          {
    00058	            bPlayHitSound = false;
    00059	            B.PlaySound(HitSoundMem, HitSoundType);
    00060	          }
    00061	        }
    00062	      }
    00063	    }
    00064	}
    00065
    00066
    00067
    00068
    00069	defaultproperties
    00070	{
    00071	     bHandToHand=True
    00072	     MaxAmmo=1
    00073	     AmmoAmount=1
    00074	     ImpactNoise=0.100000
    00075	     HitSoundType=1
    00076	}

End Source Code