Skip to content

Commit

Permalink
Mostly works, just gotta deal with memory leak issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ScipioWright committed Jun 22, 2024
1 parent 8cfb383 commit 49a9301
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 70 deletions.
2 changes: 1 addition & 1 deletion worlds/ladx/Common.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
LINKS_AWAKENING = "Links Awakening DX"
BASE_ID = 10000000
BASE_ID = 10000000
9 changes: 5 additions & 4 deletions worlds/ladx/LADXR/itempool.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .locations.items import *
from typing import Dict


DEFAULT_ITEM_POOL = {
Expand Down Expand Up @@ -165,12 +166,12 @@ def __setup(self, logic, settings):
for n in range(9):
self.remove("MAP%d" % (n + 1))
self.remove("COMPASS%d" % (n + 1))
self.add("KEY%d" % (n +1))
self.add("NIGHTMARE_KEY%d" % (n +1))
self.add("KEY%d" % (n + 1))
self.add("NIGHTMARE_KEY%d" % (n + 1))
if settings.owlstatues in ("none", "overworld"):
for n in range(9):
self.remove("STONE_BEAK%d" % (n + 1))
self.add("KEY%d" % (n +1))
self.add("KEY%d" % (n + 1))

# if settings.dungeon_items == 'keysy':
# for n in range(9):
Expand Down Expand Up @@ -274,5 +275,5 @@ def __randomizeRupees(self, options, rnd):
self.add(new_item)
self.remove(remove_item)

def toDict(self):
def toDict(self) -> Dict[str, int]:
return self.__pool.copy()
20 changes: 10 additions & 10 deletions worlds/ladx/LADXR/logic/overworld.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,20 +619,20 @@ def __init__(self, options, r):
self.overworld_entrance = {}
self.indoor_location = {}

start_house = Location("Start House").add(StartItem())
Location().add(ShopItem(0)).connect(start_house, OR(COUNT("RUPEES", 200), SWORD))
Location().add(ShopItem(1)).connect(start_house, OR(COUNT("RUPEES", 980), SWORD))
Location().add(Song(0x0B1)).connect(start_house, OCARINA) # Marins song
start_house = IndoorLocation("Start House").add(StartItem())
VirtualLocation().add(ShopItem(0)).connect(start_house, OR(COUNT("RUPEES", 200), SWORD))
VirtualLocation().add(ShopItem(1)).connect(start_house, OR(COUNT("RUPEES", 980), SWORD))
VirtualLocation().add(Song(0x0B1)).connect(start_house, OCARINA) # Marins song
start_house.add(DroppedKey(0xB2)) # Sword on the beach
egg = Location().connect(start_house, AND(r.bush, BOMB))
Location().add(MadBatter(0x1E1)).connect(start_house, MAGIC_POWDER)
egg = VirtualLocation().connect(start_house, AND(r.bush, BOMB))
VirtualLocation().add(MadBatter(0x1E1)).connect(start_house, MAGIC_POWDER)
if options.boomerang == 'trade':
Location().add(BoomerangGuy()).connect(start_house, AND(BOMB, OR(BOOMERANG, HOOKSHOT, MAGIC_ROD, PEGASUS_BOOTS, FEATHER, SHOVEL)))
VirtualLocation().add(BoomerangGuy()).connect(start_house, AND(BOMB, OR(BOOMERANG, HOOKSHOT, MAGIC_ROD, PEGASUS_BOOTS, FEATHER, SHOVEL)))
elif options.boomerang == 'gift':
Location().add(BoomerangGuy()).connect(start_house, BOMB)
VirtualLocation().add(BoomerangGuy()).connect(start_house, BOMB)

nightmare = Location("Nightmare")
windfish = Location("Windfish").connect(nightmare, AND(MAGIC_POWDER, SWORD, OR(BOOMERANG, BOW)))
nightmare = VirtualLocation("Nightmare")
windfish = VirtualLocation("Windfish").connect(nightmare, AND(MAGIC_POWDER, SWORD, OR(BOOMERANG, BOW)))

self.start = start_house
self.overworld_entrance = {
Expand Down
4 changes: 2 additions & 2 deletions worlds/ladx/Locations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from BaseClasses import Region, Entrance, Location, CollectionState

from typing import List

from .LADXR.checkMetadata import checkMetadataTable
from .Common import *
Expand Down Expand Up @@ -171,7 +171,7 @@ def ladxr_region_to_name(n):
return name


def create_regions_from_ladxr(player, multiworld, logic):
def create_regions_from_ladxr(player, multiworld, logic) -> List[LinksAwakeningRegion]:
tmp = set()

def print_items(n):
Expand Down
29 changes: 19 additions & 10 deletions worlds/ladx/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,21 @@ class Boomerang(Choice):
gift = 1
default = gift


class BossShuffle(Choice):
none = 0
shuffle = 1
random = 2
default = none


class EntranceShuffle(Choice):
option_vanilla = 0
option_simple = 1
option_mixed = 2
alias_false = option_vanilla


class StartShufflePool(OptionList):
"""
Shuffle Start Location
Expand Down Expand Up @@ -121,14 +124,16 @@ class StartShufflePool(OptionList):
# option_connector = 6
# option_dungeon = 7


class SingleEntranceShuffle(EntranceShuffle):
"""
Shuffle Single Entrances (non connectors with checks inside)
[Vanilla] No changes
[Simple] The entrances will be shuffled amongst themselves
[Mixed] The entrances will be shuffled among all other entrances
"""
entrance_type=["single", "trade"]
entrance_type = ["single", "trade"]


class DummyEntranceShuffle(EntranceShuffle):
"""
Expand All @@ -137,7 +142,8 @@ class DummyEntranceShuffle(EntranceShuffle):
[Simple] The entrances will be shuffled amongst themselves
[Mixed] The entrances will be shuffled among all other entrances
"""
entrance_type=["dummy"]
entrance_type = ["dummy"]


class AnnoyingEntranceShuffle(EntranceShuffle):
"""
Expand All @@ -146,7 +152,8 @@ class AnnoyingEntranceShuffle(EntranceShuffle):
[Simple] The entrances will be shuffled amongst themselves
[Mixed] The entrances will be shuffled among all other entrances
"""
entrance_type=["insanity"]
entrance_type = ["insanity"]


class WaterEntranceShuffle(EntranceShuffle):
"""
Expand All @@ -155,7 +162,8 @@ class WaterEntranceShuffle(EntranceShuffle):
[Simple] The entrances will be shuffled amongst themselves
[Mixed] The entrances will be shuffled among all other entrances
"""
entrance_type=["water"]
entrance_type = ["water"]


class ConnectorEntranceShuffle(EntranceShuffle):
"""
Expand All @@ -164,7 +172,8 @@ class ConnectorEntranceShuffle(EntranceShuffle):
[Simple] The entrances will be shuffled amongst themselves
[Mixed] The entrances will be shuffled among all other entrances
"""
entrance_type=["connector"]
entrance_type = ["connector"]


class DungeonEntranceShuffle(EntranceShuffle):
"""
Expand All @@ -173,14 +182,16 @@ class DungeonEntranceShuffle(EntranceShuffle):
[Simple] The entrances will be shuffled amongst themselves
[Mixed] The entrances will be shuffled among other entrances
"""
entrance_type=["dungeon"]
entrance_type = ["dungeon"]


class APTitleScreen(DefaultOnToggle):
"""
Enables AP specific title screen and disables the intro cutscene
"""
display_name = "AP Title Screen"


class OwnItemOnTarin(DefaultOnToggle):
"""
Forces one of your own items to be on Tarin.
Expand Down Expand Up @@ -563,6 +574,7 @@ class AdditionalWarpPoints(DefaultOffToggle):
[Off] No change
"""


ladx_option_groups = [
OptionGroup("Goal Options", [
Goal,
Expand All @@ -587,10 +599,6 @@ class AdditionalWarpPoints(DefaultOffToggle):
NagMessages,
BootsControls
]),
OptionGroup("Experimental", [
DungeonShuffle,
EntranceShuffle
]),
OptionGroup("Visuals & Sound", [
LinkPalette,
Palette,
Expand All @@ -602,6 +610,7 @@ class AdditionalWarpPoints(DefaultOffToggle):
])
]


@dataclass
class LinksAwakeningOptions(PerGameCommonOptions):
logic: Logic
Expand Down
Loading

0 comments on commit 49a9301

Please sign in to comment.