Template:Damage/doc: Difference between revisions
No edit summary |
mNo edit summary |
||
(44 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{Lua|Damage}} | |||
== Overview == | == Overview == | ||
This template is used for '''Total Damage''' section on skill pages in order to avoid hardcoding mathematical formulas and | 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 == | == Parameters == | ||
*''' | {{InfoBanner|text=<br/> | ||
*'''awk_dmg | *For damage and hit count values, prefix the parameter with "pvp_". | ||
**You can also generate [[Ara]]'s cancel skills by prefixing them with "cancel_" (for PvP, its prefix comes first, e.g. ''pvp_cancel_avg_hits''). | |||
*For min/max values of damage and hits, suffix the parameter with "_min" or "_max" (e.g. ''avg_hits_max'').|imagesize=30}} | |||
*'''dmg''' - specifies damage values | |||
*'''awk_dmg''' - in [[Awakening Mode]] | |||
*'''hits''' - specifies maximum hit counts. If not provided, defaults to 1 for all damage effects. | *'''hits''' - specifies maximum hit counts. If not provided, defaults to 1 for all damage effects. | ||
*'''awk_hits''' - in [[Awakening Mode]] | *'''awk_hits''' - in [[Awakening Mode]] | ||
*'''avg_hits''' - specifies average hit counts | *'''avg_hits''' - specifies average hit counts | ||
Line 21: | Line 26: | ||
*'''format''' - enables pretty-printing of the numbers (applies % sign and ''<nowiki>{{formatnum:}}</nowiki>''). 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. | *'''format''' - enables pretty-printing of the numbers (applies % sign and ''<nowiki>{{formatnum:}}</nowiki>''). 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. | *'''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#Total Damage|Heaven's Fist - Pressure]] or [[ | *'''prefix''' - if specified, appends the provided string to every output variable. Useful when dealing with skills like [[Heaven's Fist - Pressure#Total Damage|Heaven's Fist - Pressure]] or [[EX-S Viper#Total_Damage|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: | |||
***''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 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. | |||
=== I18n === | |||
*'''lang''' - is used for multi-language support. The following changes will apply if this is set. | |||
**Passive names are collected from translated pages' '''<nowiki>{{DISPLAYTITLE}}</nowiki>''' if exists. This acts like ''alias'' but can still be overwriten by ''alias''. | |||
**Links will be linked to ''[page]/[lang]'' instead of ''[page]''. | |||
**Translations will be fetched from ''Template:Damage/[lang]'' (i.e. ''Template:Damage/zh-hans'') and applied to table. Text will be unchanged if no translated text found. | |||
**To define your translation, you should add the following to ''Template:Damage/[lang]''. <syntaxhighlight> | |||
{{#arraydefine:$t| | |||
original text 1 (key1)=translated text 1(value1), | |||
original text 2 (key2)=translated text 2(value2), | |||
..., | |||
}} | |||
</syntaxhighlight> | |||
**Notable information in translations: | |||
***''PvP'' and ''PvE'' are templates ''<nowiki>{{PvE}}</nowiki>'' and ''<nowiki>{{PvP}}</nowiki>'', translate them with key ''PvP'' and ''PvE'' and values with corresponding template title. | |||
***Some translations do not act entirely. They are formatted with some words replaced. In such cases, translations for pattern and static words should be given. Use ''{n}'' in pattern to indicate where to substitute words. ''{n}'' starts from 1. | |||
****''Per Group'' and ''Per {count_name}'' → Translations ''Per {1}'' and ''Group'' needed. | |||
****''({dmp} DMP)'' → Translation ''({1} DMP)'' needed. | |||
=== 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: | *The generated variables always follow this order in their names: prefix → range → 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>'' | ||
<br/> | <br/> | ||
== | == Tips == | ||
*You can provide however many damage parts you want. The ''<nowiki>{{#var: total_damage}}</nowiki>'' and ''<nowiki>{{#var: total_damage_pvp}}</nowiki>'' variables will be composed automatically. | *You can provide however many damage parts you want. The ''<nowiki>{{#var: total_damage}}</nowiki>'' and ''<nowiki>{{#var: total_damage_pvp}}</nowiki>'' variables will be composed automatically. | ||
** | **Using ranges stops regular variables from generating. | ||
*This template automatically rounds values to the second decimal place, so no need to worry about it. | *This template automatically rounds values to the second decimal place, so no need to worry about it. | ||
*Certain values are inherited, either when they are empty or contain "i" in them (handy when you want to perform math operations on the numbers). ''Dev tip: to see the exact order, check DAMAGE_CONFIG each damage_numbers and hit_counts fields. The first value in each is the one that inherits from the rest if they exist.'' | |||
<br/> | <br/> | ||
Line 61: | Line 89: | ||
<div class="mw-collapsible mw-collapsed"><div class="collapsible-header">Code</div><div class="mw-collapsible-content"><pre><nowiki> | <div class="mw-collapsible mw-collapsed"><div class="collapsible-header">Code</div><div class="mw-collapsible-content"><pre><nowiki> | ||
{{Damage | {{Damage | ||
|true | |||
|Rose | |||
|dmg=845, 232 | |dmg=845, 232 | ||
|pvp_dmg=272, 74 | |pvp_dmg=272, 74 | ||
|hits=1, 25 | |hits=1, 25 | ||
|heavy=true | |heavy=true | ||
|passive1= | |passive1=Musket Master | ||
}} | }} | ||
</nowiki></pre></div></div> | </nowiki></pre></div></div> | ||
Result: | Result: | ||
{{Damage | {{Damage | ||
|true | |||
|Rose | |||
|dmg=845, 232 | |dmg=845, 232 | ||
|pvp_dmg=272, 74 | |pvp_dmg=272, 74 | ||
|hits=1, 25 | |hits=1, 25 | ||
|heavy=true | |heavy=true | ||
|passive1= | |passive1=Musket Master | ||
}} | }} | ||
{ | <templatedata> | ||
{ | |||
"params": { | |||
"1": { | |||
"label": "Generate Table", | |||
"description": "If true, attemps to generate a table out of the variables automatically.", | |||
"type": "boolean", | |||
"default": "true", | |||
"autovalue": "true", | |||
"suggested": true | |||
}, | |||
"2": { | |||
"aliases": [ | |||
"char" | |||
], | |||
"label": "Character", | |||
"description": "If generating a table, provide the character's name so that the template knows which color to use for the headers.", | |||
"example": "Laby", | |||
"type": "string", | |||
"default": "Elsword", | |||
"suggested": true | |||
}, | |||
"dmg": { | |||
"label": "Damage (PvE)", | |||
"description": "Specifies damage values, separated by commas.", | |||
"example": "50, 125", | |||
"type": "string", | |||
"autovalue": "0", | |||
"required": true, | |||
"suggested": true | |||
}, | |||
"pvp_dmg": { | |||
"label": "Damage (PvP)", | |||
"description": "Specifies damage values, separated by commas.", | |||
"example": "50, 125", | |||
"type": "string", | |||
"autovalue": "0", | |||
"required": true, | |||
"suggested": true | |||
}, | |||
"awk_dmg": { | |||
"label": "Damage in Awakening (PvE)", | |||
"type": "string", | |||
"default": "inherited from 'dmg'" | |||
}, | |||
"pvp_awk_dmg": { | |||
"label": "Damage in Awakening (PvP)", | |||
"type": "string", | |||
"default": "inherited from 'pvp_dmg'" | |||
}, | |||
"hits": { | |||
"label": "Hits (PvE)", | |||
"description": "Hit counts for each damage effect, separated by commas. If not provided, it will equal to 1 for all values provided with 'dmg'.", | |||
"example": "13, 23", | |||
"type": "string", | |||
"default": "1", | |||
"autovalue": "0", | |||
"suggested": true | |||
}, | |||
"count": { | |||
"label": "Count of Instances", | |||
"description": "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", | |||
"type": "number" | |||
}, | |||
"awk_hits": { | |||
"label": "Hits in Awakening", | |||
"type": "string", | |||
"default": "inherited from 'hits'" | |||
}, | |||
"avg_hits": { | |||
"label": "Average Hits", | |||
"description": "Hit counts achievable on average-sized targets, such as Free Training Dummies.", | |||
"example": "7, 13, 5", | |||
"type": "string", | |||
"default": "1 (for all damage effects)", | |||
"autovalue": "" | |||
}, | |||
"avg_awk_hits": { | |||
"label": "Average Hits in Awakening", | |||
"type": "string", | |||
"default": "inherited from 'avg_hits'" | |||
}, | |||
"hits_useful": { | |||
"label": "Hits (Useful trait)", | |||
"description": "Hit counts with the Useful trait. Requires 'useful_penalty' to make it work.", | |||
"type": "string" | |||
}, | |||
"awk_hits_useful": { | |||
"label": "Hits (Useful trait) in Awakening", | |||
"type": "string" | |||
}, | |||
"avg_hits_useful": { | |||
"label": "Average Hits (Useful trait)", | |||
"type": "string" | |||
}, | |||
"avg_awk_hits_useful": { | |||
"label": "Average Hits (Useful trait) in Awakening", | |||
"type": "string" | |||
}, | |||
"useful_penalty": { | |||
"label": "Damage decrease from Useful trait", | |||
"description": "Provided as a fraction lower than 1.", | |||
"example": "0.75", | |||
"type": "number", | |||
"aliases": [ | |||
"useful" | |||
] | |||
}, | |||
"heavy": { | |||
"label": "Heavy trait", | |||
"description": "If 'true', applies the Heavy trait.", | |||
"example": "true", | |||
"type": "boolean", | |||
"default": "false" | |||
}, | |||
"enhanced": { | |||
"label": "Enhanced trait", | |||
"description": "If 'true', applies the standard damage decrease from the Enhanced trait. Can provide a custom number lower than 1.", | |||
"example": "true (or) 0.6", | |||
"type": "string" | |||
}, | |||
"empowered": { | |||
"label": "Empowered trait", | |||
"description": "If 'true', applies the standard damage increase from the Empowered trait. Can provide a custom number.", | |||
"example": "1.3", | |||
"type": "number" | |||
}, | |||
"passive1": { | |||
"label": "Passive 1", | |||
"description": "Generates additional variables with passive values imbued into them. Uses arrays included in passive skill pages. Exact page name required. The documentation only mentions 3 passives, but more also works.", | |||
"example": "Hawk Eye", | |||
"type": "wiki-page-name" | |||
}, | |||
"passive2": { | |||
"label": "Passive 2", | |||
"type": "wiki-page-name" | |||
}, | |||
"format": { | |||
"label": "Pretty-print", | |||
"description": "Wraps the variable output in the formatnum parser function and appends the % sign.", | |||
"example": "true", | |||
"type": "boolean", | |||
"default": "true" | |||
}, | |||
"dump": { | |||
"label": "Print all variables", | |||
"description": "Dumps a <pre> with all damage numbers.", | |||
"example": "true", | |||
"type": "boolean", | |||
"default": "false" | |||
}, | |||
"prefix": { | |||
"label": "Prefix", | |||
"description": "Adds a string to every generated variable's name.", | |||
"example": "sometext", | |||
"type": "string" | |||
}, | |||
"range_max": { | |||
"label": "Range (Max)", | |||
"description": "The maximum damage of a skill, after applying a certain multiplier. PvP value comes after a comma.", | |||
"example": "2.5", | |||
"type": "number" | |||
}, | |||
"range_min": { | |||
"label": "Range (Min)", | |||
"description": "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", | |||
"type": "string" | |||
}, | |||
"range_min_count": { | |||
"label": "Range (Min) Stage Version", | |||
"description": "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.", | |||
"type": "number" | |||
}, | |||
"range_max_count": { | |||
"label": "Range (Max) Stage Version", | |||
"description": "If this parameter is used, it will multiply itself by range_max. Intended for mechanics like Sentimental Points with even stages of damage increase.", | |||
"type": "number" | |||
}, | |||
"count_name": { | |||
"label": "Instance Name", | |||
"description": "When generating a table and 'count' is used, specify the damage part that the skill is divided to.", | |||
"example": "Orb", | |||
"type": "string", | |||
"default": "Instance" | |||
}, | |||
"append": { | |||
"label": "System Effect", | |||
"description": "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[number]' beforehand. The second part is optional, and is used to give it an alternate name.", | |||
"example": "1, Over Strike", | |||
"type": "string" | |||
}, | |||
"combine": { | |||
"label": "Combined Passives", | |||
"description": "A comma-separated list of passives defined via 'passive[number]' 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", | |||
"type": "string" | |||
}, | |||
"combine_suffix": { | |||
"label": "Suffix after combination", | |||
"description": "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", | |||
"type": "string" | |||
}, | |||
"no_max": { | |||
"label": "No Max Damage", | |||
"description": "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", | |||
"type": "boolean" | |||
}, | |||
"use_avg": { | |||
"label": "Use Average For Instances", | |||
"description": "When generating a table, ignores 'each_damage' fields, and instead generates the regular 'avg_damage' fields. The 'total_damage' fields are still calculated using the 'count' argument.", | |||
"example": "true", | |||
"type": "boolean" | |||
}, | |||
"alias1": { | |||
"label": "First Passive Alt. Name", | |||
"type": "string" | |||
}, | |||
"suffix1": { | |||
"label": "First Passive Suffix", | |||
"type": "string" | |||
}, | |||
"alias2": { | |||
"label": "Second Passive Alt. Name", | |||
"type": "string" | |||
}, | |||
"suffix2": { | |||
"label": "Second Passive Suffix", | |||
"type": "string" | |||
}, | |||
"alias3": { | |||
"label": "Third Passive Alt. Name", | |||
"type": "string" | |||
}, | |||
"suffix3": { | |||
"label": "Third Passive Suffix", | |||
"type": "string" | |||
}, | |||
"perm_buff": { | |||
"label": "Permanent Effect", | |||
"description": "A buff effect for the whole skill.", | |||
"example": "1.5" | |||
}, | |||
"pvp_perm_buff": { | |||
"label": "Permanent Effect (PvP)", | |||
"description": "A buff effect for the whole skill.", | |||
"example": "1.25" | |||
}, | |||
"pvp_hits": { | |||
"label": "Hits (PvP)" | |||
}, | |||
"pvp_awk_hits": { | |||
"label": "Hits in Awakening (PvP)" | |||
}, | |||
"pvp_avg_hits": { | |||
"label": "Average Hits (PvP)" | |||
}, | |||
"pvp_avg_awk_hits": { | |||
"label": "Average Hits in Awakening (PvP)" | |||
}, | |||
"pvp_hits_useful": { | |||
"label": "Hits (Useful trait, PvP)" | |||
}, | |||
"pvp_awk_hits_useful": { | |||
"label": "Hits in Awakening (Useful trait, PvP)" | |||
}, | |||
"pvp_avg_awk_hits_useful": { | |||
"label": "Average Hits in Awakening (Useful trait, PvP)" | |||
}, | |||
"passive3": { | |||
"label": "Passive 3", | |||
"type": "wiki-page-name" | |||
}, | |||
"dump_names": { | |||
"label": "Dump Names", | |||
"description": "Replace numbers with variable names on the generated table for debugging purposes.", | |||
"example": "true", | |||
"type": "boolean" | |||
}, | |||
"dmp": { | |||
"label": "Dynamo Configuration Mode", | |||
"description": "If 'true', displays 'Dynamo Configuration (3 DMP)' instead of 'Awakening Mode' on the generated table. Provide a number if you want to modify the default amount of DMP. 'false' disables DMP notice.", | |||
"example": "4", | |||
"type": "unknown" | |||
}, | |||
"awk_alias": { | |||
"label": "Awakening Text Alias", | |||
"description": "Replace the phrase \"Awakening Mode\" with something else. After a comma, one can insert the display text. If not provided, it will fallback to the first part.", | |||
"example": "Moonlight System, Blood Moon", | |||
"type": "string" | |||
}, | |||
"bug": { | |||
"label": "Free Training Hit Count Bug", | |||
"description": "Generates a short notice above the table that this skill may report wrong on damage in Free Training areas.", | |||
"example": "true", | |||
"type": "boolean" | |||
}, | |||
"dump_table_data": { | |||
"label": "Dump Table Data", | |||
"description": "(Advanced) Dumps the generated table structure contained in a LUA table. Useful for debugging the structure.", | |||
"example": "true", | |||
"type": "boolean" | |||
}, | |||
"display_separated": { | |||
"label": "Display separated passives when combined", | |||
"description": "Combining removes the actual single passive from being generated in the table, but you can just this behavior with this argument. Takes a comma-separated list of passive indexes that you want displayed on their own.", | |||
"example": "2,3", | |||
"type": "string" | |||
}, | |||
"passive_define1": { | |||
"label": "Custom Passive 1", | |||
"description": "Able to define a custom passive in the following format: [pve value, pvp value, name]. The name will be made into a link, and the display text can be changed using alias[number], just like for normal passives.", | |||
"example": "1.4, 1.2, Blood Hit", | |||
"type": "string" | |||
}, | |||
"passive_define2": { | |||
"label": "Custom Passive 2", | |||
"type": "string" | |||
}, | |||
"passive_define3": { | |||
"label": "Custom Passive 3", | |||
"type": "string" | |||
}, | |||
"lang": { | |||
"label": "Language Suffix", | |||
"description": "A language suffix for multi-language variants.", | |||
"example": "zh-hans" | |||
} | |||
}, | |||
"description": "This template is used for the Total Damage section on skill pages to avoid hardcoding mathematical formulas. It can generate a table for you in generic cases, or make defining variables easier, 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.", | |||
"paramOrder": [ | |||
"1", | |||
"2", | |||
"lang", | |||
"dmg", | |||
"pvp_dmg", | |||
"awk_dmg", | |||
"pvp_awk_dmg", | |||
"hits", | |||
"pvp_hits", | |||
"count", | |||
"awk_hits", | |||
"avg_hits", | |||
"avg_awk_hits", | |||
"hits_useful", | |||
"awk_hits_useful", | |||
"avg_hits_useful", | |||
"avg_awk_hits_useful", | |||
"useful_penalty", | |||
"heavy", | |||
"enhanced", | |||
"empowered", | |||
"passive1", | |||
"passive2", | |||
"passive3", | |||
"format", | |||
"dump", | |||
"prefix", | |||
"range_max", | |||
"range_min", | |||
"range_min_count", | |||
"range_max_count", | |||
"count_name", | |||
"append", | |||
"combine", | |||
"combine_suffix", | |||
"no_max", | |||
"use_avg", | |||
"alias1", | |||
"alias2", | |||
"alias3", | |||
"suffix1", | |||
"suffix2", | |||
"suffix3", | |||
"perm_buff", | |||
"pvp_perm_buff", | |||
"pvp_awk_hits", | |||
"pvp_avg_hits", | |||
"pvp_avg_awk_hits", | |||
"pvp_hits_useful", | |||
"pvp_awk_hits_useful", | |||
"pvp_avg_awk_hits_useful", | |||
"dump_names", | |||
"dmp", | |||
"awk_alias", | |||
"display_separated", | |||
"bug", | |||
"dump_table_data", | |||
"passive_define1", | |||
"passive_define2", | |||
"passive_define3" | |||
], | |||
"format": "block" | |||
} | |||
</templatedata> |
Latest revision as of 15:17, 12 March 2024
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
- dmg - specifies damage values
- awk_dmg - in Awakening Mode
- hits - specifies maximum hit counts. If not provided, defaults to 1 for all damage effects.
- 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:
- 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 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.
- Variables created:
I18n
- lang - is used for multi-language support. The following changes will apply if this is set.
- Passive names are collected from translated pages' {{DISPLAYTITLE}} if exists. This acts like alias but can still be overwriten by alias.
- Links will be linked to [page]/[lang] instead of [page].
- Translations will be fetched from Template:Damage/[lang] (i.e. Template:Damage/zh-hans) and applied to table. Text will be unchanged if no translated text found.
- To define your translation, you should add the following to Template:Damage/[lang].
{{#arraydefine:$t| original text 1 (key1)=translated text 1(value1), original text 2 (key2)=translated text 2(value2), ..., }}
- Notable information in translations:
- PvP and PvE are templates {{PvE}} and {{PvP}}, translate them with key PvP and PvE and values with corresponding template title.
- Some translations do not act entirely. They are formatted with some words replaced. In such cases, translations for pattern and static words should be given. Use {n} in pattern to indicate where to substitute words. {n} starts from 1.
- Per Group and Per {count_name} → Translations Per {1} and Group needed.
- ({dmp} DMP) → Translation ({1} DMP) needed.
Extra
- The generated variables always follow this order in their names: prefix → range → 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}}
Tips
- You can provide however many damage parts you want. The {{#var: total_damage}} and {{#var: total_damage_pvp}} variables will be composed automatically.
- Using ranges stops regular variables from generating.
- This template automatically rounds values to the second decimal place, so no need to worry about it.
- Certain values are inherited, either when they are empty or contain "i" in them (handy when you want to perform math operations on the numbers). Dev tip: to see the exact order, check DAMAGE_CONFIG each damage_numbers and hit_counts fields. The first value in each is the one that inherits from the rest if they exist.
Example usage
{{Damage |true |Rose |dmg=845, 232 |pvp_dmg=272, 74 |hits=1, 25 |heavy=true |passive1=Musket Master }}
Result:
Mode | Base | Musket Master | ||
---|---|---|---|---|
Normal | Heavy | Normal | Heavy | |
PvE | 6,645% | 9,568.8% | 7,974% | 11,482.56% |
PvP | 2,122% | 3,055.68% | 2,334.2% | 3,361.25% |
This template is used for the Total Damage section on skill pages to avoid hardcoding mathematical formulas. It can generate a table for you in generic cases, or make defining variables easier, 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.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Generate Table | 1 | If true, attemps to generate a table out of the variables automatically.
| Boolean | suggested |
Character | 2 char | If generating a table, provide the character's name so that the template knows which color to use for the headers.
| String | suggested |
Language Suffix | lang | A language suffix for multi-language variants.
| Unknown | optional |
Damage (PvE) | dmg | Specifies damage values, separated by commas.
| String | required |
Damage (PvP) | pvp_dmg | Specifies damage values, separated by commas.
| String | required |
Damage in Awakening (PvE) | awk_dmg | no description
| String | optional |
Damage in Awakening (PvP) | pvp_awk_dmg | no description
| String | optional |
Hits (PvE) | hits | Hit counts for each damage effect, separated by commas. If not provided, it will equal to 1 for all values provided with 'dmg'.
| String | suggested |
Hits (PvP) | pvp_hits | no description | Unknown | optional |
Count of Instances | count | 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.
| Number | optional |
Hits in Awakening | awk_hits | no description
| String | optional |
Average Hits | avg_hits | Hit counts achievable on average-sized targets, such as Free Training Dummies.
| String | optional |
Average Hits in Awakening | avg_awk_hits | no description
| String | optional |
Hits (Useful trait) | hits_useful | Hit counts with the Useful trait. Requires 'useful_penalty' to make it work. | String | optional |
Hits (Useful trait) in Awakening | awk_hits_useful | no description | String | optional |
Average Hits (Useful trait) | avg_hits_useful | no description | String | optional |
Average Hits (Useful trait) in Awakening | avg_awk_hits_useful | no description | String | optional |
Damage decrease from Useful trait | useful_penalty useful | Provided as a fraction lower than 1.
| Number | optional |
Heavy trait | heavy | If 'true', applies the Heavy trait.
| Boolean | optional |
Enhanced trait | enhanced | If 'true', applies the standard damage decrease from the Enhanced trait. Can provide a custom number lower than 1.
| String | optional |
Empowered trait | empowered | If 'true', applies the standard damage increase from the Empowered trait. Can provide a custom number.
| Number | optional |
Passive 1 | passive1 | Generates additional variables with passive values imbued into them. Uses arrays included in passive skill pages. Exact page name required. The documentation only mentions 3 passives, but more also works.
| Page name | optional |
Passive 2 | passive2 | no description | Page name | optional |
Passive 3 | passive3 | no description | Page name | optional |
Pretty-print | format | Wraps the variable output in the formatnum parser function and appends the % sign.
| Boolean | optional |
Print all variables | dump | Dumps a <pre> with all damage numbers.
| Boolean | optional |
Prefix | prefix | Adds a string to every generated variable's name.
| String | optional |
Range (Max) | range_max | The maximum damage of a skill, after applying a certain multiplier. PvP value comes after a comma.
| Number | optional |
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.
| String | optional |
Range (Min) Stage Version | range_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. | Number | optional |
Range (Max) Stage Version | range_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. | Number | optional |
Instance Name | count_name | When generating a table and 'count' is used, specify the damage part that the skill is divided to.
| String | optional |
System Effect | append | 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[number]' beforehand. The second part is optional, and is used to give it an alternate name.
| String | optional |
Combined Passives | combine | A comma-separated list of passives defined via 'passive[number]' 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.
| String | optional |
Suffix after combination | combine_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.
| String | optional |
No Max Damage | no_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.
| Boolean | optional |
Use Average For Instances | use_avg | When generating a table, ignores 'each_damage' fields, and instead generates the regular 'avg_damage' fields. The 'total_damage' fields are still calculated using the 'count' argument.
| Boolean | optional |
First Passive Alt. Name | alias1 | no description | String | optional |
Second Passive Alt. Name | alias2 | no description | String | optional |
Third Passive Alt. Name | alias3 | no description | String | optional |
First Passive Suffix | suffix1 | no description | String | optional |
Second Passive Suffix | suffix2 | no description | String | optional |
Third Passive Suffix | suffix3 | no description | String | optional |
Permanent Effect | perm_buff | A buff effect for the whole skill.
| Unknown | optional |
Permanent Effect (PvP) | pvp_perm_buff | A buff effect for the whole skill.
| Unknown | optional |
Hits in Awakening (PvP) | pvp_awk_hits | no description | Unknown | optional |
Average Hits (PvP) | pvp_avg_hits | no description | Unknown | optional |
Average Hits in Awakening (PvP) | pvp_avg_awk_hits | no description | Unknown | optional |
Hits (Useful trait, PvP) | pvp_hits_useful | no description | Unknown | optional |
Hits in Awakening (Useful trait, PvP) | pvp_awk_hits_useful | no description | Unknown | optional |
Average Hits in Awakening (Useful trait, PvP) | pvp_avg_awk_hits_useful | no description | Unknown | optional |
Dump Names | dump_names | Replace numbers with variable names on the generated table for debugging purposes.
| Boolean | optional |
Dynamo Configuration Mode | dmp | If 'true', displays 'Dynamo Configuration (3 DMP)' instead of 'Awakening Mode' on the generated table. Provide a number if you want to modify the default amount of DMP. 'false' disables DMP notice.
| Unknown | optional |
Awakening Text Alias | awk_alias | Replace the phrase "Awakening Mode" with something else. After a comma, one can insert the display text. If not provided, it will fallback to the first part.
| String | optional |
Display separated passives when combined | display_separated | Combining removes the actual single passive from being generated in the table, but you can just this behavior with this argument. Takes a comma-separated list of passive indexes that you want displayed on their own.
| String | optional |
Free Training Hit Count Bug | bug | Generates a short notice above the table that this skill may report wrong on damage in Free Training areas.
| Boolean | optional |
Dump Table Data | dump_table_data | (Advanced) Dumps the generated table structure contained in a LUA table. Useful for debugging the structure.
| Boolean | optional |
Custom Passive 1 | passive_define1 | Able to define a custom passive in the following format: [pve value, pvp value, name]. The name will be made into a link, and the display text can be changed using alias[number], just like for normal passives.
| String | optional |
Custom Passive 2 | passive_define2 | no description | String | optional |
Custom Passive 3 | passive_define3 | no description | String | optional |