// tutorial game mode

if (!$gameModeAdded["Tutorial"])
{
$gameModeAdded["Tutorial"] = true;
$gameModeName[$nGameMode] = "Tutorial";
$gameModePrintName[$nGameMode] = "Tutorial";
$gameModePrintInServerList[$nGameMode] = false;
$nGameMode ++;
}

$tuteeTransform = "25.5636 526.042 239.032 1 0 0 0";

$bossStartTransform = "1025.5636 1526.042 239.032 1 0 0 0";

$tutorialEnemyTrans = "-15 530.22 239.032";

$arenaStart = "-45 495" SPC (239 - 500);
$arenaExtent = "150 150 560";

$tutorialEnemyTrans2 = "-15 500.22 239.032";

$tutorialHitbackStopTime = 200;

$tutMoveOnTime = 7000;

////////////////////////////////////////////////////////////////////////////////
// initialisation stuff

// called when the server loads the map
function Tutorial::ServerStarted(%this)
{
   $inTutorial = true;

   autoMoveText.setVisible(0);

   if ($debugMissionLoad)
      echo("GMServerStarted Tutorial");

   $GMMissionArea = MissionArea;

   $enemy = 0;

   $tutee = 0;

   TutorialText.setText("");

   $clientPrintText = "";
   $gameModePrintText = "";

   tutorialBox.setVisible(1);
   tutorialBox_back.setVisible(1);

   TutorialText.setText($sid::tutwel);

   InlineHelpBox.setVisible(0);
   InlineHelpBox_back.setVisible(0);

   $dontAllowMWU = false;
   $tutDisalowCharges = true;

   // turn on auto targeting
   $fightInfo.landDisputeMode = true;

   $botTauntingDisabled = true;
}


// tutorial todo:
// 
// teach about rotating body
// teach about changing weapons

///////////////////////////////////////////////////////////////////////////////
// player/client management stuff

// new client entering the game
function Tutorial::ClientEnterGame(%this, %client)
{
   if ($debugMissionLoad)
      echo("GMClientEnterGame Tutorial");
}

// client fully loaded
function Tutorial::ClientFullyLoaded(%this, %client)
{
   if ($debugMissionLoad)
      echo("GMClientFullyLoaded Tutorial");


   commandToClient(%client, 'setVisible', "JoinFightButton", 1);
   commandToClient(%client, 'setVisible', "AddBotButton", 1);
   commandToClient(%client, 'setVisible', "DuelChallengeButton", 0);
   commandToClient(%client, 'setVisible', "DuelAcceptButton", 0);
   commandToClient(%client, 'setVisible', "ChallengeBotButton", 0);

   InlineHelpText.setVisible(false);

}

// returns true if this client is allowed to join the match
function Tutorial::CanJoinMatch(%this, %client)
{
   %client.joinCharacter = "Fisher";
   %client.joinRightWeap = "Azarus";

   return (!%client.inFight && $nPlayers < $nSlots);
}

// called on a player joining the match.  Newclient indicates whether the client has been in the match before
function Tutorial::JoinMatch(%this, %client, %character, %newClient, %team)
{
   if (!$tutee && !%client.isABot)
   {
      $tutee = %client;

      TutorialActionMap.push();

      step1();

      schedule(500, 0, "attemptToMoveSteps");

      %client.player.beingHitMult = 0.001;
   }
}



// called on a client dropping for any reason
function Tutorial::ClientDropped(%this, %client, %reason)
{

}

// called on a client leaving the match
function Tutorial::ClientLeavingMatch(%this, %client)
{
   cancel(%client.botResurrectSchedule);
}

// called on player death or client leaving the match
function Tutorial::RemovePlayer(%this, %player)
{

}

// call the client and tell him what colours we want the IFFs to be
function Tutorial::SendClientIFFInfo(%this, %client)
{
   commandToClient(%client, 'setIFFColours', "0 1 0", "1 0 0", "0 0 1", "0 1 1", false);
}

//////////////////////////////////////////////////////////////////
// action stuff

// called on a player-player collision
function Tutorial::OnHit(%this, %hiter, %hitee, %myHitbox, %hisHitbox, %myForce, %hisForce, %myMult, %hisMult, %winner, %myV2, %hisV2)
{
   stepOnHit(%hiter, %hitee, %myHitbox, %hisHitbox, %myForce, %hisForce, %myMult, %hisMult, %winner, %myV2, %hisV2);

   return standardHitDamage(%hiter, %hitee, %myHitbox, %hisHitbox, %myForce, %hisForce, %myMult, %hisMult, %winner, %myV2, %hisV2);
}





// called when a player is killed by an opponent
function Tutorial::OnKilled(%this, %killee, %killer)
{
   echo(%killer SPC "FFA killed" SPC %killee);

   if (!%killer.isABot)
      %killer.client.incScore(1);
   else
      incBotScore(%killer.client, 1);

   %killer.setDamageLevel(%killer.getDamageLevel() - 25);
}

// called on a player's death
function Tutorial::OnDeath(%this, %player)
{
   stepOnDeath(%player);
}


function Tutorial::endMission()
{
   $pref::Control::renderGhostSword = false;

   $dontAllowCameraMovement = false;

   cancel($moveStepsSchedule);
   cancel($step21GenerateSchedule);

   TutorialText.setText("");
   
   //once again we're assuming a client server
   TutorialActionMap.pop();


   tutorialBox.setVisible(0);
   tutorialBox_back.setVisible(0);

   $inTutorial = false;

   $tutorialNoMWA = false;
   $tutorialNoAngling = false;
   $tutDisalowCharges = false;

   TimerHud.zeroVisible = false;

   $botTauntingDisabled = false;


}



/////////////////////////////////////////////////////////////////////
// mission area stuff

// called when the player enters the MissionArea mission area struct
function Tutorial::OnEnterMissionArea(%this, %player)
{
   
}


// called when the player leaves the MissionArea mission area struct
function Tutorial::OnLeaveMissionArea(%this, %player)
{
  
}

////////////////////////////////////////////////////////////////////
// ball stuff

// player collides with the ball
function Tutorial::PlayerHitBall(%this, %player, %hitboxID, %ball)
{

}

function Tutorial::OnMissionEnded(%this)
{
   InlineHelpText.setVisible(true);
}


////////////////////////////////////////////////
/// client binds
////////////////////////////////////////////////


if (isObject(TutorialActionMap))
   tutorialActionMap.delete();

