Example #1
0
Tki\PlayerLog::WriteLog($pdo_db, $playerinfo['ship_id'], LOG_DEFS_DESTROYED_F, "{$fighterslost}|{$sector}");
$armor_lost = $playerinfo['armor_pts'] - $playerarmor;
$fighters_lost = $playerinfo['ship_fighters'] - $playerfighters;
$energy = $playerinfo['ship_energy'];
$update4b = $db->Execute("UPDATE {$db->prefix}ships SET ship_energy = ?, ship_fighters = ship_fighters - ?, armor_pts = armor_pts - ?, torps = torps - ? WHERE ship_id = ?;", array($energy, $fighters_lost, $armor_lost, $playertorpnum, $playerinfo['ship_id']));
Tki\Db::LogDbErrors($pdo_db, $update4b, __LINE__, __FILE__);
$langvars['l_sf_lreport'] = str_replace("[armor]", $armor_lost, $langvars['l_sf_lreport']);
$langvars['l_sf_lreport'] = str_replace("[fighters]", $fighters_lost, $langvars['l_sf_lreport']);
$langvars['l_sf_lreport'] = str_replace("[torps]", $playertorpnum, $langvars['l_sf_lreport']);
echo $langvars['l_sf_lreport'] . "<br><br>";
if ($playerarmor < 1) {
    echo $langvars['l_sf_shipdestroyed'] . "<br><br>";
    Tki\PlayerLog::WriteLog($pdo_db, $playerinfo['ship_id'], LOG_DEFS_KABOOM, "{$sector}|{$playerinfo['dev_escapepod']}");
    $langvars['l_sf_sendlog2'] = str_replace("[player]", $playerinfo['character_name'], $langvars['l_sf_sendlog2']);
    $langvars['l_sf_sendlog2'] = str_replace("[sector]", $sector, $langvars['l_sf_sendlog2']);
    Tki\Sectordefense::messagedefenseOwner($pdo_db, $sector, $langvars['l_sf_sendlog2']);
    if ($playerinfo['dev_escapepod'] == 'Y') {
        $rating = round($playerinfo['rating'] / 2);
        echo $langvars['l_sf_escape'] . "<br><br>";
        $resx = $db->Execute("UPDATE {$db->prefix}ships SET hull = 0, engines = 0, power = 0, sensors = 0, computer = 0, beams = 0, torp_launchers = 0, torps = 0, armor = 0, armor_pts = 100, cloak = 0, shields = 0, sector = 0, ship_organics = 0, ship_ore = 0, ship_goods = 0, ship_energy = ?, ship_colonists = 0, ship_fighters = 100, dev_warpedit = 0, dev_genesis = 0, dev_beacon = 0, dev_emerwarp = 0, dev_escapepod = 'N', dev_fuelscoop = 'N', dev_minedeflector = 0, on_planet = 'N', rating = ?, cleared_defenses=' ', dev_lssd = 'N' WHERE ship_id = ?;", array($tkireg->start_energy, $rating, $playerinfo['ship_id']));
        Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__);
        Tki\Bounty::cancel($pdo_db, $playerinfo['ship_id']);
        $ok = 0;
        Tki\Text::gotomain($pdo_db, $lang);
        die;
    } else {
        Tki\Bounty::cancel($pdo_db, $playerinfo['ship_id']);
        Tki\Character::kill($pdo_db, $playerinfo['ship_id'], $langvars, $tkireg, false);
        $ok = 0;
        Tki\Text::gotomain($pdo_db, $lang);
        die;
Example #2
0
         $total_sector_mines = $ttl['totalmines'];
         $playerbeams = Tki\CalcLevels::beams($playerinfo['beams'], $tkireg);
         if ($playerbeams > $playerinfo['ship_energy']) {
             $playerbeams = $playerinfo['ship_energy'];
         }
         if ($playerbeams > $total_sector_mines) {
             $playerbeams = $total_sector_mines;
         }
         echo $langvars['l_md_bmines'] . " " . $playerbeams . " " . $langvars['l_mines'] . "<br>";
         $update4b = $db->Execute("UPDATE {$db->prefix}ships SET ship_energy = ship_energy - ? WHERE ship_id = ?;", array($playerbeams, $playerinfo['ship_id']));
         Tki\Mines::explode($pdo_db, $sector, $playerbeams);
         $char_name = $playerinfo['character_name'];
         $langvars['l_md_msgdownerb'] = str_replace("[sector]", $sector, $langvars['l_md_msgdownerb']);
         $langvars['l_md_msgdownerb'] = str_replace("[mines]", $playerbeams, $langvars['l_md_msgdownerb']);
         $langvars['l_md_msgdownerb'] = str_replace("[name]", $char_name, $langvars['l_md_msgdownerb']);
         Tki\Sectordefense::messagedefenseOwner($pdo_db, $sector, $langvars['l_md_msgdownerb']);
         Tki\Text::gotomain($pdo_db, $lang);
         die;
     }
     break;
 case 'retrieve':
     if ($defenseinfo['ship_id'] != $playerinfo['ship_id']) {
         echo $langvars['l_md_notyours'] . "<br><br>";
         Tki\Text::gotomain($pdo_db, $lang);
         Tki\Footer::display($pdo_db, $lang, $tkireg, $template);
         die;
     }
     $quantity = preg_replace('/[^0-9]/', '', $quantity);
     if ($quantity < 0) {
         $quantity = 0;
     }