summary refs log tree commit diff stats
path: root/test/TestSunwarps.py
blob: e8e913c4f49958b2c0d668565784d4e34ac19c8a (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
from . import LingoTestBase


class TestVanillaDoorsNormalSunwarps(LingoTestBase):
    options = {
        "shuffle_doors": "none",
        "shuffle_colors": "true",
        "sunwarp_access": "normal"
    }

    def test_access(self):
        self.assertTrue(self.multiworld.state.can_reach("Crossroads", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))

        self.collect_by_name("Yellow")
        self.assertTrue(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))
        self.assertTrue(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))


class TestSimpleDoorsNormalSunwarps(LingoTestBase):
    options = {
        "shuffle_doors": "simple",
        "sunwarp_access": "normal"
    }

    def test_access(self):
        self.assertFalse(self.multiworld.state.can_reach("Crossroads", "Region", self.player))

        self.collect_by_name("Second Room - Exit Door")
        self.assertTrue(self.multiworld.state.can_reach("Crossroads", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))

        self.collect_by_name(["Crossroads - Tower Entrances", "Orange Tower Fourth Floor - Hot Crusts Door"])
        self.assertTrue(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))
        self.assertTrue(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))


class TestSimpleDoorsDisabledSunwarps(LingoTestBase):
    options = {
        "shuffle_doors": "simple",
        "sunwarp_access": "disabled"
    }

    def test_access(self):
        self.assertFalse(self.multiworld.state.can_reach("Crossroads", "Region", self.player))

        self.collect_by_name("Second Room - Exit Door")
        self.assertFalse(self.multiworld.state.can_reach("Crossroads", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))

        self.collect_by_name(["Hub Room - Crossroads Entrance", "Crossroads - Tower Entrancse",
                              "Orange Tower Fourth Floor - Hot Crusts Door"])
        self.assertFalse(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))


class TestSimpleDoorsUnlockSunwarps(LingoTestBase):
    options = {
        "shuffle_doors": "simple",
        "sunwarp_access": "unlock"
    }

    def test_access(self):
        self.assertFalse(self.multiworld.state.can_reach("Crossroads", "Region", self.player))

        self.collect_by_name("Second Room - Exit Door")
        self.assertFalse(self.multiworld.state.can_reach("Crossroads", "Region", self.player))

        self.collect_by_name(["Crossroads - Tower Entrances", "Orange Tower Fourth Floor - Hot Crusts Door"])
        self.assertFalse(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))

        self.collect_by_name("Sunwarps")
        self.assertTrue(self.multiworld.state.can_reach("Crossroads", "Region", self.player))
        self.assertTrue(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))
        self.assertTrue(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))


class TestComplexDoorsNormalSunwarps(LingoTestBase):
    options = {
        "shuffle_doors": "complex",
        "sunwarp_access": "normal"
    }

    def test_access(self):
        self.assertFalse(self.multiworld.state.can_reach("Crossroads", "Region", self.player))

        self.collect_by_name("Second Room - Exit Door")
        self.assertTrue(self.multiworld.state.can_reach("Crossroads", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))

        self.collect_by_name(["Crossroads - Tower Entrance", "Orange Tower Fourth Floor - Hot Crusts Door"])
        self.assertTrue(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))
        self.assertTrue(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))


class TestComplexDoorsDisabledSunwarps(LingoTestBase):
    options = {
        "shuffle_doors": "complex",
        "sunwarp_access": "disabled"
    }

    def test_access(self):
        self.assertFalse(self.multiworld.state.can_reach("Crossroads", "Region", self.player))

        self.collect_by_name("Second Room - Exit Door")
        self.assertFalse(self.multiworld.state.can_reach("Crossroads", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))

        self.collect_by_name(["Hub Room - Crossroads Entrance", "Crossroads - Tower Entrance",
                              "Orange Tower Fourth Floor - Hot Crusts Door"])
        self.assertFalse(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))


class TestComplexDoorsIndividualSunwarps(LingoTestBase):
    options = {
        "shuffle_doors": "complex",
        "sunwarp_access": "individual"
    }

    def test_access(self):
        self.assertFalse(self.multiworld.state.can_reach("Crossroads", "Region", self.player))

        self.collect_by_name("Second Room - Exit Door")
        self.assertFalse(self.multiworld.state.can_reach("Crossroads", "Region", self.player))

        self.collect_by_name("1 Sunwarp")
        self.assertTrue(self.multiworld.state.can_reach("Crossroads", "Region", self.player))

        self.collect_by_name(["Crossroads - Tower Entrance", "Orange Tower Fourth Floor - Hot Crusts Door"])
        self.assertFalse(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))

        self.collect_by_name("2 Sunwarp")
        self.assertTrue(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))

        self.collect_by_name("3 Sunwarp")
        self.assertTrue(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))


class TestComplexDoorsProgressiveSunwarps(LingoTestBase):
    options = {
        "shuffle_doors": "complex",
        "sunwarp_access": "progressive"
    }

    def test_access(self):
        self.assertFalse(self.multiworld.state.can_reach("Crossroads", "Region", self.player))

        self.collect_by_name("Second Room - Exit Door")
        self.assertFalse(self.multiworld.state.can_reach("Crossroads", "Region", self.player))

        progressive_pilgrimage = self.get_items_by_name("Progressive Pilgrimage")
        self.collect(progressive_pilgrimage[0])
        self.assertTrue(self.multiworld.state.can_reach("Crossroads", "Region", self.player))

        self.collect_by_name(["Crossroads - Tower Entrance", "Orange Tower Fourth Floor - Hot Crusts Door"])
        self.assertFalse(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))

        self.collect(progressive_pilgrimage[1])
        self.assertTrue(self.multiworld.state.can_reach("Orange Tower Third Floor", "Region", self.player))
        self.assertFalse(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))

        self.collect(progressive_pilgrimage[2])
        self.assertTrue(self.multiworld.state.can_reach("Outside The Initiated", "Region", self.player))


class TestUnlockSunwarpPilgrimage(LingoTestBase):
    options = {
        "sunwarp_access": "unlock",
        "shuffle_colors": "false",
        "enable_pilgrimage": "true"
    }

    def test_access(self):
        self.assertFalse(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))

        self.collect_by_name("Sunwarps")

        self.assertTrue(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))


class TestIndividualSunwarpPilgrimage(LingoTestBase):
    options = {
        "sunwarp_access": "individual",
        "shuffle_colors": "false",
        "enable_pilgrimage": "true"
    }

    def test_access(self):
        for i in range(1, 7):
            self.assertFalse(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))
            self.collect_by_name(f"{i} Sunwarp")

        self.assertTrue(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))


class TestProgressiveSunwarpPilgrimage(LingoTestBase):
    options = {
        "sunwarp_access": "progressive",
        "shuffle_colors": "false",
        "enable_pilgrimage": "true"
    }

    def test_access(self):
        for item in self.get_items_by_name("Progressive Pilgrimage"):
            self.assertFalse(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))
            self.collect(item)

        self.assertTrue(self.can_reach_location("Pilgrim Antechamber - PILGRIM"))