-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
68 lines (47 loc) · 1.85 KB
/
main.py
File metadata and controls
68 lines (47 loc) · 1.85 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
class Enemy:
def __init__(self, type_of_enemy, health_points, attack_damage):
self.__type_of_enemy = type_of_enemy
self.health_points = health_points
self.attack_damage = attack_damage
def get_type_enemy(self):
return self.__type_of_enemy
def talk(self):
print(f"{self.__type_of_enemy}. parent class definition!")
def walk_forward(self):
print(f"{self.__type_of_enemy} moves closer to you.")
def attack(self):
print(f"{self.__type_of_enemy} attacks for {self.attack_damage}.")
class Skultula(Enemy):
def __init__(self, health_points, attack_damage):
super().__init__(type_of_enemy='Skultula',
health_points=health_points,
attack_damage=attack_damage)
def talk(self):
print("*chuckle")
def bone_attack(self):
print(f"{self.get_type_enemy} is attacking with it's hard bones!")
class Gannondorf(Enemy):
def __init__(self, health_points, attack_damage):
super().__init__(type_of_enemy='Gannondorf',
health_points=health_points,
attack_damage=attack_damage)
def talk(self):
print("Muhahahaha!")
def prince_of_darkness(self):
print(f"{self.get_type_enemy()}'s aura reduces courage...")
skullkid = Skultula(100, 100)
skullkid.talk()
skullkid.walk_forward()
skullkid.bone_attack()
skullkid.attack()
print(skullkid.get_type_enemy())
print(skullkid.health_points)
print(skullkid.attack_damage)
gannondorf = Gannondorf(1000, 1000)
gannondorf.talk()
gannondorf.prince_of_darkness()
gannondorf.walk_forward()
gannondorf.attack()
print(gannondorf.get_type_enemy())
print(gannondorf.health_points)
print(gannondorf.attack_damage)