Random Monster Generator
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file MonsterGen-0.0.6.tar.gz
.
File metadata
- Download URL: MonsterGen-0.0.6.tar.gz
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8acd073a9193d2a25a7ec00c146f0a3ca3f9e51b33e1eca8e5669ff521bc1808 |
|
MD5 | dac8ad0d0205f899bbefd0a515054e30 |
|
BLAKE2b-256 | d54f1b1ccfd8fdb3670801125ff9064ac38085d9f414e3556c6a094bb97ffbd4 |
Provenance
File details
Details for the file MonsterGen-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: MonsterGen-0.0.6-py3-none-any.whl
- Upload date:
- Size: 22.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5211091a332d513892a016fee9a7947e4061ed3a06e0c9265c3ba8fb27db09fc |
|
MD5 | eedbd631c5f41a5d46ef33de65f4bd72 |
|
BLAKE2b-256 | cfd7c84a50086980e24e2a6199a0228ccdea8ca3518704ae88a8fe276c1e4676 |