diff --git a/core/assets-raw/sprites/blocks/liquidjunction.png b/core/assets-raw/sprites/blocks/liquidjunction.png new file mode 100644 index 0000000000..0a0bfdcfba Binary files /dev/null and b/core/assets-raw/sprites/blocks/liquidjunction.png differ diff --git a/core/assets-raw/sprites/blocks/oilrefinery.png b/core/assets-raw/sprites/blocks/oilrefinery.png new file mode 100644 index 0000000000..acfe53f47f Binary files /dev/null and b/core/assets-raw/sprites/blocks/oilrefinery.png differ diff --git a/core/assets-raw/sprites/blocks/poweredconveyor.png b/core/assets-raw/sprites/blocks/poweredconveyor.png new file mode 100644 index 0000000000..bae08a3d20 Binary files /dev/null and b/core/assets-raw/sprites/blocks/poweredconveyor.png differ diff --git a/core/assets-raw/sprites/blocks/poweredconveyormove.png b/core/assets-raw/sprites/blocks/poweredconveyormove.png new file mode 100644 index 0000000000..60d4002873 Binary files /dev/null and b/core/assets-raw/sprites/blocks/poweredconveyormove.png differ diff --git a/core/assets-raw/sprites/blocks/uranium1.png b/core/assets-raw/sprites/blocks/uranium1.png new file mode 100644 index 0000000000..c89c866a93 Binary files /dev/null and b/core/assets-raw/sprites/blocks/uranium1.png differ diff --git a/core/assets-raw/sprites/blocks/uranium2.png b/core/assets-raw/sprites/blocks/uranium2.png new file mode 100644 index 0000000000..20eb054ec3 Binary files /dev/null and b/core/assets-raw/sprites/blocks/uranium2.png differ diff --git a/core/assets-raw/sprites/blocks/uranium3.png b/core/assets-raw/sprites/blocks/uranium3.png new file mode 100644 index 0000000000..dfa5ed2cc2 Binary files /dev/null and b/core/assets-raw/sprites/blocks/uranium3.png differ diff --git a/core/assets-raw/sprites/blocks/uraniumdrill.png b/core/assets-raw/sprites/blocks/uraniumdrill.png new file mode 100644 index 0000000000..7849b7cecd Binary files /dev/null and b/core/assets-raw/sprites/blocks/uraniumdrill.png differ diff --git a/core/assets-raw/sprites/icon-iron.png b/core/assets-raw/sprites/icon-iron.png index d46c14a816..f9072d1348 100644 Binary files a/core/assets-raw/sprites/icon-iron.png and b/core/assets-raw/sprites/icon-iron.png differ diff --git a/core/assets-raw/sprites/icon-steel.png b/core/assets-raw/sprites/icon-steel.png index ee6ffe781c..1f4cd1eda8 100644 Binary files a/core/assets-raw/sprites/icon-steel.png and b/core/assets-raw/sprites/icon-steel.png differ diff --git a/core/assets-raw/sprites/icon-uranium.png b/core/assets-raw/sprites/icon-uranium.png new file mode 100644 index 0000000000..0dd3f67a71 Binary files /dev/null and b/core/assets-raw/sprites/icon-uranium.png differ diff --git a/core/assets-raw/sprites/ui/icon-crafting.png b/core/assets-raw/sprites/ui/icon-crafting.png new file mode 100644 index 0000000000..0e156c60c9 Binary files /dev/null and b/core/assets-raw/sprites/ui/icon-crafting.png differ diff --git a/core/assets-raw/sprites/ui/icon-defense.png b/core/assets-raw/sprites/ui/icon-defense.png index 003074bc56..f807b78001 100644 Binary files a/core/assets-raw/sprites/ui/icon-defense.png and b/core/assets-raw/sprites/ui/icon-defense.png differ diff --git a/core/assets-raw/sprites/ui/icon-weapon.png b/core/assets-raw/sprites/ui/icon-weapon.png new file mode 100644 index 0000000000..003074bc56 Binary files /dev/null and b/core/assets-raw/sprites/ui/icon-weapon.png differ diff --git a/core/assets/shaders/shield.fragment b/core/assets/shaders/shield.fragment index f4443a495c..98f0b5adba 100644 --- a/core/assets/shaders/shield.fragment +++ b/core/assets/shaders/shield.fragment @@ -16,8 +16,11 @@ varying vec2 v_texCoord; void main() { vec2 T = v_texCoord.xy; + vec2 coords = (T * u_texsize) + u_offset; + T += vec2(sin(coords.y / 3.0 + u_time / 20.0) / 250.0, sin(coords.x / 3.0 + u_time / 20.0) / 250.0); + float si = 1.0 + sin(u_time / 20.0 /*+ (coords.x + coords.y) / 30.0*/) / 8.0; vec4 color = texture2D(u_texture, T) * vec4(si, si, si, 1.0); @@ -27,7 +30,7 @@ void main() { bool any = false; float thickness = 1.0; - float step = 1.0; + float step = 1.5; if(texture2D(u_texture, T).a < 0.1 && (texture2D(u_texture, T + vec2(0, step) * v).a > 0.1 || texture2D(u_texture, T + vec2(0, -step) * v).a > 0.1 || diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index 54cf98a71d..7061a50c1b 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -41,133 +41,133 @@ blocks/coal2 index: -1 blocks/coal3 rotate: false - xy: 393, 372 + xy: 397, 348 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coaldrill rotate: false - xy: 471, 443 + xy: 397, 338 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalgenerator rotate: false - xy: 481, 443 + xy: 397, 328 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalpurifier rotate: false - xy: 469, 433 + xy: 397, 318 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/compositewall rotate: false - xy: 469, 423 + xy: 397, 308 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduit rotate: false - xy: 479, 433 + xy: 397, 298 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduitbottom rotate: false - xy: 469, 413 + xy: 397, 288 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduitliquid rotate: false - xy: 479, 423 + xy: 471, 443 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduittop rotate: false - xy: 479, 413 + xy: 481, 443 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyor rotate: false - xy: 389, 276 + xy: 469, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyormove rotate: false - xy: 389, 266 + xy: 469, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/core rotate: false - xy: 389, 256 + xy: 479, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/cross rotate: false - xy: 389, 246 + xy: 469, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/crucible rotate: false - xy: 389, 236 + xy: 479, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/deepwater rotate: false - xy: 117, 4 + xy: 479, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt1 rotate: false - xy: 230, 62 + xy: 389, 276 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt2 rotate: false - xy: 230, 52 + xy: 389, 266 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt3 rotate: false - xy: 230, 42 + xy: 389, 256 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirtblock rotate: false - xy: 228, 32 + xy: 389, 246 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -188,14 +188,14 @@ blocks/doubleturret index: -1 blocks/drill rotate: false - xy: 409, 402 + xy: 389, 236 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/duriumwall rotate: false - xy: 405, 392 + xy: 399, 278 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -209,35 +209,35 @@ blocks/flameturret index: -1 blocks/grass1 rotate: false - xy: 403, 372 + xy: 399, 258 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass2 rotate: false - xy: 397, 362 + xy: 399, 248 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass3 rotate: false - xy: 397, 352 + xy: 399, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock rotate: false - xy: 397, 342 + xy: 117, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock2 rotate: false - xy: 397, 332 + xy: 230, 62 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -251,56 +251,56 @@ blocks/grassedge index: -1 blocks/iron1 rotate: false - xy: 407, 342 + xy: 371, 224 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron2 rotate: false - xy: 407, 332 + xy: 371, 214 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron3 rotate: false - xy: 407, 322 + xy: 381, 226 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/irondrill rotate: false - xy: 407, 312 + xy: 381, 216 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ironwall rotate: false - xy: 407, 302 + xy: 371, 204 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/junction rotate: false - xy: 407, 292 + xy: 381, 206 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/laserturret rotate: false - xy: 385, 310 + xy: 385, 286 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/lava rotate: false - xy: 413, 372 + xy: 391, 226 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -312,51 +312,58 @@ blocks/lavaedge orig: 12, 12 offset: 0, 0 index: -1 +blocks/liquidjunction + rotate: false + xy: 391, 216 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 blocks/liquidrouter rotate: false - xy: 417, 362 + xy: 391, 206 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/machineturret rotate: false - xy: 385, 298 + xy: 128, 26 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/megarepairturret rotate: false - xy: 385, 286 + xy: 140, 26 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/mortarturret rotate: false - xy: 128, 26 + xy: 152, 26 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/mossblock rotate: false - xy: 417, 342 + xy: 401, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/mossstone rotate: false - xy: 417, 342 + xy: 401, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/oil rotate: false - xy: 417, 322 + xy: 491, 443 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -368,135 +375,156 @@ blocks/oiledge orig: 12, 12 offset: 0, 0 index: -1 -blocks/omnidrill - rotate: false - xy: 417, 312 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -blocks/plasmaturret - rotate: false - xy: 140, 26 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -blocks/pump - rotate: false - xy: 417, 292 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -blocks/repairturret - rotate: false - xy: 152, 26 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -blocks/rock - rotate: false - xy: 371, 214 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -blocks/rock2 - rotate: false - xy: 381, 226 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -blocks/rock2shadow - rotate: false - xy: 381, 216 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -blocks/rockshadow - rotate: false - xy: 371, 204 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -blocks/router - rotate: false - xy: 381, 206 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -blocks/shadow - rotate: false - xy: 164, 26 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -blocks/shieldgenerator - rotate: false - xy: 391, 226 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -blocks/shotgunturret - rotate: false - xy: 176, 26 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -blocks/shrub - rotate: false - xy: 391, 216 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -blocks/shrubshadow - rotate: false - xy: 391, 206 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -blocks/smelter - rotate: false - xy: 491, 443 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -blocks/sniperturret - rotate: false - xy: 188, 26 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -blocks/steelconveyor +blocks/oilrefinery rotate: false xy: 489, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -blocks/steelconveyormove +blocks/omnidrill rotate: false xy: 489, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 +blocks/plasmaturret + rotate: false + xy: 164, 26 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +blocks/poweredconveyor + rotate: false + xy: 495, 453 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/poweredconveyormove + rotate: false + xy: 122, 16 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/pump + rotate: false + xy: 132, 16 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/repairturret + rotate: false + xy: 176, 26 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +blocks/rock + rotate: false + xy: 152, 16 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/rock2 + rotate: false + xy: 162, 16 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/rock2shadow + rotate: false + xy: 172, 16 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/rockshadow + rotate: false + xy: 182, 16 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/router + rotate: false + xy: 127, 6 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/shadow + rotate: false + xy: 188, 26 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +blocks/shieldgenerator + rotate: false + xy: 137, 6 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/shotgunturret + rotate: false + xy: 393, 394 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +blocks/shrub + rotate: false + xy: 147, 6 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/shrubshadow + rotate: false + xy: 157, 6 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/smelter + rotate: false + xy: 167, 6 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/sniperturret + rotate: false + xy: 393, 382 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +blocks/steelconveyor + rotate: false + xy: 177, 6 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/steelconveyormove + rotate: false + xy: 192, 16 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 blocks/steelwall rotate: false - xy: 489, 413 + xy: 187, 6 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -510,49 +538,49 @@ blocks/stone index: -1 blocks/stone1 rotate: false - xy: 495, 453 + xy: 197, 6 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone2 rotate: false - xy: 122, 16 + xy: 415, 392 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone3 rotate: false - xy: 132, 16 + xy: 415, 382 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock rotate: false - xy: 142, 16 + xy: 415, 372 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock2 rotate: false - xy: 152, 16 + xy: 409, 362 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock3 rotate: false - xy: 162, 16 + xy: 419, 362 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stonedrill rotate: false - xy: 172, 16 + xy: 501, 443 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -566,70 +594,98 @@ blocks/stoneedge index: -1 blocks/stonewall rotate: false - xy: 182, 16 + xy: 499, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium1 rotate: false - xy: 127, 6 + xy: 499, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium2 rotate: false - xy: 137, 6 + xy: 499, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium3 rotate: false - xy: 147, 6 + xy: 409, 352 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumdrill rotate: false - xy: 157, 6 + xy: 419, 352 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumpurifier rotate: false - xy: 167, 6 + xy: 407, 342 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumshieldwall rotate: false - xy: 177, 6 + xy: 407, 332 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumwall rotate: false - xy: 192, 16 + xy: 417, 342 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/turret rotate: false - xy: 393, 394 + xy: 393, 370 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 +blocks/uranium1 + rotate: false + xy: 417, 332 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/uranium2 + rotate: false + xy: 407, 312 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/uranium3 + rotate: false + xy: 417, 322 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/uraniumdrill + rotate: false + xy: 407, 302 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 blocks/water rotate: false - xy: 197, 6 + xy: 417, 312 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -643,7 +699,7 @@ blocks/wateredge index: -1 blocks/waveturret rotate: false - xy: 393, 382 + xy: 397, 358 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -825,42 +881,49 @@ enemies/tankenemy-t3 index: -1 icon-coal rotate: false - xy: 397, 322 + xy: 230, 52 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-dirium rotate: false - xy: 397, 312 + xy: 230, 42 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-iron rotate: false - xy: 397, 302 + xy: 228, 32 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-steel rotate: false - xy: 397, 292 + xy: 409, 402 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-stone rotate: false - xy: 407, 362 + xy: 405, 392 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-titanium rotate: false - xy: 407, 352 + xy: 405, 382 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +icon-uranium + rotate: false + xy: 405, 372 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -881,7 +944,7 @@ laserend index: -1 player rotate: false - xy: 417, 302 + xy: 489, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1012,62 +1075,69 @@ ui/icon-close-over orig: 40, 40 offset: 0, 0 index: -1 -ui/icon-cursor +ui/icon-crafting rotate: false xy: 483, 453 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-defense +ui/icon-cursor rotate: false xy: 457, 423 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-distribution +ui/icon-defense rotate: false xy: 457, 411 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-menu +ui/icon-distribution rotate: false xy: 105, 2 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-pause +ui/icon-menu rotate: false xy: 204, 34 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-play +ui/icon-pause rotate: false xy: 216, 34 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-power +ui/icon-play rotate: false xy: 385, 358 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-production +ui/icon-power rotate: false xy: 385, 346 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 +ui/icon-production + rotate: false + xy: 385, 334 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 ui/icon-rotate rotate: false xy: 425, 408 @@ -1084,14 +1154,21 @@ ui/icon-rotate-arrow index: -1 ui/icon-settings rotate: false - xy: 385, 334 + xy: 385, 322 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-touch rotate: false - xy: 385, 322 + xy: 385, 310 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +ui/icon-weapon + rotate: false + xy: 385, 298 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1154,21 +1231,21 @@ ui/scroll-knob-vertical index: -1 ui/selection rotate: false - xy: 117, 1 + xy: 422, 409 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 ui/separator rotate: false - xy: 120, 1 + xy: 117, 1 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 ui/slider rotate: false - xy: 228, 154 + xy: 419, 402 size: 1, 8 orig: 1, 8 offset: 0, 0 @@ -1241,35 +1318,35 @@ weapons/blaster index: -1 weapons/flamer rotate: false - xy: 405, 382 + xy: 399, 268 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/mortar rotate: false - xy: 417, 352 + xy: 401, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/multigun rotate: false - xy: 417, 332 + xy: 401, 208 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/railgun rotate: false - xy: 371, 224 + xy: 142, 16 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/triblaster rotate: false - xy: 187, 6 + xy: 407, 322 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 5a6f224dd3..c6d82ad241 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/src/io/anuke/mindustry/EffectCreator.java b/core/src/io/anuke/mindustry/EffectCreator.java index e8c578863f..1a309736ba 100644 --- a/core/src/io/anuke/mindustry/EffectCreator.java +++ b/core/src/io/anuke/mindustry/EffectCreator.java @@ -85,6 +85,13 @@ public class EffectCreator{ Draw.reset(); }); + Effects.create("purifyoil", 10, e -> { + Draw.color(Hue.mix(Color.BLACK, Color.GRAY, e.ifract())); + Draw.thickness(2f); + Draw.spikes(e.x, e.y, e.ifract() * 4f, 2, 6); + Draw.reset(); + }); + Effects.create("generate", 11, e -> { Draw.color(Hue.mix(Color.ORANGE, Color.YELLOW, e.ifract())); Draw.thickness(1f); diff --git a/core/src/io/anuke/mindustry/UI.java b/core/src/io/anuke/mindustry/UI.java index ae407c1c8c..aeb2455ee8 100644 --- a/core/src/io/anuke/mindustry/UI.java +++ b/core/src/io/anuke/mindustry/UI.java @@ -40,6 +40,8 @@ public class UI extends SceneModule{ VisibilityProvider play = () -> !GameState.is(State.menu); VisibilityProvider nplay = () -> GameState.is(State.menu); + private Array tempItems = new Array<>(); + public UI() { Dialog.setShowAction(()-> sequence(Actions.moveToAligned(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), Align.center), parallel(Actions.moveToAligned(Gdx.graphics.getWidth()/2, @@ -237,12 +239,16 @@ public class UI extends SceneModule{ } }); button.setName("sectionbutton" + sec.name()); - add(button).fill().height(54).padRight(-0.1f).padTop(-10).units(Unit.dp); - button.getImageCell().size(40).padBottom(4).units(Unit.dp); + add(button).growX().height(54).padTop(sec.ordinal() <= 2 ? -10 : -5).units(Unit.dp); + button.getImageCell().size(40).padBottom(4).padTop(2).units(Unit.dp); group.add(button); + if(sec.ordinal() % 3 == 2 && sec.ordinal() > 0){ + row(); + } + table.pad(4); - table.top(); + table.top().left(); int i = 0; @@ -277,12 +283,6 @@ public class UI extends SceneModule{ i++; } - //additional padding - for(int j = 0; j < maxcol - (int)((float)recipes.size/rows+2); j ++){ - table.row(); - table.add().size(size); - } - table.setVisible(()-> button.isChecked()); stack.add(table); @@ -290,7 +290,7 @@ public class UI extends SceneModule{ row(); - add(stack).colspan(3); + add(stack).colspan(Section.values().length); get().pad(10f); get().padLeft(0f); @@ -716,8 +716,14 @@ public class UI extends SceneModule{ public void updateItems(){ itemtable.clear(); itemtable.left(); + + tempItems.clear(); + for(Item item : control.getItems().keys()){ + tempItems.add(item); + } + tempItems.sort(); - for(Item stack : control.getItems().keys()){ + for(Item stack : tempItems){ Image image = new Image(Draw.region("icon-" + stack.name())); Label label = new Label("" + Mindustry.formatter.format(control.getAmount(stack))); label.setFontScale(fontscale*1.5f); diff --git a/core/src/io/anuke/mindustry/entities/effect/Shield.java b/core/src/io/anuke/mindustry/entities/effect/Shield.java index 7c696fa189..86a00b4cfd 100644 --- a/core/src/io/anuke/mindustry/entities/effect/Shield.java +++ b/core/src/io/anuke/mindustry/entities/effect/Shield.java @@ -6,9 +6,11 @@ import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.defense.ShieldBlock; import io.anuke.ucore.core.Draw; import io.anuke.ucore.core.Graphics; +import io.anuke.ucore.core.Timers; import io.anuke.ucore.entities.BulletEntity; import io.anuke.ucore.entities.Entities; import io.anuke.ucore.entities.Entity; +import io.anuke.ucore.util.Mathf; public class Shield extends Entity{ public boolean active; @@ -55,10 +57,12 @@ public class Shield extends Entity{ ShieldBlock block = (ShieldBlock)tile.block(); + float rad = block.shieldRadius*2 + Mathf.sin(Timers.time(), 25f, 2f); + Graphics.surface("shield", false); Draw.color(Color.ROYAL); Draw.thick(2f); - Draw.rect("circle2", x, y, block.shieldRadius*2, block.shieldRadius*2); + Draw.rect("circle2", x, y, rad, rad); Draw.reset(); Graphics.surface(); } diff --git a/core/src/io/anuke/mindustry/resource/Item.java b/core/src/io/anuke/mindustry/resource/Item.java index 9097f6a7c3..63ca663516 100644 --- a/core/src/io/anuke/mindustry/resource/Item.java +++ b/core/src/io/anuke/mindustry/resource/Item.java @@ -1,5 +1,5 @@ package io.anuke.mindustry.resource; public enum Item{ - stone, iron, coal, steel, titanium, dirium; + stone, iron, coal, steel, titanium, dirium, uranium; } diff --git a/core/src/io/anuke/mindustry/resource/Mech.java b/core/src/io/anuke/mindustry/resource/Mech.java new file mode 100644 index 0000000000..944bf8d5d4 --- /dev/null +++ b/core/src/io/anuke/mindustry/resource/Mech.java @@ -0,0 +1,16 @@ +package io.anuke.mindustry.resource; + +public enum Mech{ + normal("default"), + scout("scout"){{ + + }}; + public final String name; + public float speedBoost = 1f, damageBoost = 1f; + public int regenRate = 10; + public int health = 20; + + private Mech(String name){ + this.name = name; + } +} diff --git a/core/src/io/anuke/mindustry/resource/Recipe.java b/core/src/io/anuke/mindustry/resource/Recipe.java index e42538d32c..91f465773b 100644 --- a/core/src/io/anuke/mindustry/resource/Recipe.java +++ b/core/src/io/anuke/mindustry/resource/Recipe.java @@ -8,47 +8,52 @@ import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.blocks.*; public enum Recipe{ - stonewall(distribution, DefenseBlocks.stonewall, stack(Item.stone, 2)), - ironwall(distribution, DefenseBlocks.ironwall, stack(Item.iron, 2)), - steelwall(distribution, DefenseBlocks.steelwall, stack(Item.steel, 2)), - titaniumwall(distribution, DefenseBlocks.titaniumwall, stack(Item.titanium, 2)), - duriumwall(distribution, DefenseBlocks.diriumwall, stack(Item.dirium, 2)), - compositewall(distribution, DefenseBlocks.compositewall, stack(Item.dirium, 2), stack(Item.titanium, 2), stack(Item.steel, 2), stack(Item.iron, 2)), - titaniumshieldwall(distribution, DefenseBlocks.titaniumshieldwall, stack(Item.titanium, 2)), - conveyor(distribution, DistributionBlocks.conveyor, stack(Item.stone, 1)), - fastconveyor(distribution, DistributionBlocks.steelconveyor, stack(Item.steel, 1)), - router(distribution, DistributionBlocks.router, stack(Item.stone, 2)), - junction(distribution, DistributionBlocks.junction, stack(Item.iron, 2)), - - turret(defense, WeaponBlocks.turret, stack(Item.stone, 4)), - dturret(defense, WeaponBlocks.doubleturret, stack(Item.stone, 7)), - machineturret(defense, WeaponBlocks.machineturret, stack(Item.iron, 8), stack(Item.stone, 10)), - shotgunturret(defense, WeaponBlocks.shotgunturret, stack(Item.iron, 10), stack(Item.stone, 10)), - flameturret(defense, WeaponBlocks.flameturret, stack(Item.iron, 12), stack(Item.steel, 9)), - sniperturret(defense, WeaponBlocks.sniperturret, stack(Item.iron, 15), stack(Item.steel, 10)), - laserturret(defense, WeaponBlocks.laserturret, stack(Item.steel, 10), stack(Item.titanium, 10)), - mortarturret(defense, WeaponBlocks.mortarturret, stack(Item.steel, 20), stack(Item.titanium, 15)), - teslaturret(defense, WeaponBlocks.teslaturret, stack(Item.steel, 10), stack(Item.titanium, 15), stack(Item.dirium, 15)), - plasmaturret(defense, WeaponBlocks.plasmaturret, stack(Item.steel, 10), stack(Item.titanium, 10), stack(Item.dirium, 15)), - + stonewall(defense, DefenseBlocks.stonewall, stack(Item.stone, 2)), + ironwall(defense, DefenseBlocks.ironwall, stack(Item.iron, 2)), + steelwall(defense, DefenseBlocks.steelwall, stack(Item.steel, 2)), + titaniumwall(defense, DefenseBlocks.titaniumwall, stack(Item.titanium, 2)), + duriumwall(defense, DefenseBlocks.diriumwall, stack(Item.dirium, 2)), + compositewall(defense, DefenseBlocks.compositewall, stack(Item.dirium, 2), stack(Item.titanium, 2), stack(Item.steel, 2), stack(Item.iron, 2)), healturret(defense, DefenseBlocks.repairturret, stack(Item.iron, 30)), megahealturret(defense, DefenseBlocks.megarepairturret, stack(Item.iron, 20), stack(Item.steel, 30)), + titaniumshieldwall(defense, DefenseBlocks.titaniumshieldwall, stack(Item.titanium, 2)), + + conveyor(distribution, DistributionBlocks.conveyor, stack(Item.stone, 1)), + steelconveyor(distribution, DistributionBlocks.steelconveyor, stack(Item.steel, 1)), + poweredconveyor(distribution, DistributionBlocks.poweredconveyor, stack(Item.dirium, 1)), + router(distribution, DistributionBlocks.router, stack(Item.stone, 2)), + junction(distribution, DistributionBlocks.junction, stack(Item.iron, 2)), + conduit(distribution, DistributionBlocks.conduit, stack(Item.steel, 1)), + liquidrouter(distribution, DistributionBlocks.liquidrouter, stack(Item.steel, 2)), + liquidjunction(distribution, DistributionBlocks.liquidjunction, stack(Item.steel, 2)), + + turret(weapon, WeaponBlocks.turret, stack(Item.stone, 4)), + dturret(weapon, WeaponBlocks.doubleturret, stack(Item.stone, 7)), + machineturret(weapon, WeaponBlocks.machineturret, stack(Item.iron, 8), stack(Item.stone, 10)), + shotgunturret(weapon, WeaponBlocks.shotgunturret, stack(Item.iron, 10), stack(Item.stone, 10)), + flameturret(weapon, WeaponBlocks.flameturret, stack(Item.iron, 12), stack(Item.steel, 9)), + sniperturret(weapon, WeaponBlocks.sniperturret, stack(Item.iron, 15), stack(Item.steel, 10)), + laserturret(weapon, WeaponBlocks.laserturret, stack(Item.steel, 10), stack(Item.titanium, 10)), + mortarturret(weapon, WeaponBlocks.mortarturret, stack(Item.steel, 20), stack(Item.titanium, 15)), + teslaturret(weapon, WeaponBlocks.teslaturret, stack(Item.steel, 10), stack(Item.titanium, 15), stack(Item.dirium, 15)), + plasmaturret(weapon, WeaponBlocks.plasmaturret, stack(Item.steel, 10), stack(Item.titanium, 10), stack(Item.dirium, 15)), + + smelter(crafting, ProductionBlocks.smelter, stack(Item.stone, 40), stack(Item.iron, 40)), + crucible(crafting, ProductionBlocks.crucible, stack(Item.titanium, 40), stack(Item.steel, 40)), + coalpurifier(crafting, ProductionBlocks.coalpurifier, stack(Item.steel, 10), stack(Item.iron, 10)), + titaniumpurifier(crafting, ProductionBlocks.titaniumpurifier, stack(Item.steel, 30), stack(Item.iron, 30)), + oilrefinery(crafting, ProductionBlocks.oilrefinery, stack(Item.steel, 30), stack(Item.iron, 30)), stonedrill(production, ProductionBlocks.stonedrill, stack(Item.stone, 12)), irondrill(production, ProductionBlocks.irondrill, stack(Item.stone, 25)), coaldrill(production, ProductionBlocks.coaldrill, stack(Item.stone, 25), stack(Item.iron, 40)), titaniumdrill(production, ProductionBlocks.titaniumdrill, stack(Item.iron, 40), stack(Item.steel, 40)), - smelter(production, ProductionBlocks.smelter, stack(Item.stone, 40), stack(Item.iron, 40)), - crucible(production, ProductionBlocks.crucible, stack(Item.titanium, 40), stack(Item.steel, 40)), - coalpurifier(production, ProductionBlocks.coalpurifier, stack(Item.steel, 10), stack(Item.iron, 10)), - titaniumpurifier(production, ProductionBlocks.titaniumpurifier, stack(Item.steel, 30), stack(Item.iron, 30)), - omnidrill(production, ProductionBlocks.omnidrill, stack(Item.titanium, 10), stack(Item.dirium, 10)), + uraniumdrill(production, ProductionBlocks.uraniumdrill, stack(Item.titanium, 20), stack(Item.steel, 40)), + omnidrill(production, ProductionBlocks.omnidrill, stack(Item.titanium, 20), stack(Item.dirium, 20)), coalgenerator(power, ProductionBlocks.coalgenerator, stack(Item.titanium, 10), stack(Item.dirium, 10)), shieldgenerator(power, DefenseBlocks.shieldgenerator, stack(Item.titanium, 10), stack(Item.dirium, 10)), - conduit(distribution, DistributionBlocks.conduit, stack(Item.steel, 1)), - liquidrouter(distribution, DistributionBlocks.liquidrouter, stack(Item.steel, 2)), pump(production, ProductionBlocks.pump, stack(Item.steel, 10)); public Block result; diff --git a/core/src/io/anuke/mindustry/resource/Section.java b/core/src/io/anuke/mindustry/resource/Section.java index 06da625c1f..feb383eca8 100644 --- a/core/src/io/anuke/mindustry/resource/Section.java +++ b/core/src/io/anuke/mindustry/resource/Section.java @@ -1,5 +1,5 @@ package io.anuke.mindustry.resource; public enum Section{ - defense, production, distribution, power; + weapon, production, distribution, power, defense, crafting; } diff --git a/core/src/io/anuke/mindustry/world/Generator.java b/core/src/io/anuke/mindustry/world/Generator.java index 37d810dd23..5c6e99b7ce 100644 --- a/core/src/io/anuke/mindustry/world/Generator.java +++ b/core/src/io/anuke/mindustry/world/Generator.java @@ -69,6 +69,10 @@ public class Generator{ if(Noise.nnoise(x + 9999, y + 9999, 8, 1) > 0.253){ floor = Blocks.titanium; } + + if(Noise.nnoise(x + 99999, y + 99999, 6, 1) > 0.254){ + floor = Blocks.uranium; + } } if(block == Blocks.grassblock){ diff --git a/core/src/io/anuke/mindustry/world/blocks/Blocks.java b/core/src/io/anuke/mindustry/world/blocks/Blocks.java index ed87cfb4dc..a2b0d2679f 100644 --- a/core/src/io/anuke/mindustry/world/blocks/Blocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/Blocks.java @@ -87,6 +87,10 @@ public class Blocks{ drops = new ItemStack(Item.titanium, 1); }}, + uranium = new Floor("uranium"){{ + drops = new ItemStack(Item.uranium, 1); + }}, + dirt = new Floor("dirt"), grass = new Floor("grass"), diff --git a/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java index c94b88ddb8..90eb488389 100644 --- a/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java @@ -30,7 +30,7 @@ public class DistributionBlocks{ poweredconveyor = new Conveyor("poweredconveyor"){{ health = 90; speed = 0.09f; - formalName = "powered conveyor"; + formalName = "pulse conveyor"; }}, router = new Router("router"){ @@ -38,5 +38,8 @@ public class DistributionBlocks{ junction = new Junction("junction"){ + }, + liquidjunction = new LiquidJunction("liquidjunction"){ + }; } diff --git a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java index 89397d847f..cce0474318 100644 --- a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java @@ -65,7 +65,7 @@ public class ProductionBlocks{ } }, - coalpurifier = new Purifier("coalpurifier"){ + coalpurifier = new LiquidCrafter("coalpurifier"){ { formalName = "coal extractor"; input = Item.stone; @@ -83,7 +83,7 @@ public class ProductionBlocks{ } }, - titaniumpurifier = new Purifier("titaniumpurifier"){ + titaniumpurifier = new LiquidCrafter("titaniumpurifier"){ { formalName = "titanium\nextractor"; input = Item.iron; @@ -102,6 +102,24 @@ public class ProductionBlocks{ } }, + oilrefinery = new LiquidCrafter("oilrefinery"){ + { + formalName = "oil refinery"; + inputLiquid = Liquid.oil; + liquidAmount = 45f; + liquidCapacity = 46f; + purifyTime = 70; + output = Item.coal; + health = 80; + craftEffect = "purifyoil"; + } + + @Override + public String description(){ + return "Takes in oil, outputs coal."; + } + }, + stonedrill = new Drill("stonedrill"){{ resource = Blocks.stone; result = Item.stone; @@ -120,6 +138,12 @@ public class ProductionBlocks{ formalName = "coal drill"; }}, + uraniumdrill = new Drill("uraniumdrill"){{ + resource = Blocks.uranium; + result = Item.uranium; + formalName = "uranium drill"; + }}, + titaniumdrill = new Drill("titaniumdrill"){{ resource = Blocks.titanium; result = Item.titanium; @@ -153,7 +177,7 @@ public class ProductionBlocks{ coalgenerator = new ItemPowerGenerator("coalgenerator"){ { //TODO - generateItem = Item.stone; + generateItem = Item.coal; generateAmount = 4f; powerCapacity = 40f; } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java index 9f94d6da44..f09bcc9817 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java @@ -7,6 +7,8 @@ import io.anuke.mindustry.world.blocks.types.PowerBlock; import io.anuke.ucore.core.Timers; public class ShieldBlock extends PowerBlock{ + private static boolean debugShield = true; + public float shieldRadius = 40f; public float powerDrain = 0.01f; @@ -20,6 +22,8 @@ public class ShieldBlock extends PowerBlock{ if(entity.shield == null){ entity.shield = new Shield(tile); + if(debugShield) + entity.shield.add(); } if(entity.power > powerDrain * Timers.delta()){ @@ -29,7 +33,7 @@ public class ShieldBlock extends PowerBlock{ entity.power -= powerDrain * Timers.delta(); }else{ - if(entity.shield.active){ + if(entity.shield.active && !debugShield){ entity.shield.remove(); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidJunction.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidJunction.java new file mode 100644 index 0000000000..d0a2ff6a39 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidJunction.java @@ -0,0 +1,45 @@ +package io.anuke.mindustry.world.blocks.types.distribution; + +import io.anuke.mindustry.resource.Liquid; +import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.blocks.types.LiquidBlock; +import io.anuke.ucore.core.Draw; + +public class LiquidJunction extends LiquidBlock{ + + public LiquidJunction(String name) { + super(name); + update = true; + solid = true; + rotate = false; + } + + @Override + public void draw(Tile tile){ + Draw.rect(name(), tile.worldx(), tile.worldy()); + } + + @Override + public void handleLiquid(Tile tile, Tile source, Liquid liquid, float amount){ + int dir = source.relativeTo(tile.x, tile.y); + dir = (dir+4)%4; + Tile to = tile.getNearby()[dir]; + + ((LiquidBlock)to.block()).handleLiquid(to, tile, liquid, amount); + + } + + @Override + public boolean acceptLiquid(Tile dest, Tile source, Liquid liquid, float amount){ + int dir = source.relativeTo(dest.x, dest.y); + dir = (dir+4)%4; + Tile to = dest.getNearby()[dir]; + return to != null && to.block() != this && to.block() instanceof LiquidBlock && + ((LiquidBlock)to.block()).acceptLiquid(to, dest, liquid, amount); + } + + @Override + public String description(){ + return "Serves as a liquid junction."; + } +} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerBooster.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerBooster.java index be394233c0..6a75e487cf 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerBooster.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerBooster.java @@ -1,12 +1,21 @@ package io.anuke.mindustry.world.blocks.types.distribution; -import io.anuke.mindustry.world.blocks.types.PowerBlock; +import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.blocks.types.production.Generator; -public class PowerBooster extends PowerBlock{ +public class PowerBooster extends Generator{ //TODO public PowerBooster(String name) { super(name); } - + + @Override + public float addPower(Tile tile, float amount){ + PowerEntity entity = tile.entity(); + + float canAccept = Math.min(powerCapacity - entity.power, amount); + entity.power += canAccept; + return canAccept; + } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/Purifier.java b/core/src/io/anuke/mindustry/world/blocks/types/production/LiquidCrafter.java similarity index 81% rename from core/src/io/anuke/mindustry/world/blocks/types/production/Purifier.java rename to core/src/io/anuke/mindustry/world/blocks/types/production/LiquidCrafter.java index a5359e8c22..6fcd3552a5 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/Purifier.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/LiquidCrafter.java @@ -12,7 +12,8 @@ import io.anuke.ucore.core.Draw; import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Timers; -public class Purifier extends LiquidBlock{ +public class LiquidCrafter extends LiquidBlock{ + /**Can be null.*/ public Item input = null; public int inputAmount = 5; public Liquid inputLiquid = null; @@ -20,8 +21,9 @@ public class Purifier extends LiquidBlock{ public Item output = null; public int itemCapacity = 90; public int purifyTime = 80; + public String craftEffect = "purify"; - public Purifier(String name) { + public LiquidCrafter(String name) { super(name); update = true; rotate = false; @@ -48,12 +50,13 @@ public class Purifier extends LiquidBlock{ LiquidEntity entity = tile.entity(); if(Timers.get(tile, "purify", purifyTime) && entity.liquidAmount >= liquidAmount && - entity.hasItem(input, inputAmount)){ + (input == null || entity.hasItem(input, inputAmount))){ - entity.removeItem(input, inputAmount); + if(input != null) + entity.removeItem(input, inputAmount); entity.liquidAmount -= liquidAmount; offloadNear(tile, output); - Effects.effect("purify", tile.worldx(), tile.worldy()); + Effects.effect(craftEffect, tile.worldx(), tile.worldy()); } if(Timers.get(tile.hashCode(), "dump", 30)){ @@ -63,6 +66,8 @@ public class Purifier extends LiquidBlock{ @Override public void drawPixelOverlay(Tile tile){ + if(input == null) return; + float fract = (float)tile.entity.items.get(input, 0) / itemCapacity; Vars.renderer.drawBar(Color.GREEN, tile.worldx(), tile.worldy() + 13, fract); @@ -76,7 +81,7 @@ public class Purifier extends LiquidBlock{ @Override public boolean acceptItem(Item item, Tile tile, Tile source){ TileEntity entity = tile.entity(); - return item == input && entity.items.get(item, 0) < itemCapacity; + return input != null && item == input && entity.items.get(item, 0) < itemCapacity; } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/Pump.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Pump.java index 4281020c01..38ca649891 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/Pump.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Pump.java @@ -13,6 +13,7 @@ public class Pump extends LiquidBlock{ public Pump(String name) { super(name); rotate = false; + solid = true; } @Override