Skip to content

Commit

Permalink
Merge pull request #164 from kloetzl/custom-monsters
Browse files Browse the repository at this point in the history
gm_notes: allow custom monsters
  • Loading branch information
canismarko authored Mar 11, 2024
2 parents ea163db + 839821b commit db3a05f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
3 changes: 3 additions & 0 deletions dungeonsheets/make_sheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ def make_gm_sheet(
if isinstance(monster, monsters.Monster):
# It's already a monster, so just add it
new_monster = monster
elif isinstance(monster, type) and issubclass(monster, monsters.Monster):
# Needs to be instantiated
new_monster = monster()
else:
try:
MyMonster = find_content(monster, valid_classes=[monsters.Monster])
Expand Down
37 changes: 35 additions & 2 deletions examples/gm-session-notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"""

from dungeonsheets import mechanics
from dungeonsheets import mechanics, monsters
from dungeonsheets.stats import Ability


# This line (or one like it) is required in order for dungeonsheets to
Expand All @@ -28,9 +29,41 @@
# *parent_sheets* attribute.
parent_sheets = ["gm-campaign-notes.py"]


class Pting(monsters.Monster):
"""
A tiny beast with an insatiable hunger for metal.
"""
name = 'Pting'
description = 'Small beast, unaligned'
challenge_rating = 0
armor_class = 14
skills = ''
senses = ''
languages = ''
strength = Ability(12)
dexterity = Ability(16)
constitution = Ability(15)
intelligence = Ability(4)
wisdom = Ability(10)
charisma = Ability(9)
speed = 30
swim_speed = 0
fly_speed = 40
climb_speed = 0
burrow_speed = 0
hp_max = 30
hit_dice = ''
condition_immunities = 'exhaustion, frightened, paralyzed, poisoned'
damage_immunities = 'necrotic, poison'
damage_resistances = ''
damage_vulnerabilities = ''
spells = []


# Defining a *monsters* attribute will include their stat blocks in
# the output
monsters = ["aboleth", "wolf", "giant eagle", "Vashta Nerada", "priest", "priest"]
monsters = ["aboleth", "wolf", "giant eagle", "Vashta Nerada", Pting]

# Arbitrary sections can be added to the GM notes. The
# ``extra_sections`` attribute should be a sequence of subclasses of
Expand Down

0 comments on commit db3a05f

Please sign in to comment.