Skip to content

Commit

Permalink
Merge pull request Ziktofel#227 from MatthewMarinets/mm/dragoon_war_c…
Browse files Browse the repository at this point in the history
…ouncil_nerf

Mm/dragoon war council nerf
  • Loading branch information
Ziktofel authored Jul 4, 2024
2 parents 0a38be9 + e16c450 commit 66e8afa
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion worlds/sc2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def flag_user_excluded_item_sets(world: SC2World, item_list: List[FilterItem]) -

def flag_war_council_excludes(world: SC2World, item_list: List[FilterItem]) -> None:
"""Excludes items based on item set options (`only_vanilla_items`)"""
if world.options.allow_unit_nerfs:
if world.options.nerf_unit_baselines:
return

for item in item_list:
Expand Down
10 changes: 5 additions & 5 deletions worlds/sc2/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
LocationInclusion, ExtraLocations, MasteryLocations, ChallengeLocations, VanillaLocations,
DisableForcedCamera, SkipCutscenes, GrantStoryTech, GrantStoryLevels, TakeOverAIAllies, RequiredTactics,
SpearOfAdunPresence, SpearOfAdunPresentInNoBuild, SpearOfAdunAutonomouslyCastAbilityPresence,
SpearOfAdunAutonomouslyCastPresentInNoBuild, AllowUnitNerfs, LEGACY_GRID_ORDERS,
SpearOfAdunAutonomouslyCastPresentInNoBuild, NerfUnitBaselines, LEGACY_GRID_ORDERS,
)


Expand Down Expand Up @@ -329,7 +329,7 @@ def _cmd_option(self, option_name: str = "", option_value: str = "") -> None:
ConfigurableOptionInfo('no_forced_camera', 'disable_forced_camera', options.DisableForcedCamera),
ConfigurableOptionInfo('skip_cutscenes', 'skip_cutscenes', options.SkipCutscenes),
ConfigurableOptionInfo('enable_morphling', 'enable_morphling', options.EnableMorphling, can_break_logic=True),
ConfigurableOptionInfo('unit_nerfs', 'allow_unit_nerfs', options.AllowUnitNerfs, can_break_logic=True),
ConfigurableOptionInfo('unit_nerfs', 'nerf_unit_baselines', options.NerfUnitBaselines, can_break_logic=True),
)

WARNING_COLOUR = "salmon"
Expand Down Expand Up @@ -543,7 +543,7 @@ def __init__(self, *args, **kwargs) -> None:
self.kerrigan_presence: int = KerriganPresence.default
self.kerrigan_primal_status = 0
self.enable_morphling = EnableMorphling.default
self.allow_unit_nerfs: int = AllowUnitNerfs.default
self.nerf_unit_baselines: int = NerfUnitBaselines.default
self.mission_req_table: typing.Dict[SC2Campaign, typing.Dict[str, MissionInfo]] = {}
self.final_mission: int = 29
self.announcements: queue.Queue = queue.Queue()
Expand Down Expand Up @@ -651,7 +651,7 @@ def on_package(self, cmd: str, args: dict) -> None:
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.nova_covert_ops_only = args["slot_data"].get("nova_covert_ops_only", False)
self.allow_unit_nerfs = args["slot_data"].get("allow_unit_nerfs", AllowUnitNerfs.default)
self.nerf_unit_baselines = args["slot_data"].get("nerf_unit_baselines", NerfUnitBaselines.default)

if self.required_tactics == RequiredTactics.option_no_logic:
# Locking Grant Story Tech/Levels if no logic
Expand Down Expand Up @@ -897,7 +897,7 @@ def calculate_items(ctx: SC2Context) -> typing.Dict[SC2Race, typing.List[int]]:
accumulators[shield_upgrade_item.race][shield_upgrade_item.type.flag_word] += 1 << shield_upgrade_item.number

# War council option
if not ctx.allow_unit_nerfs:
if not ctx.nerf_unit_baselines:
accumulators[SC2Race.PROTOSS][ProtossItemType.War_Council.flag_word] = (1 << 30) - 1

