Fixed #10639
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 672 B After Width: | Height: | Size: 640 B |
@@ -518,7 +518,7 @@ public class Damage{
|
|||||||
}
|
}
|
||||||
//TODO better velocity displacement
|
//TODO better velocity displacement
|
||||||
float dst = vec.set(unit.x - x, unit.y - y).len();
|
float dst = vec.set(unit.x - x, unit.y - y).len();
|
||||||
unit.vel.add(vec.setLength((1f - dst / radius) * 2f / unit.mass()));
|
unit.vel.add(vec.setLength((radius > 0f ? 1f - dst / radius : 1f) * 2f / unit.mass()));
|
||||||
|
|
||||||
if(complete && damage >= 9999999f && unit.isPlayer()){
|
if(complete && damage >= 9999999f && unit.isPlayer()){
|
||||||
Events.fire(Trigger.exclusionDeath);
|
Events.fire(Trigger.exclusionDeath);
|
||||||
@@ -640,7 +640,7 @@ public class Damage{
|
|||||||
|
|
||||||
private static float calculateDamage(float dist, float radius, float damage){
|
private static float calculateDamage(float dist, float radius, float damage){
|
||||||
float falloff = 0.4f;
|
float falloff = 0.4f;
|
||||||
float scaled = Mathf.lerp(1f - dist / radius, 1f, falloff);
|
float scaled = radius <= 0.00001f ? 1f : Mathf.lerp(1f - dist / radius, 1f, falloff);
|
||||||
return damage * scaled;
|
return damage * scaled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user