added skeleton for cnc airstrike
This commit is contained in:
50
OpenRA.Mods.Cnc/AirstrikePower.cs
Normal file
50
OpenRA.Mods.Cnc/AirstrikePower.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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" />
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user