new ActionMap(TutorialActionMap);

TutorialActionMap.bind( keyboard, F3, keyEndStep );




////////////////////////////////////////////////
/// functions
////////////////////////////////////////////////

function keyEndStep(%val)
{
   if (%val)
   {
      if (canEndStep($tutorialStep, true))
      {
         alxPlay(MouseClick);

         moveToNextStep();
      }
   }
}



function canEndStep(%step, %f3Pressed)
{
   return eval("canEndStep" @ %step @ "(%f3Pressed);");
}


function moveToNextStep()
{
   if ($tutorialStep == 2)
      %nextStep = 205;
   else if ($tutorialStep == 205)
      %nextStep = 21;
   else if ($tutorialStep == 21)
      %nextStep = 211;
   else if ($tutorialStep == 211)
      %nextStep = 3;
   else if ($tutorialStep == 7)
      %nextStep = 71;
   else if ($tutorialStep == 71)
      %nextStep = 8;
   else if ($tutorialStep == 8)
      %nextStep = 81;
   else if ($tutorialStep == 81)
      %nextStep = 9;
   else if ($tutorialStep == 9)
      %nextStep = 901;
    else if ($tutorialStep == 901)
      %nextStep = 902;
    else if ($tutorialStep == 902)
      %nextStep = 91;
   else if ($tutorialStep == 91)
      %nextStep = 10;
   else if ($tutorialStep == 11)
      %nextStep = 101;
   else if ($tutorialStep == 101)
      %nextStep = 102;
   else if ($tutorialStep == 102)
      %nextStep = 103;
   else if ($tutorialStep == 103)
      %nextStep = 104;
   else if ($tutorialStep == 104)
      %nextStep = 105;
   else if ($tutorialStep == 105)
      %nextStep = 106;
   else if ($tutorialStep == 106)
      %nextStep = 107;
   else if ($tutorialStep == 107)
      %nextStep = 1105;
   else if ($tutorialStep == 1105)
      %nextStep = 111;
   else if ($tutorialStep == 111)
      %nextStep = 1111;
   else if ($tutorialStep == 1111)
      %nextStep = 1112;
   else if ($tutorialStep == 1112)
      %nextStep = 12;
   else if ($tutorialStep == 12)
      %nextStep = 1201;
   else if ($tutorialStep == 1201)
      %nextStep = 1202;
   else if ($tutorialStep == 1202)
      %nextStep = 1203;
   else if ($tutorialStep == 1203)
      %nextStep = 1204;
   else if ($tutorialStep == 1204)
      %nextStep = 1205;
   else if ($tutorialStep == 1205)
      %nextStep = 1206;
   else if ($tutorialStep == 1206)
      %nextStep = 1207;
   else if ($tutorialStep == 1207)
      %nextStep = 1208;  
   else if ($tutorialStep == 1208)
      %nextStep = 1209; 
   else if ($tutorialStep == 1209)
      %nextStep = 1210; 
   else if ($tutorialStep == 1210)
      %nextStep = 1211;
   else if ($tutorialStep == 1211)
      %nextStep = 1212; 
   else if ($tutorialStep == 1212)
      %nextStep = 1213; 
   else if ($tutorialStep == 1213)
      %nextStep = 1214; 
   else
      %nextStep = $tutorialStep + 1;

   eval("step" @ %nextStep @ "();");
}


function attemptToMoveSteps()
{
   if (canEndStep($tutorialStep, false))
   {
      moveToNextStep();

      error("current tutorial step " @ $tutorialStep);
   }
   
   
   $moveStepsSchedule = schedule(500, 0, "attemptToMoveSteps");
}


function addTutEnemy(%char, %aistate, %st, %weapon, %pos)
{
   %e = serverCmdAddBotRequest(0, %char, %aiState, 1, 0, %weapon, false, %pos, modelNameToOmphrName(%char));
   %e.altSwordType1 = %st;

   %e.beingHitMult = 10;
   return %e;
}


function stepOnDeath(%victim)
{
   eval("stepOnDeath" @ $tutorialStep @ "(%victim);");
}


function stepOnHit(%hiter, %hitee, %myHitbox, %hisHitbox, %myForce, %hisForce, %myMult, %hisMult, %winner, %myV2, %hisV2)
{
   eval("stepOnHit" @ $tutorialStep @ "(%hiter, %hitee, %myHitbox, %hisHitbox, %myForce, %hisForce, %myMult, %hisMult, %winner, %myV2, %hisV2);");
}





function zeroTutVel()
{
   zeroTutVel2();

   schedule($tutorialHitbackStopTime, 0, "zeroTutVel2");
   schedule($tutorialHitbackStopTime * 2, 0, "zeroTutVel2");
   schedule($tutorialHitbackStopTime * 3, 0, "zeroTutVel2");
   schedule($tutorialHitbackStopTime * 4, 0, "zeroTutVel2");
}


function zeroTutVel2()
{
   $tutee.player.setVelocity("0 0 0");
}




function Tutorial::playerHasNewTarget(%this, %player, %target)
{
}



////////////////////////////////////////////////
/// tutorial sessions
////////////////////////////////////////////////

function step1()
{
   // Client side in server code omfg... it's the tutorial though, so it's coo' bro.
   $dontAllowCameraMovement = true;

   $pref::landDisputeLevel1Unlocked = true;

   $tutorialStep = 1;

   $step1LongEnough = false;

   $tutee.player.setSpecialMode(1);

   $tutee.player.setVelocity("0 0 0");
   $tutee.player.setTransform($tuteeTransform);

   $tutorialNoMWA = true;
   $tutorialNoAngling = true;

   TutorialText.setText($sid::tut0);

   schedule(2000, 0, "step1LongEnough");
}

function step1LongEnough()
{
   $step1LongEnough = true;
}


function canEndStep1(%f3Pressed)
{
   if (%f3Pressed && $step1LongEnough)
      return true;
   else
      return false;
}

/////////////////////////////////////////////////////////////////////

function step2()
{
   $tutorialStep = 2;

   
   TutorialText.setText($sid::tut1);

}


function canEndStep2(%f3Pressed)
{
   if (%f3Pressed)
      return true;
   else
      return false;
}





/////////////////////////////////////////////////////////////////////

function step205()
{
   $tutorialStep = 205;

   


   TutorialText.setText($sid::tut2);

}


function canEndStep205(%f3Pressed)
{
   if (%f3Pressed)
      return true;
   else
      return false;
}


