Pārlūkot izejas kodu

Added some really dumb stat rolling options

Kirk Trombley 5 gadi atpakaļ
vecāks
revīzija
2d188738f2
1 mainītis faili ar 21 papildinājumiem un 0 dzēšanām
  1. 21 0
      src/plugins/roll.py

+ 21 - 0
src/plugins/roll.py

@@ -16,3 +16,24 @@ def roll(message):
         return "Rolled {}, got: {}".format(argstr, ", ".join(rolls))
     except Exception as _:
         return "Sorry - dice expression appears malformed. Add more ()'s"
+
+
+@as_plugin
+def rollstats():
+    return f"Rolled normal 4d6h3 stats, got: {', '.join(str(int(dice.roll('4d6h3'))) for _ in range(6))}"
+
+
+@as_plugin
+def rollstatsdumb():
+    return f"Rolled dumb d20 stats, got: {', '.join(str(int(dice.roll('d20'))) for _ in range(6))}"
+
+
+@as_plugin
+def character(message, bot):
+    if message.raw_args is not None and "d20" in message.raw_args:
+        bot.manually_post_message("!rollstatsdumb", message.group_id)
+    else:
+        bot.manually_post_message("!rollstats", message.group_id)
+    bot.manually_post_message("!choice Barbarian Bard Cleric Druid Fighter Monk Paladin Ranger Rogue Sorcerer Warlock Wizard", message.group_id)
+    bot.manually_post_message("!npc", message.group_id)
+    return None # to prevent extra message