diff --git a/worlds/sc2/client.py b/worlds/sc2/client.py index 4ec9c24e59e4..d51cec04e5c3 100644 --- a/worlds/sc2/client.py +++ b/worlds/sc2/client.py @@ -620,6 +620,7 @@ def __init__(self, *args, **kwargs) -> None: self.minerals_per_item: int = 15 # For backwards compat with games generated pre-0.4.5 self.vespene_per_item: int = 15 # For backwards compat with games generated pre-0.4.5 self.starting_supply_per_item: int = 2 # For backwards compat with games generated pre-0.4.5 + self.maximum_supply_per_item: int = 2 self.nova_covert_ops_only = False self.kerrigan_levels_per_mission_completed = 0 self.trade_enabled: int = EnableVoidTrade.default @@ -777,6 +778,7 @@ def on_package(self, cmd: str, args: dict) -> None: self.minerals_per_item = args["slot_data"].get("minerals_per_item", 15) self.vespene_per_item = args["slot_data"].get("vespene_per_item", 15) self.starting_supply_per_item = args["slot_data"].get("starting_supply_per_item", 2) + self.maximum_supply_per_item = args["slot_data"].get("maximum_supply_per_item", 2) self.nova_covert_ops_only = args["slot_data"].get("nova_covert_ops_only", False) self.trade_enabled = args["slot_data"].get("enable_void_trade", EnableVoidTrade.option_false) @@ -1272,6 +1274,8 @@ def calculate_items(ctx: SC2Context) -> typing.Dict[SC2Race, typing.List[int]]: accumulators[item_data.race][item_data.type.flag_word] += ctx.vespene_per_item elif name == item_names.STARTING_SUPPLY: accumulators[item_data.race][item_data.type.flag_word] += ctx.starting_supply_per_item + elif name == item_names.MAX_SUPPLY: + accumulators[item_data.race][item_data.type.flag_word] += ctx.maximum_supply_per_item else: accumulators[item_data.race][item_data.type.flag_word] += item_data.number @@ -1694,10 +1698,11 @@ async def update_colors(self): self.ctx.pending_color_update = False async def update_resources(self, current_items): - await self.chat_send("?GiveResources {} {} {}".format( + await self.chat_send("?GiveResources {} {} {} {}".format( current_items[SC2Race.ANY][get_item_flag_word(item_names.STARTING_MINERALS)], current_items[SC2Race.ANY][get_item_flag_word(item_names.STARTING_VESPENE)], - current_items[SC2Race.ANY][get_item_flag_word(item_names.STARTING_SUPPLY)] + current_items[SC2Race.ANY][get_item_flag_word(item_names.STARTING_SUPPLY)], + current_items[SC2Race.ANY][get_item_flag_word(item_names.MAX_SUPPLY)] )) async def update_terran_tech(self, current_items): diff --git a/worlds/sc2/item/item_names.py b/worlds/sc2/item/item_names.py index c2dfff5d2d5f..d0aaeeb3d620 100644 --- a/worlds/sc2/item/item_names.py +++ b/worlds/sc2/item/item_names.py @@ -873,6 +873,7 @@ STARTING_MINERALS = "Additional Starting Minerals" STARTING_VESPENE = "Additional Starting Vespene" STARTING_SUPPLY = "Additional Starting Supply" +MAX_SUPPLY = "Additional Maximum Supply" NOTHING = "Nothing" # Deprecated diff --git a/worlds/sc2/item/item_tables.py b/worlds/sc2/item/item_tables.py index f006f2179c28..3a37d046b346 100644 --- a/worlds/sc2/item/item_tables.py +++ b/worlds/sc2/item/item_tables.py @@ -89,6 +89,7 @@ class FactionlessItemType(ItemTypeEnum): Supply = "Supply", 2 Nothing = "Nothing Group", 4 Deprecated = "Deprecated", 5 + MaxSupply = "Max Supply", 6 Keys = "Keys", -1 @@ -1071,6 +1072,9 @@ def get_full_item_list(): item_names.NOTHING: ItemData(803 + SC2WOL_ITEM_ID_OFFSET, FactionlessItemType.Nothing, -1, SC2Race.ANY, quantity=0, classification=ItemClassification.trap), + item_names.MAX_SUPPLY: + ItemData(804 + SC2WOL_ITEM_ID_OFFSET, FactionlessItemType.MaxSupply, -1, SC2Race.ANY, quantity=0, + classification=ItemClassification.filler), # Nova gear item_names.NOVA_GHOST_VISOR: @@ -2128,6 +2132,7 @@ def get_item_table(): item_names.STARTING_MINERALS, item_names.STARTING_VESPENE, item_names.STARTING_SUPPLY, + item_names.MAX_SUPPLY, ) # Defense rating table diff --git a/worlds/sc2/options.py b/worlds/sc2/options.py index ab4526b4e7f7..75b415edcdf9 100644 --- a/worlds/sc2/options.py +++ b/worlds/sc2/options.py @@ -1014,6 +1014,17 @@ class StartingSupplyPerItem(Range): default = 2 +class MaximumSupplyPerItem(Range): + """ + Configures how much maximum supply per is given per item. + """ + display_name = "Maximum Supply Per Item" + range_start = 0 + range_end = 16 + default = 2 + + + @dataclass class Starcraft2Options(PerGameCommonOptions): start_inventory: Sc2StartInventory @@ -1084,6 +1095,7 @@ class Starcraft2Options(PerGameCommonOptions): minerals_per_item: MineralsPerItem vespene_per_item: VespenePerItem starting_supply_per_item: StartingSupplyPerItem + maximum_supply_per_item: MaximumSupplyPerItem custom_mission_order: CustomMissionOrder