$present_ship = dbr(1); if (isset($present_ship)) { //ensure the ship exists empty_bays($present_ship); } } else { $present_ship = $user_ship; } if (!isset($type)) { $type = 0; } discern_type($type); if ($type == 0) { $free_space = $cw['ship_fighters'] . ": <b>{$present_ship['fighters']}</b> / <b>{$present_ship['max_fighters']}</b>"; } else { $free_space = $st[1630] . ": <br />" . bay_storage($present_ship); } //loading or unloading a single ship if (!isset($present_ship)) { $output_str .= $st[1631]; } elseif ($user['turns'] < 1) { $pre_processed_txt .= $st[1632]; } elseif ($present_ship['cargo_bays'] < 1 && $type > 0) { $pre_processed_txt .= $st[1633]; } elseif ($present_ship['max_fighters'] < 1 && $type == 1) { $pre_processed_txt .= $st[1634]; } elseif (!isset($single_ship_process) || $amount < 1) { $out = sprintf($st[1635], $text_mat) . " {$text_mat}: <b>{$planet[$tech_mat]}</b><p />" . $free_space; $out .= "<form action={$_SERVER['PHP_SELF']} name=single_ship_process method=POST><input type=hidden name=single_ship_deal value=1 /><input type=hidden name=type value='{$type}' /><input type=hidden name=chosen_ship value='{$chosen_ship}' /><input type=hidden name=planet_id value='{$planet_id}' /><p /><input type=text name=amount value=0 /><p /><input type='submit' name='single_ship_process' value='" . $cw['load_ship'] . "' /> ------- <input type='submit' name='single_ship_process' value='" . $cw['unload_ship'] . "' /><p /><a href='{$_SERVER['PHP_SELF']}?planet_id={$planet_id}&type={$type}&single_ship_deal=1'>" . $cw['back'] . "</a>"; print_page($cw['load/unload'], $out); } elseif ($single_ship_process == $cw['load_ship']) {
function bay_storage_little($ship) { if (empty($ship['cargo_bays'])) { return "\n <b>" . $cw['none'] . "</b>"; } $ret_str = ""; $colour = ''; empty_bays($ship); if ($ship['cargo_bays'] * 0.1 > $ship['empty_bays']) { $colour = '#c00000'; } elseif ($ship['cargo_bays'] * 0.25 > $ship['empty_bays']) { $colour = '#d6750e'; } if ($colour) { $ret_str .= "<font color={$colour}><b>"; } $bay_storage = str_replace("'", "\\'", bay_storage($ship)); if ($ship['cargo_bays'] - $ship['empty_bays']) { $ret_str .= "<span onmouseover=\"montre('{$bay_storage}');\" onmouseout=\"cache();\">"; } $ret_str .= "<b>" . ($ship['cargo_bays'] - $ship['empty_bays']) . '/' . $ship['cargo_bays'] . "</b>"; if ($ship['cargo_bays'] - $ship['empty_bays']) { $ret_str .= "</span>"; } if ($colour) { $ret_str .= '</b></font>'; } return $ret_str; }
//nothing found, so almost certainly not the players own ship. if (empty($ship)) { print_s_page($st[83]); } $text = sprintf($st[84], $ship[ship_name]); $text .= make_table(array("", "")); $text .= quick_row($cw['name'], $ship['ship_name']); $text .= quick_row($cw['type'], $ship['class_name']); $text .= quick_row($cw['location'], $cw['sys'] . " # {$ship['location']}"); $text .= quick_row($cw['fleet'] . " #", $ship['fleet_id']); $text .= quick_row("", ""); $text .= quick_row($cw['fighters'], "{$ship['fighters']}/{$ship['max_fighters']}"); $text .= quick_row($cw['shields'], "{$ship['shields']}/{$ship['max_shields']}"); $text .= quick_row($cw['armour'], "{$ship['armour']}/{$ship['max_armour']}"); $text .= quick_row($cw['size'], discern_size($ship['size'])); $text .= quick_row($cw['cargo_bays'], bay_storage($ship)); if ($GAME_VARS['alternate_play_1'] == 1) { $text .= quick_row($cw['mining_rate'] . ": " . $cw['metal'], $ship['mine_rate_metal']); $text .= quick_row($cw['mining_rate'] . ": " . $cw['fuel'], $ship['mine_rate_fuel']); } else { $quick_maths = $ship['mine_rate_metal'] + $ship['mine_rate_fuel']; $text .= quick_row($cw['mining_rate'], $quick_maths); } $text .= quick_row($cw['speed_move_cost'], $ship['move_turn_cost']); $text .= quick_row("", ""); $text .= quick_row($cw['upgrade_pods'], $ship['upgrade_slots']); $text .= quick_row($cw['specials'], config_list(0, $ship['config'])); $text .= quick_row("# " . $cw['offensive_turrets'], $ship['num_ot']); $text .= quick_row("# " . $cw['defensive_turrets'], $ship['num_dt']); $text .= quick_row("# " . $cw['plasma_turrets'], $ship['num_pc']); $text .= quick_row("# " . $cw['electronic_warfare_pods'], $ship['num_ew']);