mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-03 19:38:30 +02:00
When resolving +1 weapons, replaced check for inheritance from Weapon
with check for *improved_version* method. Fixes https://github.com/canismarko/dungeon-sheets/issues/112
This commit is contained in:
@@ -136,13 +136,8 @@ class ContentRegistry:
|
||||
else:
|
||||
attr = found_attrs[0]
|
||||
# Apply weapon/etc. bonuses
|
||||
if bonus > 0:
|
||||
if (
|
||||
issubclass(attr, weapons.Weapon)
|
||||
or issubclass(attr, armor.Shield)
|
||||
or issubclass(attr, armor.Armor)
|
||||
):
|
||||
attr = attr.improved_version(bonus)
|
||||
if bonus > 0 and hasattr(attr, 'improved_version'):
|
||||
attr = attr.improved_version(bonus)
|
||||
return attr
|
||||
|
||||
|
||||
|
||||
@@ -113,7 +113,6 @@ def create_random_tables_content(
|
||||
) -> str:
|
||||
template = jinja_env.get_template(f"random_tables_template.{suffix}")
|
||||
return template.render(
|
||||
conjure_animals=True,
|
||||
tables=tables,
|
||||
use_dnd_decorations=use_dnd_decorations,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user