Template:Resistance: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
(Add even more possible terms.)
No edit summary
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{trim|
<includeonly>{{trim|
{{#lvardef: degree | {{#switch: {{{2|}}}
 
{{#lvardef: element | {{ucfirst: {{lc: {{{1}}} }} }} }}
 
{{#lvardef: wording | {{#switch: {{lc: {{{2|}}} }}
| vuln
| vulnerable
| vulnerability = Vulnerable to
| resist
| resistant
| resist nm
| resistant nm
| resistance nm = Resistant to Non-Magical
| magical
| magical
| Magical
| resist m
| resistant m
| resistance m = Resistant to Magical
| double
| double
| Double
| full
| resistant
| resist double
| Resistant = Resistant
| resist full
| vulnerable
| resistant double
| Vulnerable = Vulnerable
| resistance double
| resistant full
| resistance full = Resistant to all
| immunity
| immunity
| immune
| immune
| Immunity
| immunity full
| Immune = Immune
| immune full = Immune to all
}} }}
| immunity nm
{{#lvardef: filename | {{{1}}} {{#switch: {{{2|}}}
| immune nm = Immune to Non-Magical
| immunity nm plus
| immune nm plus = Immune to Non-Magical and Resistant to Magical
}} {{#lvar:element}} }}
 
{{#lvardef: filename | {{#lvar:element}} {{#switch: {{lc: {{{2|}}} }}
| vuln
| vulnerable
| vulnerable
| Vulnerable = Vulnerability
| vulnerability = Vulnerability
| resist
| resistant
| resistant
| Resistant
| resistance
| resist nm
| resistant nm
| resistant nm
| Resistant NM
| resistance nm = Resistance NM
| resistance nm
| Resistance NM = Resistance NM
| magical
| magical
| Magical
| resist m
| resistant m
| resistant m
| Resistant M
| resistance m = Resistance M
| resistance m
| Resistance M = Resistance M
| double
| double
| Double
| full
| resist double
| resistant double
| resistance double
| resist full
| resistant full
| resistant full
| Resistant Full
| resistance full = Resistance Full
| resistance full
| Resistance Full = Resistance Full
| immunity
| Immunity
| immune
| immune
| Immune = Immunity
| immunity = Immunity
| immunity nm
| Immunity NM
| immune nm
| immune nm
| Immune NM = Immunity NM
| immunity nm = Immunity NM
| immune nm plus
| immunity nm plus = Immunity NM Plus
}}.png }}
}}.png }}
}}<span style="display: inline-block;" aria-label="{{#lvar:degree}} to {{{1}}}">[[File:{{#lvar:filename}}|{{{3|28px}}}|link=Resistances]]</span>{{#if:{{{nocat|}}}||{{Main only|[[Category:{{#lvar:degree}} to {{{1}}}]]}}}}</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|Psychic|resistant}}
{{resistance|acid|vuln}}
{{Resistance|Fire|double}}
{{resistance|cold|resist nm}}
{{Resistance|Magic|magical}}
{{resistance|fire|resist m}}
{{Resistance|Thunder|immune}}
{{resistance|force|resist full}}
{{Resistance|Radiant|vulnerable}}
{{resistance|thunder|immune}}
{{Resistance|Slashing|immune nm}}
{{resistance|piercing|immune nm}}
{{resistance|slashing|immune nm plus}}
</pre>
</pre>


{{Resistance|Psychic|resistant}}
{{resistance|acid|vuln}}
{{Resistance|Fire|double}}
{{resistance|cold|resist nm}}
{{Resistance|Magic|magical}}
{{resistance|fire|resist m}}
{{Resistance|Thunder|immune}}
{{resistance|force|resist full}}
{{Resistance|Radiant|vulnerable}}
{{resistance|thunder|immune}}
{{Resistance|Slashing|immune nm}}
{{resistance|piercing|immunity nm}}
{{resistance|slashing|immune nm plus}}
 
Here are the "keys" for the resistance/vulnerability/immunity type:
 
* <code>vuln</code>: Self-explanatory
* <code>resist nm</code>: Resistant to non-magical
* <code>resist m</code>: Resistant to magical only
* <code>resist full</code>: Resistant to all (non-magical and magical)
* <code>immune nm</code>: Immune to non-magical
* <code>immune full</code>: Immune to all (non-magical and magical)
* <code>immune nm plus</code>: 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:
 
{{InfoBlob|<nowiki>{{resistance|acid|immune|40px}}</nowiki>}}
 
Result:
 
{{resistance|acid|immune|40px}}


You can also use {{InfoBlob|<nowiki>{{Resistance|Acid|immune|40px}}</nowiki>}} to make it bigger {{Resistance|Acid|immune|40px}}
This template also adds automatic [[:Category:Resistances|resistance categories]]. If you are using this template on a non-creature page, please add {{InfoBlob|<nowiki>|nocat=1</nowiki>}} so that page doesn't get included in the respective resistance category.


== Template data ==
== Template data ==
Line 80: Line 122:
"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

Latest revision as of 08:55, 22 December 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

This template also adds automatic resistance categories. If you are using this template on a non-creature page, please add |nocat=1 so that page doesn't get included in the respective resistance category.

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