Skip to content

Commit eb5a895

Browse files
StripesOO7FlySniper
authored andcommitted
ALTTP: Add fill_slot_data for external trackers (ArchipelagoMW#1919)
* __init__.py: Add fill_slot_data function Add fill_slot_data function. Used by StripesOO7's pop-tracker pack to auto populate settings as convenience for the user * LTTP__init__.py added race condition to fill_slot_data * added missing self to multiworl.is_race * changed filling of slot_data to fill from static list instead of pulling all alttp_options. additional options needed to be done separately cause they are not stored the same way as the rest. "mode", "goal", etc. are simple values as the rest are key:value pairs so `.value` is not supported and I didn't want to introduce an if-statement. * changed filling of slot_data to fill from static list instead of pulling all alttp_options. additional options needed to be done separately cause they are not stored the same way as the rest. "mode", "goal", etc. are simple values as the rest are key:value pairs so `.value` is not supported and I didn't want to introduce an if-statement. * added a comment to describe the use for the option added to slot_data --------- Co-authored-by: StripesOO7 <[email protected]>
1 parent 45c42c0 commit eb5a895

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

worlds/alttp/__init__.py

+26
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,32 @@ def get_pre_fill_items(self):
782782
res.append(item)
783783
return res
784784

785+
def fill_slot_data(self):
786+
slot_data = {}
787+
if not self.multiworld.is_race:
788+
# all of these option are NOT used by the SNI- or Text-Client.
789+
# they are used by the alttp-poptracker pack (https://github.com/StripesOO7/alttp-ap-poptracker-pack)
790+
# for convenient auto-tracking of the generated settings and adjusting the tracker accordingly
791+
792+
slot_options = ["crystals_needed_for_gt", "crystals_needed_for_ganon", "open_pyramid",
793+
"bigkey_shuffle", "smallkey_shuffle", "compass_shuffle", "map_shuffle",
794+
"progressive", "swordless", "retro_bow", "retro_caves", "shop_item_slots",
795+
"boss_shuffle", "pot_shuffle", "enemy_shuffle"]
796+
797+
slot_data = {option_name: getattr(self.multiworld, option_name)[self.player].value for option_name in slot_options}
798+
799+
slot_data.update({
800+
'mode': self.multiworld.mode[self.player],
801+
'goal': self.multiworld.goal[self.player],
802+
'dark_room_logic': self.multiworld.dark_room_logic[self.player],
803+
'mm_medalion': self.multiworld.required_medallions[self.player][0],
804+
'tr_medalion': self.multiworld.required_medallions[self.player][1],
805+
'shop_shuffle': self.multiworld.shop_shuffle[self.player],
806+
'entrance_shuffle': self.multiworld.shuffle[self.player]
807+
}
808+
)
809+
return slot_data
810+
785811

786812
def get_same_seed(world, seed_def: tuple) -> str:
787813
seeds: typing.Dict[tuple, str] = getattr(world, "__named_seeds", {})

0 commit comments

Comments
 (0)