Template:Data mathFormula/doc

From Wildermyth Wiki
< Template:Data mathFormula
Revision as of 12:39, 21 January 2022 by FeralKitty (talk | contribs) (Created page with "<includeonly>: ''This documentation is transcluded from Template:Data mathFormula/doc''</includeonly><!-- --><noinclude><div class="messagebox" style="padding-left:1ex;">'...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
This is a documentation subpage for Template:Data mathFormula.

This template is used by the game data process to help automatically keep pages up-to-date.

Warning: Manually editing this template data may cause your changes to be overwritten or lost if the template is automatically updated. If specific game data is missing from this template, please ask about it on the Discord #wiki channel (to arrange for its data to automatically be added to these templates).

Usage

This template returns the (math) formula for a specific theme ability. A future update will add hero abilities.

The template uses the following parameter:

1
The name associated with the specific math formula.

Examples

Theme ability math formula

{{Data mathFormula|Bash}}

Damage: (((1d4+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_tree_upgrade)))+self.theme_tree_upgrade)+target.distanceTo.targetTile

Hero ability math formula (to be added)

{{Data mathFormula|Shieldshear}}

(No math formula is returned, as this hero ability data has not been added yet to the template.)

Technical details

Math formula data comes from Wildermyth's.json files. For example, assets/data/effects/attack/morthagiArmHammer.json includes the following line:

"amount": "(((1d4+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_morthagi_upgrade)))+self.theme_morthagi_upgrade)+target.distanceTo.targetTile"

This shows the actual formula used to calculate the damage amount, based on the hero's Bonus Damage, Potency, and whether the morthagi theme has been upgraded or not.

Note: An expression like self.theme_morthagi_upgrade evaluates to 0 if that aspect does not exist (i.e., the theme is not upgraded), or (the aspect value of) 1.0 if that aspect does exist.

{{Formulas
| damage = {{Data mathFormula|Hammer}}
}}