@@ -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);
|
||||||
|
|||||||
@@ -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
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public enum LAccess{
|
|||||||
y,
|
y,
|
||||||
shootX,
|
shootX,
|
||||||
shootY,
|
shootY,
|
||||||
|
size,
|
||||||
dead,
|
dead,
|
||||||
range,
|
range,
|
||||||
shooting,
|
shooting,
|
||||||
|
|||||||
@@ -172,10 +172,12 @@ public class ItemBridge extends Block{
|
|||||||
public void playerPlaced(Object config){
|
public void playerPlaced(Object config){
|
||||||
super.playerPlaced(config);
|
super.playerPlaced(config);
|
||||||
|
|
||||||
|
if(config == null){
|
||||||
Tile link = findLink(tile.x, tile.y);
|
Tile link = findLink(tile.x, tile.y);
|
||||||
if(linkValid(tile, link) && !proximity.contains(link.build)){
|
if(linkValid(tile, link) && !proximity.contains(link.build)){
|
||||||
link.build.configure(tile.pos());
|
link.build.configure(tile.pos());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
lastBuild = this;
|
lastBuild = this;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user