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/Role.py

102 lines
2.6 KiB

import asyncio
import discord
from datetime import datetime,timedelta
class Role:
"""
Base Role class for werewolf game
Category enrollment guide as follows:
Town:
1: Random, 2: Investigative, 3: Protective, 4: Government,
7 years ago
5: Killing, 6: Power (Special night action)
7 years ago
Werewolf:
11: Random, 12: Deception, 15: Killing, 16: Support
Neutral:
21: Benign, 22: Evil, 23: Killing
7 years ago
Example category:
category = [1, 5, 6] Could be Veteran
category = [1, 5] Could be Bodyguard
"""
random_choice = True # Determines if it can be picked as a random
category = [0] # List of enrolled categories
priority = 0 # 0 is "No Action"
7 years ago
allignment = 0 # 1: Town, 2: Werewolf, 3: Neutral
private_channel_id = "" # No private channel
unique = False # Only one of this role per game
def __init__(self):
self.player = None
self.blocked = False
7 years ago
async def on_event(self, event, data):
"""
Action guide as follows:
_at_night_start
1. Detain actions (Jailer/Kidnapper)
2. Group discussions and Pick targets
_at_night_end
1. Self actions (Veteran)
2. Target switching and role blocks (bus driver, witch, escort)
3. Protection / Preempt actions (bodyguard/framer)
4. Non-disruptive actions (seer/silencer)
5. Disruptive actions (werewolf kill)
6. Role altering actions (Cult / Mason)
"""
7 years ago
"""
See Game class for event guide
"""
action_list = [
self._at_game_start(data),
self._at_day_start(data),
self._at_vote(data),
self._at_kill(data),
self._at_hang(data),
self._at_day_end(data),
self._at_night_start(data),
self._at_night_end(data)
]
await action_list[event]
async def assign_player(self, player):
"""
Give this role a player
"""
self.player = player
7 years ago
async def _at_game_start(self, data=None):
pass
async def _at_day_start(self, data=None):
pass
7 years ago
async def _at_vote(self, target=None):
pass
7 years ago
async def _at_kill(self, target=None):
pass
7 years ago
async def _at_hang(self, target=None):
pass
async def _at_day_end(self):
pass
async def _at_night_start(self):
pass
async def _at_night_end(self):
pass