diff --git a/core/assets-raw/sprites/blocks/block-middle.png b/core/assets-raw/sprites/blocks/block-middle.png new file mode 100644 index 0000000000..601527a90d Binary files /dev/null and b/core/assets-raw/sprites/blocks/block-middle.png differ diff --git a/core/assets-raw/sprites/blocks/smelter-middle.png b/core/assets-raw/sprites/blocks/smelter-middle.png new file mode 100644 index 0000000000..caf10170b4 Binary files /dev/null and b/core/assets-raw/sprites/blocks/smelter-middle.png differ diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index ccf3c265bd..99851e2016 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -102,6 +102,13 @@ blocks/block-3x3 orig: 24, 24 offset: 0, 0 index: -1 +blocks/block-middle + rotate: false + xy: 948, 485 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 blocks/chainturret rotate: false xy: 544, 227 @@ -118,112 +125,112 @@ blocks/chainturret-icon index: -1 blocks/coal1 rotate: false - xy: 958, 485 + xy: 968, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coal2 rotate: false - xy: 968, 485 + xy: 978, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coal3 rotate: false - xy: 978, 485 + xy: 988, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coaldrill rotate: false - xy: 988, 485 + xy: 998, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalgenerator rotate: false - xy: 998, 485 + xy: 1008, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalgenerator-top rotate: false - xy: 1008, 485 + xy: 841, 473 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/coalpurifier rotate: false - xy: 841, 473 + xy: 841, 463 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/combustiongenerator rotate: false - xy: 841, 463 + xy: 851, 473 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/compositewall rotate: false - xy: 851, 473 + xy: 851, 463 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduit rotate: false - xy: 851, 463 + xy: 851, 453 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduitbottom rotate: false - xy: 851, 453 + xy: 861, 473 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduitliquid rotate: false - xy: 861, 473 + xy: 861, 463 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conduittop rotate: false - xy: 861, 463 + xy: 861, 453 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyor rotate: false - xy: 861, 453 + xy: 871, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyormove rotate: false - xy: 871, 475 + xy: 871, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/conveyortunnel rotate: false - xy: 871, 465 + xy: 881, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -237,42 +244,42 @@ blocks/core index: -1 blocks/cross rotate: false - xy: 881, 475 + xy: 871, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/crucible rotate: false - xy: 871, 455 + xy: 881, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/deepwater rotate: false - xy: 881, 465 + xy: 891, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt1 rotate: false - xy: 891, 475 + xy: 881, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt2 rotate: false - xy: 881, 455 + xy: 891, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt3 rotate: false - xy: 891, 465 + xy: 901, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -286,7 +293,7 @@ blocks/dirtedge index: -1 blocks/door rotate: false - xy: 901, 475 + xy: 891, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -300,7 +307,7 @@ blocks/door-large index: -1 blocks/door-large-icon rotate: false - xy: 891, 455 + xy: 901, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -314,7 +321,7 @@ blocks/door-large-open index: -1 blocks/door-open rotate: false - xy: 901, 465 + xy: 911, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -328,7 +335,7 @@ blocks/doubleturret index: -1 blocks/duriumwall rotate: false - xy: 911, 475 + xy: 901, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -342,14 +349,14 @@ blocks/duriumwall-large index: -1 blocks/duriumwall-large-icon rotate: false - xy: 901, 455 + xy: 911, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/enemyspawn rotate: false - xy: 911, 465 + xy: 921, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -363,42 +370,42 @@ blocks/flameturret index: -1 blocks/fluxpump rotate: false - xy: 911, 455 + xy: 921, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass1 rotate: false - xy: 921, 465 + xy: 931, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass2 rotate: false - xy: 931, 475 + xy: 921, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass3 rotate: false - xy: 921, 455 + xy: 931, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock1 rotate: false - xy: 931, 465 + xy: 941, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock2 rotate: false - xy: 941, 475 + xy: 931, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -412,21 +419,21 @@ blocks/grassedge index: -1 blocks/ice1 rotate: false - xy: 931, 455 + xy: 941, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ice2 rotate: false - xy: 941, 465 + xy: 951, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ice3 rotate: false - xy: 951, 475 + xy: 941, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -440,84 +447,84 @@ blocks/iceedge index: -1 blocks/icerock1 rotate: false - xy: 941, 455 + xy: 951, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerock2 rotate: false - xy: 951, 465 + xy: 961, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerockshadow1 rotate: false - xy: 961, 475 + xy: 951, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow1 rotate: false - xy: 961, 475 + xy: 951, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerockshadow2 rotate: false - xy: 951, 455 + xy: 961, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow2 rotate: false - xy: 951, 455 + xy: 961, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron1 rotate: false - xy: 981, 455 + xy: 991, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron2 rotate: false - xy: 991, 465 + xy: 1001, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron3 rotate: false - xy: 1001, 475 + xy: 991, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/irondrill rotate: false - xy: 991, 455 + xy: 1001, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ironwall rotate: false - xy: 1001, 465 + xy: 1001, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/junction rotate: false - xy: 1001, 455 + xy: 1011, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -531,7 +538,7 @@ blocks/laserturret index: -1 blocks/lava rotate: false - xy: 1011, 475 + xy: 1011, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -545,28 +552,28 @@ blocks/lavaedge index: -1 blocks/lavasmelter rotate: false - xy: 1011, 465 + xy: 1011, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquiditemjunction rotate: false - xy: 1011, 455 + xy: 492, 82 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquidjunction rotate: false - xy: 492, 82 + xy: 502, 82 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquidrouter rotate: false - xy: 502, 82 + xy: 512, 82 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -594,14 +601,14 @@ blocks/mortarturret index: -1 blocks/mossblock rotate: false - xy: 522, 82 + xy: 801, 443 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/mossstone rotate: false - xy: 522, 82 + xy: 801, 443 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -622,7 +629,7 @@ blocks/nuclearreactor-center index: -1 blocks/nuclearreactor-icon rotate: false - xy: 811, 445 + xy: 821, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -643,7 +650,7 @@ blocks/nuclearreactor-small index: -1 blocks/oil rotate: false - xy: 821, 445 + xy: 831, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -657,14 +664,14 @@ blocks/oiledge index: -1 blocks/oilrefinery rotate: false - xy: 831, 445 + xy: 841, 444 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/omnidrill rotate: false - xy: 841, 444 + xy: 851, 443 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -678,77 +685,77 @@ blocks/plasmaturret index: -1 blocks/playerspawn rotate: false - xy: 851, 443 + xy: 861, 443 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerbooster rotate: false - xy: 861, 443 + xy: 871, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/poweredconveyor rotate: false - xy: 871, 445 + xy: 881, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/poweredconveyormove rotate: false - xy: 881, 445 + xy: 891, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlaser rotate: false - xy: 891, 445 + xy: 901, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlasercorner rotate: false - xy: 901, 445 + xy: 911, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlaserrouter rotate: false - xy: 911, 445 + xy: 921, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduit rotate: false - xy: 921, 445 + xy: 931, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduitbottom rotate: false - xy: 931, 445 + xy: 941, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduittop rotate: false - xy: 941, 445 + xy: 951, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pump rotate: false - xy: 951, 445 + xy: 961, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -762,77 +769,77 @@ blocks/repairturret index: -1 blocks/rock1 rotate: false - xy: 971, 445 + xy: 981, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rock2 rotate: false - xy: 981, 445 + xy: 991, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/router rotate: false - xy: 991, 445 + xy: 1001, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rtgenerator rotate: false - xy: 1001, 445 + xy: 1011, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rtgenerator-top rotate: false - xy: 1011, 445 + xy: 527, 126 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand1 rotate: false - xy: 527, 126 + xy: 527, 116 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand2 rotate: false - xy: 527, 116 + xy: 524, 106 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand3 rotate: false - xy: 524, 106 + xy: 736, 381 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock1 rotate: false - xy: 736, 381 + xy: 740, 371 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock2 rotate: false - xy: 740, 371 + xy: 740, 361 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock3 rotate: false - xy: 740, 361 + xy: 740, 351 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -853,7 +860,7 @@ blocks/shadow index: -1 blocks/shieldgenerator rotate: false - xy: 740, 341 + xy: 740, 331 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -867,21 +874,28 @@ blocks/shotgunturret index: -1 blocks/shrub rotate: false - xy: 798, 393 + xy: 302, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/shrubshadow rotate: false - xy: 302, 79 + xy: 312, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/smelter rotate: false - xy: 312, 79 + xy: 322, 79 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +blocks/smelter-middle + rotate: false + xy: 332, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -895,42 +909,42 @@ blocks/sniperturret index: -1 blocks/snow1 rotate: false - xy: 322, 79 + xy: 342, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snow2 rotate: false - xy: 332, 79 + xy: 352, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snow3 rotate: false - xy: 342, 79 + xy: 362, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock1 rotate: false - xy: 352, 79 + xy: 372, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock2 rotate: false - xy: 362, 83 + xy: 382, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock3 rotate: false - xy: 372, 83 + xy: 392, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -944,28 +958,28 @@ blocks/snowedge index: -1 blocks/sorter rotate: false - xy: 382, 83 + xy: 402, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyor rotate: false - xy: 392, 83 + xy: 412, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyormove rotate: false - xy: 402, 83 + xy: 422, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelwall rotate: false - xy: 412, 83 + xy: 432, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -979,56 +993,56 @@ blocks/steelwall-large index: -1 blocks/steelwall-large-icon rotate: false - xy: 422, 83 + xy: 442, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone1 rotate: false - xy: 432, 83 + xy: 452, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone2 rotate: false - xy: 442, 83 + xy: 462, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone3 rotate: false - xy: 452, 83 + xy: 472, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock1 rotate: false - xy: 462, 83 + xy: 482, 76 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock2 rotate: false - xy: 472, 83 + xy: 492, 72 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock3 rotate: false - xy: 482, 76 + xy: 502, 72 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stonedrill rotate: false - xy: 492, 72 + xy: 512, 72 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1042,35 +1056,35 @@ blocks/stoneedge index: -1 blocks/stoneformer rotate: false - xy: 502, 72 + xy: 522, 72 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stonewall rotate: false - xy: 512, 72 + xy: 528, 96 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/teleporter rotate: false - xy: 522, 72 + xy: 534, 106 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/teleporter-top rotate: false - xy: 528, 96 + xy: 538, 96 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/thermalgenerator rotate: false - xy: 534, 106 + xy: 532, 86 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1091,49 +1105,49 @@ blocks/titancannon-icon index: -1 blocks/titanium1 rotate: false - xy: 538, 96 + xy: 532, 76 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium2 rotate: false - xy: 532, 86 + xy: 542, 86 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium3 rotate: false - xy: 532, 76 + xy: 542, 76 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumdrill rotate: false - xy: 542, 86 + xy: 746, 381 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumpurifier rotate: false - xy: 542, 76 + xy: 750, 371 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumshieldwall rotate: false - xy: 746, 381 + xy: 750, 361 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumwall rotate: false - xy: 750, 371 + xy: 750, 351 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1147,7 +1161,7 @@ blocks/titaniumwall-large index: -1 blocks/titaniumwall-large-icon rotate: false - xy: 750, 361 + xy: 750, 341 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1161,35 +1175,35 @@ blocks/turret index: -1 blocks/uranium1 rotate: false - xy: 750, 331 + xy: 740, 311 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uranium2 rotate: false - xy: 750, 321 + xy: 750, 311 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uranium3 rotate: false - xy: 740, 311 + xy: 734, 301 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uraniumdrill rotate: false - xy: 750, 311 + xy: 744, 301 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/water rotate: false - xy: 734, 301 + xy: 754, 301 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1210,7 +1224,7 @@ blocks/waveturret index: -1 bullet rotate: false - xy: 948, 485 + xy: 958, 485 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1483,56 +1497,56 @@ enemyarrow index: -1 icon-coal rotate: false - xy: 961, 465 + xy: 971, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-dirium rotate: false - xy: 971, 475 + xy: 961, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-iron rotate: false - xy: 961, 455 + xy: 971, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-sand rotate: false - xy: 971, 465 + xy: 981, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-steel rotate: false - xy: 981, 475 + xy: 971, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-stone rotate: false - xy: 971, 455 + xy: 981, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-titanium rotate: false - xy: 981, 465 + xy: 991, 475 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-uranium rotate: false - xy: 991, 475 + xy: 981, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1574,28 +1588,28 @@ mechs/ship-standard index: -1 shell rotate: false - xy: 740, 351 + xy: 740, 341 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot rotate: false - xy: 740, 331 + xy: 740, 321 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot-long rotate: false - xy: 740, 321 + xy: 798, 393 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanshell rotate: false - xy: 750, 351 + xy: 750, 331 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2371,35 +2385,35 @@ weapons/blaster index: -1 weapons/flamer rotate: false - xy: 921, 475 + xy: 911, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/mortar rotate: false - xy: 512, 82 + xy: 522, 82 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/multigun rotate: false - xy: 801, 443 + xy: 811, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/railgun rotate: false - xy: 961, 445 + xy: 971, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/triblaster rotate: false - xy: 750, 341 + xy: 750, 321 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 090660964e..05bdfbdeae 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/graphics/Fx.java b/core/src/io/anuke/mindustry/graphics/Fx.java index 670ee139ed..f65230e76a 100644 --- a/core/src/io/anuke/mindustry/graphics/Fx.java +++ b/core/src/io/anuke/mindustry/graphics/Fx.java @@ -163,6 +163,16 @@ public class Fx{ Draw.reset(); }); }), + + fuelburn = new Effect(23, e -> { + Angles.randLenVectors(e.id, 5, e.ifract()*9f, (x, y)->{ + float len = e.fract()*4f; + Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract()); + //Draw.alpha(e.fract()); + Draw.rect("circle", e.x + x, e.y + y, len, len); + Draw.reset(); + }); + }), laserspark = new Effect(14, e -> { Angles.randLenVectors(e.id, 8, 1f + e.ifract()*11f, (x, y)->{ @@ -306,7 +316,7 @@ public class Fx{ smelt = new Effect(10, e -> { Draw.thickness(1f); Draw.color(Color.YELLOW, Color.RED, e.ifract()); - Draw.spikes(e.x, e.y, e.ifract() * 5f, 2, 8); + Draw.spikes(e.x, e.y, e.ifract() * 5f, 1f, 8); Draw.reset(); }), diff --git a/core/src/io/anuke/mindustry/io/BundleGen.java b/core/src/io/anuke/mindustry/io/BundleGen.java index 1a50311af8..dc65da789e 100644 --- a/core/src/io/anuke/mindustry/io/BundleGen.java +++ b/core/src/io/anuke/mindustry/io/BundleGen.java @@ -14,8 +14,11 @@ import io.anuke.mindustry.world.Map; import io.anuke.ucore.core.Inputs.DeviceType; import io.anuke.ucore.core.KeyBinds; import io.anuke.ucore.core.KeyBinds.Keybind; +import io.anuke.ucore.scene.ui.SettingsDialog.SettingsTable.Setting; import io.anuke.ucore.util.Bundles; +import io.anuke.ucore.util.Mathf; +/**Used for generating a bundle from existing strings in the game.*/ public class BundleGen { private static FileHandle file; @@ -25,12 +28,12 @@ public class BundleGen { file.writeString("", false); write("about.text=" + join(Vars.aboutText)); write("discord.text=Join the mindustry discord!\n[orange]"); - /* + Mathf.each(table -> { for(Setting setting : table.getSettings()){ write("setting." + setting.name + ".name=" + setting.title); } - }, Vars.ui.getPrefs().game, Vars.ui.getPrefs().graphics, Vars.ui.getPrefs().sound);*/ + }, Vars.ui.settings.game, Vars.ui.settings.graphics, Vars.ui.settings.sound); for(Map map : Vars.world.maps().list()){ write("map." + map.name + ".name=" + map.name); diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 0b5c19e8ae..f52300c119 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -137,7 +137,7 @@ public class Block{ tile.entity.addItem(item, 1); } - public boolean acceptItem(Item item, Tile dest, Tile source){ + public boolean acceptItem(Item item, Tile tile, Tile source){ return false; } diff --git a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java index 1369344060..b81afdd768 100644 --- a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java @@ -20,19 +20,23 @@ public class ProductionBlocks{ } }, - smelter = new Crafter("smelter"){ + smelter = new Smelter("smelter"){ { health = 70; - requirements = new Item[]{Item.coal, Item.iron}; + inputs = new Item[]{Item.iron}; + fuel = Item.coal; result = Item.steel; } }, - crucible = new Crafter("crucible"){ + crucible = new Smelter("crucible"){ { health = 90; - requirements = new Item[]{Item.titanium, Item.steel}; + inputs = new Item[]{Item.titanium, Item.steel}; + fuel = Item.coal; result = Item.dirium; + burnDuration = 80f; + craftTime = 40f; } }, diff --git a/core/src/io/anuke/mindustry/world/blocks/types/BlockPart.java b/core/src/io/anuke/mindustry/world/blocks/types/BlockPart.java index 8223915c67..005288795b 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/BlockPart.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/BlockPart.java @@ -31,8 +31,8 @@ public class BlockPart extends Block implements PowerAcceptor, LiquidAcceptor{ } @Override - public boolean acceptItem(Item item, Tile dest, Tile source){ - return dest.getLinked().block().acceptItem(item, dest.getLinked(), source); + public boolean acceptItem(Item item, Tile tile, Tile source){ + return tile.getLinked().block().acceptItem(item, tile.getLinked(), source); } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/CoreBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/CoreBlock.java index abf97f32d5..5216e7a517 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/CoreBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/CoreBlock.java @@ -28,7 +28,7 @@ public class CoreBlock extends Block { } @Override - public boolean acceptItem(Item item, Tile dest, Tile source){ + public boolean acceptItem(Item item, Tile tile, Tile source){ return true; } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/PowerTurret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/PowerTurret.java index c8d73ccd78..b69b85e08d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/PowerTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/PowerTurret.java @@ -14,7 +14,6 @@ import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.PowerAcceptor; import io.anuke.ucore.core.Draw; -import io.anuke.ucore.util.Bundles; import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Strings; @@ -70,7 +69,7 @@ public class PowerTurret extends Turret implements PowerAcceptor{ } @Override - public boolean acceptItem(Item item, Tile dest, Tile source){ + public boolean acceptItem(Item item, Tile tile, Tile source){ return false; } 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 8a4d2de1eb..eaeef5f9f6 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 @@ -17,9 +17,9 @@ import io.anuke.ucore.util.Strings; public class ShieldBlock extends PowerBlock{ public float shieldRadius = 40f; public float powerDrain = 0.005f; - public float powerPerDamage = 0.1f; + public float powerPerDamage = 0.07f; public float maxRadius = 40f; - public float radiusScale = 240f; + public float radiusScale = 300f; public ShieldBlock(String name) { super(name); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java index 38391da0f0..67ae84b3f2 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java @@ -123,8 +123,8 @@ public class Turret extends Block{ } @Override - public boolean acceptItem(Item item, Tile dest, Tile source){ - return item == ammo && dest.entity().ammo < maxammo; + public boolean acceptItem(Item item, Tile tile, Tile source){ + return item == ammo && tile.entity().ammo < maxammo; } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java index 89e9def39e..5f5feba780 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java @@ -128,11 +128,11 @@ public class Conveyor extends Block{ } @Override - public boolean acceptItem(Item item, Tile dest, Tile source){ - int direction = source == null ? 0 : Math.abs(source.relativeTo(dest.x, dest.y) - dest.getRotation()); - float minitem = dest.entity().minitem; + public boolean acceptItem(Item item, Tile tile, Tile source){ + int direction = source == null ? 0 : Math.abs(source.relativeTo(tile.x, tile.y) - tile.getRotation()); + float minitem = tile.entity().minitem; return (((direction == 0) && minitem > 0.05f) || - ((direction %2 == 1) && minitem > 0.52f)) && (source == null || !(source.block().rotate && (source.getRotation() + 2) % 4 == dest.getRotation())); + ((direction %2 == 1) && minitem > 0.52f)) && (source == null || !(source.block().rotate && (source.getRotation() + 2) % 4 == tile.getRotation())); } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Junction.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Junction.java index 159a1008ab..c32b5967ef 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Junction.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Junction.java @@ -3,7 +3,6 @@ package io.anuke.mindustry.world.blocks.types.distribution; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.UCore; import io.anuke.ucore.core.Timers; public class Junction extends Block{ @@ -32,11 +31,11 @@ public class Junction extends Block{ } @Override - public boolean acceptItem(Item item, Tile dest, Tile source){ - int dir = source.relativeTo(dest.x, dest.y); + public boolean acceptItem(Item item, Tile tile, Tile source){ + int dir = source.relativeTo(tile.x, tile.y); if(dir == -1) return false; - Tile to = dest.getNearby()[dir]; - return to != null && to.block().acceptItem(item, to, dest); + Tile to = tile.getNearby()[dir]; + return to != null && to.block().acceptItem(item, to, tile); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidItemJunction.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidItemJunction.java index 5a04f45f26..cbd9f9dd7d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidItemJunction.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidItemJunction.java @@ -53,12 +53,12 @@ public class LiquidItemJunction extends LiquidBlock{ } @Override - public boolean acceptItem(Item item, Tile dest, Tile source){ - int dir = source.relativeTo(dest.x, dest.y); + public boolean acceptItem(Item item, Tile tile, Tile source){ + int dir = source.relativeTo(tile.x, tile.y); - if((dir+dest.getRotation()) % 2 == 0) return false; + if((dir+ tile.getRotation()) % 2 == 0) return false; - Tile to = dest.getNearby()[dir]; - return to != null && to.block().acceptItem(item, to, dest); + Tile to = tile.getNearby()[dir]; + return to != null && to.block().acceptItem(item, to, tile); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java index f96e75c26a..3162acde1c 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Router.java @@ -53,8 +53,8 @@ public class Router extends Block{ } @Override - public boolean acceptItem(Item item, Tile dest, Tile source){ - int items = dest.entity.totalItems(); + public boolean acceptItem(Item item, Tile tile, Tile source){ + int items = tile.entity.totalItems(); return items < capacity; } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java index 7576b43139..3cad9e690b 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java @@ -38,11 +38,11 @@ public class Sorter extends Junction implements Configurable{ } @Override - public boolean acceptItem(Item item, Tile dest, Tile source){ + public boolean acceptItem(Item item, Tile tile, Tile source){ if(source.block() instanceof Sorter) return false; - Tile to = getTileTarget(item, dest, source, false); + Tile to = getTileTarget(item, tile, source, false); - return to != null && to.block().acceptItem(item, to, dest); + return to != null && to.block().acceptItem(item, to, tile); } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java index d0ce8d0d1f..e8e814922d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Teleporter.java @@ -5,21 +5,22 @@ import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.ObjectSet; import io.anuke.mindustry.entities.TileEntity; 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.Configurable; +import io.anuke.mindustry.world.blocks.types.PowerBlock; import io.anuke.ucore.core.Draw; import io.anuke.ucore.core.Timers; import io.anuke.ucore.scene.ui.ButtonGroup; import io.anuke.ucore.scene.ui.ImageButton; import io.anuke.ucore.scene.ui.layout.Table; import io.anuke.ucore.util.Mathf; +import io.anuke.ucore.util.Strings; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; -public class Teleporter extends Block implements Configurable{ +public class Teleporter extends PowerBlock implements Configurable{ public static final Color[] colorArray = {Color.ROYAL, Color.ORANGE, Color.SCARLET, Color.FOREST, Color.PURPLE, Color.GOLD, Color.PINK, Color.BLACK}; public static final int colors = colorArray.length; @@ -29,6 +30,8 @@ public class Teleporter extends Block implements Configurable{ private Array removal = new Array<>(); private Array returns = new Array<>(); + protected float powerPerItem = 1f; + static{ for(int i = 0; i < colors; i ++){ teleporters[i] = new ObjectSet<>(); @@ -40,6 +43,13 @@ public class Teleporter extends Block implements Configurable{ update = true; solid = true; health = 80; + powerCapacity = 30f; + } + + @Override + public void getStats(Array list){ + super.getStats(list); + list.add("[powerinfo]Power/item: " + Strings.toFixed(powerPerItem, 1)); } @Override @@ -103,18 +113,22 @@ public class Teleporter extends Block implements Configurable{ @Override public void handleItem(Item item, Tile tile, Tile source){ + PowerEntity entity = tile.entity(); + Array links = findLinks(tile); if(links.size > 0){ Tile target = links.get(Mathf.random(0, links.size-1)); target.entity.addItem(item, 1); } + + entity.power -= powerPerItem; } @Override - public boolean acceptItem(Item item, Tile dest, Tile source){ - Array links = findLinks(dest); - return links.size > 0; + public boolean acceptItem(Item item, Tile tile, Tile source){ + PowerEntity entity = tile.entity(); + return entity.power >= powerPerItem && findLinks(tile).size > 0; } @Override @@ -147,7 +161,7 @@ public class Teleporter extends Block implements Configurable{ return returns; } - public static class TeleporterEntity extends TileEntity{ + public static class TeleporterEntity extends PowerEntity{ public byte color = 0; @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java index 4b15db240d..15961d2937 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java @@ -34,10 +34,10 @@ public class TunnelConveyor extends Block{ } @Override - public boolean acceptItem(Item item, Tile dest, Tile source){ - int rot = source.relativeTo(dest.x, dest.y); - if(rot != (dest.getRotation() + 2)%4) return false; - Tile tunnel = getDestTunnel(dest, item); + public boolean acceptItem(Item item, Tile tile, Tile source){ + int rot = source.relativeTo(tile.x, tile.y); + if(rot != (tile.getRotation() + 2)%4) return false; + Tile tunnel = getDestTunnel(tile, item); if(tunnel != null){ Tile to = tunnel.getNearby()[tunnel.getRotation()]; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/Crafter.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Crafter.java deleted file mode 100644 index 368d6df053..0000000000 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/Crafter.java +++ /dev/null @@ -1,81 +0,0 @@ -package io.anuke.mindustry.world.blocks.types.production; - -import java.util.Arrays; - -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.utils.Array; - -import io.anuke.mindustry.Vars; -import io.anuke.mindustry.graphics.Fx; -import io.anuke.mindustry.resource.Item; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.Tile; -import io.anuke.ucore.core.Effects; - -public class Crafter extends Block{ - protected final int timerDump = timers++; - - protected Item[] requirements; - protected Item result; - - int capacity = 20; - - public Crafter(String name) { - super(name); - update = true; - solid = true; - } - - @Override - public void getStats(Array list){ - super.getStats(list); - list.add("[craftinfo]Input: " + Arrays.toString(requirements)); - list.add("[craftinfo]Output: " + result); - list.add("[craftinfo]Capacity per input type: " + capacity); - } - - @Override - public void update(Tile tile){ - - if(tile.entity.timer.get(timerDump, 5) && tile.entity.hasItem(result)){ - tryDump(tile, -1, result); - } - - for(Item item : requirements){ - if(!tile.entity.hasItem(item)){ - return; - } - } - - // crafter full - it has to be emptied before it can craft again. - if(tile.entity.getItem(result) >= capacity){ - return; - } - - for(Item item : requirements){ - tile.entity.removeItem(item, 1); - } - - offloadNear(tile, result); - Effects.effect(Fx.smelt, tile.entity); - } - - @Override - public boolean acceptItem(Item item, Tile dest, Tile source){ - for(Item req : requirements){ - if(item == req){ - return dest.entity.getItem(item) < capacity; - } - } - return false; - } - - @Override - public void drawSelect(Tile tile){ - // each req item has its input buffer + 1 buffer for output. - int totalCapacity = (requirements.length + 1) * capacity; - float fract = ((float)tile.entity.totalItems())/totalCapacity; - - Vars.renderer.drawBar(Color.GREEN, tile.worldx(), tile.worldy() + 6, fract); - } -} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java b/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java index 17762f97ee..f8417e8c4a 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/NuclearReactor.java @@ -19,7 +19,6 @@ import io.anuke.ucore.core.Draw; import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Timers; import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Strings; import io.anuke.ucore.util.Tmp; //TODO possibly proken diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/Smelter.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Smelter.java new file mode 100644 index 0000000000..f0bea03f46 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Smelter.java @@ -0,0 +1,144 @@ +package io.anuke.mindustry.world.blocks.types.production; + +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.utils.Array; +import io.anuke.mindustry.Vars; +import io.anuke.mindustry.entities.TileEntity; +import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.resource.Item; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.Tile; +import io.anuke.ucore.core.Draw; +import io.anuke.ucore.core.Effects; +import io.anuke.ucore.core.Effects.Effect; +import io.anuke.ucore.core.Timers; +import io.anuke.ucore.util.Mathf; +import io.anuke.ucore.util.Strings; + +import java.util.Arrays; + +public class Smelter extends Block{ + protected final int timerDump = timers++; + protected final int timerCraft = timers++; + + protected Item[] inputs; + protected Item fuel; + protected Item result; + + protected float craftTime = 30f; //time to craft one item, so max 2 items per second by default + protected float burnDuration = 60f; //by default, the fuel will burn 60 frames, so that's 2 items/fuel at most + protected Effect craftEffect = Fx.smelt, burnEffect = Fx.fuelburn; + + protected int capacity = 30; + + public Smelter(String name) { + super(name); + update = true; + solid = true; + } + + @Override + public void getStats(Array list){ + super.getStats(list); + list.add("[craftinfo]Input: " + Arrays.toString(inputs)); + list.add("[craftinfo]Fuel: " + fuel); + list.add("[craftinfo]Output: " + result); + list.add("[craftinfo]Fuel Duration: " + Strings.toFixed(burnDuration/60f, 1)); + list.add("[craftinfo]Max output/second: " + Strings.toFixed(60f/craftTime, 1)); + list.add("[craftinfo]Input Capacity: " + capacity); + list.add("[craftinfo]Output Capacity: " + capacity); + } + + @Override + public void update(Tile tile){ + CrafterEntity entity = tile.entity(); + + if(entity.timer.get(timerDump, 5) && entity.hasItem(result)){ + tryDump(tile, -1, result); + } + + //add fuel + if(entity.getItem(fuel) > 0 && entity.burnTime <= 0f){ + entity.removeItem(fuel, 1); + entity.burnTime += burnDuration; + Effects.effect(burnEffect, entity.x + Mathf.range(2f), entity.y + Mathf.range(2f)); + } + + //decrement burntime + if(entity.burnTime > 0){ + entity.burnTime -= Timers.delta(); + } + + //make sure it has all the items + for(Item item : inputs){ + if(!entity.hasItem(item)){ + return; + } + } + + if(entity.getItem(result) >= capacity //output full + || entity.burnTime <= 0 //not burning + || !entity.timer.get(timerCraft, craftTime)){ //not yet time + return; + } + + for(Item item : inputs){ + entity.removeItem(item, 1); + } + + offloadNear(tile, result); + Effects.effect(craftEffect, entity); + } + + @Override + public boolean acceptItem(Item item, Tile tile, Tile source){ + int amount = 0; + boolean isInput = false; + + for(Item req : inputs){ + if(req == item) isInput = true; + amount += tile.entity.getItem(req); + } + + return (isInput && amount < capacity) || (item == fuel && tile.entity.getItem(fuel) < capacity); + } + + @Override + public void draw(Tile tile){ + super.draw(tile); + + CrafterEntity entity = tile.entity(); + + //draw glowing center + if(entity.burnTime > 0){ + Draw.color(1f, 1f, 1f, Mathf.absin(Timers.time(), 9f, 0.4f) + Mathf.random(0.05f)); + Draw.rect("smelter-middle", tile.worldx(), tile.worldy()); + Draw.color(); + } + } + + + @Override + public void drawSelect(Tile tile){ + //all required items are put into one big capacity buffer + int totalCapacity = capacity; + int amount = 0; + + for(Item item : inputs){ + amount += tile.entity.getItem(item); + } + + float fract = ((float)amount)/totalCapacity; + + Vars.renderer.drawBar(Color.GREEN, tile.worldx(), tile.worldy() + 6, fract); + } + + @Override + public TileEntity getEntity() { + return new CrafterEntity(); + } + + public class CrafterEntity extends TileEntity{ + public float burnTime; + } +}