cleaning templates, getting levels are party counts cached properly

This commit is contained in:
Zachary Watts
2026-04-29 21:32:06 -04:00
parent 15342552f1
commit 0171a05c19
9 changed files with 157 additions and 101 deletions

View File

@@ -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"