Integrated HitShapes
Integrated hit shapes with field loader and warhead calculations.
This commit is contained in:
@@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Warheads
|
||||
continue;
|
||||
|
||||
// If the impact position is within any actor's health radius, we have a direct hit
|
||||
if ((unit.CenterPosition - pos).LengthSquared <= healthInfo.Radius.LengthSquared)
|
||||
if ((unit.CenterPosition - pos).LengthSquared <= healthInfo.Shape.OuterRadius.LengthSquared)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,9 +66,8 @@ namespace OpenRA.Mods.Common.Warheads
|
||||
if (healthInfo == null)
|
||||
continue;
|
||||
|
||||
var localModifiers = damageModifiers;
|
||||
var distance = Math.Max(0, (victim.CenterPosition - pos).Length - healthInfo.Radius.Length);
|
||||
localModifiers = localModifiers.Append(GetDamageFalloff(distance));
|
||||
var distance = healthInfo.Shape.DistanceFromEdge(pos, victim);
|
||||
var localModifiers = damageModifiers.Append(GetDamageFalloff(distance.Length));
|
||||
|
||||
DoImpact(victim, firedBy, localModifiers);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user