Skip to content

Commit

Permalink
SM and SMZ3 option_definitions deprecation fix (ArchipelagoMW#3372)
Browse files Browse the repository at this point in the history
* - 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 fb3ca18.

* 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 fb3ca18.

* 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

* replaced deprecated use of option_definitions for SM and SMZ3 by options_dataclass

* fixed missed references to option_definitions

* Update worlds/sm/variaRandomizer/utils/utils.py

Co-authored-by: Exempt-Medic <[email protected]>

* fixed conflicts and made SMZ3 accessibility related code more future proof

* Update worlds/smz3/Options.py

Co-authored-by: Exempt-Medic <[email protected]>

* Update worlds/smz3/__init__.py

Co-authored-by: Exempt-Medic <[email protected]>

---------

Co-authored-by: Exempt-Medic <[email protected]>
  • Loading branch information
lordlou and Exempt-Medic authored Aug 31, 2024
1 parent b37bb60 commit 7e0219c
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 160 deletions.
121 changes: 61 additions & 60 deletions worlds/sm/Options.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import typing
from Options import Choice, Range, OptionDict, OptionList, OptionSet, Option, Toggle, DefaultOnToggle
from Options import Choice, PerGameCommonOptions, Range, OptionDict, OptionList, OptionSet, Option, Toggle, DefaultOnToggle
from .variaRandomizer.utils.objectives import _goals
from dataclasses import dataclass

class StartItemsRemovesFromPool(Toggle):
"""Remove items in starting inventory from pool."""
Expand Down Expand Up @@ -372,62 +373,62 @@ class RelaxedRoundRobinCF(Toggle):
"""
display_name = "Relaxed round robin Crystal Flash"

sm_options: typing.Dict[str, type(Option)] = {
"start_inventory_removes_from_pool": StartItemsRemovesFromPool,
"preset": Preset,
"start_location": StartLocation,
"remote_items": RemoteItems,
"death_link": DeathLink,
#"majors_split": "Full",
#"scav_num_locs": "10",
#"scav_randomized": "off",
#"scav_escape": "off",
"max_difficulty": MaxDifficulty,
#"progression_speed": "medium",
#"progression_difficulty": "normal",
"morph_placement": MorphPlacement,
#"suits_restriction": SuitsRestriction,
"hide_items": HideItems,
"strict_minors": StrictMinors,
"missile_qty": MissileQty,
"super_qty": SuperQty,
"power_bomb_qty": PowerBombQty,
"minor_qty": MinorQty,
"energy_qty": EnergyQty,
"area_randomization": AreaRandomization,
"area_layout": AreaLayout,
"doors_colors_rando": DoorsColorsRando,
"allow_grey_doors": AllowGreyDoors,
"boss_randomization": BossRandomization,
#"minimizer": "off",
#"minimizer_qty": "45",
#"minimizer_tourian": "off",
"escape_rando": EscapeRando,
"remove_escape_enemies": RemoveEscapeEnemies,
"fun_combat": FunCombat,
"fun_movement": FunMovement,
"fun_suits": FunSuits,
"layout_patches": LayoutPatches,
"varia_tweaks": VariaTweaks,
"nerfed_charge": NerfedCharge,
"gravity_behaviour": GravityBehaviour,
#"item_sounds": "on",
"elevators_speed": ElevatorsSpeed,
"fast_doors": DoorsSpeed,
"spin_jump_restart": SpinJumpRestart,
"rando_speed": SpeedKeep,
"infinite_space_jump": InfiniteSpaceJump,
"refill_before_save": RefillBeforeSave,
"hud": Hud,
"animals": Animals,
"no_music": NoMusic,
"random_music": RandomMusic,
"custom_preset": CustomPreset,
"varia_custom_preset": VariaCustomPreset,
"tourian": Tourian,
"custom_objective": CustomObjective,
"custom_objective_list": CustomObjectiveList,
"custom_objective_count": CustomObjectiveCount,
"objective": Objective,
"relaxed_round_robin_cf": RelaxedRoundRobinCF,
}
@dataclass
class SMOptions(PerGameCommonOptions):
start_inventory_removes_from_pool: StartItemsRemovesFromPool
preset: Preset
start_location: StartLocation
remote_items: RemoteItems
death_link: DeathLink
#majors_split: "Full"
#scav_num_locs: "10"
#scav_randomized: "off"
#scav_escape: "off"
max_difficulty: MaxDifficulty
#progression_speed": "medium"
#progression_difficulty": "normal"
morph_placement: MorphPlacement
#suits_restriction": SuitsRestriction
hide_items: HideItems
strict_minors: StrictMinors
missile_qty: MissileQty
super_qty: SuperQty
power_bomb_qty: PowerBombQty
minor_qty: MinorQty
energy_qty: EnergyQty
area_randomization: AreaRandomization
area_layout: AreaLayout
doors_colors_rando: DoorsColorsRando
allow_grey_doors: AllowGreyDoors
boss_randomization: BossRandomization
#minimizer: "off"
#minimizer_qty: "45"
#minimizer_tourian: "off"
escape_rando: EscapeRando
remove_escape_enemies: RemoveEscapeEnemies
fun_combat: FunCombat
fun_movement: FunMovement
fun_suits: FunSuits
layout_patches: LayoutPatches
varia_tweaks: VariaTweaks
nerfed_charge: NerfedCharge
gravity_behaviour: GravityBehaviour
#item_sounds: "on"
elevators_speed: ElevatorsSpeed
fast_doors: DoorsSpeed
spin_jump_restart: SpinJumpRestart
rando_speed: SpeedKeep
infinite_space_jump: InfiniteSpaceJump
refill_before_save: RefillBeforeSave
hud: Hud
animals: Animals
no_music: NoMusic
random_music: RandomMusic
custom_preset: CustomPreset
varia_custom_preset: VariaCustomPreset
tourian: Tourian
custom_objective: CustomObjective
custom_objective_list: CustomObjectiveList
custom_objective_count: CustomObjectiveCount
objective: Objective
relaxed_round_robin_cf: RelaxedRoundRobinCF
38 changes: 18 additions & 20 deletions worlds/sm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

logger = logging.getLogger("Super Metroid")

from .Options import sm_options
from .Options import SMOptions
from .Client import SMSNIClient
from .Rom import get_base_rom_path, SM_ROM_MAX_PLAYERID, SM_ROM_PLAYERDATA_COUNT, SMDeltaPatch, get_sm_symbols
import Utils
Expand Down Expand Up @@ -96,10 +96,11 @@ class SMWorld(World):
a wide range of options to randomize Item locations, required skills and even the connections
between the main Areas!
"""

game: str = "Super Metroid"
topology_present = True
option_definitions = sm_options
options_dataclass = SMOptions
options: SMOptions

settings: typing.ClassVar[SMSettings]

item_name_to_id = {value.Name: items_start_id + value.Id for key, value in ItemManager.Items.items() if value.Id != None}
Expand Down Expand Up @@ -129,27 +130,27 @@ def generate_early(self):
Logic.factory('vanilla')

dummy_rom_file = Utils.user_path(SMSettings.RomFile.copy_to) # actual rom set in generate_output
self.variaRando = VariaRandomizer(self.multiworld, dummy_rom_file, self.player)
self.variaRando = VariaRandomizer(self.options, dummy_rom_file, self.player)
self.multiworld.state.smbm[self.player] = SMBoolManager(self.player, self.variaRando.maxDifficulty)

# 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
self.multiworld.local_items[self.player].value.add('Nothing')
self.multiworld.local_items[self.player].value.add('No Energy')
self.options.local_items.value.add('Nothing')
self.options.local_items.value.add('No Energy')

if (self.variaRando.args.morphPlacement == "early"):
self.multiworld.local_early_items[self.player]['Morph Ball'] = 1

self.remote_items = self.multiworld.remote_items[self.player]
self.remote_items = self.options.remote_items

if (len(self.variaRando.randoExec.setup.restrictedLocs) > 0):
self.multiworld.accessibility[self.player].value = Accessibility.option_minimal
self.options.accessibility.value = Accessibility.option_minimal
logger.warning(f"accessibility forced to 'minimal' for player {self.multiworld.get_player_name(self.player)} because of 'fun' settings")

def create_items(self):
itemPool = self.variaRando.container.itemPool
self.startItems = [variaItem for item in self.multiworld.precollected_items[self.player] for variaItem in ItemManager.Items.values() if variaItem.Name == item.name]
if self.multiworld.start_inventory_removes_from_pool[self.player]:
if self.options.start_inventory_removes_from_pool:
for item in self.startItems:
if (item in itemPool):
itemPool.remove(item)
Expand Down Expand Up @@ -317,10 +318,10 @@ def create_item(self, name: str) -> Item:
player=self.player)

