Mechanics

## Guardians

These are the characters that make up a battle. Player guardians and enemy units all operate under the same mechanics, the only difference being that enemy units are automatically AI controlled (though running a battle on auto will make your own units AI controlled as well). However, AI scripts can differ from unit to unit.

A guardian will have the following the defines it: (Keep in mind these definitions apply to enemies found on the field, as well)

* **Character**: The character's model, images,and backstory.
* **Gender**: Some effects only work on certain genders.
* **Origin**: The guardian's nationality. Some effects only work on guardians with specific nationalities.
* **Element**: Determines base weaknesses and resistances to other elements.
* **Master Ability/Passive**: Some units have a unique master ability. Most require a quest to unlock them.

These also define a unit but for can be improved on a player unit:

* **Rarity**: Determines the guardian's maximum level. This is increased through Guardian★+. Player guardians always start at a defined base rarity and have a max rarity.
* **Level**: The level the guardian is, which increases base stats and is needed to use more powerful abilities. Increased by gaining experience points after battles or through using apples.
* **Limit Break**: Typically increased by using guardian shards. Every point unlocks a special part to a guardian. Every Limit Break points unlocks new equipment slot (at 1st and 2nd) and unlocks the guardian's master passive (at 3rd) and unlocks the guardian's mastery (at 4th)

In battle a unit will also have any of the following:

* **Current HP**: The current health of the unit. It will die if this reaches 0. All units start a battle with their HP at maximum.
* **Current MP**: The mana pool that a unit draws from when using a skill.
* TD **(Turn Delay)**: When using a charging skill
* **CD (Cool Down)**: After using a skill which has a cool down on it
* **Buffs/Debuffs**: Effects that can increase or decrease a unit's attributes. Any number of buffs and debuffs can be attached to a unit. These can come from abilities effects or passive ones
* **Status Effects**: Similar to buffs and debuffs, status effects can change attributes in some way. They also may cause a wide array of changes to how a unit behaves and what it can do. Any number of status effects can be attached.
* **Drops**: When killed, the player will acquire this. It can be an item and/or an amount of gold

## Attributes

Every attribute will fall under one of these categories: stats, elemental assistance/resistance, status assistance/resistance and bonus parameters. Every attribute on a unit has a base score, plus additional factors that may increase or decrease them.

### Stats

These are the scores that can be viewed in the unit information screen.

* **HP/HP max** (Health Points): The unit will die when this reaches 0. All units start with their HP full.
* **MP/MP max** (Mana Points): The mana pool that a unit draws from when using a skill. All the guardians start with their MP full.
* **ATK** (Physical Attack): Used in most damage formulas. Note: some damage formulas do not use PATK, making the stat useless.
* **DEF** (Physical Defense): Determines damage reduction when receiving physical attacks.
* **MAG** (Magic Attack): Used in some damage formulas. Also used to determine healing from skills.
* **MDEF** (Magic Defense): Determines damage reduction when receiving magical attacks.
* **AGI** (Agility): Determines how quickly and how often a unit can take an action.

### Elemental Assistance & Resistance

Every guardian has a single/double element (which can not change). Additional, the unit will have an elemental assistance score for each element (such as Fire Assist) and an elemental resistance score for each as well (such as Light Resist).

Elemental resistance will reduce the damage received from attacks by units with that element, as well as skills that use it as well (the two effects will add together). Elemental assistance in effect reduces the elemental resistance of a defender. Since assist only applies to the unit's element and a unit's element does not change, assist attributes for any other element all in effect, useless. The elemental resistance reduction from a skill is determined instead by its own assist score (not the units).

By this, each unit has each one of these scores:

