function include_explore_text() { $objSrcUser =& $GLOBALS["objSrcUser"]; $objSrcRace = $objSrcUser->get_race(); $arrUnitNames = $objSrcRace->getUnitNames(); include_once 'inc/functions/explore.php'; $iMaxAcres = getMaxExplore($objSrcUser); $arrExploreCost = getExploreCosts($objSrcUser); //========================================================================== // Stop people from avoiding the tribe page so they dont get updated //========================================================================== include_once 'inc/functions/update_ranking.php'; doUpdateRankings($objSrcUser); echo $topLinks = '<div class="center">' . '<a href="main.php?cat=game&page=build">Construction</a> | ' . '<a href="main.php?cat=game&page=army">Military Training</a> | ' . "<strong>Exploration</strong>" . '</div>'; $advisorText = '<div id="textBig">' . '<p>' . '<img src="' . HOST_PICS . 'explorers.gif" style="float: left; margin-right: 10px;" alt="Explorers" />' . "<strong>The tribe architect</strong> greets you: <br />" . "Attacking other tribes is not the only way to settle new " . "acres and expand your tribe. Exploring is another, more friendly, " . "way to grow. However, exploring isn't free and will require crowns, " . strtolower($arrUnitNames[2]) . "s and " . strtolower($arrUnitNames[1]) . "s. " . "To lower the costs you may consider ordering additional markets to be constructed." . '</p>' . '<p>' . "Sending out a team to settle <strong>1 acre</strong> costs <strong>" . number_format($arrExploreCost['crowns']) . " crowns</strong>, <strong>" . $arrExploreCost['basics'] . " " . strtolower($arrUnitNames[2]) . "s</strong> and " . "<strong>" . $arrExploreCost['citizens'] . " " . strtolower($arrUnitNames[1]) . "s." . "</strong>" . '</p>'; if ($objSrcRace->getRaceName() == 'Nazgul') { $advisorText = '<div id="textMedium">' . '<p>' . 'Your proud Nazgul army will not lower itself to explore for acres.' . '</p>'; } $advisorText .= '</div>'; echo $advisorText; // Classic Exception $strTip = 'Tip: You may be able to afford more, but you can only explore a ' . 'total of no more than 25% of your current land.'; if ($_SERVER['SERVER_NAME'] == DINAH_SERVER_NAME && $objSrcUser->get_user_info(HOURS) < PROTECTION_HOURS) { $strTip = 'Tip: You may explore at most 1000 acres while in protection.'; } if ($objSrcRace->getRaceName() != 'Nazgul') { // Advisor Link echo $advisorLink = '<br /><div class="tableLinkMedium">' . '<a href="main.php?cat=game&page=advisors&show=build">Tribe Architect</a> ' . ':: <a href="main.php?cat=game&page=market">Market</a>' . '</div>'; echo $strAdvisorText = '<div id="textMedium" style="margin-top: 0;">' . '<h3>Prepare Expedition</h3>' . '<p>' . 'Currently you can explore <strong><span class="indicator">' . number_format($iMaxAcres) . '</span> acres</strong>.' . '</p>' . '<form id="center" action="main.php?cat=game&page=explore2" method="post" style="margin-top: 0pt";>' . '<label>Explore Acres: ' . '<input name="explored_acres" value="' . $iMaxAcres . '" size="5" maxlength="4" />' . '</label> ' . '<input type="submit" value="Send Expedition" />' . '</form>' . '<p>' . $strTip . '</p>' . '</div>'; } }
function include_explore2_text() { global $Host; $objSrcUser =& $GLOBALS["objSrcUser"]; $explored_acres = intval($_POST['explored_acres']); include_once 'inc/functions/explore.php'; $iMaxAcres = getMaxExplore($objSrcUser); $arrExploreCost = getExploreCosts($objSrcUser); $money_used = $explored_acres * $arrExploreCost['crowns']; $used_citizens = $explored_acres * $arrExploreCost['citizens']; $used_basics = $explored_acres * $arrExploreCost['basics']; include_once 'inc/functions/races.php'; $arrUnitVars = getUnitVariables($objSrcUser->get_stat(RACE)); $arrUnitNames = $arrUnitVars['output']; $strRace = $objSrcUser->get_stat(RACE); if ($strRace == 'Nazgul') { echo $strDiv = '<div id="textMedium"><p>' . "Your proud nazgul military will not lower itself to exploring for land." . '</p></div>'; include_game_down(); exit; } if ($explored_acres < 1) { echo $strDiv = '<div id="textMedium"><p>' . "You tried to explore 0 acres." . '<br /><br />' . '<a href="main.php?cat=game&page=explore">' . "Try Again ?" . "</a>" . '</p></div>'; include_game_down(); exit; } $iCitz = $objSrcUser->get_pop(CITIZENS); $iNewCitz = $iCitz - $used_citizens; if ($iNewCitz < 800) { echo $strDiv = '<div id="textMedium"><p>' . "Exploring this many acres would result in less than 800 citizens " . "remaining on your lands. Your citizens refuse to venture forth." . '<br /><br />' . '<a href="main.php?cat=game&page=explore">' . "Try Again ?" . "</a>" . '</p></div>'; include_game_down(); exit; } $arrSpells = $objSrcUser->get_spells(); if ($arrSpells[STUNTED_GROWTH] > 0) { echo $strDiv = '<div id="textMedium"><p>' . "Bewitched by your enemies, your exploration team do not dare " . "prospecting new lands for yet another " . $arrSpells[STUNTED_GROWTH] . " months." . '<br /><br />' . '<a href="main.php?cat=game&page=explore">' . "Try Again ?" . "</a>" . '</p></div>'; include_game_down(); exit; } $iMaxExplore = getMaxExplore($objSrcUser); if ($explored_acres > $iMaxExplore) { echo $strDiv = '<div id="textMedium"><p>' . "You tried to explore {$explored_acres} acres, however you can " . "only explore {$iMaxExplore} acres. " . "<br /><br />" . "You can send expeditions out to explore a maximum of 25% of " . "your current acres plus incoming." . '<br /><br />' . '<a href="main.php?cat=game&page=explore">' . "Try Again ?" . "</a>" . '</p></div>'; include_game_down(); exit; } else { if (doExplore($objSrcUser, $explored_acres)) { // Return HTML Output $plural = 's'; if ($explored_acres == 1) { $plural = ''; } echo $strDiv = '<div id="textMedium">' . '<h2>' . 'Explore Report' . '</h2>' . '<p>' . "Congratulations, you have explored " . "<b>" . number_format($explored_acres) . " acre{$plural}</b>." . '</p><p>' . "This expedition cost you <b>" . number_format($money_used) . " crowns</b> and required <b>" . number_format($used_citizens) . " " . strtolower($arrUnitNames[1]) . "s</b> and <b>" . number_format($used_basics) . " " . strtolower($arrUnitNames[2]) . "s</b> to send off." . '</p><p align="center">' . '<img src="' . $Host . 'explorers_medium.gif" width="375" />' . '</p><p>' . "Your new land will be ready for construction in <b>4 months</b>." . '</p><p>' . '<a href="main.php?cat=game&page=explore">Continue</a>' . "</p></div>"; } else { echo '<div class="center">' . "Your explore seem to have failed, please check your tribe " . "for any eventual errors caused by this, and report these " . "together with your tribe name and alliance # to an admin." . "<br />Thank you, and sorry for any inconvenience caused by " . "this."; echo "<br><br><a href=main.php?cat=game&page=explore>Return to Exploration</a></div"; } } }
function include_game_menu() { if (isset($GLOBALS['objSrcUser'])) { $objSrcUser =& $GLOBALS['objSrcUser']; $objSrcAlli = $objSrcUser->get_alliance(); $arrSrcPrefs = $objSrcUser->get_preferences(); $dtLastNews = $objSrcUser->get_user_info(LAST_NEWS); $iBarren = $objSrcUser->get_barren(); $iBasics = $objSrcUser->get_army(UNIT1); include_once 'inc/functions/explore.php'; $iExplore = getMaxExplore($objSrcUser); } else { $dtLastNews = 0; $arrSrcPrefs[NEW_A] = 0; $iBarren = 0; $iBasics = 0; $iExplore = 0; } //========================================================================== // Extra stuff, for fun :p keep developing Martel July 25, 2007 //========================================================================== // TRIBE =================================================================== $iTribeCounter = 0; $arrClassStr[0][0] = ''; if ($dtLastNews > 0) { $arrClassStr[0][0] .= ' class = "check_new"'; $iTribeCounter++; } if ($iTribeCounter > 0) { $iTribeCounter = ' (<span class="indicator">' . $iTribeCounter . '</span>)'; } else { $iTribeCounter = ''; } // ALLIANCE ================================================================ $iAllianceCounter = 0; $arrClassStr[1][0] = ''; if ($arrSrcPrefs[NEW_A] > 0) { $arrClassStr[1][0] = ' class = "check_new"'; $iAllianceCounter++; } if ($iAllianceCounter > 0) { $iAllianceCounter = ' (<span class="indicator">' . $iAllianceCounter . '</span>)'; } else { $iAllianceCounter = ''; } // ACTIONS ================================================================= $iActionsCounter = 0; $arrClassStr[2][0] = ''; $arrClassStr[2][1] = ''; $arrClassStr[2][2] = ''; if ($iBarren > 0) { $arrClassStr[2][0] = ' class = "check_new"'; $iActionsCounter++; } if ($iBasics > 0) { $arrClassStr[2][1] = ' class = "check_new"'; $iActionsCounter++; } if ($iExplore > 0) { $arrClassStr[2][2] = ' class = "check_new"'; $iActionsCounter++; } if ($iActionsCounter > 0) { $iActionsCounter = ' (<span class="indicator">' . $iActionsCounter . '</span>)'; } else { $iActionsCounter = ''; } //========================================================================== ?> <ul id="nav"> <li class="menu"><a href="main.php?cat=game&page=tribe" class="header">Tribe<?php echo $iTribeCounter; ?> </a> <ul> <li><a href="main.php?cat=game&page=tribe">The Tribe</a></li> <li><a href="main.php?cat=game&page=news"<?php echo $arrClassStr[0][0]; ?> >Tribe News</a><hr class="menuLine" /></li> <li><a href="main.php?cat=game&page=advisors">Internal Affairs</a></li> <li><a href="main.php?cat=game&page=mail">Orkfia Mail</a></li> <li><a href="main.php?cat=game&page=motd">Admin Message</a><hr class="menuLine" /></li> <?php if (isset($objSrcUser) && ($objSrcUser->get_stat(TYPE) == 'elder' || $objSrcUser->get_stat(TYPE) == 'coelder')) { ?> <li><a href="main.php?cat=game&page=elder">Elder Options</a></li> <?php } ?> <?php if (isset($objSrcUser) && $objSrcUser->get_stat(LEVEL) > 2) { ?> <li><a href="main.php?cat=game&page=resort_tools">Resort Tools</a></li> <?php } ?> </ul> </li> <li class="menu"><a href="main.php?cat=game&page=alliance" class="header">Alliance<?php echo $iAllianceCounter; ?> </a> <ul> <li><a href="main.php?cat=game&page=alliance">The Alliance</a></li> <li><a href="main.php?cat=game&page=alliance_news">Alliance News</a><hr class="menuLine" /></li> <li><a style="width: 55%; float: left;" href="main.php?cat=game&page=market">Market</a> <a style="width: 20%; float: left;" href="main.php?cat=game&page=market&action=sell">Sell</a></li> <li><a href="main.php?cat=game&page=research">Research</a></li> <li><a href="main.php?cat=game&page=war_room">War Room</a><hr class="menuLine" /></li> <li><a href="main.php?cat=game&page=vote">Elect Elder</a></li> <li><a href="main.php?cat=game&page=forums&set=alliance&mode=threads"<?php echo $arrClassStr[1][0]; ?> >Alliance Forum</a></li> </ul> </li> <li class="menu"><a href="main.php?cat=game&page=build" class="header">Actions<?php echo $iActionsCounter; ?> </a> <ul> <li><a href="main.php?cat=game&page=build"<?php echo $arrClassStr[2][0]; ?> >Construction</a></li> <li><a href="main.php?cat=game&page=army"<?php echo $arrClassStr[2][1]; ?> >Military Training</a></li> <li><a href="main.php?cat=game&page=explore"<?php echo $arrClassStr[2][2]; ?> >Exploration</a><hr class="menuLine" /></li> <li><a href="main.php?cat=game&page=mystic">Mystics</a></li> <li><a href="main.php?cat=game&page=thievery">Thievery</a></li> <li><a href="main.php?cat=game&page=invade">Invasion</a><hr class="menuLine" /></li> <li><a href="main.php?cat=game&page=global_news">Global News</a></li> </ul> </li> <li class="menu"><a href="main.php?cat=game&page=orkfiastats" class="header">Tools</a> <ul> <li><a href="main.php?cat=game&page=orkfiastats">Orkfia Stats</a></li> <li><a href="main.php?cat=game&page=rankings">Rankings</a></li> <li><a href="main.php?cat=game&page=racestats">Racial Stats</a><hr class="menuLine" /></li> <li><a href="main.php?cat=game&page=resourcefarms">Resource Farms</a></li> <li><a href="main.php?cat=game&page=targetfinder">Target Finder</a><hr class="menuLine" /></li> <li><a href="main.php?cat=game&page=preferences">Options</a></li> </ul> </li> <li class="menu"><a href="<?php echo HOST_GUIDE; ?> " target="_blank" class="header newWindowLink">Help</a> <ul> <li><a href="<?php echo HOST_GUIDE; ?> " target="_blank" class="newWindowLink">Player Guide</a></li> <li><a href="main.php?cat=game&page=forums&set=game&mode=threads">Game Talk</a><hr class="menuLine" /></li> <li><a href="main.php?cat=game&page=CoC">Code of Conduct</a></li> </ul> </li> <?php $iUserLevel = 0; if (isset($objSrcUser)) { $iUserLevel = $objSrcUser->get_stat(LEVEL); } if ($iUserLevel > 1) { ?> <li class="modTools"><a href="main.php?cat=game&page=resort_tools" class="header">Resort Tools</a></li> <?php } else { ?> <li class="modTools"><a href="main.php?cat=game&page=sponsors" class="header">Sponsors</a></li> <?php } ?> <li class="options"><a href="main.php?cat=game&page=preferences" class="header">Options</a></li> </ul> <?php //If my new menu works I will put it here. I will also remove the ID part when a first good part is done. if ($objSrcUser->get_userid() == 7160 && $_SERVER['SERVER_NAME'] == DEV_SERVER_NAME) { include "inc/harrytesting.php"; } }