forked from ArchipelagoMW/Archipelago
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Noita: Update to use new Options API (ArchipelagoMW#2370)
Reworking the options to make it work with the new options API. Also reworked stuff in several spots to use world: NoitaWorld instead of multiworld: MultiWorld
- Loading branch information
1 parent
1307754
commit 5f9ce2b
Showing
9 changed files
with
314 additions
and
301 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from typing import Dict, TYPE_CHECKING | ||
from BaseClasses import Item, ItemClassification, Location, Region | ||
from . import items, locations | ||
|
||
if TYPE_CHECKING: | ||
from . import NoitaWorld | ||
|
||
|
||
def create_event(player: int, name: str) -> Item: | ||
return items.NoitaItem(name, ItemClassification.progression, None, player) | ||
|
||
|
||
def create_location(player: int, name: str, region: Region) -> Location: | ||
return locations.NoitaLocation(player, name, None, region) | ||
|
||
|
||
def create_locked_location_event(player: int, region: Region, item: str) -> Location: | ||
new_location = create_location(player, item, region) | ||
new_location.place_locked_item(create_event(player, item)) | ||
|
||
region.locations.append(new_location) | ||
return new_location | ||
|
||
|
||
def create_all_events(world: "NoitaWorld", created_regions: Dict[str, Region]) -> None: | ||
for region_name, event in event_locks.items(): | ||
region = created_regions[region_name] | ||
create_locked_location_event(world.player, region, event) | ||
|
||
world.multiworld.completion_condition[world.player] = lambda state: state.has("Victory", world.player) | ||
|
||
|
||
# Maps region names to event names | ||
event_locks: Dict[str, str] = { | ||
"The Work": "Victory", | ||
"Mines": "Portal to Holy Mountain 1", | ||
"Coal Pits": "Portal to Holy Mountain 2", | ||
"Snowy Depths": "Portal to Holy Mountain 3", | ||
"Hiisi Base": "Portal to Holy Mountain 4", | ||
"Underground Jungle": "Portal to Holy Mountain 5", | ||
"The Vault": "Portal to Holy Mountain 6", | ||
"Temple of the Art": "Portal to Holy Mountain 7", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.