Cryo tiles (#6054)

* Cryo tile

* tile name

* Shader

* Icon and property
This commit is contained in:
TranquillyUnpleasant 2021-09-27 23:46:28 +05:00 committed by GitHub
parent 083c21ea3f
commit dbd31b9031
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 58 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1133,6 +1133,7 @@ block.sand-boulder.name = Sand Boulder
block.basalt-boulder.name = Basalt Boulder
block.grass.name = Grass
block.molten-slag.name = Slag
block.pooled-cryofluid.name = Cryofluid
block.space.name = Space
block.salt.name = Salt
block.salt-wall.name = Salt Wall

View file

@ -360,3 +360,4 @@
63348=molten-slag|block-molten-slag-ui
63347=crater-stone|block-crater-stone-ui
63346=deep-tainted-water|block-deep-tainted-water-ui
63345=pooled-cryofluid|block-pooled-cryofluid-ui

View file

@ -0,0 +1,35 @@
#define HIGHP
//shades of cryofluid
#define S1 vec3(53.0, 83.0, 93.0) / 100.0
#define S2 vec3(68.0, 90.0, 97.0) / 100.0
#define NSCALE 100.0 / 2.0
uniform sampler2D u_texture;
uniform sampler2D u_noise;
uniform vec2 u_campos;
uniform vec2 u_resolution;
uniform float u_time;
varying vec2 v_texCoords;
const float shakeScl = 20.0;
void main(){
vec2 c = v_texCoords.xy;
vec2 coords = vec2(c.x * u_resolution.x + u_campos.x, c.y * u_resolution.y + u_campos.y);
float btime = u_time / 3000.0;
float wave = abs(sin(coords.x * 1.1 + coords.y) + 0.1 * sin(2.5 * coords.x) + 0.15 * sin(3.0 * coords.y)) / 30.0;
float noise = wave + (texture2D(u_noise, (coords) / NSCALE + vec2(btime) * vec2(-0.2, 0.8)).r + texture2D(u_noise, (coords) / NSCALE + vec2(btime * 1.1) * vec2(0.8, -1.0)).r) / 2.0;
vec4 color = texture2D(u_texture, c);
if (noise > 0.55 && noise < 0.56) {
color.rgb = S2;
} else if (noise > 0.50 && noise < 0.60){
color.rgb = S1;
}
gl_FragColor = color;
}

View file

@ -35,7 +35,7 @@ public class Blocks implements ContentList{
public static Block
//environment
air, spawn, cliff, deepwater, water, taintedWater, deepTaintedWater, tar, slag, stone, craters, charr, sand, darksand, dirt, mud, ice, snow, darksandTaintedWater, space,
air, spawn, cliff, deepwater, water, taintedWater, deepTaintedWater, tar, slag, cryofluid, stone, craters, charr, sand, darksand, dirt, mud, ice, snow, darksandTaintedWater, space,
dacite,
stoneWall, dirtWall, sporeWall, iceWall, daciteWall, sporePine, snowPine, pine, shrubs, whiteTree, whiteTreeDead, sporeCluster,
iceSnow, sandWater, darksandWater, duneWall, sandWall, moss, sporeMoss, shale, shaleWall, shaleBoulder, sandBoulder, daciteBoulder, boulder, snowBoulder, basaltBoulder, grass, salt,
@ -196,6 +196,22 @@ public class Blocks implements ContentList{
cacheLayer = CacheLayer.tar;
}};
cryofluid = new Floor("pooled-cryofluid"){{
drownTime = 150f;
status = StatusEffects.freezing;
statusDuration = 240f;
speedMultiplier = 0.5f;
variants = 0;
liquidDrop = Liquids.cryofluid;
liquidMultiplier = 0.5f;
isLiquid = true;
cacheLayer = CacheLayer.cryofluid;
emitLight = true;
lightRadius = 20f;
lightColor = Color.cyan.cpy().a(0.19f);
}};
slag = new Floor("molten-slag"){{
drownTime = 150f;
status = StatusEffects.melting;

View file

@ -10,7 +10,7 @@ import static mindustry.Vars.*;
public class CacheLayer{
public static CacheLayer
water, mud, tar, slag, space, normal, walls;
water, mud, cryofluid, tar, slag, space, normal, walls;
public static CacheLayer[] all = {};
@ -37,6 +37,7 @@ public class CacheLayer{
mud = new ShaderLayer(Shaders.mud),
tar = new ShaderLayer(Shaders.tar),
slag = new ShaderLayer(Shaders.slag),
cryofluid = new ShaderLayer(Shaders.cryofluid),
space = new ShaderLayer(Shaders.space),
normal = new CacheLayer(),
walls = new CacheLayer()

View file

@ -21,7 +21,7 @@ public class Shaders{
public static UnitBuildShader build;
public static DarknessShader darkness;
public static LightShader light;
public static SurfaceShader water, mud, tar, slag, space, caustics;
public static SurfaceShader water, mud, tar, slag, cryofluid, space, caustics;
public static PlanetShader planet;
public static PlanetGridShader planetGrid;
public static AtmosphereShader atmosphere;
@ -47,6 +47,7 @@ public class Shaders{
mud = new SurfaceShader("mud");
tar = new SurfaceShader("tar");
slag = new SurfaceShader("slag");
cryofluid = new SurfaceShader("cryofluid");
space = new SpaceShader("space");
//caustics = new SurfaceShader("caustics"){
// @Override