Fixed erekir unit requirements

This commit is contained in:
Anuken
2022-02-13 20:54:25 -05:00
parent 0593c66f70
commit c8b11c4447
11 changed files with 43 additions and 1 deletions

View File

@@ -159,6 +159,8 @@ public class Block extends UnlockableContent implements Senseable{
public boolean expanded = false;
/** Clipping size of this block. Should be as large as the block will draw. */
public float clipSize = -1f;
/** When placeRangeCheck is enabled, this is the range checked for enemy blocks. */
public float placeOverlapRange = 30f;
/** Max of timers used. */
public int timers = 0;
/** Cache layer. Only used for 'cached' rendering. */

View File

@@ -94,7 +94,7 @@ public class Build{
Block previous = tile.block();
Block sub = ConstructBlock.get(result.size);
Seq<Building> prevBuild = new Seq<>(9);
var prevBuild = new Seq<Building>(9);
result.beforePlaceBegan(tile, previous);
tmp.clear();
@@ -201,9 +201,17 @@ public class Build{
}
}
if(state.rules.placeRangeCheck && getEnemyOverlap(type, team, x, y) != null){
return false;
}
return true;
}
public static @Nullable Building getEnemyOverlap(Block block, Team team, int x, int y){
return indexer.findEnemyTile(team, x * tilesize + block.size, y * tilesize + block.size, block.placeOverlapRange + 4f, p -> true);
}
public static boolean contactsGround(int x, int y, Block block){
if(block.isMultiblock()){
for(Point2 point : Edges.getEdges(block.size)){

View File

@@ -45,6 +45,7 @@ public class BaseTurret extends Block{
consumes.add(coolantOverride != null ? new ConsumeLiquid(coolantOverride, coolantUsage) : new ConsumeCoolant(coolantUsage)).update(false).boost();
}
placeOverlapRange = Math.max(placeOverlapRange, range);
super.init();
}