mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-14 09:47:24 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@ -20,7 +20,7 @@ public class Wall extends Block{
|
|||||||
public float lightningDamage = 20f;
|
public float lightningDamage = 20f;
|
||||||
public int lightningLength = 17;
|
public int lightningLength = 17;
|
||||||
|
|
||||||
public float maxDamageDeflect = 10f;
|
public float chanceDeflect = 10f;
|
||||||
public boolean flashWhite;
|
public boolean flashWhite;
|
||||||
public boolean deflect;
|
public boolean deflect;
|
||||||
|
|
||||||
@ -97,8 +97,8 @@ public class Wall extends Block{
|
|||||||
|
|
||||||
//deflect bullets if necessary
|
//deflect bullets if necessary
|
||||||
if(deflect){
|
if(deflect){
|
||||||
//doesn't reflect powerful bullets
|
//bullet reflection chance depends on bullet damage
|
||||||
if(bullet.damage() > maxDamageDeflect) return true;
|
if(!Mathf.chance(chanceDeflect/bullet.damage())) return true;
|
||||||
|
|
||||||
//translate bullet back to where it was upon collision
|
//translate bullet back to where it was upon collision
|
||||||
bullet.trns(-bullet.vel.x, -bullet.vel.y);
|
bullet.trns(-bullet.vel.x, -bullet.vel.y);
|
||||||
|
Reference in New Issue
Block a user