1
+ from . import DLCQuestTestBase
2
+ from .. import Options
3
+
4
+ sword = "Sword"
5
+ gun = "Gun"
6
+ wooden_sword = "Wooden Sword"
7
+ pickaxe = "Pickaxe"
8
+ humble_bindle = "Humble Indie Bindle"
9
+ box_supplies = "Box of Various Supplies"
10
+ items = [sword , gun , wooden_sword , pickaxe , humble_bindle , box_supplies ]
11
+
12
+ important_pack = "Incredibly Important Pack"
13
+
14
+
15
+ class TestItemShuffle (DLCQuestTestBase ):
16
+ options = {Options .ItemShuffle .internal_name : Options .ItemShuffle .option_shuffled ,
17
+ Options .Campaign .internal_name : Options .Campaign .option_both }
18
+
19
+ def test_items_in_pool (self ):
20
+ item_names = {item .name for item in self .multiworld .get_items ()}
21
+ for item in items :
22
+ with self .subTest (f"{ item } " ):
23
+ self .assertIn (item , item_names )
24
+
25
+ def test_item_locations_in_pool (self ):
26
+ location_names = {location .name for location in self .multiworld .get_locations ()}
27
+ for item_location in items :
28
+ with self .subTest (f"{ item_location } " ):
29
+ self .assertIn (item_location , location_names )
30
+
31
+ def test_sword_location_has_correct_rules (self ):
32
+ self .assertFalse (self .can_reach_location (sword ))
33
+ movement_pack = self .multiworld .create_item ("Movement Pack" , self .player )
34
+ self .collect (movement_pack )
35
+ self .assertFalse (self .can_reach_location (sword ))
36
+ time_pack = self .multiworld .create_item ("Time is Money Pack" , self .player )
37
+ self .collect (time_pack )
38
+ self .assertTrue (self .can_reach_location (sword ))
39
+
40
+ def test_gun_location_has_correct_rules (self ):
41
+ self .assertFalse (self .can_reach_location (gun ))
42
+ movement_pack = self .multiworld .create_item ("Movement Pack" , self .player )
43
+ self .collect (movement_pack )
44
+ self .assertFalse (self .can_reach_location (gun ))
45
+ sword_item = self .multiworld .create_item (sword , self .player )
46
+ self .collect (sword_item )
47
+ self .assertFalse (self .can_reach_location (gun ))
48
+ gun_pack = self .multiworld .create_item ("Gun Pack" , self .player )
49
+ self .collect (gun_pack )
50
+ self .assertTrue (self .can_reach_location (gun ))
51
+
52
+ def test_wooden_sword_location_has_correct_rules (self ):
53
+ self .assertFalse (self .can_reach_location (wooden_sword ))
54
+ important_pack_item = self .multiworld .create_item (important_pack , self .player )
55
+ self .collect (important_pack_item )
56
+ self .assertTrue (self .can_reach_location (wooden_sword ))
57
+
58
+ def test_bindle_location_has_correct_rules (self ):
59
+ self .assertFalse (self .can_reach_location (humble_bindle ))
60
+ wooden_sword_item = self .multiworld .create_item (wooden_sword , self .player )
61
+ self .collect (wooden_sword_item )
62
+ self .assertFalse (self .can_reach_location (humble_bindle ))
63
+ plants_pack = self .multiworld .create_item ("Harmless Plants Pack" , self .player )
64
+ self .collect (plants_pack )
65
+ self .assertFalse (self .can_reach_location (humble_bindle ))
66
+ wall_jump_pack = self .multiworld .create_item ("Wall Jump Pack" , self .player )
67
+ self .collect (wall_jump_pack )
68
+ self .assertFalse (self .can_reach_location (humble_bindle ))
69
+ name_change_pack = self .multiworld .create_item ("Name Change Pack" , self .player )
70
+ self .collect (name_change_pack )
71
+ self .assertFalse (self .can_reach_location (humble_bindle ))
72
+ cut_content_pack = self .multiworld .create_item ("Cut Content Pack" , self .player )
73
+ self .collect (cut_content_pack )
74
+ self .assertFalse (self .can_reach_location (humble_bindle ))
75
+ box_supplies_item = self .multiworld .create_item (box_supplies , self .player )
76
+ self .collect (box_supplies_item )
77
+ self .assertTrue (self .can_reach_location (humble_bindle ))
78
+
79
+ def test_box_supplies_location_has_correct_rules (self ):
80
+ self .assertFalse (self .can_reach_location (box_supplies ))
81
+ wooden_sword_item = self .multiworld .create_item (wooden_sword , self .player )
82
+ self .collect (wooden_sword_item )
83
+ self .assertFalse (self .can_reach_location (box_supplies ))
84
+ plants_pack = self .multiworld .create_item ("Harmless Plants Pack" , self .player )
85
+ self .collect (plants_pack )
86
+ self .assertFalse (self .can_reach_location (box_supplies ))
87
+ wall_jump_pack = self .multiworld .create_item ("Wall Jump Pack" , self .player )
88
+ self .collect (wall_jump_pack )
89
+ self .assertFalse (self .can_reach_location (box_supplies ))
90
+ name_change_pack = self .multiworld .create_item ("Name Change Pack" , self .player )
91
+ self .collect (name_change_pack )
92
+ self .assertFalse (self .can_reach_location (box_supplies ))
93
+ cut_content_pack = self .multiworld .create_item ("Cut Content Pack" , self .player )
94
+ self .collect (cut_content_pack )
95
+ self .assertTrue (self .can_reach_location (box_supplies ))
96
+
97
+ def test_pickaxe_location_has_correct_rules (self ):
98
+ self .assertFalse (self .can_reach_location (pickaxe ))
99
+ wooden_sword_item = self .multiworld .create_item (wooden_sword , self .player )
100
+ self .collect (wooden_sword_item )
101
+ self .assertFalse (self .can_reach_location (pickaxe ))
102
+ plants_pack = self .multiworld .create_item ("Harmless Plants Pack" , self .player )
103
+ self .collect (plants_pack )
104
+ self .assertFalse (self .can_reach_location (pickaxe ))
105
+ wall_jump_pack = self .multiworld .create_item ("Wall Jump Pack" , self .player )
106
+ self .collect (wall_jump_pack )
107
+ self .assertFalse (self .can_reach_location (pickaxe ))
108
+ name_change_pack = self .multiworld .create_item ("Name Change Pack" , self .player )
109
+ self .collect (name_change_pack )
110
+ self .assertFalse (self .can_reach_location (pickaxe ))
111
+ bindle_item = self .multiworld .create_item ("Humble Indie Bindle" , self .player )
112
+ self .collect (bindle_item )
113
+ self .assertTrue (self .can_reach_location (pickaxe ))
114
+
115
+
116
+ class TestNoItemShuffle (DLCQuestTestBase ):
117
+ options = {Options .ItemShuffle .internal_name : Options .ItemShuffle .option_disabled ,
118
+ Options .Campaign .internal_name : Options .Campaign .option_both }
119
+
120
+ def test_items_not_in_pool (self ):
121
+ item_names = {item .name for item in self .multiworld .get_items ()}
122
+ for item in items :
123
+ with self .subTest (f"{ item } " ):
124
+ self .assertNotIn (item , item_names )
125
+
126
+ def test_item_locations_not_in_pool (self ):
127
+ location_names = {location .name for location in self .multiworld .get_locations ()}
128
+ for item_location in items :
129
+ with self .subTest (f"{ item_location } " ):
130
+ self .assertNotIn (item_location , location_names )
0 commit comments