def __init__(self, name, hp, maxHealth, strength, weapon=Weapon("Short Sword"), armor=Armor("Cloth Armor"), bonuses=[], inventory={}, statuses=[], gold=0): self.name = name self.health = hp self.maxHealth = maxHealth self.strength = strength self.weapon = weapon self.armor = armor self.bonuses = bonuses # all types of bonuses, they handle their own action based on state code self.inventory = inventory self.statuses = statuses self.gold = gold
def setUp(self): self.weapon = Weapon()