//=============================================================================
// ExplodingBuildingZone.
//=============================================================================
class ExplodingBuildingZone expands ZoneInfo;

var() class<EnhancedSiegeMessage> PunishmentMessageClass;

event ActorEntered( actor Other )
{
	local sgWarShell BuildingDenied;
	if ( Other.IsA('sgBuilding') )
		{
			BuildingDenied = Spawn(class'sgWarShell',,,Other.Location);
			BuildingDenied.Explode(BuildingDenied.location, vector(BuildingDenied.rotation));
			Other.Destroy();
			PunishmentAlert();
		}

	if ( Other.IsA('Translocator') )
		{
			// PUNISHMENT IS INEVTABLE! you shall not translocate away!
			Other.Destroy();
		}
}

function PunishmentAlert()
{
    local pawn p;

	for ( p = Level.PawnList; p != None; p = p.nextPawn )
		if ( p.IsA('TournamentPlayer' ))
	        TournamentPlayer(P).ReceiveLocalizedMessage(PunishmentMessageClass);
}

defaultproperties
{
    PunishmentMessageClass=Class'BuildingPunishmentMessage'
}
