Small bugfixes

This commit is contained in:
Anuken
2020-09-22 17:59:37 -04:00
parent f3e08f9cb6
commit 4a02315ee5
6 changed files with 16 additions and 8 deletions

View File

@@ -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));

View File

@@ -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);
}

View File

@@ -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);

View File

@@ -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());
}
}

View File

@@ -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;
}
}

View File

@@ -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;