mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-05 20:38:26 +02:00
add infusions to character template
This commit is contained in:
@@ -533,7 +533,7 @@ class Character():
|
||||
f'Please add it to ``infusions.py``')
|
||||
warnings.warn(msg)
|
||||
_infusions.sort(key=lambda infusion: infusion.name)
|
||||
self.infusions = tuple(I() for I in _infusions)
|
||||
self.infusions = tuple(i() for i in _infusions)
|
||||
else:
|
||||
if not hasattr(self, attr):
|
||||
warnings.warn(f"Setting unknown character attribute {attr}",
|
||||
@@ -728,6 +728,13 @@ class Character():
|
||||
if hasattr(self, 'Druid'):
|
||||
self.Druid.wild_shapes = new_shapes
|
||||
|
||||
@property
|
||||
def infusions_text(self):
|
||||
if hasattr(self, 'Artificer'):
|
||||
return tuple([i.name for i in self.infusions])
|
||||
else:
|
||||
return ()
|
||||
|
||||
@classmethod
|
||||
def load(cls, character_file):
|
||||
# Create a character from the character definition
|
||||
|
||||
@@ -86,7 +86,7 @@ spells_prepared = {{ char.spells_prepared }}
|
||||
wild_shapes = {{ char.all_wild_shapes }} # Ex: ('ape', 'wolf', 'ankylosaurus')
|
||||
|
||||
# Infusions for Artificer
|
||||
infusions = {{ char.infusions }} # Ex: ('repeating shot', 'replicate magic item')
|
||||
infusions = {{ char.infusions_text }} # Ex: ('repeating shot', 'replicate magic item')
|
||||
|
||||
# Backstory
|
||||
# Describe your backstory here
|
||||
|
||||
@@ -92,6 +92,9 @@ spells = spells_prepared + __spells_unprepared
|
||||
# Wild shapes for Druid
|
||||
wild_shapes = () # Ex: ('ape', 'wolf', 'ankylosaurus')
|
||||
|
||||
# Infusions for Artificer
|
||||
infusions = {{ char.infusions_text }} # Ex: ('repeating shot', 'replicate magic item')
|
||||
|
||||
# Backstory
|
||||
# Describe your backstory here
|
||||
personality_traits = """{{ char.personality_traits }}"""
|
||||
|
||||
Reference in New Issue
Block a user