Template:Resistance: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Cleanup & support "immune to non-magical and resistant to magical".)
(Change upper/lowercase usage.)
Line 1: Line 1:
<includeonly>{{trim|
<includeonly>{{trim|
{{#lvardef: element | {{ucfirst: {{lc: {{{1}}} }} }} }}
{{#lvardef: wording | {{#switch: {{lc: {{{2|}}} }}
{{#lvardef: wording | {{#switch: {{lc: {{{2|}}} }}
| vuln
| vuln
Line 8: Line 11:
| resist nm
| resist nm
| resistant nm
| resistant nm
| resistance nm = Resistant to non-magical
| resistance nm = Resistant to Non-Magical
| magical
| magical
| resist m
| resist m
| resistant m
| resistant m
| resistance m = Resistant to magical
| resistance m = Resistant to Magical
| double
| double
| full
| full
Line 24: Line 27:
| immune = Immune to all
| immune = Immune to all
| immunity nm
| immunity nm
| immune nm = Immune to non-magical
| immune nm = Immune to Non-Magical
| immunity nm plus
| immunity nm plus
| immune nm plus = Immune to non-magical and resistant to magical
| immune nm plus = Immune to Non-Magical and Resistant to Magical
}} {{{1}}} }}
}} {{#lvar:element}} }}
{{#lvardef: filename | {{{1}}} {{#switch: {{lc: {{{2|}}} }}
 
{{#lvardef: filename | {{#lvar:element}} {{#switch: {{lc: {{{2|}}} }}
| vuln
| vuln
| vulnerable
| vulnerable
Line 57: Line 61:
| immunity nm plus = Immunity NM Plus
| immunity nm plus = Immunity NM Plus
}}.png }}
}}.png }}
}}[[File:{{#lvar:filename}}|link=|{{{3|28px}}}|{{#lvar:wording}}]]{{#if:{{{nocat|}}}||{{Main only|[[Category:{{#lvar:wording}}]]}}}}</includeonly><noinclude>[[Category:Templates]]
}}[[File:{{#lvar:filename}}|link=|{{{3|28px}}}|{{#lvar:wording}}]]{{#if:{{{nocat|}}}||{{Main only|[[Category:{{#lvar:wording}}]]}}}}</includeonly><noinclude>[[Category:Templates]]
Example:
Example:


<pre>
<pre>
{{Resistance|Acid|vuln}}
{{resistance|acid|vuln}}
{{Resistance|Cold|resist nm}}
{{resistance|cold|resist nm}}
{{Resistance|Fire|resist m}}
{{resistance|fire|resist m}}
{{Resistance|Force|resist full}}
{{resistance|force|resist full}}
{{Resistance|Thunder|immune}}
{{resistance|thunder|immune}}
{{Resistance|Piercing|immune nm}}
{{resistance|piercing|immune nm}}
{{Resistance|Slashing|immune nm plus}}
{{resistance|slashing|immune nm plus}}
</pre>
</pre>


{{Resistance|Acid|vuln}}
{{resistance|acid|vuln}}
{{Resistance|Cold|resist nm}}
{{resistance|cold|resist nm}}
{{Resistance|Fire|resist m}}
{{resistance|fire|resist m}}
{{Resistance|Force|resist full}}
{{resistance|force|resist full}}
{{Resistance|Thunder|immune}}
{{resistance|thunder|immune}}
{{Resistance|Piercing|immunity nm}}
{{resistance|piercing|immunity nm}}
{{Resistance|Slashing|immune nm plus}}
{{resistance|slashing|immune nm plus}}


Here are the "keys" for the resistance/vulnerability/immunity type:
Here are the "keys" for the resistance/vulnerability/immunity type:
Line 92: Line 97:
You can also make the icon bigger like so:
You can also make the icon bigger like so:


{{InfoBlob|<nowiki>{{Resistance|Acid|immune|40px}}</nowiki>}}
{{InfoBlob|<nowiki>{{resistance|acid|immune|40px}}</nowiki>}}


Result:
Result:


{{Resistance|Acid|immune|40px}}
{{resistance|acid|immune|40px}}


== Template data ==
== Template data ==
Line 113: Line 118:
"type": "string",
"type": "string",
"suggestedvalues": [
"suggestedvalues": [
"immune",
"vuln",
"magic",
"resist nm",
"vulnerable",
"resist m",
"resistant"
"resist full",
"immune nm",
"immune full",
"immune nm plus"
],
],
"required": true
"required": true

Revision as of 19:01, 16 June 2024

Example:

{{resistance|acid|vuln}}
{{resistance|cold|resist nm}}
{{resistance|fire|resist m}}
{{resistance|force|resist full}}
{{resistance|thunder|immune}}
{{resistance|piercing|immune nm}}
{{resistance|slashing|immune nm plus}}

Vulnerable to Acid Resistant to Non-Magical Cold Resistant to Magical Fire Resistant to all Force Immune to all Thunder Immune to Non-Magical Piercing Immune to Non-Magical and Resistant to Magical Slashing

Here are the "keys" for the resistance/vulnerability/immunity type:

  • vuln: Self-explanatory
  • resist nm: Resistant to non-magical
  • resist m: Resistant to magical only
  • resist full: Resistant to all (non-magical and magical)
  • immune nm: Immune to non-magical
  • immune full: Immune to all (non-magical and magical)
  • immune nm plus: Immune to non-magical and resistant to magical

The abbreviations "vuln", "resist", and "immune" can be written out in full as well, like "vulnerable", "vulnerability", "resistant", "resistance", or "immunity". The template will recognize all ways to write these words.

You can also make the icon bigger like so:

{{resistance|acid|immune|40px}}

Result:

Immune to all Acid

Template data

No description.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
type1

The damage type

Stringrequired
resistance2

How resistant?

Suggested values
vuln resist nm resist m resist full immune nm immune full immune nm plus
Stringrequired
size3

Size of the icon.

Default
28
Numberoptional
nocatnocat

If specified, does not insert categories.

Unknownoptional