Skip to content

Commit d13240c

Browse files
committed
v1.5.0
1 parent d6a5fbd commit d13240c

6 files changed

+106
-84
lines changed

GauntletLegendsClient.py

+13-8
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,13 @@ def _cmd_deathlink_toggle(self):
164164
self.ctx.deathlink_enabled = not self.ctx.deathlink_enabled
165165
logger.info(f"Deathlink {'Enabled.' if self.ctx.deathlink_enabled else 'Disabled.'}")
166166

167+
def _cmd_players(self, value: int):
168+
"""Set number of local players"""
169+
if type(value) is not int:
170+
logger.info(f"Invalid Parameters. Usage: /players [number]")
171+
self.ctx.players = min(value, 4)
172+
logger.info(f"Players set to {min(value, 4)}.")
173+
167174

168175
class GauntletLegendsContext(CommonContext):
169176
command_processor = GauntletLegendsCommandProcessor
@@ -491,7 +498,6 @@ def on_package(self, cmd: str, args: dict):
491498
self.glslotdata = args["slot_data"]
492499
if self.socket.status():
493500
self.retro_connected = True
494-
self.players = self.glslotdata["players"]
495501
self.deathlink_enabled = self.glslotdata["death_link"]
496502
else:
497503
raise Exception("Retroarch not detected. Please open you patched ROM in Retroarch.")
@@ -575,11 +581,11 @@ async def scale(self):
575581
level = [0x1, 0xF]
576582
players = await self.active_players()
577583
player_level = await self.player_level()
578-
max_value: int = self.glslotdata["max"]
584+
max_value: int = max(self.glslotdata["max"], self.players)
579585
scale_value = min(max(((player_level - difficulty_convert[level[1]]) // 5), 0), 3)
580586
if self.glslotdata["instant_max"] == 1:
581587
scale_value = max_value
582-
mountain_value = min(player_level // 10, 3)
588+
# mountain_value = min(player_level // 10, 3)
583589
await self.socket.write(
584590
message_format(WRITE, f"0x{format(PLAYER_COUNT, 'x')} 0x{format(min(players + scale_value, max_value), 'x')}"),
585591
)
@@ -619,8 +625,6 @@ async def scout_locations(self, ctx: "GauntletLegendsContext") -> None:
619625
"locations": [
620626
location.id
621627
for location in raw_locations
622-
if "Chest" not in location.name
623-
and ("Barrel" not in location.name or "Barrel of Gold" in location.name)
624628
],
625629
"create_as_hint": 0,
626630
},
@@ -664,7 +668,7 @@ async def location_loop(self) -> List[int]:
664668
await self.obj_read(1)
665669
acquired = []
666670
for i, obj in enumerate(self.item_objects):
667-
if obj.raw[:2] == bytes([0xAD, 0xB]):
671+
if obj.raw[24] != 0x0:
668672
if self.item_locations[i].id not in self.locations_checked:
669673
self.locations_checked += [self.item_locations[i].id]
670674
acquired += [self.item_locations[i].id]
@@ -675,7 +679,7 @@ async def location_loop(self) -> List[int]:
675679
acquired += [self.obelisk_locations[j].id]
676680
for k, obj in enumerate(self.chest_objects):
677681
if "Chest" in self.chest_locations[k].name:
678-
if obj.raw[:2] == bytes([0xAD, 0xB]):
682+
if obj.raw[24] != 0x0:
679683
if self.chest_locations[k].id not in self.locations_checked:
680684
self.locations_checked += [self.chest_locations[k].id]
681685
acquired += [self.chest_locations[k].id]
@@ -701,7 +705,7 @@ async def limbo_check(self, offset=0) -> int:
701705
# Returns True of the player is dead
702706
async def dead(self) -> bool:
703707
temp = await self.socket.read(message_format(READ, f"0x{format(PLAYER_KILL, 'x')} 1"))
704-
return (temp[0] & 0x8) == 0x8
708+
return ((temp[0] & 0x8) == 0x8 or (temp[0] | 0xFF) == 0x1)
705709

706710
# Returns a number that tells if the player is fighting a boss currently
707711
async def boss(self) -> int:
@@ -799,6 +803,7 @@ async def _patch_and_run_game(patch_file: str):
799803
# Checks location status inside of levels
800804
async def gl_sync_task(ctx: GauntletLegendsContext):
801805
logger.info("Starting N64 connector...")
806+
logger.info("Use /players to set the number of people playing locally. This is required for the client to function.")
802807
while not ctx.exit_event.is_set():
803808
if ctx.retro_connected:
804809
cc_str: str = f"gl_cc_T{ctx.team}_P{ctx.slot}"

Locations.py

+31-31
Original file line numberDiff line numberDiff line change
@@ -1327,12 +1327,12 @@ class GLLocation(Location):
13271327
LocationData("Crystal Mine - Shrink (Dif. 3)", 88870511, 3),
13281328
LocationData("Crystal Mine Barrel - Reflective Shot 1 (Dif. 3)", 8887180, 3),
13291329
LocationData("Crystal Mine Barrel - Speed Boots 1 (Dif. 4)", 8887181, 4),
1330-
LocationData("Crystal Mine Barrel - Unknown 1 (Dif. 2)", 8887182, 2),
1331-
LocationData("Crystal Mine Barrel - Unknown 2", 8887183, 1),
1332-
LocationData("Crystal Mine Barrel - Unknown 3 (Dif. 3)", 8887184, 3),
1333-
LocationData("Crystal Mine Barrel - Unknown 4 (Dif. 2)", 8887185, 2),
1334-
LocationData("Crystal Mine Barrel - Unknown 5", 8887186, 1),
1335-
LocationData("Crystal Mine Barrel - Unknown 6", 8887187, 1),
1330+
LocationData("Crystal Mine Barrel - Meat 1 (Dif. 2)", 8887182, 2),
1331+
LocationData("Crystal Mine Barrel - Meat 2", 8887183, 1),
1332+
LocationData("Crystal Mine Barrel - Meat 3 (Dif. 3)", 8887184, 3),
1333+
LocationData("Crystal Mine Barrel - Meat 4 (Dif. 2)", 8887185, 2),
1334+
LocationData("Crystal Mine Barrel - Meat 5", 8887186, 1),
1335+
LocationData("Crystal Mine Barrel - Scroll 1", 8887187, 1),
13361336
LocationData("Crystal Mine Chest - Growth 1 (Dif. 2)", 8887188, 2),
13371337
LocationData("Crystal Mine Barrel - Key 1", 8887189, 1),
13381338
LocationData("Crystal Mine Barrel - Key 2", 88871810, 1),
@@ -1383,7 +1383,7 @@ class GLLocation(Location):
13831383
LocationData("Crystal Mine Barrel - Potion 4", 88871855, 1),
13841384
LocationData("Crystal Mine Barrel - Key 15", 88871856, 1),
13851385
LocationData("Crystal Mine Chest - 3-Way Shot 1", 88871857, 1),
1386-
LocationData("Crystal Mine Barrel - Scroll 1", 88871858, 1),
1386+
LocationData("Crystal Mine Barrel - Scroll 2", 88871858, 1),
13871387
LocationData("Crystal Mine Chest - Gold 8", 88871859, 1),
13881388
LocationData("Crystal Mine Barrel - Fire Amulet 1", 88871860, 1),
13891389
LocationData("Crystal Mine Barrel - Key 16", 88871861, 1),
@@ -1415,21 +1415,21 @@ class GLLocation(Location):
14151415
LocationData("Erupting Fissure - Speed Boots (Dif. 4)", 88870527, 4),
14161416
LocationData("Erupting Fissure - Key 9", 88870528, 1),
14171417
LocationData("Erupting Fissure - Key 10 (Dif. 2)", 88870529, 2),
1418-
LocationData("Erupting Fissure Barrel - Unknown 1", 8887190, 1),
1419-
LocationData("Erupting Fissure Barrel - Unknown 2 (Dif. 4)", 8887191, 4),
1418+
LocationData("Erupting Fissure Barrel - Meat 1", 8887190, 1),
1419+
LocationData("Erupting Fissure Barrel - Potion 1 (Dif. 4)", 8887191, 4),
14201420
LocationData("Erupting Fissure Barrel - Thunder Hammer 1 (Dif. 2)", 8887192, 2),
1421-
LocationData("Erupting Fissure Barrel - Unknown 3 (Dif. 4)", 8887193, 4),
1422-
LocationData("Erupting Fissure Barrel - Unknown 4", 8887194, 1),
1423-
LocationData("Erupting Fissure Barrel - Unknown 5 (Dif. 4)", 8887195, 4),
1424-
LocationData("Erupting Fissure Barrel - Unknown 6", 8887196, 1),
1425-
LocationData("Erupting Fissure Barrel - Unknown 7 (Dif. 2)", 8887197, 2),
1426-
LocationData("Erupting Fissure Barrel - Unknown 8", 8887198, 1),
1427-
LocationData("Erupting Fissure Barrel - Unknown 9", 8887199, 1),
1428-
LocationData("Erupting Fissure Barrel - Unknown 10", 88871910, 1),
1429-
LocationData("Erupting Fissure Barrel - Unknown 11 (Dif. 3)", 88871911, 3),
1430-
LocationData("Erupting Fissure Barrel - Unknown 12 (Dif. 2)", 88871912, 2),
1431-
LocationData("Erupting Fissure Barrel - Unknown 13", 88871913, 1),
1432-
LocationData("Erupting Fissure Barrel - Unknown 14", 88871914, 1),
1421+
LocationData("Erupting Fissure Barrel - Fruit 1 (Dif. 4)", 8887193, 4),
1422+
LocationData("Erupting Fissure Barrel - Scroll 1", 8887194, 1),
1423+
LocationData("Erupting Fissure Barrel - Meat 2 (Dif. 4)", 8887195, 4),
1424+
LocationData("Erupting Fissure Barrel - Fruit 2", 8887196, 1),
1425+
LocationData("Erupting Fissure Barrel - Meat 3 (Dif. 2)", 8887197, 2),
1426+
LocationData("Erupting Fissure Barrel - Scroll 2", 8887198, 1),
1427+
LocationData("Erupting Fissure Barrel - Scroll 3", 8887199, 1),
1428+
LocationData("Erupting Fissure Barrel - Fruit 3", 88871910, 1),
1429+
LocationData("Erupting Fissure Barrel - Meat 4 (Dif. 3)", 88871911, 3),
1430+
LocationData("Erupting Fissure Barrel - Fruit 4 (Dif. 2)", 88871912, 2),
1431+
LocationData("Erupting Fissure Barrel - Meat 5", 88871913, 1),
1432+
LocationData("Erupting Fissure Barrel - Scroll 4", 88871914, 1),
14331433
LocationData("Erupting Fissure Barrel - Key 1", 88871915, 1),
14341434
LocationData("Erupting Fissure Barrel - Key 2 (Dif. 2)", 88871916, 2),
14351435
LocationData("Erupting Fissure Barrel - Key 3 (Dif. 2)", 88871917, 2),
@@ -1438,7 +1438,7 @@ class GLLocation(Location):
14381438
LocationData("Erupting Fissure Barrel - Nothing 2", 88871920, 1),
14391439
LocationData("Erupting Fissure Barrel - Nothing 3", 88871921, 1),
14401440
LocationData("Erupting Fissure Barrel - Nothing 4", 88871922, 1),
1441-
LocationData("Erupting Fissure Barrel - Fruit 1 (Dif. 3)", 88871923, 3),
1441+
LocationData("Erupting Fissure Barrel - Fruit 5 (Dif. 3)", 88871923, 3),
14421442
LocationData("Erupting Fissure Barrel - Acid Amulet 1 (Dif. 4)", 88871924, 4),
14431443
LocationData("Erupting Fissure Barrel - Nothing 5", 88871925, 1),
14441444
LocationData("Erupting Fissure Barrel - Nothing 6", 88871926, 1),
@@ -1451,7 +1451,7 @@ class GLLocation(Location):
14511451
LocationData("Erupting Fissure Barrel - Key 7 (Dif. 3)", 88871933, 3),
14521452
LocationData("Erupting Fissure Barrel - Key 8 (Dif. 4)", 88871934, 4),
14531453
LocationData("Erupting Fissure Barrel - Key 9 (Dif. 3)", 88871935, 3),
1454-
LocationData("Erupting Fissure Barrel - Fruit 2 (Dif. 2)", 88871936, 2),
1454+
LocationData("Erupting Fissure Barrel - Fruit 6 (Dif. 2)", 88871936, 2),
14551455
LocationData("Erupting Fissure Barrel - Death 1", 88871937, 1),
14561456
LocationData("Erupting Fissure Chest - Gold 2 (Dif. 3)", 88871938, 3),
14571457
LocationData("Erupting Fissure Chest - Meat 1 (Dif. 2)", 88871939, 2),
@@ -1469,13 +1469,13 @@ class GLLocation(Location):
14691469
LocationData("Erupting Fissure Barrel - Key 19", 88871951, 1),
14701470
LocationData("Erupting Fissure Barrel - Key 20 (Dif. 2)", 88871952, 2),
14711471
LocationData("Erupting Fissure Chest - Gold 4 (Dif. 2)", 88871953, 2),
1472-
LocationData("Erupting Fissure Barrel - Scroll 1", 88871954, 1),
1472+
LocationData("Erupting Fissure Barrel - Scroll 5", 88871954, 1),
14731473
LocationData("Erupting Fissure Chest - Potion 2", 88871955, 1),
14741474
LocationData("Erupting Fissure Chest - Light Amulet 1 (Dif. 2)", 88871956, 2),
14751475
LocationData("Erupting Fissure Barrel - Gold 1 (Dif. 4)", 88871957, 4),
14761476
LocationData("Erupting Fissure Barrel - Key 21 (Dif. 2)", 88871958, 2),
1477-
LocationData("Erupting Fissure Barrel - Fruit 3 (Dif. 4)", 88871959, 4),
1478-
LocationData("Erupting Fissure Barrel - Fruit 4 (Dif. 3)", 88871960, 3),
1477+
LocationData("Erupting Fissure Barrel - Fruit 7 (Dif. 4)", 88871959, 4),
1478+
LocationData("Erupting Fissure Barrel - Fruit 8 (Dif. 3)", 88871960, 3),
14791479
LocationData("Erupting Fissure Barrel - Gold 2", 88871961, 1),
14801480
LocationData("Erupting Fissure Barrel - Key 22", 88871962, 1),
14811481
LocationData("Erupting Fissure Barrel - Gold 3 (Dif. 3)", 88871963, 3),
@@ -1489,7 +1489,7 @@ class GLLocation(Location):
14891489
LocationData("Erupting Fissure Chest - Gold 7", 88871971, 1),
14901490
LocationData("Erupting Fissure Chest - Super Shot 1 (Dif. 3)", 88871972, 3),
14911491
LocationData("Erupting Fissure Chest - Timestop 1", 88871973, 1),
1492-
LocationData("Erupting Fissure Barrel - Potion 1", 88871974, 1),
1492+
LocationData("Erupting Fissure Barrel - Potion 2", 88871974, 1),
14931493
LocationData("Erupting Fissure Barrel - Death 3 (Dif. 2)", 88871975, 2),
14941494
LocationData("Erupting Fissure Chest - Levitate 1", 88871976, 1),
14951495
LocationData("Erupting Fissure Chest - Gold 8 (Dif. 2)", 88871977, 2),
@@ -1631,7 +1631,7 @@ class GLLocation(Location):
16311631
LocationData("Battle Towers - Key 2", 88870565, 1),
16321632
LocationData("Battle Towers - Soul Savior", 88870566, 1),
16331633
LocationData("Battle Towers Barrel - Fire Breath 1 (Dif. 4)", 8887220, 4),
1634-
LocationData("Battle Towers Barrel - Unknown 1", 8887221, 1),
1634+
LocationData("Battle Towers Barrel - Scroll 1", 8887221, 1),
16351635
LocationData("Battle Towers Chest - Invulnerability 1", 8887222, 1),
16361636
LocationData("Battle Towers Barrel - Thunder Hammer 1 (Dif. 2)", 8887223, 2),
16371637
LocationData("Battle Towers Barrel - Reflective Shield 1", 8887224, 1),
@@ -1641,12 +1641,12 @@ class GLLocation(Location):
16411641
LocationData("Battle Towers Barrel - Potion 2 (Dif. 2)", 8887228, 2),
16421642
LocationData("Battle Towers Dark Chest - Random 1 (Dif. 3)", 8887229, 3),
16431643
LocationData("Battle Towers Barrel - Fruit 1", 88872210, 1),
1644-
LocationData("Battle Towers Barrel - Scroll 1", 88872211, 1),
1644+
LocationData("Battle Towers Barrel - Scroll 2", 88872211, 1),
16451645
LocationData("Battle Towers Barrel - Gold 1 (Dif. 4)", 88872212, 4),
1646-
LocationData("Battle Towers Barrel - Scroll 2", 88872213, 1),
1646+
LocationData("Battle Towers Barrel - Scroll 3", 88872213, 1),
16471647
LocationData("Battle Towers Barrel - Key 3", 88872214, 1),
16481648
LocationData("Battle Towers Barrel - Key 4", 88872215, 1),
1649-
LocationData("Battle Towers Barrel - Scroll 3", 88872216, 1),
1649+
LocationData("Battle Towers Barrel - Scroll 4", 88872216, 1),
16501650
LocationData("Battle Towers Barrel - Key 5", 88872217, 1),
16511651
LocationData("Battle Towers Barrel - Fruit 2 (Dif. 3)", 88872218, 3),
16521652
LocationData("Battle Towers Barrel - Gold 2", 88872219, 1),

Regions.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def connect_regions(world: "GauntletLegendsWorld"):
104104
connect(
105105
world,
106106
names,
107-
"Valley of Fire",
107+
"Menu",
108108
"Castle Courtyard",
109109
lambda state: state.has("Mountain Obelisk 1", world.player)
110110
and state.has("Mountain Obelisk 2", world.player)
@@ -117,7 +117,7 @@ def connect_regions(world: "GauntletLegendsWorld"):
117117
connect(
118118
world,
119119
names,
120-
"Valley of Fire",
120+
"Menu",
121121
"Poisonous Fields",
122122
lambda state: state.has("Castle Obelisk 1", world.player)
123123
and state.has("Castle Obelisk 2", world.player),
@@ -129,7 +129,7 @@ def connect_regions(world: "GauntletLegendsWorld"):
129129
connect(
130130
world,
131131
names,
132-
"Valley of Fire",
132+
"Menu",
133133
"Arctic Docks",
134134
lambda state: state.has("Town Obelisk 1", world.player)
135135
and state.has("Town Obelisk 2", world.player),
@@ -141,7 +141,7 @@ def connect_regions(world: "GauntletLegendsWorld"):
141141
connect(
142142
world,
143143
names,
144-
"Valley of Fire",
144+
"Menu",
145145
"Desecrated Temple",
146146
lambda state: state.has("Dragon Mirror Shard", world.player)
147147
and state.has("Chimera Mirror Shard", world.player)
@@ -154,7 +154,7 @@ def connect_regions(world: "GauntletLegendsWorld"):
154154
connect(
155155
world,
156156
names,
157-
"Valley of Fire",
157+
"Menu",
158158
"Gates of the Underworld",
159159
lambda state: state.has("Runestone 1", world.player)
160160
and state.has("Runestone 2", world.player)

0 commit comments

Comments
 (0)