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

59 lines
1.9 KiB

import logging
4 years ago
from werewolf.constants import ALIGNMENT_WEREWOLF, CATEGORY_WW_KILLING, CATEGORY_WW_RANDOM
from werewolf.listener import wolflistener
from werewolf.role import Role
from werewolf.votegroups.wolfvote import WolfVote
7 years ago
log = logging.getLogger("red.fox_v3.werewolf.role.vanillawerewolf")
7 years ago
7 years ago
class VanillaWerewolf(Role):
7 years ago
rand_choice = True
4 years ago
town_balance = -6
category = [CATEGORY_WW_RANDOM, CATEGORY_WW_KILLING]
alignment = ALIGNMENT_WEREWOLF # 1: Town, 2: Werewolf, 3: Neutral
channel_name = "werewolves"
7 years ago
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
)
async def see_alignment(self, source=None):
"""
Interaction for investigative roles attempting
to see team (Village, Werewolf Other)
"""
4 years ago
return ALIGNMENT_WEREWOLF
7 years ago
async def get_role(self, source=None):
7 years ago
"""
Interaction for powerful access of role
Unlikely to be able to deceive this
"""
4 years ago
return "VanillaWerewolf"
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
4 years ago
@wolflistener("at_game_start", priority=2)
4 years ago
async def _at_game_start(self):
4 years ago
if self.channel_name:
log.debug("Wolf has channel_name: " + self.channel_name)
await self.game.register_channel(
4 years ago
self.channel_name, self, WolfVote
) # Add VoteGroup WolfVote
7 years ago
await self.player.send_dm(self.game_start_message)
7 years ago
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")