* **Element** (the unit's element)
* **FireAssist** & **FireResist**
* **WaterAssist** & **WaterResist**
* **WindAssist** & **WindResist**
* **ThunderAssist** & **ThunderResist**
* **LightAssist** & **LightResist**
* **DarkAssist** & **DarkResist**

### Status Assistance & Resistance

A unit may have any of the below status effects applied to it. Each effect may have a value (such as the damage of poison), as well as a turn count (which may be infinite, such as from a Bishop's Regeneration passive).

* **Poison**: At the end of the guardian's turn, it takes damage.
	+ A poison effect can define a PoisonRate (% of the unit's HPmax) and a PoisonFixed (deal a fixed amount) and will deal the highest of the two.
	+ For multiple effects, only the highest damage is applied.
	+ Default Length: 3 turns
	+ Default PoisonRate: 10% (PoisonFixed is 0 by default)
* **AutoHeal**: At the beginning of a guardian's turn, it will restore HP.
	+ An autoheal effect can define an AutoHealRate (% of the unit's HPmax) and an AutoHealFixed (heal a fixed amount) and will heal the highest of the two.
	+ For multiple effects, only the highest healing is applied.
	+ Default Length: 3 turns
	+ Default AutoHealRate: 10% (AutoHealFixed is 0 by default)

* **AutoMP**: At the beginning of a guardian's turn, it will generate Jewels.
	+ An automp effect can define an AutoMPRate (% of the unit's MPmax) and an AutoMPFixed (generate a fixed amount) and will use the highest of the two.
	+ For multiple effects, only the highest value is applied.
	+ Default Length: 3 turns
	+ Default AutoJewelRate: 10% (AutoJewelFixed is 0 by default)
* **DisableHeal**: Prevents this guardian from restoring HP.
	+ Specifically, reduces healing skills to 0 and disables HP regeneration from AutoHeal and GoodSleep (but still restores Jewels)
	+ Default Length: 3 turns
* **Blind**: Reduces a guardians hit and avoid rates.
	+ A blind effect can define a BlindHitRate and a BlindAvoidRate which will act as BuffScales for HitRate and AvoidRate, respectively.
	+ For multiple effects, the effect which gives the highest of this formula will be what is used for the buff: `abs(BlindHitRate) + abs(BlindAvoidRate)`
	+ Default Length: 3 turns
	+ Default BlindHitRate: -15%, Default BlindAvoidRate: -15%
* **Confusion**: Forces a guardian to attack on auto, while augmenting its stats. (Essentially, Berserk)
	+ A confuse effect can define a ConfuseAtkRate and a ConfuseDefRate which will act as BuffScales for PATK, MATK, PDEF and MDEF, respectively.
	+ For multiple effects, the effect which gives the highest of this formula will be what is used for the buff: `abs(ConfuseAtkRate) + abs(ConfuseDefRate)`
	+ Default Length: 3 turns
	+ Default ConfuseAtkRate: 10%, Default ConfuseDefRate: -10%
	+ Disables: Player control, Skills, Items
* **Charm**: Forces a guardian to attack its allies on its turn.
	+ Will end if the unit takes damage.
	+ Default Length: 3 turns
	+ Disables: Player control, Skills, Items
* **Stone**: Skips the guardians turn.
	+ The unit is considered dead (but can still be cured, treating it against as alive).
	+ Does not end unless cured.
	+ Disables: Player control, Turn from being taken, Reactions, Dodges
* **Sleep**: Skips the guardians turn.
	+ Will end if the unit takes damage.
	+ Default Length: 3 turns
	+ Disables: Player control, Turn from being taken, Reactions, Dodges
* **Stun**: Disables the guardian from most actions.
	+ Stuns usually end by the beginning of the units turn, so in practice only really prevent dodging, reacting, etc.
	+ Default Length: 1 turn
	+ Disables: Player control, Turn from being taken, Reactions, Dodges
* **Paralyzed**: At the beginning of a guardian's turn, it has a chance to not be able to move or take an action (but can still change facing direction).
	+ A paralyze effect can define a ParalyzeRate, which will be the % that the unit can not act.
	+ For multiple effects, only the highest ParalyzeRate is used.
	+ Default Length: 3 turns
	+ Default ParalyzeRate: 80%
	+ Disables: Movement, Attacks, Skills, Items, Reactions
* **Daze**: Prevents a guardian from attacking.
	+ Default Length: 3 turns
	+ Disables: Attacks
* **Silence**: Prevents a guardian from using skills.
	+ Default Length: 3 turns
	+ Disables: Skills, Reactions
* **Stop**: Stops TD from increasing, preventing the guardian from taking its turn.
	+ Default Length: 35 Turns
	+ Disables: Turn from being taken, Reactions, Dodges
* **Quicken**: Increases TD change rate by a percentage and AGI.
	+ Removed if delay is inflicted on the unit.
	+ Default Length: 35 Turns
* **Delay**: Decreases TD charge rate by a percentage and AGI.
	+ Removed if quicken is inflicted on the unit.
	+ Default Length: 35 Turns

Like the elements, a unit can have assistance and resistance scores for each status effect. Assistance determines chance of inflicting that status effect on an attack while resistance reduces the chance when receiving an attack.