Esempio n. 1
0
}
$servercount = getServerNumber();
for ($sid = 1; $sid < $servercount + 1; $sid++) {
    $query = "SELECT id FROM fleet{$sid} WHERE probes>0";
    $result = @mysql_query($query);
    while ($row = mysql_fetch_array($result)) {
        //Get the probe fleet id
        $fid = $row[id];
        //Make sure time has elapsed and the person doesnt own the planet already
        $pid = getFleetStat(probes, $sid, $fid);
        if (timeLeft(getFleetStat(probetime, $sid, $fid)) < 1 && getFleetStat(ownerid, $sid, $fid) != getPlanetStat(ownerid, $sid, $pid)) {
            //Check if you already have a report
            if (getFleetStat(probetime, $sid, $fid) != -1) {
                //Generate probe report
                $sentry = getPlanetStat(sentry, $sid, $pid);
                $probe = getSpyNum($sid, $fid);
                $land = getPlanetStat(landused, $sid, $pid) - getPlanetStat(land, $sid, $pid);
                if ($probe < $sentry) {
                    $report = 'Your probes could not successfully penetrate the planet\'s radar scrambling.';
                } else {
                    if ($probe > $sentry + 40) {
                        $rand = rand(9, 11) / 10;
                        $def = floor(calcDef($sid, $pid) * $rand);
                        $report = 'Your probe report came back very positive. They report the estimated defensive capabilities are ' . $def . '. The estimated land remaining is ' . $land . '. This report is very accurate.';
                    } else {
                        if ($probe > $sentry + 25) {
                            $rand = rand(8, 12) / 10;
                            $def = floor(calcDef($sid, $pid) * $rand);
                            $report = 'Your probe report came back positive. They report the estimated defensive capabilities are ' . $def . '.';
                        } else {
                            if ($probe > $sentry + 10) {
Esempio n. 2
0
        echo '</td><td><input type="submit" value="Send Fleet"></td></tr></table><input type="hidden" value="true" name="hide"></form>';
    }
} else {
    echo 'You have no fleets capable of reaching this planet for an attack. Someone might control a system between your fleets and this one.';
}
echo '</div>';
/***********
PRINT SPY
************/
echo '<div id="1" style="display:none">';
//Populate dropdown for spies
$first = true;
$query = "SELECT id,name,loc FROM fleet{$sid} WHERE ownerid={$id} AND destination=0 AND loc!={$pid} AND probes=0";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result)) {
    $num = getSpyNum($sid, $row[id]);
    $traveltime = travelTime($sid, $row[loc], $pid, $id);
    if ($num > 0 && $traveltime > 0) {
        if ($first) {
            $first = false;
            echo '<form name="fleetdd" action="./planetdetails.php?id=' . $pid . '" method="post">
      <table cellspacing=5 align=center>
        <tr>
          <td><select name="spy">';
        }
        echo '<option value="' . $row[id] . '">' . $row[name] . ' [' . $num . '] ' . ($traveltime - time()) . '</option>';
    }
}
if (!$first) {
    echo '</td><td><input type="submit" name="thesubmit" value="Send Probes"></td></td></table></form>';
} else {