//=============================================================================
// sgSupplierXXL
//=============================================================================
class sgSupplierXXL extends sgEquipmentSupplier;




simulated event Timer()
{
	local sgSupplier MySupplier;
	
	
	Super.Timer();
	
	if ( SCount > 0 || Role != ROLE_Authority )
	{
         return;
	}
			
	foreach RadiusActors(Class'sgSupplier', MySupplier, 32768)
	if (MySupplier.Team == Team)
	MySupplier.bProtected=False;
}



function Supply(Pawn target)
{
 local int numWeapons, i;
 local Inventory inv;
 
 if (bDisabledByEMP){return;}
    

    if ( !default.ClassesLoaded )
        LoadWeaponClasses();

    numWeapons = GetWeaponCount();

    for ( i = 0; i < numWeapons; i++ )
    {
        if ( default.WeaponClasses[i] == None )
            continue;

        inv = target.FindInventoryType(default.WeaponClasses[i]);
        if ( inv != None && Weapon(inv) != None &&
          Weapon(inv).AmmoType != None )
        {
            if ( Weapon(inv).AmmoType.AmmoAmount <
              Weapon(inv).PickupAmmoCount / 2 )
                Weapon(inv).AmmoType.AmmoAmount =
                  Weapon(inv).PickupAmmoCount / 2;
            else if ( FRand() < float(Weapon(inv).AmmoType.MaxAmmo) / 400 )
                Weapon(inv).AmmoType.AmmoAmount = FMin(
                  Weapon(inv).AmmoType.AmmoAmount + 1 +
                  int(FRand()*Grade/2*EquipRate),
                  Weapon(inv).AmmoType.MaxAmmo);
        }
    }

    inv = target.FindInventoryType(class'sgArmor');
    if ( inv == None )
    {
        inv = Spawn(class'sgArmor');
        if ( inv != None )
            inv.GiveTo(target);
    }
    if ( inv != None && FRand() < 0.1 + (Grade/15) && inv.Charge < 25 +
      Grade*25 )
        inv.Charge = FMin(inv.Charge + 1, 25 + grade * 25 );

    if ( FRand() < 0.2 )
        target.PlaySound(sound'SiegeUltimateRC7UB01Media.sgStockUp', SLOT_Misc,
          target.SoundDampening*2.5);
}


defaultproperties
{
    bSuperSupplier=True
    SupplyRadius=72.00
    EquipRate=4.00
    BuildingName="Super Supplier"
    BuildCost=1500
    BuildTime=60.00
    MaxEnergy=30000.00
    Model=LodMesh'Botpack.ShockWavem'
    SkinRedTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.SuperBoosterSpriteT0'
    SkinBlueTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.SuperBoosterSpriteT1'
    SkinGreenTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.SuperBoosterSpriteT2'
    SkinYellowTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.SuperBoosterSpriteT3'
    SpriteRedTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.SuperProtectorSpriteT0'
    SpriteBlueTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.SuperProtectorSpriteT1'
    SpriteGreenTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.SuperProtectorSpriteT2'
    SpriteYellowTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.SuperProtectorSpriteT3'
    DSofMFX=2.00
    MFXrotX=(Pitch=25000,Yaw=25000,Roll=25000),
    MultiSkins(0)=Texture'SiegeUltimateRC7UB01Media.GFX.sgSupSpriteT0'
    MultiSkins(1)=Texture'SiegeUltimateRC7UB01Media.GFX.sgSupSpriteT1'
    MultiSkins(2)=Texture'SiegeUltimateRC7UB01Media.GFX.sgSupSpriteT2'
    MultiSkins(3)=Texture'SiegeUltimateRC7UB01Media.GFX.sgSupSpriteT3'
}
