//=============================================================================
// BattleEffect.
//=============================================================================
class BattleEffect expands UT_ShieldBeltEffect;

simulated function Timer()
{
    local int TeamNum;

    bHidden = true;
    if ( Pawn(Owner) == None )
        return;
    if ( Pawn(Owner).PlayerReplicationInfo == None )
        TeamNum = 3;
    else
        TeamNum = Min(3, Pawn(Owner).PlayerReplicationInfo.Team);
    LowDetailTexture = class'UT_Shieldbelt'.Default.TeamTextures[TeamNum];
    if ( Level.NetMode == NM_Client )
    {
        Owner.Texture = LowDetailTexture;
        Owner.bMeshEnviromap = true;
    }
    else
        Owner.SetDisplayProperties(Owner.Style, LowDetailTexture, false, true);

	If (Pawn(Owner).FindInventoryType(Class'BattleSuit') == None)
		Destroy();
}


simulated function Tick(float DeltaTime)
{
    local int IdealFatness;

    if ( bHidden || (Level.NetMode == NM_DedicatedServer) || (Owner == None) )
    {
        Disable('Tick');
        return;
    }

    IdealFatness = Owner.Fatness; // Convert to int for safety.
    IdealFatness += FatnessOffset;

    if ( Fatness > IdealFatness )
        Fatness = Max(IdealFatness, Fatness - 130 * DeltaTime);
    else
        Fatness = Min(IdealFatness, 255);
}
