Difference between revisions of "Template:Data mathFormula"

From Wildermyth Wiki
(Created page with "<includeonly>{{#switch:{{{1}}} | Bash = (((1d4+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_tree_upgrade)))+self.theme_tree_upgrade)+target.distanceTo.tar...")
 
(updated cone of fire and thorn lash damage formulas; added crystal chrysalis)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#switch:{{{1}}}
<includeonly>{{#switch:{{{1}}}
| Bash = (((1d4+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_tree_upgrade)))+self.theme_tree_upgrade)+target.distanceTo.targetTile<!-- assets/data/effects/attack/treeArmBash.json -->
| Bash = Damage: (((1d4+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_tree_upgrade)))+self.theme_tree_upgrade)+target.distanceTo.targetTile<!-- assets/data/effects/attack/treeArmBash.json -->
| Bear Hug = ((1d3+2)+attacker.PHYSICAL_DAMAGE_BONUS)+attacker.POTENCY<!-- assets/data/effects/bear/bearHug.json -->
| Bear Hug = Damage: ((1d3+2)+attacker.PHYSICAL_DAMAGE_BONUS)+attacker.POTENCY<!-- assets/data/effects/bear/bearHug.json -->
| Bite = 1d6+floor(((attacker.PHYSICAL_DAMAGE_BONUS+attacker.POTENCY)/2))<!-- assets/data/effects/attack/wolfBiteMelee.json -->
| Bite = Damage: ((2+1d3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_wolf_upgradeBite)))+self.theme_wolf_upgradeBite<!-- assets/data/effects/attack/wolfBiteMelee.json -->
| Bitter Scratch = max(1,(floor(((attacker.PHYSICAL_DAMAGE_BONUS+attacker.POTENCY)/2))-1))<!-- assets/data/effects/attack/skeletalShred.json -->
| Bitter Scratch = Damage: max(1,(floor(((attacker.PHYSICAL_DAMAGE_BONUS+attacker.POTENCY)/2))-1))<!-- assets/data/effects/attack/skeletalShred.json -->
| Chain Lightning = (3+ceil(((((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_storm_upgrade))/1)))+self.theme_storm_upgrade<!-- assets/data/effects/storm/chainLightningUpgrade.json -->
| Chain Lightning = Damage: (3+ceil(((((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_storm_upgrade))/1)))+self.theme_storm_upgrade<!-- assets/data/effects/storm/chainLightningUpgrade.json -->
| Cone of Fire = (1d3+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_fire_upgrade)))+self.theme_fire_upgrade<!-- assets/data/effects/monster/fireArmFlameCone.json -->
| Cone of Fire = Damage: (1d3+((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5))+(self.theme_fire_upgrade*2)<!-- assets/data/effects/monster/fireArmFlameCone.json -->
| Crow Scratch = ((1d3+2)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_crow_upgrade)))+self.theme_crow_upgrade<!-- assets/data/effects/attack/crowArmClaw.json -->
| Crow Scratch = Damage: ((1d3+2)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_crow_upgrade)))+self.theme_crow_upgrade<!-- assets/data/effects/attack/crowArmClaw.json -->
| Crush = (((1d3+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_foothill_upgrade)))+self.theme_foothill_upgrade)+target.distanceTo.targetTile<!-- assets/data/effects/attack/foothillArmBash.json -->
| Crush = Damage: (((1d3+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_foothill_upgrade)))+self.theme_foothill_upgrade)+target.distanceTo.targetTile<!-- assets/data/effects/attack/foothillArmBash.json -->
| Crystal Sword = ((1d4+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_gem_upgrade)))+self.theme_gem_upgrade<!-- assets/data/effects/attack/gemArmSword.json -->
| Crystal Chrysalis = Damage: (1d4+1)+((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)<!-- assets/data/effects/crystalChrysalisExplosion.json -->
| Dread Harvest = ((1d3+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_shadow_upgrade)))+self.theme_shadow_upgrade<!-- assets/data/effects/shadow/shadowArmSoulHarvest.json -->
| Crystal Sword = Damage: ((1d4+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_gem_upgrade)))+self.theme_gem_upgrade<!-- assets/data/effects/attack/gemArmSword.json -->
| Falling Stars = (1d4+attacker.PHYSICAL_DAMAGE_BONUS)+attacker.POTENCY<!-- assets/data/effects/star/fallingStars.json -->
| Dread Harvest = Damage: ((1d3+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_shadow_upgrade)))+self.theme_shadow_upgrade<!-- assets/data/effects/shadow/shadowArmSoulHarvest.json -->
| Falling Stars = Damage: (1d4+attacker.PHYSICAL_DAMAGE_BONUS)+attacker.POTENCY<!-- assets/data/effects/star/fallingStars.json -->
| Fire Chicken = 2<!-- assets/data/effects/pets/fireChicken_lightFire.json -->
| Fire Chicken = 2<!-- assets/data/effects/pets/fireChicken_lightFire.json -->
| Flame Strike = ((2+1d4)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_fire_upgrade)))+self.theme_fire_upgrade<!-- assets/data/effects/attack/flameArmMelee.json -->
| Flame Strike = Damage: ((2+1d4)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_fire_upgrade)))+self.theme_fire_upgrade<!-- assets/data/effects/attack/flameArmMelee.json -->
| Frenzy = (1d3+floor((((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)/4)*(1+self.theme_wolf_upgrade))))+self.theme_wolf_upgrade<!-- assets/data/effects/attack/wolfArmClawFrenzy.json -->
| Frenzy = Damage: (1d3+floor((((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)/4)*(1+self.theme_wolf_upgrade))))+self.theme_wolf_upgrade<!-- assets/data/effects/attack/wolfArmClawFrenzy.json -->
| Gouge = attacker.PHYSICAL_DAMAGE_BONUS+1d5<!-- assets/data/effects/attack/hookMelee.json -->
| Gouge = attacker.PHYSICAL_DAMAGE_BONUS+1d5<!-- assets/data/effects/attack/hookMelee.json -->
| Hammer = (((1d4+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_morthagi_upgrade)))+self.theme_morthagi_upgrade)+target.distanceTo.targetTile<!-- assets/data/effects/attack/morthagiArmHammer.json -->
| Hammer = Damage: (((1d4+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_morthagi_upgrade)))+self.theme_morthagi_upgrade)+target.distanceTo.targetTile<!-- assets/data/effects/attack/morthagiArmHammer.json -->
| Harvest = ((1d3+1)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_shadow_upgrade)))+self.theme_shadow_upgrade<!-- assets/data/effects/shadow/shadowArmHarvest.json -->
| Harvest = Damage: ((1d3+1)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_shadow_upgrade)))+self.theme_shadow_upgrade<!-- assets/data/effects/shadow/shadowArmHarvest.json -->
| Heavy Bash = (((1d4+5)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_tree_upgrade)))+self.theme_tree_upgrade)+target.distanceTo.targetTile<!-- assets/data/effects/attack/treeArmBashBoth.json -->
| Heavy Bash = Damage: (((1d4+5)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_tree_upgrade)))+self.theme_tree_upgrade)+target.distanceTo.targetTile<!-- assets/data/effects/attack/treeArmBashBoth.json -->
| Jumpjolt = (3+ceil(((((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_storm_upgrade))/1)))+self.theme_storm_upgrade<!-- assets/data/effects/storm/chainLightning.json -->
| Invigoration = Health: 2+floor(((attacker.PHYSICAL_DAMAGE_BONUS+attacker.POTENCY)/2))<!-- assets/data/effects/green/greenArm_invigoration.json -->
| Peck = 1d6+floor(((attacker.PHYSICAL_DAMAGE_BONUS+attacker.POTENCY)/2))<!-- assets/data/effects/attack/crowPeckMelee.json -->
| Jumpjolt = Damage: (3+ceil(((((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_storm_upgrade))/1)))+self.theme_storm_upgrade<!-- assets/data/effects/storm/chainLightning.json -->
| Scratch and Claw = ((1d3+4)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_crow_upgrade)))+self.theme_crow_upgrade<!-- assets/data/effects/attack/crowArmFrenzy.json -->
| Peck = Damage: (1+1d3)+floor(((attacker.PHYSICAL_DAMAGE_BONUS+attacker.POTENCY)/2))<!-- assets/data/effects/attack/crowPeckMelee.json -->
| Sting = (1+1d2)+floor(((attacker.PHYSICAL_DAMAGE_BONUS+attacker.POTENCY)/2))<!-- assets/data/effects/attack/scorpionTailStab.json -->
| Scratch and Claw = Damage: ((1d3+4)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_crow_upgrade)))+self.theme_crow_upgrade<!-- assets/data/effects/attack/crowArmFrenzy.json -->
| Stone Claw = (1d5+attacker.PHYSICAL_DAMAGE_BONUS)+attacker.POTENCY<!-- assets/data/effects/attack/stoneClaw.json -->
| Shooting Star = Damage: ((1d5+((0.5*(self.PHYSICAL_DAMAGE_BONUS+self.POTENCY))*(1+self.theme_star_upgrade)))+self.theme_star_upgrade)-self.throughShotTargetNum<!-- assets/data/effects/attack/shootingStar.json -->
| Strike = (4+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_skeleton_upgrade)))+self.theme_skeleton_upgrade<!-- assets/data/effects/attack/skeletonKingDaggerAttack.json -->
| Skunk Spray = Poison: (1+floor((attacker.POTENCY/3)))+(self.theme_skunk_upgrade*2)<!-- assets/data/effects/attack/skunkTailSpray.json -->
| Swipes = ((1d3+3)+((0.5*(self.PHYSICAL_DAMAGE_BONUS+self.POTENCY))*(1+self.theme_bear_upgrade)))+self.theme_bear_upgrade<!-- assets/data/effects/bear/bearArmSwipe.json -->
| Splinterskin = 1<!-- assets/data/effects/attack/treeThemeSplinterskin.json -->
| Thorn Lash = (1d3+attacker.PHYSICAL_DAMAGE_BONUS)+attacker.POTENCY<!-- assets/data/effects/vine/vineArmThornLash.json -->
| Static Shock = 2<!-- assets/data/effects/storm/staticShock_returnsDamage.json -->
| Witherbolt = ceil((1+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)/4)*(1+self.theme_green_upgrade))))+self.theme_green_upgrade<!-- assets/data/effects/green/greenArm_witherbolt.json -->
| Sting = Damage: ((1+1d2)+floor(((attacker.PHYSICAL_DAMAGE_BONUS+attacker.POTENCY)/2)))+self.theme_scorpion_upgrade<!-- assets/data/effects/attack/scorpionTailStab.json -->
| Wolf Claw = ((1d4+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_wolf_upgrade)))+self.theme_wolf_upgrade<!-- assets/data/effects/attack/wolfArmClaw.json -->
| Stone Claw = Damage: (1d5+attacker.PHYSICAL_DAMAGE_BONUS)+attacker.POTENCY<!-- assets/data/effects/attack/stoneClaw.json -->
| Strike = Damage: (4+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_skeleton_upgrade)))+self.theme_skeleton_upgrade<!-- assets/data/effects/attack/skeletonKingDaggerAttack.json -->
| Swipes = Damage: ((1d3+3)+((0.5*(self.PHYSICAL_DAMAGE_BONUS+self.POTENCY))*(1+self.theme_bear_upgrade)))+self.theme_bear_upgrade<!-- assets/data/effects/bear/bearArmSwipe.json -->
| Thorn Lash = Damage: (1d3+((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5))+(self.theme_vine_upgrade*2)<!-- assets/data/effects/vine/vineArmThornLash.json -->
| Thunder Stomp = Range: ((0.6+(self.POTENCY/3))+self.themePiece_storm_rightLeg)+self.themePiece_storm_leftLeg<!-- assets/data/effects/storm/thunderStompAttack.json -->
| Witherbolt = Initial Damage: ceil((1+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)/4)*(1+self.theme_green_upgrade))))+self.theme_green_upgrade<!-- assets/data/effects/green/greenArm_witherbolt.json -->
| Wolf Claw = Damage: ((1d4+3)+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_wolf_upgrade)))+self.theme_wolf_upgrade<!-- assets/data/effects/attack/wolfArmClaw.json -->
| Wrist Bolt = Damage: ((1d5+(((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)*(1+self.theme_morthagi_upgrade)))+self.theme_morthagi_upgrade)-self.throughShotTargetNum<!-- assets/data/effects/attack/wristBolt.json -->
}}</includeonly><noinclude>
}}</includeonly><noinclude>
{{Data mathFormula/doc}}
{{Data mathFormula/doc}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
</noinclude>

Latest revision as of 12:02, 4 December 2022

This documentation is transcluded from Template:Data mathFormula/doc

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}}
}}