diff --git a/core/src/mindustry/ai/types/FormationAI.java b/core/src/mindustry/ai/types/FormationAI.java index 4201fb3486..e2680b4f2b 100644 --- a/core/src/mindustry/ai/types/FormationAI.java +++ b/core/src/mindustry/ai/types/FormationAI.java @@ -1,5 +1,6 @@ package mindustry.ai.types; +import arc.math.*; import arc.math.geom.*; import arc.util.ArcAnnotate.*; import mindustry.ai.formations.*; @@ -32,6 +33,10 @@ public class FormationAI extends AIController implements FormationMember{ return; } + if(unit.type().canBoost && unit.canPassOn()){ + unit.elevation = Mathf.approachDelta(unit.elevation, 0f, 0.08f); + } + unit.controlWeapons(true, leader.isShooting); // unit.moveAt(Tmp.v1.set(deltaX, deltaY).limit(unit.type().speed)); diff --git a/core/src/mindustry/ai/types/GroundAI.java b/core/src/mindustry/ai/types/GroundAI.java index 25192ca490..88fa3fc51c 100644 --- a/core/src/mindustry/ai/types/GroundAI.java +++ b/core/src/mindustry/ai/types/GroundAI.java @@ -45,7 +45,7 @@ public class GroundAI extends AIController{ } } - if(unit.type().canBoost && !unit.onSolid()){ + if(unit.type().canBoost && unit.canPassOn()){ unit.elevation = Mathf.approachDelta(unit.elevation, 0f, 0.08f); } diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index 45df11b30f..44ea787658 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -157,13 +157,8 @@ public class Damage{ if(!e.checkTarget(hitter.type.collidesAir, hitter.type.collidesGround)) return; e.hitbox(hitrect); - Rect other = hitrect; - other.y -= expand; - other.x -= expand; - other.width += expand * 2; - other.height += expand * 2; - Vec2 vec = Geometry.raycastRect(x, y, x2, y2, other); + Vec2 vec = Geometry.raycastRect(x, y, x2, y2, hitrect.grow(expand * 2)); if(vec != null){ effect.at(vec.x, vec.y); diff --git a/core/src/mindustry/entities/bullet/RailBulletType.java b/core/src/mindustry/entities/bullet/RailBulletType.java index 9d043538b1..8265f35e8b 100644 --- a/core/src/mindustry/entities/bullet/RailBulletType.java +++ b/core/src/mindustry/entities/bullet/RailBulletType.java @@ -43,7 +43,7 @@ public class RailBulletType extends BulletType{ @Override public void update(Bullet b){ - if(b.timer(1, 1f)){ + if(b.timer(1, 0.9f)){ updateEffect.at(b.x, b.y, b.rotation()); } } diff --git a/core/src/mindustry/entities/comp/MechComp.java b/core/src/mindustry/entities/comp/MechComp.java index c76eec4d78..ffbf0ce92c 100644 --- a/core/src/mindustry/entities/comp/MechComp.java +++ b/core/src/mindustry/entities/comp/MechComp.java @@ -26,6 +26,7 @@ abstract class MechComp implements Posc, Flyingc, Hitboxc, Unitc, Mechc, Elevati @Override public void moveAt(Vec2 vector, float acceleration){ if(!vector.isZero()){ + //mark walking state when moving in a controlled manner walked = true; } } diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index 208c41c6ff..f67a06f4ce 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -107,6 +107,13 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I return isGrounded() && !hovering && type.canDrown; } + @Override + @Replace + public boolean canShoot(){ + //cannot shoot while boosting + return !(type.canBoost && isFlying()); + } + @Override public int itemCapacity(){ return type.itemCapacity;