diff --git a/zulip_bots/zulip_bots/bots/rollcake/rollcake.py b/zulip_bots/zulip_bots/bots/rollcake/rollcake.py index 9b676e3..f3e694c 100644 --- a/zulip_bots/zulip_bots/bots/rollcake/rollcake.py +++ b/zulip_bots/zulip_bots/bots/rollcake/rollcake.py @@ -16,34 +16,14 @@ USAGE = '''@ me to roll RPG dice. Examples: @**Rollcake** void 3 *(Voidheart Symphony city roll, stress gauge 3: 2d6, check if either/both are above 3)* - -@**Rollcake** fate 1 -*(Fate, rating +1: 4 fate dice, add +1 to total)* ''' PBTA_RE = re.compile(r'(pbta|apoc(alypse)?|void(heart)? castle)\s+(?P[-+]?[0-9])(\s+(?Padv|dis))?') FITD_RE = re.compile(r'(fitd|forged)\s+(?P[0-9])\b') SBR_RE = re.compile(r'(sbr|res(istance)?)\s+(?P[0-9])(\s+(?Prisk|dang))?') VOID_RE = re.compile(r'(void(heart)?( city)?)\s+(?P[0-6])(\s+(?Padv|dis))?') -FATE_RE = re.compile(r'fate\s+(?P[-+]?[0-9])') DICE_RE = re.compile(r'\b(?P[0-9]*)d(?P[0-9]+)\s*(?P[-+][0-9]+)?') -FATE_LADDER = [ - 'Horrifying', - 'Catastrophic', - 'Terrible', - 'Poor', - 'Mediocre', - 'Average', - 'Fair', - 'Good', - 'Great', - 'Superb', - 'Fantastic', - 'Epic', - 'Legendary', -] - def roll(count, sides): return [random.randint(1, sides) for i in range(count)] @@ -174,25 +154,6 @@ def handle_roll(content): ) ) - fate = FATE_RE.search(content) - if fate: - rating = int(fate.group('rating') or '0') - results = [random.randint(-1, 1) for i in range(4)] - total = sum(results) + rating - ladder_entry = total + 4 - if ladder_entry >= 0 and ladder_entry < len(FATE_LADDER): - effort = FATE_LADDER[ladder_entry] - else: - effort = '' - return '**{:+d}{}**\nRolls: {}'.format( - total, - ' ' + effort if effort else '', - ', '.join( - '`{}`'.format('+' if d == 1 else '-' if d == -1 else ' ') - for d in results - ) - ) - return USAGE class RollcakeHandler(object):