update some emoji
This commit is contained in:
parent
fce32fc026
commit
475a41abcc
|
@ -22,7 +22,7 @@ class Role:
|
||||||
async def phase1(self): # query stuff + doppelganger simulation
|
async def phase1(self): # query stuff + doppelganger simulation
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def phase2(self): # werewolve stuff + seer info
|
async def phase2(self): # werewolf stuff + seer info
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def phase3(self): # robber simulation & info
|
async def phase3(self): # robber simulation & info
|
||||||
|
@ -50,18 +50,18 @@ class Role:
|
||||||
class Doppelganger(Role):
|
class Doppelganger(Role):
|
||||||
order = 1
|
order = 1
|
||||||
|
|
||||||
class Werewolve(Role):
|
class Werewolf(Role):
|
||||||
order = 2
|
order = 2
|
||||||
|
|
||||||
def setPlayer(self, player):
|
def setPlayer(self, player):
|
||||||
super().setPlayer(player)
|
super().setPlayer(player)
|
||||||
self.game.werewolve_list.append(player)
|
self.game.werewolf_list.append(player)
|
||||||
|
|
||||||
async def phase2(self):
|
async def phase2(self):
|
||||||
if len(self.game.werewolve_list) >= 2:
|
if len(self.game.werewolf_list) >= 2:
|
||||||
await self.player.send("Werewolves: " + str(self.game.werewolve_list))
|
await self.player.send("Werewolves: " + str(self.game.werewolf_list))
|
||||||
else:
|
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?")
|
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"])
|
self.choice = await self.player.get_choice(["left", "middle", "right"])
|
||||||
|
|
||||||
|
@ -72,10 +72,10 @@ class Minion(Role):
|
||||||
order = 3
|
order = 3
|
||||||
|
|
||||||
async def phase2(self):
|
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")
|
await self.player.send("There were no werewolves so you became one")
|
||||||
else:
|
else:
|
||||||
await self.player.send("Werewolves: " + str(self.game.werewolve_list))
|
await self.player.send("Werewolves: " + str(self.game.werewolf_list))
|
||||||
|
|
||||||
|
|
||||||
class Mason(Role):
|
class Mason(Role):
|
||||||
|
@ -166,7 +166,7 @@ class No_role(Role):
|
||||||
order = 1000
|
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:
|
class Player:
|
||||||
|
@ -251,7 +251,7 @@ class one_night:
|
||||||
return await bot.wait_for('message', check = check)
|
return await bot.wait_for('message', check = check)
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
self.werewolve_list = []
|
self.werewolf_list = []
|
||||||
self.mason_list = []
|
self.mason_list = []
|
||||||
|
|
||||||
|
|
||||||
|
@ -352,46 +352,46 @@ class one_night:
|
||||||
|
|
||||||
no_dead = (len(dead) == 0)
|
no_dead = (len(dead) == 0)
|
||||||
tanner_dead = any(isinstance(d.day_role.copy, Tanner) for d in dead)
|
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)
|
werewolf_dead = any(isinstance(d.day_role.copy, Werewolf) for d in dead)
|
||||||
werewolve_in_game = any(isinstance(p.day_role.copy, Werewolve) for p in self.player_list)
|
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_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)
|
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
|
village_won = False
|
||||||
tanner_won = False
|
tanner_won = False
|
||||||
|
|
||||||
# could make it shorter using boolean algebra
|
# could make it shorter using boolean algebra
|
||||||
if no_dead:
|
if no_dead:
|
||||||
if werewolve_in_game:
|
if werewolf_in_game:
|
||||||
werewolve_won = True
|
werewolf_won = True
|
||||||
else:
|
else:
|
||||||
village_won = True
|
village_won = True
|
||||||
else:
|
else:
|
||||||
if tanner_dead:
|
if tanner_dead:
|
||||||
tanner_won = True
|
tanner_won = True
|
||||||
|
|
||||||
if werewolve_dead:
|
if werewolf_dead:
|
||||||
village_won = True
|
village_won = True
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if werewolve_dead:
|
if werewolf_dead:
|
||||||
village_won = True
|
village_won = True
|
||||||
else:
|
else:
|
||||||
if minion_dead:
|
if minion_dead:
|
||||||
if werewolve_in_game:
|
if werewolf_in_game:
|
||||||
werewolve_won = True
|
werewolf_won = True
|
||||||
else:
|
else:
|
||||||
village_won = True
|
village_won = True
|
||||||
else:
|
else:
|
||||||
if minion_in_game:
|
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!")
|
await self.send("Werewolves won!")
|
||||||
|
|
||||||
if village_won:
|
if village_won:
|
||||||
|
@ -401,8 +401,8 @@ class one_night:
|
||||||
if isinstance(d.day_role.copy, Tanner):
|
if isinstance(d.day_role.copy, Tanner):
|
||||||
await self.send(str(p) + " won a tanner")
|
await self.send(str(p) + " won a tanner")
|
||||||
|
|
||||||
await self.send("Dead: " + ', '.join(str(d) for d in dead))
|
await self.send(":skull: " + ', '.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('\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))
|
await self.send("Middle cards: " + ', '.join(str(r) for r in self.middle_card))
|
||||||
|
|
||||||
# debug
|
# debug
|
||||||
|
@ -476,21 +476,21 @@ async def on_message(message):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
if message.content.startswith('$werewolve'):
|
if message.content.startswith('$werewolf'):
|
||||||
|
|
||||||
# start (only one instance running)
|
# start (only one instance running)
|
||||||
|
|
||||||
if werewolve_game.running:
|
if werewolf_game.running:
|
||||||
await message.channel.send("Sorry! A game is already running")
|
await message.channel.send("Sorry! A game is already running")
|
||||||
return
|
return
|
||||||
|
|
||||||
werewolve_game.running = True
|
werewolf_game.running = True
|
||||||
werewolve_game.set_channel(message.channel)
|
werewolf_game.set_channel(message.channel)
|
||||||
|
|
||||||
|
|
||||||
await werewolve_game.game()
|
await werewolf_game.game()
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
werewolve_game = one_night(bot)
|
werewolf_game = one_night(bot)
|
||||||
bot.run(TOKEN)
|
bot.run(TOKEN)
|
Loading…
Reference in New Issue