Properties

$db

$db : resource

Type

resource — Database connection.

$uid

$uid : integer

Type

integer — User ID.

$id

$id : integer

Type

integer — Unit ID.

$building

$building : \Building

Type

\Building — Building the unit is on.

$unit

$unit : \K_Unit

Type

\K_Unit — Base unit.

$stars

$stars : integer

Type

integer — Unit stars.

$level

$level : integer

Type

integer — Unit level.

$hp

$hp : integer

Type

integer — Unit base HP stat.

$attack

$attack : integer

Type

integer — Unit base ATK stat.

$defense

$defense : integer

Type

integer — Unit base DEF stat.

$speed

$speed : integer

Type

integer — Unit base SPD stat.

$crit_rate

$crit_rate : integer

Type

integer — Unit base CRR stat.

$crit_damage

$crit_damage : integer

Type

integer — Unit base CRD stat.

$resistance

$resistance : integer

Type

integer — Unit base RES stat.

$accuracy

$accuracy : integer

Type

integer — Unit base ACC stat.

$experience

$experience : integer

Type

integer — Total gained experience.

$exp_gained

$exp_gained : integer

Type

integer — Total gained experience in its current level.

$exp_gain_rate

$exp_gain_rate : integer

Type

integer — Experience / hour in the current building.

$costume

$costume : integer

Type

integer — Equipped transmogification.

$source

$source : \K_Source

Type

\K_Source — Source the unit was aquired from.

$create_time

$create_time : \Datetime

Type

\Datetime — Time the unit was obtained.

$homunculus_name

$homunculus_name : string

Type

string — Indicates the Homunculus name

$lock

$lock : boolean

Type

boolean — Indicates if the monster is locked.

$rune_hp

$rune_hp : integer

Type

integer — Unit rune HP stat.

$rune_attack

$rune_attack : integer

Type

integer — Unit rune ATK stat.

$rune_defense

$rune_defense : integer

Type

integer — Unit rune DEF stat.

$rune_speed

$rune_speed : integer

Type

integer — Unit rune SPD stat.

$rune_crit_rate

$rune_crit_rate : integer

Type

integer — Unit rune CRR stat.

$rune_crit_damage

$rune_crit_damage : integer

Type

integer — Unit rune CRD stat.

$rune_resistance

$rune_resistance : integer

Type

integer — Unit rune RES stat.

$rune_accuracy

$rune_accuracy : integer

Type

integer — Unit rune ACC stat.

$avg_rune_efficiency

$avg_rune_efficiency : float

Type

float — Average rune efficiency.

$rune

$rune : array<mixed,\Rune>

Type

array<mixed,\Rune> — Equiped Runes.

$teams

$teams : array<mixed,\Team>

Type

array<mixed,\Team> — The Teamss the unit is on.

$skill_levels

$skill_levels : array<mixed,integer>

Type

array<mixed,integer> — Array with the levels of the skills, in orer.

$experience_level

$experience_level : integer

Type

integer — Total experience required for the current level.

$experience_level_up

$experience_level_up : integer

Type

integer — Experience required to level up.

$in_storage

$in_storage : integer

Type

integer — Indcates if the unit is in storage.

$title

$title : string

Type

string — Unit title. If Homunculus,it will be it's name. If awakened, it will be the awakened from name. If unawakened, it will be <element> <name>.

Methods

__construct()

__construct(resource  $db, integer  $id, boolean  $complete = true) 

Constructor.

Searches the database and retrieves the information about the monster, populating it and it's items.

Parameters

resource $db

Connection to the database.

integer $id

Monster identifier.

boolean $complete

If false, query only monster and k_monster.

check_storage()

check_storage() 

Checks if the monster is in storage and sets {@see $in_storage} to true or false.

load_teams()

load_teams() 

Loads the {@see teams} array, with the teams the unit is on.

load_runes()

load_runes() 

Loads the information about the equiped runes.

It is autoatically called at construction time if the $complete parameter is true (by default). No point in calling it twice.

are_skills_maxed()

are_skills_maxed() : boolean

Checks if the unit skills are completly maxed.

Returns

boolean —

True if all skills maxed, false otherwise.

sum_rune_stat()

sum_rune_stat(string  $stat, integer  $value) 

Calculates the stat increase by a rune property.

Parameters

string $stat

Stat type.

integer $value

Stat increase value.