Skip to content

Commit

Permalink
Merge pull request ArchipelagoMW#5 from ScipioWright/sw-noita
Browse files Browse the repository at this point in the history
Items, locations, and options additions
  • Loading branch information
DaftBrit authored Dec 14, 2022
2 parents 07878e7 + 40f091c commit 497cce1
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 14 deletions.
6 changes: 3 additions & 3 deletions worlds/noita/Events.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ def create_location(player: int, name: str, region: Region) -> Location:
return Locations.NoitaLocation(player, name, None, region)


def create_locked_location_event(world: MultiWorld, player: int, region_name: str, event_name: str) -> Location:
def create_locked_location_event(world: MultiWorld, player: int, region_name: str, item: str) -> Location:
region = world.get_region(region_name, player)

new_location = create_location(player, event_name, region)
new_location.place_locked_item(create_event(player, event_name))
new_location = create_location(player, item, region)
new_location.place_locked_item(create_event(player, item))

region.locations.append(new_location)
return new_location
Expand Down
2 changes: 2 additions & 0 deletions worlds/noita/Items.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def create_all_items(world: MultiWorld, player: int) -> None:
"Perk (Tinker With Wands Everywhere)": ItemData(110019, "Perks", ItemClassification.progression, 1),
"Perk (All-Seeing Eye)": ItemData(110020, "Perks", ItemClassification.progression, 1),
"Perk (Extra Life)": ItemData(110021, "Repeatable Perks", ItemClassification.useful),
"Orb": ItemData(110022, "Orbs", ItemClassification.progression, 11)
# todo: update orbs count to an orb_count variable that takes from options
}


Expand Down
56 changes: 55 additions & 1 deletion worlds/noita/Locations.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ class NoitaLocation(Location):
game: str = "Noita"


# TODO: It gets weird about filling locations, always giving an unfilled locations error

# 111000 - 111034
# Mapping of items in each region
location_region_mapping: Dict[str, Dict[str, int]] = {
"Forest": {
# 110000 - 110500
# Just putting these here for now
f"Chest{i+1}": 110000+i for i in range(TotalLocations.range_end)
# TODO: Figure out the best way to subtract out the locations occupied by shops, orbs, etc.
},
"Holy Mountain 1 (To Coal Pits)": {
"Holy Mountain 1 (To Coal Pits) Shop Item 1": 111000,
Expand Down Expand Up @@ -65,7 +68,58 @@ class NoitaLocation(Location):
"Holy Mountain 7 (To The Laboratory) Shop Item 3": 111032,
"Holy Mountain 7 (To The Laboratory) Shop Item 4": 111033,
"Holy Mountain 7 (To The Laboratory) Shop Item 5": 111034,
}
},
"Orbs": {
# TODO: place the orbs in their regions, figure out what to do with the lava lake orbs, hook into Noita mod
"Pyramid Orb": 110501,
"Floating Island Orb": 110502,
"Frozen Vault Orb": 110503,
"Lava Lake Orb": 110504,
"Sandcave Orb": 110505,
"Magical Temple Orb": 110506,
"Lukki Lair Orb": 110507,
"Abyss Orb": 110508, # this is the orb room to the right of the lava lake, rename probably
"The Work (Hell) Orb": 110509,
"Snow Chasm Orb": 110510,
"Wizard's Den Orb": 110511,
"West Pyramid Orb": 110512,
"West Floating Island Orb": 110513,
"West Frozen Vault Orb": 110514,
"West Lava Lake Orb": 110515, # does not spawn in new game not plus
"West Sandcave Orb": 110516,
"West Magical Temple Orb": 110517,
"West Lukki Lair Orb": 110518,
"West Abyss Orb": 110519,
"West The Work (Hell) Orb": 110520,
"West Snow Chasm Orb": 110521,
"West Wizard's Den Orb": 110522,
"East Pyramid Orb": 110523,
"East Floating Island Orb": 110524,
"East Frozen Vault Orb": 110525,
"East Lava Lake Orb": 110526, # does not spawn in new game not plus
"East Sandcave Orb": 110527,
"East Magical Temple Orb": 110528,
"East Lukki Lair Orb": 110529,
"East Abyss Orb": 110530,
"East The Work (Hell) Orb": 110531,
"East Snow Chasm Orb": 110532,
"East Wizard's Den Orb": 110533,
},
"Bosses": {
# TODO: place the bosses at their spots, hook it into the noita mod
"Kolmisilma": 110600, # the final boss
"Limatoukka": 110610, # the underground slime maggot
"Suomuhauki": 110620, # the dragon, the thing in the egg
"Kolmisilman Koipi": 110630, # the green eye thing in the pyramid
"Sauvojen Tuntija": 110640, # squidward, the guy to the right of the lava lake
"Syvaolento": 110650, # the lake boss
"Gate Guardian": 110660, # the triangle that you have to throw eggs at
"Unohdettu": 110670, # the skull at the bottom of the icy place that you need paha silma for
"Toveri": 110680, # one of our best friends in the world why would you kill him you monster
"Mestarien mestari": 110690, # the dark souls lookin' dude
"Ylialkemisi": 110700, # the alchemist to the left of the dark cave
"Kolmisilman silma": 110710 # mecha kolmi
},
}

location_name_to_id: Dict[str, int] = {}
Expand Down
38 changes: 34 additions & 4 deletions worlds/noita/Options.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import Dict
from Options import Option, DeathLink, DefaultOnToggle, Range
from Options import Option, DeathLink, DefaultOnToggle, Range, Choice


