-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCharakter.py
128 lines (103 loc) · 3.53 KB
/
Charakter.py
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import Items as Item
import random
class Charakter:
def __init__(self, hp, ad, drop, name):
self.hp = hp
self.ad = ad
self.name = name
self.drop = drop
def getroffen(self, ad):
self.hp = self.hp - ad
if self.hp <= 0:
self.sterben()
def ist_tot(self):
return self.hp <= 0
def sterben(self):
print(self.name + " ist gestorben")
class Bokblin(Charakter):
def __init__(self):
rand = random.randint(1, 3)
if rand == 1:
self.drop = Item.Gesundheitstrank(30)
elif rand == 2:
self.drop = Item.Schwert("Bokblin-Knochen", 1, 105)
else:
self.drop = Item.Gesundheitstrank(20)
self.ep = 10 * rand
Charakter.__init__(self, 100, 10, self.drop, "Bokblin")
class Moblin(Charakter):
def __init__(self):
rand = random.randint(1, 3)
if rand == 1:
self.drop = Item.Gesundheitstrank(50)
elif rand == 2:
self.drop = Item.Gesundheitstrank(30)
else:
self.drop = Item.Schwert("Antikes Schwert", 2, 140)
self.ep = 25 * rand
Charakter.__init__(self, 200, 20, self.drop, "Moblin")
class Oktorok(Charakter):
def __init__(self):
rand = random.randint(1, 4)
if rand == 1:
self.drop = Item.Erfahrungstrank(100)
elif rand == 2:
self.drop = Item.Schwert("Ritterschwert", 2, 126)
elif rand == 3:
self.drop = Item.Schwert("Soldatenschwert", 2, 114)
else:
self.drop = Item.Gesundheitstrank(100)
self.ep = 20 * rand
Charakter.__init__(self, 50, 20, self.drop, "Oktorok")
class Leune(Charakter):
def __init__(self):
self.drop = []
rand = random.randint(1, 2)
if rand == 1:
self.drop = Item.Gesundheitstrank(200)
elif rand == 2:
self.drop = Item.Schwert("Leunenschwert", 3, 124)
else:
self.drop = Item.Erfahrungstrank(1000)
self.ep = 100 * rand
Charakter.__init__(self, 500, 50, self.drop, "Leune")
class Waechter(Charakter):
def __init__(self):
self.drop = []
self.ep = 350
Charakter.__init__(self, 500, 40, self.drop, "Wächter")
class Krog(Charakter):
def __init__(self):
Charakter.__init__(self, 1, None, None, "Krog")
class Maronus(Charakter):
def __init__(self):
Charakter.__init__(self, 1, None, None, "Maronus")
class Spieler(Charakter):
def __init__(self, name, hp, ad, ap):
self.max_hp = hp
self.rubine = 0
self.ep = 0
self.level = 0
self.start_ad = ad
self.ad = ad
self.ap = ap
Charakter.__init__(self, hp, self.ad, None, name)
self.levellist = [10, 25, 50, 75, 100, 200, 300, 400, 500, 600]
def sterben(self):
exit("Du bist gestorben")
def ausruhen(self):
self.hp = self.max_hp
def nextlevel(self):
if self.ep >= self.levellist[self.level]:
return True
def levelup(self):
if self.nextlevel():
self.ep -= self.levellist[self.level]
self.level += 1
print("Level up erfolgreich")
self.max_hp += 15
self.ad += 5
self.start_ad += 5
print("Dein neues Level: " + str(self.level))
else:
print("Du besitzt nicht genug Ehrfahrungspunkte")