1
1
import logging
2
+ from datetime import date
2
3
from typing import Any , ClassVar , Dict , List , Optional , TextIO
3
4
4
5
from BaseClasses import CollectionState , Entrance , Item , ItemClassification , MultiWorld , Tutorial
9
10
from worlds .LauncherComponents import Component , Type , components
10
11
from .client_setup import launch_game
11
12
from .connections import CONNECTIONS , RANDOMIZED_CONNECTIONS , TRANSITIONS
12
- from .constants import ALL_ITEMS , ALWAYS_LOCATIONS , BOSS_LOCATIONS , FILLER , NOTES , PHOBEKINS , PROG_ITEMS , USEFUL_ITEMS
13
+ from .constants import ALL_ITEMS , ALWAYS_LOCATIONS , BOSS_LOCATIONS , FILLER , NOTES , PHOBEKINS , PROG_ITEMS , TRAPS , \
14
+ USEFUL_ITEMS
13
15
from .options import AvailablePortals , Goal , Logic , MessengerOptions , NotesNeeded , ShuffleTransitions
14
16
from .portals import PORTALS , add_closed_portal_reqs , disconnect_portals , shuffle_portals , validate_portals
15
17
from .regions import LEVELS , MEGA_SHARDS , LOCATIONS , REGION_CONNECTIONS
@@ -110,7 +112,7 @@ class MessengerWorld(World):
110
112
},
111
113
}
112
114
113
- required_client_version = (0 , 4 , 3 )
115
+ required_client_version = (0 , 4 , 4 )
114
116
115
117
web = MessengerWeb ()
116
118
@@ -127,6 +129,7 @@ class MessengerWorld(World):
127
129
portal_mapping : List [int ]
128
130
transitions : List [Entrance ]
129
131
reachable_locs : int = 0
132
+ filler : Dict [str , int ]
130
133
131
134
def generate_early (self ) -> None :
132
135
if self .options .goal == Goal .option_power_seal_hunt :
@@ -156,6 +159,10 @@ def generate_early(self) -> None:
156
159
if portal in self .starting_portals ]
157
160
self .starting_portals .remove (self .random .choice (portals_to_strip ))
158
161
162
+ self .filler = FILLER .copy ()
163
+ if (not hasattr (self .options , "traps" ) and date .today () < date (2024 , 4 , 2 )) or self .options .traps :
164
+ self .filler .update (TRAPS )
165
+
159
166
self .plando_portals = []
160
167
self .portal_mapping = []
161
168
self .spoiler_portal_mapping = {}
@@ -187,9 +194,9 @@ def create_items(self) -> None:
187
194
itempool : List [MessengerItem ] = [
188
195
self .create_item (item )
189
196
for item in self .item_name_to_id
190
- if "Time Shard" not in item and item not in {
197
+ if item not in {
191
198
"Power Seal" , * NOTES , * FIGURINES , * main_movement_items ,
192
- * precollected_names ,
199
+ * precollected_names , * FILLER , * TRAPS ,
193
200
}
194
201
]
195
202
@@ -230,8 +237,8 @@ def create_items(self) -> None:
230
237
remaining_fill = len (self .multiworld .get_unfilled_locations (self .player )) - len (itempool )
231
238
if remaining_fill < 10 :
232
239
self ._filler_items = self .random .choices (
233
- list (FILLER )[2 :],
234
- weights = list (FILLER .values ())[2 :],
240
+ list (self . filler )[2 :],
241
+ weights = list (self . filler .values ())[2 :],
235
242
k = remaining_fill
236
243
)
237
244
filler = [self .create_filler () for _ in range (remaining_fill )]
@@ -302,8 +309,8 @@ def fill_slot_data(self) -> Dict[str, Any]:
302
309
def get_filler_item_name (self ) -> str :
303
310
if not getattr (self , "_filler_items" , None ):
304
311
self ._filler_items = [name for name in self .random .choices (
305
- list (FILLER ),
306
- weights = list (FILLER .values ()),
312
+ list (self . filler ),
313
+ weights = list (self . filler .values ()),
307
314
k = 20
308
315
)]
309
316
return self ._filler_items .pop (0 )
0 commit comments