-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwizzard.py
More file actions
26 lines (22 loc) · 1.01 KB
/
wizzard.py
File metadata and controls
26 lines (22 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from .character import Character
class Wizzard(Character):
"""Class representing a wizzard character.
Attributs: mana
methods = heal, str"""
actions: Character.actions.update({'s': 'se soigner'})
def __init__(self, name = False):
super().__init__(600, 20, 50, 25, name)
# Represents the magical power
self.mana = 200
def heal(self):
"""Function to increase the life of the wizzard with the mana power"""
# The spell requires at least 50 points of mana
if self.mana >= 50:
print("{} lance un puissant sort de soin".format(self.name))
self.mana -= 50
self.life += 20
print("{} regagne 20 points de vie, santé actuelle : {}".format(self.name, self.life))
else :
print("{} tente de puiser en lui les forces nécessaires pour se soigner mais son mana n'est pas suffisant".format(self.name))
def __str__(self):
return "{} : vie = {}, mana = {}".format(self.name, self.life, self.mana)