WIP arkycite

This commit is contained in:
Anuken 2021-11-30 18:13:34 -05:00
parent a0b7d96f67
commit b3dd7f4b8b
15 changed files with 111 additions and 5 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B

View file

@ -796,6 +796,7 @@ ability.energyfield = Energy Field: [accent]{0}[] damage ~ [accent]{1}[] blocks
bar.drilltierreq = Better Drill Required
bar.noresources = Missing Resources
bar.corereq = Core Base Required
bar.cargounitcap = Cargo Unit Cap Reached
bar.drillspeed = Drill Speed: {0}/s
bar.pumpspeed = Pump Speed: {0}/s
bar.efficiency = Efficiency: {0}%

View file

@ -465,3 +465,5 @@
63241=unit-cargo-loader|block-unit-cargo-loader-ui
63240=unit-cargo-unload-point|block-unit-cargo-unload-point-ui
63239=manifold|unit-manifold-ui
63238=arkycite-floor|block-arkycite-floor-ui
63237=arkycite|liquid-arkycite-ui

Binary file not shown.

View file

@ -0,0 +1,55 @@
#define HIGHP
//shades of slag
#define S2 vec3(89.0, 150.0, 62.0) / 255.0
#define S1 vec3(112.0, 181.0, 81.0) / 255.0
#define MINSHADE vec4(68.0, 118.0, 66.0, 255.0) / 255.0
#define NSCALE 170.0 / 2.0
#define DSCALE 160.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;
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);
vec4 orig = texture2D(u_texture, c);
float atime = u_time / 15000.0;
float noise = (texture2D(u_noise, (coords) / DSCALE + vec2(atime) * vec2(-0.9, 0.8)).r + texture2D(u_noise, (coords) / DSCALE + vec2(atime * 1.1) * vec2(0.8, -1.0)).r) / 2.0;
noise = abs(noise - 0.5) * 7.0 + 0.23;
float btime = u_time / 9000.0;
c += (vec2(
texture2D(u_noise, (coords) / NSCALE + vec2(btime) * vec2(-0.9, 0.8)).r,
texture2D(u_noise, (coords) / NSCALE + vec2(btime * 1.1) * vec2(0.8, -1.0)).r
) - vec2(0.5)) * 20.0 / u_resolution;
vec4 color = texture2D(u_texture, c);
if(noise > 0.85){
if(color.g >= (S2).g - 0.1){
color.rgb = S1;
}else{
color.rgb = S2;
}
}else if(noise > 0.5){
color.rgb = S2;
}
if(orig.r > 0.01){
color = max(MINSHADE, color);
}
gl_FragColor = color;
}

View file

