From eeae9360b5fe478b57bc553b202af9b4f30faa45 Mon Sep 17 00:00:00 2001 From: Ziktofel Date: Thu, 4 Jul 2024 22:48:02 +0200 Subject: [PATCH] Fix Flux Vanes and Zerg unlock bugs --- worlds/sc2/client.py | 6 +++++- worlds/sc2/item_descriptions.py | 2 +- worlds/sc2/items.py | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/worlds/sc2/client.py b/worlds/sc2/client.py index 3c392306384c..24ed3f269193 100644 --- a/worlds/sc2/client.py +++ b/worlds/sc2/client.py @@ -839,7 +839,7 @@ def calculate_items(ctx: SC2Context) -> typing.Dict[SC2Race, typing.List[int]]: network_item: NetworkItem accumulators: typing.Dict[SC2Race, typing.List[int]] = { - race: [0 for _ in item_type_enum_class] + race: [0 for element in item_type_enum_class if element.flag_word >= 0] for race, item_type_enum_class in race_to_item_type.items() } @@ -852,6 +852,9 @@ def calculate_items(ctx: SC2Context) -> typing.Dict[SC2Race, typing.List[int]]: name: str = lookup_id_to_name[network_item.item] item_data: ItemData = item_list[name] + if item_data.type.flag_word < 0: + continue + # exists exactly once if item_data.quantity == 1: accumulators[item_data.race][item_data.type.flag_word] |= 1 << item_data.number @@ -1242,6 +1245,7 @@ async def updateTerranTech(self, current_items): async def updateZergTech(self, current_items, kerrigan_level): zerg_items = current_items[SC2Race.ZERG] + zerg_items = [value for index, value in enumerate(zerg_items) if index not in [ZergItemType.Level.flag_word, ZergItemType.Primal_Form.flag_word]] kerrigan_primal_by_items = kerrigan_primal(self.ctx, kerrigan_level) kerrigan_primal_bot_value = 1 if kerrigan_primal_by_items else 0 await self.chat_send(f"?GiveZergTech {kerrigan_level} {kerrigan_primal_bot_value} " + ' '.join(map(str, zerg_items))) diff --git a/worlds/sc2/item_descriptions.py b/worlds/sc2/item_descriptions.py index 5af68bb305b8..7bd7f160e093 100644 --- a/worlds/sc2/item_descriptions.py +++ b/worlds/sc2/item_descriptions.py @@ -794,7 +794,7 @@ def _ability_desc(unit_name_plural: str, ability_name: str, ability_description: item_names.ARBITER_ENHANCED_CLOAK_FIELD: "Increases Arbiter Cloaking Field range.", item_names.CARRIER_GRAVITON_CATAPULT: "Carriers can launch Interceptors more quickly.", item_names.CARRIER_HULL_OF_PAST_GLORIES: "Carriers gain +2 armour.", - item_names.VOID_RAY_DESTROYER_WARP_RAY_FLUX_VANES: "Increases Void Ray and Destroyer movement speed.", + item_names.VOID_RAY_DESTROYER_WARP_RAY_SCORCHER_FLUX_VANES: "Increases Void Ray and Destroyer movement speed.", item_names.DESTROYER_REFORGED_BLOODSHARD_CORE: "When fully charged, the Destroyer's Destruction Beam weapon does full damage to secondary targets.", item_names.WARP_PRISM_GRAVITIC_DRIVE: "Increases the movement speed of Warp Prisms.", item_names.WARP_PRISM_PHASE_BLASTER: "Equips Warp Prisms with an auto-attack that can hit ground and air targets.", diff --git a/worlds/sc2/items.py b/worlds/sc2/items.py index e8cae231bde9..3e63ec6c3b4c 100644 --- a/worlds/sc2/items.py +++ b/worlds/sc2/items.py @@ -1637,7 +1637,7 @@ def get_full_item_list(): item_names.CARRIER_HULL_OF_PAST_GLORIES: ItemData(334 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Forge_2, 4, SC2Race.PROTOSS, origin={"bw"}, parent_item=item_names.CARRIER), - item_names.VOID_RAY_DESTROYER_WARP_RAY_FLUX_VANES: + item_names.VOID_RAY_DESTROYER_WARP_RAY_SCORCHER_FLUX_VANES: ItemData(335 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Forge_2, 5, SC2Race.PROTOSS, classification=ItemClassification.filler, origin={"ext"}), item_names.DESTROYER_REFORGED_BLOODSHARD_CORE: