## XIII
Class FGrenadAmmo

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

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

Direct Known Subclasses:None

class FGrenadAmmo
extends XIII.XIIIProjectilesAmmo

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

Function Summary
`void` | `SpawnProjectile(vector Start, rotator Dir)`
    //_____________________________________________________________________________
    // Executed on server, need ProjectileLifeTime from client

Source Code

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

End Source Code