Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import discord, os, time, random
- roles = ["Werewolf", "Sherif", "Wizard", "Damned", "Alpha Werewolf", "Seer", "Soldier", "Werewolf Seer", "Werewolf"]
- random.shuffle(roles)
- print("availeble roles: ",roles)
- speelers = []
- players= []
- i = 0
- running = False
- client = discord.Client()
- @client.event
- async def on_ready():
- print('We have logged in as {0.user}'.format(client))
- class Players():
- def __init__(self, nummer, user):
- self.nummer = nummer
- self.role = roles[nummer]
- self.hashtacknummer = user
- print(self.nummer, print(user), "=", self.role)
- async def Creategame(message, gamestate):
- global running
- if message.author.name not in speelers:
- running = True
- await message.channel.send("Type $join to join")
- async def Playerjoin(message):
- global i
- if message.author.name not in speelers:
- speelers.append(message.author.name)
- await message.channel.send("{0} Joined the hunt".format(message.author.name))
- players.append(Players(i+1, message.author))
- print("player",i+1,"has been created.")
- i+=1
- async def Startgame(message, gamestate):
- global running
- if message.author.name in speelers:
- running = "In Progress"
- await message.channel.send("Starting the game in 10 seconds")
- time.sleep(5)
- await message.channel.send("5")
- time.sleep(1)
- await message.channel.send("4")
- time.sleep(1)
- await message.channel.send("3")
- time.sleep(1)
- await message.channel.send("2")
- time.sleep(1)
- await message.channel.send("1")
- time.sleep(1)
- await message.channel.send("Let the hunt\n **begin**")
- for i in players:
- await i.hashtacknummer.send(f"You are a **{i.role}**")
- if i.role == "Werewolf":
- await i.hashtacknummer.send("Your job is to kill all the Non-Werewolfs.\nTo talk to other Werewolfs use the private Werewolf chat.\nEvery night you wil get a chance to vote who to kill.(only 1 kill per night in total).")
- elif i.role == "Sherif":
- await i.hashtacknummer.send("Your job is to kill all the bad guys.\nYou can only shoot once every two turn.s\nWhenever you shoot someone Everyone will know.")
- elif i.role == "Wizard":
- await i.hashtacknummer.send("Your job is to assist the Humans, and to stop the Non-Humans.\nYou can once choose a potion to give a person a extra live.\nAnd you can give a bad person a potion that makes them skip a day/night.")
- elif i.role == "Damned":
- await i.hashtacknummer.send("Aww to bad as a Damned there isnt mutch to do.\nAt first you are a human and you wil sta a human until attacked.\nIf you do get atacked you wil turn into a Werewolf.")
- elif i.role == "Alpha Werewolf":
- await i.hashtacknummer.send("Your job is to kill all the Non-Werewolfs.\nTo talk to other Werewolfs use the private Werewolf chat.\nAt night you are just the same as a normal Werewolf but you have twice the vote power(at night).")
- elif i.role == "Seer":
- await i.hashtacknummer.send("Your job is to instpect all people and expose the Werewolfs.\nEvery night you can inspect 1 person and it will tell you who they are.\nIf you die in any way you wont be able to tell who you inspected.")
- elif i.role == "Soldier":
- await i.hashtacknummer.send("Your job is to protect all the people against any threats.\nEveryday you can choose 1 person to protect, if you protect them you will take a hit for them.\nFor you to die you will need to be hit twice.\nIf you do not choose anyone to protect you will have a 1 in 4 chance to kill your weakest attacker and live.")
- elif i.role == "Werewolf Seer":
- await i.hashtacknummer.send("Your job is to kill all the Non-Werewolfs.\njust like a normal seer you can see peoples class, whenever you do every wolf in the game gets that info.\nYou can also vote at night who to kill.(like a normal Werewolf)")
- else:
- await i.hashtacknummer.send("No description made yet")
- @client.event
- async def on_message(message):
- global running, speelers, i
- if message.author is not client.user and (message.author.bot == False):
- if message.content.startswith('$start') and running == False:
- await Creategame(message, running)
- elif message.content.startswith('$start') and running == True:
- await Startgame(message, running)
- elif message.content.startswith('$join') and running == True:
- await Playerjoin(message)
- elif running == "In Progress":
- for j in players:
- if j.hashtacknummer == message.author and j.role == "Werewolf" or "Werewolf Seer" or "Alpha Werewolf" or "Damned":
- WWmessage = message.content
- channel = client.get_channel(668781270213591040)
- await channel.send(WWmessage)
- print(WWmessage, j.hashtacknummer, message.author, j.role)
- elif message.content.startswith('$test'):
- await Creategame(message, running)
- await Playerjoin(message)
- await Startgame(message, running)
- client.run("NjY4NzQzNjM5Mjc4NjgyMTEy.XiVuGA.1pDLcNPEsuM7JSTsbuaDBH4lS8w")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement