diff --git a/CHANGELOG b/CHANGELOG index 42931204e5..53ebf4b0d3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,7 @@ NEW: Added an Extras submenu for miscellaneous game extras. Engineers can now regain control over husks. Husks are now rendered with a black overlay. + Allow force fire to destroy husks. A player's units, and allied units, now move out of the way when blocking production facilities. Added cheat button to grow map resources. Fixed units staying selected and contributing to control groups when becoming cloaked or hidden in fog. diff --git a/OpenRA.Game/Traits/Target.cs b/OpenRA.Game/Traits/Target.cs index ee5879d3bb..ef20a253c5 100644 --- a/OpenRA.Game/Traits/Target.cs +++ b/OpenRA.Game/Traits/Target.cs @@ -85,6 +85,11 @@ namespace OpenRA.Traits return true; } + public bool RequiresForceFire + { + get { return targetable != null && targetable.RequiresForceFire; } + } + // Representative position - see Positions for the full set of targetable positions. public WPos CenterPosition { diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index 9f2faa50ec..28ca5479ca 100755 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -233,6 +233,7 @@ namespace OpenRA.Traits string[] TargetTypes { get; } IEnumerable TargetablePositions(Actor self); bool TargetableBy(Actor self, Actor byActor); + bool RequiresForceFire { get; } } public interface INotifyStanceChanged diff --git a/OpenRA.Mods.RA/Attack/AttackBase.cs b/OpenRA.Mods.RA/Attack/AttackBase.cs index 41df7f8abd..4c8661058d 100644 --- a/OpenRA.Mods.RA/Attack/AttackBase.cs +++ b/OpenRA.Mods.RA/Attack/AttackBase.cs @@ -199,6 +199,9 @@ namespace OpenRA.Mods.RA if (modifiers.HasModifier(TargetModifiers.ForceMove)) return false; + if (target.RequiresForceFire) + return false; + var targetableRelationship = negativeDamage ? Stance.Ally : Stance.Enemy; var owner = target.Type == TargetType.FrozenActor ? target.FrozenActor.Owner : target.Actor.Owner; diff --git a/OpenRA.Mods.RA/TargetableBuilding.cs b/OpenRA.Mods.RA/TargetableBuilding.cs index 6666053472..0a14520987 100755 --- a/OpenRA.Mods.RA/TargetableBuilding.cs +++ b/OpenRA.Mods.RA/TargetableBuilding.cs @@ -18,8 +18,10 @@ namespace OpenRA.Mods.RA public class TargetableBuildingInfo : ITraitInfo, ITargetableInfo, Requires { public readonly string[] TargetTypes = { }; - public string[] GetTargetTypes() { return TargetTypes; } + + public bool RequiresForceFire = false; + public object Create(ActorInitializer init) { return new TargetableBuilding(init.self, this); } } @@ -41,5 +43,7 @@ namespace OpenRA.Mods.RA { return building.OccupiedCells().Select(c => c.First.CenterPosition); } + + public bool RequiresForceFire { get { return info.RequiresForceFire; } } } } diff --git a/OpenRA.Mods.RA/TargetableUnit.cs b/OpenRA.Mods.RA/TargetableUnit.cs index 80b3bde925..a90d4334c4 100755 --- a/OpenRA.Mods.RA/TargetableUnit.cs +++ b/OpenRA.Mods.RA/TargetableUnit.cs @@ -16,8 +16,10 @@ namespace OpenRA.Mods.RA public class TargetableUnitInfo : ITraitInfo, ITargetableInfo { public readonly string[] TargetTypes = { }; - public string[] GetTargetTypes() { return TargetTypes; } + + public bool RequiresForceFire = false; + public virtual object Create(ActorInitializer init) { return new TargetableUnit(init.self, this); } } @@ -46,5 +48,7 @@ namespace OpenRA.Mods.RA { yield return self.CenterPosition; } + + public bool RequiresForceFire { get { return info.RequiresForceFire; } } } } diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index 7c90324797..7c4efb1fdd 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -516,6 +516,9 @@ Burns: Interval: 2 TargetableUnit: + RequiresForceFire: yes + TargetTypes: Ground + AutoTargetIgnore: Capturable: Type: husk AllowAllies: yes @@ -544,6 +547,7 @@ Tooltip: Name: Bridge TargetableBuilding: + RequiresForceFire: yes TargetTypes: Ground, Water BelowUnits: Health: diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index ac1268888e..f33eb7b2f2 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -97,6 +97,9 @@ BodyOrientation: LuaScriptEvents: TargetableUnit: + TargetTypes: Ground + RequiresForceFire: yes + AutoTargetIgnore: Capturable: Type: husk AllowAllies: yes diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index 764d451b28..63f90a4af1 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -432,6 +432,9 @@ Chronoshiftable: LuaScriptEvents: TargetableUnit: + TargetTypes: Ground + RequiresForceFire: yes + AutoTargetIgnore: Capturable: Type: husk AllowAllies: yes @@ -470,6 +473,7 @@ BelowUnits: TargetableBuilding: TargetTypes: Ground, Water + RequiresForceFire: yes Building: Footprint: ____ ____ Dimensions: 4,2