-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathknight.py
More file actions
38 lines (28 loc) · 810 Bytes
/
knight.py
File metadata and controls
38 lines (28 loc) · 810 Bytes
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
27
28
29
30
31
32
33
34
35
36
37
38
class Knight:
def __init__(self, skill):
self.health = 100
self.armour = 100
self.skill = skill
#self.score = 0
def in_health(self):
if self.health < 100:
self.health += 10
def dec_health(self):
if self.health >= 50:
self.health -= 50
def dec_health_sp(self):
if self.health >= 50 and self.health < 100:
self.health = 0
else:
self.health -=100
def get_health(self):
return self.health
def in_armour(self):
if self.armour < 100:
self.armour += 5
def dec_armour(self):
self.armour -= 5
def get_armour(self):
return self.armour
def get_skill(self):
return self.skill