98
98
def set_rules (world : MMX3World ):
99
99
player = world .player
100
100
multiworld = world .multiworld
101
+ jammed_buster = world .options .jammed_buster .value
101
102
102
103
multiworld .completion_condition [player ] = lambda state : state .has (ItemName .victory , player )
103
104
@@ -120,28 +121,28 @@ def set_rules(world: MMX3World):
120
121
lambda state : state .has (ItemName .stage_blast_hornet , player ))
121
122
122
123
# Doppler Lab entrance rules
123
- doppler_open = world .doppler_open
124
+ doppler_open = world .options . doppler_open . value
124
125
entrance = multiworld .get_entrance (f"{ RegionName .intro_stage } -> { RegionName .dr_doppler_lab } " , player )
125
126
126
127
if len (doppler_open ) == 0 :
127
128
set_rule (entrance , lambda state : state .has (ItemName .stage_doppler_lab , player ))
128
129
else :
129
- if "Medals" in doppler_open and world .doppler_medal_count > 0 :
130
- add_rule (entrance , lambda state : state .has (ItemName .maverick_medal , player , world .doppler_medal_count ))
131
- if "Weapons" in doppler_open and world .doppler_weapon_count > 0 :
132
- add_rule (entrance , lambda state : state .has_group ("Weapons" , player , world .doppler_weapon_count ))
133
- if "Armor Upgrades" in doppler_open and world .doppler_upgrade_count > 0 :
134
- add_rule (entrance , lambda state : state .has_group ("Armor Upgrades" , player , world .doppler_upgrade_count ))
135
- if "Heart Tanks" in doppler_open and world .doppler_heart_tank_count > 0 :
136
- add_rule (entrance , lambda state : state .has (ItemName .heart_tank , player , world .doppler_heart_tank_count ))
137
- if "Sub Tanks" in doppler_open and world .doppler_sub_tank_count > 0 :
138
- add_rule (entrance , lambda state : state .has (ItemName .sub_tank , player , world .doppler_sub_tank_count ))
130
+ if "Medals" in doppler_open and world .options . doppler_medal_count . value > 0 :
131
+ add_rule (entrance , lambda state : state .has (ItemName .maverick_medal , player , world .options . doppler_medal_count . value ))
132
+ if "Weapons" in doppler_open and world .options . doppler_weapon_count . value > 0 :
133
+ add_rule (entrance , lambda state : state .has_group ("Weapons" , player , world .options . doppler_weapon_count . value ))
134
+ if "Armor Upgrades" in doppler_open and world .options . doppler_upgrade_count . value > 0 :
135
+ add_rule (entrance , lambda state : state .has_group ("Armor Upgrades" , player , world .options . doppler_upgrade_count . value ))
136
+ if "Heart Tanks" in doppler_open and world .options . doppler_heart_tank_count . value > 0 :
137
+ add_rule (entrance , lambda state : state .has (ItemName .heart_tank , player , world .options . doppler_heart_tank_count . value ))
138
+ if "Sub Tanks" in doppler_open and world .options . doppler_sub_tank_count . value > 0 :
139
+ add_rule (entrance , lambda state : state .has (ItemName .sub_tank , player , world .options . doppler_sub_tank_count . value ))
139
140
140
- if world .logic_vile_required :
141
+ if world .options . logic_vile_required . value :
141
142
add_rule (entrance , lambda state : state .has (EventName .vile_defeated , player ))
142
143
143
144
# Doppler Lab level rules
144
- if world .doppler_all_labs :
145
+ if world .options . doppler_all_labs :
145
146
set_rule (multiworld .get_entrance (f"{ RegionName .dr_doppler_lab } -> { RegionName .dr_doppler_lab_4 } " , player ),
146
147
lambda state : (
147
148
state .has (EventName .dr_doppler_lab_1_clear , player ) and
@@ -157,12 +158,12 @@ def set_rules(world: MMX3World):
157
158
lambda state : state .has (EventName .dr_doppler_lab_3_clear , player ))
158
159
159
160
# Set Boss rematch rules
160
- if world .doppler_lab_3_boss_rematch_count > 0 :
161
+ if world .options . doppler_lab_3_boss_rematch_count . value > 0 :
161
162
set_rule (multiworld .get_entrance (f"{ RegionName .dr_doppler_lab_3_rematches } -> { RegionName .dr_doppler_lab_3_after_rematches } " , player ),
162
- lambda state : state .has (EventName .boss_rematch_clear , player , world .doppler_lab_3_boss_rematch_count ))
163
+ lambda state : state .has (EventName .boss_rematch_clear , player , world .options . doppler_lab_3_boss_rematch_count . value ))
163
164
164
165
# Vile entrance rules
165
- vile_open = world .vile_open
166
+ vile_open = world .options . vile_open . value
166
167
entrance_blizzard = multiworld .get_entrance (f"{ RegionName .blizzard_buffalo_start } -> { RegionName .vile } " , player )
167
168
entrance_volt = multiworld .get_entrance (f"{ RegionName .volt_catfish_start } -> { RegionName .vile } " , player )
168
169
entrance_crush = multiworld .get_entrance (f"{ RegionName .crush_crawfish_start } -> { RegionName .vile } " , player )
@@ -171,57 +172,57 @@ def set_rules(world: MMX3World):
171
172
set_rule (entrance_volt , lambda state : state .has (ItemName .stage_vile , player ))
172
173
set_rule (entrance_crush , lambda state : state .has (ItemName .stage_vile , player ))
173
174
else :
174
- if "Medals" in vile_open and world .vile_medal_count > 0 :
175
- add_rule (entrance_blizzard , lambda state : state .has (ItemName .maverick_medal , player , world .vile_medal_count ))
176
- add_rule (entrance_volt , lambda state : state .has (ItemName .maverick_medal , player , world .vile_medal_count ))
177
- add_rule (entrance_crush , lambda state : state .has (ItemName .maverick_medal , player , world .vile_medal_count ))
178
- if "Weapons" in vile_open and world .vile_weapon_count > 0 :
179
- add_rule (entrance_blizzard , lambda state : state .has_group ("Weapons" , player , world .vile_weapon_count ))
180
- add_rule (entrance_volt , lambda state : state .has_group ("Weapons" , player , world .vile_weapon_count ))
181
- add_rule (entrance_crush , lambda state : state .has_group ("Weapons" , player , world .vile_weapon_count ))
182
- if "Armor Upgrades" in vile_open and world .vile_upgrade_count > 0 :
183
- add_rule (entrance_blizzard , lambda state : state .has_group ("Armor Upgrades" , player , world .vile_upgrade_count ))
184
- add_rule (entrance_volt , lambda state : state .has_group ("Armor Upgrades" , player , world .vile_upgrade_count ))
185
- add_rule (entrance_crush , lambda state : state .has_group ("Armor Upgrades" , player , world .vile_upgrade_count ))
186
- if "Heart Tanks" in vile_open and world .vile_heart_tank_count > 0 :
187
- add_rule (entrance_blizzard , lambda state : state .has (ItemName .heart_tank , player , world .vile_heart_tank_count ))
188
- add_rule (entrance_volt , lambda state : state .has (ItemName .heart_tank , player , world .vile_heart_tank_count ))
189
- add_rule (entrance_crush , lambda state : state .has (ItemName .heart_tank , player , world .vile_heart_tank_count ))
190
- if "Sub Tanks" in vile_open and world .vile_sub_tank_count > 0 :
191
- add_rule (entrance_blizzard , lambda state : state .has (ItemName .sub_tank , player , world .vile_sub_tank_count ))
192
- add_rule (entrance_volt , lambda state : state .has (ItemName .sub_tank , player , world .vile_sub_tank_count ))
193
- add_rule (entrance_crush , lambda state : state .has (ItemName .sub_tank , player , world .vile_sub_tank_count ))
175
+ if "Medals" in vile_open and world .options . vile_medal_count . value > 0 :
176
+ add_rule (entrance_blizzard , lambda state : state .has (ItemName .maverick_medal , player , world .options . vile_medal_count . value ))
177
+ add_rule (entrance_volt , lambda state : state .has (ItemName .maverick_medal , player , world .options . vile_medal_count . value ))
178
+ add_rule (entrance_crush , lambda state : state .has (ItemName .maverick_medal , player , world .options . vile_medal_count . value ))
179
+ if "Weapons" in vile_open and world .options . vile_weapon_count . value > 0 :
180
+ add_rule (entrance_blizzard , lambda state : state .has_group ("Weapons" , player , world .options . vile_weapon_count . value ))
181
+ add_rule (entrance_volt , lambda state : state .has_group ("Weapons" , player , world .options . vile_weapon_count . value ))
182
+ add_rule (entrance_crush , lambda state : state .has_group ("Weapons" , player , world .options . vile_weapon_count . value ))
183
+ if "Armor Upgrades" in vile_open and world .options . vile_upgrade_count . value > 0 :
184
+ add_rule (entrance_blizzard , lambda state : state .has_group ("Armor Upgrades" , player , world .options . vile_upgrade_count . value ))
185
+ add_rule (entrance_volt , lambda state : state .has_group ("Armor Upgrades" , player , world .options . vile_upgrade_count . value ))
186
+ add_rule (entrance_crush , lambda state : state .has_group ("Armor Upgrades" , player , world .options . vile_upgrade_count . value ))
187
+ if "Heart Tanks" in vile_open and world .options . vile_heart_tank_count . value > 0 :
188
+ add_rule (entrance_blizzard , lambda state : state .has (ItemName .heart_tank , player , world .options . vile_heart_tank_count . value ))
189
+ add_rule (entrance_volt , lambda state : state .has (ItemName .heart_tank , player , world .options . vile_heart_tank_count . value ))
190
+ add_rule (entrance_crush , lambda state : state .has (ItemName .heart_tank , player , world .options . vile_heart_tank_count . value ))
191
+ if "Sub Tanks" in vile_open and world .options . vile_sub_tank_count . value > 0 :
192
+ add_rule (entrance_blizzard , lambda state : state .has (ItemName .sub_tank , player , world .options . vile_sub_tank_count . value ))
193
+ add_rule (entrance_volt , lambda state : state .has (ItemName .sub_tank , player , world .options . vile_sub_tank_count . value ))
194
+ add_rule (entrance_crush , lambda state : state .has (ItemName .sub_tank , player , world .options . vile_sub_tank_count . value ))
194
195
195
196
# Bit & Byte arena entrance rules
196
197
set_rule (multiworld .get_entrance (f"{ RegionName .blast_hornet_bit_byte } -> { RegionName .bit_byte } " , player ),
197
- lambda state : state .has (ItemName .maverick_medal , player , world .bit_medal_count ))
198
+ lambda state : state .has (ItemName .maverick_medal , player , world .options . bit_medal_count . value ))
198
199
set_rule (multiworld .get_entrance (f"{ RegionName .blizzard_buffalo_bit_byte } -> { RegionName .bit_byte } " , player ),
199
- lambda state : state .has (ItemName .maverick_medal , player , world .bit_medal_count ))
200
+ lambda state : state .has (ItemName .maverick_medal , player , world .options . bit_medal_count . value ))
200
201
set_rule (multiworld .get_entrance (f"{ RegionName .toxic_seahorse_bit_byte } -> { RegionName .bit_byte } " , player ),
201
- lambda state : state .has (ItemName .maverick_medal , player , world .bit_medal_count ))
202
+ lambda state : state .has (ItemName .maverick_medal , player , world .options . bit_medal_count . value ))
202
203
set_rule (multiworld .get_entrance (f"{ RegionName .tunnel_rhino_bit_byte } -> { RegionName .bit_byte } " , player ),
203
- lambda state : state .has (ItemName .maverick_medal , player , world .bit_medal_count ))
204
+ lambda state : state .has (ItemName .maverick_medal , player , world .options . bit_medal_count . value ))
204
205
set_rule (multiworld .get_entrance (f"{ RegionName .volt_catfish_bit_byte } -> { RegionName .bit_byte } " , player ),
205
- lambda state : state .has (ItemName .maverick_medal , player , world .bit_medal_count ))
206
+ lambda state : state .has (ItemName .maverick_medal , player , world .options . bit_medal_count . value ))
206
207
set_rule (multiworld .get_entrance (f"{ RegionName .crush_crawfish_bit_byte } -> { RegionName .bit_byte } " , player ),
207
- lambda state : state .has (ItemName .maverick_medal , player , world .bit_medal_count ))
208
+ lambda state : state .has (ItemName .maverick_medal , player , world .options . bit_medal_count . value ))
208
209
set_rule (multiworld .get_entrance (f"{ RegionName .neon_tiger_bit_byte } -> { RegionName .bit_byte } " , player ),
209
- lambda state : state .has (ItemName .maverick_medal , player , world .bit_medal_count ))
210
+ lambda state : state .has (ItemName .maverick_medal , player , world .options . bit_medal_count . value ))
210
211
set_rule (multiworld .get_entrance (f"{ RegionName .gravity_beetle_bit_byte } -> { RegionName .bit_byte } " , player ),
211
- lambda state : state .has (ItemName .maverick_medal , player , world .bit_medal_count ))
212
+ lambda state : state .has (ItemName .maverick_medal , player , world .options . bit_medal_count . value ))
212
213
213
214
# Set Bit rules
214
215
set_rule (multiworld .get_location (LocationName .bit_defeat , player ),
215
- lambda state : state .has (ItemName .maverick_medal , player , world .bit_medal_count ))
216
+ lambda state : state .has (ItemName .maverick_medal , player , world .options . bit_medal_count . value ))
216
217
set_rule (multiworld .get_location (EventName .bit_defeated , player ),
217
- lambda state : state .has (ItemName .maverick_medal , player , world .bit_medal_count ))
218
+ lambda state : state .has (ItemName .maverick_medal , player , world .options . bit_medal_count . value ))
218
219
219
220
# Set Byte rules
220
221
set_rule (multiworld .get_location (LocationName .byte_defeat , player ),
221
- lambda state : state .has (ItemName .maverick_medal , player , world .byte_medal_count ) and
222
+ lambda state : state .has (ItemName .maverick_medal , player , world .options . byte_medal_count . value ) and
222
223
state .can_reach_location (LocationName .bit_defeat , player ))
223
224
set_rule (multiworld .get_location (EventName .byte_defeated , player ),
224
- lambda state : state .has (ItemName .maverick_medal , player , world .byte_medal_count ) and
225
+ lambda state : state .has (ItemName .maverick_medal , player , world .options . byte_medal_count . value ) and
225
226
state .can_reach_location (LocationName .bit_defeat , player ))
226
227
227
228
# Set Blizzard Buffalo collectible rules
@@ -242,7 +243,7 @@ def set_rules(world: MMX3World):
242
243
state .has (ItemName .ride_frog , player ) or
243
244
(
244
245
state .has (ItemName .frost_shield , player ) and
245
- state .has (ItemName .third_armor_arms , player , world . jammed_buster + 1 )
246
+ state .has (ItemName .third_armor_arms , player , jammed_buster + 1 )
246
247
)
247
248
)
248
249
))
@@ -252,19 +253,19 @@ def set_rules(world: MMX3World):
252
253
state .has (ItemName .ride_frog , player ) or
253
254
(
254
255
state .has (ItemName .frost_shield , player ) and
255
- state .has (ItemName .third_armor_arms , player , world . jammed_buster + 1 )
256
+ state .has (ItemName .third_armor_arms , player , jammed_buster + 1 )
256
257
)
257
258
))
258
259
259
260
# Set Tunnel Rhino collectible rules
260
261
set_rule (multiworld .get_location (LocationName .tunnel_rhino_heart_tank , player ),
261
262
lambda state : (
262
- state .has (ItemName .third_armor_arms , player , world . jammed_buster + 1 ) and
263
+ state .has (ItemName .third_armor_arms , player , jammed_buster + 1 ) and
263
264
state .has (ItemName .triad_thunder , player )
264
265
))
265
266
set_rule (multiworld .get_location (LocationName .tunnel_rhino_helmet , player ),
266
267
lambda state : (
267
- state .has (ItemName .third_armor_arms , player , world . jammed_buster + 1 ) and
268
+ state .has (ItemName .third_armor_arms , player , jammed_buster + 1 ) and
268
269
state .has (ItemName .triad_thunder , player )
269
270
))
270
271
@@ -273,7 +274,7 @@ def set_rules(world: MMX3World):
273
274
lambda state : state .has_group ("Ride Armors" , player , 1 ))
274
275
set_rule (multiworld .get_location (LocationName .volt_catfish_body , player ),
275
276
lambda state : (
276
- state .has (ItemName .third_armor_arms , player , world . jammed_buster + 1 ) and
277
+ state .has (ItemName .third_armor_arms , player , jammed_buster + 1 ) and
277
278
state .has (ItemName .gravity_well , player )
278
279
))
279
280
@@ -284,7 +285,7 @@ def set_rules(world: MMX3World):
284
285
lambda state : state .has_group ("Ride Armors" , player , 1 ))
285
286
set_rule (multiworld .get_location (LocationName .crush_crawfish_hawk_ride , player ),
286
287
lambda state : (
287
- state .has (ItemName .third_armor_arms , player , world . jammed_buster + 1 ) and
288
+ state .has (ItemName .third_armor_arms , player , jammed_buster + 1 ) and
288
289
state .has (ItemName .triad_thunder , player )
289
290
))
290
291
@@ -322,15 +323,15 @@ def set_rules(world: MMX3World):
322
323
))
323
324
324
325
# Handle bosses weakness
325
- if world .logic_boss_weakness or world .boss_weakness_strictness >= 2 :
326
+ if world .options . logic_boss_weakness . value or world .options . boss_weakness_strictness . value >= 2 :
326
327
add_boss_weakness_logic (world )
327
328
328
329
# Handle pickupsanity logic
329
- if world .pickupsanity :
330
+ if world .options . pickupsanity . value :
330
331
add_pickupsanity_logic (world )
331
332
332
333
# Handle helmet logic
333
- if world .logic_helmet_checkpoints :
334
+ if world .options . logic_helmet_checkpoints . value :
334
335
add_helmet_logic (world )
335
336
336
337
@@ -345,12 +346,13 @@ def check_weaknesses(state: CollectionState, player: int, rulesets: list) -> boo
345
346
def add_boss_weakness_logic (world : MMX3World ):
346
347
player = world .player
347
348
multiworld = world .multiworld
349
+ jammed_buster = world .options .jammed_buster .value
348
350
349
351
boss_dict = {}
350
352
for boss , regions in bosses .items ():
351
353
boss_dict [boss ] = regions .copy ()
352
354
353
- if boss in mavericks and world .doppler_lab_3_boss_rematch_count == 0 :
355
+ if boss in mavericks and world .options . doppler_lab_3_boss_rematch_count . value == 0 :
354
356
boss_dict [boss ].pop ()
355
357
boss_dict [boss ].pop ()
356
358
@@ -362,7 +364,7 @@ def add_boss_weakness_logic(world: MMX3World):
362
364
world .boss_weaknesses ["Dr. Doppler's Lab 1 Boss" ].append (weakness )
363
365
364
366
if boss == "Dr. Doppler's Lab 2 Boss" :
365
- if world .doppler_lab_2_boss == "vile" :
367
+ if world .options . doppler_lab_2_boss == "vile" :
366
368
boss_dict ["Vile Goliath" ] = list ()
367
369
boss_dict ["Vile Goliath" ].append (LocationName .doppler_lab_2_boss )
368
370
boss_dict ["Vile Goliath" ].append (EventName .dr_doppler_lab_2_clear )
@@ -384,7 +386,7 @@ def add_boss_weakness_logic(world: MMX3World):
384
386
weakness = weakness [0 ]
385
387
ruleset = dict ()
386
388
if "Check Charge" in weakness [0 ]:
387
- ruleset [ItemName .third_armor_arms ] = world . jammed_buster + int (weakness [0 ][- 1 :]) - 1
389
+ ruleset [ItemName .third_armor_arms ] = jammed_buster + int (weakness [0 ][- 1 :]) - 1
388
390
else :
389
391
ruleset [weakness [0 ]] = 1
390
392
if len (weakness ) != 1 :
0 commit comments