Exemplo n.º 1
0
$system_distance = abs($source_system - $scan_system);
if ($system_distance > $sensorRange || $scan_galaxy != $source_galaxy) {
    message($lang['phalanx_rangeerror'], $lang['tech'][42], "", 3);
}
$cost = $sensorLevel * 1000;
/*
debug(GetTargetDistance($source_galaxy, $scan_galaxy, $source_system, $scan_system, $source_planet, $scan_planet) / $sensorLevel * 10);
debug(GetPhalanxRange(1), 1);
debug(GetPhalanxRange(2), 2);
debug(GetPhalanxRange(3), 3);
debug(GetPhalanxRange(4), 4);
debug(GetPhalanxRange(5), 5);
debug(GetPhalanxRange(6), 6);
debug(GetPhalanxRange(7), 7);
debug(GetPhalanxRange(8), 8);
debug(GetPhalanxRange(9), 9);
debug(GetPhalanxRange(10), 10);
*/
if ($planetrow['deuterium'] > $cost) {
    doquery("UPDATE {{planets}} SET deuterium = deuterium - {$cost} WHERE id='{$user['current_planet']}' LIMIT 1;");
} else {
    message($lang['phalanx_nodeuterium'], "phalanx", "", 3);
}
$template = gettemplate('planet_fleet_list', true);
$planet_scanned = doquery("SELECT * FROM {{planets}} WHERE galaxy = {$scan_galaxy} AND system = {$scan_system} AND planet = {$scan_planet} AND planet_type = {$scan_planet_type} LIMIT 1;", '', true);
int_get_fleet_to_planet(flt_get_fleets_to_planet_db($planet_scanned, true), $planet_scanned);
int_get_missile_to_planet("SELECT * FROM `{{iraks}}` WHERE galaxy = {$scan_galaxy} AND system = {$scan_system} AND planet = {$scan_planet};", true);
tpl_assign_fleet($template, $fleets);
$template->assign_vars(array('TIME_NOW' => $time_now));
$page = parsetemplate($template, $parse);
display($page, $lang['tech'][42], false, '', false, false);
Exemplo n.º 2
0
         } else {
             message($lang['ov_delete_wrong_pass'], $lang['colony_abandon'], 'overview.php?mode=manage');
         }
     }
     int_planet_pretemplate($planetrow, $template);
     foreach ($sn_data['groups']['governors'] as $governor_id) {
         $template->assign_block_vars('governors', array('ID' => $governor_id, 'NAME' => $lang['tech'][$governor_id]));
     }
     display(parsetemplate($template), $lang['rename_and_abandon_planet']);
     break;
 default:
     $template = gettemplate('planet_overview', true);
     rpg_level_up($user, RPG_STRUCTURE);
     rpg_level_up($user, RPG_RAID);
     $fleet_id = 1;
     int_get_fleet_to_planet("SELECT DISTINCT * FROM {{fleets}} WHERE `fleet_owner` = '{$user['id']}' OR `fleet_target_owner` = '{$user['id']}';");
     int_get_missile_to_planet("SELECT * FROM `{{iraks}}` WHERE `owner` = '{$user['id']}'");
     $planets_query = SortUserPlanets($user, false, '*');
     while ($UserPlanet = mysql_fetch_assoc($planets_query)) {
         if ($UserPlanet['planet_type'] == PT_MOON) {
             continue;
         }
         $UserPlanet = sys_o_get_updated($user, $UserPlanet, $time_now, true);
         $list_planet_que = $UserPlanet['que'];
         $UserPlanet = $UserPlanet['planet'];
         $template_planet = tpl_parse_planet($UserPlanet, $list_planet_que);
         $planet_fleet_id = 0;
         $fleet_list = $template_planet['fleet_list'];
         if ($fleet_list['own']['count']) {
             $planet_fleet_id = "p{$fleet_id}";
             $fleets[] = tpl_parse_fleet_sn($fleet_list['own']['total'], $planet_fleet_id);