We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -32,11 +32,16 @@ |
||
32 | 32 | $ship->increaseHardware($hardware_id, $amount); |
33 | 33 | |
34 | 34 | //HoF |
35 | - if ($hardware_id == HARDWARE_COMBAT) $player->increaseHOF($amount, array('Forces', 'Bought', 'Combat Drones'), HOF_ALLIANCE); |
|
36 | - if ($hardware_id == HARDWARE_SCOUT) $player->increaseHOF($amount, array('Forces', 'Bought', 'Scout Drones'), HOF_ALLIANCE); |
|
37 | - if ($hardware_id == HARDWARE_MINE) $player->increaseHOF($amount, array('Forces', 'Bought', 'Mines'), HOF_ALLIANCE); |
|
38 | -} |
|
39 | -elseif ($action == 'Sell') { |
|
35 | + if ($hardware_id == HARDWARE_COMBAT) { |
|
36 | + $player->increaseHOF($amount, array('Forces', 'Bought', 'Combat Drones'), HOF_ALLIANCE); |
|
37 | + } |
|
38 | + if ($hardware_id == HARDWARE_SCOUT) { |
|
39 | + $player->increaseHOF($amount, array('Forces', 'Bought', 'Scout Drones'), HOF_ALLIANCE); |
|
40 | + } |
|
41 | + if ($hardware_id == HARDWARE_MINE) { |
|
42 | + $player->increaseHOF($amount, array('Forces', 'Bought', 'Mines'), HOF_ALLIANCE); |
|
43 | + } |
|
44 | + } elseif ($action == 'Sell') { |
|
40 | 45 | // We only allow selling combat drones |
41 | 46 | if ($hardware_id != HARDWARE_COMBAT) { |
42 | 47 | throw new Exception('This item cannot be sold!'); |
@@ -45,8 +45,7 @@ |
||
45 | 45 | $template->assign('Weapons', $weapons); |
46 | 46 | |
47 | 47 | $template->display('weapon_list.php'); |
48 | -} |
|
49 | -catch (Throwable $e) { |
|
48 | +} catch (Throwable $e) { |
|
50 | 49 | handleException($e); |
51 | 50 | } |
52 | 51 |
@@ -20,7 +20,9 @@ |
||
20 | 20 | } |
21 | 21 | |
22 | 22 | public static function cmpNum($a, $b) { |
23 | - if ($a == $b) return 0; |
|
23 | + if ($a == $b) { |
|
24 | + return 0; |
|
25 | + } |
|
24 | 26 | return (self::$reverseOrder ? -1 : 1) * ($a < $b ? -1 : 1); |
25 | 27 | } |
26 | 28 |
@@ -11,8 +11,7 @@ discard block |
||
11 | 11 | $action = Request::get('action'); |
12 | 12 | if (Request::get('save') == 'Yes') { |
13 | 13 | $save = true; |
14 | -} |
|
15 | -else { |
|
14 | +} else { |
|
16 | 15 | $save = false; |
17 | 16 | } |
18 | 17 | |
@@ -42,8 +41,7 @@ discard block |
||
42 | 41 | $mines = $db2->getInt('sum_m'); |
43 | 42 | $cds = $db2->getInt('cds'); |
44 | 43 | $sds = $db2->getInt('sds'); |
45 | - } |
|
46 | - else { |
|
44 | + } else { |
|
47 | 45 | $mines = 0; |
48 | 46 | $cds = 0; |
49 | 47 | $sds = 0; |
@@ -143,16 +141,25 @@ discard block |
||
143 | 141 | $owner = $db->getInt('owner_id'); |
144 | 142 | |
145 | 143 | $db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 1'); |
146 | - if ($db2->nextRecord()) $gens = $db2->getInt('amount'); |
|
147 | - else $gens = 0; |
|
144 | + if ($db2->nextRecord()) { |
|
145 | + $gens = $db2->getInt('amount'); |
|
146 | + } else { |
|
147 | + $gens = 0; |
|
148 | + } |
|
148 | 149 | |
149 | 150 | $db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 2'); |
150 | - if ($db2->nextRecord()) $hangs = $db2->getInt('amount'); |
|
151 | - else $hangs = 0; |
|
151 | + if ($db2->nextRecord()) { |
|
152 | + $hangs = $db2->getInt('amount'); |
|
153 | + } else { |
|
154 | + $hangs = 0; |
|
155 | + } |
|
152 | 156 | |
153 | 157 | $db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 3'); |
154 | - if ($db2->nextRecord()) $turs = $db2->getInt('amount'); |
|
155 | - else $turs = 0; |
|
158 | + if ($db2->nextRecord()) { |
|
159 | + $turs = $db2->getInt('amount'); |
|
160 | + } else { |
|
161 | + $turs = 0; |
|
162 | + } |
|
156 | 163 | |
157 | 164 | // insert into history db |
158 | 165 | $history_db_sql[] = 'INSERT INTO planet (game_id, sector_id, owner_id, generators, hangers, turrets) VALUES ' . |
@@ -189,14 +196,21 @@ discard block |
||
189 | 196 | $smrCredits = 0; |
190 | 197 | $db2->query('SELECT sum(amount) as bounty_am, sum(smr_credits) as bounty_cred FROM bounty WHERE game_id = '.$game_id.' AND account_id = '.$acc_id.' AND claimer_id = 0'); |
191 | 198 | if ($db2->nextRecord()) { |
192 | - if (is_int($db2->getField('bounty_am'))) $amount = $db2->getInt('bounty_am'); |
|
193 | - if (is_int($db2->getField('bounty_cred'))) $smrCredits = $db2->getInt('bounty_cred'); |
|
199 | + if (is_int($db2->getField('bounty_am'))) { |
|
200 | + $amount = $db2->getInt('bounty_am'); |
|
201 | + } |
|
202 | + if (is_int($db2->getField('bounty_cred'))) { |
|
203 | + $smrCredits = $db2->getInt('bounty_cred'); |
|
204 | + } |
|
194 | 205 | |
195 | 206 | } |
196 | 207 | |
197 | 208 | $db2->query('SELECT * FROM ship_has_name WHERE game_id = '.$game_id.' AND account_id = '.$acc_id); |
198 | - if ($db2->nextRecord()) $ship_name = $db2->getField('ship_name'); |
|
199 | - else $ship_name = 'None'; |
|
209 | + if ($db2->nextRecord()) { |
|
210 | + $ship_name = $db2->getField('ship_name'); |
|
211 | + } else { |
|
212 | + $ship_name = 'None'; |
|
213 | + } |
|
200 | 214 | |
201 | 215 | // insert into history db |
202 | 216 | $history_db_sql[] = 'INSERT INTO player (account_id, game_id, player_name, player_id, experience, ship, race, alignment, alliance_id, kills, deaths, bounty, bounty_cred, ship_name) ' . |
@@ -244,9 +258,15 @@ discard block |
||
244 | 258 | $mines = $db2->getInt('sum_mines'); |
245 | 259 | $cds = $db2->getInt('cds'); |
246 | 260 | $sds = $db2->getInt('sds'); |
247 | - if (!is_numeric($mines)) $mines = 0; |
|
248 | - if (!is_numeric($cds)) $cds = 0; |
|
249 | - if (!is_numeric($sds)) $sds = 0; |
|
261 | + if (!is_numeric($mines)) { |
|
262 | + $mines = 0; |
|
263 | + } |
|
264 | + if (!is_numeric($cds)) { |
|
265 | + $cds = 0; |
|
266 | + } |
|
267 | + if (!is_numeric($sds)) { |
|
268 | + $sds = 0; |
|
269 | + } |
|
250 | 270 | |
251 | 271 | } else { |
252 | 272 |
@@ -105,13 +105,15 @@ |
||
105 | 105 | $numberOfPlanets = Request::getInt('type' . $planetTypeID); |
106 | 106 | for ($i = 1; $i <= $numberOfPlanets; $i++) { |
107 | 107 | $galSector = $galSectors[array_rand($galSectors)]; |
108 | - while ($galSector->hasPlanet()) $galSector = $galSectors[array_rand($galSectors)]; //1 per sector |
|
108 | + while ($galSector->hasPlanet()) { |
|
109 | + $galSector = $galSectors[array_rand($galSectors)]; |
|
110 | + } |
|
111 | + //1 per sector |
|
109 | 112 | $galSector->createPlanet($planetTypeID); |
110 | 113 | } |
111 | 114 | } |
112 | 115 | $var['message'] = '<span class="green">Success</span> : Succesfully added planets.'; |
113 | -} |
|
114 | -elseif ($submit == 'Create Ports') { |
|
116 | +} elseif ($submit == 'Create Ports') { |
|
115 | 117 | $numLevelPorts = []; |
116 | 118 | for ($i = 1; $i <= SmrPort::MAX_LEVEL; $i++) { |
117 | 119 | $numLevelPorts[$i] = Request::getInt('port' . $i); |
@@ -5,8 +5,7 @@ discard block |
||
5 | 5 | echo $CombatPlanet->getCombatName(); |
6 | 6 | if($TotalDamage > 0) { |
7 | 7 | ?> hit for a total of <span class="red"><?php echo $TotalDamage; ?></span> damage in this round of combat of which <span class="red"><?php echo $PlanetCombatResults['TotalDamagePerTargetPlayer'][$ThisPlayer->getAccountID()]; ?></span> was done to you<?php |
8 | - } |
|
9 | - else { |
|
8 | + } else { |
|
10 | 9 | ?> does no damage this round<?php |
11 | 10 | } ?>. <?php echo $AttackLogLink; |
12 | 11 | return; |
@@ -23,24 +22,19 @@ discard block |
||
23 | 22 | if (!$ShotHit || !$ActualDamage['TargetAlreadyDead']) { |
24 | 23 | if(!$ShotHit) { |
25 | 24 | ?> and misses<?php |
26 | - } |
|
27 | - else if($ActualDamage['TotalDamage'] == 0) { |
|
25 | + } else if($ActualDamage['TotalDamage'] == 0) { |
|
28 | 26 | if($WeaponDamage['Shield'] > 0) { |
29 | 27 | if($ActualDamage['HasCDs']) { |
30 | 28 | ?> which proves ineffective against their combat drones<?php |
31 | - } |
|
32 | - else { |
|
29 | + } else { |
|
33 | 30 | ?> which washes harmlessly over their hull<?php |
34 | 31 | } |
35 | - } |
|
36 | - else if($WeaponDamage['Armour'] > 0) { |
|
32 | + } else if($WeaponDamage['Armour'] > 0) { |
|
37 | 33 | ?> which is deflected by their shields<?php |
38 | - } |
|
39 | - else { |
|
34 | + } else { |
|
40 | 35 | ?> but it cannot do any damage<?php |
41 | 36 | } |
42 | - } |
|
43 | - else { |
|
37 | + } else { |
|
44 | 38 | ?> destroying <?php |
45 | 39 | $DamageTypes = 0; |
46 | 40 | if($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; } |
@@ -79,27 +73,22 @@ discard block |
||
79 | 73 | echo $CombatPlanet->getCombatName(); |
80 | 74 | if($WeaponDamage['Launched'] == 0) { |
81 | 75 | ?> fails to launch it's combat drones<?php |
82 | - } |
|
83 | - else { |
|
76 | + } else { |
|
84 | 77 | ?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at <?php if($ActualDamage['TargetAlreadyDead']){ ?>the debris that was once <?php } echo $TargetPlayer->getDisplayName(); |
85 | 78 | if(!$ActualDamage['TargetAlreadyDead']) { |
86 | 79 | if($ActualDamage['TotalDamage'] == 0) { |
87 | 80 | if($WeaponDamage['Shield'] > 0) { |
88 | 81 | if($ActualDamage['HasCDs']) { |
89 | 82 | ?> which prove ineffective against their combat drones<?php |
90 | - } |
|
91 | - else { |
|
83 | + } else { |
|
92 | 84 | ?> which washes harmlessly over their hull<?php |
93 | 85 | } |
94 | - } |
|
95 | - else if($WeaponDamage['Armour'] > 0) { |
|
86 | + } else if($WeaponDamage['Armour'] > 0) { |
|
96 | 87 | ?> which is deflected by their shields<?php |
97 | - } |
|
98 | - else { |
|
88 | + } else { |
|
99 | 89 | ?> but they cannot do any damage<?php |
100 | 90 | } |
101 | - } |
|
102 | - else { |
|
91 | + } else { |
|
103 | 92 | ?> destroying <?php |
104 | 93 | if($ActualDamage['Shield'] > 0) { |
105 | 94 | ?><span class="shields"><?php echo number_format($ActualDamage['Shield']); ?></span> shields<?php |
@@ -124,7 +113,6 @@ discard block |
||
124 | 113 | echo $CombatPlanet->getCombatName(); |
125 | 114 | if($TotalDamage > 0) { |
126 | 115 | ?> hit for a total of <span class="red"><?php echo $TotalDamage; ?></span> damage in this round of combat<?php |
127 | -} |
|
128 | -else { |
|
116 | +} else { |
|
129 | 117 | ?> does no damage this round. You call that a planet? It needs a better builder<?php |
130 | 118 | } ?>. |