diff --git a/OpenRA.Mods.RA/Activities/Repair.cs b/OpenRA.Mods.RA/Activities/Repair.cs index 858efc447a..f1157fb10e 100644 --- a/OpenRA.Mods.RA/Activities/Repair.cs +++ b/OpenRA.Mods.RA/Activities/Repair.cs @@ -33,10 +33,8 @@ namespace OpenRA.Mods.RA.Activities var repairsUnits = host.Info.Traits.Get(); var unitCost = self.Info.Traits.Get().Cost; - var hpToRepair = Math.Min(host.Info.Traits.Get().URepairStep, health.MaxHP - health.HP); - var costPerHp = (repairsUnits.URepairPercent * unitCost) / health.MaxHP; - var fullRepairCost = (int)(repairsUnits.URepairPercent * unitCost); - var cost = fullRepairCost * hpToRepair / health.MaxHP; + var hpToRepair = Math.Min(repairsUnits.HpPerStep, health.MaxHP - health.HP); + var cost = (hpToRepair * unitCost * repairsUnits.ValuePercentage) / (health.MaxHP * 100); if (!self.Owner.PlayerActor.Trait().TakeCash(cost)) { diff --git a/OpenRA.Mods.RA/RepairsUnits.cs b/OpenRA.Mods.RA/RepairsUnits.cs index 8fb17da68c..b59538de59 100644 --- a/OpenRA.Mods.RA/RepairsUnits.cs +++ b/OpenRA.Mods.RA/RepairsUnits.cs @@ -14,9 +14,9 @@ namespace OpenRA.Mods.RA { public class RepairsUnitsInfo : TraitInfo { - public readonly float URepairPercent = 0.2f; - public readonly int URepairStep = 10; - public readonly int Interval = 24; + public readonly int ValuePercentage = 20; // charge 20% of the unit value to fully repair + public readonly int HpPerStep = 10; + public readonly int Interval = 24; // Ticks } public class RepairsUnits { }