## XIII
Class GrenadAmmo

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

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

Direct Known Subclasses:None

class GrenadAmmo
extends XIII.XIIIProjectilesAmmo

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

Function Summary
`void` | `SpawnProjectile(vector Start, rotator Dir)`
    //_____________________________________________________________________________

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class GrenadAmmo extends XIIIProjectilesAmmo;
    00005
    00006	//_____________________________________________________________________________
    00007	function SpawnProjectile(vector Start, rotator Dir)
    00008	{
    00009	    local XIIIProjectile XP;
    00010
    00011	    if (AmmoAmount > 0)
    00012	      AmmoAmount -= 1;  // Fire
    00013	    else
    00014	      return;  // Empty Shot
    00015	    XP = XIIIProjectile(Spawn(ProjectileClass,owner,,Start,Dir));
    00016
    00017	    if ( XP != none )
    00018	    {
    00019	      XP.SetImpactNoise(SoftImpactNoise, ImpactNoise);
    00020	      if ( Pawn(Owner).IsPlayerPawn() )
    00021	        GrenadFlying(XP).fLifeTime = GrenadB(Pawn(Owner).Weapon).ProjectileLifeTime - Level.TimeSeconds;
    00022	      //SOUTHEND Set the projectile so it will spawn a viewport just before the explosion
    00023	      if (GrenadFlying(XP).fLifeTime>0.5)
    00024	        GrenadFlying(XP).SetPreExplosion(GrenadFlying(XP).fLifeTime-0.5);
    00025	    }
    00026	}
    00027
    00028	//    PickupClass=class'GrenadPick'
    00029
    00030
    00031	defaultproperties
    00032	{
    00033	     fThrowDelay=0.090000
    00034	     MaxAmmo=15
    00035	     AmmoAmount=1
    00036	     ProjectileClass=Class'XIII.GrenadFlying'
    00037	     ImpactNoise=6.300000
    00038	     SoftImpactNoise=6.300000
    00039	     PickupClassName="XIII.GrenadPick"
    00040	     ItemName="Grenade"
    00041	}

End Source Code