diff --git a/sjplayer/src/sjplayer/CircleElement.d b/sjplayer/src/sjplayer/CircleElement.d index 635b169..dff1243 100644 --- a/sjplayer/src/sjplayer/CircleElement.d +++ b/sjplayer/src/sjplayer/CircleElement.d @@ -27,7 +27,8 @@ class CircleElement : AbstractShapeElement { if (d <= 1) { return DamageCalculationResult(damage, 0); } - return DamageCalculationResult(0, 1 - (d-1).clamp(0, 1)); + const nearness = 1 - (d-1).clamp(0, 1); + return DamageCalculationResult(0, nearness * nearness_coe); } } diff --git a/sjplayer/src/sjplayer/SquareElement.d b/sjplayer/src/sjplayer/SquareElement.d index 2da737e..b712497 100644 --- a/sjplayer/src/sjplayer/SquareElement.d +++ b/sjplayer/src/sjplayer/SquareElement.d @@ -43,7 +43,8 @@ class SquareElement : AbstractShapeElement { if (min_distance == 0) { return DamageCalculationResult(damage, 0); } - return DamageCalculationResult(0, 1-(min_distance-1).clamp(0f, 1f)); + const nearness = 1 - (min_distance-1).clamp(0f, 1f); + return DamageCalculationResult(0, nearness * nearness_coe); } } diff --git a/sjplayer/src/sjplayer/TriangleElement.d b/sjplayer/src/sjplayer/TriangleElement.d index 2fa0016..26dc884 100644 --- a/sjplayer/src/sjplayer/TriangleElement.d +++ b/sjplayer/src/sjplayer/TriangleElement.d @@ -50,7 +50,9 @@ class TriangleElement : AbstractShapeElement { if (min_distance == 0) { return DamageCalculationResult(damage, 0); } - return DamageCalculationResult(0, 1-(min_distance-1).clamp(0f, 1f)); + + const nearness = 1 - (min_distance-1).clamp(0f, 1f); + return DamageCalculationResult(0, nearness * nearness_coe); } }