SM: 0.4.1 Fixes and Additional Objective Options (#1859)
* 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 * fixed broken Item links * fixed failing generation that could happen with Disabled Tourian fixed shared Location list that could be modified for each world * added missing force disable of EscapeRando if an escape solution cant be found * fixed broken animal surprise patches * prevent receiving items when in the first room of Ceres (message box in mode7 is broken) * fixed generating with "activate chozo robots" Objective * added soft reset that saves to initial starting location reverted code change applied to fix softlocks from comeback checks reverted forcing all beam local when using door rando * replaced "save and reset" with "save and fast reload" (using same Start+Select+L+R) * added documentation about Save and Reload removed forgotten docstring about forcing beams as local items when using door rando * fixed frequent failing generation on WebHost (KeyError: 'Kraid') * added "objectiveRandom", "nbObjective", objectiveList and adapted Objective selection options to better reflect VARIA's. fixed "collect 100% items" not being excluded when objectiveRandom is used added Exception when VARIA initial layout fails * fixed broken non-AP items fixed determinism caused by the use of a set * fixed generation failing on Webhost with string as a OptionSet (replaced default with a list of string) cleaned doc and naming of Objective related Options
This commit is contained in:
parent
77b0852dca
commit
d0db728850
|
@ -1,5 +1,5 @@
|
||||||
import typing
|
import typing
|
||||||
from Options import Choice, Range, OptionDict, OptionList, Option, Toggle, DefaultOnToggle
|
from Options import Choice, Range, OptionDict, OptionList, OptionSet, Option, Toggle, DefaultOnToggle
|
||||||
from .variaRandomizer.utils.objectives import _goals
|
from .variaRandomizer.utils.objectives import _goals
|
||||||
|
|
||||||
class StartItemsRemovesFromPool(Toggle):
|
class StartItemsRemovesFromPool(Toggle):
|
||||||
|
@ -136,7 +136,7 @@ class AreaLayout(Toggle):
|
||||||
|
|
||||||
class DoorsColorsRando(Toggle):
|
class DoorsColorsRando(Toggle):
|
||||||
"""Randomize the color of Red/Green/Yellow doors. Add four new type of doors which require Ice/Wave/Spazer/Plasma
|
"""Randomize the color of Red/Green/Yellow doors. Add four new type of doors which require Ice/Wave/Spazer/Plasma
|
||||||
beams to open them. When enabled, will force those beams as local items."""
|
beams to open them."""
|
||||||
display_name = "Doors Colors Rando"
|
display_name = "Doors Colors Rando"
|
||||||
|
|
||||||
class AllowGreyDoors(Toggle):
|
class AllowGreyDoors(Toggle):
|
||||||
|
@ -215,7 +215,11 @@ class Hud(Toggle):
|
||||||
display_name = "Hud"
|
display_name = "Hud"
|
||||||
|
|
||||||
class Animals(Toggle):
|
class Animals(Toggle):
|
||||||
"""Replace saving the animals in the escape sequence by a random surprise."""
|
"""
|
||||||
|
Replace saving the animals in the escape sequence by a random surprise.
|
||||||
|
Note: This setting is not available when Escape Randomization is enabled, as it is replaced by Animals Challenges
|
||||||
|
(see Escape Randomization help for more information).
|
||||||
|
"""
|
||||||
display_name = "Animals"
|
display_name = "Animals"
|
||||||
|
|
||||||
class NoMusic(Toggle):
|
class NoMusic(Toggle):
|
||||||
|
@ -286,17 +290,52 @@ class Tourian(Choice):
|
||||||
option_Disabled = 2
|
option_Disabled = 2
|
||||||
default = 0
|
default = 0
|
||||||
|
|
||||||
class Objective(OptionList):
|
class CustomObjective(Toggle):
|
||||||
"""
|
"""
|
||||||
Choose which objectives are required to sink the Golden Four statue and to open access to Tourian.
|
Use randomized custom objectives. You can choose which objectives are available for the randomizer to choose from. If enabled, the randomizer
|
||||||
You can choose from 0 to 5 objectives.
|
will choose "Custom objective count" objectives from "Custom objective list". Otherwise, only objective is used. Default is disabled.
|
||||||
|
"""
|
||||||
|
display_name = "Custom objectives"
|
||||||
|
|
||||||
|
class CustomObjectiveCount(Range):
|
||||||
|
"""
|
||||||
|
By default you need to complete 4 objectives from the list to access Tourian. You can choose between 1 and 5. This setting is ignored if
|
||||||
|
""Custom objectives"" is set to false.
|
||||||
|
"""
|
||||||
|
display_name = "Custom objective count"
|
||||||
|
range_start = 1
|
||||||
|
range_end = 5
|
||||||
|
default = 4
|
||||||
|
|
||||||
|
class CustomObjectiveList(OptionSet):
|
||||||
|
"""
|
||||||
|
If ""Custom objectives"" is enabled, "Custom Objective count" will be used to pick an amount of objective from the list.
|
||||||
|
This setting is ignored if ""Custom objectives"" is set to false.
|
||||||
Note: If you leave the list empty no objective is required to access Tourian, ie. it's open.
|
Note: If you leave the list empty no objective is required to access Tourian, ie. it's open.
|
||||||
Note: See the Tourian parameter to enable fast Tourian or trigger the escape when all objectives are completed.
|
Note: See the Tourian parameter to enable fast Tourian or trigger the escape when all objectives are completed.
|
||||||
Note: Current percentage of collected items is displayed in the inventory pause menu.
|
Note: Current percentage of collected items is displayed in the inventory pause menu.
|
||||||
Note: Collect 100% items is excluded by default when randomizing the objectives list as it requires you to complete all the objectives.
|
Note: Collect 100% items is excluded by default as it requires you to complete all the objectives.
|
||||||
Note: In AP, Items% and areas objectives are counted toward location checks, not items collected or received, except for "collect all upgrades"
|
Note: In AP, Items% and areas objectives are counted toward location checks, not items collected or received, except for "collect all upgrades"
|
||||||
|
|
||||||
Format as a comma-separated list of objective names: ["kill three G4", "collect 75% items"].
|
Format as a comma-separated list of objective names: ["kill three G4", "collect 75% items"] or ["random"] to specify the whole list except
|
||||||
|
"collect 100% items" and "nothing". The default is ["random"]. A full list of supported objectives can be found at:
|
||||||
|
https://github.com/ArchipelagoMW/Archipelago/blob/main/worlds/sm/variaRandomizer/utils/objectives.py
|
||||||
|
"""
|
||||||
|
display_name = "Custom objective list"
|
||||||
|
default = ["random"]
|
||||||
|
valid_keys = frozenset([name for name in _goals.keys()] + ["random"])
|
||||||
|
#valid_keys_casefold = True
|
||||||
|
|
||||||
|
class Objective(OptionSet):
|
||||||
|
"""
|
||||||
|
If ""Custom objectives"" is disabled, choose which objectives are required to sink the Golden Four statue and to open access to Tourian.
|
||||||
|
You can choose from 0 to 5 objectives. Up to the first 5 objectives from the list will be selected.
|
||||||
|
Note: If you leave the list empty no objective is required to access Tourian, ie. it's open.
|
||||||
|
Note: See the Tourian parameter to enable fast Tourian or trigger the escape when all objectives are completed.
|
||||||
|
Note: Current percentage of collected items is displayed in the inventory pause menu.
|
||||||
|
Note: In AP, Items% and areas objectives are counted toward location checks, not items collected or received, except for "collect all upgrades"
|
||||||
|
|
||||||
|
Format as a comma-separated list of objective names: ["kill three G4", "collect 75% items"]. The default is ["kill all G4"].
|
||||||
A full list of supported objectives can be found at:
|
A full list of supported objectives can be found at:
|
||||||
https://github.com/ArchipelagoMW/Archipelago/blob/main/worlds/sm/variaRandomizer/utils/objectives.py
|
https://github.com/ArchipelagoMW/Archipelago/blob/main/worlds/sm/variaRandomizer/utils/objectives.py
|
||||||
"""
|
"""
|
||||||
|
@ -386,6 +425,9 @@ sm_options: typing.Dict[str, type(Option)] = {
|
||||||
"custom_preset": CustomPreset,
|
"custom_preset": CustomPreset,
|
||||||
"varia_custom_preset": VariaCustomPreset,
|
"varia_custom_preset": VariaCustomPreset,
|
||||||
"tourian": Tourian,
|
"tourian": Tourian,
|
||||||
|
"custom_objective": CustomObjective,
|
||||||
|
"custom_objective_list": CustomObjectiveList,
|
||||||
|
"custom_objective_count": CustomObjectiveCount,
|
||||||
"objective": Objective,
|
"objective": Objective,
|
||||||
"relaxed_round_robin_cf": RelaxedRoundRobinCF,
|
"relaxed_round_robin_cf": RelaxedRoundRobinCF,
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ class SMCollectionState(metaclass=AutoLogicRegister):
|
||||||
# for unit tests where MultiWorld is instantiated before worlds
|
# for unit tests where MultiWorld is instantiated before worlds
|
||||||
if hasattr(parent, "state"):
|
if hasattr(parent, "state"):
|
||||||
self.smbm = {player: SMBoolManager(player, parent.state.smbm[player].maxDiff,
|
self.smbm = {player: SMBoolManager(player, parent.state.smbm[player].maxDiff,
|
||||||
parent.state.smbm[player].onlyBossLeft, parent.state.smbm[player].lastAP) for player in
|
parent.state.smbm[player].onlyBossLeft) for player in
|
||||||
parent.get_game_players("Super Metroid")}
|
parent.get_game_players("Super Metroid")}
|
||||||
for player, group in parent.groups.items():
|
for player, group in parent.groups.items():
|
||||||
if (group["game"] == "Super Metroid"):
|
if (group["game"] == "Super Metroid"):
|
||||||
|
@ -99,13 +99,15 @@ class SMWorld(World):
|
||||||
required_client_version = (0, 2, 6)
|
required_client_version = (0, 2, 6)
|
||||||
|
|
||||||
itemManager: ItemManager
|
itemManager: ItemManager
|
||||||
|
spheres = None
|
||||||
|
|
||||||
Logic.factory('vanilla')
|
Logic.factory('vanilla')
|
||||||
|
|
||||||
def __init__(self, world: MultiWorld, player: int):
|
def __init__(self, world: MultiWorld, player: int):
|
||||||
self.rom_name_available_event = threading.Event()
|
self.rom_name_available_event = threading.Event()
|
||||||
self.locations = {}
|
self.locations = {}
|
||||||
self.need_comeback_check = True
|
if SMWorld.spheres != None:
|
||||||
|
SMWorld.spheres = None
|
||||||
super().__init__(world, player)
|
super().__init__(world, player)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -118,7 +120,7 @@ class SMWorld(World):
|
||||||
Logic.factory('vanilla')
|
Logic.factory('vanilla')
|
||||||
|
|
||||||
self.variaRando = VariaRandomizer(self.multiworld, get_base_rom_path(), self.player)
|
self.variaRando = VariaRandomizer(self.multiworld, get_base_rom_path(), self.player)
|
||||||
self.multiworld.state.smbm[self.player] = SMBoolManager(self.player, self.variaRando.maxDifficulty, lastAP = self.variaRando.args.startLocation)
|
self.multiworld.state.smbm[self.player] = SMBoolManager(self.player, self.variaRando.maxDifficulty)
|
||||||
|
|
||||||
# keeps Nothing items local so no player will ever pickup Nothing
|
# keeps Nothing items local so no player will ever pickup Nothing
|
||||||
# doing so reduces contribution of this world to the Multiworld the more Nothing there is though
|
# doing so reduces contribution of this world to the Multiworld the more Nothing there is though
|
||||||
|
@ -178,11 +180,6 @@ class SMWorld(World):
|
||||||
None if itemClass == 'Boss' else self.item_name_to_id[item.Name],
|
None if itemClass == 'Boss' else self.item_name_to_id[item.Name],
|
||||||
player=self.player)
|
player=self.player)
|
||||||
|
|
||||||
beamItems = ['Spazer', 'Ice', 'Wave' ,'Plasma']
|
|
||||||
if self.multiworld.doors_colors_rando[self.player].value != 0:
|
|
||||||
if item.Type in beamItems:
|
|
||||||
self.multiworld.local_items[self.player].value.add(item.Name)
|
|
||||||
|
|
||||||
if itemClass == 'Boss':
|
if itemClass == 'Boss':
|
||||||
self.locked_items[item.Name] = smitem
|
self.locked_items[item.Name] = smitem
|
||||||
elif item.Category == 'Nothing':
|
elif item.Category == 'Nothing':
|
||||||
|
@ -217,7 +214,6 @@ class SMWorld(World):
|
||||||
|
|
||||||
self.multiworld.completion_condition[self.player] = lambda state: state.has('Mother Brain', self.player)
|
self.multiworld.completion_condition[self.player] = lambda state: state.has('Mother Brain', self.player)
|
||||||
|
|
||||||
ammoItems = ['Missile', 'Super', 'PowerBomb']
|
|
||||||
for key, value in locationsDict.items():
|
for key, value in locationsDict.items():
|
||||||
location = self.multiworld.get_location(key, self.player)
|
location = self.multiworld.get_location(key, self.player)
|
||||||
set_available_rule(location, self.player, value.Available)
|
set_available_rule(location, self.player, value.Available)
|
||||||
|
@ -226,11 +222,6 @@ class SMWorld(World):
|
||||||
if value.PostAvailable is not None:
|
if value.PostAvailable is not None:
|
||||||
add_postAvailable_rule(location, self.player, value.PostAvailable)
|
add_postAvailable_rule(location, self.player, value.PostAvailable)
|
||||||
|
|
||||||
if self.multiworld.doors_colors_rando[self.player].value != 0:
|
|
||||||
add_item_rule(location, lambda item: item.game != self.game or item.type not in ammoItems or
|
|
||||||
(item.type in ammoItems and \
|
|
||||||
(not item.advancement or (item.advancement and item.player == self.player))))
|
|
||||||
|
|
||||||
for accessPoint in Logic.accessPoints:
|
for accessPoint in Logic.accessPoints:
|
||||||
if not accessPoint.Escape:
|
if not accessPoint.Escape:
|
||||||
for key, value1 in accessPoint.intraTransitions.items():
|
for key, value1 in accessPoint.intraTransitions.items():
|
||||||
|
@ -304,11 +295,6 @@ class SMWorld(World):
|
||||||
|
|
||||||
def collect(self, state: CollectionState, item: Item) -> bool:
|
def collect(self, state: CollectionState, item: Item) -> bool:
|
||||||
state.smbm[self.player].addItem(item.type)
|
state.smbm[self.player].addItem(item.type)
|
||||||
if item.location != None and item.location.game == self.game:
|
|
||||||
for entrance in self.multiworld.get_region(item.location.parent_region.name, item.location.player).entrances:
|
|
||||||
if (entrance.parent_region.can_reach(state)):
|
|
||||||
state.smbm[item.location.player].lastAP = entrance.parent_region.name
|
|
||||||
break
|
|
||||||
return super(SMWorld, self).collect(state, item)
|
return super(SMWorld, self).collect(state, item)
|
||||||
|
|
||||||
def remove(self, state: CollectionState, item: Item) -> bool:
|
def remove(self, state: CollectionState, item: Item) -> bool:
|
||||||
|
@ -359,42 +345,57 @@ class SMWorld(World):
|
||||||
loc.address = loc.item.code = None
|
loc.address = loc.item.code = None
|
||||||
|
|
||||||
def post_fill(self):
|
def post_fill(self):
|
||||||
|
# Having a sorted itemLocs from collection order is required for escapeTrigger when Tourian is Disabled.
|
||||||
|
# We cant use stage_post_fill for this as its called after worlds' post_fill.
|
||||||
|
# get_spheres could be cached in multiworld?
|
||||||
|
# Another possible solution would be to have a globally accessible list of items in the order in which the get placed in push_item
|
||||||
|
# and use the inversed starting from the first progression item.
|
||||||
|
if (SMWorld.spheres == None):
|
||||||
|
SMWorld.spheres = [itemLoc for sphere in self.multiworld.get_spheres() for itemLoc in sorted(sphere, key=lambda location: location.name)]
|
||||||
|
|
||||||
self.itemLocs = [
|
self.itemLocs = [
|
||||||
ItemLocation(ItemManager.Items[itemLoc.item.type
|
ItemLocation(copy.copy(ItemManager.Items[itemLoc.item.type
|
||||||
if isinstance(itemLoc.item, SMItem) and itemLoc.item.type in ItemManager.Items else
|
if isinstance(itemLoc.item, SMItem) and itemLoc.item.type in ItemManager.Items else
|
||||||
'ArchipelagoItem'],
|
'ArchipelagoItem']),
|
||||||
locationsDict[itemLoc.name], itemLoc.item.player, True)
|
copy.copy(locationsDict[itemLoc.name]), itemLoc.item.player, True)
|
||||||
for itemLoc in self.multiworld.get_locations(self.player)
|
for itemLoc in self.multiworld.get_locations(self.player)
|
||||||
]
|
]
|
||||||
self.progItemLocs = [
|
|
||||||
ItemLocation(ItemManager.Items[itemLoc.item.type
|
|
||||||
if isinstance(itemLoc.item, SMItem) and itemLoc.item.type in ItemManager.Items else
|
|
||||||
'ArchipelagoItem'],
|
|
||||||
locationsDict[itemLoc.name], itemLoc.item.player, True)
|
|
||||||
for itemLoc in self.multiworld.get_locations(self.player) if itemLoc.item.advancement
|
|
||||||
]
|
|
||||||
for itemLoc in self.itemLocs:
|
|
||||||
if itemLoc.Item.Class == "Boss":
|
|
||||||
itemLoc.Item.Class = "Minor"
|
|
||||||
for itemLoc in self.progItemLocs:
|
|
||||||
if itemLoc.Item.Class == "Boss":
|
|
||||||
itemLoc.Item.Class = "Minor"
|
|
||||||
|
|
||||||
localItemLocs = [il for il in self.itemLocs if il.player == self.player]
|
escapeTrigger = None
|
||||||
localprogItemLocs = [il for il in self.progItemLocs if il.player == self.player]
|
if self.variaRando.randoExec.randoSettings.restrictions["EscapeTrigger"]:
|
||||||
|
#used to simulate received items
|
||||||
|
first_local_collected_loc = next(itemLoc for itemLoc in SMWorld.spheres if itemLoc.player == self.player)
|
||||||
|
|
||||||
|
playerItemsItemLocs = [
|
||||||
|
ItemLocation(copy.copy(ItemManager.Items[
|
||||||
|
itemLoc.item.type if isinstance(itemLoc.item, SMItem) and itemLoc.item.type in ItemManager.Items else
|
||||||
|
'ArchipelagoItem']),
|
||||||
|
copy.copy(locationsDict[itemLoc.name] if itemLoc.game == self.game else
|
||||||
|
locationsDict[first_local_collected_loc.name]),
|
||||||
|
itemLoc.item.player,
|
||||||
|
True)
|
||||||
|
for itemLoc in SMWorld.spheres if itemLoc.item.player == self.player
|
||||||
|
]
|
||||||
|
for itemLoc in playerItemsItemLocs:
|
||||||
|
if itemLoc.Item.Class == "Boss":
|
||||||
|
itemLoc.Item.Class = "Minor"
|
||||||
|
|
||||||
|
playerProgItemsItemLocs = [itemLoc for itemLoc in playerItemsItemLocs if itemLoc.item.advancement]
|
||||||
|
|
||||||
|
escapeTrigger = (playerItemsItemLocs, playerProgItemsItemLocs, 'Full')
|
||||||
|
|
||||||
escapeTrigger = (localItemLocs, localprogItemLocs, 'Full') if self.variaRando.randoExec.randoSettings.restrictions["EscapeTrigger"] else None
|
|
||||||
escapeOk = self.variaRando.randoExec.graphBuilder.escapeGraph(self.variaRando.container, self.variaRando.randoExec.areaGraph, self.variaRando.randoExec.randoSettings.maxDiff, escapeTrigger)
|
escapeOk = self.variaRando.randoExec.graphBuilder.escapeGraph(self.variaRando.container, self.variaRando.randoExec.areaGraph, self.variaRando.randoExec.randoSettings.maxDiff, escapeTrigger)
|
||||||
assert escapeOk, "Could not find a solution for escape"
|
if (not escapeOk):
|
||||||
|
logger.warning(f"Escape Rando forced to 'Off' for player {self.multiworld.get_player_name(self.player)} because could not find a solution for escape")
|
||||||
|
|
||||||
|
# if we couldn't find an area layout then the escape graph is not created either
|
||||||
|
# and getDoorConnections will crash if random escape is activated.
|
||||||
self.variaRando.doors = GraphUtils.getDoorConnections(self.variaRando.randoExec.areaGraph,
|
self.variaRando.doors = GraphUtils.getDoorConnections(self.variaRando.randoExec.areaGraph,
|
||||||
self.variaRando.args.area, self.variaRando.args.bosses,
|
self.variaRando.args.area, self.variaRando.args.bosses,
|
||||||
self.variaRando.args.escapeRando)
|
self.variaRando.args.escapeRando if escapeOk else False)
|
||||||
|
|
||||||
self.variaRando.randoExec.postProcessItemLocs(self.itemLocs, self.variaRando.args.hideItems)
|
self.variaRando.randoExec.postProcessItemLocs(self.itemLocs, self.variaRando.args.hideItems)
|
||||||
|
|
||||||
self.need_comeback_check = False
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def stage_post_fill(cls, world):
|
def stage_post_fill(cls, world):
|
||||||
new_state = CollectionState(world)
|
new_state = CollectionState(world)
|
||||||
|
@ -872,29 +873,6 @@ class SMLocation(Location):
|
||||||
def __init__(self, player: int, name: str, address=None, parent=None):
|
def __init__(self, player: int, name: str, address=None, parent=None):
|
||||||
super(SMLocation, self).__init__(player, name, address, parent)
|
super(SMLocation, self).__init__(player, name, address, parent)
|
||||||
|
|
||||||
def can_reach(self, state: CollectionState) -> bool:
|
|
||||||
# self.access_rule computes faster on average, so placing it first for faster abort
|
|
||||||
assert self.parent_region, "Can't reach location without region"
|
|
||||||
return super(SMLocation, self).can_reach(state) and \
|
|
||||||
(not state.multiworld.worlds[self.player].need_comeback_check or \
|
|
||||||
self.can_comeback(state, self.item))
|
|
||||||
|
|
||||||
def can_comeback(self, state: CollectionState, item):
|
|
||||||
randoExec = state.multiworld.worlds[self.player].variaRando.randoExec
|
|
||||||
randoService = randoExec.setup.services
|
|
||||||
|
|
||||||
comebackCheck = ComebackCheckType.JustComeback
|
|
||||||
n = 2 if GraphUtils.isStandardStart(randoExec.graphSettings.startAP) else 3
|
|
||||||
# is early game
|
|
||||||
if (len([loc for loc in state.locations_checked if loc.player == self.player]) <= n or randoExec.graphSettings.startAP == state.smbm[self.player].lastAP):
|
|
||||||
comebackCheck = ComebackCheckType.NoCheck
|
|
||||||
container = ItemLocContainer(state.smbm[self.player], [], [])
|
|
||||||
return randoService.fullComebackCheck( container,
|
|
||||||
state.smbm[self.player].lastAP,
|
|
||||||
ItemManager.Items[item.type] if item is not None and item.player == self.player else None,
|
|
||||||
locationsDict[self.name],
|
|
||||||
comebackCheck)
|
|
||||||
|
|
||||||
class SMItem(Item):
|
class SMItem(Item):
|
||||||
game = "Super Metroid"
|
game = "Super Metroid"
|
||||||
type: str
|
type: str
|
||||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -4,7 +4,7 @@
|
||||||
"CLIPLEN_end": "85:990F",
|
"CLIPLEN_end": "85:990F",
|
||||||
"CLIPLEN_no_multi": "85:990C",
|
"CLIPLEN_no_multi": "85:990C",
|
||||||
"CLIPSET": "85:FF1D",
|
"CLIPSET": "85:FF1D",
|
||||||
"COLLECTTANK": "B8:8503",
|
"COLLECTTANK": "B8:8517",
|
||||||
"MISCFX": "85:FF45",
|
"MISCFX": "85:FF45",
|
||||||
"NORMAL": "84:8BF2",
|
"NORMAL": "84:8BF2",
|
||||||
"SETFX": "85:FF4E",
|
"SETFX": "85:FF4E",
|
||||||
|
@ -12,15 +12,17 @@
|
||||||
"SOUNDFX_84": "84:FD90",
|
"SOUNDFX_84": "84:FD90",
|
||||||
"SPECIALFX": "85:FF3C",
|
"SPECIALFX": "85:FF3C",
|
||||||
"ammo_loop_table": "84:FC46",
|
"ammo_loop_table": "84:FC46",
|
||||||
"ap_playerid_to_rom_other_player_index": "B8:85BA",
|
"ap_playerid_to_rom_other_player_index": "B8:85CE",
|
||||||
"ap_playerid_to_rom_other_player_index_checklastrow": "B8:85DD",
|
"ap_playerid_to_rom_other_player_index_checklastrow": "B8:85F1",
|
||||||
"ap_playerid_to_rom_other_player_index_correctindex": "B8:85F8",
|
"ap_playerid_to_rom_other_player_index_correctindex": "B8:860C",
|
||||||
"ap_playerid_to_rom_other_player_index_do_search_stage_1": "B8:85C0",
|
"ap_playerid_to_rom_other_player_index_do_search_stage_1": "B8:85D4",
|
||||||
"ap_playerid_to_rom_other_player_index_notfound": "B8:85F5",
|
"ap_playerid_to_rom_other_player_index_notfound": "B8:8609",
|
||||||
"archipelago_chozo_item_plm": "84:FC24",
|
"archipelago_chozo_item_plm": "84:FC24",
|
||||||
"archipelago_hidden_item_plm": "84:FC28",
|
"archipelago_hidden_item_plm": "84:FC28",
|
||||||
"archipelago_visible_item_plm": "84:FC20",
|
"archipelago_visible_item_plm": "84:FC20",
|
||||||
"c_item": "84:FC42",
|
"c_item": "84:FC42",
|
||||||
|
"check_reload": "82:F990",
|
||||||
|
"check_reload_end": "82:F9C0",
|
||||||
"config_deathlink": "CE:FF04",
|
"config_deathlink": "CE:FF04",
|
||||||
"config_flags": "CE:FF00",
|
"config_flags": "CE:FF00",
|
||||||
"config_multiworld": "CE:FF00",
|
"config_multiworld": "CE:FF00",
|
||||||
|
@ -32,6 +34,8 @@
|
||||||
"copy_memory_done": "B8:8417",
|
"copy_memory_done": "B8:8417",
|
||||||
"copy_memory_even": "B8:8409",
|
"copy_memory_even": "B8:8409",
|
||||||
"copy_memory_loop": "B8:840F",
|
"copy_memory_loop": "B8:840F",
|
||||||
|
"deathhook": "82:F9C3",
|
||||||
|
"deathhook_zebes": "82:F9D8",
|
||||||
"h_item": "84:FC44",
|
"h_item": "84:FC44",
|
||||||
"i_chozo_item": "84:FC5D",
|
"i_chozo_item": "84:FC5D",
|
||||||
"i_hidden_item": "84:FC64",
|
"i_hidden_item": "84:FC64",
|
||||||
|
@ -40,13 +44,13 @@
|
||||||
"i_item_setup_shared_all_items": "B8:8878",
|
"i_item_setup_shared_all_items": "B8:8878",
|
||||||
"i_item_setup_shared_alwaysloaded": "B8:8883",
|
"i_item_setup_shared_alwaysloaded": "B8:8883",
|
||||||
"i_live_pickup": "84:FE29",
|
"i_live_pickup": "84:FE29",
|
||||||
"i_live_pickup_multiworld": "B8:85FD",
|
"i_live_pickup_multiworld": "B8:8611",
|
||||||
"i_live_pickup_multiworld_end": "B8:8679",
|
"i_live_pickup_multiworld_end": "B8:868D",
|
||||||
"i_live_pickup_multiworld_item_link_item": "B8:8659",
|
"i_live_pickup_multiworld_item_link_item": "B8:866D",
|
||||||
"i_live_pickup_multiworld_otherplayers_item": "B8:8649",
|
"i_live_pickup_multiworld_otherplayers_item": "B8:865D",
|
||||||
"i_live_pickup_multiworld_own_item": "B8:8635",
|
"i_live_pickup_multiworld_own_item": "B8:8649",
|
||||||
"i_live_pickup_multiworld_own_item1": "B8:8641",
|
"i_live_pickup_multiworld_own_item1": "B8:8655",
|
||||||
"i_live_pickup_multiworld_send_network": "B8:8620",
|
"i_live_pickup_multiworld_send_network": "B8:8634",
|
||||||
"i_load_custom_graphics": "84:FDCE",
|
"i_load_custom_graphics": "84:FDCE",
|
||||||
"i_load_custom_graphics_all_items": "84:FDE9",
|
"i_load_custom_graphics_all_items": "84:FDE9",
|
||||||
"i_load_custom_graphics_alwaysloaded": "84:FDF9",
|
"i_load_custom_graphics_alwaysloaded": "84:FDF9",
|
||||||
|
@ -82,30 +86,30 @@
|
||||||
"message_write_placeholders": "85:BAA3",
|
"message_write_placeholders": "85:BAA3",
|
||||||
"message_write_placeholders_adjust": "85:BAA5",
|
"message_write_placeholders_adjust": "85:BAA5",
|
||||||
"message_write_placeholders_end": "85:BAED",
|
"message_write_placeholders_end": "85:BAED",
|
||||||
"mw_cleanup_item_link_messagebox": "B8:84BB",
|
"mw_cleanup_item_link_messagebox": "B8:84CF",
|
||||||
"mw_display_item_sent": "B8:848B",
|
"mw_display_item_sent": "B8:849F",
|
||||||
"mw_handle_queue": "B8:8513",
|
"mw_handle_queue": "B8:8527",
|
||||||
"mw_handle_queue_collect_item_if_present": "B8:8562",
|
"mw_handle_queue_collect_item_if_present": "B8:8576",
|
||||||
"mw_handle_queue_end": "B8:85B3",
|
"mw_handle_queue_end": "B8:85C7",
|
||||||
"mw_handle_queue_found": "B8:859B",
|
"mw_handle_queue_found": "B8:85AF",
|
||||||
"mw_handle_queue_lookup_player": "B8:8522",
|
"mw_handle_queue_lookup_player": "B8:8536",
|
||||||
"mw_handle_queue_loop": "B8:8515",
|
"mw_handle_queue_loop": "B8:8529",
|
||||||
"mw_handle_queue_new_remote_item": "B8:857C",
|
"mw_handle_queue_new_remote_item": "B8:8590",
|
||||||
"mw_handle_queue_next": "B8:85A7",
|
"mw_handle_queue_next": "B8:85BB",
|
||||||
"mw_handle_queue_perform_receive": "B8:858E",
|
"mw_handle_queue_perform_receive": "B8:85A2",
|
||||||
"mw_hook_main_game": "B8:867D",
|
"mw_hook_main_game": "B8:8691",
|
||||||
"mw_init": "B8:8311",
|
"mw_init": "B8:8311",
|
||||||
"mw_init_continuereset": "B8:8366",
|
"mw_init_continuereset": "B8:8366",
|
||||||
"mw_init_end": "B8:83EA",
|
"mw_init_end": "B8:83EA",
|
||||||
"mw_init_memory": "B8:8300",
|
"mw_init_memory": "B8:8300",
|
||||||
"mw_init_reset_sram": "B8:833B",
|
"mw_init_reset_sram": "B8:833B",
|
||||||
"mw_init_smstringdata": "B8:8351",
|
"mw_init_smstringdata": "B8:8351",
|
||||||
"mw_load_sram": "B8:8474",
|
"mw_load_sram": "B8:8488",
|
||||||
"mw_load_sram_done": "B8:8482",
|
"mw_load_sram_done": "B8:8496",
|
||||||
"mw_load_sram_setnewgame": "B8:8485",
|
"mw_load_sram_setnewgame": "B8:8499",
|
||||||
"mw_prep_item_link_messagebox": "B8:84A9",
|
"mw_prep_item_link_messagebox": "B8:84BD",
|
||||||
"mw_receive_item": "B8:84C4",
|
"mw_receive_item": "B8:84D8",
|
||||||
"mw_receive_item_end": "B8:84FC",
|
"mw_receive_item_end": "B8:8510",
|
||||||
"mw_save_sram": "B8:8469",
|
"mw_save_sram": "B8:8469",
|
||||||
"mw_write_message": "B8:8442",
|
"mw_write_message": "B8:8442",
|
||||||
"nonprog_item_eight_palette_indices": "84:FC38",
|
"nonprog_item_eight_palette_indices": "84:FC38",
|
||||||
|
@ -132,7 +136,7 @@
|
||||||
"p_visible_item_end": "84:FD1E",
|
"p_visible_item_end": "84:FD1E",
|
||||||
"p_visible_item_loop": "84:FD0B",
|
"p_visible_item_loop": "84:FD0B",
|
||||||
"p_visible_item_trigger": "84:FD17",
|
"p_visible_item_trigger": "84:FD17",
|
||||||
"patch_load_multiworld": "B8:8694",
|
"patch_load_multiworld": "B8:86B5",
|
||||||
"perform_item_pickup": "84:FE2E",
|
"perform_item_pickup": "84:FE2E",
|
||||||
"plm_graphics_entry_offworld_item": "84:FC36",
|
"plm_graphics_entry_offworld_item": "84:FC36",
|
||||||
"plm_graphics_entry_offworld_progression_item": "84:FC2C",
|
"plm_graphics_entry_offworld_progression_item": "84:FC2C",
|
||||||
|
@ -143,8 +147,21 @@
|
||||||
"rando_player_id_table_end": "B8:DE34",
|
"rando_player_id_table_end": "B8:DE34",
|
||||||
"rando_player_name_table": "B8:D000",
|
"rando_player_name_table": "B8:D000",
|
||||||
"rando_seed_data": "B8:CF00",
|
"rando_seed_data": "B8:CF00",
|
||||||
|
"setup_game_1": "A0:FE0C",
|
||||||
|
"setup_game_1_quick": "A0:FE1F",
|
||||||
|
"setup_game_2": "A0:FE2F",
|
||||||
|
"setup_game_2_quick": "A0:FE40",
|
||||||
|
"setup_game_3": "A0:FE44",
|
||||||
|
"setup_game_3_loadmusic": "A0:FE73",
|
||||||
|
"setup_game_3_quick": "A0:FE57",
|
||||||
|
"setup_music": "A0:FE00",
|
||||||
|
"setup_music_quick": "A0:FE0B",
|
||||||
|
"setup_samus": "A0:FE94",
|
||||||
|
"setup_samus_normal": "A0:FEA5",
|
||||||
|
"sm_fix_checksum": "82:FA0C",
|
||||||
"sm_item_graphics": "B8:8800",
|
"sm_item_graphics": "B8:8800",
|
||||||
"sm_item_plm_pickup_sequence_pointers": "B8:882E",
|
"sm_item_plm_pickup_sequence_pointers": "B8:882E",
|
||||||
|
"sm_save_done_hook": "B8:847B",
|
||||||
"start_item": "B8:C81C",
|
"start_item": "B8:C81C",
|
||||||
"start_item_data_major": "B8:C800",
|
"start_item_data_major": "B8:C800",
|
||||||
"start_item_data_minor": "B8:C808",
|
"start_item_data_minor": "B8:C808",
|
||||||
|
@ -153,6 +170,12 @@
|
||||||
"v_item": "84:FC40",
|
"v_item": "84:FC40",
|
||||||
"write_repeated_memory": "B8:83EF",
|
"write_repeated_memory": "B8:83EF",
|
||||||
"write_repeated_memory_loop": "B8:83F4",
|
"write_repeated_memory_loop": "B8:83F4",
|
||||||
|
"deathhook82": "82:DDC7",
|
||||||
|
"freespace82_start": "82:F990",
|
||||||
|
"freespace82_end": "82:FA4A",
|
||||||
|
"freespacea0": "a0:fe00",
|
||||||
|
"SRAM_SAVING": "70:2604",
|
||||||
|
"current_save_slot": "7e:0952",
|
||||||
"ITEM_RAM": "7E:09A2",
|
"ITEM_RAM": "7E:09A2",
|
||||||
"SRAM_MW_ITEMS_RECV": "70:2000",
|
"SRAM_MW_ITEMS_RECV": "70:2000",
|
||||||
"SRAM_MW_ITEMS_RECV_WCOUNT": "70:2602",
|
"SRAM_MW_ITEMS_RECV_WCOUNT": "70:2602",
|
||||||
|
|
|
@ -30,3 +30,9 @@ a small up arrow on the sprite and non-progression don't.
|
||||||
|
|
||||||
When the player receives an item, a text box will appear to show which item was received, and from whom.
|
When the player receives an item, a text box will appear to show which item was received, and from whom.
|
||||||
|
|
||||||
|
## I can't get back to my starting position with a required item (softlocked), what can I do?
|
||||||
|
|
||||||
|
It can happen that a required item is in a place where you cant get back from. While in normal gameplay state, by holding
|
||||||
|
Start+Select+L+R at the same time, the game will save your progress and put you back at your original starting position.
|
||||||
|
This can be required by the logic.
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ class SMBoolManager(object):
|
||||||
countItems = ['Missile', 'Super', 'PowerBomb', 'ETank', 'Reserve']
|
countItems = ['Missile', 'Super', 'PowerBomb', 'ETank', 'Reserve']
|
||||||
|
|
||||||
percentItems = ['Bomb', 'Charge', 'Ice', 'HiJump', 'SpeedBooster', 'Wave', 'Spazer', 'SpringBall', 'Varia', 'Plasma', 'Grapple', 'Morph', 'Gravity', 'XRayScope', 'SpaceJump', 'ScrewAttack']
|
percentItems = ['Bomb', 'Charge', 'Ice', 'HiJump', 'SpeedBooster', 'Wave', 'Spazer', 'SpringBall', 'Varia', 'Plasma', 'Grapple', 'Morph', 'Gravity', 'XRayScope', 'SpaceJump', 'ScrewAttack']
|
||||||
def __init__(self, player=0, maxDiff=sys.maxsize, onlyBossLeft = False, lastAP = 'Landing Site'):
|
def __init__(self, player=0, maxDiff=sys.maxsize, onlyBossLeft = False):
|
||||||
self._items = { }
|
self._items = { }
|
||||||
self._counts = { }
|
self._counts = { }
|
||||||
|
|
||||||
|
@ -23,8 +23,6 @@ class SMBoolManager(object):
|
||||||
self.maxDiff = maxDiff
|
self.maxDiff = maxDiff
|
||||||
self.onlyBossLeft = onlyBossLeft
|
self.onlyBossLeft = onlyBossLeft
|
||||||
|
|
||||||
self.lastAP = lastAP
|
|
||||||
|
|
||||||
# cache related
|
# cache related
|
||||||
#self.cacheKey = 0
|
#self.cacheKey = 0
|
||||||
#self.computeItemsPositions()
|
#self.computeItemsPositions()
|
||||||
|
@ -32,7 +30,7 @@ class SMBoolManager(object):
|
||||||
Logic.factory('vanilla')
|
Logic.factory('vanilla')
|
||||||
self.helpers = Logic.HelpersGraph(self)
|
self.helpers = Logic.HelpersGraph(self)
|
||||||
self.doorsManager = DoorsManager()
|
self.doorsManager = DoorsManager()
|
||||||
self.objectives = Objectives.objDict[player]
|
self.objectives = Objectives.objDict[player] if player in Objectives.objDict.keys() else Objectives(player)
|
||||||
self.createFacadeFunctions()
|
self.createFacadeFunctions()
|
||||||
self.createKnowsFunctions(player)
|
self.createKnowsFunctions(player)
|
||||||
self.resetItems()
|
self.resetItems()
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -46,7 +46,7 @@ class RandoExec(object):
|
||||||
DoorsManager.randomize(self.graphSettings.allowGreyDoors, self.player)
|
DoorsManager.randomize(self.graphSettings.allowGreyDoors, self.player)
|
||||||
self.areaGraph = self.graphBuilder.createGraph(self.randoSettings.maxDiff)
|
self.areaGraph = self.graphBuilder.createGraph(self.randoSettings.maxDiff)
|
||||||
services = RandoServices(self.areaGraph, self.restrictions)
|
services = RandoServices(self.areaGraph, self.restrictions)
|
||||||
setup = RandoSetup(self.graphSettings, Logic.locations, services, self.player)
|
setup = RandoSetup(self.graphSettings, Logic.locations[:], services, self.player)
|
||||||
self.setup = setup
|
self.setup = setup
|
||||||
container = setup.createItemLocContainer(endDate, vcr)
|
container = setup.createItemLocContainer(endDate, vcr)
|
||||||
if container is None:
|
if container is None:
|
||||||
|
@ -66,6 +66,7 @@ class RandoExec(object):
|
||||||
self.errorMsg += '; '.join(setup.errorMsgs)
|
self.errorMsg += '; '.join(setup.errorMsgs)
|
||||||
if self.errorMsg == "":
|
if self.errorMsg == "":
|
||||||
self.errorMsg += "Unable to process settings; "
|
self.errorMsg += "Unable to process settings; "
|
||||||
|
raise Exception(self.errorMsg)
|
||||||
self.areaGraph.printGraph()
|
self.areaGraph.printGraph()
|
||||||
return container
|
return container
|
||||||
|
|
||||||
|
|
|
@ -620,16 +620,13 @@ class VariaRandomizer:
|
||||||
self.objectivesManager.setScavengerHunt()
|
self.objectivesManager.setScavengerHunt()
|
||||||
addedObjectives = 1
|
addedObjectives = 1
|
||||||
|
|
||||||
|
if not args.objective:
|
||||||
|
args.objective = ["nothing"]
|
||||||
|
|
||||||
if args.objective:
|
if args.objective:
|
||||||
try:
|
if (args.objectiveRandom):
|
||||||
nbObjectives = int(args.objective[0])
|
availableObjectives = [goal for goal in objectives if goal != "collect 100% items"] if "random" in args.objectiveList else args.objectiveList
|
||||||
except:
|
self.objectivesManager.setRandom(args.nbObjective, availableObjectives)
|
||||||
nbObjectives = 0 if "random" in args.objective else None
|
|
||||||
if nbObjectives is not None:
|
|
||||||
availableObjectives = args.objectiveList.split(',') if args.objectiveList is not None else objectives
|
|
||||||
if nbObjectives == 0:
|
|
||||||
nbObjectives = random.randint(1, min(Objectives.maxActiveGoals, len(availableObjectives)))
|
|
||||||
self.objectivesManager.setRandom(nbObjectives, availableObjectives)
|
|
||||||
else:
|
else:
|
||||||
maxActiveGoals = Objectives.maxActiveGoals - addedObjectives
|
maxActiveGoals = Objectives.maxActiveGoals - addedObjectives
|
||||||
if len(args.objective) > maxActiveGoals:
|
if len(args.objective) > maxActiveGoals:
|
||||||
|
|
|
@ -1065,7 +1065,7 @@ class RomPatcher:
|
||||||
objectives.writeIntroObjectives(self.romFile, tourian)
|
objectives.writeIntroObjectives(self.romFile, tourian)
|
||||||
self.writeItemsMasks(itemLocs)
|
self.writeItemsMasks(itemLocs)
|
||||||
# hack bomb_torizo.ips to wake BT in all cases if necessary, ie chozo bots objective is on, and nothing at bombs
|
# hack bomb_torizo.ips to wake BT in all cases if necessary, ie chozo bots objective is on, and nothing at bombs
|
||||||
if objectives.isGoalActive("activate chozo robots") and RomPatches.has(RomPatches.BombTorizoWake):
|
if objectives.isGoalActive("activate chozo robots") and RomPatches.has(self.player, RomPatches.BombTorizoWake):
|
||||||
bomb = next((il for il in itemLocs if il.Location.Name == "Bomb"), None)
|
bomb = next((il for il in itemLocs if il.Location.Name == "Bomb"), None)
|
||||||
if bomb is not None and bomb.Item.Category == "Nothing":
|
if bomb is not None and bomb.Item.Category == "Nothing":
|
||||||
for addrName in ["BTtweaksHack1", "BTtweaksHack2"]:
|
for addrName in ["BTtweaksHack1", "BTtweaksHack2"]:
|
||||||
|
|
|
@ -417,7 +417,10 @@ def loadRandoPreset(world, player, args):
|
||||||
args.powerBombQty = world.power_bomb_qty[player].value / float(10)
|
args.powerBombQty = world.power_bomb_qty[player].value / float(10)
|
||||||
args.minorQty = world.minor_qty[player].value
|
args.minorQty = world.minor_qty[player].value
|
||||||
args.energyQty = defaultMultiValues["energyQty"][world.energy_qty[player].value]
|
args.energyQty = defaultMultiValues["energyQty"][world.energy_qty[player].value]
|
||||||
args.objective = world.objective[player].value
|
args.objectiveRandom = world.custom_objective[player].value
|
||||||
|
args.objectiveList = list(world.custom_objective_list[player].value)
|
||||||
|
args.nbObjective = world.custom_objective_count[player].value
|
||||||
|
args.objective = list(world.objective[player].value)
|
||||||
args.tourian = defaultMultiValues["tourian"][world.tourian[player].value]
|
args.tourian = defaultMultiValues["tourian"][world.tourian[player].value]
|
||||||
#args.minimizerN
|
#args.minimizerN
|
||||||
#args.minimizerTourian
|
#args.minimizerTourian
|
||||||
|
|
Loading…
Reference in New Issue