diff --git a/core/assets-raw/sprites/blocks/production/flierfactory-top-open.png b/core/assets-raw/sprites/blocks/production/flierfactory-top-open.png new file mode 100644 index 0000000000..25db6bb2b2 Binary files /dev/null and b/core/assets-raw/sprites/blocks/production/flierfactory-top-open.png differ diff --git a/core/assets-raw/sprites/blocks/production/flierfactory.png b/core/assets-raw/sprites/blocks/production/flierfactory.png index 72c6264dc3..b703c27481 100644 Binary files a/core/assets-raw/sprites/blocks/production/flierfactory.png and b/core/assets-raw/sprites/blocks/production/flierfactory.png differ diff --git a/core/assets/shaders/build.fragment b/core/assets/shaders/build.fragment index 47040c6a01..4977e782b1 100644 --- a/core/assets/shaders/build.fragment +++ b/core/assets/shaders/build.fragment @@ -46,7 +46,7 @@ void main() { f = 1.0; else f = 0.0; - c = mix(c, u_color, f); + c = mix(c, u_color, f * u_color.a); } gl_FragColor = c * v_color; diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index 40c8b0064e..f72a563599 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -13,56 +13,56 @@ background index: -1 blackrock1 rotate: false - xy: 223, 113 + xy: 681, 341 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackrockshadow1 rotate: false - xy: 245, 113 + xy: 681, 331 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstone1 rotate: false - xy: 255, 113 + xy: 691, 351 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstone2 rotate: false - xy: 265, 113 + xy: 691, 341 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstone3 rotate: false - xy: 275, 113 + xy: 691, 331 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock1 rotate: false - xy: 285, 113 + xy: 579, 234 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock2 rotate: false - xy: 295, 113 + xy: 627, 306 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock3 rotate: false - xy: 305, 117 + xy: 637, 306 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -76,504 +76,504 @@ blackstoneedge index: -1 coal1 rotate: false - xy: 860, 373 + xy: 689, 311 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coal2 rotate: false - xy: 413, 141 + xy: 419, 159 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coal3 rotate: false - xy: 488, 168 + xy: 429, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 deepwater rotate: false - xy: 419, 159 + xy: 889, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt1 rotate: false - xy: 429, 160 + xy: 889, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt2 rotate: false - xy: 439, 160 + xy: 899, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt3 rotate: false - xy: 449, 160 + xy: 899, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirtedge rotate: false - xy: 842, 397 + xy: 871, 439 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 grass1 rotate: false - xy: 704, 369 + xy: 955, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass2 rotate: false - xy: 704, 359 + xy: 945, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass3 rotate: false - xy: 714, 364 + xy: 955, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock1 rotate: false - xy: 724, 364 + xy: 965, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock2 rotate: false - xy: 734, 364 + xy: 955, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassedge rotate: false - xy: 762, 381 + xy: 118, 33 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 ice1 rotate: false - xy: 642, 296 + xy: 965, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice2 rotate: false - xy: 652, 299 + xy: 975, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice3 rotate: false - xy: 699, 349 + xy: 965, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iceedge rotate: false - xy: 776, 381 + xy: 113, 19 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 icerock1 rotate: false - xy: 699, 339 + xy: 975, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerock2 rotate: false - xy: 699, 329 + xy: 985, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow1 rotate: false - xy: 699, 319 + xy: 975, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow1 rotate: false - xy: 699, 319 + xy: 975, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow2 rotate: false - xy: 714, 354 + xy: 985, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow2 rotate: false - xy: 714, 354 + xy: 985, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron1 rotate: false - xy: 724, 354 + xy: 985, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron2 rotate: false - xy: 734, 354 + xy: 305, 105 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron3 rotate: false - xy: 744, 360 + xy: 698, 383 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lava rotate: false - xy: 739, 330 + xy: 662, 289 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lavaedge rotate: false - xy: 790, 381 + xy: 321, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 lead1 rotate: false - xy: 739, 310 + xy: 620, 266 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lead2 rotate: false - xy: 749, 340 + xy: 630, 276 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lead3 rotate: false - xy: 749, 330 + xy: 630, 266 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 mossblock rotate: false - xy: 188, 54 + xy: 158, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 oil rotate: false - xy: 198, 54 + xy: 168, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 oiledge rotate: false - xy: 804, 381 + xy: 335, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 rock1 rotate: false - xy: 622, 286 + xy: 182, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rock2 rotate: false - xy: 632, 286 + xy: 192, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand1 rotate: false - xy: 620, 276 + xy: 177, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand2 rotate: false - xy: 620, 266 + xy: 177, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand3 rotate: false - xy: 630, 276 + xy: 187, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock1 rotate: false - xy: 630, 266 + xy: 187, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock2 rotate: false - xy: 640, 276 + xy: 197, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock3 rotate: false - xy: 640, 266 + xy: 197, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandedge rotate: false - xy: 818, 381 + xy: 349, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 shrub rotate: false - xy: 784, 357 + xy: 217, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shrubshadow rotate: false - xy: 794, 357 + xy: 222, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow1 rotate: false - xy: 677, 311 + xy: 232, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow2 rotate: false - xy: 687, 313 + xy: 237, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow3 rotate: false - xy: 682, 301 + xy: 237, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock1 rotate: false - xy: 682, 291 + xy: 927, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock2 rotate: false - xy: 697, 309 + xy: 937, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock3 rotate: false - xy: 692, 299 + xy: 947, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowedge rotate: false - xy: 860, 383 + xy: 405, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 stone1 rotate: false - xy: 712, 284 + xy: 949, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone2 rotate: false - xy: 722, 284 + xy: 949, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone3 rotate: false - xy: 759, 347 + xy: 959, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock1 rotate: false - xy: 759, 337 + xy: 959, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock2 rotate: false - xy: 769, 347 + xy: 969, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock3 rotate: false - xy: 759, 327 + xy: 969, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneedge rotate: false - xy: 788, 367 + xy: 913, 433 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 thorium1 rotate: false - xy: 779, 337 + xy: 989, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium2 rotate: false - xy: 789, 347 + xy: 706, 373 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium3 rotate: false - xy: 769, 317 + xy: 708, 363 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium1 rotate: false - xy: 789, 337 + xy: 711, 343 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium2 rotate: false - xy: 799, 347 + xy: 711, 333 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium3 rotate: false - xy: 779, 317 + xy: 711, 323 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 water rotate: false - xy: 809, 327 + xy: 241, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 wateredge rotate: false - xy: 802, 367 + xy: 875, 413 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 block-middle rotate: false - xy: 627, 306 + xy: 691, 321 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pump-liquid rotate: false - xy: 627, 306 + xy: 691, 321 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduit-liquid rotate: false - xy: 669, 321 + xy: 146, 43 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 cross-1 rotate: false - xy: 632, 296 + xy: 157, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -594,28 +594,28 @@ cross-3 index: -1 enemyspawn rotate: false - xy: 689, 323 + xy: 945, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 playerspawn rotate: false - xy: 133, 13 + xy: 198, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shadow rotate: false - xy: 130, 35 + xy: 669, 325 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 battery rotate: false - xy: 113, 13 + xy: 933, 469 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -629,21 +629,21 @@ batterylarge index: -1 coalgenerator rotate: false - xy: 669, 341 + xy: 459, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coalgenerator-top rotate: false - xy: 669, 331 + xy: 622, 296 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 combustiongenerator rotate: false - xy: 679, 353 + xy: 632, 296 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -678,49 +678,49 @@ nuclearreactor-lights index: -1 powerinfinite rotate: false - xy: 315, 107 + xy: 166, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 powervoid rotate: false - xy: 875, 421 + xy: 186, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rtgenerator rotate: false - xy: 652, 289 + xy: 167, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rtgenerator-top rotate: false - xy: 662, 289 + xy: 167, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shieldgenerator rotate: false - xy: 630, 256 + xy: 216, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shieldprojector rotate: false - xy: 835, 427 + xy: 817, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 solarpanel rotate: false - xy: 692, 289 + xy: 957, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -734,7 +734,7 @@ teleporter index: -1 thermalgenerator rotate: false - xy: 769, 327 + xy: 989, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -748,14 +748,14 @@ alloysmelter index: -1 coaldrill rotate: false - xy: 315, 117 + xy: 439, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coalextractor rotate: false - xy: 669, 351 + xy: 449, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -802,37 +802,44 @@ flierfactory-top orig: 16, 16 offset: 0, 0 index: -1 +flierfactory-top-open + rotate: false + xy: 656, 361 + size: 16, 16 + orig: 16, 16 + offset: 0, 0 + index: -1 fluxpump rotate: false - xy: 694, 363 + xy: 945, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill rotate: false - xy: 744, 350 + xy: 696, 373 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserdrill rotate: false - xy: 561, 225 + xy: 564, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 lavasmelter rotate: false - xy: 739, 320 + xy: 620, 276 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 leaddrill rotate: false - xy: 749, 320 + xy: 640, 276 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -853,154 +860,154 @@ oilextractor-liquid index: -1 oilrefinery rotate: false - xy: 208, 54 + xy: 178, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 omnidrill rotate: false - xy: 218, 54 + xy: 188, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulverizer rotate: false - xy: 874, 391 + xy: 162, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pump rotate: false - xy: 884, 391 + xy: 172, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 quartzextractor rotate: false - xy: 817, 427 + xy: 799, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 siliconextractor rotate: false - xy: 804, 357 + xy: 226, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 smelter rotate: false - xy: 672, 301 + xy: 227, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 smelter-middle rotate: false - xy: 672, 291 + xy: 227, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stonedrill rotate: false - xy: 769, 337 + xy: 987, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneformer rotate: false - xy: 779, 347 + xy: 979, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thoriumdrill rotate: false - xy: 779, 327 + xy: 711, 353 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill rotate: false - xy: 789, 327 + xy: 121, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumextractor rotate: false - xy: 799, 337 + xy: 131, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 uraniumextractor rotate: false - xy: 789, 307 + xy: 201, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 waterextractor rotate: false - xy: 651, 325 + xy: 680, 407 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 waterextractor-liquid rotate: false - xy: 680, 407 + xy: 680, 389 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 conduit-bottom rotate: false - xy: 679, 333 + xy: 142, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduit-top rotate: false - xy: 679, 323 + xy: 642, 296 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduittunnel rotate: false - xy: 667, 311 + xy: 652, 299 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyor rotate: false - xy: 870, 401 + xy: 147, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyormove rotate: false - xy: 137, 25 + xy: 152, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyortunnel rotate: false - xy: 622, 296 + xy: 662, 299 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1014,42 +1021,42 @@ core index: -1 junction rotate: false - xy: 739, 340 + xy: 652, 289 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidjunction rotate: false - xy: 749, 310 + xy: 640, 266 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter rotate: false - xy: 148, 54 + xy: 620, 256 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-bottom rotate: false - xy: 158, 54 + xy: 630, 256 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-liquid rotate: false - xy: 168, 54 + xy: 640, 256 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-top rotate: false - xy: 178, 54 + xy: 148, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1077,84 +1084,84 @@ liquidtank-top index: -1 multiplexer rotate: false - xy: 799, 427 + xy: 781, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 poweredconveyor rotate: false - xy: 133, 3 + xy: 208, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 poweredconveyormove rotate: false - xy: 305, 107 + xy: 156, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 powernode rotate: false - xy: 870, 373 + xy: 176, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-bottom rotate: false - xy: 875, 411 + xy: 196, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-top rotate: false - xy: 880, 401 + xy: 206, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 router rotate: false - xy: 642, 286 + xy: 202, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sortedunloader rotate: false - xy: 702, 299 + xy: 967, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sorter rotate: false - xy: 702, 289 + xy: 977, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 splitter rotate: false - xy: 712, 304 + xy: 929, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyor rotate: false - xy: 722, 304 + xy: 929, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyormove rotate: false - xy: 712, 294 + xy: 939, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1168,7 +1175,7 @@ teleporter-top index: -1 unloader rotate: false - xy: 779, 307 + xy: 191, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1182,21 +1189,21 @@ vault index: -1 vault-icon rotate: false - xy: 799, 307 + xy: 211, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weaponfactory rotate: false - xy: 680, 389 + xy: 698, 409 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 block-1 rotate: false - xy: 579, 234 + xy: 681, 321 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1238,7 +1245,7 @@ chainturret index: -1 doubleturret rotate: false - xy: 689, 343 + xy: 919, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1273,56 +1280,56 @@ gatlingturret index: -1 laserturret rotate: false - xy: 113, 23 + xy: 674, 361 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 magmaturret rotate: false - xy: 564, 207 + xy: 651, 343 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 megarepairturret rotate: false - xy: 763, 427 + xy: 651, 325 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 missileturret rotate: false - xy: 781, 427 + xy: 763, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 railgunturret rotate: false - xy: 121, 1 + xy: 669, 349 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 repairturret rotate: false - xy: 125, 23 + xy: 669, 337 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 shotgunturret rotate: false - xy: 871, 431 + xy: 667, 313 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 teslaturret rotate: false - xy: 233, 111 + xy: 686, 361 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1336,14 +1343,14 @@ titancannon index: -1 compositewall rotate: false - xy: 679, 343 + xy: 137, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 door rotate: false - xy: 459, 160 + xy: 909, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1364,14 +1371,14 @@ door-large-open index: -1 door-open rotate: false - xy: 689, 353 + xy: 909, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 duriumwall rotate: false - xy: 689, 333 + xy: 919, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1385,49 +1392,49 @@ duriumwall-large index: -1 ironwall rotate: false - xy: 662, 299 + xy: 698, 363 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelwall rotate: false - xy: 722, 294 + xy: 939, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelwall-large rotate: false - xy: 853, 427 + xy: 835, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 stonewall rotate: false - xy: 759, 317 + xy: 979, 415 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumshieldwall rotate: false - xy: 789, 317 + xy: 141, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumwall rotate: false - xy: 799, 327 + xy: 151, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumwall-large rotate: false - xy: 651, 343 + xy: 853, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -1441,7 +1448,7 @@ blank index: -1 bullet rotate: false - xy: 637, 306 + xy: 132, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1483,126 +1490,126 @@ laserfull index: -1 shell rotate: false - xy: 620, 256 + xy: 218, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot rotate: false - xy: 764, 357 + xy: 207, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot-long rotate: false - xy: 774, 357 + xy: 217, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanshell rotate: false - xy: 799, 317 + xy: 161, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-biomatter rotate: false - xy: 709, 344 + xy: 701, 353 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-coal rotate: false - xy: 709, 334 + xy: 701, 343 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-densealloy rotate: false - xy: 719, 344 + xy: 701, 333 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-iron rotate: false - xy: 709, 324 + xy: 701, 323 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-lead rotate: false - xy: 719, 334 + xy: 419, 115 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-plastic rotate: false - xy: 729, 344 + xy: 127, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-quartz rotate: false - xy: 719, 324 + xy: 137, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-silicon rotate: false - xy: 729, 334 + xy: 147, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-steel rotate: false - xy: 729, 324 + xy: 157, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-stone rotate: false - xy: 709, 314 + xy: 622, 286 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-thorium rotate: false - xy: 719, 314 + xy: 632, 286 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-titanium rotate: false - xy: 729, 314 + xy: 642, 286 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 standard-mech rotate: false - xy: 760, 367 + xy: 885, 433 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 standard-ship rotate: false - xy: 774, 367 + xy: 899, 433 size: 12, 12 orig: 12, 12 offset: 0, 0 @@ -1799,7 +1806,7 @@ icon-admin index: -1 icon-admin-small rotate: false - xy: 867, 445 + xy: 321, 135 size: 6, 6 orig: 6, 6 offset: 0, 0 @@ -1813,7 +1820,7 @@ icon-areaDelete index: -1 icon-arrow rotate: false - xy: 698, 411 + xy: 698, 393 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -1827,56 +1834,56 @@ icon-arrow-down index: -1 icon-arrow-left rotate: false - xy: 816, 369 + xy: 871, 427 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-arrow-right rotate: false - xy: 828, 369 + xy: 502, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-arrow-up rotate: false - xy: 502, 195 + xy: 514, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-back rotate: false - xy: 656, 361 + xy: 118, 47 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-ban rotate: false - xy: 698, 395 + xy: 572, 274 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-cancel rotate: false - xy: 572, 274 + xy: 572, 258 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-chat rotate: false - xy: 514, 195 + xy: 526, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-check rotate: false - xy: 572, 258 + xy: 588, 276 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -1904,497 +1911,497 @@ icon-close-over index: -1 icon-crafting rotate: false - xy: 526, 195 + xy: 538, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-cursor rotate: false - xy: 538, 195 + xy: 550, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-defense rotate: false - xy: 550, 195 + xy: 562, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-dev-builds rotate: false - xy: 588, 276 + xy: 588, 260 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-discord rotate: false - xy: 588, 260 + xy: 604, 276 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-distribution rotate: false - xy: 562, 195 + xy: 933, 457 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-donate rotate: false - xy: 604, 276 + xy: 604, 260 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-dots rotate: false - xy: 604, 260 + xy: 763, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-editor rotate: false - xy: 763, 411 + xy: 779, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-exit rotate: false - xy: 779, 411 + xy: 795, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-file-text rotate: false - xy: 795, 411 + xy: 811, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-fill rotate: false - xy: 118, 47 + xy: 476, 178 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-floppy rotate: false - xy: 811, 411 + xy: 827, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-folder rotate: false - xy: 827, 411 + xy: 843, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-folder-parent rotate: false - xy: 843, 411 + xy: 859, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-github rotate: false - xy: 859, 411 + xy: 680, 373 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-google-play rotate: false - xy: 680, 373 + xy: 225, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-grid rotate: false - xy: 476, 178 + xy: 492, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-hold rotate: false - xy: 329, 139 + xy: 933, 445 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-holdDelete rotate: false - xy: 341, 139 + xy: 136, 53 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-home rotate: false - xy: 225, 123 + xy: 241, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-host rotate: false - xy: 241, 123 + xy: 257, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-info rotate: false - xy: 353, 139 + xy: 154, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-itch.io rotate: false - xy: 257, 123 + xy: 273, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-line rotate: false - xy: 492, 207 + xy: 510, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-link rotate: false - xy: 273, 123 + xy: 289, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-liquid rotate: false - xy: 365, 139 + xy: 166, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-load rotate: false - xy: 289, 123 + xy: 305, 127 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-load-image rotate: false - xy: 510, 207 + xy: 528, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-load-map rotate: false - xy: 528, 207 + xy: 546, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-loading rotate: false - xy: 546, 207 + xy: 867, 453 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-logic rotate: false - xy: 377, 139 + xy: 178, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-menu rotate: false - xy: 389, 139 + xy: 190, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-menu-large rotate: false - xy: 867, 453 + xy: 134, 92 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-none rotate: false - xy: 401, 139 + xy: 202, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-pause rotate: false - xy: 476, 166 + xy: 214, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-pencil rotate: false - xy: 134, 92 + xy: 134, 74 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-pencil-small rotate: false - xy: 305, 127 + xy: 651, 309 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-pick rotate: false - xy: 134, 74 + xy: 152, 94 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-play rotate: false - xy: 118, 35 + xy: 574, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-play-2 rotate: false - xy: 651, 309 + xy: 329, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-players rotate: false - xy: 136, 53 + xy: 746, 404 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-power rotate: false - xy: 154, 64 + xy: 233, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-production rotate: false - xy: 166, 64 + xy: 245, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-quit rotate: false - xy: 714, 406 + xy: 345, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-redo rotate: false - xy: 152, 94 + xy: 152, 76 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-refresh rotate: false - xy: 730, 406 + xy: 361, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rename rotate: false - xy: 714, 390 + xy: 377, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-resize rotate: false - xy: 152, 76 + xy: 170, 94 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-rotate rotate: false - xy: 730, 390 + xy: 393, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-arrow rotate: false - xy: 746, 400 + xy: 409, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-left rotate: false - xy: 698, 379 + xy: 476, 162 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-right rotate: false - xy: 714, 374 + xy: 885, 463 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-save rotate: false - xy: 730, 374 + xy: 901, 463 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-save-image rotate: false - xy: 170, 94 + xy: 170, 76 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-save-map rotate: false - xy: 170, 76 + xy: 188, 94 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-settings rotate: false - xy: 178, 64 + xy: 257, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-terrain rotate: false - xy: 188, 94 + xy: 188, 76 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-tools rotate: false - xy: 746, 384 + xy: 917, 463 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-touch rotate: false - xy: 190, 64 + xy: 269, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-touchDelete rotate: false - xy: 202, 64 + xy: 281, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-trash rotate: false - xy: 762, 395 + xy: 885, 447 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-trash-16 rotate: false - xy: 188, 76 + xy: 206, 94 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-trello rotate: false - xy: 778, 395 + xy: 901, 447 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-tutorial rotate: false - xy: 794, 395 + xy: 917, 447 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-undo rotate: false - xy: 206, 94 + xy: 206, 76 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-units rotate: false - xy: 214, 64 + xy: 293, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-weapon rotate: false - xy: 574, 195 + xy: 305, 115 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-wiki rotate: false - xy: 810, 395 + xy: 716, 406 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-zoom rotate: false - xy: 206, 76 + xy: 561, 225 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-zoom-small rotate: false - xy: 826, 395 + xy: 714, 390 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -2500,7 +2507,7 @@ slider-knob-over index: -1 slider-vertical rotate: false - xy: 1, 5 + xy: 171, 1 size: 8, 1 orig: 8, 1 offset: 0, 0 @@ -2544,7 +2551,7 @@ textfield-over index: -1 white rotate: false - xy: 709, 354 + xy: 716, 422 size: 3, 3 orig: 3, 3 offset: 0, 0 @@ -2567,126 +2574,126 @@ window-empty index: -1 flier rotate: false - xy: 856, 397 + xy: 732, 408 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 scout rotate: false - xy: 746, 370 + xy: 363, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 scout-base rotate: false - xy: 832, 381 + xy: 377, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 standard-mech-base rotate: false - xy: 832, 381 + xy: 377, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 scout-leg rotate: false - xy: 846, 383 + xy: 391, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 standard-mech-leg rotate: false - xy: 846, 383 + xy: 391, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 beam rotate: false - xy: 123, 13 + xy: 223, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 beam-equip rotate: false - xy: 875, 443 + xy: 681, 351 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blaster rotate: false - xy: 674, 363 + xy: 419, 125 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blaster-equip rotate: false - xy: 684, 363 + xy: 136, 43 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 clustergun rotate: false - xy: 840, 371 + xy: 127, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 clustergun-equip rotate: false - xy: 850, 373 + xy: 679, 311 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun rotate: false - xy: 640, 256 + xy: 212, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun-equip rotate: false - xy: 754, 357 + xy: 207, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster rotate: false - xy: 759, 307 + xy: 171, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster-equip rotate: false - xy: 769, 307 + xy: 181, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan rotate: false - xy: 809, 347 + xy: 221, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan-equip rotate: false - xy: 809, 337 + xy: 231, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index e6955a772f..eff9ad14bc 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/assets/version.properties b/core/assets/version.properties index 61aae7632e..c32bb1b9e6 100644 --- a/core/assets/version.properties +++ b/core/assets/version.properties @@ -1,7 +1,7 @@ #Autogenerated file. Do not modify. -#Sun Mar 25 16:45:50 EDT 2018 +#Sun Mar 25 23:37:47 EDT 2018 version=release -androidBuildCode=653 +androidBuildCode=657 name=Mindustry code=3.4 build=custom build diff --git a/core/src/io/anuke/mindustry/entities/TileEntity.java b/core/src/io/anuke/mindustry/entities/TileEntity.java index 39ee3edd50..d863ed3311 100644 --- a/core/src/io/anuke/mindustry/entities/TileEntity.java +++ b/core/src/io/anuke/mindustry/entities/TileEntity.java @@ -37,8 +37,8 @@ public class TileEntity extends Entity{ public TileEntity init(Tile tile, boolean added){ this.tile = tile; this.added = added; - x = tile.worldx(); - y = tile.worldy(); + x = tile.drawx(); + y = tile.drawy(); health = tile.block().health; diff --git a/core/src/io/anuke/mindustry/entities/units/FlyingUnitType.java b/core/src/io/anuke/mindustry/entities/units/FlyingUnitType.java index 41939fd75e..7f86c3ee02 100644 --- a/core/src/io/anuke/mindustry/entities/units/FlyingUnitType.java +++ b/core/src/io/anuke/mindustry/entities/units/FlyingUnitType.java @@ -24,6 +24,7 @@ public class FlyingUnitType extends UnitType { speed = 0.2f; maxVelocity = 4f; drag = 0.01f; + isFlying = true; } @Override diff --git a/core/src/io/anuke/mindustry/entities/units/UnitType.java b/core/src/io/anuke/mindustry/entities/units/UnitType.java index eaf083a75a..db2d17c2d8 100644 --- a/core/src/io/anuke/mindustry/entities/units/UnitType.java +++ b/core/src/io/anuke/mindustry/entities/units/UnitType.java @@ -54,6 +54,10 @@ public abstract class UnitType { //TODO doesn't do anything } + public boolean isFlying(){ + return isFlying; + } + public void update(BaseUnit unit){ if(unit.hitTime > 0){ unit.hitTime -= Timers.delta(); diff --git a/core/src/io/anuke/mindustry/graphics/Fx.java b/core/src/io/anuke/mindustry/graphics/Fx.java index fddb9da59e..74935a7f03 100644 --- a/core/src/io/anuke/mindustry/graphics/Fx.java +++ b/core/src/io/anuke/mindustry/graphics/Fx.java @@ -203,6 +203,14 @@ public class Fx{ Draw.reset(); }); }), + + producesmoke = new Effect(12, e -> { + Angles.randLenVectors(e.id, 8, 4f + e.ifract()*18f, (x, y)->{ + Draw.color(Color.WHITE, Colors.get("accent"), e.ifract()); + Fill.poly(e.x + x, e.y + y, 4, 1f+e.fract()*3f, 45); + Draw.reset(); + }); + }), blastsmoke = new Effect(26, e -> { Angles.randLenVectors(e.id, 12, 1f + e.ifract()*23f, (x, y)->{ diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/Door.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/Door.java index e7d28fdd35..65244cd82c 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/Door.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/Door.java @@ -63,7 +63,6 @@ public class Door extends Wall{ } boolean anyEntities(Tile tile){ - int x = tile.x, y = tile.y; Block type = tile.block(); rect.setSize(type.size * tilesize, type.size * tilesize); rect.setCenter(tile.drawx(), tile.drawy()); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/UnitFactory.java b/core/src/io/anuke/mindustry/world/blocks/types/production/UnitFactory.java index 13167b3f81..5228241891 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/UnitFactory.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/UnitFactory.java @@ -2,10 +2,13 @@ package io.anuke.mindustry.world.blocks.types.production; import com.badlogic.gdx.graphics.Colors; import com.badlogic.gdx.graphics.g2d.TextureRegion; +import com.badlogic.gdx.math.Rectangle; import io.anuke.mindustry.Vars; import io.anuke.mindustry.entities.TileEntity; +import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.entities.units.UnitType; +import io.anuke.mindustry.graphics.Fx; import io.anuke.mindustry.graphics.Shaders; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.ItemStack; @@ -14,6 +17,7 @@ import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.BlockBar; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.modules.InventoryModule; +import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Graphics; import io.anuke.ucore.core.Timers; import io.anuke.ucore.graphics.Draw; @@ -24,18 +28,30 @@ import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; +import static io.anuke.mindustry.Vars.tilesize; + public class UnitFactory extends Block { + private final Rectangle rect = new Rectangle(); + protected UnitType type; protected ItemStack[] requirements; protected float produceTime = 1000f; protected float powerUse = 0.1f; + protected float openDuration = 50f; + protected float launchVelocity = 4f; protected String unitRegion; public UnitFactory(String name) { super(name); - solid = true; update = true; hasPower = true; + solidifes = true; + } + + @Override + public boolean isSolidFor(Tile tile) { + UnitFactoryEntity entity = tile.entity(); + return !type.isFlying() || !entity.open; } @Override @@ -46,6 +62,14 @@ public class UnitFactory extends Block { bars.remove(BarType.inventory); } + @Override + public TextureRegion[] getIcon() { + return new TextureRegion[]{ + Draw.region(name), + Draw.region(name + "-top") + }; + } + @Override public void draw(Tile tile) { UnitFactoryEntity entity = tile.entity(); @@ -55,7 +79,8 @@ public class UnitFactory extends Block { Shaders.build.region = region; Shaders.build.progress = entity.buildTime/produceTime; - Shaders.build.color = Colors.get("accent"); + Shaders.build.color.set(Colors.get("accent")); + Shaders.build.color.a = entity.speedScl; Shaders.build.time = -entity.time / 10f; Graphics.shader(Shaders.build, false); @@ -64,6 +89,7 @@ public class UnitFactory extends Block { Graphics.shader(); Draw.color("accent"); + Draw.alpha(entity.speedScl); Lines.lineAngleCenter( tile.drawx() + Mathf.sin(entity.time, 6f, Vars.tilesize/2f*size - 2f), @@ -73,7 +99,7 @@ public class UnitFactory extends Block { Draw.reset(); - Draw.rect(name + "-top", tile.drawx(), tile.drawy()); + Draw.rect(name + (entity.open ? "-top-open" : "-top"), tile.drawx(), tile.drawy()); } @Override @@ -82,19 +108,45 @@ public class UnitFactory extends Block { float used = Math.min(powerUse * Timers.delta(), powerCapacity); - if(hasRequirements(entity.inventory, entity.buildTime/produceTime) && - entity.power.amount >= used){ + entity.time += Timers.delta() * entity.speedScl; - entity.buildTime += Timers.delta(); - entity.time += Timers.delta(); - entity.power.amount -= used; + if(entity.openCountdown > 0){ + if(entity.openCountdown > Timers.delta()){ + entity.openCountdown -= Timers.delta(); + }else{ + if(type.isFlying() || !anyEntities(tile)) { + entity.open = false; + entity.openCountdown = -1; + } + } } - if(entity.buildTime >= produceTime){ - BaseUnit unit = new BaseUnit(type, tile.getTeam()); - unit.set(tile.drawx(), tile.drawy()).add(); - unit.velocity.y = 4f; - entity.buildTime = 0f; + if(hasRequirements(entity.inventory, entity.buildTime/produceTime) && + entity.power.amount >= used && !entity.open){ + + entity.buildTime += Timers.delta(); + entity.power.amount -= used; + entity.speedScl = Mathf.lerpDelta(entity.speedScl, 1f, 0.05f); + }else{ + if(!entity.open) entity.speedScl = Mathf.lerpDelta(entity.speedScl, 0f, 0.05f); + } + + if(entity.buildTime >= produceTime && !entity.open){ + entity.open = true; + + Timers.run(openDuration/1.5f, () -> { + entity.buildTime = 0f; + Effects.shake(2f, 3f, entity); + Effects.effect(Fx.producesmoke, tile.drawx(), tile.drawy()); + + BaseUnit unit = new BaseUnit(type, tile.getTeam()); + unit.set(tile.drawx(), tile.drawy()).add(); + unit.velocity.y = launchVelocity; + }); + + entity.openCountdown = openDuration; + + //Timers.run(openDuration, () -> entity.open = false); for(ItemStack stack : requirements){ entity.inventory.removeItem(stack.item, stack.amount); @@ -117,6 +169,23 @@ public class UnitFactory extends Block { return new UnitFactoryEntity(); } + boolean anyEntities(Tile tile){ + Block type = tile.block(); + rect.setSize(type.size * tilesize, type.size * tilesize); + rect.setCenter(tile.drawx(), tile.drawy()); + + boolean[] value = new boolean[1]; + + Units.getNearby(rect, unit -> { + if(value[0]) return; + if(unit.hitbox.getRect(unit.x, unit.y).overlaps(rect)){ + value[0] = true; + } + }); + + return value[0]; + } + protected boolean hasRequirements(InventoryModule inv, float fraction){ for(ItemStack stack : requirements){ if(!inv.hasItem(stack.item, (int)(fraction * stack.amount))){ @@ -128,7 +197,10 @@ public class UnitFactory extends Block { public static class UnitFactoryEntity extends TileEntity{ public float buildTime; + public boolean open; + public float openCountdown; public float time; + public float speedScl; @Override public void write(DataOutputStream stream) throws IOException {