[fix] Fixed an issue that nearness_coe was ignored.
This commit is contained in:
parent
2ad131534f
commit
d3026b1fb7
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user