mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-05-18 20:23:27 +02:00
tested version of character et al
This commit is contained in:
@@ -1000,7 +1000,7 @@ class Character(Creature):
|
||||
f"Companion '{beast}' not found. Please add it to"
|
||||
" ``monsters.py``" )
|
||||
beast = self._resolve_mechanic(beast, monsters.Monster, msg)
|
||||
self.Ranger.ranger_beast = (beast, self.proficiency_bonus)
|
||||
self.Ranger.ranger_beast = (beast(), self.proficiency_bonus)
|
||||
|
||||
@property
|
||||
def companions(self):
|
||||
@@ -1019,7 +1019,7 @@ class Character(Creature):
|
||||
f"Companion '{compa}' not found. Please add it to"
|
||||
" ``monsters.py``" )
|
||||
new_compa = self._resolve_mechanic(compa, monsters.Monster, msg)
|
||||
companions_list.append(new_compa)
|
||||
companions_list.append(new_compa())
|
||||
# Save the updated list for later
|
||||
self._companions = companions_list
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ def read_dice_str(dice_str):
|
||||
|
||||
"""
|
||||
dice_str = dice_str.replace(" ", "").replace("\n", "")
|
||||
match = dice_re.match(dice_str)
|
||||
match = dice_re.search(dice_str)
|
||||
if match is None:
|
||||
raise DiceError(f"Cannot interpret dice string {dice_str}")
|
||||
num, faces = int(match.group(1)), int(match.group(2))
|
||||
@@ -79,8 +79,3 @@ def dice_roll_mean(dice_text):
|
||||
dice = read_dice_str(dice_text)
|
||||
return round(_dice_mean(dice))
|
||||
|
||||
if __name__ == "__main__":
|
||||
ds = "10d12+10"
|
||||
v = read_dice_str(ds)
|
||||
print(v)
|
||||
print(_dice_mean(v))
|
||||
@@ -92,7 +92,7 @@ def create_monsters_content(
|
||||
template = jinja_env.get_template(base_template+f".{suffix}")
|
||||
spell_list = [Spell() for monster in monsters for Spell in monster.spells]
|
||||
return template.render(monsters=monsters,
|
||||
use_dnd_decorations=use_dnd_decorations, spell_list=spell_list)
|
||||
use_dnd_decorations=use_dnd_decorations, spell_list=spell_list)
|
||||
|
||||
|
||||
def create_gm_spellbook(spell_list, suffix):
|
||||
|
||||
Reference in New Issue
Block a user