added skeleton for cnc airstrike

This commit is contained in:
Chris Forbes
2010-04-09 22:07:49 +12:00
parent 982c9518ac
commit b01ce10a8e
3 changed files with 58 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenRA.Traits;
namespace OpenRA.Mods.Cnc
{
class AirstrikePowerInfo : SupportPowerInfo
{
public override object Create(Actor self) { return new AirstrikePower(self, this); }
}
class AirstrikePower : SupportPower, IResolveOrder
{
public AirstrikePower(Actor self, AirstrikePowerInfo info) : base(self, info) { }
class SelectTarget : IOrderGenerator
{
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Right)
Game.controller.CancelInputMode();
return OrderInner(world, xy, mi);
}
IEnumerable<Order> OrderInner(World world, int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Left)
yield return new Order("Airstrike", world.LocalPlayer.PlayerActor, xy);
}
public void Tick(World world) { }
public void Render(World world) { }
public string GetCursor(World world, int2 xy, MouseInput mi) { return "ability"; }
}
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString == "Airstrike")
{
// todo: spawn a10, have it dump napalm all over the target
Game.controller.CancelInputMode();
FinishActivate();
}
}
}
}

View File

@@ -45,6 +45,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="AirstrikePower.cs" />
<Compile Include="CriticalBuildingState.cs" />
<Compile Include="Effects\IonCannon.cs" />
<Compile Include="IonCannonPower.cs" />

View File

@@ -26,6 +26,13 @@ Player:
EndChargeSound: ionredy1.aud
LaunchSound: ion1.aud
SelectTargetSound: select1.aud
AirstrikePower:
Image: a10icnh
ChargeTime: 8
Description: Delivers a load of napalm on your target.
Prerequisites: hq
TechLevel: 8
EndChargeSound: airredy1.aud
World:
GlobalDefaults: