We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -18,8 +18,7 @@ |
||
18 | 18 | if ($join === false) { |
19 | 19 | create_error('Join Date is not valid!'); |
20 | 20 | } |
21 | -$start = empty(Request::get('game_start')) ? $join : |
|
22 | - DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
21 | +$start = empty(Request::get('game_start')) ? $join : DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
23 | 22 | if ($start === false) { |
24 | 23 | create_error('Start Date is not valid!'); |
25 | 24 | } |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | 1 => array("pipe", "w") // stdout is a pipe that the child will write to |
20 | 20 | ); |
21 | 21 | $engine = proc_open(UCI_CHESS_ENGINE, $descriptorSpec, $pipes); |
22 | - $toEngine =& $pipes[0]; |
|
23 | - $fromEngine =& $pipes[1]; |
|
22 | + $toEngine = & $pipes[0]; |
|
23 | + $fromEngine = & $pipes[1]; |
|
24 | 24 | |
25 | 25 | function readFromEngine($block = true) { |
26 | 26 | global $fromEngine; |
@@ -84,5 +84,5 @@ discard block |
||
84 | 84 | function debug($message, $debugObject = null) { |
85 | 85 | global $account, $var, $db; |
86 | 86 | echo date('Y-m-d H:i:s - ') . $message . ($debugObject !== null ? EOL . var_export($debugObject, true) : '') . EOL; |
87 | - $db->query('INSERT INTO npc_logs (script_id, npc_id, time, message, debug_info, var) VALUES (' . (defined('SCRIPT_ID') ? SCRIPT_ID : 0) . ', ' . (is_object($account) ? $account->getAccountID() : 0) . ',NOW(),' . $db->escapeString($message) . ',' . $db->escapeString(var_export($debugObject,true)) . ',' . $db->escapeString(var_export($var, true)) . ')'); |
|
87 | + $db->query('INSERT INTO npc_logs (script_id, npc_id, time, message, debug_info, var) VALUES (' . (defined('SCRIPT_ID') ? SCRIPT_ID : 0) . ', ' . (is_object($account) ? $account->getAccountID() : 0) . ',NOW(),' . $db->escapeString($message) . ',' . $db->escapeString(var_export($debugObject, true)) . ',' . $db->escapeString(var_export($var, true)) . ')'); |
|
88 | 88 | } |
@@ -374,13 +374,13 @@ |
||
374 | 374 | $this->db->query('SELECT type,sum(amount) as amount FROM player_hof WHERE ' . $this->SQL . ' AND game_id IN (SELECT game_id FROM game WHERE ignore_stats = \'FALSE\') GROUP BY type'); |
375 | 375 | $this->HOF = array(); |
376 | 376 | while ($this->db->nextRecord()) { |
377 | - $hof =& $this->HOF; |
|
377 | + $hof = & $this->HOF; |
|
378 | 378 | $typeList = explode(':', $this->db->getField('type')); |
379 | 379 | foreach ($typeList as $type) { |
380 | 380 | if (!isset($hof[$type])) { |
381 | 381 | $hof[$type] = array(); |
382 | 382 | } |
383 | - $hof =& $hof[$type]; |
|
383 | + $hof = & $hof[$type]; |
|
384 | 384 | } |
385 | 385 | $hof = $this->db->getFloat('amount'); |
386 | 386 | } |
@@ -79,12 +79,12 @@ discard block |
||
79 | 79 | 'exp_gain' => 540, |
80 | 80 | ], |
81 | 81 | ]; |
82 | - public function name() { return "Terran Planet"; } |
|
83 | - public function imageLink() { return "images/planet1.png"; } |
|
84 | - public function description() { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; } |
|
82 | + public function name() { return "Terran Planet"; } |
|
83 | + public function imageLink() { return "images/planet1.png"; } |
|
84 | + public function description() { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; } |
|
85 | 85 | public function maxAttackers() { return 10; } |
86 | - public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
87 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
86 | + public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
87 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | class AridPlanet extends SmrPlanetType { |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | 'exp_gain' => 180, |
109 | 109 | ], |
110 | 110 | ]; |
111 | - public function name() { return "Arid Planet"; } |
|
112 | - public function imageLink() { return "images/planet2.png"; } |
|
113 | - public function description() { return "A world mostly devoid of surface water, but capable of supporting life."; } |
|
111 | + public function name() { return "Arid Planet"; } |
|
112 | + public function imageLink() { return "images/planet2.png"; } |
|
113 | + public function description() { return "A world mostly devoid of surface water, but capable of supporting life."; } |
|
114 | 114 | public function maxAttackers() { return 5; } |
115 | - public function maxLanded() { return 5; } |
|
116 | - public function menuOptions() { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; } |
|
115 | + public function maxLanded() { return 5; } |
|
116 | + public function menuOptions() { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; } |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | class DwarfPlanet extends SmrPlanetType { |
@@ -137,12 +137,12 @@ discard block |
||
137 | 137 | 'exp_gain' => 540, |
138 | 138 | ], |
139 | 139 | ]; |
140 | - public function name() { return "Dwarf Planet"; } |
|
141 | - public function imageLink() { return "images/planet3.png"; } |
|
142 | - public function description() { return "A smaller than usual planet, with no native life present."; } |
|
140 | + public function name() { return "Dwarf Planet"; } |
|
141 | + public function imageLink() { return "images/planet3.png"; } |
|
142 | + public function description() { return "A smaller than usual planet, with no native life present."; } |
|
143 | 143 | public function maxAttackers() { return 5; } |
144 | - public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
145 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
144 | + public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
145 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | class ProtoPlanet extends SmrPlanetType { |
@@ -178,12 +178,12 @@ discard block |
||
178 | 178 | 'exp_gain' => 540, |
179 | 179 | ], |
180 | 180 | ]; |
181 | - public function name() { return "Protoplanet"; } |
|
182 | - public function imageLink() { return "images/planet5.png"; } |
|
183 | - public function description() { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; } |
|
181 | + public function name() { return "Protoplanet"; } |
|
182 | + public function imageLink() { return "images/planet5.png"; } |
|
183 | + public function description() { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; } |
|
184 | 184 | public function maxAttackers() { return 5; } |
185 | - public function maxLanded() { return 5; } |
|
186 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
185 | + public function maxLanded() { return 5; } |
|
186 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | class DefenseWorld extends SmrPlanetType { |
@@ -213,10 +213,10 @@ discard block |
||
213 | 213 | 'exp_gain' => 9, |
214 | 214 | ], |
215 | 215 | ]; |
216 | - public function name() { return "Defense World"; } |
|
217 | - public function imageLink() { return "images/planet4.png"; } |
|
218 | - public function description() { return "A fully armed and operational battle station loaded with excessive firepower."; } |
|
216 | + public function name() { return "Defense World"; } |
|
217 | + public function imageLink() { return "images/planet4.png"; } |
|
218 | + public function description() { return "A fully armed and operational battle station loaded with excessive firepower."; } |
|
219 | 219 | public function maxAttackers() { return 10; } |
220 | - public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
221 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
220 | + public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
221 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
222 | 222 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | $template->assign('OurRank', $ourRank); |
26 | 26 | } |
27 | 27 | |
28 | -$expRanks = function (int $minRank, int $maxRank) use ($player, $db) : array { |
|
28 | +$expRanks = function(int $minRank, int $maxRank) use ($player, $db) : array { |
|
29 | 29 | $offset = $minRank - 1; |
30 | 30 | $limit = $maxRank - $offset; |
31 | 31 | $db->query('SELECT alliance_id, COALESCE(SUM(experience), 0) amount |
@@ -1,30 +1,30 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | 3 | class DummyPlayer extends AbstractSmrPlayer { |
4 | - public function __construct($gameID=0,$playerName='Dummy',$raceID=1,$experience=1000,$alignment=100,$allianceID=0,$shipTypeID=60) { |
|
4 | + public function __construct($gameID = 0, $playerName = 'Dummy', $raceID = 1, $experience = 1000, $alignment = 100, $allianceID = 0, $shipTypeID = 60) { |
|
5 | 5 | $this->accountID = 0; |
6 | - $this->gameID = (int) $gameID; |
|
7 | - $this->playerName = (string) $playerName; |
|
6 | + $this->gameID = (int)$gameID; |
|
7 | + $this->playerName = (string)$playerName; |
|
8 | 8 | $this->playerID = 0; |
9 | 9 | $this->sectorID = 0; |
10 | - $this->lastSectorID = 0; |
|
10 | + $this->lastSectorID = 0; |
|
11 | 11 | $this->turns = 1000; |
12 | - $this->newbieTurns = 0; |
|
12 | + $this->newbieTurns = 0; |
|
13 | 13 | $this->lastNewsUpdate = 0; |
14 | 14 | $this->dead = false; |
15 | 15 | $this->landedOnPlanet = false; |
16 | - $this->lastActive = 0; |
|
17 | - $this->lastCPLAction = 0; |
|
18 | - $this->raceID = (int) $raceID; |
|
19 | - $this->credits = 0; |
|
20 | - $this->experience = (int) $experience; |
|
21 | - $this->alignment = (int) $alignment; |
|
22 | - $this->militaryPayment = 0; |
|
23 | - $this->allianceID = (int) $allianceID; |
|
24 | - $this->shipID = (int) $shipTypeID; |
|
16 | + $this->lastActive = 0; |
|
17 | + $this->lastCPLAction = 0; |
|
18 | + $this->raceID = (int)$raceID; |
|
19 | + $this->credits = 0; |
|
20 | + $this->experience = (int)$experience; |
|
21 | + $this->alignment = (int)$alignment; |
|
22 | + $this->militaryPayment = 0; |
|
23 | + $this->allianceID = (int)$allianceID; |
|
24 | + $this->shipID = (int)$shipTypeID; |
|
25 | 25 | $this->kills = 0; |
26 | 26 | $this->deaths = 0; |
27 | - $this->lastPort = 0; |
|
27 | + $this->lastPort = 0; |
|
28 | 28 | $this->bank = 0; |
29 | 29 | $this->zoom = 0; |
30 | 30 | |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | public function setAllianceID($ID) { |
51 | - if($this->allianceID == $ID) |
|
51 | + if ($this->allianceID == $ID) |
|
52 | 52 | return; |
53 | - $this->allianceID=$ID; |
|
53 | + $this->allianceID = $ID; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | public function killPlayerByPlayer(AbstractSmrPlayer $killer) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $db = MySqlDatabase::getInstance(); |
77 | 77 | $db->query('REPLACE INTO cached_dummys ' . |
78 | 78 | '(type, id, info) ' . |
79 | - 'VALUES (\'DummyPlayer\', '.$db->escapeString($this->getPlayerName()).', '.$db->escapeString($cache).')'); |
|
79 | + 'VALUES (\'DummyPlayer\', ' . $db->escapeString($this->getPlayerName()) . ', ' . $db->escapeString($cache) . ')'); |
|
80 | 80 | unserialize($cache); |
81 | 81 | } |
82 | 82 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $db->query('SELECT info FROM cached_dummys |
86 | 86 | WHERE type = \'DummyPlayer\' |
87 | 87 | AND id = ' . $db->escapeString($name) . ' LIMIT 1'); |
88 | - if($db->nextRecord()) { |
|
88 | + if ($db->nextRecord()) { |
|
89 | 89 | $return = unserialize($db->getField('info')); |
90 | 90 | return $return; |
91 | 91 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $db->query('SELECT id FROM cached_dummys |
101 | 101 | WHERE type = \'DummyPlayer\''); |
102 | 102 | $dummyNames = array(); |
103 | - while($db->nextRecord()) { |
|
103 | + while ($db->nextRecord()) { |
|
104 | 104 | $dummyNames[] = $db->getField('id'); |
105 | 105 | } |
106 | 106 | return $dummyNames; |
@@ -1711,7 +1711,7 @@ discard block |
||
1711 | 1711 | create_error('The saved sector must be in the box!'); |
1712 | 1712 | } |
1713 | 1713 | |
1714 | - $storedDestinations =& $this->getStoredDestinations(); |
|
1714 | + $storedDestinations = & $this->getStoredDestinations(); |
|
1715 | 1715 | foreach ($storedDestinations as &$sd) { |
1716 | 1716 | if ($sd['SectorID'] == $sectorID) { |
1717 | 1717 | $sd['OffsetTop'] = $offsetTop; |
@@ -2034,13 +2034,13 @@ discard block |
||
2034 | 2034 | $this->db->query('SELECT type,amount FROM player_hof WHERE ' . $this->SQL); |
2035 | 2035 | $this->HOF = array(); |
2036 | 2036 | while ($this->db->nextRecord()) { |
2037 | - $hof =& $this->HOF; |
|
2037 | + $hof = & $this->HOF; |
|
2038 | 2038 | $typeList = explode(':', $this->db->getField('type')); |
2039 | 2039 | foreach ($typeList as $type) { |
2040 | 2040 | if (!isset($hof[$type])) { |
2041 | 2041 | $hof[$type] = array(); |
2042 | 2042 | } |
2043 | - $hof =& $hof[$type]; |
|
2043 | + $hof = & $hof[$type]; |
|
2044 | 2044 | } |
2045 | 2045 | $hof = $this->db->getFloat('amount'); |
2046 | 2046 | } |
@@ -2119,8 +2119,8 @@ discard block |
||
2119 | 2119 | } |
2120 | 2120 | self::$HOFVis[$hofType] = $visibility; |
2121 | 2121 | |
2122 | - $hof =& $this->HOF; |
|
2123 | - $hofChanged =& $this->hasHOFChanged; |
|
2122 | + $hof = & $this->HOF; |
|
2123 | + $hofChanged = & $this->hasHOFChanged; |
|
2124 | 2124 | $new = false; |
2125 | 2125 | foreach ($typeList as $type) { |
2126 | 2126 | if (!isset($hofChanged[$type])) { |
@@ -2130,8 +2130,8 @@ discard block |
||
2130 | 2130 | $hof[$type] = array(); |
2131 | 2131 | $new = true; |
2132 | 2132 | } |
2133 | - $hof =& $hof[$type]; |
|
2134 | - $hofChanged =& $hofChanged[$type]; |
|
2133 | + $hof = & $hof[$type]; |
|
2134 | + $hofChanged = & $hofChanged[$type]; |
|
2135 | 2135 | } |
2136 | 2136 | if ($hofChanged == null) { |
2137 | 2137 | $hofChanged = self::HOF_CHANGED; |
@@ -2780,7 +2780,7 @@ discard block |
||
2780 | 2780 | 'Starting Sector' => $this->getSectorID() |
2781 | 2781 | ); |
2782 | 2782 | |
2783 | - $this->missions[$missionID] =& $mission; |
|
2783 | + $this->missions[$missionID] = & $mission; |
|
2784 | 2784 | $this->setupMissionStep($missionID); |
2785 | 2785 | $this->rebuildMission($missionID); |
2786 | 2786 | |
@@ -2830,7 +2830,7 @@ discard block |
||
2830 | 2830 | |
2831 | 2831 | public function claimMissionReward($missionID) { |
2832 | 2832 | $this->getMissions(); |
2833 | - $mission =& $this->missions[$missionID]; |
|
2833 | + $mission = & $this->missions[$missionID]; |
|
2834 | 2834 | if ($mission === false) { |
2835 | 2835 | throw new Exception('Unknown mission: ' . $missionID); |
2836 | 2836 | } |
@@ -1,79 +1,79 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | -$template->assign('PageTopic','Combat Simulator'); |
|
2 | +$template->assign('PageTopic', 'Combat Simulator'); |
|
3 | 3 | |
4 | -$template->assign('EditDummysLink',SmrSession::getNewHREF(create_container('skeleton.php','edit_dummys.php'))); |
|
4 | +$template->assign('EditDummysLink', SmrSession::getNewHREF(create_container('skeleton.php', 'edit_dummys.php'))); |
|
5 | 5 | $template->assign('DummyNames', DummyPlayer::getDummyPlayerNames()); |
6 | 6 | |
7 | 7 | $duplicates = false; |
8 | 8 | $usedNames = array(); |
9 | 9 | $realAttackers = array(); |
10 | 10 | $attackers = array(); |
11 | -$i=1; |
|
12 | -if(isset($_POST['attackers'])) |
|
13 | - foreach($_POST['attackers'] as $attackerName) { |
|
14 | - if($attackerName=='none') |
|
11 | +$i = 1; |
|
12 | +if (isset($_POST['attackers'])) |
|
13 | + foreach ($_POST['attackers'] as $attackerName) { |
|
14 | + if ($attackerName == 'none') |
|
15 | 15 | continue; |
16 | - if(isset($usedNames[$attackerName])) { |
|
16 | + if (isset($usedNames[$attackerName])) { |
|
17 | 17 | $duplicates = true; |
18 | 18 | continue; |
19 | 19 | } |
20 | 20 | $usedNames[$attackerName] = true; |
21 | - $attackers[$i] =& DummyPlayer::getCachedDummyPlayer($attackerName); |
|
21 | + $attackers[$i] = & DummyPlayer::getCachedDummyPlayer($attackerName); |
|
22 | 22 | $attackers[$i]->setAllianceID(1); |
23 | - $realAttackers[$i] =& $attackers[$i]; |
|
23 | + $realAttackers[$i] = & $attackers[$i]; |
|
24 | 24 | ++$i; |
25 | 25 | } |
26 | 26 | |
27 | -for(;$i<=10;++$i) |
|
27 | +for (;$i <= 10; ++$i) |
|
28 | 28 | $attackers[$i] = null; |
29 | -$template->assign('Attackers',$attackers); |
|
29 | +$template->assign('Attackers', $attackers); |
|
30 | 30 | |
31 | -$i=1; |
|
31 | +$i = 1; |
|
32 | 32 | $realDefenders = array(); |
33 | 33 | $defenders = array(); |
34 | -if(isset($_POST['defenders'])) |
|
35 | - foreach($_POST['defenders'] as $defenderName) { |
|
36 | - if($defenderName=='none') |
|
34 | +if (isset($_POST['defenders'])) |
|
35 | + foreach ($_POST['defenders'] as $defenderName) { |
|
36 | + if ($defenderName == 'none') |
|
37 | 37 | continue; |
38 | - if(isset($usedNames[$defenderName])) { |
|
38 | + if (isset($usedNames[$defenderName])) { |
|
39 | 39 | $duplicates = true; |
40 | 40 | continue; |
41 | 41 | } |
42 | 42 | $usedNames[$attackerName] = true; |
43 | - $defenders[$i] =& DummyPlayer::getCachedDummyPlayer($defenderName); |
|
43 | + $defenders[$i] = & DummyPlayer::getCachedDummyPlayer($defenderName); |
|
44 | 44 | $defenders[$i]->setAllianceID(2); |
45 | - $realDefenders[$i] =& $defenders[$i]; |
|
45 | + $realDefenders[$i] = & $defenders[$i]; |
|
46 | 46 | ++$i; |
47 | 47 | } |
48 | 48 | |
49 | -for(;$i<=10;++$i) |
|
49 | +for (;$i <= 10; ++$i) |
|
50 | 50 | $defenders[$i] = null; |
51 | -$template->assign('Defenders',$defenders); |
|
51 | +$template->assign('Defenders', $defenders); |
|
52 | 52 | |
53 | -$template->assign('Duplicates',$duplicates); |
|
53 | +$template->assign('Duplicates', $duplicates); |
|
54 | 54 | |
55 | -$template->assign('CombatSimHREF',SmrSession::getNewHREF(create_container('skeleton.php','combat_simulator.php'))); |
|
55 | +$template->assign('CombatSimHREF', SmrSession::getNewHREF(create_container('skeleton.php', 'combat_simulator.php'))); |
|
56 | 56 | |
57 | 57 | if (!empty($realAttackers) && !empty($realDefenders)) { |
58 | - if(isset($_REQUEST['run'])) { |
|
59 | - runAnAttack($realAttackers,$realDefenders); |
|
58 | + if (isset($_REQUEST['run'])) { |
|
59 | + runAnAttack($realAttackers, $realDefenders); |
|
60 | 60 | } |
61 | - if(isset($_REQUEST['death_run'])) { |
|
62 | - while(count($realAttackers)>0 && count($realDefenders)>0) { |
|
63 | - runAnAttack($realAttackers,$realDefenders); |
|
64 | - foreach($realAttackers as $key => &$teamPlayer) { |
|
65 | - if($teamPlayer->isDead()) |
|
61 | + if (isset($_REQUEST['death_run'])) { |
|
62 | + while (count($realAttackers) > 0 && count($realDefenders) > 0) { |
|
63 | + runAnAttack($realAttackers, $realDefenders); |
|
64 | + foreach ($realAttackers as $key => &$teamPlayer) { |
|
65 | + if ($teamPlayer->isDead()) |
|
66 | 66 | unset($realAttackers[$key]); |
67 | 67 | } unset($teamPlayer); |
68 | - foreach($realDefenders as $key => &$teamPlayer) { |
|
69 | - if($teamPlayer->isDead()) |
|
68 | + foreach ($realDefenders as $key => &$teamPlayer) { |
|
69 | + if ($teamPlayer->isDead()) |
|
70 | 70 | unset($realDefenders[$key]); |
71 | 71 | } unset($teamPlayer); |
72 | 72 | } |
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | -function runAnAttack($realAttackers,$realDefenders) { |
|
76 | +function runAnAttack($realAttackers, $realDefenders) { |
|
77 | 77 | global $template; |
78 | 78 | $results = array('Attackers' => array('Traders' => array(), 'TotalDamage' => 0), |
79 | 79 | 'Defenders' => array('Traders' => array(), 'TotalDamage' => 0)); |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | } |
85 | 85 | foreach ($realDefenders as $accountID => $teamPlayer) { |
86 | 86 | $playerResults = $teamPlayer->shootPlayers($realAttackers); |
87 | - $results['Defenders']['Traders'][] = $playerResults; |
|
87 | + $results['Defenders']['Traders'][] = $playerResults; |
|
88 | 88 | $results['Defenders']['TotalDamage'] += $playerResults['TotalDamage']; |
89 | 89 | } |
90 | - $template->assign('TraderCombatResults',$results); |
|
90 | + $template->assign('TraderCombatResults', $results); |
|
91 | 91 | } |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | } else { |
41 | 41 | ?> destroying <?php |
42 | 42 | $DamageTypes = 0; |
43 | - if ($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
44 | - if ($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
45 | - if ($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
43 | + if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
44 | + if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
45 | + if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
46 | 46 | |
47 | 47 | if ($ActualDamage['Shield'] > 0) { |
48 | 48 | ?><span class="shields"><?php echo number_format($ActualDamage['Shield']) ?></span> shields<?php |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | } ?>. |
60 | 60 | <br /><?php |
61 | 61 | if ($ShotHit && $ActualDamage['KillingShot']) { |
62 | - $this->includeTemplate('includes/TraderCombatKillMessage.inc.php',array('KillResults'=>$WeaponResults['KillResults'],'TargetPlayer'=>$TargetPlayer,'ShootingPlayer'=>$ShootingPlayer)); |
|
62 | + $this->includeTemplate('includes/TraderCombatKillMessage.inc.php', array('KillResults'=>$WeaponResults['KillResults'], 'TargetPlayer'=>$TargetPlayer, 'ShootingPlayer'=>$ShootingPlayer)); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | } |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | $WeaponDamage = $Drones['WeaponDamage']; |
70 | 70 | $TargetPlayer = $Drones['TargetPlayer']; |
71 | 71 | $DamageTypes = 0; |
72 | - if ($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
73 | - if ($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
74 | - if ($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
72 | + if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
73 | + if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
74 | + if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
75 | 75 | |
76 | 76 | echo $ShootingPlayer->getDisplayName(); |
77 | 77 | if ($WeaponDamage['Launched'] == 0) { |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } ?>. |
115 | 115 | <br /><?php |
116 | 116 | if ($ActualDamage['KillingShot']) { |
117 | - $this->includeTemplate('includes/TraderCombatKillMessage.inc.php',array('KillResults'=>$Drones['KillResults'],'TargetPlayer'=>$TargetPlayer,'ShootingPlayer'=>$ShootingPlayer)); |
|
117 | + $this->includeTemplate('includes/TraderCombatKillMessage.inc.php', array('KillResults'=>$Drones['KillResults'], 'TargetPlayer'=>$TargetPlayer, 'ShootingPlayer'=>$ShootingPlayer)); |
|
118 | 118 | } |
119 | 119 | } |
120 | 120 | } |
@@ -130,4 +130,4 @@ discard block |
||
130 | 130 | } |
131 | 131 | } |
132 | 132 | $TotalDamage = $TraderTeamCombatResults['TotalDamage']; ?> |
133 | -This fleet <?php if ($TotalDamage > 0){ ?>hits for a total of <span class="red"><?php echo $TotalDamage ?></span> damage in this round of combat<?php } else{ ?>does no damage this round. You call that a fleet? They need a better recruiter<?php } ?>.<br /> |
|
133 | +This fleet <?php if ($TotalDamage > 0) { ?>hits for a total of <span class="red"><?php echo $TotalDamage ?></span> damage in this round of combat<?php } else { ?>does no damage this round. You call that a fleet? They need a better recruiter<?php } ?>.<br /> |