diff --git a/Templates/Build/upgrade.tpl b/Templates/Build/upgrade.tpl index a5f9b1d0..2ee9d5bc 100644 --- a/Templates/Build/upgrade.tpl +++ b/Templates/Build/upgrade.tpl @@ -1,18 +1,20 @@ resarray['f'.$id.'t']; $bindicate = $building->canBuild($id,$bid); if($bindicate == 1) { - echo "
Building already at max level
"; + echo "Building already at max level
"; } else if($bindicate == 10) { - echo "Building max level under construction
"; + echo "Building max level under construction
"; } else if($bindicate == 11) { - echo "Building presently being demolished
"; + echo "Building presently being demolished
"; } else { - $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)); - $uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master); - $mastertime = $uprequire['time']; + $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)); + $uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master); + $mastertime = $uprequire['time']; + $_SESSION['mas'][$bid]=$bid.",".$id.",".$mastertime; ?>Costs for upgrading to level resarray['f'.$id]+1+$loopsame+$doublebuild+$master; ?>:
|
|
|
|
|
getTimeFormat($uprequire['time']);
@@ -21,116 +23,116 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
} ?>
The workers are already at work.";
- if($session->goldclub == 1){
-?>
+ echo "The workers are already at work.";
+ if($session->goldclub == 1){
+?>
gold >= 1 && $village->master == 0){
- echo "Constructing with master builder ";
- echo '(costs:
1)';
- }else{
- echo "Constructing with master builder";
- echo '(costs:
1)';
- }
- }else{
- if($session->gold >= 1 && $village->master == 0){
- echo "Constructing with master builder ";
- echo '(costs:
1)';
- }else{
- echo "Constructing with master builder";
- echo '(costs:
1)';
- }
- }
- }
+ if($id <= 18) {
+ if($session->gold >= 1 && $village->master == 0){
+ echo "checker\">Constructing with master builder ";
+ echo '(costs:
1)';
+ }else{
+ echo "Constructing with master builder";
+ echo '(costs:
1)';
+ }
+ }else{
+ if($session->gold >= 1 && $village->master == 0){
+ echo "checker\">Constructing with master builder ";
+ echo '(costs:
1)';
+ }else{
+ echo "Constructing with master builder";
+ echo '(costs:
1)';
+ }
+ }
+ }
}
else if($bindicate == 3) {
- echo "The workers are already at work. (waiting loop)";
- if($session->goldclub == 1){
-?>
+ echo "The workers are already at work. (waiting loop)";
+ if($session->goldclub == 1){
+?>
gold >= 1 && $village->master == 0){
- echo "Constructing with master builder ";
- echo '(costs:
1)';
- }else{
- echo "Constructing with master builder";
- echo '(costs:
1)';
- }
- }else{
- if($session->gold >= 1 && $village->master == 0){
- echo "Constructing with master builder ";
- echo '(costs:
1)';
- }else{
- echo "Constructing with master builder";
- echo '(costs:
1)';
- }
- }
- }
+ if($id <= 18) {
+ if($session->gold >= 1 && $village->master == 0){
+ echo "checker\">Constructing with master builder ";
+ echo '(costs:
1)';
+ }else{
+ echo "Constructing with master builder";
+ echo '(costs:
1)';
+ }
+ }else{
+ if($session->gold >= 1 && $village->master == 0){
+ echo "checker\">Constructing with master builder ";
+ echo '(costs:
1)';
+ }else{
+ echo "Constructing with master builder";
+ echo '(costs:
1)';
+ }
+ }
+ }
}
else if($bindicate == 4) {
- echo "Not enough food. Expand cropland.";
+ echo "Not enough food. Expand cropland.";
}
else if($bindicate == 5) {
- echo "Upgrade Warehouse.";
+ echo "Upgrade Warehouse.";
}
else if($bindicate == 6) {
- echo "Upgrade Granary.";
+ echo "Upgrade Granary.";
}
else if($bindicate == 7) {
- if($village->allcrop - $village->pop - $automation->getUpkeep($village->unitall, 0) > 0){
- $neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
- echo "Enough resources ".$neededtime[0]." at ".$neededtime[1]."";
- }else{
- echo "Your crop production is negative, you will never get the required resources.";
- }
- if($session->goldclub == 1){
-?>
+ if($village->allcrop - $village->pop - $automation->getUpkeep($village->unitall, 0) > 0){
+ $neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
+ echo "Enough resources ".$neededtime[0]." at ".$neededtime[1]."";
+ }else{
+ echo "Your crop production is negative, you will never get the required resources.";
+ }
+ if($session->goldclub == 1){
+?>
gold >= 1 && $village->master == 0){
- echo "Constructing with master builder ";
- echo '(costs:
1)';
- }else{
- echo "Constructing with master builder";
- echo '(costs:
1)';
- }
- }else{
- if($session->gold >= 1 && $village->master == 0){
- echo "Constructing with master builder ";
- echo '(costs:
1)';
- }else{
- echo "Constructing with master builder";
- echo '(costs:
1)';
- }
- }
- }
+ if($id <= 18) {
+ if($session->gold >= 1 && $village->master == 0){
+ echo "checker\">Constructing with master builder ";
+ echo '(costs:
1)';
+ }else{
+ echo "Constructing with master builder";
+ echo '(costs:
1)';
+ }
+ }else{
+ if($session->gold >= 1 && $village->master == 0){
+ echo "checker\">Constructing with master builder ";
+ echo '(costs:
1)';
+ }else{
+ echo "Constructing with master builder";
+ echo '(costs:
1)';
+ }
+ }
+ }
}
else if($bindicate == 8) {
- if($session->access==BANNED){
- echo "Upgrade to level ";
- }
- else if($id <= 18) {
- echo "checker\">Upgrade to level ";
+ if($session->access==BANNED){
+ echo "Upgrade to level ";
+ }
+ else if($id <= 18) {
+ echo "checker\">Upgrade to level ";
}
else {
echo "checker\">Upgrade to level ";
}
- echo $village->resarray['f'.$id]+1;
- echo ".";
- }
+ echo $village->resarray['f'.$id]+1;
+ echo ".";
+ }
else if($bindicate == 9) {
- if($session->access==BANNED){
- echo "Upgrade to level ";
- }
- else if($id <= 18) {
- echo "checker\">Upgrade to level ";
+ if($session->access==BANNED){
+ echo "Upgrade to level ";
+ }
+ else if($id <= 18) {
+ echo "checker\">Upgrade to level ";
}
else {
echo "checker\">Upgrade to level ";
}
- echo $village->resarray['f'.$id]+($loopsame > 0 ? 2:1);
- echo ". (waiting loop) ";
+ echo $village->resarray['f'.$id]+($loopsame > 0 ? 2:1);
+ echo ". (waiting loop) ";
}
}