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.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
using OpenRA.Traits.Activities;
|
||||||
|
|
||||||
namespace OpenRA.Mods.Cnc
|
namespace OpenRA.Mods.Cnc
|
||||||
{
|
{
|
||||||
@@ -15,6 +16,14 @@ namespace OpenRA.Mods.Cnc
|
|||||||
{
|
{
|
||||||
public AirstrikePower(Actor self, AirstrikePowerInfo info) : base(self, info) { }
|
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
|
class SelectTarget : IOrderGenerator
|
||||||
{
|
{
|
||||||
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
|
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
|
||||||
@@ -40,7 +49,20 @@ namespace OpenRA.Mods.Cnc
|
|||||||
{
|
{
|
||||||
if (order.OrderString == "Airstrike")
|
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();
|
Game.controller.CancelInputMode();
|
||||||
FinishActivate();
|
FinishActivate();
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA
|
|||||||
protected override void OnActivate()
|
protected override void OnActivate()
|
||||||
{
|
{
|
||||||
Game.controller.orderGenerator = new SelectTarget();
|
Game.controller.orderGenerator = new SelectTarget();
|
||||||
Sound.Play("slcttgt1.aud");
|
Sound.Play(Info.SelectTargetSound);
|
||||||
}
|
}
|
||||||
|
|
||||||
class SelectTarget : IOrderGenerator
|
class SelectTarget : IOrderGenerator
|
||||||
|
|||||||
@@ -1,140 +1,122 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<sequences>
|
<sequences>
|
||||||
|
<!-- Mobile Construction Vehicle -->
|
||||||
<!-- Mobile Construction Vehicle -->
|
<unit name="mcv">
|
||||||
<unit name="mcv">
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="idle" start="0" facings="32" />
|
</unit>
|
||||||
</unit>
|
<!-- Tiberium Harvester -->
|
||||||
|
<unit name="harv">
|
||||||
<!-- Tiberium Harvester -->
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<unit name="harv">
|
<sequence name="harvest" start="32" length="4" facings="8" />
|
||||||
<sequence name="idle" start="0" facings="32" />
|
</unit>
|
||||||
<sequence name="harvest" start="32" length="4" facings="8" />
|
<!-- Nod Buggy -->
|
||||||
</unit>
|
<unit name="bggy">
|
||||||
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<!-- Nod Buggy -->
|
<sequence name="turret" start="32" facings="32" />
|
||||||
<unit name="bggy">
|
<sequence name="muzzle" start="0" length="6" facings="8" src="minigun" />
|
||||||
<sequence name="idle" start="0" facings="32" />
|
</unit>
|
||||||
<sequence name="turret" start="32" facings="32" />
|
<!-- Nod Supply Aircraft -->
|
||||||
<sequence name="muzzle" start="0" length="6" facings="8" src="minigun" />
|
<unit name="c17">
|
||||||
</unit>
|
<sequence name="idle" start="0" facings="32" />
|
||||||
|
</unit>
|
||||||
<!-- Nod Supply Aircraft -->
|
<!-- Transport Helicopter -->
|
||||||
<unit name="c17">
|
<unit name="tran">
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
</unit>
|
<sequence name="rotor" start="0" length="4" src="lrotor" />
|
||||||
|
<sequence name="rotor2" start="0" length="4" src="rrotor" />
|
||||||
<!-- Transport Helicopter -->
|
<sequence name="slow-rotor" start="4" length="8" src="lrotor" />
|
||||||
<unit name="tran">
|
<sequence name="slow-rotor2" start="4" length="8" src="rrotor" />
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<sequence name="open" start="32" length="4" />
|
||||||
<sequence name="rotor" start="0" length="4" src="lrotor" />
|
<sequence name="unload" start="35" length="1" />
|
||||||
<sequence name="rotor2" start="0" length="4" src="rrotor" />
|
</unit>
|
||||||
<sequence name="slow-rotor" start="4" length="8" src="lrotor" />
|
<!-- Apache Longbow -->
|
||||||
<sequence name="slow-rotor2" start="4" length="8" src="rrotor" />
|
<unit name="heli">
|
||||||
<sequence name="open" start="32" length="4" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="unload" start="35" length="1" />
|
<sequence name="rotor" start="0" length="4" src="lrotor" />
|
||||||
</unit>
|
<sequence name="slow-rotor" start="4" length="8" src="lrotor" />
|
||||||
|
</unit>
|
||||||
<!-- Apache Longbow -->
|
<!-- Orca Helicopter -->
|
||||||
<unit name="heli">
|
<unit name="orca">
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="rotor" start="0" length="4" src="lrotor" />
|
<sequence name="damaged-idle" start="32" facings="32" />
|
||||||
<sequence name="slow-rotor" start="4" length="8" src="lrotor" />
|
</unit>
|
||||||
</unit>
|
<!-- Medium Tank -->
|
||||||
|
<unit name="mtnk">
|
||||||
<!-- Orca Helicopter -->
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<unit name="orca">
|
<sequence name="turret" start="32" facings="32" />
|
||||||
<sequence name="idle" start="0" facings="32" />
|
</unit>
|
||||||
<sequence name="damaged-idle" start="32" facings="32" />
|
<!-- Light Tank -->
|
||||||
</unit>
|
<unit name="ltnk">
|
||||||
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<!-- Medium Tank -->
|
<sequence name="turret" start="32" facings="32" />
|
||||||
<unit name="mtnk">
|
</unit>
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<!-- Mammoth Tank -->
|
||||||
<sequence name="turret" start="32" facings="32" />
|
<unit name="htnk">
|
||||||
</unit>
|
<sequence name="idle" start="0" facings="32" />
|
||||||
|
<sequence name="turret" start="32" facings="32" />
|
||||||
<!-- Light Tank -->
|
</unit>
|
||||||
<unit name="ltnk">
|
<!-- Humvee -->
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<unit name="jeep">
|
||||||
<sequence name="turret" start="32" facings="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
</unit>
|
<sequence name="turret" start="32" facings="32" />
|
||||||
|
<sequence name="muzzle" start="0" length="6" facings="8" src="minigun" />
|
||||||
<!-- Mammoth Tank -->
|
</unit>
|
||||||
<unit name="htnk">
|
<!-- Attack Bike -->
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<unit name="bike">
|
||||||
<sequence name="turret" start="32" facings="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
</unit>
|
</unit>
|
||||||
|
<!-- Flame Tank -->
|
||||||
<!-- Humvee -->
|
<unit name="ftnk">
|
||||||
<unit name="jeep">
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="idle" start="0" facings="32" />
|
</unit>
|
||||||
<sequence name="turret" start="32" facings="32" />
|
<!-- Mobile HQ -->
|
||||||
<sequence name="muzzle" start="0" length="6" facings="8" src="minigun" />
|
<unit name="mhq">
|
||||||
</unit>
|
<sequence name="idle" start="0" facings="32" />
|
||||||
|
<sequence name="spinner" start="32" length="32" />
|
||||||
<!-- Attack Bike -->
|
</unit>
|
||||||
<unit name="bike">
|
<!-- Rocket Launcher -->
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<unit name="msam">
|
||||||
</unit>
|
<sequence name="idle" start="0" facings="32" />
|
||||||
|
<sequence name="turret" start="32" facings="16" />
|
||||||
<!-- Flame Tank -->
|
<sequence name="turret-2" start="48" facings="16" />
|
||||||
<unit name="ftnk">
|
<sequence name="turret-3" start="64" facings="32" />
|
||||||
<sequence name="idle" start="0" facings="32" />
|
</unit>
|
||||||
</unit>
|
<!-- SSM Launcher -->
|
||||||
|
<unit name="mlrs">
|
||||||
<!-- Mobile HQ -->
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<unit name="mhq">
|
<sequence name="turret" start="32" facings="32" />
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<sequence name="turret-2" start="64" facings="32" />
|
||||||
<sequence name="spinner" start="32" length="32" />
|
<sequence name="turret-3" start="96" facings="32" />
|
||||||
</unit>
|
</unit>
|
||||||
|
<!-- Stealth Tank -->
|
||||||
<!-- Rocket Launcher -->
|
<unit name="stnk">
|
||||||
<unit name="msam">
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="idle" start="0" facings="32" />
|
</unit>
|
||||||
<sequence name="turret" start="32" facings="16" />
|
<!-- artillery -->
|
||||||
<sequence name="turret-2" start="48" facings="16" />
|
<unit name="arty">
|
||||||
<sequence name="turret-3" start="64" facings="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
</unit>
|
</unit>
|
||||||
|
<!-- apc -->
|
||||||
<!-- SSM Launcher -->
|
<unit name="apc">
|
||||||
<unit name="mlrs">
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<sequence name="muzzle" start="0" length="6" facings="8" src="minigun" />
|
||||||
<sequence name="turret" start="32" facings="32" />
|
<sequence name="close" start="32" length="3" />
|
||||||
<sequence name="turret-2" start="64" facings="32" />
|
<sequence name="unload" start="32" length="1" />
|
||||||
<sequence name="turret-3" start="96" facings="32" />
|
</unit>
|
||||||
</unit>
|
<!-- Hovercraft -->
|
||||||
|
<unit name="lst">
|
||||||
<!-- Stealth Tank -->
|
<sequence name="idle" start="0" facings="4" />
|
||||||
<unit name="stnk">
|
</unit>
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<!-- Gunboat -->
|
||||||
</unit>
|
<unit name="boat">
|
||||||
|
<sequence name="left" start="0" length="32" />
|
||||||
<!-- artillery -->
|
<sequence name="left-damaged" start="32" length="32" />
|
||||||
<unit name="arty">
|
<sequence name="left-critical" start="64" length="32" />
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<sequence name="right" start="96" length="32" />
|
||||||
</unit>
|
<sequence name="right-damaged" start="128" length="32" />
|
||||||
|
<sequence name="right-critical" start="160" length="32" />
|
||||||
<!-- apc -->
|
</unit>
|
||||||
<unit name="apc">
|
<unit name="a10">
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="muzzle" start="0" length="6" facings="8" src="minigun" />
|
</unit>
|
||||||
<sequence name="close" start="32" length="3" />
|
</sequences>
|
||||||
<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" />
|
|
||||||
<sequence name="left-damaged" start="32" length="32" />
|
|
||||||
<sequence name="left-critical" start="64" length="32" />
|
|
||||||
<sequence name="right" start="96" length="32" />
|
|
||||||
<sequence name="right-damaged" start="128" length="32" />
|
|
||||||
<sequence name="right-critical" start="160" length="32" />
|
|
||||||
</unit>
|
|
||||||
</sequences>
|
|
||||||
@@ -28,10 +28,10 @@ Player:
|
|||||||
SelectTargetSound: select1.aud
|
SelectTargetSound: select1.aud
|
||||||
AirstrikePower:
|
AirstrikePower:
|
||||||
Image: a10icnh
|
Image: a10icnh
|
||||||
ChargeTime: 8
|
ChargeTime: .2
|
||||||
Description: Airstrike
|
Description: Airstrike
|
||||||
LongDesc: Delivers a load of napalm on your target.
|
LongDesc: Delivers a load of napalm on your target.
|
||||||
Prerequisites: hq
|
Prerequisites: nuke
|
||||||
TechLevel: 8
|
TechLevel: 8
|
||||||
EndChargeSound: airredy1.aud
|
EndChargeSound: airredy1.aud
|
||||||
|
|
||||||
|
|||||||
@@ -450,7 +450,6 @@ ORCA:
|
|||||||
LimitedAmmo:
|
LimitedAmmo:
|
||||||
Ammo: 6
|
Ammo: 6
|
||||||
|
|
||||||
|
|
||||||
C17:
|
C17:
|
||||||
ParaDrop:
|
ParaDrop:
|
||||||
LZRange: 1
|
LZRange: 1
|
||||||
@@ -467,3 +466,17 @@ C17:
|
|||||||
Cargo:
|
Cargo:
|
||||||
Passengers: 10
|
Passengers: 10
|
||||||
-Selectable:
|
-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