updated so all tests pass except distinct changes to desired implementation

This commit is contained in:
Ben Cook
2018-12-22 15:17:58 -05:00
parent 8ff94d0f13
commit 40b070d782
5 changed files with 259 additions and 164 deletions
+10 -2
View File
@@ -30,11 +30,15 @@ class Spell():
materials = ""
duration = "instantaneous"
ritual = False
_concentration = False
magic_school = ""
classes = ()
def __str__(self):
s = self.name + ' ({:s}) '.format(','.join(self.components))
if len(self.components) == 0:
s = self.name
else:
s = self.name + ' ({:s}) '.format(','.join(self.components))
# Indicate if this is a ritual or a concentration
indicators = [('R', self.ritual), ('C', self.concentration), ('$', self.special_material)]
indicators = tuple(letter for letter, is_active in indicators if is_active)
@@ -60,7 +64,11 @@ class Spell():
@property
def concentration(self):
return ('concentration' in self.duration.lower())
return ('concentration' in self.duration.lower()) or self._concentration
@concentration.setter
def concentration(self, val: bool):
self._concentration = val
@property
def special_material(self):