actually make it work (except for napalm)
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Traits.Activities;
|
||||
|
||||
namespace OpenRA.Mods.Cnc
|
||||
{
|
||||
@@ -15,6 +16,14 @@ namespace OpenRA.Mods.Cnc
|
||||
{
|
||||
public AirstrikePower(Actor self, AirstrikePowerInfo info) : base(self, info) { }
|
||||
|
||||
protected override void OnActivate()
|
||||
{
|
||||
Game.controller.orderGenerator = new SelectTarget();
|
||||
Sound.Play(Info.SelectTargetSound);
|
||||
}
|
||||
|
||||
protected override void OnFinishCharging() { Sound.PlayToPlayer(Owner, Info.EndChargeSound); }
|
||||
|
||||
class SelectTarget : IOrderGenerator
|
||||
{
|
||||
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
|
||||
@@ -40,7 +49,20 @@ namespace OpenRA.Mods.Cnc
|
||||
{
|
||||
if (order.OrderString == "Airstrike")
|
||||
{
|
||||
// todo: spawn a10, have it dump napalm all over the target
|
||||
var startPos = Owner.World.ChooseRandomEdgeCell();
|
||||
Owner.World.AddFrameEndTask(w =>
|
||||
{
|
||||
var a = w.CreateActor("a10", startPos, Owner);
|
||||
a.traits.Get<Unit>().Facing = Util.GetFacing(order.TargetLocation - startPos, 0);
|
||||
a.traits.Get<Unit>().Altitude = a.Info.Traits.Get<PlaneInfo>().CruiseAltitude;
|
||||
|
||||
a.CancelActivity();
|
||||
a.QueueActivity(new Fly(order.TargetLocation));
|
||||
self.QueueActivity(new FlyOffMap { Interruptible = false });
|
||||
self.QueueActivity(new RemoveSelf());
|
||||
|
||||
// todo: napalm
|
||||
});
|
||||
|
||||
Game.controller.CancelInputMode();
|
||||
FinishActivate();
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA
|
||||
protected override void OnActivate()
|
||||
{
|
||||
Game.controller.orderGenerator = new SelectTarget();
|
||||
Sound.Play("slcttgt1.aud");
|
||||
Sound.Play(Info.SelectTargetSound);
|
||||
}
|
||||
|
||||
class SelectTarget : IOrderGenerator
|
||||
|
||||
@@ -1,29 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<sequences>
|
||||
|
||||
<!-- Mobile Construction Vehicle -->
|
||||
<unit name="mcv">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
</unit>
|
||||
|
||||
<!-- Tiberium Harvester -->
|
||||
<unit name="harv">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
<sequence name="harvest" start="32" length="4" facings="8" />
|
||||
</unit>
|
||||
|
||||
<!-- Nod Buggy -->
|
||||
<unit name="bggy">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
<sequence name="turret" start="32" facings="32" />
|
||||
<sequence name="muzzle" start="0" length="6" facings="8" src="minigun" />
|
||||
</unit>
|
||||
|
||||
<!-- Nod Supply Aircraft -->
|
||||
<unit name="c17">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
</unit>
|
||||
|
||||
<!-- Transport Helicopter -->
|
||||
<unit name="tran">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
@@ -34,61 +29,51 @@
|
||||
<sequence name="open" start="32" length="4" />
|
||||
<sequence name="unload" start="35" length="1" />
|
||||
</unit>
|
||||
|
||||
<!-- Apache Longbow -->
|
||||
<unit name="heli">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
<sequence name="rotor" start="0" length="4" src="lrotor" />
|
||||
<sequence name="slow-rotor" start="4" length="8" src="lrotor" />
|
||||
</unit>
|
||||
|
||||
<!-- Orca Helicopter -->
|
||||
<unit name="orca">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
<sequence name="damaged-idle" start="32" facings="32" />
|
||||
</unit>
|
||||
|
||||
<!-- Medium Tank -->
|
||||
<unit name="mtnk">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
<sequence name="turret" start="32" facings="32" />
|
||||
</unit>
|
||||
|
||||
<!-- Light Tank -->
|
||||
<unit name="ltnk">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
<sequence name="turret" start="32" facings="32" />
|
||||
</unit>
|
||||
|
||||
<!-- Mammoth Tank -->
|
||||
<unit name="htnk">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
<sequence name="turret" start="32" facings="32" />
|
||||
</unit>
|
||||
|
||||
<!-- Humvee -->
|
||||
<unit name="jeep">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
<sequence name="turret" start="32" facings="32" />
|
||||
<sequence name="muzzle" start="0" length="6" facings="8" src="minigun" />
|
||||
</unit>
|
||||
|
||||
<!-- Attack Bike -->
|
||||
<unit name="bike">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
</unit>
|
||||
|
||||
<!-- Flame Tank -->
|
||||
<unit name="ftnk">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
</unit>
|
||||
|
||||
<!-- Mobile HQ -->
|
||||
<unit name="mhq">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
<sequence name="spinner" start="32" length="32" />
|
||||
</unit>
|
||||
|
||||
<!-- Rocket Launcher -->
|
||||
<unit name="msam">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
@@ -96,7 +81,6 @@
|
||||
<sequence name="turret-2" start="48" facings="16" />
|
||||
<sequence name="turret-3" start="64" facings="32" />
|
||||
</unit>
|
||||
|
||||
<!-- SSM Launcher -->
|
||||
<unit name="mlrs">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
@@ -104,17 +88,14 @@
|
||||
<sequence name="turret-2" start="64" facings="32" />
|
||||
<sequence name="turret-3" start="96" facings="32" />
|
||||
</unit>
|
||||
|
||||
<!-- Stealth Tank -->
|
||||
<unit name="stnk">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
</unit>
|
||||
|
||||
<!-- artillery -->
|
||||
<unit name="arty">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
</unit>
|
||||
|
||||
<!-- apc -->
|
||||
<unit name="apc">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
@@ -122,12 +103,10 @@
|
||||
<sequence name="close" start="32" length="3" />
|
||||
<sequence name="unload" start="32" length="1" />
|
||||
</unit>
|
||||
|
||||
<!-- Hovercraft -->
|
||||
<unit name="lst">
|
||||
<sequence name="idle" start="0" facings="4" />
|
||||
</unit>
|
||||
|
||||
<!-- Gunboat -->
|
||||
<unit name="boat">
|
||||
<sequence name="left" start="0" length="32" />
|
||||
@@ -137,4 +116,7 @@
|
||||
<sequence name="right-damaged" start="128" length="32" />
|
||||
<sequence name="right-critical" start="160" length="32" />
|
||||
</unit>
|
||||
<unit name="a10">
|
||||
<sequence name="idle" start="0" facings="32" />
|
||||
</unit>
|
||||
</sequences>
|
||||
@@ -28,10 +28,10 @@ Player:
|
||||
SelectTargetSound: select1.aud
|
||||
AirstrikePower:
|
||||
Image: a10icnh
|
||||
ChargeTime: 8
|
||||
ChargeTime: .2
|
||||
Description: Airstrike
|
||||
LongDesc: Delivers a load of napalm on your target.
|
||||
Prerequisites: hq
|
||||
Prerequisites: nuke
|
||||
TechLevel: 8
|
||||
EndChargeSound: airredy1.aud
|
||||
|
||||
|
||||
@@ -450,7 +450,6 @@ ORCA:
|
||||
LimitedAmmo:
|
||||
Ammo: 6
|
||||
|
||||
|
||||
C17:
|
||||
ParaDrop:
|
||||
LZRange: 1
|
||||
@@ -467,3 +466,17 @@ C17:
|
||||
Cargo:
|
||||
Passengers: 10
|
||||
-Selectable:
|
||||
|
||||
A10:
|
||||
Inherits: ^Plane
|
||||
Unit:
|
||||
HP: 60
|
||||
Armor: light
|
||||
ROT: 4
|
||||
Sight: 0
|
||||
Speed: 25
|
||||
Plane:
|
||||
RenderUnit:
|
||||
WithShadow:
|
||||
LimitedAmmo:
|
||||
Ammo: 10
|
||||
|
||||
Reference in New Issue
Block a user