From 6ade8320296480cc6852917ba7c21a4e3c1b00af Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Tue, 5 Oct 2021 23:07:03 +0200 Subject: [PATCH] Subnautica: fix Aurora Prawn Suit Bay requires laser cutter Subnautica: add Dunes North Wreck's PDA to the correct wreck Subnautica: fix typo in Yellow Subnautica: fix progression tag for many items Subnautica: move extra items from valuable item pool to fast-fill Testclient at https://cdn.discordapp.com/attachments/731214280439103580/895047705552904222/ArchipelagoSubnautica.zip --- worlds/subnautica/Rules.py | 24 +++++------ worlds/subnautica/__init__.py | 14 ++++++- worlds/subnautica/items.json | 68 ++++++++++++++++---------------- worlds/subnautica/locations.json | 6 +-- 4 files changed, 61 insertions(+), 51 deletions(-) diff --git a/worlds/subnautica/Rules.py b/worlds/subnautica/Rules.py index a19c42df..8d5bcae4 100644 --- a/worlds/subnautica/Rules.py +++ b/worlds/subnautica/Rules.py @@ -106,7 +106,7 @@ def has_propulsion_cannon(state, player): return state.has("Propulsion Cannon Fragment", player, 2) or \ (has_prawn(state, player) and has_praw_propulsion_arm(state, player)) - + def has_cyclops_shield(state, player): return has_cyclops(state, player) and \ state.has("Cyclops Shield Generator", player) @@ -121,12 +121,12 @@ def has_cyclops_shield(state, player): # Fins are not used when using seaglide # def get_max_swim_depth(state, player): - #TODO, Make this a difficulty setting. + # TODO, Make this a difficulty setting. # Only go up to 200m without any submarines for now. return 200 # Rules bellow, are what are technically possible - + # has_ultra_high_capacity_tank = state.has("Ultra High Capacity Tank", player) # has_ultra_glide_fins = state.has("Ultra Glide Fins", player) @@ -151,7 +151,7 @@ def get_seamoth_max_depth(state, player): if has_seamoth(state, player): if has_seamoth_depth_module_mk3(state, player): return 900 - elif has_seamoth_depth_module_mk2(state, player): # Will never be the case, 3 is craftable + elif has_seamoth_depth_module_mk2(state, player): # Will never be the case, 3 is craftable return 500 elif has_seamoth_depth_module_mk1(state, player): return 300 @@ -165,7 +165,7 @@ def get_cyclops_max_depth(state, player): if has_cyclops(state, player): if has_cyclops_depth_module_mk3(state, player): return 1700 - elif has_cyclops_depth_module_mk2(state, player): # Will never be the case, 3 is craftable + elif has_cyclops_depth_module_mk2(state, player): # Will never be the case, 3 is craftable return 1300 elif has_cyclops_depth_module_mk1(state, player): return 900 @@ -188,12 +188,12 @@ def get_prawn_max_depth(state, player): def get_max_depth(state, player): - #TODO, Difficulty option, we can add vehicle depth + swim depth + # TODO, Difficulty option, we can add vehicle depth + swim depth # But at this point, we have to consider traver distance in caves, not # just depth - return max(get_max_swim_depth(state, player), \ - get_seamoth_max_depth(state, player), \ - get_cyclops_max_depth(state, player), \ + return max(get_max_swim_depth(state, player), + get_seamoth_max_depth(state, player), + get_cyclops_max_depth(state, player), get_prawn_max_depth(state, player)) @@ -201,9 +201,9 @@ def can_access_location(state, player, loc): pos_x = loc.get("position").get("x") pos_y = loc.get("position").get("y") pos_z = loc.get("position").get("z") - depth = -pos_y # y-up - map_center_dist = math.sqrt(pos_x**2 + pos_z**2) - aurora_dist = math.sqrt((pos_x - 1038.0)**2 + (pos_y - -3.4)**2 + (pos_z - -163.1)**2) + depth = -pos_y # y-up + map_center_dist = math.sqrt(pos_x ** 2 + pos_z ** 2) + aurora_dist = math.sqrt((pos_x - 1038.0) ** 2 + (pos_y - -3.4) ** 2 + (pos_z - -163.1) ** 2) need_radiation_suit = aurora_dist < 950 need_laser_cutter = loc.get("need_laser_cutter", False) diff --git a/worlds/subnautica/__init__.py b/worlds/subnautica/__init__.py index 5ccac126..0a3c9c2e 100644 --- a/worlds/subnautica/__init__.py +++ b/worlds/subnautica/__init__.py @@ -1,4 +1,5 @@ import logging +import typing logger = logging.getLogger("Subnautica") @@ -26,6 +27,8 @@ class SubnauticaWorld(World): location_name_to_id = locations_lookup_name_to_id options = options + data_version = 2 + def generate_basic(self): # Link regions self.world.get_entrance('Lifepod 5', self.player).connect(self.world.get_region('Planet 4546B', self.player)) @@ -34,19 +37,23 @@ class SubnauticaWorld(World): pool = [] neptune_launch_platform = None extras = 0 + valuable = self.world.item_pool[self.player] == "valuable" for item in item_table: for i in range(item["count"]): subnautica_item = self.create_item(item["name"]) if item["name"] == "Neptune Launch Platform": neptune_launch_platform = subnautica_item - elif not item["progression"] and self.world.item_pool[self.player] == "valuable": + elif valuable and not item["progression"]: self.world.push_precollected(subnautica_item) extras += 1 else: pool.append(subnautica_item) + for item_name in self.world.random.choices(sorted(advancement_item_names - {"Neptune Launch Platform"}), k=extras): - pool.append(self.create_item(item_name)) + item = self.create_item(item_name) + item.advancement = False # as it's an extra, just fast-fill it somewhere + pool.append(item) self.world.itempool += pool @@ -70,6 +77,9 @@ class SubnauticaWorld(World): item = lookup_name_to_item[name] return SubnauticaItem(name, item["progression"], item["id"], player=self.player) + def get_required_client_version(self) -> typing.Tuple[int, int, int]: + return max((0, 1, 9), super(SubnauticaWorld, self).get_required_client_version()) + def create_region(world: MultiWorld, player: int, name: str, locations=None, exits=None): ret = Region(name, None, name, player) diff --git a/worlds/subnautica/items.json b/worlds/subnautica/items.json index c5b08445..2dc4b225 100644 --- a/worlds/subnautica/items.json +++ b/worlds/subnautica/items.json @@ -1,60 +1,60 @@ [ - { "id": 35000, "count": 1, "progression": true, "tech_type": "Compass", "name": "Subnautica Compass" }, + { "id": 35000, "count": 1, "progression": false, "tech_type": "Compass", "name": "Compass" }, { "id": 35001, "count": 1, "progression": true, "tech_type": "PlasteelTank", "name": "Lightweight High Capacity Tank" }, { "id": 35002, "count": 1, "progression": true, "tech_type": "BaseUpgradeConsole", "name": "Vehicle Upgrade Console" }, { "id": 35003, "count": 1, "progression": true, "tech_type": "UltraGlideFins", "name": "Ultra Glide Fins" }, - { "id": 35004, "count": 1, "progression": true, "tech_type": "CyclopsSonarModule", "name": "Cyclops Sonar Upgrade" }, - { "id": 35005, "count": 1, "progression": true, "tech_type": "ReinforcedDiveSuit", "name": "Reinforced Dive Suit" }, - { "id": 35006, "count": 1, "progression": true, "tech_type": "CyclopsThermalReactorModule", "name": "Cyclops Thermal Reactor Module" }, - { "id": 35007, "count": 1, "progression": true, "tech_type": "Stillsuit", "name": "Stillsuit" }, + { "id": 35004, "count": 1, "progression": false, "tech_type": "CyclopsSonarModule", "name": "Cyclops Sonar Upgrade" }, + { "id": 35005, "count": 1, "progression": false, "tech_type": "ReinforcedDiveSuit", "name": "Reinforced Dive Suit" }, + { "id": 35006, "count": 1, "progression": false, "tech_type": "CyclopsThermalReactorModule", "name": "Cyclops Thermal Reactor Module" }, + { "id": 35007, "count": 1, "progression": false, "tech_type": "Stillsuit", "name": "Stillsuit" }, { "id": 35008, "count": 2, "progression": false, "tech_type": "BaseWaterParkFragment", "name": "Alien Containment Fragment" }, - { "id": 35009, "count": 1, "progression": true, "tech_type": "CyclopsDecoy", "name": "Creature Decoy" }, - { "id": 35010, "count": 1, "progression": true, "tech_type": "CyclopsFireSuppressionModule", "name": "Cyclops Fire Suppression System" }, - { "id": 35011, "count": 1, "progression": true, "tech_type": "SwimChargeFins", "name": "Swim Charge Fins" }, - { "id": 35012, "count": 1, "progression": true, "tech_type": "RepulsionCannon", "name": "Repulsion Cannon" }, - { "id": 35013, "count": 1, "progression": true, "tech_type": "CyclopsDecoyModule", "name": "Cyclops Decoy Tube Upgrade" }, + { "id": 35009, "count": 1, "progression": false, "tech_type": "CyclopsDecoy", "name": "Creature Decoy" }, + { "id": 35010, "count": 1, "progression": false, "tech_type": "CyclopsFireSuppressionModule", "name": "Cyclops Fire Suppression System" }, + { "id": 35011, "count": 1, "progression": false, "tech_type": "SwimChargeFins", "name": "Swim Charge Fins" }, + { "id": 35012, "count": 1, "progression": false, "tech_type": "RepulsionCannon", "name": "Repulsion Cannon" }, + { "id": 35013, "count": 1, "progression": false, "tech_type": "CyclopsDecoyModule", "name": "Cyclops Decoy Tube Upgrade" }, { "id": 35014, "count": 1, "progression": true, "tech_type": "CyclopsShieldModule", "name": "Cyclops Shield Generator" }, { "id": 35015, "count": 1, "progression": true, "tech_type": "CyclopsHullModule1", "name": "Cyclops Depth Module MK1" }, - { "id": 35016, "count": 1, "progression": true, "tech_type": "CyclopsSeamothRepairModule", "name": "Cyclops Docking Bay Repair Module" }, - { "id": 35017, "count": 2, "progression": true, "tech_type": "BatteryChargerFragment", "name": "Battery Charger fragment" }, - { "id": 35018, "count": 2, "progression": true, "tech_type": "BeaconFragment", "name": "Beacon Fragment" }, - { "id": 35019, "count": 2, "progression": true, "tech_type": "BaseBioReactorFragment", "name": "Bioreactor Fragment" }, + { "id": 35016, "count": 1, "progression": false, "tech_type": "CyclopsSeamothRepairModule", "name": "Cyclops Docking Bay Repair Module" }, + { "id": 35017, "count": 2, "progression": false, "tech_type": "BatteryChargerFragment", "name": "Battery Charger fragment" }, + { "id": 35018, "count": 2, "progression": false, "tech_type": "BeaconFragment", "name": "Beacon Fragment" }, + { "id": 35019, "count": 2, "progression": false, "tech_type": "BaseBioReactorFragment", "name": "Bioreactor Fragment" }, { "id": 35020, "count": 3, "progression": true, "tech_type": "CyclopsBridgeFragment", "name": "Cyclops Bridge Fragment" }, { "id": 35021, "count": 3, "progression": true, "tech_type": "CyclopsEngineFragment", "name": "Cyclops Engine Fragment" }, { "id": 35022, "count": 3, "progression": true, "tech_type": "CyclopsHullFragment", "name": "Cyclops Hull Fragment" }, - { "id": 35023, "count": 2, "progression": true, "tech_type": "GravSphereFragment", "name": "Grav Trap Fragment" }, + { "id": 35023, "count": 2, "progression": false, "tech_type": "GravSphereFragment", "name": "Grav Trap Fragment" }, { "id": 35024, "count": 3, "progression": true, "tech_type": "LaserCutterFragment", "name": "Laser Cutter Fragment" }, { "id": 35025, "count": 1, "progression": false, "tech_type": "TechlightFragment", "name": "Light Stick Fragment" }, { "id": 35026, "count": 3, "progression": true, "tech_type": "ConstructorFragment", "name": "Mobile Vehicle Bay Fragment" }, { "id": 35027, "count": 3, "progression": true, "tech_type": "WorkbenchFragment", "name": "Modification Station Fragment" }, { "id": 35028, "count": 2, "progression": true, "tech_type": "MoonpoolFragment", "name": "Moonpool Fragment" }, - { "id": 35029, "count": 3, "progression": true, "tech_type": "BaseNuclearReactorFragment", "name": "Nuclear Reactor Fragment" }, - { "id": 35030, "count": 2, "progression": true, "tech_type": "PowerCellChargerFragment", "name": "Power Cell Charger Fragment" }, - { "id": 35031, "count": 1, "progression": true, "tech_type": "PowerTransmitterFragment", "name": "Power Transmitter Fragment" }, + { "id": 35029, "count": 3, "progression": false, "tech_type": "BaseNuclearReactorFragment", "name": "Nuclear Reactor Fragment" }, + { "id": 35030, "count": 2, "progression": false, "tech_type": "PowerCellChargerFragment", "name": "Power Cell Charger Fragment" }, + { "id": 35031, "count": 1, "progression": false, "tech_type": "PowerTransmitterFragment", "name": "Power Transmitter Fragment" }, { "id": 35032, "count": 4, "progression": true, "tech_type": "ExosuitFragment", "name": "Prawn Suit Fragment" }, - { "id": 35033, "count": 2, "progression": true, "tech_type": "ExosuitDrillArmFragment", "name": "Prawn Suit Drill Arm Fragment" }, - { "id": 35034, "count": 2, "progression": true, "tech_type": "ExosuitGrapplingArmFragment", "name": "Prawn Suit Grappling Arm Fragment" }, - { "id": 35035, "count": 2, "progression": true, "tech_type": "ExosuitPropulsionArmFragment", "name": "Prawn Suit Propulsion Cannon Fragment" }, - { "id": 35036, "count": 2, "progression": true, "tech_type": "ExosuitTorpedoArmFragment", "name": "Prawn Suit Torpedo Arm Fragment" }, - { "id": 35037, "count": 3, "progression": true, "tech_type": "BaseMapRoomFragment", "name": "Scanner Room Fragment" }, + { "id": 35033, "count": 2, "progression": false, "tech_type": "ExosuitDrillArmFragment", "name": "Prawn Suit Drill Arm Fragment" }, + { "id": 35034, "count": 2, "progression": false, "tech_type": "ExosuitGrapplingArmFragment", "name": "Prawn Suit Grappling Arm Fragment" }, + { "id": 35035, "count": 2, "progression": false, "tech_type": "ExosuitPropulsionArmFragment", "name": "Prawn Suit Propulsion Cannon Fragment" }, + { "id": 35036, "count": 2, "progression": false, "tech_type": "ExosuitTorpedoArmFragment", "name": "Prawn Suit Torpedo Arm Fragment" }, + { "id": 35037, "count": 3, "progression": false, "tech_type": "BaseMapRoomFragment", "name": "Scanner Room Fragment" }, { "id": 35038, "count": 5, "progression": true, "tech_type": "SeamothFragment", "name": "Seamoth Fragment" }, - { "id": 35039, "count": 2, "progression": true, "tech_type": "StasisRifleFragment", "name": "Stasis Rifle Fragment" }, - { "id": 35040, "count": 2, "progression": true, "tech_type": "ThermalPlantFragment", "name": "Thermal Plant Fragment" }, + { "id": 35039, "count": 2, "progression": false, "tech_type": "StasisRifleFragment", "name": "Stasis Rifle Fragment" }, + { "id": 35040, "count": 2, "progression": false, "tech_type": "ThermalPlantFragment", "name": "Thermal Plant Fragment" }, { "id": 35041, "count": 4, "progression": true, "tech_type": "SeaglideFragment", "name": "Seaglide Fragment" }, { "id": 35042, "count": 1, "progression": true, "tech_type": "RadiationSuit", "name": "Radiation Suit" }, { "id": 35043, "count": 2, "progression": true, "tech_type": "PropulsionCannonFragment", "name": "Propulsion Cannon Fragment" }, { "id": 35044, "count": 1, "progression": true, "tech_type": "RocketBase", "name": "Neptune Launch Platform" }, { "id": 35045, "count": 1, "progression": true, "tech_type": "PrecursorIonPowerCell", "name": "Ion Power Cell" }, - { "id": 35046, "count": 2, "progression": true, "tech_type": "FarmingTrayFragment", "name": "Exterior Growbed Fragment" }, + { "id": 35046, "count": 2, "progression": false, "tech_type": "FarmingTrayFragment", "name": "Exterior Growbed Fragment" }, { "id": 35047, "count": 1, "progression": false, "tech_type": "PictureFrameFragment", "name": "Picture Frame" }, { "id": 35048, "count": 2, "progression": false, "tech_type": "BenchFragment", "name": "Bench Fragment" }, - { "id": 35049, "count": 1, "progression": true, "tech_type": "PlanterPotFragment", "name": "Basic Plant Pot" }, - { "id": 35050, "count": 1, "progression": true, "tech_type": "PlanterBoxFragment", "name": "Interior Growbed" }, - { "id": 35051, "count": 1, "progression": true, "tech_type": "PlanterShelfFragment", "name": "Plant Shelf" }, + { "id": 35049, "count": 1, "progression": false, "tech_type": "PlanterPotFragment", "name": "Basic Plant Pot" }, + { "id": 35050, "count": 1, "progression": false, "tech_type": "PlanterBoxFragment", "name": "Interior Growbed" }, + { "id": 35051, "count": 1, "progression": false, "tech_type": "PlanterShelfFragment", "name": "Plant Shelf" }, { "id": 35052, "count": 2, "progression": false, "tech_type": "BaseObservatoryFragment", "name": "Observatory Fragment" }, - { "id": 35053, "count": 2, "progression": true, "tech_type": "BaseRoomFragment", "name": "Multipurpose Room Fragment" }, + { "id": 35053, "count": 2, "progression": false, "tech_type": "BaseRoomFragment", "name": "Multipurpose Room Fragment" }, { "id": 35054, "count": 2, "progression": false, "tech_type": "BaseBulkheadFragment", "name": "Bulkhead Fragment" }, - { "id": 35055, "count": 1, "progression": true, "tech_type": "Spotlight", "name": "Spotlight" }, + { "id": 35055, "count": 1, "progression": false, "tech_type": "Spotlight", "name": "Spotlight" }, { "id": 35056, "count": 2, "progression": false, "tech_type": "StarshipDesk", "name": "Desk" }, { "id": 35057, "count": 1, "progression": false, "tech_type": "StarshipChair", "name": "Swivel Chair" }, { "id": 35058, "count": 1, "progression": false, "tech_type": "StarshipChair2", "name": "Office Chair" }, @@ -70,8 +70,8 @@ { "id": 35068, "count": 1, "progression": false, "tech_type": "VendingMachine", "name": "Vending Machine" }, { "id": 35069, "count": 1, "progression": false, "tech_type": "SingleWallShelf", "name": "Single Wall Shelf" }, { "id": 35070, "count": 1, "progression": false, "tech_type": "WallShelves", "name": "Wall Shelves" }, - { "id": 35071, "count": 1, "progression": true, "tech_type": "PlanterPot2", "name": "Round Plant Pot" }, - { "id": 35072, "count": 1, "progression": true, "tech_type": "PlanterPot3", "name": "Chic Plant Pot" }, + { "id": 35071, "count": 1, "progression": false, "tech_type": "PlanterPot2", "name": "Round Plant Pot" }, + { "id": 35072, "count": 1, "progression": false, "tech_type": "PlanterPot3", "name": "Chic Plant Pot" }, { "id": 35073, "count": 1, "progression": false, "tech_type": "LabTrashcan", "name": "Nuclear Waste Disposal" }, { "id": 35074, "count": 1, "progression": false, "tech_type": "BasePlanter", "name": "Wall Planter" }, { "id": 35075, "count": 1, "progression": true, "tech_type": "PrecursorIonBattery", "name": "Ion Battery" }, @@ -79,5 +79,5 @@ { "id": 35077, "count": 1, "progression": true, "tech_type": "RocketStage1", "name": "Neptune Boosters" }, { "id": 35078, "count": 1, "progression": true, "tech_type": "RocketStage2", "name": "Neptune Fuel Reserve" }, { "id": 35079, "count": 1, "progression": true, "tech_type": "RocketStage3", "name": "Neptune Cockpit" }, - { "id": 35080, "count": 1, "progression": true, "tech_type": "BaseFiltrationMachine", "name": "Water Filtration Machine" } + { "id": 35080, "count": 1, "progression": false, "tech_type": "BaseFiltrationMachine", "name": "Water Filtration Machine" } ] diff --git a/worlds/subnautica/locations.json b/worlds/subnautica/locations.json index 81df2153..806fc45e 100644 --- a/worlds/subnautica/locations.json +++ b/worlds/subnautica/locations.json @@ -41,7 +41,7 @@ { "id": 33010, "position": { "x": -1396.3, "y": -330.8, "z": 730.0}, "need_laser_cutter": false, "can_slip_through": false, - "name": "Dunes Wreck - PDA" }, + "name": "Dunes North Wreck - PDA" }, { "id": 33011, "position": { "x": -1409.8, "y": -332.4, "z": 706.9}, "need_laser_cutter": true, "can_slip_through": false, @@ -380,7 +380,7 @@ "name": "Aurora Drive Room - Upgrade Console" }, { "id": 33095, "position": { "x": 991.6, "y": 3.2, "z": -31.0}, - "need_laser_cutter": false, "can_slip_through": false, "need_propulsion_cannon": true, + "need_laser_cutter": true, "can_slip_through": false, "need_propulsion_cannon": true, "name": "Aurora Prawn Suit Bay - Upgrade Console" }, { "id": 33096, "position": { "x": 952.1, "y": 41.2, "z": 113.9}, @@ -497,7 +497,7 @@ { "id": 33124, "position": { "x": -30.4, "y": -1220.3, "z": 111.8}, "need_laser_cutter": false, "can_slip_through": false, - "name": "Alien Thermal Plant - Yelow Alien Data Terminal" }, + "name": "Alien Thermal Plant - Yellow Alien Data Terminal" }, { "id": 33125, "position": { "x": 245.8, "y": -1430.6, "z": -311.5}, "need_laser_cutter": false, "can_slip_through": false,