def level_up(self): self.xp_to_next_level, sp = combat.next_level(self.level) self.unused_skill_points += sp self.level += 1 self.max_hp += combat.hp_bonus(self.stats[3]) hp = self.max_hp self.hp = hp
def __init__(self, hp, defense, power, death_function=None, Con=10, Str=10, Dex=10, Int=10, money=0,ticker=None,speed=0,xp_value=0): self.death_function = death_function self.type = 'melee' self.money = money self.speed = speed self.level = 1 self.current_xp = xp_value self.xp_to_next_level = 1000 self.inventory = [] self.owner = None self.ticker = ticker self.stats = [Str, Dex, Int, Con] self.unused_skill_points = 2 self.defense = 0 self.max_hp = combat.hp_bonus(Con) hp = self.max_hp self.hp = hp self.armor_bonus = 0 self.armor_penalty = 0 '''self.max_mp = 1 + (2*self.stats[2]) mp = self.max_mp self.mp = mp''' self.equipment = [None, None, None, None, None, None, None, None] #accessories self.accessories = [None, None, None] #weapons/shield self.wielded = [None, None] self.skills = copy.deepcopy(combat.skill_list) # skill list needs to have its own copies
def level_up(self): self.xp_to_next_level, sp = combat.next_level(self.level) self.unused_skill_points += sp self.level += 1 self.max_hp += combat.hp_bonus(self.stats[3]) hp = self.max_hp self.hp = hp self.current_xp = 0
def __init__(self, hp, defense, power, death_function=None, Con=10, Str=10, Dex=10, Int=10, money=0, ticker=None, speed=0, xp_value=0): self.death_function = death_function self.type = 'melee' self.money = money self.speed = speed self.level = 1 self.current_xp = xp_value self.xp_to_next_level = 1000 self.inventory = [] self.owner = None self.ticker = ticker self.stats = [Str, Dex, Int, Con] self.unused_skill_points = 2 self.defense = 0 self.depth = 0 self.threat = 0.0 self.max_hp = combat.hp_bonus(Con) hp = self.max_hp self.hp = hp self.armor_bonus = 0 self.armor_penalty = 0 '''self.max_mp = 1 + (2*self.stats[2]) mp = self.max_mp self.mp = mp''' self.equipment = [None, None, None, None, None, None, None, None] #accessories self.accessories = [None, None, None] #weapons/shield self.wielded = [None, None] self.skills = copy.deepcopy( combat.skill_list) # skill list needs to have its own copies