We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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; |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | abstract public function getModifiedPlanetDamageAgainstPlayer(SmrPlanet $planet, AbstractSmrPlayer $targetPlayer); |
68 | 68 | |
69 | 69 | protected function doPlayerDamageToForce(array $return, AbstractSmrPlayer $weaponPlayer, SmrForce $forces) { |
70 | - $return['WeaponDamage'] = $this->getModifiedDamageAgainstForces($weaponPlayer,$forces); |
|
70 | + $return['WeaponDamage'] = $this->getModifiedDamageAgainstForces($weaponPlayer, $forces); |
|
71 | 71 | $return['ActualDamage'] = $forces->doWeaponDamage($return['WeaponDamage']); |
72 | 72 | if ($return['ActualDamage']['KillingShot']) { |
73 | 73 | $return['KillResults'] = $forces->killForcesByPlayer($weaponPlayer); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | protected function doPlayerDamageToPlayer(array $return, AbstractSmrPlayer $weaponPlayer, AbstractSmrPlayer $targetPlayer) { |
79 | - $return['WeaponDamage'] = $this->getModifiedDamageAgainstPlayer($weaponPlayer,$targetPlayer); |
|
79 | + $return['WeaponDamage'] = $this->getModifiedDamageAgainstPlayer($weaponPlayer, $targetPlayer); |
|
80 | 80 | $return['ActualDamage'] = $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']); |
81 | 81 | |
82 | 82 | if ($return['ActualDamage']['KillingShot']) { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | protected function doPlayerDamageToPort(array $return, AbstractSmrPlayer $weaponPlayer, SmrPort $port) { |
89 | - $return['WeaponDamage'] = $this->getModifiedDamageAgainstPort($weaponPlayer,$port); |
|
89 | + $return['WeaponDamage'] = $this->getModifiedDamageAgainstPort($weaponPlayer, $port); |
|
90 | 90 | $return['ActualDamage'] = $port->doWeaponDamage($return['WeaponDamage']); |
91 | 91 | if ($return['ActualDamage']['KillingShot']) { |
92 | 92 | $return['KillResults'] = $port->killPortByPlayer($weaponPlayer); |
@@ -95,8 +95,8 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | protected function doPlayerDamageToPlanet(array $return, AbstractSmrPlayer $weaponPlayer, SmrPlanet $planet, $delayed) { |
98 | - $return['WeaponDamage'] = $this->getModifiedDamageAgainstPlanet($weaponPlayer,$planet); |
|
99 | - $return['ActualDamage'] = $planet->doWeaponDamage($return['WeaponDamage'],$delayed); |
|
98 | + $return['WeaponDamage'] = $this->getModifiedDamageAgainstPlanet($weaponPlayer, $planet); |
|
99 | + $return['ActualDamage'] = $planet->doWeaponDamage($return['WeaponDamage'], $delayed); |
|
100 | 100 | if ($return['ActualDamage']['KillingShot']) { |
101 | 101 | $return['KillResults'] = $planet->killPlanetByPlayer($weaponPlayer); |
102 | 102 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | protected function doPortDamageToPlayer(array $return, SmrPort $port, AbstractSmrPlayer $targetPlayer) { |
107 | - $return['WeaponDamage'] = $this->getModifiedPortDamageAgainstPlayer($port,$targetPlayer); |
|
107 | + $return['WeaponDamage'] = $this->getModifiedPortDamageAgainstPlayer($port, $targetPlayer); |
|
108 | 108 | $return['ActualDamage'] = $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']); |
109 | 109 | |
110 | 110 | if ($return['ActualDamage']['KillingShot']) { |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | } |
115 | 115 | |
116 | 116 | protected function doPlanetDamageToPlayer(array $return, SmrPlanet $planet, AbstractSmrPlayer $targetPlayer) { |
117 | - $return['WeaponDamage'] = $this->getModifiedPlanetDamageAgainstPlayer($planet,$targetPlayer); |
|
117 | + $return['WeaponDamage'] = $this->getModifiedPlanetDamageAgainstPlayer($planet, $targetPlayer); |
|
118 | 118 | $return['ActualDamage'] = $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']); |
119 | 119 | |
120 | 120 | if ($return['ActualDamage']['KillingShot']) { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | protected function doForceDamageToPlayer(array $return, SmrForce $forces, AbstractSmrPlayer $targetPlayer) { |
127 | - $return['WeaponDamage'] = $this->getModifiedForceDamageAgainstPlayer($forces,$targetPlayer); |
|
127 | + $return['WeaponDamage'] = $this->getModifiedForceDamageAgainstPlayer($forces, $targetPlayer); |
|
128 | 128 | $return['ActualDamage'] = $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']); |
129 | 129 | |
130 | 130 | if ($return['ActualDamage']['KillingShot']) { |
@@ -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 | } |
@@ -924,14 +924,14 @@ |
||
924 | 924 | |
925 | 925 | public function isFederal() { |
926 | 926 | return $this->getShipTypeID() == SHIP_TYPE_FEDERAL_DISCOVERY || |
927 | - $this->getShipTypeID() == SHIP_TYPE_FEDERAL_WARRANT || |
|
928 | - $this->getShipTypeID() == SHIP_TYPE_FEDERAL_ULTIMATUM; |
|
927 | + $this->getShipTypeID() == SHIP_TYPE_FEDERAL_WARRANT || |
|
928 | + $this->getShipTypeID() == SHIP_TYPE_FEDERAL_ULTIMATUM; |
|
929 | 929 | } |
930 | 930 | |
931 | 931 | public function isUnderground() { |
932 | 932 | return $this->getShipTypeID() == SHIP_TYPE_THIEF || |
933 | - $this->getShipTypeID() == SHIP_TYPE_ASSASSIN || |
|
934 | - $this->getShipTypeID() == SHIP_TYPE_DEATH_CRUISER; |
|
933 | + $this->getShipTypeID() == SHIP_TYPE_ASSASSIN || |
|
934 | + $this->getShipTypeID() == SHIP_TYPE_DEATH_CRUISER; |
|
935 | 935 | } |
936 | 936 | |
937 | 937 | public function shootPlayers(array $targetPlayers) { |
@@ -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 | } |
@@ -16,24 +16,24 @@ discard block |
||
16 | 16 | $WeaponDamage = $WeaponResults['WeaponDamage']; |
17 | 17 | } |
18 | 18 | |
19 | - echo $ShootingPlayer->getDisplayName() ?> fires their <?php echo $ShootingWeapon->getName() ?> at<?php if ($ShotHit && $ActualDamage['TargetAlreadyDead']){ ?> the debris that was once<?php } ?> the forces<?php |
|
19 | + echo $ShootingPlayer->getDisplayName() ?> fires their <?php echo $ShootingWeapon->getName() ?> at<?php if ($ShotHit && $ActualDamage['TargetAlreadyDead']) { ?> the debris that was once<?php } ?> the forces<?php |
|
20 | 20 | if (!$ShotHit || !$ActualDamage['TargetAlreadyDead']) { |
21 | 21 | if (!$ShotHit) { |
22 | 22 | ?> and misses<?php |
23 | 23 | } elseif ($ActualDamage['TotalDamage'] == 0) { |
24 | 24 | if ($WeaponDamage['Shield'] > 0) { |
25 | - ?> which proves ineffective against the <?php if ($ActualDamage['HasMines']){ ?>mines<?php } elseif ($ActualDamage['HasCDs']){ ?>combat drones<?php } else{ ?>scout drones<?php } |
|
25 | + ?> which proves ineffective against the <?php if ($ActualDamage['HasMines']) { ?>mines<?php } elseif ($ActualDamage['HasCDs']) { ?>combat drones<?php } else { ?>scout drones<?php } |
|
26 | 26 | } elseif ($WeaponDamage['Armour'] > 0) { |
27 | - ?> which is deflected by the <?php if ($ActualDamage['HasMines']){ ?>mines<?php } elseif ($ActualDamage['HasCDs']){ ?>combat drones<?php } else{ ?>scout drones<?php } ?> shields<?php |
|
27 | + ?> which is deflected by the <?php if ($ActualDamage['HasMines']) { ?>mines<?php } elseif ($ActualDamage['HasCDs']) { ?>combat drones<?php } else { ?>scout drones<?php } ?> shields<?php |
|
28 | 28 | } else { |
29 | 29 | ?> but it cannot do any damage<?php |
30 | 30 | } |
31 | 31 | } else { |
32 | 32 | ?> destroying <?php |
33 | 33 | $DamageTypes = 0; |
34 | - if ($ActualDamage['NumMines'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
35 | - if ($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
36 | - if ($ActualDamage['NumSDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
34 | + if ($ActualDamage['NumMines'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
35 | + if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
36 | + if ($ActualDamage['NumSDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
37 | 37 | |
38 | 38 | if ($ActualDamage['NumMines'] > 0) { |
39 | 39 | ?><span class="red"><?php echo number_format($ActualDamage['NumMines']) ?></span> mines<?php |
@@ -63,22 +63,22 @@ discard block |
||
63 | 63 | if ($WeaponDamage['Launched'] == 0) { |
64 | 64 | ?> fails to launch their combat drones<?php |
65 | 65 | } else { |
66 | - ?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at<?php if ($ActualDamage['TargetAlreadyDead']){ ?> the debris that was once <?php } ?> the forces<?php |
|
66 | + ?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at<?php if ($ActualDamage['TargetAlreadyDead']) { ?> the debris that was once <?php } ?> the forces<?php |
|
67 | 67 | if (!$ActualDamage['TargetAlreadyDead']) { |
68 | 68 | if ($ActualDamage['TotalDamage'] == 0) { |
69 | 69 | if ($WeaponDamage['Shield'] > 0) { |
70 | - ?> which prove ineffective against the <?php if ($ActualDamage['HasMines']){ ?>mines<?php } elseif ($ActualDamage['HasCDs']){ ?>combat drones<?php } else{ ?>scout drones<?php } |
|
70 | + ?> which prove ineffective against the <?php if ($ActualDamage['HasMines']) { ?>mines<?php } elseif ($ActualDamage['HasCDs']) { ?>combat drones<?php } else { ?>scout drones<?php } |
|
71 | 71 | } elseif ($WeaponDamage['Armour'] > 0) { |
72 | 72 | ?> which is deflected by the <?php |
73 | - if ($ActualDamage['HasMines']){ ?>mines<?php } elseif ($ActualDamage['HasCDs']){ ?>combat drones<?php } else{ ?>scout drones<?php } ?> shields<?php |
|
73 | + if ($ActualDamage['HasMines']) { ?>mines<?php } elseif ($ActualDamage['HasCDs']) { ?>combat drones<?php } else { ?>scout drones<?php } ?> shields<?php |
|
74 | 74 | } else { |
75 | 75 | ?> but they cannot do any damage<?php |
76 | 76 | } |
77 | 77 | } else { |
78 | 78 | $DamageTypes = 0; |
79 | - if ($ActualDamage['NumMines'] > $WeaponDamage['Kamikaze']) { $DamageTypes = $DamageTypes+1; } |
|
80 | - if ($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
81 | - if ($ActualDamage['NumSDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
79 | + if ($ActualDamage['NumMines'] > $WeaponDamage['Kamikaze']) { $DamageTypes = $DamageTypes + 1; } |
|
80 | + if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
81 | + if ($ActualDamage['NumSDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
82 | 82 | |
83 | 83 | if ($WeaponDamage['Kamikaze'] == 0) { |
84 | 84 | ?> destroying <?php |
@@ -120,4 +120,4 @@ discard block |
||
120 | 120 | } |
121 | 121 | } |
122 | 122 | $TotalDamage = $TraderTeamCombatResults['TotalDamage']; ?> |
123 | -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 } ?>. |
|
123 | +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 } ?>. |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | ?> scout drones kamikaze themselves against <?php |
17 | 17 | } |
18 | 18 | |
19 | - if ($ShotHit && $ActualDamage['TargetAlreadyDead']){ ?> the debris that was once <?php } |
|
19 | + if ($ShotHit && $ActualDamage['TargetAlreadyDead']) { ?> the debris that was once <?php } |
|
20 | 20 | echo $TargetPlayer->getDisplayName(); |
21 | 21 | if (!$ShotHit || !$ActualDamage['TargetAlreadyDead']) { |
22 | 22 | if (!$ShotHit) { |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | ?> destroying <?php |
38 | 38 | } |
39 | 39 | $DamageTypes = 0; |
40 | - if ($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
41 | - if ($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
42 | - if ($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
40 | + if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
41 | + if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
42 | + if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
43 | 43 | |
44 | 44 | if ($ActualDamage['Shield'] > 0) { |
45 | 45 | ?><span class="shields"><?php echo number_format($ActualDamage['Shield']) ?></span> shields<?php |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | } ?>. |
56 | 56 | <br /><?php |
57 | 57 | if ($ShotHit && $ActualDamage['KillingShot']) { |
58 | - $this->includeTemplate('includes/TraderCombatKillMessage.inc.php',array('KillResults'=>$ForceResults['KillResults'],'TargetPlayer'=>$TargetPlayer)); |
|
58 | + $this->includeTemplate('includes/TraderCombatKillMessage.inc.php', array('KillResults'=>$ForceResults['KillResults'], 'TargetPlayer'=>$TargetPlayer)); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | } |
@@ -64,4 +64,4 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | $TotalDamage = $ForcesCombatResults['TotalDamage'] ?> |
67 | -The forces <?php if ($TotalDamage > 0){ ?>hit for a total of <span class="red"><?php echo number_format($TotalDamage) ?></span> damage in this round of combat<?php } else{ ?>do no damage this round<?php } ?>. |
|
67 | +The forces <?php if ($TotalDamage > 0) { ?>hit for a total of <span class="red"><?php echo number_format($TotalDamage) ?></span> damage in this round of combat<?php } else { ?>do no damage this round<?php } ?>. |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | } |
26 | 26 | $TargetPort = $WeaponResults['TargetPort']; |
27 | 27 | |
28 | - echo $ShootingPlayer->getDisplayName() ?> fires their <?php echo $ShootingWeapon->getName() ?> at <?php if ($ShotHit && $ActualDamage['TargetAlreadyDead']){ ?>the remnants of <?php } echo $TargetPort->getDisplayName(); |
|
28 | + echo $ShootingPlayer->getDisplayName() ?> fires their <?php echo $ShootingWeapon->getName() ?> at <?php if ($ShotHit && $ActualDamage['TargetAlreadyDead']) { ?>the remnants of <?php } echo $TargetPort->getDisplayName(); |
|
29 | 29 | if (!$ShotHit || !$ActualDamage['TargetAlreadyDead']) { |
30 | 30 | if (!$ShotHit) { |
31 | 31 | ?> and misses every critical system<?php |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | } else { |
45 | 45 | ?> destroying <?php |
46 | 46 | $DamageTypes = 0; |
47 | - if ($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
48 | - if ($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
49 | - if ($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
47 | + if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
48 | + if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
49 | + if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
50 | 50 | |
51 | 51 | if ($ActualDamage['Shield'] > 0) { |
52 | 52 | ?><span class="shields"><?php echo number_format($ActualDamage['Shield']) ?></span> shields<?php |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | } ?>. |
64 | 64 | <br /><?php |
65 | 65 | if ($ShotHit && $ActualDamage['KillingShot']) { |
66 | - $this->includeTemplate('includes/PortKillMessage.inc.php',array('KillResults'=>$WeaponResults['KillResults'],'TargetPort'=>$TargetPort,'ShootingPlayer'=>$ShootingPlayer)); |
|
66 | + $this->includeTemplate('includes/PortKillMessage.inc.php', array('KillResults'=>$WeaponResults['KillResults'], 'TargetPort'=>$TargetPort, 'ShootingPlayer'=>$ShootingPlayer)); |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | } |
21 | 21 | $TargetPlayer = $WeaponResults['TargetPlayer']; |
22 | 22 | |
23 | - echo $CombatPort->getDisplayName() ?> fires an <?php echo $ShootingWeapon->getName() ?> at <?php if ($ShotHit && $ActualDamage['TargetAlreadyDead']){ ?> the debris that was once <?php } echo $TargetPlayer->getDisplayName(); |
|
23 | + echo $CombatPort->getDisplayName() ?> fires an <?php echo $ShootingWeapon->getName() ?> at <?php if ($ShotHit && $ActualDamage['TargetAlreadyDead']) { ?> the debris that was once <?php } echo $TargetPlayer->getDisplayName(); |
|
24 | 24 | if (!$ShotHit || !$ActualDamage['TargetAlreadyDead']) { |
25 | 25 | if (!$ShotHit) { |
26 | 26 | ?> and misses<?php |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | } else { |
40 | 40 | ?> destroying <?php |
41 | 41 | $DamageTypes = 0; |
42 | - if ($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
43 | - if ($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
44 | - if ($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
42 | + if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
43 | + if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
44 | + if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
45 | 45 | |
46 | 46 | if ($ActualDamage['Shield'] > 0) { |
47 | 47 | ?><span class="shields"><?php echo number_format($ActualDamage['Shield']) ?></span> shields<?php |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | } ?>. |
59 | 59 | <br /><?php |
60 | 60 | if ($ShotHit && $ActualDamage['KillingShot']) { |
61 | - $this->includeTemplate('includes/TraderCombatKillMessage.inc.php',array('KillResults'=>$WeaponResults['KillResults'],'TargetPlayer'=>$TargetPlayer)); |
|
61 | + $this->includeTemplate('includes/TraderCombatKillMessage.inc.php', array('KillResults'=>$WeaponResults['KillResults'], 'TargetPlayer'=>$TargetPlayer)); |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | if ($WeaponDamage['Launched'] == 0) { |
73 | 73 | ?> fails to launch it's combat drones<?php |
74 | 74 | } else { |
75 | - ?> 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(); |
|
75 | + ?> 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(); |
|
76 | 76 | if (!$ActualDamage['TargetAlreadyDead']) { |
77 | 77 | if ($ActualDamage['TotalDamage'] == 0) { |
78 | 78 | if ($WeaponDamage['Shield'] > 0) { |