Added a content registry, so homebrew content can be referenced by name.

This commit is contained in:
Mark Wolfman
2021-06-13 14:29:57 -05:00
parent 1abfcaf657
commit cc430720fb
13 changed files with 200 additions and 92 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ from collections import defaultdict
from dungeonsheets import exceptions, features, monsters, weapons
from dungeonsheets.classes.classes import CharClass, SubClass
from dungeonsheets.stats import findattr
from dungeonsheets.content_registry import find_content
# PHB
@@ -272,7 +272,7 @@ class Druid(CharClass):
else:
# Not already a monster so see if we can find one
try:
NewMonster = findattr(monsters, shape)
NewMonster = find_content(shape, valid_classes=[monsters.Monster])
new_shape = NewMonster()
except AttributeError:
msg = (