@@ -47,20 +47,20 @@ discard block |
||
| 47 | 47 | )); |
| 48 | 48 | |
| 49 | 49 | $ActualProd = floor($Prod[$BuildID]); |
| 50 | - if($BuildID != STRUC_MINE_FUSION) { |
|
| 50 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
| 51 | 51 | $ActualNeed = floor($Prod[STRUC_MINE_SOLAR]); |
| 52 | 52 | } else { |
| 53 | 53 | $ActualNeed = floor($Prod[STRUC_MINE_DEUTERIUM]); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | $BuildStartLvl = $CurrentBuildtLvl - 2; |
| 57 | - if($BuildStartLvl < 1) { |
|
| 57 | + if ($BuildStartLvl < 1) { |
|
| 58 | 58 | $BuildStartLvl = 1; |
| 59 | 59 | } |
| 60 | 60 | $Table = ''; |
| 61 | 61 | $ProdFirst = 0; |
| 62 | - for($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 10; $BuildLevel++) { |
|
| 63 | - if($BuildID != STRUC_MOON_PHALANX) { |
|
| 62 | + for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 10; $BuildLevel++) { |
|
| 63 | + if ($BuildID != STRUC_MOON_PHALANX) { |
|
| 64 | 64 | $Prod[STRUC_MINE_METAL] = floor(mrc_modify_value( |
| 65 | 65 | $CurrentUser, |
| 66 | 66 | $CurrentPlanet, |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | )); |
| 88 | 88 | |
| 89 | 89 | $bloc['build_lvl'] = ($CurrentBuildtLvl == $BuildLevel) ? "<font color=\"#ff0000\">" . $BuildLevel . "</font>" : $BuildLevel; |
| 90 | - if($ProdFirst > 0) { |
|
| 91 | - if($BuildID != STRUC_MINE_FUSION) { |
|
| 90 | + if ($ProdFirst > 0) { |
|
| 91 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
| 92 | 92 | $bloc['build_gain'] = "<font color=\"lime\">(" . pretty_number(floor($Prod[$BuildID] - $ProdFirst)) . ")</font>"; |
| 93 | 93 | } else { |
| 94 | 94 | $bloc['build_gain'] = "<font color=\"lime\">(" . pretty_number(floor($Prod[STRUC_MINE_SOLAR] - $ProdFirst)) . ")</font>"; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } else { |
| 97 | 97 | $bloc['build_gain'] = ''; |
| 98 | 98 | } |
| 99 | - if($BuildID != STRUC_MINE_FUSION) { |
|
| 99 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
| 100 | 100 | $bloc['build_prod'] = pretty_number(floor($Prod[$BuildID])); |
| 101 | 101 | $bloc['build_prod_diff'] = pretty_number(floor($Prod[$BuildID] - $ActualProd), true, true); |
| 102 | 102 | $bloc['build_need'] = pretty_number(floor($Prod[STRUC_MINE_SOLAR]), true, true); |
@@ -107,8 +107,8 @@ discard block |
||
| 107 | 107 | $bloc['build_need'] = pretty_number(floor($Prod[STRUC_MINE_DEUTERIUM]), true, true); |
| 108 | 108 | $bloc['build_need_diff'] = pretty_number(floor($Prod[STRUC_MINE_DEUTERIUM] - $ActualNeed), true, true); |
| 109 | 109 | } |
| 110 | - if($ProdFirst == 0) { |
|
| 111 | - if($BuildID != STRUC_MINE_FUSION) { |
|
| 110 | + if ($ProdFirst == 0) { |
|
| 111 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
| 112 | 112 | $ProdFirst = floor($Prod[$BuildID]); |
| 113 | 113 | } else { |
| 114 | 114 | $ProdFirst = floor($Prod[STRUC_MINE_SOLAR]); |
@@ -133,22 +133,22 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | $str_rapid_from = ''; |
| 135 | 135 | $str_rapid_to = ''; |
| 136 | - foreach(sn_get_groups(array('fleet', 'defense_active')) as $enemy_id) { |
|
| 136 | + foreach (sn_get_groups(array('fleet', 'defense_active')) as $enemy_id) { |
|
| 137 | 137 | $enemy_data = get_unit_param($enemy_id); |
| 138 | 138 | $enemy_durability = $enemy_data['shield'] + $enemy_data['armor']; |
| 139 | 139 | |
| 140 | 140 | $rapid = floor($unit_data['attack'] * (isset($unit_data['amplify'][$enemy_id]) ? $unit_data['amplify'][$enemy_id] : 1) / $enemy_durability); |
| 141 | - if($rapid >= 1) { |
|
| 141 | + if ($rapid >= 1) { |
|
| 142 | 142 | $str_rapid_to .= "{$classLocale['nfo_rf_again']} {$classLocale['tech'][$enemy_id]} <font color=\"#00ff00\">{$rapid}</font><br>"; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | $rapid = floor($enemy_data['attack'] * (isset($enemy_data['amplify'][$unit_id]) ? $enemy_data['amplify'][$unit_id] : 1) / $unit_durability); |
| 146 | - if($rapid >= 1) { |
|
| 146 | + if ($rapid >= 1) { |
|
| 147 | 147 | $str_rapid_from .= "{$classLocale['tech'][$enemy_id]} {$classLocale['nfo_rf_from']} <font color=\"#ff0000\">{$rapid}</font><br>"; |
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - if($str_rapid_to && $str_rapid_from) { |
|
| 151 | + if ($str_rapid_to && $str_rapid_from) { |
|
| 152 | 152 | $str_rapid_to .= '<hr>'; |
| 153 | 153 | } |
| 154 | 154 | |
@@ -156,16 +156,16 @@ discard block |
||
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | $unit_id = sys_get_param_id('gid'); |
| 159 | -if($unit_id == RES_DARK_MATTER) { |
|
| 159 | +if ($unit_id == RES_DARK_MATTER) { |
|
| 160 | 160 | sys_redirect('dark_matter.php'); |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | -if($unit_id == RES_METAMATTER) { |
|
| 163 | +if ($unit_id == RES_METAMATTER) { |
|
| 164 | 164 | sys_redirect('metamatter.php'); |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | lng_include('infos'); |
| 168 | -if(!$unit_id || (!get_unit_param($unit_id) && !isset(classLocale::$lang['info'][$unit_id]))) { |
|
| 168 | +if (!$unit_id || (!get_unit_param($unit_id) && !isset(classLocale::$lang['info'][$unit_id]))) { |
|
| 169 | 169 | sys_redirect('index.php?page=techtree'); |
| 170 | 170 | } |
| 171 | 171 | |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $unit_data = get_unit_param($unit_id); |
| 175 | 175 | $unit_type = $unit_data['type']; |
| 176 | 176 | |
| 177 | -if($unit_type == UNIT_SHIPS) { |
|
| 177 | +if ($unit_type == UNIT_SHIPS) { |
|
| 178 | 178 | $template_result['UNIT_IS_SHIP'] = true; |
| 179 | 179 | |
| 180 | 180 | $ship_data = get_ship_data($unit_id, $user); |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | ); |
| 191 | 191 | |
| 192 | 192 | $engine_template_info = array(); |
| 193 | - foreach($unit_data['engine'] as $unit_engine_data) { |
|
| 193 | + foreach ($unit_data['engine'] as $unit_engine_data) { |
|
| 194 | 194 | $unit_engine_data = get_engine_data($user, $unit_engine_data); |
| 195 | 195 | |
| 196 | 196 | $engine_template_info[] = array( |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | |
| 211 | 211 | $sn_data_group_combat = sn_get_groups('combat'); |
| 212 | -if(in_array($unit_id, $sn_data_group_combat)) { |
|
| 212 | +if (in_array($unit_id, $sn_data_group_combat)) { |
|
| 213 | 213 | $template_result['UNIT_IS_COMBAT'] = true; |
| 214 | 214 | |
| 215 | 215 | $unit_durability = $unit_data['shield'] + $unit_data['armor']; |
@@ -217,21 +217,21 @@ discard block |
||
| 217 | 217 | $volley_arr = $rapid_to = $rapid_from = array(); |
| 218 | 218 | $str_rapid_from = ''; |
| 219 | 219 | $str_rapid_to = ''; |
| 220 | - foreach($sn_data_group_combat as $enemy_id) { |
|
| 220 | + foreach ($sn_data_group_combat as $enemy_id) { |
|
| 221 | 221 | $enemy_data = get_unit_param($enemy_id); |
| 222 | 222 | $enemy_durability = $enemy_data['shield'] + $enemy_data['armor']; |
| 223 | 223 | |
| 224 | 224 | $rapid = $unit_data['attack'] * (isset($unit_data['amplify'][$enemy_id]) ? $unit_data['amplify'][$enemy_id] : 1) / $enemy_durability; |
| 225 | - if($rapid >= 1) { |
|
| 225 | + if ($rapid >= 1) { |
|
| 226 | 226 | $volley_arr[$enemy_id]['TO'] = floor($rapid); |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | $rapid = $enemy_data['attack'] * (isset($enemy_data['amplify'][$unit_id]) ? $enemy_data['amplify'][$unit_id] : 1) / $unit_durability; |
| 230 | - if($rapid >= 1) { |
|
| 230 | + if ($rapid >= 1) { |
|
| 231 | 231 | $volley_arr[$enemy_id]['FROM'] = floor($rapid); |
| 232 | 232 | } |
| 233 | 233 | } |
| 234 | - foreach($volley_arr as $enemy_id => &$rapid) { |
|
| 234 | + foreach ($volley_arr as $enemy_id => &$rapid) { |
|
| 235 | 235 | $rapid['ENEMY_ID'] = $enemy_id; |
| 236 | 236 | $rapid['ENEMY_NAME'] = classLocale::$lang['tech'][$enemy_id]; |
| 237 | 237 | } |
@@ -249,11 +249,11 @@ discard block |
||
| 249 | 249 | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | -if(classLocale::$lang['info'][$unit_id]['effect']) { |
|
| 252 | +if (classLocale::$lang['info'][$unit_id]['effect']) { |
|
| 253 | 253 | $template_result['UNIT_EFFECT'] = classLocale::$lang['info'][$unit_id]['effect']; |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | -if($unit_data['bonus']) { |
|
| 256 | +if ($unit_data['bonus']) { |
|
| 257 | 257 | $unit_bonus = !$unit_data['bonus'] || $unit_data['bonus_type'] == BONUS_ABILITY ? '' : ( |
| 258 | 258 | ($unit_data['bonus'] >= 0 ? '+' : '') . $unit_data['bonus'] . ($unit_data['bonus_type'] == BONUS_PERCENT ? '%' : '') |
| 259 | 259 | ); |