-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update config #4
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,3 +198,6 @@ minecraft_versions.json | |
.LSOverride | ||
Thumbs.db | ||
[Dd]esktop.ini | ||
|
||
config.json | ||
prime.iso |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ class MetroidPrimeItem(Item): | |
"Plasma Beam": ItemData("Plasma Beam", 3, ItemClassification.progression), | ||
"Missile Expansion": ItemData("Missile Expansion", 4, ItemClassification.useful, 999), | ||
"Scan Visor": ItemData("Scan Visor", 5, ItemClassification.progression), | ||
"Morph Ball Bombs": ItemData("Morph Ball Bombs", 6, ItemClassification.progression), | ||
"Morph Ball Bomb": ItemData("Morph Ball Bomb", 6, ItemClassification.progression), | ||
"Power Bomb Expansion": ItemData("Power Bomb Expansion", 7, ItemClassification.useful, 99), | ||
"Flamethrower": ItemData("Flamethrower", 8, ItemClassification.filler), | ||
"Thermal Visor": ItemData("Thermal Visor", 9, ItemClassification.progression), | ||
|
@@ -48,12 +48,15 @@ class MetroidPrimeItem(Item): | |
"Varia Suit": ItemData("Varia Suit", 22, ItemClassification.progression), | ||
"Phazon Suit": ItemData("Phazon Suit", 23, ItemClassification.progression), | ||
"Energy Tank": ItemData("Energy Tank", 24, ItemClassification.useful, 14), | ||
"UnknownItem1": ItemData("UnknownItem1", 25, ItemClassification.useful), | ||
# item 026 is a health refill | ||
"Ice Trap": ItemData("Ice Trap", 27, ItemClassification.trap), | ||
"Wavebuster": ItemData("Wavebuster", 28, ItemClassification.filler), | ||
} | ||
|
||
misc_item_table: dict[str, ItemData] = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved these out so they aren't included in the item pool for now (we'll obviously want to move ice traps back in eventually) |
||
"UnknownItem1": ItemData("UnknownItem1", 25, ItemClassification.useful), | ||
"Ice Trap": ItemData("Ice Trap", 27, ItemClassification.trap), | ||
} | ||
|
||
# These item ids are invalid in the player state, we'll need to exclude it from logic relying on that | ||
custom_suit_upgrade_table: dict[str, ItemData] = { | ||
"Main Missile": ItemData("Main Missile", 41, ItemClassification.progression), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from pathlib import Path | ||
from typing import Any, Dict, List | ||
from BaseClasses import Item, Tutorial, ItemClassification | ||
from .Items import MetroidPrimeItem, suit_upgrade_table, artifact_table, item_table, custom_suit_upgrade_table | ||
|
@@ -45,6 +46,7 @@ class MetroidPrimeWorld(World): | |
topology_present = True | ||
item_name_to_id = {name: data.code for name, data in item_table.items()} | ||
location_name_to_id = every_location | ||
settings: MetroidPrimeSettings | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once I wired this up that settings class worked as expected and correctly asked me to put in an ISO 🎉 |
||
|
||
def create_regions(self) -> None: | ||
boss_selection = int(self.options.final_bosses) | ||
|
@@ -113,9 +115,22 @@ def set_rules(self) -> None: | |
self.multiworld.completion_condition[self.player] = lambda state: ( | ||
state.can_reach("Mission Complete", "Region", self.player)) | ||
|
||
def generate_output(self) -> None: | ||
configjson = make_config(self, self.options) | ||
py_randomprime.patch_iso(self.settings.rom_file, "prime_out.iso", configjson) | ||
def generate_output(self, output_directory: str) -> None: | ||
configjson = make_config(self) | ||
# convert configjson to json | ||
import json | ||
|
||
configjsons = json.dumps(configjson, indent=4) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I left this in for now just to make debugging the config easier, I'm good to remove if you want or to flag it so it only does it if we have a debug argument passed in or something |
||
# TODO: Remove this later | ||
# write configjson to a file for review | ||
with open("config.json", "w") as file: | ||
file.write(configjsons) | ||
notifier = py_randomprime.ProgressNotifier(lambda progress, message: print("Generating ISO: ", progress, message)) | ||
|
||
input_iso_path = Path(settings.get_settings().metroidprime_options.rom_file) | ||
output_iso_path = Path(f"{output_directory}\prime_out.iso") | ||
|
||
py_randomprime.patch_iso(input_iso_path, output_iso_path, configjson, notifier) | ||
|
||
def fill_slot_data(self) -> Dict[str, Any]: | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
randomprime expects this to be singular 🤷