Skip to content

Commit

Permalink
Noita: Do some cleanup to make mypy happy (ArchipelagoMW#3114)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScipioWright authored and EmilyV99 committed Apr 15, 2024
1 parent 3637833 commit 47bac30
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion worlds/noita/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class NoitaWorld(World):

web = NoitaWeb()

def generate_early(self):
def generate_early(self) -> None:
if not self.multiworld.get_player_name(self.player).isascii():
raise Exception("Noita yaml's slot name has invalid character(s).")

Expand Down
2 changes: 1 addition & 1 deletion worlds/noita/locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class NoitaLocation(Location):
class LocationData(NamedTuple):
id: int
flag: int = 0
ltype: Optional[str] = "shop"
ltype: str = "shop"


class LocationFlag(IntEnum):
Expand Down
2 changes: 1 addition & 1 deletion worlds/noita/regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def create_regions(world: "NoitaWorld") -> Dict[str, Region]:


# An "Entrance" is really just a connection between two regions
def create_entrance(player: int, source: str, destination: str, regions: Dict[str, Region]):
def create_entrance(player: int, source: str, destination: str, regions: Dict[str, Region]) -> Entrance:
entrance = Entrance(player, f"From {source} To {destination}", regions[source])
entrance.connect(regions[destination])
return entrance
Expand Down
4 changes: 2 additions & 2 deletions worlds/noita/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def has_orb_count(state: CollectionState, player: int, amount: int) -> bool:
return state.count("Orb", player) >= amount


def forbid_items_at_locations(world: "NoitaWorld", shop_locations: Set[str], forbidden_items: Set[str]):
def forbid_items_at_locations(world: "NoitaWorld", shop_locations: Set[str], forbidden_items: Set[str]) -> None:
for shop_location in shop_locations:
location = world.multiworld.get_location(shop_location, world.player)
GenericRules.forbid_items_for_player(location, forbidden_items, world.player)
Expand Down Expand Up @@ -129,7 +129,7 @@ def holy_mountain_unlock_conditions(world: "NoitaWorld") -> None:
)


def biome_unlock_conditions(world: "NoitaWorld"):
def biome_unlock_conditions(world: "NoitaWorld") -> None:
lukki_entrances = world.multiworld.get_region("Lukki Lair", world.player).entrances
magical_entrances = world.multiworld.get_region("Magical Temple", world.player).entrances
wizard_entrances = world.multiworld.get_region("Wizards' Den", world.player).entrances
Expand Down

0 comments on commit 47bac30

Please sign in to comment.