@@ -174,12 +174,12 @@ def create_items(self):
174
174
isAdvancement = False
175
175
176
176
itemClass = ItemManager .Items [item .Type ].Class
177
- smitem = SMItem (item .Name ,
178
- ItemClassification .progression if isAdvancement else ItemClassification .filler ,
177
+ smitem = SMItem (item .Name ,
178
+ ItemClassification .progression if isAdvancement else ItemClassification .filler ,
179
179
item .Type ,
180
- None if itemClass == 'Boss' else self .item_name_to_id [item .Name ],
180
+ None if itemClass == 'Boss' else self .item_name_to_id [item .Name ],
181
181
player = self .player )
182
-
182
+
183
183
if itemClass == 'Boss' :
184
184
self .locked_items [item .Name ] = smitem
185
185
elif item .Category == 'Nothing' :
@@ -192,10 +192,10 @@ def create_items(self):
192
192
for (location , item ) in self .locked_items .items ():
193
193
self .multiworld .get_location (location , self .player ).place_locked_item (item )
194
194
self .multiworld .get_location (location , self .player ).address = None
195
-
195
+
196
196
def evalSMBool (self , smbool , maxDiff ):
197
197
return smbool .bool == True and smbool .difficulty <= maxDiff
198
-
198
+
199
199
def add_entrance_rule (self , entrance , player , func ):
200
200
add_rule (entrance , lambda state : self .evalSMBool (func (state .smbm [player ]), state .smbm [player ].maxDiff ))
201
201
@@ -221,12 +221,12 @@ def set_entrance_rule(entrance, player, func):
221
221
add_accessFrom_rule (location , self .player , value .AccessFrom )
222
222
if value .PostAvailable is not None :
223
223
add_postAvailable_rule (location , self .player , value .PostAvailable )
224
-
224
+
225
225
for accessPoint in Logic .accessPoints :
226
226
if not accessPoint .Escape :
227
227
for key , value1 in accessPoint .intraTransitions .items ():
228
228
set_entrance_rule (self .multiworld .get_entrance (accessPoint .Name + "->" + key , self .player ), self .player , value1 )
229
-
229
+
230
230
def create_region (self , world : MultiWorld , player : int , name : str , locations = None , exits = None ):
231
231
ret = Region (name , player , world )
232
232
if locations :
@@ -238,7 +238,7 @@ def create_region(self, world: MultiWorld, player: int, name: str, locations=Non
238
238
for exit in exits :
239
239
ret .exits .append (Entrance (player , exit , ret ))
240
240
return ret
241
-
241
+
242
242
def create_regions (self ):
243
243
# create locations
244
244
for name in locationsDict :
@@ -248,9 +248,9 @@ def create_regions(self):
248
248
regions = []
249
249
for accessPoint in Logic .accessPoints :
250
250
if not accessPoint .Escape :
251
- regions .append (self .create_region ( self .multiworld ,
252
- self .player ,
253
- accessPoint .Name ,
251
+ regions .append (self .create_region ( self .multiworld ,
252
+ self .player ,
253
+ accessPoint .Name ,
254
254
None ,
255
255
[accessPoint .Name + "->" + key for key in accessPoint .intraTransitions .keys ()]))
256
256
@@ -261,9 +261,9 @@ def create_regions(self):
261
261
# this is required in AP because a location cant have multiple parent regions
262
262
locationRegions = []
263
263
for locationName , value in locationsDict .items ():
264
- locationRegions .append (self .create_region ( self .multiworld ,
265
- self .player ,
266
- locationName ,
264
+ locationRegions .append (self .create_region ( self .multiworld ,
265
+ self .player ,
266
+ locationName ,
267
267
[locationName ]))
268
268
for key in value .AccessFrom .keys ():
269
269
currentRegion = self .multiworld .get_region (key , self .player )
@@ -320,7 +320,7 @@ def get_filler_item_name(self) -> str:
320
320
return "Super Missile"
321
321
else :
322
322
return "Nothing"
323
-
323
+
324
324
def pre_fill (self ):
325
325
if len (self .NothingPool ) > 0 :
326
326
nonChozoLoc = []
@@ -371,8 +371,8 @@ def post_fill(self):
371
371
itemLoc .item .type if isinstance (itemLoc .item , SMItem ) and itemLoc .item .type in ItemManager .Items else
372
372
'ArchipelagoItem' ]),
373
373
copy .copy (locationsDict [itemLoc .name ] if itemLoc .game == self .game else
374
- locationsDict [first_local_collected_loc .name ]),
375
- itemLoc .item .player ,
374
+ locationsDict [first_local_collected_loc .name ]),
375
+ itemLoc .item .player ,
376
376
True )
377
377
for itemLoc in SMWorld .spheres if itemLoc .item .player == self .player
378
378
]
@@ -387,7 +387,7 @@ def post_fill(self):
387
387
escapeOk = self .variaRando .randoExec .graphBuilder .escapeGraph (self .variaRando .container , self .variaRando .randoExec .areaGraph , self .variaRando .randoExec .randoSettings .maxDiff , escapeTrigger )
388
388
if (not escapeOk ):
389
389
logger .warning (f"Escape Rando forced to 'Off' for player { self .multiworld .get_player_name (self .player )} because could not find a solution for escape" )
390
-
390
+
391
391
# if we couldn't find an area layout then the escape graph is not created either
392
392
# and getDoorConnections will crash if random escape is activated.
393
393
self .variaRando .doors = GraphUtils .getDoorConnections (self .variaRando .randoExec .areaGraph ,
@@ -406,7 +406,7 @@ def stage_post_fill(cls, world):
406
406
407
407
for item in progitempool :
408
408
new_state .collect (item , True )
409
-
409
+
410
410
bossesLoc = ['Draygon' , 'Kraid' , 'Ridley' , 'Phantoon' , 'Mother Brain' ]
411
411
for player in world .get_game_players ("Super Metroid" ):
412
412
for bossLoc in bossesLoc :
@@ -548,9 +548,17 @@ def APPostPatchRom(self, romPatcher):
548
548
vanillaItemTypesCount = 21
549
549
for itemLoc in self .multiworld .get_locations ():
550
550
if itemLoc .player == self .player and "Boss" not in locationsDict [itemLoc .name ].Class :
551
- # item to place in this SM world: write full item data to tables
551
+ SMZ3NameToSMType = {
552
+ "ETank" : "ETank" , "Missile" : "Missile" , "Super" : "Super" , "PowerBomb" : "PowerBomb" , "Bombs" : "Bomb" ,
553
+ "Charge" : "Charge" , "Ice" : "Ice" , "HiJump" : "HiJump" , "SpeedBooster" : "SpeedBooster" ,
554
+ "Wave" : "Wave" , "Spazer" : "Spazer" , "SpringBall" : "SpringBall" , "Varia" : "Varia" , "Plasma" : "Plasma" ,
555
+ "Grapple" : "Grapple" , "Morph" : "Morph" , "ReserveTank" : "Reserve" , "Gravity" : "Gravity" ,
556
+ "XRay" : "XRayScope" , "SpaceJump" : "SpaceJump" , "ScrewAttack" : "ScrewAttack"
557
+ }
552
558
if isinstance (itemLoc .item , SMItem ) and itemLoc .item .type in ItemManager .Items :
553
559
itemId = ItemManager .Items [itemLoc .item .type ].Id
560
+ elif itemLoc .item .game == "SMZ3" and itemLoc .item .name in SMZ3NameToSMType .keys ():
561
+ itemId = ItemManager .Items [SMZ3NameToSMType [itemLoc .item .name ]].Id
554
562
else :
555
563
itemId = ItemManager .Items ["ArchipelagoItem" ].Id + idx
556
564
multiWorldItems .append ({"sym" : symbols ["message_item_names" ],
0 commit comments