# SWDB

# \Monster_Fusion

Extension of K_Unit that also stores information about owned monsters.

Represents an object from the table 'k_unit'.

## Summary

Methods
Properties
Constants
__construct()
load_essences()
load_transformation()
load_skills()
load_sources()
get_image()
$id
$family
$name
$element
$element_name
$archetype
$archetype_name
$base_stars
$natural_stars
$obtainable
$can_awaken
$awaken_bonus
$skill_ups_to_max
$leader_skill
$hp
$atk
$defense
$speed
$crit_rate
$crit_damage
$resistance
$accuracy
$raw_hp
$raw_atk
$raw_defense
$max_lvl_hp
$max_lvl_atk
$max_lvl_defense
$awakens_from
$awakens_to
$fusion_food
$homunculus
$craft_cost
$skill
$essences
$sources
$title
$transformation
$db
$owned
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

File
  application/entity/Fusion.php
Package
  Default
Class hierarchy
  \Entity
  \K_Unit
  \Monster_Fusion

## Tags

category | Entity

## Properties

### $id

    $id : integer

#### Type

integer — Unit identifier.

#

Inherited from
  \K_Unit

## Tags

None found

### $family

    $family : integer

#### Type

integer — Unit family id.

#

Inherited from
  \K_Unit

## Tags

None found

### $name

    $name : string

#### Type

string — Unit name.

#

Inherited from
  \K_Unit

## Tags

None found

### $element

    $element : integer

#### Type

integer — Unit element id.

#

Inherited from
  \K_Unit

## Tags

None found

### $element_name

    $element_name : string

#### Type

string — Element name (title case)

#

Inherited from
  \K_Unit

## Tags

None found

### $archetype

    $archetype : integer

#### Type

integer — Unit archetype id.

#

Inherited from
  \K_Unit

## Tags

None found

### $archetype_name

    $archetype_name : string

#### Type

string — Archetype name (title case).

#

Inherited from
  \K_Unit

## Tags

None found

### $base_stars

    $base_stars : integer

#### Type

integer — Default star level.

#

Inherited from
  \K_Unit

## Tags

None found

### $natural_stars

    $natural_stars : integer

#### Type

integer — Default star level.

#

Inherited from
  \K_Unit

## Tags

None found

### $obtainable

    $obtainable : boolean

#### Type

boolean — Indicates if the unit is obtainable.

#

Inherited from
  \K_Unit

## Tags

None found

### $can_awaken

    $can_awaken : boolean

#### Type

boolean — Indicates if the unit can be awakened.

#

Inherited from
  \K_Unit

## Tags

None found

### $awaken_bonus

    $awaken_bonus : string

#### Type

string — Bonus when awakening.

#

Inherited from
  \K_Unit

## Tags

None found

### $skill_ups_to_max

    $skill_ups_to_max : integer

#### Type

integer — Required skill-ups.

#

Inherited from
  \K_Unit

## Tags

None found

### $leader_skill

    $leader_skill : \K_Leader_Skill

#### Type

\K_Leader_Skill — Unit's leader skill.

#

Inherited from
  \K_Unit

## Tags

None found

### $hp

    $hp : integer

#### Type

integer — Base HP.

#

Inherited from
  \K_Unit

## Tags

None found

### $atk

    $atk : integer

#### Type

integer — Base attack.

#

Inherited from
  \K_Unit

## Tags

None found

### $defense

    $defense : integer

#### Type

integer — Base defense.

#

Inherited from
  \K_Unit

## Tags

None found

### $speed

    $speed : integer

#### Type

integer — Speed.

#

Inherited from
  \K_Unit

## Tags

None found

### $crit_rate

    $crit_rate : integer

#### Type

integer — Critical rate.

#

Inherited from
  \K_Unit

## Tags

None found

### $crit_damage

    $crit_damage : integer

#### Type

integer — Critical damage.

#

Inherited from
  \K_Unit

## Tags

None found

### $resistance

    $resistance : integer

#### Type

integer — Resistance

#

Inherited from
  \K_Unit

## Tags

None found

### $accuracy

    $accuracy : integer

#### Type

integer — Accuracy.

#

Inherited from
  \K_Unit

