|
|
|
@ -8,40 +8,27 @@ class Role:
|
|
|
|
|
"""
|
|
|
|
|
Base Role class for werewolf game
|
|
|
|
|
|
|
|
|
|
Category enrollment guide as follows:
|
|
|
|
|
|
|
|
|
|
Town:
|
|
|
|
|
1: Random, 2: Investigative, 3: Protective, 4: Government,
|
|
|
|
|
5: Killing, 6: Power (Special night action)
|
|
|
|
|
|
|
|
|
|
Werewolf:
|
|
|
|
|
11: Random, 12: Deception, 15: Killing, 16: Support
|
|
|
|
|
|
|
|
|
|
Neutral:
|
|
|
|
|
21: Benign, 22: Evil, 23: Killing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
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
|
|
|
|
|
Category enrollment guide as follows (category property):
|
|
|
|
|
Town:
|
|
|
|
|
1: Random, 2: Investigative, 3: Protective, 4: Government,
|
|
|
|
|
5: Killing, 6: Power (Special night action)
|
|
|
|
|
|
|
|
|
|
Werewolf:
|
|
|
|
|
11: Random, 12: Deception, 15: Killing, 16: Support
|
|
|
|
|
|
|
|
|
|
Neutral:
|
|
|
|
|
21: Benign, 22: Evil, 23: Killing
|
|
|
|
|
|
|
|
|
|
async def on_event(self, event, data):
|
|
|
|
|
"""
|
|
|
|
|
Action guide as follows:
|
|
|
|
|
|
|
|
|
|
Example category:
|
|
|
|
|
category = [1, 5, 6] Could be Veteran
|
|
|
|
|
category = [1, 5] Could be Bodyguard
|
|
|
|
|
category = [11, 16] Could be Werewolf Silencer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Action guide as follows (on_event function):
|
|
|
|
|
_at_night_start
|
|
|
|
|
0. No Action
|
|
|
|
|
1. Detain actions (Jailer/Kidnapper)
|
|
|
|
|
2. Group discussions and Pick targets
|
|
|
|
|
|
|
|
|
@ -52,30 +39,48 @@ class Role:
|
|
|
|
|
4. Non-disruptive actions (seer/silencer)
|
|
|
|
|
5. Disruptive actions (werewolf kill)
|
|
|
|
|
6. Role altering actions (Cult / Mason)
|
|
|
|
|
"""
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
rand_choice = True # Determines if it can be picked as a random
|
|
|
|
|
category = [0] # List of enrolled categories
|
|
|
|
|
allignment = 0 # 1: Town, 2: Werewolf, 3: Neutral
|
|
|
|
|
channel_id = "" # No private channel
|
|
|
|
|
unique = False # Only one of this role per game
|
|
|
|
|
action_list = [
|
|
|
|
|
(self._at_game_start, 0), # (Action, Priority)
|
|
|
|
|
(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),
|
|
|
|
|
(self._at_night_end, 0)
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
|
self.player = None
|
|
|
|
|
self.blocked = False
|
|
|
|
|
self.properties = {} # Extra data for other roles (i.e. arsonist)
|
|
|
|
|
|
|
|
|
|
async def on_event(self, event, data):
|
|
|
|
|
"""
|
|
|
|
|
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]
|
|
|
|
|
await action_list[event][0](data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def assign_player(self, player):
|
|
|
|
|
"""
|
|
|
|
|
Give this role a player
|
|
|
|
|
Can be used after the game has started (Cult, Mason, other role swap)
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
player.role = self
|
|
|
|
|
self.player = player
|
|
|
|
|
|
|
|
|
|
async def _see_role(self, source=None):
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
async def _at_game_start(self, data=None):
|
|
|
|
|
pass
|
|
|
|
@ -83,7 +88,7 @@ class Role:
|
|
|
|
|
async def _at_day_start(self, data=None):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
async def _at_vote(self, target=None):
|
|
|
|
|
async def _at_voted(self, target=None):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
async def _at_kill(self, target=None):
|
|
|
|
|