Skip to content

Commit 481d376

Browse files
authored
Merge pull request #218 from orkaboy/dev/logging
Applied logging up to the end of the game
2 parents 107d877 + 393b11e commit 481d376

20 files changed

+582
-538
lines changed

Diff for: area/boats.py

+16-14
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import battle.boss
22
import battle.main
3+
import logging
34
import logs
45
import memory.main
56
import menu
67
import pathing
78
import vars
89
import xbox
910

11+
logger = logging.getLogger(__name__)
1012
game_vars = vars.vars_handle()
11-
1213
FFXC = xbox.controller_handle()
1314

1415

1516
def boat_dance():
16-
print("No dancing this time")
17+
logger.info("No dancing this time")
1718
memory.main.wait_frames(30 * 50)
1819

1920

@@ -27,7 +28,7 @@ def ss_liki():
2728
checkpoint += 1
2829
elif checkpoint == 3: # Talk to Wakka
2930
memory.main.click_to_event_temple(3)
30-
print("Ready for SS Liki menu - (var) ", game_vars.early_tidus_grid())
31+
logger.info(f"Ready for SS Liki menu - (var) {game_vars.early_tidus_grid()}")
3132
if not game_vars.early_tidus_grid():
3233
menu.liki()
3334
memory.main.close_menu()
@@ -36,7 +37,7 @@ def ss_liki():
3637
# General pathing
3738
elif pathing.set_movement(pathing.liki(checkpoint)):
3839
checkpoint += 1
39-
print("Checkpoint reached:", checkpoint)
40+
logger.debug(f"Checkpoint reached: {checkpoint}")
4041

4142
else:
4243
FFXC.set_neutral()
@@ -45,11 +46,11 @@ def ss_liki():
4546
elif memory.main.cutscene_skip_possible():
4647
xbox.skip_scene()
4748
elif memory.main.battle_active():
48-
print("Ready to start fight with Sin's Fin")
49+
logger.info("Ready to start fight with Sin's Fin")
4950
battle.boss.sin_fin()
50-
print("Sin's Fin fight complete. Waiting for next fight")
51+
logger.info("Sin's Fin fight complete. Waiting for next fight")
5152
battle.boss.echuilles()
52-
print("Sinspawn Echuilles fight complete")
53+
logger.info("Sinspawn Echuilles fight complete")
5354

5455

5556
def get_digit(number, n):
@@ -83,6 +84,7 @@ def ss_winno():
8384
FFXC.set_movement(1, -1)
8485
memory.main.wait_frames(2)
8586

87+
logger.info("Talk to O'aka")
8688
# Talk to O'aka XXIII
8789
oaka_coords = [
8890
memory.main.get_actor_coords(1)[0],
@@ -99,11 +101,11 @@ def ss_winno():
99101
FFXC.set_neutral()
100102
while memory.main.oaka_interface() != 12:
101103
xbox.tap_b()
102-
print("Setting Hundreds")
104+
logger.debug("Setting Hundreds")
103105
_set_index_to_value(5, 0, 2)
104-
print("Setting Thousands")
106+
logger.debug("Setting Thousands")
105107
_set_index_to_value(4, 1, 3)
106-
print("Setting Zeroes")
108+
logger.debug("Setting Zeroes")
107109
_set_index_to_value(7, 1, 0)
108110
while memory.main.oaka_interface() != 0:
109111
xbox.tap_b()
@@ -132,7 +134,7 @@ def ss_winno_2():
132134
checkpoint += 1
133135
elif pathing.set_movement(pathing.winno(checkpoint)):
134136
checkpoint += 1
135-
print("Checkpoint reached:", checkpoint)
137+
logger.debug(f"Checkpoint reached: {checkpoint}")
136138
else:
137139
FFXC.set_neutral()
138140
if memory.main.diag_skip_possible():
@@ -176,7 +178,7 @@ def jecht_shot_success():
176178

177179
def jecht_shot():
178180
# Jecht shot tutorial
179-
print("Ready for Jecht Shot")
181+
logger.info("Ready for Jecht Shot")
180182
memory.main.click_to_diag_progress(96)
181183
while memory.main.diag_progress_flag() != 100:
182184
if memory.main.diag_progress_flag() == 97:
@@ -196,8 +198,8 @@ def jecht_shot():
196198

197199
# Failure logic
198200
xbox.skip_dialog(2)
199-
print("End Jecht Shot")
200-
print("We are intentionally failing the Jecht shot. Save the frames!")
201+
logger.info("End Jecht Shot")
202+
logger.info("We are intentionally failing the Jecht shot. Save the frames!")
201203

202204
# Success logic
203205
# for i in range(15):

0 commit comments

Comments
 (0)