Procedural scorch marks / Bugfixes

This commit is contained in:
Anuken
2020-02-09 12:07:36 -05:00
parent 8e976c20a1
commit d45d7f21b6
39 changed files with 1187 additions and 950 deletions

View File

@@ -55,7 +55,7 @@ public class Effects{
}
public static void decal(TextureRegion region, float x, float y, float rotation, float lifetime, Color color){
if(headless || region == null) return;
if(headless || region == null || !Core.atlas.isFound(region)) return;
Decalc decal = DecalEntity.create();
decal.set(x, y);
@@ -66,12 +66,20 @@ public class Effects{
decal.add();
}
public static void scorch(float x, float y, int size){
if(headless) return;
size = Mathf.clamp(size, 0, 9);
TextureRegion region = Core.atlas.find("scorch-" + size + "-" + Mathf.random(2));
decal(region, x, y, Mathf.random(4) * 90, 3600, Pal.rubble);
}
public static void rubble(float x, float y, int blockSize){
if(headless) return;
TextureRegion region = Core.atlas.find("rubble-" + blockSize + "-" + Mathf.random(0, 1));
if(!Core.atlas.isFound(region)) return;
decal(region, x, y, Mathf.random(0, 4) * 90, 3600, Pal.rubble);
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);
}
}