|
25 | 25 | crest_warps = [51, 52, 53, 76, 96, 108, 158, 171, 175, 191, 275, 276, 277, 308, 334, 336, 396, 397] |
26 | 26 |
|
27 | 27 |
|
28 | | -def process_rules(spot, access): |
| 28 | +def process_rules(spot, access, ut_glitch=False): |
29 | 29 | for weapon in weapons: |
30 | 30 | if weapon in access: |
31 | | - add_rule(spot, lambda state, w=weapon: state.has_any(item_groups[w + "s"], spot.player)) |
| 31 | + items = item_groups[weapon + "s"].copy() |
| 32 | + if ut_glitch: |
| 33 | + items.append("ut_glitch") |
| 34 | + add_rule(spot, lambda state, i=items: state.has_any(i, spot.player)) |
32 | 35 | access = [yaml_item(rule) for rule in access if rule not in weapons] |
33 | | - add_rule(spot, lambda state: state.has_all(access, spot.player)) |
| 36 | + if ut_glitch: |
| 37 | + add_rule(spot, lambda state: state.has_all(access, spot.player) or state.has("ut_glitch", spot.player)) |
| 38 | + else: |
| 39 | + add_rule(spot, lambda state: state.has_all(access, spot.player)) |
34 | 40 |
|
35 | 41 |
|
36 | 42 | def create_region(world: MultiWorld, player: int, name: str, room_id=None, locations=None, links=None): |
@@ -129,7 +135,7 @@ def set_rules(self) -> None: |
129 | 135 | self.multiworld.completion_condition[self.player] = lambda state: state.has("Dark King", self.player) |
130 | 136 |
|
131 | 137 | def hard_boss_logic(state): |
132 | | - return state.has_all(["River Coin", "Sand Coin"], self.player) |
| 138 | + return state.has_all(["River Coin", "Sand Coin"], self.player) or state.has("ut_glitch", self.player) |
133 | 139 |
|
134 | 140 | add_rule(self.multiworld.get_location("Pazuzu 1F", self.player), hard_boss_logic) |
135 | 141 | add_rule(self.multiworld.get_location("Gidrah", self.player), hard_boss_logic) |
@@ -158,43 +164,45 @@ def check_foresta(region): |
158 | 164 |
|
159 | 165 | if self.options.logic == "friendly": |
160 | 166 | process_rules(self.multiworld.get_entrance("Overworld - Ice Pyramid", self.player), |
161 | | - ["MagicMirror"]) |
| 167 | + ["MagicMirror"], ut_glitch=True) |
162 | 168 | process_rules(self.multiworld.get_entrance("Overworld - Volcano", self.player), |
163 | | - ["Mask"]) |
164 | | - if self.options.map_shuffle: |
| 169 | + ["Mask"], ut_glitch=True) |
| 170 | + if self.options.map_shuffle in ("none", "dungeons_internal"): |
165 | 171 | process_rules(self.multiworld.get_entrance("Overworld - Bone Dungeon", self.player), |
166 | | - ["Bomb"]) |
| 172 | + ["Bomb"], ut_glitch=True) |
167 | 173 | process_rules(self.multiworld.get_entrance("Overworld - Wintry Cave", self.player), |
168 | | - ["Bomb", "Claw"]) |
| 174 | + ["Bomb", "Claw"], ut_glitch=True) |
169 | 175 | process_rules(self.multiworld.get_entrance("Overworld - Ice Pyramid", self.player), |
170 | | - ["Bomb", "Claw"]) |
| 176 | + ["Bomb", "Claw"], ut_glitch=True) |
171 | 177 | process_rules(self.multiworld.get_entrance("Overworld - Mine", self.player), |
172 | | - ["MegaGrenade", "Claw"]) |
| 178 | + ["MegaGrenade", "Claw"], ut_glitch=True) |
173 | 179 | process_rules(self.multiworld.get_entrance("Overworld - Lava Dome", self.player), |
174 | | - ["MegaGrenade"]) |
| 180 | + ["MegaGrenade"], ut_glitch=True) |
175 | 181 | process_rules(self.multiworld.get_entrance("Overworld - Giant Tree", self.player), |
176 | | - ["DragonClaw", "Axe"]) |
| 182 | + ["DragonClaw", "Axe"], ut_glitch=True) |
177 | 183 | process_rules(self.multiworld.get_entrance("Overworld - Mount Gale", self.player), |
178 | | - ["DragonClaw"]) |
| 184 | + ["DragonClaw"], ut_glitch=True) |
179 | 185 | process_rules(self.multiworld.get_entrance("Overworld - Pazuzu Tower", self.player), |
180 | | - ["DragonClaw", "Bomb"]) |
| 186 | + ["DragonClaw", "Bomb"], ut_glitch=True) |
181 | 187 | process_rules(self.multiworld.get_entrance("Overworld - Mac Ship", self.player), |
182 | | - ["DragonClaw", "CaptainCap"]) |
| 188 | + ["DragonClaw", "CaptainCap"], ut_glitch=True) |
183 | 189 | process_rules(self.multiworld.get_entrance("Overworld - Mac Ship Doom", self.player), |
184 | | - ["DragonClaw", "CaptainCap"]) |
| 190 | + ["DragonClaw", "CaptainCap"], ut_glitch=True) |
185 | 191 |
|
186 | | - if self.options.logic == "expert": |
187 | | - if self.options.map_shuffle == "none" and not self.options.crest_shuffle: |
188 | | - inner_room = self.multiworld.get_region("Wintry Temple Inner Room", self.player) |
189 | | - connection = Entrance(self.player, "Sealed Temple Exit Trick", inner_room) |
190 | | - connection.connect(self.multiworld.get_region("Wintry Temple Outer Room", self.player)) |
| 192 | + if self.options.map_shuffle == "none" and not self.options.crest_shuffle: |
| 193 | + inner_room = self.multiworld.get_region("Wintry Temple Inner Room", self.player) |
| 194 | + connection = Entrance(self.player, "Sealed Temple Exit Trick", inner_room) |
| 195 | + connection.connect(self.multiworld.get_region("Wintry Temple Outer Room", self.player)) |
| 196 | + if self.options.logic == "expert": |
191 | 197 | connection.access_rule = lambda state: state.has("Exit Book", self.player) |
192 | | - inner_room.exits.append(connection) |
193 | | - else: |
| 198 | + else: |
| 199 | + connection.access_rule = lambda state: state.has_all(["Exit Book", "ut_glitch"], self.player) |
| 200 | + inner_room.exits.append(connection) |
| 201 | + if self.options.logic != "expert": |
194 | 202 | for crest_warp in non_dead_end_crest_warps: |
195 | 203 | entrance = self.multiworld.get_entrance(crest_warp, self.player) |
196 | 204 | if entrance.connected_region.name in non_dead_end_crest_rooms: |
197 | | - entrance.access_rule = lambda state: False |
| 205 | + add_rule(entrance, lambda state: state.has("ut_glitch", self.player)) |
198 | 206 |
|
199 | 207 | if self.options.sky_coin_mode == "shattered_sky_coin": |
200 | 208 | logic_coins = [16, 24, 32, 32, 38][self.options.shattered_sky_coin_quantity.value] |
|
0 commit comments