//------------------------------------------------------------------------------
// FILENAME:	baseCaptureStdlib.cs
// Version 1.00
//
// AUTHOR:	ACrisp [oAo]
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// This script contains code that will allow mapmakers to set up capturable bases
// on maps (ideal for Defend and Destroy, Capture and Hold, and Capture the Flag
// missions).  Up to 5 capturable bases can be set up.  
//
// Essential items needed:
//
// $capturable1 .. 5: these are variables within the mission script.  Use these to 
// name the bases.
// giveBaseXToThisTeam(%team): you must have one of these function for each 
// capturable base in your map.  this function should contain all the necessary
// code to change the team colour of structures, vehicles, and turrets within a given base.


// Base 1

function baseOneTrigger::Trigger::onEnter(%this, %object)
{
   %team  = getTeam(%object);
   %player = playerManager::vehicleIdToPlayerNum(%object);
   if ((%team == *IDSTR_TEAM_YELLOW) && ($base1Owner != %team))
    {
      $base1Owner = %team;
      %player.baseCaptures++;
      %yellowTxt = "Your team has captured " @ $capturable1 @ "!";
      %otherTxt = "<f5>Yellow Team has taken " @ $capturable1 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %yellowTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\yellowFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\purpleFlag"), false);

      giveBase1ToThisTeam(*IDSTR_TEAM_YELLOW);
    }
   else if ((%team == *IDSTR_TEAM_BLUE) && ($base1Owner != %team))
    {
      $base1Owner = %team;
      %player.baseCaptures++;
      %blueTxt = "Your team has captured " @ $capturable1 @ "!";
      %otherTxt = "<f5>Blue Team has taken " @ $capturable1 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %blueTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\blueFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\purpleFlag"), false);

      giveBase1ToThisTeam(*IDSTR_TEAM_BLUE);
    }
   else if ((%team == *IDSTR_TEAM_RED) && ($base1Owner != %team))
    {
      $base1Owner = %team;
      %player.baseCaptures++;
      %redTxt = "Your team has captured " @ $capturable1 @ "!";
      %otherTxt = "<f5>Red Team has taken " @ $capturable1 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %redTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\redFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\purpleFlag"), false);

      giveBase1ToThisTeam(*IDSTR_TEAM_RED);
    }
   else if ((%team == *IDSTR_TEAM_PURPLE) && ($base1Owner != %team))
    {
      $base1Owner = %team;
      %player.baseCaptures++;
      %purpleTxt = "Your team has captured " @ $capturable1 @ "!";
      %otherTxt = "<f5>Purple Team has taken " @ $capturable1 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %purpleTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseOne\\purpleFlag"), true);

      giveBase1ToThisTeam(*IDSTR_TEAM_PURPLE);
    }

}

// Base 2

function baseTwoTrigger::Trigger::onEnter(%this, %object)
{
   %team  = getTeam(%object);
   %player = playerManager::vehicleIdToPlayerNum(%object);
   if ((%team == *IDSTR_TEAM_YELLOW) && ($base2Owner != %team))
    {
      $base2Owner = %team;
      %player.baseCaptures++;
      %yellowTxt = "Your team has captured " @ $capturable2 @ "!";
      %otherTxt = "<f5>Yellow Team has taken " @ $capturable2 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %yellowTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\yellowFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\purpleFlag"), false);

      giveBase2ToThisTeam(*IDSTR_TEAM_YELLOW);
    }
   else if ((%team == *IDSTR_TEAM_BLUE) && ($base2Owner != %team))
    {
      $base2Owner = %team;
      %player.baseCaptures++;
      %blueTxt = "Your team has captured " @ $capturable2 @ "!";
      %otherTxt = "<f5>Blue Team has taken " @ $capturable2 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %blueTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\blueFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\purpleFlag"), false);

      giveBase2ToThisTeam(*IDSTR_TEAM_BLUE);
    }
   else if ((%team == *IDSTR_TEAM_RED) && ($base2Owner != %team))
    {
      $base2Owner = %team;
      %player.baseCaptures++;
      %redTxt = "Your team has captured " @ $capturable2 @ "!";
      %otherTxt = "<f5>Red Team has taken " @ $capturable2 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %redTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\redFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\purpleFlag"), false);

      giveBase2ToThisTeam(*IDSTR_TEAM_RED);
    }
   else if ((%team == *IDSTR_TEAM_PURPLE) && ($base2Owner != %team))
    {
      $base2Owner = %team;
      %player.baseCaptures++;
      %purpleTxt = "Your team has captured " @ $capturable2 @ "!";
      %otherTxt = "<f5>Purple Team has taken " @ $capturable2 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %purpleTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseTwo\\purpleFlag"), true);

      giveBase2ToThisTeam(*IDSTR_TEAM_PURPLE);
    }

}

// Base 3

