canismarko / dungeon-sheets

A tool to create character sheets and GM session notes for Dungeons and Dragons fifth edition (D&D 5e).
https://dungeon-sheets.readthedocs.io/en/latest/
GNU General Public License v3.0
161 stars 66 forks source link

allow multiclassing of magic weapons #126

Closed canismarko closed 2 years ago

canismarko commented 2 years ago

Currently, weapons can either subclass from mechanics.Weapon or mechanics.MagicItem but not both. This means for a magic weapon you need two separate classes: 1 as a magic item and 1 as a weapon. It would be nice to allow multi-classing so it can be included in both lists:

class VorpalSword(mechanics.MagicItem, mechanics.Weapon): ...

weapons = [..., VorpalSword()] magic_items = [..., VorpalSword()]

canismarko commented 2 years ago

Fixed in c9a0eb1f0e843bcdf54e81e7ed8dae071783460d and 4691e154fd05a9fc7b49e8f1f985f766cff8b826