Enable and disable display of oases

+Now during the installation (or after installation in the admin panel) you can enable or disable oasis display for villages in the player profile.

NOTE: To play this version of the game, you need to reinstall the server OR you can simply add these lines of code into your file:
GameEngine/config.php

/////////////////////////////////////////////////
//   ****  NEW MECHANICS AND FUNCTIONS  ****   //
/////////////////////////////////////////////////
define("NEW_FUNCTIONS_OASIS", True);

GameEngine/Admin/Modsconstant_format.tpl

/////////////////////////////////////////////////
//   ****  NEW MECHANICS AND FUNCTIONS  ****   //
/////////////////////////////////////////////////
define("NEW_FUNCTIONS_OASIS", %NEW_FUNCTIONS_OASIS%);

NOTICE 2: pay special attention to the fact that these are two different records !!! If the records are entered incorrectly, you will receive a non-working code!
This commit is contained in:
Vladyslav
2018-06-20 16:57:13 +03:00
parent 7747a301be
commit 11ae61c013
13 changed files with 306 additions and 60 deletions
+80 -59
View File
@@ -152,64 +152,85 @@ if($displayarray['vac_mode'] == 1) echo "<tr><th colspan='2'><font color='Maroon
</td>
</tr>
</tbody>
</table><table cellpadding="1" cellspacing="1" id="villages">
<thead>
<tr>
<th colspan="4">Villages</th>
</tr>
<tr>
<td>Name</td>
<td>Oasis</td>
<td>Inhabitants</td>
<td>Coordinates</td>
</tr>
</thead><tbody>
<?php
foreach($varray as $vil) {
$coor = $database->getCoor($vil['wref']);
echo "<tr><td class=\"nam\"><a href=\"karte.php?d=".$vil['wref']."&amp;c=".$generator->getMapCheck($vil['wref'])."\">".$vil['name']."</a>";
if($vil['capital'] == 1) echo "<span class=\"none3\"> (capital)</span>";
echo "<td class=\"hab\">";
// OASIS PART - must to be activated from install part
$oases = $database->getOasis($vil['wref']);
foreach ($oases as $oasis){
switch ($oasis['type']) {
case 1:
case 2:
echo "<img class='r100' src='img/x.gif' title='+25% Lumber'> ";
break;
case 3:
echo "<img class='r200' src='img/x.gif' title='+25% Lumber +25% Crop'> ";
break;
case 4:
case 5:
echo "<img class='r400' src='img/x.gif' title='+25% Clay'> ";
break;
case 6:
echo "<img class='r500' src='img/x.gif' title='+25% Clay +25% Crop'> ";
break;
case 7:
case 8:
echo "<img class='r700' src='img/x.gif' title='+25% Iron'> ";
break;
case 9:
echo "<img class='r800' src='img/x.gif' title='+25% Iron +25% Crop'> ";
break;
case 10:
case 11:
echo "<img class='r1000' src='img/x.gif' title='+25% Crop'> ";
break;
case 12:
echo "<img class='r1100' src='img/x.gif' title='+50% Crop'> ";
break;
}
</table>
<?php
if(NEW_FUNCTIONS_OASIS == false) {
echo "<table cellpadding=\"1\" cellspacing=\"1\" id=\"villages\">
<thead>
<tr>
<th colspan=\"3\">Villages</th>
</tr>
<tr>
<td>Name</td>
<td>Inhabitants</td>
<td>Coordinates</td>
</tr>
</thead>
<tbody>";
foreach($varray as $vil) {
$coor = $database->getCoor($vil['wref']);
echo "<tr><td class=\"nam\"><a href=\"karte.php?d=".$vil['wref']."&amp;c=".$generator->getMapCheck($vil['wref'])."\">".$vil['name']."</a>";
if($vil['capital'] == 1) echo "<span class=\"none3\"> (capital)</span>";
echo "<td class=\"hab\">".$vil['pop']."</td><td class=\"aligned_coords\">";
echo "<div class=\"cox\">(".$coor['x']."</div><div class=\"pi\">|</div><div class=\"coy\">".$coor['y'].")</div></td></tr>";
}
echo "</td>";
echo "<td class=\"hab\">".$vil['pop']."</td><td class=\"aligned_coords\">";
echo "<div class=\"cox\">(".$coor['x']."</div><div class=\"pi\">|</div><div class=\"coy\">".$coor['y'].")</div></td></tr>";
echo "</tbody></table>";
} else {
echo "<table cellpadding=\"1\" cellspacing=\"1\" id=\"villages\">
<thead>
<tr>
<th colspan=\"4\">Villages</th>
</tr>
<tr>
<td>Name</td>
<td>Oasis</td>
<td>Inhabitants</td>
<td>Coordinates</td>
</tr>
</thead>
<tbody>";
foreach($varray as $vil) {
$coor = $database->getCoor($vil['wref']);
echo "<tr><td class=\"nam\"><a href=\"karte.php?d=".$vil['wref']."&amp;c=".$generator->getMapCheck($vil['wref'])."\">".$vil['name']."</a>";
if($vil['capital'] == 1) echo "<span class=\"none3\"> (capital)</span>";
echo "<td class=\"hab\">";
$oases = $database->getOasis($vil['wref']);
foreach ($oases as $oasis) {
switch ($oasis['type']) {
case 1:
case 2:
echo "<img class='r100' src='img/x.gif' title='+25% Lumber'> ";
break;
case 3:
echo "<img class='r200' src='img/x.gif' title='+25% Lumber +25% Crop'> ";
break;
case 4:
case 5:
echo "<img class='r400' src='img/x.gif' title='+25% Clay'> ";
break;
case 6:
echo "<img class='r500' src='img/x.gif' title='+25% Clay +25% Crop'> ";
break;
case 7:
case 8:
echo "<img class='r700' src='img/x.gif' title='+25% Iron'> ";
break;
case 9:
echo "<img class='r800' src='img/x.gif' title='+25% Iron +25% Crop'> ";
break;
case 10:
case 11:
echo "<img class='r1000' src='img/x.gif' title='+25% Crop'> ";
break;
case 12:
echo "<img class='r1100' src='img/x.gif' title='+50% Crop'> ";
break;
}
}
echo "</td>";
echo "<td class=\"hab\">".$vil['pop']."</td><td class=\"aligned_coords\">";
echo "<div class=\"cox\">(".$coor['x']."</div><div class=\"pi\">|</div><div class=\"coy\">".$coor['y'].")</div></td></tr>";
}
echo "</tbody></table>";
}
?>
</tbody></table>
?>