| 
									
										
										
										
											2021-07-04 16:18:21 +02:00
										 |  |  | import typing | 
					
						
							| 
									
										
										
										
											2021-08-10 08:00:53 +02:00
										 |  |  | import random | 
					
						
							| 
									
										
										
										
											2021-07-04 16:18:21 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  | from Options import Choice, Range, Option, Toggle, DefaultOnToggle | 
					
						
							| 
									
										
										
										
											2021-07-04 16:18:21 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Logic(Choice): | 
					
						
							|  |  |  |     option_no_glitches = 0 | 
					
						
							|  |  |  |     option_minor_glitches = 1 | 
					
						
							|  |  |  |     option_overworld_glitches = 2 | 
					
						
							|  |  |  |     option_hybrid_major_glitches = 3 | 
					
						
							|  |  |  |     option_no_logic = 4 | 
					
						
							|  |  |  |     alias_owg = 2 | 
					
						
							|  |  |  |     alias_hmg = 3 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Objective(Choice): | 
					
						
							|  |  |  |     option_crystals = 0 | 
					
						
							|  |  |  |     # option_pendants = 1 | 
					
						
							|  |  |  |     option_triforce_pieces = 2 | 
					
						
							|  |  |  |     option_pedestal = 3 | 
					
						
							|  |  |  |     option_bingo = 4 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Goal(Choice): | 
					
						
							|  |  |  |     option_kill_ganon = 0 | 
					
						
							|  |  |  |     option_kill_ganon_and_gt_agahnim = 1 | 
					
						
							|  |  |  |     option_hand_in = 2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 16:31:56 +02:00
										 |  |  | class DungeonItem(Choice): | 
					
						
							|  |  |  |     value: int | 
					
						
							|  |  |  |     option_original_dungeon = 0 | 
					
						
							|  |  |  |     option_own_dungeons = 1 | 
					
						
							|  |  |  |     option_own_world = 2 | 
					
						
							|  |  |  |     option_any_world = 3 | 
					
						
							|  |  |  |     option_different_world = 4 | 
					
						
							|  |  |  |     alias_true = 3 | 
					
						
							|  |  |  |     alias_false = 0 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @property | 
					
						
							|  |  |  |     def in_dungeon(self): | 
					
						
							|  |  |  |         return self.value in {0, 1} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 18:00:39 +02:00
										 |  |  | class bigkey_shuffle(DungeonItem): | 
					
						
							| 
									
										
										
										
											2021-08-30 16:31:56 +02:00
										 |  |  |     """Big Key Placement""" | 
					
						
							|  |  |  |     item_name_group = "Big Keys" | 
					
						
							|  |  |  |     displayname = "Big Key Shuffle" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 18:00:39 +02:00
										 |  |  | class smallkey_shuffle(DungeonItem): | 
					
						
							| 
									
										
										
										
											2021-08-30 16:31:56 +02:00
										 |  |  |     """Small Key Placement""" | 
					
						
							|  |  |  |     option_universal = 5 | 
					
						
							|  |  |  |     item_name_group = "Small Keys" | 
					
						
							|  |  |  |     displayname = "Small Key Shuffle" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 18:00:39 +02:00
										 |  |  | class compass_shuffle(DungeonItem): | 
					
						
							| 
									
										
										
										
											2021-08-30 16:31:56 +02:00
										 |  |  |     """Compass Placement""" | 
					
						
							|  |  |  |     item_name_group = "Compasses" | 
					
						
							|  |  |  |     displayname = "Compass Shuffle" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-30 18:00:39 +02:00
										 |  |  | class map_shuffle(DungeonItem): | 
					
						
							| 
									
										
										
										
											2021-08-30 16:31:56 +02:00
										 |  |  |     """Map Placement""" | 
					
						
							|  |  |  |     item_name_group = "Maps" | 
					
						
							|  |  |  |     displayname = "Map Shuffle" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-04 16:18:21 +02:00
										 |  |  | class Crystals(Range): | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 7 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class CrystalsTower(Crystals): | 
					
						
							|  |  |  |     default = 7 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class CrystalsGanon(Crystals): | 
					
						
							|  |  |  |     default = 7 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class TriforcePieces(Range): | 
					
						
							|  |  |  |     default = 30 | 
					
						
							|  |  |  |     range_start = 1 | 
					
						
							|  |  |  |     range_end = 90 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ShopItemSlots(Range): | 
					
						
							|  |  |  |     range_start = 0 | 
					
						
							|  |  |  |     range_end = 30 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class WorldState(Choice): | 
					
						
							|  |  |  |     option_standard = 1 | 
					
						
							|  |  |  |     option_open = 0 | 
					
						
							|  |  |  |     option_inverted = 2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Bosses(Choice): | 
					
						
							|  |  |  |     option_vanilla = 0 | 
					
						
							|  |  |  |     option_simple = 1 | 
					
						
							|  |  |  |     option_full = 2 | 
					
						
							|  |  |  |     option_chaos = 3 | 
					
						
							|  |  |  |     option_singularity = 4 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Enemies(Choice): | 
					
						
							|  |  |  |     option_vanilla = 0 | 
					
						
							|  |  |  |     option_shuffled = 1 | 
					
						
							|  |  |  |     option_chaos = 2 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | class Progressive(Choice): | 
					
						
							|  |  |  |     displayname = "Progressive Items" | 
					
						
							|  |  |  |     option_off = 0 | 
					
						
							|  |  |  |     option_grouped_random = 1 | 
					
						
							|  |  |  |     option_on = 2 | 
					
						
							|  |  |  |     alias_false = 0 | 
					
						
							|  |  |  |     alias_true = 2 | 
					
						
							|  |  |  |     default = 2 | 
					
						
							| 
									
										
										
										
											2021-08-09 10:05:45 +02:00
										 |  |  |     alias_random = 1 | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def want_progressives(self, random): | 
					
						
							| 
									
										
										
										
											2021-08-09 10:05:45 +02:00
										 |  |  |         return random.choice([True, False]) if self.value == self.option_grouped_random else bool(self.value) | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-29 20:21:49 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  | class Palette(Choice): | 
					
						
							|  |  |  |     option_default = 0 | 
					
						
							|  |  |  |     option_good = 1 | 
					
						
							|  |  |  |     option_blackout = 2 | 
					
						
							|  |  |  |     option_puke = 3 | 
					
						
							|  |  |  |     option_classic = 4 | 
					
						
							|  |  |  |     option_grayscale = 5 | 
					
						
							|  |  |  |     option_negative = 6 | 
					
						
							|  |  |  |     option_dizzy = 7 | 
					
						
							|  |  |  |     option_sick = 8 | 
					
						
							| 
									
										
										
										
											2021-08-10 08:00:53 +02:00
										 |  |  |     alias_random = 1 | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class OWPalette(Palette): | 
					
						
							|  |  |  |     displayname = "Overworld Palette" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class UWPalette(Palette): | 
					
						
							|  |  |  |     displayname = "Underworld Palette" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class HUDPalette(Palette): | 
					
						
							|  |  |  |     displayname = "Menu Palette" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class SwordPalette(Palette): | 
					
						
							|  |  |  |     displayname = "Sword Palette" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ShieldPalette(Palette): | 
					
						
							|  |  |  |     displayname = "Shield Palette" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class LinkPalette(Palette): | 
					
						
							|  |  |  |     displayname = "Link Palette" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class HeartBeep(Choice): | 
					
						
							|  |  |  |     displayname = "Heart Beep Rate" | 
					
						
							|  |  |  |     option_normal = 0 | 
					
						
							|  |  |  |     option_double = 1 | 
					
						
							| 
									
										
										
										
											2021-08-29 15:43:16 +02:00
										 |  |  |     option_half = 2 | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  |     option_quarter = 3 | 
					
						
							|  |  |  |     option_off = 4 | 
					
						
							| 
									
										
										
										
											2021-08-29 20:21:49 +02:00
										 |  |  |     alias_false = 4 | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class HeartColor(Choice): | 
					
						
							|  |  |  |     displayname = "Heart Color" | 
					
						
							|  |  |  |     option_red = 0 | 
					
						
							|  |  |  |     option_blue = 1 | 
					
						
							|  |  |  |     option_green = 2 | 
					
						
							|  |  |  |     option_yellow = 3 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-10 08:00:53 +02:00
										 |  |  |     @classmethod | 
					
						
							|  |  |  |     def from_text(cls, text: str) -> Choice: | 
					
						
							|  |  |  |         # remove when this becomes a base Choice feature | 
					
						
							|  |  |  |         if text == "random": | 
					
						
							|  |  |  |             return cls(random.randint(0, 3)) | 
					
						
							| 
									
										
										
										
											2021-08-10 09:03:44 +02:00
										 |  |  |         return super(HeartColor, cls).from_text(text) | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-15 02:32:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  | class QuickSwap(DefaultOnToggle): | 
					
						
							|  |  |  |     displayname = "L/R Quickswapping" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class MenuSpeed(Choice): | 
					
						
							|  |  |  |     displayname = "Menu Speed" | 
					
						
							|  |  |  |     option_normal = 0 | 
					
						
							|  |  |  |     option_instant = 1, | 
					
						
							|  |  |  |     option_double = 2 | 
					
						
							|  |  |  |     option_triple = 3 | 
					
						
							|  |  |  |     option_quadruple = 4 | 
					
						
							|  |  |  |     option_half = 5 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Music(DefaultOnToggle): | 
					
						
							|  |  |  |     displayname = "Play music" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-15 02:32:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  | class ReduceFlashing(DefaultOnToggle): | 
					
						
							|  |  |  |     displayname = "Reduce Screen Flashes" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-15 02:32:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  | class TriforceHud(Choice): | 
					
						
							|  |  |  |     displayname = "Display Method for Triforce Hunt" | 
					
						
							|  |  |  |     option_normal = 0 | 
					
						
							|  |  |  |     option_hide_goal = 1 | 
					
						
							|  |  |  |     option_hide_required = 2 | 
					
						
							|  |  |  |     option_hide_both = 3 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-08-15 02:32:36 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-04 16:18:21 +02:00
										 |  |  | alttp_options: typing.Dict[str, type(Option)] = { | 
					
						
							|  |  |  |     "crystals_needed_for_gt": CrystalsTower, | 
					
						
							|  |  |  |     "crystals_needed_for_ganon": CrystalsGanon, | 
					
						
							| 
									
										
										
										
											2021-08-30 18:00:39 +02:00
										 |  |  |     "bigkey_shuffle": bigkey_shuffle, | 
					
						
							|  |  |  |     "smallkey_shuffle": smallkey_shuffle, | 
					
						
							|  |  |  |     "compass_shuffle": compass_shuffle, | 
					
						
							|  |  |  |     "map_shuffle": map_shuffle, | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  |     "progressive": Progressive, | 
					
						
							| 
									
										
										
										
											2021-07-04 16:18:21 +02:00
										 |  |  |     "shop_item_slots": ShopItemSlots, | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  |     "ow_palettes": OWPalette, | 
					
						
							|  |  |  |     "uw_palettes": UWPalette, | 
					
						
							|  |  |  |     "hud_palettes": HUDPalette, | 
					
						
							|  |  |  |     "sword_palettes": SwordPalette, | 
					
						
							|  |  |  |     "shield_palettes": ShieldPalette, | 
					
						
							|  |  |  |     "link_palettes": LinkPalette, | 
					
						
							|  |  |  |     "heartbeep": HeartBeep, | 
					
						
							|  |  |  |     "heartcolor": HeartColor, | 
					
						
							|  |  |  |     "quickswap": QuickSwap, | 
					
						
							|  |  |  |     "menuspeed": MenuSpeed, | 
					
						
							|  |  |  |     "music": Music, | 
					
						
							|  |  |  |     "reduceflashing": ReduceFlashing, | 
					
						
							| 
									
										
										
										
											2021-08-30 16:31:56 +02:00
										 |  |  |     "triforcehud": TriforceHud, | 
					
						
							|  |  |  |     "glitch_boots": DefaultOnToggle | 
					
						
							| 
									
										
										
										
											2021-08-09 09:15:41 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | } |