We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | -foreach($TraderTeamCombatResults['Traders'] as $AccountID => $TraderResults) { |
|
3 | - $ShootingPlayer =& $TraderResults['Player']; |
|
4 | - $TotalDamage =& $TraderResults['TotalDamage']; |
|
5 | - if($MinimalDisplay && !$ThisPlayer->equals($ShootingPlayer)) { |
|
2 | +foreach ($TraderTeamCombatResults['Traders'] as $AccountID => $TraderResults) { |
|
3 | + $ShootingPlayer = & $TraderResults['Player']; |
|
4 | + $TotalDamage = & $TraderResults['TotalDamage']; |
|
5 | + if ($MinimalDisplay && !$ThisPlayer->equals($ShootingPlayer)) { |
|
6 | 6 | echo $ShootingPlayer->getDisplayName(); |
7 | - if($TotalDamage > 0) { |
|
7 | + if ($TotalDamage > 0) { |
|
8 | 8 | ?> hits for a total of <span class="red"><?php echo $TotalDamage ?></span> damage in this round of combat<?php |
9 | 9 | } else { |
10 | 10 | ?> does no damage this round<?php |
@@ -12,29 +12,29 @@ discard block |
||
12 | 12 | continue; |
13 | 13 | } |
14 | 14 | |
15 | - if($TraderResults['DeadBeforeShot']) { |
|
15 | + if ($TraderResults['DeadBeforeShot']) { |
|
16 | 16 | echo $ShootingPlayer->getDisplayName() ?> died before they were able to attack!<br /><?php |
17 | 17 | } else { |
18 | - if(isset($TraderResults['Weapons']) && is_array($TraderResults['Weapons'])) { |
|
19 | - foreach($TraderResults['Weapons'] as $WeaponResults) { |
|
20 | - $ShootingWeapon =& $WeaponResults['Weapon']; |
|
21 | - $ShotHit =& $WeaponResults['Hit']; |
|
22 | - $ActualDamage =& $WeaponResults['ActualDamage']; |
|
23 | - $WeaponDamage =& $WeaponResults['WeaponDamage']; |
|
24 | - $TargetPort =& $WeaponResults['TargetPort']; |
|
18 | + if (isset($TraderResults['Weapons']) && is_array($TraderResults['Weapons'])) { |
|
19 | + foreach ($TraderResults['Weapons'] as $WeaponResults) { |
|
20 | + $ShootingWeapon = & $WeaponResults['Weapon']; |
|
21 | + $ShotHit = & $WeaponResults['Hit']; |
|
22 | + $ActualDamage = & $WeaponResults['ActualDamage']; |
|
23 | + $WeaponDamage = & $WeaponResults['WeaponDamage']; |
|
24 | + $TargetPort = & $WeaponResults['TargetPort']; |
|
25 | 25 | |
26 | - echo $ShootingPlayer->getDisplayName() ?> fires their <?php echo $ShootingWeapon->getName() ?> at <?php if($ShotHit && $ActualDamage['TargetAlreadyDead']){ ?>the remnants of <?php } echo $TargetPort->getDisplayName(); |
|
26 | + echo $ShootingPlayer->getDisplayName() ?> fires their <?php echo $ShootingWeapon->getName() ?> at <?php if ($ShotHit && $ActualDamage['TargetAlreadyDead']) { ?>the remnants of <?php } echo $TargetPort->getDisplayName(); |
|
27 | 27 | if (!$ShotHit || !$ActualDamage['TargetAlreadyDead']) { |
28 | - if(!$ShotHit) { |
|
28 | + if (!$ShotHit) { |
|
29 | 29 | ?> and misses every critical system<?php |
30 | - } else if($ActualDamage['TotalDamage'] == 0) { |
|
31 | - if($WeaponDamage['Shield'] > 0) { |
|
32 | - if($ActualDamage['HasCDs']) { |
|
30 | + } else if ($ActualDamage['TotalDamage'] == 0) { |
|
31 | + if ($WeaponDamage['Shield'] > 0) { |
|
32 | + if ($ActualDamage['HasCDs']) { |
|
33 | 33 | ?> which proves ineffective against their combat drones<?php |
34 | 34 | } else { |
35 | 35 | ?> which proves ineffective against it's armour<?php |
36 | 36 | } |
37 | - } else if($WeaponDamage['Armour'] > 0) { |
|
37 | + } else if ($WeaponDamage['Armour'] > 0) { |
|
38 | 38 | ?> which is deflected by their shields<?php |
39 | 39 | } else { |
40 | 40 | ?> but it cannot do any damage<?php |
@@ -42,55 +42,55 @@ discard block |
||
42 | 42 | } else { |
43 | 43 | ?> destroying <?php |
44 | 44 | $DamageTypes = 0; |
45 | - if($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
46 | - if($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
47 | - if($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
45 | + if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
46 | + if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
47 | + if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
48 | 48 | |
49 | - if($ActualDamage['Shield'] > 0) { |
|
49 | + if ($ActualDamage['Shield'] > 0) { |
|
50 | 50 | ?><span class="shields"><?php echo number_format($ActualDamage['Shield']) ?></span> shields<?php |
51 | 51 | $this->doDamageTypeReductionDisplay($DamageTypes); |
52 | 52 | } |
53 | - if($ActualDamage['NumCDs'] > 0) { |
|
53 | + if ($ActualDamage['NumCDs'] > 0) { |
|
54 | 54 | ?><span class="cds"><?php echo number_format($ActualDamage['NumCDs']) ?></span> combat drones<?php |
55 | 55 | $this->doDamageTypeReductionDisplay($DamageTypes); |
56 | 56 | } |
57 | - if($ActualDamage['Armour'] > 0) { |
|
57 | + if ($ActualDamage['Armour'] > 0) { |
|
58 | 58 | ?><span class="red"><?php echo number_format($ActualDamage['Armour']) ?></span> plates of armour<?php |
59 | 59 | } |
60 | 60 | } |
61 | 61 | } ?>. |
62 | 62 | <br /><?php |
63 | 63 | if ($ShotHit && $ActualDamage['KillingShot']) { |
64 | - $this->includeTemplate('includes/PortKillMessage.inc',array('KillResults'=>$WeaponResults['KillResults'],'TargetPort'=>$TargetPort,'ShootingPlayer'=>$ShootingPlayer)); |
|
64 | + $this->includeTemplate('includes/PortKillMessage.inc', array('KillResults'=>$WeaponResults['KillResults'], 'TargetPort'=>$TargetPort, 'ShootingPlayer'=>$ShootingPlayer)); |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | } |
68 | - if(isset($TraderResults['Drones'])) { |
|
69 | - $Drones =& $TraderResults['Drones']; |
|
70 | - $ActualDamage =& $Drones['ActualDamage']; |
|
71 | - $WeaponDamage =& $Drones['WeaponDamage']; |
|
72 | - $TargetPort =& $Drones['TargetPort']; |
|
68 | + if (isset($TraderResults['Drones'])) { |
|
69 | + $Drones = & $TraderResults['Drones']; |
|
70 | + $ActualDamage = & $Drones['ActualDamage']; |
|
71 | + $WeaponDamage = & $Drones['WeaponDamage']; |
|
72 | + $TargetPort = & $Drones['TargetPort']; |
|
73 | 73 | |
74 | 74 | echo $ShootingPlayer->getDisplayName(); |
75 | - if($WeaponDamage['Launched'] == 0) { |
|
75 | + if ($WeaponDamage['Launched'] == 0) { |
|
76 | 76 | ?> fails to launch their combat drones<?php |
77 | 77 | } else { |
78 | 78 | ?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at <?php |
79 | - if($ActualDamage['TargetAlreadyDead']) { |
|
79 | + if ($ActualDamage['TargetAlreadyDead']) { |
|
80 | 80 | ?>the debris that was once <?php |
81 | 81 | } |
82 | 82 | echo $TargetPort->getDisplayName(); |
83 | 83 | |
84 | - if(!$ActualDamage['TargetAlreadyDead']) { |
|
85 | - if($ActualDamage['TotalDamage'] == 0) { |
|
86 | - if($WeaponDamage['Shield'] > 0) { |
|
87 | - if($ActualDamage['HasCDs']) { |
|
84 | + if (!$ActualDamage['TargetAlreadyDead']) { |
|
85 | + if ($ActualDamage['TotalDamage'] == 0) { |
|
86 | + if ($WeaponDamage['Shield'] > 0) { |
|
87 | + if ($ActualDamage['HasCDs']) { |
|
88 | 88 | ?> which prove ineffective against their combat drones<?php |
89 | 89 | } else { |
90 | 90 | ?> which proves ineffective against it's armour<?php |
91 | 91 | } |
92 | 92 | } |
93 | - if($ActualDamage['Armour'] > 0) { |
|
93 | + if ($ActualDamage['Armour'] > 0) { |
|
94 | 94 | ?> which is deflected by their shields<?php |
95 | 95 | } else { |
96 | 96 | ?> but they cannot do any damage<?php |
@@ -98,45 +98,45 @@ discard block |
||
98 | 98 | } else { |
99 | 99 | ?> destroying <?php |
100 | 100 | $DamageTypes = 0; |
101 | - if($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
102 | - if($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
103 | - if($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
101 | + if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
102 | + if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
103 | + if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
104 | 104 | |
105 | - if($ActualDamage['Shield'] > 0) { |
|
105 | + if ($ActualDamage['Shield'] > 0) { |
|
106 | 106 | ?><span class="shields"><?php echo number_format($ActualDamage['Shield']) ?></span> shields<?php |
107 | 107 | $this->doDamageTypeReductionDisplay($DamageTypes); |
108 | 108 | } |
109 | - if($ActualDamage['NumCDs'] > 0) { |
|
109 | + if ($ActualDamage['NumCDs'] > 0) { |
|
110 | 110 | ?><span class="cds"><?php echo number_format($ActualDamage['NumCDs']) ?></span> combat drones<?php |
111 | 111 | $this->doDamageTypeReductionDisplay($DamageTypes); |
112 | 112 | } |
113 | - if($ActualDamage['Armour'] > 0) { |
|
113 | + if ($ActualDamage['Armour'] > 0) { |
|
114 | 114 | ?><span class="red"><?php echo number_format($ActualDamage['Armour']) ?></span> plates of armour<?php |
115 | 115 | } |
116 | 116 | } |
117 | 117 | } |
118 | 118 | } ?>. |
119 | 119 | <br /><?php |
120 | - if($ActualDamage['KillingShot']) { |
|
121 | - $this->includeTemplate('includes/PortKillMessage.inc',array('KillResults'=>$Drones['KillResults'],'TargetPort'=>$TargetPort,'ShootingPlayer'=>$ShootingPlayer)); |
|
120 | + if ($ActualDamage['KillingShot']) { |
|
121 | + $this->includeTemplate('includes/PortKillMessage.inc', array('KillResults'=>$Drones['KillResults'], 'TargetPort'=>$TargetPort, 'ShootingPlayer'=>$ShootingPlayer)); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | } |
125 | 125 | echo $ShootingPlayer->getDisplayName(); |
126 | - if($TotalDamage > 0) { |
|
126 | + if ($TotalDamage > 0) { |
|
127 | 127 | ?> hits for a total of <span class="red"><?php echo $TotalDamage ?></span> damage in this round of combat<?php |
128 | 128 | } else { |
129 | 129 | ?> does no damage this round<?php |
130 | - if(!$TraderResults['DeadBeforeShot']) { |
|
130 | + if (!$TraderResults['DeadBeforeShot']) { |
|
131 | 131 | ?>. Maybe they should go back to the academy<?php |
132 | 132 | } |
133 | 133 | } ?>.<br /><br /><?php |
134 | 134 | } |
135 | 135 | $TotalDamage = $TraderTeamCombatResults['TotalDamage']; ?> |
136 | -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 /> |
|
136 | +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 /> |
|
137 | 137 | |
138 | 138 | <?php |
139 | 139 | $Downgrades = $TraderTeamCombatResults['Downgrades']; |
140 | -if ($Downgrades != 0 ) { |
|
140 | +if ($Downgrades != 0) { |
|
141 | 141 | ?>The port has lost <?php echo $Downgrades . ' ' . pluralise('level', $Downgrades); ?>.<?php |
142 | 142 | } ?> |
@@ -1,34 +1,34 @@ discard block |
||
1 | 1 | <?php |
2 | -if(isset($ForcesCombatResults['Results']) && is_array($ForcesCombatResults['Results'])) { |
|
3 | - foreach($ForcesCombatResults['Results'] as $ForceType => $ForceResults) { |
|
4 | - $ShootingWeapon =& $ForceResults['Weapon']; |
|
5 | - $ShotHit =& $ForceResults['Hit']; |
|
6 | - $ActualDamage =& $ForceResults['ActualDamage']; |
|
7 | - $WeaponDamage =& $ForceResults['WeaponDamage']; |
|
8 | - $TargetPlayer =& $ForceResults['TargetPlayer']; |
|
2 | +if (isset($ForcesCombatResults['Results']) && is_array($ForcesCombatResults['Results'])) { |
|
3 | + foreach ($ForcesCombatResults['Results'] as $ForceType => $ForceResults) { |
|
4 | + $ShootingWeapon = & $ForceResults['Weapon']; |
|
5 | + $ShotHit = & $ForceResults['Hit']; |
|
6 | + $ActualDamage = & $ForceResults['ActualDamage']; |
|
7 | + $WeaponDamage = & $ForceResults['WeaponDamage']; |
|
8 | + $TargetPlayer = & $ForceResults['TargetPlayer']; |
|
9 | 9 | ?> |
10 | 10 | <span class="cds"><?php echo isset($ActualDamage['Launched']) ? $ActualDamage['Launched'] : $WeaponDamage['Launched']; ?></span><?php |
11 | - if($ForceType == 'Mines') { |
|
11 | + if ($ForceType == 'Mines') { |
|
12 | 12 | ?> mines kamikaze themselves against <?php |
13 | - } else if($ForceType == 'Drones') { |
|
13 | + } else if ($ForceType == 'Drones') { |
|
14 | 14 | ?> combat drones launch at <?php |
15 | - } else if($ForceType == 'Scouts') { |
|
15 | + } else if ($ForceType == 'Scouts') { |
|
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 | - if(!$ShotHit) { |
|
22 | + if (!$ShotHit) { |
|
23 | 23 | ?> and misses<?php |
24 | - } else if($ActualDamage['TotalDamage'] == 0) { |
|
25 | - if($WeaponDamage['Shield'] > 0) { |
|
26 | - if($ActualDamage['HasCDs']) { |
|
24 | + } else if ($ActualDamage['TotalDamage'] == 0) { |
|
25 | + if ($WeaponDamage['Shield'] > 0) { |
|
26 | + if ($ActualDamage['HasCDs']) { |
|
27 | 27 | ?> which proves ineffective against their combat drones<?php |
28 | 28 | } else { |
29 | 29 | ?> which washes harmlessly over their hull<?php |
30 | 30 | } |
31 | - } else if($WeaponDamage['Armour'] > 0) { |
|
31 | + } else if ($WeaponDamage['Armour'] > 0) { |
|
32 | 32 | ?> which is deflected by their shields<?php |
33 | 33 | } else { |
34 | 34 | ?> but it cannot do any damage<?php |
@@ -37,31 +37,31 @@ 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 | - if($ActualDamage['Shield'] > 0) { |
|
44 | + if ($ActualDamage['Shield'] > 0) { |
|
45 | 45 | ?><span class="shields"><?php echo number_format($ActualDamage['Shield']) ?></span> shields<?php |
46 | 46 | $this->doDamageTypeReductionDisplay($DamageTypes); |
47 | 47 | } |
48 | - if($ActualDamage['NumCDs'] > 0) { |
|
48 | + if ($ActualDamage['NumCDs'] > 0) { |
|
49 | 49 | ?><span class="cds"><?php echo number_format($ActualDamage['NumCDs']) ?></span> drones<?php |
50 | 50 | $this->doDamageTypeReductionDisplay($DamageTypes); |
51 | 51 | } |
52 | - if($ActualDamage['Armour'] > 0) { |
|
52 | + if ($ActualDamage['Armour'] > 0) { |
|
53 | 53 | ?><span class="red"><?php echo number_format($ActualDamage['Armour']) ?></span> plates of armour<?php |
54 | 54 | } |
55 | 55 | } ?>. |
56 | 56 | <br /><?php |
57 | 57 | if ($ShotHit && $ActualDamage['KillingShot']) { |
58 | - $this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$ForceResults['KillResults'],'TargetPlayer'=>$TargetPlayer)); |
|
58 | + $this->includeTemplate('includes/TraderCombatKillMessage.inc', array('KillResults'=>$ForceResults['KillResults'], 'TargetPlayer'=>$TargetPlayer)); |
|
59 | 59 | } |
60 | 60 | } |
61 | 61 | } |
62 | -if(isset($ForcesCombatResults['ForcesDestroyed']) && $ForcesCombatResults['ForcesDestroyed']) { |
|
62 | +if (isset($ForcesCombatResults['ForcesDestroyed']) && $ForcesCombatResults['ForcesDestroyed']) { |
|
63 | 63 | ?>Forces are <span class="red">DESTROYED!</span><br /><?php |
64 | 64 | } |
65 | 65 | |
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 } ?>. |
|
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 } ?>. |
@@ -1,36 +1,36 @@ discard block |
||
1 | 1 | <?php |
2 | -if(is_array($TraderTeamCombatResults['Traders'])) { |
|
3 | - foreach($TraderTeamCombatResults['Traders'] as $AccountID => $TraderResults) { |
|
4 | - $ShootingPlayer =& $TraderResults['Player']; |
|
5 | - $TotalDamage =& $TraderResults['TotalDamage']; |
|
2 | +if (is_array($TraderTeamCombatResults['Traders'])) { |
|
3 | + foreach ($TraderTeamCombatResults['Traders'] as $AccountID => $TraderResults) { |
|
4 | + $ShootingPlayer = & $TraderResults['Player']; |
|
5 | + $TotalDamage = & $TraderResults['TotalDamage']; |
|
6 | 6 | |
7 | - if($TraderResults['DeadBeforeShot']) { |
|
7 | + if ($TraderResults['DeadBeforeShot']) { |
|
8 | 8 | echo $ShootingPlayer->getDisplayName() ?> died before they were able to attack!<br /><?php |
9 | 9 | } else { |
10 | - if(isset($TraderResults['Weapons']) && is_array($TraderResults['Weapons'])) { |
|
11 | - foreach($TraderResults['Weapons'] as $WeaponResults) { |
|
12 | - $ShootingWeapon =& $WeaponResults['Weapon']; |
|
13 | - $ShotHit =& $WeaponResults['Hit']; |
|
14 | - $ActualDamage =& $WeaponResults['ActualDamage']; |
|
15 | - $WeaponDamage =& $WeaponResults['WeaponDamage']; |
|
16 | - $TargetPlayer =& $WeaponResults['TargetPlayer']; |
|
10 | + if (isset($TraderResults['Weapons']) && is_array($TraderResults['Weapons'])) { |
|
11 | + foreach ($TraderResults['Weapons'] as $WeaponResults) { |
|
12 | + $ShootingWeapon = & $WeaponResults['Weapon']; |
|
13 | + $ShotHit = & $WeaponResults['Hit']; |
|
14 | + $ActualDamage = & $WeaponResults['ActualDamage']; |
|
15 | + $WeaponDamage = & $WeaponResults['WeaponDamage']; |
|
16 | + $TargetPlayer = & $WeaponResults['TargetPlayer']; |
|
17 | 17 | |
18 | 18 | echo $ShootingPlayer->getDisplayName() ?> fires their <?php echo $ShootingWeapon->getName() ?> at <?php |
19 | - if($ShotHit && $ActualDamage['TargetAlreadyDead']) { |
|
19 | + if ($ShotHit && $ActualDamage['TargetAlreadyDead']) { |
|
20 | 20 | ?>the debris that was once <?php |
21 | 21 | } |
22 | 22 | echo $TargetPlayer->getDisplayName(); |
23 | 23 | if (!$ShotHit || !$ActualDamage['TargetAlreadyDead']) { |
24 | - if(!$ShotHit) { |
|
24 | + if (!$ShotHit) { |
|
25 | 25 | ?> and misses<?php |
26 | - } else if($ActualDamage['TotalDamage'] == 0) { |
|
27 | - if($WeaponDamage['Shield'] > 0) { |
|
28 | - if($ActualDamage['HasCDs']) { |
|
26 | + } else if ($ActualDamage['TotalDamage'] == 0) { |
|
27 | + if ($WeaponDamage['Shield'] > 0) { |
|
28 | + if ($ActualDamage['HasCDs']) { |
|
29 | 29 | ?> which proves ineffective against their combat drones<?php |
30 | 30 | } else { |
31 | 31 | ?> which washes harmlessly over their hull<?php |
32 | 32 | } |
33 | - } else if($WeaponDamage['Armour'] > 0) { |
|
33 | + } else if ($WeaponDamage['Armour'] > 0) { |
|
34 | 34 | ?> which is deflected by their shields<?php |
35 | 35 | } else { |
36 | 36 | ?> but it cannot do any damage<?php |
@@ -38,94 +38,94 @@ discard block |
||
38 | 38 | } else { |
39 | 39 | ?> destroying <?php |
40 | 40 | $DamageTypes = 0; |
41 | - if($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
42 | - if($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
43 | - if($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
41 | + if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
42 | + if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
43 | + if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
44 | 44 | |
45 | - if($ActualDamage['Shield'] > 0) { |
|
45 | + if ($ActualDamage['Shield'] > 0) { |
|
46 | 46 | ?><span class="shields"><?php echo number_format($ActualDamage['Shield']) ?></span> shields<?php |
47 | 47 | $this->doDamageTypeReductionDisplay($DamageTypes); |
48 | 48 | } |
49 | - if($ActualDamage['NumCDs'] > 0) { |
|
49 | + if ($ActualDamage['NumCDs'] > 0) { |
|
50 | 50 | ?><span class="cds"><?php echo number_format($ActualDamage['NumCDs']) ?></span> combat drones<?php |
51 | 51 | $this->doDamageTypeReductionDisplay($DamageTypes); |
52 | 52 | } |
53 | - if($ActualDamage['Armour'] > 0) { |
|
53 | + if ($ActualDamage['Armour'] > 0) { |
|
54 | 54 | ?><span class="red"><?php echo number_format($ActualDamage['Armour']) ?></span> plates of armour<?php |
55 | 55 | } |
56 | 56 | } |
57 | 57 | } ?>. |
58 | 58 | <br /><?php |
59 | 59 | if ($ShotHit && $ActualDamage['KillingShot']) { |
60 | - $this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$WeaponResults['KillResults'],'TargetPlayer'=>$TargetPlayer,'ShootingPlayer'=>$ShootingPlayer)); |
|
60 | + $this->includeTemplate('includes/TraderCombatKillMessage.inc', array('KillResults'=>$WeaponResults['KillResults'], 'TargetPlayer'=>$TargetPlayer, 'ShootingPlayer'=>$ShootingPlayer)); |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | } |
64 | - if(isset($TraderResults['Drones'])) { |
|
65 | - $Drones =& $TraderResults['Drones']; |
|
66 | - $ActualDamage =& $Drones['ActualDamage']; |
|
67 | - $WeaponDamage =& $Drones['WeaponDamage']; |
|
68 | - $TargetPlayer =& $Drones['TargetPlayer']; |
|
64 | + if (isset($TraderResults['Drones'])) { |
|
65 | + $Drones = & $TraderResults['Drones']; |
|
66 | + $ActualDamage = & $Drones['ActualDamage']; |
|
67 | + $WeaponDamage = & $Drones['WeaponDamage']; |
|
68 | + $TargetPlayer = & $Drones['TargetPlayer']; |
|
69 | 69 | $DamageTypes = 0; |
70 | - if($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
71 | - if($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
72 | - if($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; } |
|
70 | + if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
71 | + if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
72 | + if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; } |
|
73 | 73 | |
74 | 74 | echo $ShootingPlayer->getDisplayName(); |
75 | - if($WeaponDamage['Launched'] == 0) { |
|
75 | + if ($WeaponDamage['Launched'] == 0) { |
|
76 | 76 | ?> fails to launch their combat drones<?php |
77 | 77 | } else { |
78 | 78 | ?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at <?php |
79 | - if($ActualDamage['TargetAlreadyDead']) { |
|
79 | + if ($ActualDamage['TargetAlreadyDead']) { |
|
80 | 80 | ?>the debris that was once <?php |
81 | 81 | } |
82 | 82 | echo $TargetPlayer->getDisplayName(); |
83 | - if(!$ActualDamage['TargetAlreadyDead']) { |
|
84 | - if($ActualDamage['TotalDamage'] == 0) { |
|
85 | - if($WeaponDamage['Shield'] > 0) { |
|
86 | - if($ActualDamage['HasCDs']) { |
|
83 | + if (!$ActualDamage['TargetAlreadyDead']) { |
|
84 | + if ($ActualDamage['TotalDamage'] == 0) { |
|
85 | + if ($WeaponDamage['Shield'] > 0) { |
|
86 | + if ($ActualDamage['HasCDs']) { |
|
87 | 87 | ?> which prove ineffective against their combat drones<?php |
88 | 88 | } else { |
89 | 89 | ?> which washes harmlessly over their hull<?php |
90 | 90 | } |
91 | 91 | } |
92 | - if($ActualDamage['Armour'] > 0) { |
|
92 | + if ($ActualDamage['Armour'] > 0) { |
|
93 | 93 | ?> which is deflected by their shields<?php |
94 | 94 | } else { |
95 | 95 | ?> but they cannot do any damage<?php |
96 | 96 | } |
97 | 97 | } else { |
98 | 98 | ?> destroying <?php |
99 | - if($ActualDamage['Shield'] > 0) { |
|
99 | + if ($ActualDamage['Shield'] > 0) { |
|
100 | 100 | ?><span class="shields"><?php echo number_format($ActualDamage['Shield']) ?></span> shields<?php |
101 | 101 | $this->doDamageTypeReductionDisplay($DamageTypes); |
102 | 102 | } |
103 | - if($ActualDamage['NumCDs'] > 0) { |
|
103 | + if ($ActualDamage['NumCDs'] > 0) { |
|
104 | 104 | ?><span class="cds"><?php echo number_format($ActualDamage['NumCDs']) ?></span> combat drones<?php |
105 | 105 | $this->doDamageTypeReductionDisplay($DamageTypes); |
106 | 106 | } |
107 | - if($ActualDamage['Armour'] > 0) { |
|
107 | + if ($ActualDamage['Armour'] > 0) { |
|
108 | 108 | ?><span class="red"><?php echo number_format($ActualDamage['Armour']) ?></span> plates of armour<?php |
109 | 109 | } |
110 | 110 | } |
111 | 111 | } |
112 | 112 | } ?>. |
113 | 113 | <br /><?php |
114 | - if($ActualDamage['KillingShot']) { |
|
115 | - $this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$Drones['KillResults'],'TargetPlayer'=>$TargetPlayer,'ShootingPlayer'=>$ShootingPlayer)); |
|
114 | + if ($ActualDamage['KillingShot']) { |
|
115 | + $this->includeTemplate('includes/TraderCombatKillMessage.inc', array('KillResults'=>$Drones['KillResults'], 'TargetPlayer'=>$TargetPlayer, 'ShootingPlayer'=>$ShootingPlayer)); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | } |
119 | 119 | echo $ShootingPlayer->getDisplayName(); |
120 | - if($TotalDamage > 0) { |
|
120 | + if ($TotalDamage > 0) { |
|
121 | 121 | ?> hits for a total of <span class="red"><?php echo $TotalDamage ?></span> damage in this round of combat<?php |
122 | 122 | } else { |
123 | 123 | ?> does no damage this round.<?php |
124 | - if(!$TraderResults['DeadBeforeShot']) { |
|
124 | + if (!$TraderResults['DeadBeforeShot']) { |
|
125 | 125 | ?> Maybe they should go back to the academy<?php |
126 | 126 | } |
127 | 127 | } ?>.<br /><br /><?php |
128 | 128 | } |
129 | 129 | } |
130 | 130 | $TotalDamage = $TraderTeamCombatResults['TotalDamage']; ?> |
131 | -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 /> |
|
131 | +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 /> |
@@ -46,7 +46,7 @@ |
||
46 | 46 | |
47 | 47 | // Don't lose more exp than you have |
48 | 48 | $lost_xp = min($player->getExperience(), |
49 | - IRound(SmrPort::getBaseExperience($amount, $good_distance))); |
|
49 | + IRound(SmrPort::getBaseExperience($amount, $good_distance))); |
|
50 | 50 | $player->decreaseExperience($lost_xp); |
51 | 51 | $player->increaseHOF($lost_xp, array('Trade', 'Experience', 'Jettisoned'), HOF_PUBLIC); |
52 | 52 |
@@ -192,21 +192,21 @@ discard block |
||
192 | 192 | public function &getModifiedDamageAgainstForces(AbstractSmrPlayer $weaponPlayer, SmrForce $forces) { |
193 | 193 | if (!$this->canShootForces()) // If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods. |
194 | 194 | return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); |
195 | - $damage =& $this->getModifiedDamage(); |
|
195 | + $damage = & $this->getModifiedDamage(); |
|
196 | 196 | return $damage; |
197 | 197 | } |
198 | 198 | |
199 | 199 | public function &getModifiedDamageAgainstPort(AbstractSmrPlayer $weaponPlayer, SmrPort $port) { |
200 | 200 | if (!$this->canShootPorts()) // If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods. |
201 | 201 | return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); |
202 | - $damage =& $this->getModifiedDamage(); |
|
202 | + $damage = & $this->getModifiedDamage(); |
|
203 | 203 | return $damage; |
204 | 204 | } |
205 | 205 | |
206 | 206 | public function &getModifiedDamageAgainstPlanet(AbstractSmrPlayer $weaponPlayer, SmrPlanet $planet) { |
207 | 207 | if (!$this->canShootPlanets()) // If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods. |
208 | 208 | return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); |
209 | - $damage =& $this->getModifiedDamage(); |
|
209 | + $damage = & $this->getModifiedDamage(); |
|
210 | 210 | |
211 | 211 | $planetMod = self::PLANET_DAMAGE_MOD; |
212 | 212 | $damage['MaxDamage'] = ICeil($damage['MaxDamage'] * $planetMod); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | $return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); |
227 | 227 | return $return; |
228 | 228 | } |
229 | - $damage =& $this->getModifiedDamage(); |
|
229 | + $damage = & $this->getModifiedDamage(); |
|
230 | 230 | return $damage; |
231 | 231 | } |
232 | 232 |
@@ -193,22 +193,28 @@ |
||
193 | 193 | } |
194 | 194 | |
195 | 195 | public function &getModifiedDamageAgainstForces(AbstractSmrPlayer $weaponPlayer, SmrForce $forces) { |
196 | - if (!$this->canShootForces()) // If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods. |
|
196 | + if (!$this->canShootForces()) { |
|
197 | + // If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods. |
|
197 | 198 | return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); |
199 | + } |
|
198 | 200 | $damage =& $this->getModifiedDamage(); |
199 | 201 | return $damage; |
200 | 202 | } |
201 | 203 | |
202 | 204 | public function &getModifiedDamageAgainstPort(AbstractSmrPlayer $weaponPlayer, SmrPort $port) { |
203 | - if (!$this->canShootPorts()) // If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods. |
|
205 | + if (!$this->canShootPorts()) { |
|
206 | + // If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods. |
|
204 | 207 | return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); |
208 | + } |
|
205 | 209 | $damage =& $this->getModifiedDamage(); |
206 | 210 | return $damage; |
207 | 211 | } |
208 | 212 | |
209 | 213 | public function &getModifiedDamageAgainstPlanet(AbstractSmrPlayer $weaponPlayer, SmrPlanet $planet) { |
210 | - if (!$this->canShootPlanets()) // If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods. |
|
214 | + if (!$this->canShootPlanets()) { |
|
215 | + // If we can't shoot forces then just return a damageless array and don't waste resources calculated any damage mods. |
|
211 | 216 | return array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); |
217 | + } |
|
212 | 218 | $damage =& $this->getModifiedDamage(); |
213 | 219 | |
214 | 220 | $planetMod = self::PLANET_DAMAGE_MOD; |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); |
95 | 95 | return $return; |
96 | 96 | } |
97 | - $damage =& $this->getModifiedDamage(); |
|
97 | + $damage = & $this->getModifiedDamage(); |
|
98 | 98 | if ($targetPlayer->getShip()->isFederal()) { // do less damage to fed ships |
99 | 99 | $damage['MaxDamage'] = IRound($damage['MaxDamage'] * self::FED_SHIP_DAMAGE_MODIFIER); |
100 | 100 | $damage['Shield'] = IRound($damage['Shield'] * self::FED_SHIP_DAMAGE_MODIFIER); |
@@ -131,12 +131,12 @@ discard block |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | protected function &doForceDamageToPlayer(array &$return, SmrForce $forces, AbstractSmrPlayer $targetPlayer, $minesAreAttacker = false) { |
134 | - $return['WeaponDamage'] =& $this->getModifiedForceDamageAgainstPlayer($forces, $targetPlayer, $minesAreAttacker); |
|
135 | - $return['ActualDamage'] =& $targetPlayer->getShip()->doMinesDamage($return['WeaponDamage']); |
|
134 | + $return['WeaponDamage'] = & $this->getModifiedForceDamageAgainstPlayer($forces, $targetPlayer, $minesAreAttacker); |
|
135 | + $return['ActualDamage'] = & $targetPlayer->getShip()->doMinesDamage($return['WeaponDamage']); |
|
136 | 136 | $return['ActualDamage']['Launched'] = ICeil($return['WeaponDamage']['Launched'] * $return['ActualDamage']['TotalDamage'] / $return['WeaponDamage']['MaxDamage']); |
137 | 137 | |
138 | 138 | if ($return['ActualDamage']['KillingShot']) { |
139 | - $return['KillResults'] =& $targetPlayer->killPlayerByForces($forces); |
|
139 | + $return['KillResults'] = & $targetPlayer->killPlayerByForces($forces); |
|
140 | 140 | } |
141 | 141 | return $return; |
142 | 142 | } |
@@ -80,7 +80,7 @@ |
||
80 | 80 | $return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); |
81 | 81 | return $return; |
82 | 82 | } |
83 | - $damage =& $this->getModifiedDamage(); |
|
83 | + $damage = & $this->getModifiedDamage(); |
|
84 | 84 | $damage['Launched'] = ICeil($this->getNumberOfSDs() * $this->getModifiedForceAccuracyAgainstPlayer($forces, $targetPlayer) / 100); |
85 | 85 | $damage['MaxDamage'] = ICeil($damage['Launched'] * $damage['MaxDamage']); |
86 | 86 | $damage['Shield'] = ICeil($damage['Launched'] * $damage['Shield']); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | foreach (\Globals::getGoods() as $goodId => $value) { |
92 | 92 | if ($goods[$goodId]===true) { |
93 | 93 | if ($sectors[$currentSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_SELLS && |
94 | - $sectors[$targetSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_BUYS) { |
|
94 | + $sectors[$targetSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_BUYS) { |
|
95 | 95 | $rl[] = new OneWayRoute($currentSectorId, $targetSectorId, $raceID, $sectors[$targetSectorId]->getPort()->getRaceID(), $sectors[$currentSectorId]->getPort()->getGoodDistance($goodId), $sectors[$targetSectorId]->getPort()->getGoodDistance($goodId), $distance, $goodId); |
96 | 96 | } |
97 | 97 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | foreach (\Globals::getGoods() as $goodId => $value) { |
117 | 117 | if ($goods[$goodId]===true) { |
118 | 118 | if ($sectors[$currentSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_SELLS && |
119 | - $sectors[$targetSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_BUYS) { |
|
119 | + $sectors[$targetSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_BUYS) { |
|
120 | 120 | $owr = new OneWayRoute($currentSectorId, $targetSectorId, $sectors[$currentSectorId]->getPort()->getRaceID(), $sectors[$targetSectorId]->getPort()->getRaceID(), $sectors[$currentSectorId]->getPort()->getGoodDistance($goodId), $sectors[$targetSectorId]->getPort()->getGoodDistance($goodId), $distance, $goodId); |
121 | 121 | $fakeReturn = new OneWayRoute($targetSectorId, $currentSectorId, $sectors[$targetSectorId]->getPort()->getRaceID(), $sectors[$currentSectorId]->getPort()->getRaceID(), 0, 0, $distance, GOOD_NOTHING); |
122 | 122 | $mpr = new MultiplePortRoute($owr, $fakeReturn); |
@@ -71,11 +71,11 @@ discard block |
||
71 | 71 | $routes = array(); |
72 | 72 | foreach ($distances as $currentSectorId => $d) { |
73 | 73 | $raceID = $sectors[$currentSectorId]->getPort()->getRaceID(); |
74 | - if (isset($races[$raceID])===false) { |
|
75 | - echo 'Error with Race ID: '.$sectors[$currentSectorId]->getPort()->getRaceID(); |
|
74 | + if (isset($races[$raceID]) === false) { |
|
75 | + echo 'Error with Race ID: ' . $sectors[$currentSectorId]->getPort()->getRaceID(); |
|
76 | 76 | continue; |
77 | 77 | } |
78 | - if($races[$raceID]===false) { |
|
78 | + if ($races[$raceID] === false) { |
|
79 | 79 | continue; |
80 | 80 | } |
81 | 81 | $rl = array(); |
@@ -83,16 +83,16 @@ discard block |
||
83 | 83 | if (!$races[$sectors[$targetSectorId]->getPort()->getRaceID()]) { |
84 | 84 | continue; |
85 | 85 | } |
86 | - if($routesForPort!==-1 && $currentSectorId !== $routesForPort && $targetSectorId !== $routesForPort) { |
|
86 | + if ($routesForPort !== -1 && $currentSectorId !== $routesForPort && $targetSectorId !== $routesForPort) { |
|
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | |
90 | - if ($goods[GOOD_NOTHING]===true) { |
|
90 | + if ($goods[GOOD_NOTHING] === true) { |
|
91 | 91 | $rl[] = new OneWayRoute($currentSectorId, $targetSectorId, $raceID, $sectors[$targetSectorId]->getPort()->getRaceID(), 0, 0, $distance, GOOD_NOTHING); |
92 | 92 | } |
93 | 93 | |
94 | 94 | foreach (\Globals::getGoods() as $goodId => $value) { |
95 | - if ($goods[$goodId]===true) { |
|
95 | + if ($goods[$goodId] === true) { |
|
96 | 96 | if ($sectors[$currentSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_SELLS && |
97 | 97 | $sectors[$targetSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_BUYS) { |
98 | 98 | $rl[] = new OneWayRoute($currentSectorId, $targetSectorId, $raceID, $sectors[$targetSectorId]->getPort()->getRaceID(), $sectors[$currentSectorId]->getPort()->getGoodDistance($goodId), $sectors[$targetSectorId]->getPort()->getGoodDistance($goodId), $distance, $goodId); |
@@ -108,19 +108,19 @@ discard block |
||
108 | 108 | public static function generateOneWayRoutes(array $sectors, array $distances, array $goods, array $races, int $routesForPort) : array { |
109 | 109 | self::initialize(); |
110 | 110 | foreach ($distances as $currentSectorId => $d) { |
111 | - if ($races[$sectors[$currentSectorId]->getPort()->getRaceID()]===false) { |
|
111 | + if ($races[$sectors[$currentSectorId]->getPort()->getRaceID()] === false) { |
|
112 | 112 | continue; |
113 | 113 | } |
114 | 114 | foreach ($d as $targetSectorId => $distance) { |
115 | - if ($races[$sectors[$targetSectorId]->getPort()->getRaceID()]===false) { |
|
115 | + if ($races[$sectors[$targetSectorId]->getPort()->getRaceID()] === false) { |
|
116 | 116 | continue; |
117 | 117 | } |
118 | - if($routesForPort!==-1 && $currentSectorId !== $routesForPort && $targetSectorId !== $routesForPort) { |
|
118 | + if ($routesForPort !== -1 && $currentSectorId !== $routesForPort && $targetSectorId !== $routesForPort) { |
|
119 | 119 | continue; |
120 | 120 | } |
121 | 121 | |
122 | 122 | foreach (\Globals::getGoods() as $goodId => $value) { |
123 | - if ($goods[$goodId]===true) { |
|
123 | + if ($goods[$goodId] === true) { |
|
124 | 124 | if ($sectors[$currentSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_SELLS && |
125 | 125 | $sectors[$targetSectorId]->getPort()->getGoodTransaction($goodId) === self::GOOD_BUYS) { |
126 | 126 | $owr = new OneWayRoute($currentSectorId, $targetSectorId, $sectors[$currentSectorId]->getPort()->getRaceID(), $sectors[$targetSectorId]->getPort()->getRaceID(), $sectors[$currentSectorId]->getPort()->getGoodDistance($goodId), $sectors[$targetSectorId]->getPort()->getGoodDistance($goodId), $distance, $goodId); |
@@ -166,19 +166,19 @@ discard block |
||
166 | 166 | $i = 0; |
167 | 167 | krsort(self::$expRoutes, SORT_NUMERIC); |
168 | 168 | foreach (self::$expRoutes as $multi => $routesByMulti) { |
169 | - if(count($routesByMulti)+$i < $trimToBestXRoutes) { |
|
169 | + if (count($routesByMulti) + $i < $trimToBestXRoutes) { |
|
170 | 170 | $i += count($routesByMulti); |
171 | 171 | } |
172 | - else if($i > $trimToBestXRoutes) { |
|
172 | + else if ($i > $trimToBestXRoutes) { |
|
173 | 173 | unset(self::$expRoutes[$multi]); |
174 | 174 | } |
175 | 175 | else { |
176 | - foreach($routesByMulti as $key => $value) { |
|
176 | + foreach ($routesByMulti as $key => $value) { |
|
177 | 177 | $i++; |
178 | - if($i < $trimToBestXRoutes) { |
|
178 | + if ($i < $trimToBestXRoutes) { |
|
179 | 179 | continue; |
180 | 180 | } |
181 | - if($i === $trimToBestXRoutes) { |
|
181 | + if ($i === $trimToBestXRoutes) { |
|
182 | 182 | self::$dontAddWorseThan[self::EXP_ROUTE] = $multi; |
183 | 183 | continue; |
184 | 184 | } |
@@ -190,20 +190,20 @@ discard block |
||
190 | 190 | $i = 0; |
191 | 191 | krsort(self::$moneyRoutes, SORT_NUMERIC); |
192 | 192 | foreach (self::$moneyRoutes as $multi => $routesByMulti) { |
193 | - if(count($routesByMulti)+$i < $trimToBestXRoutes) { |
|
193 | + if (count($routesByMulti) + $i < $trimToBestXRoutes) { |
|
194 | 194 | $i += count($routesByMulti); |
195 | 195 | } |
196 | - else if($i > $trimToBestXRoutes) { |
|
196 | + else if ($i > $trimToBestXRoutes) { |
|
197 | 197 | unset(self::$moneyRoutes[$multi]); |
198 | 198 | continue; |
199 | 199 | } |
200 | 200 | else { |
201 | - foreach($routesByMulti as $key => $value) { |
|
201 | + foreach ($routesByMulti as $key => $value) { |
|
202 | 202 | $i++; |
203 | - if($i < $trimToBestXRoutes) { |
|
203 | + if ($i < $trimToBestXRoutes) { |
|
204 | 204 | continue; |
205 | 205 | } |
206 | - if($i === $trimToBestXRoutes) { |
|
206 | + if ($i === $trimToBestXRoutes) { |
|
207 | 207 | self::$dontAddWorseThan[self::MONEY_ROUTE] = $multi; |
208 | 208 | continue; |
209 | 209 | } |
@@ -58,8 +58,7 @@ discard block |
||
58 | 58 | $mpr = new MultiplePortRoute($routeToContinue, $currentStepRoute); |
59 | 59 | self::addExpRoute($mpr); |
60 | 60 | self::addMoneyRoute($mpr); |
61 | - } |
|
62 | - else if ($maxNumPorts > 1 && !$routeToContinue->containsPort($currentStepBuySector)) { |
|
61 | + } else if ($maxNumPorts > 1 && !$routeToContinue->containsPort($currentStepBuySector)) { |
|
63 | 62 | $mpr = new MultiplePortRoute($routeToContinue, $currentStepRoute); |
64 | 63 | self::getContinueRoutes($maxNumPorts - 1, $startSectorId, $mpr, $routeLists[$currentStepBuySector], $routeLists, $lastGoodIsNothing); |
65 | 64 | } |
@@ -168,11 +167,9 @@ discard block |
||
168 | 167 | foreach (self::$expRoutes as $multi => $routesByMulti) { |
169 | 168 | if(count($routesByMulti)+$i < $trimToBestXRoutes) { |
170 | 169 | $i += count($routesByMulti); |
171 | - } |
|
172 | - else if($i > $trimToBestXRoutes) { |
|
170 | + } else if($i > $trimToBestXRoutes) { |
|
173 | 171 | unset(self::$expRoutes[$multi]); |
174 | - } |
|
175 | - else { |
|
172 | + } else { |
|
176 | 173 | foreach($routesByMulti as $key => $value) { |
177 | 174 | $i++; |
178 | 175 | if($i < $trimToBestXRoutes) { |
@@ -192,12 +189,10 @@ discard block |
||
192 | 189 | foreach (self::$moneyRoutes as $multi => $routesByMulti) { |
193 | 190 | if(count($routesByMulti)+$i < $trimToBestXRoutes) { |
194 | 191 | $i += count($routesByMulti); |
195 | - } |
|
196 | - else if($i > $trimToBestXRoutes) { |
|
192 | + } else if($i > $trimToBestXRoutes) { |
|
197 | 193 | unset(self::$moneyRoutes[$multi]); |
198 | 194 | continue; |
199 | - } |
|
200 | - else { |
|
195 | + } else { |
|
201 | 196 | foreach($routesByMulti as $key => $value) { |
202 | 197 | $i++; |
203 | 198 | if($i < $trimToBestXRoutes) { |
@@ -20,7 +20,7 @@ |
||
20 | 20 | } |
21 | 21 | } |
22 | 22 | $missingLocs = array_diff(array_keys(SmrLocation::getAllLocations()), |
23 | - array_keys($existingLocs)); |
|
23 | + array_keys($existingLocs)); |
|
24 | 24 | $missingLocNames = []; |
25 | 25 | foreach ($missingLocs as $locID) { |
26 | 26 | $missingLocNames[] = SmrLocation::getLocation($locID)->getName(); |