Skip to content

Commit

Permalink
Add Dominion Troopers
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziktofel committed Oct 6, 2024
1 parent e6dd300 commit 1418cac
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 16 deletions.
8 changes: 8 additions & 0 deletions worlds/sc2/item_descriptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ def _ability_desc(unit_name_plural: str, ability_name: str, ability_description:
item_names.WARHOUND: inspect.cleandoc("""
Anti-vehicle mech. Haywire missiles do bonus damage to mechanical units.
"""),
item_names.DOMINION_TROOPER: inspect.cleandoc("""
General-purpose infantry. Can be outfitted with weapons for different combat situations.
"""),
item_names.PRIDE_OF_AUGUSTRGRAD: "Powerful Royal Guard warship.",
item_names.SKY_FURY: inspect.cleandoc("""
Durable Royal Guard support flyer. Loaded with strong anti-capital air missiles.
Expand Down Expand Up @@ -472,6 +475,11 @@ def _ability_desc(unit_name_plural: str, ability_name: str, ability_description:
item_names.VIKING_AESIR_TURBINES: "Increases Viking movement speed by 55%.",
item_names.MEDIVAC_RESOURCE_EFFICIENCY: _get_resource_efficiency_desc(item_names.MEDIVAC),
item_names.EMPERORS_SHADOW_SOVEREIGN_TACTICAL_MISSILES: "Tactical Missile Strikes no longer need to be channeled.",
item_names.DOMINION_TROOPER_B2_HIGH_CAL_LMG: "Allows the Troopers to arm with a more powerful weapon, effective against all unit types.",
item_names.DOMINION_TROOPER_HAILSTORM_LAUNCHER: "Allows the Troopers to arm with a more powerful weapon, especially effective against armored air units.",
item_names.DOMINION_TROOPER_CPO7_SALAMANDER_FLAMETHROWER: "Allows the Troopers to arm with a more powerful weapon, especially effective against light ground units.",
item_names.DOMINION_TROOPER_ADVANCED_ALLOYS: "Dominion Trooper advanced weapons are dropped on ground on death to be able to be picked up by an another Dominion Trooper.",
item_names.DOMINION_TROOPER_OPTIMIZED_LOGISTICS: "Increases Dominion Trooper training speed.",
item_names.BUNKER: "Defensive structure. Able to load infantry units, giving them +1 range to their attacks.",
item_names.MISSILE_TURRET: "Anti-air defensive structure.",
item_names.SENSOR_TOWER: "Reveals locations of enemy units at long range.",
Expand Down
2 changes: 1 addition & 1 deletion worlds/sc2/item_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def get_all_group_names(cls) -> typing.Set[str]:
item_name_groups[ItemGroupNames.BARRACKS_UNITS] = barracks_units = [
item_names.MARINE, item_names.MEDIC, item_names.FIREBAT, item_names.MARAUDER,
item_names.REAPER, item_names.GHOST, item_names.SPECTRE, item_names.HERC, item_names.AEGIS_GUARD,
item_names.EMPERORS_SHADOW,
item_names.EMPERORS_SHADOW, item_names.DOMINION_TROOPER,
]
item_name_groups[ItemGroupNames.FACTORY_UNITS] = factory_units = [
item_names.HELLION, item_names.VULTURE, item_names.GOLIATH, item_names.DIAMONDBACK,
Expand Down
18 changes: 12 additions & 6 deletions worlds/sc2/item_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
PREDATOR = "Predator"
HERCULES = "Hercules"
# Extended units
LIBERATOR = "Liberator"
VALKYRIE = "Valkyrie"
WIDOW_MINE = "Widow Mine"
CYCLONE = "Cyclone"
HERC = "HERC"
WARHOUND = "Warhound"
LIBERATOR = "Liberator"
VALKYRIE = "Valkyrie"
WIDOW_MINE = "Widow Mine"
CYCLONE = "Cyclone"
HERC = "HERC"
WARHOUND = "Warhound"
DOMINION_TROOPER = "Dominion Trooper"
# Elites
PRIDE_OF_AUGUSTRGRAD = "Pride of Augustgrad"
SKY_FURY = "Sky Fury"
Expand Down Expand Up @@ -150,6 +151,11 @@
DIAMONDBACK_SHAPED_HULL = "Shaped Hull (Diamondback)"
DIAMONDBACK_PROGRESSIVE_TRI_LITHIUM_POWER_CELL = "Progressive Tri-Lithium Power Cell (Diamondback)"
DIAMONDBACK_ION_THRUSTERS = "Ion Thrusters (Diamondback)"
DOMINION_TROOPER_B2_HIGH_CAL_LMG = "B-2 High-Cal LMG (Dominion Trooper)"
DOMINION_TROOPER_CPO7_SALAMANDER_FLAMETHROWER = "CPO-7 Salamander Flamethrower (Dominion Trooper)"
DOMINION_TROOPER_HAILSTORM_LAUNCHER = "Hailstorm Launcher (Dominion Trooper)"
DOMINION_TROOPER_ADVANCED_ALLOYS = "Advanced Alloys (Dominion Trooper)"
DOMINION_TROOPER_OPTIMIZED_LOGISTICS = "Optimized Logistics (Dominion Trooper)"
EMPERORS_SHADOW_SOVEREIGN_TACTICAL_MISSILES = "Sovereign Tactical Missiles (Emperor's Shadow)"
FIREBAT_INCINERATOR_GAUNTLETS = "Incinerator Gauntlets (Firebat)"
FIREBAT_JUGGERNAUT_PLATING = "Juggernaut Plating (Firebat)"
Expand Down
18 changes: 18 additions & 0 deletions worlds/sc2/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ def get_full_item_list():
item_names.WARHOUND:
ItemData(23 + SC2WOL_ITEM_ID_OFFSET, TerranItemType.Unit, 27, SC2Race.TERRAN,
classification=ItemClassification.progression, origin={"ext"}),
item_names.DOMINION_TROOPER:
ItemData(24 + SC2WOL_ITEM_ID_OFFSET, TerranItemType.Unit_2, 4, SC2Race.TERRAN,
classification=ItemClassification.progression),
# Elites
item_names.PRIDE_OF_AUGUSTRGRAD:
ItemData(50 + SC2WOL_ITEM_ID_OFFSET, TerranItemType.Unit, 28, SC2Race.TERRAN,
Expand Down Expand Up @@ -1020,6 +1023,21 @@ def get_full_item_list():
item_names.EMPERORS_SHADOW_SOVEREIGN_TACTICAL_MISSILES:
ItemData(756 + SC2WOL_ITEM_ID_OFFSET, TerranItemType.Armory_7, 10, SC2Race.TERRAN,
parent_item=item_names.EMPERORS_SHADOW),
item_names.DOMINION_TROOPER_B2_HIGH_CAL_LMG:
ItemData(757 + SC2WOL_ITEM_ID_OFFSET, TerranItemType.Armory_7, 11, SC2Race.TERRAN,
parent_item=item_names.DOMINION_TROOPER),
item_names.DOMINION_TROOPER_HAILSTORM_LAUNCHER:
ItemData(758 + SC2WOL_ITEM_ID_OFFSET, TerranItemType.Armory_7, 12, SC2Race.TERRAN,
parent_item=item_names.DOMINION_TROOPER),
item_names.DOMINION_TROOPER_CPO7_SALAMANDER_FLAMETHROWER:
ItemData(759 + SC2WOL_ITEM_ID_OFFSET, TerranItemType.Armory_7, 13, SC2Race.TERRAN,
parent_item=item_names.DOMINION_TROOPER),
item_names.DOMINION_TROOPER_ADVANCED_ALLOYS:
ItemData(760 + SC2WOL_ITEM_ID_OFFSET, TerranItemType.Armory_7, 14, SC2Race.TERRAN,
parent_item=item_names.DOMINION_TROOPER),
item_names.DOMINION_TROOPER_OPTIMIZED_LOGISTICS:
ItemData(761 + SC2WOL_ITEM_ID_OFFSET, TerranItemType.Armory_7, 15, SC2Race.TERRAN,
parent_item=item_names.DOMINION_TROOPER, classification=ItemClassification.filler),

# Filler items to fill remaining spots
item_names.STARTING_MINERALS:
Expand Down
21 changes: 12 additions & 9 deletions worlds/sc2/rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ def terran_early_tech(self, state: CollectionState):
:return:
"""
return (
state.has_any({item_names.MARINE, item_names.FIREBAT, item_names.MARAUDER, item_names.REAPER, item_names.HELLION}, self.player)
state.has_any({
item_names.MARINE, item_names.DOMINION_TROOPER, item_names.FIREBAT, item_names.MARAUDER,
item_names.REAPER, item_names.HELLION
}, self.player)
or (self.advanced_tactics and state.has_any({item_names.GOLIATH, item_names.DIAMONDBACK, item_names.VIKING, item_names.BANSHEE}, self.player))
)

Expand Down Expand Up @@ -75,7 +78,7 @@ def terran_competent_ground_to_air(self, state: CollectionState) -> bool:
"""
return (
state.has(item_names.GOLIATH, self.player)
or state.has(item_names.MARINE, self.player) and self.terran_bio_heal(state)
or state.has_any({item_names.MARINE, item_names.DOMINION_TROOPER}, self.player) and self.terran_bio_heal(state)
or self.advanced_tactics and state.has(item_names.CYCLONE, self.player)
)

Expand Down Expand Up @@ -122,7 +125,7 @@ def welcome_to_the_jungle_requirement(self, state: CollectionState) -> bool:
and self.terran_competent_ground_to_air(state)
) or (
self.advanced_tactics
and state.has_any({item_names.MARINE, item_names.VULTURE}, self.player)
and state.has_any({item_names.MARINE, item_names.DOMINION_TROOPER, item_names.VULTURE}, self.player)
and self.terran_air_anti_air(state)
)

Expand All @@ -137,7 +140,7 @@ def terran_basic_anti_air(self, state: CollectionState) -> bool:
item_names.MISSILE_TURRET, item_names.THOR, item_names.WAR_PIGS, item_names.SPARTAN_COMPANY,
item_names.HELS_ANGELS, item_names.BATTLECRUISER, item_names.MARINE, item_names.WRAITH,
item_names.VALKYRIE, item_names.CYCLONE, item_names.WINGED_NIGHTMARES, item_names.BRYNHILDS,
item_names.SKY_FURY,
item_names.SKY_FURY, item_names.DOMINION_TROOPER
), self.player)
or self.terran_competent_anti_air(state)
or self.advanced_tactics and (
Expand All @@ -163,7 +166,7 @@ def terran_defense_rating(self, state: CollectionState, zerg_enemy: bool, air_en
"""
defense_score = sum((tvx_defense_ratings[item] for item in tvx_defense_ratings if state.has(item, self.player)))
# Manned Bunker
if state.has_any({item_names.MARINE, item_names.MARAUDER}, self.player) and state.has(item_names.BUNKER, self.player):
if state.has_any({item_names.MARINE, item_names.DOMINION_TROOPER, item_names.MARAUDER}, self.player) and state.has(item_names.BUNKER, self.player):
defense_score += 3
elif zerg_enemy and state.has(item_names.FIREBAT, self.player) and state.has(item_names.BUNKER, self.player):
defense_score += 2
Expand Down Expand Up @@ -200,7 +203,7 @@ def terran_competent_comp(self, state: CollectionState) -> bool:
"""
return (
(
(state.has_any({item_names.MARINE, item_names.MARAUDER}, self.player) and self.terran_bio_heal(state))
(state.has_any({item_names.MARINE, item_names.DOMINION_TROOPER, item_names.MARAUDER}, self.player) and self.terran_bio_heal(state))
or state.has_any({item_names.THOR, item_names.BANSHEE, item_names.SIEGE_TANK}, self.player)
or state.has_all({item_names.LIBERATOR, item_names.LIBERATOR_RAID_ARTILLERY}, self.player)
)
Expand Down Expand Up @@ -469,7 +472,7 @@ def all_in_requirement(self, state: CollectionState):
:return:
"""
beats_kerrigan = (
state.has_any({item_names.MARINE, item_names.BANSHEE, item_names.GHOST}, self.player)
state.has_any({item_names.MARINE, item_names.DOMINION_TROOPER, item_names.BANSHEE, item_names.GHOST}, self.player)
or state.has_all({item_names.REAPER, item_names.REAPER_RESOURCE_EFFICIENCY}, self.player)
or self.advanced_tactics
)
Expand Down Expand Up @@ -1036,7 +1039,7 @@ def brothers_in_arms_requirement(self, state: CollectionState) -> bool:
or state.has_any({item_names.BATTLECRUISER, item_names.LIBERATOR, item_names.SIEGE_TANK}, self.player)
or state.has_all({item_names.SPECTRE, item_names.SPECTRE_PSIONIC_LASH}, self.player)
or (state.has_any({item_names.IMMORTAL, item_names.STALWART}, self.player)
and state.has_any({item_names.MARINE, item_names.MARAUDER}, self.player)
and state.has_any({item_names.MARINE, item_names.DOMINION_TROOPER, item_names.MARAUDER}, self.player)
and self.terran_bio_heal(state)
)
)
Expand Down Expand Up @@ -1313,7 +1316,7 @@ def sudden_strike_can_reach_objectives(self, state: CollectionState) -> bool:
self.advanced_tactics
and state.has(item_names.MEDIVAC, self.player)
and state.has_any({
item_names.MARINE, item_names.MARAUDER, item_names.VULTURE, item_names.HELLION, item_names.GOLIATH
item_names.MARINE, item_names.DOMINION_TROOPER, item_names.MARAUDER, item_names.VULTURE, item_names.HELLION, item_names.GOLIATH
}, self.player)
)
)
Expand Down

0 comments on commit 1418cac

Please sign in to comment.