Skip to content

Commit 37dce22

Browse files
authored
Merge pull request #2903 from UmedMuzl/more-coins
Update GloomyGalleon.py
2 parents 24e832b + 442618a commit 37dce22

File tree

9 files changed

+460
-420
lines changed

9 files changed

+460
-420
lines changed

__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -842,11 +842,11 @@ def _generate_archipelago_prices(self):
842842

843843
# Constants
844844
MAX_COINS = {
845-
Kongs.donkey: 178,
845+
Kongs.donkey: 179,
846846
Kongs.diddy: 183,
847847
Kongs.lanky: 190,
848848
Kongs.tiny: 198,
849-
Kongs.chunky: 219,
849+
Kongs.chunky: 224,
850850
}
851851

852852
PRICE_PERCENTAGES = {

ap_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Holds the version for Archipelago."""
22

3-
version = "1.4.11"
3+
version = "1.4.12"

base-hack/src/item rando/ice_trap.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,11 @@ int canLoadIceTrap(ICE_TRAP_TYPES trap_type) {
662662
}
663663
}
664664
}
665+
if (trap_type == ICETRAP_ANIMALS) {
666+
if (Player->characterID >= 6) {
667+
return 0;
668+
}
669+
}
665670
return 1;
666671
}
667672

randomizer/CollectibleLogicFiles/GloomyGalleon.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,5 +159,6 @@
159159
Collectible(Collectibles.coin, Kongs.tiny, lambda _: True, None, 2),
160160
],
161161
Regions.TriangleShip: [
162+
Collectible(Collectibles.coin, Kongs.chunky, lambda _: True, None, 3)
162163
],
163164
}

randomizer/Fill.py

Lines changed: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -551,36 +551,61 @@ def GetAccessibleLocations(
551551

552552
def VerifyMinimalLogic(spoiler: Spoiler) -> bool:
553553
"""Verify a world in the context of minimal logic."""
554-
# Key 5 not in Level 7 with non-LZR
555554
level_7 = None
555+
level_7_lobby_map = None
556556
if spoiler.settings.shuffle_loading_zones != ShuffleLoadingZones.all: # Non-LZR
557-
level_7 = Levels.CreepyCastle
558557
if spoiler.settings.shuffle_loading_zones == ShuffleLoadingZones.levels:
559-
level_7 = spoiler.settings.level_order[6]
560-
561-
# Kongs not in shops tied to them
562-
kong_shop_locations = [
563-
[], # DK
564-
[], # Diddy
565-
[], # Lanky
566-
[], # Tiny
567-
[], # Chunky
568-
]
569-
for level, shop_level_data in ShopLocationReference.items():
570-
for vendor, shop_vendor_data in shop_level_data.items():
571-
for kong_idx, kong_loc in enumerate(shop_vendor_data):
572-
if kong_idx < 5:
573-
kong_shop_locations[kong_idx].append(kong_loc)
558+
# In level shuffle, check level 7
559+
level_7 = spoiler.settings.level_order[7]
560+
else:
561+
# Vanilla Order
562+
level_7 = Levels.CreepyCastle
563+
564+
# Map the level to its lobby map
565+
lobby_map_dict = {
566+
Levels.JungleJapes: Maps.JungleJapesLobby,
567+
Levels.AngryAztec: Maps.AngryAztecLobby,
568+
Levels.FranticFactory: Maps.FranticFactoryLobby,
569+
Levels.GloomyGalleon: Maps.GloomyGalleonLobby,
570+
Levels.FungiForest: Maps.FungiForestLobby,
571+
Levels.CrystalCaves: Maps.CrystalCavesLobby,
572+
Levels.CreepyCastle: Maps.CreepyCastleLobby,
573+
}
574+
level_7_lobby_map = lobby_map_dict.get(level_7)
575+
level_7_items = []
576+
574577
kong_items = [Items.Donkey, Items.Diddy, Items.Lanky, Items.Tiny, Items.Chunky]
575578
for loc, data in spoiler.LocationList.items():
576-
if level_7 is not None:
577-
if data.level == level_7 and data.item == Items.FungiForestKey:
578-
print("Placement invalid because of Key 5 being in Level 7")
579+
580+
# Track items in Level 7
581+
if level_7 is not None and data.level == level_7 and data.item is not None:
582+
level_7_items.append(data.item)
583+
584+
# Key 5 cannot be in Level 7 or its lobby
585+
if level_7 is not None and data.item == Items.FungiForestKey:
586+
# Check if in the level itself
587+
if data.level == level_7:
588+
print(f"Placement invalid because of Key 5 being in Level 7 at {data.name}")
579589
return False
580-
for kong_index, kong_locs in enumerate(kong_shop_locations):
581-
if loc in kong_locs and data.item == kong_items[kong_index]:
582-
print("Placement invalid due to shop in shop location")
590+
# Check if in the level's lobby
591+
if level_7_lobby_map is not None and data.default_mapid_data is not None:
592+
for map_data in data.default_mapid_data:
593+
if map_data.map == level_7_lobby_map:
594+
print(f"Placement invalid because of Key 5 being in Level 7 lobby at {data.name}")
595+
return False
596+
597+
# Kongs cannot be locked behind shops that require that specific Kong to access
598+
if data.type == Types.Shop and data.kong < 5:
599+
if data.item == kong_items[data.kong]:
600+
print(f"Placement invalid: {kong_items[data.kong].name} is locked behind their own shop at {data.name}")
583601
return False
602+
603+
# Kongs cannot be on their own banana medal or half-medal locations
604+
if data.type in (Types.Medal, Types.HalfMedal) and data.kong < 5:
605+
if data.item == kong_items[data.kong]:
606+
print(f"Placement invalid: {kong_items[data.kong].name} is on their own medal location at {data.name}")
607+
return False
608+
584609
# Blasts/Arcade R2 can't contain DK
585610
non_dk_locations = [
586611
Locations.JapesDonkeyBaboonBlast,
@@ -1466,6 +1491,15 @@ def RandomFill(spoiler: Spoiler, itemsToPlace: List[Items], inOrder: bool = Fals
14661491
spoiler.settings.random.shuffle(itemEmpty)
14671492
locationId = itemEmpty.pop()
14681493
spoiler.LocationList[locationId].PlaceItem(spoiler, item)
1494+
1495+
# In minimal logic, verify placement doesn't violate minimal logic rules
1496+
if settings.logic_type == LogicType.minimal:
1497+
if not VerifyMinimalLogic(spoiler):
1498+
# Placement violated minimal logic, unplace and try another location
1499+
spoiler.LocationList[locationId].UnplaceItem(spoiler)
1500+
itemsToPlace.append(item)
1501+
continue
1502+
14691503
empty.remove(locationId)
14701504
if locationId in SharedShopLocations:
14711505
settings.placed_shared_shops += 1

randomizer/Patching/Library/Generic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ def sumChecks(spoiler, ownedItems, locations: list) -> int:
802802

803803
def getHolidaySetting(settings):
804804
"""Get the holiday setting."""
805-
is_offseason = False
805+
is_offseason = True
806806
if is_offseason:
807807
return settings.holiday_setting_offseason
808808
return settings.holiday_setting
@@ -811,7 +811,7 @@ def getHolidaySetting(settings):
811811
def getHoliday(settings):
812812
"""Get the holiday experienced."""
813813
if getHolidaySetting(settings):
814-
return Holidays.Halloween
814+
return Holidays.Christmas
815815
return Holidays.no_holiday
816816

817817

static/patches/shrink-dk64.bps

23 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)