@@ -34,8 +34,6 @@ class Hylics2World(World):
34
34
location_name_to_id = {data ["name" ]: loc_id for loc_id , data in all_locations .items ()}
35
35
option_definitions = Options .hylics2_options
36
36
37
- topology_present : bool = True
38
-
39
37
data_version = 3
40
38
41
39
start_location = "Waynehouse"
@@ -51,18 +49,14 @@ def create_item(self, name: str) -> "Hylics2Item":
51
49
return Hylics2Item (name , self .all_items [item_id ]["classification" ], item_id , player = self .player )
52
50
53
51
54
- def add_item (self , name : str , classification : ItemClassification , code : int ) -> "Item" :
55
- return Hylics2Item (name , classification , code , self .player )
56
-
57
-
58
52
def create_event (self , event : str ):
59
53
return Hylics2Item (event , ItemClassification .progression_skip_balancing , None , self .player )
60
54
61
55
62
56
# set random starting location if option is enabled
63
57
def generate_early (self ):
64
58
if self .multiworld .random_start [self .player ]:
65
- i = self .multiworld . random .randint (0 , 3 )
59
+ i = self .random .randint (0 , 3 )
66
60
if i == 0 :
67
61
self .start_location = "Waynehouse"
68
62
elif i == 1 :
@@ -77,26 +71,26 @@ def create_items(self):
77
71
pool = []
78
72
79
73
# add regular items
80
- for i , data in Items .item_table .items ():
81
- if data ["count" ] > 0 :
82
- for j in range (data ["count" ]):
83
- pool .append (self .add_item ( data ["name" ], data [ "classification" ], i ))
74
+ for item in Items .item_table .values ():
75
+ if item ["count" ] > 0 :
76
+ for _ in range (item ["count" ]):
77
+ pool .append (self .create_item ( item ["name" ]))
84
78
85
79
# add party members if option is enabled
86
80
if self .multiworld .party_shuffle [self .player ]:
87
- for i , data in Items .party_item_table .items ():
88
- pool .append (self .add_item ( data ["name" ], data [ "classification" ], i ))
81
+ for item in Items .party_item_table .values ():
82
+ pool .append (self .create_item ( item ["name" ]))
89
83
90
84
# handle gesture shuffle
91
85
if not self .multiworld .gesture_shuffle [self .player ]: # add gestures to pool like normal
92
- for i , data in Items .gesture_item_table .items ():
93
- pool .append (self .add_item ( data ["name" ], data [ "classification" ], i ))
86
+ for item in Items .gesture_item_table .values ():
87
+ pool .append (self .create_item ( item ["name" ]))
94
88
95
89
# add '10 Bones' items if medallion shuffle is enabled
96
90
if self .multiworld .medallion_shuffle [self .player ]:
97
- for i , data in Items .medallion_item_table .items ():
98
- for j in range (data ["count" ]):
99
- pool .append (self .add_item ( data ["name" ], data [ "classification" ], i ))
91
+ for item in Items .medallion_item_table .values ():
92
+ for _ in range (item ["count" ]):
93
+ pool .append (self .create_item ( item ["name" ]))
100
94
101
95
# add to world's pool
102
96
self .multiworld .itempool += pool
@@ -107,48 +101,45 @@ def pre_fill(self):
107
101
if self .multiworld .gesture_shuffle [self .player ] == 2 : # vanilla locations
108
102
gestures = Items .gesture_item_table
109
103
self .multiworld .get_location ("Waynehouse: TV" , self .player )\
110
- .place_locked_item (self .add_item ( gestures [ 200678 ][ "name" ], gestures [ 200678 ][ "classification" ], 200678 ))
104
+ .place_locked_item (self .create_item ( "POROMER BLEB" ))
111
105
self .multiworld .get_location ("Afterlife: TV" , self .player )\
112
- .place_locked_item (self .add_item ( gestures [ 200683 ][ "name" ], gestures [ 200683 ][ "classification" ], 200683 ))
106
+ .place_locked_item (self .create_item ( "TELEDENUDATE" ))
113
107
self .multiworld .get_location ("New Muldul: TV" , self .player )\
114
- .place_locked_item (self .add_item ( gestures [ 200679 ][ "name" ], gestures [ 200679 ][ "classification" ], 200679 ))
108
+ .place_locked_item (self .create_item ( "SOUL CRISPER" ))
115
109
self .multiworld .get_location ("Viewax's Edifice: TV" , self .player )\
116
- .place_locked_item (self .add_item ( gestures [ 200680 ][ "name" ], gestures [ 200680 ][ "classification" ], 200680 ))
110
+ .place_locked_item (self .create_item ( "TIME SIGIL" ))
117
111
self .multiworld .get_location ("TV Island: TV" , self .player )\
118
- .place_locked_item (self .add_item ( gestures [ 200681 ][ "name" ], gestures [ 200681 ][ "classification" ], 200681 ))
112
+ .place_locked_item (self .create_item ( "CHARGE UP" ))
119
113
self .multiworld .get_location ("Juice Ranch: TV" , self .player )\
120
- .place_locked_item (self .add_item ( gestures [ 200682 ][ "name" ], gestures [ 200682 ][ "classification" ], 200682 ))
114
+ .place_locked_item (self .create_item ( "FATE SANDBOX" ))
121
115
self .multiworld .get_location ("Foglast: TV" , self .player )\
122
- .place_locked_item (self .add_item ( gestures [ 200684 ][ "name" ], gestures [ 200684 ][ "classification" ], 200684 ))
116
+ .place_locked_item (self .create_item ( "LINK MOLLUSC" ))
123
117
self .multiworld .get_location ("Drill Castle: TV" , self .player )\
124
- .place_locked_item (self .add_item ( gestures [ 200688 ][ "name" ], gestures [ 200688 ][ "classification" ], 200688 ))
118
+ .place_locked_item (self .create_item ( "NEMATODE INTERFACE" ))
125
119
self .multiworld .get_location ("Sage Airship: TV" , self .player )\
126
- .place_locked_item (self .add_item ( gestures [ 200685 ][ "name" ], gestures [ 200685 ][ "classification" ], 200685 ))
120
+ .place_locked_item (self .create_item ( "BOMBO - GENESIS" ))
127
121
128
122
elif self .multiworld .gesture_shuffle [self .player ] == 1 : # TVs only
129
- gestures = list ( Items .gesture_item_table .items ())
130
- tvs = list ( Locations .tv_location_table .items ())
123
+ gestures = [ gesture [ "name" ] for gesture in Items .gesture_item_table .values ()]
124
+ tvs = [ tv [ "name" ] for tv in Locations .tv_location_table .values ()]
131
125
132
126
# if Extra Items in Logic is enabled place CHARGE UP first and make sure it doesn't get
133
127
# placed at Sage Airship: TV or Foglast: TV
134
128
if self .multiworld .extra_items_in_logic [self .player ]:
135
- tv = self .multiworld .random .choice (tvs )
136
- gest = gestures .index ((200681 , Items .gesture_item_table [200681 ]))
137
- while tv [1 ]["name" ] == "Sage Airship: TV" or tv [1 ]["name" ] == "Foglast: TV" :
138
- tv = self .multiworld .random .choice (tvs )
139
- self .multiworld .get_location (tv [1 ]["name" ], self .player )\
140
- .place_locked_item (self .add_item (gestures [gest ][1 ]["name" ], gestures [gest ][1 ]["classification" ],
141
- gestures [gest ]))
142
- gestures .remove (gestures [gest ])
129
+ tv = self .random .choice (tvs )
130
+ while tv == "Sage Airship: TV" or tv == "Foglast: TV" :
131
+ tv = self .random .choice (tvs )
132
+ self .multiworld .get_location (tv , self .player )\
133
+ .place_locked_item (self .create_item ("CHARGE UP" ))
134
+ gestures .remove ("CHARGE UP" )
143
135
tvs .remove (tv )
144
136
145
- for i in range (len (gestures )):
146
- gest = self .multiworld .random .choice (gestures )
147
- tv = self .multiworld .random .choice (tvs )
148
- self .multiworld .get_location (tv [1 ]["name" ], self .player )\
149
- .place_locked_item (self .add_item (gest [1 ]["name" ], gest [1 ]["classification" ], gest [0 ]))
150
- gestures .remove (gest )
151
- tvs .remove (tv )
137
+ self .random .shuffle (gestures )
138
+ self .random .shuffle (tvs )
139
+ while gestures :
140
+ gesture = gestures .pop ()
141
+ tv = tvs .pop ()
142
+ self .get_location (tv ).place_locked_item (self .create_item (gesture ))
152
143
153
144
154
145
def fill_slot_data (self ) -> Dict [str , Any ]:
0 commit comments