Template:Rarity: Difference between revisions

From Baldur's Gate 3 Wiki
Jump to navigation Jump to search
(Support for honour specific rarity values)
(simplify, removing backwards compat)
Line 1: Line 1:
<includeonly>{{SmallIcon|Rarity Icon.png|class=bg3wiki-lightmode-drop-shadow}}<!--
<includeonly>{{SmallIcon|Rarity Icon.png|class=bg3wiki-lightmode-drop-shadow}}Rarity: {{#switch: {{{1|}}}
To maintain compatibility with existing templates, the honour mode specific value can be
either specified as the second argument or in the first argument separated by :
-->{{#lvardef:base|{{ #explode: {{{1}}}|:|0}}}}<!--
Split parameter into base rarity and honour rarity on the :
-->{{#lvardef:honour|{{ #explode: {{{1}}}|:|1}}}}<!--
-->Rarity: {{#switch: {{#lvar: base|common}}
| <!-- accept empty value for "common", for ease of use from other templates -->
| <!-- accept empty value for "common", for ease of use from other templates -->
| common = Common
| common = Common
Line 13: Line 7:
| legendary = {{Legendary}}
| legendary = {{Legendary}}
| story = {{Story}}
| story = {{Story}}
}} {{#if: {{{2|{{#lvar: honour}}}}}
}} {{#if: {{{2|}}}
| / {{#switch: {{{2|{{#lvar: honour}}}}}
| / {{#switch: {{{2}}}
| common = Common
| common = Common
| uncommon = {{Uncommon}}
| uncommon = {{Uncommon}}
Line 53: Line 47:


Result: {{rarity|uncommon|rare}}
Result: {{rarity|uncommon|rare}}
Usage: {{code|<nowiki>{{rarity|uncommon:very rare}}</nowiki>}}
Result: {{rarity|uncommon:very rare}}


[[Category:Weapon Property Templates]]
[[Category:Weapon Property Templates]]
</noinclude>
</noinclude>

Revision as of 13:47, 4 December 2023

Usage: {{rarity|}}

Result: Rarity: Common

Usage: {{rarity|common}}

Result: Rarity: Common

Usage: {{rarity|uncommon}}

Result: Rarity: Uncommon

Usage: {{rarity|rare}}

Result: Rarity: Rare

Usage: {{rarity|very rare}}

Result: Rarity: Very Rare

Usage: {{rarity|legendary}}

Result: Rarity: Legendary

Usage: {{rarity|story}}

Result: Rarity: Story Item

Usage: {{rarity|uncommon|rare}}

Result: Rarity: Uncommon / RareHHonour