/////////////////////////////////////////////////////////////////////

function step21()
{
   $tutorialStep = 21;

   activateGhostSword($tutee.player);

   $pref::Control::renderGhostSword = true;
   $myGhost.updateRenderGhostSword();

   $doubleVictoryNeeded = false;

   $step21Victories = 0;

   TutorialText.setText($sid::tut3);

   cancel($step21GenerateSchedule);
   generateNewSwordTarget(false);
}



// generate a sword target not obscured from view by the player's body

function getValidGhostSwordTarget()
{
   %x = (getRandom() * 1.8) - 0.9;
   %y = getRandom() * 0.9;

   if (%x < 0.059 && %x > -0.30 && %y < 0.24) 
      return getValidGhostSwordTarget();
   else
      return %x SPC %y;
}


function generateNewSwordTarget(%failed)
{
   if ($step21Victories < 10)
   {
      TutorialText.setText($sid::tut4a @ 10 - $step21Victories @ $sid::tut4b);

      $doubleVictoryNeeded = false;

      %p = getValidGhostSwordTarget();

      $myGhost.setGhostSwordTarget(%p);

      %time = 5000 - $step21Victories * 400;
   }
   else if ($step21Victories < 15)
   {
      TutorialText.setText($sid::tut5a @ 15 - $step21Victories @ $sid::tut5b);

      %time = 1200;

      if ($leftRight == "")
         $leftRight = 0;

      $leftRight = 1 - $leftRight;

      if ($leftRight)
         %pos = "0.7 0";
      else
         %pos = "-0.7 0";

      $doubleVictoryNeeded = true;
      $myGhost.setGhostSwordTarget(%pos);
   }
   else if ($step21Victories < 20)
   {
      TutorialText.setText($sid::tut6a @ 20 - $step21Victories @ $sid::tut6b);

      %time = 1200;

      if ($leftRight == "")
         $leftRight = 0;

      $leftRight = 1 - $leftRight;

      if ($leftRight)
         %pos = "0 0.8";
      else
         %pos = "0 -0.8";

      $doubleVictoryNeeded = true;
      $myGhost.setGhostSwordTarget(%pos);
   }
   else
   {
      $doubleVictoryNeeded = false;

      %p = getValidGhostSwordTarget();

      $myGhost.setGhostSwordTarget(%p);

      %time = 800;
   }



   cancel($step21GenerateSchedule);
   $step21GenerateSchedule = schedule(%time, 0, "generateNewSwordTarget", true);

   if (%failed)
   {
      $oneVictory = false;
      alxPlay(DuelChallengeFailed);
   }
}


$nTGToWin = 20;

function TGReachedSwordTarget()
{
   if (!$TGdeadtime)
   {
      if (!$doubleVictoryNeeded || $oneVictory)
      {
         $step21Victories ++;

         generateNewSwordTarget(false);

         $oneVictory = false;

         alxPlay(DuelChallengeReceived);

         if ($step21Victories == 10 || $step21Victories == 15 || $step21Victories == 20 || $step21Victories == 25)
            alxPlay(WinWaveSound);

         if ($step21Victories > $nTGToWin - 1)
         {
            alxPlay(WinWaveSound);

            if ($step21Victories == $nTGToWin)
            {
               clientCmdSetCenterPrintText($sid::tut7, $tutMoveOnTime);

               TutorialText.setText($sid::tut8);
            }
         }

         $TGdeadTime = true;
         schedule(400, 0, "eval", "$TGdeadTime = false;");
      }
      else if ($doubleVictoryNeeded)
      {
         generateNewSwordTarget(false);

         alxPlay(DuelChallengeAccepted);

         $oneVictory = true;

         $TGdeadTime = true;
         schedule(400, 0, "eval", "$TGdeadTime = false;");
      }
   }
}



function canEndStep21(%f3Pressed)
{
   if (%f3Pressed && $step21Victories > $nTGToWin - 1)
      return true;
   else
      return false;
}




/////////////////////////////////////////////////////////////////////

function step211()
{
   hideCenterPrint();

   cancel($step21GenerateSchedule);

   disactivateGhostSword($tutee.player);

   $myGhost.cancelGhostSwordTarget();

   $tutorialStep = 211;

   $haveGotRedSword = false;
   $doneRedRecharge = false;

   
   TutorialText.setText($sid::tut9);
}





function canEndStep211(%f3Pressed)
{
   %red = !$myGhost.hasSwordCharge();

   if (!$haveGotRedSword && %red)
   {
      $haveGotRedSword = true;
      alxPlay(DuelChallengeReceived);
   }
   else if ($haveGotRedSword && !$doneRedRecharge && !%red)
   {
      $doneRedRecharge = true;
      alxPlay(WinWaveSound);

      TutorialText.setText($sid::tut10);
   }

   if (%f3Pressed && $doneRedRecharge)
      return true;
   else
      return false;
}



///////////////////////////////////////////////////////////////////


function step3()
{
   $tutorialStep = 3;


   $tutee.player.setTransform($tuteeTransform);

   $enemy = addTutEnemy(Herman, Statue, StaticSwordCentre, None, $tutorialEnemyTrans);
}


function canEndStep3(%f3Pressed)
{
   if ($enemy && $tutee.player.getTargetObject() == $enemy)
      return true;


   return false;
}


//////////////////////////////////////////////////////////////////////


function step4()
{
   $step4Deaths = 0;

   $tutorialStep = 4;

   TutorialText.setText($sid::tut11);
}



function canEndStep4(%f3Pressed)
{
   return %f3Pressed;   
}


//////////////////////////////////////////////////////////////////////


function step5()
{
   $step5Deaths = 0;

   $tutorialStep = 5;

   $enemy.beingHitMult = 200;

   $enemy.setAIState(HeadlessTutorial1);

   $step5EnemyDumb = false;

   TutorialText.setText($sid::tut12);
}


function stepOnHit5(%hiter, %hitee, %myHitbox, %hisHitbox, %myForce, %hisForce, %myMult, %hisMult, %winner, %myV2, %hisV2)
{
   schedule($tutorialHitbackStopTime, 0, "zeroTutVel");
}





