-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobalvars.py
175 lines (139 loc) · 6.25 KB
/
globalvars.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
import dbconn as db
# These are variables that are needed across several functions and py files.
debug = False
rungame = True # For game loop.
cmdalias = [] # List of command aliases.
cmdlist = [] # List of commands the aliases point to.
columnWidth = 80
essentialPeople = ["bugeorgi","bumonica","grinnkee","grjens","grkolbio","grlone","grportma","grsailor","grvolur","inbusdri","nesherpa","pecook","pewayna","player","spgorka","tachief","taneema","tifisher","timonk2","tizlatin"]
#callLocs = ["grpost","inpost","pepost","tapost","spdiroff"] # Locations where it is possible to call people.
callLocs = ["pepost"] # Locations where it is possible to call people.
callPeople = ["spgorka","pewayna"] # People that can be called.
buylocs = ["intrains","nehikesh","grstore","grinn1"] # Order matters!
buyppl = ["intimast","inshopke","grstore","grinnkee"] # Order matters!
multiArgCmds = ["give","talk","use","travel"]
rentlocs = ["grmaster","grinn1"] # Order matters!
rentppl = ["grportma","grinnkee"] # Order matters!
#turns = 0
#cheatsUsed = 0
immortals = ["grkolbio","peghost"]
cmdMovement = ["north","northeast","east","southeast","south","southwest","west","northwest","up","down","travel"]
cmdInteraction = ["attack","buy","call","drop","examine","give","greet","rent","say","shoot","take","talk","use"]
cmdNoArgs = ["inventory","load","look","quit","restart","save","tips"]
worldTravel = ["buairpor","grport","inairpor","peairpor","peport","spairpor","spport","taport","taairpor"]
countries = ["Bulgaria","Greenland","India","Peru","Peru","Spain","Spain","Tanzania","Tanzania"]
asiaTravel = ["inbussta","intrains","intrro7","nejaratr","netoti","titone"]
asiaCountries = ["India","India","India","India","Nepal","Nepal","Tibet"]
# So the player doesn't screw themselves over.
criticalItem = ["budagger","divesuit","fishnet","fjorstei","guthjorr","kolbswor","linskin","martenit","mead","mead2","mead3","necklace","pet","viksword","zlatlett"]
criticalItemPeople = ["spgorka","grportma","tifisher","spgorka","spgorka","grkolbio","grvolur","bumonica","grlone","grlone","grlone","grjens","tizlatin","spgorka","spgorka"]
def killLoop():
global rungame
rungame = False
def initCmdList(): # Initialize command list for later.
global cmdalias
global cmdlist
db.cur.execute("select alias,cmd from command;")
result = db.cur.fetchall()
for row in result:
cmdalias.append(row[0])
cmdlist.append(row[1])
if debug == "verbose": # No need to print these.
print("[DBG] globalvars CMDLIST",cmdlist)
print("[DBG] globalvars CMDALIAS",cmdalias)
def toggleDebug():
global debug
if debug:
debug = False
else:
debug = True
# I need to initialize all the variables. They are updated with the real values in the function.
savedTurns = 0
wolvesGuided = 0
wearDiveSuit = 0
grFisherCrater = 0
Chapters = 0
firstBulgaria = 0
inTrainRobbed = 0
inTrainRobDone = 0
inTrainBack = 0
spletterRead = 0
zlaGreet = 0
firstTanz = 0
firstPeru = 0
backToIndia = 0
spletterDropped = 0
grkolbOut = 0
buMartFind = 0
grforSkin = 0
grShamanMeet = 0
spgorCalled = 0
pewayCalled = 0
gameSaved = 0
def update():
global savedTurns
global wolvesGuided
global wearDiveSuit
global grFisherCrater
global Chapters
global firstBulgaria
global inTrainRobbed
global inTrainRobDone
global inTrainBack
global spletterRead
global zlaGreet
global firstTanz
global firstPeru
global backToIndia
global spletterDropped
global grkolbOut
global buMartFind
global grforSkin
global grShamanMeet
global spgorCalled
global pewayCalled
global gameSaved
db.cur.execute("select val from save where var = \"turns\";")
savedTurns = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"wolvesGuided\";")
wolvesGuided = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"wearDiveSuit\";")
wearDiveSuit = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"grFisherCrater\";")
grFisherCrater = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"chapters\";")
Chapters = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"firstBulgaria\";")
firstBulgaria = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"inTrainRobbed\";")
inTrainRobbed = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"inTrainRobDone\";")
inTrainRobDone = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"inTrainBack\";")
inTrainBack = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"spletterRead\";")
spletterRead = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"zlaGreet\";")
zlaGreet = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"firstTanz\";")
firstTanz = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"firstPeru\";")
firstPeru = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"backToIndia\";")
backToIndia = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"spletterDropped\";")
spletterDropped = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"grkolbOut\";")
grkolbOut = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"buMartFind\";")
buMartFind = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"grforSkin\";")
grforSkin = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"grShamanMeet\";")
grShamanMeet = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"spgorCalled\";")
spgorCalled = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"pewayCalled\";")
pewayCalled = db.cur.fetchall()[0][0]
db.cur.execute("select val from save where var = \"gameSaved\";")
gameSaved = db.cur.fetchall()[0][0]