Template:Damage/doc: Difference between revisions

m
no edit summary
No edit summary
mNo edit summary
 
(24 intermediate revisions by 3 users not shown)
Line 5: Line 5:


== Parameters ==
== Parameters ==
{{InfoBanner|text=For damage and hit count values, prefix the parameter with "pvp_".}}
{{InfoBanner|text=<br/>
*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
*'''dmg''' - specifies damage values
*'''awk_dmg''' - in [[Awakening Mode]]
*'''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.
*'''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]]
*'''awk_hits''' - in [[Awakening Mode]]
*'''avg_hits''' - specifies average hit counts
*'''avg_hits''' - specifies average hit counts
Line 25: 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 [[Ex-S Viper#Total_Damage|Ex-S Viper]].
*'''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.
*'''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:
**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%
***''range_''total_damage[...] - displays both minimum and maximum total damage separated with a "~", ex. 17,342% ~ 23,234%
**Can behave in two different ways.
**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).
***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).
***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.
****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.
**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: 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 → 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/>


== What works and what doesn't ==
== 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.
**'''Count''' will not work with '''Useful''' or [[Awakening Mode]].
**Using ranges stops regular variables from generating.
*Damage range only works with damage buffs, not when hit counts are changed.
**Check '''[[Phoenix Wings#Total Damage|this page]]''' for hints.
*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.
*BUG: Appending extra passive variations with the '''append''' argument will only work if the appended passive's index is equal to 1.
*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 98: Line 112:
"params": {
"params": {
"1": {
"1": {
"aliases": [
"table"
],
"label": "Generate Table",
"label": "Generate Table",
"description": "If true, attemps to generate a table out of the variables automatically.",
"description": "If true, attemps to generate a table out of the variables automatically.",
Line 148: Line 159:
},
},
"hits": {
"hits": {
"label": "Hits",
"label": "Hits (PvE)",
"description": "Hit counts for each damage effect, separated by commas. Different hit counts for PvP not supported.",
"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",
"example": "13, 23",
"type": "string",
"type": "string",
"default": "1 (for all damage effects)",
"default": "1",
"autovalue": "0",
"autovalue": "0",
"suggested": true
"suggested": true
Line 201: Line 212:
"description": "Provided as a fraction lower than 1.",
"description": "Provided as a fraction lower than 1.",
"example": "0.75",
"example": "0.75",
"type": "number"
"type": "number",
"aliases": [
"useful"
]
},
},
"heavy": {
"heavy": {
Line 224: Line 238:
"passive1": {
"passive1": {
"label": "Passive 1",
"label": "Passive 1",
"description": "Generates additional variables with passive values imbued into them. Uses arrays included in passive skill pages. Exact page name required.",
"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": "Hawkeye",
"example": "Hawk Eye",
"type": "wiki-page-name"
"type": "wiki-page-name"
},
},
"passive2": {
"passive2": {
"label": "Passive 2",
"label": "Passive 2",
"description": "Generates additional variables with passive values imbued into them. Uses arrays included in passive skill pages. Exact page name required.",
"example": "Arrow Mastery",
"type": "wiki-page-name"
},
"Passive 3": {
"label": "Passive 3",
"description": "Generates additional variables with passive values imbued into them. Uses arrays included in passive skill pages. Exact page name required.",
"type": "wiki-page-name"
"type": "wiki-page-name"
},
},
Line 244: Line 251:
"example": "true",
"example": "true",
"type": "boolean",
"type": "boolean",
"default": "false"
"default": "true"
},
},
"dump": {
"dump": {
"label": "Print all variables",
"label": "Print all variables",
"description": "Dumps all generated variables in a list. Warning: disables the actual variables from generating.",
"description": "Dumps a <pre> with all damage numbers.",
"example": "true",
"example": "true",
"type": "boolean",
"type": "boolean",
Line 280: Line 287:
"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.",
"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"
"type": "number"
},
"count_extra": {
"label": "Extra damage to merged instances",
"description": "Applies extra damage to 'total_damage' fields (but not 'each_damage') when 'count' is used.",
"example": "150",
"type": "number"
},
"count_extra_hits": {
"label": "Extra damage to merged instances (hit count)",
"description": "Applies extra damage to 'total_damage' fields (but not 'each_damage') when 'count' is used. (Provide hit count)",
"example": "5",
"type": "number"
},
"count_extra_pvp": {
"label": "Extra damage to merged instances (PvP)",
"description": "Applies extra damage to 'total_damage_pvp' fields (but not 'each_damage_pvp') when 'count' is used.",
"type": "string"
},
},
"count_name": {
"count_name": {
Line 307: Line 297:
"append": {
"append": {
"label": "System Effect",
"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[1-3]' beforehand. The second part is optional, and is used to give it an alternate name.",
"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",
"example": "1, Over Strike",
"type": "string"
"type": "string"
Line 313: Line 303:
"combine": {
"combine": {
"label": "Combined Passives",
"label": "Combined Passives",
"description": "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.",
"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",
"example": "2, 3",
"type": "string"
"type": "string"
Line 331: Line 321:
"use_avg": {
"use_avg": {
"label": "Use Average For Instances",
"label": "Use Average For Instances",
"description": "When generating a table, ignores 'each_damage' fields, and instead generates the regular 'avg_damage' fields.",
"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",
"example": "true",
"type": "boolean"
"type": "boolean"
Line 361: Line 351:
"perm_buff": {
"perm_buff": {
"label": "Permanent Effect",
"label": "Permanent Effect",
"description": "Specified for damage parts between commas.",
"description": "A buff effect for the whole skill.",
"example": "1.5"
"example": "1.5"
},
},
"pvp_perm_buff": {
"pvp_perm_buff": {
"label": "Permanent Effect (PvP)",
"label": "Permanent Effect (PvP)",
"description": "Specified for damage parts between commas.",
"description": "A buff effect for the whole skill.",
"example": "1.25"
"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 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.",
"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": [
"paramOrder": [
"1",
"1",
"2",
"2",
"lang",
"dmg",
"dmg",
"pvp_dmg",
"pvp_dmg",
Line 379: Line 450:
"pvp_awk_dmg",
"pvp_awk_dmg",
"hits",
"hits",
"pvp_hits",
"count",
"count",
"awk_hits",
"awk_hits",
Line 393: Line 465:
"passive1",
"passive1",
"passive2",
"passive2",
"Passive 3",
"passive3",
"format",
"format",
"dump",
"dump",
Line 401: Line 473:
"range_min_count",
"range_min_count",
"range_max_count",
"range_max_count",
"count_extra",
"count_extra_hits",
"count_extra_pvp",
"count_name",
"count_name",
"append",
"append",
Line 417: Line 486:
"suffix3",
"suffix3",
"perm_buff",
"perm_buff",
"pvp_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"
"format": "block"
}
}
</templatedata>
</templatedata>