Difference between revisions of "Template:Data mathFormula"

From Wildermyth Wiki
(1.6+399 Edina Gramling)
(updated cone of fire and thorn lash damage formulas; added crystal chrysalis)
 
Line 5: Line 5:
| Bitter Scratch = Damage: 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 = 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 -->
| 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 = Damage: (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 = 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 -->
| 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 = 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 -->
| 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 Chrysalis = Damage: (1d4+1)+((self.PHYSICAL_DAMAGE_BONUS+self.POTENCY)*0.5)<!-- assets/data/effects/crystalChrysalisExplosion.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 -->
| 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 -->
| 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 -->
| 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 -->
Line 30: Line 31:
| 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 -->
| 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 -->
| 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)*(1+self.theme_vine_upgrade)))+self.theme_vine_upgrade<!-- assets/data/effects/vine/vineArmThornLash.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 -->
| 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 -->
| 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 -->

Latest revision as of 13: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}}
}}