function stepOnDeath5(%victim)
{
   if (%victim == $lastEnemy)
      return;


   $step5Deaths ++;

   if ($step5Deaths < 3)
   {
      TutorialText.setText($sid::tut13a @ 3 - $step5Deaths @ $sid::tut13b);
   }
   
   if ($step5Deaths == 3)
   {
      TutorialText.setText($sid::tut14);
      clientCmdSetCenterPrintText($sid::tut15, $tutMoveOnTime);
      alxPlay(WinWaveSound);
   }

   
   $enemy = addTutEnemy(Herman, Statue, StaticSwordCentre, None, $tutorialEnemyTrans);
   $enemy.beingHitMult = 200;
   $step5EnemyDumb = true;
}


function canEndStep5(%f3Pressed)
{
   if ($enemy && $step5EnemyDumb && $tutee.player.getTargetObject() == $enemy)
   {
      $step5EnemyDumb = false;

      $enemy.setAIState(HeadlessTutorial1);
   }


   if (%f3Pressed && $step5Deaths > 2)
      return true;

   return false;
}


//////////////////////////////////////////////////////////////////////


function step6()
{
   $tutee.player.cantResetAngle = true;
   $myGhost.cantResetAngle = true;

   $tutorialStep = 6;

   $step6HaveBlockedUp = 0;

   $tutee.player.setVelocity("0 0 0");
   $tutee.player.setTransform($tuteeTransform);

   hideCenterPrint();
   $lastEnemy = $enemy;
   $enemy.applyDamage(120);


   $tutorialNoAngling = false;

   

   TutorialText.setText($sid::tut16 @ getPrintableKeyFor("trigger1") @ $sid::tut17 @ getPrintableKeyFor("trigger1") @ $sid::tut18);
}



function canEndStep6(%f3Pressed)
{
   %ss = $myGhost.getSwordStatus();

   if (getWord(%ss, 3) != 0 || getWord(%ss, 4) != 0)
   {
      if (!$step6HaveBlockedUp)
      {
         alxPlay(WinWaveSound);
         $step6HaveBlockedUp = true;
      }
   }

   if ($step6HaveBlockedUp && %f3Pressed)
      return true;
   else
      return false;   
}


//////////////////////////////////////////////////////////////////////


function step7()
{
   $tutorialStep = 7;

   $tutee.player.cantResetAngle = false;
   $myGhost.cantResetAngle = false;

   TutorialText.setText($sid::tut19 @ getPrintableKeyFor("trigger1") @ $sid::tut20);
}



function canEndStep7(%f3Pressed)
{
   %ss = $myGhost.getSwordStatus();

   if (getWord(%ss, 2) == 0 && getWord(%ss, 3) == 0)
      return true;
   else
      return false;
}

//////////////////////////////////////////////////////////////////////


function step71()
{
   alxPlay(winwavesound);

   $tutorialStep = 71;

   $tutorialNoAngling = true;

   $tutorialNoMWA = false;

   $s71DoneAngled = false;

   TutorialText.setText($sid::tut21);
}



function canEndStep71(%f3Pressed)
{
   %ss = $myGhost.getSwordStatus();

   //error("step71 " @ %ss);

   if (!$s71DoneAngled && getWord(%ss, 2) != 0 && getWord(%ss, 3) != 0)
   {
      $s71DoneAngled = true;
      $tutorialNoAngling = false;

      alxPlay(WinWaveSound);

      TutorialText.setText($sid::tut22 @ getPrintableKeyFor("trigger1") @ $sid::tut23);
   }
   else if ($s71DoneAngled && getWord(%ss, 2) == 0 && getWord(%ss, 3) == 0)
   {
      alxPlay(WinWaveSound);

      return true;
   }

   return false;
}


//////////////////////////////////////////////////////////////////////


function step8()
{
   $tutorialStep = 8;

   $tutee.player.setTransform($tuteeTransform);

   $tutorialNoAngling = false;

   alxPlay(WinWaveSound);

   $enemy = addTutEnemy(Herman, Statue, StaticSwordCentre, Azarus, $tutorialEnemyTrans);

   $enemy.invincible = true;

   TutorialText.setText($sid::tut24);
}



function canEndStep8(%f3Pressed)
{
   return (%f3Pressed && $enemy && $tutee.player.getTargetObject() == $enemy);
}


//////////////////////////////////////////////////////////////////////




function step81()
{
   $tutorialStep = 81;

   

   TutorialText.setText($sid::tut25 @ getPrintableKeyFor("trigger1") @ $sid::tut26 @ getPrintableKeyFor("trigger1") @ $sid::tut27);
}



function canEndStep81(%f3Pressed)
{
   return (%f3Pressed && $enemy && $tutee.player.getTargetObject() == $enemy);
}


//////////////////////////////////////////////////////////////////////



function step9()
{
   $tutorialStep = 9;

   $tut9goodDeath = false;

   $step9Deaths = 0;

   $enemy.setAIState(HeadlessTutorial1);

   TutorialText.setText($sid::tut28);
}


function stepOnDeath9(%victim)
{
   if (%victim == $lastEnemy)
      return;

   if ($tut9goodDeath)
      $step9Deaths ++;

   alxPlay(WinWaveSound);

   if ($step9Deaths == 1)
      %swordType = StaticSwordTutPos1;
   else if ($step9Deaths == 2)
      %swordType = StaticSwordTutPos2;
   else if ($step9Deaths == 3)
      %swordType = StaticSwordTutPos3;

   $enemy = addTutEnemy(Herman, HeadlessTutorial1, %swordType, Azarus, $tutorialEnemyTrans);

   $enemy.invincible = true;

   if ($step9Deaths < 3)
   {
      TutorialText.setText($sid::tut29 @ 3 - $step9Deaths @ $sid::tut30);
   }

   if ($step9Deaths == 3)
   {
      alxPlay(WinLevelSound);
   }
}




function stepOnHit9(%hiter, %hitee, %myHitbox, %hisHitbox, %myForce, %hisForce, %myMult, %hisMult, %winner, %myV2, %hisV2)
{
   if (0)
   {
   if (%myHitbox != $hitboxEnum::R_SWORD || %hisHitbox != $hitboxEnum::R_SWORD)
   {
      alxPlay(ringOutSound);
      $tut9goodDeath = false;
      $enemy.applyDamage(120);
      
      if (!canEndStep9(true))
         TutorialText.setText($sid::tut31);
   }
   }

   schedule($tutorialHitbackStopTime, 0, "zeroTutVel");
}


function tutSwordSwordCol(%p1, %p2)
{
   if ($tutorialStep == 9 || $tutorialStep == 902)
   {
      if (($tutorialStep == 9 && !canEndStep9(1)) || ($tutorialStep == 902 && !canEndStep902(1)))
         TutorialText.setText($sid::tut32);
      
      $tut9goodDeath = true;
      $enemy.applyDamage(120);
   }
}



