diff --git a/core/src/mindustry/entities/Effects.java b/core/src/mindustry/entities/Effects.java index bec60a7dea..2f1eb20faf 100644 --- a/core/src/mindustry/entities/Effects.java +++ b/core/src/mindustry/entities/Effects.java @@ -9,6 +9,7 @@ import arc.util.*; import mindustry.content.*; import mindustry.gen.*; import mindustry.graphics.*; +import mindustry.world.*; import static mindustry.Vars.*; @@ -69,6 +70,9 @@ public class Effects{ public static void scorch(float x, float y, int size){ if(headless) return; + Tile tile = world.tileWorld(x, y); + if(tile == null || tile.floor().isLiquid) return; + size = Mathf.clamp(size, 0, 9); TextureRegion region = Core.atlas.find("scorch-" + size + "-" + Mathf.random(2)); @@ -79,6 +83,9 @@ public class Effects{ public static void rubble(float x, float y, int blockSize){ if(headless) return; + Tile tile = world.tileWorld(x, y); + if(tile == null || tile.floor().isLiquid) return; + TextureRegion region = Core.atlas.find("rubble-" + blockSize + "-" + (Core.atlas.has("rubble-" + blockSize + "-1") ? Mathf.random(0, 1) : "0")); decal(region, x, y, Mathf.random(4) * 90, 3600, Pal.rubble); } diff --git a/core/src/mindustry/type/Planet.java b/core/src/mindustry/type/Planet.java index 0fb7698674..1d8275ad2b 100644 --- a/core/src/mindustry/type/Planet.java +++ b/core/src/mindustry/type/Planet.java @@ -39,7 +39,6 @@ public class Planet extends UnlockableContent{ sectors = new Array<>(grid.tiles.length); for(int i = 0; i < grid.tiles.length; i++){ - //TODO load sector data sectors.add(new Sector(this, grid.tiles[i], new SectorData())); } diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 5d5e8aa4f7..fb6942ae0d 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -122,6 +122,7 @@ public class UnitType extends UnlockableContent{ } public void drawItems(Unitc unit){ + applyColor(unit); //draw back items if(unit.hasItem() && unit.itemTime() > 0.01f){ @@ -154,7 +155,7 @@ public class UnitType extends UnlockableContent{ } public void drawWeapons(Unitc unit){ - Draw.mixcol(Color.white, unit.hitTime()); + applyColor(unit); for(WeaponMount mount : unit.mounts()){ Weapon weapon = mount.weapon; @@ -179,7 +180,7 @@ public class UnitType extends UnlockableContent{ } public void drawBody(Unitc unit){ - Draw.mixcol(Color.white, unit.hitTime()); + applyColor(unit); Draw.rect(region, unit, unit.rotation() - 90); @@ -187,9 +188,11 @@ public class UnitType extends UnlockableContent{ } public void drawCell(Unitc unit){ + applyColor(unit); + Draw.color(Color.black, unit.team().color, unit.healthf() + Mathf.absin(Time.time(), Math.max(unit.healthf() * 5f, 1f), 1f - unit.healthf())); Draw.rect(cellRegion, unit, unit.rotation() - 90); - Draw.color(); + Draw.reset(); } public void drawLight(Unitc unit){ @@ -227,5 +230,12 @@ public class UnitType extends UnlockableContent{ Draw.mixcol(); } + public void applyColor(Unitc unit){ + Draw.mixcol(Color.white, unit.hitTime()); + if(unit.drownTime() > 0 && unit.floorOn().isDeep()){ + Draw.mixcol(unit.floorOn().color, unit.drownTime() * 0.8f); + } + } + //endregion } diff --git a/gradle.properties b/gradle.properties index 7f41c54766..88c2ae197f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=899ab293f6f7bab4deadec06fac7a666028edf15 +archash=f1178ca09b4d0b29e23f6443e73f8daf4a4b7329 diff --git a/tools/build.gradle b/tools/build.gradle index 726a7acfb2..631802e28c 100644 --- a/tools/build.gradle +++ b/tools/build.gradle @@ -351,6 +351,9 @@ task genSectorData(dependsOn: classes, type: JavaExec){ workingDir = "../core/assets/" } +task updateCache(dependsOn: [genSectorData]){ +} + task updateBundles(dependsOn: classes, type: JavaExec){ file(genFolder).mkdirs() diff --git a/tools/src/mindustry/tools/SectorDataGenerator.java b/tools/src/mindustry/tools/SectorDataGenerator.java index 9d21679415..3a6aff97c5 100644 --- a/tools/src/mindustry/tools/SectorDataGenerator.java +++ b/tools/src/mindustry/tools/SectorDataGenerator.java @@ -7,6 +7,7 @@ import arc.struct.*; import arc.util.*; import arc.util.io.*; import mindustry.*; +import mindustry.content.*; import mindustry.core.*; import mindustry.ctype.*; import mindustry.net.Net; @@ -58,6 +59,9 @@ public class SectorDataGenerator{ if(!tile.block().isStatic()){ floors.increment(tile.floor()); + if(tile.overlay() != Blocks.air){ + floors.increment(tile.overlay()); + } } } @@ -76,7 +80,7 @@ public class SectorDataGenerator{ data.resources = content.asArray().sort(Structs.comps(Structs.comparing(Content::getContentType), Structs.comparingInt(c -> c.id))).toArray(Content.class); - if(count[0]++ % 5 == 0){ + if(count[0]++ % 10 == 0){ Log.info("&lyDone with sector &lm{0}/{1}", count[0], planet.sectors.size); }