-
Notifications
You must be signed in to change notification settings - Fork 1
/
TextBasedAdventureFunctions.py
181 lines (163 loc) · 5.17 KB
/
TextBasedAdventureFunctions.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
import AdventureMaps
import classes
#Creating info for mage class
user_niche = ()
user_object = ()
store = ()
balance = 10
class Mage():
def __init__ (self):
self.name = ("Mage")
self.health = 100
self.mana = 20
self.attack = 10
self.defence = 10
def print_all_things(self):
print ("Class: " + str(self.name))
print ("Health: " + str(self.health))
print ("Mana: " + str(self.mana))
print ("Attack: " + str(self.attack))
print ("Defence: " + str(self.defence))
#Info for archer class
class Archer():
def __init__ (self):
self.name = ("Archer")
self.health = 150
self.mana = 12
self.attack = 14
self.defence = 14
def print_all_things(self):
print ("Class: " + str(self.name))
print ("Health: " + str(self.health))
print ("Mana: " + str(self.mana))
print ("Attack: " + str(self.attack))
print ("Defence: " + str(self.defence))
#Info for assassin class
class Assassin():
def __init__ (self):
self.name = ("Assassin")
self.health = 75
self.mana = 15
self.attack = 15
self.defence = 7
def print_all_things(self):
print ("Class: " + str(self.name))
print ("Health: " + str(self.health))
print ("Mana: " + str(self.mana))
print ("Attack: " + str(self.attack))
print ("Defence: " + str(self.defence))
#Info for warrior class
class Warrior():
def __init__ (self):
self.name = ("Warrior")
self.health = 175
self.mana = 8
self.attack = 175
self.defence = 150
def print_all_things(self):
print ("Class: " + str(self.name))
print ("Health: " + str(self.health))
print ("Mana: " + str(self.mana))
print ("Attack: " + str(self.attack))
print ("Defence: " + str(self.defence))
#Info for ragni armor shop
class ragni_armor_shop():
def __init__ (self):
self.item1 = ("10G - Tattered Leather Chestplate")
self.item2 = ("2G - Tattered Leather Helm")
self.item3 = ("3G - Tattered Leather Shoes")
self.item4 = ("6G - Tattered Leather Pants")
self.item5 = ("8G - Cracked Barrel Top")
def print_all_armor_ragni(self):
print ("---------------------------------------------")
print ("1. " + str(self.item1))
print ("2. " + str(self.item2))
print ("3. " + str(self.item3))
print ("4. " + str(self.item4))
print ("5. " + str(self.item5))
print ("6. Back")
print ("---------------------------------------------")
#Used to print number of desired blank lines
def blank_line(lines):
for i in range(lines):
print ("")
#Used for inspecting classes inside of the class selection function
def look_at_class():
while True:
print ("""---------------------------------------------
1. Mage
2. Archer
3. Assassin
4. Warrior
5. Back
---------------------------------------------""")
blank_line(3)
inspect_class = int(input("What class would you like to inspect?"))
if inspect_class == 1:
user_object = Mage()
user_object.print_all_things()
print ("Press 5 to go back.")
blank_line(2)
elif inspect_class == 2:
user_object = Archer()
user_object.print_all_things()
print ("Press 5 to go back.")
blank_line(2)
elif inspect_class == 3:
user_object = Assassin()
user_object.print_all_things()
print ("Press 5 to go back.")
blank_line(2)
elif inspect_class == 4:
user_object = Warrior()
user_object.print_all_things()
print ("Press 5 to go back.")
blank_line(2)
elif inspect_class == 5:
choose_class()
else:
print ("That is not a valid option!")
continue
#Used to choose a class at the beginning of the game
def choose_class():
while True:
print ("""---------------------------------------------
1. Mage
2. Archer
3. Assassin
4. Warrior
---------------------------------------------""")
global user_niche
global user_object
niche = input("What class would you like?")
if niche == ("1"):
print ("You are now a Mage!")
user_object = Mage()
user_niche = ("mage")
blank_line(2)
break
elif niche == ("2"):
print ("You are now an Archer!")
user_object = Archer()
user_niche = ("archer")
blank_line(2)
break
elif niche == ("3"):
print ("You are now an Assassin!")
user_object = Assassin()
user_niche = ("assassin")
blank_line(2)
break
elif niche == ("4"):
print ("You are now a Warrior!")
user_object = Warrior()
user_niche = ("warrior")
blank_line(2)
break
else:
print ("That is not a valid input.")
continue
def print_stats():
user_object.print_all_things()
def current_map():
print ("")