-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patharchipelago_multiworld_randomizer_game.py
More file actions
313 lines (265 loc) · 10.4 KB
/
archipelago_multiworld_randomizer_game.py
File metadata and controls
313 lines (265 loc) · 10.4 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
from __future__ import annotations
from typing import List
from dataclasses import dataclass
from Options import DefaultOnToggle, OptionList, OptionSet
from ..game import Game
from ..game_objective_template import GameObjectiveTemplate
from ..enums import KeymastersKeepGamePlatforms
@dataclass
class ArchipelagoMultiworldRandomizerArchipelagoOptions:
archipelago_multiworld_randomizer_game_selection: ArchipelagoMultiworldRandomizerGameSelection
archipelago_multiworld_randomizer_objective_types: ArchipelagoMultiworldRandomizerObjectiveTypes
archipelago_multiworld_randomizer_bingo_release_always_off: ArchipelagoMultiworldRandomizerBingoReleaseAlwaysOff
class ArchipelagoMultiworldRandomizerGame(Game):
name = "Archipelago Multiworld Randomizer"
platform = KeymastersKeepGamePlatforms.META
platforms_other = None
is_adult_only_or_unrated = False
options_cls = ArchipelagoMultiworldRandomizerArchipelagoOptions
def optional_game_constraint_templates(self) -> List[GameObjectiveTemplate]:
return list()
def game_objective_templates(self) -> List[GameObjectiveTemplate]:
game_objective_templates: List[GameObjectiveTemplate] = list()
if self.include_solo_randomizer_objectives:
game_objective_templates.append(
GameObjectiveTemplate(
label="[Hints: HINT_COST%] Complete a solo randomizer with GAME",
data={
"HINT_COST": (self.hint_costs, 1),
"GAME": (self.games, 1)
},
is_time_consuming=True,
is_difficult=False,
weight=2,
),
)
if self.include_small_multiworld_randomizer_objectives:
game_objective_templates.extend([
GameObjectiveTemplate(
label="[Hints: HINT_COST% Release: RELEASE] Complete a multiworld randomizer with GAMES",
data={
"HINT_COST": (self.hint_costs, 1),
"RELEASE": (self.release, 1),
"GAMES": (self.games, 2)
},
is_time_consuming=True,
is_difficult=False,
weight=3,
),
GameObjectiveTemplate(
label="[Hints: HINT_COST% Release: RELEASE] Complete a multiworld randomizer with GAMES",
data={
"HINT_COST": (self.hint_costs, 1),
"RELEASE": (self.release, 1),
"GAMES": (self.games, 3)
},
is_time_consuming=True,
is_difficult=False,
weight=4,
),
])
if self.include_small_multiworld_randomizer_with_apbingo_objectives:
objective_label: str = (
"[Hints: HINT_COST% Release: RELEASE] Get COUNT bingo(s) on a SIZExSIZE APBingo board in a multiworld "
"randomizer with GAMES"
)
if self.apbingo_release_always_off:
objective_label = objective_label.replace("Release: RELEASE", "Release: Off")
game_objective_templates.extend([
GameObjectiveTemplate(
label=objective_label,
data={
"HINT_COST": (self.hint_costs, 1),
"RELEASE": (self.release, 1),
"GAMES": (self.games, 2),
"COUNT": (self.bingo_counts, 1),
"SIZE": (self.bingo_board_sizes, 1)
},
is_time_consuming=True,
is_difficult=False,
weight=2,
),
GameObjectiveTemplate(
label=objective_label,
data={
"HINT_COST": (self.hint_costs, 1),
"RELEASE": (self.release, 1),
"GAMES": (self.games, 3),
"COUNT": (self.bingo_counts, 1),
"SIZE": (self.bingo_board_sizes, 1)
},
is_time_consuming=True,
is_difficult=False,
weight=3,
),
])
if self.include_apbingo_blackout_objectives:
objective_label: str = (
"[Hints: HINT_COST% Release: RELEASE] Blackout a SIZExSIZE APBingo board in a multiworld "
"randomizer with GAMES"
)
if self.apbingo_release_always_off:
objective_label = objective_label.replace("Release: RELEASE", "Release: Off")
game_objective_templates.extend([
GameObjectiveTemplate(
label=objective_label,
data={
"HINT_COST": (self.hint_costs, 1),
"RELEASE": (self.release, 1),
"GAMES": (self.games, 2),
"SIZE": (self.bingo_board_sizes, 1)
},
is_time_consuming=True,
is_difficult=False,
weight=1,
),
GameObjectiveTemplate(
label=objective_label,
data={
"HINT_COST": (self.hint_costs, 1),
"RELEASE": (self.release, 1),
"GAMES": (self.games, 3),
"SIZE": (self.bingo_board_sizes, 1)
},
is_time_consuming=True,
is_difficult=False,
weight=1,
),
])
return game_objective_templates
@property
def objective_types(self) -> List[str]:
return sorted(self.archipelago_options.archipelago_multiworld_randomizer_objective_types.value)
@property
def include_solo_randomizer_objectives(self) -> bool:
return "Solo Randomizer" in self.objective_types
@property
def include_small_multiworld_randomizer_objectives(self) -> bool:
return "Small Multiworld Randomizer" in self.objective_types
@property
def include_small_multiworld_randomizer_with_apbingo_objectives(self) -> bool:
return "Small Multiworld Randomizer with APBingo" in self.objective_types
@property
def include_apbingo_blackout_objectives(self) -> bool:
return "APBingo Blackout" in self.objective_types
@property
def apbingo_release_always_off(self) -> bool:
return self.archipelago_options.archipelago_multiworld_randomizer_bingo_release_always_off.value
@staticmethod
def hint_costs() -> List[int]:
return list(range(0, 26)) + [100]
@staticmethod
def release() -> List[str]:
return ["Off", "On", "On", "On", "On"]
def games(self) -> List[str]:
games: List[str] = list(self.archipelago_options.archipelago_multiworld_randomizer_game_selection.value)
return sorted(games)
@staticmethod
def bingo_board_sizes() -> List[int]:
return list(range(3, 11))
@staticmethod
def bingo_counts() -> List[int]:
return list(range(1, 7))
# Archipelago Options
class ArchipelagoMultiworldRandomizerGameSelection(OptionList):
"""
Defines which APWorlds to select from.
You can customize this list to your liking. Defaults to all supported games in 0.6.1
You are allowed to add the same game multiple times here. This will act as a weighted pool.
"""
display_name = "Archipelago Multiworld Randomizer Game Selection"
default = [
"A Hat in Time",
"A Short Hike",
"Adventure",
"Aquaria",
"Blasphemous",
"Bomb Rush Cyberfunk",
"Bumper Stickers",
"Castlevania",
"Castlevania: Circle of the Moon",
"Celeste 64",
"ChecksFinder",
"Clique",
"Dark Souls III",
"DLC Quest",
"Donkey Kong Country 3: Dixie Kong's Double Trouble!",
"DOOM 1993",
"DOOM II",
"Factorio",
"Faxanadu",
"Final Fantasy",
"Final Fantasy: Mystic Quest",
"Heretic",
"Hollow Knight",
"Hylics 2",
"Inscryption",
"KINGDOM HEARTS FINAL MIX",
"KINGDOM HEARTS II FINAL MIX",
"Kirby's Dream Land 3",
"Landstalker - The Treasures of King Nole",
"Lingo",
"Lufia II: Rise of the Sinistrals",
"Mario & Luigi: Superstar Saga",
"Mega Man 2",
"Mega Man Battle Network 3 Blue",
"Meritous",
"Minecraft",
"Muse Dash",
"Noita",
"Old School Runescape",
"Overcooked! 2",
"Pokémon Emerald",
"Pokémon Red and Blue",
"Raft",
"Risk of Rain 2",
"Rogue Legacy",
"Saving Princess",
"Secret of Evermore",
"Shivers",
"Sid Meier's Civilization VI",
"Slay the Spire",
"SMZ3",
"Sonic Adventure 2: Battle",
"StarCraft II",
"Stardew Valley",
"Subnautica",
"Super Mario 64",
"Super Mario World",
"Super Mario World 2: Yoshi's Island",
"Super Metroid",
"Terraria",
"The Legend of Zelda",
"The Legend of Zelda: A Link to the Past",
"The Legend of Zelda: Link's Awakening DX",
"The Legend of Zelda: Ocarina of Time",
"The Legend of Zelda: The Wind Waker",
"The Messenger",
"The Witness",
"Timespinner",
"TUNIC",
"Undertale",
"VVVVVV",
"Wargroove",
"Yacht Dice",
"Yu-Gi-Oh! Ultimate Masters: WCT 2006",
"Zillion",
"Zork: Grand Inquisitor",
]
class ArchipelagoMultiworldRandomizerObjectiveTypes(OptionSet):
"""
Defines which types of Archipelago Multiworld Randomizer objectives to use when generating.
"""
display_name = "Archipelago Multiworld Randomizer Objective Types"
valid_keys = [
"Solo Randomizer",
"Small Multiworld Randomizer",
"Small Multiworld Randomizer with APBingo",
"APBingo Blackout",
]
default = valid_keys
class ArchipelagoMultiworldRandomizerBingoReleaseAlwaysOff(DefaultOnToggle):
"""
Indicates whether to force the release parameter to always be "Off" for APBingo objectives.
"""
display_name = "Archipelago Multiworld Randomizer Bingo Release Always Off"