Cleanup
This commit is contained in:
@@ -100,7 +100,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
|
||||
return indexer.getAllied(team, BlockFlag.comandCenter).size != 0 && indexer.getAllied(team, BlockFlag.comandCenter).first().entity instanceof CommandCenterEntity;
|
||||
}
|
||||
|
||||
public UnitCommand getCommand(){
|
||||
public @Nullable UnitCommand getCommand(){
|
||||
if(isCommanded()){
|
||||
return indexer.getAllied(team, BlockFlag.comandCenter).first().<CommandCenterEntity>entity().command;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public abstract class FlyingUnit extends BaseUnit{
|
||||
}
|
||||
}else{
|
||||
target = getClosestSpawner();
|
||||
moveTo(Vars.state.rules.dropZoneRadius + 80f);
|
||||
moveTo(Vars.state.rules.dropZoneRadius + 120f);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -88,7 +88,7 @@ public abstract class FlyingUnit extends BaseUnit{
|
||||
}
|
||||
|
||||
if(target != null){
|
||||
circle(80f + Mathf.randomSeed(id) * 120);
|
||||
circle(65f + Mathf.randomSeed(id) * 100);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -37,7 +37,7 @@ public abstract class GroundUnit extends BaseUnit{
|
||||
|
||||
if(core == null){
|
||||
Tile closestSpawn = getClosestSpawner();
|
||||
if(closestSpawn == null || !withinDst(closestSpawn, Vars.state.rules.dropZoneRadius + 75f)){
|
||||
if(closestSpawn == null || !withinDst(closestSpawn, Vars.state.rules.dropZoneRadius + 85f)){
|
||||
moveToCore(PathTarget.enemyCores);
|
||||
}
|
||||
}else{
|
||||
@@ -58,7 +58,7 @@ public abstract class GroundUnit extends BaseUnit{
|
||||
public void update(){
|
||||
Tile target = getClosest(BlockFlag.rally);
|
||||
|
||||
if(target != null && dst(target) > 100f){
|
||||
if(target != null && dst(target) > 80f){
|
||||
moveToCore(PathTarget.rallyPoints);
|
||||
}
|
||||
}
|
||||
@@ -243,11 +243,18 @@ public abstract class GroundUnit extends BaseUnit{
|
||||
}
|
||||
}
|
||||
|
||||
if(enemy == null){
|
||||
for(Team team : Vars.state.teams.enemiesOf(team)){
|
||||
enemy = team;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(enemy == null) return;
|
||||
|
||||
Tile tile = world.tileWorld(x, y);
|
||||
if(tile == null) return;
|
||||
Tile targetTile = pathfinder.getTargetTile(tile, team, PathTarget.enemyCores);
|
||||
Tile targetTile = pathfinder.getTargetTile(tile, enemy, PathTarget.enemyCores);
|
||||
TileEntity core = getClosestCore();
|
||||
|
||||
if(tile == targetTile || core == null || dst(core) < 120f) return;
|
||||
|
||||
Reference in New Issue
Block a user