Storyteller tools for Blood on the Clocktower
  • TypeScript 98%
  • HTML 1%
  • JavaScript 0.7%
  • Dockerfile 0.3%
Find a file
Dae Lorant 2bef977b8c
Add support for "loric" role type in game logic (#76)
This pull request introduces support for a new role type, `loric`,
across several parts of the codebase. The main changes ensure that
`loric` is treated similarly to existing special roles like `fabled` and
`travellers` in role definitions, setup logic, script filtering,
selection requirements, and UI pluralization.

Role definition and handling:

* Added `loric` to the `RoleTypes` array and updated the `CharacterInfo`
class so that `loric` is considered a special role alongside `fabled`
and `travellers`.
[[1]](diffhunk://#diff-33f0dcf99a76d4de3eacdb145c7016294a7366caa02d110d3beacc7d1f9fbca7R34)
[[2]](diffhunk://#diff-33f0dcf99a76d4de3eacdb145c7016294a7366caa02d110d3beacc7d1f9fbca7L73-R74)

Setup and filtering logic:

* Modified the `goesInBag` function in `setup.ts` so that characters
with the `loric` role type do not go in the bag, matching the behavior
for `fabled`.
* Updated the `onlyBaseThree` function in `script.ts` to include `loric`
as a valid role type for base three scripts.

Selection and UI:

* Changed the `requiredSelection` function in `selection.ts` so that
`loric` roles are always required selections, just like `fabled`.
* Updated the `pluralRole` function in `character_sheet.tsx` to treat
`loric` as a plural role type for UI display purposes.

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: ratteler50 <4249192+ratteler50@users.noreply.github.com>
2026-07-14 08:13:52 -07:00
.github/workflows Temporarily disable typechecking in CI 2025-11-12 18:28:43 -06:00
.vscode Upgrade to TypeScript 5.9 (#66) 2025-08-06 13:26:57 -07:00
assets Remove parcel and only use vite (#55) 2025-06-16 21:06:39 -05:00
extra_scripts Updated the Oops! All Pit-Hags script with the latest characters like… (#71) 2025-08-19 09:44:33 -05:00
fetch_assets Fix refresh after Townsquare data merge (#78) 2026-07-13 21:28:36 -07:00
hash_password Bump target from es2016 to es2018 2024-07-14 17:35:30 -05:00
homebrew_scripts Renamed the Brainrot characters to have a suffix 2025-04-01 14:47:16 -07:00
icons Change the icon 2023-07-14 19:10:44 -07:00
screenshots Add a button to copy the script as JSON 2024-07-17 13:45:30 -07:00
src Add support for "loric" role type in game logic (#76) 2026-07-14 08:13:52 -07:00
test JSX is no longer in the global namespace 2024-12-29 11:00:24 -08:00
.babelrc Use emotion's documented babel config 2023-07-03 12:35:33 -07:00
.gitignore Remove parcel and only use vite (#55) 2025-06-16 21:06:39 -05:00
.markdownlint.jsonc Bump prettier version 2024-03-03 11:06:09 -06:00
.nvmrc Build with vite by default (#53) 2025-06-16 19:39:16 -05:00
.prettierignore Remove parcel and only use vite (#55) 2025-06-16 21:06:39 -05:00
.prettierrc.mjs Actually sort imports 2024-12-29 02:45:30 -08:00
docker-compose.yml Added support for Docker 2025-02-21 21:49:21 -08:00
Dockerfile Added support for Docker 2025-02-21 21:49:21 -08:00
eslint.config.mjs Fix some lint issues 2025-06-17 08:11:17 -05:00
FEATURES.md Documentation updates 2024-03-02 20:41:28 -06:00
LICENSE Rename license file 2025-06-16 19:27:22 -05:00
package.json Attempt to compress JSON in URL (#73) 2025-10-27 07:45:24 -05:00
posthtml-include.d.ts Fix some lint issues 2025-06-17 08:11:17 -05:00
README.md Switch from azurewebsites URL to botcscripts.com (#65) 2025-08-01 09:23:39 -05:00
tsconfig.json JSX is no longer in the global namespace 2024-12-29 11:00:24 -08:00
vite.config.ts Add support for "loric" role type in game logic (#76) 2026-07-14 08:13:52 -07:00
workbox-config.js Fix some lint issues 2025-06-17 08:11:17 -05:00
yarn.lock Update caniuse 2025-09-01 12:59:41 -05:00

BotC storyteller tools

build refresh

Tools for the storyteller in Blood on the Clocktower, for supporting in-person games.

Role assignment: Select roles for a script and randomize them. Helps set up a game that will otherwise be run from a tablet or a piece of paper.

Night sheet: Generate a good-looking and useful night sheet for a custom script, with instructions for each character, similar in style to the base 3 scripts. These print nicely, with a page for the first night and another for other nights.

Role sheet: A replacement for the script tool's character sheet (for players) that is useful to the storyteller, and a useful replacement for existing options on mobile.

Role assignment features

The highlights are that the tool helps you pick characters and distribute them to players, and it all works offline. The app has all scripts from the unofficial script database. See this detailed list of features for more, as well as some screenshots.

Setting up for development

Install yarn and nvm.

nvm use
yarn install
yarn fetch-assets --json
yarn run check

The project now uses Vite as the default build tool instead of Parcel.

The last command fetches the JSON assets, which are needed for the code to build.

Run yarn run check to run eslint, check formatting, and check types with TypeScript. Run yarn run fmt to automatically fix formatting with prettier.

Download assets

yarn fetch-assets

This fetches character icons, and all the scripts from https://botcscripts.com - it will take a couple minutes. Running multiple times won't re-download images and scripts. If you want to re-fetch, delete the downloaded assets:

yarn fetch-assets --clean

Running the website

Use yarn start to run a development server.

To build an optimized, static version of the site to dist/, run yarn build.

Testing

There is currently no testing framework setup. This is not intentional, I just haven't set one up. (A contribution that sets up testing would be very useful!)

There is infrastructure for some automated browser screenshots:

yarn test-screenshots

test-screenshots takes some options, run it with yarn test-screenshots --help to see them.

Building and Running with Docker

To build and run the application using Docker, follow these steps:

Build the Docker Image

First, build the Docker image using the provided Dockerfile:

docker build -t botc:latest .

Run the Docker Container

To run the Docker container and map the necessary ports, use the following command:

docker run -p 8000:8000 -it botc:latest

This command maps port 8000 on your host machine to port 8000 in the container, making the application accessible at http://localhost:8000.

Using Docker Compose

Alternatively, you can use Docker Compose to build and run the application. Ensure you have a docker-compose.yml file with the appropriate configuration.

To start the application with Docker Compose, run:

docker-compose up

This will build the image (if not already built) and start the container with the port mappings specified in the docker-compose.yml file.

Stopping the Docker Container

To stop the running Docker container, press Ctrl+C in the terminal where the container is running, or use the following command to stop it gracefully:

docker stop <container_id>

Replace <container_id> with the actual container ID, which you can find using:

docker ps

Acknowledgments and Copyrights

  • Blood on the Clocktower is a trademark of Steven Medway and The Pandemonium Institute
  • Night reminders and other auxiliary text written by Ben Finney
  • Iconography by Font Awesome
  • All other images and icons are copyright their respective owners

This project and its website are provided free of charge and are not affiliated with The Pandemonium Institute in any way.