function canEndStep9(%f3Pressed)
{
   return ($step9Deaths >= 3);
}


//////////////////////////////////////////////////////////////////////






function step901()
{
   $tutorialStep = 901;

   hideCenterPrint();

   $lastEnemy = $enemy;
   $enemy.applyDamage(120);

   $enemy = addTutEnemy(Herman, Statue, Tut902ST, Azarus, $tutorialEnemyTrans);

   $enemy.invincible = true;

   TutorialText.setText($sid::tut33);
}



new BigAttackSwordType("Tut902ST")
{
   drawBackTime = 3.5;
   strikeTime = 0.22;
   timingError = 0;

   chargeProbability = 0;
};


function canEndStep901(%f3Pressed)
{
   return (%f3Pressed && $enemy && $tutee.player.getTargetObject() == $enemy);
}


//////////////////////////////////////////////////////////////////////



function step902()
{
   $tutorialStep = 902;

   $step902Deaths = 0;


   $enemy.setAIState(HeadlessTutorial1);

   TutorialText.setText($sid::tut34);
}



function stepOnDeath902(%victim)
{
   if (%victim == $lastEnemy)
      return;

   if ($tut9goodDeath)
      $step902Deaths ++;

   alxPlay(WinWaveSound);

   $enemy = addTutEnemy(Herman, HeadlessTutorial1, Tut902ST, Azarus, $tutorialEnemyTrans);

   $enemy.invincible = true;

   if ($step902Deaths < 3)
   {
      TutorialText.setText($sid::tut35 @ 3 - $step902Deaths @ $sid::tut36);
   }


   if ($step902Deaths == 3)
   {
      clientCmdSetCenterPrintText($sid::tut37, $tutMoveOnTime);
      alxPlay(WinWaveSound);
      TutorialText.setText($sid::tut38);
   }
}


function stepOnHit902(%hiter, %hitee, %myHitbox, %hisHitbox, %myForce, %hisForce, %myMult, %hisMult, %winner, %myV2, %hisV2)
{
   if (0)
   {
   if (%myHitbox != $hitboxEnum::R_SWORD || %hisHitbox != $hitboxEnum::R_SWORD)
   {
         alxPlay(ringOutSound);
         $tut9goodDeath = false;
         $enemy.applyDamage(120);

         if (!canEndStep902(true))
            TutorialText.setText($sid::tut39);  
   }
   }

   schedule($tutorialHitbackStopTime, 0, "zeroTutVel");
}




function canEndStep902(%f3Pressed)
{
   return (%f3Pressed && $step902Deaths > 2);
}



//////////////////////////////////////////////////////////////////////



function step91()
{
   hideCenterPrint();

   $tutorialStep = 91;
   
   $lastEnemy = $enemy;
   $enemy.applyDamage(120);

   $enemy = addTutEnemy(Herman, Statue, RandomStatic, Azarus, $tutorialEnemyTrans);

   TutorialText.setText($sid::tut40);
}


function canEndStep91(%f3Pressed)
{
   if (%f3Pressed)
      return true;
   else
      return false;
}



//////////////////////////////////////////////////////////////////////

function step10()
{
   $tutorialStep = 10;

   $tutee.player.setVelocity("0 0 0");
   $tutee.player.setTransform($tuteeTransform);

   $step10Deaths = 0;

   $enemy.setAIState(Headless);
   

   TutorialText.setText($sid::tut41);
}

function stepOnDeath10(%victim)
{
   if (%victim != $lastEnemy)
   {
      $step10Deaths ++;

      if ($step10Deaths < 3)
      {
         TutorialText.setText($sid::tut42 @ 3 - $step10Deaths @ $sid::tut43);
      }

      if ($step10Deaths == 3)
      {
         TutorialText.setText($sid::tut44);
         clientCmdSetCenterPrintText($sid::tut45, $tutMoveOnTime);
         alxPlay(WinWaveSound);
      }

      $enemy = addTutEnemy(Herman, Headless, RandomStatic, Azarus, $tutorialEnemyTrans);
   }
}


function stepOnHit10(%hiter, %hitee, %myHitbox, %hisHitbox, %myForce, %hisForce, %myMult, %hisMult, %winner, %myV2, %hisV2)
{
   schedule($tutorialHitbackStopTime, 0, "zeroTutVel");
}

function canEndStep10(%f3Pressed)
{
   return (%f3Pressed && $step10Deaths > 2);
}


//////////////////////////////////////////////////////////////////////


function step11()
{
   hideCenterPrint();

   $tutorialStep = 11;

   $lastEnemy = $enemy;
   $enemy.applyDamage(120);

   $dontAllowCameraMovement = false;

   $tutHasMovedCamera = false;

   $playedS11 = false;

   TutorialText.setText($sid::tut46 @ getPrintableKeyFor("trigger0") @ $sid::tut47);
}



function canEndStep11(%f3Pressed)
{
   if ($tutHasMovedCamera && !$playedS11)
   {
      alxPlay(WinWaveSound);

      $playedS11 = true;
   }

   return (%f3Pressed && $tutHasMovedCamera);
}






function step101()
{
   $tutorialStep = 101;

   //$tutee.player.setVelocity("0 0 0");
   //$tutee.player.setTransform($tuteeTransform);



   // auto targetting ACTIVATED

   


   TutorialText.setText($sid::tut48 @ getPrintableKeyFor("ccNextTarget") @ $sid::tut49);
}



function canEndStep101(%f3Pressed)
{
   return (%f3Pressed);
}




//////////////////////////////////////////////////////////////////////





function step102()
{
   $tutorialStep = 102;

 
   $enemy = addTutEnemy(Herman, Statue, StaticSwordCentre, Azarus, $tutorialEnemyTrans);

   setTeam($enemy.client, 1);


   $fightInfo.landDisputeMode = true;


   TutorialText.setText("");
}



function canEndStep102(%f3Pressed)
{
   if ($tutee.player.getTargetObject() == $enemy)
   {
      //alxPlay(WinWaveSound);
      return true;
   }
   else
      return false;
}





//////////////////////////////////////////////////////////////////////





function step103()
{
   // disable auto-targeting

   $fightInfo.landDisputeMode = false;


   $tutorialStep = 103;



   


   TutorialText.setText($sid::tut50 @ getPrintableKeyFor("trigger0") @ $sid::tut51);
}



