diff --git a/OpenRA.Mods.RA/Activities/CaptureActor.cs b/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs similarity index 88% rename from OpenRA.Mods.RA/Activities/CaptureActor.cs rename to OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs index 77bd9617b1..77c1bd7cf2 100644 --- a/OpenRA.Mods.RA/Activities/CaptureActor.cs +++ b/OpenRA.Mods.RA/Activities/ExternalCaptureActor.cs @@ -16,18 +16,18 @@ using OpenRA.Mods.RA.Buildings; namespace OpenRA.Mods.RA.Activities { - class CaptureActor : Activity + class ExternalCaptureActor : Activity { Target target; - public CaptureActor(Target target) { this.target = target; } + public ExternalCaptureActor(Target target) { this.target = target; } public override Activity Tick(Actor self) { if (target.Type != TargetType.Actor) return NextActivity; - var capturable = target.Actor.Trait(); + var capturable = target.Actor.Trait(); if (IsCanceled || !self.IsInWorld || self.IsDead() || !target.IsValidFor(self)) { @@ -57,7 +57,7 @@ namespace OpenRA.Mods.RA.Activities if (capturable.CaptureProgressTime == capturable.Info.CaptureCompleteTime * 25) { - var capturesInfo = self.Info.Traits.Get(); + var capturesInfo = self.Info.Traits.Get(); self.World.AddFrameEndTask(w => { diff --git a/OpenRA.Mods.RA/Capturable.cs b/OpenRA.Mods.RA/ExternalCapturable.cs similarity index 78% rename from OpenRA.Mods.RA/Capturable.cs rename to OpenRA.Mods.RA/ExternalCapturable.cs index 0c3d2c5745..7eaf10b59c 100644 --- a/OpenRA.Mods.RA/Capturable.cs +++ b/OpenRA.Mods.RA/ExternalCapturable.cs @@ -17,20 +17,20 @@ using OpenRA.Mods.RA.Buildings; namespace OpenRA.Mods.RA { - [Desc("This actor can be captured by a unit with Captures: trait.")] - public class CapturableInfo : ITraitInfo + [Desc("This actor can be captured by a unit with ExternalCaptures: trait.")] + public class ExternalCapturableInfo : ITraitInfo { - [Desc("Type of actor (the Captures: trait defines what Types it can capture).")] + [Desc("Type of actor (the ExternalCaptures: trait defines what Types it can capture).")] public readonly string Type = "building"; public readonly bool AllowAllies = false; public readonly bool AllowNeutral = true; public readonly bool AllowEnemies = true; - [Desc("Seconds it takes to change the owner.", "You might want to add a CapturableBar: trait, too.")] + [Desc("Seconds it takes to change the owner.", "You might want to add a ExternalCapturableBar: trait, too.")] public readonly int CaptureCompleteTime = 15; public bool CanBeTargetedBy(Actor captor, Player owner) { - var c = captor.TraitOrDefault(); + var c = captor.TraitOrDefault(); if (c == null) return false; @@ -50,18 +50,18 @@ namespace OpenRA.Mods.RA return true; } - public object Create(ActorInitializer init) { return new Capturable(init.self, this); } + public object Create(ActorInitializer init) { return new ExternalCapturable(init.self, this); } } - public class Capturable : ITick + public class ExternalCapturable : ITick { [Sync] public int CaptureProgressTime = 0; [Sync] public Actor Captor; private Actor self; - public CapturableInfo Info; + public ExternalCapturableInfo Info; public bool CaptureInProgress { get { return Captor != null; } } - public Capturable(Actor self, CapturableInfo info) + public ExternalCapturable(Actor self, ExternalCapturableInfo info) { this.self = self; Info = info; diff --git a/OpenRA.Mods.RA/CapturableBar.cs b/OpenRA.Mods.RA/ExternalCapturableBar.cs similarity index 63% rename from OpenRA.Mods.RA/CapturableBar.cs rename to OpenRA.Mods.RA/ExternalCapturableBar.cs index 1aaa944f7d..04707a0d96 100644 --- a/OpenRA.Mods.RA/CapturableBar.cs +++ b/OpenRA.Mods.RA/ExternalCapturableBar.cs @@ -15,19 +15,19 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - [Desc("Visualize the remaining CaptureCompleteTime from Capturable: trait.")] - class CapturableBarInfo : ITraitInfo, Requires + [Desc("Visualize the remaining CaptureCompleteTime from ExternalCapturable: trait.")] + class ExternalCapturableBarInfo : ITraitInfo, Requires { - public object Create(ActorInitializer init) { return new CapturableBar(init.self); } + public object Create(ActorInitializer init) { return new ExternalCapturableBar(init.self); } } - class CapturableBar : ISelectionBar + class ExternalCapturableBar : ISelectionBar { - Capturable cap; + ExternalCapturable cap; - public CapturableBar(Actor self) + public ExternalCapturableBar(Actor self) { - this.cap = self.Trait(); + this.cap = self.Trait(); } public float GetValue() diff --git a/OpenRA.Mods.RA/Captures.cs b/OpenRA.Mods.RA/ExternalCaptures.cs similarity index 70% rename from OpenRA.Mods.RA/Captures.cs rename to OpenRA.Mods.RA/ExternalCaptures.cs index 72c6cdc8c2..1aad9fefb2 100644 --- a/OpenRA.Mods.RA/Captures.cs +++ b/OpenRA.Mods.RA/ExternalCaptures.cs @@ -20,22 +20,22 @@ using OpenRA.Traits; namespace OpenRA.Mods.RA { - [Desc("This actor can capture other actors which have the Capturable: trait.")] - class CapturesInfo : ITraitInfo + [Desc("This actor can capture other actors which have the ExternalCapturable: trait.")] + class ExternalCapturesInfo : ITraitInfo { - [Desc("Types of actors that it can capture, as long as the type also exists in the Capturable Type: trait.")] + [Desc("Types of actors that it can capture, as long as the type also exists in the ExternalCapturable Type: trait.")] public readonly string[] CaptureTypes = { "building" }; [Desc("Destroy the unit after capturing.")] public readonly bool ConsumeActor = false; - public object Create(ActorInitializer init) { return new Captures(init.self, this); } + public object Create(ActorInitializer init) { return new ExternalCaptures(init.self, this); } } - class Captures : IIssueOrder, IResolveOrder, IOrderVoice + class ExternalCaptures : IIssueOrder, IResolveOrder, IOrderVoice { - public readonly CapturesInfo Info; + public readonly ExternalCapturesInfo Info; - public Captures(Actor self, CapturesInfo info) + public ExternalCaptures(Actor self, ExternalCapturesInfo info) { Info = info; } @@ -44,13 +44,13 @@ namespace OpenRA.Mods.RA { get { - yield return new CaptureOrderTargeter(); + yield return new ExternalCaptureOrderTargeter(); } } public Order IssueOrder(Actor self, IOrderTargeter order, Target target, bool queued) { - if (order.OrderID != "CaptureActor") + if (order.OrderID != "ExternalCaptureActor") return null; if (target.Type == TargetType.FrozenActor) @@ -76,23 +76,23 @@ namespace OpenRA.Mods.RA if (frozen == null) return false; - var ci = frozen.Info.Traits.GetOrDefault(); + var ci = frozen.Info.Traits.GetOrDefault(); return ci != null && ci.CanBeTargetedBy(self, frozen.Owner); } - var c = order.TargetActor.TraitOrDefault(); + var c = order.TargetActor.TraitOrDefault(); return c != null && !c.CaptureInProgress && c.Info.CanBeTargetedBy(self, order.TargetActor.Owner); } public string VoicePhraseForOrder(Actor self, Order order) { - return order.OrderString == "CaptureActor" && IsValidOrder(self, order) + return order.OrderString == "ExternalCaptureActor" && IsValidOrder(self, order) ? "Attack" : null; } public void ResolveOrder(Actor self, Order order) { - if (order.OrderString != "CaptureActor" || !IsValidOrder(self, order)) + if (order.OrderString != "ExternalCaptureActor" || !IsValidOrder(self, order)) return; var target = self.ResolveFrozenActorOrder(order, Color.Red); @@ -103,17 +103,17 @@ namespace OpenRA.Mods.RA self.CancelActivity(); self.SetTargetLine(target, Color.Red); - self.QueueActivity(new CaptureActor(target)); + self.QueueActivity(new ExternalCaptureActor(target)); } } - class CaptureOrderTargeter : UnitOrderTargeter + class ExternalCaptureOrderTargeter : UnitOrderTargeter { - public CaptureOrderTargeter() : base("CaptureActor", 6, "enter", true, true) { } + public ExternalCaptureOrderTargeter() : base("ExternalCaptureActor", 6, "enter", true, true) { } public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor) { - var c = target.TraitOrDefault(); + var c = target.TraitOrDefault(); var canTargetActor = c != null && !c.CaptureInProgress && c.Info.CanBeTargetedBy(self, target.Owner); cursor = canTargetActor ? "ability" : "move-blocked"; @@ -122,7 +122,7 @@ namespace OpenRA.Mods.RA public override bool CanTargetFrozenActor(Actor self, FrozenActor target, TargetModifiers modifiers, ref string cursor) { - var c = target.Info.Traits.GetOrDefault(); + var c = target.Info.Traits.GetOrDefault(); var canTargetActor = c != null && c.CanBeTargetedBy(self, target.Owner); cursor = canTargetActor ? "ability" : "move-blocked"; diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 5e8643fe0c..29ab12848f 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -87,7 +87,7 @@ - + @@ -174,10 +174,10 @@ - - + + - + @@ -529,7 +529,5 @@ cd "$(SolutionDir)thirdparty/" copy "FuzzyLogicLibrary.dll" "$(SolutionDir)" cd "$(SolutionDir)" - - - + diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index 492fd4f45e..0afb310914 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -208,8 +208,8 @@ SellSounds: BUILD1.WAV Adjacent: 3 GivesBuildableArea: - Capturable: - CapturableBar: + ExternalCapturable: + ExternalCapturableBar: SoundOnDamageTransition: DamagedSound: EXPLSML1.WAV DestroyedSound: EXPLHG1.WAV diff --git a/mods/d2k/rules/infantry.yaml b/mods/d2k/rules/infantry.yaml index fb2ad18e01..171bd9ff02 100644 --- a/mods/d2k/rules/infantry.yaml +++ b/mods/d2k/rules/infantry.yaml @@ -47,7 +47,7 @@ ENGINEER: Passenger: PipType: Yellow EngineerRepair: - Captures: + ExternalCaptures: -AutoTarget: AttackMove: JustMove: true diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index 20ad4f1205..8e891b3eb6 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -640,8 +640,8 @@ SIETCH: Range: 10 -GivesBuildableArea: -Sellable: - -Capturable: - -CapturableBar: + -ExternalCapturable: + -ExternalCapturableBar: STARPORTC: Inherits: ^STARPORT diff --git a/mods/ra/maps/Fort-Lonestar/map.yaml b/mods/ra/maps/Fort-Lonestar/map.yaml index 5c47c7e007..a90523ad52 100644 --- a/mods/ra/maps/Fort-Lonestar/map.yaml +++ b/mods/ra/maps/Fort-Lonestar/map.yaml @@ -529,8 +529,8 @@ Rules: Bib: RevealsShroud: Range: 3 - Capturable: - CapturableBar: + ExternalCapturable: + ExternalCapturableBar: EngineerRepairable: -MustBeDestroyed: CashTrickler: diff --git a/mods/ra/maps/apollo/map.yaml b/mods/ra/maps/apollo/map.yaml index 1ea2d94ae4..5bbe6bae01 100644 --- a/mods/ra/maps/apollo/map.yaml +++ b/mods/ra/maps/apollo/map.yaml @@ -2606,8 +2606,8 @@ Rules: HP: 2000 Armor: Heavy: - Capturable: - CapturableBar: + ExternalCapturable: + ExternalCapturableBar: CashTrickler: Period: 750 Amount: 333 diff --git a/mods/ra/maps/artemis/map.yaml b/mods/ra/maps/artemis/map.yaml index a6f69f7e82..44f27a63ef 100644 --- a/mods/ra/maps/artemis/map.yaml +++ b/mods/ra/maps/artemis/map.yaml @@ -2940,7 +2940,7 @@ Rules: HP: 1500 Armor: Heavy: - Capturable: + ExternalCapturable: CashTrickler: Period: 250 Amount: 50 diff --git a/mods/ra/maps/dionysus/map.yaml b/mods/ra/maps/dionysus/map.yaml index 6cd02b39d0..71f928340b 100644 --- a/mods/ra/maps/dionysus/map.yaml +++ b/mods/ra/maps/dionysus/map.yaml @@ -2157,8 +2157,8 @@ Rules: HP: 2000 Armor: Heavy: - Capturable: - CapturableBar: + ExternalCapturable: + ExternalCapturableBar: CashTrickler: Period: 750 Amount: 333 diff --git a/mods/ra/maps/zeus/map.yaml b/mods/ra/maps/zeus/map.yaml index 7958a6f3f5..80e23c92da 100644 --- a/mods/ra/maps/zeus/map.yaml +++ b/mods/ra/maps/zeus/map.yaml @@ -2588,7 +2588,7 @@ Rules: HP: 2000 Armor: Heavy: - Capturable: + ExternalCapturable: CashTrickler: Period: 750 Amount: 333 diff --git a/mods/ra/rules/civilian.yaml b/mods/ra/rules/civilian.yaml index 4e9c3188ae..7b0c2de1bd 100644 --- a/mods/ra/rules/civilian.yaml +++ b/mods/ra/rules/civilian.yaml @@ -79,8 +79,8 @@ HOSP: Dimensions: 2,2 Health: HP: 1000 - Capturable: - CapturableBar: + ExternalCapturable: + ExternalCapturableBar: EngineerRepairable: SelfHealingTech: Type: InfantryHealing @@ -320,8 +320,8 @@ OILB: HP: 1000 RevealsShroud: Range: 3 - Capturable: - CapturableBar: + ExternalCapturable: + ExternalCapturableBar: EngineerRepairable: -MustBeDestroyed: CashTrickler: diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index 76f90d1f70..5743e46b79 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -222,8 +222,8 @@ TerrainTypes: Clear,Road RequiresBaseProvider: True GivesBuildableArea: - Capturable: - CapturableBar: + ExternalCapturable: + ExternalCapturableBar: SoundOnDamageTransition: DamagedSound: kaboom1.aud DestroyedSound: kaboom22.aud @@ -303,8 +303,8 @@ -AcceptsSupplies: -GivesBuildableArea: -Sellable: - -Capturable: - -CapturableBar: + -ExternalCapturable: + -ExternalCapturableBar: FrozenUnderFog: StartsRevealed: true -GpsDot: diff --git a/mods/ra/rules/infantry.yaml b/mods/ra/rules/infantry.yaml index dd23c051b7..229ad6f081 100644 --- a/mods/ra/rules/infantry.yaml +++ b/mods/ra/rules/infantry.yaml @@ -172,7 +172,7 @@ E6: PipType: Yellow EngineerRepair: RepairsBridges: - Captures: + ExternalCaptures: TakeCover: -AutoTarget: AttackMove: diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml index d4050f8c90..3ef39c5683 100644 --- a/mods/ts/rules/defaults.yaml +++ b/mods/ts/rules/defaults.yaml @@ -11,7 +11,6 @@ TerrainTypes: Clear,Road GivesBuildableArea: Capturable: - CapturableBar: SoundOnDamageTransition: DamagedSound: #TODO DestroyedSound: #TODO