Template:Damage/doc: Difference between revisions

From Elwiki
Line 24: Line 24:
=== Extra ===
=== Extra ===
*The generated variables always follow this order in their names: damage type → awk if awakening (empty if not) → trait → passives → game mode (empty if dungeon), e.g. ''<nowiki>{{#var: total_damage_awk_empowered_passive1_passive2_pvp}}</nowiki>''
*The generated variables always follow this order in their names: damage type → awk if awakening (empty if not) → trait → passives → game mode (empty if dungeon), e.g. ''<nowiki>{{#var: total_damage_awk_empowered_passive1_passive2_pvp}}</nowiki>''
*When providing ''Useful'' trait and Awakening values, the values that don't change '''need to be provided''' anyway, otherwise the calculation will break.
*When providing ''Useful'' trait and Awakening values, the values that don't change in relation to the '''hits''' or '''avg_hits''' parameter can be provided as '''x''', inheriting the value.
<br/>
<br/>



Revision as of 17:17, 7 April 2022

Overview

This template is used for Total Damage section on skill pages in order to avoid hardcoding mathematical formulas and not pollute the page's code that much with long variables. It simply generates the most generic variables you need based on the arguments provided. Should you need something extra, you can always export it to an external variable.

Parameters

  • dmg, pvp_dmg - specifies damage value for the nth damage effect
  • awk_dmg, pvp_awk_dmg - in Awakening Mode
  • hits - specifies maximum hit count for the nth damage effect
  • avg_hits - specifies average hit count for the nth damage effect
  • avg_awk_hits - in Awakening Mode
  • hits_useful - specifies maximum hit count for the nth damage effect with the Useful trait
  • awk_hits_useful - in Awakening Mode
  • avg_hits_useful - specifies average hit count for the nth damage effect with the Useful trait
  • avg_awk_hits_useful - in Awakening Mode
  • useful_penalty - specifies damage decrease from the Useful trait in 0.value format, e.g. 0.75
  • awk_hits - specifies maximum hit count for the nth damage effect in Awakening Mode
  • heavy - if provided with a value, enables Heavy trait
  • enhanced - if provided with a value, enables Enhanced trait
  • empowered - if true, enables Empowered trait with the standard 1.2x damage increase. It can also take another value that replaces the standard one
  • passive[n] - enables the nth passive variables, please specify with the exact passive skill's name. If more than one provided, combined variables will also be created, i.e. passive1_passive2 (max 3).
  • format - enables pretty-printing of the numbers (applies % sign and {{formatnum:}}). Enabled by default, you can provide false to disable it. In order to tamper with single variables, I recommend using Template:Num that converts them back to numbers.
  • dump - if true, write out the generated variables. Useful when debugging, off by default. Warning: disables the variables from generating.
  • prefix - if specified, appends the string to every output variable. Useful when dealing with skills like Heaven's Fist - Pressure or Ex-S Viper.

Extra

  • The generated variables always follow this order in their names: damage type → awk if awakening (empty if not) → trait → passives → game mode (empty if dungeon), e.g. {{#var: total_damage_awk_empowered_passive1_passive2_pvp}}
  • When providing Useful trait and Awakening values, the values that don't change in relation to the hits or avg_hits parameter can be provided as x, inheriting the value.


What works and what doesn't

  • You can provide however many damage parts you want. The {{#var: total_damage}} and {{#var: total_damage_pvp}} variables will be composed automatically.
    • However, you can't specify separate hit counts for PvP. This is a thing for too small amount of skills (e.g. Lightning Shower) and wasn't worth implementing, so in that case, please use external variables for PvP.
  • No range implemented. Whenever you need to add in some inner skill mechanics with the use of bonus points like Sentimental Points, do it yourself.
  • This template automatically rounds values to the second decimal place, so no need to worry about it.


Example usage

Code
{{Damage
|dmg=845, 232
|pvp_dmg=272, 74
|hits=1, 25
|heavy=true
|passive1=ECP System
}}
{| cellpadding="5" border="1" style="border-collapse: collapse; text-align: center"
|- style="background:{{ColorSel|CharLight|Rose}}"
! rowspan=3 | Mode !! colspan=4 | Regular
|- style="background:{{ColorSel|CharLight|Rose}}"
! colspan=2 | Normal !! colspan=2 | [[ECP System|Over Strike]]
|- style="background:{{ColorSel|CharLight|Rose}}"
! Normal !! Heavy !! Normal !! Heavy
|- 
! {{PvE}} 
| {{#var: total_damage}}
| {{#var: total_damage_heavy}}
| {{#var: total_damage_passive1}}
| {{#var: total_damage_heavy_passive1}}
|- 
! {{PvP}} 
| {{#var: total_damage_pvp}}
| {{#var: total_damage_heavy_pvp}}
| {{#var: total_damage_passive1_pvp}}
| {{#var: total_damage_heavy_passive1_pvp}}
|}

Result:

Mode Regular
Normal Over Strike
Normal Heavy Normal Heavy
PvE 6,645% 9,568.8% 7,974% 11,482.56%
PvP 2,122% 3,055.68% 2,546.4% 3,666.82%