Skip to content

Commit 31a5696

Browse files
authored
Noita: Add more location groups, capitalize existing ones (#3141)
* Add location groups for each region * Capitalize existing location groups * Capitalize new boss location group names * Update comment with capitalization * Capitalize location_type in reigons.py
1 parent 7bdf9a6 commit 31a5696

File tree

2 files changed

+69
-66
lines changed

2 files changed

+69
-66
lines changed

worlds/noita/locations.py

+65-62
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class NoitaLocation(Location):
1212
class LocationData(NamedTuple):
1313
id: int
1414
flag: int = 0
15-
ltype: str = "shop"
15+
ltype: str = "Shop"
1616

1717

1818
class LocationFlag(IntEnum):
@@ -25,7 +25,7 @@ class LocationFlag(IntEnum):
2525

2626
# Mapping of items in each region.
2727
# Only the first Hidden Chest and Pedestal are mapped here, the others are created in Regions.
28-
# ltype key: "chest" = Hidden Chests, "pedestal" = Pedestals, "boss" = Boss, "orb" = Orb.
28+
# ltype key: "Chest" = Hidden Chests, "Pedestal" = Pedestals, "Boss" = Boss, "Orb" = Orb.
2929
# 110000-110671
3030
location_region_mapping: Dict[str, Dict[str, LocationData]] = {
3131
"Coal Pits Holy Mountain": {
@@ -91,117 +91,118 @@ class LocationFlag(IntEnum):
9191
"Secret Shop Item 4": LocationData(110045),
9292
},
9393
"The Sky": {
94-
"Kivi": LocationData(110670, LocationFlag.main_world, "boss"),
94+
"Kivi": LocationData(110670, LocationFlag.main_world, "Boss"),
9595
},
9696
"Floating Island": {
97-
"Floating Island Orb": LocationData(110658, LocationFlag.main_path, "orb"),
97+
"Floating Island Orb": LocationData(110658, LocationFlag.main_path, "Orb"),
9898
},
9999
"Pyramid": {
100-
"Kolmisilmän Koipi": LocationData(110649, LocationFlag.main_world, "boss"),
101-
"Pyramid Orb": LocationData(110659, LocationFlag.main_world, "orb"),
102-
"Sandcave Orb": LocationData(110662, LocationFlag.main_world, "orb"),
100+
"Kolmisilmän Koipi": LocationData(110649, LocationFlag.main_world, "Boss"),
101+
"Pyramid Orb": LocationData(110659, LocationFlag.main_world, "Orb"),
102+
"Sandcave Orb": LocationData(110662, LocationFlag.main_world, "Orb"),
103103
},
104104
"Overgrown Cavern": {
105-
"Overgrown Cavern Chest": LocationData(110526, LocationFlag.main_world, "chest"),
106-
"Overgrown Cavern Pedestal": LocationData(110546, LocationFlag.main_world, "pedestal"),
105+
"Overgrown Cavern Chest": LocationData(110526, LocationFlag.main_world, "Chest"),
106+
"Overgrown Cavern Pedestal": LocationData(110546, LocationFlag.main_world, "Pedestal"),
107107
},
108108
"Lake": {
109-
"Syväolento": LocationData(110651, LocationFlag.main_world, "boss"),
110-
"Tapion vasalli": LocationData(110669, LocationFlag.main_world, "boss"),
109+
"Syväolento": LocationData(110651, LocationFlag.main_world, "Boss"),
110+
"Tapion vasalli": LocationData(110669, LocationFlag.main_world, "Boss"),
111111
},
112112
"Frozen Vault": {
113-
"Frozen Vault Orb": LocationData(110660, LocationFlag.main_world, "orb"),
114-
"Frozen Vault Chest": LocationData(110566, LocationFlag.main_world, "chest"),
115-
"Frozen Vault Pedestal": LocationData(110586, LocationFlag.main_world, "pedestal"),
113+
"Frozen Vault Orb": LocationData(110660, LocationFlag.main_world, "Orb"),
114+
"Frozen Vault Chest": LocationData(110566, LocationFlag.main_world, "Chest"),
115+
"Frozen Vault Pedestal": LocationData(110586, LocationFlag.main_world, "Pedestal"),
116116
},
117117
"Mines": {
118-
"Mines Chest": LocationData(110046, LocationFlag.main_path, "chest"),
119-
"Mines Pedestal": LocationData(110066, LocationFlag.main_path, "pedestal"),
118+
"Mines Chest": LocationData(110046, LocationFlag.main_path, "Chest"),
119+
"Mines Pedestal": LocationData(110066, LocationFlag.main_path, "Pedestal"),
120120
},
121121
# Collapsed Mines is a very small area, combining it with the Mines. Leaving this here as a reminder
122+
122123
"Ancient Laboratory": {
123-
"Ylialkemisti": LocationData(110656, LocationFlag.side_path, "boss"),
124+
"Ylialkemisti": LocationData(110656, LocationFlag.side_path, "Boss"),
124125
},
125126
"Abyss Orb Room": {
126-
"Sauvojen Tuntija": LocationData(110650, LocationFlag.side_path, "boss"),
127-
"Abyss Orb": LocationData(110665, LocationFlag.main_path, "orb"),
127+
"Sauvojen Tuntija": LocationData(110650, LocationFlag.side_path, "Boss"),
128+
"Abyss Orb": LocationData(110665, LocationFlag.main_path, "Orb"),
128129
},
129130
"Below Lava Lake": {
130-
"Lava Lake Orb": LocationData(110661, LocationFlag.side_path, "orb"),
131+
"Lava Lake Orb": LocationData(110661, LocationFlag.side_path, "Orb"),
131132
},
132133
"Coal Pits": {
133-
"Coal Pits Chest": LocationData(110126, LocationFlag.main_path, "chest"),
134-
"Coal Pits Pedestal": LocationData(110146, LocationFlag.main_path, "pedestal"),
134+
"Coal Pits Chest": LocationData(110126, LocationFlag.main_path, "Chest"),
135+
"Coal Pits Pedestal": LocationData(110146, LocationFlag.main_path, "Pedestal"),
135136
},
136137
"Fungal Caverns": {
137-
"Fungal Caverns Chest": LocationData(110166, LocationFlag.side_path, "chest"),
138-
"Fungal Caverns Pedestal": LocationData(110186, LocationFlag.side_path, "pedestal"),
138+
"Fungal Caverns Chest": LocationData(110166, LocationFlag.side_path, "Chest"),
139+
"Fungal Caverns Pedestal": LocationData(110186, LocationFlag.side_path, "Pedestal"),
139140
},
140141
"Snowy Depths": {
141-
"Snowy Depths Chest": LocationData(110206, LocationFlag.main_path, "chest"),
142-
"Snowy Depths Pedestal": LocationData(110226, LocationFlag.main_path, "pedestal"),
142+
"Snowy Depths Chest": LocationData(110206, LocationFlag.main_path, "Chest"),
143+
"Snowy Depths Pedestal": LocationData(110226, LocationFlag.main_path, "Pedestal"),
143144
},
144145
"Magical Temple": {
145-
"Magical Temple Orb": LocationData(110663, LocationFlag.side_path, "orb"),
146+
"Magical Temple Orb": LocationData(110663, LocationFlag.side_path, "Orb"),
146147
},
147148
"Hiisi Base": {
148-
"Hiisi Base Chest": LocationData(110246, LocationFlag.main_path, "chest"),
149-
"Hiisi Base Pedestal": LocationData(110266, LocationFlag.main_path, "pedestal"),
149+
"Hiisi Base Chest": LocationData(110246, LocationFlag.main_path, "Chest"),
150+
"Hiisi Base Pedestal": LocationData(110266, LocationFlag.main_path, "Pedestal"),
150151
},
151152
"Underground Jungle": {
152-
"Suomuhauki": LocationData(110648, LocationFlag.main_path, "boss"),
153-
"Underground Jungle Chest": LocationData(110286, LocationFlag.main_path, "chest"),
154-
"Underground Jungle Pedestal": LocationData(110306, LocationFlag.main_path, "pedestal"),
153+
"Suomuhauki": LocationData(110648, LocationFlag.main_path, "Boss"),
154+
"Underground Jungle Chest": LocationData(110286, LocationFlag.main_path, "Chest"),
155+
"Underground Jungle Pedestal": LocationData(110306, LocationFlag.main_path, "Pedestal"),
155156
},
156157
"Lukki Lair": {
157-
"Lukki Lair Orb": LocationData(110664, LocationFlag.side_path, "orb"),
158-
"Lukki Lair Chest": LocationData(110326, LocationFlag.side_path, "chest"),
159-
"Lukki Lair Pedestal": LocationData(110346, LocationFlag.side_path, "pedestal"),
158+
"Lukki Lair Orb": LocationData(110664, LocationFlag.side_path, "Orb"),
159+
"Lukki Lair Chest": LocationData(110326, LocationFlag.side_path, "Chest"),
160+
"Lukki Lair Pedestal": LocationData(110346, LocationFlag.side_path, "Pedestal"),
160161
},
161162
"The Vault": {
162-
"The Vault Chest": LocationData(110366, LocationFlag.main_path, "chest"),
163-
"The Vault Pedestal": LocationData(110386, LocationFlag.main_path, "pedestal"),
163+
"The Vault Chest": LocationData(110366, LocationFlag.main_path, "Chest"),
164+
"The Vault Pedestal": LocationData(110386, LocationFlag.main_path, "Pedestal"),
164165
},
165166
"Temple of the Art": {
166-
"Gate Guardian": LocationData(110652, LocationFlag.main_path, "boss"),
167-
"Temple of the Art Chest": LocationData(110406, LocationFlag.main_path, "chest"),
168-
"Temple of the Art Pedestal": LocationData(110426, LocationFlag.main_path, "pedestal"),
167+
"Gate Guardian": LocationData(110652, LocationFlag.main_path, "Boss"),
168+
"Temple of the Art Chest": LocationData(110406, LocationFlag.main_path, "Chest"),
169+
"Temple of the Art Pedestal": LocationData(110426, LocationFlag.main_path, "Pedestal"),
169170
},
170171
"The Tower": {
171-
"The Tower Chest": LocationData(110606, LocationFlag.main_world, "chest"),
172-
"The Tower Pedestal": LocationData(110626, LocationFlag.main_world, "pedestal"),
172+
"The Tower Chest": LocationData(110606, LocationFlag.main_world, "Chest"),
173+
"The Tower Pedestal": LocationData(110626, LocationFlag.main_world, "Pedestal"),
173174
},
174175
"Wizards' Den": {
175-
"Mestarien Mestari": LocationData(110655, LocationFlag.main_world, "boss"),
176-
"Wizards' Den Orb": LocationData(110668, LocationFlag.main_world, "orb"),
177-
"Wizards' Den Chest": LocationData(110446, LocationFlag.main_world, "chest"),
178-
"Wizards' Den Pedestal": LocationData(110466, LocationFlag.main_world, "pedestal"),
176+
"Mestarien Mestari": LocationData(110655, LocationFlag.main_world, "Boss"),
177+
"Wizards' Den Orb": LocationData(110668, LocationFlag.main_world, "Orb"),
178+
"Wizards' Den Chest": LocationData(110446, LocationFlag.main_world, "Chest"),
179+
"Wizards' Den Pedestal": LocationData(110466, LocationFlag.main_world, "Pedestal"),
179180
},
180181
"Powerplant": {
181-
"Kolmisilmän silmä": LocationData(110657, LocationFlag.main_world, "boss"),
182-
"Power Plant Chest": LocationData(110486, LocationFlag.main_world, "chest"),
183-
"Power Plant Pedestal": LocationData(110506, LocationFlag.main_world, "pedestal"),
182+
"Kolmisilmän silmä": LocationData(110657, LocationFlag.main_world, "Boss"),
183+
"Power Plant Chest": LocationData(110486, LocationFlag.main_world, "Chest"),
184+
"Power Plant Pedestal": LocationData(110506, LocationFlag.main_world, "Pedestal"),
184185
},
185186
"Snow Chasm": {
186-
"Unohdettu": LocationData(110653, LocationFlag.main_world, "boss"),
187-
"Snow Chasm Orb": LocationData(110667, LocationFlag.main_world, "orb"),
187+
"Unohdettu": LocationData(110653, LocationFlag.main_world, "Boss"),
188+
"Snow Chasm Orb": LocationData(110667, LocationFlag.main_world, "Orb"),
188189
},
189190
"Meat Realm": {
190-
"Meat Realm Chest": LocationData(110086, LocationFlag.main_world, "chest"),
191-
"Meat Realm Pedestal": LocationData(110106, LocationFlag.main_world, "pedestal"),
192-
"Limatoukka": LocationData(110647, LocationFlag.main_world, "boss"),
191+
"Meat Realm Chest": LocationData(110086, LocationFlag.main_world, "Chest"),
192+
"Meat Realm Pedestal": LocationData(110106, LocationFlag.main_world, "Pedestal"),
193+
"Limatoukka": LocationData(110647, LocationFlag.main_world, "Boss"),
193194
},
194195
"West Meat Realm": {
195-
"Kolmisilmän sydän": LocationData(110671, LocationFlag.main_world, "boss"),
196+
"Kolmisilmän sydän": LocationData(110671, LocationFlag.main_world, "Boss"),
196197
},
197198
"The Laboratory": {
198-
"Kolmisilmä": LocationData(110646, LocationFlag.main_path, "boss"),
199+
"Kolmisilmä": LocationData(110646, LocationFlag.main_path, "Boss"),
199200
},
200201
"Friend Cave": {
201-
"Toveri": LocationData(110654, LocationFlag.main_world, "boss"),
202+
"Toveri": LocationData(110654, LocationFlag.main_world, "Boss"),
202203
},
203204
"The Work (Hell)": {
204-
"The Work (Hell) Orb": LocationData(110666, LocationFlag.main_world, "orb"),
205+
"The Work (Hell) Orb": LocationData(110666, LocationFlag.main_world, "Orb"),
205206
},
206207
}
207208

@@ -212,18 +213,20 @@ def make_location_range(location_name: str, base_id: int, amt: int) -> Dict[str,
212213
return {f"{location_name} {i+1}": base_id + i for i in range(amt)}
213214

214215

215-
location_name_groups: Dict[str, Set[str]] = {"shop": set(), "orb": set(), "boss": set(), "chest": set(),
216-
"pedestal": set()}
216+
location_name_groups: Dict[str, Set[str]] = {"Shop": set(), "Orb": set(), "Boss": set(), "Chest": set(),
217+
"Pedestal": set()}
217218
location_name_to_id: Dict[str, int] = {}
218219

219220

220-
for location_group in location_region_mapping.values():
221+
for region_name, location_group in location_region_mapping.items():
222+
location_name_groups[region_name] = set()
221223
for locname, locinfo in location_group.items():
222224
# Iterating the hidden chest and pedestal locations here to avoid clutter above
223-
amount = 20 if locinfo.ltype in ["chest", "pedestal"] else 1
225+
amount = 20 if locinfo.ltype in ["Chest", "Pedestal"] else 1
224226
entries = make_location_range(locname, locinfo.id, amount)
225227

226228
location_name_to_id.update(entries)
227229
location_name_groups[locinfo.ltype].update(entries.keys())
230+
location_name_groups[region_name].update(entries.keys())
228231

229232
shop_locations = {name for name in location_name_to_id.keys() if "Shop Item" in name}

worlds/noita/regions.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ def create_locations(world: "NoitaWorld", region: Region) -> None:
1515
location_type = location_data.ltype
1616
flag = location_data.flag
1717

18-
is_orb_allowed = location_type == "orb" and flag <= world.options.orbs_as_checks
19-
is_boss_allowed = location_type == "boss" and flag <= world.options.bosses_as_checks
18+
is_orb_allowed = location_type == "Orb" and flag <= world.options.orbs_as_checks
19+
is_boss_allowed = location_type == "Boss" and flag <= world.options.bosses_as_checks
2020
amount = 0
2121
if flag == locations.LocationFlag.none or is_orb_allowed or is_boss_allowed:
2222
amount = 1
23-
elif location_type == "chest" and flag <= world.options.path_option:
23+
elif location_type == "Chest" and flag <= world.options.path_option:
2424
amount = world.options.hidden_chests.value
25-
elif location_type == "pedestal" and flag <= world.options.path_option:
25+
elif location_type == "Pedestal" and flag <= world.options.path_option:
2626
amount = world.options.pedestal_checks.value
2727

2828
region.add_locations(locations.make_location_range(location_name, location_data.id, amount),

0 commit comments

Comments
 (0)