Exemplo n.º 1
0
<?php

require_once get_file_loc('smr_sector.inc');
$sector = new SMR_SECTOR($player->sector_id, SmrSession::$game_id, SmrSession::$old_account_id);
require_once get_file_loc("smr_port.inc");
require_once get_file_loc("smr_battle.inc");
$port = new SMR_PORT($player->sector_id, $player->game_id);
if ($player->newbie_turns > 0) {
    create_error("You are under newbie protection!");
}
if ($player->is_fed_protected()) {
    create_error("You are under federal protection! That wouldn't be fair.");
}
if (!$sector->has_port()) {
    create_error("There is no port in that sector!");
}
// check if he got enough turns
if ($player->get_info('turns') < 3) {
    create_error("You do not have enough turns to attack this port!");
}
$db->query("SELECT * FROM ship_has_weapon NATURAL JOIN weapon_type " . "WHERE account_id = {$player->account_id} AND " . "game_id = {$player->game_id} " . "ORDER BY order_id");
if (!$db->next_record()) {
    //do we have drones to attack?
    $db->query("SELECT * FROM ship_has_hardware WHERE hardware_type_id = HARDWARE_COMBAT AND account_id = {$player->account_id} AND game_id = {$player->game_id}");
    if (!$db->next_record()) {
        create_error("What are you gonna do? Insult it to death?");
    }
}
//set the attack start time
$time = time();
//only 1 shot per 2 seconds (stop double port raids)
Exemplo n.º 2
0
print "<p>";
print "<table cellspacing=\"0\" cellpadding=\"3\" border=\"0\" class=\"standard\">";
print "<tr>";
print "<td>Planet</td>";
print "<td>";
if ($target_sector->has_planet()) {
    print "Yes";
} else {
    print "No";
}
print "</td>";
print "</tr>";
print "<tr>";
print "<td>Port</td>";
print "<td>";
if ($target_sector->has_port()) {
    print "Yes";
} else {
    print "No";
}
print "</td>";
print "</tr>";
print "<tr>";
print "<td>Location</td>";
print "<td>";
if ($target_sector->has_location()) {
    print "Yes";
} else {
    print "No";
}
print "</td>";