function baseThreeTrigger::Trigger::onEnter(%this, %object)
{
   %team  = getTeam(%object);
   %player = playerManager::vehicleIdToPlayerNum(%object);
   if ((%team == *IDSTR_TEAM_YELLOW) && ($base3Owner != %team))
    {
      $base3Owner = %team;
      %player.baseCaptures++;
      %yellowTxt = "Your team has captured " @ $capturable3 @ "!";
      %otherTxt = "<f5>Yellow Team has taken " @ $capturable3 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %yellowTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\yellowFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\purpleFlag"), false);

      giveBase3ToThisTeam(*IDSTR_TEAM_YELLOW);
    }
   else if ((%team == *IDSTR_TEAM_BLUE) && ($base3Owner != %team))
    {
      $base3Owner = %team;
      %player.baseCaptures++;
      %blueTxt = "Your team has captured " @ $capturable3 @ "!";
      %otherTxt = "<f5>Blue Team has taken " @ $capturable3 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %blueTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\blueFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\purpleFlag"), false);

      giveBase3ToThisTeam(*IDSTR_TEAM_BLUE);
    }
   else if ((%team == *IDSTR_TEAM_RED) && ($base3Owner != %team))
    {
      $base3Owner = %team;
      %player.baseCaptures++;
      %redTxt = "Your team has captured " @ $capturable3 @ "!";
      %otherTxt = "<f5>Red Team has taken " @ $capturable3 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %redTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\redFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\purpleFlag"), false);

      giveBase3ToThisTeam(*IDSTR_TEAM_RED);
    }
   else if ((%team == *IDSTR_TEAM_PURPLE) && ($base3Owner != %team))
    {
      $base3Owner = %team;
      %player.baseCaptures++;
      %purpleTxt = "Your team has captured " @ $capturable3 @ "!";
      %otherTxt = "<f5>Purple Team has taken " @ $capturable3 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %purpleTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseThree\\purpleFlag"), true);

      giveBase3ToThisTeam(*IDSTR_TEAM_PURPLE);
    }

}

// Base 4

function baseFourTrigger::Trigger::onEnter(%this, %object)
{
   %team  = getTeam(%object);
   %player = playerManager::vehicleIdToPlayerNum(%object);
   if ((%team == *IDSTR_TEAM_YELLOW) && ($base4Owner != %team))
    {
      $base4Owner = %team;
      %player.baseCaptures++;
      %yellowTxt = "Your team has captured " @ $capturable4 @ "!";
      %otherTxt = "<f5>Yellow Team has taken " @ $capturable4 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %yellowTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\yellowFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\purpleFlag"), false);

      giveBase4ToThisTeam(*IDSTR_TEAM_YELLOW);
    }
   else if ((%team == *IDSTR_TEAM_BLUE) && ($base4Owner != %team))
    {
      $base4Owner = %team;
      %player.baseCaptures++;
      %blueTxt = "Your team has captured " @ $capturable4 @ "!";
      %otherTxt = "<f5>Blue Team has taken " @ $capturable4 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %blueTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\blueFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\purpleFlag"), false);

      giveBase4ToThisTeam(*IDSTR_TEAM_BLUE);
    }
   else if ((%team == *IDSTR_TEAM_RED) && ($base4Owner != %team))
    {
      $base4Owner = %team;
      %player.baseCaptures++;
      %redTxt = "Your team has captured " @ $capturable4 @ "!";
      %otherTxt = "<f5>Red Team has taken " @ $capturable4 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %redTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\redFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\purpleFlag"), false);

      giveBase4ToThisTeam(*IDSTR_TEAM_RED);
    }
   else if ((%team == *IDSTR_TEAM_PURPLE) && ($base4Owner != %team))
    {
      $base4Owner = %team;
      %player.baseCaptures++;
      %purpleTxt = "Your team has captured " @ $capturable4 @ "!";
      %otherTxt = "<f5>Purple Team has taken " @ $capturable4 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %purpleTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFour\\purpleFlag"), true);

      giveBase4ToThisTeam(*IDSTR_TEAM_PURPLE);
    }

}

// Base 5

function baseFiveTrigger::Trigger::onEnter(%this, %object)
{
   %team  = getTeam(%object);
   %player = playerManager::vehicleIdToPlayerNum(%object);
   if ((%team == *IDSTR_TEAM_YELLOW) && ($base5Owner != %team))
    {
      $base5Owner = %team;
      %player.baseCaptures++;
      %yellowTxt = "Your team has captured " @ $capturable5 @ "!";
      %otherTxt = "<f5>Yellow Team has taken " @ $capturable5 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %yellowTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\yellowFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\purpleFlag"), false);

      giveBase5ToThisTeam(*IDSTR_TEAM_YELLOW);
    }
   else if ((%team == *IDSTR_TEAM_BLUE) && ($base5Owner != %team))
    {
      $base5Owner = %team;
      %player.baseCaptures++;
      %blueTxt = "Your team has captured " @ $capturable5 @ "!";
      %otherTxt = "<f5>Blue Team has taken " @ $capturable5 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %blueTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\blueFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\purpleFlag"), false);

      giveBase5ToThisTeam(*IDSTR_TEAM_BLUE);
    }
   else if ((%team == *IDSTR_TEAM_RED) && ($base5Owner != %team))
    {
      $base5Owner = %team;
      %player.baseCaptures++;
      %redTxt = "Your team has captured " @ $capturable5 @ "!";
      %otherTxt = "<f5>Red Team has taken " @ $capturable5 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %redTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %otherTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\redFlag"), true);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\purpleFlag"), false);

      giveBase5ToThisTeam(*IDSTR_TEAM_RED);
    }
   else if ((%team == *IDSTR_TEAM_PURPLE) && ($base5Owner != %team))
    {
      $base5Owner = %team;
      %player.baseCaptures++;
      %purpleTxt = "Your team has captured " @ $capturable5 @ "!";
      %otherTxt = "<f5>Purple Team has taken " @ $capturable5 @ "!";
      say(IDSTR_TEAM_YELLOW, 1, %otherTxt, "");
      say(IDSTR_TEAM_BLUE, 1, %otherTxt, "");
      say(IDSTR_TEAM_RED, 1, %otherTxt, "");
      say(IDSTR_TEAM_PURPLE, 1, %purpleTxt, "");
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\neutralFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\yellowFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\blueFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\redFlag"), false);
      setShapeVisibility(getObjectId("MissionGroup\\baseFive\\purpleFlag"), true);

      giveBase5ToThisTeam(*IDSTR_TEAM_PURPLE);
    }

}

