@@ -161,8 +161,7 @@ discard block |
||
| 161 | 161 | return $rows_affected; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | -function rpg_level_up(&$user, $type, $xp_to_add = 0) |
|
| 165 | -{ |
|
| 164 | +function rpg_level_up(&$user, $type, $xp_to_add = 0) { |
|
| 166 | 165 | $q = 1.03; |
| 167 | 166 | |
| 168 | 167 | switch($type) |
@@ -223,27 +222,22 @@ discard block |
||
| 223 | 222 | } |
| 224 | 223 | } |
| 225 | 224 | |
| 226 | -function rpg_xp_for_level($level, $b1, $q) |
|
| 227 | -{ |
|
| 225 | +function rpg_xp_for_level($level, $b1, $q) { |
|
| 228 | 226 | return floor($b1 * (pow($q, $level) - 1)/($q - 1)); |
| 229 | 227 | } |
| 230 | 228 | |
| 231 | -function rpg_get_miner_xp($level) |
|
| 232 | -{ |
|
| 229 | +function rpg_get_miner_xp($level) { |
|
| 233 | 230 | return rpg_xp_for_level($level, 50, 1.03); |
| 234 | 231 | } |
| 235 | 232 | |
| 236 | -function RPG_get_raider_xp($level) |
|
| 237 | -{ |
|
| 233 | +function RPG_get_raider_xp($level) { |
|
| 238 | 234 | return rpg_xp_for_level($level, 10, 1.03); |
| 239 | 235 | } |
| 240 | 236 | |
| 241 | -function rpg_get_tech_xp($level) |
|
| 242 | -{ |
|
| 237 | +function rpg_get_tech_xp($level) { |
|
| 243 | 238 | return rpg_xp_for_level($level, 50, 1.03); |
| 244 | 239 | } |
| 245 | 240 | |
| 246 | -function rpg_get_explore_xp($level) |
|
| 247 | -{ |
|
| 241 | +function rpg_get_explore_xp($level) { |
|
| 248 | 242 | return rpg_xp_for_level($level, 10, 1.05); |
| 249 | 243 | } |
@@ -458,8 +458,7 @@ |
||
| 458 | 458 | |
| 459 | 459 | if(is_numeric($planet['id'])) { |
| 460 | 460 | DBStaticPlanet::db_planet_set_by_id($planet['id'], "`que_processed` = UNIX_TIMESTAMP(NOW())"); |
| 461 | - } |
|
| 462 | - elseif(is_numeric($user['id'])) { |
|
| 461 | + } elseif(is_numeric($user['id'])) { |
|
| 463 | 462 | db_user_set_by_id($user['id'], '`que_processed` = UNIX_TIMESTAMP(NOW())'); |
| 464 | 463 | } |
| 465 | 464 | |
@@ -1,7 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -function sys_maintenance() |
|
| 4 | -{ |
|
| 3 | +function sys_maintenance() { |
|
| 5 | 4 | global $config; |
| 6 | 5 | |
| 7 | 6 | $bashing_time_limit = SN_TIME_NOW - $config->fleet_bashing_scope; |
@@ -42,8 +41,7 @@ discard block |
||
| 42 | 41 | * TODO: 2. [<m|w|d|h|m|s>@]<time> |
| 43 | 42 | */ |
| 44 | 43 | |
| 45 | -function sys_schedule_get_prev_run($scheduleList, $recorded_run = SN_TIME_NOW, $return_next_run = false) |
|
| 46 | -{ |
|
| 44 | +function sys_schedule_get_prev_run($scheduleList, $recorded_run = SN_TIME_NOW, $return_next_run = false) { |
|
| 47 | 45 | static $date_part_names_reverse = array('seconds', 'minutes', 'hours', 'days', 'months', 'years',); |
| 48 | 46 | |
| 49 | 47 | $possible_schedules = array(); |
@@ -1,14 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // ---------------------------------------------------------------------------------------------------------------- |
| 4 | -function lng_try_filepath($path, $file_path_relative) |
|
| 5 | -{ |
|
| 4 | +function lng_try_filepath($path, $file_path_relative) { |
|
| 6 | 5 | $file_path = SN_ROOT_PHYSICAL . ($path && file_exists(SN_ROOT_PHYSICAL . $path . $file_path_relative) ? $path : '') . $file_path_relative; |
| 7 | 6 | return file_exists($file_path) ? $file_path : false; |
| 8 | 7 | } |
| 9 | 8 | |
| 10 | -function lng_die_not_an_object() |
|
| 11 | -{ |
|
| 9 | +function lng_die_not_an_object() { |
|
| 12 | 10 | print('Ошибка - $lang не объект! Сообщите Администратору сервера и приложите содержимое страницы'); |
| 13 | 11 | $trace = debug_backtrace(); |
| 14 | 12 | unset($trace[0]); |
@@ -17,32 +15,27 @@ discard block |
||
| 17 | 15 | } |
| 18 | 16 | |
| 19 | 17 | // ---------------------------------------------------------------------------------------------------------------- |
| 20 | -function lng_include($filename, $path = '', $ext = '.mo.php') |
|
| 21 | -{ |
|
| 18 | +function lng_include($filename, $path = '', $ext = '.mo.php') { |
|
| 22 | 19 | global $lang; |
| 23 | 20 | return is_object($lang) ? $lang->lng_include($filename, $path, $ext) : lng_die_not_an_object(); |
| 24 | 21 | } |
| 25 | 22 | |
| 26 | -function lng_get_list() |
|
| 27 | -{ |
|
| 23 | +function lng_get_list() { |
|
| 28 | 24 | global $lang; |
| 29 | 25 | return is_object($lang) ? $lang->lng_get_list() : lng_die_not_an_object(); |
| 30 | 26 | } |
| 31 | 27 | |
| 32 | -function lng_get_info($entry) |
|
| 33 | -{ |
|
| 28 | +function lng_get_info($entry) { |
|
| 34 | 29 | global $lang; |
| 35 | 30 | return is_object($lang) ? $lang->lng_get_info($entry) : lng_die_not_an_object(); |
| 36 | 31 | } |
| 37 | 32 | |
| 38 | -function lng_switch($language_new) |
|
| 39 | -{ |
|
| 33 | +function lng_switch($language_new) { |
|
| 40 | 34 | global $lang; |
| 41 | 35 | return is_object($lang) ? $lang->lng_switch($language_new) : lng_die_not_an_object(); |
| 42 | 36 | } |
| 43 | 37 | |
| 44 | -function lng_load_i18n($i18n) |
|
| 45 | -{ |
|
| 38 | +function lng_load_i18n($i18n) { |
|
| 46 | 39 | global $lang; |
| 47 | 40 | return is_object($lang) ? $lang->lng_load_i18n($i18n) : lng_die_not_an_object(); |
| 48 | 41 | } |
@@ -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 | |