| 
									
										
										
										
											2022-08-23 01:02:29 +02:00
										 |  |  | import typing | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-28 07:03:09 +01:00
										 |  |  | from Options import Choice, Range, DeathLink, DefaultOnToggle | 
					
						
							| 
									
										
										
										
											2022-08-30 17:14:34 +02:00
										 |  |  | from .Creatures import all_creatures, Definitions | 
					
						
							| 
									
										
										
										
											2021-09-17 04:32:36 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-28 07:43:04 +01:00
										 |  |  | class SwimRule(Choice): | 
					
						
							|  |  |  |     """What logic considers ok swimming distances.
 | 
					
						
							|  |  |  |     Easy: +200 depth from any max vehicle depth. | 
					
						
							|  |  |  |     Normal: +400 depth from any max vehicle depth. | 
					
						
							|  |  |  |     Warning: Normal can expect you to death run to a location (No viable return trip). | 
					
						
							|  |  |  |     Hard: +600 depth from any max vehicle depth. | 
					
						
							|  |  |  |     Warning: Hard may require bases, deaths, glitches, multi-tank inventory or other depth extending means. | 
					
						
							|  |  |  |     Items: Expected depth is extended by items like seaglide, ultra glide fins and capacity tanks. | 
					
						
							|  |  |  |     """
 | 
					
						
							|  |  |  |     display_name = "Swim Rule" | 
					
						
							|  |  |  |     option_easy = 0 | 
					
						
							|  |  |  |     option_normal = 1 | 
					
						
							|  |  |  |     option_hard = 2 | 
					
						
							|  |  |  |     option_items_easy = 3 | 
					
						
							|  |  |  |     option_items_normal = 4 | 
					
						
							|  |  |  |     option_items_hard = 5 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @property | 
					
						
							|  |  |  |     def base_depth(self) -> int: | 
					
						
							|  |  |  |         return [200, 400, 600][self.value % 3] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     @property | 
					
						
							|  |  |  |     def consider_items(self) -> bool: | 
					
						
							|  |  |  |         return self.value > 2 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-11-28 07:03:09 +01:00
										 |  |  | class EarlySeaglide(DefaultOnToggle): | 
					
						
							|  |  |  |     """Make sure 2 of the Seaglide Fragments are available in or near the Safe Shallows (Sphere 1 Locations).""" | 
					
						
							| 
									
										
										
										
											2022-12-21 16:54:43 +01:00
										 |  |  |     display_name = "Early Seaglide" | 
					
						
							| 
									
										
										
										
											2022-11-28 07:03:09 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-17 04:32:36 +02:00
										 |  |  | class ItemPool(Choice): | 
					
						
							| 
									
										
										
										
											2022-07-15 17:41:53 +02:00
										 |  |  |     """Valuable item pool leaves all filler items in their vanilla locations and
 | 
					
						
							|  |  |  |     creates random duplicates of important items into freed spots."""
 | 
					
						
							| 
									
										
										
										
											2022-07-07 00:01:28 +02:00
										 |  |  |     display_name = "Item Pool" | 
					
						
							| 
									
										
										
										
											2021-09-17 04:32:36 +02:00
										 |  |  |     option_standard = 0 | 
					
						
							|  |  |  |     option_valuable = 1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-15 17:41:53 +02:00
										 |  |  | class Goal(Choice): | 
					
						
							|  |  |  |     """Goal to complete.
 | 
					
						
							|  |  |  |     Launch: Leave the planet. | 
					
						
							|  |  |  |     Free: Disable quarantine. | 
					
						
							|  |  |  |     Infected: Reach maximum infection level. | 
					
						
							|  |  |  |     Drive: Repair the Aurora's Drive Core""" | 
					
						
							|  |  |  |     auto_display_name = True | 
					
						
							|  |  |  |     display_name = "Goal" | 
					
						
							|  |  |  |     option_launch = 0 | 
					
						
							|  |  |  |     option_free = 1 | 
					
						
							|  |  |  |     option_infected = 2 | 
					
						
							|  |  |  |     option_drive = 3 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def get_event_name(self) -> str: | 
					
						
							|  |  |  |         return { | 
					
						
							|  |  |  |             self.option_launch: "Neptune Launch", | 
					
						
							|  |  |  |             self.option_infected: "Full Infection", | 
					
						
							|  |  |  |             self.option_free: "Disable Quarantine", | 
					
						
							|  |  |  |             self.option_drive: "Repair Aurora Drive" | 
					
						
							|  |  |  |         }[self.value] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-16 16:45:40 +02:00
										 |  |  | class CreatureScans(Range): | 
					
						
							| 
									
										
										
										
											2022-08-22 23:35:41 +02:00
										 |  |  |     """Place items on specific, randomly chosen, creature scans.
 | 
					
						
							| 
									
										
										
										
											2022-07-16 16:45:40 +02:00
										 |  |  |     Warning: Includes aggressive Leviathans."""
 | 
					
						
							|  |  |  |     display_name = "Creature Scans" | 
					
						
							|  |  |  |     range_end = len(all_creatures) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-23 01:02:29 +02:00
										 |  |  | class AggressiveScanLogic(Choice): | 
					
						
							| 
									
										
										
										
											2022-08-22 23:35:41 +02:00
										 |  |  |     """By default (Stasis), aggressive Creature Scans are logically expected only with a Stasis Rifle.
 | 
					
						
							|  |  |  |     Containment: Removes Stasis Rifle as expected solution and expects Alien Containment instead. | 
					
						
							|  |  |  |     Either: Creatures may be expected to be scanned via Stasis Rifle or Containment, whichever is found first. | 
					
						
							|  |  |  |     None: Aggressive Creatures are assumed to not need any tools to scan. | 
					
						
							| 
									
										
										
										
											2022-08-30 17:14:34 +02:00
										 |  |  |     Removed: No Creatures needing Stasis or Containment will be in the pool at all. | 
					
						
							| 
									
										
										
										
											2022-08-22 23:35:41 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     Note: Containment, Either and None adds Cuddlefish as an option for scans. | 
					
						
							| 
									
										
										
										
											2022-08-30 17:14:34 +02:00
										 |  |  |     Note: Stasis, Either and None adds unhatchable aggressive species, such as Warper. | 
					
						
							| 
									
										
										
										
											2022-08-22 23:35:41 +02:00
										 |  |  |     Note: This is purely a logic expectation, and does not affect gameplay, only placement."""
 | 
					
						
							|  |  |  |     display_name = "Aggressive Creature Scan Logic" | 
					
						
							|  |  |  |     option_stasis = 0 | 
					
						
							|  |  |  |     option_containment = 1 | 
					
						
							|  |  |  |     option_either = 2 | 
					
						
							|  |  |  |     option_none = 3 | 
					
						
							| 
									
										
										
										
											2022-08-30 17:14:34 +02:00
										 |  |  |     option_removed = 4 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def get_pool(self) -> typing.List[str]: | 
					
						
							|  |  |  |         if self == self.option_removed: | 
					
						
							| 
									
										
										
										
											2022-11-03 03:05:58 +01:00
										 |  |  |             return Definitions.all_creatures_presorted_without_aggressive_and_containment | 
					
						
							| 
									
										
										
										
											2022-08-30 17:14:34 +02:00
										 |  |  |         elif self == self.option_stasis: | 
					
						
							|  |  |  |             return Definitions.all_creatures_presorted_without_containment | 
					
						
							|  |  |  |         elif self == self.option_containment: | 
					
						
							|  |  |  |             return Definitions.all_creatures_presorted_without_stasis | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             return Definitions.all_creatures_presorted | 
					
						
							| 
									
										
										
										
											2022-08-22 23:35:41 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-21 15:39:34 +02:00
										 |  |  | class SubnauticaDeathLink(DeathLink): | 
					
						
							|  |  |  |     """When you die, everyone dies. Of course the reverse is true too.
 | 
					
						
							|  |  |  |     Note: can be toggled via in-game console command "deathlink"."""
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-17 04:32:36 +02:00
										 |  |  | options = { | 
					
						
							| 
									
										
										
										
											2022-11-28 07:43:04 +01:00
										 |  |  |     "swim_rule": SwimRule, | 
					
						
							| 
									
										
										
										
											2022-11-28 07:03:09 +01:00
										 |  |  |     "early_seaglide": EarlySeaglide, | 
					
						
							| 
									
										
										
										
											2022-07-15 17:41:53 +02:00
										 |  |  |     "item_pool": ItemPool, | 
					
						
							|  |  |  |     "goal": Goal, | 
					
						
							| 
									
										
										
										
											2022-07-21 15:39:34 +02:00
										 |  |  |     "creature_scans": CreatureScans, | 
					
						
							| 
									
										
										
										
											2022-08-22 23:35:41 +02:00
										 |  |  |     "creature_scan_logic": AggressiveScanLogic, | 
					
						
							| 
									
										
										
										
											2022-07-21 15:39:34 +02:00
										 |  |  |     "death_link": SubnauticaDeathLink, | 
					
						
							| 
									
										
										
										
											2021-09-17 04:32:36 +02:00
										 |  |  | } |