more big update

This commit is contained in:
unknown
2012-05-15 23:23:19 +03:00
parent 0583888a14
commit 1215e1c42f
50 changed files with 478 additions and 498 deletions
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid1"><a href="#" onClick="return Popup(0,4);" class="build_logo">
<img class="building g1" src="img/x.gif" alt="<?php echo B1; ?>" title="<?php echo B1; ?>" />
@@ -14,7 +13,7 @@
</tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid10"><a href="#" onClick="return Popup(10,4);" class="build_logo">
<img class="building g10" src="img/x.gif" alt="Warehouse" title="Warehouse" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid11"><a href="#" onClick="return Popup(11,4);" class="build_logo">
<img class="building g11" src="img/x.gif" alt="Granary" title="Granary" />
@@ -18,7 +17,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid14"><a href="#" onClick="return Popup(14,4);" class="build_logo">
<img class="building g14" src="img/x.gif" alt="Tournament Square" title="Tournament Square" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Speed bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid15"><a href="#" onClick="return Popup(15,4);" class="build_logo">
<img class="building g15" src="img/x.gif" alt="Main Building" title="Main Building" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Construction time at level <?php echo $next; ?>:</th>
+8
View File
@@ -1,17 +1,25 @@
<?php
if($_REQUEST["cancel"] == "1") {
if($session->access != BANNED){
$database->delDemolition($village->wid);
header("Location: build.php?gid=15&amp;cancel=0&amp;demolish=0");
}else{
header("Location: banned.php");
}
}
if(!empty($_REQUEST["demolish"]) && $_REQUEST["c"] == $session->mchecker) {
if($session->access != BANNED){
if($_REQUEST["type"] != null) {
$type = $_REQUEST['type'];
$database->addDemolition($village->wid,$type);
$session->changeChecker();
header("Location: build.php?gid=15&amp;cancel=0&amp;demolish=0");
}
}else{
header("Location: banned.php");
}
}
if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) {
+2 -2
View File
@@ -169,8 +169,8 @@ function testSum() {
<?php
$wwvillage = $database->getResourceLevel($village->wid);
if($wwvillage['f99t']!=40 && $wwvillage['f1t']!=40 && $wwvillage['f2t']!=40 && $wwvillage['f3t']!=40 && $wwvillage['f4t']!=40 && $wwvillage['f5t']!=40 && $wwvillage['f6t']!=40 && $wwvillage['f7t']!=40 && $wwvillage['f8t']!=40 && $wwvillage['f9t']!=40 && $wwvillage['f10t']!=40 && $wwvillage['f11t']!=40 && $wwvillage['f12t']!=40 && $wwvillage['f13t']!=40 && $wwvillage['f14t']!=40 && $wwvillage['f15t']!=40 && $wwvillage['f16t']!=40 && $wwvillage['f17t']!=40 && $wwvillage['f18t']!=40 && $wwvillage['f19t']!=40 && $wwvillage['f20t']!=40 && $wwvillage['f21t']!=40 && $wwvillage['f22t']!=40 && $wwvillage['f23t']!=40 && $wwvillage['f24t']!=40 && $wwvillage['f25t']!=40 && $wwvillage['f26t']!=40 && $wwvillage['f27t']!=40 && $wwvillage['f28t']!=40 && $wwvillage['f29t']!=40 && $wwvillage['f30t']!=40 && $wwvillage['f31t']!=40 && $wwvillage['f32t']!=40 && $wwvillage['f33t']!=40 && $wwvillage['f34t']!=40 && $wwvillage['f35t']!=40 && $wwvillage['f36t']!=40 && $wwvillage['f37t']!=40 && $wwvillage['f38t']!=40 && $wwvillage['f39t']!=40 && $wwvillage['f40t']!=40){
?>
if($wwvillage['f99t']!=40){
?>
<table id="npc" cellpadding="1" cellspacing="1">
<thead>
<tr>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid2"><a href="#" onClick="return Popup(2,4);" class="build_logo">
<img class="building g2" src="img/x.gif" alt="<?php echo B2; ?>" title="<?php echo B2; ?>" />
@@ -15,7 +14,7 @@
</tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
-145
View File
@@ -1,145 +0,0 @@
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr>
<td>Academy</td>
<td>Action</td>
</tr></thead>
<tbody>
<?php
$fail = $success = 0;
for($i=2;$i<=9;$i++) {
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
echo "<br><span class=\"none\">Expand warehouse</span></div></td>";
echo "<td class=\"act\">
<div class=\"none\">Expand<br>warehouse</div>
</td></tr>";
}
else if(${'r'.$i}['crop'] > $village->maxcrop) {
echo "<br><span class=\"none\">Expand granary</span></div></td>";
echo "<td class=\"act\">
<div class=\"none\">Expand<br>granary</div>
</td></tr>";
}
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
$time = $technology->calculateAvaliable($i);
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
echo "<td class=\"act\">
<div class=\"none\">Too few<br>resources</div>
</td></tr>";
}
else if($session->access != BANNED){
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"build.php?id=$id&amp;a=$i&amp;c=".$session->mchecker."\">Research</a></td></tr>";
}else{
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"banned.php\">Research</a></td></tr>";
}
$success += 1;
}
else {
$fail += 1;
}
}
if($success == 0) {
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</div></td>";
}
?>
</tbody>
</table>
<?php
if($fail > 0) {
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">show more</a></p>
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
<thead><tr><td colspan=\"2\">Prerequisites</td></tr><tbody>";
if(!$technology->meetRRequirement(2) && !$technology->getTech(2)) {
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u2\" title=\"Praetorian\" alt=\"Praetorian\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(2, 1);\" href=\"#\">Praetorian</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 1);\">Academy</a>
<span title=\"+2\">Level 1</span><br /><a href=\"#\" onclick=\"return Popup(13, 4);\">Armoury </a><span title=\"+1\">Level 1</span></td></tr>";
}
if(!$technology->meetRRequirement(3) && !$technology->getTech(3)) {
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u3\" title=\"Imperian\" alt=\"Imperian\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(3, 1);\" href=\"#\">Imperian</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
<span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\">Level 1</span> </td></tr>";
}
if(!$technology->meetRRequirement(4) && !$technology->getTech(4)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u4\" title=\"Equites Legati\" alt=\"Equites Legati\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(4, 1);\" href=\"#\">Equites Legati</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a><span title=\"+1\">Level 1</span> </td></tr>";
}
if(!$technology->meetRRequirement(5) && !$technology->getTech(5)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u5\" title=\"Equites Imperatoris\" alt=\"Equites Imperatoris\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(5, 1);\" href=\"#\">Equites Imperatoris</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a><span title=\"+5\">Level 5</span> </td></tr>";
}
if(!$technology->meetRRequirement(6) && !$technology->getTech(6)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u6\" title=\"Equites Caesaris\" alt=\"Equites Caesaris\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(6, 1);\" href=\"#\">Equites Caesaris</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\">Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
Stable</a><span title=\"+10\">Level 10</span> </td></tr>";
}
if(!$technology->meetRRequirement(7) && !$technology->getTech(7)) {
echo "
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u7\" title=\"Battering Ram\" alt=\"Battering Ram\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(7, 1);\" href=\"#\">Battering Ram</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
<span title=\"+7\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a><span title=\"+1\">Level 1</span></td></tr>";
}
if(!$technology->meetRRequirement(8) && !$technology->getTech(8)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u8\" title=\"Fire Catapult\" alt=\"Fire Catapult\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(8, 1);\" href=\"#\">Fire Catapult</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a>
<span title=\"+10\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\">Level 15</span> </td>
</tr>";
}
if(!$technology->meetRRequirement(9) && !$technology->getTech(9)) {
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u9\" title=\"Senator\" alt=\"Senator\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(9, 1);\" href=\"#\">Senator</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(16, 4);\">Rally Point</a><span title=\"+9\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
Academy</a><span title=\"+17\">Level 20</span></td></tr>";
}
echo "<script type=\"text/javascript\">
//<![CDATA[
$(\"researchFuture\").toggle = (function()
{
this.toggleClass(\"hide\");
$(\"researchFutureLink\").set(\"text\",
this.hasClass(\"hide\")
? \"show more\"
: \"hide more\"
);
return false;
}).bind($(\"researchFuture\"));
//]]>
</script>";
echo "</tbody></table>";
}
$acares = $technology->grabAcademyRes();
if(count($acares) > 0) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>Researching</td><td>Duration</td><td>Complete</td></tr>
</thead><tbody>";
$timer = 1;
foreach($acares as $aca) {
$unit = substr($aca['tech'],1,2);
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
$date = $generator->procMtime($aca['timestamp']);
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
echo "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
?>
+4 -5
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid23"><a href="#" onClick="return Popup(23,4);" class="build_logo">
<img class="building g23" src="img/x.gif" alt="Cranny" title="Cranny" />
@@ -29,15 +28,15 @@
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
if($next<=10){
?>
<th>Hidden units per resource at level <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild; ?>:</th>
<th>Hidden units per resource at level <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master; ?>:</th>
<?php
if($session->tribe == 3) {
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild]['attri']*2; ?></b> units</td>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*2; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild]['attri']; ?></b> units</td>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']; ?></b> units</td>
<?php
}}else{
?>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid28"><a href="#" onClick="return Popup(28,4);" class="build_logo">
<img class="building g28" src="img/x.gif" alt="Trade Office" title="Trade Office" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Merchant load at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid3"><a href="#" onClick="return Popup(3,4);" class="build_logo">
<img class="building g3" src="img/x.gif" alt="<?php echo B3; ?>" title="<?php echo B3; ?>" />
@@ -17,7 +16,7 @@
</tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid31">
<h1>City Wall <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
@@ -13,7 +12,7 @@
</tr><tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Defence Bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid32">
<h1>Earth Wall <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
@@ -13,7 +12,7 @@
</tr><tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Defence Bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid33">
<h1>Palisade <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
@@ -13,7 +12,7 @@
</tr><tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Defence Bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid34"><a href="#" onClick="return Popup(34,4);" class="build_logo">
<img class="building g34" src="img/x.gif" alt="Stonemason's Lodge" title="Stonemason's Lodge" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Stability bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid35"><a href="#" onClick="return Popup(35,4);" class="build_logo">
<img class="building g35" src="img/x.gif" alt="Brewery" title="Brewery" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=10){
?>
<th>Bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid36"><h1>Trapper <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">
@@ -20,7 +19,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Maximum traps to train at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid38"><a href="#" onClick="return Popup(38,4);" class="build_logo">
<img class="building g38" src="img/x.gif" alt="Great Warehouse" title="Great Warehouse" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid39"><a href="#" onClick="return Popup(39,4);" class="build_logo">
<img class="building g39" src="img/x.gif" alt="Great Granary" title="Great Granary" />
@@ -18,7 +17,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid4"><a href="#" onClick="return Popup(4,4);" class="build_logo">
<img class="building g4" src="img/x.gif" alt="<?php echo B4; ?>" title="<?php echo B4; ?>" />
@@ -16,7 +15,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
-106
View File
@@ -1,106 +0,0 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename ww.tpl ##
## Developed by: Dixie ##
## Edited by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
?>
<div id="build" class="gid40"><a href="#" onClick="return Popup(5,4);" class="build_logo">
<img class="building g40" src="img/x.gif" alt="Sawmill" title="Sawmill" />
</a>
<h1>Wonder of the World <br /><span class="level">Level <?php echo $village->resarray['f'.$id];?></span></h1>
<p class="build_desc">The World Wonder (otherwise known as a Wonder of the World) is as wonderful as it sounds. "This building" is built in order to win the server. Each level of the World Wonder costs hundreds of thousands (even millions) of resources to build.</p>
<form action="GameEngine/Game/WorldWonderName.php" method="POST">
<input type="hidden" name="vref" value="<?php echo $_SESSION['wid']; ?>" />
<?php
$vref = $_SESSION['wid'];
$wwname = $database->getWWName($vref);
if($village->resarray['f'.$id] < 0){
echo 'You need to have World Wonder level 1 to be able to change its name.
<center><br />World Wonder name: <input class="text" name="wwname" id="wwname" disabled="disabled" value="'.$wwname.'" maxlength="20"></center><p class="btn"><input type="image" value="" tabindex="9" name="s1" disabled="disabled" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>';
} else if($village->resarray['f'.$id] > 0 and $village->resarray['f'.$id] < 11) {
echo '<center><br />World Wonder name: <input class="text" name="wwname" id="wwname" value="'.$wwname.'" maxlength="20"></center><p class="btn"><input type="image" value="" tabindex="9" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>';
} else if ($village->resarray['f'.$id] > 10){
echo 'You can not change the name of the World Wonder after level 10.
<center><br />World Wonder name: <input class="text" name="wwname" id="wwname" disabled="disabled" value="'.$wwname.'" maxlength="20"></center><p class="btn"><input type="image" value="" tabindex="9" name="s1" disabled="disabled" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>';
}?>
</form>
<?php
if(isset($_GET['n'])) {
echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="Red"><b>Name changed.</b></font>';
}
?>
<?php
$bindicate = $building->canBuild($id,$village->resarray['f'.$id.'t']);
if($village->resarray['f'.$id] == 100) {
echo "<p><span class=\"none\">Building already at max level</span></p>";
}
else {
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],($loopsame > 0 ? 2:1)+$doublebuild);
?>
<p id="contract"><b>Costs</b> for upgrading to level <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild; ?>:<br />
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><span class="little_res"><?php echo $uprequire['wood']; ?></span> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><span class="little_res"><?php echo $uprequire['clay']; ?></span> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><span class="little_res"><?php echo $uprequire['iron']; ?></span> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><span class="little_res"><?php echo $uprequire['crop']; ?></span> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
} ?><br />
<?php
if($bindicate == 2) {
echo "<span class=\"none\">The workers are already at work.</span>";
}
else if($bindicate == 3) {
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
}
else if($bindicate == 4) {
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
}
else if($bindicate == 5) {
echo "<span class=\"none\">Upgrade Warehouse.</span>";
}
else if($bindicate == 6) {
echo "<span class=\"none\">Upgrade Granary.</span>";
}
else if($bindicate == 7) {
$neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id]);
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
}
else if($bindicate == 8) {
if($session->access==BANNED){
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
}
else if($id <= 18) {
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
}
else {
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
}
echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
echo ".</a>";
}
else if($bindicate == 9) {
if($session->access==BANNED){
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
}
else if($id <= 18) {
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
}
else {
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
}
echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
echo ".</a> <span class=\"none\">(waiting loop)</span> ";
}
}
?>
</p></div>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid5"><a href="#" onClick="return Popup(5,4);" class="build_logo">
<img class="building g5" src="img/x.gif" alt="Sawmill" title="Sawmill" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Wood bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid6"><a href="#" onClick="return Popup(6,4);" class="build_logo">
<img class="building g6" src="img/x.gif" alt="Brickyard" title="Brickyard" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Clay bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid7"><a href="#" onClick="return Popup(7,4);" class="build_logo">
<img class="building g7" src="img/x.gif" alt="Iron Foundry" title="Iron Foundry" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Iron bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid8"><a href="#" onClick="return Popup(8,4);" class="build_logo">
<img class="building g8" src="img/x.gif" alt="Grain Mill" title="Grain Mill" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Crop bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid9"><a href="#" onClick="return Popup(9,4);" class="build_logo">
<img class="building g9" src="img/x.gif" alt="Bakery" title="Bakery" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Crop bonus at level <?php echo $next; ?>:</th>
+6 -3
View File
@@ -42,6 +42,8 @@ $herosmansion = $building->getTypeLevel(37);
$greatwarehouse = $building->getTypeLevel(38);
$greatgranary = $building->getTypeLevel(39);
$greatworkshop = $building->getTypeLevel(42);
$ww = $building->getTypeLevel(40);
$wwinbuild = count($database->getBuildingByType($village->wid,40));
foreach ($database->getJobs($_SESSION['wid']) as $bdata) {
$UnderConstruction = strtolower(str_replace(array(" ","'"),"",$building->procResType($bdata['type'])));
@@ -52,6 +54,9 @@ foreach ($database->getJobs($_SESSION['wid']) as $bdata) {
?>
<div id="build" class="gid0"><h1>Construct new building</h1>
<?php
if($ww == 0 && $wwinbuild == 0 && $village->natar == 1){ //need to check if have ww buildplan too
include("avaliable/ww.tpl");
}
if($mainbuilding == 0 && $id != 39 && $id != 40) {
include("avaliable/mainbuilding.tpl");
}
@@ -391,6 +396,7 @@ if($greatworkshop == 0 && $workshop >= 18 && $village->capital == 0 && GREAT_WKS
if($greatworkshop == 0 && $workshop >= 15 && $village->capital == 0 && GREAT_WKS) {
include("soon/greatworkshop.tpl");
}
}
?>
</div><script language="JavaScript" type="text/javascript">
function show_build_list(list) {
@@ -429,7 +435,4 @@ function show_build_list(list) {
}
}
</script>
<?php
}
?>
</div>
@@ -2,7 +2,10 @@
$bid = $_GET['bid'];
unset($_GET['bid']);
$bindicator = $building->canBuild($id,$bid);
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
$uprequire = $building->resourceRequired($id,$bid);
$mastertime = $uprequire['time'];
?>
<td class="res">
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $uprequire['wood']; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $uprequire['clay']; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $uprequire['iron']; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $uprequire['crop']; ?> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
@@ -16,9 +19,31 @@ $uprequire = $building->resourceRequired($id,$bid);
<?php
if($bindicator == 2) {
echo "<span class=\"none\">The workers are already at work.</span>";
if($session->goldclub){
?> </br>
<?php
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
else if($bindicator == 3) {
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
if($session->goldclub){
?> </br>
<?php
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
else if($bindicator == 4) {
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
@@ -32,6 +57,17 @@ $uprequire = $building->resourceRequired($id,$bid);
else if($bindicator == 7) {
$neededtime = $building->calculateAvaliable($id,$bid);
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
if($session->goldclub){
?> </br>
<?php
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
else if($bindicator == 8) {
if($session->access!=BANNED){
+16
View File
@@ -0,0 +1,16 @@
<h2>Wonder Of The World</h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc">The wonder of the world represents the pride of creation. Only the mightiest and richest are able to build such a masterwork and defend it against envious enemies.</td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(40,4);">
<img class="building g40" src="img/x.gif" alt="Wonder Of The World" title="Wonder Of The World" /></a>
</td>
</tr>
<tr>
<?php
$_GET['bid'] = 40;
include("wwavailupgrade.tpl");
?>
</tr></tbody>
</table>
@@ -0,0 +1,84 @@
<?php
$bid = $_GET['bid'];
unset($_GET['bid']);
$bindicator = $building->canBuild(99,$bid);
$uprequire = $building->resourceRequired(99,$bid);
?>
<td class="res">
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $uprequire['wood']; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $uprequire['clay']; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $uprequire['iron']; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $uprequire['crop']; ?> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
} ?></td>
</tr>
<tr>
<td class="link">
<?php
if($bindicator == 2) {
echo "<span class=\"none\">The workers are already at work.</span>";
if($session->goldclub){
?> </br>
<?php
if($session->gold >= 1){
echo "<a class=\"build\" href=\"dorf2.php?master=99\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
else if($bindicator == 3) {
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
if($session->goldclub){
?> </br>
<?php
if($session->gold >= 1){
echo "<a class=\"build\" href=\"dorf2.php?master=99\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
else if($bindicator == 4) {
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
}
else if($bindicator == 5) {
echo "<span class=\"none\">Upgrade Warehouse.</span>";
}
else if($bindicator == 6) {
echo "<span class=\"none\">Upgrade Granary.</span>";
}
else if($bindicator == 7) {
$neededtime = $building->calculateAvaliable(99,$bid);
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
if($session->goldclub){
?> </br>
<?php
if($session->gold >= 1){
echo "<a class=\"build\" href=\"dorf2.php?master=99\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
else if($bindicator == 8) {
if($session->access!=BANNED){
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=99&c=".$session->checker."\">Construct building.</a>";
}else{
echo "<a class=\"build\" href=\"banned.php\">Construct building.</a>";
}
}
else if($bindicator == 9) {
if($session->access!=BANNED){
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=99&c=".$session->checker."\">Construct building. (waiting loop)</a>";
}else{
echo "<a class=\"build\" href=\"banned.php?a=$bid&id=99&c=".$session->checker."\">Construct building. (waiting loop)</a>";
}
}
?>
</td>
+5
View File
@@ -0,0 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
$master = count($database->getMasterJobsByField($village->wid,$id));
?>
+71 -5
View File
@@ -1,5 +1,6 @@
<?php
$bindicate = $building->canBuild($id,$village->resarray['f'.$id.'t']);
$bid = $village->resarray['f'.$id.'t'];
$bindicate = $building->canBuild($id,$bid);
if($bindicate == 1) {
echo "<p><span class=\"none\">Building already at max level</span></p>";
} else if($bindicate == 10) {
@@ -9,9 +10,11 @@ if($bindicate == 1) {
} else {
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],($loopsame > 0 ? 2:1)+$doublebuild);
$master = count($database->getMasterJobsByField($village->wid,$id));
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
$mastertime = $uprequire['time'];
?>
<p id="contract"><b>Costs</b> for upgrading to level <?php echo $village->resarray['f'.$id]+($loopsame > 0 ? 2:1)+$doublebuild; ?>:<br />
<p id="contract"><b>Costs</b> for upgrading to level <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master; ?>:<br />
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><span class="little_res"><?php echo $uprequire['wood']; ?></span> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><span class="little_res"><?php echo $uprequire['clay']; ?></span> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><span class="little_res"><?php echo $uprequire['iron']; ?></span> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><span class="little_res"><?php echo $uprequire['crop']; ?></span> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
@@ -19,9 +22,51 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
<?php
if($bindicate == 2) {
echo "<span class=\"none\">The workers are already at work.</span>";
if($session->goldclub){
?> </br>
<?php
if($id <= 18) {
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}else{
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
}
else if($bindicate == 3) {
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
if($session->goldclub){
?> </br>
<?php
if($id <= 18) {
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}else{
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
}
else if($bindicate == 4) {
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
@@ -33,8 +78,29 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "<span class=\"none\">Upgrade Granary.</span>";
}
else if($bindicate == 7) {
$neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],($loopsame > 0 ? 2:1));
$neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
if($session->goldclub){
?> </br>
<?php
if($id <= 18) {
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}else{
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
}
else if($bindicate == 8) {
if($session->access==BANNED){
@@ -48,7 +114,7 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
}
echo $village->resarray['f'.$id]+1;
echo ".</a>";
}
}
else if($bindicate == 9) {
if($session->access==BANNED){
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
+6 -65
View File
@@ -15,9 +15,9 @@
?>
<div id="build" class="gid40"><a href="#" onClick="return Popup(5,4);" class="build_logo">
<img class="building g40" src="img/x.gif" alt="Sawmill" title="Sawmill" />
<img class="building g40" src="img/x.gif" alt="World Wonder" title="World Wonder" />
</a>
<h1>Wonder of the World <br /><span class="level">Level <?php echo $village->resarray['f99'];?></span></h1>
<h1>Wonder of the World <br /><span class="level">Level <?php echo $village->resarray['f'.$id];?></span></h1>
<p class="build_desc">The World Wonder (otherwise known as a Wonder of the World) is as wonderful as it sounds. "This building" is built in order to win the server. Each level of the World Wonder costs hundreds of thousands (even millions) of resources to build.</p>
<form action="GameEngine/Game/WorldWonderName.php" method="POST">
<input type="hidden" name="vref" value="<?php echo $_SESSION['wid']; ?>" />
@@ -25,12 +25,12 @@
$vref = $_SESSION['wid'];
$wwname = $database->getWWName($vref);
if($village->resarray['f99'] < 0){
if($village->resarray['f'.$id] < 0){
echo 'You need to have World Wonder level 1 to be able to change its name.
<center><br />World Wonder name: <input class="text" name="wwname" id="wwname" disabled="disabled" value="'.$wwname.'" maxlength="20"></center><p class="btn"><input type="image" value="" tabindex="9" name="s1" disabled="disabled" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>';
} else if($village->resarray['f99'] > 0 and $village->resarray['f99'] < 11) {
} else if($village->resarray['f'.$id] > 0 and $village->resarray['f'.$id] < 11) {
echo '<center><br />World Wonder name: <input class="text" name="wwname" id="wwname" value="'.$wwname.'" maxlength="20"></center><p class="btn"><input type="image" value="" tabindex="9" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>';
} else if ($village->resarray['f99'] > 10){
} else if ($village->resarray['f'.$id] > 10){
echo 'You can not change the name of the World Wonder after level 10.
<center><br />World Wonder name: <input class="text" name="wwname" id="wwname" disabled="disabled" value="'.$wwname.'" maxlength="20"></center><p class="btn"><input type="image" value="" tabindex="9" name="s1" disabled="disabled" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>';
}?>
@@ -42,65 +42,6 @@ echo 'You can not change the name of the World Wonder after level 10.
?>
<?php
$bindicate = $building->canBuild($id,$village->resarray['f99t']);
if($village->resarray['f99'] == 100) {
echo "<p><span class=\"none\">Building already at max level</span></p>";
}
else {
$uprequire = $building->resourceRequired($id,$village->resarray['f99t'],($loopsame > 0 ? 2:1)+$doublebuild);
?>
<p id="contract"><b>Costs</b> for upgrading to level <?php echo $village->resarray['f99']+1+$loopsame+$doublebuild; ?>:<br />
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><span class="little_res"><?php echo $uprequire['wood']; ?></span> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><span class="little_res"><?php echo $uprequire['clay']; ?></span> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><span class="little_res"><?php echo $uprequire['iron']; ?></span> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><span class="little_res"><?php echo $uprequire['crop']; ?></span> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
} ?><br />
<?php
if($bindicate == 2) {
echo "<span class=\"none\">The workers are already at work.</span>";
}
else if($bindicate == 3) {
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
}
else if($bindicate == 4) {
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
}
else if($bindicate == 5) {
echo "<span class=\"none\">Upgrade Warehouse.</span>";
}
else if($bindicate == 6) {
echo "<span class=\"none\">Upgrade Granary.</span>";
}
else if($bindicate == 7) {
$neededtime = $building->calculateAvaliable($id,$village->resarray['f99']);
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
}
else if($bindicate == 8) {
if($session->access==BANNED){
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
}
else if($id <= 18) {
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
}
else {
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
}
echo $village->resarray['f99']+1+$loopsame+$doublebuild;
echo ".</a>";
}
else if($bindicate == 9) {
if($session->access==BANNED){
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
}
else if($id <= 18) {
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
}
else {
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
}
echo $village->resarray['f99']+1+$loopsame+$doublebuild;
echo ".</a> <span class=\"none\">(waiting loop)</span> ";
}
}
include("upgrade.tpl");
?>
</p></div>