@@ -36,6 +36,11 @@ class SM64Levels(int, Enum):
36
36
BOWSER_IN_THE_FIRE_SEA = 191
37
37
WING_MARIO_OVER_THE_RAINBOW = 311
38
38
39
+
40
+ class SM64Region (Region ):
41
+ subregions : typing .List [Region ] = []
42
+
43
+
39
44
# sm64paintings is a dict of entrances, format LEVEL | AREA
40
45
sm64_level_to_paintings : typing .Dict [SM64Levels , str ] = {
41
46
SM64Levels .BOB_OMB_BATTLEFIELD : "Bob-omb Battlefield" ,
@@ -81,21 +86,24 @@ def create_regions(world: MultiWorld, player: int):
81
86
regBoB = create_region ("Bob-omb Battlefield" , player , world )
82
87
create_locs (regBoB , "BoB: Big Bob-Omb on the Summit" , "BoB: Footrace with Koopa The Quick" ,
83
88
"BoB: Mario Wings to the Sky" , "BoB: Behind Chain Chomp's Gate" , "BoB: Bob-omb Buddy" )
84
- create_subregion (regBoB , "BoB: Island" , "BoB: Shoot to the Island in the Sky" , "BoB: Find the 8 Red Coins" )
89
+ bob_island = create_subregion (regBoB , "BoB: Island" , "BoB: Shoot to the Island in the Sky" , "BoB: Find the 8 Red Coins" )
90
+ regBoB .subregions = [bob_island ]
85
91
if (world .EnableCoinStars [player ].value ):
86
92
create_locs (regBoB , "BoB: 100 Coins" )
87
93
88
94
regWhomp = create_region ("Whomp's Fortress" , player , world )
89
95
create_locs (regWhomp , "WF: Chip Off Whomp's Block" , "WF: Shoot into the Wild Blue" , "WF: Red Coins on the Floating Isle" ,
90
96
"WF: Fall onto the Caged Island" , "WF: Blast Away the Wall" )
91
- create_subregion (regWhomp , "WF: Tower" , "WF: To the Top of the Fortress" , "WF: Bob-omb Buddy" )
97
+ wf_tower = create_subregion (regWhomp , "WF: Tower" , "WF: To the Top of the Fortress" , "WF: Bob-omb Buddy" )
98
+ regWhomp .subregions = [wf_tower ]
92
99
if (world .EnableCoinStars [player ].value ):
93
100
create_locs (regWhomp , "WF: 100 Coins" )
94
101
95
102
regJRB = create_region ("Jolly Roger Bay" , player , world )
96
103
create_locs (regJRB , "JRB: Plunder in the Sunken Ship" , "JRB: Can the Eel Come Out to Play?" , "JRB: Treasure of the Ocean Cave" ,
97
104
"JRB: Blast to the Stone Pillar" , "JRB: Through the Jet Stream" , "JRB: Bob-omb Buddy" )
98
105
jrb_upper = create_subregion (regJRB , 'JRB: Upper' , "JRB: Red Coins on the Ship Afloat" )
106
+ regJRB .subregions = [jrb_upper ]
99
107
if (world .EnableCoinStars [player ].value ):
100
108
create_locs (jrb_upper , "JRB: 100 Coins" )
101
109
@@ -108,7 +116,8 @@ def create_regions(world: MultiWorld, player: int):
108
116
create_locs (regBBH , "BBH: Go on a Ghost Hunt" , "BBH: Ride Big Boo's Merry-Go-Round" ,
109
117
"BBH: Secret of the Haunted Books" , "BBH: Seek the 8 Red Coins" )
110
118
bbh_third_floor = create_subregion (regBBH , "BBH: Third Floor" , "BBH: Eye to Eye in the Secret Room" )
111
- create_subregion (bbh_third_floor , "BBH: Roof" , "BBH: Big Boo's Balcony" , "BBH: 1Up Block Top of Mansion" )
119
+ bbh_roof = create_subregion (bbh_third_floor , "BBH: Roof" , "BBH: Big Boo's Balcony" , "BBH: 1Up Block Top of Mansion" )
120
+ regBBH .subregions = [bbh_third_floor , bbh_roof ]
112
121
if (world .EnableCoinStars [player ].value ):
113
122
create_locs (regBBH , "BBH: 100 Coins" )
114
123
@@ -130,29 +139,34 @@ def create_regions(world: MultiWorld, player: int):
130
139
create_locs (regHMC , "HMC: Swimming Beast in the Cavern" , "HMC: Metal-Head Mario Can Move!" ,
131
140
"HMC: Watch for Rolling Rocks" , "HMC: Navigating the Toxic Maze" ,"HMC: 1Up Block Past Rolling Rocks" )
132
141
hmc_red_coin_area = create_subregion (regHMC , "HMC: Red Coin Area" , "HMC: Elevate for 8 Red Coins" )
133
- create_subregion (regHMC , "HMC: Pit Islands" , "HMC: A-Maze-Ing Emergency Exit" , "HMC: 1Up Block above Pit" )
142
+ hmc_pit_islands = create_subregion (regHMC , "HMC: Pit Islands" , "HMC: A-Maze-Ing Emergency Exit" , "HMC: 1Up Block above Pit" )
143
+ regHMC .subregions = [hmc_red_coin_area , hmc_pit_islands ]
134
144
if (world .EnableCoinStars [player ].value ):
135
145
create_locs (hmc_red_coin_area , "HMC: 100 Coins" )
136
146
137
147
regLLL = create_region ("Lethal Lava Land" , player , world )
138
148
create_locs (regLLL , "LLL: Boil the Big Bully" , "LLL: Bully the Bullies" ,
139
149
"LLL: 8-Coin Puzzle with 15 Pieces" , "LLL: Red-Hot Log Rolling" )
140
- create_subregion (regLLL , "LLL: Upper Volcano" , "LLL: Hot-Foot-It into the Volcano" , "LLL: Elevator Tour in the Volcano" )
150
+ lll_upper_volcano = create_subregion (regLLL , "LLL: Upper Volcano" , "LLL: Hot-Foot-It into the Volcano" , "LLL: Elevator Tour in the Volcano" )
151
+ regLLL .subregions = [lll_upper_volcano ]
141
152
if (world .EnableCoinStars [player ].value ):
142
153
create_locs (regLLL , "LLL: 100 Coins" )
143
154
144
155
regSSL = create_region ("Shifting Sand Land" , player , world )
145
- create_locs (regSSL , "SSL: In the Talons of the Big Bird" , "SSL: Shining Atop the Pyramid" , "SSL: Inside the Ancient Pyramid" ,
156
+ create_locs (regSSL , "SSL: In the Talons of the Big Bird" , "SSL: Shining Atop the Pyramid" ,
146
157
"SSL: Free Flying for 8 Red Coins" , "SSL: Bob-omb Buddy" ,
147
158
"SSL: 1Up Block Outside Pyramid" , "SSL: 1Up Block Pyramid Left Path" , "SSL: 1Up Block Pyramid Back" )
148
- create_subregion (regSSL , "SSL: Upper Pyramid" , "SSL: Stand Tall on the Four Pillars" , "SSL: Pyramid Puzzle" )
159
+ ssl_upper_pyramid = create_subregion (regSSL , "SSL: Upper Pyramid" , "SSL: Inside the Ancient Pyramid" ,
160
+ "SSL: Stand Tall on the Four Pillars" , "SSL: Pyramid Puzzle" )
161
+ regSSL .subregions = [ssl_upper_pyramid ]
149
162
if (world .EnableCoinStars [player ].value ):
150
163
create_locs (regSSL , "SSL: 100 Coins" )
151
164
152
165
regDDD = create_region ("Dire, Dire Docks" , player , world )
153
166
create_locs (regDDD , "DDD: Board Bowser's Sub" , "DDD: Chests in the Current" , "DDD: Through the Jet Stream" ,
154
167
"DDD: The Manta Ray's Reward" , "DDD: Collect the Caps..." )
155
168
ddd_moving_poles = create_subregion (regDDD , "DDD: Moving Poles" , "DDD: Pole-Jumping for Red Coins" )
169
+ regDDD .subregions = [ddd_moving_poles ]
156
170
if (world .EnableCoinStars [player ].value ):
157
171
create_locs (ddd_moving_poles , "DDD: 100 Coins" )
158
172
@@ -163,7 +177,8 @@ def create_regions(world: MultiWorld, player: int):
163
177
create_default_locs (regVCutM , locVCutM_table )
164
178
165
179
regBitFS = create_region ("Bowser in the Fire Sea" , player , world )
166
- create_subregion (regBitFS , "BitFS: Upper" , * locBitFS_table .keys ())
180
+ bitfs_upper = create_subregion (regBitFS , "BitFS: Upper" , * locBitFS_table .keys ())
181
+ regBitFS .subregions = [bitfs_upper ]
167
182
168
183
create_region ("Second Floor" , player , world )
169
184
@@ -176,7 +191,8 @@ def create_regions(world: MultiWorld, player: int):
176
191
create_locs (regWDW , "WDW: Express Elevator--Hurry Up!" )
177
192
wdw_top = create_subregion (regWDW , "WDW: Top" , "WDW: Shocking Arrow Lifts!" , "WDW: Top o' the Town" ,
178
193
"WDW: Secrets in the Shallows & Sky" , "WDW: Bob-omb Buddy" )
179
- create_subregion (regWDW , "WDW: Downtown" , "WDW: Go to Town for Red Coins" , "WDW: Quick Race Through Downtown!" , "WDW: 1Up Block in Downtown" )
194
+ wdw_downtown = create_subregion (regWDW , "WDW: Downtown" , "WDW: Go to Town for Red Coins" , "WDW: Quick Race Through Downtown!" , "WDW: 1Up Block in Downtown" )
195
+ regWDW .subregions = [wdw_top , wdw_downtown ]
180
196
if (world .EnableCoinStars [player ].value ):
181
197
create_locs (wdw_top , "WDW: 100 Coins" )
182
198
@@ -185,17 +201,19 @@ def create_regions(world: MultiWorld, player: int):
185
201
"TTM: Bob-omb Buddy" , "TTM: 1Up Block on Red Mushroom" )
186
202
ttm_top = create_subregion (ttm_middle , "TTM: Top" , "TTM: Scale the Mountain" , "TTM: Mystery of the Monkey Cage" ,
187
203
"TTM: Mysterious Mountainside" , "TTM: Breathtaking View from Bridge" )
204
+ regTTM .subregions = [ttm_middle , ttm_top ]
188
205
if (world .EnableCoinStars [player ].value ):
189
206
create_locs (ttm_top , "TTM: 100 Coins" )
190
207
191
208
create_region ("Tiny-Huge Island (Huge)" , player , world )
192
209
create_region ("Tiny-Huge Island (Tiny)" , player , world )
193
210
regTHI = create_region ("Tiny-Huge Island" , player , world )
194
- create_locs (regTHI , "THI: The Tip Top of the Huge Island" , "THI: 1Up Block THI Small near Start" )
195
- thi_pipes = create_subregion (regTHI , "THI: Pipes" , "THI: Pluck the Piranha Flower" , "THI: Rematch with Koopa the Quick" ,
211
+ create_locs (regTHI , "THI: 1Up Block THI Small near Start" )
212
+ thi_pipes = create_subregion (regTHI , "THI: Pipes" , "THI: The Tip Top of the Huge Island" , "THI: Pluck the Piranha Flower" , "THI: Rematch with Koopa the Quick" ,
196
213
"THI: Five Itty Bitty Secrets" , "THI: Wiggler's Red Coins" , "THI: Bob-omb Buddy" ,
197
214
"THI: 1Up Block THI Large near Start" , "THI: 1Up Block Windy Area" )
198
215
thi_large_top = create_subregion (thi_pipes , "THI: Large Top" , "THI: Make Wiggler Squirm" )
216
+ regTHI .subregions = [thi_pipes , thi_large_top ]
199
217
if (world .EnableCoinStars [player ].value ):
200
218
create_locs (thi_large_top , "THI: 100 Coins" )
201
219
@@ -206,15 +224,17 @@ def create_regions(world: MultiWorld, player: int):
206
224
ttc_lower = create_subregion (regTTC , "TTC: Lower" , "TTC: Roll into the Cage" , "TTC: Get a Hand" , "TTC: 1Up Block Midway Up" )
207
225
ttc_upper = create_subregion (ttc_lower , "TTC: Upper" , "TTC: Timed Jumps on Moving Bars" , "TTC: The Pit and the Pendulums" )
208
226
ttc_top = create_subregion (ttc_upper , "TTC: Top" , "TTC: Stomp on the Thwomp" , "TTC: 1Up Block at the Top" )
227
+ regTTC .subregions = [ttc_lower , ttc_upper , ttc_top ]
209
228
if (world .EnableCoinStars [player ].value ):
210
229
create_locs (ttc_top , "TTC: 100 Coins" )
211
230
212
231
regRR = create_region ("Rainbow Ride" , player , world )
213
232
create_locs (regRR , "RR: Swingin' in the Breeze" , "RR: Tricky Triangles!" ,
214
233
"RR: 1Up Block Top of Red Coin Maze" , "RR: 1Up Block Under Fly Guy" , "RR: Bob-omb Buddy" )
215
234
rr_maze = create_subregion (regRR , "RR: Maze" , "RR: Coins Amassed in a Maze" )
216
- create_subregion (regRR , "RR: Cruiser" , "RR: Cruiser Crossing the Rainbow" , "RR: Somewhere Over the Rainbow" )
217
- create_subregion (regRR , "RR: House" , "RR: The Big House in the Sky" , "RR: 1Up Block On House in the Sky" )
235
+ rr_cruiser = create_subregion (regRR , "RR: Cruiser" , "RR: Cruiser Crossing the Rainbow" , "RR: Somewhere Over the Rainbow" )
236
+ rr_house = create_subregion (regRR , "RR: House" , "RR: The Big House in the Sky" , "RR: 1Up Block On House in the Sky" )
237
+ regRR .subregions = [rr_maze , rr_cruiser , rr_house ]
218
238
if (world .EnableCoinStars [player ].value ):
219
239
create_locs (rr_maze , "RR: 100 Coins" )
220
240
@@ -223,7 +243,8 @@ def create_regions(world: MultiWorld, player: int):
223
243
224
244
regBitS = create_region ("Bowser in the Sky" , player , world )
225
245
create_locs (regBitS , "Bowser in the Sky 1Up Block" )
226
- create_subregion (regBitS , "BitS: Top" , "Bowser in the Sky Red Coins" )
246
+ bits_top = create_subregion (regBitS , "BitS: Top" , "Bowser in the Sky Red Coins" )
247
+ regBitS .subregions = [bits_top ]
227
248
228
249
229
250
def connect_regions (world : MultiWorld , player : int , source : str , target : str , rule = None ):
@@ -232,14 +253,14 @@ def connect_regions(world: MultiWorld, player: int, source: str, target: str, ru
232
253
sourceRegion .connect (targetRegion , rule = rule )
233
254
234
255
235
- def create_region (name : str , player : int , world : MultiWorld ) -> Region :
236
- region = Region (name , player , world )
256
+ def create_region (name : str , player : int , world : MultiWorld ) -> SM64Region :
257
+ region = SM64Region (name , player , world )
237
258
world .regions .append (region )
238
259
return region
239
260
240
261
241
- def create_subregion (source_region : Region , name : str , * locs : str ) -> Region :
242
- region = Region (name , source_region .player , source_region .multiworld )
262
+ def create_subregion (source_region : Region , name : str , * locs : str ) -> SM64Region :
263
+ region = SM64Region (name , source_region .player , source_region .multiworld )
243
264
connection = Entrance (source_region .player , name , source_region )
244
265
source_region .exits .append (connection )
245
266
connection .connect (region )
0 commit comments