Template:DamageModifier: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<includeonly>{{#switch:{{{1|}}}
<includeonly>{{#switch: {{trim | {{{1|}}} }}
| melee = + [[Damage Roll#Modifiers|Strength Modifier]]
| melee = + [[Damage Roll#Modifiers|Strength modifier]]
| ranged = + [[Damage Roll#Modifiers|Dexterity Modifier]]
| ranged = + [[Damage Roll#Modifiers|Dexterity modifier]]
| finesse = + [[Damage Roll#Modifiers|Strength or Dexterity Modifier]]
| finesse = + [[Damage Roll#Modifiers|Strength or Dexterity modifier]]
| {{#if:{{{1|}}}|+ {{{1}}}|}}
| spell | spellcasting = + [[Spellcasting modifier|spellcasting modifier]]
| {{#if: {{{1|}}} | + [[ability score modifier|{{{1}}} modifier]] | }}
}}</includeonly><noinclude>
}}</includeonly><noinclude>
The keywords melee, ranged, and finesse can be used to print the corresponding modifier(s) with a link to the Damage Roll page that explains the details:
Usage: {{code|<nowiki>{{DamageModifier|melee}}</nowiki>}}
Usage: {{code|<nowiki>{{DamageModifier|melee}}</nowiki>}}


Line 17: Line 20:
Result: {{DamageModifier|finesse}}
Result: {{DamageModifier|finesse}}


Anything that's not one of the specially recognized keywords will be used verbatim:
The keyword spell can be used to link to [[spellcasting modifier|spellcasting modifier]]:


Usage: {{code|<nowiki>{{DamageModifier|[[Wisdom Modifier]]}}</nowiki>}}
Usage: {{code|<nowiki>{{DamageModifier|spell}}</nowiki>}}


Result: {{DamageModifier|[[Wisdom Modifier]]}}
Result: {{DamageModifier|spell}}
 
Anything that's not one of the specially recognized keywords will just have the word "Modifier" appended and link to [[ability score modifier|ability score modifier]]:
 
Usage: {{code|<nowiki>{{DamageModifier|Wisdom}}</nowiki>}}
 
Result: {{DamageModifier|Wisdom}}


If the parameter is completely empty however, then nothing will be printed:
If the parameter is completely empty however, then nothing will be printed:
Line 30: Line 39:


(That makes it easier to use in other templates, where a modifier might be optional.)
(That makes it easier to use in other templates, where a modifier might be optional.)
[[Category:Damage info templates]]
</noinclude>
</noinclude>

Latest revision as of 11:08, 28 October 2023

The keywords melee, ranged, and finesse can be used to print the corresponding modifier(s) with a link to the Damage Roll page that explains the details:

Usage: {{DamageModifier|melee}}

Result: + Strength modifier

Usage: {{DamageModifier|ranged}}

Result: + Dexterity modifier

Usage: {{DamageModifier|finesse}}

Result: + Strength or Dexterity modifier

The keyword spell can be used to link to spellcasting modifier:

Usage: {{DamageModifier|spell}}

Result: + spellcasting modifier

Anything that's not one of the specially recognized keywords will just have the word "Modifier" appended and link to ability score modifier:

Usage: {{DamageModifier|Wisdom}}

Result: + Wisdom modifier

If the parameter is completely empty however, then nothing will be printed:

Usage: {{DamageModifier|}}

Result:

(That makes it easier to use in other templates, where a modifier might be optional.)