Skip to content
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

Merged
merged 1 commit into from
May 14, 2024
Merged

update config #4

merged 1 commit into from
May 14, 2024

Conversation

hesto2
Copy link
Collaborator

@hesto2 hesto2 commented May 14, 2024

This looks like a lot more changes than it actually is, most of it is whitespace changes. Here are the updates:

  • Most of the config had items nested under properties which is a JSON schema keyword but not something the actual config was expecting. Removed that, type, and additionalProperties from each of the objects and that got randomprime working smoothly 🎉
  • Hard coded combat/scan visors and power beam as starting items since we don't have them used in logic right now.
  • Updated the way it pulls the text to show when you pick up an item
  • Removed Unknown Item 1 from the item pool so we don't have it shuffled in
  • Made a few small tweaks around the World class in __init__ so it'll be able to accept an ISO input

remove extra file

minor schema changes, ap world output update, text formatting for item text
@@ -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),
Copy link
Collaborator Author

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 🤷

"Wavebuster": ItemData("Wavebuster", 28, ItemClassification.filler),
}

misc_item_table: dict[str, ItemData] = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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)

@@ -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
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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 🎉

# convert configjson to json
import json

configjsons = json.dumps(configjson, indent=4)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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

from typing import Dict, Any


def starting_inventory(world, item) -> bool:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed from self to world since these functions are not methods inside of a class

def item_text(world, location) -> str:
loc = world.multiworld.get_location(location, world.player)
player_name = f"{world.multiworld.player_name[location.player]} " if loc.player != world.player else ""
return f"{player_name}{loc.item.name}"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grab the item name from the location 👍

"poisonDamagePerSec": 0.11,
"phazonDamagePerSec": 0.964,
"phazonDamageModifier": "Default",
"autoEnabledElevators": True,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I turned this on for testing, let me know if you want to keep it disabled or we can add it as a config option 👍

},
"rooms": {
"Landing Site": {
"pickups": [{
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I learned that pickups needs to be an array of objects, you'll see a lot of updates for the rest of the file with that change guiding it.

Copy link
Owner

@Electro1512 Electro1512 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely leave the pre-scanned elevators in that seems to be a popular feature. Looking forward to getting to test this!

@Electro1512 Electro1512 merged commit 614bea0 into main May 14, 2024
23 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants