diff --git a/core/assets-raw/sprites/blocks/conveyortunnel.png b/core/assets-raw/sprites/blocks/conveyortunnel.png new file mode 100644 index 0000000000..59bdfcee8c Binary files /dev/null and b/core/assets-raw/sprites/blocks/conveyortunnel.png differ diff --git a/core/assets/maps/grassland.png b/core/assets/maps/grassland.png index 9a964d95c7..2396fbf212 100644 Binary files a/core/assets/maps/grassland.png and b/core/assets/maps/grassland.png differ diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index ced9b2c0ee..9e3e5f96c7 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -214,6 +214,13 @@ blocks/conveyormove orig: 8, 8 offset: 0, 0 index: -1 +blocks/conveyortunnel + rotate: false + xy: 494, 429 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 blocks/core rotate: false xy: 413, 361 @@ -223,49 +230,49 @@ blocks/core index: -1 blocks/cross rotate: false - xy: 494, 429 + xy: 484, 419 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/crucible rotate: false - xy: 484, 419 + xy: 494, 419 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/deepwater rotate: false - xy: 494, 419 + xy: 480, 409 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt1 rotate: false - xy: 480, 409 + xy: 480, 399 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt2 rotate: false - xy: 480, 399 + xy: 490, 409 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirt3 rotate: false - xy: 490, 409 + xy: 490, 399 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/dirtblock rotate: false - xy: 490, 399 + xy: 476, 385 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -279,7 +286,7 @@ blocks/dirtedge index: -1 blocks/door rotate: false - xy: 476, 385 + xy: 486, 389 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -293,7 +300,7 @@ blocks/door-large index: -1 blocks/door-large-icon rotate: false - xy: 486, 389 + xy: 461, 305 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -307,7 +314,7 @@ blocks/door-large-open index: -1 blocks/door-open rotate: false - xy: 461, 305 + xy: 459, 295 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -321,7 +328,7 @@ blocks/doubleturret index: -1 blocks/duriumwall rotate: false - xy: 459, 295 + xy: 459, 285 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -335,7 +342,7 @@ blocks/duriumwall-large index: -1 blocks/duriumwall-large-icon rotate: false - xy: 459, 285 + xy: 459, 275 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -349,70 +356,70 @@ blocks/flameturret index: -1 blocks/fluxpump rotate: false - xy: 459, 265 + xy: 459, 255 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass1 rotate: false - xy: 459, 255 + xy: 441, 223 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass2 rotate: false - xy: 441, 223 + xy: 500, 409 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass3 rotate: false - xy: 500, 409 + xy: 500, 399 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock-edge-0 rotate: false - xy: 486, 379 + xy: 496, 379 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock-edge-1 rotate: false - xy: 496, 379 + xy: 476, 375 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock-edge-2 rotate: false - xy: 476, 375 + xy: 475, 365 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock-edge-3 rotate: false - xy: 475, 365 + xy: 475, 355 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock1 rotate: false - xy: 500, 399 + xy: 496, 389 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock2 rotate: false - xy: 496, 389 + xy: 486, 379 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -426,21 +433,21 @@ blocks/grassedge index: -1 blocks/ice1 rotate: false - xy: 475, 355 + xy: 475, 345 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ice2 rotate: false - xy: 475, 345 + xy: 473, 335 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ice3 rotate: false - xy: 473, 335 + xy: 471, 325 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -454,84 +461,84 @@ blocks/iceedge index: -1 blocks/icerock1 rotate: false - xy: 471, 325 + xy: 471, 315 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerock2 rotate: false - xy: 471, 315 + xy: 471, 305 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerockshadow1 rotate: false - xy: 471, 305 + xy: 469, 295 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow1 rotate: false - xy: 471, 305 + xy: 469, 295 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerockshadow2 rotate: false - xy: 469, 295 + xy: 469, 285 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow2 rotate: false - xy: 469, 295 + xy: 469, 285 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron1 rotate: false - xy: 496, 369 + xy: 485, 359 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron2 rotate: false - xy: 485, 359 + xy: 485, 349 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron3 rotate: false - xy: 485, 349 + xy: 495, 359 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/irondrill rotate: false - xy: 495, 359 + xy: 495, 349 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ironwall rotate: false - xy: 495, 349 + xy: 485, 339 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/junction rotate: false - xy: 485, 339 + xy: 495, 339 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -545,7 +552,7 @@ blocks/laserturret index: -1 blocks/lava rotate: false - xy: 495, 339 + xy: 325, 209 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -559,28 +566,28 @@ blocks/lavaedge index: -1 blocks/lavasmelter rotate: false - xy: 325, 209 + xy: 325, 199 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquiditemjunction rotate: false - xy: 325, 199 + xy: 325, 189 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquidjunction rotate: false - xy: 325, 189 + xy: 335, 211 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquidrouter rotate: false - xy: 335, 211 + xy: 345, 211 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -608,14 +615,14 @@ blocks/mortarturret index: -1 blocks/mossblock rotate: false - xy: 335, 201 + xy: 335, 191 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/mossstone rotate: false - xy: 335, 201 + xy: 335, 191 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -636,7 +643,7 @@ blocks/nuclearreactor-center index: -1 blocks/nuclearreactor-icon rotate: false - xy: 345, 201 + xy: 345, 191 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -657,7 +664,7 @@ blocks/nuclearreactor-small index: -1 blocks/oil rotate: false - xy: 345, 191 + xy: 355, 208 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -671,14 +678,14 @@ blocks/oiledge index: -1 blocks/oilrefinery rotate: false - xy: 355, 208 + xy: 355, 198 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/omnidrill rotate: false - xy: 355, 198 + xy: 355, 188 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -692,70 +699,70 @@ blocks/plasmaturret index: -1 blocks/powerbooster rotate: false - xy: 355, 188 + xy: 327, 173 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/poweredconveyor rotate: false - xy: 327, 173 + xy: 325, 163 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/poweredconveyormove rotate: false - xy: 325, 163 + xy: 325, 153 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlaser rotate: false - xy: 325, 153 + xy: 315, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlasercorner rotate: false - xy: 315, 143 + xy: 325, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlaserrouter rotate: false - xy: 325, 143 + xy: 314, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduit rotate: false - xy: 314, 133 + xy: 314, 123 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduitbottom rotate: false - xy: 314, 123 + xy: 324, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduittop rotate: false - xy: 324, 133 + xy: 314, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pump rotate: false - xy: 314, 113 + xy: 324, 123 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -769,70 +776,70 @@ blocks/repairturret index: -1 blocks/rock1 rotate: false - xy: 314, 103 + xy: 324, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rock2 rotate: false - xy: 324, 113 + xy: 314, 93 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/router rotate: false - xy: 314, 93 + xy: 324, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rtgenerator rotate: false - xy: 324, 103 + xy: 314, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand1 rotate: false - xy: 314, 83 + xy: 324, 93 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand2 rotate: false - xy: 324, 93 + xy: 314, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand3 rotate: false - xy: 314, 73 + xy: 324, 83 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock1 rotate: false - xy: 324, 83 + xy: 314, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock2 rotate: false - xy: 314, 63 + xy: 324, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock3 rotate: false - xy: 324, 73 + xy: 314, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -853,7 +860,7 @@ blocks/shadow index: -1 blocks/shieldgenerator rotate: false - xy: 324, 63 + xy: 314, 43 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -867,21 +874,21 @@ blocks/shotgunturret index: -1 blocks/shrub rotate: false - xy: 314, 33 + xy: 324, 43 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/shrubshadow rotate: false - xy: 324, 43 + xy: 314, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/smelter rotate: false - xy: 314, 23 + xy: 324, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -895,42 +902,42 @@ blocks/sniperturret index: -1 blocks/snow1 rotate: false - xy: 324, 33 + xy: 314, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snow2 rotate: false - xy: 314, 13 + xy: 324, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snow3 rotate: false - xy: 324, 23 + xy: 324, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock1 rotate: false - xy: 324, 13 + xy: 314, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock2 rotate: false - xy: 314, 3 + xy: 324, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock3 rotate: false - xy: 324, 3 + xy: 411, 217 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -944,28 +951,28 @@ blocks/snowedge index: -1 blocks/sorter rotate: false - xy: 411, 217 + xy: 408, 207 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyor rotate: false - xy: 408, 207 + xy: 408, 197 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyormove rotate: false - xy: 408, 197 + xy: 421, 217 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelwall rotate: false - xy: 421, 217 + xy: 431, 219 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -979,7 +986,7 @@ blocks/steelwall-large index: -1 blocks/steelwall-large-icon rotate: false - xy: 431, 219 + xy: 418, 207 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -993,84 +1000,84 @@ blocks/stone index: -1 blocks/stone1 rotate: false - xy: 418, 207 + xy: 418, 197 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone2 rotate: false - xy: 418, 197 + xy: 441, 213 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone3 rotate: false - xy: 441, 213 + xy: 431, 209 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock-edge-0 rotate: false - xy: 365, 198 + xy: 365, 188 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock-edge-1 rotate: false - xy: 365, 188 + xy: 481, 325 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock-edge-2 rotate: false - xy: 481, 325 + xy: 481, 315 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock-edge-3 rotate: false - xy: 481, 315 + xy: 481, 305 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock-smooth1 rotate: false - xy: 481, 305 + xy: 479, 295 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock1 rotate: false - xy: 431, 209 + xy: 428, 199 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock2 rotate: false - xy: 428, 199 + xy: 441, 203 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock3 rotate: false - xy: 441, 203 + xy: 365, 198 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stonedrill rotate: false - xy: 479, 295 + xy: 479, 285 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1084,35 +1091,35 @@ blocks/stoneedge index: -1 blocks/stoneformer rotate: false - xy: 479, 285 + xy: 479, 275 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stonewall rotate: false - xy: 479, 275 + xy: 479, 265 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/teleporter rotate: false - xy: 479, 265 + xy: 479, 255 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/teleporter-top rotate: false - xy: 479, 255 + xy: 479, 245 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/thermalgenerator rotate: false - xy: 479, 245 + xy: 491, 329 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1133,49 +1140,49 @@ blocks/titancannon-icon index: -1 blocks/titanium1 rotate: false - xy: 491, 329 + xy: 491, 319 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium2 rotate: false - xy: 491, 319 + xy: 491, 309 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium3 rotate: false - xy: 491, 309 + xy: 501, 329 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumdrill rotate: false - xy: 501, 329 + xy: 501, 319 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumpurifier rotate: false - xy: 501, 319 + xy: 501, 309 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumshieldwall rotate: false - xy: 501, 309 + xy: 491, 299 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumwall rotate: false - xy: 491, 299 + xy: 501, 299 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1189,7 +1196,7 @@ blocks/titaniumwall-large index: -1 blocks/titaniumwall-large-icon rotate: false - xy: 501, 299 + xy: 489, 289 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1203,35 +1210,35 @@ blocks/turret index: -1 blocks/uranium1 rotate: false - xy: 499, 289 + xy: 489, 269 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uranium2 rotate: false - xy: 489, 269 + xy: 499, 279 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uranium3 rotate: false - xy: 499, 279 + xy: 489, 259 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uraniumdrill rotate: false - xy: 489, 259 + xy: 499, 269 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/water rotate: false - xy: 499, 269 + xy: 489, 249 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1525,49 +1532,49 @@ enemyarrow index: -1 icon-coal rotate: false - xy: 469, 285 + xy: 469, 275 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-dirium rotate: false - xy: 469, 275 + xy: 469, 265 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-iron rotate: false - xy: 469, 265 + xy: 469, 255 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-steel rotate: false - xy: 469, 255 + xy: 459, 245 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-stone rotate: false - xy: 459, 245 + xy: 469, 245 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-titanium rotate: false - xy: 469, 245 + xy: 486, 369 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-uranium rotate: false - xy: 486, 369 + xy: 496, 369 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1595,28 +1602,28 @@ mechs/mech-standard index: -1 shell rotate: false - xy: 314, 53 + xy: 324, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot rotate: false - xy: 314, 43 + xy: 324, 53 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot-long rotate: false - xy: 324, 53 + xy: 314, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanshell rotate: false - xy: 489, 289 + xy: 489, 279 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2133,35 +2140,35 @@ weapons/blaster index: -1 weapons/flamer rotate: false - xy: 459, 275 + xy: 459, 265 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/mortar rotate: false - xy: 345, 211 + xy: 335, 201 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/multigun rotate: false - xy: 335, 191 + xy: 345, 201 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/railgun rotate: false - xy: 324, 123 + xy: 314, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/triblaster rotate: false - xy: 489, 279 + xy: 499, 289 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index adf7a96486..6b8133c945 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/ai/Pathfind.java b/core/src/io/anuke/mindustry/ai/Pathfind.java index 6b28151904..205d06b30a 100644 --- a/core/src/io/anuke/mindustry/ai/Pathfind.java +++ b/core/src/io/anuke/mindustry/ai/Pathfind.java @@ -105,6 +105,9 @@ public class Pathfind{ } void findNode(Enemy enemy){ + if(enemy.spawn >= Vars.control.getSpawnPoints().size){ + enemy.spawn = 0; + } if(Vars.control.getSpawnPoints().get(enemy.spawn).pathTiles == null){ return; diff --git a/core/src/io/anuke/mindustry/resource/Recipe.java b/core/src/io/anuke/mindustry/resource/Recipe.java index f1399e9ab2..22ccc746a5 100644 --- a/core/src/io/anuke/mindustry/resource/Recipe.java +++ b/core/src/io/anuke/mindustry/resource/Recipe.java @@ -26,11 +26,11 @@ public enum Recipe{ poweredconveyor(distribution, DistributionBlocks.pulseconveyor, stack(Item.dirium, 1)), router(distribution, DistributionBlocks.router, stack(Item.stone, 2)), junction(distribution, DistributionBlocks.junction, stack(Item.iron, 2)), + tunnel(distribution, DistributionBlocks.tunnel, stack(Item.iron, 2)), conduit(distribution, DistributionBlocks.conduit, stack(Item.steel, 1)), pulseconduit(distribution, DistributionBlocks.pulseconduit, stack(Item.titanium, 1), stack(Item.steel, 1)), liquidrouter(distribution, DistributionBlocks.liquidrouter, stack(Item.steel, 2)), liquidjunction(distribution, DistributionBlocks.liquidjunction, stack(Item.steel, 2)), - liquiditemjunction(distribution, DistributionBlocks.liquiditemjunction, stack(Item.steel, 1), stack(Item.iron, 1)), sorter(distribution, DistributionBlocks.sorter, stack(Item.steel, 2)), turret(weapon, WeaponBlocks.turret, stack(Item.stone, 4)), diff --git a/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java index fb1c04b26a..29d130b0c1 100644 --- a/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java @@ -63,6 +63,12 @@ public class DistributionBlocks{ + "two different conveyors carrying different materials to different locations."; }}, + tunnel = new TunnelConveyor("conveyortunnel"){{ + formalName = "conveyor tunnel"; + description = "Transports items under blocks."; + fullDescription = "Transports item under blocks. " + + "To use, place one tunnel leading into the block to be tunneled under, and one on the other side."; + }}, liquidjunction = new LiquidJunction("liquidjunction"){{ formalName = "liquid junction"; description = "Serves as a liquid junction."; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerBooster.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerBooster.java index 5fb43a82ca..3fe032b493 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerBooster.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerBooster.java @@ -32,7 +32,8 @@ public class PowerBooster extends Generator{ @Override public void drawPlace(int x, int y, int rotation, boolean valid){ Draw.color("purple"); - Draw.dashCircle(x * Vars.tilesize, y * Vars.tilesize, laserRange * Vars.tilesize); + Draw.thick(1f); + Draw.dashCircle(x * Vars.tilesize, y * Vars.tilesize, powerRange * Vars.tilesize); Draw.reset(); } 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 new file mode 100644 index 0000000000..4599dc3d2a --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/TunnelConveyor.java @@ -0,0 +1,52 @@ +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.core.Timers; + +public class TunnelConveyor extends Block{ + + protected TunnelConveyor(String name) { + super(name); + rotate = true; + update = true; + solid = true; + } + + @Override + public boolean canReplace(Block other){ + return other instanceof Conveyor || other instanceof Router || other instanceof Junction; + } + + @Override + public void handleItem(Item item, Tile tile, Tile source){ + int dir = source.relativeTo(tile.x, tile.y); + Tile to = getOther(tile, dir, 3); + Tile inter = getOther(tile, dir, 2); + + Timers.run(25, ()->{ + if(to == null || to.entity == null) return; + to.block().handleItem(item, to, inter); + }); + + } + + @Override + public boolean acceptItem(Item item, Tile dest, Tile source){ + int dir = source.relativeTo(dest.x, dest.y); + Tile to = getOther(dest, dir, 3); + Tile inter = getOther(dest, dir, 2); + return to != null && inter != null && source.getRotation() == (dest.getRotation() + 2)%4 && inter.block() instanceof TunnelConveyor + && (inter.getRotation() + 2) % 4 == dest.getRotation() && + to.block().acceptItem(item, to, inter); + } + + Tile getOther(Tile tile, int dir, int amount){ + for(int i = 0; i < amount; i ++){ + if(tile == null) return null; + tile = tile.getNearby()[dir]; + } + return tile; + } +} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/Generator.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Generator.java index ae498ce50c..6544cab0f8 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/Generator.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Generator.java @@ -6,6 +6,8 @@ import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.Vars; +import io.anuke.mindustry.core.GameState; +import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.effect.Fx; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.PowerAcceptor; @@ -27,7 +29,7 @@ public class Generator extends PowerBlock{ public boolean hasLasers = true; public boolean outputOnly = false; - public Generator(String name) { + public Generator(String name){ super(name); } @@ -175,7 +177,7 @@ public class Generator extends PowerBlock{ Draw.tint(Hue.mix(Color.GRAY, Color.WHITE, 0.904f + Mathf.sin(Timers.time(), 1.7f, 0.06f))); }else{ Draw.tint(Hue.mix(Color.SCARLET, Color.WHITE, 0.902f + Mathf.sin(Timers.time(), 1.7f, 0.08f))); - if(Mathf.chance(Timers.delta() * 0.033)){ + if(GameState.is(State.playing) && Mathf.chance(Timers.delta() * 0.033)){ Effects.effect(Fx.laserspark, target.worldx() - Tmp.v1.x, target.worldy() - Tmp.v1.y); } } @@ -192,6 +194,13 @@ public class Generator extends PowerBlock{ if(target.block() instanceof Generator){ Generator other = (Generator) target.block(); int relrot = (rotation + 2) % 4; + if(other.hasLasers){ + for(int i = 0; i < other.laserDirections; i ++){ + if(target.getRotation() + i - other.laserDirections/2 == (target.getRotation() + 2) % 4){ + return true; + } + } + } if(other.hasLasers && Math.abs(target.getRotation() - relrot) <= other.laserDirections / 2){ return true; } diff --git a/desktop/mindustry-saves/0.mins b/desktop/mindustry-saves/0.mins index 1913c7f072..f2216c7edc 100644 Binary files a/desktop/mindustry-saves/0.mins and b/desktop/mindustry-saves/0.mins differ diff --git a/desktop/mindustry-saves/1.mins b/desktop/mindustry-saves/1.mins index d780fe1229..322eff1fa6 100644 Binary files a/desktop/mindustry-saves/1.mins and b/desktop/mindustry-saves/1.mins differ