From a17dfb820e31878996075ad3aaae18b6e51e484a Mon Sep 17 00:00:00 2001 From: Leonwang4234 <62972692+Leonwang4234@users.noreply.github.com> Date: Thu, 20 Aug 2020 20:30:04 -0700 Subject: [PATCH] Update Wall.java --- core/src/mindustry/world/blocks/defense/Wall.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/world/blocks/defense/Wall.java b/core/src/mindustry/world/blocks/defense/Wall.java index 55b896421d..64f575a254 100644 --- a/core/src/mindustry/world/blocks/defense/Wall.java +++ b/core/src/mindustry/world/blocks/defense/Wall.java @@ -20,7 +20,7 @@ public class Wall extends Block{ public float lightningDamage = 20f; public int lightningLength = 17; - public float maxDamageDeflect = 10f; + public float chanceDeflect = 10f; public boolean flashWhite; public boolean deflect; @@ -97,8 +97,8 @@ public class Wall extends Block{ //deflect bullets if necessary if(deflect){ - //doesn't reflect powerful bullets - if(bullet.damage() > maxDamageDeflect) return true; + //bullet reflection chance depends on bullet damage + if(!Mathf.chance(chanceDeflect/bullet.damage())) return true; //translate bullet back to where it was upon collision bullet.trns(-bullet.vel.x, -bullet.vel.y);