Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features

This commit is contained in:
Anuken
2021-09-20 09:19:16 -04:00
11 changed files with 32 additions and 14 deletions

View File

@@ -32,7 +32,7 @@ public class ShieldRegenFieldAbility extends Ability{
Units.nearby(unit.team, unit.x, unit.y, range, other -> {
if(other.shield < max){
other.shield = Math.max(other.shield + amount, max);
other.shield = Math.min(other.shield + amount, max);
other.shieldAlpha = 1f; //TODO may not be necessary
applyEffect.at(unit.x, unit.y, 0f, unit.team.color, parentizeEffects ? other : null);
applied = true;

View File

@@ -199,7 +199,7 @@ public class BulletType extends Content implements Cloneable{
/** Returns maximum distance the bullet this bullet type has can travel. */
public float range(){
return Math.max(speed * lifetime * (1f - drag), maxRange);
return Mathf.zero(drag) ? speed * lifetime : Math.max(speed * (1f - Mathf.pow(1f - drag, lifetime)) / drag, maxRange);
}
/** @return continuous damage in damage/sec, or -1 if not continuous. */

View File

@@ -45,11 +45,6 @@ public class LiquidBulletType extends BulletType{
this(null);
}
@Override
public float range(){
return speed * lifetime / 2f;
}
@Override
public void update(Bullet b){
super.update(b);