break;
}
if (Main.game.world.tiles[x][y] instanceof Building) {
Building building = (Building) Main.game.world.tiles[x][y];
rendermanager.spriteBatch.draw(Main.textureRegionObjectMap.get("stone"), Tile.SIZE * x, Tile.SIZE * y, Tile.SIZE, Tile.SIZE);
if (building.team != null) {
if (building.team.equals(Main.game.blueTeam) || !Main.game.world.FOG_OF_WAR || Main.game.visible.contains(Main.game.world.tiles[x][y])|| building.tiletyp.equals(Repository.tiletypObjectMap.get("hq"))) {
rendermanager.spriteBatch.setColor(building.team.color);
}
} else {
rendermanager.spriteBatch.setColor(Repository.grey);
}
}
// if (Main.game.world.tiles[x][y].locked) {
// rendermanager.spriteBatch.setColor(Color.PINK);
// }
rendermanager.spriteBatch.draw(Main.game.world.tiles[x][y].tiletyp.textureRegion, Tile.SIZE * x, Tile.SIZE * y, Tile.SIZE, Tile.SIZE);
rendermanager.spriteBatch.setColor(Color.WHITE);
if (Main.game.world.tiles[x][y] instanceof Building) {
((BuildingTyp) Main.game.world.tiles[x][y].tiletyp).render(rendermanager, (Building) Main.game.world.tiles[x][y]);
}
}
}
for (Entity entity: Main.game.world.entities) {
if (entity != null) {
if (Main.game.visible.contains(entity.tile) || entity.team.equals(Main.game.blueTeam) || !Main.game.world.FOG_OF_WAR) {
if (entity.team.flip) {
entity.entitytyp.textureRegion.flip(true, false);
}
if (entity.waypoints != null) {
if (!entity.waypoints.isEmpty() && entity.team.equals(Game.blueTeam)) {
rendermanager.spriteBatch.setColor(Repository.used);
rendermanager.spriteBatch.draw(entity.entitytyp.textureRegion, Tile.SIZE * ((Tile) entity.waypoints.getLast()).posX, Tile.SIZE * ((Tile) entity.waypoints.getLast()).posY, Tile.SIZE, Tile.SIZE);
}
}
rendermanager.spriteBatch.setColor(entity.team.color);
if (Main.game.currentAction == CurrentAction.TO_SELECT_ENTITY) {
if (GametimeManager.TICKCOUNT % 60 < 30) {
rendermanager.spriteBatch.setColor(Color.YELLOW);
}
}
rendermanager.spriteBatch.draw(entity.entitytyp.textureRegion, Tile.SIZE * entity.tile.posX + entity.offsetX, Tile.SIZE * entity.tile.posY + entity.offsetY, Tile.SIZE, Tile.SIZE);
rendermanager.spriteBatch.setColor(Color.WHITE);
if (Main.game.currentAction == CurrentAction.TO_SELECT_ENTITY) {
if (entity.entitytyp.cost <= Main.game.blueTeam.money) {
rendermanager.spriteBatch.setColor(Color.GREEN);
} else {
rendermanager.spriteBatch.setColor(Color.RED);
}
rendermanager.spriteBatch.draw(Main.textureRegionObjectMap.get("highlighter"), Tile.SIZE * entity.tile.posX + entity.offsetX + Tile.SIZE * 0.1f, Tile.SIZE * entity.tile.posY + entity.offsetY, Tile.SIZE * 0.8f, Tile.SIZE * 0.4f);
rendermanager.spriteBatch.setColor(Color.WHITE);
rendermanager.spriteBatch.draw(Main.textureRegionObjectMap.get("10s"), Tile.SIZE * entity.tile.posX + entity.offsetX + Tile.SIZE * 0.4f, Tile.SIZE * entity.tile.posY + entity.offsetY, Tile.SIZE * 0.4f, Tile.SIZE * 0.4f);
drawIndependentText(rendermanager, Main.fontMap.get("tektonpro").get(24), "font", "" + entity.entitytyp.cost, Tile.SIZE * entity.tile.posX + entity.offsetX + Tile.SIZE * 0.2f, Tile.SIZE * entity.tile.posY + entity.offsetY + Tile.SIZE * 0.5f, Color.WHITE);
} else if (entity.health / 10 < 10) {
rendermanager.spriteBatch.draw(Main.textureRegionObjectMap.get("heart"), Tile.SIZE * entity.tile.posX + entity.offsetX, Tile.SIZE * entity.tile.posY + entity.offsetY, Tile.SIZE * 0.6f, Tile.SIZE * 0.6f);
drawIndependentText(rendermanager, Main.fontMap.get("tektonpro").get(24), "font", "" + Math.max(entity.health / 10, 1), Tile.SIZE * entity.tile.posX + entity.offsetX + Tile.SIZE * 0.15f, Tile.SIZE * entity.tile.posY + entity.offsetY + Tile.SIZE * 0.6f, Color.WHITE);
}
if (entity.waypoints != null && entity.team.equals(Game.blueTeam)) {
if (!entity.waypoints.isEmpty() && Main.game.currentAction != CurrentAction.ATTACK) {
rendermanager.spriteBatch.draw(Main.textureRegionObjectMap.get("check"), Tile.SIZE * entity.tile.posX + entity.offsetX + Tile.SIZE * 0.6f, Tile.SIZE * entity.tile.posY + entity.offsetY + Tile.SIZE * 0.6f, Tile.SIZE * 0.45f, Tile.SIZE * 0.45f);
}
}
if (entity.team.flip) {
entity.entitytyp.textureRegion.flip(true, false);
}
}
}
}
for (int x = 0; x < Main.game.world.WORLD_WIDTH; x++) {
for (int y = Main.game.world.WORLD_HEIGHT - 1; y >= 0; y--) {
if (Main.game.world.tiles[x][y] instanceof Building) {
Building building = (Building) Main.game.world.tiles[x][y];
Color color = Repository.grey;
if (building.team != null) {
if (building.team.equals(Main.game.blueTeam) || Main.game.visible.contains(building) || !Main.game.world.FOG_OF_WAR || building.tiletyp.equals(Repository.tiletypObjectMap.get("hq"))) {