From a0fafdeed4fdbb146987d0f3195c45ba37683652 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 8 Jan 2010 21:54:29 +1300 Subject: [PATCH] added auto activate cap for powers; attached to gps satellite --- OpenRa.Game/GameRules/SupportPowerInfo.cs | 1 + OpenRa.Game/SupportPower.cs | 3 +++ units.ini | 1 + 3 files changed, 5 insertions(+) diff --git a/OpenRa.Game/GameRules/SupportPowerInfo.cs b/OpenRa.Game/GameRules/SupportPowerInfo.cs index 603d68f494..df60930d1f 100644 --- a/OpenRa.Game/GameRules/SupportPowerInfo.cs +++ b/OpenRa.Game/GameRules/SupportPowerInfo.cs @@ -17,5 +17,6 @@ namespace OpenRa.Game.GameRules public readonly int TechLevel = -1; public readonly bool GivenAuto = true; public readonly string Impl = null; + public readonly bool AutoActivate = false; } } diff --git a/OpenRa.Game/SupportPower.cs b/OpenRa.Game/SupportPower.cs index 4e30951c1a..1669fc0459 100644 --- a/OpenRa.Game/SupportPower.cs +++ b/OpenRa.Game/SupportPower.cs @@ -58,6 +58,9 @@ namespace OpenRa.Game { if (RemainingTime > 0) --RemainingTime; } + + if (RemainingTime == 0 && Info.AutoActivate) + Activate(); } public void Activate() diff --git a/units.ini b/units.ini index 720f1383b8..a80d24df82 100644 --- a/units.ini +++ b/units.ini @@ -890,6 +890,7 @@ Prerequisite=ATEK Image=gpssicon TechLevel=12 Impl=NullPower +AutoActivate=yes [InvulnerabilityPower] ; the point of IRON ChargeTime=11