<?php
session_start();
//header("Cache-control: private");
require_once "headers.php";
require_once "common.php";
$exp[1] = 1000;
$exp[2] = 5000;
$exp[3] = 15000;
$exp[4] = 45000;
$exp[5] = 150000;
$exp[6] = 450000;
$exp[7] = 1000000;
$exp[8] = 5000000;
$exp[9] = 10000000;
$exp[10] = 50000000;
$exp[11] = 100000000;
$exp[12] = 350000000;
$exp[13] = 600000000;
$exp[14] = 900000000;
$sailing[2] = 1;
$sailing[3] = 2;
$sailing[4] = 2;
$sailing[5] = 2;
$sailing[6] = 3;
$sailing[7] = 5;
$sailing[8] = 8;
$sailing[9] = 11;
$sailing[10] = 17;
$sailing[11] = 26;
$sailing[12] = 38;
$sailing[13] = 58;
$sailing[14] = 86;
$gunnery[2] = 1;
$gunnery[3] = 2;
$gunnery[4] = 2;
$gunnery[5] = 3;
$gunnery[6] = 5;
$gunnery[7] = 8;
$gunnery[8] = 11;
$gunnery[9] = 17;
$gunnery[10] = 26;
$gunnery[11] = 38;
$gunnery[12] = 58;
$gunnery[13] = 86;
$gunnery[14] = 130;
echo"<BODY><div align=left>";
echo "<form action=\"shipyard.php\" method=\"POST\">";
echo "<br><br>";
echo "<table class=\"menu\">";
echo " <tr>";
echo " <td class=\"menuheader\" style=\"height:25px;width:450px;text-align:center\" colspan=3>Ship Master</td>";
echo " </tr>";
echo " <tr>";
echo " <td colspan=3 style=\"text-align:center\"><img src=\"../images/sailingMaster.png\"></td>";
echo " </tr>";
echo " <tr>";
echo " <td class=\"body\" style=\"text-align:Center;width:150px\"><a href=\"shipmaster.php?module=1\"></td>";
echo " <td class=\"body\" style=\"text-align:Center;width:150px\"><a href=\"shipmaster.php?module=2\">Visit the Master</td>";
echo " <td class=\"body\" style=\"text-align:Center;width:150px\"><a href=\"shipmaster.php?module=3\"></td>";
echo " </tr>";
$cannonbought = 0;
$platingbought = 0;
switch($_GET["module"])
{
case 0:
break;
case 1:
break;
case 2:
if($_SESSION['experience'] >= $exp[$_SESSION['playerlevel']])
{
$nextlvl = $_SESSION['playerlevel'] + 1;
$message = "The master smiles and gladly promotes you!";
$_SESSION['mygunnery'] = $_SESSION['mygunnery'] + $gunnery[$nextlvl];
$_SESSION['mysailing'] = $_SESSION['mysailing'] + $sailing[$nextlvl];
$_SESSION['playerlevel'] = $nextlvl;
SavePlayerShip();
}
else
{
$message = "The master says you are not ready for advancement yet. You need to earn ". ($exp[$_SESSION['playerlevel']] - $_SESSION['experience']) ." experience.";
}
echo "<tr><td colspan=3>";
DisplayMessage($message);
echo "</td></tr>";
break;
case 3:
break;
default:
$message="You walk up to the ramshackle house...</td></tr>";
echo "<tr><td colspan=3>";
DisplayMessage($message);
echo "</td></tr>";
break;
}
echo "</table>";
echo "</form>";
echo "</div>";
echo "</BODY>";
include("footer.php");
?>