@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | * @copyright 2008 By Chlorel for XNova |
8 | 8 | */ |
9 | 9 | |
10 | -function flt_mission_recycle(&$mission_data) |
|
11 | -{ |
|
10 | +function flt_mission_recycle(&$mission_data) { |
|
12 | 11 | $fleet_row = &$mission_data['fleet']; |
13 | 12 | $destination_planet = &$mission_data['dst_planet']; |
14 | 13 | |
@@ -37,8 +36,7 @@ discard block |
||
37 | 36 | if(in_array($unit_id, sn_get_groups('flt_recyclers'))) |
38 | 37 | { |
39 | 38 | $RecyclerCapacity += $capacity; |
40 | - } |
|
41 | - else |
|
39 | + } else |
|
42 | 40 | { |
43 | 41 | $OtherFleetCapacity += $capacity; |
44 | 42 | } |
@@ -55,16 +53,14 @@ discard block |
||
55 | 53 | { |
56 | 54 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
57 | 55 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
58 | - } |
|
59 | - else |
|
56 | + } else |
|
60 | 57 | { |
61 | 58 | if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
62 | 59 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
63 | 60 | { |
64 | 61 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
65 | 62 | $RecycledGoods["crystal"] = $RecyclerCapacity / 2; |
66 | - } |
|
67 | - else |
|
63 | + } else |
|
68 | 64 | { |
69 | 65 | if ($destination_planet["debris_metal"] > $destination_planet["debris_crystal"]) |
70 | 66 | { |
@@ -72,20 +68,17 @@ discard block |
||
72 | 68 | if ($destination_planet["debris_metal"] > ($RecyclerCapacity - $RecycledGoods["crystal"])) |
73 | 69 | { |
74 | 70 | $RecycledGoods["metal"] = $RecyclerCapacity - $RecycledGoods["crystal"]; |
75 | - } |
|
76 | - else |
|
71 | + } else |
|
77 | 72 | { |
78 | 73 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
79 | 74 | } |
80 | - } |
|
81 | - else |
|
75 | + } else |
|
82 | 76 | { |
83 | 77 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
84 | 78 | if ($destination_planet["debris_crystal"] > ($RecyclerCapacity - $RecycledGoods["metal"])) |
85 | 79 | { |
86 | 80 | $RecycledGoods["crystal"] = $RecyclerCapacity - $RecycledGoods["metal"]; |
87 | - } |
|
88 | - else |
|
81 | + } else |
|
89 | 82 | { |
90 | 83 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
91 | 84 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | } |
59 | 59 | else |
60 | 60 | { |
61 | - if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
61 | + if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) and |
|
62 | 62 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
63 | 63 | { |
64 | 64 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | $fleet_row = &$mission_data['fleet']; |
16 | 16 | $destination_planet = &$mission_data['dst_planet']; |
17 | 17 | |
18 | - if(!$fleet_row) |
|
18 | + if (!$fleet_row) |
|
19 | 19 | { |
20 | 20 | return CACHE_NOTHING; |
21 | 21 | } |
22 | 22 | |
23 | - if(!isset($destination_planet['id'])) |
|
23 | + if (!isset($destination_planet['id'])) |
|
24 | 24 | { |
25 | 25 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
26 | 26 | DbFleetStatic::fleet_send_back($mission_data['fleet']); |
@@ -32,12 +32,12 @@ discard block |
||
32 | 32 | $RecyclerCapacity = 0; |
33 | 33 | $OtherFleetCapacity = 0; |
34 | 34 | $fleet_array = sys_unit_str2arr($fleet_row['fleet_array']); |
35 | - foreach($fleet_array as $unit_id => $unit_count) |
|
35 | + foreach ($fleet_array as $unit_id => $unit_count) |
|
36 | 36 | { |
37 | - if(in_array($unit_id, sn_get_groups('fleet'))) |
|
37 | + if (in_array($unit_id, sn_get_groups('fleet'))) |
|
38 | 38 | { |
39 | 39 | $capacity = get_unit_param($unit_id, P_CAPACITY) * $unit_count; |
40 | - if(in_array($unit_id, sn_get_groups('flt_recyclers'))) |
|
40 | + if (in_array($unit_id, sn_get_groups('flt_recyclers'))) |
|
41 | 41 | { |
42 | 42 | $RecyclerCapacity += $capacity; |
43 | 43 | } |
@@ -49,19 +49,19 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | $IncomingFleetGoods = $fleet_row["fleet_resource_metal"] + $fleet_row["fleet_resource_crystal"] + $fleet_row["fleet_resource_deuterium"]; |
52 | - if($IncomingFleetGoods > $OtherFleetCapacity) |
|
52 | + if ($IncomingFleetGoods > $OtherFleetCapacity) |
|
53 | 53 | { |
54 | 54 | $RecyclerCapacity -= ($IncomingFleetGoods - $OtherFleetCapacity); |
55 | 55 | } |
56 | 56 | |
57 | - if(($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) |
|
57 | + if (($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) |
|
58 | 58 | { |
59 | 59 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
60 | 60 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
61 | 61 | } |
62 | 62 | else |
63 | 63 | { |
64 | - if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
64 | + if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
65 | 65 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
66 | 66 | { |
67 | 67 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | } |
97 | 97 | } |
98 | - $NewCargo['Metal'] = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"]; |
|
98 | + $NewCargo['Metal'] = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"]; |
|
99 | 99 | $NewCargo['Crystal'] = $fleet_row["fleet_resource_crystal"] + $RecycledGoods["crystal"]; |
100 | 100 | $NewCargo['Deuterium'] = $fleet_row["fleet_resource_deuterium"]; |
101 | 101 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | HelperString::numberFloorAndFormat($RecycledGoods["metal"]), $lang['Metal'], |
109 | 109 | HelperString::numberFloorAndFormat($RecycledGoods["crystal"]), $lang['Crystal'] |
110 | 110 | ); |
111 | - msg_send_simple_message ( $fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_RECYCLE, $lang['sys_mess_spy_control'], $lang['sys_recy_report'], $Message); |
|
111 | + msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_RECYCLE, $lang['sys_mess_spy_control'], $lang['sys_recy_report'], $Message); |
|
112 | 112 | |
113 | 113 | // $QryUpdateFleet = "UPDATE {{fleets}} SET `fleet_mess` = 1,`fleet_resource_metal` = '{$NewCargo['Metal']}',`fleet_resource_crystal` = '{$NewCargo['Crystal']}',`fleet_resource_deuterium` = '{$NewCargo['Deuterium']}' "; |
114 | 114 | // $QryUpdateFleet .= "WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;"; |
@@ -8,8 +8,7 @@ |
||
8 | 8 | * @version 1.1 |
9 | 9 | * @copyright 2008 by Chlorel for XNova |
10 | 10 | */ |
11 | -function flt_mission_relocate($mission_data) |
|
12 | -{ |
|
11 | +function flt_mission_relocate($mission_data) { |
|
13 | 12 | $fleet_row = &$mission_data['fleet']; |
14 | 13 | $destination_planet = &$mission_data['dst_planet']; |
15 | 14 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $fleet_row = &$mission_data['fleet']; |
16 | 16 | $destination_planet = &$mission_data['dst_planet']; |
17 | 17 | |
18 | - if(!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner']) |
|
18 | + if (!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner']) |
|
19 | 19 | { |
20 | 20 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
21 | 21 | DbFleetStatic::fleet_send_back($mission_data['fleet']); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $mission_data['src_planet']['name'], uni_render_coordinates_href($fleet_row, 'fleet_start_', 3, ''), $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), |
29 | 29 | $fleet_row['fleet_resource_metal'], $lang['Metal'], $fleet_row['fleet_resource_crystal'], $lang['Crystal'], $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']) . |
30 | 30 | '<br />' . $lang['sys_relocate_mess_user']; |
31 | - foreach(sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) |
|
31 | + foreach (sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) |
|
32 | 32 | { |
33 | 33 | $Message .= $lang['tech'][$ship_id] . ' - ' . $ship_count . '<br />'; |
34 | 34 | } |
@@ -8,8 +8,7 @@ |
||
8 | 8 | * @copyright 2008 By Chlorel for XNova |
9 | 9 | */ |
10 | 10 | |
11 | -function flt_mission_transport(&$mission_data) |
|
12 | -{ |
|
11 | +function flt_mission_transport(&$mission_data) { |
|
13 | 12 | $fleet_row = &$mission_data['fleet']; |
14 | 13 | $source_planet = &$mission_data['src_planet']; |
15 | 14 | $destination_planet = &$mission_data['dst_planet']; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $source_planet = &$mission_data['src_planet']; |
17 | 17 | $destination_planet = &$mission_data['dst_planet']; |
18 | 18 | |
19 | - if(!isset($destination_planet['id']) || !$destination_planet['id_owner']) |
|
19 | + if (!isset($destination_planet['id']) || !$destination_planet['id_owner']) |
|
20 | 20 | { |
21 | 21 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
22 | 22 | DbFleetStatic::fleet_send_back($fleet_row); |
@@ -29,10 +29,10 @@ discard block |
||
29 | 29 | $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), |
30 | 30 | $fleet_row['fleet_resource_metal'], $lang['Metal'], |
31 | 31 | $fleet_row['fleet_resource_crystal'], $lang['Crystal'], |
32 | - $fleet_row['fleet_resource_deuterium'], $lang['Deuterium'] ); |
|
32 | + $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']); |
|
33 | 33 | msg_send_simple_message($fleet_row['fleet_target_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message); |
34 | 34 | |
35 | - if($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner']) |
|
35 | + if ($fleet_row['fleet_target_owner'] <> $fleet_row['fleet_owner']) |
|
36 | 36 | { |
37 | 37 | msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_TRANSPORT, $lang['sys_mess_tower'], $lang['sys_mess_transport'], $Message); |
38 | 38 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | QUEST_STATUS_COMPLETE => '', |
32 | 32 | ); |
33 | 33 | |
34 | - if(!isset($statuses[$this->filterQuestStatus])) { |
|
34 | + if (!isset($statuses[$this->filterQuestStatus])) { |
|
35 | 35 | $this->filterQuestStatus = QUEST_STATUS_ALL; |
36 | 36 | } |
37 | 37 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
104 | - if(!isset($next)) { |
|
104 | + if (!isset($next)) { |
|
105 | 105 | $next = new TextEntity(); |
106 | 106 | } |
107 | 107 | |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $prev = $this->getById($currentText->prev); |
120 | 120 | } |
121 | 121 | |
122 | - if(!isset($prev)) { |
|
122 | + if (!isset($prev)) { |
|
123 | 123 | $prev = new TextEntity(); |
124 | 124 | } |
125 | 125 |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | * @return string |
339 | 339 | */ |
340 | 340 | protected function stringValue($value) { |
341 | - return "'" . $this->escape((string)$value) . "'"; |
|
341 | + return "'" . $this->escape((string) $value) . "'"; |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | /** |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | * @return string |
350 | 350 | */ |
351 | 351 | public function quote($fieldName) { |
352 | - return "`" . $this->escape((string)$fieldName) . "`"; |
|
352 | + return "`" . $this->escape((string) $fieldName) . "`"; |
|
353 | 353 | } |
354 | 354 | |
355 | 355 | /** |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | * @return string |
397 | 397 | */ |
398 | 398 | protected function quoteTable($tableName) { |
399 | - return "`{{" . $this->escape((string)$tableName) . "}}`"; |
|
399 | + return "`{{" . $this->escape((string) $tableName) . "}}`"; |
|
400 | 400 | } |
401 | 401 | |
402 | 402 | /** |
@@ -43,7 +43,7 @@ |
||
43 | 43 | */ |
44 | 44 | public function toArray() { |
45 | 45 | $tutorial = array(); |
46 | - foreach($this->keys() as $key) { |
|
46 | + foreach ($this->keys() as $key) { |
|
47 | 47 | $tutorial[$key] = $this->$key; |
48 | 48 | } |
49 | 49 |
@@ -7,9 +7,9 @@ |
||
7 | 7 | * |
8 | 8 | */ |
9 | 9 | |
10 | -define('INSIDE' , true); |
|
11 | -define('INSTALL' , false); |
|
12 | -define('IN_ADMIN' , true); |
|
10 | +define('INSIDE', true); |
|
11 | +define('INSTALL', false); |
|
12 | +define('IN_ADMIN', true); |
|
13 | 13 | |
14 | 14 | require('../common.' . substr(strrchr(__FILE__, '.'), 1)); |
15 | 15 |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | $mip_data = get_unit_param(UNIT_DEF_MISSILE_INTERPLANET); |
15 | 15 | $MIPDamage = floor(mrc_modify_value($attackerTech, false, TECH_WEAPON, $MIPs * $mip_data[P_ATTACK] * mt_rand(80, 120) / 100)); |
16 | - foreach($structures as $key => $structure) |
|
16 | + foreach ($structures as $key => $structure) |
|
17 | 17 | { |
18 | 18 | $unit_info = get_unit_param($key); |
19 | 19 | $amplify = isset($mip_data[P_AMPLIFY][$key]) ? $mip_data[P_AMPLIFY][$key] : 1; |
@@ -31,9 +31,9 @@ discard block |
||
31 | 31 | { |
32 | 32 | //attacking only selected structure |
33 | 33 | $damageDone = $structures[$targetedStructure][$damageTo]; |
34 | - $structsDestroyed = min( floor($MIPDamage/$damageDone), $structures[$targetedStructure][0] ); |
|
34 | + $structsDestroyed = min(floor($MIPDamage / $damageDone), $structures[$targetedStructure][0]); |
|
35 | 35 | $structures[$targetedStructure][0] -= $structsDestroyed; |
36 | - $MIPDamage -= $structsDestroyed*$damageDone; |
|
36 | + $MIPDamage -= $structsDestroyed * $damageDone; |
|
37 | 37 | } |
38 | 38 | else |
39 | 39 | { |
@@ -44,16 +44,16 @@ discard block |
||
44 | 44 | do |
45 | 45 | { |
46 | 46 | // finding is there any structure that can be damaged with leftovers of $MIPDamage |
47 | - foreach($can_be_damaged as $key => $unit_id) |
|
47 | + foreach ($can_be_damaged as $key => $unit_id) |
|
48 | 48 | { |
49 | 49 | //debug($structures[$unit_id][0]); |
50 | 50 | //debug($structures[$unit_id][$damageTo], $MIPDamage); |
51 | - if($structures[$unit_id][0] <= 0 || $structures[$unit_id][$damageTo] > $MIPDamage) |
|
51 | + if ($structures[$unit_id][0] <= 0 || $structures[$unit_id][$damageTo] > $MIPDamage) |
|
52 | 52 | { |
53 | 53 | unset($can_be_damaged[$key]); |
54 | 54 | } |
55 | 55 | } |
56 | - if(empty($can_be_damaged)) |
|
56 | + if (empty($can_be_damaged)) |
|
57 | 57 | { |
58 | 58 | break; |
59 | 59 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | //debug($destroyed, 'Actually destroyed'); |
73 | 73 | |
74 | 74 | //print('<hr>'); |
75 | - } while($MIPDamage > 0 && !empty($can_be_damaged)); |
|
75 | + } while ($MIPDamage > 0 && !empty($can_be_damaged)); |
|
76 | 76 | //debug($MIPDamage, 'MIPDamage left'); |
77 | 77 | } |
78 | 78 | //debug($structures);//die(); |
@@ -87,8 +87,8 @@ discard block |
||
87 | 87 | $crystal += $destroyed * $unit_info[P_COST][RES_CRYSTAL] / 4; |
88 | 88 | } |
89 | 89 | |
90 | - $return['structures'] = $structures; // Structures left after attack |
|
91 | - $return['metal'] = floor($metal); // Metal scraps |
|
90 | + $return['structures'] = $structures; // Structures left after attack |
|
91 | + $return['metal'] = floor($metal); // Metal scraps |
|
92 | 92 | $return['crystal'] = floor($crystal); // Crystal scraps |
93 | 93 | |
94 | 94 | return $return; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | $iraks = doquery("SELECT * FROM {{iraks}} WHERE `fleet_end_time` <= " . SN_TIME_NOW . " FOR UPDATE;"); |
114 | 114 | |
115 | - while($fleetRow = db_fetch($iraks)) { |
|
115 | + while ($fleetRow = db_fetch($iraks)) { |
|
116 | 116 | set_time_limit(15); |
117 | 117 | $db_changeset = array(); |
118 | 118 | |
@@ -128,9 +128,9 @@ discard block |
||
128 | 128 | |
129 | 129 | $rowAttacker = db_user_by_id($fleetRow['fleet_owner'], true); |
130 | 130 | |
131 | - if($target_planet_row['id']) { |
|
131 | + if ($target_planet_row['id']) { |
|
132 | 132 | $planetDefense = array(); |
133 | - foreach(sn_get_groups('defense_active') as $unit_id) { |
|
133 | + foreach (sn_get_groups('defense_active') as $unit_id) { |
|
134 | 134 | $planetDefense[$unit_id] = array(mrc_get_level($targetUser, $target_planet_row, $unit_id, true, true)); |
135 | 135 | } |
136 | 136 | |
@@ -141,23 +141,23 @@ discard block |
||
141 | 141 | $message = $lang['mip_all_destroyed']; |
142 | 142 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit(UNIT_DEF_MISSILE_INTERCEPTOR, -$missiles, $targetUser, $target_planet_row['id']); |
143 | 143 | } else { |
144 | - if($interceptors) { |
|
144 | + if ($interceptors) { |
|
145 | 145 | $message = sprintf($lang['mip_destroyed'], $interceptors); |
146 | 146 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit(UNIT_DEF_MISSILE_INTERCEPTOR, -$interceptors, $targetUser, $target_planet_row['id']); |
147 | 147 | } |
148 | 148 | |
149 | 149 | $attackResult = COE_missileAttack($targetUser, $rowAttacker, $missiles - $interceptors, $planetDefense, $fleetRow['primaer']); |
150 | 150 | |
151 | - foreach($attackResult['structures'] as $key => $structure) { |
|
151 | + foreach ($attackResult['structures'] as $key => $structure) { |
|
152 | 152 | $destroyed = $planetDefense[$key][0] - $structure[0]; |
153 | - if($destroyed) { |
|
153 | + if ($destroyed) { |
|
154 | 154 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($key, -$destroyed, $targetUser, $target_planet_row['id']); |
155 | 155 | |
156 | 156 | $message .= " {$lang['tech'][$key]} - {$destroyed} {$lang['quantity']}<br>"; |
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
160 | - if(!empty($message)) { |
|
160 | + if (!empty($message)) { |
|
161 | 161 | $message = $lang['mip_defense_destroyed'] . $message . "{$lang['mip_recycled']}{$lang['Metal']}: {$attackResult['metal']}, {$lang['Crystal']}: {$attackResult['crystal']}<br>"; |
162 | 162 | |
163 | 163 | DBStaticPlanet::db_planet_set_by_id($target_planet_row['id'], "`metal` = `metal` + {$attackResult['metal']}, `crystal` = `crystal` + {$attackResult['crystal']}"); |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | |
175 | 175 | empty($message) ? $message = $lang['mip_no_defense'] : false; |
176 | 176 | |
177 | - msg_send_simple_message ( $fleetRow['fleet_owner'], '', SN_TIME_NOW, MSG_TYPE_SPY, $lang['mip_sender_amd'], $lang['mip_subject_amd'], $message_vorlage . $message ); |
|
178 | - msg_send_simple_message ( $fleetRow['fleet_target_owner'], '', SN_TIME_NOW, MSG_TYPE_SPY, $lang['mip_sender_amd'], $lang['mip_subject_amd'], $message_vorlage . $message ); |
|
177 | + msg_send_simple_message($fleetRow['fleet_owner'], '', SN_TIME_NOW, MSG_TYPE_SPY, $lang['mip_sender_amd'], $lang['mip_subject_amd'], $message_vorlage . $message); |
|
178 | + msg_send_simple_message($fleetRow['fleet_target_owner'], '', SN_TIME_NOW, MSG_TYPE_SPY, $lang['mip_sender_amd'], $lang['mip_subject_amd'], $message_vorlage . $message); |
|
179 | 179 | } |
180 | 180 | doquery("DELETE FROM {{iraks}} WHERE id = '{$fleetRow['id']}';"); |
181 | 181 | } |
@@ -7,8 +7,7 @@ discard block |
||
7 | 7 | use DBAL\OldDbChangeSet; |
8 | 8 | use Planet\DBStaticPlanet; |
9 | 9 | |
10 | -function COE_missileAttack($defenceTech, $attackerTech, $MIPs, $structures, $targetedStructure = '0') |
|
11 | -{ |
|
10 | +function COE_missileAttack($defenceTech, $attackerTech, $MIPs, $structures, $targetedStructure = '0') { |
|
12 | 11 | // Here we select which part of defense should take damage: structure or shield |
13 | 12 | // $damageTo = P_SHIELD; |
14 | 13 | // $damageTo = P_STRUCTURE; |
@@ -37,8 +36,7 @@ discard block |
||
37 | 36 | $structsDestroyed = min( floor($MIPDamage/$damageDone), $structures[$targetedStructure][0] ); |
38 | 37 | $structures[$targetedStructure][0] -= $structsDestroyed; |
39 | 38 | $MIPDamage -= $structsDestroyed*$damageDone; |
40 | - } |
|
41 | - else |
|
39 | + } else |
|
42 | 40 | { |
43 | 41 | // REALLY random attack |
44 | 42 | $can_be_damaged = sn_get_groups('defense_active'); |