diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index 528720ad72..e090812c3a 100755 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -153,6 +153,7 @@ namespace OpenRA.Traits Activity MoveTo(CPos cell, int nearEnough); Activity MoveTo(CPos cell, Actor ignoredActor); Activity MoveWithinRange(Target target, WRange range); + CPos NearestMoveableCell(CPos target); } public interface INotifyBlockingMove { void OnNotifyBlockingMove(Actor self, Actor blocking); } diff --git a/OpenRA.Mods.RA/Air/Helicopter.cs b/OpenRA.Mods.RA/Air/Helicopter.cs index b3eaac30a1..be255584c8 100755 --- a/OpenRA.Mods.RA/Air/Helicopter.cs +++ b/OpenRA.Mods.RA/Air/Helicopter.cs @@ -152,5 +152,6 @@ namespace OpenRA.Mods.RA.Air public Activity MoveTo(CPos cell, int nearEnough) { return new HeliFly(cell); } public Activity MoveTo(CPos cell, Actor ignoredActor) { return new HeliFly(cell); } public Activity MoveWithinRange(Target target, WRange range) { return new HeliFly(target.CenterPosition); } + public CPos NearestMoveableCell(CPos cell) { return cell; } } } diff --git a/OpenRA.Mods.RA/Air/Plane.cs b/OpenRA.Mods.RA/Air/Plane.cs index 741ab020b8..f3cd5bb047 100755 --- a/OpenRA.Mods.RA/Air/Plane.cs +++ b/OpenRA.Mods.RA/Air/Plane.cs @@ -92,5 +92,6 @@ namespace OpenRA.Mods.RA.Air public Activity MoveTo(CPos cell, int nearEnough) { return Fly.ToCell(cell); } public Activity MoveTo(CPos cell, Actor ignoredActor) { return Fly.ToCell(cell); } public Activity MoveWithinRange(Target target, WRange range) { return Fly.ToPos(target.CenterPosition); } + public CPos NearestMoveableCell(CPos cell) { return cell; } } } diff --git a/OpenRA.Mods.RA/AttackMove.cs b/OpenRA.Mods.RA/AttackMove.cs index f5b0a23ef7..410a2b0ecf 100644 --- a/OpenRA.Mods.RA/AttackMove.cs +++ b/OpenRA.Mods.RA/AttackMove.cs @@ -17,8 +17,6 @@ namespace OpenRA.Mods.RA { class AttackMoveInfo : ITraitInfo { - public readonly bool JustMove = false; - public object Create(ActorInitializer init) { return new AttackMove(init.self, this); } } @@ -27,13 +25,11 @@ namespace OpenRA.Mods.RA [Sync] public CPos _targetLocation { get { return TargetLocation.HasValue ? TargetLocation.Value : CPos.Zero; } } public CPos? TargetLocation = null; - readonly Mobile mobile; - readonly AttackMoveInfo info; + readonly IMove move; public AttackMove(Actor self, AttackMoveInfo info) { - this.info = info; - mobile = self.Trait(); + move = self.Trait(); } public string VoicePhraseForOrder(Actor self, Order order) @@ -47,7 +43,7 @@ namespace OpenRA.Mods.RA void Activate(Actor self) { self.CancelActivity(); - self.QueueActivity(new AttackMoveActivity(self, mobile.MoveTo(TargetLocation.Value, 1))); + self.QueueActivity(new AttackMoveActivity(self, move.MoveTo(TargetLocation.Value, 1))); self.SetTargetLine(Target.FromCell(TargetLocation.Value), Color.Red); } @@ -63,13 +59,8 @@ namespace OpenRA.Mods.RA if (order.OrderString == "AttackMove") { - if (info.JustMove) - mobile.ResolveOrder(self, new Order("Move", order)); - else - { - TargetLocation = mobile.NearestMoveableCell(order.TargetLocation); - Activate(self); - } + TargetLocation = move.NearestMoveableCell(order.TargetLocation); + Activate(self); } } diff --git a/OpenRA.Mods.RA/Lint/CheckAutotargetWiring.cs b/OpenRA.Mods.RA/Lint/CheckAutotargetWiring.cs deleted file mode 100644 index 6f46c394ed..0000000000 --- a/OpenRA.Mods.RA/Lint/CheckAutotargetWiring.cs +++ /dev/null @@ -1,31 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation. For more information, - * see COPYING. - */ -#endregion - -using System; -using OpenRA.Traits; - -namespace OpenRA.Mods.RA -{ - class CheckAutotargetWiring : ILintPass - { - public void Run(Action emitError, Action emitWarning) - { - foreach( var i in Rules.Info ) - { - if (i.Key.StartsWith("^")) - continue; - var attackMove = i.Value.Traits.GetOrDefault(); - if (attackMove != null && !attackMove.JustMove && - !i.Value.Traits.Contains()) - emitError( "{0} has AttackMove setup without AutoTarget, and will crash when resolving that order.".F(i.Key) ); - } - } - } -} diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 16846cd5d5..f2aeefea5f 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -254,7 +254,6 @@ - diff --git a/OpenRA.Utility/UpgradeRules.cs b/OpenRA.Utility/UpgradeRules.cs index fd1401d6c9..2ffcbe21a4 100644 --- a/OpenRA.Utility/UpgradeRules.cs +++ b/OpenRA.Utility/UpgradeRules.cs @@ -93,6 +93,13 @@ namespace OpenRA.Utility ConvertPxToRange(ref node.Value.Value); } + // AttackMove was generalized to support all moveable actor types + if (engineVersion < 20140116) + { + if (depth == 1 && node.Key == "AttackMove") + node.Value.Nodes.RemoveAll(n => n.Key == "JustMove"); + } + UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1); } } diff --git a/mods/cnc/rules/civilian.yaml b/mods/cnc/rules/civilian.yaml index 456fa5e6c9..dde55a3368 100644 --- a/mods/cnc/rules/civilian.yaml +++ b/mods/cnc/rules/civilian.yaml @@ -455,3 +455,4 @@ VICE: QuantizedFacings: 8 PoisonedByTiberium: Weapon: Heal + diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index eb17f57a35..83ae0418f5 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -209,7 +209,6 @@ ScaredyCat: RenderInfantryPanic: AttackMove: - JustMove: yes CrushableInfantry: ^DINO: diff --git a/mods/cnc/rules/infantry.yaml b/mods/cnc/rules/infantry.yaml index fd7a6d4fce..a091925c0b 100644 --- a/mods/cnc/rules/infantry.yaml +++ b/mods/cnc/rules/infantry.yaml @@ -172,7 +172,6 @@ E6: CaptureTypes: building, husk -AutoTarget: AttackMove: - JustMove: true RenderInfantryProne: IdleAnimations: idle1,idle2 StandAnimations: stand, stand2 diff --git a/mods/cnc/rules/ships.yaml b/mods/cnc/rules/ships.yaml index d3e9e5e5ba..9c4e8508c9 100644 --- a/mods/cnc/rules/ships.yaml +++ b/mods/cnc/rules/ships.yaml @@ -67,6 +67,5 @@ LST: MaxWeight: 5 PipCount: 5 AttackMove: - JustMove: true RejectsOrders: diff --git a/mods/cnc/rules/system-ai.yaml b/mods/cnc/rules/system-ai.yaml index a50da60d97..90ffbafbba 100644 --- a/mods/cnc/rules/system-ai.yaml +++ b/mods/cnc/rules/system-ai.yaml @@ -187,3 +187,4 @@ Player: htnk: 50% orca: 10% SquadSize: 8 + diff --git a/mods/cnc/rules/system-player.yaml b/mods/cnc/rules/system-player.yaml index 6f13cd1668..35137a0f78 100644 --- a/mods/cnc/rules/system-player.yaml +++ b/mods/cnc/rules/system-player.yaml @@ -16,3 +16,4 @@ Player: Shroud: PlayerStatistics: FrozenActorLayer: + diff --git a/mods/cnc/rules/system-world.yaml b/mods/cnc/rules/system-world.yaml index 96fdef0fcf..086e9b959d 100644 --- a/mods/cnc/rules/system-world.yaml +++ b/mods/cnc/rules/system-world.yaml @@ -175,3 +175,4 @@ World: DebugPauseState: ConquestObjectivesPanel: ObjectivesPanel: CONQUEST_OBJECTIVES + diff --git a/mods/cnc/rules/vehicles.yaml b/mods/cnc/rules/vehicles.yaml index 6f8c242486..0ff42a7f72 100644 --- a/mods/cnc/rules/vehicles.yaml +++ b/mods/cnc/rules/vehicles.yaml @@ -28,7 +28,6 @@ MCV: RenderUnit: MustBeDestroyed: AttackMove: - JustMove: true BaseBuilding: LeavesHusk: HuskActor: MCV.Husk @@ -69,7 +68,6 @@ HARV: RevealsShroud: Range: 4 AttackMove: - JustMove: true LeavesHusk: HuskActor: HARV.Husk -GainsExperience: @@ -559,7 +557,6 @@ MHQ: Sequence: spinner Offset: -256,0,256 AttackMove: - JustMove: yes Explodes: Weapon: UnitExplodeSmall EmptyWeapon: UnitExplodeSmall diff --git a/mods/cnc/weapons.yaml b/mods/cnc/weapons.yaml index bb8e997b2f..558ac5bc44 100644 --- a/mods/cnc/weapons.yaml +++ b/mods/cnc/weapons.yaml @@ -1030,4 +1030,5 @@ Claw: Demolish: Warhead: ImpactSound: xplobig6.aud - Explosion: building \ No newline at end of file + Explosion: building + diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index ff2438fca9..54ae72fe02 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -249,3 +249,4 @@ Huntable: LuaScriptEvents: Demolishable: + diff --git a/mods/d2k/rules/infantry.yaml b/mods/d2k/rules/infantry.yaml index 88efb39574..3bdb08e43d 100644 --- a/mods/d2k/rules/infantry.yaml +++ b/mods/d2k/rules/infantry.yaml @@ -50,7 +50,6 @@ ENGINEER: ExternalCaptures: -AutoTarget: AttackMove: - JustMove: true BAZOOKA: Inherits: ^Infantry @@ -109,5 +108,4 @@ MEDIC: PipType: Blue -AutoTarget: AttackMove: - JustMove: true diff --git a/mods/d2k/rules/ordos.yaml b/mods/d2k/rules/ordos.yaml index 6c4e9ee6c1..328e0583a7 100644 --- a/mods/d2k/rules/ordos.yaml +++ b/mods/d2k/rules/ordos.yaml @@ -294,5 +294,4 @@ SABOTEUR: C4Delay: 45 -AutoTarget: AttackMove: - JustMove: true diff --git a/mods/d2k/rules/system-ai.yaml b/mods/d2k/rules/system-ai.yaml index 2158668fd0..5f604d153c 100644 --- a/mods/d2k/rules/system-ai.yaml +++ b/mods/d2k/rules/system-ai.yaml @@ -303,3 +303,4 @@ Player: combath: 100% combato: 100% SquadSize: 10 + diff --git a/mods/d2k/rules/system-player.yaml b/mods/d2k/rules/system-player.yaml index 82f51dbe78..1c8a8ba9e7 100644 --- a/mods/d2k/rules/system-player.yaml +++ b/mods/d2k/rules/system-player.yaml @@ -51,3 +51,4 @@ Player: FrozenActorLayer: HarvesterAttackNotifier: PlayerStatistics: + diff --git a/mods/d2k/rules/system-world.yaml b/mods/d2k/rules/system-world.yaml index 3cede668a0..f406e4b2ae 100644 --- a/mods/d2k/rules/system-world.yaml +++ b/mods/d2k/rules/system-world.yaml @@ -126,3 +126,4 @@ World: PathFinder: ValidateOrder: DebugPauseState: + diff --git a/mods/ra/maps/Fort-Lonestar/map.yaml b/mods/ra/maps/Fort-Lonestar/map.yaml index d8c62c25eb..2bc23def29 100644 --- a/mods/ra/maps/Fort-Lonestar/map.yaml +++ b/mods/ra/maps/Fort-Lonestar/map.yaml @@ -849,7 +849,6 @@ Rules: Spy: -AutoTarget: AttackMove: - JustMove: true -RenderInfantry: RenderSpy: IdleAnimations: idle1,idle2 diff --git a/mods/ra/maps/bomber-john/map.yaml b/mods/ra/maps/bomber-john/map.yaml index 51d1fa22d0..3d570a79c9 100644 --- a/mods/ra/maps/bomber-john/map.yaml +++ b/mods/ra/maps/bomber-john/map.yaml @@ -833,7 +833,6 @@ Rules: RenderUnit: Image: MNLY AttackMove: - JustMove: true MustBeDestroyed: Transforms: IntoActor: ftur diff --git a/mods/ra/rules/infantry.yaml b/mods/ra/rules/infantry.yaml index 7420322916..29c37f95e2 100644 --- a/mods/ra/rules/infantry.yaml +++ b/mods/ra/rules/infantry.yaml @@ -175,7 +175,6 @@ E6: TakeCover: -AutoTarget: AttackMove: - JustMove: true -RenderInfantry: RenderInfantryProne: IdleAnimations: idle1,idle2 @@ -211,7 +210,6 @@ SPY: Types: Cash, SupportPower, Exploration -AutoTarget: AttackMove: - JustMove: true -RenderInfantry: RenderSpy: IdleAnimations: idle1,idle2 @@ -289,7 +287,6 @@ MEDI: TakeCover: -AutoTarget: AttackMove: - JustMove: true -RenderInfantry: RenderInfantryProne: IdleAnimations: idle1,idle2 @@ -326,7 +323,6 @@ MECH: TakeCover: -AutoTarget: AttackMove: - JustMove: true -RenderInfantry: RenderInfantryProne: IdleAnimations: idle1,idle2 @@ -348,7 +344,6 @@ EINSTEIN: Range: 2 -AutoTarget: AttackMove: - JustMove: true ProximityCaptor: Types: CivilianInfantry -RenderInfantry: @@ -372,7 +367,6 @@ DELPHI: Range: 2 -AutoTarget: AttackMove: - JustMove: true ProximityCaptor: Types: CivilianInfantry -RenderInfantry: @@ -414,7 +408,6 @@ THF: TakeCover: -AutoTarget: AttackMove: - JustMove: true SHOK: Inherits: ^Infantry diff --git a/mods/ra/rules/ships.yaml b/mods/ra/rules/ships.yaml index 3db6a2e1da..880fdab0c2 100644 --- a/mods/ra/rules/ships.yaml +++ b/mods/ra/rules/ships.yaml @@ -226,7 +226,6 @@ LST: IronCurtainable: RepairableNear: AttackMove: - JustMove: true PT: Inherits: ^Ship diff --git a/mods/ra/rules/system-actors.yaml b/mods/ra/rules/system-actors.yaml index fb036a85c4..1a3d492075 100644 --- a/mods/ra/rules/system-actors.yaml +++ b/mods/ra/rules/system-actors.yaml @@ -173,3 +173,4 @@ waypoint: Waypoint: RenderEditorOnly: BodyOrientation: + diff --git a/mods/ra/rules/system-ai.yaml b/mods/ra/rules/system-ai.yaml index d8b9aa5c56..bf46a08b3c 100644 --- a/mods/ra/rules/system-ai.yaml +++ b/mods/ra/rules/system-ai.yaml @@ -477,3 +477,4 @@ Player: arty: 15% harv: 10% SquadSize: 7 + diff --git a/mods/ra/rules/system-player.yaml b/mods/ra/rules/system-player.yaml index baa4819247..79cf0050d8 100644 --- a/mods/ra/rules/system-player.yaml +++ b/mods/ra/rules/system-player.yaml @@ -56,3 +56,4 @@ Player: FrozenActorLayer: BaseAttackNotifier: PlayerStatistics: + diff --git a/mods/ra/rules/system-world.yaml b/mods/ra/rules/system-world.yaml index 2dc2757862..2838fd5d42 100644 --- a/mods/ra/rules/system-world.yaml +++ b/mods/ra/rules/system-world.yaml @@ -164,3 +164,4 @@ World: PathFinder: ValidateOrder: DebugPauseState: + diff --git a/mods/ra/rules/vehicles.yaml b/mods/ra/rules/vehicles.yaml index 222f7873e1..d5746aa46d 100644 --- a/mods/ra/rules/vehicles.yaml +++ b/mods/ra/rules/vehicles.yaml @@ -419,7 +419,6 @@ MNLY.AP: LimitedAmmo: Ammo: 5 AttackMove: - JustMove: true DetectCloaked: Range: 5 RenderDetectionCircle: @@ -453,7 +452,6 @@ MNLY.AT: LimitedAmmo: Ammo: 3 AttackMove: - JustMove: true DetectCloaked: Range: 5 RenderDetectionCircle: @@ -483,7 +481,6 @@ TRUK: SupplyTruck: Payload: 500 AttackMove: - JustMove: yes MGG: Inherits: ^Vehicle @@ -509,7 +506,6 @@ MGG: Offset: -299,0,171 Sequence: spinner AttackMove: - JustMove: yes RevealsShroud: Range: 6 CreatesShroud: @@ -557,7 +553,6 @@ MRJ: Sequence: spinner Offset: -256,0,256 AttackMove: - JustMove: yes Explodes: Weapon: UnitExplodeSmall EmptyWeapon: UnitExplodeSmall @@ -719,7 +714,6 @@ DTRK: Range: 3 RenderUnit: AttackMove: - JustMove: yes Explodes: Weapon: MiniNuke EmptyWeapon: MiniNuke @@ -791,7 +785,6 @@ QTNK: Bounds: 44,38,0,-4 RenderUnit: AttackMove: - JustMove: True Explodes: Weapon: UnitExplodeSmall MadTank: diff --git a/mods/ts/rules/infantry.yaml b/mods/ts/rules/infantry.yaml index fce3436e99..64abf53b7b 100644 --- a/mods/ts/rules/infantry.yaml +++ b/mods/ts/rules/infantry.yaml @@ -166,7 +166,6 @@ ENGINEER: CaptureTypes: building -AutoTarget: AttackMove: - JustMove: true -RenderInfantry: RenderInfantryProne: IdleAnimations: idle1,idle2 @@ -294,7 +293,6 @@ CHAMSPY: Types: Cash, SupportPower, Exploration -AutoTarget: AttackMove: - JustMove: true -RenderInfantry: RenderSpy: IdleAnimations: idle1,idle2 diff --git a/mods/ts/rules/system-actors.yaml b/mods/ts/rules/system-actors.yaml index 19d862dc7c..3420574682 100644 --- a/mods/ts/rules/system-actors.yaml +++ b/mods/ts/rules/system-actors.yaml @@ -7,3 +7,4 @@ waypoint: Waypoint: RenderEditorOnly: BodyOrientation: + diff --git a/mods/ts/rules/system-ai.yaml b/mods/ts/rules/system-ai.yaml index 4653791488..7d864be1ce 100644 --- a/mods/ts/rules/system-ai.yaml +++ b/mods/ts/rules/system-ai.yaml @@ -1 +1,2 @@ Player: + diff --git a/mods/ts/rules/system-player.yaml b/mods/ts/rules/system-player.yaml index 3c87a51d25..addcb00bf6 100644 --- a/mods/ts/rules/system-player.yaml +++ b/mods/ts/rules/system-player.yaml @@ -40,3 +40,4 @@ Player: Shroud: BaseAttackNotifier: PlayerStatistics: + diff --git a/mods/ts/rules/system-world.yaml b/mods/ts/rules/system-world.yaml index f08572fe6c..20b439841f 100644 --- a/mods/ts/rules/system-world.yaml +++ b/mods/ts/rules/system-world.yaml @@ -96,3 +96,4 @@ World: ValidateOrder: DebugPauseState: ScreenShaker: + diff --git a/mods/ts/rules/vehicles.yaml b/mods/ts/rules/vehicles.yaml index 360743a113..6020f5cead 100644 --- a/mods/ts/rules/vehicles.yaml +++ b/mods/ts/rules/vehicles.yaml @@ -94,7 +94,6 @@ HARV: RevealsShroud: Range: 4 AttackMove: - JustMove: yes -GainsExperience: RenderSprites: RenderVoxels: @@ -190,7 +189,6 @@ TRUCKB: SupplyTruck: Payload: 500 AttackMove: - JustMove: yes RenderSprites: RenderVoxels: WithVoxelBody: @@ -215,7 +213,6 @@ LPST: RevealsShroud: Range: 10 AttackMove: - JustMove: yes RenderSprites: RenderVoxels: WithVoxelBody: @@ -246,7 +243,6 @@ ICBM: RevealsShroud: Range: 7 AttackMove: - JustMove: yes RenderSprites: RenderVoxels: WithVoxelBody: @@ -280,7 +276,6 @@ REPAIR: AttackMedic: Cursor: repair AttackMove: - JustMove: true RenderSprites: RenderVoxels: WithVoxelBody: @@ -305,7 +300,6 @@ ART2: RevealsShroud: Range: 9 AttackMove: - JustMove: yes RenderSprites: RenderVoxels: WithVoxelBody: @@ -337,7 +331,6 @@ WEED: RevealsShroud: Range: 4 AttackMove: - JustMove: yes -GainsExperience: RenderSprites: RenderVoxels: @@ -451,7 +444,6 @@ GGHUNT: Range: 7 RenderUnit: AttackMove: - JustMove: yes DemoTruck: Explodes: Weapon: SuicideBomb