Mechanics

From The Alchemist Code
Jump to: navigation, search

The gameplay of The Alchemist Code follows certain conventions and mechanics.

Units[edit | edit source]

These are the characters that make up a battle. Player units 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 unit 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, voice and backstory.
  • Gender: Some effects only work on certain genders.
  • Origin: The unit's nationality. Some effects only work on units with specific nationalities.
  • Element: Determines base weaknesses and resistances to other elements.
  • Core Attributes: These are unique to the unit, used as the basis for all attribute formulas.
  • Leader Skill: A passive skill that can have an effect on various units in a battle, provided the unit is the party's "leader". For player units, a player may have up to two leader skills: one from the unit in the first slot (the party leader) and one from a hired mercenary (friend unit). Duplicate leader skills can stack. Not every unit has a leader skill.
  • Jobs: The jobs available to the unit. A unit also has a "current job", which the job that is currently in use, or deployed in a battle. Jobs available can not be changed for player characters.
  • Master Ability: 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 unit's maximum level, maximum job level and maximum limit break. Some leader skills change at different rarities. This is increased through evolution. Player units always start at a defined base rarity and have a max rarity.
  • Level: The level the unit is, which increases base stats and is needed to use more powerful equipment. Increased by gaining experience points after battles or through using apples.
  • Limit Break: The number of LB points the unit has, typically increased by using unit shards. Every point increases the unit's max level and combo stat by 1. Every 5 points unlocks new jobs (at 5 and 15) and additional gear slots (at 10 and 25).
  • Gear: The gear the unit is currently using, which can increase attributes, add effects to attacks and provide skills (as well as cosmetics for the equipped weapon).

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 (Jewels): The mana pool that a unit draws from when using a skill.
  • CT (Charge Time): How close the unit is till it gets its turn.
  • Skill Use Counts: Most skills have a limited number of uses per battle.
  • 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 active skill effects or passive ones (including leader skills).
  • 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 zenni.

Attributes[edit | edit source]

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[edit | edit source]

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

  • HP/HPmax (Health Points): The unit will die when this reaches 0. All units start with their HP full.
  • MP/MPmax (Jewels): The mana pool that a unit draws from when using a skill. For calculations, MP refers to the portion of MPmax that a unit starts a battle with.
  • PATK (Physical Attack): Used in most damage formulas. Note: some damage formulas do not use PATK, making the stat useless.
  • PDEF (Physical Defense): Determines damage reduction when receiving physical attacks.
  • MATK (Magic Attack): Used in some damage formulas. Also used to determine healing from skills. Note: some damage formulas do not use MATK, making the stat useless.
  • MDEF (Magic Defense): Determines damage reduction when receiving magical attacks.
  • DEX (Dexterity): Influences attack accuracy (hit rate).
  • AGI (Agility): Determines how quickly and how often a unit can take an action.
  • CRIT (Critical): Determines how often a unit will land a critical hit when attacking.
  • LUCK: Reduces the chance of receiving a critical hit when taking damage.
  • COMBO: Determines the chance of activating a combo attack (blue aura).
  • MOVE: The number of tiles a unit can move.
  • JUMP: How high a unit can jump when moving between tiles.

Elemental Assistance & Resistance[edit | edit source]

