skeleton of SpyPlanePower

This commit is contained in:
Chris Forbes
2010-01-24 13:36:21 +13:00
parent 6b84d102cd
commit a43787d0cb
7 changed files with 79 additions and 10 deletions

View File

@@ -226,6 +226,7 @@
<Compile Include="Traits\LimitedAmmo.cs" />
<Compile Include="Traits\Passenger.cs" />
<Compile Include="Traits\PlaceBuilding.cs" />
<Compile Include="Traits\SpyPlanePower.cs" />
<Compile Include="Traits\SupportPower.cs" />
<Compile Include="Traits\ProvidesRadar.cs" />
<Compile Include="Traits\Repairable.cs" />

View File

@@ -32,7 +32,9 @@ namespace OpenRa.Traits
if (order.OrderString == "ChronosphereFinish")
{
Game.controller.CancelInputMode();
if (self.Owner == self.World.LocalPlayer)
Game.controller.CancelInputMode();
FinishActivate();
Sound.Play("chrono2.aud");

View File

@@ -27,6 +27,9 @@ namespace OpenRa.Traits
Owner.World.AddFrameEndTask(w =>
{
if (Owner == Owner.World.LocalPlayer)
Sound.Play("satlnch1.aud");
w.Add(new SatelliteLaunch(launchSite));
w.Add(new DelayedAction((Info as GpsPowerInfo).RevealDelay * 25,
() => Owner.Shroud.HasGPS = true));

View File

@@ -0,0 +1,58 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OpenRa.Traits
{
class SpyPlanePowerInfo : SupportPowerInfo
{
public override object Create(Actor self) { return new SpyPlanePower(self,this); }
}
class SpyPlanePower : SupportPower, IResolveOrder
{
public SpyPlanePower(Actor self, SpyPlanePowerInfo info) : base(self, info) { }
protected override void OnFinishCharging() { Sound.Play("spypln1.aud"); }
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString == "SpyPlane")
{
FinishActivate();
if (order.Player == Owner.World.LocalPlayer)
Game.controller.CancelInputMode();
// todo: pick a cell p1 on the edge of the map; get the cell p2 at the other end of the line
// through that p1 & the target location;
// todo: spawn a SpyPlane at p1 with activities:
// -- fly to target point
// -- take picture
// -- fly to p2
// -- leave the world
}
}
class SelectTarget : IOrderGenerator
{
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Right)
{
Game.controller.CancelInputMode();
yield break;
}
yield return new Order("SpyPlane", Game.world.LocalPlayer.PlayerActor, xy);
}
public void Tick(World world) {}
public void Render(World world) {}
public Cursor GetCursor(World world, int2 xy, MouseInput mi) { return Cursor.Ability; }
}
}
}

View File

@@ -27,6 +27,13 @@ Player:
Prerequisites: IRON
TechLevel: 12
Duration: .75
SpyPlanePower:
Image: smigicon
ChargeTime: 3
Description: Spy Plane
LongDesc: Reveals an area of the map.
Prerequisites: AFLD
TechLevel: 5
World:
WaterPaletteRotation:

View File

@@ -27,6 +27,13 @@ Player:
Prerequisites: IRON
TechLevel: 12
Duration: .75
SpyPlanePower:
Image: smigicon
ChargeTime: 3
Description: Spy Plane
LongDesc: Reveals an area of the map.
Prerequisites: AFLD
TechLevel: 5
World:
WaterPaletteRotation:

View File

@@ -880,15 +880,6 @@ TechLevel=5
GivenAuto=no
Impl=NullPower
[SpyPlanePower] ; free with first AFLD
ChargeTime=3
TechLevel=5
Description=Spy Plane
LongDesc=Reveals an area of the map.
Prerequisite=AFLD
Image=smigicon
Impl=NullPower
[NukePower] ; the point of MSLO
ChargeTime=13
Description=Atom Bomb