forked from OoTRandomizer/OoT-Randomizer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ItemPool.py
executable file
·1343 lines (1206 loc) · 50.3 KB
/
ItemPool.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
from collections import namedtuple
import logging
import random
from itertools import chain
from Utils import random_choices
from Item import ItemFactory
from ItemList import item_table
from LocationList import location_groups
from decimal import Decimal, ROUND_HALF_UP
#This file sets the item pools for various modes. Timed modes and triforce hunt are enforced first, and then extra items are specified per mode to fill in the remaining space.
#Some basic items that various modes require are placed here, including pendants and crystals. Medallion requirements for the two relevant entrances are also decided.
alwaysitems = ([
'Biggoron Sword',
'Boomerang',
'Lens of Truth',
'Megaton Hammer',
'Iron Boots',
'Goron Tunic',
'Zora Tunic',
'Hover Boots',
'Mirror Shield',
'Stone of Agony',
'Fire Arrows',
'Ice Arrows',
'Light Arrows',
'Dins Fire',
'Farores Wind',
'Nayrus Love',
'Rupee (1)']
+ ['Progressive Hookshot'] * 2
+ ['Deku Shield']
+ ['Hylian Shield']
+ ['Progressive Strength Upgrade'] * 3
+ ['Progressive Scale'] * 2
+ ['Recovery Heart'] * 6
+ ['Bow'] * 3
+ ['Slingshot'] * 3
+ ['Bomb Bag'] * 3
+ ['Bombs (5)'] * 2
+ ['Bombs (10)']
+ ['Bombs (20)']
+ ['Arrows (5)']
+ ['Arrows (10)'] * 5
+ ['Progressive Wallet'] * 2
+ ['Magic Meter'] * 2
+ ['Double Defense']
+ ['Deku Stick Capacity'] * 2
+ ['Deku Nut Capacity'] * 2
+ ['Piece of Heart (Treasure Chest Game)'])
easy_items = ([
'Biggoron Sword',
'Kokiri Sword',
'Boomerang',
'Lens of Truth',
'Megaton Hammer',
'Iron Boots',
'Goron Tunic',
'Zora Tunic',
'Hover Boots',
'Mirror Shield',
'Fire Arrows',
'Light Arrows',
'Dins Fire',
'Progressive Hookshot',
'Progressive Strength Upgrade',
'Progressive Scale',
'Progressive Wallet',
'Magic Meter',
'Deku Stick Capacity',
'Deku Nut Capacity',
'Bow',
'Slingshot',
'Bomb Bag',
'Double Defense'] +
['Heart Container'] * 16 +
['Piece of Heart'] * 3)
normal_items = (
['Heart Container'] * 8 +
['Piece of Heart'] * 35)
item_difficulty_max = {
'plentiful': {},
'balanced': {},
'scarce': {
'Bombchus': 3,
'Bombchus (5)': 1,
'Bombchus (10)': 2,
'Bombchus (20)': 0,
'Magic Meter': 1,
'Double Defense': 0,
'Deku Stick Capacity': 1,
'Deku Nut Capacity': 1,
'Bow': 2,
'Slingshot': 2,
'Bomb Bag': 2,
'Heart Container': 0,
},
'minimal': {
'Bombchus': 1,
'Bombchus (5)': 1,
'Bombchus (10)': 0,
'Bombchus (20)': 0,
'Nayrus Love': 0,
'Magic Meter': 1,
'Double Defense': 0,
'Deku Stick Capacity': 0,
'Deku Nut Capacity': 0,
'Bow': 1,
'Slingshot': 1,
'Bomb Bag': 1,
'Heart Container': 0,
'Piece of Heart': 0,
},
}
TriforceCounts = {
'plentiful': Decimal(2.00),
'balanced': Decimal(1.50),
'scarce': Decimal(1.25),
'minimal': Decimal(1.00),
}
DT_vanilla = (
['Recovery Heart'] * 2)
DT_MQ = (
['Deku Shield'] * 2 +
['Rupees (50)'])
DC_vanilla = (
['Rupees (20)'])
DC_MQ = (
['Hylian Shield'] +
['Rupees (5)'])
JB_MQ = (
['Deku Nuts (5)'] * 4 +
['Recovery Heart'] +
['Deku Shield'] +
['Deku Stick (1)'])
FoT_vanilla = (
['Recovery Heart'] +
['Arrows (10)'] +
['Arrows (30)'])
FoT_MQ = (
['Arrows (5)'])
FiT_vanilla = (
['Rupees (200)'])
FiT_MQ = (
['Bombs (20)'] +
['Hylian Shield'])
SpT_vanilla = (
['Deku Shield'] * 2 +
['Recovery Heart'] +
['Bombs (20)'])
SpT_MQ = (
['Rupees (50)'] * 2 +
['Arrows (30)'])
ShT_vanilla = (
['Arrows (30)'])
ShT_MQ = (
['Arrows (5)'] * 2 +
['Rupees (20)'])
BW_vanilla = (
['Recovery Heart'] +
['Bombs (10)'] +
['Rupees (200)'] +
['Deku Nuts (5)'] +
['Deku Nuts (10)'] +
['Deku Shield'] +
['Hylian Shield'])
GTG_vanilla = (
['Arrows (30)'] * 3 +
['Rupees (200)'])
GTG_MQ = (
['Rupee (Treasure Chest Game)'] * 2 +
['Arrows (10)'] +
['Rupee (1)'] +
['Rupees (50)'])
GC_vanilla = (
['Rupees (5)'] * 3 +
['Arrows (30)'])
GC_MQ = (
['Arrows (10)'] * 2 +
['Bombs (5)'] +
['Rupees (20)'] +
['Recovery Heart'])
normal_bottles = [
'Bottle',
'Bottle with Milk',
'Bottle with Red Potion',
'Bottle with Green Potion',
'Bottle with Blue Potion',
'Bottle with Fairy',
'Bottle with Fish',
'Bottle with Bugs',
'Bottle with Poe',
'Bottle with Big Poe',
'Bottle with Blue Fire']
bottle_count = 4
dungeon_rewards = [
'Kokiri Emerald',
'Goron Ruby',
'Zora Sapphire',
'Forest Medallion',
'Fire Medallion',
'Water Medallion',
'Shadow Medallion',
'Spirit Medallion',
'Light Medallion'
]
normal_rupees = (
['Rupees (5)'] * 13 +
['Rupees (20)'] * 5 +
['Rupees (50)'] * 7 +
['Rupees (200)'] * 3)
shopsanity_rupees = (
['Rupees (5)'] * 2 +
['Rupees (20)'] * 10 +
['Rupees (50)'] * 10 +
['Rupees (200)'] * 5 +
['Progressive Wallet'])
vanilla_shop_items = {
'KF Shop Item 1': 'Buy Deku Shield',
'KF Shop Item 2': 'Buy Deku Nut (5)',
'KF Shop Item 3': 'Buy Deku Nut (10)',
'KF Shop Item 4': 'Buy Deku Stick (1)',
'KF Shop Item 5': 'Buy Deku Seeds (30)',
'KF Shop Item 6': 'Buy Arrows (10)',
'KF Shop Item 7': 'Buy Arrows (30)',
'KF Shop Item 8': 'Buy Heart',
'Kak Potion Shop Item 1': 'Buy Deku Nut (5)',
'Kak Potion Shop Item 2': 'Buy Fish',
'Kak Potion Shop Item 3': 'Buy Red Potion [30]',
'Kak Potion Shop Item 4': 'Buy Green Potion',
'Kak Potion Shop Item 5': 'Buy Blue Fire',
'Kak Potion Shop Item 6': 'Buy Bottle Bug',
'Kak Potion Shop Item 7': 'Buy Poe',
'Kak Potion Shop Item 8': 'Buy Fairy\'s Spirit',
'Market Bombchu Shop Item 1': 'Buy Bombchu (5)',
'Market Bombchu Shop Item 2': 'Buy Bombchu (10)',
'Market Bombchu Shop Item 3': 'Buy Bombchu (10)',
'Market Bombchu Shop Item 4': 'Buy Bombchu (10)',
'Market Bombchu Shop Item 5': 'Buy Bombchu (20)',
'Market Bombchu Shop Item 6': 'Buy Bombchu (20)',
'Market Bombchu Shop Item 7': 'Buy Bombchu (20)',
'Market Bombchu Shop Item 8': 'Buy Bombchu (20)',
'Market Potion Shop Item 1': 'Buy Green Potion',
'Market Potion Shop Item 2': 'Buy Blue Fire',
'Market Potion Shop Item 3': 'Buy Red Potion [30]',
'Market Potion Shop Item 4': 'Buy Fairy\'s Spirit',
'Market Potion Shop Item 5': 'Buy Deku Nut (5)',
'Market Potion Shop Item 6': 'Buy Bottle Bug',
'Market Potion Shop Item 7': 'Buy Poe',
'Market Potion Shop Item 8': 'Buy Fish',
'Market Bazaar Item 1': 'Buy Hylian Shield',
'Market Bazaar Item 2': 'Buy Bombs (5) [35]',
'Market Bazaar Item 3': 'Buy Deku Nut (5)',
'Market Bazaar Item 4': 'Buy Heart',
'Market Bazaar Item 5': 'Buy Arrows (10)',
'Market Bazaar Item 6': 'Buy Arrows (50)',
'Market Bazaar Item 7': 'Buy Deku Stick (1)',
'Market Bazaar Item 8': 'Buy Arrows (30)',
'Kak Bazaar Item 1': 'Buy Hylian Shield',
'Kak Bazaar Item 2': 'Buy Bombs (5) [35]',
'Kak Bazaar Item 3': 'Buy Deku Nut (5)',
'Kak Bazaar Item 4': 'Buy Heart',
'Kak Bazaar Item 5': 'Buy Arrows (10)',
'Kak Bazaar Item 6': 'Buy Arrows (50)',
'Kak Bazaar Item 7': 'Buy Deku Stick (1)',
'Kak Bazaar Item 8': 'Buy Arrows (30)',
'ZD Shop Item 1': 'Buy Zora Tunic',
'ZD Shop Item 2': 'Buy Arrows (10)',
'ZD Shop Item 3': 'Buy Heart',
'ZD Shop Item 4': 'Buy Arrows (30)',
'ZD Shop Item 5': 'Buy Deku Nut (5)',
'ZD Shop Item 6': 'Buy Arrows (50)',
'ZD Shop Item 7': 'Buy Fish',
'ZD Shop Item 8': 'Buy Red Potion [50]',
'GC Shop Item 1': 'Buy Bombs (5) [25]',
'GC Shop Item 2': 'Buy Bombs (10)',
'GC Shop Item 3': 'Buy Bombs (20)',
'GC Shop Item 4': 'Buy Bombs (30)',
'GC Shop Item 5': 'Buy Goron Tunic',
'GC Shop Item 6': 'Buy Heart',
'GC Shop Item 7': 'Buy Red Potion [40]',
'GC Shop Item 8': 'Buy Heart',
}
min_shop_items = (
['Buy Deku Shield'] +
['Buy Hylian Shield'] +
['Buy Goron Tunic'] +
['Buy Zora Tunic'] +
['Buy Deku Nut (5)'] * 2 + ['Buy Deku Nut (10)'] +
['Buy Deku Stick (1)'] * 2 +
['Buy Deku Seeds (30)'] +
['Buy Arrows (10)'] * 2 + ['Buy Arrows (30)'] + ['Buy Arrows (50)'] +
['Buy Bombchu (5)'] + ['Buy Bombchu (10)'] * 2 + ['Buy Bombchu (20)'] +
['Buy Bombs (5) [25]'] + ['Buy Bombs (5) [35]'] + ['Buy Bombs (10)'] + ['Buy Bombs (20)'] +
['Buy Green Potion'] +
['Buy Red Potion [30]'] +
['Buy Blue Fire'] +
['Buy Fairy\'s Spirit'] +
['Buy Bottle Bug'] +
['Buy Fish'])
vanilla_deku_scrubs = {
'ZR Deku Scrub Grotto Rear': 'Buy Red Potion [30]',
'ZR Deku Scrub Grotto Front': 'Buy Green Potion',
'SFM Deku Scrub Grotto Rear': 'Buy Red Potion [30]',
'SFM Deku Scrub Grotto Front': 'Buy Green Potion',
'LH Deku Scrub Grotto Left': 'Buy Deku Nut (5)',
'LH Deku Scrub Grotto Right': 'Buy Bombs (5) [35]',
'LH Deku Scrub Grotto Center': 'Buy Arrows (30)',
'GV Deku Scrub Grotto Rear': 'Buy Red Potion [30]',
'GV Deku Scrub Grotto Front': 'Buy Green Potion',
'LW Deku Scrub Near Deku Theater Right': 'Buy Deku Nut (5)',
'LW Deku Scrub Near Deku Theater Left': 'Buy Deku Stick (1)',
'LW Deku Scrub Grotto Rear': 'Buy Arrows (30)',
'Colossus Deku Scrub Grotto Rear': 'Buy Red Potion [30]',
'Colossus Deku Scrub Grotto Front': 'Buy Green Potion',
'DMC Deku Scrub': 'Buy Bombs (5) [35]',
'DMC Deku Scrub Grotto Left': 'Buy Deku Nut (5)',
'DMC Deku Scrub Grotto Right': 'Buy Bombs (5) [35]',
'DMC Deku Scrub Grotto Center': 'Buy Arrows (30)',
'GC Deku Scrub Grotto Left': 'Buy Deku Nut (5)',
'GC Deku Scrub Grotto Right': 'Buy Bombs (5) [35]',
'GC Deku Scrub Grotto Center': 'Buy Arrows (30)',
'LLR Deku Scrub Grotto Left': 'Buy Deku Nut (5)',
'LLR Deku Scrub Grotto Right': 'Buy Bombs (5) [35]',
'LLR Deku Scrub Grotto Center': 'Buy Arrows (30)',
}
deku_scrubs_items = (
['Deku Nuts (5)'] * 5 +
['Deku Stick (1)'] +
['Bombs (5)'] * 5 +
['Recovery Heart'] * 4 +
['Rupees (5)'] * 4) # ['Green Potion']
songlist = [
'Zeldas Lullaby',
'Eponas Song',
'Suns Song',
'Sarias Song',
'Song of Time',
'Song of Storms',
'Minuet of Forest',
'Prelude of Light',
'Bolero of Fire',
'Serenade of Water',
'Nocturne of Shadow',
'Requiem of Spirit']
skulltula_locations = ([
'KF GS Know It All House',
'KF GS Bean Patch',
'KF GS House of Twins',
'LW GS Bean Patch Near Bridge',
'LW GS Bean Patch Near Theater',
'LW GS Above Theater',
'SFM GS',
'HF GS Near Kak Grotto',
'HF GS Cow Grotto',
'Market GS Guard House',
'HC GS Tree',
'HC GS Storms Grotto',
'OGC GS',
'LLR GS Tree',
'LLR GS Rain Shed',
'LLR GS House Window',
'LLR GS Back Wall',
'Kak GS House Under Construction',
'Kak GS Skulltula House',
'Kak GS Guards House',
'Kak GS Tree',
'Kak GS Watchtower',
'Kak GS Above Impas House',
'Graveyard GS Wall',
'Graveyard GS Bean Patch',
'DMT GS Bean Patch',
'DMT GS Near Kak',
'DMT GS Falling Rocks Path',
'DMT GS Above Dodongos Cavern',
'GC GS Boulder Maze',
'GC GS Center Platform',
'DMC GS Crate',
'DMC GS Bean Patch',
'ZR GS Ladder',
'ZR GS Tree',
'ZR GS Near Raised Grottos',
'ZR GS Above Bridge',
'ZD GS Frozen Waterfall',
'ZF GS Tree',
'ZF GS Above the Log',
'ZF GS Hidden Cave',
'LH GS Bean Patch',
'LH GS Lab Wall',
'LH GS Small Island',
'LH GS Tree',
'LH GS Lab Crate',
'GV GS Small Bridge',
'GV GS Bean Patch',
'GV GS Behind Tent',
'GV GS Pillar',
'GF GS Archery Range',
'GF GS Top Floor',
'Wasteland GS',
'Colossus GS Bean Patch',
'Colossus GS Tree',
'Colossus GS Hill'])
tradeitems = (
'Pocket Egg',
'Pocket Cucco',
'Cojiro',
'Odd Mushroom',
'Poachers Saw',
'Broken Sword',
'Prescription',
'Eyeball Frog',
'Eyedrops',
'Claim Check')
tradeitemoptions = (
'pocket_egg',
'pocket_cucco',
'cojiro',
'odd_mushroom',
'poachers_saw',
'broken_sword',
'prescription',
'eyeball_frog',
'eyedrops',
'claim_check')
fixedlocations = {
'Ganon': 'Triforce',
'Pierre': 'Scarecrow Song',
'Deliver Rutos Letter': 'Deliver Letter',
'Master Sword Pedestal': 'Time Travel',
'Market Bombchu Bowling Bombchus': 'Bombchu Drop',
'Wasteland Bombchu Salesman': 'Bombchus',
}
droplocations = {
'Deku Baba Sticks': 'Deku Stick Drop',
'Deku Baba Nuts': 'Deku Nut Drop',
'Stick Pot': 'Deku Stick Drop',
'Nut Pot': 'Deku Nut Drop',
'Nut Crate': 'Deku Nut Drop',
'Blue Fire': 'Blue Fire',
'Lone Fish': 'Fish',
'Fish Group': 'Fish',
'Bug Rock': 'Bugs',
'Bug Shrub': 'Bugs',
'Wandering Bugs': 'Bugs',
'Fairy Pot': 'Fairy',
'Free Fairies': 'Fairy',
'Wall Switch Fairy': 'Fairy',
'Butterfly Fairy': 'Fairy',
'Gossip Stone Fairy': 'Fairy',
'Bean Plant Fairy': 'Fairy',
'Fairy Pond': 'Fairy',
'Big Poe Kill': 'Big Poe',
}
vanillaBK = {
'Fire Temple Boss Key Chest': 'Boss Key (Fire Temple)',
'Shadow Temple Boss Key Chest': 'Boss Key (Shadow Temple)',
'Spirit Temple Boss Key Chest': 'Boss Key (Spirit Temple)',
'Water Temple Boss Key Chest': 'Boss Key (Water Temple)',
'Forest Temple Boss Key Chest': 'Boss Key (Forest Temple)',
'Fire Temple MQ Boss Key Chest': 'Boss Key (Fire Temple)',
'Shadow Temple MQ Boss Key Chest': 'Boss Key (Shadow Temple)',
'Spirit Temple MQ Boss Key Chest': 'Boss Key (Spirit Temple)',
'Water Temple MQ Boss Key Chest': 'Boss Key (Water Temple)',
'Forest Temple MQ Boss Key Chest': 'Boss Key (Forest Temple)',
}
vanillaMC = {
'Bottom of the Well Compass Chest': 'Compass (Bottom of the Well)',
'Deku Tree Compass Chest': 'Compass (Deku Tree)',
'Dodongos Cavern Compass Chest': 'Compass (Dodongos Cavern)',
'Fire Temple Compass Chest': 'Compass (Fire Temple)',
'Forest Temple Blue Poe Chest': 'Compass (Forest Temple)',
'Ice Cavern Compass Chest': 'Compass (Ice Cavern)',
'Jabu Jabus Belly Compass Chest': 'Compass (Jabu Jabus Belly)',
'Shadow Temple Compass Chest': 'Compass (Shadow Temple)',
'Spirit Temple Compass Chest': 'Compass (Spirit Temple)',
'Water Temple Compass Chest': 'Compass (Water Temple)',
'Bottom of the Well Map Chest': 'Map (Bottom of the Well)',
'Deku Tree Map Chest': 'Map (Deku Tree)',
'Dodongos Cavern Map Chest': 'Map (Dodongos Cavern)',
'Fire Temple Map Chest': 'Map (Fire Temple)',
'Forest Temple Map Chest': 'Map (Forest Temple)',
'Ice Cavern Map Chest': 'Map (Ice Cavern)',
'Jabu Jabus Belly Map Chest': 'Map (Jabu Jabus Belly)',
'Shadow Temple Map Chest': 'Map (Shadow Temple)',
'Spirit Temple Map Chest': 'Map (Spirit Temple)',
'Water Temple Map Chest': 'Map (Water Temple)',
'Bottom of the Well MQ Compass Chest': 'Compass (Bottom of the Well)',
'Deku Tree MQ Compass Chest': 'Compass (Deku Tree)',
'Dodongos Cavern MQ Compass Chest': 'Compass (Dodongos Cavern)',
'Fire Temple MQ Compass Chest': 'Compass (Fire Temple)',
'Forest Temple MQ Compass Chest': 'Compass (Forest Temple)',
'Ice Cavern MQ Compass Chest': 'Compass (Ice Cavern)',
'Jabu Jabus Belly MQ Compass Chest': 'Compass (Jabu Jabus Belly)',
'Shadow Temple MQ Compass Chest': 'Compass (Shadow Temple)',
'Spirit Temple MQ Compass Chest': 'Compass (Spirit Temple)',
'Water Temple MQ Compass Chest': 'Compass (Water Temple)',
'Bottom of the Well MQ Map Chest': 'Map (Bottom of the Well)',
'Deku Tree MQ Map Chest': 'Map (Deku Tree)',
'Dodongos Cavern MQ Map Chest': 'Map (Dodongos Cavern)',
'Fire Temple MQ Map Chest': 'Map (Fire Temple)',
'Forest Temple MQ Map Chest': 'Map (Forest Temple)',
'Ice Cavern MQ Map Chest': 'Map (Ice Cavern)',
'Jabu Jabus Belly MQ Map Chest': 'Map (Jabu Jabus Belly)',
'Shadow Temple MQ Map Chest': 'Map (Shadow Temple)',
'Spirit Temple MQ Map Chest': 'Map (Spirit Temple)',
'Water Temple MQ Map Chest': 'Map (Water Temple)',
}
vanillaSK = {
'Bottom of the Well Front Left Fake Wall Chest': 'Small Key (Bottom of the Well)',
'Bottom of the Well Right Bottom Fake Wall Chest': 'Small Key (Bottom of the Well)',
'Bottom of the Well Freestanding Key': 'Small Key (Bottom of the Well)',
'Fire Temple Big Lava Room Blocked Door Chest': 'Small Key (Fire Temple)',
'Fire Temple Big Lava Room Lower Open Door Chest': 'Small Key (Fire Temple)',
'Fire Temple Boulder Maze Shortcut Chest': 'Small Key (Fire Temple)',
'Fire Temple Boulder Maze Lower Chest': 'Small Key (Fire Temple)',
'Fire Temple Boulder Maze Side Room Chest': 'Small Key (Fire Temple)',
'Fire Temple Boulder Maze Upper Chest': 'Small Key (Fire Temple)',
'Fire Temple Near Boss Chest': 'Small Key (Fire Temple)',
'Fire Temple Highest Goron Chest': 'Small Key (Fire Temple)',
'Forest Temple First Stalfos Chest': 'Small Key (Forest Temple)',
'Forest Temple First Room Chest': 'Small Key (Forest Temple)',
'Forest Temple Floormaster Chest': 'Small Key (Forest Temple)',
'Forest Temple Red Poe Chest': 'Small Key (Forest Temple)',
'Forest Temple Well Chest': 'Small Key (Forest Temple)',
'Ganons Castle Light Trial Invisible Enemies Chest': 'Small Key (Ganons Castle)',
'Ganons Castle Light Trial Lullaby Chest': 'Small Key (Ganons Castle)',
'Gerudo Training Grounds Beamos Chest': 'Small Key (Gerudo Training Grounds)',
'Gerudo Training Grounds Eye Statue Chest': 'Small Key (Gerudo Training Grounds)',
'Gerudo Training Grounds Hammer Room Switch Chest': 'Small Key (Gerudo Training Grounds)',
'Gerudo Training Grounds Heavy Block Third Chest': 'Small Key (Gerudo Training Grounds)',
'Gerudo Training Grounds Hidden Ceiling Chest': 'Small Key (Gerudo Training Grounds)',
'Gerudo Training Grounds Near Scarecrow Chest': 'Small Key (Gerudo Training Grounds)',
'Gerudo Training Grounds Stalfos Chest': 'Small Key (Gerudo Training Grounds)',
'Gerudo Training Grounds Underwater Silver Rupee Chest': 'Small Key (Gerudo Training Grounds)',
'Gerudo Training Grounds Freestanding Key': 'Small Key (Gerudo Training Grounds)',
'Shadow Temple After Wind Hidden Chest': 'Small Key (Shadow Temple)',
'Shadow Temple Early Silver Rupee Chest': 'Small Key (Shadow Temple)',
'Shadow Temple Falling Spikes Switch Chest': 'Small Key (Shadow Temple)',
'Shadow Temple Invisible Floormaster Chest': 'Small Key (Shadow Temple)',
'Shadow Temple Freestanding Key': 'Small Key (Shadow Temple)',
'Spirit Temple Child Early Torches Chest': 'Small Key (Spirit Temple)',
'Spirit Temple Early Adult Right Chest': 'Small Key (Spirit Temple)',
'Spirit Temple Near Four Armos Chest': 'Small Key (Spirit Temple)',
'Spirit Temple Statue Room Hand Chest': 'Small Key (Spirit Temple)',
'Spirit Temple Sun Block Room Chest': 'Small Key (Spirit Temple)',
'Water Temple Central Bow Target Chest': 'Small Key (Water Temple)',
'Water Temple Central Pillar Chest': 'Small Key (Water Temple)',
'Water Temple Cracked Wall Chest': 'Small Key (Water Temple)',
'Water Temple Dragon Chest': 'Small Key (Water Temple)',
'Water Temple River Chest': 'Small Key (Water Temple)',
'Water Temple Torches Chest': 'Small Key (Water Temple)',
'Bottom of the Well MQ Dead Hand Freestanding Key': 'Small Key (Bottom of the Well)',
'Bottom of the Well MQ East Inner Room Freestanding Key': 'Small Key (Bottom of the Well)',
'Fire Temple MQ Big Lava Room Blocked Door Chest': 'Small Key (Fire Temple)',
'Fire Temple MQ Near Boss Chest': 'Small Key (Fire Temple)',
'Fire Temple MQ Lizalfos Maze Side Room Chest': 'Small Key (Fire Temple)',
'Fire Temple MQ Chest On Fire': 'Small Key (Fire Temple)',
'Fire Temple MQ Freestanding Key': 'Small Key (Fire Temple)',
'Forest Temple MQ Wolfos Chest': 'Small Key (Forest Temple)',
'Forest Temple MQ First Room Chest': 'Small Key (Forest Temple)',
'Forest Temple MQ Raised Island Courtyard Lower Chest': 'Small Key (Forest Temple)',
'Forest Temple MQ Raised Island Courtyard Upper Chest': 'Small Key (Forest Temple)',
'Forest Temple MQ Redead Chest': 'Small Key (Forest Temple)',
'Forest Temple MQ Well Chest': 'Small Key (Forest Temple)',
'Ganons Castle MQ Shadow Trial Eye Switch Chest': 'Small Key (Ganons Castle)',
'Ganons Castle MQ Spirit Trial Sun Back Left Chest': 'Small Key (Ganons Castle)',
'Ganons Castle MQ Forest Trial Freestanding Key': 'Small Key (Ganons Castle)',
'Gerudo Training Grounds MQ Dinolfos Chest': 'Small Key (Gerudo Training Grounds)',
'Gerudo Training Grounds MQ Flame Circle Chest': 'Small Key (Gerudo Training Grounds)',
'Gerudo Training Grounds MQ Underwater Silver Rupee Chest': 'Small Key (Gerudo Training Grounds)',
'Shadow Temple MQ Falling Spikes Switch Chest': 'Small Key (Shadow Temple)',
'Shadow Temple MQ Invisible Blades Invisible Chest': 'Small Key (Shadow Temple)',
'Shadow Temple MQ Early Gibdos Chest': 'Small Key (Shadow Temple)',
'Shadow Temple MQ Near Ship Invisible Chest': 'Small Key (Shadow Temple)',
'Shadow Temple MQ Wind Hint Chest': 'Small Key (Shadow Temple)',
'Shadow Temple MQ Freestanding Key': 'Small Key (Shadow Temple)',
'Spirit Temple MQ Child Hammer Switch Chest': 'Small Key (Spirit Temple)',
'Spirit Temple MQ Child Climb South Chest': 'Small Key (Spirit Temple)',
'Spirit Temple MQ Map Room Enemy Chest': 'Small Key (Spirit Temple)',
'Spirit Temple MQ Entrance Back Left Chest': 'Small Key (Spirit Temple)',
'Spirit Temple MQ Entrance Front Right Chest': 'Small Key (Spirit Temple)',
'Spirit Temple MQ Mirror Puzzle Invisible Chest': 'Small Key (Spirit Temple)',
'Spirit Temple MQ Silver Block Hallway Chest': 'Small Key (Spirit Temple)',
'Water Temple MQ Central Pillar Chest': 'Small Key (Water Temple)',
'Water Temple MQ Freestanding Key': 'Small Key (Water Temple)',
}
junk_pool_base = [
('Bombs (5)', 8),
('Bombs (10)', 2),
('Arrows (5)', 8),
('Arrows (10)', 2),
('Deku Stick (1)', 5),
('Deku Nuts (5)', 5),
('Deku Seeds (30)', 5),
('Rupees (5)', 10),
('Rupees (20)', 4),
('Rupees (50)', 1),
]
pending_junk_pool = []
junk_pool = []
remove_junk_items = [
'Bombs (5)',
'Deku Nuts (5)',
'Deku Stick (1)',
'Recovery Heart',
'Arrows (5)',
'Arrows (10)',
'Arrows (30)',
'Rupees (5)',
'Rupees (20)',
'Rupees (50)',
'Rupees (200)',
'Deku Nuts (10)',
'Bombs (10)',
'Bombs (20)',
'Deku Seeds (30)',
'Ice Trap',
]
item_groups = {
'Junk': remove_junk_items,
'JunkSong': ('Prelude of Light', 'Serenade of Water'),
'AdultTrade': tradeitems,
'Bottle': normal_bottles,
'Spell': ('Dins Fire', 'Farores Wind', 'Nayrus Love'),
'Shield': ('Deku Shield', 'Hylian Shield'),
'Song': songlist,
'NonWarpSong': songlist[0:6],
'WarpSong': songlist[6:],
'HealthUpgrade': ('Heart Container', 'Piece of Heart'),
'ProgressItem': [name for (name, data) in item_table.items() if data[0] == 'Item' and data[1]],
'DungeonReward': dungeon_rewards,
'ForestFireWater': ('Forest Medallion', 'Fire Medallion', 'Water Medallion'),
'FireWater': ('Fire Medallion', 'Water Medallion'),
}
def get_junk_item(count=1, pool=None, plando_pool=None):
if count < 1:
raise ValueError("get_junk_item argument 'count' must be greater than 0.")
return_pool = []
if pending_junk_pool:
pending_count = min(len(pending_junk_pool), count)
return_pool = [pending_junk_pool.pop() for _ in range(pending_count)]
count -= pending_count
if pool and plando_pool:
jw_list = [(junk, weight) for (junk, weight) in junk_pool
if junk not in plando_pool or pool.count(junk) < plando_pool[junk].count]
try:
junk_items, junk_weights = zip(*jw_list)
except ValueError:
raise RuntimeError("Not enough junk is available in the item pool to replace removed items.")
else:
junk_items, junk_weights = zip(*junk_pool)
return_pool.extend(random_choices(junk_items, weights=junk_weights, k=count))
return return_pool
def replace_max_item(items, item, max):
count = 0
for i,val in enumerate(items):
if val == item:
if count >= max:
items[i] = get_junk_item()[0]
count += 1
def generate_itempool(world):
junk_pool[:] = list(junk_pool_base)
if world.junk_ice_traps == 'on':
junk_pool.append(('Ice Trap', 10))
elif world.junk_ice_traps in ['mayhem', 'onslaught']:
junk_pool[:] = [('Ice Trap', 1)]
fixed_locations = list(filter(lambda loc: loc.name in fixedlocations, world.get_locations()))
for location in fixed_locations:
item = fixedlocations[location.name]
world.push_item(location, ItemFactory(item, world))
location.locked = True
drop_locations = list(filter(lambda loc: loc.type == 'Drop', world.get_locations()))
for drop_location in drop_locations:
item = droplocations[drop_location.name]
world.push_item(drop_location, ItemFactory(item, world))
drop_location.locked = True
# set up item pool
(pool, placed_items) = get_pool_core(world)
world.itempool = ItemFactory(pool, world)
for (location, item) in placed_items.items():
world.push_item(location, ItemFactory(item, world))
world.get_location(location).locked = True
world.initialize_items()
world.distribution.set_complete_itempool(world.itempool)
def try_collect_heart_container(world, pool):
if 'Heart Container' in pool:
pool.remove('Heart Container')
pool.extend(get_junk_item())
world.state.collect(ItemFactory('Heart Container'))
return True
return False
def try_collect_pieces_of_heart(world, pool):
n = pool.count('Piece of Heart') + pool.count('Piece of Heart (Treasure Chest Game)')
if n >= 4:
for i in range(4):
if 'Piece of Heart' in pool:
pool.remove('Piece of Heart')
world.state.collect(ItemFactory('Piece of Heart'))
else:
pool.remove('Piece of Heart (Treasure Chest Game)')
world.state.collect(ItemFactory('Piece of Heart (Treasure Chest Game)'))
pool.extend(get_junk_item())
return True
return False
def collect_pieces_of_heart(world, pool):
success = try_collect_pieces_of_heart(world, pool)
if not success:
try_collect_heart_container(world, pool)
def collect_heart_container(world, pool):
success = try_collect_heart_container(world, pool)
if not success:
try_collect_pieces_of_heart(world, pool)
def get_pool_core(world):
pool = []
placed_items = {
'HC Zeldas Letter': 'Zeldas Letter',
}
if world.shuffle_kokiri_sword:
pool.append('Kokiri Sword')
else:
placed_items['KF Kokiri Sword Chest'] = 'Kokiri Sword'
ruto_bottles = 1
if world.zora_fountain == 'open':
ruto_bottles = 0
elif world.item_pool_value == 'plentiful':
ruto_bottles += 1
if world.shuffle_weird_egg:
pool.append('Weird Egg')
else:
placed_items['HC Malon Egg'] = 'Weird Egg'
if world.shuffle_ocarinas:
pool.extend(['Ocarina'] * 2)
if world.item_pool_value == 'plentiful':
pending_junk_pool.append('Ocarina')
else:
placed_items['LW Gift from Saria'] = 'Ocarina'
placed_items['HF Ocarina of Time Item'] = 'Ocarina'
if world.shuffle_cows:
pool.extend(get_junk_item(10 if world.dungeon_mq['Jabu Jabus Belly'] else 9))
else:
placed_items['LLR Stables Left Cow'] = 'Milk'
placed_items['LLR Stables Right Cow'] = 'Milk'
placed_items['LLR Tower Left Cow'] = 'Milk'
placed_items['LLR Tower Right Cow'] = 'Milk'
placed_items['KF Links House Cow'] = 'Milk'
placed_items['Kak Impas House Cow'] = 'Milk'
placed_items['GV Cow'] = 'Milk'
placed_items['DMT Cow Grotto Cow'] = 'Milk'
placed_items['HF Cow Grotto Cow'] = 'Milk'
if world.dungeon_mq['Jabu Jabus Belly']:
placed_items['Jabu Jabus Belly MQ Cow'] = 'Milk'
if world.shuffle_beans:
if world.distribution.get_starting_item('Magic Bean') < 10:
pool.append('Magic Bean Pack')
if world.item_pool_value == 'plentiful':
pending_junk_pool.append('Magic Bean Pack')
else:
pool.extend(get_junk_item())
else:
placed_items['ZR Magic Bean Salesman'] = 'Magic Bean'
if world.dungeon_mq['Deku Tree']:
skulltula_locations_final = skulltula_locations + [
'Deku Tree MQ GS Lobby',
'Deku Tree MQ GS Compass Room',
'Deku Tree MQ GS Basement Graves Room',
'Deku Tree MQ GS Basement Back Room']
else:
skulltula_locations_final = skulltula_locations + [
'Deku Tree GS Compass Room',
'Deku Tree GS Basement Vines',
'Deku Tree GS Basement Gate',
'Deku Tree GS Basement Back Room']
if world.dungeon_mq['Dodongos Cavern']:
skulltula_locations_final.extend([
'Dodongos Cavern MQ GS Scrub Room',
'Dodongos Cavern MQ GS Song of Time Block Room',
'Dodongos Cavern MQ GS Lizalfos Room',
'Dodongos Cavern MQ GS Larvae Room',
'Dodongos Cavern MQ GS Back Area'])
else:
skulltula_locations_final.extend([
'Dodongos Cavern GS Side Room Near Lower Lizalfos',
'Dodongos Cavern GS Vines Above Stairs',
'Dodongos Cavern GS Back Room',
'Dodongos Cavern GS Alcove Above Stairs',
'Dodongos Cavern GS Scarecrow'])
if world.dungeon_mq['Jabu Jabus Belly']:
skulltula_locations_final.extend([
'Jabu Jabus Belly MQ GS Tailpasaran Room',
'Jabu Jabus Belly MQ GS Invisible Enemies Room',
'Jabu Jabus Belly MQ GS Boomerang Chest Room',
'Jabu Jabus Belly MQ GS Near Boss'])
else:
skulltula_locations_final.extend([
'Jabu Jabus Belly GS Water Switch Room',
'Jabu Jabus Belly GS Lobby Basement Lower',
'Jabu Jabus Belly GS Lobby Basement Upper',
'Jabu Jabus Belly GS Near Boss'])
if world.dungeon_mq['Forest Temple']:
skulltula_locations_final.extend([
'Forest Temple MQ GS First Hallway',
'Forest Temple MQ GS Block Push Room',
'Forest Temple MQ GS Raised Island Courtyard',
'Forest Temple MQ GS Level Island Courtyard',
'Forest Temple MQ GS Well'])
else:
skulltula_locations_final.extend([
'Forest Temple GS First Room',
'Forest Temple GS Lobby',
'Forest Temple GS Raised Island Courtyard',
'Forest Temple GS Level Island Courtyard',
'Forest Temple GS Basement'])
if world.dungeon_mq['Fire Temple']:
skulltula_locations_final.extend([
'Fire Temple MQ GS Above Fire Wall Maze',
'Fire Temple MQ GS Fire Wall Maze Center',
'Fire Temple MQ GS Big Lava Room Open Door',
'Fire Temple MQ GS Fire Wall Maze Side Room',
'Fire Temple MQ GS Skull On Fire'])
else:
skulltula_locations_final.extend([
'Fire Temple GS Song of Time Room',
'Fire Temple GS Boulder Maze',
'Fire Temple GS Scarecrow Climb',
'Fire Temple GS Scarecrow Top',
'Fire Temple GS Boss Key Loop'])
if world.dungeon_mq['Water Temple']:
skulltula_locations_final.extend([
'Water Temple MQ GS Before Upper Water Switch',
'Water Temple MQ GS Freestanding Key Area',
'Water Temple MQ GS Lizalfos Hallway',
'Water Temple MQ GS River',
'Water Temple MQ GS Triple Wall Torch'])
else:
skulltula_locations_final.extend([
'Water Temple GS Behind Gate',
'Water Temple GS River',
'Water Temple GS Falling Platform Room',
'Water Temple GS Central Pillar',
'Water Temple GS Near Boss Key Chest'])
if world.dungeon_mq['Spirit Temple']:
skulltula_locations_final.extend([
'Spirit Temple MQ GS Symphony Room',
'Spirit Temple MQ GS Leever Room',
'Spirit Temple MQ GS Nine Thrones Room West',
'Spirit Temple MQ GS Nine Thrones Room North',
'Spirit Temple MQ GS Sun Block Room'])
else:
skulltula_locations_final.extend([
'Spirit Temple GS Metal Fence',
'Spirit Temple GS Sun on Floor Room',
'Spirit Temple GS Hall After Sun Block Room',
'Spirit Temple GS Boulder Room',
'Spirit Temple GS Lobby'])
if world.dungeon_mq['Shadow Temple']:
skulltula_locations_final.extend([
'Shadow Temple MQ GS Falling Spikes Room',
'Shadow Temple MQ GS Wind Hint Room',
'Shadow Temple MQ GS After Wind',
'Shadow Temple MQ GS After Ship',
'Shadow Temple MQ GS Near Boss'])
else:
skulltula_locations_final.extend([
'Shadow Temple GS Like Like Room',
'Shadow Temple GS Falling Spikes Room',
'Shadow Temple GS Single Giant Pot',
'Shadow Temple GS Near Ship',
'Shadow Temple GS Triple Giant Pot'])
if world.dungeon_mq['Bottom of the Well']:
skulltula_locations_final.extend([
'Bottom of the Well MQ GS Basement',
'Bottom of the Well MQ GS Coffin Room',
'Bottom of the Well MQ GS West Inner Room'])
else:
skulltula_locations_final.extend([
'Bottom of the Well GS West Inner Room',
'Bottom of the Well GS East Inner Room',
'Bottom of the Well GS Like Like Cage'])
if world.dungeon_mq['Ice Cavern']:
skulltula_locations_final.extend([
'Ice Cavern MQ GS Scarecrow',
'Ice Cavern MQ GS Ice Block',
'Ice Cavern MQ GS Red Ice'])
else:
skulltula_locations_final.extend([
'Ice Cavern GS Spinning Scythe Room',
'Ice Cavern GS Heart Piece Room',
'Ice Cavern GS Push Block Room'])
if world.tokensanity == 'off':
for location in skulltula_locations_final:
placed_items[location] = 'Gold Skulltula Token'
elif world.tokensanity == 'dungeons':
for location in skulltula_locations_final:
if world.get_location(location).scene >= 0x0A:
placed_items[location] = 'Gold Skulltula Token'
else:
pool.append('Gold Skulltula Token')
elif world.tokensanity == 'overworld':
for location in skulltula_locations_final:
if world.get_location(location).scene < 0x0A:
placed_items[location] = 'Gold Skulltula Token'
else: