Skip to content

Commit b76f085

Browse files
alwaysintrebleJouramie
authored andcommitted
The Messenger: Add Shop Rando (ArchipelagoMW#1834)
* add shop shuffle options and items * add logic for the shop slots * write cost tests * start on shop item logic * make strike and second wind early items * some cleanup * remove 5 shards * double cost requirement for really expensive items and raise the rates * add test for shop shuffle with minimum other locations * put power seal in front of shards * rename locations and items * update rules, regions, and shop * update tests and misc fixes * minor cleanup * implement money wrench and figurines * clean out now unneeded info from slot_data * docs update and fix a failure when not shuffling shops * remove shop shuffle option * Finish out shop rules * make seals generation easier to read and fix tests * rule adjustments * oop * adjust the prices to be a bit more generous * add max price to slot data for tracker * update the hard rules a bit * remove unnecessary test * update data_version * bump version and remove info for fixed issues * remove now unneeded assert * review updates * minor bug fix * add a test for minimum locations shop costing * minor optimizations and cleanup * remove whitespace
1 parent 828b818 commit b76f085

13 files changed

+713
-394
lines changed

worlds/messenger/Constants.py

+47-95
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# items
22
# listing individual groups first for easy lookup
3+
from .Shop import SHOP_ITEMS, FIGURINES
34

45
NOTES = [
56
"Key of Hope",
@@ -13,15 +14,16 @@
1314
PROG_ITEMS = [
1415
"Wingsuit",
1516
"Rope Dart",
16-
"Ninja Tabi",
17+
"Lightfoot Tabi",
1718
"Power Thistle",
1819
"Demon King Crown",
1920
"Ruxxtin's Amulet",
20-
"Fairy Bottle",
21+
"Magic Firefly",
2122
"Sun Crest",
2223
"Moon Crest",
2324
# "Astral Seed",
2425
# "Astral Tea Leaves",
26+
"Money Wrench",
2527
]
2628

2729
PHOBEKINS = [
@@ -35,127 +37,77 @@
3537
"Windmill Shuriken",
3638
]
3739

40+
FILLER = {
41+
"Time Shard": 5,
42+
"Time Shard (10)": 10,
43+
"Time Shard (50)": 20,
44+
"Time Shard (100)": 20,
45+
"Time Shard (300)": 10,
46+
"Time Shard (500)": 5,
47+
}
48+
3849
# item_name_to_id needs to be deterministic and match upstream
3950
ALL_ITEMS = [
4051
*NOTES,
4152
"Windmill Shuriken",
4253
"Wingsuit",
4354
"Rope Dart",
44-
"Ninja Tabi",
55+
"Lightfoot Tabi",
4556
# "Astral Seed",
4657
# "Astral Tea Leaves",
4758
"Candle",
4859
"Seashell",
4960
"Power Thistle",
5061
"Demon King Crown",
5162
"Ruxxtin's Amulet",
52-
"Fairy Bottle",
63+
"Magic Firefly",
5364
"Sun Crest",
5465
"Moon Crest",
5566
*PHOBEKINS,
5667
"Power Seal",
57-
"Time Shard", # there's 45 separate instances of this in the client lookup, but hopefully we don't care?
68+
*FILLER,
69+
*SHOP_ITEMS,
70+
*FIGURINES,
71+
"Money Wrench",
5872
]
5973

6074
# locations
6175
# the names of these don't actually matter, but using the upstream's names for now
6276
# order must be exactly the same as upstream
6377
ALWAYS_LOCATIONS = [
6478
# notes
65-
"Key of Love",
66-
"Key of Courage",
67-
"Key of Chaos",
68-
"Key of Symbiosis",
69-
"Key of Strength",
70-
"Key of Hope",
79+
"Sunken Shrine - Key of Love",
80+
"Corrupted Future - Key of Courage",
81+
"Underworld - Key of Chaos",
82+
"Elemental Skylands - Key of Symbiosis",
83+
"Searing Crags - Key of Strength",
84+
"Autumn Hills - Key of Hope",
7185
# upgrades
72-
"Wingsuit",
73-
"Rope Dart",
74-
"Ninja Tabi",
75-
"Climbing Claws",
86+
"Howling Grotto - Wingsuit",
87+
"Searing Crags - Rope Dart",
88+
"Sunken Shrine - Lightfoot Tabi",
89+
"Autumn Hills - Climbing Claws",
7690
# quest items
77-
"Astral Seed",
78-
"Astral Tea Leaves",
79-
"Candle",
80-
"Seashell",
81-
"Power Thistle",
82-
"Demon King Crown",
83-
"Ruxxtin's Amulet",
84-
"Fairy Bottle",
85-
"Sun Crest",
86-
"Moon Crest",
91+
"Ninja Village - Astral Seed",
92+
"Searing Crags - Astral Tea Leaves",
93+
"Ninja Village - Candle",
94+
"Quillshroom Marsh - Seashell",
95+
"Searing Crags - Power Thistle",
96+
"Forlorn Temple - Demon King",
97+
"Catacombs - Ruxxtin's Amulet",
98+
"Riviere Turquoise - Butterfly Matriarch",
99+
"Sunken Shrine - Sun Crest",
100+
"Sunken Shrine - Moon Crest",
87101
# phobekins
88-
"Necro",
89-
"Pyro",
90-
"Claustro",
91-
"Acro",
92-
]
93-
94-
SEALS = [
95-
"Ninja Village Seal - Tree House",
96-
97-
"Autumn Hills Seal - Trip Saws",
98-
"Autumn Hills Seal - Double Swing Saws",
99-
"Autumn Hills Seal - Spike Ball Swing",
100-
"Autumn Hills Seal - Spike Ball Darts",
101-
102-
"Catacombs Seal - Triple Spike Crushers",
103-
"Catacombs Seal - Crusher Gauntlet",
104-
"Catacombs Seal - Dirty Pond",
105-
106-
"Bamboo Creek Seal - Spike Crushers and Doors",
107-
"Bamboo Creek Seal - Spike Ball Pits",
108-
"Bamboo Creek Seal - Spike Crushers and Doors v2",
109-
110-
"Howling Grotto Seal - Windy Saws and Balls",
111-
"Howling Grotto Seal - Crushing Pits",
112-
"Howling Grotto Seal - Breezy Crushers",
113-
114-
"Quillshroom Marsh Seal - Spikey Window",
115-
"Quillshroom Marsh Seal - Sand Trap",
116-
"Quillshroom Marsh Seal - Do the Spike Wave",
117-
118-
"Searing Crags Seal - Triple Ball Spinner",
119-
"Searing Crags Seal - Raining Rocks",
120-
"Searing Crags Seal - Rhythm Rocks",
121-
122-
"Glacial Peak Seal - Ice Climbers",
123-
"Glacial Peak Seal - Projectile Spike Pit",
124-
"Glacial Peak Seal - Glacial Air Swag",
125-
126-
"Tower of Time Seal - Time Waster Seal",
127-
"Tower of Time Seal - Lantern Climb",
128-
"Tower of Time Seal - Arcane Orbs",
129-
130-
"Cloud Ruins Seal - Ghost Pit",
131-
"Cloud Ruins Seal - Toothbrush Alley",
132-
"Cloud Ruins Seal - Saw Pit",
133-
"Cloud Ruins Seal - Money Farm Room",
134-
135-
"Underworld Seal - Sharp and Windy Climb",
136-
"Underworld Seal - Spike Wall",
137-
"Underworld Seal - Fireball Wave",
138-
"Underworld Seal - Rising Fanta",
139-
140-
"Forlorn Temple Seal - Rocket Maze",
141-
"Forlorn Temple Seal - Rocket Sunset",
142-
143-
"Sunken Shrine Seal - Ultra Lifeguard",
144-
"Sunken Shrine Seal - Waterfall Paradise",
145-
"Sunken Shrine Seal - Tabi Gauntlet",
146-
147-
"Riviere Turquoise Seal - Bounces and Balls",
148-
"Riviere Turquoise Seal - Launch of Faith",
149-
"Riviere Turquoise Seal - Flower Power",
150-
151-
"Elemental Skylands Seal - Air",
152-
"Elemental Skylands Seal - Water",
153-
"Elemental Skylands Seal - Fire",
102+
"Catacombs - Necro",
103+
"Searing Crags - Pyro",
104+
"Bamboo Creek - Claustro",
105+
"Cloud Ruins - Acro",
154106
]
155107

156108
BOSS_LOCATIONS = [
157-
"Leaf Golem",
158-
"Ruxxtin",
159-
"Emerald Golem",
160-
"Queen of Quills",
109+
"Autumn Hills - Leaf Golem",
110+
"Catacombs - Ruxxtin",
111+
"Howling Grotto - Emerald Golem",
112+
"Quillshroom Marsh - Queen of Quills",
161113
]

worlds/messenger/Options.py

+70-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
from Options import DefaultOnToggle, DeathLink, Range, Accessibility, Choice, Toggle, StartInventoryPool
1+
from typing import Dict
2+
from schema import Schema, Or, And, Optional
3+
4+
from Options import DefaultOnToggle, DeathLink, Range, Accessibility, Choice, Toggle, OptionDict, StartInventoryPool
25

36

47
class MessengerAccessibility(Accessibility):
@@ -10,16 +13,16 @@ class MessengerAccessibility(Accessibility):
1013
class Logic(Choice):
1114
"""
1215
The level of logic to use when determining what locations in your world are accessible.
13-
Normal can require damage boosts, but otherwise approachable for someone who has beaten the game.
14-
Hard has some easier speedrunning tricks in logic. May need to leash.
15-
Challenging contains more medium and hard difficulty speedrunning tricks.
16-
OoB places everything with the minimum amount of rules possible. Expect to do OoB. Not guaranteed completable.
16+
17+
Normal: can require damage boosts, but otherwise approachable for someone who has beaten the game.
18+
Hard: has leashing, normal clips, time warps and turtle boosting in logic.
19+
OoB: places everything with the minimum amount of rules possible. Expect to do OoB. Not guaranteed completable.
1720
"""
1821
display_name = "Logic Level"
1922
option_normal = 0
2023
option_hard = 1
21-
option_challenging = 2
22-
option_oob = 3
24+
option_oob = 2
25+
alias_challenging = 1
2326

2427

2528
class PowerSeals(DefaultOnToggle):
@@ -68,6 +71,64 @@ class RequiredSeals(Range):
6871
default = range_end
6972

7073

74+
class ShopPrices(Range):
75+
"""Percentage modifier for shuffled item prices in shops"""
76+
display_name = "Shop Prices Modifier"
77+
range_start = 25
78+
range_end = 400
79+
default = 100
80+
81+
82+
def planned_price(location: str) -> Dict[Optional, Or]:
83+
return {
84+
Optional(location): Or(
85+
And(int, lambda n: n >= 0),
86+
{
87+
Optional(And(int, lambda n: n >= 0)): And(int, lambda n: n >= 0)
88+
}
89+
)
90+
}
91+
92+
93+
class PlannedShopPrices(OptionDict):
94+
"""Plan specific prices on shop slots. Supports weighting"""
95+
display_name = "Shop Price Plando"
96+
schema = Schema({
97+
**planned_price("Karuta Plates"),
98+
**planned_price("Serendipitous Bodies"),
99+
**planned_price("Path of Resilience"),
100+
**planned_price("Kusari Jacket"),
101+
**planned_price("Energy Shuriken"),
102+
**planned_price("Serendipitous Minds"),
103+
**planned_price("Prepared Mind"),
104+
**planned_price("Meditation"),
105+
**planned_price("Rejuvenative Spirit"),
106+
**planned_price("Centered Mind"),
107+
**planned_price("Strike of the Ninja"),
108+
**planned_price("Second Wind"),
109+
**planned_price("Currents Master"),
110+
**planned_price("Aerobatics Warrior"),
111+
**planned_price("Demon's Bane"),
112+
**planned_price("Devil's Due"),
113+
**planned_price("Time Sense"),
114+
**planned_price("Power Sense"),
115+
**planned_price("Focused Power Sense"),
116+
**planned_price("Green Kappa Figurine"),
117+
**planned_price("Blue Kappa Figurine"),
118+
**planned_price("Ountarde Figurine"),
119+
**planned_price("Red Kappa Figurine"),
120+
**planned_price("Demon King Figurine"),
121+
**planned_price("Quillshroom Figurine"),
122+
**planned_price("Jumping Quillshroom Figurine"),
123+
**planned_price("Scurubu Figurine"),
124+
**planned_price("Jumping Scurubu Figurine"),
125+
**planned_price("Wallaxer Figurine"),
126+
**planned_price("Barmath'azel Figurine"),
127+
**planned_price("Queen of Quills Figurine"),
128+
**planned_price("Demon Hive Figurine"),
129+
})
130+
131+
71132
messenger_options = {
72133
"accessibility": MessengerAccessibility,
73134
"start_inventory": StartInventoryPool,
@@ -79,5 +140,7 @@ class RequiredSeals(Range):
79140
"notes_needed": NotesNeeded,
80141
"total_seals": AmountSeals,
81142
"percent_seals_required": RequiredSeals,
143+
"shop_price": ShopPrices,
144+
"shop_price_plan": PlannedShopPrices,
82145
"death_link": DeathLink,
83146
}

0 commit comments

Comments
 (0)