@@ -75,11 +75,11 @@ |
||
75 | 75 | * @return float[] - [int resourceId] -> [float ratesNormalizedToResourceCost] |
76 | 76 | */ |
77 | 77 | public function getResourceExchangeIn($resourceId) { |
78 | - if(empty($this->resourceExchangeRates[$resourceId])) { |
|
78 | + if (empty($this->resourceExchangeRates[$resourceId])) { |
|
79 | 79 | $defaultRates = $this->getResourcesExchange(); |
80 | 80 | |
81 | 81 | $this->resourceExchangeRates[$resourceId] = []; |
82 | - foreach($defaultRates as $defaultResourceId => $defaultRate) { |
|
82 | + foreach ($defaultRates as $defaultResourceId => $defaultRate) { |
|
83 | 83 | $this->resourceExchangeRates[$resourceId][$defaultResourceId] = $defaultRate / $defaultRates[$resourceId]; |
84 | 84 | } |
85 | 85 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function admin_planet_edit_mode(&$template, &$admin_planet_edit_mode_list){return sn_function_call('admin_planet_edit_mode', array(&$template, &$admin_planet_edit_mode_list));} |
|
3 | +function admin_planet_edit_mode(&$template, &$admin_planet_edit_mode_list) {return sn_function_call('admin_planet_edit_mode', array(&$template, &$admin_planet_edit_mode_list)); } |
|
4 | 4 | function sn_admin_planet_edit_mode(&$template, &$admin_planet_edit_mode_list) |
5 | 5 | { |
6 | 6 | global $lang; |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | return $mode; |
20 | 20 | } |
21 | 21 | |
22 | -function admin_planet_edit_template(&$template, $edit_planet_row, $mode){return sn_function_call('admin_planet_edit_template', array(&$template, $edit_planet_row, $mode));} |
|
22 | +function admin_planet_edit_template(&$template, $edit_planet_row, $mode) {return sn_function_call('admin_planet_edit_template', array(&$template, $edit_planet_row, $mode)); } |
|
23 | 23 | /** |
24 | 24 | * @param template $template |
25 | 25 | * @param $edit_planet_row |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | global $lang; |
31 | 31 | |
32 | 32 | $unit_list = sn_get_groups($mode); |
33 | - if(empty($unit_list)) |
|
33 | + if (empty($unit_list)) |
|
34 | 34 | { |
35 | 35 | return; |
36 | 36 | } |
37 | 37 | $name_list = $lang['tech']; |
38 | 38 | |
39 | - foreach($unit_list as $unit_id) |
|
39 | + foreach ($unit_list as $unit_id) |
|
40 | 40 | { |
41 | 41 | $template->assign_block_vars('unit', array( |
42 | 42 | 'ID' => $unit_id, |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | } |
48 | 48 | } |
49 | 49 | |
50 | -function admin_planet_edit_query_string($unit_id, $unit_amount, $mode){return sn_function_call('admin_planet_edit_query_string', array($unit_id, $unit_amount, $mode));} |
|
50 | +function admin_planet_edit_query_string($unit_id, $unit_amount, $mode) {return sn_function_call('admin_planet_edit_query_string', array($unit_id, $unit_amount, $mode)); } |
|
51 | 51 | function sn_admin_planet_edit_query_string($unit_id, $unit_amount, $mode) |
52 | 52 | { |
53 | - if($unit_amount && in_array($unit_id, sn_get_groups($mode))) |
|
53 | + if ($unit_amount && in_array($unit_id, sn_get_groups($mode))) |
|
54 | 54 | { |
55 | 55 | $unit_amount = round($unit_amount); |
56 | 56 | $unit_name = get_unit_param($unit_id, P_NAME); |
@@ -12,12 +12,12 @@ discard block |
||
12 | 12 | $fleet_row = &$mission_data['fleet']; |
13 | 13 | $destination_planet = &$mission_data['dst_planet']; |
14 | 14 | |
15 | - if(!$fleet_row) |
|
15 | + if (!$fleet_row) |
|
16 | 16 | { |
17 | 17 | return CACHE_NOTHING; |
18 | 18 | } |
19 | 19 | |
20 | - if(!isset($destination_planet['id'])) |
|
20 | + if (!isset($destination_planet['id'])) |
|
21 | 21 | { |
22 | 22 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
23 | 23 | fleet_send_back($mission_data['fleet']); |
@@ -29,12 +29,12 @@ discard block |
||
29 | 29 | $RecyclerCapacity = 0; |
30 | 30 | $OtherFleetCapacity = 0; |
31 | 31 | $fleet_array = sys_unit_str2arr($fleet_row['fleet_array']); |
32 | - foreach($fleet_array as $unit_id => $unit_count) |
|
32 | + foreach ($fleet_array as $unit_id => $unit_count) |
|
33 | 33 | { |
34 | - if(in_array($unit_id, sn_get_groups('fleet'))) |
|
34 | + if (in_array($unit_id, sn_get_groups('fleet'))) |
|
35 | 35 | { |
36 | 36 | $capacity = get_unit_param($unit_id, P_CAPACITY) * $unit_count; |
37 | - if(in_array($unit_id, sn_get_groups('flt_recyclers'))) |
|
37 | + if (in_array($unit_id, sn_get_groups('flt_recyclers'))) |
|
38 | 38 | { |
39 | 39 | $RecyclerCapacity += $capacity; |
40 | 40 | } |
@@ -46,19 +46,19 @@ discard block |
||
46 | 46 | } |
47 | 47 | |
48 | 48 | $IncomingFleetGoods = $fleet_row["fleet_resource_metal"] + $fleet_row["fleet_resource_crystal"] + $fleet_row["fleet_resource_deuterium"]; |
49 | - if($IncomingFleetGoods > $OtherFleetCapacity) |
|
49 | + if ($IncomingFleetGoods > $OtherFleetCapacity) |
|
50 | 50 | { |
51 | 51 | $RecyclerCapacity -= ($IncomingFleetGoods - $OtherFleetCapacity); |
52 | 52 | } |
53 | 53 | |
54 | - if(($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) |
|
54 | + if (($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) |
|
55 | 55 | { |
56 | 56 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
57 | 57 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
58 | 58 | } |
59 | 59 | else |
60 | 60 | { |
61 | - if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
61 | + if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
62 | 62 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
63 | 63 | { |
64 | 64 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | } |
93 | 93 | } |
94 | 94 | } |
95 | - $NewCargo['Metal'] = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"]; |
|
95 | + $NewCargo['Metal'] = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"]; |
|
96 | 96 | $NewCargo['Crystal'] = $fleet_row["fleet_resource_crystal"] + $RecycledGoods["crystal"]; |
97 | 97 | $NewCargo['Deuterium'] = $fleet_row["fleet_resource_deuterium"]; |
98 | 98 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | HelperString::numberFloorAndFormat($RecycledGoods["metal"]), $lang['Metal'], |
106 | 106 | HelperString::numberFloorAndFormat($RecycledGoods["crystal"]), $lang['Crystal'] |
107 | 107 | ); |
108 | - msg_send_simple_message ( $fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_RECYCLE, $lang['sys_mess_spy_control'], $lang['sys_recy_report'], $Message); |
|
108 | + msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_RECYCLE, $lang['sys_mess_spy_control'], $lang['sys_recy_report'], $Message); |
|
109 | 109 | |
110 | 110 | // $QryUpdateFleet = "UPDATE {{fleets}} SET `fleet_mess` = 1,`fleet_resource_metal` = '{$NewCargo['Metal']}',`fleet_resource_crystal` = '{$NewCargo['Crystal']}',`fleet_resource_deuterium` = '{$NewCargo['Deuterium']}' "; |
111 | 111 | // $QryUpdateFleet .= "WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;"; |
@@ -11,8 +11,8 @@ discard block |
||
11 | 11 | global $who, $lang; |
12 | 12 | |
13 | 13 | // $sn_group_stat_common = sn_get_groups('STAT_COMMON'); |
14 | - foreach($array as $key => $value) { |
|
15 | - if($array_name == 'type' && $who == 2 && !in_array($key, $sn_group_stat_common)) { |
|
14 | + foreach ($array as $key => $value) { |
|
15 | + if ($array_name == 'type' && $who == 2 && !in_array($key, $sn_group_stat_common)) { |
|
16 | 16 | continue; |
17 | 17 | } |
18 | 18 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $subject_list = array( |
45 | 45 | 1 => array('header' => $lang['stat_player']), |
46 | 46 | ); |
47 | -if(!$source) { |
|
47 | +if (!$source) { |
|
48 | 48 | $subject_list[2] = array('header' => $lang['stat_allys']); |
49 | 49 | } |
50 | 50 | stat_tpl_assign($template, $who, 'subject', $subject_list, $sn_group_stat_common); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | |
112 | 112 | $page_count = floor($record_count / 100); |
113 | 113 | $pages = array(); |
114 | -for($i = 0; $i <= $page_count; $i++) { |
|
114 | +for ($i = 0; $i <= $page_count; $i++) { |
|
115 | 115 | $first_element = $i * 100 + 1; |
116 | 116 | $last_element = $first_element + 99; |
117 | 117 | $pages[$first_element] = array( |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | 'POINTS' => HelperString::numberFloorAndFormat($row['points']), |
131 | 131 | ); |
132 | 132 | |
133 | - if($who == 1) { |
|
133 | + if ($who == 1) { |
|
134 | 134 | $row_stat['ALLY_NAME'] = $row['ally_name']; |
135 | 135 | $row_stat['ALLY_ID'] = $row['ally_id']; |
136 | 136 | empty($row['username']) ? $row['username'] = $row['name'] : false; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | public function unset_by_prefix($prefix_unset = '') { |
152 | 152 | static $array_clear; |
153 | - !$array_clear ? $array_clear = function (&$v, $k, $p) { |
|
153 | + !$array_clear ? $array_clear = function(&$v, $k, $p) { |
|
154 | 154 | strpos($k, $p) === 0 ? $v = null : false; |
155 | 155 | } : false; |
156 | 156 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | if ($this->$name[0] === null) { |
206 | 206 | for ($i = count($name) - 1; $i > 0; $i--) { |
207 | 207 | $cName = "{$name[$i]}_COUNT"; |
208 | - $cName1 = "{$name[$i-1]}_COUNT"; |
|
208 | + $cName1 = "{$name[$i - 1]}_COUNT"; |
|
209 | 209 | if ($this->$cName1 == null || $i == 1) { |
210 | 210 | $this->$cName++; |
211 | 211 | } |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $count = count($name); |
252 | 252 | for ($i = 1; $i < $count; $i++) { |
253 | 253 | $cName = "{$name[$i]}_COUNT"; |
254 | - $cName1 = "{$name[$i-1]}_COUNT"; |
|
254 | + $cName1 = "{$name[$i - 1]}_COUNT"; |
|
255 | 255 | |
256 | 256 | if ($i == 1 || $this->$cName1 === null) { |
257 | 257 | $this->$cName--; |
@@ -109,33 +109,33 @@ discard block |
||
109 | 109 | `ube_report_time_combat` = '" . date(FMT_DATE_TIME_SQL, $combat_data[UBE_TIME]) . "', |
110 | 110 | `ube_report_time_spent` = {$combat_data[UBE_TIME_SPENT]}, |
111 | 111 | |
112 | - `ube_report_combat_admin` = " . (int)$combat_data[UBE_OPTIONS][UBE_COMBAT_ADMIN] . ", |
|
112 | + `ube_report_combat_admin` = " . (int) $combat_data[UBE_OPTIONS][UBE_COMBAT_ADMIN] . ", |
|
113 | 113 | `ube_report_mission_type` = {$combat_data[UBE_OPTIONS][UBE_MISSION_TYPE]}, |
114 | 114 | |
115 | 115 | `ube_report_combat_result` = {$outcome[UBE_COMBAT_RESULT]}, |
116 | - `ube_report_combat_sfr` = " . (int)$outcome[UBE_SFR] . ", |
|
116 | + `ube_report_combat_sfr` = " . (int) $outcome[UBE_SFR] . ", |
|
117 | 117 | |
118 | - `ube_report_debris_metal` = " . (float)$outcome[UBE_DEBRIS][RES_METAL] . ", |
|
119 | - `ube_report_debris_crystal` = " . (float)$outcome[UBE_DEBRIS][RES_CRYSTAL] . ", |
|
118 | + `ube_report_debris_metal` = " . (float) $outcome[UBE_DEBRIS][RES_METAL] . ", |
|
119 | + `ube_report_debris_crystal` = " . (float) $outcome[UBE_DEBRIS][RES_CRYSTAL] . ", |
|
120 | 120 | `ube_report_debris_total_in_metal` = " . $ube_report_debris_total_in_metal . ", |
121 | 121 | |
122 | - `ube_report_planet_id` = " . (int)$outcome[UBE_PLANET][PLANET_ID] . ", |
|
122 | + `ube_report_planet_id` = " . (int) $outcome[UBE_PLANET][PLANET_ID] . ", |
|
123 | 123 | `ube_report_planet_name` = '" . db_escape($outcome[UBE_PLANET][PLANET_NAME]) . "', |
124 | - `ube_report_planet_size` = " . (int)$outcome[UBE_PLANET][PLANET_SIZE] . ", |
|
125 | - `ube_report_planet_galaxy` = " . (int)$outcome[UBE_PLANET][PLANET_GALAXY] . ", |
|
126 | - `ube_report_planet_system` = " . (int)$outcome[UBE_PLANET][PLANET_SYSTEM] . ", |
|
127 | - `ube_report_planet_planet` = " . (int)$outcome[UBE_PLANET][PLANET_PLANET] . ", |
|
128 | - `ube_report_planet_planet_type` = " . (int)$outcome[UBE_PLANET][PLANET_TYPE] . ", |
|
124 | + `ube_report_planet_size` = " . (int) $outcome[UBE_PLANET][PLANET_SIZE] . ", |
|
125 | + `ube_report_planet_galaxy` = " . (int) $outcome[UBE_PLANET][PLANET_GALAXY] . ", |
|
126 | + `ube_report_planet_system` = " . (int) $outcome[UBE_PLANET][PLANET_SYSTEM] . ", |
|
127 | + `ube_report_planet_planet` = " . (int) $outcome[UBE_PLANET][PLANET_PLANET] . ", |
|
128 | + `ube_report_planet_planet_type` = " . (int) $outcome[UBE_PLANET][PLANET_TYPE] . ", |
|
129 | 129 | |
130 | - `ube_report_moon` = " . (int)$outcome[UBE_MOON] . ", |
|
131 | - `ube_report_moon_chance` = " . (int)$outcome[UBE_MOON_CHANCE] . ", |
|
132 | - `ube_report_moon_size` = " . (float)$outcome[UBE_MOON_SIZE] . ", |
|
130 | + `ube_report_moon` = " . (int) $outcome[UBE_MOON] . ", |
|
131 | + `ube_report_moon_chance` = " . (int) $outcome[UBE_MOON_CHANCE] . ", |
|
132 | + `ube_report_moon_size` = " . (float) $outcome[UBE_MOON_SIZE] . ", |
|
133 | 133 | |
134 | - `ube_report_moon_reapers` = " . (int)$outcome[UBE_MOON_REAPERS] . ", |
|
135 | - `ube_report_moon_destroy_chance` = " . (int)$outcome[UBE_MOON_DESTROY_CHANCE] . ", |
|
136 | - `ube_report_moon_reapers_die_chance` = " . (int)$outcome[UBE_MOON_REAPERS_DIE_CHANCE] . ", |
|
134 | + `ube_report_moon_reapers` = " . (int) $outcome[UBE_MOON_REAPERS] . ", |
|
135 | + `ube_report_moon_destroy_chance` = " . (int) $outcome[UBE_MOON_DESTROY_CHANCE] . ", |
|
136 | + `ube_report_moon_reapers_die_chance` = " . (int) $outcome[UBE_MOON_REAPERS_DIE_CHANCE] . ", |
|
137 | 137 | |
138 | - `ube_report_capture_result` = " . (int)$outcome[UBE_CAPTURE_RESULT] . " |
|
138 | + `ube_report_capture_result` = " . (int) $outcome[UBE_CAPTURE_RESULT] . " |
|
139 | 139 | "); |
140 | 140 | $ube_report_id = $combat_data[UBE_REPORT_ID] = db_insert_id(); |
141 | 141 | |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | $player_id, |
147 | 147 | |
148 | 148 | "'" . db_escape($player_info[UBE_NAME]) . "'", |
149 | - (int)$player_info[UBE_ATTACKER], |
|
149 | + (int) $player_info[UBE_ATTACKER], |
|
150 | 150 | |
151 | - (float)$player_info[UBE_BONUSES][UBE_ATTACK], |
|
152 | - (float)$player_info[UBE_BONUSES][UBE_SHIELD], |
|
153 | - (float)$player_info[UBE_BONUSES][UBE_ARMOR], |
|
151 | + (float) $player_info[UBE_BONUSES][UBE_ATTACK], |
|
152 | + (float) $player_info[UBE_BONUSES][UBE_SHIELD], |
|
153 | + (float) $player_info[UBE_BONUSES][UBE_ARMOR], |
|
154 | 154 | ); |
155 | 155 | } |
156 | 156 | |
@@ -163,20 +163,20 @@ discard block |
||
163 | 163 | $fleet_info[UBE_OWNER], |
164 | 164 | $fleet_id, |
165 | 165 | |
166 | - (float)$fleet_info[UBE_PLANET][PLANET_ID], |
|
166 | + (float) $fleet_info[UBE_PLANET][PLANET_ID], |
|
167 | 167 | "'" . db_escape($fleet_info[UBE_PLANET][PLANET_NAME]) . "'", |
168 | - (int)$fleet_info[UBE_PLANET][PLANET_GALAXY], |
|
169 | - (int)$fleet_info[UBE_PLANET][PLANET_SYSTEM], |
|
170 | - (int)$fleet_info[UBE_PLANET][PLANET_PLANET], |
|
171 | - (int)$fleet_info[UBE_PLANET][PLANET_TYPE], |
|
172 | - |
|
173 | - (float)$fleet_info[UBE_RESOURCES][RES_METAL], |
|
174 | - (float)$fleet_info[UBE_RESOURCES][RES_CRYSTAL], |
|
175 | - (float)$fleet_info[UBE_RESOURCES][RES_DEUTERIUM], |
|
176 | - |
|
177 | - (float)$fleet_info[UBE_BONUSES][UBE_ATTACK], |
|
178 | - (float)$fleet_info[UBE_BONUSES][UBE_SHIELD], |
|
179 | - (float)$fleet_info[UBE_BONUSES][UBE_ARMOR], |
|
168 | + (int) $fleet_info[UBE_PLANET][PLANET_GALAXY], |
|
169 | + (int) $fleet_info[UBE_PLANET][PLANET_SYSTEM], |
|
170 | + (int) $fleet_info[UBE_PLANET][PLANET_PLANET], |
|
171 | + (int) $fleet_info[UBE_PLANET][PLANET_TYPE], |
|
172 | + |
|
173 | + (float) $fleet_info[UBE_RESOURCES][RES_METAL], |
|
174 | + (float) $fleet_info[UBE_RESOURCES][RES_CRYSTAL], |
|
175 | + (float) $fleet_info[UBE_RESOURCES][RES_DEUTERIUM], |
|
176 | + |
|
177 | + (float) $fleet_info[UBE_BONUSES][UBE_ATTACK], |
|
178 | + (float) $fleet_info[UBE_BONUSES][UBE_SHIELD], |
|
179 | + (float) $fleet_info[UBE_BONUSES][UBE_ARMOR], |
|
180 | 180 | ); |
181 | 181 | |
182 | 182 | // Сохраняем итоговую информацию по ресурсам флота - потеряно, выброшено, увезено |
@@ -185,19 +185,19 @@ discard block |
||
185 | 185 | $ube_report_id, |
186 | 186 | $fleet_id, |
187 | 187 | |
188 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_METAL], |
|
189 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_CRYSTAL], |
|
190 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_DEUTERIUM], |
|
188 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_METAL], |
|
189 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_CRYSTAL], |
|
190 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_DEUTERIUM], |
|
191 | 191 | |
192 | - (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_METAL], |
|
193 | - (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_CRYSTAL], |
|
194 | - (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_DEUTERIUM], |
|
192 | + (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_METAL], |
|
193 | + (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_CRYSTAL], |
|
194 | + (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_DEUTERIUM], |
|
195 | 195 | |
196 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_METAL], |
|
197 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_CRYSTAL], |
|
198 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_DEUTERIUM], |
|
196 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_METAL], |
|
197 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_CRYSTAL], |
|
198 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_DEUTERIUM], |
|
199 | 199 | |
200 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST_IN_METAL][RES_METAL], |
|
200 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST_IN_METAL][RES_METAL], |
|
201 | 201 | ); |
202 | 202 | |
203 | 203 | // Сохраняем результаты по юнитам - потеряно и восстановлено |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | $fleet_id, |
210 | 210 | |
211 | 211 | $unit_id, |
212 | - (float)$fleet_outcome_data[UBE_DEFENCE_RESTORE][$unit_id], |
|
213 | - (float)$fleet_outcome_data[UBE_UNITS_LOST][$unit_id], |
|
212 | + (float) $fleet_outcome_data[UBE_DEFENCE_RESTORE][$unit_id], |
|
213 | + (float) $fleet_outcome_data[UBE_UNITS_LOST][$unit_id], |
|
214 | 214 | |
215 | 215 | $unit_sort_order, |
216 | 216 | ); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | $unit_id, |
235 | 235 | $unit_count, |
236 | - (int)$fleet_data[UBE_UNITS_BOOM][$unit_id], |
|
236 | + (int) $fleet_data[UBE_UNITS_BOOM][$unit_id], |
|
237 | 237 | |
238 | 238 | $fleet_data[UBE_ATTACK][$unit_id], |
239 | 239 | $fleet_data[UBE_SHIELD][$unit_id], |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | $this->target_message = "{$lang['sys_mess_spy_enemy_fleet']} {$this->src_planet['name']} " . uni_render_coordinates_href($this->src_planet, '', 3); |
32 | 32 | $this->target_message .= " {$lang['sys_mess_spy_seen_at']} {$this->dst_planet['name']} " . uni_render_coordinates($this->dst_planet); |
33 | - if($this->missionReport->isSpyDetected()) { |
|
33 | + if ($this->missionReport->isSpyDetected()) { |
|
34 | 34 | $this->target_message .= "<br />{$lang['sys_mess_spy_destroyed_enemy']}"; |
35 | 35 | } |
36 | 36 |
@@ -25,8 +25,8 @@ discard block |
||
25 | 25 | $groups[get_unit_param($unitId, P_UNIT_TYPE)][$unitId] = $unitAmount; |
26 | 26 | } |
27 | 27 | |
28 | - foreach(static::ALLOWED_UNITS as $groupId) { |
|
29 | - if(empty($groups[$groupId])) { |
|
28 | + foreach (static::ALLOWED_UNITS as $groupId) { |
|
29 | + if (empty($groups[$groupId])) { |
|
30 | 30 | continue; |
31 | 31 | } |
32 | 32 | |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | 'NAME' => $lang['tech'][$groupId], |
36 | 36 | ]); |
37 | 37 | |
38 | - foreach($general->getGroupsById($groupId) as $unitId) { |
|
39 | - if((!isset($groups[$groupId][$unitId]) || floor($groups[$groupId][$unitId]) < 1) && $unitId != RES_ENERGY) { |
|
38 | + foreach ($general->getGroupsById($groupId) as $unitId) { |
|
39 | + if ((!isset($groups[$groupId][$unitId]) || floor($groups[$groupId][$unitId]) < 1) && $unitId != RES_ENERGY) { |
|
40 | 40 | continue; |
41 | 41 | } |
42 | 42 |
@@ -223,7 +223,7 @@ |
||
223 | 223 | 'factor' => 1, |
224 | 224 | ), |
225 | 225 | P_UNIT_PRODUCTION => array( |
226 | - RES_ENERGY => function ($level, $production_factor, $user, $planet_row) { return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor); }, |
|
226 | + RES_ENERGY => function($level, $production_factor, $user, $planet_row) { return ($planet_row["temp_max"] / 4 + 20) * $level * (0.1 * $production_factor); }, |
|
227 | 227 | ), |
228 | 228 | P_MINING_IS_MANAGED => true, |
229 | 229 |