forked from coderwilson/FFX_TAS_Python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFFX_Baaj.py
More file actions
345 lines (309 loc) · 10 KB
/
FFX_Baaj.py
File metadata and controls
345 lines (309 loc) · 10 KB
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
import pyxinput
import time
import FFX_Xbox
import FFX_Screen
import FFX_Battle
import FFX_memory
FFXC = FFX_Xbox.FFXC
def Entrance():
FFX_Screen.awaitMap1()
print("Starting Baaj exterior area")
FFXC.set_value('AxisLx', 0)
FFXC.set_value('AxisLy', 0)
#First, we need to change aeon summons ### MOVE THIS TO LATER
FFX_Xbox.menuY()
time.sleep(0.6)
FFX_Xbox.menuUp()
FFX_Xbox.menuUp()
FFX_Xbox.menuB()
time.sleep(0.3)
FFX_Xbox.menuUp()
FFX_Xbox.menuUp()
FFX_Xbox.menuUp()
FFX_Xbox.menuRight()
FFX_Xbox.menuA()
FFX_Xbox.menuA()
#Now back into the water
FFXC.set_value('AxisLy', 1)
time.sleep(1)
FFXC.set_value('AxisLx', -1)
time.sleep(0.5)
FFXC.set_value('AxisLy', 1)
FFXC.set_value('AxisLx', 0)
print("Mark 1")
time.sleep(35)
print("Mark 2")
FFXC.set_value('AxisLx', 0)
FFXC.set_value('AxisLy', 0)
#Battles
while FFX_memory.getStoryProgress() < 48:
if FFX_Screen.BattleScreen():
if FFX_memory.getStoryProgress() == 44:
FFX_Battle.attack('none')
else:
FFX_Battle.defend()
elif FFX_memory.diagSkipPossible():
FFX_Xbox.menuB()
#FFX_Battle.attack('none')
#time.sleep(0.2)
#FFX_Screen.awaitTurn()
#FFX_Battle.attack('none')
#FFX_Screen.clickToBattle()
#while not FFX_memory.userControl():
# if FFX_Screen.BattleScreen():
# FFX_Battle.defend()
# else:
# FFX_Xbox.menuB()
#Out of the frying pan, into the furnace
FFX_memory.awaitControl()
pos = FFX_memory.getCoords()
while FFX_memory.userControl():
if pos[1] < 85:
print("Path 1")
FFXC.set_value('AxisLx', -1)
FFXC.set_value('AxisLy', 0)
elif pos[1] < 130:
print("Path 2")
FFXC.set_value('AxisLx', 0)
FFXC.set_value('AxisLy', 1)
elif pos[1] < 170:
print("Path 3")
FFXC.set_value('AxisLx', -1)
FFXC.set_value('AxisLy', 1)
elif pos[1] < 180:
print("Path 4")
FFXC.set_value('AxisLx', 1)
FFXC.set_value('AxisLy', 1)
elif pos[1] < 215:
print("Path 5")
FFXC.set_value('AxisLx', 0)
FFXC.set_value('AxisLy', 1)
else:
print("Path 6")
FFXC.set_value('AxisLx', -1)
FFXC.set_value('AxisLy', 1)
pos = FFX_memory.getCoords()
def Baaj_puzzle():
FFXC.set_value('AxisLy', 0)
FFXC.set_value('AxisLx', 0)
FFX_memory.clickToControl()
print("Starting Baaj puzzle")
FFXC.set_value('AxisLy', -1)
time.sleep(0.3)
FFXC.set_value('AxisLx', -1)
time.sleep(2.8)
FFXC.set_value('AxisLy', 0)
FFXC.set_value('AxisLx', 0)
FFX_Xbox.touchSaveSphere()
FFXC.set_value('AxisLy', -1)
FFXC.set_value('AxisLx', -1)
time.sleep(0.4)
FFXC.set_value('AxisLy', 1)
FFXC.set_value('AxisLx', 0)
time.sleep(1.5) #Into the first room
FFX_memory.awaitControl()
time.sleep(0.04)
FFX_memory.clickToEvent() #Grab Flint
FFXC.set_value('AxisLy', -1)
FFX_memory.clickToControl()
time.sleep(0.04)
FFX_memory.clickToEvent() #Exit the room
time.sleep(0.04)
FFXC.set_value('AxisLx', 0)
FFXC.set_value('AxisLy', 0)
#Across the room
FFX_memory.awaitControl()
FFXC.set_value('AxisLy', -1)
FFXC.set_value('AxisLx', 1)
time.sleep(0.6)
FFXC.set_value('AxisLx', 0)
time.sleep(0.25)
FFXC.set_value('AxisLx', 1)
time.sleep(2.2)
pos = FFX_memory.getCoords()
while FFX_memory.userControl():
pos = FFX_memory.getCoords()
FFXC.set_value('AxisLy', 1)
if pos[1] > ((-1.13 * pos[0]) + 11.75):
FFXC.set_value('AxisLx', 1)
else:
FFXC.set_value('AxisLx', 0)
FFXC.set_value('AxisLy', 0)
FFXC.set_value('AxisLx', 0)
#FFXC.set_value('AxisLy', 1)
#FFXC.set_value('AxisLx', 0)
#time.sleep(3) #Enters the stair room/hallway
#FFXC.set_value('AxisLy', 0)
#Grab the withered bouquet
FFX_memory.awaitControl()
pos = FFX_memory.getCoords()
while FFX_memory.userControl():
pos = FFX_memory.getCoords()
FFXC.set_value('AxisLy', 1)
if pos[1] < ((0.80 * pos[0]) -85.80) or pos[1] < -88:
FFXC.set_value('AxisLx', 1)
else:
FFXC.set_value('AxisLx', 0)
FFX_Xbox.menuB()
FFX_memory.clickToControl()
FFXC.set_value('AxisLy', 0)
FFXC.set_value('AxisLx', 0)
#Back down the hallway
while FFX_memory.userControl():
pos = FFX_memory.getCoords()
if pos[1] < 82:
FFXC.set_value('AxisLy', -1)
else:
FFXC.set_value('AxisLy', 0)
if pos[1] < ((0.80 * pos[0]) -85.80) or pos[1] > 82:
FFXC.set_value('AxisLx', 1)
elif pos[1] < 25 and pos[0] > 74:
FFXC.set_value('AxisLx', 1)
elif pos[0] > 90:
FFXC.set_value('AxisLx', 1)
else:
FFXC.set_value('AxisLx', 0)
FFX_Xbox.menuB()
FFXC.set_value('AxisLx', 0)
FFXC.set_value('AxisLy', 0)
#time.sleep(20)
#Back in the main room
FFX_memory.awaitControl()
FFXC.set_value('AxisLy', -1)
time.sleep(2)
FFXC.set_value('AxisLx', -1)
FFX_Xbox.SkipDialog(2)
FFXC.set_value('AxisLy', 0)
FFXC.set_value('AxisLx', 0)
if FFX_memory.userControl():
while FFX_memory.userControl():
print("We missed the fireplace!")
pos = FFX_memory.getCoords()
if pos[0] > 2:
FFXC.set_value('AxisLy', -1)
elif pos[0] < -2:
FFXC.set_value('AxisLy', 1)
if pos[1] > 2:
FFXC.set_value('AxisLx', -1)
elif pos[1] < -2:
FFXC.set_value('AxisLx', 1)
def Klikk_fight() :
#Before Rikku shows up, we're just going to spam the click button. Simple.
print("Waiting on Use tutorial")
FFX_Screen.clickToPixel(897,295,(234, 199, 0))
print("Doing Use tutorial")
FFX_Screen.clickToBattle()
FFX_Battle.useItem(1,'none')
#Tidus self-potion
FFX_Screen.awaitTurn()
FFX_Battle.Klikk()
def ABboat1() :
FFXC.set_value('AxisLy', -1)
time.sleep(0.3)
FFX_Xbox.SkipDialog(4) #Start Sphere Grid tutorial
FFX_memory.clickToControl()
FFXC.set_value('AxisLy', -1)
FFX_Xbox.SkipDialog(1) #Talk to Rikku a second time.
FFXC.set_value('AxisLy', -1)
FFXC.set_value('BtnA', 1)
FFX_memory.clickToControl()
time.sleep(12)
FFXC.set_value('AxisLy', 0)
FFXC.set_value('BtnA', 0)
def ABswimming1() :
complete = 0
print("Swimming towards airship")
while FFX_memory.getMap() != 64 :
pos = FFX_memory.getCoords()
if FFX_memory.userControl():
if FFX_memory.getMap() == 71:
FFXC.set_value('AxisLy', -1)
FFXC.set_value('BtnA', 1)
else:
checkpoint = 1
FFXC.set_value('AxisLy', 1)
FFXC.set_value('BtnA', 0)
if pos[1] < ((2.56 * pos[0]) + 583.79):
FFXC.set_value('AxisLx', 1)
else:
FFXC.set_value('AxisLx', 0)
else:
FFXC.set_value('AxisLy', 0)
FFXC.set_value('AxisLx', 0)
if FFX_Screen.BattleScreen() :
print("Battle Start (Al Bhed swimming section)")
FFX_Battle.stealAndAttack()
print("Battle End (Al Bhed swimming section)")
elif FFX_memory.menuOpen():
print("Battle Complete screen")
FFX_Xbox.menuB()
def ABswimming2() :
#Quick heal-up to make sure we're full HP on Rikku
FFX_memory.awaitControl()
FFXC.set_value('AxisLy', -1)
FFXC.set_value('AxisLx', 1)
FFXC.set_value('BtnA', 1)
time.sleep(0.5)
FFXC.set_value('AxisLy', 0)
FFXC.set_value('AxisLx', 0)
FFXC.set_value('BtnA', 0)
FFX_Xbox.touchSaveSphere()
#Now to get to it
FFXC.set_value('AxisLy', 1)
time.sleep(0.3)
FFX_memory.clickToEvent()
time.sleep(0.2)
FFX_memory.awaitControl()
pos = FFX_memory.getCoords()
while FFX_memory.userControl():
FFXC.set_value('AxisLy', 1)
if pos[1] < 135:
FFXC.set_value('AxisLx', 1)
else:
FFXC.set_value('AxisLx', 0)
pos = FFX_memory.getCoords()
FFXC.set_value('AxisLy', 0)
FFXC.set_value('AxisLx', 0)
FFX_Screen.awaitTurn()
#Final group of Pirhanas
FFX_Battle.stealAndAttackPreTros()
FFX_memory.awaitControl()
FFXC.set_value('AxisLy', 1)
print("Technical Support Tidus")
FFX_Xbox.SkipDialog(2)
FFXC.set_value('AxisLy', -1)
FFX_Screen.clickToMap1()
time.sleep(2)
FFX_memory.clickToEvent()
print("Engaging Tros")
FFXC.set_value('AxisLy', 0)
FFXC.set_value('AxisLx', 0)
#Tros fight
FFX_Screen.clickToBattle()
FFX_Battle.Tros()
FFX_memory.clickToControl()
FFXC.set_value('AxisLy', 1)
time.sleep(2)
FFXC.set_value('AxisLx', 1)
time.sleep(2)
FFXC.set_value('AxisLy', 0)
time.sleep(1)
FFXC.set_value('AxisLy', 1)
time.sleep(5)
FFXC.set_value('AxisLx', 0)
FFXC.set_value('AxisLy', 0)
FFX_memory.awaitControl()
time.sleep(1)
FFXC.set_value('AxisLx', 1)
time.sleep(30)
FFXC.set_value('AxisLx', 0)
#Back onto the ship
FFX_memory.clickToControl()
FFXC.set_value('AxisLx', 1)
time.sleep(0.35)
FFXC.set_value('AxisLx', 0)
FFXC.set_value('AxisLy', 1)
FFX_Xbox.SkipDialog(1)
FFXC.set_value('AxisLy', 0)
FFXC.set_value('AxisLx', 0)
FFX_Screen.awaitSave()