Skip to content

Commit 4f5d766

Browse files
committed
rename memory/main.py variables
1 parent 756b9a1 commit 4f5d766

File tree

16 files changed

+1590
-1585
lines changed

16 files changed

+1590
-1585
lines changed

battle/boss.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,8 @@ def gui():
556556
aeon_turn = True
557557

558558
screen.await_turn()
559-
nextHP = memory.main.get_battle_hp()[0]
560-
lastHP = nextHP
559+
next_hp = memory.main.get_battle_hp()[0]
560+
lastHP = next_hp
561561
turn1 = False
562562
nextTurn = 20
563563
lastTurn = 20
@@ -566,7 +566,7 @@ def gui():
566566
pass
567567
while memory.main.battle_active():
568568
if memory.main.turn_ready() and memory.main.get_battle_char_turn() == 8:
569-
nextHP = memory.main.get_battle_hp()[0]
569+
next_hp = memory.main.get_battle_hp()[0]
570570
lastTurn = nextTurn
571571
nextTurn = memory.main.get_next_turn()
572572
if went and kimahriCrit:
@@ -582,14 +582,14 @@ def gui():
582582
elif lastTurn == 8: # Valefor takes two turns in a row
583583
logger.debug("------Two turns in a row")
584584
battle.main.aeon_shield()
585-
elif nextHP > lastHP - 40 and not nextHP == lastHP:
585+
elif next_hp > lastHP - 40 and not next_hp == lastHP:
586586
# Gravity spell was used
587587
logger.debug("------Gravity was used")
588588
battle.main.aeon_shield()
589589
else:
590590
logger.debug("------Attack was just used. Now boost.")
591591
battle.main.aeon_boost()
592-
lastHP = nextHP
592+
lastHP = next_hp
593593
elif memory.main.turn_ready() and memory.main.get_battle_char_turn() == 1:
594594
logger.warning("Yuna turn, something went wrong.")
595595
elif memory.main.turn_ready() and memory.main.get_battle_char_turn() == 2:
@@ -1757,15 +1757,15 @@ def yu_yevon():
17571757
else:
17581758
battle.main.defend()
17591759
elif zombieAttack: # Throw P.down to end game
1760-
itemNum = battle.main.yu_yevon_item()
1761-
if itemNum == 99:
1760+
item_num = battle.main.yu_yevon_item()
1761+
if item_num == 99:
17621762
battle.main.attack("none")
17631763
else:
17641764
while memory.main.battle_menu_cursor() != 1:
17651765
xbox.tap_down()
17661766
while memory.main.main_battle_menu():
17671767
xbox.tap_b()
1768-
item_pos = memory.main.get_throw_items_slot(itemNum)
1768+
item_pos = memory.main.get_throw_items_slot(item_num)
17691769
battle.main._navigate_to_position(item_pos)
17701770
while memory.main.other_battle_menu():
17711771
xbox.tap_b()

blitz.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def select_shot_type():
6666

6767

6868
def targeted_player():
69-
retVal = memory.main.blitz_target_player() - 2
70-
return retVal
69+
ret_val = memory.main.blitz_target_player() - 2
70+
return ret_val
7171

7272

7373
def active_clock():
@@ -79,9 +79,9 @@ def aurochs_control():
7979

8080

8181
def controlling_player():
82-
retVal = memory.main.blitz_current_player() - 2
83-
if retVal < 200:
84-
return retVal
82+
ret_val = memory.main.blitz_current_player() - 2
83+
if ret_val < 200:
84+
return ret_val
8585
return 1
8686

8787

@@ -1078,9 +1078,9 @@ def blitz_main(forceBlitzWin):
10781078
prep_half()
10791079
else:
10801080
storyline(forceBlitzWin)
1081-
except Exception as xVal:
1081+
except Exception as x_val:
10821082
print("Caught exception in blitz memory.main.:")
1083-
print(xVal)
1083+
print(x_val)
10841084

10851085
print("Blitz game has completed.")
10861086
# Set the blitzWin flag for the rest of the run.

