Skip to content

Commit 92f41ea

Browse files
authored
Merge pull request #152 from shenef/main
formatting and cleanup
2 parents b003658 + 5977c83 commit 92f41ea

File tree

122 files changed

+6663
-3807
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+6663
-3807
lines changed

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
__pycache__/
2-
memory.__pycache__/
3-
battle.__pycache__/
4-
area.__pycache__/
52
*.py[cod]
63
*.txt
74
none
8-
*.pyc

Logs/.gitkeep

Whitespace-only changes.

Logs/temp

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ We strive to only include code that is not seed-specific which causes the codeba
1616

1717
This project has been showcased on:
1818

19-
- Q4G HH2 in Nov 2021
19+
- Q4G HH2 - Nov 2021
2020
<https://www.twitch.tv/videos/1205160940>
2121

22-
- TASgiving Nov 2021
22+
- TASgiving - Nov 2021
2323
<https://www.youtube.com/watch?v=Gvz-XdiNuKI>
2424

25-
- RPG Limit Break 2022 on October 17th 2022
26-
_pending | <https://horaro.org/rpglb/2022>_
25+
- RPG Limit Break 2022 - October 17th 2022
26+
<https://www.youtube.com/watch?v=C598HEcfdgE>
2727

2828
## Setup
2929

Showcase/chocoEater.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ def engage():
1212
if memory.main.userControl():
1313
pDownSlot = memory.main.getItemSlot(6)
1414
if memory.main.getMap() == 58:
15-
memory.main.fullPartyFormat('tidkimwak')
15+
memory.main.fullPartyFormat("tidkimwak")
1616
FFXC.set_movement(0, 1)
1717
memory.main.awaitEvent()
1818
FFXC.set_neutral()
19-
#elif checkpoint == 2 and memory.main.getItemCountSlot(pDownSlot) >= 10:
19+
# elif checkpoint == 2 and memory.main.getItemCountSlot(pDownSlot) >= 10:
2020
# checkpoint = 4
2121
elif checkpoint in [2, 3]:
2222
checkpoint = 4

area/MRR.py

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def mainPath():
9999
if memory.main.userControl():
100100
if checkpoint == 1:
101101
memory.main.touchSaveSphere()
102-
memory.main.fullPartyFormat('mrr1')
102+
memory.main.fullPartyFormat("mrr1")
103103
checkpoint += 1
104104
elif checkpoint == 4:
105105
print("Up the first lift")
@@ -127,7 +127,9 @@ def mainPath():
127127
elif checkpoint >= 54 and checkpoint <= 56: # 400 gil guy
128128
if memory.main.rngSeed() in [160, 31]:
129129
checkpoint = 57
130-
elif memory.main.getGilvalue() != lastGilValue: # check if we got the 400 from the guy
130+
elif (
131+
memory.main.getGilvalue() != lastGilValue
132+
): # check if we got the 400 from the guy
131133
if memory.main.getGilvalue() == lastGilValue + 400:
132134
print("We've procured the 400 gil from the guy.")
133135
checkpoint = 57 # now to the actual lift
@@ -145,7 +147,10 @@ def mainPath():
145147
elif checkpoint == 66:
146148
xbox.SkipDialog(1)
147149
print("Up the final lift")
148-
print("======== Next Kimahri crit:", memory.main.nextCrit(character=3, charLuck=18, enemyLuck=15))
150+
print(
151+
"======== Next Kimahri crit:",
152+
memory.main.nextCrit(character=3, charLuck=18, enemyLuck=15),
153+
)
149154
checkpoint += 1
150155
elif checkpoint == 68:
151156
FFXC.set_movement(0, -1)
@@ -157,10 +162,23 @@ def mainPath():
157162
checkpoint = 71 # Into Battle Site zone (upper, cannon area)
158163
elif targetPathing.setMovement(targetPathing.mrrMain(checkpoint)):
159164
if checkpoint == 61:
160-
if memory.main.nextCrit(character=3, charLuck=18, enemyLuck=15) in [2, 3, 4, 5, 6, 7, 9]:
165+
if memory.main.nextCrit(character=3, charLuck=18, enemyLuck=15) in [
166+
2,
167+
3,
168+
4,
169+
5,
170+
6,
171+
7,
172+
9,
173+
]:
161174
critManip = True
162175
# Try to end on 1.
163-
print("+++++++++++ We can manip:", memory.main.nextCrit(character=3, charLuck=18, enemyLuck=15))
176+
print(
177+
"+++++++++++ We can manip:",
178+
memory.main.nextCrit(
179+
character=3, charLuck=18, enemyLuck=15
180+
),
181+
)
164182
checkpoint = 59
165183
else:
166184
checkpoint += 1
@@ -190,7 +208,10 @@ def mainPath():
190208
menu.mrrGrid2()
191209
memory.main.closeMenu()
192210
print("MRR battle complete")
193-
print("======== Next Kimahri crit:", memory.main.nextCrit(character=3, charLuck=18, enemyLuck=15))
211+
print(
212+
"======== Next Kimahri crit:",
213+
memory.main.nextCrit(character=3, charLuck=18, enemyLuck=15),
214+
)
194215
battleCount += 1
195216
elif memory.main.menuOpen():
196217
xbox.tapB()
@@ -229,11 +250,17 @@ def battleSite():
229250
FFXC.set_neutral()
230251
menu.battleSiteOaka1()
231252
menu.battleSiteOaka2()
232-
print("======== Next Kimahri crit:", memory.main.nextCrit(character=3, charLuck=18, enemyLuck=15))
253+
print(
254+
"======== Next Kimahri crit:",
255+
memory.main.nextCrit(character=3, charLuck=18, enemyLuck=15),
256+
)
233257
checkpoint += 1
234258
elif checkpoint == 8:
235259
memory.main.touchSaveSphere()
236-
print("======== Next Kimahri crit:", memory.main.nextCrit(character=3, charLuck=18, enemyLuck=15))
260+
print(
261+
"======== Next Kimahri crit:",
262+
memory.main.nextCrit(character=3, charLuck=18, enemyLuck=15),
263+
)
237264
checkpoint += 1
238265
elif checkpoint == 12:
239266
FFXC.set_movement(1, 0)
@@ -279,7 +306,9 @@ def guiAndAftermath():
279306
FFXC.set_movement(0, 1)
280307
memory.main.awaitEvent()
281308
checkpoint += 1
282-
elif targetPathing.setMovement(targetPathing.battleSiteAftermath(checkpoint)):
309+
elif targetPathing.setMovement(
310+
targetPathing.battleSiteAftermath(checkpoint)
311+
):
283312
checkpoint += 1
284313
print("Checkpoint reached:", checkpoint)
285314
else:

