Difference between revisions of "User:Paxed/Template:dicemin"
Jump to navigation
Jump to search
m |
m |
||
Line 1: | Line 1: | ||
<onlyinclude><includeonly> | <onlyinclude><includeonly> | ||
+ | {{#sub: {{#explode:{{{1}}}|d|1}}|{{#rpos:{{#explode:{{{1}}}|d|1}}|+}} }} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</includeonly></onlyinclude> | </includeonly></onlyinclude> | ||
Line 25: | Line 17: | ||
*<tt><nowiki>{{dicemin|2d10+5}}</nowiki></tt> gives <tt>{{:User:Paxed/Template:dicemin|2d105}}</tt> | *<tt><nowiki>{{dicemin|2d10+5}}</nowiki></tt> gives <tt>{{:User:Paxed/Template:dicemin|2d105}}</tt> | ||
*<tt><nowiki>{{dicemin|3d8-2}}</nowiki></tt> gives <tt>{{:User:Paxed/Template:dicemin|3d8-2}}</tt> | *<tt><nowiki>{{dicemin|3d8-2}}</nowiki></tt> gives <tt>{{:User:Paxed/Template:dicemin|3d8-2}}</tt> | ||
+ | |||
+ | <nowiki> | ||
+ | {{#expr:{{#explode:{{{1}}}|d|0}} {{#if: {{#sub: {{#explode:{{{1}}}|d|1}}|{{#rpos:{{#explode:{{{1}}}|d|1}}|+}} }} | ||
+ | | + {{#sub: {{#explode:{{{1}}}|d|1}}|{{#rpos:{{#explode:{{{1}}}|d|1}}|+}} }} | ||
+ | |{{#if: {{#sub: {{#explode:{{{1}}}|d|1}}|{{#rpos:{{#explode:{{{1}}}|d|1}}|-}} }} | ||
+ | | - {{#sub: {{#explode:{{{1}}}|d|1}}|{{#rpos:{{#explode:{{{1}}}|d|1}}|-}} }} | ||
+ | | +0 | ||
+ | }} | ||
+ | }} | ||
+ | |||
+ | }} | ||
+ | </nowiki> |
Revision as of 17:20, 4 March 2008
This template returns the minimum value a die roll in the standard d-notation can give. This cannot handle more than one d-notation, so no 1d6+1d4. See also User:Paxed/Template:dicemax.
Usage: {{dicemin|AdB+C}}
Where:
- A is the number of dice to be rolled.
- B is the number of sides the dices have.
- C is an (optional) modifier added after the diceroll. Use only simple plusses or minuses here!
Output:
- {{dicemin|1d6}} gives
6
- {{dicemin|2d10+5}} gives
5
- {{dicemin|3d8-2}} gives
2
{{#expr:{{#explode:{{{1}}}|d|0}} {{#if: {{#sub: {{#explode:{{{1}}}|d|1}}|{{#rpos:{{#explode:{{{1}}}|d|1}}|+}} }} | + {{#sub: {{#explode:{{{1}}}|d|1}}|{{#rpos:{{#explode:{{{1}}}|d|1}}|+}} }} |{{#if: {{#sub: {{#explode:{{{1}}}|d|1}}|{{#rpos:{{#explode:{{{1}}}|d|1}}|-}} }} | - {{#sub: {{#explode:{{{1}}}|d|1}}|{{#rpos:{{#explode:{{{1}}}|d|1}}|-}} }} | +0 }} }} }}