function canEndStep103(%f3Pressed)
{
   if ($tutee.player.getTargetObject() != $enemy && ($mvTriggerCount0 % 2) == 0)
   {
      alxPlay(WinWaveSound);
      return true;
   }
   else
      return false;
}




//////////////////////////////////////////////////////////////////////





function step104()
{
   // disable auto-targeting



   $tutorialStep = 104;


   $dontAllowCameraMovement = true;


   TutorialText.setText($sid::tut52 @ getPrintableKeyFor("ccNextTarget") @ $sid::tut53);
}



function canEndStep104(%f3Pressed)
{
   if ($tutee.player.getTargetObject() == $enemy)
   {
      alxPlay(WinWaveSound);
      return true;
   }
   else
      return false;
}




//////////////////////////////////////////////////////////////////////





function step105()
{
   // disable auto-targeting



   $tutorialStep = 105;

   $enemy2 = addTutEnemy(Dexter, Statue, StaticSwordCentre, Azarus, $tutorialEnemyTrans2);

   setTeam($enemy2.client, 1);

   $dontAllowCameraMovement = false;

   $dontAllowMWU = true;



   TutorialText.setText($sid::tut54 @ getPrintableKeyFor("trigger0") @ $sid::tut55);

}



function canEndStep105(%f3Pressed)
{
   if ($tutee.player.getTargetObject() == $enemy2)
   {
      alxPlay(WinWaveSound);
      return true;
   }
   else
      return false;
}



//////////////////////////////////////////////////////////////////////





function step106()
{
   // disable auto-targeting



   $tutorialStep = 106;


   $dontAllowCameraMovement = true;

   $dontAllowMWU = false;


   TutorialText.setText($sid::tut56 @ getPrintableKeyFor("ccNextTarget") @ $sid::tut57 @ getPrintableKeyFor("ccNextTarget") @ $sid::tut58 @ getPrintableKeyFor("ccNextTarget") @ $sid::tut59);
}



function canEndStep106(%f3Pressed)
{
   if ($tutee.player.getTargetObject() == $enemy)
   {
      alxPlay(WinWaveSound);
      return true;
   }
   else
      return false;
}




//////////////////////////////////////////////////////////////////////





function step107()
{
   // disable auto-targeting



   $tutorialStep = 107;


   $dontAllowCameraMovement = true;

   $dontAllowMWU = false;


   TutorialText.setText($sid::tut60 @ getPrintableKeyFor("ccNextTarget") @ ".");
}



function canEndStep107(%f3Pressed)
{
   if ($tutee.player.getTargetObject() == $enemy2)
   {
      alxPlay(WinWaveSound);
      return true;
   }
   else
      return false;
}





///////////////////////////////////////////////////////////////////



//////////////////////////////////////////////////////////////////////



function step1105()
{
   $tutorialStep = 1105;

   $lastEnemy = $enemy;
   $enemy.applyDamage(120);
   $enemy2.applyDamage(120);

   $tutee.player.setSpecialMode(0);

   $dontAllowCameraMovement = false;

   TutorialText.setText($sid::tut61 @ getPrintableKeyFor("moveforward") @ ", " @ getPrintableKeyFor("movebackward") @ ", " @ getPrintableKeyFor("moveleft") @ $sid::tut62 @ getPrintableKeyFor("moveright") @ $sid::tut63 @ getPrintableKeyFor("trigger0") @ $sid::tut64 @ getPrintableKeyFor("trigger2") @ $sid::tut65 @ getPrintableKeyFor("trigger5") @ ".\n " @ $sid::tut66);
}



function canEndStep1105(%f3Pressed)
{
   return (%f3Pressed);
}


//////////////////////////////////////////////////////////////////////



function step111()
{
   $tutorialStep = 111;



   

   $tutHaveBraked = false;

   $tutHaveGoneFast = false;

   $tutCanGoFastEnough = false;


   schedule(4000, 0, "step111CanGoFastEnough");


   TutorialText.setText($sid::tut67 @ getPrintableKeyFor("trigger2") @
      $sid::tut68 @ getPrintableKeyFor("trigger0") @ $sid::tut69);


}


function step111CanGoFastEnough()
{
   $tutCanGoFastEnough = true;
}


function canEndStep111(%f3Pressed)
{
   if ($tutCanGoFastEnough && !$tutHaveGoneFast && VectorLen($tutee.player.getVelocity()) > 25)
   {
      $tutHaveGoneFast = true;

      TutorialText.setText($sid::tut70 @ getPrintableKeyFor("trigger2") @
         $sid::tut71);

      alxPlay(WinWaveSound);
   }



   if ($tutHaveGoneFast && $tutHaveBraked && VectorLen($tutee.player.getVelocity()) < 2)
   {
      alxPlay(WinWaveSound);
      return true;
   }
   else
      return false;
   
}



//////////////////////////////////////////////////////////////////////


function step1111()
{
   $tutorialStep = 1111;

   $tutee.player.setVelocity("0 0 0");
   $tutee.player.setTransform($tuteeTransform);

   %pos = (getWord($tutee.player.getTransform(), 0) + getRandom() * 800) SPC (getWord($tutee.player.getTransform(), 1) + getRandom() * 800);
   
   %z = getTerrainOrWaterHeight(%pos) + 100; 

   %pos = %pos SPC %z;

   $enemy = addTutEnemy(Herman, None, None, None, %pos);


   $enemy.invincible = true;


   TutorialText.setText($sid::tut72 @ getPrintableKeyFor("trigger0") @ $sid::tut73);
}




function canEndStep1111(%f3Pressed)
{
   return (%f3Pressed);
}




//////////////////////////////////////////////////////////////////////


function step1112()
{
   $tutorialStep = 1112;





   TutorialText.setText($sid::tut74);
}




function canEndStep1112(%f3Pressed)
{
   return (%f3Pressed);
}


//////////////////////////////////////////////////////////////////////


function step12()
{
   $tutorialStep = 12;

   $step12Deaths = 0;

   if (!$enemy.isAlive())
   {
      %pos = (getWord($tutee.player.getTransform(), 0) + getRandom() * 800) SPC (getWord($tutee.player.getTransform(), 1) + getRandom() * 800);
   
      %z = getTerrainOrWaterHeight(%pos) + 100; 

      %pos = %pos SPC %z;

      $enemy = addTutEnemy(Herman, None, None, None, %pos);
   }


   $enemy.invincible = false;

   TutorialText.setText($sid::tut75);
}


