update some emoji

This commit is contained in:
Bibin Muttappillil 2020-03-28 21:11:49 +01:00
parent fce32fc026
commit 475a41abcc
1 changed files with 31 additions and 31 deletions

View File

@ -22,7 +22,7 @@ class Role:
async def phase1(self): # query stuff + doppelganger simulation
pass
async def phase2(self): # werewolve stuff + seer info
async def phase2(self): # werewolf stuff + seer info
pass
async def phase3(self): # robber simulation & info
@ -50,18 +50,18 @@ class Role:
class Doppelganger(Role):
order = 1
class Werewolve(Role):
class Werewolf(Role):
order = 2
def setPlayer(self, player):
super().setPlayer(player)
self.game.werewolve_list.append(player)
self.game.werewolf_list.append(player)
async def phase2(self):
if len(self.game.werewolve_list) >= 2:
await self.player.send("Werewolves: " + str(self.game.werewolve_list))
if len(self.game.werewolf_list) >= 2:
await self.player.send("Werewolves: " + str(self.game.werewolf_list))
else:
await self.player.send("You are the only werewolve")
await self.player.send("You are the only werewolf")
await self.player.send("Which card in the middle do you want to look at?")
self.choice = await self.player.get_choice(["left", "middle", "right"])
@ -72,10 +72,10 @@ class Minion(Role):
order = 3
async def phase2(self):
if len(self.game.werewolve_list) == 0:
if len(self.game.werewolf_list) == 0:
await self.player.send("There were no werewolves so you became one")
else:
await self.player.send("Werewolves: " + str(self.game.werewolve_list))
await self.player.send("Werewolves: " + str(self.game.werewolf_list))
class Mason(Role):
@ -166,7 +166,7 @@ class No_role(Role):
order = 1000
Role.role_set = [Doppelganger, Werewolve, Minion, Mason, Seer, Robber, Troublemaker, Drunk, Insomniac, Villiager, Tanner, Hunter]
Role.role_set = [Doppelganger, Werewolf, Minion, Mason, Seer, Robber, Troublemaker, Drunk, Insomniac, Villiager, Tanner, Hunter]
class Player:
@ -251,7 +251,7 @@ class one_night:
return await bot.wait_for('message', check = check)
def setup(self):
self.werewolve_list = []
self.werewolf_list = []
self.mason_list = []
@ -352,46 +352,46 @@ class one_night:
no_dead = (len(dead) == 0)
tanner_dead = any(isinstance(d.day_role.copy, Tanner) for d in dead)
werewolve_dead = any(isinstance(d.day_role.copy, Werewolve) for d in dead)
werewolve_in_game = any(isinstance(p.day_role.copy, Werewolve) for p in self.player_list)
werewolf_dead = any(isinstance(d.day_role.copy, Werewolf) for d in dead)
werewolf_in_game = any(isinstance(p.day_role.copy, Werewolf) for p in self.player_list)
minion_dead = any(isinstance(d.day_role.copy, Minion) for d in dead)
minion_in_game = any(isinstance(p.day_role.copy, Minion) for p in self.player_list)
werewolve_won = False
werewolf_won = False
village_won = False
tanner_won = False
# could make it shorter using boolean algebra
if no_dead:
if werewolve_in_game:
werewolve_won = True
if werewolf_in_game:
werewolf_won = True
else:
village_won = True
else:
if tanner_dead:
tanner_won = True
if werewolve_dead:
if werewolf_dead:
village_won = True
else:
if werewolve_dead:
if werewolf_dead:
village_won = True
else:
if minion_dead:
if werewolve_in_game:
werewolve_won = True
if werewolf_in_game:
werewolf_won = True
else:
village_won = True
else:
if minion_in_game:
werewolve_won = True
werewolf_won = True
return werewolve_won, village_won, tanner_won, dead
return werewolf_won, village_won, tanner_won, dead
async def result(self, werewolve_won, village_won, tanner_won, dead):
async def result(self, werewolf_won, village_won, tanner_won, dead):
if werewolve_won:
if werewolf_won:
await self.send("Werewolves won!")
if village_won:
@ -401,8 +401,8 @@ class one_night:
if isinstance(d.day_role.copy, Tanner):
await self.send(str(p) + " won a tanner")
await self.send("Dead: " + ', '.join(str(d) for d in dead))
await self.send('\n'.join(str(p.tally) + " votes for " + str(p) + " who is " + str(p.day_role) + " (was " + str(p.night_role) + ") " for p in self.player_list))
await self.send(":skull: " + ', '.join(str(d) for d in dead))
await self.send('\n'.join(":ballot_box " + str(p.tally) + " votes for " + str(p) + " who is " + str(p.day_role) + " (was " + str(p.night_role) + ") " for p in self.player_list))
await self.send("Middle cards: " + ', '.join(str(r) for r in self.middle_card))
# debug
@ -476,21 +476,21 @@ async def on_message(message):
return
if message.content.startswith('$werewolve'):
if message.content.startswith('$werewolf'):
# start (only one instance running)
if werewolve_game.running:
if werewolf_game.running:
await message.channel.send("Sorry! A game is already running")
return
werewolve_game.running = True
werewolve_game.set_channel(message.channel)
werewolf_game.running = True
werewolf_game.set_channel(message.channel)
await werewolve_game.game()
await werewolf_game.game()
return
werewolve_game = one_night(bot)
werewolf_game = one_night(bot)
bot.run(TOKEN)