2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								import  logging  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  copy  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  os  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  random  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								import  threading  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  typing  import  Dict ,  Set ,  TextIO  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-02-13 18:06:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  BaseClasses  import  Region ,  Entrance ,  Location ,  MultiWorld ,  Item ,  ItemClassification ,  CollectionState ,  \ 
						 
					
						
							
								
									
										
										
										
											2022-06-17 03:23:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    Tutorial 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-18 04:53:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  worlds . generic . Rules  import  set_rule  
						 
					
						
							
								
									
										
										
										
											2023-04-08 16:52:34 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  . TotalSMZ3 . Item  import  ItemType  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . TotalSMZ3  import  Item  as  TotalSMZ3Item  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . TotalSMZ3 . World  import  World  as  TotalSMZ3World  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . TotalSMZ3 . Regions . Zelda . GanonsTower  import  GanonsTower  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . TotalSMZ3 . Config  import  Config ,  GameMode ,  Goal ,  KeyShuffle ,  MorphLocation ,  SMLogic ,  SwordLocation ,  Z3Logic ,  OpenTower ,  GanonVulnerable ,  OpenTourian  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . TotalSMZ3 . Location  import  LocationType ,  locations_start_id ,  Location  as  TotalSMZ3Location  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . TotalSMZ3 . Patch  import  Patch  as  TotalSMZ3Patch ,  getWord ,  getWordArray  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . TotalSMZ3 . WorldState  import  WorldState  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . TotalSMZ3 . Region  import  IReward ,  IMedallionAccess  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . TotalSMZ3 . Text . Texts  import  openFile  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  worlds . AutoWorld  import  World ,  AutoLogicRegister ,  WebWorld  
						 
					
						
							
								
									
										
										
										
											2022-10-25 13:54:43 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  . Client  import  SMZ3SNIClient  
						 
					
						
							
								
									
										
										
										
											2022-03-18 04:53:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  . Rom  import  get_base_rom_bytes ,  SMZ3DeltaPatch  
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								from  . ips  import  IPS_Patch  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								from  . Options  import  smz3_options  
						 
					
						
							
								
									
										
										
										
											2022-08-04 12:39:31 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								from  Options  import  Accessibility  
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								world_folder  =  os . path . dirname ( __file__ )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								logger  =  logging . getLogger ( " SMZ3 " )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-09-03 17:52:09 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Location IDs in the range 256+196 to 256+202 shifted +34 between 11.2 and 11.3  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# this is required to keep backward compatibility  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								def  convertLocSMZ3IDToAPID ( value ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    return  ( value  -  34 )  if  value  > =  256 + 230  and  value  < =  256 + 236  else  value 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-18 04:53:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  SMZ3CollectionState ( metaclass = AutoLogicRegister ) :  
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    def  init_mixin ( self ,  parent :  MultiWorld ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # for unit tests where MultiWorld is instantiated before worlds 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  hasattr ( parent ,  " state " ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . smz3state  =  { player :  TotalSMZ3Item . Progression ( [ ] )  for  player  in  parent . get_game_players ( " SMZ3 " ) } 
							 
						 
					
						
							
								
									
										
											 
										
											
												SMZ3: Item link support (#756)
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* Fixed multiworld support patch not working with VariaRandomizer's
Added stage_fill_hook to set morph first in progitempool
Added back VariaRandomizer's standard patches
* + added missing files from variaRandomizer project
* + added missing variaRandomizer files (custom sprites)
+ started integrating VariaRandomizer options (WIP)
* Some fixes for player and server name display
- fixed player name of 16 characters reading too far in SM client
- fixed 12 bytes SM player name limit (now 16)
- fixed server name not being displayed in SM when using server cheat ( now displays RECEIVED FROM ARCHIPELAGO)
- request: temporarly changed default seed names displayed in SM main menu to OWTCH
* Fixed Goal completion not triggering in smClient
* integrated VariaRandomizer's options into AP (WIP)
- startAP is working
- door rando is working
- skillset is working
* - fixed itemsounds.ips crash by always including nofanfare.ips into multiworld.ips (itemsounds is now always applied and "itemsounds" preset must always be "off")
* skillset are now instanced per player instead of being a singleton class
* RomPatches are now instanced per player instead of being a singleton class
* DoorManager is now instanced per player instead of being a singleton class
* - fixed the last bugs that prevented generation of >1 SM world
* fixed crash when no skillset preset is specified in randoPreset (default to "casual")
* maxDifficulty support and itemsounds removal
- added support for maxDifficulty
- removed itemsounds patch as its always applied from multiworld patch for now
* Fixed bad merge
* Post merge adaptation
* fixed player name length fix that got lost with the merge
* fixed generation with other game type than SM
* added default randoPreset json for SM in playerSettings.yaml
* fixed broken SM client following merge
* beautified json skillset presets
* Fixed ArchipelagoSmClient not building
* Fixed conflict between mutliworld patch and beam_doors_plms patch
- doorsColorsRando now working
* SM generation now outputs APBP
- Fixed paths for patches and presets when frozen
* added missing file and fixed multithreading issue
* temporarily set data_version = 0
* more work
- added support for AP starting items
- fixed client crash with gamemode being None
- patch.py "compatible_version" is now 3
* commited missing asm files
fixed start item reserve breaking game (was using bad write offset when patching)
* Nothing item are now handled game-side. the game will now skip displaying a message box for received Nothing item (but the client will still receive it).
fixed crash in SMClient when loosing connection to SNI
* fixed No Energy Item missing its ID
fixed Plando
* merge post fixes
* fixed start item Grapple, XRay and Reserve HUD, as well as graphic beams (except ice palette color)
* fixed freeze in blue brinstar caused by Varia's custom PLM not being filled with proper Multiworld PLM address (altLocsAddresses)
* fixed start item x-ray HUD display
* Fixed start items being sent by the server (is all handled in ROM)
Start items are now not removed from itempool anymore
Nothing Item is now local_items so no player will ever pickup Nothing. Doing so reduces contribution of this world to the Multiworld the more Nothing there is though.
Fixed crash (and possibly passing but broken) at generation where the static list of IPSPatches used by all SM worlds was being modified
* fixed settings that could be applied to any SM players
* fixed auth to server only using player name (now does as ALTTP to authenticate)
* - fixed End Credits broken text
* added non SM item name display
* added all supported SM options in playerSettings.yaml
* fixed locations needing a list of parent regions (now generate a region for each location with one-way exits to each (previously) parent region
did some cleaning (mainly reverts on unnecessary core classes
* minor setting fixes and tweaks
- merged Area and lightArea settings
- made missileQty, superQty and powerBombQty use value from 10 to 90 and divide value by float(10) when generating
- fixed inverted layoutPatch setting
* added option start_inventory_removes_from_pool
fixed option names formatting
fixed lint errors
small code and repo cleanup
* Hopefully fixed ROR2 that could not send any items
* - fixed missing required change to ROR2
* fixed 0 hp when respawning without having ever saved (start items were not updating the save checksum)
* fixed typo with doors_colors_rando
* fixed checksum
* added custom sprites for off-world items (progression or not)
the original AP sprite was made with PierRoulette's SM Item Sprite Utility by ijwu
* - added missing change following upstream merge
- changed patch filename extension from apbp to apm3 so patch can be used with the new client
* added morph placement options: early means local and sphere 1
* fixed failing unit tests
* - fixed broken custom_preset options
* - big cleanup to remove unnecessary or unsupported features
* - more cleanup
* - moved sm_randomizer_rom and all always applied patches into an external project that outputs basepatch.ips
- small cleanup
* - added comment to refer to project for generating basepatch.ips (https://github.com/lordlou/SMBasepatch)
* fixed g4_skip patch that can be not applied if hud is enabled
* - fixed off world sprite that can have broken graphics (restricted to use only first 2 palette)
* - updated basepatch to reflect g4_skip removal
- moved more asm files to SMBasepatch project
* - tourian grey doors at baby metroid are now always flashing (allowing to go back if needed)
* fixed wrong path if using built as exe
* - cleaned exposed maxDifficulty options
- removed always enabled Knows
* Merged LttPClient and SMClient into SNIClient
* added varia_custom Preset Option that fetch a preset (read from a new varia_custom_preset Option) from varia's web service
* small doc precision
* - added death_link support
- fixed broken Goal Completion
- post merge fix
* - removed now useless presets
* - fixed bad internal mapping with maxDiff
- increases maxDiff if only Bosses is preventing beating the game
* - added support for lowercase custom preset sections (knows, settings and controller)
- fixed controller settings not applying to ROM
* - fixed death loop when dying with Door rando, bomb or speed booster as starting items
- varia's backup save should now be usable (automatically enabled when doing door rando)
* -added docstring for generated yaml
* fixed bad merge
* fixed broken infinity max difficulty
* commented debug prints
* adjusted credits to mark progression speed and difficulty as Non Available
* added support for more than 255 players (will print Archipelago for higher player number)
* fixed missing cleanup
* added support for 65535 different player names in ROM
* fixed generations failing when only bosses are unreachable
* - replaced setting maxDiff to infinity with a bool only affecting boss logics if only bosses are left to finish
* fixed failling generations when using 'fun' settings
Accessibility checks are forced to 'items' if restricted locations are used by VARIA following usage of 'fun' settings
* fixed debug logger
* removed unsupported "suits_restriction" option
* fixed generations failing when only bosses are unreachable (using a less intrusive approach for AP)
* - fixed deathlink emptying reserves
- added death_link_survive option that lets player survive when receiving a deathlink if the have non-empty reserves
* - merged death_link and death_link_survive options
* fixed death_link
* added a fallback default starting location instead of failing generation if an invalid one was chosen
* added Nothing and NoEnergy as hint blacklist
added missing NoEnergy as local items and removed it from progression
* - enabled local item dialog boxes for dungeon and keycard items when keysanity is used
* - fixed ItemLink support
* fixed shops sending checks
* Added get_filler_item_name() returning a random junk item
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
											 
										 
										
											2022-07-16 13:47:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            for  player ,  group  in  parent . groups . items ( ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( group [ " game " ]  ==  " SMZ3 " ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    self . smz3state [ player ]  =  TotalSMZ3Item . Progression ( [ ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  player  not  in  parent . state . smz3state : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        parent . state . smz3state [ player ]  =  TotalSMZ3Item . Progression ( [ ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . smz3state  =  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  copy_mixin ( self ,  ret )  - >  CollectionState : 
							 
						 
					
						
							
								
									
										
											 
										
											
												SMZ3: Item link support (#756)
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* Fixed multiworld support patch not working with VariaRandomizer's
Added stage_fill_hook to set morph first in progitempool
Added back VariaRandomizer's standard patches
* + added missing files from variaRandomizer project
* + added missing variaRandomizer files (custom sprites)
+ started integrating VariaRandomizer options (WIP)
* Some fixes for player and server name display
- fixed player name of 16 characters reading too far in SM client
- fixed 12 bytes SM player name limit (now 16)
- fixed server name not being displayed in SM when using server cheat ( now displays RECEIVED FROM ARCHIPELAGO)
- request: temporarly changed default seed names displayed in SM main menu to OWTCH
* Fixed Goal completion not triggering in smClient
* integrated VariaRandomizer's options into AP (WIP)
- startAP is working
- door rando is working
- skillset is working
* - fixed itemsounds.ips crash by always including nofanfare.ips into multiworld.ips (itemsounds is now always applied and "itemsounds" preset must always be "off")
* skillset are now instanced per player instead of being a singleton class
* RomPatches are now instanced per player instead of being a singleton class
* DoorManager is now instanced per player instead of being a singleton class
* - fixed the last bugs that prevented generation of >1 SM world
* fixed crash when no skillset preset is specified in randoPreset (default to "casual")
* maxDifficulty support and itemsounds removal
- added support for maxDifficulty
- removed itemsounds patch as its always applied from multiworld patch for now
* Fixed bad merge
* Post merge adaptation
* fixed player name length fix that got lost with the merge
* fixed generation with other game type than SM
* added default randoPreset json for SM in playerSettings.yaml
* fixed broken SM client following merge
* beautified json skillset presets
* Fixed ArchipelagoSmClient not building
* Fixed conflict between mutliworld patch and beam_doors_plms patch
- doorsColorsRando now working
* SM generation now outputs APBP
- Fixed paths for patches and presets when frozen
* added missing file and fixed multithreading issue
* temporarily set data_version = 0
* more work
- added support for AP starting items
- fixed client crash with gamemode being None
- patch.py "compatible_version" is now 3
* commited missing asm files
fixed start item reserve breaking game (was using bad write offset when patching)
* Nothing item are now handled game-side. the game will now skip displaying a message box for received Nothing item (but the client will still receive it).
fixed crash in SMClient when loosing connection to SNI
* fixed No Energy Item missing its ID
fixed Plando
* merge post fixes
* fixed start item Grapple, XRay and Reserve HUD, as well as graphic beams (except ice palette color)
* fixed freeze in blue brinstar caused by Varia's custom PLM not being filled with proper Multiworld PLM address (altLocsAddresses)
* fixed start item x-ray HUD display
* Fixed start items being sent by the server (is all handled in ROM)
Start items are now not removed from itempool anymore
Nothing Item is now local_items so no player will ever pickup Nothing. Doing so reduces contribution of this world to the Multiworld the more Nothing there is though.
Fixed crash (and possibly passing but broken) at generation where the static list of IPSPatches used by all SM worlds was being modified
* fixed settings that could be applied to any SM players
* fixed auth to server only using player name (now does as ALTTP to authenticate)
* - fixed End Credits broken text
* added non SM item name display
* added all supported SM options in playerSettings.yaml
* fixed locations needing a list of parent regions (now generate a region for each location with one-way exits to each (previously) parent region
did some cleaning (mainly reverts on unnecessary core classes
* minor setting fixes and tweaks
- merged Area and lightArea settings
- made missileQty, superQty and powerBombQty use value from 10 to 90 and divide value by float(10) when generating
- fixed inverted layoutPatch setting
* added option start_inventory_removes_from_pool
fixed option names formatting
fixed lint errors
small code and repo cleanup
* Hopefully fixed ROR2 that could not send any items
* - fixed missing required change to ROR2
* fixed 0 hp when respawning without having ever saved (start items were not updating the save checksum)
* fixed typo with doors_colors_rando
* fixed checksum
* added custom sprites for off-world items (progression or not)
the original AP sprite was made with PierRoulette's SM Item Sprite Utility by ijwu
* - added missing change following upstream merge
- changed patch filename extension from apbp to apm3 so patch can be used with the new client
* added morph placement options: early means local and sphere 1
* fixed failing unit tests
* - fixed broken custom_preset options
* - big cleanup to remove unnecessary or unsupported features
* - more cleanup
* - moved sm_randomizer_rom and all always applied patches into an external project that outputs basepatch.ips
- small cleanup
* - added comment to refer to project for generating basepatch.ips (https://github.com/lordlou/SMBasepatch)
* fixed g4_skip patch that can be not applied if hud is enabled
* - fixed off world sprite that can have broken graphics (restricted to use only first 2 palette)
* - updated basepatch to reflect g4_skip removal
- moved more asm files to SMBasepatch project
* - tourian grey doors at baby metroid are now always flashing (allowing to go back if needed)
* fixed wrong path if using built as exe
* - cleaned exposed maxDifficulty options
- removed always enabled Knows
* Merged LttPClient and SMClient into SNIClient
* added varia_custom Preset Option that fetch a preset (read from a new varia_custom_preset Option) from varia's web service
* small doc precision
* - added death_link support
- fixed broken Goal Completion
- post merge fix
* - removed now useless presets
* - fixed bad internal mapping with maxDiff
- increases maxDiff if only Bosses is preventing beating the game
* - added support for lowercase custom preset sections (knows, settings and controller)
- fixed controller settings not applying to ROM
* - fixed death loop when dying with Door rando, bomb or speed booster as starting items
- varia's backup save should now be usable (automatically enabled when doing door rando)
* -added docstring for generated yaml
* fixed bad merge
* fixed broken infinity max difficulty
* commented debug prints
* adjusted credits to mark progression speed and difficulty as Non Available
* added support for more than 255 players (will print Archipelago for higher player number)
* fixed missing cleanup
* added support for 65535 different player names in ROM
* fixed generations failing when only bosses are unreachable
* - replaced setting maxDiff to infinity with a bool only affecting boss logics if only bosses are left to finish
* fixed failling generations when using 'fun' settings
Accessibility checks are forced to 'items' if restricted locations are used by VARIA following usage of 'fun' settings
* fixed debug logger
* removed unsupported "suits_restriction" option
* fixed generations failing when only bosses are unreachable (using a less intrusive approach for AP)
* - fixed deathlink emptying reserves
- added death_link_survive option that lets player survive when receiving a deathlink if the have non-empty reserves
* - merged death_link and death_link_survive options
* fixed death_link
* added a fallback default starting location instead of failing generation if an invalid one was chosen
* added Nothing and NoEnergy as hint blacklist
added missing NoEnergy as local items and removed it from progression
* - enabled local item dialog boxes for dungeon and keycard items when keysanity is used
* - fixed ItemLink support
* fixed shops sending checks
* Added get_filler_item_name() returning a random junk item
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
											 
										 
										
											2022-07-16 13:47:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ret . smz3state  =  { player :  copy . deepcopy ( self . smz3state [ player ] )  for  player  in  self . smz3state } 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        return  ret 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-05-11 13:05:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								class  SMZ3Web ( WebWorld ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    tutorials  =  [ Tutorial ( 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " Multiworld Setup Guide " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " A guide to setting up the Archipelago Super Metroid and A Link to the Past Crossover randomizer on your computer. This guide covers single-player, multiworld, and related software. " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " English " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " multiworld_en.md " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        " multiworld/en " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        [ " lordlou " ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    ) ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								class  SMZ3World ( World ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    """ 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     A  python  port  of  Super  Metroid  &  A  Link  To  The  Past  Crossover  Item  Randomizer  based  on  v11 .2  of  Total ' s SMZ3.  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								     This  is  allowed  as  long  as  we  keep  features  and  logic  as  close  as  possible  as  the  original .     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    """ 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    game :  str  =  " SMZ3 " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    topology_present  =  False 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-03 17:52:09 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    data_version  =  3 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 16:46:59 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    option_definitions  =  smz3_options 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    item_names :  Set [ str ]  =  frozenset ( TotalSMZ3Item . lookup_name_to_id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    location_names :  Set [ str ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    item_name_to_id  =  TotalSMZ3Item . lookup_name_to_id 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-03 17:52:09 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    location_name_to_id :  Dict [ str ,  int ]  =  { key  :  locations_start_id  +  convertLocSMZ3IDToAPID ( value . Id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  key ,  value  in  TotalSMZ3World ( Config ( ) ,  " " ,  0 ,  " " ) . locationLookup . items ( ) } 
							 
						 
					
						
							
								
									
										
										
										
											2022-05-11 13:05:53 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    web  =  SMZ3Web ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-07-28 06:04:48 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    locationNamesGT :  Set [ str ]  =  { loc . Name  for  loc  in  GanonsTower ( None ,  None ) . Locations } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-04-08 11:16:36 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    # first added for 0.2.6 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    required_client_version  =  ( 0 ,  2 ,  6 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    def  __init__ ( self ,  world :  MultiWorld ,  player :  int ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . rom_name_available_event  =  threading . Event ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-04 01:49:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        self . locations :  Dict [ str ,  Location ]  =  { } 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        self . unreachable  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        super ( ) . __init__ ( world ,  player ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-07-31 05:08:41 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    @classmethod 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  isProgression ( cls ,  itemType ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        progressionTypes  =  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . ProgressiveShield , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . ProgressiveSword , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Bow , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Hookshot , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Mushroom , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Powder , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Firerod , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Icerod , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Bombos , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Ether , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Quake , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Lamp , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Hammer , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Shovel , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Flute , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Bugnet , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Book , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Bottle , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Somaria , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Byrna , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Cape , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Mirror , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Boots , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . ProgressiveGlove , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Flippers , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . MoonPearl , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . HalfMagic , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Grapple , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Charge , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Ice , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Wave , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Plasma , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Varia , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Gravity , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Morph , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . Bombs , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . SpringBall , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . ScrewAttack , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . HiJump , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . SpaceJump , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . SpeedBooster , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . ETank , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . ReserveTank , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . BigKeyGT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . KeyGT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . BigKeyEP , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . BigKeyDP , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . BigKeyTH , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . BigKeyPD , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . BigKeySP , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . BigKeySW , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . BigKeyTT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . BigKeyIP , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . BigKeyMM , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . BigKeyTR , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . KeyHC , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . KeyCT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . KeyDP , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . KeyTH , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . KeyPD , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . KeySP , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . KeySW , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . KeyTT , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . KeyIP , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . KeyMM , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . KeyTR , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardCrateriaL1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardCrateriaL2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardCrateriaBoss , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardBrinstarL1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardBrinstarL2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardBrinstarBoss , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardNorfairL1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardNorfairL2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardNorfairBoss , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardMaridiaL1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardMaridiaL2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardMaridiaBoss , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardWreckedShipL1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardWreckedShipBoss , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardLowerNorfairL1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                ItemType . CardLowerNorfairBoss , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  itemType  in  progressionTypes 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-04-29 20:37:28 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    @classmethod 
							 
						 
					
						
							
								
									
										
										
										
											2023-02-16 00:28:02 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    def  stage_assert_generate ( cls ,  multiworld :  MultiWorld ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-04-29 20:37:28 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        base_combined_rom  =  get_base_rom_bytes ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    def  generate_early ( self ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        self . config  =  Config ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . config . GameMode  =  GameMode . Multiworld 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . config . Z3Logic  =  Z3Logic . Normal 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        self . config . SMLogic  =  SMLogic ( self . multiworld . sm_logic [ self . player ] . value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . config . SwordLocation  =  SwordLocation ( self . multiworld . sword_location [ self . player ] . value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . config . MorphLocation  =  MorphLocation ( self . multiworld . morph_location [ self . player ] . value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . config . Goal  =  Goal ( self . multiworld . goal [ self . player ] . value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . config . KeyShuffle  =  KeyShuffle ( self . multiworld . key_shuffle [ self . player ] . value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . config . OpenTower  =  OpenTower ( self . multiworld . open_tower [ self . player ] . value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . config . GanonVulnerable  =  GanonVulnerable ( self . multiworld . ganon_vulnerable [ self . player ] . value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . config . OpenTourian  =  OpenTourian ( self . multiworld . open_tourian [ self . player ] . value ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . local_random  =  random . Random ( self . multiworld . random . randint ( 0 ,  1000 ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . smz3World  =  TotalSMZ3World ( self . config ,  self . multiworld . get_player_name ( self . player ) ,  self . player ,  self . multiworld . seed_name ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        self . smz3DungeonItems  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        SMZ3World . location_names  =  frozenset ( self . smz3World . locationLookup . keys ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        self . multiworld . state . smz3state [ self . player ]  =  TotalSMZ3Item . Progression ( [ ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  generate_basic ( self ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        self . smz3World . Setup ( WorldState . Generate ( self . config ,  self . multiworld . random ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        self . dungeon  =  TotalSMZ3Item . Item . CreateDungeonPool ( self . smz3World ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . dungeon . reverse ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . progression  =  TotalSMZ3Item . Item . CreateProgressionPool ( self . smz3World ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . keyCardsItems  =  TotalSMZ3Item . Item . CreateKeycards ( self . smz3World ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        self . SmMapsItems  =  TotalSMZ3Item . Item . CreateSmMaps ( self . smz3World ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        niceItems  =  TotalSMZ3Item . Item . CreateNicePool ( self . smz3World ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        junkItems  =  TotalSMZ3Item . Item . CreateJunkPool ( self . smz3World ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        allJunkItems  =  niceItems  +  junkItems 
							 
						 
					
						
							
								
									
										
											 
										
											
												SMZ3: Item link support (#756)
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* Fixed multiworld support patch not working with VariaRandomizer's
Added stage_fill_hook to set morph first in progitempool
Added back VariaRandomizer's standard patches
* + added missing files from variaRandomizer project
* + added missing variaRandomizer files (custom sprites)
+ started integrating VariaRandomizer options (WIP)
* Some fixes for player and server name display
- fixed player name of 16 characters reading too far in SM client
- fixed 12 bytes SM player name limit (now 16)
- fixed server name not being displayed in SM when using server cheat ( now displays RECEIVED FROM ARCHIPELAGO)
- request: temporarly changed default seed names displayed in SM main menu to OWTCH
* Fixed Goal completion not triggering in smClient
* integrated VariaRandomizer's options into AP (WIP)
- startAP is working
- door rando is working
- skillset is working
* - fixed itemsounds.ips crash by always including nofanfare.ips into multiworld.ips (itemsounds is now always applied and "itemsounds" preset must always be "off")
* skillset are now instanced per player instead of being a singleton class
* RomPatches are now instanced per player instead of being a singleton class
* DoorManager is now instanced per player instead of being a singleton class
* - fixed the last bugs that prevented generation of >1 SM world
* fixed crash when no skillset preset is specified in randoPreset (default to "casual")
* maxDifficulty support and itemsounds removal
- added support for maxDifficulty
- removed itemsounds patch as its always applied from multiworld patch for now
* Fixed bad merge
* Post merge adaptation
* fixed player name length fix that got lost with the merge
* fixed generation with other game type than SM
* added default randoPreset json for SM in playerSettings.yaml
* fixed broken SM client following merge
* beautified json skillset presets
* Fixed ArchipelagoSmClient not building
* Fixed conflict between mutliworld patch and beam_doors_plms patch
- doorsColorsRando now working
* SM generation now outputs APBP
- Fixed paths for patches and presets when frozen
* added missing file and fixed multithreading issue
* temporarily set data_version = 0
* more work
- added support for AP starting items
- fixed client crash with gamemode being None
- patch.py "compatible_version" is now 3
* commited missing asm files
fixed start item reserve breaking game (was using bad write offset when patching)
* Nothing item are now handled game-side. the game will now skip displaying a message box for received Nothing item (but the client will still receive it).
fixed crash in SMClient when loosing connection to SNI
* fixed No Energy Item missing its ID
fixed Plando
* merge post fixes
* fixed start item Grapple, XRay and Reserve HUD, as well as graphic beams (except ice palette color)
* fixed freeze in blue brinstar caused by Varia's custom PLM not being filled with proper Multiworld PLM address (altLocsAddresses)
* fixed start item x-ray HUD display
* Fixed start items being sent by the server (is all handled in ROM)
Start items are now not removed from itempool anymore
Nothing Item is now local_items so no player will ever pickup Nothing. Doing so reduces contribution of this world to the Multiworld the more Nothing there is though.
Fixed crash (and possibly passing but broken) at generation where the static list of IPSPatches used by all SM worlds was being modified
* fixed settings that could be applied to any SM players
* fixed auth to server only using player name (now does as ALTTP to authenticate)
* - fixed End Credits broken text
* added non SM item name display
* added all supported SM options in playerSettings.yaml
* fixed locations needing a list of parent regions (now generate a region for each location with one-way exits to each (previously) parent region
did some cleaning (mainly reverts on unnecessary core classes
* minor setting fixes and tweaks
- merged Area and lightArea settings
- made missileQty, superQty and powerBombQty use value from 10 to 90 and divide value by float(10) when generating
- fixed inverted layoutPatch setting
* added option start_inventory_removes_from_pool
fixed option names formatting
fixed lint errors
small code and repo cleanup
* Hopefully fixed ROR2 that could not send any items
* - fixed missing required change to ROR2
* fixed 0 hp when respawning without having ever saved (start items were not updating the save checksum)
* fixed typo with doors_colors_rando
* fixed checksum
* added custom sprites for off-world items (progression or not)
the original AP sprite was made with PierRoulette's SM Item Sprite Utility by ijwu
* - added missing change following upstream merge
- changed patch filename extension from apbp to apm3 so patch can be used with the new client
* added morph placement options: early means local and sphere 1
* fixed failing unit tests
* - fixed broken custom_preset options
* - big cleanup to remove unnecessary or unsupported features
* - more cleanup
* - moved sm_randomizer_rom and all always applied patches into an external project that outputs basepatch.ips
- small cleanup
* - added comment to refer to project for generating basepatch.ips (https://github.com/lordlou/SMBasepatch)
* fixed g4_skip patch that can be not applied if hud is enabled
* - fixed off world sprite that can have broken graphics (restricted to use only first 2 palette)
* - updated basepatch to reflect g4_skip removal
- moved more asm files to SMBasepatch project
* - tourian grey doors at baby metroid are now always flashing (allowing to go back if needed)
* fixed wrong path if using built as exe
* - cleaned exposed maxDifficulty options
- removed always enabled Knows
* Merged LttPClient and SMClient into SNIClient
* added varia_custom Preset Option that fetch a preset (read from a new varia_custom_preset Option) from varia's web service
* small doc precision
* - added death_link support
- fixed broken Goal Completion
- post merge fix
* - removed now useless presets
* - fixed bad internal mapping with maxDiff
- increases maxDiff if only Bosses is preventing beating the game
* - added support for lowercase custom preset sections (knows, settings and controller)
- fixed controller settings not applying to ROM
* - fixed death loop when dying with Door rando, bomb or speed booster as starting items
- varia's backup save should now be usable (automatically enabled when doing door rando)
* -added docstring for generated yaml
* fixed bad merge
* fixed broken infinity max difficulty
* commented debug prints
* adjusted credits to mark progression speed and difficulty as Non Available
* added support for more than 255 players (will print Archipelago for higher player number)
* fixed missing cleanup
* added support for 65535 different player names in ROM
* fixed generations failing when only bosses are unreachable
* - replaced setting maxDiff to infinity with a bool only affecting boss logics if only bosses are left to finish
* fixed failling generations when using 'fun' settings
Accessibility checks are forced to 'items' if restricted locations are used by VARIA following usage of 'fun' settings
* fixed debug logger
* removed unsupported "suits_restriction" option
* fixed generations failing when only bosses are unreachable (using a less intrusive approach for AP)
* - fixed deathlink emptying reserves
- added death_link_survive option that lets player survive when receiving a deathlink if the have non-empty reserves
* - merged death_link and death_link_survive options
* fixed death_link
* added a fallback default starting location instead of failing generation if an invalid one was chosen
* added Nothing and NoEnergy as hint blacklist
added missing NoEnergy as local items and removed it from progression
* - enabled local item dialog boxes for dungeon and keycard items when keysanity is used
* - fixed ItemLink support
* fixed shops sending checks
* Added get_filler_item_name() returning a random junk item
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
											 
										 
										
											2022-07-16 13:47:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        self . junkItemsNames  =  [ item . Type . name  for  item  in  junkItems ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( self . smz3World . Config . Keysanity ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            progressionItems  =  self . progression  +  self . dungeon  +  self . keyCardsItems  +  self . SmMapsItems 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            progressionItems  =  self . progression  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  item  in  self . keyCardsItems : 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                self . multiworld . push_precollected ( SMZ3Item ( item . Type . name ,  ItemClassification . filler ,  item . Type ,  self . item_name_to_id [ item . Type . name ] ,  self . player ,  item ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-06-17 03:23:27 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        itemPool  =  [ SMZ3Item ( item . Type . name ,  ItemClassification . progression ,  item . Type ,  self . item_name_to_id [ item . Type . name ] ,  self . player ,  item )  for  item  in  progressionItems ]  +  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    [ SMZ3Item ( item . Type . name ,  ItemClassification . filler ,  item . Type ,  self . item_name_to_id [ item . Type . name ] ,  self . player ,  item )  for  item  in  allJunkItems ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . smz3DungeonItems  =  [ SMZ3Item ( item . Type . name ,  ItemClassification . progression ,  item . Type ,  self . item_name_to_id [ item . Type . name ] ,  self . player ,  item )  for  item  in  self . dungeon ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        self . multiworld . itempool  + =  itemPool 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  set_rules ( self ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # SM G4 is logically required to access Ganon's Tower in SMZ3 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        self . multiworld . completion_condition [ self . player ]  =  lambda  state :  \
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            self . smz3World . GetRegion ( " Ganon ' s Tower " ) . CanEnter ( state . smz3state [ self . player ] )  and  \
							 
						 
					
						
							
								
									
										
											 
										
											
												SMZ3: completion condition fix and more info in spoiler (#1133)
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* Fixed multiworld support patch not working with VariaRandomizer's
Added stage_fill_hook to set morph first in progitempool
Added back VariaRandomizer's standard patches
* + added missing files from variaRandomizer project
* + added missing variaRandomizer files (custom sprites)
+ started integrating VariaRandomizer options (WIP)
* Some fixes for player and server name display
- fixed player name of 16 characters reading too far in SM client
- fixed 12 bytes SM player name limit (now 16)
- fixed server name not being displayed in SM when using server cheat ( now displays RECEIVED FROM ARCHIPELAGO)
- request: temporarly changed default seed names displayed in SM main menu to OWTCH
* Fixed Goal completion not triggering in smClient
* integrated VariaRandomizer's options into AP (WIP)
- startAP is working
- door rando is working
- skillset is working
* - fixed itemsounds.ips crash by always including nofanfare.ips into multiworld.ips (itemsounds is now always applied and "itemsounds" preset must always be "off")
* skillset are now instanced per player instead of being a singleton class
* RomPatches are now instanced per player instead of being a singleton class
* DoorManager is now instanced per player instead of being a singleton class
* - fixed the last bugs that prevented generation of >1 SM world
* fixed crash when no skillset preset is specified in randoPreset (default to "casual")
* maxDifficulty support and itemsounds removal
- added support for maxDifficulty
- removed itemsounds patch as its always applied from multiworld patch for now
* Fixed bad merge
* Post merge adaptation
* fixed player name length fix that got lost with the merge
* fixed generation with other game type than SM
* added default randoPreset json for SM in playerSettings.yaml
* fixed broken SM client following merge
* beautified json skillset presets
* Fixed ArchipelagoSmClient not building
* Fixed conflict between mutliworld patch and beam_doors_plms patch
- doorsColorsRando now working
* SM generation now outputs APBP
- Fixed paths for patches and presets when frozen
* added missing file and fixed multithreading issue
* temporarily set data_version = 0
* more work
- added support for AP starting items
- fixed client crash with gamemode being None
- patch.py "compatible_version" is now 3
* commited missing asm files
fixed start item reserve breaking game (was using bad write offset when patching)
* Nothing item are now handled game-side. the game will now skip displaying a message box for received Nothing item (but the client will still receive it).
fixed crash in SMClient when loosing connection to SNI
* fixed No Energy Item missing its ID
fixed Plando
* merge post fixes
* fixed start item Grapple, XRay and Reserve HUD, as well as graphic beams (except ice palette color)
* fixed freeze in blue brinstar caused by Varia's custom PLM not being filled with proper Multiworld PLM address (altLocsAddresses)
* fixed start item x-ray HUD display
* Fixed start items being sent by the server (is all handled in ROM)
Start items are now not removed from itempool anymore
Nothing Item is now local_items so no player will ever pickup Nothing. Doing so reduces contribution of this world to the Multiworld the more Nothing there is though.
Fixed crash (and possibly passing but broken) at generation where the static list of IPSPatches used by all SM worlds was being modified
* fixed settings that could be applied to any SM players
* fixed auth to server only using player name (now does as ALTTP to authenticate)
* - fixed End Credits broken text
* added non SM item name display
* added all supported SM options in playerSettings.yaml
* fixed locations needing a list of parent regions (now generate a region for each location with one-way exits to each (previously) parent region
did some cleaning (mainly reverts on unnecessary core classes
* minor setting fixes and tweaks
- merged Area and lightArea settings
- made missileQty, superQty and powerBombQty use value from 10 to 90 and divide value by float(10) when generating
- fixed inverted layoutPatch setting
* added option start_inventory_removes_from_pool
fixed option names formatting
fixed lint errors
small code and repo cleanup
* Hopefully fixed ROR2 that could not send any items
* - fixed missing required change to ROR2
* fixed 0 hp when respawning without having ever saved (start items were not updating the save checksum)
* fixed typo with doors_colors_rando
* fixed checksum
* added custom sprites for off-world items (progression or not)
the original AP sprite was made with PierRoulette's SM Item Sprite Utility by ijwu
* - added missing change following upstream merge
- changed patch filename extension from apbp to apm3 so patch can be used with the new client
* added morph placement options: early means local and sphere 1
* fixed failing unit tests
* - fixed broken custom_preset options
* - big cleanup to remove unnecessary or unsupported features
* - more cleanup
* - moved sm_randomizer_rom and all always applied patches into an external project that outputs basepatch.ips
- small cleanup
* - added comment to refer to project for generating basepatch.ips (https://github.com/lordlou/SMBasepatch)
* fixed g4_skip patch that can be not applied if hud is enabled
* - fixed off world sprite that can have broken graphics (restricted to use only first 2 palette)
* - updated basepatch to reflect g4_skip removal
- moved more asm files to SMBasepatch project
* - tourian grey doors at baby metroid are now always flashing (allowing to go back if needed)
* fixed wrong path if using built as exe
* - cleaned exposed maxDifficulty options
- removed always enabled Knows
* Merged LttPClient and SMClient into SNIClient
* added varia_custom Preset Option that fetch a preset (read from a new varia_custom_preset Option) from varia's web service
* small doc precision
* - added death_link support
- fixed broken Goal Completion
- post merge fix
* - removed now useless presets
* - fixed bad internal mapping with maxDiff
- increases maxDiff if only Bosses is preventing beating the game
* - added support for lowercase custom preset sections (knows, settings and controller)
- fixed controller settings not applying to ROM
* - fixed death loop when dying with Door rando, bomb or speed booster as starting items
- varia's backup save should now be usable (automatically enabled when doing door rando)
* -added docstring for generated yaml
* fixed bad merge
* fixed broken infinity max difficulty
* commented debug prints
* adjusted credits to mark progression speed and difficulty as Non Available
* added support for more than 255 players (will print Archipelago for higher player number)
* fixed missing cleanup
* added support for 65535 different player names in ROM
* fixed generations failing when only bosses are unreachable
* - replaced setting maxDiff to infinity with a bool only affecting boss logics if only bosses are left to finish
* fixed failling generations when using 'fun' settings
Accessibility checks are forced to 'items' if restricted locations are used by VARIA following usage of 'fun' settings
* fixed debug logger
* removed unsupported "suits_restriction" option
* fixed generations failing when only bosses are unreachable (using a less intrusive approach for AP)
* - fixed deathlink emptying reserves
- added death_link_survive option that lets player survive when receiving a deathlink if the have non-empty reserves
* - merged death_link and death_link_survive options
* fixed death_link
* added a fallback default starting location instead of failing generation if an invalid one was chosen
* added Nothing and NoEnergy as hint blacklist
added missing NoEnergy as local items and removed it from progression
* added missing completion_condition when TowerCrystals is lower than GanonCrystals
added Rewards and Medallions infos to spoiler
* Update worlds/smz3/__init__.py
Yes, indeed. Thank you!
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
Co-authored-by: Zach Parks <zach@alliware.com>
											 
										 
										
											2022-11-01 15:52:04 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            self . smz3World . GetRegion ( " Ganon ' s Tower " ) . TowerAscend ( state . smz3state [ self . player ] )  and  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . smz3World . GetRegion ( " Ganon ' s Tower " ) . CanComplete ( state . smz3state [ self . player ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  region  in  self . smz3World . Regions : 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            entrance  =  self . multiworld . get_entrance ( ' Menu '  +  " -> "  +  region . Name ,  self . player ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            set_rule ( entrance ,  lambda  state ,  region = region :  region . CanEnter ( state . smz3state [ self . player ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  loc  in  region . Locations : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                l  =  self . locations [ loc . Name ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                if  self . multiworld . accessibility [ self . player ]  !=  ' locations ' : 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                    l . always_allow  =  lambda  state ,  item ,  loc = loc :  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        item . game  ==  " SMZ3 "  and  \
							 
						 
					
						
							
								
									
										
										
										
											2023-02-06 21:14:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        loc . alwaysAllow ( item . item ,  state . smz3state [ self . player ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                old_rule  =  l . item_rule 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                l . item_rule  =  lambda  item ,  loc = loc ,  region = region :  ( \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    item . game  !=  " SMZ3 "  or  \
							 
						 
					
						
							
								
									
										
										
										
											2023-02-06 21:14:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    loc . allow ( item . item ,  None )  and  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        region . CanFill ( item . item ) )  and  old_rule ( item ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                set_rule ( l ,  lambda  state ,  loc = loc :  loc . Available ( state . smz3state [ self . player ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  create_regions ( self ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . create_locations ( self . player ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        startRegion  =  self . create_region ( self . multiworld ,  self . player ,  ' Menu ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . multiworld . regions . append ( startRegion ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  region  in  self . smz3World . Regions : 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            currentRegion  =  self . create_region ( self . multiworld ,  self . player ,  region . Name ,  region . locationLookup . keys ( ) ,  [ region . Name  +  " -> "  +  ' Menu ' ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . multiworld . regions . append ( currentRegion ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            entrance  =  self . multiworld . get_entrance ( region . Name  +  " -> "  +  ' Menu ' ,  self . player ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            entrance . connect ( startRegion ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            exit  =  Entrance ( self . player ,  ' Menu '  +  " -> "  +  region . Name ,  startRegion ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            startRegion . exits . append ( exit ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            exit . connect ( currentRegion ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  apply_sm_custom_sprite ( self ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itemSprites  =  [ " off_world_prog_item.bin " ,  " off_world_item.bin " ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itemSpritesAddress  =  [ 0xF800 ,  0xF900 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        idx  =  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        offworldSprites  =  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  fileName  in  itemSprites : 
							 
						 
					
						
							
								
									
										
										
										
											2023-04-08 16:52:34 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            with  openFile ( world_folder  +  " /data/custom_sprite/ "  +  fileName ,  ' rb ' )  as  stream : 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                buffer  =  bytearray ( stream . read ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                offworldSprites [ 0x04Eff2  +  10 * ( ( 0x6B  +  0x40 )  +  idx ) ]  =  bytearray ( getWordArray ( itemSpritesAddress [ idx ] ) )  +  buffer [ 0 : 8 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                offworldSprites [ 0x090000  +  itemSpritesAddress [ idx ] ]  =  buffer [ 8 : 264 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                idx  + =  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  offworldSprites 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  convert_to_sm_item_name ( self ,  itemName ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        charMap  =  {  " A "  :  0x3CE0 ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " B "  :  0x3CE1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " C "  :  0x3CE2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " D "  :  0x3CE3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " E "  :  0x3CE4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " F "  :  0x3CE5 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " G "  :  0x3CE6 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " H "  :  0x3CE7 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " I "  :  0x3CE8 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " J "  :  0x3CE9 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " K "  :  0x3CEA , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " L "  :  0x3CEB , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " M "  :  0x3CEC , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " N "  :  0x3CED , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " O "  :  0x3CEE , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " P "  :  0x3CEF , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " Q "  :  0x3CF0 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " R "  :  0x3CF1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " S "  :  0x3CF2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " T "  :  0x3CF3 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " U "  :  0x3CF4 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " V "  :  0x3CF5 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " W "  :  0x3CF6 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " X "  :  0x3CF7 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " Y "  :  0x3CF8 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " Z "  :  0x3CF9 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    "   "  :  0x3C4E , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " ! "  :  0x3CFF , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " ? "  :  0x3CFE , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " ' "  :  0x3CFD , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " , "  :  0x3CFB , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " . "  :  0x3CFA , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " - "  :  0x3CCF , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " _ "  :  0x000E , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " 1 "  :  0x3C00 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " 2 "  :  0x3C01 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " 3 "  :  0x3C02 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " 4 "  :  0x3C03 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " 5 "  :  0x3C04 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " 6 "  :  0x3C05 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " 7 "  :  0x3C06 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " 8 "  :  0x3C07 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " 9 "  :  0x3C08 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " 0 "  :  0x3C09 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    " % "  :  0x3C0A } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        data  =  [ ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itemName  =  itemName . upper ( ) [ : 26 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itemName  =  itemName . strip ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itemName  =  itemName . center ( 26 ,  "   " )     
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itemName  =  " ___ "  +  itemName  +  " ___ " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  char  in  itemName : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            ( w0 ,  w1 )  =  getWord ( charMap . get ( char ,  0x3C4E ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            data . append ( w0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            data . append ( w1 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  data 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  convert_to_lttp_item_name ( self ,  itemName ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-18 04:53:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  bytearray ( itemName [ : 19 ] . center ( 19 ,  "   " ) ,  ' utf8 ' )  +  bytearray ( 0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  apply_item_names ( self ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        patch  =  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        sm_remote_idx  =  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        lttp_remote_idx  =  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  location  in  self . smz3World . Locations : 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  self . multiworld . worlds [ location . APLocation . item . player ] . game  !=  self . game : 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                if  location . Type  ==  LocationType . Visible  or  location . Type  ==  LocationType . Chozo  or  location . Type  ==  LocationType . Hidden : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    patch [ 0x390000  +  sm_remote_idx * 64 ]  =  self . convert_to_sm_item_name ( location . APLocation . item . name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    sm_remote_idx  + =  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    progressionItem  =  ( 0  if  location . APLocation . item . advancement  else  0x8000 )  +  sm_remote_idx 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    patch [ 0x386000  +  ( location . Id  *  8 )  +  6 ]  =  bytearray ( getWordArray ( progressionItem ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    patch [ 0x390000  +  100  *  64  +  lttp_remote_idx  *  20 ]  =  self . convert_to_lttp_item_name ( location . APLocation . item . name ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    lttp_remote_idx  + =  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    progressionItem  =  ( 0  if  location . APLocation . item . advancement  else  0x8000 )  +  lttp_remote_idx 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    patch [ 0x386000  +  ( location . Id  *  8 )  +  6 ]  =  bytearray ( getWordArray ( progressionItem ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  patch 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    def  SnesCustomization ( self ,  addr :  int ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        addr  =  ( 0x400000  if  addr  <  0x800000  else  0 ) |  ( addr  &  0x3FFFFF ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  addr 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  apply_customization ( self ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        patch  =  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # smSpinjumps 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( self . multiworld . spin_jumps_animation [ self . player ] . value  ==  1 ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            patch [ self . SnesCustomization ( 0x9B93FE ) ]  =  bytearray ( [ 0x01 ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # z3HeartBeep 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        values  =     [  0x00 ,  0x80 ,  0x40 ,  0x20 ,  0x10 ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        index  =  self . multiworld . heart_beep_speed [ self . player ] . value 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        patch [ 0x400033 ]  =  bytearray ( [ values [ index  if  index  <  len ( values )  else  2 ] ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # z3HeartColor 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        values  =     [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        [ 0x24 ,  [ 0x18 ,  0x00 ] ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        [ 0x3C ,  [ 0x04 ,  0x17 ] ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        [ 0x2C ,  [ 0xC9 ,  0x69 ] ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        [ 0x28 ,  [ 0xBC ,  0x02 ] ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        index  =  self . multiworld . heart_color [ self . player ] . value 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ( hud ,  fileSelect )  =  values [ index  if  index  <  len ( values )  else  0 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  i  in  range ( 0 ,  20 ,  2 ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            patch [ self . SnesCustomization ( 0xDFA1E  +  i ) ]  =  bytearray ( [ hud ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        patch [ self . SnesCustomization ( 0x1BD6AA ) ]  =  bytearray ( fileSelect ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # z3QuickSwap 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        patch [ 0x40004B ]  =  bytearray ( [ 0x01  if  self . multiworld . quick_swap [ self . player ] . value  else  0x00 ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # smEnergyBeepOff 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( self . multiworld . energy_beep [ self . player ] . value  ==  0 ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            for  ( [ addr ,  value ] )  in  [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            [ 0x90EA9B ,  0x80 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            [ 0x90F337 ,  0x80 ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                            [ 0x91E6D5 ,  0x80 ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        ] : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                patch [ self . SnesCustomization ( addr ) ]  =  bytearray ( [ value ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  patch 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    def  generate_output ( self ,  output_directory :  str ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        try : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            base_combined_rom  =  get_base_rom_bytes ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            basepatch  =  IPS_Patch . load ( world_folder  +  " /data/zsm.ips " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            base_combined_rom  =  basepatch . apply ( base_combined_rom ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            patcher  =  TotalSMZ3Patch ( self . smz3World , 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                                     [ world . smz3World  for  key ,  world  in  self . multiworld . worlds . items ( )  if  isinstance ( world ,  SMZ3World )  and  hasattr ( world ,  " smz3World " ) ] , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                     self . multiworld . seed_name , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                     self . multiworld . seed , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                     self . local_random , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                     { v :  k  for  k ,  v  in  self . multiworld . player_name . items ( ) } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                     next ( iter ( loc . player  for  loc  in  self . multiworld . get_locations ( )  if  ( loc . item . name  ==  " SilverArrows "  and  loc . item . player  ==  self . player ) ) ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            patches  =  patcher . Create ( self . smz3World . Config ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            patches . update ( self . apply_sm_custom_sprite ( ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            patches . update ( self . apply_item_names ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            patches . update ( self . apply_customization ( ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            for  addr ,  bytes  in  patches . items ( ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                offset  =  0 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                for  byte  in  bytes : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    base_combined_rom [ addr  +  offset ]  =  byte 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    offset  + =  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            outfilebase  =  self . multiworld . get_out_file_name_base ( self . player ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-10-02 07:53:18 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            filename  =  os . path . join ( output_directory ,  f " { outfilebase } .sfc " ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            with  open ( filename ,  " wb " )  as  binary_file : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                binary_file . write ( base_combined_rom ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            patch  =  SMZ3DeltaPatch ( os . path . splitext ( filename ) [ 0 ]  +  SMZ3DeltaPatch . patch_file_ending ,  player = self . player , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                                   player_name = self . multiworld . player_name [ self . player ] ,  patched_path = filename ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-18 04:53:09 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            patch . write ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            os . remove ( filename ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . rom_name  =  bytearray ( patcher . title ,  ' utf8 ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        except : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            raise 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        finally : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . rom_name_available_event . set ( )  # make sure threading continues and errors are collected 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  modify_multidata ( self ,  multidata :  dict ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        import  base64 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( not  self . smz3World . Config . Keysanity ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  item_name  in  self . keyCardsItems : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                item_id  =  self . item_name_to_id . get ( item_name . Type . name ,  None ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                try : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    multidata [ " precollected_items " ] [ self . player ] . remove ( item_id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                except  ValueError  as  e : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    logger . warning ( f " Attempted to remove nonexistent item id  { item_id }  from smz3 precollected items ( { item_name } ) " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # wait for self.rom_name to be available. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . rom_name_available_event . wait ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        rom_name  =  getattr ( self ,  " rom_name " ,  None ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # we skip in case of error, so that the original error in the output thread is the one that gets raised 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  rom_name : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            new_name  =  base64 . b64encode ( bytes ( self . rom_name ) ) . decode ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            payload  =  multidata [ " connect_names " ] [ self . multiworld . player_name [ self . player ] ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            multidata [ " connect_names " ] [ new_name ]  =  payload 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  fill_slot_data ( self ) :  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        slot_data  =  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  slot_data 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  collect ( self ,  state :  CollectionState ,  item :  Item )  - >  bool : 
							 
						 
					
						
							
								
									
										
											 
										
											
												SMZ3: Item link support (#756)
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* Fixed multiworld support patch not working with VariaRandomizer's
Added stage_fill_hook to set morph first in progitempool
Added back VariaRandomizer's standard patches
* + added missing files from variaRandomizer project
* + added missing variaRandomizer files (custom sprites)
+ started integrating VariaRandomizer options (WIP)
* Some fixes for player and server name display
- fixed player name of 16 characters reading too far in SM client
- fixed 12 bytes SM player name limit (now 16)
- fixed server name not being displayed in SM when using server cheat ( now displays RECEIVED FROM ARCHIPELAGO)
- request: temporarly changed default seed names displayed in SM main menu to OWTCH
* Fixed Goal completion not triggering in smClient
* integrated VariaRandomizer's options into AP (WIP)
- startAP is working
- door rando is working
- skillset is working
* - fixed itemsounds.ips crash by always including nofanfare.ips into multiworld.ips (itemsounds is now always applied and "itemsounds" preset must always be "off")
* skillset are now instanced per player instead of being a singleton class
* RomPatches are now instanced per player instead of being a singleton class
* DoorManager is now instanced per player instead of being a singleton class
* - fixed the last bugs that prevented generation of >1 SM world
* fixed crash when no skillset preset is specified in randoPreset (default to "casual")
* maxDifficulty support and itemsounds removal
- added support for maxDifficulty
- removed itemsounds patch as its always applied from multiworld patch for now
* Fixed bad merge
* Post merge adaptation
* fixed player name length fix that got lost with the merge
* fixed generation with other game type than SM
* added default randoPreset json for SM in playerSettings.yaml
* fixed broken SM client following merge
* beautified json skillset presets
* Fixed ArchipelagoSmClient not building
* Fixed conflict between mutliworld patch and beam_doors_plms patch
- doorsColorsRando now working
* SM generation now outputs APBP
- Fixed paths for patches and presets when frozen
* added missing file and fixed multithreading issue
* temporarily set data_version = 0
* more work
- added support for AP starting items
- fixed client crash with gamemode being None
- patch.py "compatible_version" is now 3
* commited missing asm files
fixed start item reserve breaking game (was using bad write offset when patching)
* Nothing item are now handled game-side. the game will now skip displaying a message box for received Nothing item (but the client will still receive it).
fixed crash in SMClient when loosing connection to SNI
* fixed No Energy Item missing its ID
fixed Plando
* merge post fixes
* fixed start item Grapple, XRay and Reserve HUD, as well as graphic beams (except ice palette color)
* fixed freeze in blue brinstar caused by Varia's custom PLM not being filled with proper Multiworld PLM address (altLocsAddresses)
* fixed start item x-ray HUD display
* Fixed start items being sent by the server (is all handled in ROM)
Start items are now not removed from itempool anymore
Nothing Item is now local_items so no player will ever pickup Nothing. Doing so reduces contribution of this world to the Multiworld the more Nothing there is though.
Fixed crash (and possibly passing but broken) at generation where the static list of IPSPatches used by all SM worlds was being modified
* fixed settings that could be applied to any SM players
* fixed auth to server only using player name (now does as ALTTP to authenticate)
* - fixed End Credits broken text
* added non SM item name display
* added all supported SM options in playerSettings.yaml
* fixed locations needing a list of parent regions (now generate a region for each location with one-way exits to each (previously) parent region
did some cleaning (mainly reverts on unnecessary core classes
* minor setting fixes and tweaks
- merged Area and lightArea settings
- made missileQty, superQty and powerBombQty use value from 10 to 90 and divide value by float(10) when generating
- fixed inverted layoutPatch setting
* added option start_inventory_removes_from_pool
fixed option names formatting
fixed lint errors
small code and repo cleanup
* Hopefully fixed ROR2 that could not send any items
* - fixed missing required change to ROR2
* fixed 0 hp when respawning without having ever saved (start items were not updating the save checksum)
* fixed typo with doors_colors_rando
* fixed checksum
* added custom sprites for off-world items (progression or not)
the original AP sprite was made with PierRoulette's SM Item Sprite Utility by ijwu
* - added missing change following upstream merge
- changed patch filename extension from apbp to apm3 so patch can be used with the new client
* added morph placement options: early means local and sphere 1
* fixed failing unit tests
* - fixed broken custom_preset options
* - big cleanup to remove unnecessary or unsupported features
* - more cleanup
* - moved sm_randomizer_rom and all always applied patches into an external project that outputs basepatch.ips
- small cleanup
* - added comment to refer to project for generating basepatch.ips (https://github.com/lordlou/SMBasepatch)
* fixed g4_skip patch that can be not applied if hud is enabled
* - fixed off world sprite that can have broken graphics (restricted to use only first 2 palette)
* - updated basepatch to reflect g4_skip removal
- moved more asm files to SMBasepatch project
* - tourian grey doors at baby metroid are now always flashing (allowing to go back if needed)
* fixed wrong path if using built as exe
* - cleaned exposed maxDifficulty options
- removed always enabled Knows
* Merged LttPClient and SMClient into SNIClient
* added varia_custom Preset Option that fetch a preset (read from a new varia_custom_preset Option) from varia's web service
* small doc precision
* - added death_link support
- fixed broken Goal Completion
- post merge fix
* - removed now useless presets
* - fixed bad internal mapping with maxDiff
- increases maxDiff if only Bosses is preventing beating the game
* - added support for lowercase custom preset sections (knows, settings and controller)
- fixed controller settings not applying to ROM
* - fixed death loop when dying with Door rando, bomb or speed booster as starting items
- varia's backup save should now be usable (automatically enabled when doing door rando)
* -added docstring for generated yaml
* fixed bad merge
* fixed broken infinity max difficulty
* commented debug prints
* adjusted credits to mark progression speed and difficulty as Non Available
* added support for more than 255 players (will print Archipelago for higher player number)
* fixed missing cleanup
* added support for 65535 different player names in ROM
* fixed generations failing when only bosses are unreachable
* - replaced setting maxDiff to infinity with a bool only affecting boss logics if only bosses are left to finish
* fixed failling generations when using 'fun' settings
Accessibility checks are forced to 'items' if restricted locations are used by VARIA following usage of 'fun' settings
* fixed debug logger
* removed unsupported "suits_restriction" option
* fixed generations failing when only bosses are unreachable (using a less intrusive approach for AP)
* - fixed deathlink emptying reserves
- added death_link_survive option that lets player survive when receiving a deathlink if the have non-empty reserves
* - merged death_link and death_link_survive options
* fixed death_link
* added a fallback default starting location instead of failing generation if an invalid one was chosen
* added Nothing and NoEnergy as hint blacklist
added missing NoEnergy as local items and removed it from progression
* - enabled local item dialog boxes for dungeon and keycard items when keysanity is used
* - fixed ItemLink support
* fixed shops sending checks
* Added get_filler_item_name() returning a random junk item
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
											 
										 
										
											2022-07-16 13:47:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        state . smz3state [ self . player ] . Add ( [ TotalSMZ3Item . Item ( TotalSMZ3Item . ItemType [ item . name ] ,  self . smz3World  if  hasattr ( self ,  " smz3World " )  else  None ) ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        if  item . advancement : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            state . prog_items [ item . name ,  item . player ]  + =  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  True   # indicate that a logical state change has occured 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  False 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  remove ( self ,  state :  CollectionState ,  item :  Item )  - >  bool : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        name  =  self . collect_item ( state ,  item ,  True ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  name : 
							 
						 
					
						
							
								
									
										
											 
										
											
												SMZ3: Item link support (#756)
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* Fixed multiworld support patch not working with VariaRandomizer's
Added stage_fill_hook to set morph first in progitempool
Added back VariaRandomizer's standard patches
* + added missing files from variaRandomizer project
* + added missing variaRandomizer files (custom sprites)
+ started integrating VariaRandomizer options (WIP)
* Some fixes for player and server name display
- fixed player name of 16 characters reading too far in SM client
- fixed 12 bytes SM player name limit (now 16)
- fixed server name not being displayed in SM when using server cheat ( now displays RECEIVED FROM ARCHIPELAGO)
- request: temporarly changed default seed names displayed in SM main menu to OWTCH
* Fixed Goal completion not triggering in smClient
* integrated VariaRandomizer's options into AP (WIP)
- startAP is working
- door rando is working
- skillset is working
* - fixed itemsounds.ips crash by always including nofanfare.ips into multiworld.ips (itemsounds is now always applied and "itemsounds" preset must always be "off")
* skillset are now instanced per player instead of being a singleton class
* RomPatches are now instanced per player instead of being a singleton class
* DoorManager is now instanced per player instead of being a singleton class
* - fixed the last bugs that prevented generation of >1 SM world
* fixed crash when no skillset preset is specified in randoPreset (default to "casual")
* maxDifficulty support and itemsounds removal
- added support for maxDifficulty
- removed itemsounds patch as its always applied from multiworld patch for now
* Fixed bad merge
* Post merge adaptation
* fixed player name length fix that got lost with the merge
* fixed generation with other game type than SM
* added default randoPreset json for SM in playerSettings.yaml
* fixed broken SM client following merge
* beautified json skillset presets
* Fixed ArchipelagoSmClient not building
* Fixed conflict between mutliworld patch and beam_doors_plms patch
- doorsColorsRando now working
* SM generation now outputs APBP
- Fixed paths for patches and presets when frozen
* added missing file and fixed multithreading issue
* temporarily set data_version = 0
* more work
- added support for AP starting items
- fixed client crash with gamemode being None
- patch.py "compatible_version" is now 3
* commited missing asm files
fixed start item reserve breaking game (was using bad write offset when patching)
* Nothing item are now handled game-side. the game will now skip displaying a message box for received Nothing item (but the client will still receive it).
fixed crash in SMClient when loosing connection to SNI
* fixed No Energy Item missing its ID
fixed Plando
* merge post fixes
* fixed start item Grapple, XRay and Reserve HUD, as well as graphic beams (except ice palette color)
* fixed freeze in blue brinstar caused by Varia's custom PLM not being filled with proper Multiworld PLM address (altLocsAddresses)
* fixed start item x-ray HUD display
* Fixed start items being sent by the server (is all handled in ROM)
Start items are now not removed from itempool anymore
Nothing Item is now local_items so no player will ever pickup Nothing. Doing so reduces contribution of this world to the Multiworld the more Nothing there is though.
Fixed crash (and possibly passing but broken) at generation where the static list of IPSPatches used by all SM worlds was being modified
* fixed settings that could be applied to any SM players
* fixed auth to server only using player name (now does as ALTTP to authenticate)
* - fixed End Credits broken text
* added non SM item name display
* added all supported SM options in playerSettings.yaml
* fixed locations needing a list of parent regions (now generate a region for each location with one-way exits to each (previously) parent region
did some cleaning (mainly reverts on unnecessary core classes
* minor setting fixes and tweaks
- merged Area and lightArea settings
- made missileQty, superQty and powerBombQty use value from 10 to 90 and divide value by float(10) when generating
- fixed inverted layoutPatch setting
* added option start_inventory_removes_from_pool
fixed option names formatting
fixed lint errors
small code and repo cleanup
* Hopefully fixed ROR2 that could not send any items
* - fixed missing required change to ROR2
* fixed 0 hp when respawning without having ever saved (start items were not updating the save checksum)
* fixed typo with doors_colors_rando
* fixed checksum
* added custom sprites for off-world items (progression or not)
the original AP sprite was made with PierRoulette's SM Item Sprite Utility by ijwu
* - added missing change following upstream merge
- changed patch filename extension from apbp to apm3 so patch can be used with the new client
* added morph placement options: early means local and sphere 1
* fixed failing unit tests
* - fixed broken custom_preset options
* - big cleanup to remove unnecessary or unsupported features
* - more cleanup
* - moved sm_randomizer_rom and all always applied patches into an external project that outputs basepatch.ips
- small cleanup
* - added comment to refer to project for generating basepatch.ips (https://github.com/lordlou/SMBasepatch)
* fixed g4_skip patch that can be not applied if hud is enabled
* - fixed off world sprite that can have broken graphics (restricted to use only first 2 palette)
* - updated basepatch to reflect g4_skip removal
- moved more asm files to SMBasepatch project
* - tourian grey doors at baby metroid are now always flashing (allowing to go back if needed)
* fixed wrong path if using built as exe
* - cleaned exposed maxDifficulty options
- removed always enabled Knows
* Merged LttPClient and SMClient into SNIClient
* added varia_custom Preset Option that fetch a preset (read from a new varia_custom_preset Option) from varia's web service
* small doc precision
* - added death_link support
- fixed broken Goal Completion
- post merge fix
* - removed now useless presets
* - fixed bad internal mapping with maxDiff
- increases maxDiff if only Bosses is preventing beating the game
* - added support for lowercase custom preset sections (knows, settings and controller)
- fixed controller settings not applying to ROM
* - fixed death loop when dying with Door rando, bomb or speed booster as starting items
- varia's backup save should now be usable (automatically enabled when doing door rando)
* -added docstring for generated yaml
* fixed bad merge
* fixed broken infinity max difficulty
* commented debug prints
* adjusted credits to mark progression speed and difficulty as Non Available
* added support for more than 255 players (will print Archipelago for higher player number)
* fixed missing cleanup
* added support for 65535 different player names in ROM
* fixed generations failing when only bosses are unreachable
* - replaced setting maxDiff to infinity with a bool only affecting boss logics if only bosses are left to finish
* fixed failling generations when using 'fun' settings
Accessibility checks are forced to 'items' if restricted locations are used by VARIA following usage of 'fun' settings
* fixed debug logger
* removed unsupported "suits_restriction" option
* fixed generations failing when only bosses are unreachable (using a less intrusive approach for AP)
* - fixed deathlink emptying reserves
- added death_link_survive option that lets player survive when receiving a deathlink if the have non-empty reserves
* - merged death_link and death_link_survive options
* fixed death_link
* added a fallback default starting location instead of failing generation if an invalid one was chosen
* added Nothing and NoEnergy as hint blacklist
added missing NoEnergy as local items and removed it from progression
* - enabled local item dialog boxes for dungeon and keycard items when keysanity is used
* - fixed ItemLink support
* fixed shops sending checks
* Added get_filler_item_name() returning a random junk item
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
											 
										 
										
											2022-07-16 13:47:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            state . smz3state [ item . player ] . Remove ( [ TotalSMZ3Item . Item ( TotalSMZ3Item . ItemType [ item . name ] ,  self . smz3World  if  hasattr ( self ,  " smz3World " )  else  None ) ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            state . prog_items [ name ,  item . player ]  - =  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  state . prog_items [ name ,  item . player ]  <  1 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                del  ( state . prog_items [ name ,  item . player ] ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  True 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  False 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  create_item ( self ,  name :  str )  - >  Item : 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-11 02:59:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  SMZ3Item ( name , 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-31 05:08:41 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        ItemClassification . progression  if  SMZ3World . isProgression ( TotalSMZ3Item . ItemType [ name ] )  else  ItemClassification . filler , 
							 
						 
					
						
							
								
									
										
										
										
											2022-12-11 02:59:17 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        TotalSMZ3Item . ItemType [ name ] ,  self . item_name_to_id [ name ] , 
							 
						 
					
						
							
								
									
										
											 
										
											
												SMZ3: Item link support (#756)
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* Fixed multiworld support patch not working with VariaRandomizer's
Added stage_fill_hook to set morph first in progitempool
Added back VariaRandomizer's standard patches
* + added missing files from variaRandomizer project
* + added missing variaRandomizer files (custom sprites)
+ started integrating VariaRandomizer options (WIP)
* Some fixes for player and server name display
- fixed player name of 16 characters reading too far in SM client
- fixed 12 bytes SM player name limit (now 16)
- fixed server name not being displayed in SM when using server cheat ( now displays RECEIVED FROM ARCHIPELAGO)
- request: temporarly changed default seed names displayed in SM main menu to OWTCH
* Fixed Goal completion not triggering in smClient
* integrated VariaRandomizer's options into AP (WIP)
- startAP is working
- door rando is working
- skillset is working
* - fixed itemsounds.ips crash by always including nofanfare.ips into multiworld.ips (itemsounds is now always applied and "itemsounds" preset must always be "off")
* skillset are now instanced per player instead of being a singleton class
* RomPatches are now instanced per player instead of being a singleton class
* DoorManager is now instanced per player instead of being a singleton class
* - fixed the last bugs that prevented generation of >1 SM world
* fixed crash when no skillset preset is specified in randoPreset (default to "casual")
* maxDifficulty support and itemsounds removal
- added support for maxDifficulty
- removed itemsounds patch as its always applied from multiworld patch for now
* Fixed bad merge
* Post merge adaptation
* fixed player name length fix that got lost with the merge
* fixed generation with other game type than SM
* added default randoPreset json for SM in playerSettings.yaml
* fixed broken SM client following merge
* beautified json skillset presets
* Fixed ArchipelagoSmClient not building
* Fixed conflict between mutliworld patch and beam_doors_plms patch
- doorsColorsRando now working
* SM generation now outputs APBP
- Fixed paths for patches and presets when frozen
* added missing file and fixed multithreading issue
* temporarily set data_version = 0
* more work
- added support for AP starting items
- fixed client crash with gamemode being None
- patch.py "compatible_version" is now 3
* commited missing asm files
fixed start item reserve breaking game (was using bad write offset when patching)
* Nothing item are now handled game-side. the game will now skip displaying a message box for received Nothing item (but the client will still receive it).
fixed crash in SMClient when loosing connection to SNI
* fixed No Energy Item missing its ID
fixed Plando
* merge post fixes
* fixed start item Grapple, XRay and Reserve HUD, as well as graphic beams (except ice palette color)
* fixed freeze in blue brinstar caused by Varia's custom PLM not being filled with proper Multiworld PLM address (altLocsAddresses)
* fixed start item x-ray HUD display
* Fixed start items being sent by the server (is all handled in ROM)
Start items are now not removed from itempool anymore
Nothing Item is now local_items so no player will ever pickup Nothing. Doing so reduces contribution of this world to the Multiworld the more Nothing there is though.
Fixed crash (and possibly passing but broken) at generation where the static list of IPSPatches used by all SM worlds was being modified
* fixed settings that could be applied to any SM players
* fixed auth to server only using player name (now does as ALTTP to authenticate)
* - fixed End Credits broken text
* added non SM item name display
* added all supported SM options in playerSettings.yaml
* fixed locations needing a list of parent regions (now generate a region for each location with one-way exits to each (previously) parent region
did some cleaning (mainly reverts on unnecessary core classes
* minor setting fixes and tweaks
- merged Area and lightArea settings
- made missileQty, superQty and powerBombQty use value from 10 to 90 and divide value by float(10) when generating
- fixed inverted layoutPatch setting
* added option start_inventory_removes_from_pool
fixed option names formatting
fixed lint errors
small code and repo cleanup
* Hopefully fixed ROR2 that could not send any items
* - fixed missing required change to ROR2
* fixed 0 hp when respawning without having ever saved (start items were not updating the save checksum)
* fixed typo with doors_colors_rando
* fixed checksum
* added custom sprites for off-world items (progression or not)
the original AP sprite was made with PierRoulette's SM Item Sprite Utility by ijwu
* - added missing change following upstream merge
- changed patch filename extension from apbp to apm3 so patch can be used with the new client
* added morph placement options: early means local and sphere 1
* fixed failing unit tests
* - fixed broken custom_preset options
* - big cleanup to remove unnecessary or unsupported features
* - more cleanup
* - moved sm_randomizer_rom and all always applied patches into an external project that outputs basepatch.ips
- small cleanup
* - added comment to refer to project for generating basepatch.ips (https://github.com/lordlou/SMBasepatch)
* fixed g4_skip patch that can be not applied if hud is enabled
* - fixed off world sprite that can have broken graphics (restricted to use only first 2 palette)
* - updated basepatch to reflect g4_skip removal
- moved more asm files to SMBasepatch project
* - tourian grey doors at baby metroid are now always flashing (allowing to go back if needed)
* fixed wrong path if using built as exe
* - cleaned exposed maxDifficulty options
- removed always enabled Knows
* Merged LttPClient and SMClient into SNIClient
* added varia_custom Preset Option that fetch a preset (read from a new varia_custom_preset Option) from varia's web service
* small doc precision
* - added death_link support
- fixed broken Goal Completion
- post merge fix
* - removed now useless presets
* - fixed bad internal mapping with maxDiff
- increases maxDiff if only Bosses is preventing beating the game
* - added support for lowercase custom preset sections (knows, settings and controller)
- fixed controller settings not applying to ROM
* - fixed death loop when dying with Door rando, bomb or speed booster as starting items
- varia's backup save should now be usable (automatically enabled when doing door rando)
* -added docstring for generated yaml
* fixed bad merge
* fixed broken infinity max difficulty
* commented debug prints
* adjusted credits to mark progression speed and difficulty as Non Available
* added support for more than 255 players (will print Archipelago for higher player number)
* fixed missing cleanup
* added support for 65535 different player names in ROM
* fixed generations failing when only bosses are unreachable
* - replaced setting maxDiff to infinity with a bool only affecting boss logics if only bosses are left to finish
* fixed failling generations when using 'fun' settings
Accessibility checks are forced to 'items' if restricted locations are used by VARIA following usage of 'fun' settings
* fixed debug logger
* removed unsupported "suits_restriction" option
* fixed generations failing when only bosses are unreachable (using a less intrusive approach for AP)
* - fixed deathlink emptying reserves
- added death_link_survive option that lets player survive when receiving a deathlink if the have non-empty reserves
* - merged death_link and death_link_survive options
* fixed death_link
* added a fallback default starting location instead of failing generation if an invalid one was chosen
* added Nothing and NoEnergy as hint blacklist
added missing NoEnergy as local items and removed it from progression
* - enabled local item dialog boxes for dungeon and keycard items when keysanity is used
* - fixed ItemLink support
* fixed shops sending checks
* Added get_filler_item_name() returning a random junk item
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
											 
										 
										
											2022-07-16 13:47:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        self . player , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        TotalSMZ3Item . Item ( TotalSMZ3Item . ItemType [ name ] ,  self ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  pre_fill ( self ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        from  Fill  import  fill_restrictive 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . InitialFillInOwnWorld ( ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( not  self . smz3World . Config . Keysanity ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            locations  =  [ loc  for  loc  in  self . locations . values ( )  if  loc . item  is  None ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            self . multiworld . random . shuffle ( locations ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            all_state  =  self . multiworld . get_all_state ( False ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            for  item  in  self . smz3DungeonItems : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                all_state . remove ( item ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            all_dungeonItems  =  self . smz3DungeonItems [ : ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            fill_restrictive ( self . multiworld ,  all_state ,  locations ,  all_dungeonItems ,  True ,  True ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        self . JunkFillGT ( 0.5 ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  get_pre_fill_items ( self ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( not  self . smz3World . Config . Keysanity ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  self . smz3DungeonItems 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            return  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-13 18:40:55 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-02-06 21:14:03 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    def  post_fill ( self ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # some small or big keys (those always_allow) can be unreachable in-game 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # while logic still collects some of them (probably to simulate the player collecting pot keys in the logic), some others don't 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # so we need to remove those exceptions as progression items 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  self . multiworld . accessibility [ self . player ]  ==  ' items ' : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            state  =  CollectionState ( self . multiworld ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            locs  =  [ self . multiworld . get_location ( " Swamp Palace - Big Chest " ,  self . player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   self . multiworld . get_location ( " Skull Woods - Big Chest " ,  self . player ) , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                   self . multiworld . get_location ( " Tower of Hera - Big Key Chest " ,  self . player ) ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  loc  in  locs : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  ( loc . item . player  ==  self . player  and  loc . always_allow ( state ,  loc . item ) ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    loc . item . classification  =  ItemClassification . filler 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    loc . item . item . Progression  =  False 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    loc . item . location . event  =  False 
							 
						 
					
						
							
								
									
										
										
										
											2023-03-13 18:40:55 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    self . unreachable . append ( loc ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												SMZ3: Item link support (#756)
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* Fixed multiworld support patch not working with VariaRandomizer's
Added stage_fill_hook to set morph first in progitempool
Added back VariaRandomizer's standard patches
* + added missing files from variaRandomizer project
* + added missing variaRandomizer files (custom sprites)
+ started integrating VariaRandomizer options (WIP)
* Some fixes for player and server name display
- fixed player name of 16 characters reading too far in SM client
- fixed 12 bytes SM player name limit (now 16)
- fixed server name not being displayed in SM when using server cheat ( now displays RECEIVED FROM ARCHIPELAGO)
- request: temporarly changed default seed names displayed in SM main menu to OWTCH
* Fixed Goal completion not triggering in smClient
* integrated VariaRandomizer's options into AP (WIP)
- startAP is working
- door rando is working
- skillset is working
* - fixed itemsounds.ips crash by always including nofanfare.ips into multiworld.ips (itemsounds is now always applied and "itemsounds" preset must always be "off")
* skillset are now instanced per player instead of being a singleton class
* RomPatches are now instanced per player instead of being a singleton class
* DoorManager is now instanced per player instead of being a singleton class
* - fixed the last bugs that prevented generation of >1 SM world
* fixed crash when no skillset preset is specified in randoPreset (default to "casual")
* maxDifficulty support and itemsounds removal
- added support for maxDifficulty
- removed itemsounds patch as its always applied from multiworld patch for now
* Fixed bad merge
* Post merge adaptation
* fixed player name length fix that got lost with the merge
* fixed generation with other game type than SM
* added default randoPreset json for SM in playerSettings.yaml
* fixed broken SM client following merge
* beautified json skillset presets
* Fixed ArchipelagoSmClient not building
* Fixed conflict between mutliworld patch and beam_doors_plms patch
- doorsColorsRando now working
* SM generation now outputs APBP
- Fixed paths for patches and presets when frozen
* added missing file and fixed multithreading issue
* temporarily set data_version = 0
* more work
- added support for AP starting items
- fixed client crash with gamemode being None
- patch.py "compatible_version" is now 3
* commited missing asm files
fixed start item reserve breaking game (was using bad write offset when patching)
* Nothing item are now handled game-side. the game will now skip displaying a message box for received Nothing item (but the client will still receive it).
fixed crash in SMClient when loosing connection to SNI
* fixed No Energy Item missing its ID
fixed Plando
* merge post fixes
* fixed start item Grapple, XRay and Reserve HUD, as well as graphic beams (except ice palette color)
* fixed freeze in blue brinstar caused by Varia's custom PLM not being filled with proper Multiworld PLM address (altLocsAddresses)
* fixed start item x-ray HUD display
* Fixed start items being sent by the server (is all handled in ROM)
Start items are now not removed from itempool anymore
Nothing Item is now local_items so no player will ever pickup Nothing. Doing so reduces contribution of this world to the Multiworld the more Nothing there is though.
Fixed crash (and possibly passing but broken) at generation where the static list of IPSPatches used by all SM worlds was being modified
* fixed settings that could be applied to any SM players
* fixed auth to server only using player name (now does as ALTTP to authenticate)
* - fixed End Credits broken text
* added non SM item name display
* added all supported SM options in playerSettings.yaml
* fixed locations needing a list of parent regions (now generate a region for each location with one-way exits to each (previously) parent region
did some cleaning (mainly reverts on unnecessary core classes
* minor setting fixes and tweaks
- merged Area and lightArea settings
- made missileQty, superQty and powerBombQty use value from 10 to 90 and divide value by float(10) when generating
- fixed inverted layoutPatch setting
* added option start_inventory_removes_from_pool
fixed option names formatting
fixed lint errors
small code and repo cleanup
* Hopefully fixed ROR2 that could not send any items
* - fixed missing required change to ROR2
* fixed 0 hp when respawning without having ever saved (start items were not updating the save checksum)
* fixed typo with doors_colors_rando
* fixed checksum
* added custom sprites for off-world items (progression or not)
the original AP sprite was made with PierRoulette's SM Item Sprite Utility by ijwu
* - added missing change following upstream merge
- changed patch filename extension from apbp to apm3 so patch can be used with the new client
* added morph placement options: early means local and sphere 1
* fixed failing unit tests
* - fixed broken custom_preset options
* - big cleanup to remove unnecessary or unsupported features
* - more cleanup
* - moved sm_randomizer_rom and all always applied patches into an external project that outputs basepatch.ips
- small cleanup
* - added comment to refer to project for generating basepatch.ips (https://github.com/lordlou/SMBasepatch)
* fixed g4_skip patch that can be not applied if hud is enabled
* - fixed off world sprite that can have broken graphics (restricted to use only first 2 palette)
* - updated basepatch to reflect g4_skip removal
- moved more asm files to SMBasepatch project
* - tourian grey doors at baby metroid are now always flashing (allowing to go back if needed)
* fixed wrong path if using built as exe
* - cleaned exposed maxDifficulty options
- removed always enabled Knows
* Merged LttPClient and SMClient into SNIClient
* added varia_custom Preset Option that fetch a preset (read from a new varia_custom_preset Option) from varia's web service
* small doc precision
* - added death_link support
- fixed broken Goal Completion
- post merge fix
* - removed now useless presets
* - fixed bad internal mapping with maxDiff
- increases maxDiff if only Bosses is preventing beating the game
* - added support for lowercase custom preset sections (knows, settings and controller)
- fixed controller settings not applying to ROM
* - fixed death loop when dying with Door rando, bomb or speed booster as starting items
- varia's backup save should now be usable (automatically enabled when doing door rando)
* -added docstring for generated yaml
* fixed bad merge
* fixed broken infinity max difficulty
* commented debug prints
* adjusted credits to mark progression speed and difficulty as Non Available
* added support for more than 255 players (will print Archipelago for higher player number)
* fixed missing cleanup
* added support for 65535 different player names in ROM
* fixed generations failing when only bosses are unreachable
* - replaced setting maxDiff to infinity with a bool only affecting boss logics if only bosses are left to finish
* fixed failling generations when using 'fun' settings
Accessibility checks are forced to 'items' if restricted locations are used by VARIA following usage of 'fun' settings
* fixed debug logger
* removed unsupported "suits_restriction" option
* fixed generations failing when only bosses are unreachable (using a less intrusive approach for AP)
* - fixed deathlink emptying reserves
- added death_link_survive option that lets player survive when receiving a deathlink if the have non-empty reserves
* - merged death_link and death_link_survive options
* fixed death_link
* added a fallback default starting location instead of failing generation if an invalid one was chosen
* added Nothing and NoEnergy as hint blacklist
added missing NoEnergy as local items and removed it from progression
* - enabled local item dialog boxes for dungeon and keycard items when keysanity is used
* - fixed ItemLink support
* fixed shops sending checks
* Added get_filler_item_name() returning a random junk item
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
											 
										 
										
											2022-07-16 13:47:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    def  get_filler_item_name ( self )  - >  str : 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        return  self . multiworld . random . choice ( self . junkItemsNames ) 
							 
						 
					
						
							
								
									
										
											 
										
											
												SMZ3: Item link support (#756)
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* Fixed multiworld support patch not working with VariaRandomizer's
Added stage_fill_hook to set morph first in progitempool
Added back VariaRandomizer's standard patches
* + added missing files from variaRandomizer project
* + added missing variaRandomizer files (custom sprites)
+ started integrating VariaRandomizer options (WIP)
* Some fixes for player and server name display
- fixed player name of 16 characters reading too far in SM client
- fixed 12 bytes SM player name limit (now 16)
- fixed server name not being displayed in SM when using server cheat ( now displays RECEIVED FROM ARCHIPELAGO)
- request: temporarly changed default seed names displayed in SM main menu to OWTCH
* Fixed Goal completion not triggering in smClient
* integrated VariaRandomizer's options into AP (WIP)
- startAP is working
- door rando is working
- skillset is working
* - fixed itemsounds.ips crash by always including nofanfare.ips into multiworld.ips (itemsounds is now always applied and "itemsounds" preset must always be "off")
* skillset are now instanced per player instead of being a singleton class
* RomPatches are now instanced per player instead of being a singleton class
* DoorManager is now instanced per player instead of being a singleton class
* - fixed the last bugs that prevented generation of >1 SM world
* fixed crash when no skillset preset is specified in randoPreset (default to "casual")
* maxDifficulty support and itemsounds removal
- added support for maxDifficulty
- removed itemsounds patch as its always applied from multiworld patch for now
* Fixed bad merge
* Post merge adaptation
* fixed player name length fix that got lost with the merge
* fixed generation with other game type than SM
* added default randoPreset json for SM in playerSettings.yaml
* fixed broken SM client following merge
* beautified json skillset presets
* Fixed ArchipelagoSmClient not building
* Fixed conflict between mutliworld patch and beam_doors_plms patch
- doorsColorsRando now working
* SM generation now outputs APBP
- Fixed paths for patches and presets when frozen
* added missing file and fixed multithreading issue
* temporarily set data_version = 0
* more work
- added support for AP starting items
- fixed client crash with gamemode being None
- patch.py "compatible_version" is now 3
* commited missing asm files
fixed start item reserve breaking game (was using bad write offset when patching)
* Nothing item are now handled game-side. the game will now skip displaying a message box for received Nothing item (but the client will still receive it).
fixed crash in SMClient when loosing connection to SNI
* fixed No Energy Item missing its ID
fixed Plando
* merge post fixes
* fixed start item Grapple, XRay and Reserve HUD, as well as graphic beams (except ice palette color)
* fixed freeze in blue brinstar caused by Varia's custom PLM not being filled with proper Multiworld PLM address (altLocsAddresses)
* fixed start item x-ray HUD display
* Fixed start items being sent by the server (is all handled in ROM)
Start items are now not removed from itempool anymore
Nothing Item is now local_items so no player will ever pickup Nothing. Doing so reduces contribution of this world to the Multiworld the more Nothing there is though.
Fixed crash (and possibly passing but broken) at generation where the static list of IPSPatches used by all SM worlds was being modified
* fixed settings that could be applied to any SM players
* fixed auth to server only using player name (now does as ALTTP to authenticate)
* - fixed End Credits broken text
* added non SM item name display
* added all supported SM options in playerSettings.yaml
* fixed locations needing a list of parent regions (now generate a region for each location with one-way exits to each (previously) parent region
did some cleaning (mainly reverts on unnecessary core classes
* minor setting fixes and tweaks
- merged Area and lightArea settings
- made missileQty, superQty and powerBombQty use value from 10 to 90 and divide value by float(10) when generating
- fixed inverted layoutPatch setting
* added option start_inventory_removes_from_pool
fixed option names formatting
fixed lint errors
small code and repo cleanup
* Hopefully fixed ROR2 that could not send any items
* - fixed missing required change to ROR2
* fixed 0 hp when respawning without having ever saved (start items were not updating the save checksum)
* fixed typo with doors_colors_rando
* fixed checksum
* added custom sprites for off-world items (progression or not)
the original AP sprite was made with PierRoulette's SM Item Sprite Utility by ijwu
* - added missing change following upstream merge
- changed patch filename extension from apbp to apm3 so patch can be used with the new client
* added morph placement options: early means local and sphere 1
* fixed failing unit tests
* - fixed broken custom_preset options
* - big cleanup to remove unnecessary or unsupported features
* - more cleanup
* - moved sm_randomizer_rom and all always applied patches into an external project that outputs basepatch.ips
- small cleanup
* - added comment to refer to project for generating basepatch.ips (https://github.com/lordlou/SMBasepatch)
* fixed g4_skip patch that can be not applied if hud is enabled
* - fixed off world sprite that can have broken graphics (restricted to use only first 2 palette)
* - updated basepatch to reflect g4_skip removal
- moved more asm files to SMBasepatch project
* - tourian grey doors at baby metroid are now always flashing (allowing to go back if needed)
* fixed wrong path if using built as exe
* - cleaned exposed maxDifficulty options
- removed always enabled Knows
* Merged LttPClient and SMClient into SNIClient
* added varia_custom Preset Option that fetch a preset (read from a new varia_custom_preset Option) from varia's web service
* small doc precision
* - added death_link support
- fixed broken Goal Completion
- post merge fix
* - removed now useless presets
* - fixed bad internal mapping with maxDiff
- increases maxDiff if only Bosses is preventing beating the game
* - added support for lowercase custom preset sections (knows, settings and controller)
- fixed controller settings not applying to ROM
* - fixed death loop when dying with Door rando, bomb or speed booster as starting items
- varia's backup save should now be usable (automatically enabled when doing door rando)
* -added docstring for generated yaml
* fixed bad merge
* fixed broken infinity max difficulty
* commented debug prints
* adjusted credits to mark progression speed and difficulty as Non Available
* added support for more than 255 players (will print Archipelago for higher player number)
* fixed missing cleanup
* added support for 65535 different player names in ROM
* fixed generations failing when only bosses are unreachable
* - replaced setting maxDiff to infinity with a bool only affecting boss logics if only bosses are left to finish
* fixed failling generations when using 'fun' settings
Accessibility checks are forced to 'items' if restricted locations are used by VARIA following usage of 'fun' settings
* fixed debug logger
* removed unsupported "suits_restriction" option
* fixed generations failing when only bosses are unreachable (using a less intrusive approach for AP)
* - fixed deathlink emptying reserves
- added death_link_survive option that lets player survive when receiving a deathlink if the have non-empty reserves
* - merged death_link and death_link_survive options
* fixed death_link
* added a fallback default starting location instead of failing generation if an invalid one was chosen
* added Nothing and NoEnergy as hint blacklist
added missing NoEnergy as local items and removed it from progression
* - enabled local item dialog boxes for dungeon and keycard items when keysanity is used
* - fixed ItemLink support
* fixed shops sending checks
* Added get_filler_item_name() returning a random junk item
Co-authored-by: Fabian Dill <Berserker66@users.noreply.github.com>
											 
										 
										
											2022-07-16 13:47:26 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    def  write_spoiler ( self ,  spoiler_handle :  TextIO ) : 
							 
						 
					
						
							
								
									
										
											 
										
											
												SMZ3: completion condition fix and more info in spoiler (#1133)
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* first working (most of the time) progression generation for SM using VariaRandomizer's rules, items, locations and accessPoint (as regions)
* first working single-world randomized SM rom patches
* - SM now displays message when getting an item outside for someone else (fills ROM item table)
This is dependant on modifications done to sm_randomizer_rom project
* First working MultiWorld SM
* some missing things:
- player name inject in ROM and get in client
- end game get from ROM in client
- send self item to server
- add player names table in ROM
* replaced CollectionState inheritance from SMBoolManager with a composition of an array of it (required to generation more than one SM world, which is still fails but is better)
* - reenabled balancing
* post rebase fixes
* updated SmClient.py
* + added VariaRandomizer LICENSE
* + added sm_randomizer_rom project (which builds sm.ips)
* Moved VariaRandomizer and sm_randomizer_rom projects inside worlds/sm and done some cleaning
* properly revert change made to CollectionState and more cleaning
* Fixed multiworld support patch not working with VariaRandomizer's
* missing file commit
* Fixed syntax error in unused code to satisfy Linter
* Revert "Fixed multiworld support patch not working with VariaRandomizer's"
This reverts commit fb3ca18528bb331995e3d3051648c8f84d04c08b.
* many fixes and improovement
- fixed seeded generation
- fixed broken logic when more than one SM world
- added missing rules for inter-area transitions
- added basic patch presence for logic
- added DoorManager init call to reflect present patches for logic
- moved CollectionState addition out of BaseClasses into SM world
- added condition to apply progitempool presorting only if SM world is present
- set Bosses item id to None to prevent them going into multidata
- now use get_game_players
* Fixed multiworld support patch not working with VariaRandomizer's
Added stage_fill_hook to set morph first in progitempool
Added back VariaRandomizer's standard patches
* + added missing files from variaRandomizer project
* + added missing variaRandomizer files (custom sprites)
+ started integrating VariaRandomizer options (WIP)
* Some fixes for player and server name display
- fixed player name of 16 characters reading too far in SM client
- fixed 12 bytes SM player name limit (now 16)
- fixed server name not being displayed in SM when using server cheat ( now displays RECEIVED FROM ARCHIPELAGO)
- request: temporarly changed default seed names displayed in SM main menu to OWTCH
* Fixed Goal completion not triggering in smClient
* integrated VariaRandomizer's options into AP (WIP)
- startAP is working
- door rando is working
- skillset is working
* - fixed itemsounds.ips crash by always including nofanfare.ips into multiworld.ips (itemsounds is now always applied and "itemsounds" preset must always be "off")
* skillset are now instanced per player instead of being a singleton class
* RomPatches are now instanced per player instead of being a singleton class
* DoorManager is now instanced per player instead of being a singleton class
* - fixed the last bugs that prevented generation of >1 SM world
* fixed crash when no skillset preset is specified in randoPreset (default to "casual")
* maxDifficulty support and itemsounds removal
- added support for maxDifficulty
- removed itemsounds patch as its always applied from multiworld patch for now
* Fixed bad merge
* Post merge adaptation
* fixed player name length fix that got lost with the merge
* fixed generation with other game type than SM
* added default randoPreset json for SM in playerSettings.yaml
* fixed broken SM client following merge
* beautified json skillset presets
* Fixed ArchipelagoSmClient not building
* Fixed conflict between mutliworld patch and beam_doors_plms patch
- doorsColorsRando now working
* SM generation now outputs APBP
- Fixed paths for patches and presets when frozen
* added missing file and fixed multithreading issue
* temporarily set data_version = 0
* more work
- added support for AP starting items
- fixed client crash with gamemode being None
- patch.py "compatible_version" is now 3
* commited missing asm files
fixed start item reserve breaking game (was using bad write offset when patching)
* Nothing item are now handled game-side. the game will now skip displaying a message box for received Nothing item (but the client will still receive it).
fixed crash in SMClient when loosing connection to SNI
* fixed No Energy Item missing its ID
fixed Plando
* merge post fixes
* fixed start item Grapple, XRay and Reserve HUD, as well as graphic beams (except ice palette color)
* fixed freeze in blue brinstar caused by Varia's custom PLM not being filled with proper Multiworld PLM address (altLocsAddresses)
* fixed start item x-ray HUD display
* Fixed start items being sent by the server (is all handled in ROM)
Start items are now not removed from itempool anymore
Nothing Item is now local_items so no player will ever pickup Nothing. Doing so reduces contribution of this world to the Multiworld the more Nothing there is though.
Fixed crash (and possibly passing but broken) at generation where the static list of IPSPatches used by all SM worlds was being modified
* fixed settings that could be applied to any SM players
* fixed auth to server only using player name (now does as ALTTP to authenticate)
* - fixed End Credits broken text
* added non SM item name display
* added all supported SM options in playerSettings.yaml
* fixed locations needing a list of parent regions (now generate a region for each location with one-way exits to each (previously) parent region
did some cleaning (mainly reverts on unnecessary core classes
* minor setting fixes and tweaks
- merged Area and lightArea settings
- made missileQty, superQty and powerBombQty use value from 10 to 90 and divide value by float(10) when generating
- fixed inverted layoutPatch setting
* added option start_inventory_removes_from_pool
fixed option names formatting
fixed lint errors
small code and repo cleanup
* Hopefully fixed ROR2 that could not send any items
* - fixed missing required change to ROR2
* fixed 0 hp when respawning without having ever saved (start items were not updating the save checksum)
* fixed typo with doors_colors_rando
* fixed checksum
* added custom sprites for off-world items (progression or not)
the original AP sprite was made with PierRoulette's SM Item Sprite Utility by ijwu
* - added missing change following upstream merge
- changed patch filename extension from apbp to apm3 so patch can be used with the new client
* added morph placement options: early means local and sphere 1
* fixed failing unit tests
* - fixed broken custom_preset options
* - big cleanup to remove unnecessary or unsupported features
* - more cleanup
* - moved sm_randomizer_rom and all always applied patches into an external project that outputs basepatch.ips
- small cleanup
* - added comment to refer to project for generating basepatch.ips (https://github.com/lordlou/SMBasepatch)
* fixed g4_skip patch that can be not applied if hud is enabled
* - fixed off world sprite that can have broken graphics (restricted to use only first 2 palette)
* - updated basepatch to reflect g4_skip removal
- moved more asm files to SMBasepatch project
* - tourian grey doors at baby metroid are now always flashing (allowing to go back if needed)
* fixed wrong path if using built as exe
* - cleaned exposed maxDifficulty options
- removed always enabled Knows
* Merged LttPClient and SMClient into SNIClient
* added varia_custom Preset Option that fetch a preset (read from a new varia_custom_preset Option) from varia's web service
* small doc precision
* - added death_link support
- fixed broken Goal Completion
- post merge fix
* - removed now useless presets
* - fixed bad internal mapping with maxDiff
- increases maxDiff if only Bosses is preventing beating the game
* - added support for lowercase custom preset sections (knows, settings and controller)
- fixed controller settings not applying to ROM
* - fixed death loop when dying with Door rando, bomb or speed booster as starting items
- varia's backup save should now be usable (automatically enabled when doing door rando)
* -added docstring for generated yaml
* fixed bad merge
* fixed broken infinity max difficulty
* commented debug prints
* adjusted credits to mark progression speed and difficulty as Non Available
* added support for more than 255 players (will print Archipelago for higher player number)
* fixed missing cleanup
* added support for 65535 different player names in ROM
* fixed generations failing when only bosses are unreachable
* - replaced setting maxDiff to infinity with a bool only affecting boss logics if only bosses are left to finish
* fixed failling generations when using 'fun' settings
Accessibility checks are forced to 'items' if restricted locations are used by VARIA following usage of 'fun' settings
* fixed debug logger
* removed unsupported "suits_restriction" option
* fixed generations failing when only bosses are unreachable (using a less intrusive approach for AP)
* - fixed deathlink emptying reserves
- added death_link_survive option that lets player survive when receiving a deathlink if the have non-empty reserves
* - merged death_link and death_link_survive options
* fixed death_link
* added a fallback default starting location instead of failing generation if an invalid one was chosen
* added Nothing and NoEnergy as hint blacklist
added missing NoEnergy as local items and removed it from progression
* added missing completion_condition when TowerCrystals is lower than GanonCrystals
added Rewards and Medallions infos to spoiler
* Update worlds/smz3/__init__.py
Yes, indeed. Thank you!
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
Co-authored-by: Doug Hoskisson <beauxq@users.noreply.github.com>
Co-authored-by: Zach Parks <zach@alliware.com>
											 
										 
										
											2022-11-01 15:52:04 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        self . multiworld . spoiler . unreachables . update ( self . unreachable ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        player_name  =  f ' { self . multiworld . get_player_name ( self . player ) } :  '  if  self . multiworld . players  >  1  else  ' ' 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        spoiler_handle . write ( ' \n \n Rewards: \n \n ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        spoiler_handle . write ( ' \n ' . join ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            f " { player_name } { region . Name } :  { region . Reward . name } " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  region  in  self . smz3World . Regions 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  isinstance ( region ,  IReward ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        spoiler_handle . write ( ' \n \n Medallions: \n \n ' ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        spoiler_handle . write ( ' \n ' . join ( [ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            f " { player_name } { region . Name } :  { region . Medallion . name } " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  region  in  self . smz3World . Regions 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            if  isinstance ( region ,  IMedallionAccess ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        ] ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    def  JunkFillGT ( self ,  factor ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        poolLength  =  len ( self . multiworld . itempool ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        playerGroups  =  self . multiworld . get_player_groups ( self . player ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-09-03 15:25:55 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        playerGroups . add ( self . player ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        junkPoolIdx  =  [ i  for  i  in  range ( 0 ,  poolLength ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  self . multiworld . itempool [ i ] . classification  in  ( ItemClassification . filler ,  ItemClassification . trap )  and 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    self . multiworld . itempool [ i ] . player  in  playerGroups ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        toRemove  =  [ ] 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-28 06:04:48 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        for  loc  in  self . locations . values ( ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            # commenting this for now since doing a partial GT pre fill would allow for non SMZ3 progression in GT 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # which isnt desirable (SMZ3 logic only filters for SMZ3 items). Having progression in GT can only happen in Single Player. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            # if len(toRemove) >= int(len(self.locationNamesGT) * factor * self.smz3World.TowerCrystals / 7): 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            #     break 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-28 06:04:48 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            if  loc . name  in  self . locationNamesGT  and  loc . item  is  None : 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                poolLength  =  len ( junkPoolIdx ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-28 06:04:48 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                # start looking at a random starting index and loop at start if no match found 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                start  =  self . multiworld . random . randint ( 0 ,  poolLength ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-04 01:49:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                for  off  in  range ( 0 ,  poolLength ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    i  =  ( start  +  off )  %  poolLength 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    candidate  =  self . multiworld . itempool [ junkPoolIdx [ i ] ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                    if  junkPoolIdx [ i ]  not  in  toRemove  and  loc . can_fill ( self . multiworld . state ,  candidate ,  False ) : 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        itemFromPool  =  candidate 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                        toRemove . append ( junkPoolIdx [ i ] ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-28 06:04:48 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                        break 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                self . multiworld . push_item ( loc ,  itemFromPool ,  False ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-07-28 06:04:48 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                loc . event  =  False 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        toRemove . sort ( reverse  =  True ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  i  in  toRemove :  
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            self . multiworld . itempool . pop ( i ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    def  FillItemAtLocation ( self ,  itemPool ,  itemType ,  location ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itemToPlace  =  TotalSMZ3Item . Item . Get ( itemPool ,  itemType ,  self . smz3World ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  ( itemToPlace  ==  None ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            raise  Exception ( f " Tried to place item  { itemType }  at  { location . Name } , but there is no such item in the item pool " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            location . Item  =  itemToPlace 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            itemFromPool  =  next ( ( i  for  i  in  self . multiworld . itempool  if  i . player  ==  self . player  and  i . name  ==  itemToPlace . Type . name ) ,  None ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            if  itemFromPool  is  not  None : 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                self . multiworld . get_location ( location . Name ,  self . player ) . place_locked_item ( itemFromPool ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                self . multiworld . itempool . remove ( itemFromPool ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								            else : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                itemFromPool  =  next ( ( i  for  i  in  self . smz3DungeonItems  if  i . player  ==  self . player  and  i . name  ==  itemToPlace . Type . name ) ,  None ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                if  itemFromPool  is  not  None : 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								                    self . multiworld . get_location ( location . Name ,  self . player ) . place_locked_item ( itemFromPool ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								                    self . smz3DungeonItems . remove ( itemFromPool ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        itemPool . remove ( itemToPlace ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  FrontFillItemInOwnWorld ( self ,  itemPool ,  itemType ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        item  =  TotalSMZ3Item . Item . Get ( itemPool ,  itemType ,  self . smz3World ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        location  =  next ( iter ( self . multiworld . random . sample ( TotalSMZ3Location . AvailableGlobal ( TotalSMZ3Location . Empty ( self . smz3World . Locations ) ,  self . smz3World . Items ( ) ) ,  1 ) ) ,  None ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        if  ( location  ==  None ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            raise  Exception ( f " Tried to front fill  { item . Name }  in, but no location was available " ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        location . Item  =  item 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        itemFromPool  =  next ( ( i  for  i  in  self . multiworld . itempool  if  i . player  ==  self . player  and  i . name  ==  item . Type . name  and  i . advancement  ==  item . Progression ) ,  None ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        if  itemFromPool  is  not  None : 
							 
						 
					
						
							
								
									
										
										
										
											2022-10-31 21:41:21 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								            self . multiworld . get_location ( location . Name ,  self . player ) . place_locked_item ( itemFromPool ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . multiworld . itempool . remove ( itemFromPool ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        itemPool . remove ( item ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  InitialFillInOwnWorld ( self ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . FillItemAtLocation ( self . dungeon ,  TotalSMZ3Item . ItemType . KeySW ,  self . smz3World . GetLocation ( " Skull Woods - Pinball Room " ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-15 10:48:13 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        if  ( not  self . smz3World . Config . Keysanity ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . FillItemAtLocation ( self . dungeon ,  TotalSMZ3Item . ItemType . KeySP ,  self . smz3World . GetLocation ( " Swamp Palace - Entrance " ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # /* Check Swords option and place as needed */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  self . smz3World . Config . SwordLocation  ==  SwordLocation . Uncle : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . FillItemAtLocation ( self . progression ,  TotalSMZ3Item . ItemType . ProgressiveSword ,  self . smz3World . GetLocation ( " Link ' s Uncle " ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        # /* Check Morph option and place as needed */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  self . smz3World . Config . MorphLocation  ==  MorphLocation . Original : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . FillItemAtLocation ( self . progression ,  TotalSMZ3Item . ItemType . Morph ,  self . smz3World . GetLocation ( " Morphing Ball " ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        elif  self . smz3World . Config . MorphLocation  ==  MorphLocation . Early : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . FrontFillItemInOwnWorld ( self . progression ,  TotalSMZ3Item . ItemType . Morph ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-19 09:02:39 -04:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        # We do early Sword placement after Morph in case its Original location 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  self . smz3World . Config . SwordLocation  ==  SwordLocation . Early : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . FrontFillItemInOwnWorld ( self . progression ,  TotalSMZ3Item . ItemType . ProgressiveSword ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        # /* We place a PB and Super in Sphere 1 to make sure the filler 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #    * doesn't start locking items behind this when there are a 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        #    * high chance of the trash fill actually making them available */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . FrontFillItemInOwnWorld ( self . progression ,  TotalSMZ3Item . ItemType . Super ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . FrontFillItemInOwnWorld ( self . progression ,  TotalSMZ3Item . ItemType . PowerBomb ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  create_locations ( self ,  player :  int ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        for  name ,  id  in  SMZ3World . location_name_to_id . items ( ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            newLoc  =  SMZ3Location ( player ,  name ,  id ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . locations [ name ]  =  newLoc 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            self . smz3World . locationLookup [ name ] . APLocation  =  newLoc 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  create_region ( self ,  world :  MultiWorld ,  player :  int ,  name :  str ,  locations = None ,  exits = None ) : 
							 
						 
					
						
							
								
									
										
										
										
											2023-02-13 18:06:43 -06:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        ret  =  Region ( name ,  player ,  world ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        if  locations : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  loc  in  locations : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                location  =  self . locations [ loc ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                location . parent_region  =  ret 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ret . locations . append ( location ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        if  exits : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								            for  exit  in  exits : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								                ret . exits . append ( Entrance ( player ,  exit ,  ret ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        return  ret 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  SMZ3Location ( Location ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    game :  str  =  " SMZ3 " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    def  __init__ ( self ,  player :  int ,  name :  str ,  address = None ,  parent = None ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        super ( SMZ3Location ,  self ) . __init__ ( player ,  name ,  address ,  parent ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								class  SMZ3Item ( Item ) :  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    game  =  " SMZ3 " 
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 00:49:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    type :  ItemType 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    item :  Item 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2022-08-06 00:49:54 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    def  __init__ ( self ,  name ,  classification ,  type :  ItemType ,  code ,  player :  int ,  item :  Item ) : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        super ( SMZ3Item ,  self ) . __init__ ( name ,  classification ,  code ,  player ) 
							 
						 
					
						
							
								
									
										
										
										
											2022-03-15 08:55:57 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								        self . type  =  type 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        self . item  =  item