diff --git a/core/assets-raw/sprites/blocks/lava.png b/core/assets-raw/sprites/blocks/lava.png new file mode 100644 index 0000000000..8ef9d3966b Binary files /dev/null and b/core/assets-raw/sprites/blocks/lava.png differ diff --git a/core/assets-raw/sprites/blocks/lavaedge.png b/core/assets-raw/sprites/blocks/lavaedge.png new file mode 100644 index 0000000000..69ce2f2332 Binary files /dev/null and b/core/assets-raw/sprites/blocks/lavaedge.png differ diff --git a/core/assets-raw/sprites/ui/button-gray-over.9.png b/core/assets-raw/sprites/ui/button-gray-over.9.png deleted file mode 100644 index 31a904acba..0000000000 Binary files a/core/assets-raw/sprites/ui/button-gray-over.9.png and /dev/null differ diff --git a/core/assets-raw/sprites/ui/button-gray.9.png b/core/assets-raw/sprites/ui/button-gray.9.png deleted file mode 100644 index d47e70b84f..0000000000 Binary files a/core/assets-raw/sprites/ui/button-gray.9.png and /dev/null differ diff --git a/core/assets-raw/sprites/ui/slot.9.png b/core/assets-raw/sprites/ui/slot.9.png deleted file mode 100644 index 66d175ec16..0000000000 Binary files a/core/assets-raw/sprites/ui/slot.9.png and /dev/null differ diff --git a/core/assets-raw/sprites/ui/window-gray.9.png b/core/assets-raw/sprites/ui/window-gray.9.png deleted file mode 100644 index 36c4fc6ca5..0000000000 Binary files a/core/assets-raw/sprites/ui/window-gray.9.png and /dev/null differ diff --git a/core/assets/maps/delta.png b/core/assets/maps/delta.png index 9e2c2f6713..e1522308a8 100644 Binary files a/core/assets/maps/delta.png and b/core/assets/maps/delta.png differ diff --git a/core/assets/shaders/pattern.fragment b/core/assets/shaders/pattern.fragment new file mode 100644 index 0000000000..4a25d505b3 --- /dev/null +++ b/core/assets/shaders/pattern.fragment @@ -0,0 +1,60 @@ +#ifdef GL_ES +precision mediump float; +precision mediump int; +#endif + +uniform sampler2D u_texture; + +uniform vec4 u_color; +uniform vec2 u_texsize; +uniform float u_time; +uniform vec2 u_offset; + +varying vec4 v_color; +varying vec2 v_texCoord; + +void main() { + + vec2 T = v_texCoord.xy; + vec2 coords = (T * u_texsize) + u_offset; + + 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); + + vec2 v = vec2(1.0/u_texsize.x, 1.0/u_texsize.y); + + bool any = false; + + float thickness = 1.0; + float step = 1.0; + + 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 || + texture2D(u_texture, T + vec2(step, 0) * v).a > 0.1 || texture2D(u_texture, T + vec2(-step, 0) * v).a > 0.1)) + any = true; + + if(any){ + gl_FragColor = u_color * vec4(si, si, si, 1.0); + }else{ + + //coords.x = float(int(coords.x)); + if(color.a > 0.1){ + float x = coords.x; + float y = coords.y; + float time = u_time; + float w = 1.0; + float h = 1.0; + float f1 = sin(2.0*time+(y/4.0*cos(time/3.0)+(x/2.0)-w/4.0)*((y/3.0)-h/4.0)/w); + float f2 = -2.0*cos(11.0*time/9.0-11.0*pow(y, x)/9.0); + + color.r = (f2 + f1) / 4.0*abs(cos(2.0*(x-y)/w + time)); + color.g = (f2 + f1) /(3.0 + color.r); + color.b = (f2 + f1) /(2.5 + color.g); + + + } + + gl_FragColor = color; + } +} diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index 4117ce31b1..4a3d88586e 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -13,623 +13,637 @@ backgrounds/background index: -1 blank rotate: false - xy: 295, 218 + xy: 450, 490 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 blocks/block rotate: false - xy: 412, 401 + xy: 503, 493 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coal1 rotate: false - xy: 369, 214 + xy: 503, 473 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coal2 rotate: false - xy: 484, 453 + xy: 503, 463 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coal3 rotate: false - xy: 416, 391 + xy: 397, 324 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coaldrill rotate: false - xy: 383, 226 + xy: 397, 314 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalgenerator rotate: false - xy: 312, 151 + xy: 397, 304 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalpurifier rotate: false - xy: 316, 141 + xy: 397, 294 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/compositewall rotate: false - xy: 316, 131 + xy: 397, 284 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduit rotate: false - xy: 316, 121 + xy: 457, 451 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduitbottom rotate: false - xy: 316, 111 + xy: 457, 441 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduitliquid rotate: false - xy: 316, 101 + xy: 457, 431 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduittop rotate: false - xy: 316, 91 + xy: 457, 421 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyor rotate: false - xy: 316, 81 + xy: 457, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyormove rotate: false - xy: 316, 71 + xy: 117, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/core rotate: false - xy: 316, 61 + xy: 230, 62 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/cross rotate: false - xy: 316, 51 + xy: 230, 52 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/crucible rotate: false - xy: 383, 374 + xy: 230, 42 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/deepwater rotate: false - xy: 383, 364 + xy: 228, 32 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt1 rotate: false - xy: 383, 354 + xy: 409, 402 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt2 rotate: false - xy: 383, 344 + xy: 405, 392 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt3 rotate: false - xy: 393, 375 + xy: 405, 382 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirtblock rotate: false - xy: 393, 365 + xy: 405, 372 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirtedge rotate: false - xy: 1, 1 + xy: 37, 1 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/doubleturret rotate: false - xy: 302, 209 + xy: 105, 2 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/drill rotate: false - xy: 393, 355 + xy: 371, 224 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/duriumwall rotate: false - xy: 393, 345 + xy: 371, 214 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/flameturret rotate: false - xy: 302, 197 + xy: 204, 34 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/grass1 rotate: false - xy: 199, 18 + xy: 381, 226 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass2 rotate: false - xy: 209, 32 + xy: 381, 216 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass3 rotate: false - xy: 209, 22 + xy: 381, 206 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock rotate: false - xy: 219, 32 + xy: 471, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock2 rotate: false - xy: 219, 22 + xy: 481, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassedge rotate: false - xy: 43, 1 + xy: 79, 1 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/iron1 rotate: false - xy: 229, 12 + xy: 487, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron2 rotate: false - xy: 239, 18 + xy: 467, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron3 rotate: false - xy: 239, 8 + xy: 477, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/irondrill rotate: false - xy: 420, 437 + xy: 487, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ironwall rotate: false - xy: 420, 427 + xy: 477, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/junction rotate: false - xy: 420, 417 + xy: 487, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/laserturret rotate: false - xy: 304, 139 + xy: 140, 26 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 +blocks/lava + rotate: false + xy: 487, 415 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/lavaedge + rotate: false + xy: 92, 16 + size: 12, 12 + orig: 12, 12 + offset: 0, 0 + index: -1 blocks/liquidrouter rotate: false - xy: 430, 437 + xy: 501, 453 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/machineturret rotate: false - xy: 304, 127 + xy: 152, 26 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/megarepairturret rotate: false - xy: 304, 115 + xy: 164, 26 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/mortarturret rotate: false - xy: 304, 103 + xy: 176, 26 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/mossblock rotate: false - xy: 430, 417 + xy: 497, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/mossstone rotate: false - xy: 430, 417 + xy: 497, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/omnidrill rotate: false - xy: 440, 430 + xy: 497, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/plasmaturret rotate: false - xy: 304, 91 + xy: 188, 26 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/pump rotate: false - xy: 450, 437 + xy: 132, 16 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/repairturret rotate: false - xy: 304, 79 + xy: 393, 394 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/rock rotate: false - xy: 460, 437 + xy: 152, 16 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rock2 rotate: false - xy: 470, 439 + xy: 162, 16 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rock2shadow rotate: false - xy: 460, 427 + xy: 172, 16 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow rotate: false - xy: 470, 429 + xy: 182, 16 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/router rotate: false - xy: 450, 417 + xy: 127, 6 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/shadow rotate: false - xy: 304, 67 + xy: 393, 382 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/shieldgenerator rotate: false - xy: 460, 417 + xy: 137, 6 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/shotgunturret rotate: false - xy: 304, 55 + xy: 393, 370 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/shrub rotate: false - xy: 470, 419 + xy: 147, 6 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/shrubshadow rotate: false - xy: 440, 410 + xy: 157, 6 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/smelter rotate: false - xy: 450, 407 + xy: 167, 6 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sniperturret rotate: false - xy: 160, 7 + xy: 397, 358 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/steelconveyor rotate: false - xy: 460, 407 + xy: 177, 6 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyormove rotate: false - xy: 470, 409 + xy: 192, 16 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelwall rotate: false - xy: 496, 467 + xy: 187, 6 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone rotate: false - xy: 57, 1 + xy: 375, 236 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/stone1 rotate: false - xy: 252, 40 + xy: 197, 6 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone2 rotate: false - xy: 262, 44 + xy: 415, 392 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone3 rotate: false - xy: 272, 44 + xy: 415, 382 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock rotate: false - xy: 282, 44 + xy: 415, 372 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock2 rotate: false - xy: 292, 44 + xy: 409, 362 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock3 rotate: false - xy: 404, 379 + xy: 409, 352 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stonedrill rotate: false - xy: 403, 369 + xy: 409, 342 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneedge rotate: false - xy: 71, 1 + xy: 357, 220 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/stonewall rotate: false - xy: 403, 359 + xy: 409, 332 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium1 rotate: false - xy: 403, 349 + xy: 407, 322 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium2 rotate: false - xy: 122, 2 + xy: 407, 312 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium3 rotate: false - xy: 132, 2 + xy: 407, 302 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumdrill rotate: false - xy: 379, 214 + xy: 407, 292 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumpurifier rotate: false - xy: 484, 443 + xy: 407, 282 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumshieldwall rotate: false - xy: 480, 433 + xy: 419, 362 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumwall rotate: false - xy: 480, 423 + xy: 419, 352 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/turret rotate: false - xy: 172, 10 + xy: 397, 346 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/water rotate: false - xy: 315, 215 + xy: 419, 332 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/wateredge rotate: false - xy: 470, 449 + xy: 357, 206 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/waveturret rotate: false - xy: 184, 10 + xy: 397, 334 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 bullet rotate: false - xy: 359, 214 + xy: 503, 483 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 circle rotate: false - xy: 148, 19 + xy: 233, 180 size: 17, 17 orig: 17, 17 offset: 0, 0 @@ -643,224 +657,224 @@ circle2 index: -1 enemies/blastenemy-t1 rotate: false - xy: 256, 118 + xy: 409, 428 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/blastenemy-t2 rotate: false - xy: 388, 385 + xy: 425, 440 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/blastenemy-t3 rotate: false - xy: 272, 134 + xy: 470, 497 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/enemy-t1 rotate: false - xy: 315, 225 + xy: 252, 183 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/targetenemy-t1 rotate: false - xy: 315, 225 + xy: 252, 183 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/enemy-t2 rotate: false - xy: 15, 1 + xy: 51, 1 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 enemies/enemy-t3 rotate: false - xy: 29, 1 + xy: 65, 1 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 enemies/fastenemy-t1 rotate: false - xy: 167, 22 + xy: 409, 412 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/fastenemy-t2 rotate: false - xy: 256, 102 + xy: 425, 424 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/fastenemy-t3 rotate: false - xy: 272, 118 + xy: 486, 497 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/flamerenemy-t1 rotate: false - xy: 331, 225 + xy: 268, 183 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/flamerenemy-t2 rotate: false - xy: 183, 22 + xy: 284, 183 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/flamerenemy-t3 rotate: false - xy: 256, 86 + xy: 300, 183 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/mortarenemy-t1 rotate: false - xy: 272, 70 + xy: 106, 14 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/mortarenemy-t2 rotate: false - xy: 272, 54 + xy: 455, 477 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/mortarenemy-t3 rotate: false - xy: 288, 134 + xy: 455, 461 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/rapidenemy-t1 rotate: false - xy: 288, 118 + xy: 471, 481 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/rapidenemy-t2 rotate: false - xy: 288, 102 + xy: 471, 465 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/rapidenemy-t3 rotate: false - xy: 288, 86 + xy: 487, 481 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/tankenemy-t1 rotate: false - xy: 288, 70 + xy: 487, 465 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/tankenemy-t2 rotate: false - xy: 288, 54 + xy: 316, 183 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/tankenemy-t3 rotate: false - xy: 454, 447 + xy: 359, 234 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-coal rotate: false - xy: 229, 32 + xy: 491, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-dirium rotate: false - xy: 229, 22 + xy: 467, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-iron rotate: false - xy: 239, 28 + xy: 467, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-steel rotate: false - xy: 199, 8 + xy: 477, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-stone rotate: false - xy: 209, 12 + xy: 467, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-titanium rotate: false - xy: 219, 12 + xy: 477, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laser rotate: false - xy: 85, 1 + xy: 228, 164 size: 1, 12 orig: 1, 12 offset: 0, 0 index: -1 laserend rotate: false - xy: 295, 221 + xy: 450, 493 size: 18, 18 orig: 18, 18 offset: 0, 0 index: -1 player rotate: false - xy: 440, 420 + xy: 122, 16 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ui/button rotate: false - xy: 230, 50 + xy: 359, 322 size: 24, 40 split: 10, 10, 6, 10 orig: 24, 40 @@ -868,7 +882,7 @@ ui/button index: -1 ui/button-down rotate: false - xy: 246, 176 + xy: 275, 199 size: 24, 40 split: 10, 10, 6, 10 orig: 24, 40 @@ -876,33 +890,15 @@ ui/button-down index: -1 ui/button-over rotate: false - xy: 246, 176 + xy: 275, 199 size: 24, 40 split: 10, 10, 6, 10 orig: 24, 40 offset: 0, 0 index: -1 -ui/button-gray - rotate: false - xy: 246, 134 - size: 24, 40 - split: 10, 10, 10, 8 - pad: 8, 8, 2, 2 - orig: 24, 40 - offset: 0, 0 - index: -1 -ui/button-gray-over - rotate: false - xy: 204, 92 - size: 24, 40 - split: 10, 10, 10, 8 - pad: 8, 8, 2, 2 - orig: 24, 40 - offset: 0, 0 - index: -1 ui/button-map rotate: false - xy: 230, 92 + xy: 301, 199 size: 24, 40 split: 10, 10, 5, 10 orig: 24, 40 @@ -910,7 +906,7 @@ ui/button-map index: -1 ui/button-map-down rotate: false - xy: 204, 50 + xy: 359, 364 size: 24, 40 split: 10, 10, 5, 10 orig: 24, 40 @@ -918,7 +914,7 @@ ui/button-map-down index: -1 ui/button-map-over rotate: false - xy: 204, 50 + xy: 359, 364 size: 24, 40 split: 10, 10, 5, 10 orig: 24, 40 @@ -926,7 +922,7 @@ ui/button-map-over index: -1 ui/button-select rotate: false - xy: 122, 12 + xy: 204, 46 size: 24, 24 split: 4, 4, 4, 4 orig: 24, 24 @@ -934,168 +930,168 @@ ui/button-select index: -1 ui/check-off rotate: false - xy: 359, 266 + xy: 327, 207 size: 28, 32 orig: 28, 32 offset: 0, 0 index: -1 ui/check-on rotate: false - xy: 272, 184 + xy: 359, 250 size: 28, 32 orig: 28, 32 offset: 0, 0 index: -1 ui/check-over rotate: false - xy: 272, 150 + xy: 425, 456 size: 28, 32 orig: 28, 32 offset: 0, 0 index: -1 ui/clear rotate: false - xy: 347, 229 + xy: 93, 4 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/cursor rotate: false - xy: 383, 338 + xy: 1, 1 size: 4, 4 orig: 4, 4 offset: 0, 0 index: -1 ui/icon-cancel rotate: false - xy: 272, 102 + xy: 441, 440 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 ui/icon-check rotate: false - xy: 256, 70 + xy: 441, 424 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 ui/icon-close rotate: false - xy: 204, 176 + xy: 359, 448 size: 40, 40 orig: 40, 40 offset: 0, 0 index: -1 ui/icon-close-down rotate: false - xy: 454, 471 + xy: 233, 199 size: 40, 40 orig: 40, 40 offset: 0, 0 index: -1 ui/icon-close-over rotate: false - xy: 204, 134 + xy: 359, 406 size: 40, 40 orig: 40, 40 offset: 0, 0 index: -1 ui/icon-cursor rotate: false - xy: 302, 185 + xy: 216, 34 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-defense rotate: false - xy: 302, 173 + xy: 385, 358 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-distribution rotate: false - xy: 302, 161 + xy: 385, 346 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-menu rotate: false - xy: 240, 38 + xy: 385, 334 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-pause rotate: false - xy: 404, 389 + xy: 385, 322 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-play rotate: false - xy: 148, 7 + xy: 385, 310 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-production rotate: false - xy: 359, 224 + xy: 385, 298 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-rotate rotate: false - xy: 272, 86 + xy: 425, 408 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 ui/icon-rotate-arrow rotate: false - xy: 256, 54 + xy: 441, 408 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 ui/icon-settings rotate: false - xy: 371, 224 + xy: 385, 286 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-touch rotate: false - xy: 347, 217 + xy: 128, 26 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/logotext rotate: false - xy: 1, 15 + xy: 359, 490 size: 89, 21 orig: 89, 21 offset: 0, 0 index: -1 ui/logotext-gray rotate: false - xy: 204, 218 + xy: 1, 15 size: 89, 21 orig: 89, 21 offset: 0, 0 index: -1 ui/pane rotate: false - xy: 359, 300 + xy: 359, 284 size: 24, 36 split: 10, 10, 5, 5 orig: 24, 36 @@ -1103,7 +1099,7 @@ ui/pane index: -1 ui/scroll rotate: false - xy: 204, 42 + xy: 92, 30 size: 34, 6 split: 4, 4, 2, 2 orig: 34, 6 @@ -1111,7 +1107,7 @@ ui/scroll index: -1 ui/scroll-horizontal rotate: false - xy: 496, 477 + xy: 401, 408 size: 6, 34 split: 2, 2, 0, 34 pad: 0, 5, 5, 4 @@ -1120,7 +1116,7 @@ ui/scroll-horizontal index: -1 ui/scroll-knob-horizontal rotate: false - xy: 412, 411 + xy: 385, 370 size: 6, 34 split: 2, 2, 0, 34 pad: 0, 5, 13, 12 @@ -1129,7 +1125,7 @@ ui/scroll-knob-horizontal index: -1 ui/scroll-knob-vertical rotate: false - xy: 454, 463 + xy: 1, 7 size: 34, 6 split: 12, 12, 2, 2 orig: 34, 6 @@ -1137,64 +1133,56 @@ ui/scroll-knob-vertical index: -1 ui/selection rotate: false - xy: 167, 19 + xy: 422, 409 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 ui/separator rotate: false - xy: 435, 447 + xy: 117, 1 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 ui/slider rotate: false - xy: 196, 12 + xy: 419, 402 size: 1, 8 orig: 1, 8 offset: 0, 0 index: -1 ui/slider-knob rotate: false - xy: 359, 338 + xy: 204, 132 size: 22, 44 orig: 22, 44 offset: 0, 0 index: -1 ui/slider-knob-down rotate: false - xy: 388, 401 + xy: 401, 444 size: 22, 44 orig: 22, 44 offset: 0, 0 index: -1 ui/slider-knob-over rotate: false - xy: 388, 401 + xy: 401, 444 size: 22, 44 orig: 22, 44 offset: 0, 0 index: -1 ui/slider-vertical rotate: false - xy: 425, 447 + xy: 93, 1 size: 8, 1 orig: 8, 1 offset: 0, 0 index: -1 -ui/slot - rotate: false - xy: 359, 447 - size: 64, 64 - split: 4, 8, 8, 4 - orig: 64, 64 - offset: 0, 0 - index: -1 ui/textfield rotate: false - xy: 92, 8 + xy: 204, 72 size: 28, 28 split: 6, 6, 6, 6 orig: 28, 28 @@ -1202,7 +1190,7 @@ ui/textfield index: -1 ui/textfield-over rotate: false - xy: 359, 236 + xy: 204, 102 size: 28, 28 split: 2, 2, 2, 2 orig: 28, 28 @@ -1210,65 +1198,57 @@ ui/textfield-over index: -1 ui/white rotate: false - xy: 420, 412 + xy: 127, 1 size: 3, 3 orig: 3, 3 offset: 0, 0 index: -1 ui/window rotate: false - xy: 425, 450 + xy: 204, 178 size: 27, 61 split: 8, 8, 44, 11 orig: 27, 61 offset: 0, 0 index: -1 -ui/window-gray - rotate: false - xy: 359, 384 - size: 27, 61 - split: 5, 4, 52, 4 - orig: 27, 61 - offset: 0, 0 - index: -1 weapons/blaster rotate: false - xy: 302, 151 + xy: 502, 503 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/flamer rotate: false - xy: 199, 28 + xy: 371, 204 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/mortar rotate: false - xy: 430, 427 + xy: 497, 443 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/multigun rotate: false - xy: 440, 440 + xy: 497, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/railgun rotate: false - xy: 450, 427 + xy: 142, 16 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/triblaster rotate: false - xy: 480, 413 + xy: 419, 342 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 491a9ae28e..dd44cce56d 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 e868f3196d..cc7974382e 100644 --- a/core/src/io/anuke/mindustry/EffectCreator.java +++ b/core/src/io/anuke/mindustry/EffectCreator.java @@ -8,6 +8,7 @@ import io.anuke.ucore.core.Draw; import io.anuke.ucore.core.Effects; import io.anuke.ucore.graphics.Hue; import io.anuke.ucore.util.Angles; +import io.anuke.ucore.util.Mathf; public class EffectCreator{ static Color lightRed = Hue.mix(Color.WHITE, Color.FIREBRICK, 0.1f); @@ -32,6 +33,23 @@ public class EffectCreator{ }); }); + Effects.create("lava", 18, e -> { + Angles.randLenVectors(e.id, 3, 1f + e.ifract()*10f, (x, y)->{ + float size = e.sfract()*4f; + Draw.color(Color.ORANGE, Color.GRAY, e.ifract()); + Draw.rect("circle", e.x + x, e.y + y, size, size); + Draw.reset(); + }); + }); + + Effects.create("lavabubble", 45f, e -> { + Draw.color(Color.ORANGE); + float scl = 0.35f; + Draw.thick(1f - Mathf.clamp(e.ifract() - (1f-scl)) * (1f/scl)); + Draw.circle(e.x, e.y, e.ifract()*4f); + Draw.reset(); + }); + Effects.create("shellexplosion", 15, e -> { Draw.thickness(1.3f - e.ifract()); Draw.color(Hue.mix(Color.WHITE, Color.ORANGE, e.ifract())); diff --git a/core/src/io/anuke/mindustry/Mindustry.java b/core/src/io/anuke/mindustry/Mindustry.java index bd2b9e0a75..c4f0c2932d 100644 --- a/core/src/io/anuke/mindustry/Mindustry.java +++ b/core/src/io/anuke/mindustry/Mindustry.java @@ -32,9 +32,6 @@ public class Mindustry extends ModuleCore { @Override public void init(){ - //if(Vars.debug){ - GLProfiler.enable(); - //} //always initialize blocks in this order, otherwise there are ID errors Blocks.dirt.getClass(); ProductionBlocks.coaldrill.getClass(); @@ -48,6 +45,9 @@ public class Mindustry extends ModuleCore { @Override public void postInit(){ + if(Vars.debug && Vars.debugGL){ + GLProfiler.enable(); + } Vars.control.reset(); } diff --git a/core/src/io/anuke/mindustry/Renderer.java b/core/src/io/anuke/mindustry/Renderer.java index da0eab79ba..444b5e59cf 100644 --- a/core/src/io/anuke/mindustry/Renderer.java +++ b/core/src/io/anuke/mindustry/Renderer.java @@ -112,7 +112,7 @@ public class Renderer extends RendererModule{ drawDefault(); - if(Vars.debug && Timers.get("profile", 30)){ + if(Vars.debug && Vars.debugGL && Timers.get("profile", 60)){ UCore.log("shaders: " + GLProfiler.shaderSwitches, "calls: " + GLProfiler.drawCalls, "bindings: " + GLProfiler.textureBindings, diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index 18e4018910..4f6667c870 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -27,6 +27,8 @@ public class Vars{ public static final int zoomScale = Math.round(Unit.dp.inPixels(1)); //if true, player speed will be increased, massive amounts of resources will be given on start, and other debug options will be available public static boolean debug = false; + //whether to debug openGL info + public static boolean debugGL = false; //number of save slots-- increasing may lead to layout issues //TODO named save slots, possibly with a scroll dialog public static final int saveSlots = 4; diff --git a/core/src/io/anuke/mindustry/entities/effect/Shield.java b/core/src/io/anuke/mindustry/entities/effect/Shield.java index 0cb4bd7407..7c696fa189 100644 --- a/core/src/io/anuke/mindustry/entities/effect/Shield.java +++ b/core/src/io/anuke/mindustry/entities/effect/Shield.java @@ -3,7 +3,7 @@ package io.anuke.mindustry.entities.effect; import com.badlogic.gdx.graphics.Color; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.types.ShieldBlock; +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.entities.BulletEntity; diff --git a/core/src/io/anuke/mindustry/resource/Liquid.java b/core/src/io/anuke/mindustry/resource/Liquid.java index e90e1c55a4..6a42de36db 100644 --- a/core/src/io/anuke/mindustry/resource/Liquid.java +++ b/core/src/io/anuke/mindustry/resource/Liquid.java @@ -4,7 +4,8 @@ import com.badlogic.gdx.graphics.Color; public enum Liquid{ water(Color.ROYAL), - plasma(Color.CORAL); + plasma(Color.CORAL), + lava(Color.valueOf("ed5334")); public final Color color; diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 4fb0b26b88..e76f4a628f 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -41,8 +41,6 @@ public class Block{ public void drawOver(Tile tile){} public void drawPixelOverlay(Tile tile){} - @Deprecated - public void drawOverlay(Tile tile){} public void drawPlace(int x, int y, boolean valid){} public String name(){ diff --git a/core/src/io/anuke/mindustry/world/Generator.java b/core/src/io/anuke/mindustry/world/Generator.java index 8acb119d7a..fcd29d407f 100644 --- a/core/src/io/anuke/mindustry/world/Generator.java +++ b/core/src/io/anuke/mindustry/world/Generator.java @@ -22,7 +22,8 @@ public class Generator{ Hue.rgb(70, 90, 150), Blocks.deepwater, Hue.rgb(110, 80, 30), Blocks.dirt, Hue.rgb(160, 120, 70), Blocks.dirtblock, - Hue.rgb(100, 100, 100), Blocks.stoneblock + Hue.rgb(100, 100, 100), Blocks.stoneblock, + Color.valueOf("ed5334"), Blocks.lava ); /**Returns world size.*/ diff --git a/core/src/io/anuke/mindustry/world/blocks/Blocks.java b/core/src/io/anuke/mindustry/world/blocks/Blocks.java index 9e6265ccc0..29837b81f4 100644 --- a/core/src/io/anuke/mindustry/world/blocks/Blocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/Blocks.java @@ -6,8 +6,10 @@ import io.anuke.mindustry.resource.Liquid; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.Floor; -import io.anuke.mindustry.world.blocks.types.ShieldedWallBlock; import io.anuke.mindustry.world.blocks.types.Wall; +import io.anuke.mindustry.world.blocks.types.defense.ShieldedWallBlock; +import io.anuke.ucore.core.Effects; +import io.anuke.ucore.util.Mathf; public class Blocks{ public static final Block @@ -15,7 +17,11 @@ public class Blocks{ air = new Block("air"){ //no drawing here public void drawCache(Tile tile){} - public void draw(Tile tile){} + + //update floor blocks for effects, if needed + public void draw(Tile tile){ + tile.floor().update(tile); + } }, deepwater = new Floor("deepwater"){{ @@ -30,6 +36,25 @@ public class Blocks{ liquidDrop = Liquid.water; }}, + lava = new Floor("lava"){ + { + vary = false; + solid = true; + liquidDrop = Liquid.lava; + } + + @Override + public void update(Tile tile){ + if(Mathf.chance(0.001)){ + Effects.effect("lava", tile.worldx() + Mathf.range(5f), tile.worldy() + Mathf.range(5f)); + } + + if(Mathf.chance(0.004)){ + Effects.effect("lavabubble", tile.worldx() + Mathf.range(3f), tile.worldy() + Mathf.range(3f)); + } + } + }, + stone = new Floor("stone"){{ drops = new ItemStack(Item.stone, 1); }}, diff --git a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java index 8ab9c2d30e..4ce4551523 100644 --- a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java @@ -6,6 +6,8 @@ import io.anuke.mindustry.resource.Liquid; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.*; +import io.anuke.mindustry.world.blocks.types.distribution.*; +import io.anuke.mindustry.world.blocks.types.production.*; import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Timers; @@ -35,7 +37,7 @@ public class ProductionBlocks{ } }, - conduit = new Conduit("conduit"){{ + conduit = new LiquidBlock("conduit"){{ }}, diff --git a/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java b/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java index 5dc266f708..767abf694f 100644 --- a/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java @@ -8,7 +8,7 @@ import io.anuke.mindustry.entities.effect.TeslaOrb; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.types.*; +import io.anuke.mindustry.world.blocks.types.defense.*; import io.anuke.ucore.core.Timers; import io.anuke.ucore.util.Angles; import io.anuke.ucore.util.Mathf; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Conduit.java b/core/src/io/anuke/mindustry/world/blocks/types/LiquidBlock.java similarity index 80% rename from core/src/io/anuke/mindustry/world/blocks/types/Conduit.java rename to core/src/io/anuke/mindustry/world/blocks/types/LiquidBlock.java index ee041d71df..091c50b4de 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Conduit.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/LiquidBlock.java @@ -11,11 +11,11 @@ import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Draw; import io.anuke.ucore.core.Timers; -public class Conduit extends Block{ +public class LiquidBlock extends Block{ protected float liquidCapacity = 10f; protected float flowfactor = 4.9f; - public Conduit(String name) { + public LiquidBlock(String name) { super(name); rotate = true; update = true; @@ -28,7 +28,7 @@ public class Conduit extends Block{ @Override public void draw(Tile tile){ - ConduitEntity entity = tile.entity(); + LiquidEntity entity = tile.entity(); Draw.rect(name() + "bottom", tile.worldx(), tile.worldy(), tile.rotation * 90); @@ -45,12 +45,12 @@ public class Conduit extends Block{ @Override public TileEntity getEntity(){ - return new ConduitEntity(); + return new LiquidEntity(); } @Override public void update(Tile tile){ - ConduitEntity entity = tile.entity(); + LiquidEntity entity = tile.entity(); if(entity.liquidAmount > 0.01f && Timers.get(entity, "flow", 3)){ tryMoveLiquid(tile, tile.getNearby()[tile.rotation]); @@ -59,7 +59,7 @@ public class Conduit extends Block{ } public void tryDumpLiquid(Tile tile){ - ConduitEntity entity = tile.entity(); + LiquidEntity entity = tile.entity(); if(entity.liquidAmount > 0.01f){ tryMoveLiquid(tile, tile.getNearby()[tile.dump]); @@ -69,13 +69,13 @@ public class Conduit extends Block{ } public void tryMoveLiquid(Tile tile, Tile next){ - ConduitEntity entity = tile.entity(); + LiquidEntity entity = tile.entity(); Liquid liquid = entity.liquid; - if(next != null && next.block() instanceof Conduit && entity.liquidAmount > 0.01f){ - Conduit other = (Conduit)next.block(); - ConduitEntity otherentity = next.entity(); + if(next != null && next.block() instanceof LiquidBlock && entity.liquidAmount > 0.01f){ + LiquidBlock other = (LiquidBlock)next.block(); + LiquidEntity otherentity = next.entity(); float flow = Math.min(other.liquidCapacity - otherentity.liquidAmount - 0.001f, Math.min(entity.liquidAmount/flowfactor, entity.liquidAmount)); @@ -89,20 +89,20 @@ public class Conduit extends Block{ } public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){ - ConduitEntity entity = tile.entity(); + LiquidEntity entity = tile.entity(); return entity.liquidAmount + amount < liquidCapacity && (entity.liquid == liquid || entity.liquidAmount <= 0.01f); } public void handleLiquid(Tile tile, Tile source, Liquid liquid, float amount){ - ConduitEntity entity = tile.entity(); + LiquidEntity entity = tile.entity(); entity.liquid = liquid; entity.liquidAmount += amount; } - static class ConduitEntity extends TileEntity{ - Liquid liquid; - float liquidAmount; + public static class LiquidEntity extends TileEntity{ + public Liquid liquid; + public float liquidAmount; @Override public void write(DataOutputStream stream) throws IOException{ diff --git a/core/src/io/anuke/mindustry/world/blocks/types/PowerBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/PowerBlock.java index a093545a54..f543a51eeb 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/PowerBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/PowerBlock.java @@ -27,7 +27,7 @@ public abstract class PowerBlock extends Block implements PowerAcceptor{ float fract = (float)entity.power / powerCapacity; if(fract > 0) - fract = Mathf.clamp(fract, 0.24f, 1f); + fract = Mathf.clamp(fract + 0.2f, 0.24f, 1f); Vars.renderer.drawBar(Color.YELLOW, tile.worldx(), tile.worldy() + 13, fract); } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/LaserTurret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/LaserTurret.java similarity index 97% rename from core/src/io/anuke/mindustry/world/blocks/types/LaserTurret.java rename to core/src/io/anuke/mindustry/world/blocks/types/defense/LaserTurret.java index ebcdb433ef..6d0e039f90 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/LaserTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/LaserTurret.java @@ -1,4 +1,4 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.defense; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.math.MathUtils; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/RepairTurret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/RepairTurret.java similarity index 97% rename from core/src/io/anuke/mindustry/world/blocks/types/RepairTurret.java rename to core/src/io/anuke/mindustry/world/blocks/types/defense/RepairTurret.java index e972c25656..9c24868142 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/RepairTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/RepairTurret.java @@ -1,4 +1,4 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.defense; import com.badlogic.gdx.math.MathUtils; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/ShieldBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java similarity index 88% rename from core/src/io/anuke/mindustry/world/blocks/types/ShieldBlock.java rename to core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java index 3a61c1dd19..9f94d6da44 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/ShieldBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldBlock.java @@ -1,8 +1,9 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.defense; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.effect.Shield; import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.blocks.types.PowerBlock; import io.anuke.ucore.core.Timers; public class ShieldBlock extends PowerBlock{ diff --git a/core/src/io/anuke/mindustry/world/blocks/types/ShieldedWallBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldedWallBlock.java similarity index 93% rename from core/src/io/anuke/mindustry/world/blocks/types/ShieldedWallBlock.java rename to core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldedWallBlock.java index 67f694e0ad..268df4b579 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/ShieldedWallBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldedWallBlock.java @@ -1,10 +1,11 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.defense; import com.badlogic.gdx.graphics.Color; import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.blocks.types.PowerBlock; import io.anuke.ucore.core.Draw; import io.anuke.ucore.core.Graphics; import io.anuke.ucore.core.Timers; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Turret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java similarity index 99% rename from core/src/io/anuke/mindustry/world/blocks/types/Turret.java rename to core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java index 74d055e2a5..868932cc08 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Turret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java @@ -1,4 +1,4 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.defense; import java.io.DataInputStream; import java.io.DataOutputStream; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Conveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java similarity index 98% rename from core/src/io/anuke/mindustry/world/blocks/types/Conveyor.java rename to core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java index d8e67e95e8..d51d043ce2 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Conveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java @@ -1,4 +1,4 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.distribution; import static io.anuke.mindustry.Vars.tilesize; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/LiquidRouter.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidRouter.java similarity index 83% rename from core/src/io/anuke/mindustry/world/blocks/types/LiquidRouter.java rename to core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidRouter.java index 0ed1e66cda..0af7e45ea6 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/LiquidRouter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidRouter.java @@ -1,13 +1,14 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.distribution; import com.badlogic.gdx.utils.ObjectMap; 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; import io.anuke.ucore.core.Timers; -public class LiquidRouter extends Conduit{ +public class LiquidRouter extends LiquidBlock{ private ObjectMap lastmap = new ObjectMap<>(); public LiquidRouter(String name) { @@ -23,7 +24,7 @@ public class LiquidRouter extends Conduit{ @Override public void update(Tile tile){ - ConduitEntity entity = tile.entity(); + LiquidEntity entity = tile.entity(); if(Timers.get(tile, 2) && entity.liquidAmount > 0){ if(lastmap.get(tile, (byte)-1) != tile.rotation){ @@ -43,7 +44,7 @@ public class LiquidRouter extends Conduit{ @Override public void draw(Tile tile){ - ConduitEntity entity = tile.entity(); + LiquidEntity entity = tile.entity(); Draw.rect(name(), tile.worldx(), tile.worldy()); if(entity.liquid == null) return; 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 new file mode 100644 index 0000000000..60bf9537c0 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerBooster.java @@ -0,0 +1,5 @@ +package io.anuke.mindustry.world.blocks.types.distribution; + +public class PowerBooster{ + +} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Router.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java similarity index 95% rename from core/src/io/anuke/mindustry/world/blocks/types/Router.java rename to core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java index dc9447108e..e29c68e842 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Router.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java @@ -1,4 +1,4 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.distribution; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.utils.ObjectMap; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Crafter.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Crafter.java similarity index 94% rename from core/src/io/anuke/mindustry/world/blocks/types/Crafter.java rename to core/src/io/anuke/mindustry/world/blocks/types/production/Crafter.java index 2f9ae2ab52..31fb9b1550 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Crafter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Crafter.java @@ -1,4 +1,4 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.production; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.Block; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Drill.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Drill.java similarity index 95% rename from core/src/io/anuke/mindustry/world/blocks/types/Drill.java rename to core/src/io/anuke/mindustry/world/blocks/types/production/Drill.java index 5649f8b1fa..47d8a3d1d1 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Drill.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Drill.java @@ -1,4 +1,4 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.production; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.Block; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Generator.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Generator.java similarity index 89% rename from core/src/io/anuke/mindustry/world/blocks/types/Generator.java rename to core/src/io/anuke/mindustry/world/blocks/types/production/Generator.java index ea7d45d7de..1a8728e041 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Generator.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Generator.java @@ -1,10 +1,12 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.production; import com.badlogic.gdx.math.Vector2; import io.anuke.mindustry.Vars; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.World; +import io.anuke.mindustry.world.blocks.types.PowerAcceptor; +import io.anuke.mindustry.world.blocks.types.PowerBlock; import io.anuke.ucore.core.Draw; public class Generator extends PowerBlock{ diff --git a/core/src/io/anuke/mindustry/world/blocks/types/ItemPowerGenerator.java b/core/src/io/anuke/mindustry/world/blocks/types/production/ItemPowerGenerator.java similarity index 95% rename from core/src/io/anuke/mindustry/world/blocks/types/ItemPowerGenerator.java rename to core/src/io/anuke/mindustry/world/blocks/types/production/ItemPowerGenerator.java index f577d7213a..779d99e930 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/ItemPowerGenerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/ItemPowerGenerator.java @@ -1,4 +1,4 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.production; import com.badlogic.gdx.graphics.Color; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/LiquidPowerGenerator.java b/core/src/io/anuke/mindustry/world/blocks/types/production/LiquidPowerGenerator.java new file mode 100644 index 0000000000..e827d1b71e --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/LiquidPowerGenerator.java @@ -0,0 +1,30 @@ +package io.anuke.mindustry.world.blocks.types.production; + +import io.anuke.mindustry.resource.Liquid; +import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.blocks.types.LiquidBlock; + +public class LiquidPowerGenerator extends LiquidBlock{ + public Liquid generateLiquid; + public float generatePower; + public float generateAmount = 1f; + + public LiquidPowerGenerator(String name) { + super(name); + } + + @Override + public void update(Tile tile){ + LiquidEntity entity = tile.entity(); + + if(entity.liquidAmount >= generateAmount){ + entity.liquidAmount -= generateAmount; + //TODO actually add power + } + } + + @Override + public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){ + return liquid == generateLiquid && super.acceptLiquid(tile, source, liquid, amount); + } +} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Pump.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Pump.java similarity index 85% rename from core/src/io/anuke/mindustry/world/blocks/types/Pump.java rename to core/src/io/anuke/mindustry/world/blocks/types/production/Pump.java index 41fdbc0281..4281020c01 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Pump.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Pump.java @@ -1,12 +1,13 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.production; 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; import io.anuke.ucore.core.Timers; import io.anuke.ucore.util.Mathf; -public class Pump extends Conduit{ +public class Pump extends LiquidBlock{ protected float pumpspeed = 2f; public Pump(String name) { @@ -40,7 +41,7 @@ public class Pump extends Conduit{ @Override public void update(Tile tile){ - ConduitEntity entity = tile.entity(); + LiquidEntity entity = tile.entity(); if(tile.floor().liquidDrop != null && Timers.get(tile, "pump", 8) && entity.liquidAmount < liquidCapacity){ diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Purifier.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Purifier.java similarity index 89% rename from core/src/io/anuke/mindustry/world/blocks/types/Purifier.java rename to core/src/io/anuke/mindustry/world/blocks/types/production/Purifier.java index 669d111344..a5359e8c22 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Purifier.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Purifier.java @@ -1,4 +1,4 @@ -package io.anuke.mindustry.world.blocks.types; +package io.anuke.mindustry.world.blocks.types.production; import com.badlogic.gdx.graphics.Color; @@ -7,11 +7,12 @@ import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.resource.Item; 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; import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Timers; -public class Purifier extends Conduit{ +public class Purifier extends LiquidBlock{ public Item input = null; public int inputAmount = 5; public Liquid inputLiquid = null; @@ -31,7 +32,7 @@ public class Purifier extends Conduit{ @Override public void draw(Tile tile){ - ConduitEntity entity = tile.entity(); + LiquidEntity entity = tile.entity(); Draw.rect(name(), tile.worldx(), tile.worldy()); if(entity.liquid == null) return; @@ -44,7 +45,7 @@ public class Purifier extends Conduit{ @Override public void update(Tile tile){ - ConduitEntity entity = tile.entity(); + LiquidEntity entity = tile.entity(); if(Timers.get(tile, "purify", purifyTime) && entity.liquidAmount >= liquidAmount && entity.hasItem(input, inputAmount)){