forked from tanjo3/tww_apworld
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rules.py
1666 lines (1588 loc) · 72.9 KB
/
Rules.py
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# flake8: noqa
from typing import TYPE_CHECKING
from worlds.AutoWorld import LogicMixin
from worlds.generic.Rules import set_rule
from .Macros import *
if TYPE_CHECKING:
from . import TWWWorld
class TWWLogic(LogicMixin):
def _tww_has_chart_for_island(self, player: int, island_number: int) -> bool:
chart_item_name = self.multiworld.worlds[player].charts.island_number_to_chart_name[island_number]
if "Triforce Chart" in chart_item_name:
return self.has(chart_item_name, player) and has_any_wallet_upgrade(self, player)
else:
return self.has(chart_item_name, player)
def _tww_can_defeat_all_required_bosses(self, player: int) -> bool:
required_boss_item_locations = self.multiworld.worlds[player].boss_reqs.required_boss_item_locations
return all(self.can_reach_location(loc, player) for loc in required_boss_item_locations)
def _tww_rematch_bosses_skipped(self, player: int) -> bool:
return self.multiworld.worlds[player].options.skip_rematch_bosses
def _tww_in_swordless_mode(self, player: int) -> bool:
return self.multiworld.worlds[player].options.sword_mode in ("swords_optional", "swordless")
def _tww_outside_swordless_mode(self, player: int) -> bool:
return self.multiworld.worlds[player].options.sword_mode not in ("swords_optional", "swordless")
def _tww_in_required_bosses_mode(self, player: int) -> bool:
return self.multiworld.worlds[player].options.required_bosses
def _tww_outside_required_bosses_mode(self, player: int) -> bool:
return not self.multiworld.worlds[player].options.required_bosses
def _tww_obscure_1(self, player: int) -> bool:
return (
self.multiworld.worlds[player].options.logic_obscurity == "normal"
or self.multiworld.worlds[player].options.logic_obscurity == "hard"
or self.multiworld.worlds[player].options.logic_obscurity == "very_hard"
)
def _tww_obscure_2(self, player: int) -> bool:
return (
self.multiworld.worlds[player].options.logic_obscurity == "hard"
or self.multiworld.worlds[player].options.logic_obscurity == "very_hard"
)
def _tww_obscure_3(self, player: int) -> bool:
return self.multiworld.worlds[player].options.logic_obscurity == "very_hard"
def _tww_precise_1(self, player: int) -> bool:
return (
self.multiworld.worlds[player].options.logic_precision == "normal"
or self.multiworld.worlds[player].options.logic_precision == "hard"
or self.multiworld.worlds[player].options.logic_precision == "very_hard"
)
def _tww_precise_2(self, player: int) -> bool:
return (
self.multiworld.worlds[player].options.logic_precision == "hard"
or self.multiworld.worlds[player].options.logic_precision == "very_hard"
)
def _tww_precise_3(self, player: int) -> bool:
return self.multiworld.worlds[player].options.logic_precision == "very_hard"
def _tww_tuner_logic_enabled(self, player: int) -> bool:
return self.multiworld.worlds[player].options.enable_tuner_logic
def set_rules(world: "TWWWorld") -> None: # noqa: F405
player = world.player
# Outset Island
set_rule(world.get_location("Outset Island - Underneath Link's House"), lambda state: True)
set_rule(world.get_location("Outset Island - Mesa the Grasscutter's House"), lambda state: True)
set_rule(
world.get_location("Outset Island - Orca - Give 10 Knight's Crests"),
lambda state: state.has("Spoils Bag", player)
and can_farm_knights_crests(state, player)
and can_sword_fight_with_orca(state, player)
and has_magic_meter(state, player),
)
# set_rule(
# world.get_location("Outset Island - Orca - Hit 500 Times"),
# lambda state: can_sword_fight_with_orca(state, player),
# )
set_rule(
world.get_location("Outset Island - Great Fairy"),
lambda state: can_access_outset_fairy_fountain(state, player),
)
set_rule(world.get_location("Outset Island - Jabun's Cave"), lambda state: state.has("Bombs", player))
set_rule(
world.get_location("Outset Island - Dig up Black Soil"),
lambda state: state.has("Bait Bag", player)
and can_buy_bait(state, player)
and state.has("Power Bracelets", player),
)
set_rule(
world.get_location("Outset Island - Savage Labyrinth - Floor 30"),
lambda state: can_access_savage_labyrinth(state, player)
and can_defeat_keese(state, player)
and can_defeat_miniblins(state, player)
and can_defeat_red_chuchus(state, player)
and can_defeat_magtails(state, player)
and can_defeat_fire_keese(state, player)
and can_defeat_peahats(state, player)
and can_defeat_green_chuchus(state, player)
and can_defeat_boko_babas(state, player)
and can_defeat_mothulas(state, player)
and can_defeat_winged_mothulas(state, player)
and can_defeat_wizzrobes(state, player)
and can_defeat_armos(state, player)
and can_defeat_yellow_chuchus(state, player)
and can_defeat_red_bubbles(state, player)
and can_defeat_darknuts(state, player)
and can_play_winds_requiem(state, player)
and (
state.has("Grappling Hook", player) or has_heros_sword(state, player) or state.has("Skull Hammer", player)
),
)
set_rule(
world.get_location("Outset Island - Savage Labyrinth - Floor 50"),
lambda state: state.can_reach_location("Outset Island - Savage Labyrinth - Floor 30", player)
and can_aim_mirror_shield(state, player)
and can_defeat_redeads(state, player)
and can_defeat_blue_bubbles(state, player)
and can_defeat_dark_chuchus(state, player)
and can_defeat_poes(state, player)
and can_defeat_stalfos(state, player)
and state.has("Skull Hammer", player),
)
# Windfall Island
set_rule(world.get_location("Windfall Island - Jail - Tingle - First Gift"), lambda state: True)
set_rule(world.get_location("Windfall Island - Jail - Tingle - Second Gift"), lambda state: True)
set_rule(world.get_location("Windfall Island - Jail - Maze Chest"), lambda state: True)
set_rule(
world.get_location("Windfall Island - Chu Jelly Juice Shop - Give 15 Green Chu Jelly"),
lambda state: can_farm_green_chu_jelly(state, player),
)
set_rule(
world.get_location("Windfall Island - Chu Jelly Juice Shop - Give 15 Blue Chu Jelly"),
lambda state: can_obtain_15_blue_chu_jelly(state, player),
)
set_rule(world.get_location("Windfall Island - Ivan - Catch Killer Bees"), lambda state: True)
set_rule(world.get_location("Windfall Island - Mrs. Marie - Catch Killer Bees"), lambda state: True)
set_rule(
world.get_location("Windfall Island - Mrs. Marie - Give 1 Joy Pendant"),
# In Archipelago, the non-randomized Joy Pendant on Windfall is not obtainable, so require the player to have
# a way to collect Joy Pendants.
lambda state: state.has("Spoils Bag", player) and can_farm_joy_pendants(state, player),
)
set_rule(
world.get_location("Windfall Island - Mrs. Marie - Give 21 Joy Pendants"),
lambda state: state.has("Spoils Bag", player) and can_farm_joy_pendants(state, player),
)
set_rule(
world.get_location("Windfall Island - Mrs. Marie - Give 40 Joy Pendants"),
lambda state: state.has("Spoils Bag", player) and can_farm_joy_pendants(state, player),
)
set_rule(
world.get_location("Windfall Island - Lenzo's House - Left Chest"),
lambda state: can_play_winds_requiem(state, player) and has_picto_box(state, player),
)
set_rule(
world.get_location("Windfall Island - Lenzo's House - Right Chest"),
lambda state: can_play_winds_requiem(state, player) and has_picto_box(state, player),
)
set_rule(
world.get_location("Windfall Island - Lenzo's House - Become Lenzo's Assistant"),
lambda state: has_picto_box(state, player),
)
set_rule(
world.get_location("Windfall Island - Lenzo's House - Bring Forest Firefly"),
lambda state: has_picto_box(state, player)
and state.has("Empty Bottle", player)
and can_access_forest_haven(state, player),
)
set_rule(world.get_location("Windfall Island - House of Wealth Chest"), lambda state: True)
set_rule(
world.get_location("Windfall Island - Maggie's Father - Give 20 Skull Necklaces"),
lambda state: rescued_aryll(state, player)
and state.has("Spoils Bag", player)
and can_farm_skull_necklaces(state, player),
)
set_rule(world.get_location("Windfall Island - Maggie - Free Item"), lambda state: rescued_aryll(state, player))
set_rule(
world.get_location("Windfall Island - Maggie - Delivery Reward"),
lambda state: rescued_aryll(state, player)
and state.has("Delivery Bag", player)
and state.has("Moblin's Letter", player),
)
set_rule(
world.get_location("Windfall Island - Cafe Bar - Postman"),
lambda state: rescued_aryll(state, player)
and state.has("Delivery Bag", player)
and state.has("Maggie's Letter", player),
)
set_rule(
world.get_location("Windfall Island - Kreeb - Light Up Lighthouse"),
lambda state: can_play_winds_requiem(state, player) and has_fire_arrows(state, player),
)
set_rule(
world.get_location("Windfall Island - Transparent Chest"),
lambda state: can_play_winds_requiem(state, player)
and has_fire_arrows(state, player)
and (can_fly_with_deku_leaf_outdoors(state, player) or state.has("Hookshot", player)),
)
set_rule(
world.get_location("Windfall Island - Tott - Teach Rhythm"),
lambda state: state.has("Wind Waker", player),
)
set_rule(world.get_location("Windfall Island - Pirate Ship"), lambda state: True)
set_rule(world.get_location("Windfall Island - 5 Rupee Auction"), lambda state: True)
set_rule(world.get_location("Windfall Island - 40 Rupee Auction"), lambda state: True)
set_rule(world.get_location("Windfall Island - 60 Rupee Auction"), lambda state: True)
set_rule(world.get_location("Windfall Island - 80 Rupee Auction"), lambda state: True)
set_rule(
world.get_location("Windfall Island - Zunari - Stock Exotic Flower in Zunari's Shop"),
lambda state: rescued_aryll(state, player) and state.has("Delivery Bag", player),
)
set_rule(
world.get_location("Windfall Island - Sam - Decorate the Town"),
lambda state: rescued_aryll(state, player) and state.has("Delivery Bag", player),
)
# set_rule(
# world.get_location("Windfall Island - Kane - Place Shop Guru Statue on Gate"),
# lambda state: rescued_aryll(state, player) and state.has("Delivery Bag", player),
# )
# set_rule(
# world.get_location("Windfall Island - Kane - Place Postman Statue on Gate"),
# lambda state: rescued_aryll(state, player) and state.has("Delivery Bag", player),
# )
# set_rule(
# world.get_location("Windfall Island - Kane - Place Six Flags on Gate"),
# lambda state: rescued_aryll(state, player) and state.has("Delivery Bag", player),
# )
# set_rule(
# world.get_location("Windfall Island - Kane - Place Six Idols on Gate"),
# lambda state: rescued_aryll(state, player) and state.has("Delivery Bag", player),
# )
set_rule(
world.get_location("Windfall Island - Mila - Follow the Thief"), lambda state: rescued_aryll(state, player)
)
set_rule(world.get_location("Windfall Island - Battlesquid - First Prize"), lambda state: True)
set_rule(world.get_location("Windfall Island - Battlesquid - Second Prize"), lambda state: True)
set_rule(world.get_location("Windfall Island - Battlesquid - Under 20 Shots Prize"), lambda state: True)
set_rule(
world.get_location("Windfall Island - Pompie and Vera - Secret Meeting Photo"),
lambda state: can_play_winds_requiem(state, player) and has_picto_box(state, player),
)
set_rule(
world.get_location("Windfall Island - Kamo - Full Moon Photo"),
lambda state: has_deluxe_picto_box(state, player) and can_play_song_of_passing(state, player),
)
set_rule(
world.get_location("Windfall Island - Minenco - Miss Windfall Photo"),
lambda state: has_deluxe_picto_box(state, player),
)
set_rule(
world.get_location("Windfall Island - Linda and Anton"),
lambda state: has_deluxe_picto_box(state, player) and can_play_song_of_passing(state, player),
)
# Dragon Roost Island
set_rule(world.get_location("Dragon Roost Island - Wind Shrine"), lambda state: state.has("Wind Waker", player))
set_rule(
world.get_location("Dragon Roost Island - Rito Aerie - Give Hoskit 20 Golden Feathers"),
lambda state: state.has("Spoils Bag", player) and can_farm_golden_feathers(state, player),
)
set_rule(
world.get_location("Dragon Roost Island - Chest on Top of Boulder"),
lambda state: has_heros_bow(state, player)
or (state.has("Bait Bag", player) and can_buy_hyoi_pears(state, player))
or state.has("Boomerang", player)
or state.has("Bombs", player),
)
set_rule(
world.get_location("Dragon Roost Island - Fly Across Platforms Around Island"),
lambda state: can_fly_with_deku_leaf_outdoors(state, player)
and (can_cut_grass(state, player) or has_magic_meter_upgrade(state, player)),
)
set_rule(world.get_location("Dragon Roost Island - Rito Aerie - Mail Sorting"), lambda state: True)
set_rule(
world.get_location("Dragon Roost Island - Secret Cave"),
lambda state: can_access_dragon_roost_island_secret_cave(state, player)
and can_defeat_keese(state, player)
and can_defeat_red_chuchus(state, player),
)
# Dragon Roost Cavern
set_rule(
world.get_location("Dragon Roost Cavern - First Room"),
lambda state: can_access_dragon_roost_cavern(state, player),
)
set_rule(
world.get_location("Dragon Roost Cavern - Alcove With Water Jugs"),
lambda state: can_access_dragon_roost_cavern(state, player) and state.has("DRC Small Key", player, 1),
)
set_rule(
world.get_location("Dragon Roost Cavern - Water Jug on Upper Shelf"),
lambda state: can_access_dragon_roost_cavern(state, player) and state.has("DRC Small Key", player, 1),
)
set_rule(
world.get_location("Dragon Roost Cavern - Boarded Up Chest"),
lambda state: can_access_dragon_roost_cavern(state, player) and state.has("DRC Small Key", player, 1),
)
set_rule(
world.get_location("Dragon Roost Cavern - Chest Across Lava Pit"),
lambda state: can_access_dragon_roost_cavern(state, player)
and state.has("DRC Small Key", player, 2)
and (
state.has("Grappling Hook", player)
or can_fly_with_deku_leaf_indoors(state, player)
or (state.has("Hookshot", player) and state._tww_obscure_1(player))
),
)
set_rule(
world.get_location("Dragon Roost Cavern - Rat Room"),
lambda state: can_access_dragon_roost_cavern(state, player) and state.has("DRC Small Key", player, 2),
)
set_rule(
world.get_location("Dragon Roost Cavern - Rat Room Boarded Up Chest"),
lambda state: can_access_dragon_roost_cavern(state, player) and state.has("DRC Small Key", player, 2),
)
set_rule(
world.get_location("Dragon Roost Cavern - Bird's Nest"),
lambda state: can_access_dragon_roost_cavern(state, player) and state.has("DRC Small Key", player, 3),
)
set_rule(
world.get_location("Dragon Roost Cavern - Dark Room"),
lambda state: can_access_dragon_roost_cavern(state, player) and state.has("DRC Small Key", player, 4),
)
set_rule(
world.get_location("Dragon Roost Cavern - Tingle Chest in Hub Room"),
lambda state: can_access_dragon_roost_cavern(state, player)
and state.has("DRC Small Key", player, 4)
and has_tingle_bombs(state, player),
)
set_rule(
world.get_location("Dragon Roost Cavern - Pot on Upper Shelf in Pot Room"),
lambda state: can_access_dragon_roost_cavern(state, player) and state.has("DRC Small Key", player, 4),
)
set_rule(
world.get_location("Dragon Roost Cavern - Pot Room Chest"),
lambda state: can_access_dragon_roost_cavern(state, player) and state.has("DRC Small Key", player, 4),
)
set_rule(
world.get_location("Dragon Roost Cavern - Miniboss"),
lambda state: can_access_dragon_roost_cavern(state, player) and state.has("DRC Small Key", player, 4),
)
set_rule(
world.get_location("Dragon Roost Cavern - Under Rope Bridge"),
lambda state: can_access_dragon_roost_cavern(state, player)
and state.has("DRC Small Key", player, 4)
and (state.has("Grappling Hook", player) or can_fly_with_deku_leaf_outdoors(state, player)),
)
set_rule(
world.get_location("Dragon Roost Cavern - Tingle Statue Chest"),
lambda state: can_reach_dragon_roost_cavern_gaping_maw(state, player)
and state.has("Grappling Hook", player)
and has_tingle_bombs(state, player),
)
set_rule(
world.get_location("Dragon Roost Cavern - Big Key Chest"),
lambda state: can_reach_dragon_roost_cavern_gaping_maw(state, player)
and state.has("Grappling Hook", player)
and can_stun_magtails(state, player),
)
set_rule(
world.get_location("Dragon Roost Cavern - Boss Stairs Right Chest"),
lambda state: can_reach_dragon_roost_cavern_boss_stairs(state, player),
)
set_rule(
world.get_location("Dragon Roost Cavern - Boss Stairs Left Chest"),
lambda state: can_reach_dragon_roost_cavern_boss_stairs(state, player),
)
set_rule(
world.get_location("Dragon Roost Cavern - Boss Stairs Right Pot"),
lambda state: can_reach_dragon_roost_cavern_boss_stairs(state, player),
)
set_rule(
world.get_location("Dragon Roost Cavern - Gohma Heart Container"),
lambda state: can_access_gohma_boss_arena(state, player) and can_defeat_gohma(state, player),
)
# Forest Haven
set_rule(
world.get_location("Forest Haven - On Tree Branch"),
lambda state: can_access_forest_haven(state, player)
and (
state.has("Grappling Hook", player)
or (
can_fly_with_deku_leaf_indoors(state, player)
and can_fly_with_deku_leaf_outdoors(state, player)
and state._tww_obscure_1(player)
and (
(can_cut_grass(state, player) and state._tww_precise_1(player))
or (has_magic_meter_upgrade(state, player) and state._tww_precise_2(player))
)
)
),
)
set_rule(
world.get_location("Forest Haven - Small Island Chest"),
lambda state: can_access_forest_haven(state, player)
and (
state.has("Grappling Hook", player)
or (
can_fly_with_deku_leaf_indoors(state, player)
and can_fly_with_deku_leaf_outdoors(state, player)
and state._tww_obscure_1(player)
and (
(can_cut_grass(state, player) and state._tww_precise_1(player))
or (has_magic_meter_upgrade(state, player) and state._tww_precise_2(player))
)
)
)
and can_fly_with_deku_leaf_outdoors(state, player)
and (can_cut_grass(state, player) or has_magic_meter_upgrade(state, player)),
)
# Forbidden Woods
set_rule(
world.get_location("Forbidden Woods - First Room"),
lambda state: can_access_forbidden_woods(state, player),
)
set_rule(
world.get_location("Forbidden Woods - Inside Hollow Tree's Mouth"),
lambda state: can_access_forbidden_woods(state, player)
and (can_defeat_door_flowers(state, player) or can_defeat_boko_babas(state, player)),
)
set_rule(
world.get_location("Forbidden Woods - Climb to Top Using Boko Baba Bulbs"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and can_defeat_door_flowers(state, player),
)
set_rule(
world.get_location("Forbidden Woods - Pot High Above Hollow Tree"),
lambda state: can_access_forbidden_woods(state, player) and can_fly_with_deku_leaf_indoors(state, player),
)
set_rule(
world.get_location("Forbidden Woods - Hole in Tree"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and can_defeat_boko_babas(state, player),
)
set_rule(
world.get_location("Forbidden Woods - Morth Pit"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and can_defeat_boko_babas(state, player)
and state.has("Grappling Hook", player),
)
set_rule(
world.get_location("Forbidden Woods - Vine Maze Left Chest"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and can_defeat_boko_babas(state, player)
and state.has("Grappling Hook", player),
)
set_rule(
world.get_location("Forbidden Woods - Vine Maze Right Chest"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and can_defeat_boko_babas(state, player)
and state.has("Grappling Hook", player),
)
set_rule(
world.get_location("Forbidden Woods - Highest Pot in Vine Maze"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and can_defeat_boko_babas(state, player)
and state.has("Grappling Hook", player),
)
set_rule(
world.get_location("Forbidden Woods - Tall Room Before Miniboss"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and can_defeat_boko_babas(state, player)
and state.has("Grappling Hook", player)
and state.has("FW Small Key", player, 1)
and (can_defeat_peahats(state, player) or state._tww_precise_2(player)),
)
set_rule(
world.get_location("Forbidden Woods - Mothula Miniboss Room"),
lambda state: can_access_forbidden_woods_miniboss_arena(state, player)
and can_defeat_winged_mothulas(state, player),
)
set_rule(
world.get_location("Forbidden Woods - Past Seeds Hanging by Vines"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and can_defeat_boko_babas(state, player)
and state.has("Grappling Hook", player)
and state.has("FW Small Key", player, 1)
and can_defeat_door_flowers(state, player)
and (can_destroy_seeds_hanging_by_vines(state, player) or state._tww_precise_1(player)),
)
set_rule(
world.get_location("Forbidden Woods - Chest Across Red Hanging Flower"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and can_defeat_boko_babas(state, player)
and state.has("Grappling Hook", player)
and state.has("Boomerang", player),
)
set_rule(
world.get_location("Forbidden Woods - Tingle Statue Chest"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and state.has("Grappling Hook", player)
and state.has("Boomerang", player)
and (has_tingle_bombs(state, player) or can_activate_tingle_bomb_triggers_without_tingle_tuner(state, player)),
)
set_rule(
world.get_location("Forbidden Woods - Chest in Locked Tree Trunk"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and can_defeat_boko_babas(state, player)
and state.has("Grappling Hook", player)
and state.has("Boomerang", player),
)
set_rule(
world.get_location("Forbidden Woods - Big Key Chest"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and can_defeat_boko_babas(state, player)
and state.has("Grappling Hook", player)
and state.has("Boomerang", player),
)
set_rule(
world.get_location("Forbidden Woods - Double Mothula Room"),
lambda state: can_access_forbidden_woods(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and can_defeat_boko_babas(state, player)
and (can_defeat_door_flowers(state, player) or state.has("Grappling Hook", player))
and can_defeat_mothulas(state, player),
)
set_rule(
world.get_location("Forbidden Woods - Kalle Demos Heart Container"),
lambda state: can_access_kalle_demos_boss_arena(state, player) and can_defeat_kalle_demos(state, player),
)
# Greatfish Isle
set_rule(
world.get_location("Greatfish Isle - Hidden Chest"),
lambda state: can_fly_with_deku_leaf_outdoors(state, player),
)
# Tower of the Gods
set_rule(
world.get_location("Tower of the Gods - Chest Behind Bombable Walls"),
lambda state: can_access_tower_of_the_gods(state, player) and state.has("Bombs", player),
)
set_rule(
world.get_location("Tower of the Gods - Pot Behind Bombable Walls"),
lambda state: can_access_tower_of_the_gods(state, player) and state.has("Bombs", player),
)
set_rule(
world.get_location("Tower of the Gods - Hop Across Floating Boxes"),
lambda state: can_access_tower_of_the_gods(state, player),
)
set_rule(
world.get_location("Tower of the Gods - Light Two Torches"),
lambda state: can_access_tower_of_the_gods(state, player) and state.has("Bombs", player),
)
set_rule(
world.get_location("Tower of the Gods - Skulls Room Chest"),
lambda state: can_access_tower_of_the_gods(state, player) and state.has("Bombs", player),
)
set_rule(
world.get_location("Tower of the Gods - Shoot Eye Above Skulls Room Chest"),
lambda state: can_access_tower_of_the_gods(state, player)
and state.has("Bombs", player)
and has_heros_bow(state, player),
)
set_rule(
world.get_location("Tower of the Gods - Tingle Statue Chest"),
lambda state: can_reach_tower_of_the_gods_second_floor(state, player) and has_tingle_bombs(state, player),
)
set_rule(
world.get_location("Tower of the Gods - First Chest Guarded by Armos Knights"),
lambda state: can_reach_tower_of_the_gods_second_floor(state, player) and has_heros_bow(state, player),
)
set_rule(
world.get_location("Tower of the Gods - Stone Tablet"),
lambda state: can_reach_tower_of_the_gods_second_floor(state, player)
and (
can_bring_east_servant_of_the_tower(state, player)
or can_bring_west_servant_of_the_tower(state, player)
or can_bring_north_servant_of_the_tower(state, player)
)
and state.has("Wind Waker", player),
)
set_rule(
world.get_location("Tower of the Gods - Darknut Miniboss Room"),
lambda state: can_access_tower_of_the_gods_miniboss_arena(state, player) and can_defeat_darknuts(state, player),
)
set_rule(
world.get_location("Tower of the Gods - Second Chest Guarded by Armos Knights"),
lambda state: can_reach_tower_of_the_gods_second_floor(state, player)
and state.has("Bombs", player)
and can_play_winds_requiem(state, player),
)
set_rule(
world.get_location("Tower of the Gods - Floating Platforms Room"),
lambda state: can_reach_tower_of_the_gods_second_floor(state, player)
and (
has_heros_bow(state, player)
or (can_fly_with_deku_leaf_indoors(state, player) and state._tww_precise_1(player))
or (state.has("Hookshot", player) and state._tww_obscure_1(player))
),
)
set_rule(
world.get_location("Tower of the Gods - Top of Floating Platforms Room"),
lambda state: can_reach_tower_of_the_gods_second_floor(state, player) and has_heros_bow(state, player),
)
set_rule(
world.get_location("Tower of the Gods - Eastern Pot in Big Key Chest Room"),
lambda state: can_reach_tower_of_the_gods_third_floor(state, player),
)
set_rule(
world.get_location("Tower of the Gods - Big Key Chest"),
lambda state: can_reach_tower_of_the_gods_third_floor(state, player),
)
set_rule(
world.get_location("Tower of the Gods - Gohdan Heart Container"),
lambda state: can_access_gohdan_boss_arena(state, player) and can_defeat_gohdan(state, player),
)
# Hyrule
set_rule(
world.get_location("Hyrule - Master Sword Chamber"),
lambda state: can_access_master_sword_chamber(state, player) and can_defeat_mighty_darknuts(state, player),
)
# Forsaken Fortress
set_rule(
world.get_location("Forsaken Fortress - Phantom Ganon"),
lambda state: can_reach_and_defeat_phantom_ganon(state, player),
)
set_rule(
world.get_location("Forsaken Fortress - Chest Outside Upper Jail Cell"),
lambda state: can_get_inside_forsaken_fortress(state, player)
and (
can_fly_with_deku_leaf_indoors(state, player)
or state.has("Hookshot", player)
or state._tww_obscure_1(player)
),
)
set_rule(
world.get_location("Forsaken Fortress - Chest Inside Lower Jail Cell"),
lambda state: can_get_inside_forsaken_fortress(state, player),
)
set_rule(
world.get_location("Forsaken Fortress - Chest Guarded By Bokoblin"),
lambda state: can_get_inside_forsaken_fortress(state, player),
)
set_rule(
world.get_location("Forsaken Fortress - Chest on Bed"),
lambda state: can_get_inside_forsaken_fortress(state, player),
)
set_rule(
world.get_location("Forsaken Fortress - Helmaroc King Heart Container"),
lambda state: can_access_helmaroc_king_boss_arena(state, player) and can_defeat_helmaroc_king(state, player),
)
# Mother and Child Isles
set_rule(
world.get_location("Mother and Child Isles - Inside Mother Isle"),
lambda state: can_play_ballad_of_gales(state, player),
)
# Fire Mountain
set_rule(
world.get_location("Fire Mountain - Cave - Chest"),
lambda state: can_access_fire_mountain_secret_cave(state, player) and can_defeat_magtails(state, player),
)
set_rule(world.get_location("Fire Mountain - Lookout Platform Chest"), lambda state: True)
set_rule(
world.get_location("Fire Mountain - Lookout Platform - Destroy the Cannons"),
lambda state: can_destroy_cannons(state, player),
)
set_rule(
world.get_location("Fire Mountain - Big Octo"),
lambda state: can_defeat_big_octos(state, player) and state.has("Grappling Hook", player),
)
# Ice Ring Isle
set_rule(world.get_location("Ice Ring Isle - Frozen Chest"), lambda state: has_fire_arrows(state, player))
set_rule(
world.get_location("Ice Ring Isle - Cave - Chest"),
lambda state: can_access_ice_ring_isle_secret_cave(state, player),
)
set_rule(
world.get_location("Ice Ring Isle - Inner Cave - Chest"),
lambda state: can_access_ice_ring_isle_inner_cave(state, player) and has_fire_arrows(state, player),
)
# Headstone Island
set_rule(
world.get_location("Headstone Island - Top of the Island"),
lambda state: state.has("Bait Bag", player) and can_buy_hyoi_pears(state, player),
)
set_rule(world.get_location("Headstone Island - Submarine"), lambda state: can_defeat_bombchus(state, player))
# Earth Temple
set_rule(
world.get_location("Earth Temple - Transparent Chest In Warp Pot Room"),
lambda state: can_access_earth_temple(state, player) and can_play_command_melody(state, player),
)
set_rule(
world.get_location("Earth Temple - Behind Curtain In Warp Pot Room"),
lambda state: can_access_earth_temple(state, player)
and can_play_command_melody(state, player)
and has_fire_arrows(state, player)
and (state.has("Boomerang", player) or state.has("Hookshot", player)),
)
set_rule(
world.get_location("Earth Temple - Transparent Chest in First Crypt"),
lambda state: can_reach_earth_temple_right_path(state, player)
and state.has("Power Bracelets", player)
and (can_play_command_melody(state, player) or has_mirror_shield(state, player)),
)
set_rule(
world.get_location("Earth Temple - Chest Behind Destructible Walls"),
lambda state: can_reach_earth_temple_right_path(state, player) and has_mirror_shield(state, player),
)
set_rule(
world.get_location("Earth Temple - Chest In Three Blocks Room"),
lambda state: can_reach_earth_temple_left_path(state, player)
and has_fire_arrows(state, player)
and state.has("Power Bracelets", player)
and can_defeat_floormasters(state, player)
and (can_play_command_melody(state, player) or can_aim_mirror_shield(state, player)),
)
set_rule(
world.get_location("Earth Temple - Chest Behind Statues"),
lambda state: can_reach_earth_temple_moblins_and_poes_room(state, player)
and (can_play_command_melody(state, player) or can_aim_mirror_shield(state, player)),
)
set_rule(
world.get_location("Earth Temple - Casket in Second Crypt"),
lambda state: can_reach_earth_temple_moblins_and_poes_room(state, player),
)
set_rule(
world.get_location("Earth Temple - Stalfos Miniboss Room"),
lambda state: can_access_earth_temple_miniboss_arena(state, player)
and (can_defeat_stalfos(state, player) or state.has("Hookshot", player)),
)
set_rule(
world.get_location("Earth Temple - Tingle Statue Chest"),
lambda state: can_reach_earth_temple_basement(state, player) and has_tingle_bombs(state, player),
)
set_rule(
world.get_location("Earth Temple - End of Foggy Room With Floormasters"),
lambda state: can_reach_earth_temple_redead_hub_room(state, player)
and (can_play_command_melody(state, player) or can_aim_mirror_shield(state, player)),
)
set_rule(
world.get_location(
"Earth Temple - Kill All Floormasters in Foggy Room",
),
lambda state: can_reach_earth_temple_redead_hub_room(state, player)
and (can_play_command_melody(state, player) or can_aim_mirror_shield(state, player))
and can_defeat_floormasters(state, player),
)
set_rule(
world.get_location("Earth Temple - Behind Curtain Next to Hammer Button"),
lambda state: can_reach_earth_temple_redead_hub_room(state, player)
and (can_play_command_melody(state, player) or can_aim_mirror_shield(state, player))
and has_fire_arrows(state, player)
and (state.has("Boomerang", player) or state.has("Hookshot", player)),
)
set_rule(
world.get_location("Earth Temple - Chest in Third Crypt"),
lambda state: can_reach_earth_temple_third_crypt(state, player),
)
set_rule(
world.get_location("Earth Temple - Many Mirrors Room Right Chest"),
lambda state: can_reach_earth_temple_many_mirrors_room(state, player)
and can_play_command_melody(state, player),
)
set_rule(
world.get_location("Earth Temple - Many Mirrors Room Left Chest"),
lambda state: can_reach_earth_temple_many_mirrors_room(state, player)
and state.has("Power Bracelets", player)
and can_play_command_melody(state, player)
and can_aim_mirror_shield(state, player),
)
set_rule(
world.get_location("Earth Temple - Stalfos Crypt Room"),
lambda state: can_reach_earth_temple_many_mirrors_room(state, player) and can_defeat_stalfos(state, player),
)
set_rule(
world.get_location("Earth Temple - Big Key Chest"),
lambda state: can_reach_earth_temple_many_mirrors_room(state, player)
and state.has("Power Bracelets", player)
and can_play_command_melody(state, player)
and can_aim_mirror_shield(state, player)
and (
can_defeat_blue_bubbles(state, player)
or (has_heros_bow(state, player) and state._tww_obscure_1(player))
or (
(
has_heros_sword(state, player)
or has_any_master_sword(state, player)
or state.has("Skull Hammer", player)
)
and state._tww_obscure_1(player)
and state._tww_precise_1(player)
)
)
and can_defeat_darknuts(state, player),
)
set_rule(
world.get_location("Earth Temple - Jalhalla Heart Container"),
lambda state: can_access_jalhalla_boss_arena(state, player) and can_defeat_jalhalla(state, player),
)
# Wind Temple
set_rule(
world.get_location("Wind Temple - Chest Between Two Dirt Patches"),
lambda state: can_access_wind_temple(state, player) and can_play_command_melody(state, player),
)
set_rule(
world.get_location("Wind Temple - Behind Stone Head in Hidden Upper Room"),
lambda state: can_access_wind_temple(state, player)
and can_play_command_melody(state, player)
and state.has("Iron Boots", player)
and can_fly_with_deku_leaf_indoors(state, player)
and state.has("Hookshot", player),
)
set_rule(
world.get_location("Wind Temple - Tingle Statue Chest"),
lambda state: can_reach_wind_temple_kidnapping_room(state, player) and has_tingle_bombs(state, player),
)
set_rule(
world.get_location("Wind Temple - Chest Behind Stone Head"),
lambda state: can_reach_wind_temple_kidnapping_room(state, player)
and state.has("Iron Boots", player)
and state.has("Hookshot", player),
)
set_rule(
world.get_location("Wind Temple - Chest in Left Alcove"),
lambda state: can_reach_wind_temple_kidnapping_room(state, player)
and state.has("Iron Boots", player)
and can_fan_with_deku_leaf(state, player),
)
set_rule(
world.get_location("Wind Temple - Big Key Chest"),
lambda state: can_reach_wind_temple_kidnapping_room(state, player)
and state.has("Iron Boots", player)
and can_fan_with_deku_leaf(state, player)
and can_play_wind_gods_aria(state, player)
and can_defeat_darknuts(state, player),
)
set_rule(
world.get_location("Wind Temple - Chest In Many Cyclones Room"),
lambda state: can_reach_wind_temple_kidnapping_room(state, player)
and (
(
state.has("Iron Boots", player)
and can_fan_with_deku_leaf(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
and (can_cut_grass(state, player) or has_magic_meter_upgrade(state, player))
)
or (
state.has("Hookshot", player)
and can_defeat_blue_bubbles(state, player)
and can_fly_with_deku_leaf_indoors(state, player)
)
or (
state.has("Hookshot", player)
and can_fly_with_deku_leaf_indoors(state, player)
and state._tww_obscure_1(player)
and state._tww_precise_2(player)
)
),
)
set_rule(
world.get_location("Wind Temple - Behind Stone Head in Many Cyclones Room"),
lambda state: can_reach_end_of_wind_temple_many_cyclones_room(state, player) and state.has("Hookshot", player),
)
set_rule(
world.get_location("Wind Temple - Chest In Middle Of Hub Room"),
lambda state: can_open_wind_temple_upper_giant_grate(state, player),
)
set_rule(
world.get_location("Wind Temple - Spike Wall Room - First Chest"),
lambda state: can_open_wind_temple_upper_giant_grate(state, player) and state.has("Iron Boots", player),
)
set_rule(
world.get_location("Wind Temple - Spike Wall Room - Destroy All Cracked Floors"),
lambda state: can_open_wind_temple_upper_giant_grate(state, player) and state.has("Iron Boots", player),
)
set_rule(
world.get_location("Wind Temple - Wizzrobe Miniboss Room"),
lambda state: can_access_wind_temple_miniboss_arena(state, player)
and can_defeat_darknuts(state, player)
and can_remove_peahat_armor(state, player),
)
set_rule(
world.get_location("Wind Temple - Chest at Top of Hub Room"),
lambda state: can_activate_wind_temple_giant_fan(state, player),
)
set_rule(
world.get_location("Wind Temple - Chest Behind Seven Armos"),
lambda state: can_activate_wind_temple_giant_fan(state, player) and can_defeat_armos(state, player),
)
set_rule(
world.get_location("Wind Temple - Kill All Enemies in Tall Basement Room"),
lambda state: can_reach_wind_temple_tall_basement_room(state, player)
and can_defeat_stalfos(state, player)
and can_defeat_wizzrobes(state, player)
and can_defeat_morths(state, player),
)
set_rule(
world.get_location("Wind Temple - Molgera Heart Container"),
lambda state: can_access_molgera_boss_arena(state, player) and can_defeat_molgera(state, player),
)
# Ganon's Tower
set_rule(
world.get_location("Ganon's Tower - Maze Chest"),
lambda state: can_reach_ganons_tower_phantom_ganon_room(state, player)
and can_defeat_phantom_ganon(state, player),
)
# Mailbox
set_rule(
world.get_location("Mailbox - Letter from Hoskit's Girlfriend"),
lambda state: state.has("Spoils Bag", player)
and can_farm_golden_feathers(state, player)
and can_play_song_of_passing(state, player),
)
set_rule(
world.get_location("Mailbox - Letter from Baito's Mother"),
lambda state: state.has("Delivery Bag", player)
and state.has("Note to Mom", player)
and can_play_song_of_passing(state, player),
)
set_rule(
world.get_location("Mailbox - Letter from Baito"),
lambda state: state.has("Delivery Bag", player)
and state.has("Note to Mom", player)
and state.can_reach_location("Earth Temple - Jalhalla Heart Container", player),
)
set_rule(
world.get_location("Mailbox - Letter from Komali's Father"),
lambda state: state.has("Farore's Pearl", player),
)
set_rule(
world.get_location("Mailbox - Letter Advertising Bombs in Beedle's Shop"),
lambda state: state.has("Bombs", player),
)
set_rule(
world.get_location("Mailbox - Letter Advertising Rock Spire Shop Ship"),
lambda state: has_any_wallet_upgrade(state, player),
)
# set_rule(
# world.get_location("Mailbox - Beedle's Silver Membership Reward"),
# lambda state: (
# state.has("Bait Bag", player)
# or state.has("Bombs", player)
# or has_heros_bow(state, player)
# or state.has("Empty Bottle", player)
# )
# and can_play_song_of_passing(state, player),
# )
# set_rule(
# world.get_location("Mailbox - Beedle's Gold Membership Reward"),
# lambda state: (
# state.has("Bait Bag", player)
# or state.has("Bombs", player)
# or has_heros_bow(state, player)
# or state.has("Empty Bottle", player)
# )
# and can_play_song_of_passing(state, player),
# )
set_rule(
world.get_location("Mailbox - Letter from Orca"),
lambda state: state.can_reach_location("Forbidden Woods - Kalle Demos Heart Container", player),
)
set_rule(
world.get_location("Mailbox - Letter from Grandma"),
lambda state: state.has("Empty Bottle", player)
and can_get_fairies(state, player)
and can_play_song_of_passing(state, player),
)