///////////////////


function stepOnDeath12(%victim)
{
   if (%victim == $lastEnemy)
      return;

   $step12Deaths ++;

   if ($step12Deaths < 3)
   {
      TutorialText.setText($sid::tut76 @ 3 - $step12Deaths @ $sid::tut77);
   }

   if ($step12Deaths == 3)
   {
      TutorialText.setText($sid::tut78);
      clientCmdSetCenterPrintText($sid::tut79, $tutMoveOnTime);
      alxPlay(WinWaveSound);
   }

   %pos = (getWord($tutee.player.getTransform(), 0) + getRandom() * 800) SPC (getWord($tutee.player.getTransform(), 1) + getRandom() * 800);
   
   %z = getTerrainOrWaterHeight(%pos) + 100; 

   %pos = %pos SPC %z;

   $enemy = addTutEnemy(Herman, None, None, None, %pos);
}



function canEndStep12(%f3Pressed)
{
   return (%f3Pressed && $step12Deaths > 2);
}



//////////////////////////////////////////////////////////////////////


function step1201()
{
   $tutorialStep = 1201;
   
   $lastEnemy = $enemy;
   $enemy.applyDamage(120);
  
   hideCenterPrint();
   
   exec("dt/server/scripts/duelArena.cs");

   $tutee.player.setTransform($tuteeTransform);
   $tutee.player.setSpecialMode(1);

   

   $fightInfo.arenaGame = true;

   $enemy = addTutEnemy(Herman, None, StaticSwordCentre, Azarus, $tutorialEnemyTrans);
   $enemy.invincible = true;

   $tutee.player.setTargetObject($enemy);

   schedule(2000, 0, "eval", "$tutee.player.setTargetObject($enemy);");

   $tutee.player.setSpecialMode(1);

   $radarOn = false;
   turnRadar(0);

   //error("drawing arena:" SPC $arenaStart SPC $arenaExtent);

   drawArenaBounds($arenaStart, $arenaExtent, $tutee.player, $enemy, 0);

   
   $tutee.player.setMissionArea($arenaStart, $arenaExtent);
   $enemy.setMissionArea($arenaStart, $arenaExtent);


   TutorialText.setText($sid::tut80 @ getPrintableKeyFor("ccNextTarget") @ $sid::tut81);
}




function canEndStep1201(%f3Pressed)
{
   return (%f3Pressed);
}



//////////////////////////////////////////////////////////////////////


function step1202()
{
   $tutorialStep = 1202;

   $tutee.player.setTargetObject($enemy);
  
   ClientCmdSetTimer(60000);

   TimerHud.zeroVisible = true;

   TutorialText.setText($sid::tut82);
}




function canEndStep1202(%f3Pressed)
{
   return (%f3Pressed);
}



//////////////////////////////////////////////////////////////////////


function step1203()
{
   $tutorialStep = 1203;
  
   ClientCmdSetTimer(-1);

   $tutee.player.setSpecialMode(0);

   $tutBeenOutOfBounds = false;
   $tutBeenBackInBounds = false;

   TutorialText.setText($sid::tut83);
}


// called when the player enters the MissionArea mission area struct
function Tutorial::OnEnterMissionArea(%this, %player)
{
   cancel(%player.ringoutDamageSchedule);
}

// called when the player leaves the MissionArea mission area struct
function Tutorial::OnLeaveMissionArea(%this, %player)
{

   //error("left ring");

   if ($fightInfo.arenaGame)
      damageTutPlayerRingout(%player);
}



function damageTutPlayerRingout(%player)
{
   cancel(%player.ringoutDamageSchedule);

 
   messageClient(%player.client, 'playSound', $sid::tut84, "ringOutSound");



   %player.ringoutDamageSchedule = schedule(1000, 0, "damagePlayerRingout", %player);
   
}










function canEndStep1203(%f3Pressed)
{
   return (%f3Pressed);
}




//////////////////////////////////////////////////////////////////////


function step1204()
{
   $tutorialStep = 1204;

   $tutee.player.setTargetObject($enemy);
  
   TutorialText.setText($sid::tut85);
}




function canEndStep1204(%f3Pressed)
{
   return (%f3Pressed);
}



//////////////////////////////////////////////////////////////////////


function step1205()
{
   $tutorialStep = 1205;

   $enemy.invincible = false;
   $enemy.setAIState("EdBurnsAIFacingOff");
   $enemy.beingHitMult = 1;

   $tutee.player.setTargetObject($enemy);

   $tutee.player.setSpecialMode(0);

   $step1205killedBlunder = false;
  
   TutorialText.setText($sid::tut86);
}


function stepOnDeath1205(%victim)
{
   $step1205killedBlunder = true;
   alxPlay(WinWaveSound);
}


function canEndStep1205(%f3Pressed)
{
   return ($step1205killedBlunder);
}


//////////////////////////////////////////////////////////////////////


function step1206()
{
   $tutorialStep = 1206;

   $tutDisalowCharges = false;

   $step1206HasChargeStriked = false;

   $tutee.player.setVelocity("0 0 0");
   schedule(2000, 0, "eval", "$tutee.player.setTransform($tuteeTransform);");

   $tutee.player.setSpecialMode(1);

   deleteArena(0,0,0);


   $fightInfo.arenaGame = false;


   TutorialText.setText($sid::tut87 @ getPrintableKeyFor("trigger3") @ $sid::tut88);
}




function canEndStep1206(%f3Pressed)
{
   return ($step1206HasChargeStriked && %f3Pressed);
}


function tutOnFinishedChargeStrike()
{
   if ($tutorialStep == 1206 && !$step1206HasChargeStriked)
   {
      TutorialText.setText($sid::tut89);
      $step1206HasChargeStriked = true;
      alxplay(WinWaveSound);
   }
}



//////////////////////////////////////////////////////////////////////


function step1207()
{
   $tutorialStep = 1207;

   $enemy = addTutEnemy(Herman, Statue, StaticSwordCentre, None, $tutorialEnemyTrans);
   $enemy.setTransform($tutorialEnemyTrans);
   $enemy.invincible = true;



   $tutee.player.setTargetObject($enemy);

   schedule(1000, 0, "eval", "$tutee.player.setTargetObject($enemy);");

   TutorialText.setText($sid::tut90 @ getPrintableKeyFor("trigger3") @ $sid::tut91);
}