@ -57,6 +57,13 @@ public class CargoAI extends AIController{
}
}
}else{
//what if some prankster reconfigures the source while the unit is moving? we can't have that!
if(unloadTarget.item != itemTarget){
unloadTarget = null;
return;
}
moveTo(unloadTarget, moveRange, moveSmoothing);
//deposit in bursts, unloading can take a while

View file

@ -39,6 +39,7 @@ public class Blocks{
//environment
air, spawn, cliff, deepwater, water, taintedWater, deepTaintedWater, tar, slag, cryofluid, stone, craters, charr, sand, darksand, dirt, mud, ice, snow, darksandTaintedWater, space, empty,
dacite, rhyolite, rhyoliteCrater, regolith, yellowStone, redIce,
arkyciteFloor,
redmat, bluemat,
stoneWall, dirtWall, sporeWall, iceWall, daciteWall, sporePine, snowPine, pine, shrubs, whiteTree, whiteTreeDead, sporeCluster,
redweed, purbush, coralChunk, yellowCoral,
@ -388,6 +389,20 @@ public class Blocks{
attributes.set(Attribute.water, 0.4f);
}};
arkyciteFloor = new Floor("arkycite-floor"){{
speedMultiplier = 0.3f;
variants = 0;
liquidDrop = Liquids.arkycite;
liquidMultiplier = 1.5f;
isLiquid = true;
//TODO status, cache layer for this crap
status = StatusEffects.wet;
statusDuration = 120f;
drownTime = 200f;
cacheLayer = CacheLayer.arkycite;
albedo = 0.9f;
}};
redmat = new Floor("redmat");
bluemat = new Floor("bluemat");

View file

@ -5,7 +5,7 @@ import mindustry.type.*;
public class Liquids{
public static Liquid water, slag, oil, cryofluid, neoplasm,
gallium,
arkycite, gallium,
ozone, hydrogen, nitrogen, cyanogen;
public static void load(){
@ -56,6 +56,12 @@ public class Liquids{
colorTo = Color.valueOf("9e172c");
}};
//TODO
arkycite = new Liquid("arkycite", Color.valueOf("59963e")){{
flammability = 0.4f;
viscosity = 0.7f;
}};
gallium = new Liquid("gallium", Color.valueOf("9a9dbf")){{
}};

View file

@ -2637,6 +2637,9 @@ public class UnitTypes{
engineSize = 2.3f;
engineOffset = 6.5f;
//should not appear anywhere, it's for internal use only and will despawn
hidden = true;
setEnginesMirror(
new UnitEngine(24 / 4f, -24 / 4f, 2.3f, 315f)
);

View file

@ -10,7 +10,7 @@ import static mindustry.Vars.*;
public class CacheLayer{
public static CacheLayer
water, mud, cryofluid, tar, slag, space, normal, walls;
water, mud, cryofluid, tar, slag, arkycite, 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),
arkycite = new ShaderLayer(Shaders.arkycite),
cryofluid = new ShaderLayer(Shaders.cryofluid),
space = new ShaderLayer(Shaders.space),
normal = 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, cryofluid, space, caustics;
public static SurfaceShader water, mud, tar, slag, cryofluid, space, caustics, arkycite;
public static PlanetShader planet;
public static CloudShader clouds;
public static PlanetGridShader planetGrid;
@ -45,6 +45,7 @@ public class Shaders{
darkness = new DarknessShader();
light = new LightShader();
water = new SurfaceShader("water");
arkycite = new SurfaceShader("arkycite");
mud = new SurfaceShader("mud");
tar = new SurfaceShader("tar");
slag = new SurfaceShader("slag");

View file

@ -112,7 +112,6 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
float noise = noise(x + 782, y, 7, 0.8f, 280f, 1f);
if(noise > 0.62f){
if(noise > 0.635f){
//TODO slag must be rounded, no single occurrences
floor = Blocks.slag;
}else{
floor = Blocks.yellowStone;

View file

@ -6,8 +6,10 @@ import arc.graphics.g2d.*;
import arc.math.*;
import arc.util.*;
import arc.util.io.*;
import mindustry.*;
import mindustry.content.*;
import mindustry.entities.*;
import mindustry.game.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.type.*;
@ -49,6 +51,20 @@ public class UnitCargoLoader extends Block{
));
}
@Override
public boolean canPlaceOn(Tile tile, Team team, int rotation){
return super.canPlaceOn(tile, team, rotation) && Units.canCreate(team, unitType);
}
@Override
public void drawPlace(int x, int y, int rotation, boolean valid){
super.drawPlace(x, y, rotation, valid);
if(!Units.canCreate(Vars.player.team(), unitType)){
drawPlaceText(Core.bundle.get("@bar.cargounitcap"), x, y, valid);
}
}
public class UnitTransportSourceBuild extends Building{
//needs to be "unboxed" after reading, since units are read after buildings.
public int readUnitId = -1;

View file

@ -24,4 +24,4 @@ android.useAndroidX=true
#used for slow jitpack builds; TODO see if this actually works
org.gradle.internal.http.socketTimeout=100000
org.gradle.internal.http.connectionTimeout=100000
archash=00d1f312
archash=f9abed08