|
|
@ -392,7 +392,7 @@ OS.karada = function (body) {
|
|
|
|
return output;
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var dice_re = /(#dame|#tutturu|#muri|#flip|#when|#du|#pyu|#pcount|#test|#sleep|#janken|#8ball|#imfey|#\?(?:\[(?:\w,*)+\])?|#\d{0,2}d\d{1,4}(?:[+-]\d{1,4})?)/i;
|
|
|
|
var dice_re = /(#tea|#dame|#tutturu|#muri|#flip|#when|#du|#pyu|#pcount|#test|#sleep|#janken|#8ball|#imfey|#\?(?:\[(?:\w,*)+\])?|#\d{0,2}d\d{1,4}(?:[+-]\d{1,4})?)/i;
|
|
|
|
exports.dice_re = dice_re;
|
|
|
|
exports.dice_re = dice_re;
|
|
|
|
|
|
|
|
|
|
|
|
var WHEN = [
|
|
|
|
var WHEN = [
|
|
|
@ -472,6 +472,8 @@ function parse_dice(frag)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (frag == '#pyu' || frag == '#pcount' || frag == '#du')
|
|
|
|
if (frag == '#pyu' || frag == '#pcount' || frag == '#du')
|
|
|
|
return {n: 1, faces: 2};
|
|
|
|
return {n: 1, faces: 2};
|
|
|
|
|
|
|
|
if (frag == '#tea')
|
|
|
|
|
|
|
|
return {n: 1, faces: 2};
|
|
|
|
if (frag == '#flip')
|
|
|
|
if (frag == '#flip')
|
|
|
|
return {n: 1, faces: 2};
|
|
|
|
return {n: 1, faces: 2};
|
|
|
|
if (frag == '#imfey')
|
|
|
|
if (frag == '#imfey')
|
|
|
@ -546,6 +548,8 @@ function readable_dice(bit, d) {
|
|
|
|
return '#pyu (' + d[0]+ ')';
|
|
|
|
return '#pyu (' + d[0]+ ')';
|
|
|
|
if (bit == '#pcount')
|
|
|
|
if (bit == '#pcount')
|
|
|
|
return '#pcount (' + d[0] + ')';
|
|
|
|
return '#pcount (' + d[0] + ')';
|
|
|
|
|
|
|
|
if (bit == '#tea')
|
|
|
|
|
|
|
|
return '#tea (' + ((d[0] === true)?"now!":d[0]+" hours") + ')';
|
|
|
|
if (bit == '#flip')
|
|
|
|
if (bit == '#flip')
|
|
|
|
return '#flip (' + (d[1] == 2) + ')';
|
|
|
|
return '#flip (' + (d[1] == 2) + ')';
|
|
|
|
if (bit == '#imfey')
|
|
|
|
if (bit == '#imfey')
|
|
|
@ -554,7 +558,7 @@ function readable_dice(bit, d) {
|
|
|
|
return '#8ball (' + EIGHT_BALL[d[1] - 1] + ')';
|
|
|
|
return '#8ball (' + EIGHT_BALL[d[1] - 1] + ')';
|
|
|
|
if (bit == '#when')
|
|
|
|
if (bit == '#when')
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var f = function(n) {
|
|
|
|
const f = (n) => {
|
|
|
|
if(WHEN[n] === null)
|
|
|
|
if(WHEN[n] === null)
|
|
|
|
return f(n-1);
|
|
|
|
return f(n-1);
|
|
|
|
else return WHEN[n];
|
|
|
|
else return WHEN[n];
|
|
|
|