@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('INSIDE')) |
|
3 | +if (!defined('INSIDE')) |
|
4 | 4 | { |
5 | 5 | die('Hack attempt!'); |
6 | 6 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | 'shield' => 10, |
39 | 39 | 'armor' => 400, |
40 | 40 | 'attack' => 5, |
41 | - 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ), |
|
41 | + 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,), |
|
42 | 42 | ), |
43 | 43 | SHIP_CARGO_BIG => array( |
44 | 44 | 'name' => 'big_ship_cargo', |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | 'shield' => 25, |
59 | 59 | 'armor' => 1200, |
60 | 60 | 'attack' => 5, |
61 | - 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ), |
|
61 | + 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,), |
|
62 | 62 | 'engine' => array( |
63 | 63 | array( |
64 | 64 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | 'shield' => 50, |
87 | 87 | 'armor' => 3000, |
88 | 88 | 'attack' => 10, |
89 | - 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ), |
|
89 | + 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,), |
|
90 | 90 | 'engine' => array( |
91 | 91 | array( |
92 | 92 | 'tech' => TECH_ENGINE_ION, |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | 'shield' => 200, |
115 | 115 | 'armor' => 70000, |
116 | 116 | 'attack' => 50, |
117 | - 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250, ), |
|
117 | + 'amplify' => array(SHIP_SPY => 100, SHIP_SATTELITE_SOLAR => 250,), |
|
118 | 118 | 'engine' => array( |
119 | 119 | array( |
120 | 120 | 'tech' => TECH_ENGINE_HYPER, |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | 'shield' => 100, |
144 | 144 | 'armor' => 3000, |
145 | 145 | 'attack' => 50, |
146 | - 'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ), |
|
146 | + 'amplify' => array(SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,), |
|
147 | 147 | 'engine' => array( |
148 | 148 | array( |
149 | 149 | 'tech' => TECH_ENGINE_ION, |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | 'shield' => 10, |
172 | 172 | 'armor' => 1600, |
173 | 173 | 'attack' => 1, |
174 | - 'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050, ), |
|
174 | + 'amplify' => array(SHIP_SPY => 500.05, SHIP_SATTELITE_SOLAR => 1050,), |
|
175 | 175 | 'engine' => array( |
176 | 176 | array( |
177 | 177 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | 'shield' => 0.01, |
200 | 200 | 'armor' => 100, |
201 | 201 | 'attack' => 0.01, |
202 | - 'amplify' => array( SHIP_SPY => 1,), |
|
202 | + 'amplify' => array(SHIP_SPY => 1,), |
|
203 | 203 | 'engine' => array( |
204 | 204 | array( |
205 | 205 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -223,7 +223,7 @@ discard block |
||
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 | |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | 'shield' => 10, |
233 | 233 | 'armor' => 200, |
234 | 234 | 'attack' => 1, |
235 | - 'amplify' => array(SHIP_SPY => 1, ), |
|
235 | + 'amplify' => array(SHIP_SPY => 1,), |
|
236 | 236 | 'engine' => array( |
237 | 237 | array( |
238 | 238 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | 'shield' => 10, |
265 | 265 | 'armor' => 400, |
266 | 266 | 'attack' => 50, |
267 | - 'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21, ), |
|
267 | + 'amplify' => array(SHIP_CARGO_SMALL => 16.4, SHIP_SPY => 10.001, SHIP_SATTELITE_SOLAR => 21,), |
|
268 | 268 | 'engine' => array( |
269 | 269 | array( |
270 | 270 | 'tech' => TECH_ENGINE_CHEMICAL, |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | 'shield' => 25, |
294 | 294 | 'armor' => 1000, |
295 | 295 | 'attack' => 150, |
296 | - 'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7, ), |
|
296 | + 'amplify' => array(SHIP_CARGO_SMALL => 8.2, SHIP_SPY => 3.33367, SHIP_SATTELITE_SOLAR => 7,), |
|
297 | 297 | 'engine' => array( |
298 | 298 | array( |
299 | 299 | 'tech' => TECH_ENGINE_ION, |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | 'shield' => 50, |
353 | 353 | 'armor' => 2700, |
354 | 354 | 'attack' => 400, |
355 | - 'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5, ), |
|
355 | + 'amplify' => array(SHIP_SMALL_FIGHTER_LIGHT => 6.15, SHIP_SPY => 1.25013, SHIP_SATTELITE_SOLAR => 2.625, UNIT_DEF_TURRET_MISSILE => 5.5,), |
|
356 | 356 | 'engine' => array( |
357 | 357 | array( |
358 | 358 | 'tech' => TECH_ENGINE_ION, |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | 'shield' => 200, |
412 | 412 | 'armor' => 6000, |
413 | 413 | 'attack' => 1000, |
414 | - 'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76, ), |
|
414 | + 'amplify' => array(SHIP_SPY => 0.50005, SHIP_SATTELITE_SOLAR => 1.05, UNIT_DEF_TURRET_MISSILE => 1.76,), |
|
415 | 415 | 'engine' => array( |
416 | 416 | array( |
417 | 417 | 'tech' => TECH_ENGINE_HYPER, |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | 'shield' => 500, |
508 | 508 | 'armor' => 11000, |
509 | 509 | 'attack' => 2000, |
510 | - 'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125, ), |
|
510 | + 'amplify' => array(SHIP_SPY => 0.25003, SHIP_SATTELITE_SOLAR => 0.525, SHIP_LARGE_BATTLESHIP => 7.4, UNIT_DEF_TURRET_LASER_SMALL => 1.125,), |
|
511 | 511 | 'engine' => array( |
512 | 512 | array( |
513 | 513 | 'tech' => TECH_ENGINE_HYPER, |
@@ -611,7 +611,7 @@ discard block |
||
611 | 611 | 'shield' => 20, |
612 | 612 | 'armor' => 200, |
613 | 613 | 'attack' => 80, |
614 | - 'amplify' => array(SHIP_SPY => 7, ), |
|
614 | + 'amplify' => array(SHIP_SPY => 7,), |
|
615 | 615 | ), |
616 | 616 | UNIT_DEF_TURRET_LASER_SMALL => array( |
617 | 617 | 'name' => 'small_laser', |
@@ -629,7 +629,7 @@ discard block |
||
629 | 629 | 'shield' => 25, |
630 | 630 | 'armor' => 200, |
631 | 631 | 'attack' => 100, |
632 | - 'amplify' => array(SHIP_SPY => 5, ), |
|
632 | + 'amplify' => array(SHIP_SPY => 5,), |
|
633 | 633 | ), |
634 | 634 | UNIT_DEF_TURRET_LASER_BIG => array( |
635 | 635 | 'name' => 'big_laser', |
@@ -647,7 +647,7 @@ discard block |
||
647 | 647 | 'shield' => 100, |
648 | 648 | 'armor' => 800, |
649 | 649 | 'attack' => 250, |
650 | - 'amplify' => array(SHIP_SPY => 2, ), |
|
650 | + 'amplify' => array(SHIP_SPY => 2,), |
|
651 | 651 | ), |
652 | 652 | UNIT_DEF_TURRET_GAUSS => array( |
653 | 653 | 'name' => 'gauss_canyon', |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | 'armor' => 3500, |
666 | 666 | 'shield' => 200, |
667 | 667 | 'attack' => 1100, |
668 | - 'amplify' => array(SHIP_SPY => 0.5, ), |
|
668 | + 'amplify' => array(SHIP_SPY => 0.5,), |
|
669 | 669 | ), |
670 | 670 | UNIT_DEF_TURRET_ION => array( |
671 | 671 | 'name' => 'ionic_canyon', |
@@ -683,7 +683,7 @@ discard block |
||
683 | 683 | 'shield' => 500, |
684 | 684 | 'armor' => 800, |
685 | 685 | 'attack' => 150, |
686 | - 'amplify' => array(SHIP_SPY => 3.3, ), |
|
686 | + 'amplify' => array(SHIP_SPY => 3.3,), |
|
687 | 687 | ), |
688 | 688 | UNIT_DEF_TURRET_PLASMA => array( |
689 | 689 | 'name' => 'buster_canyon', |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | 'shield' => 300, |
702 | 702 | 'armor' => 10000, |
703 | 703 | 'attack' => 3000, |
704 | - 'amplify' => array(SHIP_SPY => 0.17, ), |
|
704 | + 'amplify' => array(SHIP_SPY => 0.17,), |
|
705 | 705 | ), |
706 | 706 | |
707 | 707 | UNIT_DEF_SHIELD_SMALL => array( |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | 'shield' => 2000, |
722 | 722 | 'armor' => 2000, |
723 | 723 | 'attack' => 1, |
724 | - 'amplify' => array(SHIP_SPY => 500, ), |
|
724 | + 'amplify' => array(SHIP_SPY => 500,), |
|
725 | 725 | ), |
726 | 726 | UNIT_DEF_SHIELD_BIG => array( |
727 | 727 | 'name' => 'big_protection_shield', |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | 'shield' => 2000, |
741 | 741 | 'armor' => 10000, |
742 | 742 | 'attack' => 1, |
743 | - 'amplify' => array(SHIP_SPY => 500, ), |
|
743 | + 'amplify' => array(SHIP_SPY => 500,), |
|
744 | 744 | ), |
745 | 745 | UNIT_DEF_SHIELD_PLANET => array( |
746 | 746 | 'name' => 'planet_protector', |
@@ -2,16 +2,16 @@ |
||
2 | 2 | // Captcha code for registration - really didn't work alot :( |
3 | 3 | |
4 | 4 | session_start(); |
5 | -$en=100; |
|
6 | -$boy=25; |
|
7 | -$sayi = mt_rand(0,9999999); |
|
5 | +$en = 100; |
|
6 | +$boy = 25; |
|
7 | +$sayi = mt_rand(0, 9999999); |
|
8 | 8 | $_SESSION['captcha'] = $sayi; |
9 | -$tuval = imagecreatetruecolor($en,$boy); |
|
10 | -$b = imagecolorallocate($tuval,175,238,238); |
|
11 | -$s = imagecolorallocate($tuval,0,0,0); |
|
12 | -imagefill($tuval,0,0,$s); |
|
13 | -imageline($tuval,20,50,$en,$boy,$b); |
|
14 | -imagestring($tuval,3,27,7,$sayi,$b); |
|
9 | +$tuval = imagecreatetruecolor($en, $boy); |
|
10 | +$b = imagecolorallocate($tuval, 175, 238, 238); |
|
11 | +$s = imagecolorallocate($tuval, 0, 0, 0); |
|
12 | +imagefill($tuval, 0, 0, $s); |
|
13 | +imageline($tuval, 20, 50, $en, $boy, $b); |
|
14 | +imagestring($tuval, 3, 27, 7, $sayi, $b); |
|
15 | 15 | Header("content-type:image/gif"); |
16 | 16 | imagegif($tuval); |
17 | 17 | imagedestroy($tuval); |
@@ -7,8 +7,8 @@ |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -define('INSIDE' , true); |
|
11 | -define('INSTALL' , false); |
|
10 | +define('INSIDE', true); |
|
11 | +define('INSTALL', false); |
|
12 | 12 | |
13 | 13 | require('common.' . substr(strrchr(__FILE__, '.'), 1)); |
14 | 14 |
@@ -12,16 +12,16 @@ discard block |
||
12 | 12 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
13 | 13 | |
14 | 14 | $unit_id = sys_get_param_id('gid'); |
15 | -if($unit_id == RES_DARK_MATTER) { |
|
15 | +if ($unit_id == RES_DARK_MATTER) { |
|
16 | 16 | sys_redirect('dark_matter.php'); |
17 | 17 | } |
18 | 18 | |
19 | -if($unit_id == RES_METAMATTER) { |
|
19 | +if ($unit_id == RES_METAMATTER) { |
|
20 | 20 | sys_redirect('metamatter.php'); |
21 | 21 | } |
22 | 22 | |
23 | 23 | lng_include('infos'); |
24 | -if(!$unit_id || (!get_unit_param($unit_id) && !isset($lang['info'][$unit_id]))) { |
|
24 | +if (!$unit_id || (!get_unit_param($unit_id) && !isset($lang['info'][$unit_id]))) { |
|
25 | 25 | sys_redirect('index.php?page=techtree'); |
26 | 26 | } |
27 | 27 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $unit_data = get_unit_param($unit_id); |
31 | 31 | $unit_type = $unit_data['type']; |
32 | 32 | |
33 | -if($unit_type == UNIT_SHIPS) { |
|
33 | +if ($unit_type == UNIT_SHIPS) { |
|
34 | 34 | $template_result['UNIT_IS_SHIP'] = true; |
35 | 35 | |
36 | 36 | $ship_data = get_ship_data($unit_id, $user); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ); |
47 | 47 | |
48 | 48 | $engine_template_info = array(); |
49 | - foreach($unit_data['engine'] as $unit_engine_data) { |
|
49 | + foreach ($unit_data['engine'] as $unit_engine_data) { |
|
50 | 50 | $unit_engine_data = get_engine_data($user, $unit_engine_data); |
51 | 51 | |
52 | 52 | $engine_template_info[] = array( |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | |
67 | 67 | $sn_data_group_combat = sn_get_groups('combat'); |
68 | -if(in_array($unit_id, $sn_data_group_combat)) { |
|
68 | +if (in_array($unit_id, $sn_data_group_combat)) { |
|
69 | 69 | $template_result['UNIT_IS_COMBAT'] = true; |
70 | 70 | |
71 | 71 | $unit_durability = $unit_data['shield'] + $unit_data['armor']; |
@@ -73,21 +73,21 @@ discard block |
||
73 | 73 | $volley_arr = $rapid_to = $rapid_from = array(); |
74 | 74 | $str_rapid_from = ''; |
75 | 75 | $str_rapid_to = ''; |
76 | - foreach($sn_data_group_combat as $enemy_id) { |
|
76 | + foreach ($sn_data_group_combat as $enemy_id) { |
|
77 | 77 | $enemy_data = get_unit_param($enemy_id); |
78 | 78 | $enemy_durability = $enemy_data['shield'] + $enemy_data['armor']; |
79 | 79 | |
80 | 80 | $rapid = $unit_data['attack'] * (isset($unit_data['amplify'][$enemy_id]) ? $unit_data['amplify'][$enemy_id] : 1) / $enemy_durability; |
81 | - if($rapid >= 1) { |
|
81 | + if ($rapid >= 1) { |
|
82 | 82 | $volley_arr[$enemy_id]['TO'] = floor($rapid); |
83 | 83 | } |
84 | 84 | |
85 | 85 | $rapid = $enemy_data['attack'] * (isset($enemy_data['amplify'][$unit_id]) ? $enemy_data['amplify'][$unit_id] : 1) / $unit_durability; |
86 | - if($rapid >= 1) { |
|
86 | + if ($rapid >= 1) { |
|
87 | 87 | $volley_arr[$enemy_id]['FROM'] = floor($rapid); |
88 | 88 | } |
89 | 89 | } |
90 | - foreach($volley_arr as $enemy_id => &$rapid) { |
|
90 | + foreach ($volley_arr as $enemy_id => &$rapid) { |
|
91 | 91 | $rapid['ENEMY_ID'] = $enemy_id; |
92 | 92 | $rapid['ENEMY_NAME'] = $lang['tech'][$enemy_id]; |
93 | 93 | } |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | |
106 | 106 | } |
107 | 107 | |
108 | -if($lang['info'][$unit_id]['effect']) { |
|
108 | +if ($lang['info'][$unit_id]['effect']) { |
|
109 | 109 | $template_result['UNIT_EFFECT'] = $lang['info'][$unit_id]['effect']; |
110 | 110 | } |
111 | 111 | |
112 | -if($unit_data['bonus']) { |
|
112 | +if ($unit_data['bonus']) { |
|
113 | 113 | $unit_bonus = !$unit_data['bonus'] || $unit_data['bonus_type'] == BONUS_ABILITY ? '' : ( |
114 | 114 | ($unit_data['bonus'] >= 0 ? '+' : '') . $unit_data['bonus'] . ($unit_data['bonus_type'] == BONUS_PERCENT ? '%' : '') |
115 | 115 | ); |
@@ -174,20 +174,20 @@ discard block |
||
174 | 174 | )); |
175 | 175 | |
176 | 176 | $ActualProd = floor($Prod[$BuildID]); |
177 | - if($BuildID != STRUC_MINE_FUSION) { |
|
177 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
178 | 178 | $ActualNeed = floor($Prod[STRUC_MINE_SOLAR]); |
179 | 179 | } else { |
180 | 180 | $ActualNeed = floor($Prod[STRUC_MINE_DEUTERIUM]); |
181 | 181 | } |
182 | 182 | |
183 | 183 | $BuildStartLvl = $CurrentBuildtLvl - 2; |
184 | - if($BuildStartLvl < 1) { |
|
184 | + if ($BuildStartLvl < 1) { |
|
185 | 185 | $BuildStartLvl = 1; |
186 | 186 | } |
187 | 187 | $Table = ''; |
188 | 188 | $ProdFirst = 0; |
189 | - for($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 10; $BuildLevel++) { |
|
190 | - if($BuildID != STRUC_MOON_PHALANX) { |
|
189 | + for ($BuildLevel = $BuildStartLvl; $BuildLevel < $BuildStartLvl + 10; $BuildLevel++) { |
|
190 | + if ($BuildID != STRUC_MOON_PHALANX) { |
|
191 | 191 | $Prod[STRUC_MINE_METAL] = floor(mrc_modify_value( |
192 | 192 | $CurrentUser, |
193 | 193 | $CurrentPlanet, |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | )); |
215 | 215 | |
216 | 216 | $bloc['build_lvl'] = ($CurrentBuildtLvl == $BuildLevel) ? "<font color=\"#ff0000\">" . $BuildLevel . "</font>" : $BuildLevel; |
217 | - if($ProdFirst > 0) { |
|
218 | - if($BuildID != STRUC_MINE_FUSION) { |
|
217 | + if ($ProdFirst > 0) { |
|
218 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
219 | 219 | $bloc['build_gain'] = "<font color=\"lime\">(" . pretty_number(floor($Prod[$BuildID] - $ProdFirst)) . ")</font>"; |
220 | 220 | } else { |
221 | 221 | $bloc['build_gain'] = "<font color=\"lime\">(" . pretty_number(floor($Prod[STRUC_MINE_SOLAR] - $ProdFirst)) . ")</font>"; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | } else { |
224 | 224 | $bloc['build_gain'] = ''; |
225 | 225 | } |
226 | - if($BuildID != STRUC_MINE_FUSION) { |
|
226 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
227 | 227 | $bloc['build_prod'] = pretty_number(floor($Prod[$BuildID])); |
228 | 228 | $bloc['build_prod_diff'] = pretty_number(floor($Prod[$BuildID] - $ActualProd), true, true); |
229 | 229 | $bloc['build_need'] = pretty_number(floor($Prod[STRUC_MINE_SOLAR]), true, true); |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | $bloc['build_need'] = pretty_number(floor($Prod[STRUC_MINE_DEUTERIUM]), true, true); |
235 | 235 | $bloc['build_need_diff'] = pretty_number(floor($Prod[STRUC_MINE_DEUTERIUM] - $ActualNeed), true, true); |
236 | 236 | } |
237 | - if($ProdFirst == 0) { |
|
238 | - if($BuildID != STRUC_MINE_FUSION) { |
|
237 | + if ($ProdFirst == 0) { |
|
238 | + if ($BuildID != STRUC_MINE_FUSION) { |
|
239 | 239 | $ProdFirst = floor($Prod[$BuildID]); |
240 | 240 | } else { |
241 | 241 | $ProdFirst = floor($Prod[STRUC_MINE_SOLAR]); |
@@ -260,22 +260,22 @@ discard block |
||
260 | 260 | |
261 | 261 | $str_rapid_from = ''; |
262 | 262 | $str_rapid_to = ''; |
263 | - foreach(sn_get_groups(array('fleet', 'defense_active')) as $enemy_id) { |
|
263 | + foreach (sn_get_groups(array('fleet', 'defense_active')) as $enemy_id) { |
|
264 | 264 | $enemy_data = get_unit_param($enemy_id); |
265 | 265 | $enemy_durability = $enemy_data['shield'] + $enemy_data['armor']; |
266 | 266 | |
267 | 267 | $rapid = floor($unit_data['attack'] * (isset($unit_data['amplify'][$enemy_id]) ? $unit_data['amplify'][$enemy_id] : 1) / $enemy_durability); |
268 | - if($rapid >= 1) { |
|
268 | + if ($rapid >= 1) { |
|
269 | 269 | $str_rapid_to .= "{$lang['nfo_rf_again']} {$lang['tech'][$enemy_id]} <font color=\"#00ff00\">{$rapid}</font><br>"; |
270 | 270 | } |
271 | 271 | |
272 | 272 | $rapid = floor($enemy_data['attack'] * (isset($enemy_data['amplify'][$unit_id]) ? $enemy_data['amplify'][$unit_id] : 1) / $unit_durability); |
273 | - if($rapid >= 1) { |
|
273 | + if ($rapid >= 1) { |
|
274 | 274 | $str_rapid_from .= "{$lang['tech'][$enemy_id]} {$lang['nfo_rf_from']} <font color=\"#ff0000\">{$rapid}</font><br>"; |
275 | 275 | } |
276 | 276 | } |
277 | 277 | |
278 | - if($str_rapid_to && $str_rapid_from) { |
|
278 | + if ($str_rapid_to && $str_rapid_from) { |
|
279 | 279 | $str_rapid_to .= '<hr>'; |
280 | 280 | } |
281 | 281 | |
@@ -304,75 +304,75 @@ discard block |
||
304 | 304 | |
305 | 305 | $unit_info = get_unit_param($unit_id); |
306 | 306 | |
307 | -if($unit_id >= 1 && $unit_id <= 3) { |
|
307 | +if ($unit_id >= 1 && $unit_id <= 3) { |
|
308 | 308 | // Cas des mines |
309 | 309 | $PageTPL = gettemplate('info_buildings_table'); |
310 | 310 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
311 | 311 | $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_p_hour}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_energy}</td><td class=\"c\">{nfo_difference}</td></tr>"; |
312 | 312 | $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; |
313 | -} elseif($unit_id == 4) { |
|
313 | +} elseif ($unit_id == 4) { |
|
314 | 314 | // Centrale Solaire |
315 | 315 | $PageTPL = gettemplate('info_buildings_table'); |
316 | 316 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
317 | 317 | $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td></tr>"; |
318 | 318 | $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th></tr>"; |
319 | -} elseif($unit_id == STRUC_MINE_FUSION) { |
|
319 | +} elseif ($unit_id == STRUC_MINE_FUSION) { |
|
320 | 320 | // Centrale Fusion |
321 | 321 | $PageTPL = gettemplate('info_buildings_table'); |
322 | 322 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
323 | 323 | $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_prod_energy}</td><td class=\"c\">{nfo_difference}</td><td class=\"c\">{nfo_used_deuter}</td><td class=\"c\">{nfo_difference}</td></tr>"; |
324 | 324 | $TableTPL = "<tr><th>{build_lvl}</th><th>{build_prod} {build_gain}</th><th>{build_prod_diff}</th><th>{build_need}</th><th>{build_need_diff}</th></tr>"; |
325 | -} elseif($unit_id >= STRUC_FACTORY_ROBOT && $unit_id <= 32) { |
|
325 | +} elseif ($unit_id >= STRUC_FACTORY_ROBOT && $unit_id <= 32) { |
|
326 | 326 | // Batiments Generaux |
327 | 327 | $PageTPL = gettemplate('info_buildings_general'); |
328 | 328 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
329 | -} elseif($unit_id == STRUC_TERRAFORMER) { |
|
329 | +} elseif ($unit_id == STRUC_TERRAFORMER) { |
|
330 | 330 | // Batiments Terraformer |
331 | 331 | $PageTPL = gettemplate('info_buildings_general'); |
332 | -} elseif($unit_id == STRUC_ALLY_DEPOSIT) { |
|
332 | +} elseif ($unit_id == STRUC_ALLY_DEPOSIT) { |
|
333 | 333 | // Dépot d'alliance |
334 | 334 | $PageTPL = gettemplate('info_buildings_general'); |
335 | 335 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
336 | -} elseif($unit_id == STRUC_LABORATORY_NANO) { |
|
336 | +} elseif ($unit_id == STRUC_LABORATORY_NANO) { |
|
337 | 337 | // nano |
338 | 338 | $PageTPL = gettemplate('info_buildings_general'); |
339 | 339 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
340 | -} elseif($unit_id == STRUC_SILO) { |
|
340 | +} elseif ($unit_id == STRUC_SILO) { |
|
341 | 341 | // Silo de missiles |
342 | 342 | $PageTPL = gettemplate('info_buildings_general'); |
343 | 343 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
344 | -} elseif($unit_id == STRUC_MOON_STATION) { |
|
344 | +} elseif ($unit_id == STRUC_MOON_STATION) { |
|
345 | 345 | // Batiments lunaires |
346 | 346 | $PageTPL = gettemplate('info_buildings_general'); |
347 | -} elseif($unit_id == STRUC_MOON_PHALANX) { |
|
347 | +} elseif ($unit_id == STRUC_MOON_PHALANX) { |
|
348 | 348 | // Phalange |
349 | 349 | $PageTPL = gettemplate('info_buildings_table'); |
350 | 350 | $TableHeadTPL = "<tr><td class=\"c\">{nfo_level}</td><td class=\"c\">{nfo_range}</td></tr>"; |
351 | 351 | $TableTPL = "<tr><th>{build_lvl}</th><th>{build_range}</th></tr>"; |
352 | 352 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
353 | -} elseif($unit_id == STRUC_MOON_GATE) { |
|
353 | +} elseif ($unit_id == STRUC_MOON_GATE) { |
|
354 | 354 | // Porte de Saut |
355 | 355 | $PageTPL = gettemplate('info_buildings_general'); |
356 | 356 | $DestroyTPL = gettemplate('info_buildings_destroy'); |
357 | -} elseif(in_array($unit_id, sn_get_groups('tech'))) { |
|
357 | +} elseif (in_array($unit_id, sn_get_groups('tech'))) { |
|
358 | 358 | // Laboratoire |
359 | 359 | $PageTPL = gettemplate('info_buildings_general'); |
360 | -} elseif(in_array($unit_id, sn_get_groups('fleet'))) { |
|
360 | +} elseif (in_array($unit_id, sn_get_groups('fleet'))) { |
|
361 | 361 | // Flotte |
362 | 362 | |
363 | 363 | $PageTPL = gettemplate('info_buildings_fleet'); |
364 | 364 | |
365 | 365 | $parse['element_typ'] = $lang['tech'][UNIT_SHIPS]; |
366 | 366 | $rapid_fire = eco_render_rapid_fire($unit_id); |
367 | - $parse['rf_info_to'] = $rapid_fire['to']; // Rapid Fire vers |
|
367 | + $parse['rf_info_to'] = $rapid_fire['to']; // Rapid Fire vers |
|
368 | 368 | $parse['rf_info_fr'] = $rapid_fire['from']; // Rapid Fire de |
369 | 369 | |
370 | 370 | $parse['hull_pt'] = pretty_number(($unit_info['metal'] + $unit_info['crystal']) / 10); // Points de Structure |
371 | - $parse['shield_pt'] = pretty_number($unit_info['shield']); // Points de Bouclier |
|
372 | - $parse['attack_pt'] = pretty_number($unit_info['attack']); // Points d'Attaque |
|
371 | + $parse['shield_pt'] = pretty_number($unit_info['shield']); // Points de Bouclier |
|
372 | + $parse['attack_pt'] = pretty_number($unit_info['attack']); // Points d'Attaque |
|
373 | 373 | $parse['capacity_pt'] = pretty_number($unit_info['capacity']); // Capacitée de fret |
374 | - $parse['base_speed'] = pretty_number($unit_info['engine'][0]['speed']); // Vitesse de base |
|
375 | - $parse['base_conso'] = pretty_number($unit_info['engine'][0]['consumption']); // Consommation de base |
|
374 | + $parse['base_speed'] = pretty_number($unit_info['engine'][0]['speed']); // Vitesse de base |
|
375 | + $parse['base_conso'] = pretty_number($unit_info['engine'][0]['consumption']); // Consommation de base |
|
376 | 376 | |
377 | 377 | $parse['ACTUAL_ARMOR'] = pretty_number(mrc_modify_value($user, false, array(MRC_ADMIRAL, TECH_ARMOR), ($unit_info['metal'] + $unit_info['crystal']) / 10)); |
378 | 378 | $parse['ACTUAL_SHIELD'] = pretty_number(mrc_modify_value($user, false, array(MRC_ADMIRAL, TECH_SHIELD), $unit_info['shield'])); |
@@ -382,37 +382,37 @@ discard block |
||
382 | 382 | $parse['ACTUAL_CAPACITY'] = pretty_number($ship_data['capacity']); |
383 | 383 | $parse['ACTUAL_SPEED'] = pretty_number($ship_data['speed']); |
384 | 384 | $parse['ACTUAL_CONSUMPTION'] = pretty_number($ship_data['consumption']); |
385 | - if(count($unit_info['engine']) > 1) { |
|
386 | - $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($unit_info['engine'][1]['speed']) . ")</font>"; // Vitesse rééquipée |
|
385 | + if (count($unit_info['engine']) > 1) { |
|
386 | + $parse['upd_speed'] = "<font color=\"yellow\">(" . pretty_number($unit_info['engine'][1]['speed']) . ")</font>"; // Vitesse rééquipée |
|
387 | 387 | $parse['upd_conso'] = "<font color=\"yellow\">(" . pretty_number($unit_info['engine'][1]['consumption']) . ")</font>"; // Consommation apres rééquipement |
388 | 388 | } |
389 | -} elseif(in_array($unit_id, sn_get_groups('defense_active'))) { |
|
389 | +} elseif (in_array($unit_id, sn_get_groups('defense_active'))) { |
|
390 | 390 | // Defenses |
391 | 391 | $PageTPL = gettemplate('info_buildings_defense'); |
392 | 392 | $parse['element_typ'] = $lang['tech'][UNIT_DEFENCE]; |
393 | 393 | |
394 | 394 | $rapid_fire = eco_render_rapid_fire($unit_id); |
395 | - $parse['rf_info_to'] = $rapid_fire['to']; // Rapid Fire vers |
|
395 | + $parse['rf_info_to'] = $rapid_fire['to']; // Rapid Fire vers |
|
396 | 396 | $parse['rf_info_fr'] = $rapid_fire['from']; // Rapid Fire de |
397 | 397 | |
398 | 398 | $parse['hull_pt'] = pretty_number(($unit_info['metal'] + $unit_info['crystal']) / 10); // Points de Structure |
399 | - $parse['shield_pt'] = pretty_number($unit_info['shield']); // Points de Bouclier |
|
400 | - $parse['attack_pt'] = pretty_number($unit_info['attack']); // Points d'Attaque |
|
401 | -} elseif(in_array($unit_id, sn_get_groups('missile'))) { |
|
399 | + $parse['shield_pt'] = pretty_number($unit_info['shield']); // Points de Bouclier |
|
400 | + $parse['attack_pt'] = pretty_number($unit_info['attack']); // Points d'Attaque |
|
401 | +} elseif (in_array($unit_id, sn_get_groups('missile'))) { |
|
402 | 402 | // Misilles |
403 | 403 | $PageTPL = gettemplate('info_buildings_defense'); |
404 | 404 | $parse['element_typ'] = $lang['tech'][UNIT_DEFENCE]; |
405 | 405 | $parse['hull_pt'] = pretty_number($unit_info['metal'] + $unit_info['crystal']); // Points de Structure |
406 | - $parse['shield_pt'] = pretty_number($unit_info['shield']); // Points de Bouclier |
|
407 | - $parse['attack_pt'] = pretty_number($unit_info['attack']); // Points d'Attaque |
|
408 | -} elseif(in_array($unit_id, sn_get_groups(array('mercenaries', 'governors', 'artifacts', 'resources_all')))) { |
|
406 | + $parse['shield_pt'] = pretty_number($unit_info['shield']); // Points de Bouclier |
|
407 | + $parse['attack_pt'] = pretty_number($unit_info['attack']); // Points d'Attaque |
|
408 | +} elseif (in_array($unit_id, sn_get_groups(array('mercenaries', 'governors', 'artifacts', 'resources_all')))) { |
|
409 | 409 | // Officiers |
410 | 410 | $PageTPL = gettemplate('info_officiers_general'); |
411 | 411 | |
412 | 412 | $mercenary = $unit_info; |
413 | 413 | $mercenary_bonus = $mercenary['bonus']; |
414 | 414 | $mercenary_bonus = $mercenary_bonus >= 0 ? "+{$mercenary_bonus}" : "{$mercenary_bonus}"; |
415 | - switch($mercenary['bonus_type']) { |
|
415 | + switch ($mercenary['bonus_type']) { |
|
416 | 416 | case BONUS_PERCENT: |
417 | 417 | $mercenary_bonus = "{$mercenary_bonus}%"; |
418 | 418 | break; |
@@ -430,7 +430,7 @@ discard block |
||
430 | 430 | |
431 | 431 | $parse['EFFECT'] = $lang['info'][$unit_id]['effect']; |
432 | 432 | $parse['mercenary_bonus'] = $mercenary_bonus; |
433 | - if(!in_array($unit_id, sn_get_groups(array('artifacts', 'resources_all')))) { |
|
433 | + if (!in_array($unit_id, sn_get_groups(array('artifacts', 'resources_all')))) { |
|
434 | 434 | $parse['max_level'] = $lang['sys_level'] . ' ' . |
435 | 435 | (in_array($unit_id, sn_get_groups('mercenaries')) ? mrc_get_level($user, $planetrow, $unit_id) : ($mercenary['location'] == LOC_USER ? mrc_get_level($user, null, $unit_id) : ($planetrow['PLANET_GOVERNOR_ID'] == $unit_id ? $planetrow['PLANET_GOVERNOR_LEVEL'] : 0))) |
436 | 436 | . (isset($mercenary['max']) ? "/{$mercenary['max']}" : ''); |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | } |
439 | 439 | |
440 | 440 | // ---- Tableau d'evolution |
441 | -if($TableHeadTPL != '') { |
|
441 | +if ($TableHeadTPL != '') { |
|
442 | 442 | $parse['table_head'] = parsetemplate($TableHeadTPL, $lang); |
443 | 443 | $parse['table_data'] = ShowProductionTable($user, $planetrow, $unit_id, $TableTPL); |
444 | 444 | } |
@@ -22,19 +22,19 @@ |
||
22 | 22 | */ |
23 | 23 | switch($mode) |
24 | 24 | { |
25 | - case SNC_MODE_REGISTER: |
|
26 | - if($config->server_updater_key || $config->server_updater_id) |
|
27 | - { |
|
28 | - if($ajax) |
|
25 | + case SNC_MODE_REGISTER: |
|
26 | + if($config->server_updater_key || $config->server_updater_id) |
|
29 | 27 | { |
30 | - print(SNC_VER_REGISTER_ERROR_REGISTERED); |
|
28 | + if($ajax) |
|
29 | + { |
|
30 | + print(SNC_VER_REGISTER_ERROR_REGISTERED); |
|
31 | + } |
|
32 | + die(); |
|
31 | 33 | } |
32 | - die(); |
|
33 | - } |
|
34 | - $url .= "&name=" . urlencode($config->game_name) . "&url=" . urlencode(SN_ROOT_VIRTUAL); |
|
35 | -//TODO REMOVE DEBUG!!! |
|
36 | -//$url .= "&name=" . urlencode($config->game_name) . "&url=" . urlencode('http://supernova.ws/'); |
|
37 | - break; |
|
34 | + $url .= "&name=" . urlencode($config->game_name) . "&url=" . urlencode(SN_ROOT_VIRTUAL); |
|
35 | + //TODO REMOVE DEBUG!!! |
|
36 | + //$url .= "&name=" . urlencode($config->game_name) . "&url=" . urlencode('http://supernova.ws/'); |
|
37 | + break; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | $check_result = sn_get_url_contents($url); |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | . '&key=' . urlencode($config->server_updater_key) |
21 | 21 | . '&id=' . urlencode($config->server_updater_id); |
22 | 22 | */ |
23 | -switch($mode) |
|
23 | +switch ($mode) |
|
24 | 24 | { |
25 | 25 | case SNC_MODE_REGISTER: |
26 | - if($config->server_updater_key || $config->server_updater_id) |
|
26 | + if ($config->server_updater_key || $config->server_updater_id) |
|
27 | 27 | { |
28 | - if($ajax) |
|
28 | + if ($ajax) |
|
29 | 29 | { |
30 | 30 | print(SNC_VER_REGISTER_ERROR_REGISTERED); |
31 | 31 | } |
@@ -38,11 +38,11 @@ discard block |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | $check_result = sn_get_url_contents($url); |
41 | -if(!$check_result) |
|
41 | +if (!$check_result) |
|
42 | 42 | { |
43 | 43 | $version_check = SNC_VER_ERROR_CONNECT; |
44 | 44 | } |
45 | -elseif(($version_check = intval($check_result)) && $version_check == $check_result) |
|
45 | +elseif (($version_check = intval($check_result)) && $version_check == $check_result) |
|
46 | 46 | { |
47 | 47 | $version_check = $check_result; |
48 | 48 | } |
@@ -52,10 +52,10 @@ discard block |
||
52 | 52 | $check_result = json_decode($check_result, true); |
53 | 53 | $version_check = $check_result === null ? SNC_VER_UNKNOWN_RESPONSE : $check_result['version_check']; |
54 | 54 | |
55 | - switch($mode) |
|
55 | + switch ($mode) |
|
56 | 56 | { |
57 | 57 | case SNC_MODE_REGISTER: |
58 | - if($check_result['site']['site_key'] && $check_result['site']['site_id'] && $check_result['site']['result'] == SNC_VER_REGISTER_REGISTERED) |
|
58 | + if ($check_result['site']['site_key'] && $check_result['site']['site_id'] && $check_result['site']['result'] == SNC_VER_REGISTER_REGISTERED) |
|
59 | 59 | { |
60 | 60 | $config->db_saveItem('server_updater_key', $check_result['site']['site_key']); |
61 | 61 | $config->db_saveItem('server_updater_id', $check_result['site']['site_id']); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $config->db_saveItem('server_updater_check_last', SN_TIME_NOW); |
70 | 70 | $config->db_saveItem('server_updater_check_result', $version_check); |
71 | 71 | |
72 | -if($ajax) |
|
72 | +if ($ajax) |
|
73 | 73 | { |
74 | 74 | define('IN_AJAX', true); |
75 | 75 | print($version_check); |
@@ -41,12 +41,10 @@ |
||
41 | 41 | if(!$check_result) |
42 | 42 | { |
43 | 43 | $version_check = SNC_VER_ERROR_CONNECT; |
44 | -} |
|
45 | -elseif(($version_check = intval($check_result)) && $version_check == $check_result) |
|
44 | +} elseif(($version_check = intval($check_result)) && $version_check == $check_result) |
|
46 | 45 | { |
47 | 46 | $version_check = $check_result; |
48 | -} |
|
49 | -else |
|
47 | +} else |
|
50 | 48 | { |
51 | 49 | // JSON decode if string |
52 | 50 | $check_result = json_decode($check_result, true); |
@@ -14,39 +14,39 @@ discard block |
||
14 | 14 | |
15 | 15 | lng_include('fleet'); |
16 | 16 | |
17 | -if($TargetPlanet = sys_get_param_id('jmpto')) |
|
17 | +if ($TargetPlanet = sys_get_param_id('jmpto')) |
|
18 | 18 | { |
19 | 19 | sn_db_transaction_start(); |
20 | 20 | db_user_by_id($user['id'], true, 'id'); |
21 | 21 | $planetrow = db_planet_by_id($planetrow['id'], true); |
22 | - if(!($NextJumpTime = uni_get_time_to_jump($planetrow))) |
|
22 | + if (!($NextJumpTime = uni_get_time_to_jump($planetrow))) |
|
23 | 23 | { |
24 | 24 | $TargetGate = db_planet_by_id($TargetPlanet, true, '`id`, `last_jump_time`'); |
25 | - if(mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0) |
|
25 | + if (mrc_get_level($user, $TargetGate, STRUC_MOON_GATE) > 0) |
|
26 | 26 | { |
27 | - $NextDestTime = uni_get_time_to_jump ( $TargetGate ); |
|
28 | - if(!$NextDestTime) |
|
27 | + $NextDestTime = uni_get_time_to_jump($TargetGate); |
|
28 | + if (!$NextDestTime) |
|
29 | 29 | { |
30 | 30 | // $SubQueryOri = ""; |
31 | 31 | // $SubQueryDes = ""; |
32 | 32 | $ship_list = sys_get_param('ships'); |
33 | 33 | $db_changeset = array(); |
34 | - foreach($ship_list as $ship_id => $ship_count) |
|
34 | + foreach ($ship_list as $ship_id => $ship_count) |
|
35 | 35 | { |
36 | - if(!in_array($ship_id, sn_get_groups('fleet'))) |
|
36 | + if (!in_array($ship_id, sn_get_groups('fleet'))) |
|
37 | 37 | { |
38 | 38 | continue; |
39 | 39 | } |
40 | 40 | |
41 | 41 | $ship_count = max(0, min(floor($ship_count), mrc_get_level($user, $planetrow, $ship_id))); |
42 | - if($ship_count) |
|
42 | + if ($ship_count) |
|
43 | 43 | { |
44 | 44 | $db_changeset['unit'][] = sn_db_unit_changeset_prepare($ship_id, -$ship_count, $user, $planetrow['id']); |
45 | 45 | $db_changeset['unit'][] = sn_db_unit_changeset_prepare($ship_id, $ship_count, $user, $TargetGate['id']); |
46 | 46 | } |
47 | 47 | } |
48 | 48 | // Dit monsieur, y avait quelque chose a envoyer ??? |
49 | - if(!empty($db_changeset)) |
|
49 | + if (!empty($db_changeset)) |
|
50 | 50 | { |
51 | 51 | db_planet_set_by_id($TargetGate['id'], "`last_jump_time` = " . SN_TIME_NOW . ""); |
52 | 52 | db_planet_set_by_id($planetrow['id'], "`last_jump_time` = " . SN_TIME_NOW . ""); |
@@ -55,31 +55,31 @@ discard block |
||
55 | 55 | db_user_set_by_id($user['id'], "`current_planet` = '{$TargetGate['id']}'"); |
56 | 56 | |
57 | 57 | $planetrow['last_jump_time'] = SN_TIME_NOW; |
58 | - $RetMessage = $lang['gate_jump_done'] ." - ". pretty_time(uni_get_time_to_jump($planetrow)); |
|
58 | + $RetMessage = $lang['gate_jump_done'] . " - " . pretty_time(uni_get_time_to_jump($planetrow)); |
|
59 | 59 | } else { |
60 | 60 | $RetMessage = $lang['gate_wait_data']; |
61 | 61 | } |
62 | 62 | } else { |
63 | - $RetMessage = $lang['gate_wait_dest'] ." - ". pretty_time($NextDestTime); |
|
63 | + $RetMessage = $lang['gate_wait_dest'] . " - " . pretty_time($NextDestTime); |
|
64 | 64 | } |
65 | 65 | } else { |
66 | 66 | $RetMessage = $lang['gate_no_dest_g']; |
67 | 67 | } |
68 | 68 | } else { |
69 | - $RetMessage = $lang['gate_wait_star'] ." - ". pretty_time($NextJumpTime); |
|
69 | + $RetMessage = $lang['gate_wait_star'] . " - " . pretty_time($NextJumpTime); |
|
70 | 70 | } |
71 | 71 | sn_db_transaction_commit(); |
72 | 72 | message($RetMessage, $lang['tech'][STRUC_MOON_GATE], "jumpgate.php", 10); |
73 | 73 | } else { |
74 | 74 | $template = gettemplate('jumpgate', true); |
75 | - if(mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0) |
|
75 | + if (mrc_get_level($user, $planetrow, STRUC_MOON_GATE) > 0) |
|
76 | 76 | { |
77 | 77 | $Combo = ''; |
78 | 78 | $MoonList = db_planet_list_moon_other($user['id'], $planetrow['id']); |
79 | 79 | // while($CurMoon = db_fetch($MoonList)) |
80 | - foreach($MoonList as $CurMoon) |
|
80 | + foreach ($MoonList as $CurMoon) |
|
81 | 81 | { |
82 | - if(mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1) |
|
82 | + if (mrc_get_level($user, $CurMoon, STRUC_MOON_GATE) >= 1) |
|
83 | 83 | { |
84 | 84 | $NextJumpTime = uni_get_time_to_jump($CurMoon); |
85 | 85 | $template->assign_block_vars('moon', array( |
@@ -93,9 +93,9 @@ discard block |
||
93 | 93 | } |
94 | 94 | } |
95 | 95 | |
96 | - foreach(sn_get_groups('fleet') as $Ship) |
|
96 | + foreach (sn_get_groups('fleet') as $Ship) |
|
97 | 97 | { |
98 | - if(($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0) |
|
98 | + if (($ship_count = mrc_get_level($user, $planetrow, $Ship)) <= 0) |
|
99 | 99 | { |
100 | 100 | continue; |
101 | 101 | } |
@@ -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 | message($lang['gate_no_src_ga'], $lang['tech'][STRUC_MOON_GATE], "overview.php", 10); |
122 | 121 | } |
@@ -21,8 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | $sym_defender = $unpacked['D']; |
23 | 23 | $sym_attacker = $unpacked['A']; |
24 | -} |
|
25 | -else |
|
24 | +} else |
|
26 | 25 | { |
27 | 26 | $sym_defender = array(0 => $sym_defender); |
28 | 27 | $sym_attacker = array(1 => $sym_attacker); |
@@ -56,8 +55,7 @@ discard block |
||
56 | 55 | $template = gettemplate('ube_combat_report', true); |
57 | 56 | $template->assign_recursive($template_result); |
58 | 57 | display($template, '', false, '', false, false, true); |
59 | -} |
|
60 | -else |
|
58 | +} else |
|
61 | 59 | { |
62 | 60 | $template = gettemplate('simulator', true); |
63 | 61 | $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
4 | 4 | |
5 | -if(sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG')) |
|
5 | +if (sys_get_param_int('BE_DEBUG') && !defined('BE_DEBUG')) |
|
6 | 6 | { |
7 | 7 | define('BE_DEBUG', true); |
8 | 8 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $sym_defender = $_POST['defender'] ? $_POST['defender'] : array(); |
15 | 15 | $sym_attacker = $_POST['attacker'] ? $_POST['attacker'] : array(); |
16 | 16 | |
17 | -if($replay) |
|
17 | +if ($replay) |
|
18 | 18 | { |
19 | 19 | $unpacked = sn_ube_simulator_decode_replay($replay); |
20 | 20 | |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | $sym_attacker = array(1 => $sym_attacker); |
28 | 28 | } |
29 | 29 | |
30 | -if($_POST['submit'] || $execute) |
|
30 | +if ($_POST['submit'] || $execute) |
|
31 | 31 | { |
32 | 32 | $replay = sn_ube_simulator_encode_replay($sym_defender, 'D'); |
33 | 33 | $replay .= sn_ube_simulator_encode_replay($sym_attacker, 'A'); |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | $template = gettemplate('simulator', true); |
41 | 41 | $techs_and_officers = array(TECH_WEAPON, TECH_SHIELD, TECH_ARMOR, MRC_ADMIRAL); |
42 | 42 | |
43 | - foreach($techs_and_officers as $tech_id) |
|
43 | + foreach ($techs_and_officers as $tech_id) |
|
44 | 44 | { |
45 | - if(!$sym_attacker[1][$tech_id]) |
|
45 | + if (!$sym_attacker[1][$tech_id]) |
|
46 | 46 | { |
47 | 47 | $sym_attacker[1][$tech_id] = mrc_get_level($user, false, $tech_id); |
48 | 48 | } |
@@ -56,14 +56,14 @@ discard block |
||
56 | 56 | UNIT_GOVERNORS => array(MRC_FORTIFIER), |
57 | 57 | UNIT_DEFENCE => sn_get_groups('defense_active'), |
58 | 58 | ); |
59 | - foreach($show_groups as $unit_group_id => $unit_group) |
|
59 | + foreach ($show_groups as $unit_group_id => $unit_group) |
|
60 | 60 | { |
61 | 61 | $template->assign_block_vars('simulator', array( |
62 | 62 | 'GROUP' => $unit_group_id, |
63 | 63 | 'NAME' => $lang['tech'][$unit_group_id], |
64 | 64 | )); |
65 | 65 | |
66 | - foreach($unit_group as $unit_id) |
|
66 | + foreach ($unit_group as $unit_id) |
|
67 | 67 | { |
68 | 68 | $tab++; |
69 | 69 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $result = array(); |
38 | 38 | |
39 | -switch($mode = sys_get_param_str('mode')) { |
|
39 | +switch ($mode = sys_get_param_str('mode')) { |
|
40 | 40 | case 'manage': |
41 | 41 | sn_sys_sector_buy('overview.php?mode=manage'); |
42 | 42 | |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | $template = gettemplate('planet_manage', true); |
47 | 47 | $planet_id = sys_get_param_id('planet_id'); |
48 | 48 | |
49 | - if(sys_get_param_str('rename') && $new_name = sys_get_param_str('new_name')) { |
|
49 | + if (sys_get_param_str('rename') && $new_name = sys_get_param_str('new_name')) { |
|
50 | 50 | $planetrow['name'] = $new_name; |
51 | 51 | // $new_name = db_escape($new_name); |
52 | 52 | db_planet_set_by_id($planetrow['id'], "`name` = '{$new_name}'"); |
53 | - } elseif(sys_get_param_str('action') == 'make_capital') { |
|
53 | + } elseif (sys_get_param_str('action') == 'make_capital') { |
|
54 | 54 | try { |
55 | 55 | sn_db_transaction_start(); |
56 | 56 | $user = db_user_by_id($user['id'], true, '*'); |
@@ -59,15 +59,15 @@ discard block |
||
59 | 59 | // $user = $global_data['user']; |
60 | 60 | // $planetrow = $global_data['planet']; |
61 | 61 | |
62 | - if($planetrow['planet_type'] != PT_PLANET) { |
|
62 | + if ($planetrow['planet_type'] != PT_PLANET) { |
|
63 | 63 | throw new exception($lang['ov_capital_err_not_a_planet'], ERR_ERROR); |
64 | 64 | } |
65 | 65 | |
66 | - if($planetrow['id'] == $user['id_planet']) { |
|
66 | + if ($planetrow['id'] == $user['id_planet']) { |
|
67 | 67 | throw new exception($lang['ov_capital_err_capital_already'], ERR_ERROR); |
68 | 68 | } |
69 | 69 | |
70 | - if($user_dark_matter < $config->planet_capital_cost) { |
|
70 | + if ($user_dark_matter < $config->planet_capital_cost) { |
|
71 | 71 | throw new exception($lang['ov_capital_err_no_dark_matter'], ERR_ERROR); |
72 | 72 | } |
73 | 73 | |
@@ -84,16 +84,16 @@ discard block |
||
84 | 84 | ); |
85 | 85 | sn_db_transaction_commit(); |
86 | 86 | sys_redirect('overview.php?mode=manage'); |
87 | - } catch(exception $e) { |
|
87 | + } catch (exception $e) { |
|
88 | 88 | sn_db_transaction_rollback(); |
89 | 89 | $result[] = array( |
90 | 90 | 'STATUS' => $e->getCode(), |
91 | 91 | 'MESSAGE' => $e->getMessage(), |
92 | 92 | ); |
93 | 93 | } |
94 | - } elseif(sys_get_param_str('action') == 'planet_teleport') { |
|
94 | + } elseif (sys_get_param_str('action') == 'planet_teleport') { |
|
95 | 95 | try { |
96 | - if(!uni_coordinates_valid($new_coordinates = array( |
|
96 | + if (!uni_coordinates_valid($new_coordinates = array( |
|
97 | 97 | 'galaxy' => sys_get_param_int('new_galaxy'), |
98 | 98 | 'system' => sys_get_param_int('new_system'), |
99 | 99 | 'planet' => sys_get_param_int('new_planet'))) |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | // $planetrow = $global_data['planet']; |
111 | 111 | |
112 | 112 | $can_teleport = uni_planet_teleport_check($user, $planetrow, $new_coordinates); |
113 | - if($can_teleport['result'] != ERR_NONE) { |
|
113 | + if ($can_teleport['result'] != ERR_NONE) { |
|
114 | 114 | throw new exception($can_teleport['message'], $can_teleport['result']); |
115 | 115 | } |
116 | 116 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | db_planet_set_by_gspt($planetrow['galaxy'], $planetrow['system'], $planetrow['planet'], PT_ALL, |
122 | 122 | "galaxy = {$new_coordinates['galaxy']}, system = {$new_coordinates['system']}, planet = {$new_coordinates['planet']}, planet_teleport_next = {$planet_teleport_next}"); |
123 | 123 | |
124 | - if($planetrow['id'] == $user['id_planet']) { |
|
124 | + if ($planetrow['id'] == $user['id_planet']) { |
|
125 | 125 | db_user_set_by_id($user['id'], "galaxy = {$new_coordinates['galaxy']}, system = {$new_coordinates['system']}, planet = {$new_coordinates['planet']}"); |
126 | 126 | } |
127 | 127 | |
@@ -134,17 +134,17 @@ discard block |
||
134 | 134 | 'MESSAGE' => $lang['ov_teleport_err_none'], |
135 | 135 | ); |
136 | 136 | sys_redirect('overview.php?mode=manage'); |
137 | - } catch(exception $e) { |
|
137 | + } catch (exception $e) { |
|
138 | 138 | sn_db_transaction_rollback(); |
139 | 139 | $result[] = array( |
140 | 140 | 'STATUS' => $e->getCode(), |
141 | 141 | 'MESSAGE' => $e->getMessage(), |
142 | 142 | ); |
143 | 143 | } |
144 | - } elseif(sys_get_param_str('action') == 'planet_abandon') { |
|
144 | + } elseif (sys_get_param_str('action') == 'planet_abandon') { |
|
145 | 145 | // if(sec_password_check($user['id'], sys_get_param('abandon_confirm'))) { |
146 | - if(classSupernova::$auth->password_check(sys_get_param('abandon_confirm'))) { |
|
147 | - if($user['id_planet'] != $user['current_planet'] && $user['current_planet'] == $planet_id) { |
|
146 | + if (classSupernova::$auth->password_check(sys_get_param('abandon_confirm'))) { |
|
147 | + if ($user['id_planet'] != $user['current_planet'] && $user['current_planet'] == $planet_id) { |
|
148 | 148 | $destroyed = SN_TIME_NOW + 60 * 60 * 24; |
149 | 149 | db_planet_set_by_id($user['current_planet'], "`destruyed`='{$destroyed}', `id_owner`=0"); |
150 | 150 | db_planet_set_by_parent($user['current_planet'], "`destruyed`='{$destroyed}', `id_owner`=0"); |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | message($lang['ov_delete_wrong_planet'], $lang['colony_abandon'], 'overview.php?mode=manage'); |
155 | 155 | } |
156 | 156 | } else { |
157 | - message($lang['ov_delete_wrong_pass'] , $lang['colony_abandon'], 'overview.php?mode=manage'); |
|
157 | + message($lang['ov_delete_wrong_pass'], $lang['colony_abandon'], 'overview.php?mode=manage'); |
|
158 | 158 | } |
159 | - } elseif( |
|
159 | + } elseif ( |
|
160 | 160 | ($hire = sys_get_param_int('hire')) && in_array($hire, sn_get_groups('governors')) |
161 | 161 | && ( |
162 | 162 | !get_unit_param($hire, P_MAX_STACK) || |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | $user = db_user_by_id($user['id'], true); |
172 | 172 | $planetrow = db_planet_by_id($planetrow['id'], true); |
173 | 173 | $build_data = eco_get_build_data($user, $planetrow, $hire, $planetrow['PLANET_GOVERNOR_ID'] == $hire ? $planetrow['PLANET_GOVERNOR_LEVEL'] : 0); |
174 | - if($build_data['CAN'][BUILD_CREATE]) { |
|
175 | - if($planetrow['PLANET_GOVERNOR_ID'] == $hire) { |
|
174 | + if ($build_data['CAN'][BUILD_CREATE]) { |
|
175 | + if ($planetrow['PLANET_GOVERNOR_ID'] == $hire) { |
|
176 | 176 | $planetrow['PLANET_GOVERNOR_LEVEL']++; |
177 | 177 | $query = '`PLANET_GOVERNOR_LEVEL` + 1'; |
178 | 178 | } else { |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | |
199 | 199 | lng_include('mrc_mercenary'); |
200 | 200 | int_planet_pretemplate($planetrow, $template); |
201 | - foreach(sn_get_groups('governors') as $governor_id) { |
|
202 | - if($planetrow['planet_type'] == PT_MOON && $governor_id == MRC_TECHNOLOGIST) { |
|
201 | + foreach (sn_get_groups('governors') as $governor_id) { |
|
202 | + if ($planetrow['planet_type'] == PT_MOON && $governor_id == MRC_TECHNOLOGIST) { |
|
203 | 203 | continue; |
204 | 204 | } |
205 | 205 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | 'PAGE_HINT' => $lang['ov_manage_page_hint'], |
252 | 252 | )); |
253 | 253 | |
254 | - foreach($result as &$a_result) { |
|
254 | + foreach ($result as &$a_result) { |
|
255 | 255 | $template->assign_block_vars('result', $a_result); |
256 | 256 | } |
257 | 257 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | default: |
262 | 262 | sn_sys_sector_buy(); |
263 | 263 | |
264 | - if(sys_get_param_str('rename') && $new_name = sys_get_param_str('new_name')) { |
|
264 | + if (sys_get_param_str('rename') && $new_name = sys_get_param_str('new_name')) { |
|
265 | 265 | $planetrow['name'] = $new_name; |
266 | 266 | $new_name_safe = db_escape($new_name); |
267 | 267 | db_planet_set_by_id($planetrow['id'], "`name` = '{$new_name_safe}'"); |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | |
290 | 290 | $planet_count = 0; |
291 | 291 | $planets_query = db_planet_list_sorted($user, false, '*'); |
292 | - foreach($planets_query as $an_id => $UserPlanet) { |
|
292 | + foreach ($planets_query as $an_id => $UserPlanet) { |
|
293 | 293 | sn_db_transaction_start(); |
294 | 294 | $UserPlanet = sys_o_get_updated($user, $UserPlanet['id'], SN_TIME_NOW, false, true); |
295 | 295 | sn_db_transaction_commit(); |
@@ -300,16 +300,16 @@ discard block |
||
300 | 300 | |
301 | 301 | $planet_fleet_id = 0; |
302 | 302 | $fleet_list = $template_planet['fleet_list']; |
303 | - if($fleet_list['own']['count']) { |
|
303 | + if ($fleet_list['own']['count']) { |
|
304 | 304 | $planet_fleet_id = "p{$UserPlanet['id']}"; |
305 | 305 | $fleets_to_planet[$UserPlanet['id']] = tpl_parse_fleet_sn($fleet_list['own']['total'], $planet_fleet_id); |
306 | 306 | // $fleet_id++;tpl_parse_fleet_sn |
307 | 307 | } |
308 | - if($UserPlanet['planet_type'] == PT_MOON) { |
|
308 | + if ($UserPlanet['planet_type'] == PT_MOON) { |
|
309 | 309 | continue; |
310 | 310 | } |
311 | 311 | $moon = db_planet_by_parent($UserPlanet['id']); |
312 | - if($moon) { |
|
312 | + if ($moon) { |
|
313 | 313 | $moon_fill = min(100, floor($moon['field_current'] / eco_planet_fields_max($moon) * 100)); |
314 | 314 | } else { |
315 | 315 | $moon_fill = 0; |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | tpl_assign_fleet($template, $fleets); |
336 | 336 | |
337 | 337 | $lune = $planetrow['planet_type'] == PT_PLANET ? db_planet_by_parent($planetrow['id']) : db_planet_by_id($planetrow['parent_planet']); |
338 | - if($lune) { |
|
338 | + if ($lune) { |
|
339 | 339 | $template->assign_vars(array( |
340 | 340 | 'MOON_ID' => $lune['id'], |
341 | 341 | 'MOON_IMG' => $lune['image'], |
@@ -347,15 +347,15 @@ discard block |
||
347 | 347 | $planet_fill = $planet_fill > 100 ? 100 : $planet_fill; |
348 | 348 | |
349 | 349 | $planet_recyclers_orbiting = 0; |
350 | - foreach(sn_get_groups('flt_recyclers') as $recycler_id) { |
|
350 | + foreach (sn_get_groups('flt_recyclers') as $recycler_id) { |
|
351 | 351 | $planet_recyclers_orbiting += mrc_get_level($user, $planetrow, $recycler_id); |
352 | 352 | } |
353 | 353 | |
354 | 354 | int_planet_pretemplate($planetrow, $template); |
355 | 355 | |
356 | 356 | $sn_group_ques = sn_get_groups('ques'); |
357 | - if(!defined('GAME_STRUCTURES_DISABLED') || !GAME_STRUCTURES_DISABLED) { |
|
358 | - foreach(array(QUE_STRUCTURES => $sn_group_ques[QUE_STRUCTURES]) as $que_id => $que_type_data) { |
|
357 | + if (!defined('GAME_STRUCTURES_DISABLED') || !GAME_STRUCTURES_DISABLED) { |
|
358 | + foreach (array(QUE_STRUCTURES => $sn_group_ques[QUE_STRUCTURES]) as $que_id => $que_type_data) { |
|
359 | 359 | $this_que = $que['ques'][$que_id][$user['id']][$planetrow['id']]; |
360 | 360 | $template->assign_block_vars('ques', array( |
361 | 361 | 'ID' => $que_id, |
@@ -363,8 +363,8 @@ discard block |
||
363 | 363 | 'LENGTH' => empty($this_que) ? 0 : count($this_que), |
364 | 364 | )); |
365 | 365 | |
366 | - if(!empty($this_que)) { |
|
367 | - foreach($this_que as $que_item) { |
|
366 | + if (!empty($this_que)) { |
|
367 | + foreach ($this_que as $que_item) { |
|
368 | 368 | $template->assign_block_vars('que', que_tpl_parse_element($que_item)); |
369 | 369 | } |
370 | 370 | } |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | 'LENGTH' => $que_hangar_length, |
379 | 379 | )); |
380 | 380 | |
381 | - if(!defined('GAME_DEFENSE_DISABLED') || !GAME_DEFENSE_DISABLED) { |
|
381 | + if (!defined('GAME_DEFENSE_DISABLED') || !GAME_DEFENSE_DISABLED) { |
|
382 | 382 | $que_hangar_length = tpl_assign_hangar($template, $planetrow, SUBQUE_DEFENSE); |
383 | 383 | $template->assign_block_vars('ques', array( |
384 | 384 | 'ID' => SUBQUE_DEFENSE, |
@@ -390,12 +390,12 @@ discard block |
||
390 | 390 | $overview_planet_rows = $user['opt_int_overview_planet_rows']; |
391 | 391 | $overview_planet_columns = $user['opt_int_overview_planet_columns']; |
392 | 392 | |
393 | - if($overview_planet_rows <= 0 && $overview_planet_columns <= 0) { |
|
393 | + if ($overview_planet_rows <= 0 && $overview_planet_columns <= 0) { |
|
394 | 394 | $overview_planet_rows = $user_option_list[OPT_INTERFACE]['opt_int_overview_planet_rows']; |
395 | 395 | $overview_planet_columns = $user_option_list[OPT_INTERFACE]['opt_int_overview_planet_columns']; |
396 | 396 | } |
397 | 397 | |
398 | - if($overview_planet_rows > 0 && $overview_planet_columns <= 0) { |
|
398 | + if ($overview_planet_rows > 0 && $overview_planet_columns <= 0) { |
|
399 | 399 | $overview_planet_columns = ceil($planet_count / $overview_planet_rows); |
400 | 400 | } |
401 | 401 | |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | )); |
453 | 453 | tpl_set_resource_info($template, $planetrow, $fleets_to_planet, 2); |
454 | 454 | |
455 | - foreach($result as &$a_result) { |
|
455 | + foreach ($result as &$a_result) { |
|
456 | 456 | $template->assign_block_vars('result', $a_result); |
457 | 457 | } |
458 | 458 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | include('includes/init.' . substr(strrchr(__FILE__, '.'), 1)); |
17 | 17 | // die(); |
18 | -if($template_result[F_USER_IS_AUTHORIZED]) { |
|
18 | +if ($template_result[F_USER_IS_AUTHORIZED]) { |
|
19 | 19 | sys_redirect('index' . DOT_PHP_EX); |
20 | 20 | } |
21 | 21 | lng_include('login'); |