Files
Archipelago/worlds/witness/test/test_disable_non_randomized.py
NewSoupVi a6c1347102 The Witness: Make "Early Good Item" an OptionSet allowing Symbols, Doors and Obelisk Keys (#3804)
* New solution to that plando issue

* better

* Another warning

* better comment

* Best of both worlds I guess?

* oops

* Smarter code reuse

* better comment

* oop

* lint

* mypy

* player_name

* add unit test

* oh

* Rebrand time baby

* This fits on one line

* oop

* Update worlds/witness/__init__.py

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

* mypy

* Reorganize some doors according to medic's suggestions

* This should make it much faster (Thanks Medic)

* Town Doors works because of Church being a check always, Church Entry feels really bad tho

* Only add Desert Entry if there are no control panels stopping you

* No overlap here, so why is it a set

* Idk everything's kinda good without symbol shuffle

* Just make sure, I guess

* This makes way more sense doesn't it

* Oh, this is probably important

* oop

* loc

* oops 2

* ruff

* that was already in there

* Change the door picking a bit further

* some renaming

* slight wording change

* Fix

* Move it all to a new file

* ruff

* mypy

* .

* Make sure we're only adding as many tutorial checks as necessary

* ruff

* These checks aren't necessary, as the final list gets culled to only existing items anyway. It saves CPU cycles, but this is nicer for future compatibility

* Special handling for caves shortcuts

* 120 chars

* Update worlds/witness/place_early_item.py

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>

* Clean up Windmill & Theater cases

* Make early_symbol_item removed instead

* Add early_good_item to presets

* replace double None checks with casts

* That doesn't exist anymore

* Mypy thing

* Update the doors again a bit

* Pycharm pls

* ruff

* forgot one

* oop

* Is it finally right?

* Update options.py

* Fix with new Panel Keys

* Hopefully fix crash when one of the types runs out when the others haven't yet

* oops

* Medic suggestion

* unused import

* Update place_early_item.py

* Update __init__.py

* Update __init__.py

* Update options.py

* Add possible types to option desc

* Make that include all Tutorial (Inside) checks

* Update __init__.py

* Update test_early_good_item.py

* Update test_early_good_item.py

* Slight cleanup

* fix no tutorial locations being picked up by tutorial location size check

---------

Co-authored-by: Exempt-Medic <60412657+Exempt-Medic@users.noreply.github.com>
2026-04-18 13:52:38 +02:00

40 lines
1.7 KiB
Python

from ..rules import _has_lasers
from ..test.bases import WitnessTestBase
class TestDisableNonRandomized(WitnessTestBase):
run_default_tests = False
options = {
"disable_non_randomized_puzzles": True,
"shuffle_doors": "panels",
"early_good_items": {},
}
def test_locations_got_disabled_and_alternate_activation_triggers_work(self) -> None:
"""
Test the different behaviors of the disable_non_randomized mode:
1. Unrandomized locations like Orchard Apple Tree 5 are disabled.
2. Certain doors or lasers that would usually be activated by unrandomized panels depend on event items instead.
3. These alternate activations are tied to solving Discarded Panels.
"""
with self.subTest("Test that unrandomized locations are disabled."):
self.assert_location_does_not_exist("Orchard Apple Tree 5")
with self.subTest("Test that alternate activation trigger events exist."):
self.assert_dependency_on_event_item(
self.world.get_entrance("Town Tower After Third Door to Town Tower Top"),
"Town Tower 4th Door Opens",
)
with self.subTest("Test that alternate activation triggers award lasers."):
self.assertFalse(_has_lasers(1, self.world, False)(self.multiworld.state))
self.collect_by_name("Triangles")
# Alternate triggers yield Bunker Laser (Mountainside Discard) and Monastery Laser (Desert Discard)
self.assertTrue(_has_lasers(2, self.world, False)(self.multiworld.state))
self.assertFalse(_has_lasers(3, self.world, False)(self.multiworld.state))