@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -function flt_mission_hold(&$mission_data) |
|
| 4 | -{ |
|
| 3 | +function flt_mission_hold(&$mission_data) { |
|
| 5 | 4 | if($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW) |
| 6 | 5 | { |
| 7 | 6 | fleet_send_back($mission_data['fleet']); |
@@ -7,8 +7,7 @@ discard block |
||
| 7 | 7 | * @copyright 2008 By Chlorel for XNova |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | -function flt_mission_recycle(&$mission_data) |
|
| 11 | -{ |
|
| 10 | +function flt_mission_recycle(&$mission_data) { |
|
| 12 | 11 | $fleet_row = &$mission_data['fleet']; |
| 13 | 12 | $destination_planet = &$mission_data['dst_planet']; |
| 14 | 13 | |
@@ -37,8 +36,7 @@ discard block |
||
| 37 | 36 | if(in_array($unit_id, sn_get_groups('flt_recyclers'))) |
| 38 | 37 | { |
| 39 | 38 | $RecyclerCapacity += $capacity; |
| 40 | - } |
|
| 41 | - else |
|
| 39 | + } else |
|
| 42 | 40 | { |
| 43 | 41 | $OtherFleetCapacity += $capacity; |
| 44 | 42 | } |
@@ -55,16 +53,14 @@ discard block |
||
| 55 | 53 | { |
| 56 | 54 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
| 57 | 55 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
| 58 | - } |
|
| 59 | - else |
|
| 56 | + } else |
|
| 60 | 57 | { |
| 61 | 58 | if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
| 62 | 59 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
| 63 | 60 | { |
| 64 | 61 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
| 65 | 62 | $RecycledGoods["crystal"] = $RecyclerCapacity / 2; |
| 66 | - } |
|
| 67 | - else |
|
| 63 | + } else |
|
| 68 | 64 | { |
| 69 | 65 | if ($destination_planet["debris_metal"] > $destination_planet["debris_crystal"]) |
| 70 | 66 | { |
@@ -72,20 +68,17 @@ discard block |
||
| 72 | 68 | if ($destination_planet["debris_metal"] > ($RecyclerCapacity - $RecycledGoods["crystal"])) |
| 73 | 69 | { |
| 74 | 70 | $RecycledGoods["metal"] = $RecyclerCapacity - $RecycledGoods["crystal"]; |
| 75 | - } |
|
| 76 | - else |
|
| 71 | + } else |
|
| 77 | 72 | { |
| 78 | 73 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
| 79 | 74 | } |
| 80 | - } |
|
| 81 | - else |
|
| 75 | + } else |
|
| 82 | 76 | { |
| 83 | 77 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
| 84 | 78 | if ($destination_planet["debris_crystal"] > ($RecyclerCapacity - $RecycledGoods["metal"])) |
| 85 | 79 | { |
| 86 | 80 | $RecycledGoods["crystal"] = $RecyclerCapacity - $RecycledGoods["metal"]; |
| 87 | - } |
|
| 88 | - else |
|
| 81 | + } else |
|
| 89 | 82 | { |
| 90 | 83 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
| 91 | 84 | } |
@@ -8,8 +8,7 @@ |
||
| 8 | 8 | * @version 1.1 |
| 9 | 9 | * @copyright 2008 by Chlorel for XNova |
| 10 | 10 | */ |
| 11 | -function flt_mission_relocate($mission_data) |
|
| 12 | -{ |
|
| 11 | +function flt_mission_relocate($mission_data) { |
|
| 13 | 12 | $fleet_row = &$mission_data['fleet']; |
| 14 | 13 | $destination_planet = &$mission_data['dst_planet']; |
| 15 | 14 | |
@@ -1,7 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -function sn_user_birthday_celebrate() |
|
| 4 | -{ |
|
| 3 | +function sn_user_birthday_celebrate() { |
|
| 5 | 4 | global $config, $lang; |
| 6 | 5 | |
| 7 | 6 | sn_db_transaction_start(); |
@@ -8,8 +8,7 @@ |
||
| 8 | 8 | * @copyright 2008 By Chlorel for XNova |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -function flt_mission_transport(&$mission_data) |
|
| 12 | -{ |
|
| 11 | +function flt_mission_transport(&$mission_data) { |
|
| 13 | 12 | $fleet_row = &$mission_data['fleet']; |
| 14 | 13 | $source_planet = &$mission_data['src_planet']; |
| 15 | 14 | $destination_planet = &$mission_data['dst_planet']; |
@@ -10,8 +10,7 @@ |
||
| 10 | 10 | // ---------------------------------------------------------------------------------------------------------------- |
| 11 | 11 | // Mission Case 9: -> Coloniser |
| 12 | 12 | // |
| 13 | -function flt_mission_colonize(&$mission_data) |
|
| 14 | -{ |
|
| 13 | +function flt_mission_colonize(&$mission_data) { |
|
| 15 | 14 | $fleet_row = &$mission_data['fleet']; |
| 16 | 15 | $src_user_row = &$mission_data['src_user']; |
| 17 | 16 | |
@@ -6,8 +6,7 @@ |
||
| 6 | 6 | * version 2.0 copyright (c) 2012 by Gorlum for http://supernova.ws |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -function sn_techtree_view($template = null) |
|
| 10 | -{ |
|
| 9 | +function sn_techtree_view($template = null) { |
|
| 11 | 10 | global $lang, $user, $planetrow; |
| 12 | 11 | |
| 13 | 12 | $tech_tree = array(); |
@@ -1,7 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -function flt_fleet_speed($user, $fleet) |
|
| 4 | -{ |
|
| 3 | +function flt_fleet_speed($user, $fleet) { |
|
| 5 | 4 | if (!is_array($fleet)) |
| 6 | 5 | { |
| 7 | 6 | $fleet = array($fleet => 1); |
@@ -29,16 +28,13 @@ discard block |
||
| 29 | 28 | if($from['galaxy'] != $to['galaxy']) |
| 30 | 29 | { |
| 31 | 30 | $distance = abs($from['galaxy'] - $to['galaxy']) * $config->uni_galaxy_distance; |
| 32 | - } |
|
| 33 | - elseif($from['system'] != $to['system']) |
|
| 31 | + } elseif($from['system'] != $to['system']) |
|
| 34 | 32 | { |
| 35 | 33 | $distance = abs($from['system'] - $to['system']) * 5 * 19 + 2700; |
| 36 | - } |
|
| 37 | - elseif($from['planet'] != $to['planet']) |
|
| 34 | + } elseif($from['planet'] != $to['planet']) |
|
| 38 | 35 | { |
| 39 | 36 | $distance = abs($from['planet'] - $to['planet']) * 5 + 1000; |
| 40 | - } |
|
| 41 | - else |
|
| 37 | + } else |
|
| 42 | 38 | { |
| 43 | 39 | $distance = 5; |
| 44 | 40 | } |
@@ -55,8 +51,7 @@ discard block |
||
| 55 | 51 | * |
| 56 | 52 | * @return array |
| 57 | 53 | */ |
| 58 | -function flt_travel_data($user_row, $from, $to, $fleet_array, $speed_percent = 10) |
|
| 59 | -{ |
|
| 54 | +function flt_travel_data($user_row, $from, $to, $fleet_array, $speed_percent = 10) { |
|
| 60 | 55 | $distance = flt_travel_distance($from, $to); |
| 61 | 56 | |
| 62 | 57 | $consumption = 0; |
@@ -120,8 +115,7 @@ discard block |
||
| 120 | 115 | ); |
| 121 | 116 | } |
| 122 | 117 | |
| 123 | -function flt_bashing_check($user, $enemy, $planet_dst, $mission, $flight_duration, $fleet_group = 0) |
|
| 124 | -{ |
|
| 118 | +function flt_bashing_check($user, $enemy, $planet_dst, $mission, $flight_duration, $fleet_group = 0) { |
|
| 125 | 119 | global $config; |
| 126 | 120 | |
| 127 | 121 | $config_bashing_attacks = $config->fleet_bashing_attacks; |
@@ -531,8 +525,7 @@ discard block |
||
| 531 | 525 | $fleet_ship_count += $amount; |
| 532 | 526 | $fleet_string .= "{$unit_id},{$amount};"; |
| 533 | 527 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($unit_id, -$amount, $user, $from['id']); |
| 534 | - } |
|
| 535 | - elseif(in_array($unit_id, sn_get_groups('resources_loot'))) |
|
| 528 | + } elseif(in_array($unit_id, sn_get_groups('resources_loot'))) |
|
| 536 | 529 | { |
| 537 | 530 | $planet_fields[pname_resource_name($unit_id)]['delta'] -= $amount; |
| 538 | 531 | } |
@@ -624,8 +617,7 @@ discard block |
||
| 624 | 617 | //ini_set('error_reporting', E_ALL ^ E_NOTICE); |
| 625 | 618 | } |
| 626 | 619 | |
| 627 | -function flt_calculate_ship_to_transport_sort($a, $b) |
|
| 628 | -{ |
|
| 620 | +function flt_calculate_ship_to_transport_sort($a, $b) { |
|
| 629 | 621 | return $a['transport_effectivness'] == $b['transport_effectivness'] ? 0 : ($a['transport_effectivness'] > $b['transport_effectivness'] ? -1 : 1); |
| 630 | 622 | } |
| 631 | 623 | |
@@ -634,8 +626,7 @@ discard block |
||
| 634 | 626 | // $resource_amount - how much amount of resources need to be transported |
| 635 | 627 | // $from - transport from |
| 636 | 628 | // $to - transport to |
| 637 | -function flt_calculate_fleet_to_transport($ship_list, $resource_amount, $from, $to) |
|
| 638 | -{ |
|
| 629 | +function flt_calculate_fleet_to_transport($ship_list, $resource_amount, $from, $to) { |
|
| 639 | 630 | global $user; |
| 640 | 631 | |
| 641 | 632 | $ship_data = array(); |
@@ -115,8 +115,7 @@ |
||
| 115 | 115 | )); |
| 116 | 116 | |
| 117 | 117 | display($template, $lang['tech'][STRUC_MOON_GATE]); |
| 118 | - } |
|
| 119 | - else |
|
| 118 | + } else |
|
| 120 | 119 | { |
| 121 | 120 | messageBox($lang['gate_no_src_ga'], $lang['tech'][STRUC_MOON_GATE], "overview.php", 10); |
| 122 | 121 | } |