HK: write shop prices to spoiler log

This commit is contained in:
Fabian Dill 2022-04-04 00:40:19 +02:00 committed by Hussein Farran
parent cffa772801
commit 574e2abba8
1 changed files with 17 additions and 2 deletions

View File

@ -91,7 +91,12 @@ class HKWorld(World):
item_name_groups = item_name_groups item_name_groups = item_name_groups
ranges: typing.Dict[str, typing.Tuple[int, int]] ranges: typing.Dict[str, typing.Tuple[int, int]]
shops = {"Egg_Shop": "Egg", "Grubfather": "Grub", "Seer": "Essence", "Salubra_(Requires_Charms)": "Charm"} shops: typing.Dict[str, str] = {
"Egg_Shop": "Egg",
"Grubfather": "Grub",
"Seer": "Essence",
"Salubra_(Requires_Charms)": "Charm"
}
charm_costs: typing.List[int] charm_costs: typing.List[int]
data_version = 2 data_version = 2
@ -257,7 +262,7 @@ class HKWorld(World):
return change return change
@classmethod @classmethod
def stage_write_spoiler(cls, world, spoiler_handle): def stage_write_spoiler(cls, world: MultiWorld, spoiler_handle):
hk_players = world.get_game_players(cls.game) hk_players = world.get_game_players(cls.game)
spoiler_handle.write('\n\nCharm Notches:') spoiler_handle.write('\n\nCharm Notches:')
for player in hk_players: for player in hk_players:
@ -267,6 +272,16 @@ class HKWorld(World):
for charm_number, cost in enumerate(hk_world.charm_costs, start=1): for charm_number, cost in enumerate(hk_world.charm_costs, start=1):
spoiler_handle.write(f"\n{charm_number}: {cost}") spoiler_handle.write(f"\n{charm_number}: {cost}")
spoiler_handle.write('\n\nShop Prices:')
for player in hk_players:
name = world.get_player_name(player)
spoiler_handle.write(f'\n{name}\n')
hk_world: HKWorld = world.worlds[player]
for shop_name, unit_name in cls.shops.items():
for x in range(1, hk_world.created_multi_locations[shop_name]+1):
loc = world.get_location(hk_world.get_multi_location_name(shop_name, x), player)
spoiler_handle.write(f"\n{loc}: {loc.item} costing {loc.cost} {unit_name}")
def get_multi_location_name(self, base: str, i: typing.Optional[int]) -> str: def get_multi_location_name(self, base: str, i: typing.Optional[int]) -> str:
if i is None: if i is None:
i = self.created_multi_locations[base] i = self.created_multi_locations[base]