Module:Damage display/doc

From bg3.wiki
Revision as of 22:14, 28 January 2025 by NtCarlson (talk | contribs) (Added support for save effect)
Jump to navigation Jump to search

This is the documentation page for Module:Damage display

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
damage n The damage string in the simple format

ExprTerm + Expr | Term
TermDice | Integer | "prof"
DiceInteger "d" Integer

For example, "2d8 + 1d6 + 4". The "prof" term is a special value for Proficiency bonus that is occasionally used.

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.
damage n save The saving throw used to avoid or reduce this damage if applicable.
damage n save dc The DC of the saving throw for this damage instance.
damage n save effect The effect of a successful saving throw on this damage. Values can be negate or halve.
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
}}
Damage: 4~14
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
1d6 + 5Damage TypesPiercing
+ 1d6Damage TypesFire
+ 2d8Damage TypesRadiant
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
1d10 + 3Damage TypesForce
+ 1d10 + 3Damage TypesForce
+ 1d10 + 3Damage TypesForce
Unspecified weapon
{{#invoke: Damage display | main
| damage 1          = weapon
| damage 2          = 1d6
| damage 2 type     = Necrotic
}}
Damage: 1~6
Normal weapon damage
+ 1d6Damage TypesNecrotic
Specified weapon
{{#invoke: Damage display | main
| damage 1          = weapon
| damage 2          = 1d6
| damage 2 type     = Necrotic

| weapon = Spear +1 
}}
Damage: 3~13
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
1d6 + 4Damage TypesPiercing
+ 1d6Damage TypesNecrotic
Big dice
{{#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
}}
Damage: 7~54
1d12Damage TypesCold
+ 1d10Damage TypesLightning
+ 2d8Damage TypesPsychic
+ 1d4Damage TypesForce
No dice
{{#invoke: Damage display | main
| damage 1          = 1d12 + 2
| damage 1 type     = Slashing
| damage 2          = 1d6
| damage 2 type     = Poison

| dice size = 0
}}
Damage: 4~20
1d12 + 2Damage TypesSlashing
+ 1d6Damage TypesPoison
Proficiency bonus
{{#invoke: Damage display | main
| damage 1          = 1d12 + 2
| damage 1 type     = Slashing
| damage 2          = prof
| damage 2 type     = Radiant
}}
Damage: 3~14
Proficiency bonus w/ level
{{#invoke: Damage display | main
| damage 1          = 1d12 + 2
| damage 1 type     = Slashing
| damage 2          = prof
| damage 2 type     = Radiant

| level = 8
}}
Damage: 6~17
1d12 + 2Damage TypesSlashing
Saving throw
{{#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
}}
Damage: 8~48
8d6Damage TypesFire (DC 16  Dexterity saving throw to halve)