function canEndStep1207(%f3Pressed)
{
   return (%f3Pressed);
}



////////////////////////////////////////////////////


function step1208()
{
   $step1208Deaths = 0;

   $tutorialStep = 1208;


   $enemy.setAIState(HeadlessTutorial1);


   TutorialText.setText($sid::tut92);
}


function stepOnHit1208(%hiter, %hitee, %myHitbox, %hisHitbox, %myForce, %hisForce, %myMult, %hisMult, %winner, %myV2, %hisV2)
{
   schedule($tutorialHitbackStopTime, 0, "zeroTutVel");
}


function tutChargeStrike(%striker, %strikee)
{
   if ($tutorialStep == 1208)
   {
      %strikee.applyDamage(100);
   }
}


function stepOnDeath1208(%victim)
{
   if (%victim == $lastEnemy)
      return;


   $step1208Deaths ++;

   if ($step1208Deaths < 3)
   {
      TutorialText.setText($sid::tut93 @ 3 - $step1208Deaths @ $sid::tut94);
   }

   if ($step1208Deaths == 3)
   {
      TutorialText.setText($sid::tut94a);
      clientCmdSetCenterPrintText($sid::tut95, $tutMoveOnTime);
      alxPlay(WinWaveSound);
   }
   
   
   $enemy = addTutEnemy(Herman, HeadlessTutorial1, StaticSwordCentre, None, $tutorialEnemyTrans);
   $enemy.invincible = true;

   $tutee.player.setTargetObject($enemy);

   schedule(1000, 0, "eval", "$tutee.player.setTargetObject($enemy);");
}


function canEndStep1208(%f3Pressed)
{
   if (%f3Pressed && $step1208Deaths > 2)
      return true;

   return false;
}





//////////////////////////////////////////////////////////////////////


function step1209()
{
   $tutorialStep = 1209;

   hideCenterPrint();
   $lastEnemy = $enemy;
   $enemy.applyDamage(120);

   $step1209HaveChargeBlocked = false;

   TutorialText.setText($sid::tut96 @ getPrintableKeyFor("trigger4") @ $sid::tut97);
}


function tutChargeBlock()
{
   if ($tutorialStep == 1209 && !$step1209HaveChargeBlocked)
   {
      alxPlay(winWaveSound);
      TutorialText.setText($sid::tut98);

      $step1209HaveChargeBlocked = true;
   }
}



function canEndStep1209(%f3Pressed)
{
   return ($step1209HaveChargeBlocked && %f3Pressed);
}





//////////////////////////////////////////////////////////////////////


function step1210()
{
   $tutorialStep = 1210;

   $tutDisalowCharges = false;

   $enemy = addTutEnemy(Herman, Statue, Tut902ST, Azarus, $tutorialEnemyTrans);
   $enemy.invincible = true;

   $tutee.player.setTargetObject($enemy);

   schedule(1000, 0, "eval", "$tutee.player.setTargetObject($enemy);");

   TutorialText.setText($sid::tut99);
}




function canEndStep1210(%f3Pressed)
{
   return (%f3Pressed);
}






////////////////////////////////////////////////////


function step1211()
{
   $step1211Deaths = 0;

   $tutorialStep = 1211;


   $enemy.setAIState(HeadlessTutorial1);


   TutorialText.setText($sid::tut100 @ getPrintableKeyFor("trigger4") @ ".");
}


function stepOnHit1211(%hiter, %hitee, %myHitbox, %hisHitbox, %myForce, %hisForce, %myMult, %hisMult, %winner, %myV2, %hisV2)
{
   if (0)
   {
   cancel($hackTutSched);
   $step1211GoodDeath = false;

   $hackTutSched = schedule(500, 0, "eval", "$enemy.applyDamage(100);");
   }
   

   schedule($tutorialHitbackStopTime, 0, "zeroTutVel");
}


function tutOnChargeBlocked(%blocker, %blocked)
{
   if ($tutorialStep == 1211)
   {
      cancel($hackTutSched);

      $step1211GoodDeath = true;

      %blocked.applyDamage(100);

   }
}


function stepOnDeath1211(%victim)
{
   if (%victim == $lastEnemy)
      return;

   if ($step1211GoodDeath)
   {
      $step1211Deaths ++;
      
      alxPlay(winWaveSound);

      

      if ($step1211Deaths == 3)
      {
         TutorialText.setText($sid::tut101);
         clientCmdSetCenterPrintText($sid::tut102, $tutMoveOnTime);
         alxPlay(WinWaveSound);
      }
      else if ($step1211Deaths < 3)
      {
         TutorialText.setText($sid::tut103 @ 3 - $step1211Deaths @ $sid::tut104);
      }
   }
   else
   {
      alxPlay(ringOutSound);

      if ($step1211Deaths < 3)
      {
         TutorialText.setText($sid::tut105);
      }
   }
   
   $enemy = addTutEnemy(Herman, HeadlessTutorial1, Tut902ST, Azarus, $tutorialEnemyTrans);
   $enemy.invincible = true;

   $tutee.player.setTargetObject($enemy);

   schedule(1000, 0, "eval", "$tutee.player.setTargetObject($enemy);");
}


function canEndStep1211(%f3Pressed)
{
   if (%f3Pressed && $step1211Deaths > 2)
      return true;

   return false;
}





//////////////////////////////////////////////////////////////////////


function step1212()
{
   $tutorialStep = 1212;

   hideCenterPrint();
   $lastEnemy = $enemy;
   $enemy.applyDamage(120);

   $step1212HaveQS = false;


   TutorialText.setText($sid::tut106 @ getPrintableKeyFor("quickStrike") @ $sid::tut107);
}


function tutQuickStrike()
{
   if ($tutorialStep == 1212 && !$step1212HaveQS)
   {
      alxPlay(winWaveSound);
      TutorialText.setText($sid::tut108);

      $step1212HaveQS = true;
   }
}



function canEndStep1212(%f3Pressed)
{
   return (%f3Pressed);
}


//////////////////////////////////////////////////////////////////////


function step1213()
{
   $tutorialStep = 1213;

   alxplay(winLevelSound);

   TutorialText.setText($sid::tut109);
}


function canEndStep1213(%f3Pressed)
{
   return (%f3Pressed);
}


//////////////////////////////////////////////////////////////////////


function step1214()
{
   $tutorialStep = 1214;

   disconnect();
}
