MV Formula Library

From HimeWorks
Revision as of 19:05, 19 February 2016 by Bluebooth (Talk | contribs) (Common MV Formulas)

Jump to: navigation, search

Formulas are Javascript expressions that are evaluated at run-time. You can use them in damage formulas to determine how much damage you inflict with a skill, or you can use them in script calls to perform certain functions that aren't provided through the event interface by default.

A formula may contain special formula variables that you can use to craft your formulas.

Damage Formulas

Damage formulas by default are used in Skills and Items, and are primarily used to determine how much base damage the action will inflict.

The following formula variables are available:

  • a - user of the action
  • b - target of the action
  • v - game variables (equivalent to $gameVariables)

Common MV Formulas

Physical Attack: a.atk * 4 - b.def * 2 Every point of physical defense negates half a point of physical attack.

Magical Attack: 100 + a.mat * 2 - b.mdf * 2 Every point of magical defense negates a point of magical attack.

Percentage Factors

Another approach is to create a common damage formula, where a common attack is equal to the result of this formula. A scale of appropriate attack values can be created by multiplying this common damage formula by a percentage representing the potency of the skill. For example, a strong skill might be NORMAL ATTACK * 2.0, and a weaker skill might be NORMAL ATTACK * 0.5. This makes scaling skills easy, and avoids relying on random value additions.

Physical Attack: ((a.atk / b.def) * a.atk + a.atk - b.def) * 1.0 Magical Attack: ((a.mat / b.mdf) * a.mat + a.mat - b.mdf) * 2.0

Shared by Michael Morris from Res Judicata.

Related Topics