Skip to content

Commit

Permalink
v1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbrq committed Aug 11, 2024
1 parent bdb072e commit 567b61e
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 36 deletions.
19 changes: 14 additions & 5 deletions worlds/gl/GauntletLegendsClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,9 +615,17 @@ async def scout_locations(self, ctx: "GauntletLegendsContext") -> None:
_id = level[0]
if level[1] == 1:
_id = castle_id.index(level[0]) + 1
raw_locations = [
location for location in level_locations.get((level[1] << 4) + _id, []) if self.difficulty >= location.difficulty
]
raw_locations = []
for location in level_locations.get((level[1] << 4) + _id, []):
if "Chest" in location.name:
if self.glslotdata["chests"]:
raw_locations += [location]
elif "Barrel" in location.name and "Barrel of Gold" not in location.name:
if self.glslotdata["barrels"]:
raw_locations += [location]
else:
if self.difficulty >= location.difficulty:
raw_locations += [location]
await ctx.send_msgs(
[
{
Expand Down Expand Up @@ -708,7 +716,7 @@ async def dead(self) -> bool:
temp = await self.socket.read(message_format(READ, f"0x{format(PLAYER_KILL, 'x')} 1"))
if (temp[0] & 0xF) == 0x1:
self.ignore_deathlink = True
return (temp[0] & 0xF) == 0x8 or (temp[0] & 0xF) == 0x1
return ((temp[0] & 0xF) == 0x8) or ((temp[0] & 0xF) == 0x1)

# Returns a number that tells if the player is fighting a boss currently
async def boss(self) -> int:
Expand Down Expand Up @@ -747,7 +755,8 @@ async def level_status(self, ctx: "GauntletLegendsContext") -> bool:
elif self.ignore_deathlink:
self.ignore_deathlink = False
else:
await ctx.send_death(f"{ctx.auth} didn't eat enough meat.")
if self.deathlink_enabled:
await ctx.send_death(f"{ctx.auth} didn't eat enough meat.")
await self.var_reset()
return True
return False
Expand Down
46 changes: 23 additions & 23 deletions worlds/gl/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,29 +86,29 @@ class GLItem(Item):
"Light Potion": 50,
"Acid Potion": 50,
"Fire Potion": 50,
"Acid Breath": 33,
"Lightning Breath": 33,
"Fire Breath": 33,
"Light Amulet": 32,
"Acid Amulet": 32,
"Lightning Amulet": 32,
"Fire Amulet": 35,
"Lightning Shield": 33,
"Fire Shield": 33,
"Invisibility": 34,
"Levitate": 32,
"Speed Boots": 33,
"3-Way Shot": 37,
"5-Way Shot": 33,
"Rapid Fire": 36,
"Reflective Shot": 37,
"Reflective Shield": 33,
"Super Shot": 33,
"Timestop": 33,
"Phoenix Familiar": 37,
"Growth": 36,
"Shrink": 35,
"Thunder Hammer": 35,
"Acid Breath": 50,
"Lightning Breath": 50,
"Fire Breath": 50,
"Light Amulet": 50,
"Acid Amulet": 50,
"Lightning Amulet": 50,
"Fire Amulet": 50,
"Lightning Shield": 50,
"Fire Shield": 50,
"Invisibility": 50,
"Levitate": 50,
"Speed Boots": 50,
"3-Way Shot": 50,
"5-Way Shot": 50,
"Rapid Fire": 50,
"Reflective Shot": 50,
"Reflective Shield": 50,
"Super Shot": 50,
"Timestop": 50,
"Phoenix Familiar": 50,
"Growth": 50,
"Shrink": 50,
"Thunder Hammer": 50,
"Invulnerability": 25,
"Fruit": 100,
"Meat": 100,
Expand Down
10 changes: 5 additions & 5 deletions worlds/gl/Rom.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,17 @@ def locations_to_dict(locations: List[Location]) -> Dict[str, Tuple]:

def patch_docks(data: LevelData) -> LevelData:
data.stream.seek(0x19AC, 0)
data.stream.write(bytes([0x2, 0xF0, 0x0, 0x18, 0x1, 0x6F]))
data.stream.seek(0x80, 0)
data.stream.write(bytes([0x3, 0x4E, 0x0, 0x1A, 0x1, 0x32]))
data.stream.write(bytes([0x3, 0x20, 0x0, 0x18, 0x1, 0x7C]))
data.stream.seek(0x74, 0)
data.stream.write(bytes([0x3, 0x0, 0x0, 0x1A, 0x1, 0x8]))
return data


def patch_camp(data: LevelData) -> LevelData:
data.stream.seek(0x1B74, 0)
data.stream.write(bytes([0xFF, 0x2, 0x0, 0x3B, 0xFF, 0xF9]))
data.stream.write(bytes([0xFE, 0xE9, 0x0, 0x3B, 0xFF, 0xDC, 0x0, 0x10]))
data.stream.seek(0x1B64, 0)
data.stream.write(bytes([0xFE, 0x6B, 0x0, 0x3D, 0xFF, 0xEE]))
data.stream.write(bytes([0xFE, 0x84, 0x0, 0x3D, 0xFF, 0xE0, 0xFF, 0xF0]))
return data


Expand Down
14 changes: 11 additions & 3 deletions worlds/gl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
import typing

import settings
from BaseClasses import ItemClassification, Tutorial
from BaseClasses import ItemClassification, Tutorial, Item, Location
from Fill import fast_fill
from typing import List

from worlds.AutoWorld import WebWorld, World

Expand Down Expand Up @@ -152,10 +153,13 @@ def fill_slot_data(self) -> dict:
self.options.unlock_character_three.value,
self.options.unlock_character_four.value,
]
chests_barrels = self.options.chests_barrels.value
return {
"player": self.player,
"players": self.options.local_players.value,
"shards": shard_values,
"chests": bool(chests_barrels == 3 or chests_barrels == 1),
"barrels": bool(chests_barrels == 3 or chests_barrels == 2),
"speed": self.options.permanent_speed.value,
"keys": self.options.infinite_keys.value,
"characters": characters,
Expand Down Expand Up @@ -223,8 +227,12 @@ def set_rules(self) -> None:
"Gates of the Underworld", "Region", self.player,
)

def pre_fill(self) -> None:
locations = self.multiworld.get_unfilled_locations(self.player)
def fill_hook(self,
progitempool: List["Item"],
usefulitempool: List["Item"],
filleritempool: List["Item"],
fill_locations: List["Location"]) -> None:
locations = [location for location in fill_locations if location.player == self.player]
items = [item for item in self.multiworld.itempool if item.name == "Death" and item.player == self.player]
self.random.shuffle(locations)
fast_fill(self.multiworld, items, locations)
Expand Down

0 comments on commit 567b61e

Please sign in to comment.