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.

End users may invoke this module through the wrapper templates:

  • {{Damage display}} - For the full feature set of the module
  • {{Damage inline}} - For an inline-only version with simplified syntax and features

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

ExampleMarkupRenders 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
1d6 + 5PiercingPiercing
+ 1d6FireFire
+ 2d8RadiantRadiant
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
1d10 + 6ForceForce
+ 1d10 + 6ForceForce
+ 1d10 + 6ForceForce
Unspecified weapon
{{#invoke: Damage display | main
| damage 1      = weapon
| damage 2      = 1d6
| damage 2 type = Necrotic
}}
Damage: 1~6
Normal weapon damage
+ 1d6NecroticNecrotic
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
1d6 + 4PiercingPiercing
+ 1d6NecroticNecrotic
Healing
{{#invoke: Damage display | main
| damage 1          = 1d6 + wis
| damage 1 type     = Healing

| wis = 19
}}
Healing: 5~10
1d6 + 4HealingHealing
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
1d12 + 2SlashingSlashing
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
2d4AcidAcid (Delayed)
+ 2d8RadiantRadiant (If the target is a Fiend or Undead)
+ 2d6FireFire (per ray)
+ 1d6PiercingPiercing (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)/2LightningLightning
+ 5 + 2 x (Cleric level)NecroticNecrotic
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
1d12ColdCold
+ 1d10LightningLightning
+ 2d8PsychicPsychic
+ 1d4ForceForce
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 + 2SlashingSlashing
+ 1d6PoisonPoison
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 + 2SlashingSlashing + 1d6PoisonPoison. 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
}}
1d12 + 2SlashingSlashing
+ 1d6PoisonPoison