Skip to content

Commit 52a0efb

Browse files
committed
Update menu labels, fix none specified bug, ignore autosprint
1 parent dcd5624 commit 52a0efb

File tree

4 files changed

+37
-20
lines changed

4 files changed

+37
-20
lines changed

args/misc.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
from data.movement import MovementActions
21

32

43
def name():
@@ -16,11 +15,13 @@ def parse(parser):
1615
misc.add_argument("-scan", "--scan-all", action = "store_true",
1716
help = "All enemies scannable. All characters start with scan learned. Scan costs 0 MP. Useful for testing/debugging")
1817

18+
from data.movement import ALL
1919
movement = misc.add_mutually_exclusive_group()
2020
movement.name = "Movement"
21-
movement.add_argument("-move", "--movement", type = str.lower, choices = MovementActions.ALL,
21+
movement.add_argument("-move", "--movement", type = str.lower, choices = ALL,
2222
help = "Player movement options")
23-
movement.add_argument("-as", "--auto-sprint", action = "store_true",
23+
# Completely ignore this argument, and default to auto sprint when -move is not defined
24+
misc.add_argument("-as", "--auto-sprint", action = "store_true",
2425
help = "DEPRECATED - Use `-move as` instead. Player always sprints. Sprint Shoes have no effect")
2526

2627
event_timers = misc.add_mutually_exclusive_group()
@@ -149,8 +150,15 @@ def options(args):
149150
elif args.flashes_remove_most:
150151
remove_flashes = "Most"
151152

153+
from data.movement import key_name, AUTO_SPRINT
154+
# Similar logic is present in the init fn of settings/movement.py
155+
if args.movement:
156+
movement = key_name[args.movement]
157+
else:
158+
movement = key_name[AUTO_SPRINT]
159+
152160
return [
153-
("Movement", args.movement),
161+
("Movement", movement),
154162
("Original Name Display", args.original_name_display),
155163
("Random RNG", args.random_rng),
156164
("Random Clock", args.random_clock),

data/items.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from constants.items import id_name, name_id
66

77
import data.items_asm as items_asm
8-
from data.movement import MovementActions
98

109
class Items():
1110
ITEM_COUNT = 256
@@ -282,8 +281,10 @@ def get_excluded(self):
282281
exclude.append(name_id["Exp. Egg"])
283282
if self.args.no_illuminas:
284283
exclude.append(name_id["Illumina"])
285-
# Sprint shoes are a literal dead item if not ORIGINAL or SPRINT_SHOES_B_DASH
286-
if self.args.no_sprint_shoes or self.args.movement in [MovementActions.AUTO_SPRINT, MovementActions.B_DASH]:
284+
285+
from data.movement import AUTO_SPRINT, B_DASH
286+
# Sprint Shoes are a literal dead item if any of these options
287+
if self.args.no_sprint_shoes or self.args.movement in [AUTO_SPRINT, B_DASH]:
287288
exclude.append(name_id["Sprint Shoes"])
288289
if self.args.no_free_paladin_shields:
289290
exclude.append(name_id["Paladin Shld"])

data/movement.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,28 @@ class MovementSpeed(IntEnum):
77
SPRINT = 3 # Original FF6 sprint speed
88
DASH = 4 # Custom, move twice as fast as sprint.
99

10-
class MovementActions:
10+
ORIGINAL = 'og'
11+
AUTO_SPRINT = 'as'
12+
B_DASH = 'bd'
13+
SPRINT_SHOES_B_DASH = 'ssbd'
14+
15+
name_key = {
1116
# WALK by default
1217
# SPRINT with sprint shoes equipped
13-
ORIGINAL = 'og'
18+
'ORIGINAL' : ORIGINAL,
1419
# SPRINT by default
1520
# WALK when holding B
16-
AUTO_SPRINT = 'as'
21+
'AUTO_SPRINT' : AUTO_SPRINT,
1722
# SPRINT by default
1823
# DASH when holding B
19-
B_DASH = 'bd'
24+
'B-DASH' : B_DASH,
2025
# SPRINT by default
2126
# DASH when holding B with sprint shoes equipped
2227
# WALK when holding B without sprint shoes equipped
23-
SPRINT_SHOES_B_DASH = 'ssbd'
28+
'SPR SHOE B-DASH' : SPRINT_SHOES_B_DASH,
29+
}
30+
31+
key_name = {v: k for k, v in name_key.items()}
32+
33+
ALL = [ORIGINAL, AUTO_SPRINT, B_DASH, SPRINT_SHOES_B_DASH]
2434

25-
ALL = [ORIGINAL, AUTO_SPRINT, B_DASH, SPRINT_SHOES_B_DASH]

settings/movement.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
from data.movement import MovementActions, MovementSpeed
21
from memory.space import Allocate, Bank, Reserve, Write
32
import instruction.asm as asm
3+
from data.movement import AUTO_SPRINT, B_DASH, ORIGINAL, SPRINT_SHOES_B_DASH, MovementSpeed
44

55
class Movement:
66
def __init__(self):
77
import args
8-
self.movement = args.movement or MovementActions.AUTO_SPRINT
8+
self.movement = args.movement or AUTO_SPRINT
99

10-
if self.movement != MovementActions.ORIGINAL:
10+
if self.movement != ORIGINAL:
1111
self.mod()
1212

1313
def mod(self):
@@ -56,22 +56,21 @@ def get_auto_sprint_src(self):
5656
asm.BEQ("STORE_DEFAULT"), # do nothing if b pressed
5757
]
5858

59-
60-
if self.movement == MovementActions.AUTO_SPRINT:
59+
if self.movement == AUTO_SPRINT:
6160
src += [
6261
"ON_B_BUTTON",
6362
asm.LDA(MovementSpeed.WALK, asm.IMM8),
6463
asm.BRA("STORE"),
6564
]
66-
elif self.movement == MovementActions.B_DASH:
65+
elif self.movement == B_DASH:
6766
src += owzers_src
6867
src += [
6968
"ON_B_BUTTON",
7069
asm.LDA(MovementSpeed.DASH, asm.IMM8),
7170
asm.BRA("STORE"),
7271
]
7372

74-
elif self.movement == MovementActions.SPRINT_SHOES_B_DASH:
73+
elif self.movement == SPRINT_SHOES_B_DASH:
7574
src += owzers_src
7675
src += [
7776
"ON_B_BUTTON",

0 commit comments

Comments
 (0)