Template:Damage/doc: Difference between revisions

From Elwiki
m (Text replacement - "Ex-S Viper" to "EX-S Viper")
Line 39: Line 39:
=== Extra ===
=== Extra ===
*The generated variables always follow this order in their names: prefix → range/min/max → damage type → awk if awakening (empty if not) → trait → passives → game mode (empty if dungeon), e.g. ''<nowiki>{{#var: range_total_damage_awk_empowered_passive1_passive2_pvp}}</nowiki>''
*The generated variables always follow this order in their names: prefix → range/min/max → damage type → awk if awakening (empty if not) → trait → passives → game mode (empty if dungeon), e.g. ''<nowiki>{{#var: range_total_damage_awk_empowered_passive1_passive2_pvp}}</nowiki>''
*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 empty, i.e. ''<nowiki>|hits=3, 10, 2|awk_hits=5,, 3</nowiki>'' resulting in the same output as typing ''<nowiki>|hits=3, 10, 2|awk_hits=5, 10, 3</nowiki>''.
<br/>
<br/>



Revision as of 19:58, 21 April 2023

Information: This template is using a Scribunto Module: Module:Damage.

Overview

This template is used for the Total Damage section on skill pages in order to avoid hardcoding mathematical formulas and make variables shorter, simply composing them based on the arguments provided. You can also easily edit the generated variables afterwards. If wanted, it can also generate the whole table, depending on how complicated the skill's structure is.

Parameters

Information: For damage and hit count values, prefix the parameter with "pvp_".
  • dmg - specifies damage values
  • awk_dmg - in Awakening Mode
  • hits - specifies maximum hit counts. If not provided, defaults to 1 for all damage effects.
  • count - used for skills like Clementine or Enough Mineral. Generates 2 variable types: each_damage and total_damage
    • count_extra, count_extra_hits, count_extra_pvp - adds another damage effect(s) to total_damage
  • awk_hits - in Awakening Mode
  • avg_hits - specifies average hit counts
  • avg_awk_hits - in Awakening Mode
  • hits_useful - specifies maximum hit counts with the Useful trait
  • awk_hits_useful - in Awakening Mode
  • avg_hits_useful - specifies average hit counts 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
  • 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 provided string to every output variable. Useful when dealing with skills like Heaven's Fist - Pressure or EX-S Viper.
  • range_min, range_max - applies a damage increase to all values and moves them to separate variables. If the value is different between PvE and PvP, provide the PvP value after a comma. If range_min not specified, the minimum value will be the base total damage.
    • Variables created:
      • min_total_damage[...]
      • max_total_damage[...]
      • range_total_damage[...] - displays both minimum and maximum total damage separated with a "~", ex. 17,342% ~ 23,234%
    • Can behave in two different ways.
      • By default, it's considered that only numbers are provided. This will work exactly as expected (damage value multiplied by min/max damage increase).
      • With range_min_count or range_max_count specified. Value provided for this parameter is the damage increase per stage. This is intended for things like Sentimental Point System, where the character increases their damage depending on points consumed. The value of this parameter needs to have 100% subtracted to work as intended (ex. 15%/1.15x damage increase per stage = the value should be 0.15).
        • The helping parameters specify how many available points should be used.
    • This argument is separated to min/max due to some skills being able to recover points on cast, and then consume them immediately, making some of the damage buff unavoidable.

Extra

  • The generated variables always follow this order in their names: prefix → range/min/max → damage type → awk if awakening (empty if not) → trait → passives → game mode (empty if dungeon), e.g. {{#var: range_total_damage_awk_empowered_passive1_passive2_pvp}}


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.
  • Damage range only works with damage buffs, not when hit counts are changed.
  • This template automatically rounds values to the second decimal place, so no need to worry about it.
  • BUG: Appending extra passive variations with the append argument will only work if the appended passive's index is equal to 1.


Example usage

Code
{{Damage
|true
|Rose
|dmg=845, 232
|pvp_dmg=272, 74
|hits=1, 25
|heavy=true
|passive1=Musket Master
}}

Result:

ModeBaseMusket Master
NormalHeavyNormalHeavy
PvE6,645%9,568.8%7,974%11,482.56%
PvP2,122%3,055.68%2,334.2%3,361.25%

This template is used for the Total Damage section on skill pages in order to avoid hardcoding mathematical formulas and make variables shorter, simply composing them based on the arguments provided. You can also easily edit the generated variables afterwards. Please check the template's page for detailed information.

Template parameters

This template prefers block formatting of parameters.

ParameterDescriptionTypeStatus
Generate Table1 table

If true, attemps to generate a table out of the variables automatically.

Default
true
Auto value
true
Booleansuggested
Character2 char

If generating a table, provide the character's name so that the template knows which color to use for the headers.

Default
Elsword
Example
Laby
Stringsuggested
Damage (PvE)dmg

Specifies damage values, separated by commas.

Example
50, 125
Auto value
0
Stringrequired
Damage (PvP)pvp_dmg

Specifies damage values, separated by commas.

Example
50, 125
Auto value
0
Stringrequired
Damage in Awakening (PvE)awk_dmg

no description

Default
inherited from 'dmg'
Stringoptional
Damage in Awakening (PvP)pvp_awk_dmg

no description

Default
inherited from 'pvp_dmg'
Stringoptional
Hitshits

Hit counts for each damage effect, separated by commas. Different hit counts for PvP not supported.

Default
1 (for all damage effects)
Example
13, 23
Auto value
0
Stringsuggested
Count of Instancescount

Used for skills like Clementine or Enough Mineral that spawn multiple instances of the same object. Generates 2 variable types: each_damage and total_damage.

Example
5
Numberoptional
Hits in Awakeningawk_hits

no description

Default
inherited from 'hits'
Stringoptional
Average Hitsavg_hits

Hit counts achievable on average-sized targets, such as Free Training Dummies.

Default
1 (for all damage effects)
Example
7, 13, 5
Auto value
Stringoptional
Average Hits in Awakeningavg_awk_hits

no description

Default
inherited from 'avg_hits'
Stringoptional
Hits (Useful trait)hits_useful

Hit counts with the Useful trait. Requires 'useful_penalty' to make it work.

Stringoptional
Hits (Useful trait) in Awakeningawk_hits_useful

no description

Stringoptional
Average Hits (Useful trait)avg_hits_useful

no description

Stringoptional
Average Hits (Useful trait) in Awakeningavg_awk_hits_useful

no description

Stringoptional
Damage decrease from Useful traituseful_penalty

Provided as a fraction lower than 1.

Example
0.75
Numberoptional
Heavy traitheavy

If 'true', applies the Heavy trait.

Default
false
Example
true
Booleanoptional
Enhanced traitenhanced

If 'true', applies the standard damage decrease from the Enhanced trait. Can provide a custom number lower than 1.

Example
true (or) 0.6
Stringoptional
Empowered traitempowered

If 'true', applies the standard damage increase from the Empowered trait. Can provide a custom number.

Example
1.3
Numberoptional
Passive 1passive1

Generates additional variables with passive values imbued into them. Uses arrays included in passive skill pages. Exact page name required.

Example
Hawkeye
Page nameoptional
Passive 2passive2

Generates additional variables with passive values imbued into them. Uses arrays included in passive skill pages. Exact page name required.

Example
Arrow Mastery
Page nameoptional
Passive 3Passive 3

Generates additional variables with passive values imbued into them. Uses arrays included in passive skill pages. Exact page name required.

Page nameoptional
Pretty-printformat

Wraps the variable output in the formatnum parser function and appends the % sign.

Default
false
Example
true
Booleanoptional
Print all variablesdump

Dumps all generated variables in a list. Warning: disables the actual variables from generating.

Default
false
Example
true
Booleanoptional
Prefixprefix

Adds a string to every generated variable's name.

Example
sometext
Stringoptional
Range (Max)range_max

The maximum damage of a skill, after applying a certain multiplier. PvP value comes after a comma.

Example
2.5
Numberoptional
Range (Min)range_min

Minimal damage of the skill. Only specify if there is an effect that increases damage conditionally, and a part of it cannot be avoided. PvP value comes after a comma.

Example
1.1
Stringoptional
Range (Min) Stage Versionrange_min_count

If this parameter is used, it will multiply itself by range_min. Intended for mechanics like Sentimental Points with even stages of damage increase. Use when casting the skill with no points/gauge that increases damage per stage is impossible.

Numberoptional
Range (Max) Stage Versionrange_max_count

If this parameter is used, it will multiply itself by range_max. Intended for mechanics like Sentimental Points with even stages of damage increase.

Numberoptional
Extra damage to merged instancescount_extra

Applies extra damage to 'total_damage' fields (but not 'each_damage') when 'count' is used.

Example
150
Numberoptional
Extra damage to merged instances (hit count)count_extra_hits

Applies extra damage to 'total_damage' fields (but not 'each_damage') when 'count' is used. (Provide hit count)

Example
5
Numberoptional
Extra damage to merged instances (PvP)count_extra_pvp

Applies extra damage to 'total_damage_pvp' fields (but not 'each_damage_pvp') when 'count' is used.

Stringoptional
Instance Namecount_name

When generating a table and 'count' is used, specify the damage part that the skill is divided to.

Default
Instance
Example
Orb
Stringoptional
System Effectappend

When generating a table, specify a passive/system effect that will consider everything in two cases - no effect and effect present. The first part is the passive's number provided with 'passive[1-3]' beforehand. The second part is optional, and is used to give it an alternate name.

Example
1, Over Strike
Stringoptional
Combined Passivescombine

A comma-separated list of passives defined via 'passive[1-3]' to merge when generating a table. For example, providing 'Key of Proof' as passive 1, 'Musket Master' as passive2 and 'combine' as '1, 2' will output 'Key of Proof/Musket Master' to the header, and correctly mix-match the damage values.

Example
2, 3
Stringoptional
Suffix after combinationcombine_suffix

When generating a table and using 'combine', you can add a piece of extra text at the end of the header. The value is automatically preceded by a space.

Example
Used midair
Stringoptional
No Max Damageno_max

When generating a table, tell the template not to generate the 'Maximum' fields at all. It will also try to make it look as good as possible.

Example
true
Booleanoptional
Use Average For Instancesuse_avg

When generating a table, ignores 'each_damage' fields, and instead generates the regular 'avg_damage' fields.

Example
true
Booleanoptional
First Passive Alt. Namealias1

no description

Stringoptional
Second Passive Alt. Namealias2

no description

Stringoptional
Third Passive Alt. Namealias3

no description

Stringoptional
First Passive Suffixsuffix1

no description

Stringoptional
Second Passive Suffixsuffix2

no description

Stringoptional
Third Passive Suffixsuffix3

no description

Stringoptional
Permanent Effectperm_buff

Specified for damage parts between commas.

Example
1.5
Unknownoptional
Permanent Effect (PvP)pvp_perm_buff

Specified for damage parts between commas.

Example
1.25
Unknownoptional