Module:Damage display/doc

From bg3.wiki
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
format Format of the damage display, either list (default), nosummary to hide the header, or inline for a compact inline display.
damage n The damage string in the simple format

ExprTerm + Expr | Term
TermDice | Integer | Modifier
DiceInteger "d" Integer
ModifierAbility "mod" | Ability "modifier" | Ability | "prof" | "proficiency bonus"
Ability → "strength" | "str" | "dexterity" | "dex" | "constitution" | "con"
    | "wisdom" | "wis" | "intelligence" | "int" | "charisma" | "cha"
    | "spellcasting" | "caster" | "spell" | "melee" | "ranged" | "finesse"

Example: 2d8 + 1d6 + 4 + cha modifier + strength mod

damage n type 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).
damage n info Free-form field for adding additional information about a damage instance. For example, "per ray" for Scorching Ray damage, "if the target is a Fiend or Undead" for extra Divine Smite damage, or "delayed" for Melf's Acid Arrow damage.
damage n modifier

Deprecated - Add the damage modifier as part of the damage value.

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.

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 + finesse mod
| damage 1 type = Piercing
| damage 2      = 1d6
| damage 2 type = Fire
}}
Damage: 4~14 + modifiers
Specified ability scores
{{#invoke: Damage display | main
| damage 1      = 1d6 + 2 + finesse mod
| damage 1 type = Piercing
| damage 2      = 1d6
| damage 2 type = Fire
| damage 3      = 2d8
| damage 3 type = Radiant

| str = 9
| dex = 17
}}
Damage: 9~33
D6 Piercing.pngD6 Fire.pngD8 Radiant.png
1d6 + 5Damage TypesPiercing
+ 1d6Damage TypesFire
+ 2d8Damage TypesRadiant
Specified casting ability
{{#invoke: Damage display | main
| damage 1      = 1d10 + spell + spell
| damage 1 type = Force
| damage 2      = 1d10 + spell + spell
| damage 2 type = Force
| damage 3      = 1d10 + spell + spell
| damage 3 type = Force

| wis = 10
| int = 8
| cha = 17
| casting ability = cha
}}
Damage: 21~48
D10 Force.pngD10 Force.pngD10 Force.png
1d10 + 6Damage TypesForce
+ 1d10 + 6Damage TypesForce
+ 1d10 + 6Damage TypesForce
Unspecified weapon
{{#invoke: Damage display | main
| damage 1      = weapon
| damage 2      = 1d6
| damage 2 type = Necrotic
}}
Damage: 1~6
D6 Necrotic.png
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 + modifiers
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
D6 Piercing.pngD6 Necrotic.png
1d6 + 4Damage TypesPiercing
+ 1d6Damage TypesNecrotic
Healing
{{#invoke: Damage display | main
| damage 1          = 1d6 + wis
| damage 1 type     = Healing

| wis = 19
}}
Healing: 5~10
D6 Healing.png
1d6 + 4Healing
Proficiency bonus
{{#invoke: Damage display | main
| damage 1      = 1d12 + 2
| damage 1 type = Slashing
| damage 2      = prof
| damage 2 type = Radiant
}}
Damage: 3~14 + modifiers
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
D12 Slashing.png
1d12 + 2Damage TypesSlashing
Info field
{{#invoke: Damage display | main
| damage 1      = 2d4
| damage 1 type = Acid
| damage 1 info = Delayed
| damage 2      = 2d8
| damage 2 type = Radiant
| damage 2 info = If the target is a Fiend or Undead
| damage 3      = 2d6
| damage 3 type = Fire
| damage 3 info = per ray
| damage 4      = 1d6
| damage 4 type = Piercing
| damage 4 info = to self
}}
Damage: 7~42
D4 Acid.pngD8 Radiant.pngD6 Fire.pngD6 Piercing.png
2d4Damage TypesAcid (Delayed)
+ 2d8Damage TypesRadiant (If the target is a Fiend or Undead)
+ 2d6Damage TypesFire (per ray)
+ 1d6Damage TypesPiercing (to self)
Freeform damage input
{{#invoke: Damage display | main
| damage 1      = (Sorcerer level)/2
| damage 1 type = Lightning
| damage 2      = 5 + 2 x (Cleric level)
| damage 2 type = Necrotic
}}
Damage: 5 + modifiers
(Sorcerer level)/2Damage TypesLightning
+ 5 + 2 x (Cleric level)Damage 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
D12 Cold.pngD10 Lightning.pngD8 Psychic.pngD4 Force.pngD6 Bludgeoning.png
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
Inline output
This format can be used inline: {{#invoke: Damage display | main
| format = inline
| damage 1      = 1d12 + 2
| damage 1 type = Slashing
| damage 2      = 1d6
| damage 2 type = Poison
}}. It is simple and compact.

This format can be used inline: 1d12 + 2Damage TypesSlashing + 1d6Damage TypesPoison. It is simple and compact.

No summary
{{#invoke: Damage display | main
| format = nosummary
| damage 1      = 1d12 + 2
| damage 1 type = Slashing
| damage 2      = 1d6
| damage 2 type = Poison
}}
D12 Slashing.pngD6 Poison.png
1d12 + 2Damage TypesSlashing
+ 1d6Damage TypesPoison