big update

This commit is contained in:
unknown
2012-07-03 05:27:14 +03:00
parent 8de9d72021
commit b578e44608
49 changed files with 1001 additions and 228 deletions
+77
View File
@@ -150,6 +150,83 @@ if($units_incoming > 0 or $settlers_incoming > 0){
echo "</tbody></table>";
}
}
if(count($database->getPrisoners3($village->wid)) > 0) {
echo "<h4>Prisoners</h4>";
foreach($database->getPrisoners3($village->wid) as $prisoners) {
$colspan = 10+$prisoners['t11'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".$database->getVillageField($prisoners['wref'],"name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">prisoners in ".$database->getVillageField($prisoners['wref'],"name")."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($prisoners['t11']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=1;$i<=10;$i++) {
if($prisoners['t'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $prisoners['t'.$i]."</td>";
}
if($prisoners['t11']!=0){
echo "<td>".$prisoners['t11']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($prisoners,$tribe,0,1)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>Kill</a></div></td></tr>";
echo "</tbody></table>";
}
}
if(count($database->getPrisoners($village->wid)) > 0) {
echo "<h4>Prisoners</h4>";
foreach($database->getPrisoners($village->wid) as $prisoners) {
$colspan = 10+$prisoners['t11'];
$colspan2 = 11+$prisoners['t11'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".$database->getVillageField($prisoners['from'],"name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">prisoners from ".$database->getVillageField($prisoners['from'],"name")."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($prisoners['t11']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=1;$i<=10;$i++) {
if($prisoners['t'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $prisoners['t'.$i]."</td>";
}
if($prisoners['t11']!=0){
echo "<td>".$prisoners['t11']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><td colspan=\"11\"><div class='sup'><img class=\"r6\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" /></div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>Send Back</a></div></td></tr>";
echo "</tbody></table>";
}
}
?>
<?php
+5 -1
View File
@@ -59,7 +59,11 @@ if ($units[$y]['sort_type']==3){
echo $units[$y]['t'.$i]."</td>";
}
}}else{
if($totalunits > $building->getTypeLevel(16)){
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,3,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,3,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,3,2,0));
$total_artefact = $artefact + $artefact1 + $artefact2;
if($totalunits > $building->getTypeLevel(16) && $total_artefact == 0){
echo "<td class=\"none\">?</td>";
}else{
if($units[$y]['t'.$i] == 0) {
+7 -7
View File
@@ -1,10 +1,9 @@
<?php
$artefact = $database->getOwnArtefactInfo($village->wid);
$artefact1 = $database->getOwnArtefactInfo2($village->wid);
$result = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = " . $village->wid . ""));
$wref = $village->wid;
$coor = $database->getCoor($wref);
$coor2= $database->getCoor($artefact['vref']);
function getDistance($coorx1, $coory1, $coorx2, $coory2) {
$max = 2 * WORLD_MAX + 1;
$x1 = intval($coorx1);
@@ -33,12 +32,13 @@
</thead>
<tbody>
<tr>
<?php
if($result == 0) {
echo '<td colspan="4" class="none">You do not own any artefacts.</td>';
echo '<tr><td colspan="4" class="none">You do not own any artefacts.</td></tr>';
} else {
foreach($artefact1 as $artefact){
$coor2 = $database->getCoor($artefact['vref']);
if($artefact['size'] == 1) {
$reqlvl = 10;
$effect = "village";
@@ -46,7 +46,7 @@
$reqlvl = 20;
$effect = "account";
}
echo '<td class="icon"><img class="artefact_icon_' . $artefact['type'] . '" src="img/x.gif"></td>';
echo '<tr><td class="icon"><img class="artefact_icon_' . $artefact['type'] . '" src="img/x.gif"></td>';
echo '<td class="nam">
<a href="build.php?id=' . $id . '&show='.$artefact['id'].'">' . $artefact['name'] . '</a> <span class="bon">' . $artefact['effect'] . '</span>
<div class="info">
@@ -54,11 +54,11 @@
</div>
</td>';
echo '<td class="pla"><a href="karte.php?d=' . $artefact['vref'] . '&c=' . $generator->getMapCheck($artefact['vref']) . '">' . $database->getVillageField($artefact['vref'], "name") . '</a></td>';
echo '<td class="dist">' . date("d/m/Y H:i", $artefact['conquered']) . '</td>';
echo '<td class="dist">' . date("d/m/Y H:i", $artefact['conquered']) . '</td></tr>';
}
}
?>
</tr>
</tbody>
</table>
+10 -1
View File
@@ -135,10 +135,19 @@ if (isset($_POST['name'])) {
<td colspan="5" class="empty"></td>
</tr>
<tr>
<?php if($hero_info['experience'] < 495000){ ?>
<th title="until the next level">Experience:</th>
<td class="val"><?php echo (int) (($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100) ?>%</td>
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100*2 ?>px;" alt="<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>%" title="<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>%" /></td> <td class="up"></td>
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100*2 ?>px;" alt="<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>%" title="<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>%" /></td>
<td class="up"></td>
<td class="rem"><?php echo $hero_info['points']; ?></td>
<?php }else{ ?>
<th title="until the next level">Experience:</th>
<td class="val">100%</td>
<td class="xp"><img class="bar" src="img/x.gif" style="width:200px;" alt="100%" title="100%" /></td>
<td class="up"></td>
<td class="rem"><?php echo $hero_info['points']; ?></td>
<?php } ?>
</tr>
</tbody>
</table>
-12
View File
@@ -42,15 +42,6 @@ $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));
$wwvillages = $database->getVillagesID($session->uid);
foreach($wwvillages as $wwvillage){
$plan = count($database->getOwnArtefactInfoByType2($wwvillage,11));
if($plan > 0){
$wwbuildingplan += 1;
}
}
foreach ($database->getJobs($_SESSION['wid']) as $bdata) {
$UnderConstruction = strtolower(str_replace(array(" ","'"),"",$building->procResType($bdata['type'])));
@@ -61,9 +52,6 @@ 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 && $wwbuildingplan > 0){
include("avaliable/ww.tpl");
}
if($mainbuilding == 0 && $id != 39 && $id != 40) {
include("avaliable/mainbuilding.tpl");
}