Difference between revisions of "User:Yenwood/Sandbox/Template:Dice"

From DDO Compendium
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#len:{{{1}}}}}
Template for dice rolls
 
<nowiki>{{{1}}} = amount of dice
{{{2}}} = side of dice
{{{3}}} = (optional) number to add, default 0
{{{4}}} = (optional) multiplier (multiplies base roll), default 1
 
Example:
1.25[2d8] + 6
{{Dice | 2 | 8 | 6 | 1.25}}
 
 
{{#bootstrap_tooltip: {{{1}}}d{{{2}}} | text = {{{1}}} - {{#expr:{{{1}}}*{{{2}}}}} | placement = bottom }}
 
{{#bootstrap_tooltip: {{{1}}}d{{{2}}} + {{{3}}} | text = {{#expr:{{{1}}}+{{{3}}}}} - {{#expr:{{{1}}}*{{{2}}}+{{{3}}}}} | placement = bottom }}
 
{{#bootstrap_tooltip: {{{4}}}[{{{1}}}d{{{2}}}] + {{{3}}} | text = {{#expr:{{{1}}}*{{{4}}}+{{{3}}}}} - {{#expr:({{{1}}}*{{{2}}})*{{{4}}}+{{{3}}}}} | placement = bottom }}
 
 
{{#if: {{{4|}}}|
{{#bootstrap_tooltip: {{{4}}}[{{{1}}}d{{{2}}}] + {{{3}}} | text = {{#expr:{{{1}}}*{{{4}}}+{{{3}}}}} - {{#expr:({{{1}}}*{{{2}}})*{{{4}}}+{{{3}}}}} | placement = bottom }}|
{{#if: {{{3|}}}|
{{#bootstrap_tooltip: {{{1}}}d{{{2}}} + {{{3}}} | text = {{#expr:{{{1}}}+{{{3}}}}} - {{#expr:{{{1}}}*{{{2}}}+{{{3}}}}} | placement = bottom }}|
{{#bootstrap_tooltip: {{{1}}}d{{{2}}} | text = {{#expr:{{{1}}} - {{#expr:{{{1}}}*{{{2}}}}} | placement = bottom }}}}</nowiki>
 
<onlyinclude>
{{#bootstrap_tooltip: {{{4|1}}}[{{{1}}}d{{{2}}}] + {{{3|0}}} | text = {{#expr:{{{1}}}*{{{4|1}}}+{{{3|0}}}}} - {{#expr:({{{1}}}*{{{2}}})*{{{4|1}}}+{{{3|0}}}}} | placement = bottom }}
</onlyinclude>

Latest revision as of 15:51, 1 May 2018

Template for dice rolls

{{{1}}} = amount of dice
{{{2}}} = side of dice
{{{3}}} = (optional) number to add, default 0
{{{4}}} = (optional) multiplier (multiplies base roll), default 1

Example:
1.25[2d8] + 6 
{{Dice | 2 | 8 | 6 | 1.25}}


{{#bootstrap_tooltip: {{{1}}}d{{{2}}} | text = {{{1}}} - {{#expr:{{{1}}}*{{{2}}}}} | placement = bottom }}

{{#bootstrap_tooltip: {{{1}}}d{{{2}}} + {{{3}}} | text = {{#expr:{{{1}}}+{{{3}}}}} - {{#expr:{{{1}}}*{{{2}}}+{{{3}}}}} | placement = bottom }}

{{#bootstrap_tooltip: {{{4}}}[{{{1}}}d{{{2}}}] + {{{3}}} | text = {{#expr:{{{1}}}*{{{4}}}+{{{3}}}}} - {{#expr:({{{1}}}*{{{2}}})*{{{4}}}+{{{3}}}}} | placement = bottom }}


{{#if: {{{4|}}}| 
{{#bootstrap_tooltip: {{{4}}}[{{{1}}}d{{{2}}}] + {{{3}}} | text = {{#expr:{{{1}}}*{{{4}}}+{{{3}}}}} - {{#expr:({{{1}}}*{{{2}}})*{{{4}}}+{{{3}}}}} | placement = bottom }}| 
{{#if: {{{3|}}}| 
{{#bootstrap_tooltip: {{{1}}}d{{{2}}} + {{{3}}} | text = {{#expr:{{{1}}}+{{{3}}}}} - {{#expr:{{{1}}}*{{{2}}}+{{{3}}}}} | placement = bottom }}| 
{{#bootstrap_tooltip: {{{1}}}d{{{2}}} | text = {{#expr:{{{1}}} - {{#expr:{{{1}}}*{{{2}}}}} | placement = bottom }}}}


1[{{{1}}}d{{{2}}}] + 0