MakeDice

From UODemo Wiki
Revision as of 22:11, 26 January 2010 by Batlin (talk | contribs) (Created page with 'void '''makeDice'''(string &''ResultString'', string ''PrependString'', integer ''Rolls'', integer ''Sides'', string ''MinimumPrefix', integer ''Minimum''); The makeDice functio...')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

void makeDice(string &ResultString, string PrependString, integer Rolls, integer Sides, string MinimumPrefix', integer Minimum);

The makeDice function will convert the dice parameters (Rolls, Sides and Minimum) to a string.


Notes:
Rolls is only appended if it's non-zero and when appended it is always prefixed by a "d" character.
Minimum is only appended if MinimumPrefix is not an empty string and if Minimum itself is non-zero.


Examples:

string test = "Empty String";
makeDice(test, "My Test Dice: ", 5, 8, "!", 0 - 5);
->
"My Test Dice: 5d8!-5"
string test;
makeDice(test, "My Test Dice: ", 5, 0, "", 5);
->
"My Test Dice: 5"
string test = "";
makeDice(test, "My Test Dice: ", 5, 0, "+", 5);
->
"My Test Dice: 5+5"