The Messenger: Add Shop Rando (#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
This commit is contained in:
Aaron Wagener
2023-06-27 18:39:52 -05:00
committed by GitHub
parent 8c2584f872
commit 332eab9569
13 changed files with 712 additions and 393 deletions

View File

@@ -1,4 +1,7 @@
from Options import DefaultOnToggle, DeathLink, Range, Accessibility, Choice, Toggle, StartInventoryPool
from typing import Dict
from schema import Schema, Or, And, Optional
from Options import DefaultOnToggle, DeathLink, Range, Accessibility, Choice, Toggle, OptionDict, StartInventoryPool
class MessengerAccessibility(Accessibility):
@@ -10,16 +13,16 @@ class MessengerAccessibility(Accessibility):
class Logic(Choice):
"""
The level of logic to use when determining what locations in your world are accessible.
Normal can require damage boosts, but otherwise approachable for someone who has beaten the game.
Hard has some easier speedrunning tricks in logic. May need to leash.
Challenging contains more medium and hard difficulty speedrunning tricks.
OoB places everything with the minimum amount of rules possible. Expect to do OoB. Not guaranteed completable.
Normal: can require damage boosts, but otherwise approachable for someone who has beaten the game.
Hard: has leashing, normal clips, time warps and turtle boosting in logic.
OoB: places everything with the minimum amount of rules possible. Expect to do OoB. Not guaranteed completable.
"""
display_name = "Logic Level"
option_normal = 0
option_hard = 1
option_challenging = 2
option_oob = 3
option_oob = 2
alias_challenging = 1
class PowerSeals(DefaultOnToggle):
@@ -68,6 +71,64 @@ class RequiredSeals(Range):
default = range_end
class ShopPrices(Range):
"""Percentage modifier for shuffled item prices in shops"""
display_name = "Shop Prices Modifier"
range_start = 25
range_end = 400
default = 100
def planned_price(location: str) -> Dict[Optional, Or]:
return {
Optional(location): Or(
And(int, lambda n: n >= 0),
{
Optional(And(int, lambda n: n >= 0)): And(int, lambda n: n >= 0)
}
)
}
class PlannedShopPrices(OptionDict):
"""Plan specific prices on shop slots. Supports weighting"""
display_name = "Shop Price Plando"
schema = Schema({
**planned_price("Karuta Plates"),
**planned_price("Serendipitous Bodies"),
**planned_price("Path of Resilience"),
**planned_price("Kusari Jacket"),
**planned_price("Energy Shuriken"),
**planned_price("Serendipitous Minds"),
**planned_price("Prepared Mind"),
**planned_price("Meditation"),
**planned_price("Rejuvenative Spirit"),
**planned_price("Centered Mind"),
**planned_price("Strike of the Ninja"),
**planned_price("Second Wind"),
**planned_price("Currents Master"),
**planned_price("Aerobatics Warrior"),
**planned_price("Demon's Bane"),
**planned_price("Devil's Due"),
**planned_price("Time Sense"),
**planned_price("Power Sense"),
**planned_price("Focused Power Sense"),
**planned_price("Green Kappa Figurine"),
**planned_price("Blue Kappa Figurine"),
**planned_price("Ountarde Figurine"),
**planned_price("Red Kappa Figurine"),
**planned_price("Demon King Figurine"),
**planned_price("Quillshroom Figurine"),
**planned_price("Jumping Quillshroom Figurine"),
**planned_price("Scurubu Figurine"),
**planned_price("Jumping Scurubu Figurine"),
**planned_price("Wallaxer Figurine"),
**planned_price("Barmath'azel Figurine"),
**planned_price("Queen of Quills Figurine"),
**planned_price("Demon Hive Figurine"),
})
messenger_options = {
"accessibility": MessengerAccessibility,
"start_inventory": StartInventoryPool,
@@ -79,5 +140,7 @@ messenger_options = {
"notes_needed": NotesNeeded,
"total_seals": AmountSeals,
"percent_seals_required": RequiredSeals,
"shop_price": ShopPrices,
"shop_price_plan": PlannedShopPrices,
"death_link": DeathLink,
}