You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Fox-V3/werewolf/roles/vanillawerewolf.py

127 lines
3.5 KiB

from werewolf.role import Role
7 years ago
from werewolf.votegroups.wolfvote import WolfVote
7 years ago
7 years ago
7 years ago
class VanillaWerewolf(Role):
7 years ago
rand_choice = True
7 years ago
category = [11, 15]
7 years ago
alignment = 2 # 1: Town, 2: Werewolf, 3: Neutral
7 years ago
channel_id = "werewolves"
unique = False
7 years ago
game_start_message = (
"Your role is **Werewolf**\n"
"You win by killing everyone else in the village\n"
7 years ago
"Lynch players during the day with `[p]ww vote <ID>`\n"
7 years ago
"Vote to kill players at night with `[p]ww vote <ID>`"
7 years ago
)
def __init__(self, game):
7 years ago
super().__init__(game)
7 years ago
self.action_list = [
(self._at_game_start, 1), # (Action, Priority)
7 years ago
(self._at_day_start, 0),
(self._at_voted, 0),
(self._at_kill, 0),
(self._at_hang, 0),
(self._at_day_end, 0),
(self._at_night_start, 0),
7 years ago
(self._at_night_end, 0),
(self._at_visit, 0)
7 years ago
]
7 years ago
# async def on_event(self, event, data):
7 years ago
# """
# See Game class for event guide
# """
# await self.action_list[event][0](data)
7 years ago
# async def assign_player(self, player):
7 years ago
# """
# Give this role a player
# Can be used after the game has started (Cult, Mason, role swap)
# """
# player.role = self
# self.player = player
# async def get_alignment(self, source=None):
7 years ago
# """
# Interaction for power access of team (Village, Werewolf, Other)
# Unlikely to be able to deceive this
# """
# return self.alignment
async def see_alignment(self, source=None):
"""
Interaction for investigative roles attempting
to see team (Village, Werewolf Other)
"""
7 years ago
return "Werewolf"
async def get_role(self, source=None):
7 years ago
"""
Interaction for powerful access of role
Unlikely to be able to deceive this
"""
return "Werewolf"
7 years ago
async def see_role(self, source=None):
7 years ago
"""
Interaction for investigative roles.
More common to be able to deceive these roles
"""
return "Werewolf"
7 years ago
7 years ago
async def _at_game_start(self, data=None):
if self.channel_id:
7 years ago
print("Wolf has channel_id: " + self.channel_id)
await self.game.register_channel(self.channel_id, self, WolfVote) # Add VoteGroup WolfVote
7 years ago
await self.player.send_dm(self.game_start_message)
7 years ago
# async def _at_day_start(self, data=None):
7 years ago
# super()._at_day_start(data)
7 years ago
# async def _at_voted(self, data=None):
7 years ago
# super()._at_voted(data)
7 years ago
# async def _at_kill(self, data=None):
7 years ago
# super()._at_kill(data)
7 years ago
# async def _at_hang(self, data=None):
7 years ago
# super()._at_hang(data)
7 years ago
# async def _at_day_end(self, data=None):
7 years ago
# super()._at_day_end(data)
7 years ago
# async def _at_night_start(self, data=None):
7 years ago
# super()._at_night_start(data)
7 years ago
# async def _at_night_end(self, data=None):
7 years ago
# super()._at_night_end(data)
7 years ago
# async def _at_visit(self, data=None):
7 years ago
# pass
# async def kill(self, source):
7 years ago
# """
# Called when someone is trying to kill you!
# Can you do anything about it?
# self.alive is now set to False, set to True to stay alive
# """
# pass
7 years ago
# async def visit(self, source):
7 years ago
# """
# Called whenever a night action targets you
# Source is the player who visited you
# """
# pass
7 years ago
async def choose(self, ctx, data):
7 years ago
"""Handle night actions"""
7 years ago
await self.player.member.send("Use `[p]ww vote` in your werewolf channel")