cleaning templates, getting levels are party counts cached properly
This commit is contained in:
@@ -10,9 +10,9 @@ def roll_dice(count, sides):
|
||||
|
||||
# Player Character Classes
|
||||
class Adventurer:
|
||||
def __init__(self, c_id: int, level=1, attributes={}) -> None:
|
||||
def __init__(self, c_id: str, level=1, attributes={}) -> None:
|
||||
# using a get() method to pull an attribute else use a default value, https://python-academy.org/en/handbook/get
|
||||
self.id = c_id
|
||||
self.identifier = c_id
|
||||
self.player_class = None
|
||||
self.level = level
|
||||
self.strength = attributes.get('strength', roll_dice(3,6))
|
||||
@@ -117,6 +117,10 @@ class Adventurer:
|
||||
spell_book.append(random_spell)
|
||||
return spell_book
|
||||
|
||||
def set_level(self, new_level):
|
||||
self.level = new_level
|
||||
|
||||
|
||||
|
||||
class Fighter(Adventurer):
|
||||
adv_class = "fighter"
|
||||
|
||||
Reference in New Issue
Block a user