diff --git a/OpenRA.Mods.RA/Activities/LegacyCaptureActor.cs b/OpenRA.Mods.RA/Activities/LegacyCaptureActor.cs index 062de5daaf..cd1507ac8f 100644 --- a/OpenRA.Mods.RA/Activities/LegacyCaptureActor.cs +++ b/OpenRA.Mods.RA/Activities/LegacyCaptureActor.cs @@ -46,10 +46,10 @@ namespace OpenRA.Mods.RA.Activities target.Actor.ChangeOwner(self.Owner); - foreach (var t in self.TraitsImplementing()) + foreach (var t in target.Actor.TraitsImplementing()) t.OnCapture(target.Actor, self, oldOwner, self.Owner); - foreach (var t in self.World.ActorsWithTrait()) + foreach (var t in target.Actor.World.ActorsWithTrait()) t.Trait.OnActorCaptured(t.Actor, target.Actor, self, oldOwner, self.Owner); if (b != null && b.Locked) @@ -57,7 +57,7 @@ namespace OpenRA.Mods.RA.Activities } else { - int damage = (int)(health.MaxHP * capturesInfo.SabotageHPRemoval); + var damage = (int)(health.MaxHP * capturesInfo.SabotageHPRemoval); target.Actor.InflictDamage(self, damage, null); } diff --git a/OpenRA.Mods.RA/LegacyCapturable.cs b/OpenRA.Mods.RA/LegacyCapturable.cs index f02e05959f..639dbddbb4 100644 --- a/OpenRA.Mods.RA/LegacyCapturable.cs +++ b/OpenRA.Mods.RA/LegacyCapturable.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA public readonly bool AllowNeutral = true; public readonly bool AllowEnemies = true; [Desc("Health percentage the target must be at (or below) before it can be captured.")] - public readonly double CaptureThreshold = 0.5; + public readonly float CaptureThreshold = 0.5f; public object Create(ActorInitializer init) { return new LegacyCapturable(init.self, this); } } diff --git a/OpenRA.Mods.RA/LegacyCaptures.cs b/OpenRA.Mods.RA/LegacyCaptures.cs index 4c61695556..32a0602bc4 100644 --- a/OpenRA.Mods.RA/LegacyCaptures.cs +++ b/OpenRA.Mods.RA/LegacyCaptures.cs @@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA [Desc("Unit will do damage to the actor instead of capturing it. Unit is destroyed when sabotaging.")] public readonly bool Sabotage = true; [Desc("Only used if Sabotage=true. Sabotage damage expressed as a percentage of enemy health removed.")] - public readonly double SabotageHPRemoval = 0.5; + public readonly float SabotageHPRemoval = 0.5f; public object Create(ActorInitializer init) { return new LegacyCaptures(init.self, this); } } diff --git a/mods/ra/rules/civilian.yaml b/mods/ra/rules/civilian.yaml index 216b662439..52ca469ab0 100644 --- a/mods/ra/rules/civilian.yaml +++ b/mods/ra/rules/civilian.yaml @@ -92,7 +92,8 @@ V01: IntoActor: v01.sniper SkipMakeAnims: true LegacyCapturable: - Type: civilianbuilding + Type: CivilianBuilding + CaptureThreshold: 1 EditorTilesetFilter: ExcludeTilesets: DESERT diff --git a/mods/ra/rules/infantry.yaml b/mods/ra/rules/infantry.yaml index a6c5adfc36..b54d50ecfa 100644 --- a/mods/ra/rules/infantry.yaml +++ b/mods/ra/rules/infantry.yaml @@ -480,6 +480,7 @@ SNIPER: CloakSound: UncloakSound: UncloakOnMove: yes - Captures: - CaptureTypes: civilianbuilding - AllowAllies: true + LegacyCaptures: + CaptureTypes: CivilianBuilding + Sabotage: no + SabotageHPRemoval: 0