-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquest.py
71 lines (62 loc) · 2.7 KB
/
quest.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
from enter import enter
questLog = [] #list of finished quests
currentQuests = [] #list of current quests
class Quest:
def __init__(self, name, steps, active): #steps is a list of strings
self.name = name
self.steps = steps
self.stepNum = 0 #current step number
self.currentStep = self.steps[self.stepNum]
self.active = active #active quest or not (True or False)
def startQuest(self):
self.active = True
currentQuests.append(self)
def endQuest(self):
self.active = False
currentQuests.remove(self)
questLog.append(self)
def nextStep(self):
self.stepNum += 1
self.currentStep = self.steps[self.stepNum]
def showCurrentQuests(ShowEnter=True):
for i in currentQuests:
j = 0
while j < i.stepNum:
print(i.name + " [" + str(j) + "]" + ": " + str(i.steps[j]))
j += 1
print(i.name + " [" + str(j) + "]" + ": " + i.currentStep)
print()
if ShowEnter:
enter()
### QUESTS ###
#There are seven quests. The extra variables assigned help with step regulation in the main.py and npc.py
# QUEST 1
q1 = Quest("First Steps", ["Tell Hermione about your problem.", "Talk to the librarian.", "Read the 'Book of Potions'."], False)
q1.startQuest()
# QUEST 2
q2 = Quest("Squill Bulb", ["Obtain a bucket of water and a pail of dirt.", "Go to the greenhouse.", "Find some squill seed.", "Craft squill bulb."], False)
q2step1finished = False
q2step2finished = False
q2step3finished = False
# QUEST 3
q3 = Quest("Occamy Eggshell", ["Ask Hagrid about occamy eggs.", "Unlock Umbridge's office to see if there are any occamy eggshells lying around.", "Find some occamy eggshells."], False)
q3occamyegg=False
q3step2finished = False
q3step3finished = False
# QUEST 4
q4 = Quest("Tincture of Thyme", ["Talk to Ron about thyme tinctures.", "Obtain 50 coins and make a trade with Ron."], False)
q4pixies=False
# QUEST 5
q5 = Quest("Murtlap Tentacle", ["Ask Hermione about finding a murtlap tentacle.", "Obtain some gillyweed.", "Take a dip and obtain a murtlap tentacle."], False)
q5gillyweed=False
q5step2finished = False
q5step3finished = False
#Event: Umbridge removes Hagrid
# QUEST 6
q6 = Quest("Ashwinder Egg", ["Talk to someone who might know about ashwinder eggs.", "Find and talk to the hooded creature in the Dark Forest.", "Obtain some unicorn blood but don't kill a unicorn.", "Make a trade with the hooded creature."], False)
q6unicornblood = False
q6step3finished = False
# QUEST 7
q7 = Quest("Craft Felix Felicis", ["Find the Potions classroom.", "Find some powdered common rue and craft Felix Felicis."], False)
q7step1finished = False
endgame = False