Skip to content

Commit caf9b60

Browse files
authored
Merge pull request #209 from coderwilson/coder_SS_and_nem_improvements
Coder ss and nem improvements
2 parents 42d46c4 + 175fcce commit caf9b60

File tree

5 files changed

+146
-68
lines changed

5 files changed

+146
-68
lines changed

Diff for: json_ai_files/save_sphere_details.json

+95
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@
103103
"y": -123.12351989746094,
104104
"diag": 19
105105
}
106+
},
107+
"3205": {
108+
"1": {
109+
"x": 195.7930450439453,
110+
"y": -123.12351989746094,
111+
"diag": 23
112+
}
106113
}
107114
},
108115
"106": {
@@ -182,6 +189,13 @@
182189
"y": 189.910888671875,
183190
"diag": 39
184191
}
192+
},
193+
"3205": {
194+
"8": {
195+
"x": -309.834716796875,
196+
"y": 189.910888671875,
197+
"diag": 43
198+
}
185199
}
186200
},
187201
"285": {
@@ -217,5 +231,86 @@
217231
"diag": 26
218232
}
219233
}
234+
},
235+
"322": {
236+
"3205": {
237+
"7": {
238+
"x": 222.18992614746094,
239+
"y": -247.14520263671875,
240+
"diag": 15
241+
}
242+
}
243+
},
244+
"263": {
245+
"3205": {
246+
"11": {
247+
"x": -34.357666015625,
248+
"y": -5.029695987701416,
249+
"diag": 114
250+
}
251+
}
252+
},
253+
"307": {
254+
"3205": {
255+
"9": {
256+
"x": 3.555485963821411,
257+
"y": 5.817317962646484,
258+
"diag": 166
259+
}
260+
}
261+
},
262+
"98": {
263+
"3205": {
264+
"9": {
265+
"x": 46.96438217163086,
266+
"y": -251.98614501953125,
267+
"diag": 34
268+
}
269+
}
270+
},
271+
"19": {
272+
"3205": {
273+
"13": {
274+
"x": -309.6885986328125,
275+
"y": -476.92022705078125,
276+
"diag": 55
277+
}
278+
}
279+
},
280+
"18": {
281+
"3205": {
282+
"14": {
283+
"x": -62.44031524658203,
284+
"y": -501.2289733886719,
285+
"diag": 51
286+
}
287+
}
288+
},
289+
"128": {
290+
"3205": {
291+
"9": {
292+
"x": 234.0980682373047,
293+
"y": 141.98843383789062,
294+
"diag": 68
295+
}
296+
}
297+
},
298+
"82": {
299+
"3205": {
300+
"10": {
301+
"x": 102.513671875,
302+
"y": -243.84413146972656,
303+
"diag": 89
304+
}
305+
}
306+
},
307+
"137": {
308+
"3205": {
309+
"15": {
310+
"x": -10.619672775268555,
311+
"y": 241.5653533935547,
312+
"diag": 31
313+
}
314+
}
220315
}
221316
}

Diff for: load_game.py

+18-7
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
import os
33
from pathlib import Path
44

5-
import area.dream_zan
6-
import logs
75
import memory.main
86
import pathing
97
import screen
108
import vars
9+
from gamestate import game
1110
import xbox
1211
import zz_airship_path
13-
from gamestate import game
12+
import area.dream_zan
13+
import logs
1414

1515
# This file is intended to load the game to a saved file.
1616
# This assumes that the save is the first non-auto-save in the list of saves.
@@ -19,7 +19,7 @@
1919
game_vars = vars.vars_handle()
2020

2121