Every unit has a single 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[edit | edit source]

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).

  • DeathSentence: After a certain number of turns, the unit will die.
    • A DeathSentence effect can define a DeathTurnCount, which determines the number of turns the units has to live.
    • At the beginning of the units turn, the turn count will reduce by one. If it reaches 0, the unit dies.
    • Timer does not count down while the unit is in the air from a jump attack or if the unit is afflicted with stone.
    • Does not end unless cured or the unit dies.
    • Default DeathTurnCount: 3 turns
  • Poison: At the end of the unit'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 unit'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)
  • GoodSleep: At the beginning of a unit's turn, if the unit is asleep, it will restore HP and Jewels.
    • Heals for 10% of HPmax and restores 5% of MPmax.
    • No default length is defined.
  • AutoJewel: At the beginning of a unit's turn, it will generate Jewels.
    • An autojewel effect can define an AutoJewelRate (% of the unit's MPmax) and an AutoJewelFixed (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 unit 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 units 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%
  • Confuse: Forces a unit 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, Combos, Skills, Items
  • Rage: Forces a unit to attack on auto, only attacking its rage target.
    • Generally, the rage target will be the unit the inflicted the effect.
    • Will end if the rage target dies.
    • Default Length: 3 turns
    • Disables: Player control, Combos, Skills, Items
  • Charm: Forces a unit to attack its allies on its turn.
    • Will end if the unit takes damage.
    • Default Length: 3 turns
    • Disables: Player control, Combos, Skills, Items
  • Zombie: Forces a unit to attack its allies on its turn.
    • Does not end unless cured.
    • Disables: Player control, Combos, Skills, Items
  • Petrify: Skips the units turn.
    • The unit is considered dead (but can still be cured, treating it again as alive). In Mystic Tower Veda, any units petrified at the end of the floor will die.
    • Does not end unless cured.
    • Disables: Player control, Turn from being taken, Combos, Reactions, Dodges
  • Sleep: Skips the units turn.
    • GoodSleep can cause the unit to heal or restore jewels.
    • Will end if the unit takes damage.
    • Default Length: 3 turns
    • Disables: Player control, Turn from being taken, Combos, Reactions, Dodges
  • Stun: Disables the unit from most actions.
    • Outside of Roxanne, stuns usually end by the beginning of the units turn, meaning it prevents dodging, reacting, charge skills, etc.
    • Default Length: 1 turn
    • Disables: Player control, Turn from being taken, Combos, Reactions, Dodges, Charge Skills
  • Paralyzed: At the beginning of a unit'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
  • Slow: Reduces the number of tiles a unit can move.
    • A slow effect can define a SlowValue, which determines how many tiles a unit can move.
    • For multiple effects, only the lowest SlowValue is used.
    • Since this effect replaces a unit's MOV stat entirely, in theory, it could actually increase the unit's MOV, providing the SlowValue was higher then the unit's MOV.
    • Default Length: 3 turns
    • Default SlowValue: 1 tile
  • Bind: Prevents a unit from moving.
    • Default Length: 3 turns
    • Disables: Movement
  • Daze: Prevents a unit from attacking.
    • Default Length: 3 turns
    • Disables: Attacks
  • Silence: Prevents a unit from using skills.
    • Default Length: 3 turns
    • Disables: Skills, Reactions
  • DisableKnockback: Prevents a unit from getting knocked back from a knockback skill.
    • The assist/resist values for this effect are AssistKnockback and ResistKnockback. Unlike most status effects, they do not influence the application of the DisableKnockback effect.
    • Instead, these are used to increase and decrease the chance of a knockback of occurring. If the target has the DisableKnockback effect, they will be ignored.
    • Does not end unless removed.
  • DisableBuff: Prevents a unit from receiving any buffs.
    • The assist/resist values for this effect are AssistBuff and ResistBuff. Unlike most status effects, they do not influence the application of the DisableBuff effect.
    • Instead, these are used to increase and decrease the chance of a buff from being applied. If the target has the DisableBuff effect, they will be ignored.
    • AssistBuff does not seem to be included in the code.
    • Default Length: 3 turns
  • DisableDebuff: Prevents a unit from receiving any debuffs.
    • The assist/resist values for this effect are AssistDebuff and ResistDebuff. Unlike most status effects, they do not influence the application of the DisableDebuff effect.
    • Instead, these are used to increase and decrease the chance of a debuff from being applied. If the target has the DisableDebuff effect, they will be ignored.
    • AssistDebuff does not seem to be included in the code.
    • Default Length: 3 turns
  • Stop: Stops CT from increasing, preventing the unit from taking its turn.
    • Default Length: 35 Game Clock Cycles
    • Disables: Turn from being taken, Combos, Reactions, Dodges
  • Quicken: Increases CT change rate by a percentage.
    • Removed if delay is inflicted on the unit.
    • Default Length: 35 Game Clock Cycles
  • Delay: Decreases CT charge rate by a percentage.
    • Removed if quicken is inflicted on the unit.
    • Default Length: 35 Game Clock Cycles

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.

Bonus Parameters[edit | edit source]

Miscellaneous attributes fall into this category.

  • EffectRange: Increases range of attacks and skills. (Note: Does not seem to increase range on melee attacks/skills; Needs confirmation)
  • EffectScope: Alters the area of effect the attack/skill hits, as in "5x5 diamond" or "3 (lateral line)"
  • EffectHeight: Increases the height range the attack/skill hits.
  • HitRate: Increases chance to hit.
  • AvoidRate: Increase chance to avoid being hit.
  • CriticalRate: Increase chance of landing a critical attack.
  • GainJewel: Increases the number of jewels gained when making a normal attack by a flat amount.
  • UsedJewelRate: Reduces the jewel cost of skills.
  • ActionCount: Unknown
  • GutsRate: Percentage chance of surviving a killing blow (surviving with 1 hp).
  • AutoJewel: Generates a fixed number of jewels each turn (not to be confused with the AutoJewel status effect).
  • ChargeTimeRate: Reduces CT needed to take a turn.
  • CastTimeRate: Reduces the cast time needed to on relevant skills.
  • BuffTurn: Increases the number of turns that buffs cast by this unit will last.
  • DebuffTurn: Increase the number of turns that debuffs cast by this unit will last.
  • CombinationRange: Increases the number of tiles away that a unit can be to be considered for a combo attack.
  • HpCostRate: Reduces the hp cost for skills that cost hp.
  • SkillUseCount: Increase the number of uses on each skill.
  • PoisonDamage: Increases the damage that poison inflicted by this unit will do by a percentage. PoisonFixed is scaled by this value while PoisonRate is added to.
  • PoisonTurn: Increases the number of turns that poison inflicted by this unit will last.

Attack Types[edit | edit source]

Every attack (skill or normal attack) fits one of the following types:

  • Attack Type Slash.png Slash
  • Attack Type Pierce.png Pierce
  • Attack Type Strike.png Strike
  • Attack Type Missile.png Missile
  • Attack Type Magic.png Magic
  • Attack Type Jump.png Jump
  • Other
  • Reaction: Reactions skills also can be one of the other 7 types.

With the exception of "Other" attacks (such as a Bard's attack), a unit has 3 bonus parameters for each attack type:

  • Attack: Increase the damage of that attack type by a percentage. (ex: SlashAttack)
  • Resist: Reduces the damage of that attack type by a percentage. (ex: MissileResist)
  • Avoid: Gives a chance to evade that attack type by a percentage. (ex: MagicAvoid)

Other-type attacks do not use these parameters.

Formula[edit | edit source]

For every attribute, the score is determined by the following formula:

FinalValue = (FinalBase + BuffAdds) * BuffScale
FinalBase  = (BaseScore + BaseAdds) * BaseScales
BaseScore  = levelScale(UnitBase, UnitLevel) * JobScale

BaseScore[edit | edit source]

For stats (except MOV and JUMP), every unit has a base score, which is scaled according to the unit's level. That number is then multiplied by a value determined by the current job of that unit to give the BaseScore of that unit.

The base value for MOV and JUMP usually are solely determined by the job. Some units may also increase/decrease these values by a flat amount, regardless of job.

Nearly every other attribute has a base value of 0, though some units and jobs can specify other values.

BaseAdds[edit | edit source]

These include flat increases or decreases that add to the BaseScore, including equipment, gear and skins. Nearly every value from equipment, gear and skins will take be a BaseAdd.

Specific to gear: For any given attribute, the add value will be equal to the highest value for that attribute among all equipped gear. This means having two gear that supply PATK will only give the benefit of the highest value (they do not stack).

BaseScales[edit | edit source]

After adding the BaseScore with all BaseAdds, this value is then multiplied by the sum of all the BaseScales. There is no known BaseScales so this is in effect adding 0%.

In theory, the maximum value restriction on gear does not apply to gear with attribute scales.

BuffAdds[edit | edit source]

These include flat increases or decreases that add to the FinalBase from skills and effects. Both passive (including leader skills) and active effects are included. Some attributes act as a percentage so most increases to these will take the form of an add (such as elemental resistance).

BuffScales[edit | edit source]

After adding the FinalBase with all BuffAdds, this value is then multiplied by the sum of all the BuffScales.

Example: The leader skill Pure Water's Trance increases PATK of water units by 30%. A water unit that has this effect as well as a Bard's Song of the Warrior Lv. 1 (Increases PATK by 10%) will have a total BuffScale to PATK of 40%.

Timing[edit | edit source]

Charge Time (CT)[edit | edit source]

In battle, every unit maintained a Charge Time (CT) value which is used to determine when the unit will get their turn. At 100 CT, a unit will get their turn and will be able to move. CT can go over 100, and the unit with the highest CT will get to move first.

Actions[edit | edit source]

On a units turn, 60 CT is automatically deducted. If the unit moves, 20 more CT is deducted. If that unit takes an action (attacking, casting, etc), an additional 20 CT is also deducted.

By not moving and/or not taking an action, a unit can make its next turn come quicker.

Effect Timing[edit | edit source]

Every buff, debuff and status effect has a timing which determines how long it lasts. With the exception of Eternal, every effect will have a turn count, which will cause the effect to expire once it reached 0. The timings determine how the counter is decremented:

  • Eternal: The effect lasts all battle (Passive effects are almost always Eternal).
  • ActionStart: Counter decrements at the beginning of a unit's turn.
  • SkillEnd: Counter decrements after using any skill (including regular attacks).
  • AttackEnd: Counter decrements after doing any attack (any skill that can apply damage).
  • DamageEnd: Counter decrements after taking damage.
  • GutsEnd: Counter decrements after taking fatal damage.
  • Moment (Movement): Counter decrements after the unit moves (or is moved).
  • ClockCountUp: Counter decrements after each game clock advancement (see below).

Game Clock[edit | edit source]

When the battle first begins, as well as after any unit ends their turn, the game checks the highest CT of every unit in the battle. If that value is at least 100, that unit will then take its turn. If no unit can take its turn, the game clock is advanced by 1.

Advancing the game clock has these effects:

  • Every unit increases its CT by its AGI/10. (This number is rounded to the lowest 0.1, AKA you can have 46.5 CT)
    • If a unit has the Stop status effect, its CT does not increase.
    • If a unit has the Quicken status effect, the CT increase is scaled up by 50% times the Quicken status effect value.
    • If a unit has the Delay status effect, the CT increase is scaled down by 50% times the Delay status effect value.
  • All buffs, debuffs and status effects with an effect timing of "ClockCountUp", reduce their turn count by 1, expiring if necessary.
  • Some units do not spawn at the beginning of the battle. Instead, they can be set to spawn after X game clock advances.

Casting[edit | edit source]

When a skill with cast time is casted, a "spell unit" is created, when the "spell unit's" CT reaches 100, the spell is cast. The AGI of the spell unit is equal to the spell's cast speed, indicated beside the use count in game. Note that cast speed is NOT related to the caster's AGI, but status effects (Stop, Quicken, Delay) can influence the cast speed. The CastTimeRate bonus param will reduce the total CT needed for the spell unit. For example, a CastTimeRate of -40 will reduce the CT needed for the spell down to 60.

Atk vs Dmg Types[edit | edit source]

Atk types: Slash, Strike, Pierce, Missile, Special, Magic/Spell, Jump
Damage Types : Physical, Magical

Amount of Starting Jewels[edit | edit source]

Starting jewels are based on these factors:

  • Job: All units start with a percentage of their maximum jewels (this can be anywhere between 0 and 100%)
  • Units: Unit levels increases max jewels. Each unit has different growth and different stats which affects their max jewels
  • Job Level: Some equipment items give max jewels
  • Gear: Some gear gives max jewels or initial jewels

Damage Formula[edit | edit source]

Here is some psuedo-code detailing how damage is calculated. Credits to Xores for decoding this:

FinalDamage:
	if JewelAttack: sqrt(SkillPower)*2
	else:           SkillPower*(100% - defender.resistDmgType)

SkillPower:
	skillDamage*(100% + atkMod) - defStat*(100% + defMod)
	0, If result < 0
	
	skillDamage:
		if scaling: skillEffect*attackBase
		if adding:  skillEffect+attackBase
		if fixed:   skillEffect
	skillEffect:
		skillEffectValue + Random(0, skillEffectRange)
		                 + EffectHpMaxRate*hp/maxHp
		                 + EffectMpMaxRate*mp/maxMp
		                 + EffectDeadRate*numOfDeadUnits
		                 + EffectGiantRate*max(defender.lvl - attacker.lvl, 0)
	attackBase: Uses skill formula depending on job or skill
		Generally skillAttack * attackerStat / 10
	
	defStat: PDEF or MDEF, if skill is Physical or Magical
	atkMod: attacker.bonusDmgType // Bonus to Pierce attacks, for example
	      + unitElementBonus  // attacker.assist[attacker.element] - defender.resist[attacker.element]
	      + skillElementBonus // skillElementValue - defender.resist[skill.element]
	      + killerBonus       // Bonus to machines, for example
	      + heightBonus
	      + comboBonus        // 50% per additional unit
	defMod: skill.ignoreDefenseRate
	      + skillPositionDefenseRate // For skills like sneak attack when attacking from side or back
	      + heightBonus
	heightBonus:
		if skill.usesHeightBonus: +5%/-5% or -5%/+5% for atkMod/defMod depending on relative height of attacker and defender
		else: 0

If the skill is a suicide skill:
	Scale skillEffectValue by attacker.hp/attacker.maxHp
	then add standard skillEffect random and bonuses
	Calculate skillDamage
	Add attacker.hp/2 to skillDamage

Special Attack References[edit | edit source]

Other Mechanics Guides[edit | edit source]