summary refs log tree commit diff stats
path: root/test/TestDoors.py
blob: 49a0f9c49010a2955c22e94e578260f4d4bc4a9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
from . import LingoTestBase


class TestRequiredRoomLogic(LingoTestBase):
    options = {
        "shuffle_doors": "complex",
        "shuffle_colors": "false",
    }

    def test_pilgrim_first(self) -> None:
        self.remove_forced_good_item()

        self.assertFalse(self.multiworld.state.can_reach("The Seeker", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Pilgrim Antechamber", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Pilgrim Room", "Region", self.player))
        self.assertFalse(self.can_reach_location("The Seeker - Achievement"))

        self.collect_by_name("Pilgrim Room - Sun Painting")
        self.assertFalse(self.multiworld.state.can_reach("The Seeker", "Region", self.player))
        self.assertTrue(self.multiworld.state.can_reach("Pilgrim Antechamber", "Region", self.player))
        self.assertTrue(self.multiworld.state.can_reach("Pilgrim Room", "Region", self.player))
        self.assertFalse(self.can_reach_location("The Seeker - Achievement"))

        self.collect_by_name("Pilgrim Room - Shortcut to The Seeker")
        self.assertTrue(self.multiworld.state.can_reach("The Seeker", "Region", self.player))
        self.assertTrue(self.multiworld.state.can_reach("Pilgrim Room", "Region", self.player))
        self.assertFalse(self.can_reach_location("The Seeker - Achievement"))

        self.collect_by_name("Starting Room - Back Right Door")
        self.assertTrue(self.can_reach_location("The Seeker - Achievement"))

    def test_hidden_first(self) -> None:
        self.remove_forced_good_item()

        self.assertFalse(self.multiworld.state.can_reach("The Seeker", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Pilgrim Room", "Region", self.player))
        self.assertFalse(self.can_reach_location("The Seeker - Achievement"))

        self.collect_by_name("Starting Room - Back Right Door")
        self.assertFalse(self.multiworld.state.can_reach("The Seeker", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Pilgrim Room", "Region", self.player))
        self.assertFalse(self.can_reach_location("The Seeker - Achievement"))

        self.collect_by_name("Pilgrim Room - Shortcut to The Seeker")
        self.assertFalse(self.multiworld.state.can_reach("The Seeker", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Pilgrim Room", "Region", self.player))
        self.assertFalse(self.can_reach_location("The Seeker - Achievement"))

        self.collect_by_name("Pilgrim Room - Sun Painting")
        self.assertTrue(self.multiworld.state.can_reach("The Seeker", "Region", self.player))
        self.assertTrue(self.multiworld.state.can_reach("Pilgrim Room", "Region", self.player))
        self.assertTrue(self.can_reach_location("The Seeker - Achievement"))


class TestRequiredDoorLogic(LingoTestBase):
    options = {
        "shuffle_doors": "complex",
        "shuffle_colors": "false",
    }

    def test_through_rhyme(self) -> None:
        self.remove_forced_good_item()

        self.assertFalse(self.can_reach_location("Rhyme Room - Circle/Looped Square Wall"))

        self.collect_by_name("Starting Room - Rhyme Room Entrance")
        self.assertFalse(self.can_reach_location("Rhyme Room - Circle/Looped Square Wall"))

        self.collect_by_name("Rhyme Room (Looped Square) - Door to Circle")
        self.assertTrue(self.can_reach_location("Rhyme Room - Circle/Looped Square Wall"))

    def test_through_hidden(self) -> None:
        self.remove_forced_good_item()

        self.assertFalse(self.can_reach_location("Rhyme Room - Circle/Looped Square Wall"))

        self.collect_by_name("Starting Room - Rhyme Room Entrance")
        self.assertFalse(self.can_reach_location("Rhyme Room - Circle/Looped Square Wall"))

        self.collect_by_name("Starting Room - Back Right Door")
        self.assertFalse(self.can_reach_location("Rhyme Room - Circle/Looped Square Wall"))

        self.collect_by_name("Hidden Room - Rhyme Room Entrance")
        self.assertTrue(self.can_reach_location("Rhyme Room - Circle/Looped Square Wall"))


class TestSimpleDoors(LingoTestBase):
    options = {
        "shuffle_doors": "simple",
        "shuffle_colors": "false",
    }

    def test_requirement(self):
        self.remove_forced_good_item()

        self.assertFalse(self.multiworld.state.can_reach("Outside The Wanderer", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))

        self.collect_by_name("Rhyme Room Doors")
        self.assertTrue(self.multiworld.state.can_reach("Outside The Wanderer", "Region", self.player))
        self.assertTrue(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))