## Tags

None found

### $raw_hp

    $raw_hp : integer

#### Type

integer — Raw HP.

#

Inherited from
  \K_Unit

## Tags

None found

### $raw_atk

    $raw_atk : integer

#### Type

integer — Raw attack.

#

Inherited from
  \K_Unit

## Tags

None found

### $raw_defense

    $raw_defense : integer

#### Type

integer — Raw Defense.

#

Inherited from
  \K_Unit

## Tags

None found

### $max_lvl_hp

    $max_lvl_hp : integer

#### Type

integer — HP at max_level.

#

Inherited from
  \K_Unit

## Tags

None found

### $max_lvl_atk

    $max_lvl_atk : integer

#### Type

integer — Attack at max_level.

#

Inherited from
  \K_Unit

## Tags

None found

### $max_lvl_defense

    $max_lvl_defense : integer

#### Type

integer — Defense at max_level.

#

Inherited from
  \K_Unit

## Tags

None found

### $awakens_from

    $awakens_from : \K_Unit

#### Type

\K_Unit — Unit it awakens from.

#

Inherited from
  \K_Unit

## Tags

None found

### $awakens_to

    $awakens_to : \K_Unit

#### Type

\K_Unit — Unit it awakens to.

#

Inherited from
  \K_Unit

## Tags

None found

### $fusion_food

    $fusion_food : boolean

#### Type

boolean — Indicates if the unit is a fusion ingredient.

#

Inherited from
  \K_Unit

## Tags

None found

### $homunculus

    $homunculus : boolean

#### Type

boolean — Indicates if the unit is homunculus.

#

Inherited from
  \K_Unit

## Tags

None found

### $craft_cost

    $craft_cost : integer

#### Type

integer — The crafting cost (homunculus only).

#

Inherited from
  \K_Unit

## Tags

None found

### $skill

    $skill : array<mixed,\K_Unit_Skill>

#### Type

array<mixed,\K_Unit_Skill> — Unit skills.

#

Inherited from
  \K_Unit

## Tags

None found

### $essences

    $essences : array<mixed,mixed>

#### Type

array<mixed,mixed> — Required essences to awaken the unit. Formed by arrays of: [ "element" => "", "grade" => "", "amount" => ]

#

Inherited from
  \K_Unit

## Tags

None found

### $sources

    $sources : integer

#### Type

integer — \K_Source[] Sources the unit can be get from.

#

Inherited from
  \K_Unit

## Tags

None found

### $title

    $title : string

#### Type

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

#

Inherited from
  \K_Unit

## Tags

None found

### $transformation

    $transformation : \K_Unit_Transformation

#### Type

\K_Unit_Transformation — The transformation the unit can undergo.

#

Inherited from
  \K_Unit

## Tags

None found

### $db

    $db : resource

#### Type

resource — Database connection.

#

Inherited from
  \Entity

## Tags

None found

### $owned

    $owned : array<mixed,\Unit>

#### Type

array<mixed,\Unit> — All owned units of this type.

#

## Tags

None found

## Methods

### __construct()

    __construct(resource  $db, integer  $id, integer  $uid)

Constructor.

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

#### Parameters

resource | $db | Connection to the database.
integer | $id | Unit id.
integer | $uid | Player id.

#

## Tags

None found

### load_essences()

    load_essences()

Loads the information about the essences to awake the unit.

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

#

Inherited from
  \K_Unit

## Tags

None found

### load_transformation()

    load_transformation()

Loads the unit transformation.

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

#

Inherited from
  \K_Unit

## Tags

None found

### load_skills()

    load_skills()

Loads the information about the unit skills.

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

#

Inherited from
  \K_Unit

## Tags

None found

### load_sources()

    load_sources()

Loads the information about the unit sources.

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

#

Inherited from
  \K_Unit

## Tags

None found

### get_image()

    get_image() : string

Gets the path to the unit image. The image must be in the img/unit/ directory, and it's name must be the unit id, padded with '0' to 8 digits, and the extension must be '.png'.

#### Returns

string —

Image URL, or a fixed unknown image.

#

Inherited from
  \K_Unit

## Tags

None found

### Fusion.php