Template:Character/Attribute: Difference between revisions
Jump to navigation
Jump to search
(support ? or blank values for attributes) |
(fix dice trying to parse empty value (affects pages that don't define MA, such as dynamic turret pages)) |
||
(7 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><div class="qud-attribute-entry qud-tooltip"><div class="qud-attribute-label qud-attribute-{{lc:{{{2}}}}}">{{{2}}}:</div><div class="qud-attribute-value">{{#switch: {{{3|?}}} | ? = {{{3|? | <includeonly><div class="qud-attribute-entry qud-tooltip"><div class="qud-attribute-label qud-attribute-{{lc:{{{2}}}}}">{{{2}}}:</div><div class="qud-attribute-value">{{#switch: {{{3|?}}} | | ? | ?? = {{#if:{{{3|}}}|{{{3}}}|?}}</div> | {{#invoke:dice/Format | diceStats | roll = {{{3|}}} | multiplier = {{{5|1}}} | extraafterroll = {{{6|0}}} | template = Dice_ceil_based_average_truncated}}</div>{{#if: {{{3|}}} | <!-- create hover tooltip if a value was specified for the attribute: --><span class="qud-tooltip-text delayed-tooltip">[[{{{4|Attributes}}}|{{{1}}}]]: {{#invoke:dice/Format | diceStats | roll = {{{3|}}} | multiplier = {{{5|1}}} | extraafterroll = {{{6|0}}} | template = Dice_ceil_based_average_truncated}}{{#invoke:dice/Format | diceStats | roll = {{{3|}}} | multiplier = {{{5|1}}} | extraafterroll = {{{6|0}}} | template = Tooltip_dice_range_string_character_attributes}}</span> | }} }}</div></includeonly><noinclude> | ||
Outputs a single character attribute. Intended for use in [[Template:Character]]. | Outputs a single character attribute. Intended for use in [[Template:Character]]. | ||
The fourth parameter is the link for the tooltip. If not specified it will link to the [[Attributes]] page by default. | The fourth parameter is the link for the tooltip. If not specified it will link to the [[Attributes]] page by default. | ||
The fifth parameter is a multiplier for the stat (this is derived from the stat's "Bonus" attribute using a particular formula). If not specified, it defaults to 1. | |||
The sixth parameter is an additive value that represents extrinsic bonuses, such as the bonuses from mutations or armor. | |||
<syntaxhighlight lang="html">{{Character/Attribute | <syntaxhighlight lang="html">{{Character/Attribute | ||
Line 9: | Line 13: | ||
| 3 = 17+3d2 | | 3 = 17+3d2 | ||
| 4 = Attributes | | 4 = Attributes | ||
| 5 = 1.25 | |||
| 6 = 0 | |||
}}</syntaxhighlight> | }}</syntaxhighlight> | ||
Line 18: | Line 24: | ||
| 3 = 17+3d2 | | 3 = 17+3d2 | ||
| 4 = Attributes | | 4 = Attributes | ||
| 5 = 1.25 | |||
| 6 = 0 | |||
}} | }} | ||
</div> | </div> | ||
==Additional Notes== | |||
You can also specify <code>?</code> or <code>??</code> as a value for unknown stats, and this template will show that value in place of the stat. | |||
</noinclude> | </noinclude> |
Latest revision as of 15:51, 18 January 2024
Outputs a single character attribute. Intended for use in Template:Character.
The fourth parameter is the link for the tooltip. If not specified it will link to the Attributes page by default.
The fifth parameter is a multiplier for the stat (this is derived from the stat's "Bonus" attribute using a particular formula). If not specified, it defaults to 1.
The sixth parameter is an additive value that represents extrinsic bonuses, such as the bonuses from mutations or armor.
{{Character/Attribute
| 1 = Strength
| 2 = ST
| 3 = 17+3d2
| 4 = Attributes
| 5 = 1.25
| 6 = 0
}}
Additional Notes
You can also specify ?
or ??
as a value for unknown stats, and this template will show that value in place of the stat.