class TotalLocations(Range):
Expand All @@ -15,8 +15,38 @@ class BadEffects(DefaultOnToggle):
display_name = "Bad Times"


class VictoryCondition(Choice):
"""Greed is to get to the bottom, grab the sampo, beat the boss, and enter the portal
Pure is to get the 11 orbs in the main world, grab the sampo, and bring it to the mountain altar
Peaceful is to get all 33 orbs in main + parallel, grab the sampo, and bring it to the mountain altar
Yendor is peaceful but with 34 orbs. Might not keep this one."""
display_name = "Victory Condition"
option_victory_greed = 0
option_victory_pure = 1
option_victory_peaceful = 2
option_victory_yendor = 3
default = 0


class OrbsAsChecks(Choice):
"""fill this in later"""
display_name = "Orbs as Location Checks"
option_no_orbs = 0
option_main_world = 1
option_parallel_no_lava = 2
default = 0


class BossesAsChecks(DefaultOnToggle):
"""fill this in later"""
display_name = "Bosses as Location Checks"


noita_options: Dict[str, type(Option)] = {
"total_locations": TotalLocations,
"bad_effects": BadEffects,
"death_link": DeathLink
"total_locations": TotalLocations,
"bad_effects": BadEffects,
"death_link": DeathLink,
"victory_condition": VictoryCondition,
"orbs_as_checks": OrbsAsChecks,
"bosses_as_checks": BossesAsChecks,
}
20 changes: 14 additions & 6 deletions worlds/noita/Regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ def create_all_regions_and_connections(world: MultiWorld, player: int) -> None:

"Mines": {"Collapsed Mines", "Holy Mountain 1 (To Coal Pits)", "Lava Lake", "Forest"},
"Collapsed Mines": {"Mines", "Holy Mountain 1 (To Coal Pits)", "Dark Cave"},
"Lava Lake": {"Mines", "Shaft"},
"Shaft": {"Lava Lake", "Snowy Depths"},
"Lava Lake": {"Mines", "Shaft", "Orb Room", "Below Lava Lake"},
"Shaft": {"Lava Lake", "Snowy Depths", "Orb Room", "Below Lava Lake"},
"Orb Room": {"Lava Lake", "Shaft"},
"Below Lava Lake": {"Lava Lake", "Shaft"},
"Dark Cave": {"Ancient Laboratory", "Collapsed Mines"},
"Ancient Laboratory": {"Dark Cave"},

###
"Holy Mountain 1 (To Coal Pits)": {"Coal Pits"},
Expand All @@ -67,7 +71,8 @@ def create_all_regions_and_connections(world: MultiWorld, player: int) -> None:

###
"Holy Mountain 2 (To Snowy Depths)": {"Snowy Depths"},
"Snowy Depths": {"Shaft", "Holy Mountain 2 (To Snowy Depths)", "Holy Mountain 3 (To Hiisi Base)"},
"Snowy Depths": {"Shaft", "Holy Mountain 2 (To Snowy Depths)", "Holy Mountain 3 (To Hiisi Base)", "Magical Temple"},
"Magical Temple": {"Snowy Depths"},

###
"Holy Mountain 3 (To Hiisi Base)": {"Hiisi Base"},
Expand All @@ -76,15 +81,18 @@ def create_all_regions_and_connections(world: MultiWorld, player: int) -> None:
###
"Holy Mountain 4 (To Underground Jungle)": {"Underground Jungle"},
"Dragoncave": {"Underground Jungle"},
"Underground Jungle": {"Holy Mountain 4 (To Underground Jungle)", "Dragoncave", "Holy Mountain 5 (To The Vault)"},
"Underground Jungle": {"Holy Mountain 4 (To Underground Jungle)", "Dragoncave", "Holy Mountain 5 (To The Vault)",
"Lukki Lair"},
"Lukki Lair": {"Underground Jungle", "The Vault"},

###
"Holy Mountain 5 (To The Vault)": {"The Vault"},
"The Vault": {"Holy Mountain 5 (To The Vault)", "Holy Mountain 6 (To Temple of the Art)"},
"The Vault": {"Holy Mountain 5 (To The Vault)", "Holy Mountain 6 (To Temple of the Art)", "Lukki Lair"},

###
"Holy Mountain 6 (To Temple of the Art)": {"Temple of the Art"},
"Temple of the Art": {"Holy Mountain 6 (To Temple of the Art)", "Holy Mountain 7 (To The Laboratory)"},
"Temple of the Art": {"Holy Mountain 6 (To Temple of the Art)", "Holy Mountain 7 (To The Laboratory)", "The Tower"},
"The Tower": {"Forest"},

###
"Holy Mountain 7 (To The Laboratory)": {"The Laboratory"},
Expand Down
4 changes: 4 additions & 0 deletions worlds/noita/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from worlds.AutoWorld import World, WebWorld

from . import Options, Items, Locations, Regions, Rules, Events
from .Options import noita_options

# TODO: Ban higher tier wands from appearing in earlier locations
# TODO: Gate holy mountain access behind an event that triggers when you visit the same holy mountain?
Expand Down Expand Up @@ -62,4 +63,7 @@ def fill_slot_data(self):
"totalLocations": self.world.total_locations[self.player].value,
"badEffects": self.world.bad_effects[self.player].value,
"deathLink": self.world.death_link[self.player].value,
"victoryCondition": self.world.victory_condition[self.player].value,
"orbsAsChecks": self.world.orbs_as_checks[self.player].value,
"bossesAsChecks": self.world.bosses_as_checks[self.player].value,
}

0 comments on commit 497cce1

Please sign in to comment.