diff --git a/mods/d2k/maps/atreides-02b/rules.yaml b/mods/d2k/maps/atreides-02b/rules.yaml index 3000ea3039..e4f1468e3f 100644 --- a/mods/d2k/maps/atreides-02b/rules.yaml +++ b/mods/d2k/maps/atreides-02b/rules.yaml @@ -51,4 +51,6 @@ outpostnopower: Inherits: outpost Buildable: Prerequisites: ~disabled - -RequiresPower: + GrantCondition@IDISABLE: + RequiresCondition: powerdown + -GrantConditionOnPowerState@LOWPOWER: diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index b5ef0608c7..4213ce46f3 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -470,9 +470,29 @@ Categories: Defense -CommandBarBlacklist: -^DisabledOverlay: +^DisableOnLowPower: WithColoredOverlay@IDISABLE: RequiresCondition: disabled Palette: disabled - GrantConditionOnDisabled@IDISABLE: + GrantConditionOnPowerState@LOWPOWER: + Condition: lowpower + ValidPowerStates: Low, Critical + GrantCondition@IDISABLE: + RequiresCondition: lowpower Condition: disabled + +^DisableOnLowPowerOrPowerDown: + Inherits: ^DisableOnLowPower + GrantCondition@IDISABLE: + RequiresCondition: lowpower || powerdown + Condition: disabled + CanPowerDown: + PowerupSound: EnablePower + PowerdownSound: DisablePower + PowerdownCondition: powerdown + WithDecoration@POWERDOWN: + Image: poweroff + Sequence: offline + Palette: chrome + RequiresCondition: powerdown + ReferencePoint: Center diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index ac905ec412..599335c24f 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -534,11 +534,7 @@ heavy_factory: outpost: Inherits: ^Building - Inherits@IDISABLE: ^DisabledOverlay - RequiresPower: - CanPowerDown: - PowerupSound: EnablePower - PowerdownSound: DisablePower + Inherits@IDISABLE: ^DisableOnLowPowerOrPowerDown Buildable: Prerequisites: barracks, ~techlevel.medium Queue: Building @@ -589,7 +585,6 @@ outpost: starport: Inherits: ^Building - Inherits@IDISABLE: ^DisabledOverlay Tooltip: Name: Starport Buildable: @@ -764,8 +759,10 @@ medium_gun_turret: large_gun_turret: Inherits: ^Defense - Inherits@IDISABLE: ^DisabledOverlay + Inherits@IDISABLE: ^DisableOnLowPowerOrPowerDown Inherits@AUTOTARGET: ^AutoTargetGround + AttackTurreted: + RequiresCondition: !disabled Buildable: Queue: Building Prerequisites: outpost, upgrade.conyard, ~techlevel.medium @@ -799,10 +796,6 @@ large_gun_turret: Turreted: TurnSpeed: 8 InitialFacing: 128 - RequiresPower: - CanPowerDown: - PowerupSound: EnablePower - PowerdownSound: DisablePower Power: Amount: -60 SelectionDecorations: @@ -1000,7 +993,7 @@ research_centre: palace: Inherits: ^Building - Inherits@IDISABLE: ^DisabledOverlay + Inherits@IDISABLE: ^DisableOnLowPowerOrPowerDown Buildable: Prerequisites: research_centre, ~techlevel.high Queue: Building @@ -1115,10 +1108,6 @@ palace: ExitCell: 0,3 Production: Produces: Palace - CanPowerDown: - PowerupSound: EnablePower - PowerdownSound: DisablePower - RequiresPower: SupportPowerChargeBar: ProvidesPrerequisite@buildingname: