function blackhole_show_blackhole($blackhole_id)
{
    assert(is_numeric($blackhole_id));
    global $_GALAXY;
    if (!anomaly_is_blackhole($blackhole_id)) {
        return;
    }
    $blackhole = anomaly_get_anomaly($blackhole_id);
    $race = user_get_race($blackhole['user_id']);
    $sector = sector_get_sector($blackhole['sector_id']);
    if ($race == "") {
        $race = "-";
    }
    echo "<table border=1 width=500 align=center>";
    echo "  <tr><td align=center><b><i>Sector: " . $sector['name'] . " / Anomaly: " . $blackhole['name'] . "</i></b></td></tr>";
    echo "  <tr><td>";
    echo "    <table border=0 cellpadding=0 cellspacing=0 width=100%>";
    echo "      <tr><td width=200>";
    echo "          <table border=0 cellpadding=0 cellspacing=0 width=100%>";
    echo "            <tr><th>Anomaly View</th></tr>";
    echo "            <tr><td width=100%><center><img src=\"" . $_CONFIG['URL'] . $_GALAXY['image_dir'] . "/blackholes/" . $blackhole['image'] . ".jpg\" width=150 height=150></center></td></tr>";
    echo "            <tr><th>&nbsp;</th></tr>";
    echo "          </table>";
    echo "        </td>";
    echo "        <td>&nbsp;</td>";
    echo "        <td nowrap valign=top>";
    echo "          <table border=0 cellpadding=0 cellspacing=0 width=100%>";
    echo "            <tr><td nowrap width=40%><strong>Blackhole Name        </strong></td><td nowrap width=1%><b>:</b></td>";
    if ($blackhole['unknown'] == 1) {
        form_start();
        echo "<td nowrap>";
        echo "  <input type=hidden name=aid value=" . encrypt_get_vars($blackhole_id) . ">";
        echo "  <input type=hidden name=cmd value=" . encrypt_get_vars("claim") . ">";
        echo "  <input type=text size=15 maxlength=30 name=ne_name> ";
        echo "  <input name=submit type=submit value=\"Claim\">";
        echo "</td>";
        form_end();
    } else {
        echo "<td nowrap>" . $blackhole['name'] . "</td>";
    }
    echo "             </tr>";
    echo "            <tr><td colspan=3>&nbsp;</td></tr>";
    echo "            <tr><td nowrap width=40%><strong>Caretaker          </strong></td><td nowrap width=1%><b>:</b>&nbsp;</td><td nowrap>" . $race . "</td></tr>";
    echo "            <tr><td nowrap width=40%><strong>Radius             </strong></td><td nowrap width=1%><b>:</b>&nbsp;</td><td nowrap>" . $blackhole['radius'] . " km</td></tr>";
    echo "            <tr><td nowrap width=40%><strong>Distance to sun    </strong></td><td nowrap width=1%><b>:</b>&nbsp;</td><td nowrap>" . $blackhole['distance'] . " km (10<sup>6</sup>)</td></tr>";
    echo "            <tr><td colspan=3>&nbsp;</td></tr>";
    echo "            <tr><td nowrap width=40%><strong>Fatalities         </strong></td><td nowrap width=1%><b>:</b>&nbsp;</td><td nowrap>" . blackhole_get_fatalities($blackhole_id) . " ship(s)</td></tr>";
    echo "          </table>";
    echo "        </td>";
    echo "      </tr>";
    echo "    </table>";
    echo "    </td>";
    echo "  </tr>";
    echo "</table>";
    echo "<br><br>";
}
Beispiel #2
0
function show_anomaly($anomaly_id)
{
    assert(is_numeric($anomaly_id));
    if (anomaly_is_starbase($anomaly_id)) {
        starbase_show_starbase($anomaly_id);
    }
    if (anomaly_is_planet($anomaly_id)) {
        planet_show_planet($anomaly_id);
    }
    if (anomaly_is_wormhole($anomaly_id)) {
        wormhole_show_wormhole($anomaly_id);
    }
    if (anomaly_is_blackhole($anomaly_id)) {
        blackhole_show_blackhole($anomaly_id);
    }
    if (anomaly_is_nebula($anomaly_id)) {
        nebula_show_nebula($anomaly_id);
    }
}
Beispiel #3
0
function info_get_anomaly_statistics($user_id)
{
    assert(isset($user_id));
    $minable = 0;
    $habitable = 0;
    $unusable = 0;
    $starbase = 0;
    $wormhole = 0;
    $anomalies = 0;
    $blackhole = 0;
    $result = sql_query("SELECT * FROM s_anomalies WHERE user_id = " . $user_id);
    while ($anomaly = sql_fetchrow($result)) {
        if (anomaly_is_planet($anomaly['id'])) {
            if (planet_is_habitable($anomaly['id'])) {
                $habitable++;
            } elseif (planet_is_minable($anomaly['id'])) {
                $minable++;
            } else {
                $unusable++;
            }
        } elseif (anomaly_is_wormhole($anomaly['id'])) {
            $wormhole++;
        } elseif (anomaly_is_starbase($anomaly['id'])) {
            $starbase++;
        } elseif (anomaly_is_blackhole($anomaly['id'])) {
            $blackhole++;
        } else {
            $anomalies++;
        }
    }
    return array($minable, $habitable, $unusable, $starbase, $wormhole, $blackhole, $anomalies);
}