diff --git a/OpenRA.Mods.Cnc/IonCannonPower.cs b/OpenRA.Mods.Cnc/IonCannonPower.cs index cd285fb857..df9f702c0c 100644 --- a/OpenRA.Mods.Cnc/IonCannonPower.cs +++ b/OpenRA.Mods.Cnc/IonCannonPower.cs @@ -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") + self.World.AddFrameEndTask(w => { - Owner.World.AddFrameEndTask(w => - { - Sound.Play(Info.LaunchSound, Game.CellSize * order.TargetLocation.ToFloat2()); - w.Add(new IonCannon(self, w, order.TargetLocation)); - }); - - FinishActivate(); - } + Sound.Play(Info.LaunchSound, Game.CellSize * order.TargetLocation.ToFloat2()); + w.Add(new IonCannon(self, w, order.TargetLocation)); + }); } - - protected override void OnActivate() - { - Self.World.OrderGenerator = - new GenericSelectTargetWithBuilding(Owner.PlayerActor, "IonCannon", "ability"); - } -*/ } - - class IonControlInfo : TraitInfo { } - class IonControl { } } diff --git a/OpenRA.Mods.RA/DefaultShellmapScript.cs b/OpenRA.Mods.RA/DefaultShellmapScript.cs index ab9d6be428..1686870d1e 100755 --- a/OpenRA.Mods.RA/DefaultShellmapScript.cs +++ b/OpenRA.Mods.RA/DefaultShellmapScript.cs @@ -51,14 +51,15 @@ namespace OpenRA.Mods.RA Pair.New(Actors["ca2"], new int2(92, 71)) }, Actors["pdox"], -1, false); } - + + /* if (ticks == 100) Actors["mslo1"].Trait().Attack(new int2(98, 52)); if (ticks == 140) Actors["mslo2"].Trait().Attack(new int2(95, 54)); if (ticks == 180) Actors["mslo3"].Trait().Attack(new int2(95, 49)); - + */ if (ticks == 430) { Actors["mig1"].Trait().AttackTarget(Target.FromActor(Actors["greeceweap"]), false, true); diff --git a/OpenRA.Mods.RA/SupportPowers/NukePower.cs b/OpenRA.Mods.RA/SupportPowers/NukePower.cs index e163024f8e..91eeefcc15 100755 --- a/OpenRA.Mods.RA/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/NukePower.cs @@ -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(Owner.PlayerActor, "NuclearMissile", "nuke"); - } - - public void ResolveOrder(Actor self, Order order) - { - if (!IsReady) return; - - if (order.OrderString == "NuclearMissile") - { - var silo = self.World.Queries.OwnedBy[self.Owner] - .Where(a => a.HasTrait()) - .FirstOrDefault(); - if (silo != null) - silo.Trait().PlayCustomAnim(silo, "active"); - - // Play to everyone but the current player - if (Owner != Owner.World.LocalPlayer) - Sound.Play(Info.LaunchSound); - - silo.Trait().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; + Sound.PlayToPlayer(manager.self.Owner, Info.SelectTargetSound); + return new SelectGenericPowerTarget(order, manager, "nuke", MouseButton.Left); } - public void Attack(int2 targetLocation) + public override void Activate(Actor self, Order order) { - self.Trait().PlayCustomAnim(self, "active"); + // Play to everyone but the current player + if (self.Owner != self.World.LocalPlayer) + Sound.Play(Info.LaunchSound); + self.Trait().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)); }); } } diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index bfeaae76ae..6444408a03 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -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: diff --git a/mods/cnc/rules/system.yaml b/mods/cnc/rules/system.yaml index 8ef0237455..3f06fb0d77 100644 --- a/mods/cnc/rules/system.yaml +++ b/mods/cnc/rules/system.yaml @@ -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: