Difference between revisions of "Template:Dice"

From DDO Compendium
(I reverted the changes because we want the page to look like it does in DDO, and the always show the brackets, not just when needed.)
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>This template is used to generate dice rolls, with a tooltip to show the actual range.[[Category:Template]]
<noinclude>{{TemplateDocumentation
 
|name = Dice
Used in this manner:
|description = This template is used to display a possible dice roll.  This is specifically used on weapons to say what is the basic damage amount possible.  It uses a bootstrap tooltip to show the range of values.
<br><nowiki>{{Dice|(multiplier (opt))|(count)|(sides)|(addbeforemultiplier(opt))|(addaftermultiplier(opt))}}</nowiki><br>
|category=Shared Templates
<br>Such that <nowiki>{{Dice|1.25|2|8|4|6}}</nowiki> results in
|example1 = <nowiki>{{Dice|1.25|2|8|4|6}}</nowiki>
<br>{{Dice|1.25|2|8|4|6}}
|example1output = {{Dice|1.25|2|8|4|6}}
<br><nowiki>{{Dice||2|8}}</nowiki> results in
|example2 = <nowiki>{{Dice||2|8}}</nowiki>
<br>{{Dice||2|8}}
|example2output = {{Dice||2|8}}
<br><nowiki>{{Dice||2|8||3}}</nowiki> results in
|example3 = <nowiki>{{Dice||2|8||3}}</nowiki>
<br>{{Dice||2|8||3}}
|example3output = {{Dice||2|8||3}}
<br><nowiki>{{Dice||2|8|4|3}}</nowiki> results in
|example4 = <nowiki>{{Dice||2|8|4|3}}</nowiki>
<br>{{Dice||2|8|4|3}}
|example4output = {{Dice||2|8|4|3}}
|parameter1name = Multiplier
|parameter1description = This is the amount that the dice roll is multiplied by: '''1.25'''[2d8+4]+6
|parameter1values =
|parameter2name = Die Count
|parameter2description = This is the number of die that will be rolled: 1.25['''2'''d8+4]+6
|parameter2values =
|parameter3name = Die Sides
|parameter3description = This is the number of sides that the die that is rolled will have: 1.25[2d'''8'''+4]+6
|parameter3values =
|parameter4name = Add Before Multiplier
|parameter4description = This is the amount that is added to the die roll before the multiplier: 1.25[2d8+'''4''']+6
|parameter4values =
|parameter5name = Add After Multiplier
|parameter5description = This is the amount that is added to the roll after the multiplier: 1.25[2d8+4]+'''6'''
|parameter5values =
}}
</noinclude>
</noinclude>
 
<onlyinclude><span style="white-space:nowrap">{{#bootstrap_tooltip: {{{1|}}}{{#if: {{{1|}}}|[|{{#if: {{{5|}}}|{{#if: {{{4|}}}|[|}}|}}}}{{{2}}}d{{{3}}}{{#if: {{{4|}}} |
 
{{#ifexpr: {{{4}}}<0||+}}{{{4}}}}}{{#if: {{{1|}}}|]|{{#if: {{{5|}}}|{{#if: {{{4|}}}|]|}}|}}}}{{#if: {{{5|}}} |
<onlyinclude>{{#bootstrap_tooltip: {{{1|}}}[{{{2}}}d{{{3}}}{{#if: {{{4|}}} |+{{{4}}}}}]{{#if: {{{5|}}} |+{{{5}}}}} | text = {{#expr: {{#if: {{{1|}}}|{{{1}}}|1}}*(({{{2}}})+ {{#if: {{{4|}}}|{{{4}}}|0}}) + {{#if:{{{5|}}}|{{{5}}}|0}}}}
{{#ifexpr: {{{5}}}<0||+}}{{{5}}}}} | text = Range: {{#expr: {{#if: {{{1|}}}|{{{1}}}|1}}*(({{{2}}})+ {{#if: {{{4|}}}|{{{4}}}|0}}) + {{#if:{{{5|}}}|{{{5}}}|0}}}}
  - {{#expr: {{#if: {{{1|}}}|{{{1}}}|1}}*(({{{2}}}*{{{3}}})+ {{#if: {{{4|}}}|{{{4}}}|0}}) + {{#if:{{{5|}}}|{{{5}}}|0}}}}
  - {{#expr: {{#if: {{{1|}}}|{{{1}}}|1}}*(({{{2}}}*{{{3}}})+ {{#if: {{{4|}}}|{{{4}}}|0}}) + {{#if:{{{5|}}}|{{{5}}}|0}}}}
  | placement = bottom }}</onlyinclude>
  | placement = bottom }}</span></onlyinclude>

Latest revision as of 13:36, 10 February 2022

Dice[edit]

This template is used to display a possible dice roll. This is specifically used on weapons to say what is the basic damage amount possible. It uses a bootstrap tooltip to show the range of values.

Example Usage
{{Dice|1.25|2|8|4|6}}1.25[2d8+4]+6
{{Dice||2|8}}2d8
{{Dice||2|8||3}}2d8+3
{{Dice||2|8|4|3}}[2d8+4]+3

Usage[edit]

{{Dice|(Multiplier)|(Die Count)|(Die Sides)|(Add Before Multiplier)|(Add After Multiplier)}}

Parameter Documentation
MultiplierThis is the amount that the dice roll is multiplied by: 1.25[2d8+4]+6
Die CountThis is the number of die that will be rolled: 1.25[2d8+4]+6
Die SidesThis is the number of sides that the die that is rolled will have: 1.25[2d8+4]+6
Add Before MultiplierThis is the amount that is added to the die roll before the multiplier: 1.25[2d8+4]+6
Add After MultiplierThis is the amount that is added to the roll after the multiplier: 1.25[2d8+4]+6

Template

Ignore any errors below this line, The errors occur because there is no input into the template, in the template itself.


{{{2}}}d{{{3}}}