Difference between revisions of "MV Formula Library"

From HimeWorks
Jump to: navigation, search
(Reference)
Line 6: Line 6:
  
 
*[[/Conditional Formulas|Conditional Formulas]] - formulas you can use when you want to check if a certain condition is met
 
*[[/Conditional Formulas|Conditional Formulas]] - formulas you can use when you want to check if a certain condition is met
*[[/Action Formulas|Action Formulas]]
+
*[[/Damage Formulas|Damage Formulas]]
  
 
==Damage Formulas==
 
==Damage Formulas==

Revision as of 09:58, 1 March 2016

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.

Reference

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