22-
def load_into_game(gamestate: str, step_counter: str):
22+
def load_into_game(gamestate:str, step_counter:str):
2323
if not (gamestate == "Luca" and step_counter == 3):
2424
area.dream_zan.new_game(gamestate)
2525
game.start_time = logs.time_stamp()
@@ -198,8 +198,20 @@ def load_into_game(gamestate: str, step_counter: str):
198198
if gamestate == "Nem_Farm" and step_counter == 8:
199199
load_save_num(73)
200200
if gamestate == "Nem_Farm" and step_counter == 9:
201-
load_save_num(75)
202-
game_vars.set_nem_checkpoint_ap(3) # See nemesis.menu
201+
#Start of Nemesis farm
202+
#import nemesis.menu
203+
#import memory.main
204+
load_save_num(19)
205+
game_vars.set_nem_checkpoint_ap(27) # See nemesis.menu
206+
game_vars.end_game_version_set(4)
207+
#memory.main.arena_array_nines()
208+
#while not memory.main.get_tidus_slvl() >= 70:
209+
# nemesis.menu.perform_next_grid()
210+
# memory.main.set_tidus_slvl(memory.main.get_tidus_slvl()+1)
211+
if gamestate == "Nem_Farm" and step_counter == 11:
212+
load_save_num(20)
213+
game_vars.set_nem_checkpoint_ap(27) # See nemesis.menu
214+
game_vars.end_game_version_set(4)
203215
if gamestate == "Nem_Farm" and step_counter == 13:
204216
load_save_num(17)
205217
game_vars.set_nem_checkpoint_ap(7) # See nemesis.menu
@@ -241,7 +253,6 @@ def load_into_game(gamestate: str, step_counter: str):
241253
memory.main.check_nea_armor()
242254
memory.main.check_nea_armor()
243255

244-
245256
def get_saved_files():
246257
saveFilesFull = sorted(
247258
Path(game_vars.game_save_path()).iterdir(), key=os.path.getmtime

Diff for: memory/main.py

-1
Original file line numberDiff line numberDiff line change
@@ -4464,7 +4464,6 @@ def arena_array():
44644464
retArray.append(process.readBytes(key, 1))
44654465
return retArray
44664466

4467-
44684467
def arena_farm_check(
44694468
zone: str = "besaid", end_goal: int = 10, report=False, return_array=False
44704469
):

Diff for: nemesis/arenaPrep.py

+26-54
Original file line numberDiff line numberDiff line change
@@ -217,44 +217,14 @@ def return_to_airship():
217217
while not nemesis.targetPath.set_movement([-4, -3]):
218218
pass
219219

220-
if memory.main.get_map() == 263: # Thunder plains
221-
while not nemesis.targetPath.set_movement([-39, -18]):
222-
pass
223-
224-
if memory.main.user_control():
225-
while memory.main.user_control():
226-
nemesis.targetPath.set_movement([ssDetails[0], ssDetails[1]])
227-
xbox.tap_b()
228-
memory.main.wait_frames(1)
229-
try:
230-
FFXC.set_neutral()
231-
except:
232-
FFXC = xbox.controller_handle()
233-
FFXC.set_neutral()
220+
save_sphere.approach_save_sphere()
234221
FFXC.set_neutral()
235-
236-
while not memory.main.get_map() in [194, 374]:
237-
if memory.main.get_map() == 307 and memory.main.get_coords()[1] < -5:
238-
while not nemesis.targetPath.set_movement([-4, -21]):
239-
pass
240-
while not nemesis.targetPath.set_movement([-2, -2]):
241-
pass
242-
else:
243-
FFXC.set_neutral()
244-
if memory.main.save_menu_open():
245-
xbox.tap_a()
246-
elif memory.main.diag_progress_flag() == ssDetails[2]:
247-
# print("Cursor test:", memory.saveMenuCursor())
248-
if memory.main.save_menu_cursor() != 1:
249-
xbox.menu_down()
250-
else:
251-
xbox.menu_b()
252-
elif memory.main.user_control():
253-
nemesis.targetPath.set_movement([ssDetails[0], ssDetails[1]])
254-
xbox.menu_b()
255-
elif memory.main.diag_skip_possible():
256-
xbox.menu_b()
257-
memory.main.wait_frames(4)
222+
while memory.main.save_menu_cursor() != 1:
223+
FFXC.set_neutral()
224+
xbox.menu_down()
225+
memory.main.wait_frames(1)
226+
xbox.menu_b()
227+
memory.main.await_control()
258228
print("Return to Airship Complete.")
259229
memory.main.clear_save_menu_cursor()
260230
memory.main.clear_save_menu_cursor_2()
@@ -1541,12 +1511,14 @@ def kilika_farm(cap_num: int = 1):
15411511
and checkpoint < 14
15421512
):
15431513
checkpoint = 14
1544-
elif checkpoint == 14 and not memory.main.arena_farm_check(
1545-
zone="kilika", end_goal=cap_num, report=False
1546-
):
1547-
checkpoint -= 2
1548-
print("Checkpoint reached: ", checkpoint)
1549-
1514+
elif checkpoint == 14:
1515+
if not memory.main.arena_farm_check(
1516+
zone="kilika", end_goal=cap_num, report=False
1517+
):
1518+
checkpoint -= 2
1519+
print("Checkpoint reached: ", checkpoint)
1520+
else:
1521+
return_to_airship()
15501522
elif checkpoint == 4:
15511523
memory.main.click_to_event_temple(7)
15521524
checkpoint += 1
@@ -1690,11 +1662,11 @@ def miihen_farm(cap_num: int = 1):
16901662
checkpoint = 0
16911663
last_cp = checkpoint
16921664
while not memory.main.get_map() in [194, 374]:
1665+
# Checkpoint notify
1666+
if last_cp != checkpoint:
1667+
print("Checkpoint reached: ", checkpoint)
1668+
last_cp = checkpoint
16931669
if memory.main.user_control():
1694-
# Checkpoint notify
1695-
if last_cp != checkpoint:
1696-
print("Checkpoint reached: ", checkpoint)
1697-
last_cp = checkpoint
16981670
if checkpoint == 92:
16991671
FFXC.set_neutral()
17001672
while memory.main.user_control():
@@ -1784,6 +1756,13 @@ def miihen_farm(cap_num: int = 1):
17841756
# Garuda late farming logic
17851757
elif checkpoint in [61, 62, 63] and prefArea >= 5:
17861758
checkpoint = 100
1759+
elif checkpoint == 146 and prefArea == 5:
1760+
checkpoint -= 2
1761+
if neArmor:
1762+
menu.remove_all_nea()
1763+
miihen_next(end_goal=cap_num)
1764+
print("Next area: ", prefArea)
1765+
neArmor = False
17871766
elif checkpoint in [104, 146, 158]:
17881767
FFXC.set_neutral()
17891768
memory.main.click_to_event()
@@ -1801,13 +1780,6 @@ def miihen_farm(cap_num: int = 1):
18011780
miihen_next(end_goal=cap_num)
18021781
print("Next area: ", prefArea)
18031782
neArmor = False
1804-
elif checkpoint == 145 and prefArea == 5:
1805-
checkpoint -= 2
1806-
if neArmor:
1807-
menu.remove_all_nea()
1808-
miihen_next(end_goal=cap_num)
1809-
print("Next area: ", prefArea)
1810-
neArmor = False
18111783
elif checkpoint == 150 and prefArea == 6:
18121784
checkpoint -= 2
18131785
if neArmor:

