Skip to content

Commit

Permalink
Merge pull request #9 from Yochien/dev
Browse files Browse the repository at this point in the history
This merge brings the main branch up to date with all major changes made to encounter since the beginning of 2023.

New features include:
- Use YAML as the input file format.
- Nickname command to give NPCs unique names.
- Mark command to add notes to specific NPCs.
- Rank command to manually order NPCs.
- More commands implement the `all` and `multiple selection` selectors. See the detailed help menu to see which ones.

Changes:
- Improved command documentation. The detailed help screen now provides command aliases and valid selectors.
- Commands provide more detailed error messages when used wrongly.

Some bug fixes:
- Arguments passed to commands are now no longer always lowercase.
  • Loading branch information
Yochien committed Aug 7, 2023
2 parents 9669212 + 6c103b4 commit df3237a
Show file tree
Hide file tree
Showing 10 changed files with 1,005 additions and 625 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
extend-ignore = E251
max-line-length = 120
12 changes: 8 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
name: Tests

on:
- push
- pull_request
pull_request:
push:
branches:
- main

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.10']
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11']

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install pyyaml
- name: Test with Python unittest
run: python -m unittest
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# encounter

A script that manages a combat encounter for tabletop rpgs.
Run with python command in your shell environment.
Enter help in the program to view a list of available commands and their functions.
An interactive command-line script that manages a combat encounter for tabletop rpgs.
Run from the highest level directory (the one containing bestiary.txt) using the python command in your terminal.

* Install with pip to run from anywhere.

Enter `help` once the program has started to view a list of available commands and their functions.

* Create your own NPCs to add to your encounter. See the `make` command to create them dynamically or check the provided bestiary.yaml file for the proper format.

## Dependencies

* Python 3.10 or higher
* Recommended to have a "bestiary.txt" file. An example bestiary file with its associated formatting is included.
* If no bestiary file is found the program loads some generic entries.
* Python 3.11 or higher
* PyYAML
15 changes: 0 additions & 15 deletions bestiary.txt

This file was deleted.

33 changes: 33 additions & 0 deletions bestiary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Example bestiary file for an encounter

# Creatures
Wolf:
hp: 11
ac: 13
Fox:
hp: 3
ac: 12
comment: this note will be ignored
Spider:
hp: 1
ac: 12
description: A tiny creepy crawley creature

# Fantasy
Skeleton:
hp: 13
ac: 13
Zombie:
hp: 16
ac: 15
Dragon:
hp: 150
ac: 18

# Human
Townsfolk:
hp: 9
ac: 12
Guard:
hp: 25
ac: 13
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@ build-backend = "setuptools.build_meta"

[project]
name = "encounter"
version = "4.17.0"
requires-python = ">=3.10"
version = "4.20.1"
description = "Interactive command-line tool for managing tabletop combat encounters."
requires-python = ">=3.11"
dependencies = [
"pyyaml",
]

[tool.setuptools]
package-dir = {"" = "src"}
Loading

0 comments on commit df3237a

Please sign in to comment.