Skip to content

Commit

Permalink
Fix Flux Vanes and Zerg unlock bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Jul 4, 2024
1 parent a0b942c commit eeae936
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion worlds/sc2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand All @@ -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
Expand Down Expand Up @@ -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)))
Expand Down
2 changes: 1 addition & 1 deletion worlds/sc2/item_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion worlds/sc2/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit eeae936

Please sign in to comment.