示例#1
0
文件: scan.php 项目: thekabal/tki
             $resy = $hasfedbounty->fields;
             if ($resy['btytotal'] > 0) {
                 $btyamount = $resy['btytotal'];
                 echo $langvars['l_scan_fedbounty'] . "<br>";
             }
         }
     }
 }
 // Player will get a Federation Bounty on themselves if they attack a player who's score is less than bounty_ratio of
 // themselves. If the target has a Federation Bounty, they can attack without attracting a bounty on themselves.
 if ($btyamount == 0 && ($targetscore / $playerscore < $bounty_ratio || $targetinfo['turns_used'] < $bounty_minturns)) {
     echo $langvars['l_by_fedbounty'] . "<br><br>";
 } else {
     echo $langvars['l_by_nofedbounty'] . "<br><br>";
 }
 $sc_error = Tki\Scan::error($playerinfo['sensors'], $targetinfo['cloak'], $scan_error_factor);
 echo $langvars['l_scan_ron'] . " " . $targetinfo['ship_name'] . ", " . $langvars['l_scan_capt'] . " " . $targetinfo['character_name'] . "<br><br>";
 echo "<strong>" . $langvars['l_ship_levels'] . ":</strong><br><br>";
 echo "<table  width=\"\" border=\"0\" cellspacing=\"0\" cellpadding=\"4\">";
 echo "<tr><td>" . $langvars['l_hull'] . ":</td>";
 $roll = random_int(1, 100);
 if ($roll < $success) {
     $sc_hull = round($targetinfo['hull'] * $sc_error / 100);
     echo "<td>{$sc_hull}</td></tr>";
 } else {
     echo "<td>???</td></tr>";
 }
 echo "<tr><td>" . $langvars['l_engines'] . ":</td>";
 $roll = random_int(1, 100);
 if ($roll < $success) {
     $sc_engines = round($targetinfo['engines'] * $sc_error / 100);
示例#2
0
文件: planet.php 项目: thekabal/tki
         $sc_shields = number_format(round($ownerinfo['shields'] * $sc_error / 100), 0, $langvars['local_number_dec_point'], $langvars['local_number_thousands_sep']);
         echo "<td>{$sc_shields}</td></tr>";
     } else {
         echo "<td>???</td></tr>";
     }
     echo "</table><br>";
     // $roll=random_int(1, 100);
     // if ($ownerinfo[sector] == $playerinfo[sector] && $ownerinfo[on_planet] == 'Y' && $roll < $success)
     // {
     // echo "<strong>" . $ownerinfo['character_name'] . " " . $langvars['l_planet_ison'] . "</strong><br>";
     // }
     $res = $db->Execute("SELECT * FROM {$db->prefix}ships WHERE on_planet = 'Y' and planet_id = ?;", array($planet_id));
     Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__);
     while (!$res->EOF) {
         $row = $res->fields;
         $success = Tki\Scan::success($playerinfo['sensors'], $row['cloak']);
         if ($success < 5) {
             $success = 5;
         }
         if ($success > 95) {
             $success = 95;
         }
         $roll = random_int(1, 100);
         if ($roll < $success) {
             echo "<strong>" . $row['character_name'] . " " . $langvars['l_planet_ison'] . "</strong><br>";
         }
         $res->MoveNext();
     }
 }
 $update = $db->Execute("UPDATE {$db->prefix}ships SET turns = turns - 1, turns_used = turns_used + 1 WHERE ship_id = ?;", array($playerinfo['ship_id']));
 Tki\Db::LogDbErrors($pdo_db, $update, __LINE__, __FILE__);
示例#3
0
         $ok = 0;
     } else {
         $tollstring = number_format($fighterstoll, 0, $langvars['local_number_dec_point'], $langvars['local_number_thousands_sep']);
         $langvars['l_chf_youpaidsometoll'] = str_replace("[chf_tollstring]", $tollstring, $langvars['l_chf_youpaidsometoll']);
         echo $langvars['l_chf_youpaidsometoll'] . "<br>";
         $resx = $db->Execute("UPDATE {$db->prefix}ships SET credits=credits - {$fighterstoll} WHERE ship_id = ?;", array($playerinfo['ship_id']));
         Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__);
         Tki\Toll::distribute($pdo_db, $sector, $fighterstoll, $total_sector_fighters);
         Tki\PlayerLog::WriteLog($pdo_db, $playerinfo['ship_id'], LOG_TOLL_PAID, "{$tollstring}|{$sector}");
         $ok = 1;
     }
     break;
 case "sneak":
     $resx = $db->Execute("UPDATE {$db->prefix}ships SET cleared_defenses = ' ' WHERE ship_id = ?;", array($playerinfo['ship_id']));
     Tki\Db::LogDbErrors($pdo_db, $resx, __LINE__, __FILE__);
     $success = Tki\Scan::success($fighters_owner['sensors'], $playerinfo['cloak']);
     if ($success < 5) {
         $success = 5;
     }
     if ($success > 95) {
         $success = 95;
     }
     $roll = random_int(1, 100);
     if ($roll < $success) {
         // Sector defenses detect incoming ship
         echo "<h1>" . $title . "</h1>\n";
         echo $langvars['l_chf_thefightersdetectyou'] . "<br>";
         include_once './sector_fighters.php';
         break;
     } else {
         // Sector defenses don't detect incoming ship