def get_filler_item_name(self) -> str:
if self.multiworld.random.randint(0, 100) < self.multiworld.minor_qty[self.player].value:
power_bombs = self.multiworld.power_bomb_qty[self.player].value
missiles = self.multiworld.missile_qty[self.player].value
super_missiles = self.multiworld.super_qty[self.player].value
if self.multiworld.random.randint(0, 100) < self.options.minor_qty.value:
power_bombs = self.options.power_bomb_qty.value
missiles = self.options.missile_qty.value
super_missiles = self.options.super_qty.value
roll = self.multiworld.random.randint(1, power_bombs + missiles + super_missiles)
if roll <= power_bombs:
return "Power Bomb"
Expand Down Expand Up @@ -633,7 +634,7 @@ def APPostPatchRom(self, romPatcher):
deathLink: List[ByteEdit] = [{
"sym": symbols["config_deathlink"],
"offset": 0,
"values": [self.multiworld.death_link[self.player].value]
"values": [self.options.death_link.value]
}]
remoteItem: List[ByteEdit] = [{
"sym": symbols["config_remote_items"],
Expand Down Expand Up @@ -859,10 +860,7 @@ def modify_multidata(self, multidata: dict):
def fill_slot_data(self):
slot_data = {}
if not self.multiworld.is_race:
for option_name in self.option_definitions:
option = getattr(self.multiworld, option_name)[self.player]
slot_data[option_name] = option.value

slot_data = self.options.as_dict(*self.options_dataclass.type_hints)
slot_data["Preset"] = { "Knows": {},
"Settings": {"hardRooms": Settings.SettingsDict[self.player].hardRooms,
"bossesDifficulty": Settings.SettingsDict[self.player].bossesDifficulty,
Expand All @@ -887,14 +885,14 @@ def fill_slot_data(self):
return slot_data

def write_spoiler(self, spoiler_handle: TextIO):
if self.multiworld.area_randomization[self.player].value != 0:
if self.options.area_randomization.value != 0:
spoiler_handle.write('\n\nArea Transitions:\n\n')
spoiler_handle.write('\n'.join(['%s%s %s %s' % (f'{self.multiworld.get_player_name(self.player)}: '
if self.multiworld.players > 1 else '', src.Name,
'<=>',
dest.Name) for src, dest in self.variaRando.randoExec.areaGraph.InterAreaTransitions if not src.Boss]))

if self.multiworld.boss_randomization[self.player].value != 0:
if self.options.boss_randomization.value != 0:
spoiler_handle.write('\n\nBoss Transitions:\n\n')
spoiler_handle.write('\n'.join(['%s%s %s %s' % (f'{self.multiworld.get_player_name(self.player)}: '
if self.multiworld.players > 1 else '', src.Name,
Expand Down
14 changes: 7 additions & 7 deletions worlds/sm/variaRandomizer/randomizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,13 @@ class VariaRandomizer:
parser.add_argument('--tourianList', help="list to choose from when random",
dest='tourianList', nargs='?', default=None)

def __init__(self, world, rom, player):
def __init__(self, options, rom, player):
# parse args
self.args = copy.deepcopy(VariaRandomizer.parser.parse_args(["--logic", "varia"])) #dummy custom args to skip parsing _sys.argv while still get default values
self.player = player
args = self.args
args.rom = rom
# args.startLocation = to_pascal_case_with_space(world.startLocation[player].current_key)
# args.startLocation = to_pascal_case_with_space(options.startLocation.current_key)

if args.output is None and args.rom is None:
raise Exception("Need --output or --rom parameter")
Expand Down Expand Up @@ -288,7 +288,7 @@ def forceArg(arg, value, msg, altValue=None, webArg=None, webValue=None):
# print(msg)
# optErrMsgs.append(msg)

preset = loadRandoPreset(world, self.player, args)
preset = loadRandoPreset(options, args)
# use the skill preset from the rando preset
if preset is not None and preset != 'custom' and preset != 'varia_custom' and args.paramsFileName is None:
args.paramsFileName = "/".join((appDir, getPresetDir(preset), preset+".json"))
Expand All @@ -302,12 +302,12 @@ def forceArg(arg, value, msg, altValue=None, webArg=None, webValue=None):
preset = args.preset
else:
if preset == 'custom':
PresetLoader.factory(world.custom_preset[player].value).load(self.player)
PresetLoader.factory(options.custom_preset.value).load(self.player)
elif preset == 'varia_custom':
if len(world.varia_custom_preset[player].value) == 0:
if len(options.varia_custom_preset.value) == 0:
raise Exception("varia_custom was chosen but varia_custom_preset is missing.")
url = 'https://randommetroidsolver.pythonanywhere.com/presetWebService'
preset_name = next(iter(world.varia_custom_preset[player].value))
preset_name = next(iter(options.varia_custom_preset.value))
payload = '{{"preset": "{}"}}'.format(preset_name)
headers = {'content-type': 'application/json', 'Accept-Charset': 'UTF-8'}
response = requests.post(url, data=payload, headers=headers)
Expand Down Expand Up @@ -463,7 +463,7 @@ def forceArg(arg, value, msg, altValue=None, webArg=None, webValue=None):
args.startLocation = random.choice(possibleStartAPs)
elif args.startLocation not in possibleStartAPs:
args.startLocation = 'Landing Site'
world.start_location[player] = StartLocation(StartLocation.default)
options.start_location = StartLocation(StartLocation.default)
#optErrMsgs.append('Invalid start location: {}. {}'.format(args.startLocation, reasons[args.startLocation]))
#optErrMsgs.append('Possible start locations with these settings: {}'.format(possibleStartAPs))
#dumpErrorMsgs(args.output, optErrMsgs)
Expand Down
72 changes: 36 additions & 36 deletions worlds/sm/variaRandomizer/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,35 +358,35 @@ def convertParam(randoParams, param, inverse=False):
return "random"
raise Exception("invalid value for parameter {}".format(param))

def loadRandoPreset(world, player, args):
def loadRandoPreset(options, args):
defaultMultiValues = getDefaultMultiValues()
diffs = ["easy", "medium", "hard", "harder", "hardcore", "mania", "infinity"]
presetValues = getPresetValues()

args.animals = world.animals[player].value
args.noVariaTweaks = not world.varia_tweaks[player].value
args.maxDifficulty = diffs[world.max_difficulty[player].value]
#args.suitsRestriction = world.suits_restriction[player].value
args.hideItems = world.hide_items[player].value
args.strictMinors = world.strict_minors[player].value
args.noLayout = not world.layout_patches[player].value
args.gravityBehaviour = defaultMultiValues["gravityBehaviour"][world.gravity_behaviour[player].value]
args.nerfedCharge = world.nerfed_charge[player].value
args.area = world.area_randomization[player].current_key
args.animals = options.animals.value
args.noVariaTweaks = not options.varia_tweaks.value
args.maxDifficulty = diffs[options.max_difficulty.value]
#args.suitsRestriction = options.suits_restriction.value
args.hideItems = options.hide_items.value
args.strictMinors = options.strict_minors.value
args.noLayout = not options.layout_patches.value
args.gravityBehaviour = defaultMultiValues["gravityBehaviour"][options.gravity_behaviour.value]
args.nerfedCharge = options.nerfed_charge.value
args.area = options.area_randomization.current_key
if (args.area == "true"):
args.area = "full"
if args.area != "off":
args.areaLayoutBase = not world.area_layout[player].value
args.escapeRando = world.escape_rando[player].value
args.noRemoveEscapeEnemies = not world.remove_escape_enemies[player].value
args.doorsColorsRando = world.doors_colors_rando[player].value
args.allowGreyDoors = world.allow_grey_doors[player].value
args.bosses = world.boss_randomization[player].value
if world.fun_combat[player].value:
args.areaLayoutBase = not options.area_layout.value
args.escapeRando = options.escape_rando.value
args.noRemoveEscapeEnemies = not options.remove_escape_enemies.value
args.doorsColorsRando = options.doors_colors_rando.value
args.allowGreyDoors = options.allow_grey_doors.value
args.bosses = options.boss_randomization.value
if options.fun_combat.value:
args.superFun.append("Combat")
if world.fun_movement[player].value:
if options.fun_movement.value:
args.superFun.append("Movement")
if world.fun_suits[player].value:
if options.fun_suits.value:
args.superFun.append("Suits")

ipsPatches = { "spin_jump_restart":"spinjumprestart",
Expand All @@ -396,36 +396,36 @@ def loadRandoPreset(world, player, args):
"refill_before_save":"refill_before_save",
"relaxed_round_robin_cf":"relaxed_round_robin_cf"}
for settingName, patchName in ipsPatches.items():
if hasattr(world, settingName) and getattr(world, settingName)[player].value:
if hasattr(options, settingName) and getattr(options, settingName).value:
args.patches.append(patchName + '.ips')

patches = {"no_music":"No_Music", "infinite_space_jump":"Infinite_Space_Jump"}
for settingName, patchName in patches.items():
if hasattr(world, settingName) and getattr(world, settingName)[player].value:
if hasattr(options, settingName) and getattr(options, settingName).value:
args.patches.append(patchName)

args.hud = world.hud[player].value
args.morphPlacement = defaultMultiValues["morphPlacement"][world.morph_placement[player].value]
args.hud = options.hud.value
args.morphPlacement = defaultMultiValues["morphPlacement"][options.morph_placement.value]
#args.majorsSplit
#args.scavNumLocs
#args.scavRandomized
args.startLocation = defaultMultiValues["startLocation"][world.start_location[player].value]
args.startLocation = defaultMultiValues["startLocation"][options.start_location.value]
#args.progressionDifficulty
#args.progressionSpeed
args.missileQty = world.missile_qty[player].value / float(10)
args.superQty = world.super_qty[player].value / float(10)
args.powerBombQty = world.power_bomb_qty[player].value / float(10)
args.minorQty = world.minor_qty[player].value
args.energyQty = defaultMultiValues["energyQty"][world.energy_qty[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.missileQty = options.missile_qty.value / float(10)
args.superQty = options.super_qty.value / float(10)
args.powerBombQty = options.power_bomb_qty.value / float(10)
args.minorQty = options.minor_qty.value
args.energyQty = defaultMultiValues["energyQty"][options.energy_qty.value]
args.objectiveRandom = options.custom_objective.value
args.objectiveList = list(options.custom_objective_list.value)
args.nbObjective = options.custom_objective_count.value
args.objective = list(options.objective.value)
args.tourian = defaultMultiValues["tourian"][options.tourian.value]
#args.minimizerN
#args.minimizerTourian

return presetValues[world.preset[player].value]
return presetValues[options.preset.value]

def getRandomizerDefaultParameters():
defaultParams = {}
Expand Down
Loading

0 comments on commit 7e0219c

Please sign in to comment.