Skip to content

Commit

Permalink
cleanup code for a befitting 1.1.0 release... and so unittests stop y…
Browse files Browse the repository at this point in the history
…elling at me
  • Loading branch information
Ehseezed committed Sep 5, 2024
1 parent 71a0fa8 commit 7bcf671
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .run/Archipelago Unittests.run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Archipelago Unittests" type="tests" factoryName="Unittests">
<module name="Archipelago" />
<module name="Archipelago-Integration" />
<option name="ENV_FILES" value="" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
Expand Down
7 changes: 5 additions & 2 deletions worlds/am2r/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .items import item_table
from .locations import get_location_datas, EventId
from .regions import create_regions_and_locations
from BaseClasses import Tutorial, Item
from BaseClasses import Tutorial, Item, ItemClassification
from .options import AM2R_options, LocationSettings
from worlds.AutoWorld import World, WebWorld
from worlds.LauncherComponents import Component, components, Type, launch_subprocess
Expand Down Expand Up @@ -52,10 +52,14 @@ def fill_slot_data(self) -> Dict[str, object]:

def create_regions(self) -> None:
create_regions_and_locations(self.multiworld, self.player)
self.multiworld.get_location("The Last Metroid is in Captivity", self.player).place_locked_item(self.create_event("The Galaxy is at Peace"))

def create_item(self, name: str) -> Item:
return items.create_item(self.player, name)

def create_event(self, event: str):
return Item(event, ItemClassification.progression, None, self.player)

def create_items(self) -> None:
if self.options.MetroidsRequired > self.options.MetroidsInPool:
logger.warning(f"Metroids in pool raised to {self.options.MetroidsRequired.value} for {self.multiworld.get_player_name(self.player)} because the given count was too low for the requirement.")
Expand Down Expand Up @@ -113,7 +117,6 @@ def create_items(self) -> None:
self.multiworld.exclude_locations[self.player].value.add("Deep Caves: Ramulken Lava Pool")
self.multiworld.exclude_locations[self.player].value.add("Deep Caves: After Omega")

self.multiworld.get_location("The Last Metroid is in Captivity", self.player).place_locked_item(self.create_item("The Galaxy is at Peace"))
items.create_all_items(self.multiworld, self.player)

def set_rules(self) -> None:
Expand Down
1 change: 0 additions & 1 deletion worlds/am2r/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ def create_all_items(multiworld: MultiWorld, player: int) -> None:
"OHKO Trap": ItemData(108678026, "Trap", ItemClassification.trap, 25),
"Touhou Trap": ItemData(108678027, "Trap", ItemClassification.trap, 26),
"Metroid": ItemData(108678025, "MacGuffin", ItemClassification.progression_skip_balancing, 19),
"The Galaxy is at Peace": ItemData(None, "", ItemClassification.progression)

}
filler_weights: Dict[str, int] = {
Expand Down
2 changes: 1 addition & 1 deletion worlds/am2r/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def create_regions_and_locations(world: MultiWorld, player: int):
connect(world, player, "Pipe Hell L", "Fast Travel", lambda state: state.has("Screw Attack", player)),
connect(world, player, "Fast Travel", "Pipe Hell L", lambda state: state.has("Screw Attack", player)),

connect(world, player, "Fast Travel", "Gravity", lambda state: state.has("Gravity Suit", player) and state.has("Space Jump")), # one way transition due to crumbles
connect(world, player, "Fast Travel", "Gravity", lambda state: state.has("Gravity Suit", player) and state.has("Space Jump", player)), # one way transition due to crumbles

connect(world, player, "Fast Travel", "Underwater Distribution Center"),
connect(world, player, "Underwater Distribution Center", "Fast Travel", lambda state: state.can_reach("Fast Travel", "Region", player)),
Expand Down

0 comments on commit 7bcf671

Please sign in to comment.