Iron curtain power implementation; Remove AutoActivate attribute to be part of the GPS implementation
This commit is contained in:
@@ -37,7 +37,9 @@ namespace OpenRa.Game
|
||||
public bool IsDone { get { return RemainingTime == 0; } }
|
||||
public int RemainingTime { get; private set; }
|
||||
public int TotalTime { get; private set; }
|
||||
|
||||
bool notifiedReady = false;
|
||||
bool notifiedCharging = false;
|
||||
|
||||
public void Tick()
|
||||
{
|
||||
if (Info.OneShot && IsUsed)
|
||||
@@ -59,10 +61,20 @@ namespace OpenRa.Game
|
||||
if (IsAvailable && (!Info.Powered || Owner.GetPowerState() == PowerState.Normal))
|
||||
{
|
||||
if (RemainingTime > 0) --RemainingTime;
|
||||
if (!notifiedCharging)
|
||||
{
|
||||
Impl.IsChargingNotification(this);
|
||||
notifiedCharging = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (RemainingTime == 0 && Info.AutoActivate)
|
||||
Activate();
|
||||
if (RemainingTime == 0
|
||||
&& Impl != null
|
||||
&& !notifiedReady)
|
||||
{
|
||||
Impl.IsReadyNotification(this);
|
||||
notifiedReady = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void Activate()
|
||||
@@ -79,6 +91,8 @@ namespace OpenRa.Game
|
||||
IsAvailable = false;
|
||||
}
|
||||
RemainingTime = TotalTime;
|
||||
notifiedReady = false;
|
||||
notifiedCharging = false;
|
||||
}
|
||||
|
||||
public void Give(bool requireCharge) // called by crate/spy/etc code
|
||||
|
||||
Reference in New Issue
Block a user