This commit is contained in:
Chris Forbes
2010-01-09 11:05:00 +13:00
13 changed files with 107 additions and 20 deletions

View File

@@ -11,5 +11,9 @@ namespace OpenRa.Game.SupportPowers
if (Game.controller.ToggleInputMode<ChronosphereSelectOrderGenerator>())
Sound.Play("slcttgt1.aud");
}
public void OnFireNotification(Actor target, int2 xy) {}
public void IsChargingNotification(SupportPower p) {}
public void IsReadyNotification(SupportPower p) {}
}
}

View File

@@ -6,8 +6,16 @@ namespace OpenRa.Game.SupportPowers
{
class GpsSatellite : ISupportPowerImpl
{
const int revealDelay = 30 * 25;
const int revealDelay = 15 * 25;
public void OnFireNotification(Actor a, int2 xy) { }
public void IsChargingNotification(SupportPower p) { }
public void IsReadyNotification(SupportPower p)
{
// Power is auto-activated
Activate(p);
}
public void Activate(SupportPower p)
{
var launchSite = Game.world.Actors

View File

@@ -8,5 +8,8 @@ namespace OpenRa.Game.SupportPowers
interface ISupportPowerImpl
{
void Activate(SupportPower p);
void OnFireNotification(Actor target, int2 xy);
void IsChargingNotification(SupportPower p);
void IsReadyNotification(SupportPower p);
}
}

View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRa.Game.Orders;
using OpenRa.Game.Traits;
namespace OpenRa.Game.SupportPowers
{
class IronCurtainPower : ISupportPowerImpl
{
public void IsReadyNotification(SupportPower p)
{
Sound.Play("ironrdy1.aud");
}
public void IsChargingNotification(SupportPower p)
{
Sound.Play("ironchg1.aud");
}
public void OnFireNotification(Actor target, int2 xy)
{
p.FinishActivate();
Game.controller.CancelInputMode();
Sound.Play("ironcur9.aud");
// Play active anim
var ironCurtain = Game.world.Actors
.Where(a => a.Owner == p.Owner && a.traits.Contains<IronCurtain>())
.FirstOrDefault();
if (ironCurtain != null)
ironCurtain.traits.Get<RenderBuilding>().PlayCustomAnim(ironCurtain, "active");
}
SupportPower p;
public void Activate(SupportPower p)
{
this.p = p;
// Pick a building to use
Game.controller.orderGenerator = new IronCurtainOrderGenerator(this);
Sound.Play("slcttgt1.aud");
}
}
}

View File

@@ -7,6 +7,9 @@ namespace OpenRa.Game.SupportPowers
{
class NullPower : ISupportPowerImpl
{
public void OnFireNotification(Actor a, int2 xy) { }
public void IsReadyNotification(SupportPower p) { }
public void IsChargingNotification(SupportPower p) { }
public void Activate(SupportPower p)
{
// if this was a real power, i'd do something here!