Ejemplo n.º 1
0
        if ($rand <= 5) {
            //we downgraded it
            $port->downgrade();
            // Ports do NOT set new defences when they are downgraded
            // Their defences will be reset when the port resets
            if ($display == "yes") {
                $damage_msg[] = "The port has lost a level";
            }
            //only one per shot
            $i += $chances + 1;
        } else {
            $i += 1;
        }
    }
    // update local mpa with new port infos
    $sector->mark_visited();
}
$attacker[] = $damage_msg;
// update port
$port->update();
if ($port->shields == 0 && $port->drones == 0 && $port->armor == 0) {
    // Trigger gets an alignment change and a bounty if port is taken
    $db->query("SELECT * FROM bounty WHERE game_id = {$player->game_id} AND account_id = {$player->account_id} " . "AND claimer_id = 0 AND type = 'HQ'");
    $amount = $curr_attacker->experience * $port->level;
    if ($db->next_record()) {
        //include interest
        $bounty_id = $db->f("bounty_id");
        $curr_amount = $db->f("amount");
        $new_amount = $curr_amount + $amount;
        $db->query("UPDATE bounty SET amount = {$new_amount}, time = {$time} WHERE game_id = {$player->game_id} AND bounty_id = {$bounty_id}");
    } else {