mirror of
https://github.com/Threnklyn/dungeon-sheets.git
synced 2026-06-05 20:38:26 +02:00
changes spell sorting to alphabetic
This commit is contained in:
@@ -587,7 +587,7 @@ class Character:
|
||||
spells |= set(c.spells_known) | set(c.spells_prepared)
|
||||
if self.race is not None:
|
||||
spells |= set(self.race.spells_known) | set(self.race.spells_prepared)
|
||||
return sorted(tuple(spells), key=(lambda x: (x.level, x.name)))
|
||||
return sorted(tuple(spells), key=(lambda x: (x.name))
|
||||
|
||||
@property
|
||||
def spells_prepared(self):
|
||||
@@ -598,7 +598,7 @@ class Character:
|
||||
spells |= set(c.spells_prepared)
|
||||
if self.race is not None:
|
||||
spells |= set(self.race.spells_prepared)
|
||||
return sorted(tuple(spells), key=(lambda x: (x.level, x.name)))
|
||||
return sorted(tuple(spells), key=(lambda x: x.name))
|
||||
|
||||
def set_attrs(self, **attrs):
|
||||
"""
|
||||
|
||||
@@ -71,9 +71,6 @@ class Spell:
|
||||
def __hash__(self):
|
||||
return 0
|
||||
|
||||
def __lt__(self, other):
|
||||
return (self.level, self.name) < (other.level, other.name)
|
||||
|
||||
@property
|
||||
def component_string(self):
|
||||
s = f'{", ".join(self.components)}'
|
||||
|
||||
Reference in New Issue
Block a user