# Deprecated Orbital Command handling (Backwards compatibility):
Expand Down
7 changes: 4 additions & 3 deletions worlds/sc2/item_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,9 +839,10 @@ def _ability_desc(unit_name_plural: str, ability_name: str, ability_description:
item_names.ZEALOT_SENTINEL_CENTURION_LEG_ENHANCEMENTS: "Zealots, Sentinels, and Centurions gain increased movement speed.",
item_names.ZEALOT_SENTINEL_CENTURION_SHIELD_CAPACITY: "Zealots, Sentinels, and Centurions gain +30 maximum shields.",
item_names.ZEALOT_WHIRLWIND: "Zealot War Council upgrade. Gives Zealots the whirlwind ability, dealing damage in an area over 3 seconds.",
item_names.CENTURION_RESOURCE_EFFICIENCY: _get_resource_efficiency_desc(item_names.CENTURION),
item_names.SENTINEL_RESOURCE_EFFICIENCY: _get_resource_efficiency_desc(item_names.SENTINEL),
item_names.STALKER_PHASE_REACTOR: "Stalkers restore 80 shields over 5 seconds after they Blink.",
item_names.CENTURION_RESOURCE_EFFICIENCY: "Centurion War Council upgrade. " + _get_resource_efficiency_desc(item_names.CENTURION),
item_names.SENTINEL_RESOURCE_EFFICIENCY: "Sentinel War Council upgrade. " + _get_resource_efficiency_desc(item_names.SENTINEL),
item_names.STALKER_PHASE_REACTOR: "Stalker War Council upgrade. Stalkers restore 80 shields over 5 seconds after they Blink.",
item_names.DRAGOON_PHALANX_SUIT: "Dragoon War Council upgrade. Dragoons gain +2 range, move slightly faster, and can form tighter formations.",
item_names.SOA_CHRONO_SURGE: "The Spear of Adun increases a target structure's unit warp in and research speeds by +1000% for 20 seconds.",
item_names.SOA_PROGRESSIVE_PROXY_PYLON: inspect.cleandoc("""
Level 1: The Spear of Adun quickly warps in a Pylon to a target location.
Expand Down
1 change: 1 addition & 0 deletions worlds/sc2/item_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,7 @@
DRAGOON_TRILLIC_COMPRESSION_SYSTEM = "Trillic Compression System (Dragoon)"
DRAGOON_SINGULARITY_CHARGE = "Singularity Charge (Dragoon)"
DRAGOON_ENHANCED_STRIDER_SERVOS = "Enhanced Strider Servos (Dragoon)"
DRAGOON_PHALANX_SUIT = "Phalanx Suit (Dragoon)"
SCOUT_COMBAT_SENSOR_ARRAY = "Combat Sensor Array (Scout)"
SCOUT_APIAL_SENSORS = "Apial Sensors (Scout)"
SCOUT_GRAVITIC_THRUSTERS = "Gravitic Thrusters (Scout)"
Expand Down
1 change: 1 addition & 0 deletions worlds/sc2/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -1694,6 +1694,7 @@ def get_full_item_list():
item_names.CENTURION_RESOURCE_EFFICIENCY: ItemData(501 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.War_Council, 1, SC2Race.PROTOSS, parent_item=item_names.CENTURION),
item_names.SENTINEL_RESOURCE_EFFICIENCY: ItemData(502 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.War_Council, 2, SC2Race.PROTOSS, parent_item=item_names.SENTINEL),
item_names.STALKER_PHASE_REACTOR: ItemData(503 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.War_Council, 3, SC2Race.PROTOSS, parent_item=item_names.STALKER),
item_names.DRAGOON_PHALANX_SUIT: ItemData(504 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.War_Council, 4, SC2Race.PROTOSS, parent_item=item_names.DRAGOON),

# SoA Calldown powers
item_names.SOA_CHRONO_SURGE: ItemData(700 + SC2LOTV_ITEM_ID_OFFSET, ProtossItemType.Spear_Of_Adun, 0, SC2Race.PROTOSS, origin={"lotv"}),
Expand Down
4 changes: 2 additions & 2 deletions worlds/sc2/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ class EnableMorphling(Toggle):
display_name = "Enable Morphling"


class AllowUnitNerfs(Toggle):
class NerfUnitBaselines(Toggle):
"""
Controls whether some units can initially be found in a nerfed state, with upgrades restoring their stronger power level.
For example, nerfed Zealots will lack the whirlwind upgrade until it is found as an item.
Expand Down Expand Up @@ -937,7 +937,7 @@ class Starcraft2Options(PerGameCommonOptions):
start_primary_abilities: StartPrimaryAbilities
kerrigan_primal_status: KerriganPrimalStatus
enable_morphling: EnableMorphling
allow_unit_nerfs: AllowUnitNerfs
nerf_unit_baselines: NerfUnitBaselines
spear_of_adun_presence: SpearOfAdunPresence
spear_of_adun_present_in_no_build: SpearOfAdunPresentInNoBuild
spear_of_adun_autonomously_cast_ability_presence: SpearOfAdunAutonomouslyCastAbilityPresence
Expand Down
4 changes: 2 additions & 2 deletions worlds/sc2/test/test_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def test_disabling_unit_nerfs_removes_war_council_upgrades(self) -> None:
'enable_epilogue_missions': False,
'enable_nco_missions': False,
'mission_order': options.MissionOrder.option_grid,
'allow_unit_nerfs': options.AllowUnitNerfs.option_false,
'nerf_unit_baselines': options.NerfUnitBaselines.option_false,
}

self.generate_world(world_options)
Expand All @@ -491,4 +491,4 @@ def test_disabling_unit_nerfs_removes_war_council_upgrades(self) -> None:
present_war_council_items = war_council_item_names.intersection(itempool)

self.assertTrue(itempool)
self.assertFalse(present_war_council_items, f'Found war council upgrades when allow_unit_nerfs is false: {present_war_council_items}')
self.assertFalse(present_war_council_items, f'Found war council upgrades when nerf_unit_baselines is false: {present_war_council_items}')

0 comments on commit 66e8afa

Please sign in to comment.