$sell_cost = $fuel_sell; } elseif ($deal == 3) { $resource_deal = "elect"; $resource_str = $cw['electronics']; $buy_cost = $elect_buy; $sell_cost = $elect_sell; } else { echo $st[757]; } #fleet fill with a mineral if ($buy_sell == 3) { $max = "(cargo_bays-metal-fuel-elect-colon)"; if ($GAME_VARS['alternate_play_1'] == 1 && ($deal == 1 || $deal == 2)) { print_page($cw['error'], $st[758]); } else { $error_str .= fill_fleet($resource_deal, $max, $resource_str, $buy_cost, 1) . "<p />"; } #find out how much of the material the user wants to deal in. } elseif ($amount < 1) { if ($buy_sell == 0) { #buy #figure out max capacity. $def = floor($user['cash'] / $metal_buy); if ($def > $user_ship['empty_bays']) { $def = $user_ship['empty_bays']; } #not allowed to buy. if ($GAME_VARS['alternate_play_1'] == 1 && ($deal == 1 || $deal == 2)) { print_page($cw['error'], $st[758]); } elseif ($user_ship['empty_bays'] > 0) { get_var($cw['buy'] . $resource_str, $filename, sprintf($st[759], $resource_str), 'amount', $def);
//am allowed onto this page if dead but not SD. ship_status_checker(1); $rs = "<p /><a href='{$_SERVER['PHP_SELF']}'>" . $cw['return_to_earth'] . "</a>"; $out = ""; //ensure user is in system 1 before continuing. if ($user['location'] != 1) { $rs = ""; print_page($cw['not_in_sol'], $st[429]); } //load fleet with colonists. if (isset($_REQUEST['all_colon'])) { if (!avail_check(4001)) { //ensure item has been 'developed' $out .= $st[430]; } else { $out .= fill_fleet($cw['colon'], $st[431], $cw['colonists'], $GAME_VARS['cost_colonist'], 1) . "<p />"; empty_bays($user_ship); } //individual ship load } elseif (isset($_REQUEST['colonist'])) { $fill = 0; if ($user['cash'] < $user_ship['empty_bays'] * $GAME_VARS['cost_colonist']) { $fill = floor($user['cash'] / $GAME_VARS['cost_colonist']); } else { $fill = (int) $_REQUEST['amount']; } $amount = (int) $_POST['amount']; if (!avail_check(4001)) { $out .= $st[432]; } elseif ($user['turns'] < 1) { $out .= $st[433];
} else { $error_str .= $st[1064]; } } } } elseif (isset($fill_fleet)) { //fill fleet functionality if ($fill_fleet == 1) { //fighters $error_str .= fill_fleet('fighters', 'max_fighters', $cw['fighters'], $fighter_cost); } elseif ($fill_fleet == 2) { //shields $error_str .= fill_fleet('shields', 'max_shields', $cw['shields'], $shield_cost); } else { //armour $error_str .= fill_fleet('armour', 'max_armour', $cw['armour-units'], $armour_cost); } } db("select * from {$db_name}_ships where ship_id = {$user['ship_id']}"); $vaisseau_controle = dbr(1); $error_str .= $st[1065]; $error_str .= $st[1066]; $error_str .= "<table class='equip_shop'><tr><th>Type</th><th>Coût</th><th>Vaisseau (" . $vaisseau_controle['ship_name'] . ")</th><th>Flotte complète</th><th></th></tr>"; $error_str .= "<tr><td>" . $cw['fighters'] . "</td><td> <b>{$fighter_cost}</b> / unité</td><td><center><a href='{$filename}?buy=1'>Equiper vaisseau</center></a> </td><td> <a href='{$filename}?fill_fleet=1'>" . $cw['fill_fleet'] . "</a></td> <td>" . popup_help("help.php?topic=Combat&popup=1&sub_topic=-_Chasseurs", 440, 225) . "</td></tr>"; $error_str .= "<tr><td>" . $cw['shields'] . "</td><td> <b>{$shield_cost}</b> / unité</td><td><center><a href='{$filename}?buy=2'>Equiper vaisseau</center></a> </td><td> <a href='{$filename}?fill_fleet=2'>" . $cw['fill_fleet'] . "</a></td> <td>" . popup_help("help.php?topic=Combat&popup=1&sub_topic=-_Boucliers", 400, 205) . "</td></tr>"; $error_str .= "<tr><td>" . $cw['armour'] . "</td><td> <b>{$armour_cost} </b> / unité </td><td><center><a href='{$filename}?buy=3'>Equiper vaisseau</center></a></td><td><a href='{$filename}?fill_fleet=3'>" . $cw['fill_fleet'] . "</a></td> <td>" . popup_help("help.php?topic=Combat&popup=1&sub_topic=-_Coques", 440, 260) . "</td></tr>"; if ($GAME_VARS['alternate_play_1'] == 1) { $error_str .= "<tr><td>" . $cw['mining_switcher'] . "</td><td><b>" . nombre($mining_switch_cost) . "</b></td><td><center><a href='{$filename}?switch=1'>Equiper vaisseau</a></center></td><td><a href='{$filename}?mass_switch=1'>" . $cw['switch_fleet'] . "</td></tr></a></table>"; } $error_str .= "<table class='equip_shop'><tr><th>Type</th><th>Coût</th><th></th></tr>"; if ($user['login_id'] == 1 || avail_check(1000)) {