This commit is contained in:
Anuken
2021-02-24 09:52:53 -05:00
parent befda9baaa
commit afbde49fa2
5 changed files with 9 additions and 4 deletions

View File

@@ -13,7 +13,7 @@ public class FlyingAI extends AIController{
public void updateMovement(){ public void updateMovement(){
if(target != null && unit.hasWeapons() && command() == UnitCommand.attack){ if(target != null && unit.hasWeapons() && command() == UnitCommand.attack){
if(!unit.type.circleTarget){ if(!unit.type.circleTarget){
moveTo(target, unit.range() * 0.8f); moveTo(target, unit.type.range * 0.8f);
unit.lookAt(target); unit.lookAt(target);
}else{ }else{
attack(120f); attack(120f);

View File

@@ -1339,6 +1339,7 @@ abstract class BuildingComp implements Posc, Teamc, Healthc, Buildingc, Timerc,
case enabled -> enabled ? 1 : 0; case enabled -> enabled ? 1 : 0;
case controlled -> this instanceof ControlBlock c && c.isControlled() ? 2 : 0; case controlled -> this instanceof ControlBlock c && c.isControlled() ? 2 : 0;
case payloadCount -> getPayload() != null ? 1 : 0; case payloadCount -> getPayload() != null ? 1 : 0;
case size -> block.size;
default -> Float.NaN; //gets converted to null in logic default -> Float.NaN; //gets converted to null in logic
}; };
} }

View File

@@ -142,6 +142,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
case controlled -> controller instanceof LogicAI ? 1 : controller instanceof Player ? 2 : controller instanceof FormationAI ? 3 : 0; case controlled -> controller instanceof LogicAI ? 1 : controller instanceof Player ? 2 : controller instanceof FormationAI ? 3 : 0;
case commanded -> controller instanceof FormationAI ? 1 : 0; case commanded -> controller instanceof FormationAI ? 1 : 0;
case payloadCount -> self() instanceof Payloadc pay ? pay.payloads().size : 0; case payloadCount -> self() instanceof Payloadc pay ? pay.payloads().size : 0;
case size -> hitSize / tilesize;
default -> Float.NaN; default -> Float.NaN;
}; };
} }

View File

@@ -27,6 +27,7 @@ public enum LAccess{
y, y,
shootX, shootX,
shootY, shootY,
size,
dead, dead,
range, range,
shooting, shooting,

View File

@@ -172,9 +172,11 @@ public class ItemBridge extends Block{
public void playerPlaced(Object config){ public void playerPlaced(Object config){
super.playerPlaced(config); super.playerPlaced(config);
Tile link = findLink(tile.x, tile.y); if(config == null){
if(linkValid(tile, link) && !proximity.contains(link.build)){ Tile link = findLink(tile.x, tile.y);
link.build.configure(tile.pos()); if(linkValid(tile, link) && !proximity.contains(link.build)){
link.build.configure(tile.pos());
}
} }
lastBuild = this; lastBuild = this;