No description
Find a file
ronny abraham 7127d48e99 Move class limits into races.yml and fix XP/level handling
Race data:
- Class limits (max level, ability bonuses) now live under each race
  in races.yml instead of under each class in class.yml
- Multiclass rules use {mode: none|any|restricted, combinations: [...]};
  subraces fall back to the race default
- Oriental races get 'none' only; add wild elf subrace (stats are a
  placeholder copied from high elf)

Unclassed characters:
- 'none' is always level 0 with 0 experience; real classes start at
  MIN_CLASS_LEVEL (1)

Levels and XP:
- calc_characterclass_level no longer stops at level 29; capped classes
  stop at their table max, others are unlimited
- Fix XP table overlaps: illusionist 10 and 12, paladin 11,
  magic-user 18, monk 7

Tests:
- Update tests for the new race layout and renamed GenerateClass arg
- Add tests for multiclass modes, subrace fallback, unclassed rules,
  level round trip, level caps and continuous XP tables
- Fix flaky test helpers (level 0 picks, inclusive randint bounds)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:54:25 +03:00
_resources Move class limits into races.yml and fix XP/level handling 2026-10-23 06:54:25 +03:00
_tmp update 2026-10-23 03:06:34 +03:00
lib Move class limits into races.yml and fix XP/level handling 2026-10-23 06:54:25 +03:00
tests Move class limits into races.yml and fix XP/level handling 2026-10-23 06:54:25 +03:00
.gitignore update 2026-10-23 03:06:34 +03:00
__init__.py update 2026-10-23 03:06:34 +03:00
charactergen.py update 2026-10-23 03:06:34 +03:00
gen_inventory.py update 2026-10-23 03:06:34 +03:00
gen_skel.txt update 2026-10-23 03:06:34 +03:00
printoutnpc.py update 2026-10-23 03:06:34 +03:00
readme.md update 2026-10-23 03:06:34 +03:00
yamlvalues.py update 2026-10-23 03:06:34 +03:00

how to call gen_inventory

test

equipment lists

passing in entry values via an equipment list file (see below)

python gen_inventory.py -l _tmp/gen_inventory_arguments.yml --printout --debug-entries   2>&1  | tee -a errormessages.txt

passing in entry values directly

python gen_inventory.py -e '{"weapon": [{"name": "dagger", "quantity":1}], "armor": [ {"name": "leather armor", "quantity": 1, "equipped": true }, {"name": "helmet, great", "quantity": 1, "equipped": true }], "chance": 30}' --debug

python gen_inventory.py -e '{"weapon": [{"name": "dagger", "quantity":1}], "armor": [ {"name": "leather armor", "quantity": 1, "equipped": true }, {"name": "helmet, great", "quantity": 1, "equipped": true }], "chance": 30}'  -e '{"weapon": [{"name": "spear", "quantity":1}, {"name": "sword, short", "quantity": 1} ], "armor": [ {"name": "leather, studded", "quantity": 1, "equipped": true }, {"name": "helmet, great", "quantity": 1, "equipped": true }], "chance": 30}' --debug

format for equipment list file:

yaml file

outputfile: filename.ext

equipmentsets:
  - weapons:
      - name: "weapon name"
        quantity: 1

      - name: "weapon name"
        quantity: 1
        title: "some title"
        bonus: {'hit': 1, 'dam': 1}
 
    armor:
      - name: "armor name"
        quantity: 1
        equipped: True

    chance: 48

armor and weapon values

passing in values on the command line

python gen_inventory.py --printout -w 'sword, long' -w 'sword, short', -w 'mace, footmans' -a 'leather' -a 'studdend leather' --debug > errormessages.txt  2>&1

python gen_inventory.py --printout -w "spear" -w "sword, short" -w "dagger" -w "bow, long" -a "leather armor" -a "clothing" -a "naked"

format for weaposn and armor file

yaml file

outputfile: filename.ext

weaponslist: - name: "weapon name" quantity: 1

- name: "weapon name"
  quantity: 1

- name: "weapon name"
  quantity: 1

armorslist: - name: "armor name" quantity: 1 equipped: true

- name: "armor name"
  quantity: 1
  equipped: true

- name: "armor name"
  quantity: 1
  equipped: true