Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…into gl
  • Loading branch information
jamesbrq committed Jul 30, 2024
2 parents 888e1ae + 567018b commit 734dc17
Show file tree
Hide file tree
Showing 4 changed files with 208 additions and 29 deletions.
209 changes: 193 additions & 16 deletions worlds/gl/Arrays.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,6 @@
"Poison Fruit": -50,
}

# Level area ID to area name conversion
levels: Dict[int, str] = {
0x1: "Castle",
0x2: "Mountain",
0x7: "Town",
0x8: "Hell",
0x9: "Ice",
0xF: "Boss",
0x11: "Battlefield",
}

# Castle level ID order
castle_id = [1, 6, 3, 4, 5]

Expand Down Expand Up @@ -445,10 +434,6 @@
# Area and Level ID's for mirror levels
mirror_levels = [bytes([0x6, 0x2]), bytes([0x5, 0x9]), bytes([0x5, 0x1]), bytes([0x5, 0x7])]

# Levels with obelisks in them in vanilla
# Values are index of level_locations array
level_obelisk = [5, 6, 7, 11, 12, 0, 1]

# ID's for names said by announcer
sounds = {
0: 0x9D,
Expand All @@ -471,5 +456,197 @@
}

no_obelisks = [

88870012,
88870010,
88873518,
88870014,
88873515,
88870013,
88873514,
88870050,
88870057,
88870056,
88870034,
88870039,
88870047,
88870043,
88870026,
88870051,
88873748,
88870085,
88870095,
88873726,
88873746,
88873715,
88870063,
88870059,
88873743,
88870093,
88870062,
88870094,
8887380,
88870124,
88870109,
88873836,
88870119,
88870104,
88870135,
88870106,
8887382,
88873816,
88870101,
88870136,
88873823,
88870137,
88873943,
88873924,
88873945,
88873917,
8887393,
88870166,
88870154,
88870159,
88873022,
88873024,
8887302,
88873048,
88873010,
88873032,
88870188,
88870200,
88870191,
88870192,
88870212,
88873012,
88870216,
88873035,
88873023,
88873038,
88870202,
88870234,
88870220,
88870229,
88873118,
88873128,
88870224,
88873124,
88870235,
88870252,
88870263,
88870241,
88870278,
88870260,
88870259,
88870247,
88870276,
8887326,
88873214,
88870313,
88870284,
88870321,
88870302,
88870316,
88870311,
88870295,
88873323,
88870294,
88870317,
8887330,
88870285,
88873316,
88873314,
88870375,
88871143,
88871231,
88871234,
88871229,
88870400,
88870394,
88871225,
88871237,
88870396,
88870398,
88871241,
88871353,
88871363,
88870402,
88870406,
88870405,
88871315,
88871357,
88870411,
88871358,
88870409,
88871316,
88871317,
88871318,
88871325,
88871312,
88871417,
8887145,
88870431,
88870435,
88870428,
88871438,
88870429,
88871436,
88871422,
88870422,
88871425,
88870437,
88871630,
88871764,
88871857,
88871830,
88871829,
88870498,
8887185,
88871822,
88870518,
88870515,
88870512,
8887194,
88870520,
88871952,
88871944,
88871942,
88870535,
88870534,
88872031,
88872026,
88870533,
88870532,
88872032,
88870544,
88870541,
88872111,
88870540,
88870546,
8887217,
88870538,
88870542,
88872232,
88872227,
88870561,
8887228,
88870560,
88872323,
88872321,
88872320,
88872311,
88872347,
88872346,
88872345,
88872332,
88872330,
88870576,
88872334,
88872333,
88872332,
88870575,
88872331,
88870573,
88870574,
88870603,
88870596
]
4 changes: 2 additions & 2 deletions worlds/gl/Locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ class GLLocation(Location):
LocationData("Arctic Docks - Small Pile of Gold (Dif. 2)", 88870439, 2),
LocationData("Arctic Docks - Fire Shield", 88870440, 1),
LocationData("Arctic Docks - Key 1", 88870441, 1),
LocationData("Arctic Docks - Drumstick", 88870442, 1),
LocationData("Arctic Docks - Meat", 88870442, 1),
LocationData("Arctic Docks - Light Potion 3 (Dif. 2)", 88870443, 2),
LocationData("Arctic Docks - Runestone", 88870444, 1),
LocationData("Arctic Docks - Key 2", 88870445, 1),
Expand Down Expand Up @@ -1623,7 +1623,7 @@ class GLLocation(Location):
]

battle_towers: typing.List[LocationData] = [
LocationData("Battle Towers - Ham (Dif. 3)", 88870560, 3),
LocationData("Battle Towers - Meat (Dif. 3)", 88870560, 3),
LocationData("Battle Towers - Key 1", 88870561, 1),
LocationData("Battle Towers - Large Pile of Gold (Dif. 3)", 88870562, 3),
LocationData("Battle Towers - Small Pile of Gold (Dif. 2)", 88870563, 2),
Expand Down
15 changes: 9 additions & 6 deletions worlds/gl/Rules.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import typing

from BaseClasses import ItemClassification
from worlds.generic.Rules import add_rule, forbid_item

from .Arrays import difficulty_lambda, level_locations
from .Arrays import difficulty_lambda, level_locations, no_obelisks
from .Items import item_list
from .Locations import all_locations, chimeras_keep, dragons_lair, gates_of_the_underworld

Expand All @@ -22,14 +23,16 @@ def set_rules(world: "GauntletLegendsWorld"):
runestones = [item.item_name for item in item_list if "Runestone" in item.item_name]
obelisks = [item.item_name for item in item_list if "Obelisk" in item.item_name]
mirror_shards = [item.item_name for item in item_list if "Mirror" in item.item_name]
boss_weapons = [item.item_name for item in item_list if item.progression == ItemClassification.useful]

for location in [
location
for location in all_locations
if "Mirror" in location.name
or location in dragons_lair
or location in chimeras_keep
or location in gates_of_the_underworld
if "Mirror" in location.name
or location in dragons_lair
or location in chimeras_keep
or location in gates_of_the_underworld
or location.id in no_obelisks
] + [location for location in all_locations if "Obelisk" in location.name and world.options.obelisks == 1]:
for item in obelisks:
if location.name not in world.disabled_locations:
Expand All @@ -38,7 +41,7 @@ def set_rules(world: "GauntletLegendsWorld"):
for location in [
location for location in all_locations if "Barrel" in location.name and "Barrel of Gold" not in location.name
]:
for item in runestones + mirror_shards:
for item in runestones + mirror_shards + boss_weapons:
if location.name not in world.disabled_locations:
forbid_item(world.get_location(location.name), item, world.player)

Expand Down
9 changes: 4 additions & 5 deletions worlds/gl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,10 @@ def set_rules(self) -> None:
)

def pre_fill(self) -> None:
if len(self.death) != 0:
locations = self.multiworld.get_unfilled_locations(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)
locations = self.multiworld.get_unfilled_locations(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)

def create_item(self, name: str) -> GLItem:
item = item_table[name]
Expand Down

0 comments on commit 734dc17

Please sign in to comment.