|
|
@ -2,7 +2,6 @@ import asyncio
|
|
|
|
import discord
|
|
|
|
import discord
|
|
|
|
|
|
|
|
|
|
|
|
# Import all roles here
|
|
|
|
# Import all roles here
|
|
|
|
from werewolf.role import Role
|
|
|
|
|
|
|
|
from werewolf.roles.vanillawerewolf import VanillaWerewolf
|
|
|
|
from werewolf.roles.vanillawerewolf import VanillaWerewolf
|
|
|
|
from werewolf.roles.villager import Villager
|
|
|
|
from werewolf.roles.villager import Villager
|
|
|
|
from werewolf.roles.seer import Seer
|
|
|
|
from werewolf.roles.seer import Seer
|
|
|
@ -10,35 +9,41 @@ from werewolf.roles.seer import Seer
|
|
|
|
# All roles in this list for iterating
|
|
|
|
# All roles in this list for iterating
|
|
|
|
role_list = [Villager, VanillaWerewolf]
|
|
|
|
role_list = [Villager, VanillaWerewolf]
|
|
|
|
|
|
|
|
|
|
|
|
#Example code:
|
|
|
|
"""
|
|
|
|
# 0 = Villager
|
|
|
|
Example code:
|
|
|
|
# 1 = VanillaWerewolf
|
|
|
|
0 = Villager
|
|
|
|
# E1 = Random Town
|
|
|
|
1 = VanillaWerewolf
|
|
|
|
# R1 = Random Werewolf
|
|
|
|
E1 = Random Town
|
|
|
|
# J1 = Benign Neutral
|
|
|
|
R1 = Random Werewolf
|
|
|
|
|
|
|
|
J1 = Benign Neutral
|
|
|
|
|
|
|
|
|
|
|
|
# 0001-1112E11R112P2
|
|
|
|
0001-1112E11R112P2
|
|
|
|
# 0,0,0,1,11,12,E1,R1,R1,R1,R2,P2
|
|
|
|
0,0,0,1,11,12,E1,R1,R1,R1,R2,P2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pre-letter = exact role position
|
|
|
|
|
|
|
|
double digit position preempted by `-`
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
# pre-letter = exact role position
|
|
|
|
|
|
|
|
# double digit position pre-empted by `-`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def parse_code(code):
|
|
|
|
async def parse_code(code):
|
|
|
|
|
|
|
|
"""Do the magic described above"""
|
|
|
|
out = []
|
|
|
|
out = []
|
|
|
|
#Do the magic described above
|
|
|
|
|
|
|
|
decode = code.copy() # for now, pass exact names
|
|
|
|
decode = code.copy() # for now, pass exact names
|
|
|
|
for role_id in decode:
|
|
|
|
for role_id in decode:
|
|
|
|
print(role_id)
|
|
|
|
print(role_id)
|
|
|
|
if role_id == "Villager":
|
|
|
|
if role_id == "Villager":
|
|
|
|
role = Villager
|
|
|
|
role = Villager
|
|
|
|
if role_id == "VanillaWerewolf":
|
|
|
|
elif role_id == "VanillaWerewolf":
|
|
|
|
role = VanillaWerewolf
|
|
|
|
role = VanillaWerewolf
|
|
|
|
if role_id == "Seer":
|
|
|
|
elif role_id == "Seer":
|
|
|
|
role = Seer
|
|
|
|
role = Seer
|
|
|
|
|
|
|
|
else: # Fail to parse
|
|
|
|
|
|
|
|
return None
|
|
|
|
out.append(role)
|
|
|
|
out.append(role)
|
|
|
|
|
|
|
|
|
|
|
|
return out
|
|
|
|
return out
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def build_game(channel: discord.TextChannel):
|
|
|
|
async def build_game(channel: discord.TextChannel):
|
|
|
|
await channel.send("Not currently available")
|
|
|
|
await channel.send("Not currently available")
|
|
|
|
|
|
|
|
|
|
|
|