// FILENAME:	DD_Burning_Ice.cs
//
// AUTHOR:	ACrisp [oAo]
//------------------------------------------------------------------------------

$missionName = "DD_Burning_Ice";

$criticalPoints = 5;
$capturablePoints = 5;
$killPoints     = 1;
$deathPoints    = 1;
$totalCriticals = 10;

$blueCriticalsLost = 0;
$purpleCriticalsLost = 0;

$noFactions = FALSE;

$objective1 = "Headquarters.";
$objective2 = "Tracking Station.";
$objective3 = "Power Stations.";
$objective4 = "Turrets.";
$capturable1 = "Supply Base";

$briefingTxt = "In the Ural Mountains Knights and Cybrids battle for survival.  Each side has two bases.  The first side to destroy the other's generators, headquarters, turrets, and tracking station will control this region.  In addition, there is a small supply base near the center that must be captured.";

$yellowtech = "none";
$redtech = "none";
$bluetech = "Knight";
$purpletech = "Cybrid";

$base1Owner = "";

exec("multiplayerStdLib.cs");
exec("teamSetupStdlib.cs");
exec("DDStdlib.cs");
exec("baseCaptureStdlib.cs");

$server::HudMapViewOffsetX = 0;
$server::HudMapViewOffsetY = 7168;

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

	$server::AllowTeamRed = false;
	$server::AllowTeamBlue = true;
	$server::AllowTeamYellow = false;
	$server::AllowTeamPurple = true;

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

   $server::TeamDamage = true;
}


function onMissionStart()
{
        createActors();
   
	iceSounds();
}

function onMissionLoad()
{
   cdAudioCycle("SS3", "Gnash", "Cloudburst"); 
   setRules();
}   

function createActors()
{
   %x = 656;
   %y = 6320;

   for (%i = 0; %i < 2; %i++)
   {
     %name = "drone" @ %i;
     // this bit is just for ambiance
     if ($bluetech == "Knight")
      {
        %herc = NewObject(%name, flyer, 110);
      }
     else if (($bluetech == "Imperial") || ($bluetech == "Human"))
      {
        %herc = NewObject(%name, flyer, 9);
      }
     else if ($bluetech == "Rebel")
      {
        %herc = NewObject(%name, tank, 70);
      }
     else
      {
        %herc = NewObject(%name, flyer, 91);
      }

     setTeam(%herc, *IDSTR_TEAM_BLUE);
     placeObject(%herc, %x, %y, 0);
     %x = %x + 32;
   }

}

function giveBase1ToThisTeam(%team)
{
   setTeam(getObjectId("MissionGroup\\baseOne\\navBase1"), %team);
   setTeam(getObjectId("MissionGroup\\baseOne\\tracking1"), %team);
   setTeam(getObjectId("MissionGroup\\baseOne\\storage1"), %team);
   setTeam(getObjectId("MissionGroup\\baseOne\\storage2"), %team);
   setTeam(getObjectId("MissionGroup\\baseOne\\defenses\\turret1"), %team);
   setTeam(getObjectId("MissionGroup\\baseOne\\defenses\\turret2"), %team);


}