-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstory.py
224 lines (180 loc) · 6.63 KB
/
story.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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
import json
import sys
import time
import os
if getattr(sys, 'frozen', False):
mssgs = json.load(open(os.path.join(sys._MEIPASS, 'json_data/messages.json')))
robot = json.load(open(os.path.join(sys._MEIPASS, 'json_data/robot.json')))
else:
mssgs = json.load(open("json_data/messages.json"))
robot = json.load(open("json_data/robot.json"))
def type(text):
for character in text:
sys.stdout.write(character)
sys.stdout.flush()
time.sleep(0.05)
def delete_last_x_lines(lines):
for _ in range(lines):
# Move the cursor up one line
sys.stdout.write("\x1b[1A")
# Clear the line
sys.stdout.write("\x1b[2K")
sys.stdout.flush()
def get_input(choices):
time.sleep(2)
print()
while (user_input := input("\n >>> ")) not in choices:
print("Invalid input. Please try again.")
time.sleep(1)
delete_last_x_lines(3)
return user_input
def short_wait():
time.sleep(1)
print()
def the_end():
#TODO
print()
print("THE END")
def large_title():
print("""
░█▀▀█ █▀▀█ █▀▀▀ █▀▀ █▀▀█ █▀▀ ░█▀▀█ █──█ █▀▀█ █▀▀█ █▀▀▄ █▀▀█ █▀▀
░█─── █──█ █─▀█ ▀▀█ █──█ █▀▀ ░█─── █▀▀█ █▄▄▀ █──█ █──█ █──█ ▀▀█
░█▄▄█ ▀▀▀▀ ▀▀▀▀ ▀▀▀ ▀▀▀▀ ▀── ░█▄▄█ ▀──▀ ▀─▀▀ ▀▀▀▀ ▀──▀ ▀▀▀▀ ▀▀▀
""")
def scene_0():
type(mssgs["Welcome Screen"])
short_wait()
print()
def scene_1():
type(mssgs["scene 1"])
type(mssgs["scene 1 question"])
match get_input(["1", "2", "3"]):
case "1": # short cut
type(mssgs["scene 1.1"])
type(mssgs["scene 1.1 question"])
match get_input(["1", "2"]):
case "1": # run away
type(mssgs["scene 1.1.1"])
case "2": # fight
type(mssgs["scene 1.1.2"])
# loose two cog
case "2": # normal path
type(mssgs["scene 1.2"])
case "3": # long path see bob
type(mssgs["scene 1.3"])
type(mssgs["scene 1.3 question"])
choice3 = get_input(["1", "2"])
match choice3:
case "1": # buy blueprints
type(mssgs["scene 1.3.1"])
# IMPLEMENT GAIN 1 BLUEPRINT
case "2": # decline
type(mssgs["scene 1.3.2"])
type(mssgs["scene 1.3.2/1.3.1"])
# IMPLEMENT LOOSE TWO COGS
# MAKE IT SKIP "SECENE 2" AND START SCENE 2 FROM "SCENE 2.0.1"
def scene_2():
type(mssgs["scene 2"])
short_wait()
type(mssgs["scene 2.0.1"])
type(mssgs["scene 2 question"])
match get_input(["1", "2", "3"]):
case "1": # first spot
type(mssgs["scene 2.1"])
short_wait()
type(mssgs["scene 2.1.0.1"])
type(mssgs["scene 2.1.0.1 question"])
get_input(["1","2","3"])
if "1":
type(mssgs["scene 2.1.1"])
elif "2":
type(mssgs["scene 2.1.2"])
elif "3":
type(mssgs["scene 2.1.3"])
case "2": # second spot
type(mssgs["scene 2.2"])
short_wait()
type(mssgs["scene 2.2.0.1"])
type(mssgs["scene 2.2.0.1 question"])
get_input(["1","2","3"])
if "1":
type(mssgs["scene 2.2.1"])
elif "2":
type(mssgs["scene 2.2.2"])
elif "3":
type(mssgs["scene 2.2.3"])
case "3": # third spot
type(mssgs["scene 2.3"])
short_wait()
type(mssgs["scene 2.3.0.1"])
type(mssgs["scene 2.3.0.1 question"])
get_input(["1","2","3"])
if "1":
type(mssgs["scene 2.3.1"])
elif "2":
type(mssgs["scene 2.3.2"])
elif "3":
type(mssgs["scene 2.3.3"])
type(mssgs["scene 2 END"])
def scene_3():
type(mssgs["scene 3"])
type(mssgs["scene 3 question"])
match get_input(["1", "2"]):
case "1": #investigate trio
type(mssgs["scene 3.1"])
short_wait()
type(mssgs["scene 3.1.1"])
short_wait()
type(mssgs["scene 3.1.1.1"])
type(mssgs["scene 3.1 question"])
match get_input(["1", "2"]):
case "1": #investigate and run into enforcers
type(mssgs["scene 3.1.2"])
short_wait()
type(mssgs["scene 3.1.2.1"])
print()
type("YOU DIED")
the_end()
case "2": #run back to street
type(mssgs["scene 3.1.3"])
short_wait()
type(mssgs["scene 3.1.3.1"])
short_wait()
type(mssgs["scene 3.1.3.2"])
short_wait()
type(mssgs["scene 3.1.3.3"])
short_wait()
type(mssgs["scene 3.1.3.4"])
case "2": #ignored the trio
type(mssgs["scene 3.2"])
type(mssgs["scene 3.2.1"])
def scene_4():
type(mssgs["scene 4"])
type(mssgs["scene 4 question"])
match get_input(["1", "2"]):
case "1": #Leave through backdoor
type(mssgs["scene 4.1"])
type(mssgs["scene 4.1 question"])
match get_input(["1", "2"]):
case "1": # you try to run
type(mssgs["scene 4.1.1"])
print()
type("YOU DIED")
print()
the_end()
case "2": #you try to hide
type(mssgs["scene 4.1.2"])
print()
type("YOU DIED")
print()
the_end()
case "2": #Leave through the front
type(mssgs["scene 4.2"])
type(mssgs["scene 4.2 question"])
match get_input(["1", "2", "3"]):
case "1": #you take short way
type(mssgs["scene 4.2.1"])
case "2": #you take normal way
type(mssgs["scene 4.2.2"])
case "3": #you take long way
type(mssgs["scene 4.2.3"])