Files
OpenRA/OpenRa.Game/SupportPowers/GpsSatellite.cs
2010-01-08 22:28:27 +13:00

29 lines
636 B
C#

using System.Linq;
using OpenRa.Game.Effects;
using OpenRa.Game.Traits;
namespace OpenRa.Game.SupportPowers
{
class GpsSatellite : ISupportPowerImpl
{
const int revealDelay = 30 * 25;
public void Activate(SupportPower p)
{
var launchSite = Game.world.Actors
.FirstOrDefault( a => a.Owner == p.Owner && a.traits.Contains<GpsLaunchSite>() );
if (launchSite == null)
return;
Game.world.AddFrameEndTask(w =>
{
w.Add(new SatelliteLaunch(launchSite));
w.Add(new DelayedAction(revealDelay, () => p.Owner.Shroud.HasGPS = true));
});
p.FinishActivate();
}
}
}