@@ -50,9 +50,16 @@ def create_items(self):
50
50
maximumResourcePackAmount = max (minRPSpecified , maxRPSpecified )
51
51
# Generate item pool
52
52
pool = []
53
+ frequencyItems = []
53
54
for item in item_table :
54
55
raft_item = self .create_item_replaceAsNecessary (item ["name" ])
56
+ if "Frequency" in item ["name" ]:
57
+ frequencyItems .append (raft_item )
55
58
pool .append (raft_item )
59
+ if self .multiworld .island_frequency_locations [self .player ].value <= 3 :
60
+ if not hasattr (self .multiworld , "raft_frequencyItemsPerPlayer" ):
61
+ self .multiworld .raft_frequencyItemsPerPlayer = {}
62
+ self .multiworld .raft_frequencyItemsPerPlayer [self .player ] = frequencyItems
56
63
57
64
extraItemNamePool = []
58
65
extras = len (location_table ) - len (item_table ) - 1 # Victory takes up 1 unaccounted-for slot
@@ -66,6 +73,16 @@ def create_items(self):
66
73
dupeItemPool = item_table .copy ()
67
74
# Remove frequencies if necessary
68
75
if self .multiworld .island_frequency_locations [self .player ].value != 5 : # Not completely random locations
76
+ # If we let frequencies stay in with progressive-frequencies, the progressive-frequency item
77
+ # will be included 7 times. This is a massive flood of progressive-frequency items, so we
78
+ # instead add progressive-frequency as its own item a smaller amount of times to prevent
79
+ # flooding the duplicate item pool with them.
80
+ if self .multiworld .island_frequency_locations [self .player ].value == 4 :
81
+ for _ in range (2 ):
82
+ # Progressives are not in item_pool, need to create faux item for duplicate item pool
83
+ # This can still be filtered out later by duplicate_items setting
84
+ dupeItemPool .append ({ "name" : "progressive-frequency" , "progression" : True }) # Progressive frequencies need to be included
85
+ # Always remove non-progressive Frequency items
69
86
dupeItemPool = (itm for itm in dupeItemPool if "Frequency" not in itm ["name" ])
70
87
71
88
# Remove progression or non-progression items if necessary
@@ -129,15 +146,15 @@ def collect_item(self, state, item, remove=False):
129
146
return super (RaftWorld , self ).collect_item (state , item , remove )
130
147
131
148
def pre_fill (self ):
132
- if self .multiworld .island_frequency_locations [self .player ] == 0 :
149
+ if self .multiworld .island_frequency_locations [self .player ] == 0 : # Vanilla
133
150
self .setLocationItem ("Radio Tower Frequency to Vasagatan" , "Vasagatan Frequency" )
134
151
self .setLocationItem ("Vasagatan Frequency to Balboa" , "Balboa Island Frequency" )
135
152
self .setLocationItem ("Relay Station quest" , "Caravan Island Frequency" )
136
153
self .setLocationItem ("Caravan Island Frequency to Tangaroa" , "Tangaroa Frequency" )
137
154
self .setLocationItem ("Tangaroa Frequency to Varuna Point" , "Varuna Point Frequency" )
138
155
self .setLocationItem ("Varuna Point Frequency to Temperance" , "Temperance Frequency" )
139
156
self .setLocationItem ("Temperance Frequency to Utopia" , "Utopia Frequency" )
140
- elif self .multiworld .island_frequency_locations [self .player ] == 1 :
157
+ elif self .multiworld .island_frequency_locations [self .player ] == 1 : # Random on island
141
158
self .setLocationItemFromRegion ("RadioTower" , "Vasagatan Frequency" )
142
159
self .setLocationItemFromRegion ("Vasagatan" , "Balboa Island Frequency" )
143
160
self .setLocationItemFromRegion ("BalboaIsland" , "Caravan Island Frequency" )
@@ -173,9 +190,9 @@ def pre_fill(self):
173
190
else :
174
191
currentLocation = availableLocationList [0 ] # Utopia (only one left in list)
175
192
availableLocationList .remove (currentLocation )
176
- if self .multiworld .island_frequency_locations [self .player ] == 2 :
193
+ if self .multiworld .island_frequency_locations [self .player ] == 2 : # Random island order
177
194
self .setLocationItem (locationToVanillaFrequencyLocationMap [previousLocation ], locationToFrequencyItemMap [currentLocation ])
178
- elif self .multiworld .island_frequency_locations [self .player ] == 3 :
195
+ elif self .multiworld .island_frequency_locations [self .player ] == 3 : # Random on island random order
179
196
self .setLocationItemFromRegion (previousLocation , locationToFrequencyItemMap [currentLocation ])
180
197
previousLocation = currentLocation
181
198
@@ -184,12 +201,14 @@ def pre_fill(self):
184
201
RaftItem ("Victory" , ItemClassification .progression , None , player = self .player ))
185
202
186
203
def setLocationItem (self , location : str , itemName : str ):
187
- itemToUse = next (filter (lambda itm : itm .name == itemName , self .multiworld .itempool ))
204
+ itemToUse = next (filter (lambda itm : itm .name == itemName , self .multiworld .raft_frequencyItemsPerPlayer [self .player ]))
205
+ self .multiworld .raft_frequencyItemsPerPlayer [self .player ].remove (itemToUse )
188
206
self .multiworld .itempool .remove (itemToUse )
189
207
self .multiworld .get_location (location , self .player ).place_locked_item (itemToUse )
190
208
191
209
def setLocationItemFromRegion (self , region : str , itemName : str ):
192
- itemToUse = next (filter (lambda itm : itm .name == itemName , self .multiworld .itempool ))
210
+ itemToUse = next (filter (lambda itm : itm .name == itemName , self .multiworld .raft_frequencyItemsPerPlayer [self .player ]))
211
+ self .multiworld .raft_frequencyItemsPerPlayer [self .player ].remove (itemToUse )
193
212
self .multiworld .itempool .remove (itemToUse )
194
213
location = random .choice (list (loc for loc in location_table if loc ["region" ] == region ))
195
214
self .multiworld .get_location (location ["name" ], self .player ).place_locked_item (itemToUse )
0 commit comments