Reimplement Ion Cannon and cnc nuke. Disable ra shellmap nukes.
This commit is contained in:
@@ -23,31 +23,13 @@ namespace OpenRA.Mods.Cnc
|
||||
class IonCannonPower : SupportPower
|
||||
{
|
||||
public IonCannonPower(Actor self, IonCannonPowerInfo info) : base(self, info) { }
|
||||
/*
|
||||
public void ResolveOrder(Actor self, Order order)
|
||||
public override void Activate(Actor self, Order order)
|
||||
{
|
||||
if (!IsReady) return;
|
||||
|
||||
if (order.OrderString == "IonCannon")
|
||||
{
|
||||
Owner.World.AddFrameEndTask(w =>
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
Sound.Play(Info.LaunchSound, Game.CellSize * order.TargetLocation.ToFloat2());
|
||||
w.Add(new IonCannon(self, w, order.TargetLocation));
|
||||
});
|
||||
|
||||
FinishActivate();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnActivate()
|
||||
{
|
||||
Self.World.OrderGenerator =
|
||||
new GenericSelectTargetWithBuilding<IonControl>(Owner.PlayerActor, "IonCannon", "ability");
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
class IonControlInfo : TraitInfo<IonControl> { }
|
||||
class IonControl { }
|
||||
}
|
||||
|
||||
@@ -52,13 +52,14 @@ namespace OpenRA.Mods.RA
|
||||
}, Actors["pdox"], -1, false);
|
||||
}
|
||||
|
||||
/*
|
||||
if (ticks == 100)
|
||||
Actors["mslo1"].Trait<NukeSilo>().Attack(new int2(98, 52));
|
||||
if (ticks == 140)
|
||||
Actors["mslo2"].Trait<NukeSilo>().Attack(new int2(95, 54));
|
||||
if (ticks == 180)
|
||||
Actors["mslo3"].Trait<NukeSilo>().Attack(new int2(95, 49));
|
||||
|
||||
*/
|
||||
if (ticks == 430)
|
||||
{
|
||||
Actors["mig1"].Trait<AttackPlane>().AttackTarget(Target.FromActor(Actors["greeceweap"]), false, true);
|
||||
|
||||
@@ -18,72 +18,32 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
class NukePowerInfo : SupportPowerInfo
|
||||
{
|
||||
[WeaponReference]
|
||||
public readonly string MissileWeapon = "";
|
||||
public readonly int2 SpawnOffset = int2.Zero;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new NukePower(init.self, this); }
|
||||
}
|
||||
|
||||
class NukePower : SupportPower
|
||||
{
|
||||
public NukePower(Actor self, NukePowerInfo info) : base(self, info) { }
|
||||
/*
|
||||
protected override void OnActivate()
|
||||
public override IOrderGenerator OrderGenerator(string order, SupportPowerManager manager)
|
||||
{
|
||||
Self.World.OrderGenerator =
|
||||
new GenericSelectTargetWithBuilding<NukeSilo>(Owner.PlayerActor, "NuclearMissile", "nuke");
|
||||
Sound.PlayToPlayer(manager.self.Owner, Info.SelectTargetSound);
|
||||
return new SelectGenericPowerTarget(order, manager, "nuke", MouseButton.Left);
|
||||
}
|
||||
|
||||
public void ResolveOrder(Actor self, Order order)
|
||||
public override void Activate(Actor self, Order order)
|
||||
{
|
||||
if (!IsReady) return;
|
||||
|
||||
if (order.OrderString == "NuclearMissile")
|
||||
{
|
||||
var silo = self.World.Queries.OwnedBy[self.Owner]
|
||||
.Where(a => a.HasTrait<NukeSilo>())
|
||||
.FirstOrDefault();
|
||||
if (silo != null)
|
||||
silo.Trait<RenderBuilding>().PlayCustomAnim(silo, "active");
|
||||
|
||||
// Play to everyone but the current player
|
||||
if (Owner != Owner.World.LocalPlayer)
|
||||
if (self.Owner != self.World.LocalPlayer)
|
||||
Sound.Play(Info.LaunchSound);
|
||||
|
||||
silo.Trait<NukeSilo>().Attack(order.TargetLocation);
|
||||
|
||||
FinishActivate();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
// tag trait for the building
|
||||
class NukeSiloInfo : ITraitInfo
|
||||
{
|
||||
[WeaponReference]
|
||||
public readonly string MissileWeapon = "";
|
||||
public readonly int2 SpawnOffset = int2.Zero;
|
||||
|
||||
public object Create(ActorInitializer init) { return new NukeSilo(init.self, this); }
|
||||
}
|
||||
|
||||
class NukeSilo
|
||||
{
|
||||
Actor self;
|
||||
NukeSiloInfo info;
|
||||
|
||||
public NukeSilo(Actor self, NukeSiloInfo info)
|
||||
{
|
||||
this.self = self;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public void Attack(int2 targetLocation)
|
||||
{
|
||||
self.Trait<RenderBuilding>().PlayCustomAnim(self, "active");
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
//FIRE ZE MISSILES
|
||||
w.Add(new NukeLaunch(self, info.MissileWeapon, info.SpawnOffset, targetLocation));
|
||||
w.Add(new NukeLaunch(self, (Info as NukePowerInfo).MissileWeapon, (Info as NukePowerInfo).SpawnOffset, order.TargetLocation));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,15 +33,6 @@ FACT:
|
||||
BuildSpeed: .4
|
||||
LowPowerSlowdown: 3
|
||||
BaseBuilding:
|
||||
AirstrikePower:
|
||||
Image: bombicnh
|
||||
ChargeTime: 10
|
||||
Description: Airstrike
|
||||
LongDesc: Delivers a load of napalm on your target.
|
||||
EndChargeSound: airredy1.aud
|
||||
SelectTargetSound: select1.aud
|
||||
UnitType: a10
|
||||
# AllowMultiple: true
|
||||
|
||||
NUKE:
|
||||
Inherits: ^Building
|
||||
@@ -174,6 +165,7 @@ PYLE:
|
||||
Type: Infantry
|
||||
BuildSpeed: .4
|
||||
LowPowerSlowdown: 3
|
||||
|
||||
HAND:
|
||||
Inherits: ^Building
|
||||
Valued:
|
||||
@@ -207,6 +199,7 @@ HAND:
|
||||
Type: Infantry
|
||||
BuildSpeed: .4
|
||||
LowPowerSlowdown: 3
|
||||
|
||||
AFLD:
|
||||
Inherits: ^Building
|
||||
Valued:
|
||||
@@ -312,6 +305,16 @@ HQ:
|
||||
RenderDetectionCircle:
|
||||
DetectCloaked:
|
||||
Range: 8
|
||||
AirstrikePower:
|
||||
Image: bombicnh
|
||||
# ChargeTime: 240
|
||||
ChargeTime: 10
|
||||
Description: Airstrike
|
||||
LongDesc: Delivers a load of napalm on your target.
|
||||
EndChargeSound: airredy1.aud
|
||||
SelectTargetSound: select1.aud
|
||||
UnitType: a10
|
||||
# AllowMultiple: true
|
||||
|
||||
NUK2:
|
||||
Inherits: ^Building
|
||||
@@ -427,7 +430,16 @@ EYE:
|
||||
RenderDetectionCircle:
|
||||
DetectCloaked:
|
||||
Range: 8
|
||||
IonControl:
|
||||
IonCannonPower:
|
||||
Image: ionicnh
|
||||
# ChargeTime: 180
|
||||
ChargeTime: 10
|
||||
Description: Ion Cannon
|
||||
LongDesc: Discharges the orbital Ion Cannon at your target.
|
||||
BeginChargeSound: ionchrg1.aud
|
||||
EndChargeSound: ionredy1.aud
|
||||
LaunchSound: ion1.aud
|
||||
SelectTargetSound: select1.aud
|
||||
|
||||
TMPL:
|
||||
RequiresPower:
|
||||
@@ -456,7 +468,16 @@ TMPL:
|
||||
RevealsShroud:
|
||||
Range: 6
|
||||
Bib:
|
||||
NukeSilo:
|
||||
NukePower:
|
||||
Image: atomicnh
|
||||
# ChargeTime: 300
|
||||
ChargeTime: 10
|
||||
Description: Atom Bomb
|
||||
LongDesc: Launches a nuclear missile at a target location.
|
||||
BeginChargeSound:
|
||||
EndChargeSound: nukavail.aud
|
||||
SelectTargetSound: select1.aud
|
||||
LaunchSound: nukemisl.aud
|
||||
MissileWeapon: atomic
|
||||
|
||||
OBLI:
|
||||
|
||||
@@ -1,35 +1,6 @@
|
||||
Player:
|
||||
PlaceBuilding:
|
||||
TechTree:
|
||||
# NukePower:
|
||||
# Image: atomicnh
|
||||
# ChargeTime: 5
|
||||
# Description: Atom Bomb
|
||||
# LongDesc: Launches a nuclear missile at a target location.
|
||||
# Prerequisites: TMPL
|
||||
# BeginChargeSound:
|
||||
# EndChargeSound: nukavail.aud
|
||||
# SelectTargetSound: select1.aud
|
||||
# LaunchSound: nukemisl.aud
|
||||
# IonCannonPower:
|
||||
# Image: ionicnh
|
||||
# ChargeTime: 3
|
||||
# Description: Ion Cannon
|
||||
# LongDesc: Discharges the orbital Ion Cannon at your target.
|
||||
# Prerequisites: EYE
|
||||
# BeginChargeSound: ionchrg1.aud
|
||||
# EndChargeSound: ionredy1.aud
|
||||
# LaunchSound: ion1.aud
|
||||
# SelectTargetSound: select1.aud
|
||||
# AirstrikePower:
|
||||
# Image: bombicnh
|
||||
# ChargeTime: 4
|
||||
# Description: Airstrike
|
||||
# LongDesc: Delivers a load of napalm on your target.
|
||||
# Prerequisites: hq
|
||||
# EndChargeSound: airredy1.aud
|
||||
# SelectTargetSound: select1.aud
|
||||
# UnitType: a10
|
||||
SupportPowerManager:
|
||||
ConquestVictoryConditions:
|
||||
PowerManager:
|
||||
|
||||
Reference in New Issue
Block a user