Skip to main content

MonsterGen

MonsterGen is based on Fortuna and Storm by Robert Sharp.

  • Fortuna: Random Value Toolkit for Generative Modeling.
  • Storm: High-performance Random Number Engine.

Installation

$ pip install MonsterGen

Index

  • CR
  • Random Monsters
  • Random NPCs
  • Random Traps
  • Random Treasure

CR Class

CR(cr) -> CR

  • cr: required int, -3 to 30

The CR class is a numeric system representing the relative power of a monster in D&D 5e. This system is a bit funky with values below 1, be careful... here be dragons! CR less than 1 are printed as fractions but valued mathematically as integers [-3, 0]. See below:

CR Mapping

from MonsterGen import CR

print(f"CR: {CR(-3)}")
print(f"CR: {CR(-2)}")
print(f"CR: {CR(-1)}")
print(f"CR: {CR(0)}")
print(f"CR: {CR(1)}")
print(f"CR: {CR(2)}")
print(f"CR: {CR(3)}")
print('...')
print(f"CR: {CR(30)}")
CR: 1/16
CR: 1/8
CR: 1/4
CR: 1/2
CR: 1
CR: 2
CR: 3
...
CR: 30

Party Adapter Class Method

CR.player_adapter(average_level, num_players=5, difficulty=0) -> CR

Class method for computing CR from party composition and difficulty setting.

  • average_level: required int, 1 to 20
  • num_players: optional int, 1 to 9
  • difficulty: optional int, -5 to 5
    • Stupid Easy: -5 to -4
    • Easy: -3 to -2
    • Normal: -1 to 1
    • Epic: 2 to 3
    • Legendary: 4 to 5

Monster Class

Monster(cr, monster_type=None) -> Monster

  • cr: required int, -3 to 30
  • monster_type: optional str, ["Aberration", "Beast", "Celestial", "Construct", "Dragon", "Elemental", "Fey", "Fiend", "Giant", "Humanoid", "Monstrosity", "Plant", "Ooze", "Undead"]
from MonsterGen import Monster, CR

monster_cr = CR(10)
print(Monster(monster_cr, monster_type='Aberration'))
Name: Grell
Type: Aberration
CR: 7
Hit Points: 164
Armor Class: 12
Attack Bonus: 9
Typical Damage: 45 - 50
Save DC: 15
XP Value: 2900

NPC Class

Npc() -> Npc

Produces a random NPC.

from MonsterGen import Npc

print(Npc())
Profession: Bookbinder
Race: Tiefling
Background: Soldier
Appearance: Flamboyant or outlandish clothes
Mannerism: Speaks in rhyme
Hit Points: 8
Armor Class: 11
Damage: 1

Random Trap Factory Function

random_trap(cr, dam_type=None) -> Trap

  • cr: required int, -3 to 30
  • dam_type: optional str, ['bludgeoning', 'falling', 'piercing', 'slashing', 'poison', 'acid', 'fire', 'lightning', 'cold', 'necrotic']

Produces a random trap. If dam_type is None it will choose a random damage type.

from MonsterGen import random_trap

print(random_trap(10, dam_type="fire"))
Name: Inferno
Type: Minor Trap
CR: 10
Spot & Disarm: DC: 10
Save vs: WIS DC 11 for half damage
Damage: 3d4 fire
Disarm XP: 5900

Monster Loot Factory Function

monster_loot(cr) -> Loot

  • cr: required int, -3 to 30

Produces random treasure for a single monster. Typically this is just coinage.

from MonsterGen import monster_loot

print(monster_loot(10))
Copper Coins: 1800
Electrum Coins: 50

Horde Loot Factory Function

horde_loot(cr) -> Loot

  • cr: required int, -3 to 30

Produces random treasure for a boss or horde of monsters. High-quality loot with magic items appropriate to the CR.

from MonsterGen import horde_loot

print(horde_loot(10))
Copper Coins: 400
Silver Coins: 7000
Gold Coins: 2200
Platinum Coins: 140
Jewels: 50 GP
Oil of etherealness
Quaal's feather token

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MonsterGen-0.0.7.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

MonsterGen-0.0.7-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file MonsterGen-0.0.7.tar.gz.

File metadata

  • Download URL: MonsterGen-0.0.7.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for MonsterGen-0.0.7.tar.gz
Algorithm Hash digest
SHA256 e1ee317dae2238efa0590f946e49cc4458cbdf2256a9ddd4940c89d87f6c86b7
MD5 91b13fb874c763e1740ae50977d2ff73
BLAKE2b-256 0f10c87eb48e185b413fb8bf48a9da5707f3053b5dc3b049decdb4070e9c3462

See more details on using hashes here.

File details

Details for the file MonsterGen-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: MonsterGen-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.0.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for MonsterGen-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e4f104bd8f66e42bc42db2620a77a678f593ce54b8592d8fa42f688108f9cc9e
MD5 2d5d192b10c476387f66d5be9da51432
BLAKE2b-256 d8fff194b323d44798455790ede695162eea8500977a8b8f0717752c03ac2b96

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.7 This release

2 files

0.0.6

2 files

0.0.4

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page