For example, "2d8 + 1d6 + 4". The "prof" term is a special value for [[Proficiency bonus]] that is occasionally used.
|-
| {{c|damage}} ''n'' {{c|type}}
| The type of the damage which may be any of the [[Damage#Damage_types|damage types]] in the game or one of the special values: {{c|weapon}} (for damage type that is inherited from the weapon), {{c|Physical}} (for an unspecified physical damage type), or {{c|Healing}} (for healing which is displayed separately from damage).
|-
| {{c|damage}} ''n'' {{c|modifier}}
| The modifier added to the damage. It may be a specific ability score such as {{c|Strength}} or {{c|Charisma}} or it may be a special value such as {{c|melee}}, {{c|ranged}}, {{c|finesse}}, or {{c|spell}}.
|-
| {{c|damage}} ''n'' {{c|save}}
| The saving throw used to avoid or reduce this damage if applicable.
|-
| {{c|damage}} ''n'' {{c|save dc}}
| The DC of the saving throw for this damage instance.
|-
| {{c|damage}} ''n'' {{c|save effect}}
| The effect of a successful saving throw on this damage. Values can be {{c|negate}} or {{c|halve}}.
|-
| {{c|damage}} ''n'' {{c|per}}
| Specify if the damage is dealt repeatedly for example per turn or per distance moved.
|-
| {{c|damage}} ''n'' {{c|conditional}}
| Specify that this damage requires some special conditions to apply.
|-
| {{c|damage}} ''n'' {{c|delayed}}
| Specify that this damage is delayed rather than applying immediately.
|-
| {{c|damage}} ''n'' {{c|self}}
| Specify if this damage is dealt to the user rather than the target.
|-
| {{c|str}} || Strength ability score used for evaluating modifiers
|-
| {{c|dex}} || Dexterity ability score used for evaluating modifiers
|-
| {{c|con}} || Constitution ability score used for evaluating modifiers
|-
| {{c|int}} || Intelligence ability score used for evaluating modifiers
|-
| {{c|wis}} || Wisdom ability score used for evaluating modifiers
|-
| {{c|cha}} || Charisma ability score used for evaluating modifiers
|-
| {{c|casting ability}} || The ability score used for casting. Determines how to evaluate the {{c|spell}} special modifier value.
|-
| {{c|weapon}} || Specify the weapon used in order to evaluate generic "Normal weapon damage" values.
|-
| {{c|dice size}} || Specify the size of the dice images. Setting it to 0 removes them entirely.
|-
| {{c|level}} || Specify the level which is needed to evaluate "Proficiency bonus" damage modifiers.
|}
== Examples ==
== Examples ==
Line 78:
Line 139:
}}
}}
</nowiki>
</nowiki>
| caption 7 = Big dice
| <nowiki>
{{#invoke: Damage display | main
| damage 1 = 1d12
| damage 1 type = Cold
| damage 2 = 1d10
| damage 2 type = Lightning
| damage 3 = 2d8
| damage 3 type = Psychic
| damage 4 = 1d4
| damage 4 type = Force
| damage 5 = 2d6
| damage 5 type = Bludgeoning
| dice size = 45
}}
</nowiki>
| caption 8 = No dice
| <nowiki>
{{#invoke: Damage display | main
| damage 1 = 1d12 + 2
| damage 1 type = Slashing
| damage 2 = 1d6
| damage 2 type = Poison
| dice size = 0
}}
}}
== Parameters ==
</nowiki>
{| class="wikitable"
| caption 9 = Proficiency bonus
! parameter !! meaning
| <nowiki>
|-
{{#invoke: Damage display | main
| {{c|damage}} ''n''
| damage 1 = 1d12 + 2
| The damage string in the simple format
| damage 1 type = Slashing
''Expr'' → ''Term'' + ''Expr'' {{!}} ''Term''<br>
| damage 2 = prof
''Term'' → ''Dice'' {{!}} ''Integer''<br>
| damage 2 type = Radiant
''Dice'' → ''Integer'' d ''Integer''
}}
</nowiki>
| caption 10 = Proficiency bonus w/ level
| <nowiki>
{{#invoke: Damage display | main
| damage 1 = 1d12 + 2
| damage 1 type = Slashing
| damage 2 = prof
| damage 2 type = Radiant
| level = 8
}}
</nowiki>
| caption 11 = Saving throw
| <nowiki>
{{#invoke: Damage display | main
| damage 1 = 8d6
| damage 1 type = Fire
| damage 1 save = dex
| damage 1 save dc = 16
| damage 1 save effect = halve
}}
</nowiki>
| caption 12 = Miscellaneous properties
| <nowiki>
{{#invoke: Damage display | main
| damage 1 = 1d6
| damage 1 type = Fire
| damage 1 per = turn
| damage 2 = 2d4
| damage 2 type = Acid
| damage 2 delayed = yes
| damage 3 = 1d6
| damage 3 type = Piercing
| damage 3 self = yes
| damage 4 = 1d10
| damage 4 type = Poison
| damage 4 conditional = yes
}}
</nowiki>
| caption 13 = Healing
| <nowiki>
{{#invoke: Damage display | main
| damage 1 = 1d6
| damage 1 type = Healing
| damage 1 modifier = Wisdom
For example "2d8 + 1d6 + 4".
| wis = 19
|-
}}
| {{c|damage}} ''n'' {{c|type}}
</nowiki>
| The type of the damage which may be any of the [[Damage#Damage_types|damage types]] in the game. Also accepts a special {{c|weapon}} value which means the type of the damage is inherited from the weapon.
}}
|-
| {{c|damage}} ''n'' {{c|modifier}}
| The modifier added to the damage. It may be a specific ability score such as {{c|str}} or {{c|cha}} or it may be a special value such as {{c|melee}}, {{c|ranged}}, {{c|finesse}}, or {{c|spell}}.
|-
| {{c|str}} || Strength ability score used for evaluating modifiers
|-
| {{c|dex}} || Dexterity ability score used for evaluating modifiers
|-
| {{c|con}} || Constitution ability score used for evaluating modifiers
|-
| {{c|int}} || Intelligence ability score used for evaluating modifiers
|-
| {{c|wis}} || Wisdom ability score used for evaluating modifiers
|-
| {{c|cha}} || Charisma ability score used for evaluating modifiers
|-
| {{c|casting ability}} || The ability score used for casting. Determines how to evaluate the {{c|spell}} special modifier value.
|}
Latest revision as of 00:45, 29 January 2025
Example of an in-game tooltip this module aims to replicate.
This module renders damage information in a format designed to replicate the in-game view.
Parameters
Parameter
Meaning
damagen
The damage string in the simple format
Expr → Term + Expr | Term Term → Dice | Integer | "prof" Dice → Integer "d" Integer
For example, "2d8 + 1d6 + 4". The "prof" term is a special value for Proficiency bonus that is occasionally used.
damagentype
The type of the damage which may be any of the damage types in the game or one of the special values: weapon (for damage type that is inherited from the weapon), Physical (for an unspecified physical damage type), or Healing (for healing which is displayed separately from damage).
damagenmodifier
The modifier added to the damage. It may be a specific ability score such as Strength or Charisma or it may be a special value such as melee, ranged, finesse, or spell.
damagensave
The saving throw used to avoid or reduce this damage if applicable.
damagensave dc
The DC of the saving throw for this damage instance.
damagensave effect
The effect of a successful saving throw on this damage. Values can be negate or halve.
damagenper
Specify if the damage is dealt repeatedly for example per turn or per distance moved.
damagenconditional
Specify that this damage requires some special conditions to apply.
damagendelayed
Specify that this damage is delayed rather than applying immediately.
damagenself
Specify if this damage is dealt to the user rather than the target.
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.
weapon
Specify the weapon used in order to evaluate generic "Normal weapon damage" values.
dice size
Specify the size of the dice images. Setting it to 0 removes them entirely.
level
Specify the level which is needed to evaluate "Proficiency bonus" damage modifiers.
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
}}