Esempio n. 1
0
        $upkeep = getUpkeepCost($x, $pid);
        //Check to see if the upkeep can be paid
        $statsArray = array(1 => "steel", 0 => "cylite", 2 => "plexi");
        if ($taxesPaid) {
            //Pay the upkeep
            for ($y = 0; $y < count($statsArray); $y++) {
                $current = getPlanetStat($statsArray[$y], $x, $pid);
                $current = $current - getUpkeepCost($x, $pid);
                setPlanetStat($statsArray[$y], $current, $x, $pid);
            }
            echo 'Taxes paid for ' . $pid . '<br>';
            //Add civs
            $current = getPlanetStat(civs, $x, $pid);
            $current = $current + civProductionRate($x, $pid);
            echo 'New civs ' . $current;
            if ($current > getPlanetStat(maxcivs, $x, $pid)) {
                $current = getPlanetStat(maxcivs, $x, $pid);
            }
            echo ' set to ' . $current . '<br>';
            setPlanetStat(civs, $current, $x, $pid);
            //Add each resourceproductionrate to each resource
            for ($y = 0; $y < count($statsArray); $y++) {
                $current = getPlanetStat($statsArray[$y], $x, $pid);
                $current = $current + resourceProductionRate($statsArray[$y], $x, $pid);
                echo resourceProductionRate($statsArray[$y], $x, $pid);
                setPlanetStat($statsArray[$y], $current, $x, $pid);
                echo $current . ' is new resource<br>';
            }
        }
    }
}
Esempio n. 2
0
  <br>
  <br>
  <table cellspacing=5>
    <tr>
      <td></td>
      <td><b>Civs</b></td>
      <td><b>Elinarium</b></td>
      <td><b>Cylite</b></td>
      <td><b>Plexi</b></td>
      <td><b>RP</b></td>
    </tr><tr>
      <td></td>
      <td>' . civProductionRate($sid, $pid) . '</td>
      <td>' . resourceProductionRate(steel, $sid, $pid) . '</td>
      <td>' . resourceProductionRate(cylite, $sid, $pid) . '</td>
      <td>' . resourceProductionRate(plexi, $sid, $pid) . '</td>
      <td>' . getPlanetStat(researchmod, $sid, $pid) . '</td>
  </table>
  <br>';
/******
PRINT MENU
********/
echo '
<script language="Javascript">
var timer=0;

//Get Merchant text
function getText(){
  var ajaxRequest;
  try{
    // Opera 8.0+, Firefox, Safari
Esempio n. 3
0
      <td><b>Elin [/hr]</b></td>
      <td><b>Cylite [/hr]</b></yd>
      <td><b>Plexi [/hr]</b></td>
      <td><b>Build</b></td>
    </tr>';
$query = "SELECT id,civs,maxcivs,name,steel,plexi,cylite,land,landused,constructionid,lastshipq,land,landused FROM planets{$sid} WHERE ownerid={$id} ORDER BY z ASC";
$result = @mysql_query($query);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    $pid = $row[id];
    echo '<tr>
      <td><a href="./name.php?id=' . $row[id] . '">' . $row[name] . '</a></td>
      <td>' . $row[land] . '/' . $row[landused] . '</td>
      <td>' . $row[civs] . '/' . $row[maxcivs] . ' [' . civProductionRate($sid, $pid) . ']</td>
      <td>' . $row[steel] . ' [' . resourceProductionRate(steel, $sid, $pid) . ']</td>
      <td>' . $row[cylite] . ' [' . resourceProductionRate(cylite, $sid, $pid) . ']</td>
      <td>' . $row[plexi] . ' [' . resourceProductionRate(plexi, $sid, $pid) . ']</td>
      <td><a href="./build.php?id=' . $row[id] . '">Build</a></td>
    </tr>';
}
echo '</table></div>';
/***********
BUILDINGS TAB
************/
echo '<div id="2" style="display:none"><table cellspacing=5 align="center">
    <tr>
      <td><b>Name</b></td>
      <td><b>Factory</b></td>
      <td><b>Refinery</b></td>
      <td><b>Distillery</b></td>
      <td><b>Barracks</b></yd>
      <td><b>Academy</b></td>