class MosqueHudCBombingRun extends HudCBombingRun;

#exec OBJ LOAD FILE="..\Sounds\MosqueSounds.uax"

simulated function UpdateTeamHud()
{
local GameReplicationInfo GRI;
local int i;
local int TeamOffset;
local int Index;

if ((PawnOwnerPRI != none) && (PawnOwnerPRI.Team != None))
        TeamOffset = Clamp(PawnOwnerPRI.Team.TeamIndex,0,1);
else
        TeamOffset = 0;

GRI = PlayerOwner.GameReplicationInfo;

if ((PawnOwnerPRI != none) && (GRI.FlagTarget == PawnOwnerPRI) && (BombFlag != None) && (BombFlag.Physics == PHYS_Projectile))
	{
	PlayerOwner.ReceiveLocalizedMessage(class'MosqueBombTargetMessage',0,PawnOwnerPRI);
	if (!bPlaying )
		{
		PlayerOwner.ClientPlaySound(sound'MosqueSounds.ball.IncomingPass');
		PlayerOwner.ClientPlaySound(sound'CicadaSnds.TargetLock');
		bPlaying=true;
		}
	}
else
	bPlaying=false;

if (GRI == None) return;

for (i=0; i<2; i++)
	{
        if (GRI.Teams[i] == None) continue;

        Index = (i + TeamOffset) % ArrayCount(ScoreTeam);

        ScoreTeam[Index].Value = Min (GRI.Teams[i].Score, 999);  //max display capability

        if (GRI.TeamSymbols[i] == None) continue;

        TeamSymbols[Index].WidgetTexture = GRI.TeamSymbols[i];
	}

if (PlayerOwner.PlayerReplicationInfo.Team == None)
	BombWidget.BombState = GRI.FlagState[0];
else
	{
	BombWidget.BombState = GRI.FlagState[PlayerOwner.PlayerReplicationInfo.Team.TeamIndex];
	}

Super.UpdateTeamHUD();
}