config.yaml.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ vars:
2626
perfectAeonKills : False # Before YuYevon, True is slower but more swag.
2727
attemptDjose : False # Try Djose skip? (not likely to succeed)
2828
legacySoundtrack : True # use the original Soundtrack instead of arranged
29-
doNotSkipCutscenes : False # - Missing documentation -
29+
do_not_skip_cutscenes : False # - Missing documentation -
3030

3131
# Accessibility for blind
3232
skip_cutscene_flag : True # - Missing documentation -

logs.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import memory.main
44

55
try:
6-
from memory.main import baseValue
6+
from memory.main import base_value
77
except Exception:
8-
baseValue = 0x0
8+
base_value = 0x0
99
game = "FFX_"
1010
ext = ".txt"
1111
fileName = "none"
@@ -177,7 +177,7 @@ def __init__(
177177
if self.isPointer:
178178
self.ptrOffset = ptrOffsetRef
179179
self.varType = typeRef
180-
self.key = baseValue + 0x003988A5
180+
self.key = base_value + 0x003988A5
181181

182182
self.set_last_value()
183183

@@ -323,15 +323,15 @@ def mem_change_list():
323323

324324

325325
def mem_change_handle():
326-
retArray = [0]
326+
ret_array = [0]
327327
firstEle = True
328328
memRefList = mem_change_list()
329329

330330
while len(baseArray) != 0:
331331
if firstEle:
332332
firstEle = False
333333
variables = memRefList.pop()
334-
retArray[0] = MemChangeMonitor(
334+
ret_array[0] = MemChangeMonitor(
335335
baseOffsetRef=variables[0],
336336
isPointerRef=variables[1],
337337
ptrOffsetRef=variables[2],
@@ -340,7 +340,7 @@ def mem_change_handle():
340340
)
341341
else:
342342
variables = memRefList.pop()
343-
retArray.append(
343+
ret_array.append(
344344
MemChangeMonitor(
345345
baseOffsetRef=variables[0],
346346
isPointerRef=variables[1],
@@ -349,7 +349,7 @@ def mem_change_handle():
349349
childReport=variables[4],
350350
)
351351
)
352-
return retArray
352+
return ret_array
353353

354354

355355
def time_stamp():

memory/get.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
PROCESS_QUERY_INFORMATION = 0x0400
1010
MAX_PATH = 260
11-
baseValue = 0
11+
base_value = 0
1212

1313

1414
class LocProcess(Process):
1515
def __init__(self, *args, **kwargs):
1616
super(LocProcess, self).__init__(*args, **kwargs)
1717

18-
def readBytes(self, lp_base_address: int, size: int = 4):
18+
def read_bytes(self, lp_base_address: int, size: int = 4):
1919
"""
2020
See the original ReadWriteMemory values for details on how this works. This version allows us to pass
2121
the number of bytes to be retrieved instead of a static 4-byte size. Default is 4 for reverse-compatibility
@@ -41,7 +41,7 @@ def readBytes(self, lp_base_address: int, size: int = 4):
4141
}
4242
ReadWriteMemoryError(error)
4343

44-
def writeBytes(self, lp_base_address: int, value: int, size: int = 4) -> bool:
44+
def write_bytes(self, lp_base_address: int, value: int, size: int = 4) -> bool:
4545
"""
4646
Same as above, write a passed number of bytes instead of static 4 bytes. Default is 4 for reverse-compatibility
4747
"""
@@ -114,9 +114,9 @@ def get_process_by_name(self, process_name: str | bytes) -> "Process":
114114

115115

116116
def cutscene_id():
117-
global baseValue
118-
key = baseValue + 0xD27C88
119-
cutscene_alt = process.readBytes(key, 4)
117+
global base_value
118+
key = base_value + 0xD27C88
119+
cutscene_alt = process.read_bytes(key, 4)
120120
storyline_prog = memory.main.get_story_progress()
121121
dialogue = memory.main.diag_progress_flag()
122122
return (cutscene_alt, storyline_prog, dialogue)

0 commit comments

Comments
 (0)