@@ -1,7 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -function art_use(&$user, &$planetrow, $unit_id) |
|
| 4 | -{ |
|
| 3 | +function art_use(&$user, &$planetrow, $unit_id) { |
|
| 5 | 4 | global $lang; |
| 6 | 5 | |
| 7 | 6 | if(!in_array($unit_id, sn_get_groups('artifacts'))) |
@@ -48,14 +47,12 @@ discard block |
||
| 48 | 47 | { |
| 49 | 48 | $new_moon_row = uni_create_moon($planetrow['galaxy'], $planetrow['system'], $planetrow['planet'], $user['id'], $moonSize, $updateDebris); |
| 50 | 49 | $message = sprintf($lang['art_moon_create'][$unit_id], $new_moon_row['name'], uni_render_coordinates($planetrow), HelperString::numberFloorAndFormat($moonSize)); |
| 51 | - } |
|
| 52 | - else |
|
| 50 | + } else |
|
| 53 | 51 | { |
| 54 | 52 | $message = $lang['art_lhc_moon_fail']; |
| 55 | 53 | } |
| 56 | 54 | msg_send_simple_message($user['id'], 0, 0, MSG_TYPE_ADMIN, $lang['art_lhc_from'], $lang['art_lhc_subj'], $message); |
| 57 | - } |
|
| 58 | - else |
|
| 55 | + } else |
|
| 59 | 56 | { |
| 60 | 57 | $message = $lang['art_moon_exists']; |
| 61 | 58 | } |
@@ -83,8 +80,9 @@ discard block |
||
| 83 | 80 | $sectors_used = 0; |
| 84 | 81 | foreach($artifact_deploy as $deploy_unit_id => $deploy_unit_level) |
| 85 | 82 | { |
| 86 | - if(!($levels_deployed = max(0, $deploy_unit_level - mrc_get_level($user, $planetrow, $deploy_unit_id, true, true)))) |
|
| 87 | - continue; |
|
| 83 | + if(!($levels_deployed = max(0, $deploy_unit_level - mrc_get_level($user, $planetrow, $deploy_unit_id, true, true)))) { |
|
| 84 | + continue; |
|
| 85 | + } |
|
| 88 | 86 | $sectors_used += $levels_deployed; |
| 89 | 87 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($deploy_unit_id, $levels_deployed, $user, $planetrow['id']); |
| 90 | 88 | } |
@@ -118,8 +116,7 @@ discard block |
||
| 118 | 116 | DBStaticQue::db_que_set_time_left_by_id($que_item['que_id'], $que_item['que_time_left']); |
| 119 | 117 | $message = sprintf($lang['art_heurestic_chip_ok'], $lang['tech'][$que_item['que_unit_id']], $que_item['que_unit_level'], sys_time_human($old_time - $que_item['que_time_left'])); |
| 120 | 118 | msg_send_simple_message($user['id'], 0, 0, MSG_TYPE_QUE, $lang['art_heurestic_chip_subj'], $lang['art_heurestic_chip_subj'], $message); |
| 121 | - } |
|
| 122 | - else |
|
| 119 | + } else |
|
| 123 | 120 | { |
| 124 | 121 | $message = $lang['art_heurestic_chip_no_research']; |
| 125 | 122 | } |
@@ -147,8 +144,7 @@ discard block |
||
| 147 | 144 | $lang['tech'][$que_item['que_unit_id']], $que_item['que_unit_level'], $planetrow['name'], uni_render_coordinates($planetrow), sys_time_human($old_time - $que_item['que_time_left']) |
| 148 | 145 | ); |
| 149 | 146 | msg_send_simple_message($user['id'], 0, 0, MSG_TYPE_QUE, $lang['art_nano_builder_subj'], $lang['art_nano_builder_subj'], $message); |
| 150 | - } |
|
| 151 | - else |
|
| 147 | + } else |
|
| 152 | 148 | { |
| 153 | 149 | $message = $lang['art_nano_builder_no_que']; |
| 154 | 150 | } |
@@ -160,8 +156,7 @@ discard block |
||
| 160 | 156 | $db_changeset['unit'][] = OldDbChangeSet::db_changeset_prepare_unit($unit_id, $unit_level - $artifact_level_old, $user); |
| 161 | 157 | OldDbChangeSet::db_changeset_apply($db_changeset); |
| 162 | 158 | } |
| 163 | - } |
|
| 164 | - else |
|
| 159 | + } else |
|
| 165 | 160 | { |
| 166 | 161 | $message = $lang['art_err_no_artifact']; |
| 167 | 162 | } |