Diff for: save_sphere.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ def approach_save_sphere():
5757
target_coords = memory.main.get_actor_coords(target_actor)
5858
target_details = get_save_sphere_settings(target_actor)
5959
print("Approaching actor: ", target_actor)
60-
FFXC.set_neutral()
6160
while not (
6261
memory.main.diag_progress_flag() == target_details[2]
6362
and memory.main.diag_skip_possible()
@@ -87,11 +86,11 @@ def approach_save_sphere():
8786
memory.main.wait_frames(2)
8887
memory.main.clear_save_menu_cursor()
8988
memory.main.clear_save_menu_cursor_2()
90-
while memory.main.user_control():
91-
pathing.set_movement([target_coords[0], target_coords[1]])
92-
xbox.tap_b()
93-
memory.main.wait_frames(6)
94-
memory.main.wait_frames(20)
89+
# while memory.main.user_control():
90+
# pathing.set_movement([target_coords[0], target_coords[1]])
91+
# xbox.tap_b()
92+
# memory.main.wait_frames(6)
93+
# memory.main.wait_frames(20)
9594
target_details = get_save_sphere_settings(target_actor)
9695
else:
9796
FFXC.set_neutral()
@@ -102,6 +101,8 @@ def approach_save_sphere():
102101
elif memory.main.diag_skip_possible():
103102
print("Mark 3", memory.main.diag_progress_flag())
104103
xbox.tap_b()
104+
FFXC.set_neutral()
105+
105106

106107

107108
def disengage_save_sphere():

0 commit comments

Comments
 (0)