/kaichronicles

Lone Wolf game books player

Primary LanguageTypeScriptGNU General Public License v3.0GPL-3.0

Kai Chronicles

Kai Chronicles is a game player for Lone Wolf game books. Books 1 - 21 are playable. The game player can run as a website.

This is a fork from the original "Kai Chronicles" as tonib stopped development in November 2021.

This repository does not contain game books data. Data must be downloaded from the Project Aon web site. REMEMBER that game books data is under the Project Aon license, so:

  • You cannot put this application on a public web server (only on your local machine, for your own use). The only place where this game can be published is on the Project Aon web site
  • You cannot redistribute the game books data in any way

Setup

Download dependencies

npm install

Download the Project Aon game data:

npm run downloaddata

This will require Node.js (any recent version) and the git client on your path.

Setup web site

npm run serve

Open your browser on http://localhost:3000.

Setup a Docker image

Optional method for running a local website only to play the game

  • Download and install Docker and make sure it's is in your PATH environment variable
  • Using a terminal (Linux or iOS) or PowerShell (Windows 10) navigate to the project's directory
  • Type docker build -t kai:1.16 .
  • Type docker run -p 8080:8080 kai:1.16
  • Open http://localhost:8080

More information about this method here

Developing

Game rules for each book are located at www/data. "mechanics-X" are the game rules for the book X. "objects.xml" are the game objects

There is (unfinished) documentation for rules, object formats and save game file format.

The game rules implementation are at src/ts/controller/mechanics and www/controller/mechanics.

If you add "?debug=true" to the game URL, some debug tools will appear. You also can use the browser Developer Tools to prepare the Action Chart to test individual sections. For example, in the console you can execute things like:

kai.actionChartController.pick('axe')
kai.actionChartController.increaseMoney(-10)

You can run ESLint with this command:

npm run lint

A "guide" to develop new books can be found at doc/README-developing.md

Tests

Tests are run with Selenium Web Driver and Jest. Currently tests will run only with Chrome, and Selenium will need a "browser driver". See https://www.selenium.dev/documentation/en/webdriver/driver_requirements for installation instructions. Tests are located at src/ts/tests. Be sure Typescript for node.js is compiled before running tests:

npm run test

Create a distribution

npm run dist

This will create a dist folder ready to be published on a web server.

License

GPLv3 (see LICENSE file). This application uses the following third-party code / resources: