//=============================================================================
// EMPBomb
// by SK
//=============================================================================
class EMPBomb extends sgBuilding;

function PostBeginPlay()
{
local Pawn p;

Super.PostBeginPlay();
	
	for ( p = Level.PawnList; p != None; p = p.nextPawn )
		if ( p.IsA('TournamentPlayer' ) && p.PlayerReplicationInfo.Team !=
          Pawn(Owner).PlayerReplicationInfo.Team)
			TournamentPlayer(P).ReceiveLocalizedMessage(Class'EMPMsg');
}

simulated function FinishBuilding()
{
    Super.FinishBuilding();	
	Explode();
}

function DisableEnemyBuildings()
{

local sgBuilding building;

foreach RadiusActors(class'sgBuilding', building, 2560)
		if (building.Team == Team)
        {

        }
		else
		{
		building.Electrify();
		}
}

function Explode()
{

if ( Role < ROLE_Authority )
			return;
			
		DisableEnemyBuildings();
	 	
		PlaySound(Sound'emp2', SLOT_None, 20,,10000,1+(FRand()*0.3-0.15));
		PlaySound(Sound'emp1', SLOT_None, 20,,7500);
		spawn(class'EMPRings');
		spawn(class'EMPBall');
 		spawn(class'EMPFlash');
		spawn(class'LongFlash');
		RemoteRole = ROLE_SimulatedProxy;		
 		Destroy();
}

defaultproperties
{
    BuildingName="EMP Bomb"
    BuildCost=1500
    BuildTime=10.00
    MaxEnergy=500.00
    Model=LodMesh'Botpack.Module'
    SkinRedTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.ContainerSkinTeam0'
    SkinBlueTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.ContainerSkinTeam1'
    SkinGreenTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.ContainerSkinTeam2'
    SkinYellowTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.ContainerSkinTeam3'
    SpriteRedTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.ContainerSpriteTeam0'
    SpriteBlueTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.ContainerSpriteTeam1'
    SpriteGreenTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.ContainerSpriteTeam2'
    SpriteYellowTeam=Texture'SiegeUltimateRC7UB01Media.U.BuildingMaps.ContainerSpriteTeam3'
    DSofMFX=2.81
    MFXrotX=(Pitch=2500,Yaw=2500,Roll=2500),
    MultiSkins(0)=Texture'SiegeUltimateRC7UB01Media.GFX.sgContSpriteT0'
    MultiSkins(1)=Texture'SiegeUltimateRC7UB01Media.GFX.sgContSpriteT1'
    MultiSkins(2)=Texture'SiegeUltimateRC7UB01Media.GFX.sgContSpriteT2'
    MultiSkins(3)=Texture'SiegeUltimateRC7UB01Media.GFX.sgContSpriteT3'
    CollisionRadius=16.00
    CollisionHeight=16.00
    
    bNoUpgrade=True
}
