diff --git a/core/assets-raw/sprites/blocks/units/flierfactory-top-open.png b/core/assets-raw/sprites/blocks/units/dronefactory-top-open.png similarity index 100% rename from core/assets-raw/sprites/blocks/units/flierfactory-top-open.png rename to core/assets-raw/sprites/blocks/units/dronefactory-top-open.png diff --git a/core/assets-raw/sprites/blocks/units/flierfactory-top.png b/core/assets-raw/sprites/blocks/units/dronefactory-top.png similarity index 100% rename from core/assets-raw/sprites/blocks/units/flierfactory-top.png rename to core/assets-raw/sprites/blocks/units/dronefactory-top.png diff --git a/core/assets-raw/sprites/blocks/units/flierfactory.png b/core/assets-raw/sprites/blocks/units/dronefactory.png similarity index 100% rename from core/assets-raw/sprites/blocks/units/flierfactory.png rename to core/assets-raw/sprites/blocks/units/dronefactory.png diff --git a/core/assets-raw/sprites/blocks/units/droppoint.png b/core/assets-raw/sprites/blocks/units/droppoint.png new file mode 100644 index 0000000000..de57674e8e Binary files /dev/null and b/core/assets-raw/sprites/blocks/units/droppoint.png differ diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index 5b2f10e3f9..66e98d7d95 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -132,98 +132,98 @@ core-top index: -1 junction rotate: false - xy: 310, 49 + xy: 781, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconduit rotate: false - xy: 781, 401 + xy: 441, 112 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconduit-arrow rotate: false - xy: 441, 112 + xy: 441, 102 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconduit-bridge rotate: false - xy: 441, 102 + xy: 441, 92 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconduit-end rotate: false - xy: 441, 92 + xy: 451, 108 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconveyor rotate: false - xy: 451, 108 + xy: 461, 108 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconveyor-arrow rotate: false - xy: 461, 108 + xy: 451, 98 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconveyor-bridge rotate: false - xy: 451, 98 + xy: 471, 108 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconveyor-end rotate: false - xy: 471, 108 + xy: 461, 98 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidjunction rotate: false - xy: 521, 101 + xy: 531, 101 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter rotate: false - xy: 531, 101 + xy: 541, 101 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-bottom rotate: false - xy: 541, 101 + xy: 451, 88 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-liquid rotate: false - xy: 451, 88 + xy: 461, 88 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-top rotate: false - xy: 461, 88 + xy: 471, 88 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -258,77 +258,77 @@ multiplexer index: -1 overflowgate rotate: false - xy: 551, 87 + xy: 561, 87 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 poweredconveyor rotate: false - xy: 581, 90 + xy: 591, 90 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 poweredconveyormove rotate: false - xy: 591, 90 + xy: 601, 90 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-bottom rotate: false - xy: 631, 90 + xy: 641, 90 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-top rotate: false - xy: 641, 90 + xy: 451, 78 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 router rotate: false - xy: 561, 77 + xy: 571, 80 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sortedunloader rotate: false - xy: 655, 225 + xy: 675, 245 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sorter rotate: false - xy: 675, 245 + xy: 665, 235 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 splitter rotate: false - xy: 655, 215 + xy: 675, 235 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyor rotate: false - xy: 675, 235 + xy: 665, 225 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyormove rotate: false - xy: 665, 225 + xy: 675, 225 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -342,7 +342,7 @@ teleporter-top index: -1 unloader rotate: false - xy: 320, 39 + xy: 320, 29 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -482,35 +482,35 @@ dirtedge index: -1 grass1 rotate: false - xy: 927, 433 + xy: 917, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass2 rotate: false - xy: 917, 413 + xy: 927, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass3 rotate: false - xy: 927, 423 + xy: 937, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock1 rotate: false - xy: 937, 433 + xy: 927, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock2 rotate: false - xy: 927, 413 + xy: 937, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -524,21 +524,21 @@ grassedge index: -1 ice1 rotate: false - xy: 937, 423 + xy: 947, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice2 rotate: false - xy: 947, 433 + xy: 937, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice3 rotate: false - xy: 937, 413 + xy: 947, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -552,70 +552,70 @@ iceedge index: -1 icerock1 rotate: false - xy: 947, 423 + xy: 957, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerock2 rotate: false - xy: 957, 433 + xy: 947, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow1 rotate: false - xy: 947, 413 + xy: 957, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow1 rotate: false - xy: 947, 413 + xy: 957, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow2 rotate: false - xy: 957, 423 + xy: 967, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow2 rotate: false - xy: 957, 423 + xy: 967, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron1 rotate: false - xy: 967, 423 + xy: 977, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron2 rotate: false - xy: 977, 433 + xy: 967, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron3 rotate: false - xy: 967, 413 + xy: 977, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lava rotate: false - xy: 461, 98 + xy: 471, 98 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -629,63 +629,63 @@ lavaedge index: -1 lead1 rotate: false - xy: 481, 101 + xy: 491, 101 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lead2 rotate: false - xy: 491, 101 + xy: 501, 101 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lead3 rotate: false - xy: 501, 101 + xy: 511, 101 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor1 rotate: false - xy: 491, 91 + xy: 501, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor2 rotate: false - xy: 501, 91 + xy: 511, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor3 rotate: false - xy: 511, 91 + xy: 521, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor4 rotate: false - xy: 521, 91 + xy: 531, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor5 rotate: false - xy: 531, 91 + xy: 541, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor6 rotate: false - xy: 541, 91 + xy: 551, 97 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -699,14 +699,14 @@ metalflooredge index: -1 mossblock rotate: false - xy: 551, 97 + xy: 561, 97 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 oil rotate: false - xy: 561, 97 + xy: 441, 82 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -720,56 +720,56 @@ oiledge index: -1 rock1 rotate: false - xy: 541, 81 + xy: 551, 77 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rock2 rotate: false - xy: 551, 77 + xy: 561, 77 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand1 rotate: false - xy: 591, 80 + xy: 601, 80 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand2 rotate: false - xy: 601, 80 + xy: 611, 80 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand3 rotate: false - xy: 611, 80 + xy: 621, 80 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock1 rotate: false - xy: 621, 80 + xy: 631, 80 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock2 rotate: false - xy: 631, 80 + xy: 641, 80 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock3 rotate: false - xy: 641, 80 + xy: 220, 8 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -783,56 +783,56 @@ sandedge index: -1 shrub rotate: false - xy: 310, 29 + xy: 290, 21 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shrubshadow rotate: false - xy: 290, 21 + xy: 310, 19 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow1 rotate: false - xy: 310, 9 + xy: 655, 255 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow2 rotate: false - xy: 655, 255 + xy: 655, 245 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow3 rotate: false - xy: 655, 245 + xy: 665, 255 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock1 rotate: false - xy: 665, 255 + xy: 655, 235 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock2 rotate: false - xy: 655, 235 + xy: 675, 255 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock3 rotate: false - xy: 675, 255 + xy: 665, 245 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -846,7 +846,7 @@ snowedge index: -1 space rotate: false - xy: 665, 235 + xy: 655, 215 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -860,42 +860,42 @@ spaceedge index: -1 stone1 rotate: false - xy: 481, 71 + xy: 491, 71 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone2 rotate: false - xy: 491, 71 + xy: 501, 71 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone3 rotate: false - xy: 501, 71 + xy: 511, 71 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock1 rotate: false - xy: 511, 71 + xy: 521, 71 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock2 rotate: false - xy: 521, 71 + xy: 531, 71 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock3 rotate: false - xy: 531, 71 + xy: 541, 71 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -909,49 +909,49 @@ stoneedge index: -1 thorium1 rotate: false - xy: 581, 70 + xy: 591, 70 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium2 rotate: false - xy: 591, 70 + xy: 601, 70 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium3 rotate: false - xy: 601, 70 + xy: 611, 70 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium1 rotate: false - xy: 611, 70 + xy: 621, 70 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium2 rotate: false - xy: 621, 70 + xy: 631, 70 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium3 rotate: false - xy: 631, 70 + xy: 641, 70 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 water rotate: false - xy: 320, 9 + xy: 571, 60 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1028,7 +1028,7 @@ cross-4 index: -1 enemyspawn rotate: false - xy: 917, 433 + xy: 907, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1042,14 +1042,14 @@ nuclearreactor-shadow index: -1 place-arrow rotate: false - xy: 561, 87 + xy: 571, 90 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 playerspawn rotate: false - xy: 571, 90 + xy: 581, 90 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1238,7 +1238,7 @@ largesolarpanel index: -1 liquidcombustiongenerator rotate: false - xy: 511, 101 + xy: 521, 101 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1266,14 +1266,14 @@ nuclearreactor-lights index: -1 powerinfinite rotate: false - xy: 601, 90 + xy: 611, 90 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 powernode rotate: false - xy: 611, 90 + xy: 621, 90 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1294,28 +1294,28 @@ powernodelarge-shadow index: -1 powervoid rotate: false - xy: 621, 90 + xy: 631, 90 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rtgenerator rotate: false - xy: 571, 80 + xy: 581, 80 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rtgenerator-top rotate: false - xy: 581, 80 + xy: 591, 80 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shieldgenerator rotate: false - xy: 290, 31 + xy: 300, 35 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1329,7 +1329,7 @@ shieldprojector index: -1 solarpanel rotate: false - xy: 665, 245 + xy: 655, 225 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1350,7 +1350,7 @@ teleporter-top index: -1 thermalgenerator rotate: false - xy: 571, 70 + xy: 581, 70 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1462,63 +1462,63 @@ cultivator-top index: -1 extractor rotate: false - xy: 907, 413 + xy: 917, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 fluxpump rotate: false - xy: 917, 423 + xy: 927, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 incinerator rotate: false - xy: 957, 413 + xy: 967, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill rotate: false - xy: 977, 423 + xy: 987, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill-rotator rotate: false - xy: 987, 433 + xy: 977, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill-rotator rotate: false - xy: 987, 433 + xy: 977, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill-top rotate: false - xy: 977, 413 + xy: 987, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 itemsource rotate: false - xy: 290, 41 + xy: 300, 45 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 itemvoid rotate: false - xy: 300, 45 + xy: 310, 49 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1546,21 +1546,21 @@ laserdrill-top index: -1 lavasmelter rotate: false - xy: 471, 98 + xy: 481, 101 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidsource rotate: false - xy: 471, 88 + xy: 481, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 melter rotate: false - xy: 481, 91 + xy: 491, 91 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1623,7 +1623,7 @@ oilextractor-top index: -1 oilrefinery rotate: false - xy: 441, 82 + xy: 551, 87 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1707,63 +1707,63 @@ siliconsmelter-top index: -1 pulverizer rotate: false - xy: 451, 78 + xy: 461, 78 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulverizer-rotator rotate: false - xy: 461, 78 + xy: 471, 78 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pump rotate: false - xy: 471, 78 + xy: 481, 81 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 reinforceddrill rotate: false - xy: 481, 81 + xy: 491, 81 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 reinforceddrill-rotator rotate: false - xy: 491, 81 + xy: 501, 81 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 reinforceddrill-top rotate: false - xy: 501, 81 + xy: 511, 81 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 separator rotate: false - xy: 220, 8 + xy: 280, 29 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 separator-liquid rotate: false - xy: 280, 29 + xy: 290, 31 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 siliconextractor rotate: false - xy: 310, 19 + xy: 300, 15 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1777,56 +1777,56 @@ siliconsmelter index: -1 smelter rotate: false - xy: 300, 15 + xy: 310, 9 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steeldrill rotate: false - xy: 675, 225 + xy: 665, 215 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steeldrill-rotator rotate: false - xy: 665, 215 + xy: 675, 215 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steeldrill-top rotate: false - xy: 675, 215 + xy: 394, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stonedrill rotate: false - xy: 541, 71 + xy: 551, 67 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneformer rotate: false - xy: 551, 67 + xy: 561, 67 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill rotate: false - xy: 641, 70 + xy: 404, 85 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill-top rotate: false - xy: 404, 85 + xy: 414, 86 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1959,7 +1959,7 @@ crux-panel-right index: -1 duo rotate: false - xy: 897, 413 + xy: 907, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2055,69 +2055,76 @@ wave-liquid orig: 16, 16 offset: 0, 0 index: -1 -flierfactory +dronefactory rotate: false - xy: 486, 195 + xy: 377, 101 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 walkerfactory rotate: false - xy: 486, 195 + xy: 377, 101 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 -flierfactory-top +dronefactory-top rotate: false - xy: 504, 195 + xy: 486, 195 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 walkerfactory-top rotate: false - xy: 504, 195 + xy: 486, 195 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 -flierfactory-top-open +dronefactory-top-open rotate: false - xy: 522, 195 + xy: 504, 195 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 walkerfactory-top-open rotate: false - xy: 522, 195 + xy: 504, 195 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 -repairpoint +droppoint rotate: false - xy: 511, 81 + xy: 897, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -repairpoint-turret +repairpoint rotate: false xy: 521, 81 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -resupplypoint +repairpoint-turret rotate: false xy: 531, 81 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 +resupplypoint + rotate: false + xy: 541, 81 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 compositewall rotate: false xy: 857, 433 @@ -2155,28 +2162,28 @@ door-open index: -1 duriumwall rotate: false - xy: 907, 423 + xy: 917, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 duriumwall-large rotate: false - xy: 377, 101 + xy: 522, 195 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 ironwall rotate: false - xy: 987, 423 + xy: 997, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelwall rotate: false - xy: 394, 85 + xy: 481, 71 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2190,21 +2197,21 @@ steelwall-large index: -1 stonewall rotate: false - xy: 561, 67 + xy: 571, 70 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumshieldwall rotate: false - xy: 414, 86 + xy: 320, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumwall rotate: false - xy: 320, 79 + xy: 319, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2323,7 +2330,7 @@ shell-back index: -1 shot rotate: false - xy: 300, 25 + xy: 310, 29 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2337,7 +2344,7 @@ transfer index: -1 transfer-arrow rotate: false - xy: 319, 69 + xy: 320, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2351,182 +2358,182 @@ transfer-end index: -1 item-armor-piercing-bullet rotate: false - xy: 997, 433 + xy: 987, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-composite-flak rotate: false - xy: 997, 413 + xy: 1007, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-explosive-shell rotate: false - xy: 1007, 423 + xy: 1007, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-frag-shell rotate: false - xy: 1007, 413 + xy: 847, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-homing-bullet rotate: false - xy: 847, 401 + xy: 857, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-incendiary-mortar-shell rotate: false - xy: 857, 403 + xy: 867, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-lead-bullet rotate: false - xy: 887, 403 + xy: 897, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-scythe-missile rotate: false - xy: 917, 403 + xy: 927, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-surge-mortar-shell rotate: false - xy: 967, 403 + xy: 977, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-swarm-missile rotate: false - xy: 977, 403 + xy: 987, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-thorium-shell rotate: false - xy: 1007, 403 + xy: 431, 90 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-tracer-bullet rotate: false - xy: 280, 39 + xy: 290, 41 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-biomatter rotate: false - xy: 987, 413 + xy: 997, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-blast-compound rotate: false - xy: 997, 423 + xy: 1007, 433 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-coal rotate: false - xy: 1007, 433 + xy: 997, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-iron rotate: false - xy: 867, 403 + xy: 877, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-lead rotate: false - xy: 877, 403 + xy: 887, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-plastic rotate: false - xy: 897, 403 + xy: 907, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-sand rotate: false - xy: 907, 403 + xy: 917, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-silicon rotate: false - xy: 927, 403 + xy: 937, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-steel rotate: false - xy: 937, 403 + xy: 947, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-stone rotate: false - xy: 947, 403 + xy: 957, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-surge-alloy rotate: false - xy: 957, 403 + xy: 967, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-thermite rotate: false - xy: 987, 403 + xy: 997, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-thorium rotate: false - xy: 997, 403 + xy: 1007, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-titanium rotate: false - xy: 431, 90 + xy: 280, 39 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -3039,7 +3046,7 @@ icon-itch.io index: -1 icon-items-none rotate: false - xy: 967, 433 + xy: 957, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -3646,42 +3653,42 @@ clustergun-equip index: -1 shockgun rotate: false - xy: 300, 35 + xy: 310, 39 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun-equip rotate: false - xy: 310, 39 + xy: 300, 25 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster rotate: false - xy: 320, 59 + xy: 320, 49 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster-equip rotate: false - xy: 320, 49 + xy: 320, 39 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan rotate: false - xy: 320, 29 + xy: 320, 19 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan-equip rotate: false - xy: 320, 19 + xy: 320, 9 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index a9510a763e..a786cb3802 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/Vars.java b/core/src/io/anuke/mindustry/Vars.java index bfc54e1b9a..916e57ef4d 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -63,7 +63,7 @@ public class Vars{ //whether turrets have infinite ammo (only with debug) public static boolean infiniteAmmo = true; //whether to show paths of enemies - public static boolean showPaths = false; + public static boolean showPaths = true; //if false, player is always hidden public static boolean showPlayer = true; //whether to hide ui, only on debug diff --git a/core/src/io/anuke/mindustry/ai/BlockIndexer.java b/core/src/io/anuke/mindustry/ai/BlockIndexer.java index ca430c5f97..af68f54daa 100644 --- a/core/src/io/anuke/mindustry/ai/BlockIndexer.java +++ b/core/src/io/anuke/mindustry/ai/BlockIndexer.java @@ -3,20 +3,31 @@ package io.anuke.mindustry.ai; import com.badlogic.gdx.utils.IntMap; import com.badlogic.gdx.utils.ObjectMap; import com.badlogic.gdx.utils.ObjectSet; +import io.anuke.mindustry.content.Items; import io.anuke.mindustry.game.EventType.TileChangeEvent; import io.anuke.mindustry.game.EventType.WorldLoadEvent; import io.anuke.mindustry.game.Team; +import io.anuke.mindustry.type.Item; import io.anuke.mindustry.world.BlockFlag; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Events; import io.anuke.ucore.util.EnumSet; +import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.state; import static io.anuke.mindustry.Vars.world; +//TODO consider using quadtrees for finding specific types of blocks within an area /**Class used for indexing special target blocks for AI. * TODO maybe use Arrays instead of ObjectSets?*/ public class BlockIndexer { + /**Size of one ore quadrant.*/ + private final static int quadrantSize = 12; + /**Set of all ores that are being scanned.*/ + private final ObjectSet scanOres = ObjectSet.with(Items.iron, Items.coal, Items.lead, Items.thorium, Items.titanium); + /**Stores all ore quadtrants on the map.*/ + private ObjectMap> ores = new ObjectMap<>(); + /**Maps teams to a map of flagged tiles by type.*/ private ObjectMap> enemyMap = new ObjectMap<>(); /**Maps teams to a map of flagged tiles by type.*/ @@ -43,22 +54,35 @@ public class BlockIndexer { enemyMap.clear(); allyMap.clear(); typeMap.clear(); + ores.clear(); for(int x = 0; x < world.width(); x ++){ for (int y = 0; y < world.height(); y++) { process(world.tile(x, y)); } } + + scanOres(); }); } + /**Get all allied blocks with a flag.*/ public ObjectSet getAllied(Team team, BlockFlag type){ return (state.teams.get(team).ally ? allyMap : enemyMap).get(type, emptyArray); } + /**Get all enemy blocks with a flag.*/ public ObjectSet getEnemy(Team team, BlockFlag type){ return (!state.teams.get(team).ally ? allyMap : enemyMap).get(type, emptyArray); } + /**Returns a set of tiles that have ores of the specified type nearby. + * While each tile in the set is not guaranteed to have an ore directly on it, + * each tile will at least have an ore within {@link #quadrantSize} / 2 blocks of it. + * Only specific ore types are scanned. See {@link #scanOres}.*/ + public ObjectSet getOrePositions(Item item){ + return ores.get(item, emptyArray); + } + private void process(Tile tile){ if(tile.block().flags != null && tile.getTeam() != Team.none){ @@ -85,6 +109,30 @@ public class BlockIndexer { return state.teams.get(team).ally ? allyMap : enemyMap; } + private void scanOres(){ + //initialize ore map with empty sets + for(Item item : scanOres){ + ores.put(item, new ObjectSet<>()); + } + + for(int x = 0; x < world.width(); x ++){ + for (int y = 0; y < world.height(); y++) { + int qx = (x/quadrantSize); + int qy = (y/quadrantSize); + + Tile tile = world.tile(x, y); + + //add position of quadrant to list when an ore is found + if(tile.floor().drops != null && scanOres.contains(tile.floor().drops.item)){ + ores.get(tile.floor().drops.item).add(world.tile( + //make sure to clamp quadrant middle position, since it might go off bounds + Mathf.clamp(qx * quadrantSize + quadrantSize/2, 0, world.width() - 1), + Mathf.clamp(qy * quadrantSize + quadrantSize/2, 0, world.height() - 1))); + } + } + } + } + private class TileIndex{ public final EnumSet flags; public final Team team; diff --git a/core/src/io/anuke/mindustry/ai/Pathfinder.java b/core/src/io/anuke/mindustry/ai/Pathfinder.java index a5f076ce51..337ee3b832 100644 --- a/core/src/io/anuke/mindustry/ai/Pathfinder.java +++ b/core/src/io/anuke/mindustry/ai/Pathfinder.java @@ -63,7 +63,8 @@ public class Pathfinder { if(other == null) continue; if(values[dx][dy] < value && (target == null || values[dx][dy] < tl) && - (!other.solid() || state.teams.areEnemies(team, other.getTeam()))){ + !other.solid() && + !(point.x != 0 && point.y != 0 && (world.solid(tile.x + point.x, tile.y) || world.solid(tile.x, tile.y + point.y)))){ //diagonal corner trap target = other; tl = values[dx][dy]; } diff --git a/core/src/io/anuke/mindustry/content/Recipes.java b/core/src/io/anuke/mindustry/content/Recipes.java index e4b3ef715e..e9940a5b30 100644 --- a/core/src/io/anuke/mindustry/content/Recipes.java +++ b/core/src/io/anuke/mindustry/content/Recipes.java @@ -110,9 +110,12 @@ public class Recipes implements ContentList{ new Recipe(liquid, LiquidBlocks.fluxpump, new ItemStack(Items.steel, 10), new ItemStack(Items.surgealloy, 5)); new Recipe(units, UnitBlocks.repairPoint, new ItemStack(Items.steel, 10)); + new Recipe(units, UnitBlocks.dropPoint, new ItemStack(Items.steel, 10)); new Recipe(units, UnitBlocks.resupplyPoint, new ItemStack(Items.steel, 10)); - //new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.steel, 10)); + new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.iron, 50)); + + //new Recipe(units, UnitBlocks.vtolFactory, new ItemStack(Items.steel, 10)); //new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.steel, 10)); //new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.steel, 10)); diff --git a/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java b/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java index 51bd3b799c..fde38ee208 100644 --- a/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java @@ -1,30 +1,39 @@ package io.anuke.mindustry.content.blocks; +import io.anuke.mindustry.content.Items; +import io.anuke.mindustry.content.UnitTypes; import io.anuke.mindustry.type.ContentList; +import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.blocks.types.units.DropPoint; import io.anuke.mindustry.world.blocks.types.units.RepairPoint; import io.anuke.mindustry.world.blocks.types.units.ResupplyPoint; +import io.anuke.mindustry.world.blocks.types.units.UnitFactory; public class UnitBlocks implements ContentList { - public static Block resupplyPoint, repairPoint, droneFactory; + public static Block resupplyPoint, repairPoint, droneFactory, dropPoint; @Override public void load() { - /* droneFactory = new UnitFactory("dronefactory") {{ type = UnitTypes.drone; - produceTime = 200; + produceTime = 300; size = 2; requirements = new ItemStack[]{ - new ItemStack(Items.stone, 5) + new ItemStack(Items.iron, 20) }; - }};*/ + }}; resupplyPoint = new ResupplyPoint("resupplypoint") {{ shadow = "shadow-round-1"; itemCapacity = 30; }}; + dropPoint = new DropPoint("droppoint") {{ + shadow = "shadow-round-1"; + itemCapacity = 40; + }}; + repairPoint = new RepairPoint("repairpoint") {{ shadow = "shadow-round-1"; repairSpeed = 0.1f; diff --git a/core/src/io/anuke/mindustry/core/ContentLoader.java b/core/src/io/anuke/mindustry/core/ContentLoader.java index c778b2fc57..ff4d6e64f8 100644 --- a/core/src/io/anuke/mindustry/core/ContentLoader.java +++ b/core/src/io/anuke/mindustry/core/ContentLoader.java @@ -53,6 +53,9 @@ public class ContentLoader { //weapons new Weapons(), + //units + new UnitTypes(), + //blocks new Blocks(), new DefenseBlocks(), @@ -68,9 +71,6 @@ public class ContentLoader { //recipes new Recipes(), - - //units - new UnitTypes(), }; diff --git a/core/src/io/anuke/mindustry/entities/BlockBuilder.java b/core/src/io/anuke/mindustry/entities/BlockBuilder.java index fca3f3f1d2..ca28c4e7fa 100644 --- a/core/src/io/anuke/mindustry/entities/BlockBuilder.java +++ b/core/src/io/anuke/mindustry/entities/BlockBuilder.java @@ -46,6 +46,9 @@ public interface BlockBuilder { /**Sets the tile this builder is currently mining.*/ void setMineTile(Tile tile); + /**Build power, can be any float. 1 = builds recipes in normal time, 0 = doesn't build at all.*/ + float getBuildPower(Tile tile); + /**Return whether this builder's place queue contains items.*/ default boolean isBuilding(){ return getPlaceQueue().size != 0; diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index 939b00b3c0..37a1fd7803 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -77,6 +77,12 @@ public class Player extends Unit implements BlockBuilder { //region unit and event overrides, utility methods + + @Override + public float getBuildPower(Tile tile) { + return 1f; + } + @Override public float getMaxHealth() { return 200; @@ -507,6 +513,8 @@ public class Player extends Unit implements BlockBuilder { inventory.clear(); upgrades.clear(); placeQueue.clear(); + dead = true; + respawning = false; add(); heal(); diff --git a/core/src/io/anuke/mindustry/entities/UnitInventory.java b/core/src/io/anuke/mindustry/entities/UnitInventory.java index 4b6358f1a1..f3a54cb5e0 100644 --- a/core/src/io/anuke/mindustry/entities/UnitInventory.java +++ b/core/src/io/anuke/mindustry/entities/UnitInventory.java @@ -14,6 +14,7 @@ public class UnitInventory { private Array ammos = new Array<>(); private int totalAmmo; private ItemStack item; + //TODO move these somewhere else so they're not variables? private int capacity, ammoCapacity; private boolean infiniteAmmo; @@ -22,6 +23,10 @@ public class UnitInventory { this.ammoCapacity = ammoCapacity; } + public boolean isFull(){ + return item != null && item.amount >= capacity; + } + public boolean isInfiniteAmmo() { return infiniteAmmo; } diff --git a/core/src/io/anuke/mindustry/entities/Units.java b/core/src/io/anuke/mindustry/entities/Units.java index 2a9c0a6c9c..e0d109cff3 100644 --- a/core/src/io/anuke/mindustry/entities/Units.java +++ b/core/src/io/anuke/mindustry/entities/Units.java @@ -29,11 +29,7 @@ public class Units { * @return whether the target is invalid */ public static boolean invalidateTarget(Targetable target, Team team, float x, float y, float range) { - if (target == null) { - return false; - } - - return (!(range != Float.MAX_VALUE) || !(target.distanceTo(x, y) > range)) && (target.getTeam() == team || !target.isValid()); + return target == null || (range != Float.MAX_VALUE && target.distanceTo(x, y) > range) || target.getTeam() == team || !target.isValid(); } diff --git a/core/src/io/anuke/mindustry/entities/units/BaseUnit.java b/core/src/io/anuke/mindustry/entities/units/BaseUnit.java index ddd0547df0..fb82adba93 100644 --- a/core/src/io/anuke/mindustry/entities/units/BaseUnit.java +++ b/core/src/io/anuke/mindustry/entities/units/BaseUnit.java @@ -4,6 +4,7 @@ import io.anuke.mindustry.content.fx.ExplosionFx; import io.anuke.mindustry.entities.Targetable; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Unit; +import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.entities.bullet.Bullet; import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.game.Team; @@ -95,10 +96,25 @@ public abstract class BaseUnit extends Unit{ } public void targetClosestAllyFlag(BlockFlag flag){ + if(target != null) return; + Tile target = Geometry.findClosest(x, y, world.indexer().getAllied(team, flag)); if (target != null) this.target = target.entity; } + public void targetClosestEnemyFlag(BlockFlag flag){ + if(target != null) return; + + Tile target = Geometry.findClosest(x, y, world.indexer().getEnemy(team, flag)); + if (target != null) this.target = target.entity; + } + + public void targetClosest(){ + if(target != null) return; + + target = Units.getClosestTarget(team, x, y, inventory.getAmmoRange()); + } + public UnitState getStartState(){ return null; } diff --git a/core/src/io/anuke/mindustry/entities/units/FlyingUnit.java b/core/src/io/anuke/mindustry/entities/units/FlyingUnit.java index 8a01024877..2f2c313e8f 100644 --- a/core/src/io/anuke/mindustry/entities/units/FlyingUnit.java +++ b/core/src/io/anuke/mindustry/entities/units/FlyingUnit.java @@ -1,6 +1,5 @@ package io.anuke.mindustry.entities.units; -import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.graphics.Palette; @@ -48,7 +47,7 @@ public class FlyingUnit extends BaseUnit { @Override public void drawOver() { - trail.draw(Palette.lighterOrange, Palette.lightishOrange, 5f); + trail.draw(Palette.lightFlame, Palette.lightOrange, 5f); } @Override @@ -65,6 +64,11 @@ public class FlyingUnit extends BaseUnit { return attack; } + @Override + public float drawSize() { + return 60; + } + protected void circle(float circleLength){ vec.set(target.getX() - x, target.getY() - y); @@ -111,6 +115,24 @@ public class FlyingUnit extends BaseUnit { } } }, + idle = new UnitState() { + public void update() { + retarget(() -> { + targetClosest(); + targetClosestEnemyFlag(BlockFlag.target); + + if(target != null){ + setState(attack); + } + }); + + target = getClosestCore(); + if(target != null){ + circle(50f); + } + velocity.scl(0.8f); + } + }, attack = new UnitState(){ public void entered() { target = null; @@ -124,16 +146,15 @@ public class FlyingUnit extends BaseUnit { if(!inventory.hasAmmo()) { state.set(resupply); }else if (target == null){ - if(timer.get(timerTarget, 20)) { - Unit closest = Units.getClosestEnemy(team, x, y, - inventory.getAmmo().getRange(), other -> distanceTo(other) < 60f); - if(closest != null){ - target = closest; - }else { - Tile target = Geometry.findClosest(x, y, world.indexer().getEnemy(team, BlockFlag.target)); - if (target != null) FlyingUnit.this.target = target.entity; + retarget(() -> { + targetClosest(); + targetClosestEnemyFlag(BlockFlag.target); + targetClosestEnemyFlag(BlockFlag.producer); + + if(target == null){ + setState(idle); } - } + }); }else{ attack(150f); @@ -153,7 +174,7 @@ public class FlyingUnit extends BaseUnit { } public void update() { - if(health >= health){ + if(health >= getMaxHealth()){ state.set(attack); }else if(!targetHasFlag(BlockFlag.repair)){ retarget(() -> { diff --git a/core/src/io/anuke/mindustry/entities/units/GroundUnitType.java b/core/src/io/anuke/mindustry/entities/units/GroundUnit.java similarity index 82% rename from core/src/io/anuke/mindustry/entities/units/GroundUnitType.java rename to core/src/io/anuke/mindustry/entities/units/GroundUnit.java index a55fbb06aa..c325097a79 100644 --- a/core/src/io/anuke/mindustry/entities/units/GroundUnitType.java +++ b/core/src/io/anuke/mindustry/entities/units/GroundUnit.java @@ -2,7 +2,6 @@ package io.anuke.mindustry.entities.units; import com.badlogic.gdx.graphics.Color; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.type.AmmoType; @@ -12,20 +11,17 @@ import io.anuke.mindustry.world.blocks.types.Floor; import io.anuke.ucore.core.Timers; import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.Hue; -import io.anuke.ucore.util.Angles; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Translator; +import io.anuke.ucore.util.*; import static io.anuke.mindustry.Vars.world; -public abstract class GroundUnitType extends BaseUnit { +public abstract class GroundUnit extends BaseUnit { protected static Translator vec = new Translator(); protected static float maxAim = 30f; protected float walkTime; - public GroundUnitType(UnitType type, Team team) { + public GroundUnit(UnitType type, Team team) { super(type, team); } @@ -38,9 +34,8 @@ public abstract class GroundUnitType extends BaseUnit { public void update() { super.update(); - if(!velocity.isZero(0.0001f) && (target == null - || (inventory.hasAmmo() && distanceTo(target) > inventory.getAmmo().getRange()))){ - rotation = velocity.angle(); + if(target == null){ + rotation = Mathf.lerpDelta(rotation, velocity.angle(), 0.2f); } } @@ -89,7 +84,8 @@ public abstract class GroundUnitType extends BaseUnit { public void updateTargeting() { super.updateTargeting(); - if(Units.invalidateTarget(target, this)){ + if(Units.invalidateTarget(target, team, x, y, Float.MAX_VALUE)){ + if(target != null) Log.info("Invalidating target {0}", target); target = null; } } @@ -146,19 +142,11 @@ public abstract class GroundUnitType extends BaseUnit { } public void update() { - retarget(() -> { - Unit closest = Units.getClosestEnemy(team, x, y, inventory.getAmmo().getRange(), other -> true); - if(closest != null){ - target = closest; - }else { - Tile target = Geometry.findClosest(x, y, world.indexer().getEnemy(team, BlockFlag.target)); - if (target != null) GroundUnitType.this.target = target.entity; - } - }); + retarget(() -> targetClosest()); if(!inventory.hasAmmo()) { state.set(resupply); - }else{ + }else if(target != null){ if(distanceTo(target) > inventory.getAmmo().getRange() * 0.7f){ moveToCore(); }else{ @@ -173,6 +161,8 @@ public abstract class GroundUnitType extends BaseUnit { shoot(ammo, Angles.moveToward(rotation, angleTo(target), maxAim), 4f); } + }else{ + moveToCore(); } } }, diff --git a/core/src/io/anuke/mindustry/entities/units/types/Drone.java b/core/src/io/anuke/mindustry/entities/units/types/Drone.java index e74ffa9146..979710f380 100644 --- a/core/src/io/anuke/mindustry/entities/units/types/Drone.java +++ b/core/src/io/anuke/mindustry/entities/units/types/Drone.java @@ -2,6 +2,7 @@ package io.anuke.mindustry.entities.units.types; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.utils.Queue; +import io.anuke.mindustry.content.Items; import io.anuke.mindustry.entities.BlockBuilder; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.Units; @@ -36,6 +37,8 @@ public class Drone extends FlyingUnit implements BlockBuilder{ protected Tile mineTile; protected Queue placeQueue = new Queue<>(); + /**Initialize placement event notifier system. + * Static initialization is to be avoided, thus, this is done lazily.*/ private static void initEvents(){ Events.on(BlockBuildEvent.class, (team, tile) -> { EntityGroup group = unitGroups[team.ordinal()]; @@ -70,6 +73,11 @@ public class Drone extends FlyingUnit implements BlockBuilder{ } } + @Override + public float getBuildPower(Tile tile) { + return 0.3f; + } + @Override public Queue getPlaceQueue() { return placeQueue; @@ -176,6 +184,10 @@ public class Drone extends FlyingUnit implements BlockBuilder{ retarget(() -> { target = Units.findAllyTile(team, x, y, discoverRange, tile -> tile.entity != null && tile.entity.health + 0.0001f < tile.block().health); + + if(target == null){ + setState(mine); + } }); }else if(target.distanceTo(Drone.this) > type.range){ circle(type.range); @@ -186,6 +198,22 @@ public class Drone extends FlyingUnit implements BlockBuilder{ } } }, + mine = new UnitState() { + public void update() { + //if inventory is full, drop it off. + if(inventory.isFull()){ + setState(drop); + }else{ + //only mines iron for now + retarget(() -> target = Geometry.findClosest(x, y, world.indexer().getOrePositions(Items.iron))); + } + } + }, + drop = new UnitState() { + public void update() { + + } + }, retreat = new UnitState() { public void entered() { target = null; diff --git a/core/src/io/anuke/mindustry/entities/units/types/Scout.java b/core/src/io/anuke/mindustry/entities/units/types/Scout.java index 93b5b39702..aae30cb866 100644 --- a/core/src/io/anuke/mindustry/entities/units/types/Scout.java +++ b/core/src/io/anuke/mindustry/entities/units/types/Scout.java @@ -1,10 +1,10 @@ package io.anuke.mindustry.entities.units.types; -import io.anuke.mindustry.entities.units.GroundUnitType; +import io.anuke.mindustry.entities.units.GroundUnit; import io.anuke.mindustry.entities.units.UnitType; import io.anuke.mindustry.game.Team; -public class Scout extends GroundUnitType { +public class Scout extends GroundUnit { public Scout(UnitType type, Team team) { super(type, team); diff --git a/core/src/io/anuke/mindustry/entities/units/types/Vtol.java b/core/src/io/anuke/mindustry/entities/units/types/Vtol.java index 3dd96c63ed..cb78159d3a 100644 --- a/core/src/io/anuke/mindustry/entities/units/types/Vtol.java +++ b/core/src/io/anuke/mindustry/entities/units/types/Vtol.java @@ -1,6 +1,5 @@ package io.anuke.mindustry.entities.units.types; -import io.anuke.mindustry.content.fx.UnitFx; import io.anuke.mindustry.entities.units.FlyingUnit; import io.anuke.mindustry.entities.units.UnitType; import io.anuke.mindustry.game.Team; @@ -54,10 +53,6 @@ public class Vtol extends FlyingUnit { if(velocity.len() <= 0.2f){ rotation += Mathf.sin(Timers.time() + id * 99, 10f, 8f); } - - if(timer.get(timerBoost, 2)){ - effectAt(UnitFx.vtolHover, rotation + 180f, 4f, 0); - } } } diff --git a/core/src/io/anuke/mindustry/ui/fragments/DebugFragment.java b/core/src/io/anuke/mindustry/ui/fragments/DebugFragment.java index b3208b3753..736dde7585 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/DebugFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/DebugFragment.java @@ -69,7 +69,7 @@ public class DebugFragment implements Fragment { row(); new button("death", () -> player.damage(99999, false)); row(); - new button("spawnf", () -> UnitTypes.drone.create(player.team).set(player.x, player.y).add()); + new button("spawnf", () -> UnitTypes.vtol.create(player.team).set(player.x, player.y).add()); row(); new button("spawng", () -> UnitTypes.scout.create(player.team).set(player.x, player.y).add()); row(); diff --git a/core/src/io/anuke/mindustry/world/BlockFlag.java b/core/src/io/anuke/mindustry/world/BlockFlag.java index 11a5716c9f..e1818264a4 100644 --- a/core/src/io/anuke/mindustry/world/BlockFlag.java +++ b/core/src/io/anuke/mindustry/world/BlockFlag.java @@ -1,9 +1,17 @@ package io.anuke.mindustry.world; public enum BlockFlag { + /**General important target for all types of units.*/ target(0), + /**Point to resupply resources.*/ resupplyPoint(Float.MAX_VALUE), - producer(Float.MAX_VALUE), + /**Point to drop off resources.*/ + dropPoint(Float.MAX_VALUE), + /**Producer of important goods.*/ + producer(20), + /**Producer or storage unit of volatile materials.*/ + explosive(10), + /**Repair point.*/ repair(Float.MAX_VALUE); public final float cost; diff --git a/core/src/io/anuke/mindustry/world/Tile.java b/core/src/io/anuke/mindustry/world/Tile.java index be8691c940..88dbcf387c 100644 --- a/core/src/io/anuke/mindustry/world/Tile.java +++ b/core/src/io/anuke/mindustry/world/Tile.java @@ -1,9 +1,11 @@ package io.anuke.mindustry.world; import com.badlogic.gdx.math.GridPoint2; +import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.reflect.ClassReflection; import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.entities.Targetable; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.type.Recipe; @@ -19,7 +21,7 @@ import static io.anuke.mindustry.Vars.tilesize; import static io.anuke.mindustry.Vars.world; -public class Tile implements Position{ +public class Tile implements Position, Targetable{ public static final Object tileSetLock = new Object(); /**Block ID data.*/ @@ -338,6 +340,16 @@ public class Tile implements Position{ world.notifyChanged(this); } + @Override + public boolean isDead() { + return false; //tiles never die + } + + @Override + public Vector2 getVelocity() { + return Vector2.Zero; + } + @Override public float getX() { return drawx(); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/units/DropPoint.java b/core/src/io/anuke/mindustry/world/blocks/types/units/DropPoint.java new file mode 100644 index 0000000000..dc69a79073 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/types/units/DropPoint.java @@ -0,0 +1,28 @@ +package io.anuke.mindustry.world.blocks.types.units; + +import io.anuke.mindustry.type.Item; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.Tile; + +public class DropPoint extends Block { + + public DropPoint(String name) { + super(name); + + hasItems = true; + solid = true; + update = true; + } + + @Override + public boolean acceptItem(Item item, Tile tile, Tile source) { + return false; + } + + @Override + public void update(Tile tile) { + if (tile.entity.items.totalItems() > 0) { + tryDump(tile); + } + } +}