diff --git a/build.gradle b/build.gradle index fd5cace2c7..ace1e7730a 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ allprojects { appName = 'Mindustry' gdxVersion = '1.9.8' aiVersion = '1.8.1' - uCoreVersion = 'df5b262' + uCoreVersion = '5e6c99a' getVersionString = { String buildVersion = getBuildVersion() diff --git a/core/assets-raw/sprites/blocks/environment/copper1.png b/core/assets-raw/sprites/blocks/environment/copper1.png deleted file mode 100644 index cf46e551ef..0000000000 Binary files a/core/assets-raw/sprites/blocks/environment/copper1.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/environment/copper2.png b/core/assets-raw/sprites/blocks/environment/copper2.png deleted file mode 100644 index c6bc1e04b6..0000000000 Binary files a/core/assets-raw/sprites/blocks/environment/copper2.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/environment/copper3.png b/core/assets-raw/sprites/blocks/environment/copper3.png deleted file mode 100644 index f242f0999c..0000000000 Binary files a/core/assets-raw/sprites/blocks/environment/copper3.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/production/copperdrill.png b/core/assets-raw/sprites/blocks/production/copperdrill.png deleted file mode 100644 index 72226d6f5e..0000000000 Binary files a/core/assets-raw/sprites/blocks/production/copperdrill.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/production/powerbooster.png b/core/assets-raw/sprites/blocks/production/powerbooster.png deleted file mode 100644 index 5d0ce18461..0000000000 Binary files a/core/assets-raw/sprites/blocks/production/powerbooster.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/tech/battery.png b/core/assets-raw/sprites/blocks/tech/battery.png index e457591b58..a61a546646 100644 Binary files a/core/assets-raw/sprites/blocks/tech/battery.png and b/core/assets-raw/sprites/blocks/tech/battery.png differ diff --git a/core/assets-raw/sprites/blocks/tech/batterylarge-base.png b/core/assets-raw/sprites/blocks/tech/batterylarge-base.png deleted file mode 100644 index 7800659d35..0000000000 Binary files a/core/assets-raw/sprites/blocks/tech/batterylarge-base.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/tech/batterylarge.png b/core/assets-raw/sprites/blocks/tech/batterylarge.png index 57f09a427c..7800659d35 100644 Binary files a/core/assets-raw/sprites/blocks/tech/batterylarge.png and b/core/assets-raw/sprites/blocks/tech/batterylarge.png differ diff --git a/core/assets-raw/sprites/blocks/tech/laser-base.png b/core/assets-raw/sprites/blocks/tech/laser-base.png deleted file mode 100644 index 55a722af55..0000000000 Binary files a/core/assets-raw/sprites/blocks/tech/laser-base.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/tech/powerlaser.png b/core/assets-raw/sprites/blocks/tech/powerlaser.png deleted file mode 100644 index 43a5edfcc7..0000000000 Binary files a/core/assets-raw/sprites/blocks/tech/powerlaser.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/tech/powerlasercorner.png b/core/assets-raw/sprites/blocks/tech/powerlasercorner.png deleted file mode 100644 index 7a606bbf37..0000000000 Binary files a/core/assets-raw/sprites/blocks/tech/powerlasercorner.png and /dev/null differ diff --git a/core/assets-raw/sprites/blocks/tech/powerlaserrouter.png b/core/assets-raw/sprites/blocks/tech/powerlaserrouter.png deleted file mode 100644 index 9e525c33ec..0000000000 Binary files a/core/assets-raw/sprites/blocks/tech/powerlaserrouter.png and /dev/null differ diff --git a/core/assets-raw/sprites/effects/laserend.png b/core/assets-raw/sprites/effects/laserend.png deleted file mode 100644 index d678fb0a81..0000000000 Binary files a/core/assets-raw/sprites/effects/laserend.png and /dev/null differ diff --git a/core/assets-raw/sprites/items/item-copper.png b/core/assets-raw/sprites/items/item-copper.png deleted file mode 100644 index 82e8da080a..0000000000 Binary files a/core/assets-raw/sprites/items/item-copper.png and /dev/null differ diff --git a/core/assets-raw/sprites/items/item-dirium.png b/core/assets-raw/sprites/items/item-dirium.png deleted file mode 100644 index 14cb1eb8d8..0000000000 Binary files a/core/assets-raw/sprites/items/item-dirium.png and /dev/null differ diff --git a/core/assets-raw/sprites/items/item-glass.png b/core/assets-raw/sprites/items/item-glass.png deleted file mode 100644 index 146cef90e9..0000000000 Binary files a/core/assets-raw/sprites/items/item-glass.png and /dev/null differ diff --git a/core/assets-raw/sprites/items/item-titanium.png b/core/assets-raw/sprites/items/item-titanium.png index acdf51c211..5ee7ecc63c 100644 Binary files a/core/assets-raw/sprites/items/item-titanium.png and b/core/assets-raw/sprites/items/item-titanium.png differ diff --git a/core/assets/maps/test.mmap b/core/assets/maps/test.mmap index 5cd40a37b6..85e09ece37 100644 Binary files a/core/assets/maps/test.mmap and b/core/assets/maps/test.mmap differ diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index 6084146822..522ec5696a 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -13,56 +13,56 @@ background index: -1 blackrock1 rotate: false - xy: 337, 117 + xy: 289, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackrockshadow1 rotate: false - xy: 484, 168 + xy: 579, 234 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstone1 rotate: false - xy: 579, 234 + xy: 690, 367 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstone2 rotate: false - xy: 627, 306 + xy: 700, 369 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstone3 rotate: false - xy: 637, 306 + xy: 627, 306 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock1 rotate: false - xy: 690, 367 + xy: 637, 306 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock2 rotate: false - xy: 700, 369 + xy: 136, 43 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock3 rotate: false - xy: 353, 125 + xy: 299, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -76,70 +76,49 @@ blackstoneedge index: -1 coal1 rotate: false - xy: 700, 359 + xy: 439, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coal2 rotate: false - xy: 413, 125 + xy: 449, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coal3 rotate: false - xy: 132, 33 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -copper1 - rotate: false - xy: 642, 296 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -copper2 - rotate: false - xy: 695, 347 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -copper3 - rotate: false - xy: 147, 23 + xy: 459, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 deepwater rotate: false - xy: 157, 23 + xy: 152, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt1 rotate: false - xy: 652, 291 + xy: 662, 299 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt2 rotate: false - xy: 662, 301 + xy: 157, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt3 rotate: false - xy: 662, 291 + xy: 875, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -153,35 +132,35 @@ dirtedge index: -1 grass1 rotate: false - xy: 423, 129 + xy: 329, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass2 rotate: false - xy: 433, 130 + xy: 339, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass3 rotate: false - xy: 443, 130 + xy: 349, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock1 rotate: false - xy: 453, 130 + xy: 359, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock2 rotate: false - xy: 148, 54 + xy: 369, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -195,21 +174,21 @@ grassedge index: -1 ice1 rotate: false - xy: 158, 54 + xy: 379, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice2 rotate: false - xy: 168, 54 + xy: 389, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice3 rotate: false - xy: 178, 54 + xy: 399, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -223,70 +202,70 @@ iceedge index: -1 icerock1 rotate: false - xy: 188, 54 + xy: 409, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerock2 rotate: false - xy: 198, 54 + xy: 419, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow1 rotate: false - xy: 208, 54 + xy: 319, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow1 rotate: false - xy: 208, 54 + xy: 319, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow2 rotate: false - xy: 156, 44 + xy: 329, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow2 rotate: false - xy: 156, 44 + xy: 329, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron1 rotate: false - xy: 166, 44 + xy: 339, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron2 rotate: false - xy: 176, 44 + xy: 349, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron3 rotate: false - xy: 186, 44 + xy: 359, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lava rotate: false - xy: 207, 24 + xy: 640, 276 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -298,16 +277,37 @@ lavaedge orig: 12, 12 offset: 0, 0 index: -1 +lead1 + rotate: false + xy: 620, 256 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +lead2 + rotate: false + xy: 630, 256 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +lead3 + rotate: false + xy: 640, 256 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 mossblock rotate: false - xy: 227, 14 + xy: 208, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 oil rotate: false - xy: 232, 34 + xy: 156, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -321,56 +321,56 @@ oiledge index: -1 rock1 rotate: false - xy: 662, 281 + xy: 177, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rock2 rotate: false - xy: 650, 271 + xy: 177, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand1 rotate: false - xy: 650, 251 + xy: 197, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand2 rotate: false - xy: 660, 251 + xy: 218, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand3 rotate: false - xy: 121, 3 + xy: 216, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock1 rotate: false - xy: 131, 3 + xy: 212, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock2 rotate: false - xy: 141, 3 + xy: 207, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock3 rotate: false - xy: 151, 3 + xy: 207, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -384,56 +384,56 @@ sandedge index: -1 shrub rotate: false - xy: 221, 4 + xy: 232, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shrubshadow rotate: false - xy: 231, 4 + xy: 237, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow1 rotate: false - xy: 443, 120 + xy: 672, 299 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow2 rotate: false - xy: 453, 120 + xy: 672, 289 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow3 rotate: false - xy: 463, 130 + xy: 677, 309 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock1 rotate: false - xy: 463, 120 + xy: 682, 299 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock2 rotate: false - xy: 473, 128 + xy: 682, 289 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock3 rotate: false - xy: 483, 128 + xy: 121, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -447,42 +447,42 @@ snowedge index: -1 stone1 rotate: false - xy: 921, 455 + xy: 201, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone2 rotate: false - xy: 931, 455 + xy: 211, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone3 rotate: false - xy: 899, 445 + xy: 221, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock1 rotate: false - xy: 899, 435 + xy: 231, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock2 rotate: false - xy: 909, 445 + xy: 241, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock3 rotate: false - xy: 909, 435 + xy: 705, 349 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -496,49 +496,49 @@ stoneedge index: -1 titanium1 rotate: false - xy: 941, 451 + xy: 672, 279 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium2 rotate: false - xy: 951, 451 + xy: 682, 279 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium3 rotate: false - xy: 961, 451 + xy: 650, 269 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 uranium1 rotate: false - xy: 949, 431 + xy: 660, 249 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 uranium2 rotate: false - xy: 959, 431 + xy: 670, 249 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 uranium3 rotate: false - xy: 969, 431 + xy: 680, 249 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 water rotate: false - xy: 1009, 430 + xy: 931, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -552,28 +552,28 @@ wateredge index: -1 block-middle rotate: false - xy: 393, 125 + xy: 127, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pump-liquid rotate: false - xy: 393, 125 + xy: 127, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduit-liquid rotate: false - xy: 137, 23 + xy: 146, 43 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 cross-1 rotate: false - xy: 652, 301 + xy: 147, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -587,28 +587,28 @@ cross-2 index: -1 cross-3 rotate: false - xy: 372, 169 + xy: 346, 169 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 enemyspawn rotate: false - xy: 147, 13 + xy: 309, 107 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 playerspawn rotate: false - xy: 622, 286 + xy: 186, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shadow rotate: false - xy: 281, 111 + xy: 233, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -622,49 +622,42 @@ alloysmelter index: -1 coaldrill rotate: false - xy: 127, 23 + xy: 622, 296 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coalextractor rotate: false - xy: 479, 158 + xy: 632, 296 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coalgenerator rotate: false - xy: 479, 148 + xy: 685, 347 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coalgenerator-top rotate: false - xy: 479, 138 + xy: 685, 337 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 combustiongenerator rotate: false - xy: 622, 296 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -copperdrill - rotate: false - xy: 152, 33 + xy: 685, 327 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 cryofluidmixer-bottom rotate: false - xy: 373, 151 + xy: 347, 151 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -692,217 +685,217 @@ cultivator index: -1 fluxpump rotate: false - xy: 157, 13 + xy: 319, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill rotate: false - xy: 196, 44 + xy: 369, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 largesolarpanel rotate: false - xy: 424, 170 + xy: 398, 169 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 laserdrill rotate: false - xy: 188, 76 + xy: 206, 94 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 lavasmelter rotate: false - xy: 207, 14 + xy: 640, 266 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +leaddrill + rotate: false + xy: 148, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 nuclearreactor rotate: false - xy: 450, 170 + xy: 466, 196 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 nuclearreactor-center rotate: false - xy: 721, 422 + xy: 450, 170 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 nuclearreactor-lights rotate: false - xy: 61, 13 + xy: 721, 422 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 oilextractor rotate: false - xy: 87, 13 + xy: 61, 13 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 oilextractor-liquid rotate: false - xy: 225, 139 + xy: 87, 13 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 oilrefinery rotate: false - xy: 237, 24 + xy: 166, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 omnidrill rotate: false - xy: 237, 14 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -powerbooster - rotate: false - xy: 632, 286 + xy: 176, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulverizer rotate: false - xy: 640, 256 + xy: 167, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pump rotate: false - xy: 652, 281 + xy: 167, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 quartzextractor rotate: false - xy: 763, 427 + xy: 781, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 rtgenerator rotate: false - xy: 660, 271 + xy: 187, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rtgenerator-top rotate: false - xy: 660, 261 + xy: 197, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 siliconextractor rotate: false - xy: 241, 4 + xy: 237, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 smelter rotate: false - xy: 423, 119 + xy: 669, 319 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 smelter-middle rotate: false - xy: 433, 120 + xy: 667, 309 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 solarpanel rotate: false - xy: 473, 118 + xy: 131, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stonedrill rotate: false - xy: 919, 445 + xy: 705, 339 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneformer rotate: false - xy: 919, 435 + xy: 705, 329 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thermalgenerator rotate: false - xy: 929, 435 + xy: 662, 279 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill rotate: false - xy: 971, 451 + xy: 650, 259 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumextractor rotate: false - xy: 981, 451 + xy: 660, 269 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 uraniumdrill rotate: false - xy: 979, 431 + xy: 492, 168 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 uraniumextractor rotate: false - xy: 989, 441 + xy: 492, 158 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 waterextractor rotate: false - xy: 835, 427 + xy: 853, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 waterextractor-liquid rotate: false - xy: 853, 427 + xy: 651, 343 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -921,303 +914,275 @@ batterylarge orig: 24, 24 offset: 0, 0 index: -1 -batterylarge-base - rotate: false - xy: 832, 487 - size: 24, 24 - orig: 24, 24 - offset: 0, 0 - index: -1 conduit-bottom - rotate: false - xy: 685, 347 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -conduit-top rotate: false xy: 142, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 +conduit-top + rotate: false + xy: 642, 296 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 conduittunnel rotate: false - xy: 146, 43 + xy: 652, 299 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyor rotate: false - xy: 489, 158 + xy: 695, 347 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyormove rotate: false - xy: 489, 148 + xy: 695, 337 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyortunnel rotate: false - xy: 489, 138 + xy: 695, 327 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 core rotate: false - xy: 346, 169 + xy: 320, 169 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 junction rotate: false - xy: 216, 44 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -laser-base - rotate: false - xy: 212, 34 + xy: 630, 266 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidjunction rotate: false - xy: 217, 24 + xy: 158, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter rotate: false - xy: 217, 14 + xy: 168, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-bottom rotate: false - xy: 222, 34 + xy: 178, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-liquid rotate: false - xy: 226, 44 + xy: 188, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-top rotate: false - xy: 227, 24 + xy: 198, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidtank-bottom rotate: false - xy: 66, 39 + xy: 424, 170 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 liquidtank-liquid rotate: false - xy: 92, 39 + xy: 66, 39 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 liquidtank-top rotate: false - xy: 466, 196 + xy: 92, 39 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 multiplexer rotate: false - xy: 564, 207 + xy: 763, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 poweredconveyor rotate: false - xy: 642, 286 + xy: 196, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 poweredconveyormove rotate: false - xy: 620, 276 + xy: 206, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 powerinfinite rotate: false - xy: 620, 266 + xy: 162, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -powerlaser +powernode rotate: false - xy: 630, 276 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -powerlasercorner - rotate: false - xy: 630, 266 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -powerlaserrouter - rotate: false - xy: 640, 276 + xy: 172, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 powervoid rotate: false - xy: 640, 266 + xy: 182, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-bottom rotate: false - xy: 620, 256 + xy: 192, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-top rotate: false - xy: 630, 256 + xy: 202, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 router rotate: false - xy: 650, 261 + xy: 187, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shieldgenerator rotate: false - xy: 171, 4 + xy: 217, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shieldprojector rotate: false - xy: 781, 427 + xy: 799, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 sortedunloader rotate: false - xy: 483, 118 + xy: 141, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sorter rotate: false - xy: 493, 128 + xy: 151, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 splitter rotate: false - xy: 493, 118 + xy: 161, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyor rotate: false - xy: 705, 349 + xy: 171, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyormove rotate: false - xy: 901, 455 + xy: 181, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 teleporter rotate: false - xy: 251, 139 + xy: 225, 139 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 teleporter-top rotate: false - xy: 277, 139 + xy: 251, 139 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 unloader rotate: false - xy: 939, 431 + xy: 650, 249 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vault rotate: false - xy: 329, 143 + xy: 303, 143 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 vault-icon rotate: false - xy: 989, 431 + xy: 901, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weaponfactory rotate: false - xy: 651, 343 + xy: 651, 325 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 block-1 rotate: false - xy: 383, 125 + xy: 132, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1231,21 +1196,21 @@ block-2 index: -1 block-2-top rotate: false - xy: 355, 151 + xy: 329, 151 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 block-3 rotate: false - xy: 858, 487 + xy: 832, 487 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 block-3-top rotate: false - xy: 294, 169 + xy: 858, 487 size: 24, 24 orig: 24, 24 offset: 0, 0 @@ -1259,14 +1224,14 @@ chainturret index: -1 doubleturret rotate: false - xy: 127, 13 + xy: 147, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 flakturret rotate: false - xy: 205, 112 + xy: 383, 151 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -1280,7 +1245,7 @@ flameturret index: -1 fornaxcannon rotate: false - xy: 398, 169 + xy: 372, 169 size: 24, 24 orig: 24, 24 offset: 0, 0 @@ -1294,84 +1259,84 @@ gatlingturret index: -1 laserturret rotate: false - xy: 245, 111 + xy: 214, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 magmaturret rotate: false - xy: 206, 94 + xy: 206, 76 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 megarepairturret rotate: false - xy: 206, 76 + xy: 561, 225 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 missileturret rotate: false - xy: 561, 225 + xy: 564, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 railgunturret rotate: false - xy: 257, 111 + xy: 574, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 repairturret rotate: false - xy: 269, 111 + xy: 417, 123 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 shotgunturret rotate: false - xy: 293, 111 + xy: 245, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 teslaturret rotate: false - xy: 305, 115 + xy: 257, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 titancannon rotate: false - xy: 303, 143 + xy: 277, 139 size: 24, 24 orig: 24, 24 offset: 0, 0 index: -1 compositewall rotate: false - xy: 632, 296 + xy: 137, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 door rotate: false - xy: 875, 405 + xy: 127, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 door-large rotate: false - xy: 391, 151 + xy: 365, 151 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -1385,14 +1350,14 @@ door-large-open index: -1 door-open rotate: false - xy: 305, 105 + xy: 137, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 duriumwall rotate: false - xy: 137, 13 + xy: 157, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1406,49 +1371,49 @@ duriumwall-large index: -1 ironwall rotate: false - xy: 206, 44 + xy: 379, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelwall rotate: false - xy: 911, 455 + xy: 191, 4 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelwall-large rotate: false - xy: 799, 427 + xy: 817, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 stonewall rotate: false - xy: 929, 445 + xy: 652, 279 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumshieldwall rotate: false - xy: 939, 441 + xy: 660, 259 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumwall rotate: false - xy: 949, 441 + xy: 670, 269 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumwall-large rotate: false - xy: 817, 427 + xy: 835, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -1462,7 +1427,7 @@ blank index: -1 bullet rotate: false - xy: 403, 125 + xy: 309, 117 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1488,7 +1453,7 @@ laser orig: 1, 12 offset: 0, 0 index: -1 -laserend +laser-end rotate: false xy: 566, 290 size: 18, 18 @@ -1504,28 +1469,28 @@ laserfull index: -1 shell rotate: false - xy: 161, 3 + xy: 217, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot rotate: false - xy: 201, 4 + xy: 227, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot-long rotate: false - xy: 211, 4 + xy: 227, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanshell rotate: false - xy: 959, 441 + xy: 670, 259 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1567,98 +1532,84 @@ standard-mech-leg index: -1 item-biomatter rotate: false - xy: 162, 34 + xy: 389, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-coal rotate: false - xy: 172, 34 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -item-copper - rotate: false - xy: 182, 34 + xy: 399, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-densealloy rotate: false - xy: 192, 34 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -item-dirium - rotate: false - xy: 202, 34 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -item-glass - rotate: false - xy: 167, 24 + xy: 409, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-iron rotate: false - xy: 167, 14 + xy: 419, 103 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +item-lead + rotate: false + xy: 622, 286 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-plastic rotate: false - xy: 177, 24 + xy: 632, 286 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-quartz rotate: false - xy: 177, 14 + xy: 642, 286 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-silicon rotate: false - xy: 187, 24 + xy: 652, 289 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-steel rotate: false - xy: 187, 14 + xy: 662, 289 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-stone rotate: false - xy: 197, 24 + xy: 620, 276 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-titanium rotate: false - xy: 197, 14 + xy: 620, 266 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-uranium rotate: false - xy: 218, 54 + xy: 630, 276 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1777,7 +1728,7 @@ button-map-over index: -1 button-select rotate: false - xy: 320, 169 + xy: 294, 169 size: 24, 24 split: 4, 4, 4, 4 orig: 24, 24 @@ -1869,7 +1820,7 @@ icon-admin index: -1 icon-admin-small rotate: false - xy: 476, 170 + xy: 321, 135 size: 6, 6 orig: 6, 6 offset: 0, 0 @@ -1883,7 +1834,7 @@ icon-areaDelete index: -1 icon-arrow rotate: false - xy: 651, 327 + xy: 680, 409 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -1918,21 +1869,21 @@ icon-arrow-up index: -1 icon-back rotate: false - xy: 656, 361 + xy: 205, 112 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-ban rotate: false - xy: 463, 154 + xy: 680, 393 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-cancel rotate: false - xy: 680, 409 + xy: 696, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -1946,7 +1897,7 @@ icon-chat index: -1 icon-check rotate: false - xy: 680, 393 + xy: 696, 395 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -1995,14 +1946,14 @@ icon-defense index: -1 icon-dev-builds rotate: false - xy: 696, 411 + xy: 680, 377 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-discord rotate: false - xy: 696, 395 + xy: 696, 379 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -2016,84 +1967,84 @@ icon-distribution index: -1 icon-donate rotate: false - xy: 680, 377 + xy: 572, 274 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-dots rotate: false - xy: 696, 379 + xy: 572, 258 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-editor rotate: false - xy: 572, 274 + xy: 588, 276 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-exit rotate: false - xy: 572, 258 + xy: 588, 260 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-file-text rotate: false - xy: 588, 276 + xy: 604, 276 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-fill rotate: false - xy: 118, 47 + xy: 401, 151 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-floppy rotate: false - xy: 588, 260 + xy: 604, 260 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-folder rotate: false - xy: 604, 276 + xy: 763, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-folder-parent rotate: false - xy: 604, 260 + xy: 779, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-github rotate: false - xy: 763, 411 + xy: 795, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-google-play rotate: false - xy: 779, 411 + xy: 811, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-grid rotate: false - xy: 476, 178 + xy: 656, 361 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -2114,350 +2065,350 @@ icon-holdDelete index: -1 icon-home rotate: false - xy: 795, 411 + xy: 827, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-host rotate: false - xy: 811, 411 + xy: 843, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-info rotate: false - xy: 419, 139 + xy: 321, 123 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-itch.io rotate: false - xy: 827, 411 + xy: 859, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-line rotate: false - xy: 409, 151 + xy: 118, 47 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-link rotate: false - xy: 843, 411 + xy: 674, 361 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-liquid rotate: false - xy: 431, 140 + xy: 333, 123 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-load rotate: false - xy: 859, 411 + xy: 669, 345 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-load-image rotate: false - xy: 427, 152 + xy: 476, 178 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-load-map rotate: false - xy: 445, 152 + xy: 492, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-loading rotate: false - xy: 492, 207 + xy: 510, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-logic rotate: false - xy: 443, 140 + xy: 345, 123 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-menu rotate: false - xy: 875, 415 + xy: 357, 123 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-menu-large rotate: false - xy: 510, 207 + xy: 528, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-none rotate: false - xy: 136, 53 + xy: 369, 123 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-pause rotate: false - xy: 154, 64 + xy: 381, 123 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-pencil rotate: false - xy: 528, 207 + xy: 546, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-pencil-small rotate: false - xy: 651, 311 + xy: 669, 329 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-pick rotate: false - xy: 546, 207 + xy: 867, 453 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-play rotate: false - xy: 166, 64 + xy: 393, 123 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-play-2 rotate: false - xy: 674, 361 + xy: 225, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-players rotate: false - xy: 178, 64 + xy: 405, 123 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-power rotate: false - xy: 190, 64 + xy: 875, 415 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-production rotate: false - xy: 202, 64 + xy: 136, 53 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-quit rotate: false - xy: 669, 345 + xy: 241, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-redo rotate: false - xy: 867, 453 + xy: 134, 92 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-refresh rotate: false - xy: 225, 123 + xy: 257, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rename rotate: false - xy: 241, 123 + xy: 273, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-resize rotate: false - xy: 134, 92 + xy: 134, 74 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-rotate rotate: false - xy: 257, 123 + xy: 289, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-arrow rotate: false - xy: 273, 123 + xy: 305, 127 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-left rotate: false - xy: 289, 123 + xy: 651, 309 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-right rotate: false - xy: 305, 127 + xy: 329, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-save rotate: false - xy: 321, 127 + xy: 345, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-save-image rotate: false - xy: 134, 74 + xy: 152, 94 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-save-map rotate: false - xy: 152, 94 + xy: 152, 76 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-settings rotate: false - xy: 214, 64 + xy: 154, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-terrain rotate: false - xy: 152, 76 + xy: 170, 94 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-tools rotate: false - xy: 337, 127 + xy: 361, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-touch rotate: false - xy: 574, 195 + xy: 166, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-touchDelete rotate: false - xy: 455, 140 + xy: 178, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-trash rotate: false - xy: 355, 135 + xy: 377, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-trash-16 rotate: false - xy: 170, 94 + xy: 170, 76 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-trello rotate: false - xy: 371, 135 + xy: 393, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-tutorial rotate: false - xy: 387, 135 + xy: 409, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-undo rotate: false - xy: 170, 76 + xy: 188, 94 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-units rotate: false - xy: 467, 142 + xy: 190, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-weapon rotate: false - xy: 233, 111 + xy: 202, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-wiki rotate: false - xy: 403, 135 + xy: 476, 162 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-zoom rotate: false - xy: 188, 94 + xy: 188, 76 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -2614,7 +2565,7 @@ textfield-over index: -1 white rotate: false - xy: 647, 306 + xy: 113, 34 size: 3, 3 orig: 3, 3 offset: 0, 0 @@ -2637,84 +2588,84 @@ window-empty index: -1 beam rotate: false - xy: 317, 117 + xy: 269, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 beam-equip rotate: false - xy: 327, 117 + xy: 279, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blaster rotate: false - xy: 363, 125 + xy: 690, 357 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blaster-equip rotate: false - xy: 373, 125 + xy: 700, 359 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 clustergun rotate: false - xy: 136, 43 + xy: 419, 159 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 clustergun-equip rotate: false - xy: 690, 357 + xy: 429, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun rotate: false - xy: 181, 4 + xy: 222, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun-equip rotate: false - xy: 191, 4 + xy: 226, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster rotate: false - xy: 969, 441 + xy: 680, 269 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster-equip rotate: false - xy: 979, 441 + xy: 680, 259 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan rotate: false - xy: 999, 438 + xy: 911, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan-equip rotate: false - xy: 999, 428 + xy: 921, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index b120f43bab..69fe6c46dd 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/assets/version.properties b/core/assets/version.properties index a39e19ef5c..65ceb224c5 100644 --- a/core/assets/version.properties +++ b/core/assets/version.properties @@ -1,7 +1,7 @@ #Autogenerated file. Do not modify. -#Thu Mar 22 20:36:03 EDT 2018 +#Fri Mar 23 20:15:39 EDT 2018 version=release -androidBuildCode=612 +androidBuildCode=621 name=Mindustry code=3.4 build=custom build diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index 7f8a12e1fa..570d97383d 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -413,11 +413,7 @@ public class Renderer extends RendererModule{ //draw config selected block if(ui.configfrag.isShown()){ Tile tile = ui.configfrag.getSelectedTile(); - Draw.color(Colors.get("accent")); - Lines.stroke(1f); - Lines.square(tile.drawx(), tile.drawy(), - tile.block().size * tilesize / 2f + 1f); - Draw.reset(); + tile.block().drawConfigure(tile); } int tilex = control.input().getBlockX(); @@ -460,7 +456,7 @@ public class Renderer extends RendererModule{ Draw.reset(); //draw selected block bars and info - if(input.recipe == null && !ui.hasMouse()){ + if(input.recipe == null && !ui.hasMouse() && !ui.configfrag.isShown()){ Tile tile = world.tileWorld(Graphics.mouseWorld().x, Graphics.mouseWorld().y); if(tile != null && tile.block() != Blocks.air){ diff --git a/core/src/io/anuke/mindustry/core/UI.java b/core/src/io/anuke/mindustry/core/UI.java index c71db3208f..c3341f9f3f 100644 --- a/core/src/io/anuke/mindustry/core/UI.java +++ b/core/src/io/anuke/mindustry/core/UI.java @@ -110,6 +110,7 @@ public class UI extends SceneModule{ Colors.put("breakStart", Color.YELLOW); Colors.put("breakInvalid", Color.RED); Colors.put("range", Colors.get("accent")); + Colors.put("power", Color.valueOf("fbd367")); } @Override diff --git a/core/src/io/anuke/mindustry/game/Difficulty.java b/core/src/io/anuke/mindustry/game/Difficulty.java index d483322449..451a1bb228 100644 --- a/core/src/io/anuke/mindustry/game/Difficulty.java +++ b/core/src/io/anuke/mindustry/game/Difficulty.java @@ -9,16 +9,16 @@ import io.anuke.mindustry.world.blocks.types.defense.Turret; import io.anuke.mindustry.world.blocks.types.distribution.Conveyor; import io.anuke.mindustry.world.blocks.types.distribution.Router; import io.anuke.mindustry.world.blocks.types.production.Drill; -import io.anuke.mindustry.world.blocks.types.generation.Generator; +import io.anuke.mindustry.world.blocks.types.generation.PowerDistributor; import io.anuke.mindustry.world.blocks.types.production.Smelter; import io.anuke.ucore.util.Bundles; public enum Difficulty { - easy(4f, 2f, 1f, new DestrutiveHeuristic(b -> b instanceof Generator)), - normal(2f, 1f, 1f, new DestrutiveHeuristic(b -> b instanceof Smelter || b instanceof Generator)), - hard(1.5f, 0.5f, 0.75f, new DestrutiveHeuristic(b -> b instanceof Turret || b instanceof Generator || b instanceof Drill || b instanceof Smelter)), - insane(0.5f, 0.25f, 0.5f, new DestrutiveHeuristic(b -> b instanceof Generator || b instanceof Drill || b instanceof Smelter || b instanceof Router)), - purge(0.25f, 0.01f, 0.25f, new DestrutiveHeuristic(b -> b instanceof Generator || b instanceof Drill || b instanceof Router + easy(4f, 2f, 1f, new DestrutiveHeuristic(b -> b instanceof PowerDistributor)), + normal(2f, 1f, 1f, new DestrutiveHeuristic(b -> b instanceof Smelter || b instanceof PowerDistributor)), + hard(1.5f, 0.5f, 0.75f, new DestrutiveHeuristic(b -> b instanceof Turret || b instanceof PowerDistributor || b instanceof Drill || b instanceof Smelter)), + insane(0.5f, 0.25f, 0.5f, new DestrutiveHeuristic(b -> b instanceof PowerDistributor || b instanceof Drill || b instanceof Smelter || b instanceof Router)), + purge(0.25f, 0.01f, 0.25f, new DestrutiveHeuristic(b -> b instanceof PowerDistributor || b instanceof Drill || b instanceof Router || b instanceof Smelter || b instanceof Conveyor || b instanceof LiquidBlock || b instanceof PowerBlock)); /**The scaling of how many waves it takes for one more enemy of a type to appear. diff --git a/core/src/io/anuke/mindustry/game/Tutorial.java b/core/src/io/anuke/mindustry/game/Tutorial.java index 4bef5c1bac..b615032b8c 100644 --- a/core/src/io/anuke/mindustry/game/Tutorial.java +++ b/core/src/io/anuke/mindustry/game/Tutorial.java @@ -496,7 +496,7 @@ public class Tutorial{ blockPlaceX = 4; blockPlaceY = 4; blockRotation = 2; - targetBlock = DistributionBlocks.powerlaser; + //targetBlock = DistributionBlocks.powerlaser; } void onSwitch(){ diff --git a/core/src/io/anuke/mindustry/input/DesktopInput.java b/core/src/io/anuke/mindustry/input/DesktopInput.java index 36490032bb..dce98b925a 100644 --- a/core/src/io/anuke/mindustry/input/DesktopInput.java +++ b/core/src/io/anuke/mindustry/input/DesktopInput.java @@ -43,8 +43,8 @@ public class DesktopInput extends InputHandler{ if((Inputs.keyTap("select") && recipe != null) || Inputs.keyTap("break")){ Vector2 vec = Graphics.world(Gdx.input.getX(), Gdx.input.getY()); - mousex = (int)vec.x; - mousey = (int)vec.y; + mousex = vec.x; + mousey = vec.y; } if(!Inputs.keyDown("select") && !Inputs.keyDown("break")){ @@ -110,7 +110,9 @@ public class DesktopInput extends InputHandler{ if(target != null && Inputs.keyTap("select") && !ui.hasMouse()){ if(target.block().isConfigurable(target)){ - ui.configfrag.showConfig(target); + if((!ui.configfrag.isShown() + || ui.configfrag.getSelectedTile().block().onConfigureTileTapped(ui.configfrag.getSelectedTile(), target))) + ui.configfrag.showConfig(target); }else if(!ui.configfrag.hasConfigMouse()){ ui.configfrag.hideConfig(); } diff --git a/core/src/io/anuke/mindustry/io/Maps.java b/core/src/io/anuke/mindustry/io/Maps.java index 2ff971a62b..bf97474d74 100644 --- a/core/src/io/anuke/mindustry/io/Maps.java +++ b/core/src/io/anuke/mindustry/io/Maps.java @@ -12,6 +12,7 @@ import java.io.DataInputStream; import java.io.IOException; import static io.anuke.mindustry.Vars.customMapDirectory; +import static io.anuke.mindustry.Vars.headless; import static io.anuke.mindustry.Vars.mapExtension; public class Maps implements Disposable{ @@ -76,7 +77,7 @@ public class Maps implements Disposable{ DataInputStream ds = new DataInputStream(file.read()); MapMeta meta = MapIO.readMapMeta(ds); Map map = new Map(file.nameWithoutExtension(), meta, custom); - map.texture = new Texture(MapIO.generatePixmap(MapIO.readTileData(ds, meta))); + if(!headless) map.texture = new Texture(MapIO.generatePixmap(MapIO.readTileData(ds, meta))); maps.put(map.name, map); allMaps.add(map); diff --git a/core/src/io/anuke/mindustry/resource/Item.java b/core/src/io/anuke/mindustry/resource/Item.java index 66d50aab81..c1f6b1026c 100644 --- a/core/src/io/anuke/mindustry/resource/Item.java +++ b/core/src/io/anuke/mindustry/resource/Item.java @@ -15,7 +15,7 @@ public class Item implements Comparable{ } }, iron = new Item("iron"), - copper = new Item("copper"), + lead = new Item("lead"), coal = new Item("coal"){ { explosiveness = 0.2f; diff --git a/core/src/io/anuke/mindustry/resource/Recipes.java b/core/src/io/anuke/mindustry/resource/Recipes.java index 75da8cc2dc..ad22b51b7f 100644 --- a/core/src/io/anuke/mindustry/resource/Recipes.java +++ b/core/src/io/anuke/mindustry/resource/Recipes.java @@ -62,7 +62,7 @@ public class Recipes { //new Recipe(production, ProductionBlocks.stonedrill, stack(Item.stone, 12)), new Recipe(production, ProductionBlocks.irondrill, stack(Item.iron, 25)), - new Recipe(production, ProductionBlocks.copperdrill, stack(Item.iron, 25)), + new Recipe(production, ProductionBlocks.leaddrill, stack(Item.iron, 25)), new Recipe(production, ProductionBlocks.coaldrill, stack(Item.iron, 25), stack(Item.iron, 40)), new Recipe(production, ProductionBlocks.titaniumdrill, stack(Item.iron, 50), stack(Item.steel, 50)), new Recipe(production, ProductionBlocks.uraniumdrill, stack(Item.iron, 40), stack(Item.steel, 40)), @@ -79,9 +79,7 @@ public class Recipes { new Recipe(power, ProductionBlocks.largesolarpanel, stack(Item.iron, 30), stack(Item.silicon, 20)), new Recipe(power, ProductionBlocks.rtgenerator, stack(Item.titanium, 20), stack(Item.steel, 20)), new Recipe(power, ProductionBlocks.nuclearReactor, stack(Item.titanium, 40), stack(Item.densealloy, 40), stack(Item.steel, 50)), - new Recipe(power, DistributionBlocks.powerlaser, stack(Item.steel, 3), stack(Item.iron, 3)), - new Recipe(power, DistributionBlocks.powerlasercorner, stack(Item.steel, 4), stack(Item.iron, 4)), - new Recipe(power, DistributionBlocks.powerlaserrouter, stack(Item.steel, 5), stack(Item.iron, 5)), + new Recipe(power, DistributionBlocks.powernode, stack(Item.steel, 3), stack(Item.iron, 3)), new Recipe(power, DistributionBlocks.battery, stack(Item.steel, 5), stack(Item.iron, 5)), new Recipe(power, DistributionBlocks.batteryLarge, stack(Item.steel, 5), stack(Item.iron, 5)), diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 5e59a56854..514b4e98bb 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -17,6 +17,7 @@ import io.anuke.mindustry.world.blocks.BaseBlock; import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Effects.Effect; import io.anuke.ucore.graphics.Draw; +import io.anuke.ucore.graphics.Lines; import io.anuke.ucore.scene.ui.layout.Table; import io.anuke.ucore.util.Bundles; import io.anuke.ucore.util.Mathf; @@ -135,6 +136,20 @@ public class Block extends BaseBlock { configure(tile, data); } + /**Called when another tile is tapped while this block is selected. + * Returns whether or not this block should be deselected.*/ + public boolean onConfigureTileTapped(Tile tile, Tile other){ + return true; + } + + public void drawConfigure(Tile tile){ + Draw.color("accent"); + Lines.stroke(1f); + Lines.square(tile.drawx(), tile.drawy(), + tile.block().size * tilesize / 2f + 1f); + Draw.reset(); + } + public boolean isConfigurable(Tile tile){ return false; } diff --git a/core/src/io/anuke/mindustry/world/Edges.java b/core/src/io/anuke/mindustry/world/Edges.java index b138945e0d..928e894f8d 100644 --- a/core/src/io/anuke/mindustry/world/Edges.java +++ b/core/src/io/anuke/mindustry/world/Edges.java @@ -1,17 +1,23 @@ package io.anuke.mindustry.world; import com.badlogic.gdx.math.GridPoint2; +import com.badlogic.gdx.math.Vector2; +import io.anuke.ucore.util.Geometry; import io.anuke.ucore.util.Mathf; import java.util.Arrays; public class Edges { private static final int maxSize = 11; + private static final int maxRadius = 12; private static GridPoint2[][] edges = new GridPoint2[maxSize][0]; private static GridPoint2[][] edgeInside = new GridPoint2[maxSize][0]; - private static GridPoint2[][] inside = new GridPoint2[maxSize][0]; + private static Vector2[][] polygons = new Vector2[12][0]; static{ + for(int i = 0; i < maxRadius; i ++){ + polygons[i] = Geometry.pixelCircle(i + 1); + } for(int i = 0; i < maxSize; i ++){ int bot = -(int)(i/2f) - 1; @@ -43,6 +49,11 @@ public class Edges { } } + public static Vector2[] getPixelPolygon(int radius){ + if(radius < 1 || radius > maxRadius) throw new RuntimeException("Polygon size must be between 1 and " + maxRadius); + return polygons[radius - 1]; + } + public static synchronized GridPoint2[] getEdges(int size){ if(size < 0 || size > maxSize) throw new RuntimeException("Block size must be between 0 and " + maxSize); diff --git a/core/src/io/anuke/mindustry/world/blocks/Blocks.java b/core/src/io/anuke/mindustry/world/blocks/Blocks.java index e23fd60611..9cd18eb636 100644 --- a/core/src/io/anuke/mindustry/world/blocks/Blocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/Blocks.java @@ -75,8 +75,8 @@ public class Blocks{ drops = new ItemStack(Item.iron, 1); }}, - copper = new Ore("copper"){{ - drops = new ItemStack(Item.copper, 1); + lead = new Ore("lead"){{ + drops = new ItemStack(Item.lead, 1); }}, coal = new Ore("coal"){{ diff --git a/core/src/io/anuke/mindustry/world/blocks/DebugBlocks.java b/core/src/io/anuke/mindustry/world/blocks/DebugBlocks.java index 005c2d1239..861086758e 100644 --- a/core/src/io/anuke/mindustry/world/blocks/DebugBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/DebugBlocks.java @@ -3,7 +3,7 @@ package io.anuke.mindustry.world.blocks; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.PowerBlock; -import io.anuke.mindustry.world.blocks.types.distribution.PowerLaser; +import io.anuke.mindustry.world.blocks.types.generation.PowerDistributor; public class DebugBlocks { public static final Block @@ -14,10 +14,9 @@ public class DebugBlocks { } }, - powerInfinite = new PowerLaser("powerinfinite") { + powerInfinite = new PowerDistributor("powerinfinite") { { - powerCapacity = 100f; - laserDirections = 4; + powerCapacity = 10000f; } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java index aa079e3d2c..96e894662b 100644 --- a/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java @@ -1,7 +1,9 @@ package io.anuke.mindustry.world.blocks; import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.blocks.types.PowerBlock; import io.anuke.mindustry.world.blocks.types.distribution.*; +import io.anuke.mindustry.world.blocks.types.generation.PowerDistributor; import io.anuke.mindustry.world.blocks.types.storage.SortedUnloader; import io.anuke.mindustry.world.blocks.types.storage.Unloader; import io.anuke.mindustry.world.blocks.types.storage.Vault; @@ -74,23 +76,14 @@ public class DistributionBlocks{ liquidjunction = new LiquidJunction("liquidjunction"){{ }}, - powerlaser = new PowerLaser("powerlaser"){{ + powernode = new PowerDistributor("powernode"){{ }}, - powerlaserrouter = new PowerLaser("powerlaserrouter"){{ - laserDirections = 3; - }}, - powerlasercorner = new PowerLaser("powerlasercorner"){{ - laserDirections = 2; - }}, - battery = new PowerLaser("battery"){{ - laserDirections = 1; + battery = new PowerBlock("battery"){{ powerCapacity = 320f; }}, - batteryLarge = new PowerLaser("batterylarge"){{ - laserDirections = 1; + batteryLarge = new PowerBlock("batterylarge"){{ size = 3; powerCapacity = 2000f; - base = "batterylarge-base"; }}, teleporter = new Teleporter("teleporter"){{ }}, diff --git a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java index 07583972b0..651c02693a 100644 --- a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java @@ -168,10 +168,10 @@ public class ProductionBlocks{ } }, - copperdrill = new Drill("copperdrill"){ + leaddrill = new Drill("leaddrill"){ { - resource = Blocks.copper; - result = Item.copper; + resource = Blocks.lead; + result = Item.lead; drillTime = 400; } }, diff --git a/core/src/io/anuke/mindustry/world/blocks/types/PowerBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/PowerBlock.java index a055a8a3a0..6df5bfd645 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/PowerBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/PowerBlock.java @@ -1,11 +1,9 @@ package io.anuke.mindustry.world.blocks.types; -import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.BlockGroup; public abstract class PowerBlock extends Block{ - public float voltage = 0.001f; public PowerBlock(String name) { super(name); @@ -14,13 +12,4 @@ public abstract class PowerBlock extends Block{ hasPower = true; group = BlockGroup.power; } - - @Override - public TileEntity getEntity(){ - return new PowerEntity(); - } - - public static class PowerEntity extends TileEntity{ - public float time; //generator time. this is a bit of a hack - } } 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 dac9dd7b83..cbc3bbbc7a 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 @@ -24,7 +24,6 @@ public class ShieldBlock extends PowerBlock{ public ShieldBlock(String name) { super(name); - voltage = powerDrain; powerCapacity = 80f; hasInventory = false; } @@ -82,7 +81,7 @@ public class ShieldBlock extends PowerBlock{ entity.power.amount -= bullet.getDamage() * powerPerDamage; } - static class ShieldEntity extends PowerEntity{ + static class ShieldEntity extends TileEntity{ Shield shield; } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldedWallBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldedWallBlock.java index d1cb30c408..6601e523a5 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldedWallBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/ShieldedWallBlock.java @@ -20,7 +20,6 @@ public class ShieldedWallBlock extends PowerBlock{ super(name); destructible = true; update = false; - voltage = 0.00001f; } @Override @@ -72,7 +71,7 @@ public class ShieldedWallBlock extends PowerBlock{ return new ShieldedWallEntity(); } - static class ShieldedWallEntity extends PowerEntity{ + static class ShieldedWallEntity extends TileEntity{ public float hit; } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerLaser.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerLaser.java deleted file mode 100644 index 4f72a5298a..0000000000 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/PowerLaser.java +++ /dev/null @@ -1,46 +0,0 @@ -package io.anuke.mindustry.world.blocks.types.distribution; - -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.graphics.g2d.TextureRegion; -import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.types.generation.Generator; -import io.anuke.ucore.graphics.Draw; - -public class PowerLaser extends Generator{ - public Color color = Color.valueOf("e54135"); - public String base = null; - - public PowerLaser(String name) { - super(name); - rotate = true; - solid = true; - explosive = false; - laserDirections = 1; - health = 50; - hasInventory = false; - } - - @Override - public TextureRegion[] getIcon(){ - String bname = base == null ? "laser-base" : base; - return new TextureRegion[]{Draw.region(bname), Draw.region(name)}; - } - - @Override - public void draw(Tile tile) { - Draw.rect(base == null ? "laser-base" : base, tile.drawx(), tile.drawy()); - Draw.rect(name(), tile.drawx(), tile.drawy(), tile.getRotation() * 90 - 90); - } - - @Override - public void update(Tile tile){ - distributeLaserPower(tile); - } - - @Override - public boolean acceptPower(Tile tile, Tile from, float amount){ - PowerEntity entity = tile.entity(); - - return entity.power.amount <= powerCapacity; - } -} 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 c924bfbb36..f04a4b484d 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 @@ -138,7 +138,7 @@ public class Teleporter extends PowerBlock{ @Override public void handleItem(Item item, Tile tile, Tile source){ - PowerEntity entity = tile.entity(); + TeleporterEntity entity = tile.entity(); Array links = findLinks(tile); @@ -154,7 +154,7 @@ public class Teleporter extends PowerBlock{ @Override public boolean acceptItem(Item item, Tile tile, Tile source){ - PowerEntity entity = tile.entity(); + TeleporterEntity entity = tile.entity(); return !(source.block() instanceof Teleporter) && entity.power.amount >= powerPerItem && findLinks(tile).size > 0; } @@ -189,7 +189,7 @@ public class Teleporter extends PowerBlock{ return returns; } - public static class TeleporterEntity extends PowerEntity{ + public static class TeleporterEntity extends TileEntity{ public byte color = 0; @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/types/generation/Generator.java b/core/src/io/anuke/mindustry/world/blocks/types/generation/Generator.java deleted file mode 100644 index fd5c223c39..0000000000 --- a/core/src/io/anuke/mindustry/world/blocks/types/generation/Generator.java +++ /dev/null @@ -1,266 +0,0 @@ -package io.anuke.mindustry.world.blocks.types.generation; - -import com.badlogic.gdx.graphics.Color; -import com.badlogic.gdx.math.GridPoint2; -import com.badlogic.gdx.math.Vector2; -import io.anuke.mindustry.entities.TileEntity; -import io.anuke.mindustry.graphics.Fx; -import io.anuke.mindustry.world.Layer; -import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.types.PowerBlock; -import io.anuke.ucore.core.Effects; -import io.anuke.ucore.core.Settings; -import io.anuke.ucore.core.Timers; -import io.anuke.ucore.graphics.Draw; -import io.anuke.ucore.graphics.Hue; -import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.graphics.Shapes; -import io.anuke.ucore.util.Geometry; -import io.anuke.ucore.util.Mathf; -import io.anuke.ucore.util.Strings; -import io.anuke.ucore.util.Translator; - -import static io.anuke.mindustry.Vars.tilesize; -import static io.anuke.mindustry.Vars.world; - -public class Generator extends PowerBlock{ - public static boolean drawRangeOverlay = false; - public static final float thicknessScl = 0.85f * 0.7f; - public static final float laserMinValue = 0f; - public static final Color laserFrom = Color.valueOf("d0bdd2"); - public static final Color laserTo = Color.valueOf("ffe7a8"); - - protected Translator t1 = new Translator(); - protected Translator t2 = new Translator(); - - public int laserRange = 6; - public int laserDirections = 4; - public float powerSpeed = 0.5f; - public boolean explosive = true; - public boolean hasLasers = true; - public boolean outputOnly = false; - - public Generator(String name){ - super(name); - expanded = true; - layer = Layer.power; - } - - @Override - public void setStats(){ - super.setStats(); - - if(hasLasers){ - stats.add("lasertilerange", laserRange); - stats.add("maxpowertransfersecond", Strings.toFixed(powerSpeed * 60, 2)); - } - - //TODO fix this - if(explosive){ - stats.add("explosive", "!!! //TODO"); - } - } - - @Override - public void drawSelect(Tile tile){ - super.drawSelect(tile); - - if(drawRangeOverlay){ - int rotation = tile.getRotation(); - if(hasLasers){ - Draw.color(Color.YELLOW); - Lines.stroke(2f); - - for(int i = 0; i < laserDirections; i++){ - int dir = Mathf.mod(i + rotation - laserDirections / 2, 4); - float lx = Geometry.d4[dir].x, ly = Geometry.d4[dir].y; - float dx = lx * laserRange * tilesize; - float dy = ly * laserRange * tilesize; - - Lines.dashLine( - tile.worldx() + lx * tilesize / 2, - tile.worldy() + ly * tilesize / 2, - tile.worldx() + dx - lx * tilesize, - tile.worldy() + dy - ly * tilesize, 9); - } - - Draw.reset(); - } - } - } - - @Override - public void drawPlace(int x, int y, int rotation, boolean valid){ - if(hasLasers){ - Draw.color("place"); - Lines.stroke(2f); - - for(int i = 0; i < laserDirections; i++){ - int dir = Mathf.mod(i + rotation - laserDirections / 2, 4); - float lx = Geometry.d4[dir].x, ly = Geometry.d4[dir].y; - float dx = lx * laserRange * tilesize; - float dy = ly * laserRange * tilesize; - Lines.dashLine( - x * tilesize + lx * tilesize / 2, - y * tilesize + ly * tilesize / 2, - x * tilesize + dx - lx * tilesize, - y * tilesize + dy - ly * tilesize, 9); - } - - Draw.reset(); - } - } - - @Override - public void onDestroyed(Tile tile){ - if(explosive){ - float x = tile.worldx(), y = tile.worldy(); - - Effects.effect(Fx.shellsmoke, x, y); - Effects.effect(Fx.blastsmoke, x, y); - - Timers.run(Mathf.random(8f + Mathf.random(6f)), () -> { - Effects.shake(6f, 8f, x, y); - Effects.effect(Fx.generatorexplosion, x, y); - Effects.effect(Fx.shockwave, x, y); - - //TODO better explosion effect! - - Effects.sound(explosionSound, x, y); - }); - - }else{ - super.onDestroyed(tile); - } - } - - @Override - public void drawLayer(Tile tile){ - if(!Settings.getBool("lasers")) return; - - GeneratorEntity entity = tile.entity(); - - if(entity.power.amount > powerSpeed){ - entity.laserThickness = Mathf.lerpDelta(entity.laserThickness, 1f, 0.05f); - }else{ - entity.laserThickness = Mathf.lerpDelta(entity.laserThickness, laserMinValue, 0.05f); - } - - for(int i = 0; i < laserDirections; i++){ - drawLaserTo(tile, (tile.getRotation() + i) - laserDirections / 2); - } - - Draw.color(); - } - - //@Override - //public boolean acceptPower(Tile tile, Tile source, float amount){ - // return false; - //} - - @Override - public TileEntity getEntity() { - return new GeneratorEntity(); - } - - public static class GeneratorEntity extends PowerEntity{ - float laserThickness = laserMinValue; - } - - protected void distributeLaserPower(Tile tile){ - PowerEntity entity = tile.entity(); - - for(int i = 0; i < laserDirections; i++){ - int rot = (tile.getRotation() + i) - laserDirections / 2; - Tile target = laserTarget(tile, rot); - - if(target == null) - continue; - - if(isInterfering(target, rot)){ - float fract = tile.entity.power.amount / powerCapacity; - float ofract = target.entity.power.amount / target.block().powerCapacity; - if(ofract > fract) continue; - } - - float transmit = Math.min(powerSpeed * Timers.delta(), entity.power.amount); - if(target.block().acceptPower(target, tile, transmit)){ - float accepted = target.block().addPower(target, transmit); - entity.power.amount -= accepted; - } - - } - } - - protected void drawLaserTo(Tile tile, int rotation){ - - Tile target = laserTarget(tile, rotation); - - GeneratorEntity entity = tile.entity(); - - float scale = thicknessScl; - - if(target != null){ - boolean interfering = isInterfering(target, rotation); - - t1.trns(rotation * 90, tilesize / 2 + 2f + - (interfering ? Vector2.dst(tile.worldx(), tile.worldy(), target.worldx(), - target.worldy()) / 2f - tilesize / 2f * 1 : 0)); - - t2.trns(rotation * 90, size * tilesize / 2 + 2f); - - Draw.tint(Hue.mix(laserFrom, laserTo, entity.laserThickness * 0.93f + Mathf.sin(Timers.time(), 1.7f, 0.07f))); - - int relative = tile.sizedRelativeTo(target.x, target.y); - - if(relative == -1){ - Shapes.laser("laser", "laserend", tile.worldx() + t2.x, tile.worldy() + t2.y, - target.worldx() - t1.x, - target.worldy() - t1.y, scale); - }else{ - float lf = 1f; - float s = interfering ? 12f : 18f; - float sclx = (relative == 1 || relative == 3) ? lf : 1f; - float scly = (relative == 1 || relative == 3) ? 1f : lf; - Draw.rect("laserfull", - tile.worldx() + Geometry.d4[relative].x * size * tilesize / 2f, - tile.worldy() + Geometry.d4[relative].y * size * tilesize / 2f , s * sclx, s * scly); - } - - Draw.color(); - } - } - - protected boolean isInterfering(Tile target, int rotation){ - 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(Mathf.mod(target.getRotation() + i - other.laserDirections/2, 4) == relrot){ - return true; - } - } - } - } - return false; - } - - protected Tile laserTarget(Tile tile, int rotation){ - rotation = Mathf.mod(rotation, 4); - GridPoint2 point = Geometry.d4[rotation]; - - for(int i = 1; i < laserRange; i++){ - Tile other = world.tile(tile.x + i * point.x, tile.y + i * point.y); - - if(other != null && other.block().hasPower){ - Tile linked = other.getLinked(); - if((linked == null || linked.block().hasPower) && linked != tile){ - return other; - } - } - } - return null; - } - -} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/generation/ItemPowerGenerator.java b/core/src/io/anuke/mindustry/world/blocks/types/generation/ItemPowerGenerator.java index 3198f72d56..4063f593d1 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/generation/ItemPowerGenerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/generation/ItemPowerGenerator.java @@ -6,6 +6,7 @@ import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.BarType; import io.anuke.mindustry.world.BlockBar; import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.blocks.types.generation.PowerGenerator.GeneratorEntity; import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Effects.Effect; import io.anuke.ucore.core.Timers; @@ -13,7 +14,7 @@ import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Strings; -public class ItemPowerGenerator extends Generator{ +public class ItemPowerGenerator extends PowerGenerator { public int itemCapacity = 20; public Item generateItem; public float powerOutput; @@ -23,7 +24,6 @@ public class ItemPowerGenerator extends Generator{ public ItemPowerGenerator(String name) { super(name); - outputOnly = true; } @Override @@ -43,12 +43,12 @@ public class ItemPowerGenerator extends Generator{ @Override public void draw(Tile tile){ super.draw(tile); + + GeneratorEntity entity = tile.entity(); - PowerEntity entity = tile.entity(); - - if(entity.time > 0){ + if(entity.generateTime > 0){ Draw.color(heatColor); - float alpha = (entity.inventory.hasItem(generateItem) ? 1f : Mathf.clamp(entity.time)); + float alpha = (entity.inventory.hasItem(generateItem) ? 1f : Mathf.clamp(entity.generateTime)); alpha = alpha * 0.7f + Mathf.absin(Timers.time(), 12f, 0.3f) * alpha; Draw.alpha(alpha); Draw.rect(name + "-top", tile.worldx(), tile.worldy()); @@ -63,24 +63,24 @@ public class ItemPowerGenerator extends Generator{ @Override public void update(Tile tile){ - PowerEntity entity = tile.entity(); + GeneratorEntity entity = tile.entity(); float maxPower = Math.min(powerCapacity - entity.power.amount, powerOutput * Timers.delta()); float mfract = maxPower/(powerOutput); - if(entity.time > 0f){ - entity.time -= 1f/itemDuration*mfract; + if(entity.generateTime > 0f){ + entity.generateTime -= 1f/itemDuration*mfract; entity.power.amount += maxPower; - entity.time = Mathf.clamp(entity.time); + entity.generateTime = Mathf.clamp(entity.generateTime); } - if(entity.time <= 0f && entity.inventory.hasItem(generateItem)){ + if(entity.generateTime <= 0f && entity.inventory.hasItem(generateItem)){ Effects.effect(generateEffect, tile.worldx() + Mathf.range(3f), tile.worldy() + Mathf.range(3f)); entity.inventory.removeItem(generateItem, 1); - entity.time = 1f; + entity.generateTime = 1f; } - distributeLaserPower(tile); + distributePower(tile); } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/generation/LiquidPowerGenerator.java b/core/src/io/anuke/mindustry/world/blocks/types/generation/LiquidPowerGenerator.java index a384febbc1..2fbe596047 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/generation/LiquidPowerGenerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/generation/LiquidPowerGenerator.java @@ -11,7 +11,7 @@ import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Strings; -public class LiquidPowerGenerator extends Generator{ +public class LiquidPowerGenerator extends PowerGenerator { public Liquid generateLiquid; public float powerPerLiquid = 0.13f; /**Maximum liquid used per frame.*/ @@ -20,7 +20,6 @@ public class LiquidPowerGenerator extends Generator{ public LiquidPowerGenerator(String name) { super(name); - outputOnly = true; liquidCapacity = 30f; hasLiquids = true; } @@ -66,8 +65,7 @@ public class LiquidPowerGenerator extends Generator{ } } - distributeLaserPower(tile); - + distributePower(tile); } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/types/generation/NuclearReactor.java b/core/src/io/anuke/mindustry/world/blocks/types/generation/NuclearReactor.java index f295a31e04..60647980a0 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/generation/NuclearReactor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/generation/NuclearReactor.java @@ -46,7 +46,6 @@ public class NuclearReactor extends LiquidPowerGenerator{ itemCapacity = 30; liquidCapacity = 50; explosionEffect = Fx.nuclearShockwave; - explosive = true; powerCapacity = 80f; powerSpeed = 0.5f; } @@ -111,7 +110,7 @@ public class NuclearReactor extends LiquidPowerGenerator{ if(entity.heat >= 1f){ entity.damage((int)entity.health); }else{ - distributeLaserPower(tile); + distributePower(tile); } } @@ -192,7 +191,7 @@ public class NuclearReactor extends LiquidPowerGenerator{ return new NuclearReactorEntity(); } - public static class NuclearReactorEntity extends GeneratorEntity{ + public static class NuclearReactorEntity extends GeneratorEntity { public float heat; public float flash; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/generation/PowerDistributor.java b/core/src/io/anuke/mindustry/world/blocks/types/generation/PowerDistributor.java new file mode 100644 index 0000000000..1f15c309a1 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/types/generation/PowerDistributor.java @@ -0,0 +1,217 @@ +package io.anuke.mindustry.world.blocks.types.generation; + +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.utils.IntArray; +import io.anuke.mindustry.entities.TileEntity; +import io.anuke.mindustry.world.Edges; +import io.anuke.mindustry.world.Layer; +import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.blocks.types.PowerBlock; +import io.anuke.ucore.core.Settings; +import io.anuke.ucore.core.Timers; +import io.anuke.ucore.graphics.Draw; +import io.anuke.ucore.graphics.Lines; +import io.anuke.ucore.graphics.Shapes; +import io.anuke.ucore.util.Angles; +import io.anuke.ucore.util.Mathf; +import io.anuke.ucore.util.Strings; +import io.anuke.ucore.util.Translator; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + +import static io.anuke.mindustry.Vars.tilesize; +import static io.anuke.mindustry.Vars.world; + +public class PowerDistributor extends PowerBlock{ + public static final float thicknessScl = 0.7f; + public static final float flashScl = 0.07f; + public static final float laserMinValue = 0f; + public static final Color laserFrom = Color.valueOf("e3e3e3"); + public static final Color laserTo = Color.valueOf("ffe7a8"); + + //last distribution block placed + private static int lastPlaced = -1; + + protected Translator t1 = new Translator(); + protected Translator t2 = new Translator(); + + public int laserRange = 6; + public float powerSpeed = 0.5f; + + public PowerDistributor(String name){ + super(name); + expanded = true; + layer = Layer.power; + hasInventory = false; + } + + @Override + public void placed(Tile tile) { + Tile before = world.tile(lastPlaced); + if(linkValid(tile, before)){ + tile.entity().links.add(before.packedPosition()); + } + + lastPlaced = tile.packedPosition(); + } + + @Override + public boolean isConfigurable(Tile tile){ + return true; + } + + @Override + public void setStats(){ + super.setStats(); + + stats.add("lasertilerange", laserRange); + stats.add("maxpowertransfersecond", Strings.toFixed(powerSpeed * 60, 2)); + } + + @Override + public void update(Tile tile){ + distributeLaserPower(tile); + } + + @Override + public boolean onConfigureTileTapped(Tile tile, Tile other){ + DistributorEntity entity = tile.entity(); + + if(linkValid(tile, other)){ + if(entity.links.contains(other.packedPosition())){ + entity.links.removeValue(other.packedPosition()); + }else{ + entity.links.add(other.packedPosition()); + } + return false; + } + return true; + } + + @Override + public void drawSelect(Tile tile){ + super.drawSelect(tile); + + Draw.color("power"); + Lines.stroke(1f); + + Lines.poly(Edges.getPixelPolygon(laserRange), tile.worldx() - tilesize/2, tile.worldy() - tilesize/2, tilesize); + + Draw.reset(); + } + + @Override + public void drawConfigure(Tile tile){ + Draw.color("accent"); + + Lines.stroke(1f); + Lines.square(tile.drawx(), tile.drawy(), + tile.block().size * tilesize / 2f + 1f); + + Lines.stroke(1f); + + Lines.poly(Edges.getPixelPolygon(laserRange), tile.worldx() - tilesize/2, tile.worldy() - tilesize/2, tilesize); + + Draw.color("power"); + + for(int x = tile.x - laserRange; x <= tile.x + laserRange; x ++){ + for(int y = tile.y - laserRange; y <= tile.y + laserRange; y ++){ + Tile link = world.tile(x, y); + if(link != tile && linkValid(tile, link)){ + Lines.square(link.drawx(), link.drawy(), + link.block().size * tilesize / 2f + 1f); + } + } + } + + Draw.reset(); + } + + @Override + public void drawPlace(int x, int y, int rotation, boolean valid){ + Draw.color("place"); + Lines.stroke(1f); + + Lines.poly(Edges.getPixelPolygon(laserRange), x * tilesize - tilesize/2, y * tilesize - tilesize/2, tilesize); + + Draw.reset(); + } + + @Override + public void drawLayer(Tile tile){ + if(!Settings.getBool("lasers")) return; + + DistributorEntity entity = tile.entity(); + + if(entity.power.amount > powerSpeed){ + entity.laserColor = Mathf.lerpDelta(entity.laserColor, 1f, 0.05f); + }else{ + entity.laserColor = Mathf.lerpDelta(entity.laserColor, laserMinValue, 0.05f); + } + + Draw.color(laserFrom, laserTo, entity.laserColor * (1f-flashScl) + Mathf.sin(Timers.time(), 1.7f, flashScl)); + + for(int i = 0; i < entity.links.size; i ++){ + Tile link = world.tile(entity.links.get(i)); + if(linkValid(tile, link)) drawLaser(tile, link); + } + + Draw.color(); + } + + protected void distributeLaserPower(Tile tile){ + DistributorEntity entity = tile.entity(); + + //TODO implement + } + + protected boolean linkValid(Tile tile, Tile link){ + return tile != link && link != null && link.block() instanceof PowerDistributor && + Vector2.dst(tile.worldx(), tile.worldy(), link.worldx(), link.worldy()) < Math.max(laserRange * tilesize, + ((PowerDistributor)link.block()).laserRange * tilesize); + } + + protected void drawLaser(Tile tile, Tile target){ + float x1 = tile.drawx(), y1 = tile.drawy(), + x2 = target.drawx(), y2 = target.drawy(); + + float angle1 = Angles.angle(x1, y1, x2, y2); + float angle2 = angle1 + 180f; + + t1.trns(angle1, tile.block().size * tilesize/2f + 1f); + t2.trns(angle2,tile.block().size * tilesize/2f + 1f); + + Shapes.laser("laser", "laser-end", x1 + t1.x, y1 + t1.y, + x2 + t2.x, y2 + t2.y, thicknessScl); + } + + @Override + public TileEntity getEntity() { + return new DistributorEntity(); + } + + public static class DistributorEntity extends TileEntity{ + public float laserColor = laserMinValue; + public IntArray links = new IntArray(); + + @Override + public void write(DataOutputStream stream) throws IOException { + stream.writeShort(links.size); + for(int i = 0; i < links.size; i ++){ + stream.writeInt(links.get(i)); + } + } + + @Override + public void read(DataInputStream stream) throws IOException { + short amount = stream.readShort(); + for(int i = 0; i < amount; i ++){ + links.add(stream.readInt()); + } + } + } + +} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/generation/PowerGenerator.java b/core/src/io/anuke/mindustry/world/blocks/types/generation/PowerGenerator.java new file mode 100644 index 0000000000..5b1c652e6f --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/types/generation/PowerGenerator.java @@ -0,0 +1,48 @@ +package io.anuke.mindustry.world.blocks.types.generation; + +import io.anuke.mindustry.entities.TileEntity; +import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.blocks.types.PowerBlock; +import io.anuke.ucore.core.Effects; +import io.anuke.ucore.core.Timers; +import io.anuke.ucore.util.Mathf; + +public class PowerGenerator extends PowerBlock { + protected float powerSpeed = 1f; + + public PowerGenerator(String name) { + super(name); + } + + protected void distributePower(Tile tile){ + //TODO! + } + + @Override + public void onDestroyed(Tile tile){ + float x = tile.worldx(), y = tile.worldy(); + + Effects.effect(Fx.shellsmoke, x, y); + Effects.effect(Fx.blastsmoke, x, y); + + Timers.run(Mathf.random(8f + Mathf.random(6f)), () -> { + Effects.shake(6f, 8f, x, y); + Effects.effect(Fx.generatorexplosion, x, y); + Effects.effect(Fx.shockwave, x, y); + + //TODO better explosion effect! + + Effects.sound(explosionSound, x, y); + }); + } + + @Override + public TileEntity getEntity() { + return new GeneratorEntity(); + } + + public static class GeneratorEntity extends TileEntity{ + public float generateTime; + } +} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/generation/SolarGenerator.java b/core/src/io/anuke/mindustry/world/blocks/types/generation/SolarGenerator.java index e093b36e9a..028f6ff075 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/generation/SolarGenerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/generation/SolarGenerator.java @@ -3,7 +3,7 @@ package io.anuke.mindustry.world.blocks.types.generation; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Timers; -public class SolarGenerator extends Generator { +public class SolarGenerator extends PowerGenerator { /**power generated per frame*/ protected float generation = 0.005f; @@ -16,7 +16,7 @@ public class SolarGenerator extends Generator { public void update(Tile tile){ addPower(tile, generation * Timers.delta()); - distributeLaserPower(tile); + distributePower(tile); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/PowerSmelter.java b/core/src/io/anuke/mindustry/world/blocks/types/production/PowerSmelter.java index f55f3539a6..58692492e3 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/PowerSmelter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/PowerSmelter.java @@ -160,7 +160,7 @@ public class PowerSmelter extends PowerBlock { return new PowerSmelterEntity(); } - class PowerSmelterEntity extends PowerEntity{ + class PowerSmelterEntity extends TileEntity{ public float heat; } } diff --git a/server/src/io/anuke/mindustry/server/mapgen/Colorizer.java b/server/src/io/anuke/mindustry/server/mapgen/Colorizer.java new file mode 100644 index 0000000000..f0f141b481 --- /dev/null +++ b/server/src/io/anuke/mindustry/server/mapgen/Colorizer.java @@ -0,0 +1,109 @@ +package io.anuke.mindustry.server.mapgen; + +import com.badlogic.gdx.files.FileHandle; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.Pixmap; +import com.badlogic.gdx.graphics.PixmapIO; +import com.badlogic.gdx.utils.Array; +import com.badlogic.gdx.utils.IntIntMap; +import com.badlogic.gdx.utils.IntSet; +import io.anuke.ucore.util.Mathf; + +public class Colorizer { + Color tmp = new Color(); + float[] hsv1 = new float[3]; + float[] hsv2 = new float[3]; + float target = 240f; + float shift = 12f; + float e = 0.05f; + + public void process(FileHandle in, FileHandle out){ + for(FileHandle child : in.list()){ + if(child.isDirectory()){ + process(child, out); + }else if(child.extension().equals("png")){ + PixmapIO.writePNG(out.child(child.name()), colorize(new Pixmap(child))); + } + } + } + + public Pixmap colorize(Pixmap pixmap){ + Array> colors = new Array<>(); + IntSet used = new IntSet(); + + for(int x = 0; x < pixmap.getWidth(); x ++){ + for(int y = 0; y < pixmap.getHeight(); y ++){ + tmp.set(pixmap.getPixel(x, y)); + + if(tmp.a <= 0.1f || used.contains(Color.rgba8888(tmp))) continue; + + used.add(Color.rgba8888(tmp)); + + boolean found = false; + + outer: + for(Array arr : colors){ + for(Color color : arr){ + if(isSameShade(color, tmp)){ + arr.add(tmp.cpy()); + found = true; + break outer; + } + } + } + + if(!found){ + colors.add(Array.with(tmp.cpy())); + } + } + } + + colors.forEach(a -> a.sort((c1, c2) -> Float.compare(c1.toHsv(hsv1)[2], c2.toHsv(hsv2)[2]))); + + IntIntMap map = new IntIntMap(); + + for(Array arr : colors){ + for(int i = 0; i < arr.size; i ++){ + int shift = arr.size - 1 - i; + map.put(Color.rgba8888(arr.get(i)), Color.rgba8888(shift(arr.get(i), shift))); + } + } + + Pixmap result = new Pixmap(pixmap.getWidth(), pixmap.getHeight(), pixmap.getFormat()); + + for(int x = 0; x < pixmap.getWidth(); x ++) { + for (int y = 0; y < pixmap.getHeight(); y++) { + result.drawPixel(x, y, map.get(pixmap.getPixel(x, y), 0)); + } + } + + return result; + } + + Color shift(Color color, int amount){ + color.toHsv(hsv1); + float h = hsv1[0]; + /*if(hsv1[1] < e){ + hsv1[1] += amount * 0.1f; + h = Mathf.lerp(0f, target, amount * 0.08f); + }*/ + float s = amount * shift; + if(Math.abs(h - target) < s){ + h = target; + }else{ + if(h > target) h -= s; + if(h < target) h += s; + } + hsv1[0] = h; + tmp.fromHsv(hsv1); + tmp.a = color.a; + return tmp; + } + + boolean isSameShade(Color a, Color b){ + a.toHsv(hsv1); + b.toHsv(hsv2); + + return Mathf.near(hsv1[0], hsv2[0], e*360f) && Mathf.near(hsv1[1], hsv2[1], e); + } +}