Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Player:
- def __init(self, name, hp, mp):
- self.name = name
- seld.hp = hp
- self.mp = mp
- self.skills = {}
- self.guild = "Unaffiliated"
- def add_skill(self, skill_name, mana_cost):
- if skill_name in self.skills:
- return "Skill already added
- self.skills[skill_name] = mana_cost
- return f"Skill {skill_name} added to the collection of the player {self.name}"
- def player_info(self):
- result = f"Name: {self.name}\n"
- result += f"Guild: {self.guild}\n"
- result += f"HP: {self.hp}\n"
- result += f"MP: {self.mp}\n"
- for s, m in self.skills.items():
- result += f"==={s} - {m}\n"
- return result.strip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement