Template:Damage text: Difference between revisions

From bg3.wiki
Jump to navigation Jump to search
m (update to support healing)
(Use documentation and template demo templates)
 
(18 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<includeonly><span style="white-space: nowrap;">{{DamageColor | {{{2}}} |'''{{{1}}}{{#ifeq: {{{2}}} | Physical | &nbsp; | {{DamageIcon|{{{2}}}}} }}{{#ifeq: {{{2}}} | Healing | {{DamageColor | {{{2}}} |Hit Points}} | [[Damage Types|{{DamageColor | {{{2}}} |{{{2}}}}}]]'''}}}}</span></includeonly><noinclude>
<includeonly><span style="white-space: nowrap;">{{Damage colour | {{{2}}} |{{{1}}}{{Damage icon|{{{2}}}}}{{#ifeq: {{{2}}} | Healing | {{Damage colour | {{{2}}} |hit points}} | {{Damage colour | {{{2}}} |{{{2}}}}}}}}}{{#if:{{{drs|}}}|{{DRS}}}}</span></includeonly><noinclude>{{Documentation|content=
Usage: {{code|Blah blah deals <nowiki>{{DamageText|2d6|Fire}}</nowiki> damage.}}
This template inserts formatted damage text.


Result: Blah blah deals {{DamageText|2d6|Fire}} damage.
=== Basic usage ===
----
{{Template demo
Usage: {{code|Blah blah deals <nowiki>{{DamageText|2d6|Physical}}</nowiki> damage.}}
| style = table
| <nowiki>Blah blah deals {{DamageText|2d6|Fire}} damage.</nowiki>
| <nowiki>Blah blah deals {{DamageText|2d6|Physical}} damage.</nowiki>
| <nowiki>Blah blah heals {{DamageText|2d4+2|Healing}}.</nowiki>
}}


Result: Blah blah deals {{DamageText|2d6|Physical}} damage.
=== Damage rider as source ===
----
See [[Template:DRS]] for an explanation on why anyone would want to do this.
Also supports Healing text.


Usage: {{code|Blah blah heals <nowiki>{{DamageText|2d4+2|Healing}}</nowiki>.}}
{{Template demo
| style = table
| <nowiki>Blah blah deals {{DamageText|2d6|Physical|drs=t}} damage.</nowiki>
}}


Result: Blah blah restores {{DamageText|2d4+2|Healing}}.
}}
[[Category:Damage Info Templates]]
[[Category:Templates]]
[[Category:Damage info templates]]
</noinclude>
</noinclude>

Latest revision as of 11:07, 19 January 2025

Template documentation

This template inserts formatted damage text.

Basic usage

Markup Renders as
Blah blah deals {{DamageText|2d6|Fire}} damage.
Blah blah deals 2d6Damage TypesFire damage.
Blah blah deals {{DamageText|2d6|Physical}} damage.
Blah blah deals 2d6Damage TypesPhysical damage.
Blah blah heals {{DamageText|2d4+2|Healing}}.
Blah blah heals 2d4+2hit points.

Damage rider as source

See Template:DRS for an explanation on why anyone would want to do this.

Markup Renders as
Blah blah deals {{DamageText|2d6|Physical|drs=t}} damage.
Blah blah deals 2d6Damage TypesPhysicalDRS damage.