diff --git a/core/assets-raw/sprites/blocks/environment/arkycite-floor.png b/core/assets-raw/sprites/blocks/environment/arkycite-floor.png new file mode 100644 index 0000000000..8d2645922b Binary files /dev/null and b/core/assets-raw/sprites/blocks/environment/arkycite-floor.png differ diff --git a/core/assets-raw/sprites/items/liquid-arkycite.png b/core/assets-raw/sprites/items/liquid-arkycite.png new file mode 100644 index 0000000000..57599983c2 Binary files /dev/null and b/core/assets-raw/sprites/items/liquid-arkycite.png differ diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 0f5e630c43..19b12019d6 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -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}% diff --git a/core/assets/icons/icons.properties b/core/assets/icons/icons.properties index 13172138a3..44972c897f 100755 --- a/core/assets/icons/icons.properties +++ b/core/assets/icons/icons.properties @@ -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 diff --git a/core/assets/logicids.dat b/core/assets/logicids.dat index de04a9e6fd..f89741c46e 100644 Binary files a/core/assets/logicids.dat and b/core/assets/logicids.dat differ diff --git a/core/assets/shaders/arkycite.frag b/core/assets/shaders/arkycite.frag new file mode 100644 index 0000000000..bd677d5e44 --- /dev/null +++ b/core/assets/shaders/arkycite.frag @@ -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; +} diff --git a/core/src/mindustry/ai/types/CargoAI.java b/core/src/mindustry/ai/types/CargoAI.java index 9c60c0d495..49b6d8f419 100644 --- a/core/src/mindustry/ai/types/CargoAI.java +++ b/core/src/mindustry/ai/types/CargoAI.java @@ -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 diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 3583b8cc4c..5172cb1808 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -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"); diff --git a/core/src/mindustry/content/Liquids.java b/core/src/mindustry/content/Liquids.java index 52b230812f..f2767585fe 100644 --- a/core/src/mindustry/content/Liquids.java +++ b/core/src/mindustry/content/Liquids.java @@ -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")){{ }}; diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 6c90ea8f72..83c01006ae 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -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) ); diff --git a/core/src/mindustry/graphics/CacheLayer.java b/core/src/mindustry/graphics/CacheLayer.java index 3921612853..746c39a8b4 100644 --- a/core/src/mindustry/graphics/CacheLayer.java +++ b/core/src/mindustry/graphics/CacheLayer.java @@ -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(), diff --git a/core/src/mindustry/graphics/Shaders.java b/core/src/mindustry/graphics/Shaders.java index 3a53f6d83c..c598119817 100644 --- a/core/src/mindustry/graphics/Shaders.java +++ b/core/src/mindustry/graphics/Shaders.java @@ -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"); diff --git a/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java b/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java index d7d0ffaebe..f0a2ef5b0b 100644 --- a/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java +++ b/core/src/mindustry/maps/planet/ErekirPlanetGenerator.java @@ -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; diff --git a/core/src/mindustry/world/blocks/units/UnitCargoLoader.java b/core/src/mindustry/world/blocks/units/UnitCargoLoader.java index 74eaa3da58..e72fac48da 100644 --- a/core/src/mindustry/world/blocks/units/UnitCargoLoader.java +++ b/core/src/mindustry/world/blocks/units/UnitCargoLoader.java @@ -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; diff --git a/gradle.properties b/gradle.properties index 611d472faa..b6d9a4be8e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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