// FILENAME:	DM_Town_in_the_Middle.cs | v.1.0 |
//
// AUTHORS:  	GM Mad Dog^WP^
//------------------------------------------------------------------------------

$missionName = "DM_Town_in_the_Middle";

exec("multiplayerStdLib.cs");
exec("DMstdLib.cs");

// to disable team damage in the server, comment these two lines
$server::TeamDamage =		true;
$enableTeamHittingPenalty = 	"true";

function setDefaultMissionOptions()
{
	$server::TeamPlay = true;
	$server::AllowDeathmatch = true;
	$server::AllowTeamPlay = true;	

   // what can the client choose for a team
	$server::AllowTeamRed = true;
	$server::AllowTeamBlue = true;
	$server::AllowTeamYellow = false;
	$server::AllowTeamPurple = false;

   // what can the server admin choose for available teams
   $server::disableTeamRed = false;
   $server::disableTeamBlue = false;
   $server::disableTeamYellow = true;
   $server::disableTeamPurple = true;
}

function onMissionStart()
{
	marsSounds();
}

function onMissionLoad()
{
  %jmsg = "<f5>DM_Town_in_the_Middle v.1.0\n\n<f4>Welcome to Town in the Middle! There are a lot of AI scattered around the map, and a few fliers in there to make it interesting. Enjoy the map!";
  setGameInfo(%jmsg);     
   cdAudioCycle("Purge", "Terror", "Watching"); 
}

// Water Tower splash functionality
function structure::onDestroyed(%this, %attackerId){
	// Which water tower was destroyed?
	if(%this == getObjectId("MissionGroup\\BlueBase\\WaterTower1")){
		setShapeVisibility(getObjectId("MissionGroup\\BlueBase\\Splash1"), true);
		playAnimSequence(getObjectId("MissionGroup\\BlueBase\\Splash1"), 0, true);
	}
	else if(%this == getObjectId("MissionGroup\\BlueBase\\WaterTower2")){
		setShapeVisibility(getObjectId("MissionGroup\\BlueBase\\Splash2"), true);
		playAnimSequence(getObjectId("MissionGroup\\BlueBase\\Splash2"), 0, true);
	}
	else if(%this == getObjectId("MissionGroup\\BlueBase\\WaterTower3")){
		setShapeVisibility(getObjectId("MissionGroup\\BlueBase\\Splash3"), true);
		playAnimSequence(getObjectId("MissionGroup\\BlueBase\\Splash3"), 0, true);
	}
}
