Skip to content

Commit d2d7528

Browse files
authored
Merge pull request #53 from Emerassi/shopsanity
Shopsanity
2 parents 9ee6df9 + 9b54a18 commit d2d7528

File tree

8 files changed

+938
-402
lines changed

8 files changed

+938
-402
lines changed

worlds/crystal_project/Items.py

Lines changed: 435 additions & 369 deletions
Large diffs are not rendered by default.

worlds/crystal_project/KeyItems.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
BLACK_SQUIRREL = "Item - Black Squirrel"
2+
DOG_BONE = "Item - Dog Bone"
3+
CLAMSHELL = "Item - Clamshell"
4+
DIGESTED_HEAD = "Item - Digested Head"
5+
LOST_PENGUIN = "Item - Lost Penguin"
6+
ELEVATOR_PART = "Item - Elevator Part"
7+
UNDERSEA_CRAB = "Item - Undersea Crab"
8+
WEST_LOOKOUT_TOKEN = "Item - West Lookout Token"
9+
CENTRAL_LOOKOUT_TOKEN = "Item - Central Lookout Token"
10+
NORTH_LOOKOUT_TOKEN = "Item - North Lookout Token"
11+
BABEL_QUINTAR = "Item - Babel Quintar"
12+
#"Item - Quintar Shedding"
13+
CRAG_DEMON_HORN = "Item - Crag Demon Horn"
14+
VERMILLION_BOOK = "Item - Vermillion Book"
15+
VIRIDIAN_BOOK = "Item - Viridian Book"
16+
CERULEAN_BOOK = "Item - Cerulean Book"
17+
ANCIENT_TABLET_A = "Item - Ancient Tablet A"
18+
ANCIENT_TABLET_B = "Item - Ancient Tablet B"
19+
ANCIENT_TABLET_C = "Item - Ancient Tablet C"
20+
TREASURE_FINDER = "Item - Treasure Finder"
21+
PROGRESSIVE_LEVEL_CAP = "Item - Progressive Level Cap"

worlds/crystal_project/Locations.py

Lines changed: 466 additions & 29 deletions
Large diffs are not rendered by default.

worlds/crystal_project/Options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class KillBossesMode(Toggle):
9090
"""
9191
display_name = "Kill Bosses Mode"
9292

93+
When enabled, all shop inventories will be replaced with checks. Be prepared, adventurer.
9394

9495
class IncludedRegions(Choice):
9596
"""

worlds/crystal_project/Regions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
from .Options import CrystalProjectOptions
44
from .Locations import LocationData
55
from .rules import CrystalProjectLogic
6-
from .Constants import *
6+
from .Keys import *
7+
from .KeyItems import *
78

89
class CrystalProjectLocation(Location):
910
game: str = "CrystalProject"
@@ -61,6 +62,7 @@ def init_areas(world: MultiWorld, locations: List[LocationData], options: Crysta
6162
create_region(world, player, locations_per_region, "Greenshire Reprise", excluded),
6263
create_region(world, player, locations_per_region, "Salmon Pass", excluded),
6364
create_region(world, player, locations_per_region, "Salmon River", excluded),
65+
create_region(world, player, locations_per_region, "Shoudu Waterfront", excluded), #moved Shoudu Waterfront from Expert to Advanced
6466
create_region(world, player, locations_per_region, "Poko Poko Desert", excluded),
6567
create_region(world, player, locations_per_region, "Sara Sara Bazaar", excluded),
6668
create_region(world, player, locations_per_region, "Sara Sara Beach", excluded),
@@ -76,7 +78,6 @@ def init_areas(world: MultiWorld, locations: List[LocationData], options: Crysta
7678

7779
expert_regions = [
7880
create_region(world, player, locations_per_region, "The Open Sea", excluded),
79-
create_region(world, player, locations_per_region, "Shoudu Waterfront", excluded),
8081
create_region(world, player, locations_per_region, "Shoudu Province", excluded),
8182
create_region(world, player, locations_per_region, "The Undercity", excluded),
8283
create_region(world, player, locations_per_region, "Ganymede Shrine", excluded),
@@ -211,7 +212,7 @@ def init_areas(world: MultiWorld, locations: List[LocationData], options: Crysta
211212
{"Ancient Reservoir": lambda state: logic.has_key(state, PYRAMID_KEY) and logic.is_area_in_level_range(state, 3),
212213
"Lake Delende": lambda state: logic.has_vertical_movement and logic.is_area_in_level_range(state, 3),
213214
"Salmon Bay": logic.has_horizontal_movement and logic.has_vertical_movement,
214-
"Ancient Labyrinth": lambda state: logic.has_vertical_movement and logic.has_glide and logic.is_area_in_level_range(state, 5)})
215+
"Ancient Labyrinth": lambda state: state.has(ANCIENT_TABLET_A, player) and logic.has_vertical_movement and logic.has_glide and logic.is_area_in_level_range(state, 5)})
215216
multiworld.get_region("Sara Sara Bazaar", player).add_exits(["Poko Poko Desert", "Sara Sara Beach", "Shoudu Province", "The Open Sea", "Continental Tram"],
216217
{"Poko Poko Desert": lambda state: logic.is_area_in_level_range(state, 2),
217218
"Sara Sara Beach": lambda state: logic.has_horizontal_movement and logic.is_area_in_level_range(state, 3),

worlds/crystal_project/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,13 +346,23 @@ def get_item_pool(self, excluded_items: Set[str]) -> List[Item]:
346346

347347
for name, data in item_table.items():
348348
if name not in excluded_items:
349+
#Check region and add the region amounts; then check Shopsanity and add the shop amounts
349350
amount:int = data.beginnerAmount
351+
if self.options.shopsanity == self.options.shopsanity.option_true:
352+
amount = amount + data.beginnerShops
350353
if self.options.includedRegions == self.options.includedRegions.option_advanced:
351354
amount = amount + data.advancedAmount
355+
if self.options.shopsanity == self.options.shopsanity.option_true:
356+
amount = amount + data.advancedShops
352357
elif self.options.includedRegions == self.options.includedRegions.option_expert:
353358
amount = amount + data.advancedAmount + data.expertAmount
359+
if self.options.shopsanity == self.options.shopsanity.option_true:
360+
amount = amount + data.expertShops
354361
elif self.options.includedRegions == self.options.includedRegions.option_all:
355362
amount = amount + data.advancedAmount + data.expertAmount + data.endGameAmount
363+
#atm there are no end-game specific shopsanity items
364+
if self.options.shopsanity == self.options.shopsanity.option_true:
365+
amount = amount + data.endGameShops
356366
for _ in range(amount):
357367
item = self.set_classifications(name)
358368
pool.append(item)

worlds/crystal_project/rules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing import TYPE_CHECKING, Optional
55
if TYPE_CHECKING:
66
from . import CrystalProjectWorld
7-
from .Constants import *
7+
from .Keys import *
88

99
class CrystalProjectLogic:
1010
player: int

0 commit comments

Comments
 (0)