Passed
Branch trunk (7dc288)
by SuperNova.WS
06:07
created

sn_sys_sector_buy()   B

Complexity

Conditions 5
Paths 4

Size

Total Lines 30
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 18
nc 4
nop 1
dl 0
loc 30
rs 8.439
c 0
b 0
f 0
1
<?php
2
/**
3
 * Created by Gorlum 04.12.2017 5:04
4
 */
5
6
// PLANET FUNCTIONS ----------------------------------------------------------------------------------------------------------------
7
function eco_planet_fields_max($planet) {
8
  return $planet['field_max'] + ($planet['planet_type'] == PT_PLANET ? mrc_get_level($user, $planet, STRUC_TERRAFORMER) * 5 : (mrc_get_level($user, $planet, STRUC_MOON_STATION) * 3));
9
}
10
11
function GetPhalanxRange($phalanx_level) {
12
  return $phalanx_level > 1 ? pow($phalanx_level, 2) - 1 : 0;
13
}
14
15
/**
16
 * @param array $planet
17
 *
18
 * @return bool
19
 */
20
function CheckAbandonPlanetState(&$planet) {
21
  if ($planet['destruyed'] && $planet['destruyed'] <= SN_TIME_NOW) {
22
    DBStaticPlanet::db_planet_delete_by_id($planet['id']);
23
24
    return true;
25
  }
26
27
  return false;
28
}
29
30
function can_capture_planet() { $result = null; return sn_function_call('can_capture_planet', array(&$result)); }
31
32
function sn_can_capture_planet(&$result) {
33
  return $result = false;
34
}
35