big update

This commit is contained in:
unknown
2012-04-27 12:20:13 +03:00
parent 0b01b8cf2e
commit d0c55c4c3b
27 changed files with 578 additions and 187 deletions
+103 -14
View File
@@ -17,24 +17,46 @@ if ($units[$y]['sort_type']==3){
} else if ($units[$y]['attack_type']==4){
$actionType = "Raid on ";
}
$reinfowner = $database->getVillageField($units[$y]['from'],"owner");
if($units[$y]['attack_type'] != 1){
if($units[$y]['from'] != 0){
if($units[$y]['t11'] != 0 && $reinfowner == $session->uid) {
$colspan = 11;
}else{
$colspan = 10;
}
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$units[$y]['from']."&c=".$generator->getMapCheck($units[$y]['from'])."\">".$database->getVillageField($units[$y]['from'],"name")."</a></td>
<td colspan=\"10\">";
<td colspan=\"$colspan\">";
echo "<a href=\"spieler.php?uid=".$database->getVillageField($units[$y]['from'],"owner")."\">".$database->getUserField($database->getVillageField($units[$y]['from'],"owner"),"username",0)."'s troops</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($units[$y]['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
$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($units[$y]['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=$start;$i<=($end);$i++) {
for($i=1;$i<=$colspan;$i++) {
$totalunits = $units[$y]['t1']+$units[$y]['t2']+$units[$y]['t3']+$units[$y]['t4']+$units[$y]['t5']+$units[$y]['t6']+$units[$y]['t7']+$units[$y]['t8']+$units[$y]['t9']+$units[$y]['t10']+$units[$y]['t11'];
if($units[$y]['attack_type'] == 2){
if($reinfowner != $session->uid){
echo "<td class=\"none\">?</td>";
}else{
if($units[$y]['t'.$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>";
echo $units[$y]['t'.$i]."</td>";
}
}}else{
if($totalunits > $building->getTypeLevel(16)){
echo "<td class=\"none\">?</td>";
}else{
@@ -45,6 +67,7 @@ if ($units[$y]['sort_type']==3){
}
}
}
}
echo "</tr></tbody>";
echo '
<tbody class="infos">
@@ -66,7 +89,7 @@ if ($units[$y]['sort_type']==3){
}else{
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a>village of the elders</a></td>
<td colspan=\"10\">";
<td colspan=\"$colspan\">";
echo "<a>Taskmaster's troops</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $session->tribe;
@@ -77,7 +100,7 @@ if ($units[$y]['sort_type']==3){
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=$start;$i<=($end);$i++) {
for($i=1;$i<=10;$i++) {
echo "<td class=\"none\">?</td>";
}
echo "</tr></tbody>";
@@ -113,6 +136,7 @@ if ($units[$y]['sort_type']==3){
$to = $database->getMInfo($units[$y]['vref']);
if($units[$y]['from'] != 0){
?>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
@@ -138,7 +162,6 @@ $to = $database->getMInfo($units[$y]['vref']);
<tr><th>Troops</th>
<?php
for($i=1;$i<($units[$y]['t11'] != 0?12:11);$i++) {
if($units[$y]['attack_type']!=2 or $units[$y]['from']==$village->wid){
if($units[$y]['t'.$i] == 0) {
echo "<td class=\"none\">0</td>";
}
@@ -146,19 +169,16 @@ $to = $database->getMInfo($units[$y]['vref']);
echo "<td>";
echo $units[$y]['t'.$i]."</td>";
}
}else{
echo "<td class=\"none\">?</td>";
}
}
?>
</tr>
<?php
if($units[$y]['attack_type']!=2 and $units[$y]['attack_type']!=1){?>
$totalres = $res['wood']+$res['clay']+$res['iron']+$res['crop'];
if($units[$y]['attack_type']!=2 and $units[$y]['attack_type']!=1 and $totalres != ""){?>
<tr><th>Bounty</th>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
<?php
$totalres = $res['wood']+$res['clay']+$res['iron']+$res['crop'];
$totalcarry = $units[$y]['t1']*${'u'.$start.''}['cap']+$units[$y]['t2']*${'u'.($start+1).''}['cap']+$units[$y]['t3']*${'u'.($start+2).''}['cap']+$units[$y]['t4']*${'u'.($start+3).''}['cap']+$units[$y]['t5']*${'u'.($start+4).''}['cap']+$units[$y]['t6']*${'u'.($start+5).''}['cap']+$units[$y]['t7']*${'u'.($start+6).''}['cap']+$units[$y]['t8']*${'u'.($start+7).''}['cap']+$units[$y]['t9']*${'u'.($start+8).''}['cap']+$units[$y]['t10']*${'u'.($start+9).''}['cap'];
echo "<div class=\"in small\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$res['wood']."<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$res['clay']."<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$res['iron']."<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$res['crop']."</div>";
echo "<div class=\"in small\"><img class=\"car\" src=\"gpack/travian_default/img/a/car.gif\" alt=\"carry\" title=\"carry\"/>".$totalres."/".$totalcarry."</div>";
@@ -184,9 +204,78 @@ $to = $database->getMInfo($units[$y]['vref']);
</tr>
</tbody>
</table>
<?php
<?php
}else{
?>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td class="role"><a>?</a></td>
<td colspan="<?php if($units[$y]['t11'] != 0) {echo"11";}else{echo"10";}?>"><a href="karte.php?d=<?php echo $to['wref']."&c=".$generator->getMapCheck($to['wref']); ?>"><?php echo "Returning to ".$to['name']; ?></a></td>
</tr>
</thead>
<tbody class="units">
<?php
$tribe = $session->tribe;
$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($units[$y]['t11'] != 0) {
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
?>
</tr>
<tr><th>Troops</th>
<?php
for($i=1;$i<($units[$y]['t11'] != 0?12:11);$i++) {
if($units[$y]['t'.$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>";
echo $units[$y]['t'.$i]."</td>";
}
}
?>
</tr>
<?php
$totalres = $res['wood']+$res['clay']+$res['iron']+$res['crop'];
if($units[$y]['attack_type']!=2 and $units[$y]['attack_type']!=1 and $totalres != ""){?>
<tr><th>Bounty</th>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
<?php
$totalcarry = $units[$y]['t1']*${'u'.$start.''}['cap']+$units[$y]['t2']*${'u'.($start+1).''}['cap']+$units[$y]['t3']*${'u'.($start+2).''}['cap']+$units[$y]['t4']*${'u'.($start+3).''}['cap']+$units[$y]['t5']*${'u'.($start+4).''}['cap']+$units[$y]['t6']*${'u'.($start+5).''}['cap']+$units[$y]['t7']*${'u'.($start+6).''}['cap']+$units[$y]['t8']*${'u'.($start+7).''}['cap']+$units[$y]['t9']*${'u'.($start+8).''}['cap']+$units[$y]['t10']*${'u'.($start+9).''}['cap'];
echo "<div class=\"in small\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$res['wood']."<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$res['clay']."<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$res['iron']."<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$res['crop']."</div>";
echo "<div class=\"in small\"><img class=\"car\" src=\"gpack/travian_default/img/a/car.gif\" alt=\"carry\" title=\"carry\"/>".$totalres."/".$totalcarry."</div>";
?>
</tr>
<?php } ?>
<tbody class="infos">
<tr>
<th>Arrival</th>
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
<?php
echo "<div class=\"in small\"><span id=timer".$timer.">".$generator->getTimeFormat($units[$y]['endtime']-time())."</span> h</div>";
$datetime = $generator->procMtime($units[$y]['endtime']);
echo "<div class=\"at small\">";
if($datetime[0] != "today") {
echo "on ".$datetime[0]." ";
}
echo "at ".$datetime[1]."</div>";
?>
</div>
</td>
</tr>
</tbody>
</table>
<?php
}
}
}
+9 -4
View File
@@ -166,14 +166,16 @@ function testSum() {
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<input type="hidden" name="ft" value="mk3" />
<input type="hidden" name="t" value="3" />
<?php
$wwvillage = $database->getResourceLevel($village->wid);
if($wwvillage['f99t']!=40){
?>
<table id="npc" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="5">NPC Trade</th>
</tr>
<tr>
<tr>
<td class="all">
<a href="javascript:fillup(0);"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /></a>
<span id="org0"><?php echo floor($village->awood); ?></span>
@@ -255,5 +257,8 @@ function testSum() {
testSum();
</script>
<?php } ?>
<?php }else{ ?>
</br></br>
<?php echo "You can't use NPC trade in WW village.";
}} ?>
</div>
-156
View File
@@ -1,156 +0,0 @@
<?php
$to = $database->getVillage($enforce['from']);
$fromcoor = $database->getCoor($enforce['from']);
$tocoor = $database->getCoor($enforce['vref']);
$fromCor = array('x'=>$tocoor['x'], 'y'=>$tocoor['y']);
$toCor = array('x'=>$fromcoor['x'], 'y'=>$fromcoor['y']);
?>
<h1>Send units back</h1>
<form method="POST" name="snd" action="a2b.php">
<table id="short_info" cellpadding="1" cellspacing="1">
<tbody>
<tr>
<th>Destination:</th>
<td><a href="karte.php?d=<?php echo $generator->getBaseID($fromcoor['x'],$fromcoor['y']); ?>&amp;c=<?php echo $generator->getMapCheck($generator->getBaseID($fromcoor['x'],$fromcoor['y'])); ?>"><?php echo $to['name']; ?> (<?php echo $fromcoor['x']; ?>|<?php echo $fromcoor['y']; ?>)</a></td>
</tr>
<tr>
<th>Owner:</th>
<td><a href="spieler.php?uid=<?php echo $to['owner']; ?>"><?php echo $database->getUserField($to['owner'],'username',0); ?></a></td>
</tr>
</tbody>
</table>
<table class="troop_details" cellpadding="1" cellspacing="1">
<thead>
<tr>
<td colspan="10">Send units back to <?php echo $to['name']; ?></td>
</tr>
</thead>
</table>
<table id="troops" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="line-first column-first large"><img class="unit u41" src="img/x.gif" title="Pikeman" alt="Pikeman"> <input class="text" <?php if ($enforce['u41']<=0) {echo ' disabled="disabled"';}?> name="t1" value="<?php echo $enforce['u41']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u41'].")</span></td>";
?>
<td class="line-first large"><img class="unit u44" src="img/x.gif" title="Bird of Prey" alt="Bird of Prey"> <input class="text" <?php if ($enforce['u44']<=0) {echo ' disabled="disabled"';}?> name="t4" value="<?php echo $enforce['u44']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u44'].")</span></td>";
?>
<td class="line-first regular"><img class="unit u47" src="img/x.gif" title="War Elephant" alt="War Elephant"> <input class="text" <?php if ($enforce['u47']<=0) {echo ' disabled="disabled"';}?> name="t7" value="<?php echo $enforce['u47']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u47'].")</span></td>";
?>
<td class="line-first column-last small"><img class="unit u49" src="img/x.gif" title="Natarian Emperor" alt="Natarian Emperor"> <input class="text" <?php if ($enforce['u49']<=0) {echo ' disabled="disabled"';}?> name="t9" value="<?php echo $enforce['u49']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u49'].")</span></td>";
?>
</tr>
<tr>
<td class="column-first large"><img class="unit u42" src="img/x.gif" title="Thorned Warrior" alt="Thorned Warrior"> <input class="text" <?php if ($enforce['u42']<=0) {echo ' disabled="disabled"';}?> name="t2" value="<?php echo $enforce['u42']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u42'].")</span></td>";
?>
<td class="large"><img class="unit u45" src="img/x.gif" title="Axerider" alt="Axerider"> <input class="text" <?php if ($enforce['u45']<=0) {echo ' disabled="disabled"';}?> name="t5" value="<?php echo $enforce['u45']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u45'].")</span></td>";
?>
<td class="regular"><img class="unit u48" src="img/x.gif" title="Balista" alt="Balista"> <input class="text" <?php if ($enforce['u48']<=0) {echo ' disabled="disabled"';}?> name="t8" value="<?php echo $enforce['u48']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u48'].")</span></td>";
?>
<td class="column-last small"><img class="unit u40" src="img/x.gif" title="Settler" alt="Settler"> <input class="text" <?php if ($enforce['u50']<=0) {echo ' disabled="disabled"';}?> name="t10" value="<?php echo $enforce['u50']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u50'].")</span></td>";
?>
</tr>
<tr>
<td class="line-last column-first large"><img class="unit u43" src="img/x.gif" title="Guardsman" alt="Guardsman"> <input class="text" <?php if ($enforce['u3']<=0) {echo ' disabled="disabled"';}?> name="t3" value="<?php echo $enforce['u3']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u3'].")</span></td>";
?>
<td class="line-last large"><img class="unit u46" src="img/x.gif" title="Natarian Knight" alt="Natarian Knight"> <input class="text" <?php if ($enforce['u6']<=0) {echo ' disabled="disabled"';}?> name="t6" value="<?php echo $enforce['u6']; ?>" maxlength="6" type="text">
<?php
echo"<span class=\"none\">(".$enforce['u6'].")</span></td>";
?>
<td class="line-last regular"></td>
<td class="line-last column-last"></td> </tr>
</tbody></table>
<table class="troop_details" cellpadding="1" cellspacing="1">
<tbody class="infos">
<tr>
<th>Arrived:</th>
<?php
$att_tribe = $session->tribe;
$start = ($att_tribe-1)*10+1;
$end = ($att_tribe*10);
$speeds = array();
//find slowest unit.
for($i=$start;$i<=$end;$i++)
{
if (isset($enforce['u'.$i]))
{
if($enforce['u'.$i]!='' && $enforce['u'.$i]>0)
{
//$speeds[] = $unitspeeds[$i-2];
$speeds[] = ${'u'.$i}['speed'];
}
}
}
$time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1);
?>
<td colspan="10">
<div class="in">in <?php echo $generator->getTimeFormat($time); ?></div>
<div class="at">at <span id="tp2"> <?php echo date("H:i:s",time()+$time)?></span><span> hours</span></div>
</td>
</tr>
</tbody>
</table>
<input name="ckey" value="<?php echo $ckey; ?>" type="hidden">
<input name="id" value="39" type="hidden">
<input name="a" value="533374" type="hidden">
<input name="c" value="8" type="hidden">
<p class="btn"><input value="ok" name="s1" id="btn_ok" class="dynamic_img " src="img/x.gif" alt="OK" type="image" onclick="if (this.disabled==false) {document.getElementsByTagName('form')[0].submit();} this.disabled=true;" onLoad="this.disabled=false;"></p>
</form>
</div>
+8 -7
View File
@@ -10,13 +10,14 @@
## 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['f99']; ?></span></h1>
<h1>Wonder of the World <br /><span class="level">Level <?php echo $village->resarray['f99'];?></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']; ?>" />
@@ -29,7 +30,7 @@ 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) {
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'] < 0){
} else if ($village->resarray['f99'] > 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>';
}?>
@@ -46,9 +47,9 @@ 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']);
$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; ?>:<br />
<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>";
@@ -83,7 +84,7 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
else {
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
}
echo $village->resarray['f99']+1;
echo $village->resarray['f99']+1+$loopsame+$doublebuild;
echo ".</a>";
}
else if($bindicate == 9) {
@@ -96,7 +97,7 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
else {
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
}
echo $village->resarray['f99']+1;
echo $village->resarray['f99']+1+$loopsame+$doublebuild;
echo ".</a> <span class=\"none\">(waiting loop)</span> ";
}
}