diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 975cd87232..5159f8e7c5 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -103,9 +103,10 @@ public class UnitTypes implements ContentList{ shootSound = Sounds.explosion; bullet = new BombBulletType(2f, 3f, "clear"){{ hitEffect = Fx.pulverize; - lifetime = 2f; + lifetime = 30f; speed = 1.1f; splashDamageRadius = 55f; + instantDisappear = true; splashDamage = 30f; killShooter = true; }}; @@ -126,7 +127,6 @@ public class UnitTypes implements ContentList{ shootSound = Sounds.flame; length = 1f; reload = 14f; - range = 30f; alternate = true; recoil = 1f; ejectEffect = Fx.none; diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 51e74cf383..65a399b121 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -3,8 +3,7 @@ package mindustry.entities.bullet; import arc.audio.*; import arc.math.*; import mindustry.content.*; -import mindustry.ctype.Content; -import mindustry.ctype.ContentType; +import mindustry.ctype.*; import mindustry.entities.*; import mindustry.entities.Effects.*; import mindustry.entities.effect.*; @@ -41,7 +40,9 @@ public abstract class BulletType extends Content{ public float recoil; /** Whether to kill the shooter when this is shot. For suicide bombers. */ public boolean killShooter; - + /** Whether to instantly make the bullet disappear. */ + public boolean instantDisappear; + /** Damage dealt in splash. 0 to disable.*/ public float splashDamage = 0f; /** Knockback in velocity. */ public float knockback; @@ -151,6 +152,10 @@ public abstract class BulletType extends Content{ if(killShooter && b.getOwner() instanceof HealthTrait){ ((HealthTrait)b.getOwner()).kill(); } + + if(instantDisappear){ + b.time(lifetime); + } } public void update(Bullet b){ diff --git a/core/src/mindustry/entities/type/base/GroundUnit.java b/core/src/mindustry/entities/type/base/GroundUnit.java index 56ba404a30..bf400dd24a 100644 --- a/core/src/mindustry/entities/type/base/GroundUnit.java +++ b/core/src/mindustry/entities/type/base/GroundUnit.java @@ -42,7 +42,6 @@ public class GroundUnit extends BaseUnit{ moveToCore(PathTarget.enemyCores); } }else{ - float dst = dst(core); if(dst < getWeapon().bullet.range() / 1.1f){ @@ -170,6 +169,7 @@ public class GroundUnit extends BaseUnit{ if(!Units.invalidateTarget(target, this)){ if(dst(target) < getWeapon().bullet.range()){ + rotate(angleTo(target)); if(Angles.near(angleTo(target), rotation, 13f)){ diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index 7a267abeef..65de453319 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -182,8 +182,11 @@ public class PowerNode extends PowerBlock{ if(tile == other){ if(other.entity.power.links.size == 0){ + int[] total = {0}; getPotentialLinks(tile, link -> { - if(!insulated(tile, link)) tile.configure(link.pos()); + if(!insulated(tile, link) && total[0]++ < maxNodes){ + tile.configure(link.pos()); + } }); }else{ while(entity.power.links.size > 0){