-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocationizer.py
More file actions
316 lines (291 loc) · 14.9 KB
/
Copy pathlocationizer.py
File metadata and controls
316 lines (291 loc) · 14.9 KB
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
import random
def generateItemPool(amount):
tc = 112
items = {
'Arrows (10)': int(23/tc*amount)+1,
'Bombs (3)': int(17/tc*amount)+1,
'Bee': int(1/tc*amount)+1,
'Bee Trap': int(1/tc*amount)+1,
'Rupee (1)': int(1/tc*amount)+1,
'Rupees (5)': int(4/tc*amount)+1,
'Rupees (20)': int(28/tc*amount)+1,
'Rupees (50)': int(7/tc*amount)+1,
'Rupees (100)': int(3/tc*amount)+1,
'Rupees (300)': int(3/tc*amount)+1,
'Piece of Heart': int(24/tc*amount)+1,
}
return items
def rollSetting(options):
settings = []
weights = []
for option,weight in options.items():
settings.append(option)
weights.append(weight)
return random.choices(settings,weights,k=1)[0]
def locationizer(input_yamls,parameters):
LOCATIONS = [
["Ganons Tower - Big Key Chest","Dungeon"],
["Ganons Tower - Big Key Room - Left","Dungeon"],
["Ganons Tower - Big Key Room - Right","Dungeon"],
["Ganons Tower - Bob's Chest","Dungeon"],
["Ganons Tower - Bob's Torch","Dungeon"],
["Ganons Tower - Firesnake Room","Dungeon"],
["Ganons Tower - Hope Room - Left","Dungeon"],
["Ganons Tower - Hope Room - Right","Dungeon"],
["Ganons Tower - Map Chest","Dungeon"],
["Ganons Tower - Tile Room","Dungeon"],
["Ganons Tower - Big Chest","Dungeon"],
["Ganons Tower - Compass Room - Bottom Left","Dungeon"],
["Ganons Tower - Compass Room - Bottom Right","Dungeon"],
["Ganons Tower - Compass Room - Top Left","Dungeon"],
["Ganons Tower - Compass Room - Top Right","Dungeon"],
["Ganons Tower - DMs Room - Bottom Left","Dungeon"],
["Ganons Tower - DMs Room - Bottom Right","Dungeon"],
["Ganons Tower - DMs Room - Top Left","Dungeon"],
["Ganons Tower - DMs Room - Top Right","Dungeon"],
["Ganons Tower - Mini Helmasaur Room - Left","Dungeon"],
["Ganons Tower - Mini Helmasaur Room - Right","Dungeon"],
["Ganons Tower - Validation Chest","Dungeon"],
["Ganons Tower - Pre-Moldorm Chest","Dungeon"],
["Ganons Tower - Randomizer Room - Bottom Left","Dungeon"],
["Ganons Tower - Randomizer Room - Bottom Right","Dungeon"],
["Ganons Tower - Randomizer Room - Top Left","Dungeon"],
["Ganons Tower - Randomizer Room - Top Right","Dungeon"],
["Castle Tower - Dark Maze","Dungeon"],
["Castle Tower - Room 03","Dungeon"],
["Palace of Darkness - Big Chest","Dungeon"],
["Palace of Darkness - Big Key Chest","Dungeon"],
["Palace of Darkness - Boss","Dungeon"],
["Palace of Darkness - Compass Chest","Dungeon"],
["Palace of Darkness - Dark Basement - Left","Dungeon"],
["Palace of Darkness - Dark Basement - Right","Dungeon"],
["Palace of Darkness - Dark Maze - Bottom","Dungeon"],
["Palace of Darkness - Dark Maze - Top","Dungeon"],
["Palace of Darkness - Harmless Hellway","Dungeon"],
["Palace of Darkness - Map Chest","Dungeon"],
["Palace of Darkness - Shooter Room","Dungeon"],
["Palace of Darkness - Stalfos Basement","Dungeon"],
["Palace of Darkness - The Arena - Bridge","Dungeon"],
["Palace of Darkness - The Arena - Ledge","Dungeon"],
["Desert Palace - Big Chest","Dungeon"],
["Desert Palace - Big Key Chest","Dungeon"],
["Desert Palace - Boss","Dungeon"],
["Desert Palace - Compass Chest","Dungeon"],
["Desert Palace - Map Chest","Dungeon"],
["Desert Palace - Torch","Dungeon"],
["Hyrule Castle - Boomerang Chest","Dungeon"],
["Hyrule Castle - Map Chest","Dungeon"],
["Hyrule Castle - Zelda's Cell","Dungeon"],
["Sewers - Dark Cross","Dungeon"],
["Sewers - Secret Room - Left","Dungeon"],
["Sewers - Secret Room - Middle","Dungeon"],
["Sewers - Secret Room - Right","Dungeon"],
["Sanctuary","Dungeon"],
["Ice Palace - Big Chest","Dungeon"],
["Ice Palace - Big Key Chest","Dungeon"],
["Ice Palace - Boss","Dungeon"],
["Ice Palace - Compass Chest","Dungeon"],
["Ice Palace - Freezor Chest","Dungeon"],
["Ice Palace - Iced T Room","Dungeon"],
["Ice Palace - Map Chest","Dungeon"],
["Ice Palace - Spike Room","Dungeon"],
["Misery Mire - Big Chest","Dungeon"],
["Misery Mire - Big Key Chest","Dungeon"],
["Misery Mire - Boss","Dungeon"],
["Misery Mire - Bridge Chest","Dungeon"],
["Misery Mire - Compass Chest","Dungeon"],
["Misery Mire - Main Lobby","Dungeon"],
["Misery Mire - Map Chest","Dungeon"],
["Misery Mire - Spike Chest","Dungeon"],
['Skull Woods - Map Chest', 'Dungeon'],
['Skull Woods - Big Chest', 'Dungeon'],
['Skull Woods - Pinball Room', 'Dungeon'],
['Skull Woods - Compass Chest', 'Dungeon'],
["Skull Woods - Big Key Chest","Dungeon"],
["Skull Woods - Boss","Dungeon"],
["Skull Woods - Bridge Room","Dungeon"],
["Skull Woods - Pot Prison","Dungeon"],
["Swamp Palace - Big Chest","Dungeon"],
["Swamp Palace - Big Key Chest","Dungeon"],
["Swamp Palace - Boss","Dungeon"],
["Swamp Palace - Compass Chest","Dungeon"],
["Swamp Palace - Entrance","Dungeon"],
["Swamp Palace - Flooded Room - Left","Dungeon"],
["Swamp Palace - Flooded Room - Right","Dungeon"],
["Swamp Palace - Map Chest","Dungeon"],
["Swamp Palace - Waterfall Room","Dungeon"],
["Swamp Palace - West Chest","Dungeon"],
["Thieves' Town - Ambush Chest","Dungeon"],
["Thieves' Town - Attic","Dungeon"],
["Thieves' Town - Big Chest","Dungeon"],
["Thieves' Town - Big Key Chest","Dungeon"],
["Thieves' Town - Blind's Cell","Dungeon"],
["Thieves' Town - Boss","Dungeon"],
["Thieves' Town - Compass Chest","Dungeon"],
["Thieves' Town - Map Chest","Dungeon"],
["Tower of Hera - Basement Cage","Dungeon"],
["Tower of Hera - Big Chest","Dungeon"],
["Tower of Hera - Big Key Chest","Dungeon"],
["Tower of Hera - Boss","Dungeon"],
["Tower of Hera - Compass Chest","Dungeon"],
["Tower of Hera - Map Chest","Dungeon"],
["Turtle Rock - Big Chest","Dungeon"],
["Turtle Rock - Big Key Chest","Dungeon"],
["Turtle Rock - Boss","Dungeon"],
["Turtle Rock - Chain Chomps","Dungeon"],
["Turtle Rock - Compass Chest","Dungeon"],
["Turtle Rock - Crystaroller Room","Dungeon"],
["Turtle Rock - Eye Bridge - Bottom Left","Dungeon"],
["Turtle Rock - Eye Bridge - Bottom Right","Dungeon"],
["Turtle Rock - Eye Bridge - Top Left","Dungeon"],
["Turtle Rock - Eye Bridge - Top Right","Dungeon"],
["Turtle Rock - Roller Room - Left","Dungeon"],
["Turtle Rock - Roller Room - Right","Dungeon"],
["Eastern Palace - Big Chest","Dungeon"],
["Eastern Palace - Big Key Chest","Dungeon"],
["Eastern Palace - Boss","Dungeon"],
["Eastern Palace - Cannonball Chest","Dungeon"],
["Eastern Palace - Compass Chest","Dungeon"],
["Eastern Palace - Map Chest","Dungeon"],
["Pyramid Fairy - Left","FetchQuest"],
["Pyramid Fairy - Right","FetchQuest"],
["Sahasrahla","FetchQuest"],
["Ether Tablet","FetchQuest"],
["Flute Spot","FetchQuest"],
["Old Man","FetchQuest"],
["Blacksmith","FetchQuest"],
["Purple Chest","FetchQuest"],
["Magic Bat","FetchQuest"],
["Potion Shop","FetchQuest"],
["Sick Kid","FetchQuest"],
["Lumberjack Tree","LumberjackTree"],
["Master Sword Pedestal","MasterSwordPedestal"],
["Chest Game","Overworld"],
["Maze Race","Overworld"],
["Digging Game","Overworld"],
["Link's House","Overworld"],
["Link's Uncle","Overworld"],
["Secret Passage","Overworld"],
["Ice Rod Cave","Overworld"],
["Catfish","Overworld"],
["Stumpy","Overworld"],
["King Zora","Overworld"],
["Library","Overworld"],
["Bottle Merchant","Overworld"],
["Hobo","Overworld"],
["Bombos Tablet","Overworld"],
["Bumper Cave Ledge","Overworld"],
["Hookshot Cave - Bottom Left","Overworld"],
["Hookshot Cave - Top Left","Overworld"],
["Hookshot Cave - Top Right","Overworld"],
["Hookshot Cave - Bottom Right","Overworld"],
["Spike Cave","Overworld"],
["Mimic Cave","Overworld"],
["Hype Cave - Generous Guy","Overworld"],
["Mini Moldorm Cave - Generous Guy","Overworld"],
["Peg Cave","Overworld"],
["Brewery","Overworld"],
["C-Shaped House","Overworld"],
["Hype Cave - Bottom","Overworld"],
["Hype Cave - Middle Left","Overworld"],
["Hype Cave - Middle Right","Overworld"],
["Hype Cave - Top","Overworld"],
["Mire Shed - Left","Overworld"],
["Mire Shed - Right","Overworld"],
["Pyramid","Overworld"],
["Superbunny Cave - Bottom","Overworld"],
["Superbunny Cave - Top","Overworld"],
["Paradox Cave Lower - Far Left","Overworld"],
["Paradox Cave Lower - Far Right","Overworld"],
["Paradox Cave Lower - Left","Overworld"],
["Paradox Cave Lower - Middle","Overworld"],
["Paradox Cave Lower - Right","Overworld"],
["Paradox Cave Upper - Left","Overworld"],
["Paradox Cave Upper - Right","Overworld"],
["Spectacle Rock","Overworld"],
["Spectacle Rock Cave","Overworld"],
["Spiral Cave","Overworld"],
["Aginah's Cave","Overworld"],
["Blind's Hideout - Far Left","Overworld"],
["Blind's Hideout - Far Right","Overworld"],
["Blind's Hideout - Left","Overworld"],
["Blind's Hideout - Right","Overworld"],
["Blind's Hideout - Top","Overworld"],
["Cave 45","Overworld"],
["Checkerboard Cave","Overworld"],
["Chicken House","Overworld"],
["Floodgate Chest","Overworld"],
["Graveyard Cave","Overworld"],
["Kakariko Tavern","Overworld"],
["Kakariko Well - Bottom","Overworld"],
["Kakariko Well - Left","Overworld"],
["Kakariko Well - Middle","Overworld"],
["Kakariko Well - Right","Overworld"],
["Kakariko Well - Top","Overworld"],
["King's Tomb","Overworld"],
["Lake Hylia Island","Overworld"],
["Lost Woods Hideout","Overworld"],
["Mini Moldorm Cave - Far Left","Overworld"],
["Mini Moldorm Cave - Far Right","Overworld"],
["Mini Moldorm Cave - Left","Overworld"],
["Mini Moldorm Cave - Right","Overworld"],
["Mushroom","Overworld"],
["Bonk Rock Cave","Overworld"],
["Sahasrahla's Hut - Left","Overworld"],
["Sahasrahla's Hut - Middle","Overworld"],
["Sahasrahla's Hut - Right","Overworld"],
["Sunken Treasure","Overworld"],
["Waterfall Fairy - Left","Overworld"],
["Waterfall Fairy - Right","Overworld"],
["Zora's Ledge","Overworld"],
["Floating Island","Overworld"],
["Desert Ledge","Overworld"]
]
for player,settings in input_yamls.items():
barren_regions = parameters['barren_regions']
# Check if keysanity, otherwise remove dungeon locations
if 'Dungeon' in barren_regions:
sanities = ['map_shuffle','compass_shuffle','smallkey_shuffle', 'bigkey_shuffle']
fullsanity = True
try:
for sanity in sanities:
if sanity in settings:
settings[sanity] = rollSetting(settings[sanity])
if settings[sanity] == 'off':
fullsanity = False
else:
fullsanity = False
except:
fullsanity = False
if not fullsanity:
barren_regions.remove('Dungeon')
TRASH_LOCATIONS = []
for location,group in LOCATIONS:
if group in parameters['barren_regions']:
TRASH_LOCATIONS.append(location)
# Remove already plando'd locations
if 'plando_items' in settings:
for item in settings['plando_items']:
if 'world' in item and item['world'] == False:
if 'location' in item:
try:
TRASH_LOCATIONS.remove(item['location'])
except:
pass
elif 'locations' in item:
for location in item['locations']:
try:
TRASH_LOCATIONS.remove(location)
except:
pass
else:
settings['plando_items'] = []
items = generateItemPool(len(TRASH_LOCATIONS))
barren_plando = {
'items': items,
'from_pool': False,
'world': False,
'locations': TRASH_LOCATIONS
}
settings['plando_items'].append(barren_plando)
input_yamls[player] = settings