area/baaj.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def Entrance():
3838
while memory.main.getStoryProgress() < 48:
3939
if screen.BattleScreen():
4040
if memory.main.getEncounterID() == 2:
41-
battle.main.attack('none')
41+
battle.main.attack("none")
4242
else:
4343
battle.main.defend()
4444
elif memory.main.diagSkipPossible():
@@ -113,7 +113,7 @@ def Klikk_fight():
113113
xbox.tapB()
114114

115115
xbox.clickToBattle()
116-
battle.main.useItem(0, 'none') # Tidus self-potion
116+
battle.main.useItem(0, "none") # Tidus self-potion
117117
screen.awaitTurn()
118118
battle.boss.klikk()
119119

@@ -122,7 +122,7 @@ def distance(n1, n2):
122122
try:
123123
player1 = memory.main.getActorCoords(actorNumber=n1)
124124
player2 = memory.main.getActorCoords(actorNumber=n2)
125-
return (abs(player1[1] - player2[1]) + abs(player1[0] - player2[0]))
125+
return abs(player1[1] - player2[1]) + abs(player1[0] - player2[0])
126126
except Exception as x:
127127
print("Exception:", x)
128128
return 999
@@ -142,18 +142,18 @@ def ABboat1():
142142
xbox.menuA()
143143
xbox.menuB()
144144
print("In the water!")
145-
FFXC.set_value('BtnA', 1)
145+
FFXC.set_value("BtnA", 1)
146146
while not memory.main.userControl():
147-
FFXC.set_value('BtnB', 1)
147+
FFXC.set_value("BtnB", 1)
148148
memory.main.waitFrames(1)
149-
FFXC.set_value('BtnB', 0)
149+
FFXC.set_value("BtnB", 0)
150150
memory.main.waitFrames(1)
151-
FFXC.set_value('BtnA', 1)
151+
FFXC.set_value("BtnA", 1)
152152
FFXC.set_movement(-1, -1)
153153
memory.main.waitFrames(20)
154154

155155
while memory.main.getMap() != 288:
156-
FFXC.set_value('BtnA', 1)
156+
FFXC.set_value("BtnA", 1)
157157
FFXC.set_movement(0, -1)
158158
if memory.main.battleActive():
159159
FFXC.set_neutral()
@@ -170,7 +170,7 @@ def ABswimming1():
170170
while memory.main.getMap() != 288:
171171
if memory.main.userControl():
172172
targetPathing.setMovement([-300, -300])
173-
FFXC.set_value('BtnA', 1)
173+
FFXC.set_value("BtnA", 1)
174174
else:
175175
FFXC.set_neutral()
176176
if screen.BattleScreen():
@@ -188,9 +188,9 @@ def ABswimming1():
188188
if memory.main.userControl():
189189
if memory.main.getMap() == 71:
190190
FFXC.set_movement(0, -1)
191-
FFXC.set_value('BtnA', 1)
191+
FFXC.set_value("BtnA", 1)
192192
else:
193-
FFXC.set_value('BtnA', 0)
193+
FFXC.set_value("BtnA", 0)
194194
if pos[1] > -230:
195195
targetPathing.setMovement([-343, -284])
196196
elif pos[1] > -410:
@@ -212,7 +212,7 @@ def ABswimming2():
212212
# Quick heal-up to make sure we're full HP on Rikku
213213
memory.main.awaitControl()
214214
FFXC.set_movement(1, -1)
215-
FFXC.set_value('BtnA', 1)
215+
FFXC.set_value("BtnA", 1)
216216
memory.main.touchSaveSphere()
217217

218218
memory.main.clearSaveMenuCursor2()

area/besaid.py

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ def Beach():
8282
battle.main.piranhas()
8383
besaidBattles += 1
8484
encounterID = memory.main.getEncounterID()
85-
if encounterID == 11 or (encounterID == 12 and memory.main.battleType() == 1):
85+
if encounterID == 11 or (
86+
encounterID == 12 and memory.main.battleType() == 1
87+
):
8688
goodBattles += 1
8789
elif memory.main.diagSkipPossible() or memory.main.menuOpen():
8890
xbox.tapB()
@@ -229,15 +231,14 @@ def leaving():
229231
FFXC.set_movement(1, 0)
230232
FFXC.set_neutral()
231233
xbox.clickToBattle()
232-
battle.main.attack('none')
234+
battle.main.attack("none")
233235
xbox.clickToBattle()
234-
battle.main.thunder('none')
236+
battle.main.thunder("none")
235237
memory.main.clickToControl()
236238
checkpoint += 1
237239
elif checkpoint == 24: # Hilltop
238240
memory.main.clickToEventTemple(2)
239-
print("Ready for SS Liki menu - (var)",
240-
gameVars.earlyTidusGrid())
241+
print("Ready for SS Liki menu - (var)", gameVars.earlyTidusGrid())
241242
if memory.main.getTidusSlvl() >= 3:
242243
menu.Liki()
243244
gameVars.earlyTidusGridSetTrue()
@@ -265,28 +266,36 @@ def leaving():
265266
xbox.tapB()
266267
elif memory.main.cutsceneSkipPossible():
267268
xbox.skipScene(fast_mode=True)
268-
elif checkpoint > 25 and checkpoint < 30 and screen.BattleScreen(): # Kimahri fight
269+
elif (
270+
checkpoint > 25 and checkpoint < 30 and screen.BattleScreen()
271+
): # Kimahri fight
269272
FFXC.set_neutral()
270273
healCount = 0
271274
while memory.main.battleActive():
272275
if screen.BattleScreen():
273276
battleHP = memory.main.getBattleHP()
274277
enemyHP = memory.main.getEnemyCurrentHP()
275-
if not gameVars.earlyTidusGrid() and battleHP[0] < 120 and enemyHP[0] > 119:
278+
if (
279+
not gameVars.earlyTidusGrid()
280+
and battleHP[0] < 120
281+
and enemyHP[0] > 119
282+
):
276283
if memory.main.rngSeed() == 31:
277-
battle.main.attack('none')
284+
battle.main.attack("none")
278285
else:
279-
battle.main.usePotionCharacter(0, 'l')
286+
battle.main.usePotionCharacter(0, "l")
280287
healCount += 1
281288
else:
282-
battle.main.attack('none')
289+
battle.main.attack("none")
283290
elif memory.main.diagSkipPossible():
284291
xbox.tapB()
285292
# logs.writeStats("Kimahri heal count:")
286293
# logs.writeStats(healCount)
287294
memory.main.clickToControl()
288295
# Valefor summon tutorial
289-
elif checkpoint in [31, 32, 33, 34, 35, 36, 37, 38] and screen.BattleScreen():
296+
elif (
297+
checkpoint in [31, 32, 33, 34, 35, 36, 37, 38] and screen.BattleScreen()
298+
):
290299
xbox.clickToBattle()
291300
while not screen.turnAeon():
292301
if memory.main.turnReady():
@@ -303,18 +312,22 @@ def leaving():
303312
battle.main.aeonSpell(1)
304313
print("Now to open the menu")
305314
memory.main.clickToControl()
306-
memory.main.fullPartyFormat('Besaid')
315+
memory.main.fullPartyFormat("Besaid")
307316
checkpoint += 1
308317
elif checkpoint == 39 and screen.BattleScreen(): # Dark Attack tutorial
309318
battle.main.escapeAll()
310319
memory.main.clickToControl()
311-
memory.main.fullPartyFormat('Besaid2')
320+
memory.main.fullPartyFormat("Besaid2")
312321
checkpoint += 1
313-
elif checkpoint > 39 and screen.BattleScreen(): # One forced battle on the way out of Besaid
322+
elif (
323+
checkpoint > 39 and screen.BattleScreen()
324+
): # One forced battle on the way out of Besaid
314325
battle.main.besaid()
315326

316327
# Map changes
317-
elif checkpoint > 10 and checkpoint < 24 and memory.main.getMap() == 67: # Hilltop
328+
elif (
329+
checkpoint > 10 and checkpoint < 24 and memory.main.getMap() == 67
330+
): # Hilltop
318331
checkpoint = 24
319332
elif checkpoint < 27 and memory.main.getMap() == 21: # Kimahri map
320333
checkpoint = 27

0 commit comments

Comments
 (0)