Misc RTS AI intelligence fixes

This commit is contained in:
Anuken
2022-10-21 18:29:29 -04:00
parent 46e5f55e9c
commit 7331704a13
6 changed files with 24 additions and 14 deletions
@@ -77,7 +77,6 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
rotateMove(movement);
}
}
public void moveAt(Vec2 vector){
moveAt(vector, type.accel);
}
@@ -85,7 +84,6 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
public void approach(Vec2 vector){
vel.approachDelta(vector, type.accel * speed());
}
public void rotateMove(Vec2 vec){
moveAt(Tmp.v2.trns(rotation, vec.len()));
@@ -104,6 +102,11 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
lookAt(x, y);
}
public boolean isPathImpassable(int tileX, int tileY){
return !type.flying && type.pathCost.getCost(team.id, pathfinder.get(tileX, tileY)) == -1;
}
/** @return approx. square size of the physical hitbox for physics */
public float physicSize(){
return hitSize * 0.7f;