diff --git a/OpenRA.Game/Traits/Health.cs b/OpenRA.Game/Traits/Health.cs index e18596f0b2..7924cd5608 100755 --- a/OpenRA.Game/Traits/Health.cs +++ b/OpenRA.Game/Traits/Health.cs @@ -17,7 +17,8 @@ namespace OpenRA.Traits public class HealthInfo : ITraitInfo, UsesInit { public readonly int HP = 0; - public readonly float Radius = 10; + [Desc("Physical size of the unit used for damage calculations. Impacts within this radius apply full damage")] + public readonly WRange Radius = new WRange(426); public virtual object Create(ActorInitializer init) { return new Health(init, this); } } diff --git a/OpenRA.Mods.RA/Combat.cs b/OpenRA.Mods.RA/Combat.cs index cc620e9923..34166b6f70 100755 --- a/OpenRA.Mods.RA/Combat.cs +++ b/OpenRA.Mods.RA/Combat.cs @@ -192,7 +192,7 @@ namespace OpenRA.Mods.RA var rawDamage = (float)warhead.Damage; if (withFalloff) { - var distance = (int)Math.Max(0, (target.CenterPosition - pos).Length * Game.CellSize / 1024 - healthInfo.Radius); + var distance = Math.Max(0, (target.CenterPosition - pos).Length - healthInfo.Radius.Range) * Game.CellSize / 1024; var falloff = (float)GetDamageFalloff(distance / warhead.Spread); rawDamage = (float)(falloff * rawDamage); } diff --git a/OpenRA.Mods.RA/CombatDebugOverlay.cs b/OpenRA.Mods.RA/CombatDebugOverlay.cs index 10721b1bc8..29d50c0580 100755 --- a/OpenRA.Mods.RA/CombatDebugOverlay.cs +++ b/OpenRA.Mods.RA/CombatDebugOverlay.cs @@ -42,10 +42,7 @@ namespace OpenRA.Mods.RA return; if (health.Value != null) - { - var range = new WRange((int)(health.Value.Info.Radius * 1024 / Game.CellSize)); - wr.DrawRangeCircle(self.CenterPosition, range, Color.Red); - } + wr.DrawRangeCircle(self.CenterPosition, health.Value.Info.Radius, Color.Red); var wlr = Game.Renderer.WorldLineRenderer; var c = Color.White;