wOxlf/README.md

134 lines
4.6 KiB
Markdown

# wOXlf
Discord bot for managing an anonymous [Werewolf Game](https://en.wikipedia.org/wiki/Mafia_(party_game)).
## How It Works
A host gets a list of players to play, and then begins the game with the `$start` command.
Each player is assigned a channel where they will view the game through. The player can read and send messages
in this channel normally. When a message is sent, it is forwarded to all other player channels. The message's author
is obscured by a codename. During day phases, players can cast a vote for who they wish to "terminate" that day.
The game proceeds as a normal Werewolf game.
## Channels
* Host Channel: Used by the host to interact with the game, can also be used by spectators to see the game state.
* Real player names are displayed along with code names in this channel
* Player Channel: A channel for a single player, allows them to chat with the other players and run commands.
* Vote Channel: Contains all the votes made in a game.
## Commands
## Host
* `$start <hours>h<minutes>m <list of player ids>` - starts the game
* `$end` - Ends the current game
* `$say <msg>` - Allows the host to speak into the game chat
* `$broadcast <msg>` - Broadcasts a system message, this message is then pinned in each player channel
* `$next_phase <hours>h<minutes>m <msg>` - Send the next phase message. Also cycles the phase
* `$terminate <player>` - Kills a player and removes them from the game
* `$add_time <hours>h<minutes>m` - Adds more time to the current game
## Players
* `$vote <player>` - Casts a vote for a player to be terminated. Only can be used during the day phase
* `$status` - Get the current game status. Includes time left in the phase and current vote tallies
* `$players` - Lists all the players in the game
## Example Config
```toml
# Directory to store the game state in
game_state_dir = "."
# imgur API client id
imgur_client_id = ""
# Discord Bot Config
[discord_config]
# Bot token
token = ""
# Bor app id
app_id = 0
# Channel for the host to interact the bot
host_channel = 949483310613143564
# Webhook id for the host channel
host_webhook_id = 955135068341415996
# CHannel to post vote status
vote_channel = 950078550717923329
# Category to create player channels under
category = 949766593322303518
# An example game config
[[game_config]]
# Game name, used to identify this config
game_name = "rouge_ai"
# The bot's name for this game
bot_name = "WOxlf"
# Vote phase name
vote_phase_name = "Day"
# Enemy phase name
enemy_phase_name = "Night"
# Imgur album hash for profile pics
profile_album_hash = "Raf84L4"
# PLayer group name
player_group_name = "Test Subjects"
# Names used for codename generation
first_name = ["Sleepy", "Drunk", "Smart", "Gifted", "Extreme", "Eccentric", "Amazing", "Bad", "Silly", "Dumb", "Smelly",
"Gooey", "Ok", "Poor", "Fast", "Gentle", "Dangerous", "Spooky", "Soft", "Small", "Big"]
last_name = ["Engineer", "Scientist", "Dancer", "Farmer", "Captain", "Janitor", "Author", "Bartender", "Bum",
"Student", "Teacher", "Chef", "Waiter", "Comedian", "Doctor", "Athlete", "Gamer"]
# Message config for this game
[game_config.messages]
# Format of the codenames
name_format = "{{ first_name }} {{ last_name }}"
# Welcome message to send to players at the start of a game
welcome_message = '''
Welcome {{ discord_user.mention }} to your WOxlf Terminal. You may use this terminal to communicate to other subjects.
You will also use this terminal for choosing one of your fellow subjects for termination.
Happy testing :)
Do $help to see all commands.
**SUBJECT CODENAME: {{ player_data.codename }}**
'''
# Status message format
status_message = '''
**EXPERIMENT STATUS**
CURRENT EXPERIMENT PHASE: {{ game_state.current_phase }} {{ game_state.phase_number}}
PHASE END TIME: {{ to_local_time(time=game_state.phase_end_time) }}
PHASE ENDING {{ to_countdown(time=game_state.phase_end_time) }}
**TEST SUBJECTS REMAINING:**
{% for player in game_state.player_data %}* {{ player.codename }}
{% endfor %}
'''
# Wrapper for annoucments
announcement_format = '''
**\*\*IMPORTANT wOxlf SYSTEM MESSAGE\*\***
{{ message }}
**\*\*END OF SYSTEM MESSAGE\*\***
'''
# Vote tally message format
tally_message = '''
{% if tallies | length == 0 %} NO TERMIANTION VOTES HAVE BEEN CAST! {% else %}
**TERMINATION VOTE TALLIES:**
{% for target, count in tallies %}* {{ target }}: {{ count }} {% endfor %}
{% endif %}
'''
# Vote message format, used in the vote status channel
vote_message = "{{ player_data.codename }} has selected {{ target_data.codename }} for termination."
# Message to send whene extending a phase
phase_extend_message = "THE EXPERIMENT PHASE HAS BEEN EXTENDED!!!!"
```
## License
[MIT License](./LICENSE)