Module:Damage display/doc: Difference between revisions
Jump to navigation
Jump to search
Created page with "This module renders damage information in a format designed to replicate the in-game view. == Examples == {{Template demo | style = table | <nowiki> {{#invoke: Damage display | main | damage 1 = 1d6 + 2 | damage 1 type = Piercing | damage 1 modifier = finesse | damage 2 = 1d6 | damage 2 type = Fire }} </nowiki> | <nowiki> {{#invoke: Damage display | main | damage 1 = 1d6 + 2 | damage 1 type = Piercing | damage 1 modifier = finesse..." |
Added more examples |
||
Line 4: | Line 4: | ||
{{Template demo | {{Template demo | ||
| style = table | | style = table | ||
| caption 1 = Unspecified ability scores | |||
| <nowiki> | | <nowiki> | ||
{{#invoke: Damage display | main | {{#invoke: Damage display | main | ||
Line 13: | Line 14: | ||
}} | }} | ||
</nowiki> | </nowiki> | ||
| caption 2 = Specified ability scores | |||
| <nowiki> | | <nowiki> | ||
{{#invoke: Damage display | main | {{#invoke: Damage display | main | ||
Line 27: | Line 29: | ||
}} | }} | ||
</nowiki> | </nowiki> | ||
| caption 3 = Specified casting ability | |||
| <nowiki> | | <nowiki> | ||
{{#invoke: Damage display | main | {{#invoke: Damage display | main | ||
Line 43: | Line 46: | ||
| cha = 17 | | cha = 17 | ||
| casting ability = cha | | casting ability = cha | ||
}} | |||
</nowiki> | |||
| caption 4 = Unspecified weapon | |||
| <nowiki> | |||
{{#invoke: Damage display | main | |||
| damage 1 = weapon | |||
| damage 2 = 1d6 | |||
| damage 2 type = Necrotic | |||
}} | |||
</nowiki> | |||
| caption 5 = Specified weapon | |||
| <nowiki> | |||
{{#invoke: Damage display | main | |||
| damage 1 = weapon | |||
| damage 2 = 1d6 | |||
| damage 2 type = Necrotic | |||
| weapon = Spear +1 | |||
}} | |||
</nowiki> | |||
| caption 6 = Specified weapon and abilities | |||
| <nowiki> | |||
{{#invoke: Damage display | main | |||
| damage 1 = weapon | |||
| damage 2 = 1d6 | |||
| damage 2 type = Necrotic | |||
| weapon = Spear +1 | |||
| str = 17 | |||
| dex = 12 | |||
}} | }} | ||
</nowiki> | </nowiki> |
Revision as of 19:40, 28 January 2025
This module renders damage information in a format designed to replicate the in-game view.
Examples
Example | Markup | Renders as |
---|---|---|
Unspecified ability scores | {{#invoke: Damage display | main | damage 1 = 1d6 + 2 | damage 1 type = Piercing | damage 1 modifier = finesse | damage 2 = 1d6 | damage 2 type = Fire }} |
Damage: 4~14![]() ![]() 1d6 + 2 + Strength or Dexterity modifierPiercing + 1d6Fire |
Specified ability scores | {{#invoke: Damage display | main | damage 1 = 1d6 + 2 | damage 1 type = Piercing | damage 1 modifier = finesse | damage 2 = 1d6 | damage 2 type = Fire | damage 3 = 2d8 | damage 3 type = Radiant | str = 9 | dex = 17 }} | Damage: 9~33 |
Specified casting ability | {{#invoke: Damage display | main | damage 1 = 1d10 | damage 1 type = Force | damage 1 modifier = spell | damage 2 = 1d10 | damage 2 type = Force | damage 2 modifier = spell | damage 3 = 1d10 | damage 3 type = Force | damage 3 modifier = spell | wis = 10 | int = 8 | cha = 17 | casting ability = cha }} | Damage: 12~39 |
Unspecified weapon | {{#invoke: Damage display | main | damage 1 = weapon | damage 2 = 1d6 | damage 2 type = Necrotic }} |
Damage: 1~6![]() Normal weapon damage + 1d6Necrotic |
Specified weapon | {{#invoke: Damage display | main | damage 1 = weapon | damage 2 = 1d6 | damage 2 type = Necrotic | weapon = Spear +1 }} |
Damage: 3~13![]() ![]() 1d6 + 1 + Strength or Dexterity modifierPiercing + 1d6Necrotic |
Specified weapon and abilities | {{#invoke: Damage display | main | damage 1 = weapon | damage 2 = 1d6 | damage 2 type = Necrotic | weapon = Spear +1 | str = 17 | dex = 12 }} | Damage: 6~16 |
Parameters
parameter | meaning |
---|---|
damage n
|
The damage string in the simple format
Expr → Term + Expr | Term For example "2d8 + 1d6 + 4". |
damage n type
|
The type of the damage which may be any of the damage types in the game. Also accepts a special weapon value which means the type of the damage is inherited from the weapon.
|
damage n modifier
|
The modifier added to the damage. It may be a specific ability score such as str or cha or it may be a special value such as melee , ranged , finesse , or spell .
|
str |
Strength ability score used for evaluating modifiers |
dex |
Dexterity ability score used for evaluating modifiers |
con |
Constitution ability score used for evaluating modifiers |
int |
Intelligence ability score used for evaluating modifiers |
wis |
Wisdom ability score used for evaluating modifiers |
cha |
Charisma ability score used for evaluating modifiers |
casting ability |
The ability score used for casting. Determines how to evaluate the spell special modifier value.
|