diff --git a/core/assets-raw/sprites/blocks/tech/battery.png b/core/assets-raw/sprites/blocks/power/battery.png similarity index 100% rename from core/assets-raw/sprites/blocks/tech/battery.png rename to core/assets-raw/sprites/blocks/power/battery.png diff --git a/core/assets-raw/sprites/blocks/tech/batterylarge.png b/core/assets-raw/sprites/blocks/power/batterylarge.png similarity index 100% rename from core/assets-raw/sprites/blocks/tech/batterylarge.png rename to core/assets-raw/sprites/blocks/power/batterylarge.png diff --git a/core/assets-raw/sprites/blocks/production/coalgenerator-top.png b/core/assets-raw/sprites/blocks/power/coalgenerator-top.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/coalgenerator-top.png rename to core/assets-raw/sprites/blocks/power/coalgenerator-top.png diff --git a/core/assets-raw/sprites/blocks/production/coalgenerator.png b/core/assets-raw/sprites/blocks/power/coalgenerator.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/coalgenerator.png rename to core/assets-raw/sprites/blocks/power/coalgenerator.png diff --git a/core/assets-raw/sprites/blocks/production/combustiongenerator.png b/core/assets-raw/sprites/blocks/power/combustiongenerator.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/combustiongenerator.png rename to core/assets-raw/sprites/blocks/power/combustiongenerator.png diff --git a/core/assets-raw/sprites/blocks/production/largesolarpanel.png b/core/assets-raw/sprites/blocks/power/largesolarpanel.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/largesolarpanel.png rename to core/assets-raw/sprites/blocks/power/largesolarpanel.png diff --git a/core/assets-raw/sprites/blocks/production/nuclearreactor-center.png b/core/assets-raw/sprites/blocks/power/nuclearreactor-center.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/nuclearreactor-center.png rename to core/assets-raw/sprites/blocks/power/nuclearreactor-center.png diff --git a/core/assets-raw/sprites/blocks/production/nuclearreactor-lights.png b/core/assets-raw/sprites/blocks/power/nuclearreactor-lights.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/nuclearreactor-lights.png rename to core/assets-raw/sprites/blocks/power/nuclearreactor-lights.png diff --git a/core/assets-raw/sprites/blocks/production/nuclearreactor.png b/core/assets-raw/sprites/blocks/power/nuclearreactor.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/nuclearreactor.png rename to core/assets-raw/sprites/blocks/power/nuclearreactor.png diff --git a/core/assets-raw/sprites/blocks/tech/powerinfinite.png b/core/assets-raw/sprites/blocks/power/powerinfinite.png similarity index 100% rename from core/assets-raw/sprites/blocks/tech/powerinfinite.png rename to core/assets-raw/sprites/blocks/power/powerinfinite.png diff --git a/core/assets-raw/sprites/blocks/tech/powervoid.png b/core/assets-raw/sprites/blocks/power/powervoid.png similarity index 100% rename from core/assets-raw/sprites/blocks/tech/powervoid.png rename to core/assets-raw/sprites/blocks/power/powervoid.png diff --git a/core/assets-raw/sprites/blocks/production/rtgenerator-top.png b/core/assets-raw/sprites/blocks/power/rtgenerator-top.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/rtgenerator-top.png rename to core/assets-raw/sprites/blocks/power/rtgenerator-top.png diff --git a/core/assets-raw/sprites/blocks/production/rtgenerator.png b/core/assets-raw/sprites/blocks/power/rtgenerator.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/rtgenerator.png rename to core/assets-raw/sprites/blocks/power/rtgenerator.png diff --git a/core/assets-raw/sprites/blocks/tech/shieldgenerator.png b/core/assets-raw/sprites/blocks/power/shieldgenerator.png similarity index 100% rename from core/assets-raw/sprites/blocks/tech/shieldgenerator.png rename to core/assets-raw/sprites/blocks/power/shieldgenerator.png diff --git a/core/assets-raw/sprites/blocks/tech/shieldprojector.png b/core/assets-raw/sprites/blocks/power/shieldprojector.png similarity index 100% rename from core/assets-raw/sprites/blocks/tech/shieldprojector.png rename to core/assets-raw/sprites/blocks/power/shieldprojector.png diff --git a/core/assets-raw/sprites/blocks/production/solarpanel.png b/core/assets-raw/sprites/blocks/power/solarpanel.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/solarpanel.png rename to core/assets-raw/sprites/blocks/power/solarpanel.png diff --git a/core/assets-raw/sprites/blocks/tech/teleporter.png b/core/assets-raw/sprites/blocks/power/teleporter.png similarity index 100% rename from core/assets-raw/sprites/blocks/tech/teleporter.png rename to core/assets-raw/sprites/blocks/power/teleporter.png diff --git a/core/assets-raw/sprites/blocks/production/thermalgenerator.png b/core/assets-raw/sprites/blocks/power/thermalgenerator.png similarity index 100% rename from core/assets-raw/sprites/blocks/production/thermalgenerator.png rename to core/assets-raw/sprites/blocks/power/thermalgenerator.png diff --git a/core/assets-raw/sprites/blocks/production/flierfactory.png b/core/assets-raw/sprites/blocks/production/flierfactory.png new file mode 100644 index 0000000000..b3fb296cff Binary files /dev/null and b/core/assets-raw/sprites/blocks/production/flierfactory.png differ diff --git a/core/assets/maps/test.mmap b/core/assets/maps/test.mmap index 2cd4660f8c..de4d45a09c 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 db415e2ef6..cbda60b357 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -13,56 +13,56 @@ background index: -1 blackrock1 rotate: false - xy: 289, 113 + xy: 637, 306 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackrockshadow1 rotate: false - xy: 579, 234 + xy: 419, 125 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstone1 rotate: false - xy: 690, 367 + xy: 136, 43 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstone2 rotate: false - xy: 700, 369 + xy: 134, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstone3 rotate: false - xy: 627, 306 + xy: 419, 159 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock1 rotate: false - xy: 637, 306 + xy: 429, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock2 rotate: false - xy: 136, 43 + xy: 439, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock3 rotate: false - xy: 299, 113 + xy: 449, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -76,504 +76,504 @@ blackstoneedge index: -1 coal1 rotate: false - xy: 439, 160 + xy: 632, 296 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coal2 rotate: false - xy: 449, 160 + xy: 693, 353 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coal3 rotate: false - xy: 459, 160 + xy: 693, 343 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 deepwater rotate: false - xy: 152, 33 + xy: 945, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt1 rotate: false - xy: 662, 299 + xy: 955, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt2 rotate: false - xy: 157, 23 + xy: 965, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt3 rotate: false - xy: 875, 405 + xy: 955, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirtedge rotate: false - xy: 901, 465 + xy: 871, 439 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 grass1 rotate: false - xy: 329, 113 + xy: 985, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass2 rotate: false - xy: 339, 113 + xy: 985, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass3 rotate: false - xy: 349, 113 + xy: 889, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock1 rotate: false - xy: 359, 113 + xy: 899, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock2 rotate: false - xy: 369, 113 + xy: 887, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassedge rotate: false - xy: 915, 465 + xy: 113, 17 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 ice1 rotate: false - xy: 379, 113 + xy: 897, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice2 rotate: false - xy: 389, 113 + xy: 698, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice3 rotate: false - xy: 399, 113 + xy: 696, 391 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iceedge rotate: false - xy: 929, 465 + xy: 674, 361 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 icerock1 rotate: false - xy: 409, 113 + xy: 696, 381 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerock2 rotate: false - xy: 419, 113 + xy: 708, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow1 rotate: false - xy: 319, 103 + xy: 706, 391 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow1 rotate: false - xy: 319, 103 + xy: 706, 391 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow2 rotate: false - xy: 329, 103 + xy: 706, 381 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow2 rotate: false - xy: 329, 103 + xy: 706, 381 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron1 rotate: false - xy: 339, 103 + xy: 148, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron2 rotate: false - xy: 349, 103 + xy: 158, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron3 rotate: false - xy: 359, 103 + xy: 168, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lava rotate: false - xy: 640, 276 + xy: 702, 291 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lavaedge rotate: false - xy: 885, 449 + xy: 669, 347 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 lead1 rotate: false - xy: 620, 256 + xy: 620, 266 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lead2 rotate: false - xy: 630, 256 + xy: 630, 276 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lead3 rotate: false - xy: 640, 256 + xy: 630, 266 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 mossblock rotate: false - xy: 208, 54 + xy: 907, 413 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 oil rotate: false - xy: 156, 44 + xy: 875, 405 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 oiledge rotate: false - xy: 871, 439 + xy: 669, 333 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 rock1 rotate: false - xy: 177, 24 + xy: 949, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rock2 rotate: false - xy: 177, 14 + xy: 965, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand1 rotate: false - xy: 197, 14 + xy: 985, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand2 rotate: false - xy: 218, 54 + xy: 979, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand3 rotate: false - xy: 216, 44 + xy: 989, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock1 rotate: false - xy: 212, 34 + xy: 139, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock2 rotate: false - xy: 207, 24 + xy: 144, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock3 rotate: false - xy: 207, 14 + xy: 146, 43 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandedge rotate: false - xy: 885, 435 + xy: 321, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 shrub rotate: false - xy: 232, 34 + xy: 216, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shrubshadow rotate: false - xy: 237, 24 + xy: 149, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow1 rotate: false - xy: 672, 299 + xy: 184, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow2 rotate: false - xy: 672, 289 + xy: 194, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow3 rotate: false - xy: 677, 309 + xy: 204, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock1 rotate: false - xy: 682, 299 + xy: 214, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock2 rotate: false - xy: 682, 289 + xy: 159, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock3 rotate: false - xy: 121, 3 + xy: 169, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowedge rotate: false - xy: 985, 461 + xy: 377, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 stone1 rotate: false - xy: 201, 4 + xy: 229, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone2 rotate: false - xy: 211, 4 + xy: 234, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone3 rotate: false - xy: 221, 4 + xy: 239, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock1 rotate: false - xy: 231, 4 + xy: 139, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock2 rotate: false - xy: 241, 4 + xy: 149, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock3 rotate: false - xy: 705, 349 + xy: 159, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneedge rotate: false - xy: 118, 33 + xy: 885, 433 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 thorium1 rotate: false - xy: 672, 279 + xy: 209, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium2 rotate: false - xy: 682, 279 + xy: 219, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium3 rotate: false - xy: 650, 269 + xy: 229, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium1 rotate: false - xy: 660, 269 + xy: 714, 412 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium2 rotate: false - xy: 660, 259 + xy: 724, 412 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium3 rotate: false - xy: 670, 269 + xy: 734, 412 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 water rotate: false - xy: 931, 455 + xy: 828, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 wateredge rotate: false - xy: 113, 19 + xy: 899, 433 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 block-middle rotate: false - xy: 127, 23 + xy: 683, 331 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pump-liquid rotate: false - xy: 127, 23 + xy: 683, 331 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduit-liquid rotate: false - xy: 146, 43 + xy: 691, 321 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 cross-1 rotate: false - xy: 147, 23 + xy: 955, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -594,25 +594,151 @@ cross-3 index: -1 enemyspawn rotate: false - xy: 309, 107 + xy: 985, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 playerspawn rotate: false - xy: 186, 44 + xy: 905, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shadow rotate: false - xy: 233, 111 + xy: 293, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 +battery + rotate: false + xy: 933, 469 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +batterylarge + rotate: false + xy: 806, 487 + size: 24, 24 + orig: 24, 24 + offset: 0, 0 + index: -1 +coalgenerator + rotate: false + xy: 652, 299 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +coalgenerator-top + rotate: false + xy: 662, 299 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +combustiongenerator + rotate: false + xy: 672, 299 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +largesolarpanel + rotate: false + xy: 398, 169 + size: 24, 24 + orig: 24, 24 + offset: 0, 0 + index: -1 +nuclearreactor + rotate: false + xy: 466, 196 + size: 24, 24 + orig: 24, 24 + offset: 0, 0 + index: -1 +nuclearreactor-center + rotate: false + xy: 450, 170 + size: 24, 24 + orig: 24, 24 + offset: 0, 0 + index: -1 +nuclearreactor-lights + rotate: false + xy: 721, 422 + size: 24, 24 + orig: 24, 24 + offset: 0, 0 + index: -1 +powerinfinite + rotate: false + xy: 919, 425 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +powervoid + rotate: false + xy: 935, 435 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +rtgenerator + rotate: false + xy: 975, 435 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +rtgenerator-top + rotate: false + xy: 969, 425 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +shieldgenerator + rotate: false + xy: 166, 44 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +shieldprojector + rotate: false + xy: 817, 427 + size: 16, 16 + orig: 16, 16 + offset: 0, 0 + index: -1 +solarpanel + rotate: false + xy: 179, 24 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +teleporter + rotate: false + xy: 225, 139 + size: 24, 24 + orig: 24, 24 + offset: 0, 0 + index: -1 +thermalgenerator + rotate: false + xy: 199, 14 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 alloysmelter rotate: false xy: 492, 197 @@ -622,35 +748,14 @@ alloysmelter index: -1 coaldrill rotate: false - xy: 622, 296 + xy: 693, 333 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coalextractor rotate: false - xy: 632, 296 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -coalgenerator - rotate: false - xy: 685, 347 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -coalgenerator-top - rotate: false - xy: 685, 337 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -combustiongenerator - rotate: false - xy: 685, 327 + xy: 642, 296 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -683,69 +788,48 @@ cultivator orig: 16, 16 offset: 0, 0 index: -1 +flierfactory + rotate: false + xy: 205, 112 + size: 16, 16 + orig: 16, 16 + offset: 0, 0 + index: -1 fluxpump rotate: false - xy: 319, 113 + xy: 975, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill rotate: false - xy: 369, 103 + xy: 178, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -largesolarpanel - rotate: false - xy: 398, 169 - size: 24, 24 - orig: 24, 24 - offset: 0, 0 - index: -1 laserdrill rotate: false - xy: 206, 94 + xy: 206, 76 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 lavasmelter rotate: false - xy: 640, 266 + xy: 620, 276 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 leaddrill rotate: false - xy: 148, 54 + xy: 640, 276 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -nuclearreactor - rotate: false - xy: 466, 196 - size: 24, 24 - orig: 24, 24 - offset: 0, 0 - index: -1 -nuclearreactor-center - rotate: false - xy: 450, 170 - size: 24, 24 - orig: 24, 24 - offset: 0, 0 - index: -1 -nuclearreactor-lights - rotate: false - xy: 721, 422 - size: 24, 24 - orig: 24, 24 - offset: 0, 0 - index: -1 oilextractor rotate: false xy: 61, 13 @@ -762,196 +846,154 @@ oilextractor-liquid index: -1 oilrefinery rotate: false - xy: 166, 44 + xy: 885, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 omnidrill rotate: false - xy: 176, 44 + xy: 895, 403 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulverizer rotate: false - xy: 167, 24 + xy: 939, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pump rotate: false - xy: 167, 14 + xy: 955, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 quartzextractor rotate: false - xy: 781, 427 + xy: 799, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 -rtgenerator - rotate: false - xy: 187, 14 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -rtgenerator-top - rotate: false - xy: 197, 24 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 siliconextractor rotate: false - xy: 237, 14 + xy: 154, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 smelter rotate: false - xy: 669, 319 + xy: 164, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 smelter-middle rotate: false - xy: 667, 309 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -solarpanel - rotate: false - xy: 131, 3 + xy: 174, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stonedrill rotate: false - xy: 705, 339 + xy: 169, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneformer rotate: false - xy: 705, 329 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -thermalgenerator - rotate: false - xy: 662, 279 + xy: 179, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thoriumdrill rotate: false - xy: 650, 259 + xy: 239, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill rotate: false - xy: 670, 259 + xy: 718, 402 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumextractor rotate: false - xy: 680, 269 + xy: 728, 402 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 uraniumextractor rotate: false - xy: 492, 158 + xy: 788, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 waterextractor rotate: false - xy: 853, 427 + xy: 651, 343 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 waterextractor-liquid rotate: false - xy: 651, 343 + xy: 651, 325 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 -battery - rotate: false - xy: 223, 113 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -batterylarge - rotate: false - xy: 806, 487 - size: 24, 24 - orig: 24, 24 - offset: 0, 0 - index: -1 conduit-bottom rotate: false - xy: 142, 33 + xy: 689, 311 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduit-top rotate: false - xy: 642, 296 + xy: 692, 301 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduittunnel rotate: false - xy: 652, 299 + xy: 699, 311 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyor rotate: false - xy: 695, 347 + xy: 702, 301 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyormove rotate: false - xy: 695, 337 + xy: 945, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyortunnel rotate: false - xy: 695, 327 + xy: 945, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -965,42 +1007,42 @@ core index: -1 junction rotate: false - xy: 630, 266 + xy: 692, 291 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidjunction rotate: false - xy: 158, 54 + xy: 640, 266 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter rotate: false - xy: 168, 54 + xy: 620, 256 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-bottom rotate: false - xy: 178, 54 + xy: 630, 256 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-liquid rotate: false - xy: 188, 54 + xy: 640, 256 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-top rotate: false - xy: 198, 54 + xy: 909, 423 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1028,123 +1070,88 @@ liquidtank-top index: -1 multiplexer rotate: false - xy: 763, 427 + xy: 781, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 poweredconveyor rotate: false - xy: 196, 44 + xy: 700, 371 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 poweredconveyormove rotate: false - xy: 206, 44 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -powerinfinite - rotate: false - xy: 162, 34 + xy: 710, 371 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 powernode rotate: false - xy: 172, 34 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -powervoid - rotate: false - xy: 182, 34 + xy: 925, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-bottom rotate: false - xy: 192, 34 + xy: 929, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-top rotate: false - xy: 202, 34 + xy: 945, 435 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 router rotate: false - xy: 187, 24 + xy: 959, 425 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -shieldgenerator - rotate: false - xy: 217, 14 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -shieldprojector - rotate: false - xy: 799, 427 - size: 16, 16 - orig: 16, 16 - offset: 0, 0 - index: -1 sortedunloader rotate: false - xy: 141, 3 + xy: 189, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sorter rotate: false - xy: 151, 3 + xy: 199, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 splitter rotate: false - xy: 161, 3 + xy: 209, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyor rotate: false - xy: 171, 4 + xy: 219, 24 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyormove rotate: false - xy: 181, 4 + xy: 224, 34 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -teleporter - rotate: false - xy: 225, 139 - size: 24, 24 - orig: 24, 24 - offset: 0, 0 - index: -1 teleporter-top rotate: false xy: 251, 139 @@ -1154,7 +1161,7 @@ teleporter-top index: -1 unloader rotate: false - xy: 492, 168 + xy: 778, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1168,21 +1175,21 @@ vault index: -1 vault-icon rotate: false - xy: 901, 455 + xy: 798, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weaponfactory rotate: false - xy: 651, 325 + xy: 680, 407 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 block-1 rotate: false - xy: 132, 33 + xy: 683, 341 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1224,7 +1231,7 @@ chainturret index: -1 doubleturret rotate: false - xy: 147, 13 + xy: 965, 445 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1259,56 +1266,56 @@ gatlingturret index: -1 laserturret rotate: false - xy: 214, 64 + xy: 257, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 magmaturret rotate: false - xy: 206, 76 + xy: 561, 225 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 megarepairturret rotate: false - xy: 561, 225 + xy: 564, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 missileturret rotate: false - xy: 564, 207 + xy: 763, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 railgunturret rotate: false - xy: 574, 195 + xy: 269, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 repairturret rotate: false - xy: 417, 123 + xy: 281, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 shotgunturret rotate: false - xy: 245, 111 + xy: 305, 115 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 teslaturret rotate: false - xy: 257, 111 + xy: 579, 232 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1322,14 +1329,14 @@ titancannon index: -1 compositewall rotate: false - xy: 137, 23 + xy: 682, 301 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 door rotate: false - xy: 127, 13 + xy: 965, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1350,14 +1357,14 @@ door-large-open index: -1 door-open rotate: false - xy: 137, 13 + xy: 975, 465 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 duriumwall rotate: false - xy: 157, 13 + xy: 975, 455 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1371,49 +1378,49 @@ duriumwall-large index: -1 ironwall rotate: false - xy: 379, 103 + xy: 188, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelwall rotate: false - xy: 191, 4 + xy: 226, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelwall-large rotate: false - xy: 817, 427 + xy: 835, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 stonewall rotate: false - xy: 652, 279 + xy: 189, 14 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumshieldwall rotate: false - xy: 680, 259 + xy: 738, 402 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumwall rotate: false - xy: 650, 249 + xy: 748, 406 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumwall-large rotate: false - xy: 835, 427 + xy: 853, 427 size: 16, 16 orig: 16, 16 offset: 0, 0 @@ -1427,7 +1434,7 @@ blank index: -1 bullet rotate: false - xy: 309, 117 + xy: 681, 321 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1469,161 +1476,161 @@ laserfull index: -1 shell rotate: false - xy: 217, 24 + xy: 156, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot rotate: false - xy: 227, 24 + xy: 196, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot-long rotate: false - xy: 227, 14 + xy: 206, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanshell rotate: false - xy: 660, 249 + xy: 748, 396 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 scout rotate: false - xy: 943, 461 + xy: 335, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 scout-base rotate: false - xy: 957, 461 + xy: 349, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 standard-mech-base rotate: false - xy: 957, 461 + xy: 349, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 scout-leg rotate: false - xy: 971, 461 + xy: 363, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 standard-mech-leg rotate: false - xy: 971, 461 + xy: 363, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 item-biomatter rotate: false - xy: 389, 103 + xy: 198, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-coal rotate: false - xy: 399, 103 + xy: 208, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-densealloy rotate: false - xy: 409, 103 + xy: 218, 54 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-iron rotate: false - xy: 419, 103 + xy: 305, 105 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-lead rotate: false - xy: 622, 286 + xy: 419, 115 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-plastic rotate: false - xy: 632, 286 + xy: 622, 286 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-quartz rotate: false - xy: 642, 286 + xy: 632, 286 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-silicon rotate: false - xy: 652, 289 + xy: 642, 286 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-steel rotate: false - xy: 662, 289 + xy: 652, 289 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-stone rotate: false - xy: 620, 276 + xy: 662, 289 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-thorium rotate: false - xy: 620, 266 + xy: 672, 289 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-titanium rotate: false - xy: 630, 276 + xy: 682, 291 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 standard-mech rotate: false - xy: 999, 462 + xy: 391, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 standard-ship rotate: false - xy: 999, 448 + xy: 405, 121 size: 12, 12 orig: 12, 12 offset: 0, 0 @@ -1771,7 +1778,7 @@ clear index: -1 cursor rotate: false - xy: 113, 13 + xy: 883, 427 size: 4, 4 orig: 4, 4 offset: 0, 0 @@ -1834,7 +1841,7 @@ icon-areaDelete index: -1 icon-arrow rotate: false - xy: 680, 409 + xy: 680, 391 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -1855,49 +1862,49 @@ icon-arrow-left index: -1 icon-arrow-right rotate: false - xy: 1013, 464 + xy: 913, 435 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-arrow-up rotate: false - xy: 1013, 452 + xy: 502, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-back rotate: false - xy: 205, 112 + xy: 401, 151 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-ban rotate: false - xy: 680, 393 + xy: 698, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-cancel rotate: false - xy: 696, 411 + xy: 680, 375 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-chat rotate: false - xy: 1013, 440 + xy: 514, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-check rotate: false - xy: 696, 395 + xy: 572, 274 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -1925,497 +1932,497 @@ icon-close-over index: -1 icon-crafting rotate: false - xy: 502, 195 + xy: 526, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-cursor rotate: false - xy: 514, 195 + xy: 538, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-defense rotate: false - xy: 526, 195 + xy: 550, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-dev-builds rotate: false - xy: 680, 377 + xy: 572, 258 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-discord rotate: false - xy: 696, 379 + xy: 588, 276 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-distribution rotate: false - xy: 538, 195 + xy: 562, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-donate rotate: false - xy: 572, 274 + xy: 588, 260 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-dots rotate: false - xy: 572, 258 + xy: 604, 276 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-editor rotate: false - xy: 588, 276 + xy: 604, 260 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-exit rotate: false - xy: 588, 260 + xy: 763, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-file-text rotate: false - xy: 604, 276 + xy: 779, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-fill rotate: false - xy: 401, 151 + xy: 656, 361 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-floppy rotate: false - xy: 604, 260 + xy: 795, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-folder rotate: false - xy: 763, 411 + xy: 811, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-folder-parent rotate: false - xy: 779, 411 + xy: 827, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-github rotate: false - xy: 795, 411 + xy: 843, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-google-play rotate: false - xy: 811, 411 + xy: 859, 411 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-grid rotate: false - xy: 656, 361 + xy: 118, 47 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-hold rotate: false - xy: 550, 195 + xy: 933, 457 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-holdDelete rotate: false - xy: 562, 195 + xy: 933, 445 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-home rotate: false - xy: 827, 411 + xy: 225, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-host rotate: false - xy: 843, 411 + xy: 241, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-info rotate: false - xy: 321, 123 + xy: 875, 415 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-itch.io rotate: false - xy: 859, 411 + xy: 257, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-line rotate: false - xy: 118, 47 + xy: 476, 178 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-link rotate: false - xy: 674, 361 + xy: 273, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-liquid rotate: false - xy: 333, 123 + xy: 688, 363 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-load rotate: false - xy: 669, 345 + xy: 289, 123 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-load-image rotate: false - xy: 476, 178 + xy: 492, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-load-map rotate: false - xy: 492, 207 + xy: 510, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-loading rotate: false - xy: 510, 207 + xy: 528, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-logic rotate: false - xy: 345, 123 + xy: 669, 321 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-menu rotate: false - xy: 357, 123 + xy: 667, 309 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-menu-large rotate: false - xy: 528, 207 + xy: 546, 207 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-none rotate: false - xy: 369, 123 + xy: 136, 53 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-pause rotate: false - xy: 381, 123 + xy: 154, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-pencil rotate: false - xy: 546, 207 + xy: 867, 453 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-pencil-small rotate: false - xy: 669, 329 + xy: 305, 127 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-pick rotate: false - xy: 867, 453 + xy: 134, 92 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-play rotate: false - xy: 393, 123 + xy: 166, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-play-2 rotate: false - xy: 225, 123 + xy: 651, 309 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-players rotate: false - xy: 405, 123 + xy: 178, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-power rotate: false - xy: 875, 415 + xy: 190, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-production rotate: false - xy: 136, 53 + xy: 202, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-quit rotate: false - xy: 241, 123 + xy: 329, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-redo rotate: false - xy: 134, 92 + xy: 134, 74 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-refresh rotate: false - xy: 257, 123 + xy: 345, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rename rotate: false - xy: 273, 123 + xy: 361, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-resize rotate: false - xy: 134, 74 + xy: 152, 94 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-rotate rotate: false - xy: 289, 123 + xy: 377, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-arrow rotate: false - xy: 305, 127 + xy: 393, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-left rotate: false - xy: 651, 309 + xy: 409, 135 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-rotate-right rotate: false - xy: 329, 135 + xy: 476, 162 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-save rotate: false - xy: 345, 135 + xy: 885, 463 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-save-image rotate: false - xy: 152, 94 + xy: 152, 76 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-save-map rotate: false - xy: 152, 76 + xy: 170, 94 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-settings rotate: false - xy: 154, 64 + xy: 214, 64 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-terrain rotate: false - xy: 170, 94 + xy: 170, 76 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-tools rotate: false - xy: 361, 135 + xy: 901, 463 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-touch rotate: false - xy: 166, 64 + xy: 574, 195 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-touchDelete rotate: false - xy: 178, 64 + xy: 127, 19 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-trash rotate: false - xy: 377, 135 + xy: 917, 463 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-trash-16 rotate: false - xy: 170, 76 + xy: 188, 94 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-trello rotate: false - xy: 393, 135 + xy: 885, 447 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-tutorial rotate: false - xy: 409, 135 + xy: 901, 447 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-undo rotate: false - xy: 188, 94 + xy: 188, 76 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-units rotate: false - xy: 190, 64 + xy: 233, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-weapon rotate: false - xy: 202, 64 + xy: 245, 111 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-wiki rotate: false - xy: 476, 162 + xy: 917, 447 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-zoom rotate: false - xy: 188, 76 + xy: 206, 94 size: 16, 16 orig: 16, 16 offset: 0, 0 index: -1 icon-zoom-small rotate: false - xy: 885, 463 + xy: 118, 31 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -2521,7 +2528,7 @@ slider-knob-over index: -1 slider-vertical rotate: false - xy: 171, 1 + xy: 1, 5 size: 8, 1 orig: 8, 1 offset: 0, 0 @@ -2588,84 +2595,84 @@ window-empty index: -1 beam rotate: false - xy: 269, 113 + xy: 223, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 beam-equip rotate: false - xy: 279, 113 + xy: 627, 306 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blaster rotate: false - xy: 690, 357 + xy: 459, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blaster-equip rotate: false - xy: 700, 359 + xy: 683, 351 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 clustergun rotate: false - xy: 419, 159 + xy: 679, 311 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 clustergun-equip rotate: false - xy: 429, 160 + xy: 622, 296 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun rotate: false - xy: 222, 34 + xy: 176, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun-equip rotate: false - xy: 226, 44 + xy: 186, 44 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster rotate: false - xy: 670, 249 + xy: 758, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster-equip rotate: false - xy: 680, 249 + xy: 768, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan rotate: false - xy: 911, 455 + xy: 808, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan-equip rotate: false - xy: 921, 455 + xy: 818, 401 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index d5f0fc323c..5e4df7279e 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 1f05cc61e5..cc4c588535 100644 --- a/core/assets/version.properties +++ b/core/assets/version.properties @@ -1,7 +1,7 @@ #Autogenerated file. Do not modify. -#Sun Mar 25 00:43:28 EDT 2018 +#Sun Mar 25 13:11:36 EDT 2018 version=release -androidBuildCode=638 +androidBuildCode=641 name=Mindustry code=3.4 build=custom build diff --git a/core/src/io/anuke/mindustry/Mindustry.java b/core/src/io/anuke/mindustry/Mindustry.java index 1bc490e7d4..a8cee068a2 100644 --- a/core/src/io/anuke/mindustry/Mindustry.java +++ b/core/src/io/anuke/mindustry/Mindustry.java @@ -1,7 +1,7 @@ package io.anuke.mindustry; import io.anuke.mindustry.core.*; -import io.anuke.mindustry.io.BlockLoader; +import io.anuke.mindustry.core.ContentLoader; import io.anuke.mindustry.io.BundleLoader; import io.anuke.mindustry.io.Platform; import io.anuke.ucore.modules.ModuleCore; @@ -17,7 +17,7 @@ public class Mindustry extends ModuleCore { Log.setUseColors(false); BundleLoader.load(); - BlockLoader.load(); + ContentLoader.load(); module(logic = new Logic()); module(world = new World()); diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index 5923ebe6f0..ce09c4d6e3 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -122,7 +122,7 @@ public class Vars{ public static final int port = 6567; public static final int webPort = 6568; - public static final GameState state = new GameState(); + public static GameState state; public static final ThreadHandler threads = new ThreadHandler(Platform.instance.getThreadProvider()); public static final ServerDebug serverDebug = new ServerDebug(); diff --git a/core/src/io/anuke/mindustry/content/Items.java b/core/src/io/anuke/mindustry/content/Items.java new file mode 100644 index 0000000000..c1b4e5807d --- /dev/null +++ b/core/src/io/anuke/mindustry/content/Items.java @@ -0,0 +1,39 @@ +package io.anuke.mindustry.content; + +import io.anuke.mindustry.resource.Item; + +public class Items { + public static final Item + + stone = new Item("stone") { + { + material = false; + } + }, + iron = new Item("iron"), + lead = new Item("lead"), + coal = new Item("coal") { + { + explosiveness = 0.2f; + flammability = 0.5f; + fluxiness = 0.5f; + material = false; + } + }, + steel = new Item("steel"), + titanium = new Item("titanium"), + thorium = new Item("thorium") { + { + explosiveness = 0.1f; + } + }, + silicon = new Item("silicon"), + plastic = new Item("plastic"), + densealloy = new Item("densealloy"), + biomatter = new Item("biomatter") { + { + material = false; + flammability = 0.4f; + } + }; +} diff --git a/core/src/io/anuke/mindustry/content/Liquids.java b/core/src/io/anuke/mindustry/content/Liquids.java new file mode 100644 index 0000000000..0285830043 --- /dev/null +++ b/core/src/io/anuke/mindustry/content/Liquids.java @@ -0,0 +1,49 @@ +package io.anuke.mindustry.content; + +import com.badlogic.gdx.graphics.Color; +import io.anuke.mindustry.resource.Liquid; + +public class Liquids { + + public static final Liquid + + none = new Liquid("none", Color.CLEAR), + water = new Liquid("water", Color.ROYAL) { + { + heatCapacity = 0.4f; + } + }, + plasma = new Liquid("plasma", Color.CORAL) { + { + flammability = 0.4f; + viscosity = 0.1f; + heatCapacity = 0.2f; + } + }, + lava = new Liquid("lava", Color.valueOf("e37341")) { + { + temperature = 0.7f; + viscosity = 0.8f; + } + }, + oil = new Liquid("oil", Color.valueOf("292929")) { + { + viscosity = 0.7f; + flammability = 0.6f; + explosiveness = 0.6f; + } + }, + cryofluid = new Liquid("cryofluid", Color.SKY) { + { + heatCapacity = 0.75f; + temperature = 0.5f; + } + }, + sulfuricAcid = new Liquid("sulfuricAcid", Color.YELLOW) { + { + flammability = 0.4f; + explosiveness = 0.4f; + heatCapacity = 0.4f; + } + }; +} diff --git a/core/src/io/anuke/mindustry/content/Mechs.java b/core/src/io/anuke/mindustry/content/Mechs.java new file mode 100644 index 0000000000..8653a6e0d1 --- /dev/null +++ b/core/src/io/anuke/mindustry/content/Mechs.java @@ -0,0 +1,10 @@ +package io.anuke.mindustry.content; + +import io.anuke.mindustry.resource.Mech; + +public class Mechs { + public static final Mech + + standard = new Mech("standard-mech", false), + standardShip = new Mech("standard-ship", true); +} diff --git a/core/src/io/anuke/mindustry/content/Recipes.java b/core/src/io/anuke/mindustry/content/Recipes.java new file mode 100644 index 0000000000..a30d40748d --- /dev/null +++ b/core/src/io/anuke/mindustry/content/Recipes.java @@ -0,0 +1,139 @@ +package io.anuke.mindustry.content; + +import com.badlogic.gdx.utils.Array; +import io.anuke.mindustry.Vars; +import io.anuke.mindustry.content.blocks.*; +import io.anuke.mindustry.resource.Item; +import io.anuke.mindustry.resource.ItemStack; +import io.anuke.mindustry.resource.Recipe; +import io.anuke.mindustry.resource.Section; +import io.anuke.mindustry.world.Block; + +import static io.anuke.mindustry.Vars.debug; +import static io.anuke.mindustry.resource.Section.*; + +public class Recipes { + private static final Array list = Array.with( + //new Recipe(defense, DefenseBlocks.stonewall, stack(Item.stone, 12)), + new Recipe(defense, DefenseBlocks.ironwall, stack(Items.iron, 12)), + new Recipe(defense, DefenseBlocks.steelwall, stack(Items.steel, 12)), + new Recipe(defense, DefenseBlocks.titaniumwall, stack(Items.titanium, 12)), + new Recipe(defense, DefenseBlocks.diriumwall, stack(Items.densealloy, 12)), + new Recipe(defense, DefenseBlocks.steelwalllarge, stack(Items.steel, 12*4)), + new Recipe(defense, DefenseBlocks.titaniumwalllarge, stack(Items.titanium, 12*4)), + new Recipe(defense, DefenseBlocks.diriumwall, stack(Items.densealloy, 12*4)), + new Recipe(defense, DefenseBlocks.door, stack(Items.steel, 3), stack(Items.iron, 3*4)).setDesktop(), + new Recipe(defense, DefenseBlocks.largedoor, stack(Items.steel, 3*4), stack(Items.iron, 3*4*4)).setDesktop(), + new Recipe(defense, DefenseBlocks.titaniumshieldwall, stack(Items.titanium, 16)), + + new Recipe(distribution, DistributionBlocks.conveyor, stack(Items.iron, 1)), + new Recipe(distribution, DistributionBlocks.steelconveyor, stack(Items.steel, 1)), + new Recipe(distribution, DistributionBlocks.pulseconveyor, stack(Items.densealloy, 1)), + new Recipe(distribution, DistributionBlocks.router, stack(Items.iron, 2)), + new Recipe(distribution, DistributionBlocks.multiplexer, stack(Items.iron, 8)), + new Recipe(distribution, DistributionBlocks.junction, stack(Items.iron, 2)), + new Recipe(distribution, DistributionBlocks.tunnel, stack(Items.iron, 2)), + new Recipe(distribution, DistributionBlocks.sorter, stack(Items.steel, 2)), + new Recipe(distribution, DistributionBlocks.splitter, stack(Items.steel, 1)), + new Recipe(distribution, StorageBlocks.vault, stack(Items.steel, 50)), + new Recipe(distribution, StorageBlocks.core, stack(Items.steel, 50)), + new Recipe(distribution, StorageBlocks.unloader, stack(Items.steel, 5)), + new Recipe(distribution, StorageBlocks.sortedunloader, stack(Items.steel, 5)), + + new Recipe(weapon, WeaponBlocks.doubleturret, stack(Items.iron, 7)), + new Recipe(weapon, WeaponBlocks.gatlingturret, stack(Items.iron, 8)), + new Recipe(weapon, WeaponBlocks.flameturret, stack(Items.iron, 12), stack(Items.steel, 9)), + new Recipe(weapon, WeaponBlocks.railgunturret, stack(Items.iron, 15), stack(Items.steel, 10)), + new Recipe(weapon, WeaponBlocks.laserturret, stack(Items.steel, 12), stack(Items.titanium, 12)), + new Recipe(weapon, WeaponBlocks.flakturret, stack(Items.steel, 25), stack(Items.titanium, 15)), + new Recipe(weapon, WeaponBlocks.teslaturret, stack(Items.steel, 20), stack(Items.titanium, 25), stack(Items.densealloy, 15)), + new Recipe(weapon, WeaponBlocks.magmaturret, stack(Items.steel, 80), stack(Items.titanium, 70), stack(Items.densealloy, 60)), + new Recipe(weapon, WeaponBlocks.chainturret, stack(Items.steel, 50), stack(Items.titanium, 25), stack(Items.densealloy, 40)), + new Recipe(weapon, WeaponBlocks.titanturret, stack(Items.steel, 70), stack(Items.titanium, 50), stack(Items.densealloy, 55)), + new Recipe(weapon, WeaponBlocks.missileturret, stack(Items.steel, 70), stack(Items.titanium, 50), stack(Items.densealloy, 55)), + new Recipe(weapon, WeaponBlocks.fornaxcannon, stack(Items.steel, 70), stack(Items.titanium, 50), stack(Items.densealloy, 55)), + + new Recipe(crafting, ProductionBlocks.smelter, stack(Items.iron, 40)), + new Recipe(crafting, ProductionBlocks.alloysmelter, stack(Items.titanium, 50), stack(Items.steel, 50)), + new Recipe(crafting, ProductionBlocks.coalextractor, stack(Items.steel, 10), stack(Items.iron, 10)), + new Recipe(crafting, ProductionBlocks.titaniumextractor, stack(Items.steel, 30), stack(Items.iron, 30)), + new Recipe(crafting, ProductionBlocks.oilrefinery, stack(Items.steel, 15), stack(Items.iron, 15)), + new Recipe(crafting, ProductionBlocks.stoneformer, stack(Items.steel, 10), stack(Items.iron, 10)), + new Recipe(crafting, ProductionBlocks.lavasmelter, stack(Items.steel, 30), stack(Items.titanium, 15)), + new Recipe(crafting, ProductionBlocks.siliconextractor, stack(Items.steel, 30), stack(Items.titanium, 15)), + new Recipe(crafting, ProductionBlocks.cryofluidmixer, stack(Items.steel, 30), stack(Items.titanium, 15)), + new Recipe(crafting, ProductionBlocks.weaponFactory, stack(Items.steel, 60), stack(Items.iron, 60)).setDesktop(), + //new Recipe(crafting, ProductionBlocks.centrifuge, stack(Item.steel, 30), stack(Item.iron, 30)), + + //new Recipe(production, ProductionBlocks.stonedrill, stack(Item.stone, 12)), + new Recipe(production, ProductionBlocks.irondrill, stack(Items.iron, 25)), + new Recipe(production, ProductionBlocks.leaddrill, stack(Items.iron, 25)), + new Recipe(production, ProductionBlocks.coaldrill, stack(Items.iron, 25), stack(Items.iron, 40)), + new Recipe(production, ProductionBlocks.titaniumdrill, stack(Items.iron, 50), stack(Items.steel, 50)), + new Recipe(production, ProductionBlocks.thoriumdrill, stack(Items.iron, 40), stack(Items.steel, 40)), + new Recipe(production, ProductionBlocks.quartzextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)), + new Recipe(production, ProductionBlocks.cultivator, stack(Items.titanium, 40), stack(Items.densealloy, 40)), + new Recipe(production, ProductionBlocks.laserdrill, stack(Items.titanium, 40), stack(Items.densealloy, 40)), + new Recipe(production, ProductionBlocks.waterextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)), + new Recipe(production, ProductionBlocks.oilextractor, stack(Items.titanium, 40), stack(Items.densealloy, 40)), + + new Recipe(power, PowerBlocks.coalgenerator, stack(Items.iron, 30)), + new Recipe(power, PowerBlocks.thermalgenerator, stack(Items.steel, 30)), + new Recipe(power, PowerBlocks.combustiongenerator, stack(Items.iron, 30)), + new Recipe(power, PowerBlocks.solarpanel, stack(Items.iron, 30), stack(Items.silicon, 20)), + new Recipe(power, PowerBlocks.largesolarpanel, stack(Items.iron, 30), stack(Items.silicon, 20)), + new Recipe(power, PowerBlocks.rtgenerator, stack(Items.titanium, 20), stack(Items.steel, 20)), + new Recipe(power, PowerBlocks.nuclearReactor, stack(Items.titanium, 40), stack(Items.densealloy, 40), stack(Items.steel, 50)), + new Recipe(power, PowerBlocks.powernode, stack(Items.steel, 3), stack(Items.iron, 3)), + new Recipe(power, PowerBlocks.battery, stack(Items.steel, 5), stack(Items.iron, 5)), + new Recipe(power, PowerBlocks.batteryLarge, stack(Items.steel, 5), stack(Items.iron, 5)), + + new Recipe(power, PowerBlocks.shieldgenerator, stack(Items.titanium, 30), stack(Items.densealloy, 30)), + + new Recipe(distribution, PowerBlocks.teleporter, stack(Items.steel, 30), stack(Items.densealloy, 40)), + + new Recipe(power, PowerBlocks.repairturret, stack(Items.iron, 30)), + new Recipe(power, PowerBlocks.megarepairturret, stack(Items.iron, 20), stack(Items.steel, 30)), + + new Recipe(liquid, LiquidBlocks.conduit, stack(Items.steel, 1)), + new Recipe(liquid, LiquidBlocks.pulseconduit, stack(Items.titanium, 1), stack(Items.steel, 1)), + new Recipe(liquid, LiquidBlocks.liquidrouter, stack(Items.steel, 2)), + new Recipe(liquid, LiquidBlocks.liquidtank, stack(Items.steel, 2)), + new Recipe(liquid, LiquidBlocks.liquidjunction, stack(Items.steel, 2)), + new Recipe(liquid, LiquidBlocks.conduittunnel, stack(Items.titanium, 2), stack(Items.steel, 2)), + + new Recipe(liquid, LiquidBlocks.pump, stack(Items.steel, 10)), + new Recipe(liquid, LiquidBlocks.fluxpump, stack(Items.steel, 10), stack(Items.densealloy, 5)), + + new Recipe(units, UnitBlocks.flierFactory, stack(Items.steel, 10)), + new Recipe(units, DebugBlocks.powerVoid, stack(Items.steel, 10)).setDebug(), + new Recipe(units, DebugBlocks.powerInfinite, stack(Items.steel, 10), stack(Items.densealloy, 5)).setDebug() + ); + + private static ItemStack stack(Item item, int amount){ + return new ItemStack(item, amount); + } + + public static Array all(){ + return list; + } + + public static Recipe getByResult(Block block){ + for(Recipe recipe : list){ + if(recipe.result == block){ + return recipe; + } + } + return null; + } + + public static Array getBy(Section section, Array r){ + for(Recipe recipe : list){ + if(recipe.section == section && !(Vars.android && recipe.desktopOnly) && !(!debug && recipe.debugOnly)) { + r.add(recipe); + } + } + + return r; + } +} diff --git a/core/src/io/anuke/mindustry/content/UnitTypes.java b/core/src/io/anuke/mindustry/content/UnitTypes.java new file mode 100644 index 0000000000..3305245e10 --- /dev/null +++ b/core/src/io/anuke/mindustry/content/UnitTypes.java @@ -0,0 +1,12 @@ +package io.anuke.mindustry.content; + +import io.anuke.mindustry.entities.units.UnitType; +import io.anuke.mindustry.entities.units.types.Flier; +import io.anuke.mindustry.entities.units.types.Scout; + +public class UnitTypes { + public static final UnitType + + scout = new Scout(), + flier = new Flier(); +} diff --git a/core/src/io/anuke/mindustry/resource/UpgradeRecipes.java b/core/src/io/anuke/mindustry/content/UpgradeRecipes.java similarity index 50% rename from core/src/io/anuke/mindustry/resource/UpgradeRecipes.java rename to core/src/io/anuke/mindustry/content/UpgradeRecipes.java index 7be2113018..92c5fb270e 100644 --- a/core/src/io/anuke/mindustry/resource/UpgradeRecipes.java +++ b/core/src/io/anuke/mindustry/content/UpgradeRecipes.java @@ -1,16 +1,19 @@ -package io.anuke.mindustry.resource; +package io.anuke.mindustry.content; import com.badlogic.gdx.utils.ObjectMap; import com.badlogic.gdx.utils.ObjectMap.Entries; +import io.anuke.mindustry.resource.Item; +import io.anuke.mindustry.resource.ItemStack; +import io.anuke.mindustry.resource.Upgrade; import io.anuke.ucore.util.Mathf; public class UpgradeRecipes { private static final ObjectMap recipes = Mathf.map( - Weapon.triblaster, list(stack(Item.iron, 60), stack(Item.steel, 80)), - Weapon.clustergun, list(stack(Item.iron, 300), stack(Item.steel, 80)), - Weapon.vulcan, list(stack(Item.iron, 100), stack(Item.steel, 150), stack(Item.titanium, 80)), - Weapon.beam, list(stack(Item.steel, 260), stack(Item.titanium, 160), stack(Item.densealloy, 120)), - Weapon.shockgun, list(stack(Item.steel, 240), stack(Item.titanium, 160), stack(Item.densealloy, 160)) + Weapons.triblaster, list(stack(Items.iron, 60), stack(Items.steel, 80)), + Weapons.clustergun, list(stack(Items.iron, 300), stack(Items.steel, 80)), + Weapons.vulcan, list(stack(Items.iron, 100), stack(Items.steel, 150), stack(Items.titanium, 80)), + Weapons.beam, list(stack(Items.steel, 260), stack(Items.titanium, 160), stack(Items.densealloy, 120)), + Weapons.shockgun, list(stack(Items.steel, 240), stack(Items.titanium, 160), stack(Items.densealloy, 160)) ); private static final ItemStack[] empty = {}; diff --git a/core/src/io/anuke/mindustry/content/Weapons.java b/core/src/io/anuke/mindustry/content/Weapons.java new file mode 100644 index 0000000000..52a8462fdf --- /dev/null +++ b/core/src/io/anuke/mindustry/content/Weapons.java @@ -0,0 +1,60 @@ +package io.anuke.mindustry.content; + +import io.anuke.mindustry.entities.BulletType; +import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.resource.Weapon; + +public class Weapons { + public static final Weapon + + blaster = new Weapon("blaster", 12, BulletType.shot) { + { + effect = Fx.laserShoot; + length = 2f; + } + }, + triblaster = new Weapon("triblaster", 16, BulletType.spread) { + { + shots = 3; + effect = Fx.spreadShoot; + roundrobin = true; + } + }, + clustergun = new Weapon("clustergun", 26f, BulletType.cluster) { + { + effect = Fx.clusterShoot; + inaccuracy = 17f; + roundrobin = true; + shots = 2; + spacing = 0; + } + }, + beam = new Weapon("beam", 30f, BulletType.beamlaser) { + { + effect = Fx.beamShoot; + inaccuracy = 0; + roundrobin = true; + shake = 2f; + } + }, + vulcan = new Weapon("vulcan", 5, BulletType.vulcan) { + { + effect = Fx.vulcanShoot; + inaccuracy = 5; + roundrobin = true; + shake = 1f; + inaccuracy = 4f; + } + }, + shockgun = new Weapon("shockgun", 36, BulletType.shockshell) { + { + shootsound = "bigshot"; + effect = Fx.shockShoot; + shake = 2f; + roundrobin = true; + shots = 7; + inaccuracy = 15f; + length = 3.5f; + } + }; +} diff --git a/core/src/io/anuke/mindustry/content/blocks/Blocks.java b/core/src/io/anuke/mindustry/content/blocks/Blocks.java new file mode 100644 index 0000000000..213e4a40b7 --- /dev/null +++ b/core/src/io/anuke/mindustry/content/blocks/Blocks.java @@ -0,0 +1,153 @@ +package io.anuke.mindustry.content.blocks; + +import io.anuke.mindustry.content.Items; +import io.anuke.mindustry.content.Liquids; +import io.anuke.mindustry.graphics.DrawLayer; +import io.anuke.mindustry.resource.ItemStack; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.blocks.types.*; + +public class Blocks { + public static final Block + + air = new Block("air") { + //don't draw + public void draw(Tile tile) {} + }, + + //player/enemy spawnpoint? + spawn = new Block("spawn"), + + blockpart = new BlockPart(), + + deepwater = new Floor("deepwater") {{ + variants = 0; + solid = true; + liquidDrop = Liquids.water; + liquid = true; + drawLayer = DrawLayer.water; + }}, + + water = new Floor("water") {{ + variants = 0; + solid = true; + liquidDrop = Liquids.water; + liquid = true; + drawLayer = DrawLayer.water; + }}, + + lava = new Floor("lava") {{ + variants = 0; + solid = true; + liquidDrop = Liquids.lava; + liquid = true; + drawLayer = DrawLayer.lava; + }}, + + oil = new Floor("oil") {{ + variants = 0; + solid = true; + liquidDrop = Liquids.oil; + liquid = true; + drawLayer = DrawLayer.oil; + }}, + + stone = new Floor("stone") {{ + drops = new ItemStack(Items.stone, 1); + blends = block -> block != this && !(block instanceof Ore); + }}, + + blackstone = new Floor("blackstone") {{ + drops = new ItemStack(Items.stone, 1); + }}, + + iron = new Ore("iron") {{ + drops = new ItemStack(Items.iron, 1); + }}, + + lead = new Ore("lead") {{ + drops = new ItemStack(Items.lead, 1); + }}, + + coal = new Ore("coal") {{ + drops = new ItemStack(Items.coal, 1); + }}, + + titanium = new Ore("titanium") {{ + drops = new ItemStack(Items.titanium, 1); + }}, + + thorium = new Ore("thorium") {{ + drops = new ItemStack(Items.thorium, 1); + }}, + + dirt = new Floor("dirt") { + }, + + sand = new Floor("sand") {{ + drops = new ItemStack(Items.silicon, 1); + }}, + + ice = new Floor("ice") { + }, + + snow = new Floor("snow") { + }, + + grass = new Floor("grass") { + }, + + sandblock = new StaticBlock("sandblock") {{ + solid = true; + variants = 3; + }}, + + snowblock = new StaticBlock("snowblock") {{ + solid = true; + variants = 3; + }}, + + stoneblock = new StaticBlock("stoneblock") {{ + solid = true; + variants = 3; + }}, + + blackstoneblock = new StaticBlock("blackstoneblock") {{ + solid = true; + variants = 3; + }}, + + grassblock = new StaticBlock("grassblock") {{ + solid = true; + variants = 2; + }}, + + mossblock = new StaticBlock("mossblock") {{ + solid = true; + }}, + + shrub = new Rock("shrub"), + + rock = new Rock("rock") {{ + variants = 2; + varyShadow = true; + drops = new ItemStack(Items.stone, 3); + }}, + + icerock = new Rock("icerock") {{ + variants = 2; + varyShadow = true; + drops = new ItemStack(Items.stone, 3); + }}, + + blackrock = new Rock("blackrock") {{ + variants = 1; + varyShadow = true; + drops = new ItemStack(Items.stone, 3); + }}, + + dirtblock = new StaticBlock("dirtblock") {{ + solid = true; + }}; +} diff --git a/core/src/io/anuke/mindustry/world/blocks/DebugBlocks.java b/core/src/io/anuke/mindustry/content/blocks/DebugBlocks.java similarity index 93% rename from core/src/io/anuke/mindustry/world/blocks/DebugBlocks.java rename to core/src/io/anuke/mindustry/content/blocks/DebugBlocks.java index 861086758e..3ad47e6071 100644 --- a/core/src/io/anuke/mindustry/world/blocks/DebugBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/DebugBlocks.java @@ -1,4 +1,4 @@ -package io.anuke.mindustry.world.blocks; +package io.anuke.mindustry.content.blocks; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; diff --git a/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java b/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java new file mode 100644 index 0000000000..863c9ee7fa --- /dev/null +++ b/core/src/io/anuke/mindustry/content/blocks/DefenseBlocks.java @@ -0,0 +1,66 @@ +package io.anuke.mindustry.content.blocks; + +import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.blocks.types.Wall; +import io.anuke.mindustry.world.blocks.types.defense.*; + +public class DefenseBlocks { + static final int wallHealthMultiplier = 4; + + public static final Block + + stonewall = new Wall("stonewall") {{ + health = 40 * wallHealthMultiplier; + }}, + + ironwall = new Wall("ironwall") {{ + health = 80 * wallHealthMultiplier; + }}, + + steelwall = new Wall("steelwall") {{ + health = 110 * wallHealthMultiplier; + }}, + + titaniumwall = new Wall("titaniumwall") {{ + health = 150 * wallHealthMultiplier; + }}, + + diriumwall = new Wall("duriumwall") {{ + health = 190 * wallHealthMultiplier; + }}, + + compositewall = new Wall("compositewall") {{ + health = 270 * wallHealthMultiplier; + }}, + + steelwalllarge = new Wall("steelwall-large") {{ + health = 110 * 4 * wallHealthMultiplier; + size = 2; + }}, + + titaniumwalllarge = new Wall("titaniumwall-large") {{ + health = 150 * 4 * wallHealthMultiplier; + size = 2; + }}, + + diriumwalllarge = new Wall("duriumwall-large") {{ + health = 190 * 4 * wallHealthMultiplier; + size = 2; + }}, + + titaniumshieldwall = new ShieldedWallBlock("titaniumshieldwall") {{ + health = 150 * wallHealthMultiplier; + }}, + + door = new Door("door") {{ + health = 90 * wallHealthMultiplier; + }}, + + largedoor = new Door("door-large") {{ + openfx = Fx.dooropenlarge; + closefx = Fx.doorcloselarge; + health = 90 * 4 * wallHealthMultiplier; + size = 2; + }}; +} diff --git a/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java b/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java new file mode 100644 index 0000000000..5c9a7074d3 --- /dev/null +++ b/core/src/io/anuke/mindustry/content/blocks/DistributionBlocks.java @@ -0,0 +1,44 @@ +package io.anuke.mindustry.content.blocks; + +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.blocks.types.distribution.*; + +public class DistributionBlocks{ + + public static final Block + + conveyor = new Conveyor("conveyor"){{ + health = 40; + speed = 0.02f; + }}, + + steelconveyor = new Conveyor("steelconveyor"){{ + health = 55; + speed = 0.04f; + }}, + + pulseconveyor = new Conveyor("poweredconveyor"){{ + health = 75; + speed = 0.09f; + }}, + + router = new Router("router"), + + multiplexer = new Router("multiplexer"){{ + size = 2; + itemCapacity = 80; + }}, + + junction = new Junction("junction"){{ + speed = 26; + capacity = 32; + }}, + + tunnel = new TunnelConveyor("conveyortunnel"){{ + speed = 53; + }}, + + sorter = new Sorter("sorter"), + + splitter = new Splitter("splitter"); +} diff --git a/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java b/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java new file mode 100644 index 0000000000..9ec0bdb7b7 --- /dev/null +++ b/core/src/io/anuke/mindustry/content/blocks/LiquidBlocks.java @@ -0,0 +1,45 @@ +package io.anuke.mindustry.content.blocks; + +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.blocks.types.distribution.Conduit; +import io.anuke.mindustry.world.blocks.types.distribution.LiquidJunction; +import io.anuke.mindustry.world.blocks.types.distribution.LiquidRouter; +import io.anuke.mindustry.world.blocks.types.distribution.TunnelConduit; +import io.anuke.mindustry.world.blocks.types.production.Pump; + +public class LiquidBlocks { + public static final Block + + pump = new Pump("pump") {{ + pumpAmount = 0.8f; + }}, + + fluxpump = new Pump("fluxpump") {{ + pumpAmount = 1.2f; + }}, + + conduit = new Conduit("conduit") {{ + health = 45; + }}, + + pulseconduit = new Conduit("pulseconduit") {{ + liquidCapacity = 16f; + liquidFlowFactor = 4.9f; + health = 65; + }}, + + liquidrouter = new LiquidRouter("liquidrouter") {{ + liquidCapacity = 40f; + }}, + + liquidtank = new LiquidRouter("liquidtank") {{ + size = 3; + liquidCapacity = 1500f; + }}, + + liquidjunction = new LiquidJunction("liquidjunction"), + + conduittunnel = new TunnelConduit("conduittunnel") {{ + speed = 53; + }}; +} diff --git a/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java b/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java new file mode 100644 index 0000000000..ccef03df3b --- /dev/null +++ b/core/src/io/anuke/mindustry/content/blocks/PowerBlocks.java @@ -0,0 +1,89 @@ +package io.anuke.mindustry.content.blocks; + +import io.anuke.mindustry.content.Items; +import io.anuke.mindustry.content.Liquids; +import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.blocks.types.defense.RepairTurret; +import io.anuke.mindustry.world.blocks.types.defense.ShieldBlock; +import io.anuke.mindustry.world.blocks.types.distribution.Teleporter; +import io.anuke.mindustry.world.blocks.types.generation.*; + +public class PowerBlocks { + public static final Block + + coalgenerator = new ItemPowerGenerator("coalgenerator") {{ + generateItem = Items.coal; + powerOutput = 0.04f; + powerCapacity = 40f; + }}, + + thermalgenerator = new LiquidPowerGenerator("thermalgenerator") {{ + generateLiquid = Liquids.lava; + maxLiquidGenerate = 0.5f; + powerPerLiquid = 0.08f; + powerCapacity = 40f; + generateEffect = Fx.redgeneratespark; + }}, + + combustiongenerator = new LiquidPowerGenerator("combustiongenerator") {{ + generateLiquid = Liquids.oil; + maxLiquidGenerate = 0.4f; + powerPerLiquid = 0.12f; + powerCapacity = 40f; + }}, + + rtgenerator = new ItemPowerGenerator("rtgenerator") {{ + generateItem = Items.thorium; + powerCapacity = 40f; + powerOutput = 0.03f; + itemDuration = 240f; + }}, + + solarpanel = new SolarGenerator("solarpanel") {{ + generation = 0.003f; + }}, + + largesolarpanel = new SolarGenerator("largesolarpanel") {{ + size = 3; + generation = 0.012f; + }}, + + nuclearReactor = new NuclearReactor("nuclearreactor") {{ + size = 3; + health = 600; + breaktime *= 2.3f; + }}, + + repairturret = new RepairTurret("repairturret") {{ + range = 30; + reload = 20f; + health = 60; + powerUsed = 0.08f; + }}, + + megarepairturret = new RepairTurret("megarepairturret") {{ + range = 44; + reload = 12f; + health = 90; + powerUsed = 0.13f; + size = 2; + }}, + + shieldgenerator = new ShieldBlock("shieldgenerator") {{ + health = 400; + }}, + + battery = new PowerGenerator("battery") {{ + powerCapacity = 320f; + }}, + + batteryLarge = new PowerGenerator("batterylarge") {{ + size = 3; + powerCapacity = 2000f; + }}, + + powernode = new PowerDistributor("powernode"), + + teleporter = new Teleporter("teleporter"); +} diff --git a/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java new file mode 100644 index 0000000000..6b6d372133 --- /dev/null +++ b/core/src/io/anuke/mindustry/content/blocks/ProductionBlocks.java @@ -0,0 +1,215 @@ +package io.anuke.mindustry.content.blocks; + +import io.anuke.mindustry.content.Items; +import io.anuke.mindustry.content.Liquids; +import io.anuke.mindustry.graphics.Fx; +import io.anuke.mindustry.resource.Item; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.blocks.types.production.*; + +public class ProductionBlocks { + public static final Block + + smelter = new Smelter("smelter") {{ + health = 70; + inputs = new Item[]{Items.iron}; + fuel = Items.coal; + result = Items.steel; + craftTime = 25f; + }}, + + alloysmelter = new Smelter("alloysmelter") {{ + health = 90; + inputs = new Item[]{Items.titanium, Items.steel}; + fuel = Items.coal; + result = Items.densealloy; + burnDuration = 45f; + craftTime = 25f; + }}, + + powersmelter = new PowerSmelter("powersmelter") {{ + /* + health = 90; + inputs = new Item[]{Item.titanium, Item.steel}; + fuel = Item.coal; + results = Item.dirium; + burnDuration = 45f; + craftTime = 25f; + size = 2;*/ + }}, + + cryofluidmixer = new LiquidMixer("cryofluidmixer") {{ + health = 200; + inputLiquid = Liquids.water; + outputLiquid = Liquids.cryofluid; + inputItem = Items.titanium; + liquidPerItem = 50f; + itemCapacity = 50; + powerUse = 0.1f; + size = 2; + }}, + + coalextractor = new LiquidCrafter("coalextractor") {{ + input = Items.stone; + inputAmount = 6; + inputLiquid = Liquids.water; + liquidAmount = 19f; + output = Items.coal; + health = 50; + purifyTime = 50; + health = 60; + }}, + + titaniumextractor = new LiquidCrafter("titaniumextractor") {{ + input = Items.stone; + inputAmount = 8; + inputLiquid = Liquids.water; + liquidAmount = 40f; + liquidCapacity = 41f; + purifyTime = 60; + output = Items.titanium; + health = 70; + }}, + + oilrefinery = new LiquidCrafter("oilrefinery") {{ + inputLiquid = Liquids.oil; + liquidAmount = 55f; + liquidCapacity = 56f; + purifyTime = 65; + output = Items.coal; + health = 80; + craftEffect = Fx.purifyoil; + }}, + + stoneformer = new LiquidCrafter("stoneformer") {{ + input = null; + inputLiquid = Liquids.lava; + liquidAmount = 16f; + liquidCapacity = 21f; + purifyTime = 12; + output = Items.stone; + health = 80; + craftEffect = Fx.purifystone; + }}, + + lavasmelter = new LiquidCrafter("lavasmelter") {{ + input = Items.iron; + inputAmount = 1; + inputLiquid = Liquids.lava; + liquidAmount = 40f; + liquidCapacity = 41f; + purifyTime = 30; + output = Items.steel; + health = 80; + craftEffect = Fx.purifystone; + }}, + + siliconextractor = new LiquidCrafter("siliconextractor") {{ + input = Items.stone; + inputAmount = 5; + inputLiquid = Liquids.water; + liquidAmount = 18.99f; + output = Items.silicon; + health = 50; + purifyTime = 50; + }}, + + stonedrill = new Drill("stonedrill") {{ + resource = Blocks.stone; + result = Items.stone; + drillTime = 240; + }}, + + irondrill = new Drill("irondrill") {{ + resource = Blocks.iron; + result = Items.iron; + drillTime = 360; + }}, + + leaddrill = new Drill("leaddrill") {{ + resource = Blocks.lead; + result = Items.lead; + drillTime = 400; + }}, + + coaldrill = new Drill("coaldrill") {{ + resource = Blocks.coal; + result = Items.coal; + drillTime = 420; + }}, + + thoriumdrill = new Drill("thoriumdrill") {{ + resource = Blocks.thorium; + result = Items.thorium; + drillTime = 600; + }}, + + titaniumdrill = new Drill("titaniumdrill") {{ + resource = Blocks.titanium; + result = Items.titanium; + drillTime = 540; + }}, + + laserdrill = new GenericDrill("laserdrill") {{ + drillTime = 200; + size = 2; + powerUse = 0.2f; + hasPower = true; + }}, + + nucleardrill = new GenericDrill("nucleardrill") {{ + drillTime = 240; + size = 3; + powerUse = 0.32f; + hasPower = true; + }}, + + plasmadrill = new GenericDrill("plasmadrill") {{ + inputLiquid = Liquids.plasma; + drillTime = 240; + size = 4; + powerUse = 0.16f; + hasLiquids = true; + hasPower = true; + }}, + + quartzextractor = new GenericDrill("quartzextractor") {{ + powerUse = 0.1f; + resource = Blocks.sand; + result = Items.silicon; + drillTime = 320; + size = 2; + }}, + + waterextractor = new SolidPump("waterextractor") {{ + result = Liquids.water; + powerUse = 0.1f; + pumpAmount = 0.4f; + size = 2; + liquidCapacity = 30f; + }}, + + oilextractor = new SolidPump("oilextractor") {{ + result = Liquids.oil; + powerUse = 0.5f; + pumpAmount = 0.4f; + size = 3; + liquidCapacity = 80f; + }}, + + cultivator = new GenericDrill("cultivator") {{ + resource = Blocks.grass; + result = Items.biomatter; + inputLiquid = Liquids.water; + liquidUse = 0.1f; + drillTime = 300; + size = 2; + hasLiquids = true; + hasPower = true; + }}, + + weaponFactory = new WeaponFactory("weaponfactory") {{ + size = 2; + health = 250; + }}; +} diff --git a/core/src/io/anuke/mindustry/content/blocks/StorageBlocks.java b/core/src/io/anuke/mindustry/content/blocks/StorageBlocks.java new file mode 100644 index 0000000000..e2c2590994 --- /dev/null +++ b/core/src/io/anuke/mindustry/content/blocks/StorageBlocks.java @@ -0,0 +1,27 @@ +package io.anuke.mindustry.content.blocks; + +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.blocks.types.storage.CoreBlock; +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; + +public class StorageBlocks { + public static final Block + + core = new CoreBlock("core"){{ + health = 800; + }}, + + vault = new Vault("vault"){{ + size = 3; + }}, + + unloader = new Unloader("unloader"){{ + speed = 5; + }}, + + sortedunloader = new SortedUnloader("sortedunloader"){{ + speed = 5; + }}; +} diff --git a/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java b/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java new file mode 100644 index 0000000000..6355cca507 --- /dev/null +++ b/core/src/io/anuke/mindustry/content/blocks/UnitBlocks.java @@ -0,0 +1,13 @@ +package io.anuke.mindustry.content.blocks; + +import io.anuke.mindustry.content.UnitTypes; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.blocks.types.production.UnitFactory; + +public class UnitBlocks { + public static final Block + + flierFactory = new UnitFactory("flierfactory"){{ + type = UnitTypes.flier; + }}; +} diff --git a/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java b/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java similarity index 91% rename from core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java rename to core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java index 714ae41756..b5df92fc3f 100644 --- a/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java @@ -1,11 +1,11 @@ -package io.anuke.mindustry.world.blocks; +package io.anuke.mindustry.content.blocks; import com.badlogic.gdx.graphics.Color; +import io.anuke.mindustry.content.Items; +import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.entities.BulletType; import io.anuke.mindustry.entities.effect.TeslaOrb; import io.anuke.mindustry.graphics.Fx; -import io.anuke.mindustry.resource.Item; -import io.anuke.mindustry.resource.Liquid; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.defense.LaserTurret; @@ -24,7 +24,7 @@ public class WeaponBlocks{ range = 44; reload = 13f; bullet = BulletType.stone; - ammo = Item.stone; + ammo = Items.stone; health = 45; } @@ -44,7 +44,7 @@ public class WeaponBlocks{ range = 65; reload = 7f; bullet = BulletType.iron; - ammo = Item.iron; + ammo = Items.iron; health = 65; } }, @@ -54,7 +54,7 @@ public class WeaponBlocks{ range = 45f; reload = 5f; bullet = BulletType.flame; - ammo = Item.coal; + ammo = Items.coal; health = 90; inaccuracy = 4f; } @@ -66,7 +66,7 @@ public class WeaponBlocks{ range = 120; reload = 50f; bullet = BulletType.sniper; - ammo = Item.steel; + ammo = Items.steel; health = 70; shootEffect = Fx.railshot; } @@ -81,7 +81,7 @@ public class WeaponBlocks{ bullet = BulletType.flak; shots = 3; inaccuracy = 9f; - ammo = Item.coal; + ammo = Items.coal; ammoMultiplier = 5; health = 110; shootEffect = Fx.mortarshot; @@ -128,7 +128,7 @@ public class WeaponBlocks{ range = 90f; reload = 7f; bullet = BulletType.plasmaflame; - ammoLiquid = Liquid.lava; + ammoLiquid = Liquids.lava; liquidPerShot = 3f; health = 180*3; size = 2; @@ -142,7 +142,7 @@ public class WeaponBlocks{ range = 60f; reload = 3f; bullet = BulletType.plasmaflame; - ammo = Item.coal; + ammo = Items.coal; health = 180; ammoMultiplier = 40; } @@ -155,7 +155,7 @@ public class WeaponBlocks{ range = 80f; reload = 8f; bullet = BulletType.chain; - ammo = Item.thorium; + ammo = Items.thorium; health = 430; size = 2; shootCone = 9f; @@ -188,7 +188,7 @@ public class WeaponBlocks{ range = 120f; reload = 23f; bullet = BulletType.titanshell; - ammo = Item.thorium; + ammo = Items.thorium; health = 800; ammoMultiplier = 4; size = 3; @@ -205,7 +205,7 @@ public class WeaponBlocks{ range = 120f; reload = 23f; bullet = BulletType.titanshell; - ammo = Item.thorium; + ammo = Items.thorium; health = 800; ammoMultiplier = 4; size = 3; @@ -221,7 +221,7 @@ public class WeaponBlocks{ range = 120f; reload = 23f; bullet = BulletType.titanshell; - ammo = Item.thorium; + ammo = Items.thorium; health = 800; ammoMultiplier = 4; size = 2; diff --git a/core/src/io/anuke/mindustry/core/ContentLoader.java b/core/src/io/anuke/mindustry/core/ContentLoader.java new file mode 100644 index 0000000000..9d91c3c0ef --- /dev/null +++ b/core/src/io/anuke/mindustry/core/ContentLoader.java @@ -0,0 +1,58 @@ +package io.anuke.mindustry.core; + +import io.anuke.mindustry.content.*; +import io.anuke.mindustry.content.blocks.*; +import io.anuke.mindustry.entities.units.UnitType; +import io.anuke.mindustry.resource.Item; +import io.anuke.mindustry.resource.Liquid; +import io.anuke.mindustry.resource.Mech; +import io.anuke.mindustry.world.Block; +import io.anuke.ucore.util.Log; + +/**Loads all game content by creating class instances. + * Call load() before doing anything with content.*/ +public class ContentLoader { + + public static void load(){ + + Object[] content = { + //blocks + new Blocks(), + new DefenseBlocks(), + new DistributionBlocks(), + new ProductionBlocks(), + new WeaponBlocks(), + new DebugBlocks(), + new LiquidBlocks(), + new StorageBlocks(), + new UnitBlocks(), + new PowerBlocks(), + + //items + new Items(), + + //liquids + new Liquids(), + + //mechs + new Mechs(), + + //weapons + new Weapons(), + + //units + new UnitTypes(), + }; + + for(Block block : Block.getAllBlocks()){ + block.init(); + } + + Log.info("--- CONTENT INFO ---"); + Log.info("Blocks loaded: {0}\nItems loaded: {1}\nLiquids loaded: {2}\nUpgrades loaded: {3}\nUnits loaded: {4}", + Block.getAllBlocks().size, Item.getAllItems().size, Liquid.getAllLiquids().size, + Mech.getAllUpgrades().size, UnitType.getAllTypes().size); + + Log.info("-------------------"); + } +} diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index af710cb783..550005937b 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -3,6 +3,8 @@ package io.anuke.mindustry.core; import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Input.Buttons; import com.badlogic.gdx.graphics.Color; +import io.anuke.mindustry.content.Mechs; +import io.anuke.mindustry.content.Weapons; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.game.EventType.*; @@ -18,8 +20,6 @@ import io.anuke.mindustry.io.Platform; import io.anuke.mindustry.io.Saves; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.resource.Item; -import io.anuke.mindustry.resource.Mech; -import io.anuke.mindustry.resource.Weapon; import io.anuke.ucore.UCore; import io.anuke.ucore.core.*; import io.anuke.ucore.core.Inputs.DeviceType; @@ -123,7 +123,7 @@ public class Control extends Module{ player = new Player(); player.name = Settings.getString("name"); - player.mech = android ? Mech.standardShip : Mech.standard; + player.mech = android ? Mechs.standardShip : Mechs.standard; player.color.set(Settings.getInt("color")); player.isLocal = true; @@ -149,7 +149,7 @@ public class Control extends Module{ Events.on(ResetEvent.class, () -> { upgrades.reset(); - player.weaponLeft = player.weaponRight = Weapon.blaster; + player.weaponLeft = player.weaponRight = Weapons.blaster; player.team = Team.blue; player.add(); diff --git a/core/src/io/anuke/mindustry/core/GameState.java b/core/src/io/anuke/mindustry/core/GameState.java index afd45fde8c..6d673462f9 100644 --- a/core/src/io/anuke/mindustry/core/GameState.java +++ b/core/src/io/anuke/mindustry/core/GameState.java @@ -1,11 +1,10 @@ package io.anuke.mindustry.core; -import com.badlogic.gdx.utils.ObjectSet; import io.anuke.mindustry.game.Difficulty; import io.anuke.mindustry.game.EventType.StateChangeEvent; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.Inventory; -import io.anuke.mindustry.game.Team; +import io.anuke.mindustry.game.TeamInfo; import io.anuke.ucore.core.Events; public class GameState{ @@ -21,8 +20,7 @@ public class GameState{ public GameMode mode = GameMode.waves; public Difficulty difficulty = Difficulty.normal; public boolean friendlyFire; - public ObjectSet enemyTeams = new ObjectSet<>(), //enemies to the player team - allyTeams = new ObjectSet<>(); //allies to the player team, includes the player team + public TeamInfo teams = new TeamInfo(); public void set(State astate){ Events.fire(StateChangeEvent.class, state, astate); diff --git a/core/src/io/anuke/mindustry/core/Logic.java b/core/src/io/anuke/mindustry/core/Logic.java index 4b899f6994..b02db270b2 100644 --- a/core/src/io/anuke/mindustry/core/Logic.java +++ b/core/src/io/anuke/mindustry/core/Logic.java @@ -1,14 +1,13 @@ package io.anuke.mindustry.core; -import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.core.GameState.State; -import io.anuke.mindustry.game.EnemySpawn; import io.anuke.mindustry.game.EventType.GameOverEvent; import io.anuke.mindustry.game.EventType.PlayEvent; import io.anuke.mindustry.game.EventType.ResetEvent; import io.anuke.mindustry.game.EventType.WaveEvent; import io.anuke.mindustry.game.Team; -import io.anuke.mindustry.game.WaveCreator; +import io.anuke.mindustry.game.TeamInfo; +import io.anuke.mindustry.game.TeamInfo.TeamData; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.NetEvents; import io.anuke.ucore.core.Events; @@ -27,7 +26,10 @@ import static io.anuke.mindustry.Vars.*; * This class should not call any outside methods to change state of modules, but instead fire events. */ public class Logic extends Module { - private final Array spawns = WaveCreator.getSpawns(); + + public Logic(){ + state = new GameState(); + } @Override public void init(){ @@ -52,10 +54,9 @@ public class Logic extends Module { state.enemies = 0; state.gameOver = false; state.inventory.clearItems(); - state.allyTeams.clear(); - state.allyTeams.add(Team.blue); - state.enemyTeams.clear(); - state.enemyTeams.add(Team.red); + state.teams = new TeamInfo(); + state.teams.add(Team.blue, true); + state.teams.add(Team.red, false); Timers.clear(); Entities.clear(); @@ -86,8 +87,16 @@ public class Logic extends Module { if(!Net.client()) world.pathfinder().update(); + boolean gameOver = true; - if(world.getAllyCores().size == 0 && !state.gameOver){ //TODO gameover state + for(TeamData data : state.teams.getTeams(true)){ + if(data.cores.size > 0){ + gameOver = false; + break; + } + } + + if(gameOver && !state.gameOver){ //TODO better gameover state, victory state? state.gameOver = true; if(Net.server()) NetEvents.handleGameOver(); Events.fire(GameOverEvent.class); diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index 4252ce07aa..1a8426eebf 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -1,6 +1,9 @@ package io.anuke.mindustry.core; import com.badlogic.gdx.utils.*; +import io.anuke.mindustry.content.Mechs; +import io.anuke.mindustry.content.Recipes; +import io.anuke.mindustry.content.UpgradeRecipes; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.entities.BulletType; import io.anuke.mindustry.entities.Player; @@ -12,7 +15,9 @@ import io.anuke.mindustry.net.*; import io.anuke.mindustry.net.Administration.PlayerInfo; import io.anuke.mindustry.net.Net.SendMode; import io.anuke.mindustry.net.Packets.*; -import io.anuke.mindustry.resource.*; +import io.anuke.mindustry.resource.Recipe; +import io.anuke.mindustry.resource.Upgrade; +import io.anuke.mindustry.resource.Weapon; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Placement; import io.anuke.ucore.core.Events; @@ -95,7 +100,7 @@ public class NetServer extends Module{ player.isAdmin = admins.isAdmin(uuid, ip); player.clientid = id; player.name = packet.name; - player.mech = packet.android ? Mech.standardShip : Mech.standard; + player.mech = packet.android ? Mechs.standardShip : Mechs.standard; player.set(world.getSpawnX(), world.getSpawnY()); player.setNet(player.x, player.y); player.setNet(player.x, player.y); diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index 570d97383d..6227251563 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -25,7 +25,7 @@ import io.anuke.mindustry.ui.fragments.ToolFragment; import io.anuke.mindustry.world.BlockBar; import io.anuke.mindustry.world.Layer; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.ucore.core.*; import io.anuke.ucore.entities.EffectEntity; import io.anuke.ucore.entities.Entities; diff --git a/core/src/io/anuke/mindustry/core/World.java b/core/src/io/anuke/mindustry/core/World.java index f7a0c405c0..6fae4c35aa 100644 --- a/core/src/io/anuke/mindustry/core/World.java +++ b/core/src/io/anuke/mindustry/core/World.java @@ -12,8 +12,8 @@ import io.anuke.mindustry.io.Maps; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.WorldGenerator; -import io.anuke.mindustry.world.blocks.Blocks; -import io.anuke.mindustry.world.blocks.ProductionBlocks; +import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.blocks.ProductionBlocks; import io.anuke.ucore.entities.Entities; import io.anuke.ucore.entities.Entity; import io.anuke.ucore.modules.Module; @@ -29,8 +29,6 @@ public class World extends Module{ private Tile[][] tiles; private Pathfind pathfind = new Pathfind(); private Maps maps = new Maps(); - private Array allyCores = new Array<>(); - private Array enemyCores = new Array<>(); private Array tempTiles = new Array<>(); @@ -51,14 +49,6 @@ public class World extends Module{ return pathfind; } - public Array getAllyCores() { - return allyCores; - } - - public Array getEnemyCores() { - return enemyCores; - } - //TODO proper spawnpoints! public float getSpawnX(){ return width() * tilesize/2f; @@ -179,7 +169,7 @@ public class World extends Module{ Entities.resizeTree(0, 0, width * tilesize, height * tilesize); - WorldGenerator.generate(tiles, MapIO.readTileData(map), allyCores); + WorldGenerator.generate(tiles, MapIO.readTileData(map)); } void set(int x, int y, Block type, int rot){ diff --git a/core/src/io/anuke/mindustry/editor/MapEditor.java b/core/src/io/anuke/mindustry/editor/MapEditor.java index 67d0bca6b1..6d476d9f07 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditor.java +++ b/core/src/io/anuke/mindustry/editor/MapEditor.java @@ -4,7 +4,7 @@ import io.anuke.mindustry.game.Team; import io.anuke.mindustry.io.MapTileData; import io.anuke.mindustry.io.MapTileData.TileDataMarker; import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.world.blocks.types.Floor; import io.anuke.ucore.util.Mathf; diff --git a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java index 7b9a9bb2cf..bc73ca39ac 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java @@ -15,7 +15,7 @@ import io.anuke.mindustry.ui.dialogs.FloatingDialog; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.ColorMapper; import io.anuke.mindustry.world.ColorMapper.BlockPair; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.ucore.core.Core; import io.anuke.ucore.core.Graphics; import io.anuke.ucore.core.Inputs; diff --git a/core/src/io/anuke/mindustry/editor/MapFilter.java b/core/src/io/anuke/mindustry/editor/MapFilter.java index a01b082a43..65d7686006 100644 --- a/core/src/io/anuke/mindustry/editor/MapFilter.java +++ b/core/src/io/anuke/mindustry/editor/MapFilter.java @@ -8,7 +8,7 @@ import com.badlogic.gdx.utils.OrderedMap; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.ColorMapper; import io.anuke.mindustry.world.ColorMapper.BlockPair; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.world.blocks.types.Floor; import io.anuke.ucore.graphics.Pixmaps; import io.anuke.ucore.noise.RidgedPerlin; diff --git a/core/src/io/anuke/mindustry/editor/MapRenderer.java b/core/src/io/anuke/mindustry/editor/MapRenderer.java index d47682567a..1555ada2ad 100644 --- a/core/src/io/anuke/mindustry/editor/MapRenderer.java +++ b/core/src/io/anuke/mindustry/editor/MapRenderer.java @@ -5,7 +5,7 @@ import com.badlogic.gdx.utils.IntSet; import com.badlogic.gdx.utils.IntSet.IntSetIterator; import io.anuke.mindustry.io.MapTileData.TileDataMarker; import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.ucore.core.Core; import io.anuke.ucore.core.Graphics; import io.anuke.ucore.core.Timers; diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index b9c46f52b8..474fab4e73 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -2,6 +2,9 @@ package io.anuke.mindustry.entities; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.math.Vector2; +import io.anuke.mindustry.content.Mechs; +import io.anuke.mindustry.content.Weapons; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.graphics.Fx; import io.anuke.mindustry.net.Net; @@ -10,8 +13,10 @@ import io.anuke.mindustry.resource.Mech; import io.anuke.mindustry.resource.Upgrade; import io.anuke.mindustry.resource.Weapon; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.Blocks; -import io.anuke.ucore.core.*; +import io.anuke.ucore.core.Effects; +import io.anuke.ucore.core.Inputs; +import io.anuke.ucore.core.Settings; +import io.anuke.ucore.core.Timers; import io.anuke.ucore.entities.SolidEntity; import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.util.Angles; @@ -34,9 +39,9 @@ public class Player extends Unit{ public boolean isAdmin; public Color color = new Color(); - public Weapon weaponLeft = Weapon.blaster; - public Weapon weaponRight = Weapon.blaster; - public Mech mech = Mech.standard; + public Weapon weaponLeft = Weapons.blaster; + public Weapon weaponRight = Weapons.blaster; + public Mech mech = Mechs.standard; public float targetAngle = 0f; public float stucktime = 0f; diff --git a/core/src/io/anuke/mindustry/entities/Units.java b/core/src/io/anuke/mindustry/entities/Units.java index 52ddeb6909..e0a11dc96a 100644 --- a/core/src/io/anuke/mindustry/entities/Units.java +++ b/core/src/io/anuke/mindustry/entities/Units.java @@ -70,14 +70,7 @@ public class Units { /**Iterates over all units that are enemies of this team.*/ public static void getNearbyEnemies(Team team, Rectangle rect, Consumer cons){ - //check if it's an ally team to the 'main team' - boolean ally = state.allyTeams.contains(team); - boolean enemy = state.enemyTeams.contains(team); - - //this team isn't even in the game, so target nothing! - if(!ally && !enemy) return; - - ObjectSet targets = ally ? state.enemyTeams : state.allyTeams; + ObjectSet targets = state.teams.enemiesOf(team); for(Team other : targets){ EntityGroup group = unitGroups[other.ordinal()]; @@ -93,12 +86,4 @@ public class Units { } }); } - - /**Returns whether these two teams are enemies.*/ - public static boolean areEnemies(Team team, Team other){ - if(team == other) return false; //fast fail to be more efficient - boolean ally = state.allyTeams.contains(team); - boolean ally2 = state.allyTeams.contains(other); - return ally == ally2; - } } diff --git a/core/src/io/anuke/mindustry/entities/effect/DamageArea.java b/core/src/io/anuke/mindustry/entities/effect/DamageArea.java index e3c5e2a225..7ce4e36cf3 100644 --- a/core/src/io/anuke/mindustry/entities/effect/DamageArea.java +++ b/core/src/io/anuke/mindustry/entities/effect/DamageArea.java @@ -13,6 +13,7 @@ import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Physics; import io.anuke.ucore.util.Translator; +import static io.anuke.mindustry.Vars.state; import static io.anuke.mindustry.Vars.tilesize; import static io.anuke.mindustry.Vars.world; @@ -88,7 +89,7 @@ public class DamageArea{ for(int dx = -trad; dx <= trad; dx ++){ for(int dy= -trad; dy <= trad; dy ++){ Tile tile = world.tile(Mathf.scl2(x, tilesize) + dx, Mathf.scl2(y, tilesize) + dy); - if(tile != null && tile.entity != null && (team == null || Units.areEnemies(team, tile.getTeam())) && Vector2.dst(dx, dy, 0, 0) <= trad){ + if(tile != null && tile.entity != null && (team == null || state.teams.areEnemies(team, tile.getTeam())) && Vector2.dst(dx, dy, 0, 0) <= trad){ int amount = calculateDamage(x, y, tile.worldx(), tile.worldy(), radius, damage); tile.entity.damage(amount); } diff --git a/core/src/io/anuke/mindustry/entities/units/BaseUnit.java b/core/src/io/anuke/mindustry/entities/units/BaseUnit.java index 3dbde54675..6e7083676d 100644 --- a/core/src/io/anuke/mindustry/entities/units/BaseUnit.java +++ b/core/src/io/anuke/mindustry/entities/units/BaseUnit.java @@ -5,6 +5,7 @@ import io.anuke.mindustry.entities.BulletType; import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.game.Team; import io.anuke.ucore.core.Timers; +import io.anuke.ucore.entities.Entity; import io.anuke.ucore.entities.SolidEntity; import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Timer; @@ -17,7 +18,7 @@ public class BaseUnit extends Unit { public UnitType type; public Timer timer = new Timer(5); public float walkTime = 0f; - public Unit target; + public Entity target; public BaseUnit(UnitType type, Team team){ this.type = type; diff --git a/core/src/io/anuke/mindustry/entities/units/FlyingUnitType.java b/core/src/io/anuke/mindustry/entities/units/FlyingUnitType.java index c3aeda7618..14df599f46 100644 --- a/core/src/io/anuke/mindustry/entities/units/FlyingUnitType.java +++ b/core/src/io/anuke/mindustry/entities/units/FlyingUnitType.java @@ -1,12 +1,21 @@ package io.anuke.mindustry.entities.units; +import com.badlogic.gdx.math.Vector2; +import com.badlogic.gdx.utils.ObjectSet; import io.anuke.mindustry.entities.Unit; +import io.anuke.mindustry.game.TeamInfo.TeamData; +import io.anuke.mindustry.world.Tile; +import io.anuke.ucore.core.Timers; import io.anuke.ucore.graphics.Draw; +import static io.anuke.mindustry.Vars.state; + public class FlyingUnitType extends UnitType { + private static Vector2 vec = new Vector2(); public FlyingUnitType(String name) { super(name); + speed = 1f; } @Override @@ -20,6 +29,36 @@ public class FlyingUnitType extends UnitType { @Override public void behavior(BaseUnit unit) { + vec.set(unit.target.x - unit.x, unit.target.y - unit.y); + vec.setLength(speed); + + unit.velocity.lerp(vec, 0.1f * Timers.delta()); //TODO clamp it so it doesn't glitch out at low fps } + + @Override + public void updateTargeting(BaseUnit unit) { + if(!unit.timer.get(timerTarget, 20)) return; + + ObjectSet teams = state.teams.enemyDataOf(unit.team); + + Tile closest = null; + float cdist = 0f; + + for(TeamData data : teams){ + for(Tile tile : data.cores){ + float dist = Vector2.dst(unit.x, unit.y, tile.drawx(), tile.drawy()); + if(closest == null || dist < cdist){ + closest = tile; + cdist = dist; + } + } + } + + if(closest != null){ + unit.target = closest.entity; + }else{ + unit.target = null; + } + } } diff --git a/core/src/io/anuke/mindustry/entities/units/UnitType.java b/core/src/io/anuke/mindustry/entities/units/UnitType.java index 6d4bf6f671..863fd1df0a 100644 --- a/core/src/io/anuke/mindustry/entities/units/UnitType.java +++ b/core/src/io/anuke/mindustry/entities/units/UnitType.java @@ -2,6 +2,7 @@ package io.anuke.mindustry.entities.units; import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.entities.BulletType; +import io.anuke.mindustry.entities.Unit; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.graphics.Fx; import io.anuke.mindustry.net.Net; @@ -78,11 +79,11 @@ public abstract class UnitType { public abstract void behavior(BaseUnit unit); public void updateTargeting(BaseUnit unit){ - if(unit.target == null || unit.target.isDead()){ + if(unit.target == null || (unit.target instanceof Unit && ((Unit)unit.target).isDead())){ unit.target = null; } - if(unit.timer.get(timerTarget, 30)){ + if(unit.timer.get(timerTarget, 20)){ unit.target = Units.getClosestEnemy(unit.team, unit.x, unit.y, range, e -> true); } } @@ -113,4 +114,8 @@ public abstract class UnitType { public static UnitType getByID(byte id){ return types.get(id); } + + public static Array getAllTypes(){ + return types; + } } diff --git a/core/src/io/anuke/mindustry/entities/units/UnitTypes.java b/core/src/io/anuke/mindustry/entities/units/UnitTypes.java deleted file mode 100644 index 44c51584bf..0000000000 --- a/core/src/io/anuke/mindustry/entities/units/UnitTypes.java +++ /dev/null @@ -1,9 +0,0 @@ -package io.anuke.mindustry.entities.units; - -import io.anuke.mindustry.entities.units.types.Scout; - -public class UnitTypes { - public static final UnitType - - scout = new Scout(); -} diff --git a/core/src/io/anuke/mindustry/entities/units/types/Flier.java b/core/src/io/anuke/mindustry/entities/units/types/Flier.java new file mode 100644 index 0000000000..418b11daf6 --- /dev/null +++ b/core/src/io/anuke/mindustry/entities/units/types/Flier.java @@ -0,0 +1,11 @@ +package io.anuke.mindustry.entities.units.types; + +import io.anuke.mindustry.entities.units.FlyingUnitType; + +public class Flier extends FlyingUnitType { + + public Flier(){ + super("flier"); + } + +} diff --git a/core/src/io/anuke/mindustry/game/Inventory.java b/core/src/io/anuke/mindustry/game/Inventory.java index 97b7890313..9b059ad864 100644 --- a/core/src/io/anuke/mindustry/game/Inventory.java +++ b/core/src/io/anuke/mindustry/game/Inventory.java @@ -1,5 +1,6 @@ package io.anuke.mindustry.game; +import io.anuke.mindustry.content.Items; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.ItemStack; @@ -29,7 +30,7 @@ public class Inventory { if(item.material) items[item.id] = 99999; } }else{ - addItem(Item.iron, 40); + addItem(Items.iron, 40); } } diff --git a/core/src/io/anuke/mindustry/game/TeamInfo.java b/core/src/io/anuke/mindustry/game/TeamInfo.java new file mode 100644 index 0000000000..afd5966f5f --- /dev/null +++ b/core/src/io/anuke/mindustry/game/TeamInfo.java @@ -0,0 +1,99 @@ +package io.anuke.mindustry.game; + +import com.badlogic.gdx.utils.Array; +import com.badlogic.gdx.utils.ObjectMap; +import com.badlogic.gdx.utils.ObjectSet; +import io.anuke.mindustry.world.Tile; + +/**Wrapper around an ObjectMap for team data.*/ +public class TeamInfo { + private final static ObjectSet empty = new ObjectSet<>(); + private final static ObjectSet emptyData = new ObjectSet<>(); + + private ObjectMap map = new ObjectMap<>(); + private ObjectSet allies = new ObjectSet<>(), + enemies = new ObjectSet<>(); + private ObjectSet allyData = new ObjectSet<>(), + enemyData = new ObjectSet<>(); + + public ObjectSet getTeams(boolean ally) { + return ally ? allyData : enemyData; + } + + /**Register a team. + * @param team The team type enum. + * @param ally Whether this team is an ally with the player or an enemy with the player. + * In PvP situations with dedicated servers, the sides can be arbitrary. + */ + public void add(Team team, boolean ally){ + if(has(team)) throw new RuntimeException("Can't define team information twice!"); + + TeamData data = new TeamData(team, ally); + + if(ally) { + allies.add(team); + allyData.add(data); + }else { + enemies.add(team); + enemyData.add(data); + } + + map.put(team, data); + } + + /**Returns team data by type. Call {@link #has(Team)} first to make sure it's active!*/ + public TeamData get(Team team){ + if(!has(team)) throw new RuntimeException("This team is not active! Check has() before calling get()."); + return map.get(team); + } + + /**Returns whether the specified team is active, e.g. whether it is participating in the game.*/ + public boolean has(Team team){ + return map.containsKey(team); + } + + /**Returns a set of all teams that are enemies of this team. + * For teams not active, an empty set is returned. + */ + public ObjectSet enemiesOf(Team team) { + boolean ally = allies.contains(team); + boolean enemy = enemies.contains(team); + + //this team isn't even in the game, so target nothing! + if(!ally && !enemy) return empty; + + return ally ? enemies : allies; + } + + /**Returns a set of all teams that are enemies of this team. + * For teams not active, an empty set is returned. + */ + public ObjectSet enemyDataOf(Team team) { + boolean ally = allies.contains(team); + boolean enemy = enemies.contains(team); + + //this team isn't even in the game, so target nothing! + if(!ally && !enemy) return emptyData; + + return ally ? enemyData : allyData; + } + + /**Returns whether or not these two teams are enemies.*/ + public boolean areEnemies(Team team, Team other){ + if(team == other) return false; //fast fail to be more efficient + boolean ally = allies.contains(team); + boolean ally2 = enemies.contains(other); + return ally == ally2; + } + + public class TeamData { + public final Array cores = new Array<>(); + public final Team team; + public final boolean ally; + + public TeamData(Team team, boolean ally) { + this.team = team; + this.ally = ally; + } + } +} diff --git a/core/src/io/anuke/mindustry/game/Tutorial.java b/core/src/io/anuke/mindustry/game/Tutorial.java index b615032b8c..b9835cf393 100644 --- a/core/src/io/anuke/mindustry/game/Tutorial.java +++ b/core/src/io/anuke/mindustry/game/Tutorial.java @@ -1,10 +1,13 @@ package io.anuke.mindustry.game; import com.badlogic.gdx.math.GridPoint2; +import io.anuke.mindustry.content.Items; +import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.blocks.DistributionBlocks; +import io.anuke.mindustry.content.blocks.ProductionBlocks; +import io.anuke.mindustry.content.blocks.WeaponBlocks; import io.anuke.mindustry.core.GameState.State; -import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.*; import io.anuke.ucore.core.Timers; import io.anuke.ucore.scene.builders.button; import io.anuke.ucore.scene.builders.label; @@ -404,15 +407,15 @@ public class Tutorial{ canForward = false; showBlock = true; canPlace = true; - targetBlock = ProductionBlocks.pump; + //targetBlock = ProductionBlocks.pump; blockPlaceX = 6; blockPlaceY = -2; } void onSwitch(){ ui.find("sectionbuttonproduction").fireClick(); - state.inventory.addItem(Item.steel, 60); - state.inventory.addItem(Item.iron, 60); + state.inventory.addItem(Items.steel, 60); + state.inventory.addItem(Items.iron, 60); } }, conduitUse{ @@ -421,7 +424,7 @@ public class Tutorial{ canForward = false; showBlock = true; canPlace = true; - targetBlock = DistributionBlocks.conduit; + //targetBlock = DistributionBlocks.conduit; blockPlaceX = 5; blockPlaceY = -2; blockRotation = 2; @@ -438,8 +441,8 @@ public class Tutorial{ canForward = false; showBlock = true; canPlace = true; - targetBlock = DistributionBlocks.conduit; - blockPlaceX = 4; + //targetBlock = DistributionBlocks.conduit; + //blockPlaceX = 4; blockPlaceY = -2; blockRotation = 1; } @@ -454,7 +457,7 @@ public class Tutorial{ canForward = false; showBlock = true; canPlace = true; - targetBlock = DistributionBlocks.conduit; + //targetBlock = DistributionBlocks.conduit; blockPlaceX = 4; blockPlaceY = -1; blockRotation = 1; @@ -470,7 +473,7 @@ public class Tutorial{ canForward = false; showBlock = true; canPlace = true; - targetBlock = ProductionBlocks.combustiongenerator; + //targetBlock = ProductionBlocks.combustiongenerator; blockPlaceX = 4; blockPlaceY = 0; } @@ -478,8 +481,8 @@ public class Tutorial{ void onSwitch(){ //world.tile(blockPlaceX + world.getCore().x, blockPlaceY + world.getCore().y).setBlock(Blocks.air); ui.find("sectionbuttonpower").fireClick(); - state.inventory.addItem(Item.steel, 60); - state.inventory.addItem(Item.iron, 60); + state.inventory.addItem(Items.steel, 60); + state.inventory.addItem(Items.iron, 60); } }, generatorExplain{ @@ -522,7 +525,7 @@ public class Tutorial{ canBack = false; blockPlaceX = 1; blockPlaceY = 4; - targetBlock = DefenseBlocks.repairturret; + //targetBlock = DefenseBlocks.repairturret; } void onSwitch(){ @@ -547,8 +550,8 @@ public class Tutorial{ } void onSwitch(){ - state.inventory.addItem(Item.stone, 40); - state.inventory.addItem(Item.iron, 40); + state.inventory.addItem(Items.stone, 40); + state.inventory.addItem(Items.iron, 40); ui.find("sectionbuttoncrafting").fireClick(); } diff --git a/core/src/io/anuke/mindustry/game/UpgradeInventory.java b/core/src/io/anuke/mindustry/game/UpgradeInventory.java index 24fadf2d12..62ca604c6e 100644 --- a/core/src/io/anuke/mindustry/game/UpgradeInventory.java +++ b/core/src/io/anuke/mindustry/game/UpgradeInventory.java @@ -1,6 +1,7 @@ package io.anuke.mindustry.game; import com.badlogic.gdx.utils.Array; +import io.anuke.mindustry.content.Weapons; import io.anuke.mindustry.resource.Weapon; public class UpgradeInventory { @@ -20,6 +21,6 @@ public class UpgradeInventory { public void reset(){ weapons.clear(); - weapons.add(Weapon.blaster); + weapons.add(Weapons.blaster); } } diff --git a/core/src/io/anuke/mindustry/graphics/BlockRenderer.java b/core/src/io/anuke/mindustry/graphics/BlockRenderer.java index 2a1d3cbb80..26c4497483 100644 --- a/core/src/io/anuke/mindustry/graphics/BlockRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/BlockRenderer.java @@ -9,7 +9,7 @@ import io.anuke.mindustry.game.Team; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Layer; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.world.blocks.types.StaticBlock; import io.anuke.ucore.core.Core; import io.anuke.ucore.core.Graphics; diff --git a/core/src/io/anuke/mindustry/input/InputHandler.java b/core/src/io/anuke/mindustry/input/InputHandler.java index c1bd04785d..d0f913f6d9 100644 --- a/core/src/io/anuke/mindustry/input/InputHandler.java +++ b/core/src/io/anuke/mindustry/input/InputHandler.java @@ -10,7 +10,7 @@ import io.anuke.mindustry.resource.Recipe; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Placement; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.ucore.core.Graphics; import io.anuke.ucore.util.Mathf; diff --git a/core/src/io/anuke/mindustry/io/BlockLoader.java b/core/src/io/anuke/mindustry/io/BlockLoader.java deleted file mode 100644 index 17e524145a..0000000000 --- a/core/src/io/anuke/mindustry/io/BlockLoader.java +++ /dev/null @@ -1,144 +0,0 @@ -package io.anuke.mindustry.io; - -import com.badlogic.gdx.utils.IntMap; -import com.badlogic.gdx.utils.ObjectIntMap; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.*; -import io.anuke.ucore.util.Log; - -public class BlockLoader { - static final ObjectIntMap defaultMap = map( - "air", 0, - "blockpart", 1, - "deepwater", 2, - "water", 3, - "lava", 4, - "oil", 5, - "stone", 6, - "blackstone", 7, - "iron", 8, - "coal", 9, - "titanium", 10, - "thorium", 11, - "dirt", 12, - "sand", 13, - "ice", 14, - "snow", 15, - "grass", 16, - "sandblock", 17, - "snowblock", 18, - "stoneblock", 19, - "blackstoneblock", 20, - "grassblock", 21, - "mossblock", 22, - "shrub", 23, - "rock", 24, - "icerock", 25, - "blackrock", 26, - "dirtblock", 27, - "stonewall", 28, - "ironwall", 29, - "steelwall", 30, - "titaniumwall", 31, - "duriumwall", 32, - "compositewall", 33, - "steelwall-large", 34, - "titaniumwall-large", 35, - "duriumwall-large", 36, - "titaniumshieldwall", 37, - "repairturret", 38, - "megarepairturret", 39, - "shieldgenerator", 40, - "door", 41, - "door-large", 42, - "conduit", 43, - "pulseconduit", 44, - "liquidrouter", 45, - "conveyor", 46, - "steelconveyor", 47, - "poweredconveyor", 48, - "router", 49, - "junction", 50, - "conveyortunnel", 51, - "liquidjunction", 52, - "liquiditemjunction", 53, - "powerbooster", 54, - "powerlaser", 55, - "powerlaserrouter", 56, - "powerlasercorner", 57, - "teleporter", 58, - "sorter", 59, - "core", 60, - "pump", 61, - "fluxpump", 62, - "smelter", 63, - "crucible", 64, - "coalpurifier", 65, - "titaniumpurifier", 66, - "oilrefinery", 67, - "stoneformer", 68, - "lavasmelter", 69, - "stonedrill", 70, - "irondrill", 71, - "coaldrill", 72, - "thoriumdrill", 73, - "titaniumdrill", 74, - "omnidrill", 75, - "coalgenerator", 76, - "thermalgenerator", 77, - "combustiongenerator", 78, - "rtgenerator", 79, - "nuclearreactor", 80, - "turret", 81, - "doubleturret", 82, - "machineturret", 83, - "shotgunturret", 84, - "flameturret", 85, - "sniperturret", 86, - "mortarturret", 87, - "laserturret", 88, - "waveturret", 89, - "plasmaturret", 90, - "chainturret", 91, - "titancannon", 92, - "playerspawn", 93, - "enemyspawn", 94 - ); - static final IntMap blockmap = new IntMap<>(); - - public static void load(){ - - Block[] blockClasses = { - Blocks.air, - DefenseBlocks.compositewall, - DistributionBlocks.conduit, - ProductionBlocks.coaldrill, - WeaponBlocks.chainturret, - DebugBlocks.powerVoid - //add any new block sections here - }; - - for(String string : defaultMap.keys()){ - Block block = Block.getByName(string); - blockmap.put(defaultMap.get(string, -1), block); - } - - for(Block block : Block.getAllBlocks()){ - block.init(); - } - - Log.info("Total blocks loaded: {0}", Block.getAllBlocks().size); - } - - public static Block getByOldID(int id){ - return blockmap.get(id); - } - - private static ObjectIntMap map(Object... objects){ - ObjectIntMap map = new ObjectIntMap<>(); - for(int i = 0; i < objects.length/2; i ++){ - map.put((String)objects[i*2], (int)objects[i*2+1]); - } - return map; - } -} diff --git a/core/src/io/anuke/mindustry/io/MapIO.java b/core/src/io/anuke/mindustry/io/MapIO.java index 01901baff0..b73ab8eae5 100644 --- a/core/src/io/anuke/mindustry/io/MapIO.java +++ b/core/src/io/anuke/mindustry/io/MapIO.java @@ -10,7 +10,7 @@ import io.anuke.mindustry.io.MapTileData.TileDataMarker; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.ColorMapper; import io.anuke.mindustry.world.ColorMapper.BlockPair; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; import java.io.DataInputStream; import java.io.DataOutputStream; @@ -22,6 +22,7 @@ import static io.anuke.mindustry.Vars.mapExtension; /**Reads and writes map files.*/ //TODO GWT support +//TODO map header that maps block names to IDs for backwards compatibility public class MapIO { private static final int version = 0; diff --git a/core/src/io/anuke/mindustry/io/versions/Save16.java b/core/src/io/anuke/mindustry/io/versions/Save16.java index cdf356d9e7..b9d0b9e115 100644 --- a/core/src/io/anuke/mindustry/io/versions/Save16.java +++ b/core/src/io/anuke/mindustry/io/versions/Save16.java @@ -2,6 +2,7 @@ package io.anuke.mindustry.io.versions; import com.badlogic.gdx.utils.IntMap; import com.badlogic.gdx.utils.TimeUtils; +import io.anuke.mindustry.content.Weapons; import io.anuke.mindustry.entities.units.BaseUnit; import io.anuke.mindustry.entities.units.UnitType; import io.anuke.mindustry.game.Difficulty; @@ -10,10 +11,9 @@ import io.anuke.mindustry.game.Team; import io.anuke.mindustry.io.SaveFileVersion; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.Upgrade; -import io.anuke.mindustry.resource.Weapon; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.world.blocks.types.BlockPart; import io.anuke.ucore.core.Core; import io.anuke.ucore.entities.EntityGroup; @@ -75,8 +75,8 @@ public class Save16 extends SaveFileVersion { //weapons control.upgrades().getWeapons().clear(); - control.upgrades().getWeapons().add(Weapon.blaster); - player.weaponLeft = player.weaponRight = Weapon.blaster; + control.upgrades().getWeapons().add(Weapons.blaster); + player.weaponLeft = player.weaponRight = Weapons.blaster; int weapons = stream.readByte(); diff --git a/core/src/io/anuke/mindustry/net/NetworkIO.java b/core/src/io/anuke/mindustry/net/NetworkIO.java index bd27df11eb..757265cb16 100644 --- a/core/src/io/anuke/mindustry/net/NetworkIO.java +++ b/core/src/io/anuke/mindustry/net/NetworkIO.java @@ -2,14 +2,14 @@ package io.anuke.mindustry.net; import com.badlogic.gdx.utils.ByteArray; import com.badlogic.gdx.utils.TimeUtils; +import io.anuke.mindustry.content.Weapons; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.io.Version; import io.anuke.mindustry.resource.Upgrade; -import io.anuke.mindustry.resource.Weapon; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.world.blocks.types.BlockPart; import io.anuke.ucore.core.Timers; import io.anuke.ucore.entities.Entities; @@ -128,7 +128,7 @@ public class NetworkIO { ui.hudfrag.updateItems(); control.upgrades().getWeapons().clear(); - control.upgrades().getWeapons().add(Weapon.blaster); + control.upgrades().getWeapons().add(Weapons.blaster); byte weapons = stream.readByte(); diff --git a/core/src/io/anuke/mindustry/net/TraceInfo.java b/core/src/io/anuke/mindustry/net/TraceInfo.java index 940f98726f..e0dab07ada 100644 --- a/core/src/io/anuke/mindustry/net/TraceInfo.java +++ b/core/src/io/anuke/mindustry/net/TraceInfo.java @@ -1,7 +1,7 @@ package io.anuke.mindustry.net; import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; public class TraceInfo { public int playerid; diff --git a/core/src/io/anuke/mindustry/resource/Item.java b/core/src/io/anuke/mindustry/resource/Item.java index 488ae62aa2..4423b823ab 100644 --- a/core/src/io/anuke/mindustry/resource/Item.java +++ b/core/src/io/anuke/mindustry/resource/Item.java @@ -8,39 +8,6 @@ import io.anuke.ucore.util.Bundles; public class Item implements Comparable{ private static final Array items = new Array<>(); - public static final Item - stone = new Item("stone"){ - { - material = false; - } - }, - iron = new Item("iron"), - lead = new Item("lead"), - coal = new Item("coal"){ - { - explosiveness = 0.2f; - flammability = 0.5f; - fluxiness = 0.5f; - material = false; - } - }, - steel = new Item("steel"), - titanium = new Item("titanium"), - thorium = new Item("thorium"){ - { - explosiveness = 0.1f; - } - }, - silicon = new Item("silicon"), - plastic = new Item("plastic"), - densealloy = new Item("densealloy"), - biomatter = new Item("biomatter"){ - { - material = false; - flammability = 0.4f; - } - }; - public final int id; public final String name; public TextureRegion region; diff --git a/core/src/io/anuke/mindustry/resource/Liquid.java b/core/src/io/anuke/mindustry/resource/Liquid.java index 72501cc12b..0857649d9c 100644 --- a/core/src/io/anuke/mindustry/resource/Liquid.java +++ b/core/src/io/anuke/mindustry/resource/Liquid.java @@ -8,48 +8,6 @@ public class Liquid { private static final Array liquids = new Array<>(); - public static final Liquid - - none = new Liquid("none", Color.CLEAR), - water = new Liquid("water", Color.ROYAL){ - { - heatCapacity = 0.4f; - } - }, - plasma = new Liquid("plasma", Color.CORAL){ - { - flammability = 0.4f; - viscosity = 0.1f; - heatCapacity = 0.2f; - } - }, - lava = new Liquid("lava", Color.valueOf("e37341")){ - { - temperature = 0.7f; - viscosity = 0.8f; - } - }, - oil = new Liquid("oil", Color.valueOf("292929")){ - { - viscosity = 0.7f; - flammability = 0.6f; - explosiveness = 0.6f; - } - }, - cryofluid = new Liquid("cryofluid", Color.SKY){ - { - heatCapacity = 0.75f; - temperature = 0.5f; - } - }, - sulfuricAcid = new Liquid("sulfuricAcid", Color.YELLOW){ - { - flammability = 0.4f; - explosiveness = 0.4f; - heatCapacity = 0.4f; - } - }; - public final Color color; public final String name; public final int id; diff --git a/core/src/io/anuke/mindustry/resource/Mech.java b/core/src/io/anuke/mindustry/resource/Mech.java index 65f226038c..5ccd99a59d 100644 --- a/core/src/io/anuke/mindustry/resource/Mech.java +++ b/core/src/io/anuke/mindustry/resource/Mech.java @@ -1,11 +1,6 @@ package io.anuke.mindustry.resource; public class Mech extends Upgrade{ - public static final Mech - - standard = new Mech("standard-mech", false), - standardShip = new Mech("standard-ship", true); - public boolean flying; public float mass = 1f; diff --git a/core/src/io/anuke/mindustry/resource/Recipes.java b/core/src/io/anuke/mindustry/resource/Recipes.java deleted file mode 100644 index a89eae100b..0000000000 --- a/core/src/io/anuke/mindustry/resource/Recipes.java +++ /dev/null @@ -1,134 +0,0 @@ -package io.anuke.mindustry.resource; - -import com.badlogic.gdx.utils.Array; -import io.anuke.mindustry.Vars; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.*; - -import static io.anuke.mindustry.Vars.debug; -import static io.anuke.mindustry.resource.Section.*; - -public class Recipes { - private static final Array list = Array.with( - //new Recipe(defense, DefenseBlocks.stonewall, stack(Item.stone, 12)), - new Recipe(defense, DefenseBlocks.ironwall, stack(Item.iron, 12)), - new Recipe(defense, DefenseBlocks.steelwall, stack(Item.steel, 12)), - new Recipe(defense, DefenseBlocks.titaniumwall, stack(Item.titanium, 12)), - new Recipe(defense, DefenseBlocks.diriumwall, stack(Item.densealloy, 12)), - new Recipe(defense, DefenseBlocks.steelwalllarge, stack(Item.steel, 12*4)), - new Recipe(defense, DefenseBlocks.titaniumwalllarge, stack(Item.titanium, 12*4)), - new Recipe(defense, DefenseBlocks.diriumwall, stack(Item.densealloy, 12*4)), - new Recipe(defense, DefenseBlocks.door, stack(Item.steel, 3), stack(Item.iron, 3*4)).setDesktop(), - new Recipe(defense, DefenseBlocks.largedoor, stack(Item.steel, 3*4), stack(Item.iron, 3*4*4)).setDesktop(), - new Recipe(defense, DefenseBlocks.titaniumshieldwall, stack(Item.titanium, 16)), - - new Recipe(distribution, DistributionBlocks.conveyor, stack(Item.iron, 1)), - new Recipe(distribution, DistributionBlocks.steelconveyor, stack(Item.steel, 1)), - new Recipe(distribution, DistributionBlocks.pulseconveyor, stack(Item.densealloy, 1)), - new Recipe(distribution, DistributionBlocks.router, stack(Item.iron, 2)), - new Recipe(distribution, DistributionBlocks.multiplexer, stack(Item.iron, 8)), - new Recipe(distribution, DistributionBlocks.junction, stack(Item.iron, 2)), - new Recipe(distribution, DistributionBlocks.tunnel, stack(Item.iron, 2)), - new Recipe(distribution, DistributionBlocks.sorter, stack(Item.steel, 2)), - new Recipe(distribution, DistributionBlocks.splitter, stack(Item.steel, 1)), - new Recipe(distribution, DistributionBlocks.vault, stack(Item.steel, 50)), - new Recipe(distribution, ProductionBlocks.core, stack(Item.steel, 50)), - new Recipe(distribution, DistributionBlocks.unloader, stack(Item.steel, 5)), - new Recipe(distribution, DistributionBlocks.sortedunloader, stack(Item.steel, 5)), - - new Recipe(weapon, WeaponBlocks.doubleturret, stack(Item.iron, 7)), - new Recipe(weapon, WeaponBlocks.gatlingturret, stack(Item.iron, 8)), - new Recipe(weapon, WeaponBlocks.flameturret, stack(Item.iron, 12), stack(Item.steel, 9)), - new Recipe(weapon, WeaponBlocks.railgunturret, stack(Item.iron, 15), stack(Item.steel, 10)), - new Recipe(weapon, WeaponBlocks.laserturret, stack(Item.steel, 12), stack(Item.titanium, 12)), - new Recipe(weapon, WeaponBlocks.flakturret, stack(Item.steel, 25), stack(Item.titanium, 15)), - new Recipe(weapon, WeaponBlocks.teslaturret, stack(Item.steel, 20), stack(Item.titanium, 25), stack(Item.densealloy, 15)), - new Recipe(weapon, WeaponBlocks.magmaturret, stack(Item.steel, 80), stack(Item.titanium, 70), stack(Item.densealloy, 60)), - new Recipe(weapon, WeaponBlocks.chainturret, stack(Item.steel, 50), stack(Item.titanium, 25), stack(Item.densealloy, 40)), - new Recipe(weapon, WeaponBlocks.titanturret, stack(Item.steel, 70), stack(Item.titanium, 50), stack(Item.densealloy, 55)), - new Recipe(weapon, WeaponBlocks.missileturret, stack(Item.steel, 70), stack(Item.titanium, 50), stack(Item.densealloy, 55)), - new Recipe(weapon, WeaponBlocks.fornaxcannon, stack(Item.steel, 70), stack(Item.titanium, 50), stack(Item.densealloy, 55)), - - new Recipe(crafting, ProductionBlocks.smelter, stack(Item.iron, 40)), - new Recipe(crafting, ProductionBlocks.alloysmelter, stack(Item.titanium, 50), stack(Item.steel, 50)), - new Recipe(crafting, ProductionBlocks.coalextractor, stack(Item.steel, 10), stack(Item.iron, 10)), - new Recipe(crafting, ProductionBlocks.titaniumextractor, stack(Item.steel, 30), stack(Item.iron, 30)), - new Recipe(crafting, ProductionBlocks.oilrefinery, stack(Item.steel, 15), stack(Item.iron, 15)), - new Recipe(crafting, ProductionBlocks.stoneformer, stack(Item.steel, 10), stack(Item.iron, 10)), - new Recipe(crafting, ProductionBlocks.lavasmelter, stack(Item.steel, 30), stack(Item.titanium, 15)), - new Recipe(crafting, ProductionBlocks.siliconextractor, stack(Item.steel, 30), stack(Item.titanium, 15)), - new Recipe(crafting, ProductionBlocks.cryofluidmixer, stack(Item.steel, 30), stack(Item.titanium, 15)), - new Recipe(crafting, ProductionBlocks.weaponFactory, stack(Item.steel, 60), stack(Item.iron, 60)).setDesktop(), - //new Recipe(crafting, ProductionBlocks.centrifuge, stack(Item.steel, 30), stack(Item.iron, 30)), - - //new Recipe(production, ProductionBlocks.stonedrill, stack(Item.stone, 12)), - new Recipe(production, ProductionBlocks.irondrill, 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.thoriumdrill, stack(Item.iron, 40), stack(Item.steel, 40)), - new Recipe(production, ProductionBlocks.quartzextractor, stack(Item.titanium, 40), stack(Item.densealloy, 40)), - new Recipe(production, ProductionBlocks.cultivator, stack(Item.titanium, 40), stack(Item.densealloy, 40)), - new Recipe(production, ProductionBlocks.laserdrill, stack(Item.titanium, 40), stack(Item.densealloy, 40)), - new Recipe(production, ProductionBlocks.waterextractor, stack(Item.titanium, 40), stack(Item.densealloy, 40)), - new Recipe(production, ProductionBlocks.oilextractor, stack(Item.titanium, 40), stack(Item.densealloy, 40)), - - new Recipe(power, ProductionBlocks.coalgenerator, stack(Item.iron, 30)), - new Recipe(power, ProductionBlocks.thermalgenerator, stack(Item.steel, 30)), - new Recipe(power, ProductionBlocks.combustiongenerator, stack(Item.iron, 30)), - new Recipe(power, ProductionBlocks.solarpanel, stack(Item.iron, 30), stack(Item.silicon, 20)), - 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.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)), - - new Recipe(power, DefenseBlocks.shieldgenerator, stack(Item.titanium, 30), stack(Item.densealloy, 30)), - - new Recipe(distribution, DistributionBlocks.teleporter, stack(Item.steel, 30), stack(Item.densealloy, 40)), - - new Recipe(power, DefenseBlocks.repairturret, stack(Item.iron, 30)), - new Recipe(power, DefenseBlocks.megarepairturret, stack(Item.iron, 20), stack(Item.steel, 30)), - - new Recipe(liquid, DistributionBlocks.conduit, stack(Item.steel, 1)), - new Recipe(liquid, DistributionBlocks.pulseconduit, stack(Item.titanium, 1), stack(Item.steel, 1)), - new Recipe(liquid, DistributionBlocks.liquidrouter, stack(Item.steel, 2)), - new Recipe(liquid, DistributionBlocks.liquidtank, stack(Item.steel, 2)), - new Recipe(liquid, DistributionBlocks.liquidjunction, stack(Item.steel, 2)), - new Recipe(liquid, DistributionBlocks.conduittunnel, stack(Item.titanium, 2), stack(Item.steel, 2)), - - new Recipe(liquid, ProductionBlocks.pump, stack(Item.steel, 10)), - new Recipe(liquid, ProductionBlocks.fluxpump, stack(Item.steel, 10), stack(Item.densealloy, 5)), - - new Recipe(units, DebugBlocks.powerVoid, stack(Item.steel, 10)).setDebug(), - new Recipe(units, DebugBlocks.powerInfinite, stack(Item.steel, 10), stack(Item.densealloy, 5)).setDebug() - ); - - private static ItemStack stack(Item item, int amount){ - return new ItemStack(item, amount); - } - - public static Array all(){ - return list; - } - - public static Recipe getByResult(Block block){ - for(Recipe recipe : list){ - if(recipe.result == block){ - return recipe; - } - } - return null; - } - - public static Array getBy(Section section, Array r){ - for(Recipe recipe : list){ - if(recipe.section == section && !(Vars.android && recipe.desktopOnly) && !(!debug && recipe.debugOnly)) { - r.add(recipe); - } - } - - return r; - } -} diff --git a/core/src/io/anuke/mindustry/resource/Weapon.java b/core/src/io/anuke/mindustry/resource/Weapon.java index 23a9c120f3..d71c05bda0 100644 --- a/core/src/io/anuke/mindustry/resource/Weapon.java +++ b/core/src/io/anuke/mindustry/resource/Weapon.java @@ -5,7 +5,6 @@ import io.anuke.mindustry.entities.Bullet; import io.anuke.mindustry.entities.BulletType; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Unit; -import io.anuke.mindustry.graphics.Fx; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.NetEvents; import io.anuke.ucore.core.Effects; @@ -15,82 +14,30 @@ import io.anuke.ucore.util.Mathf; import io.anuke.ucore.util.Translator; public class Weapon extends Upgrade{ - public static final Weapon - - blaster = new Weapon("blaster", 12, BulletType.shot){ - { - effect = Fx.laserShoot; - length = 2f; - } - }, - triblaster = new Weapon("triblaster", 16, BulletType.spread){ - { - shots = 3; - effect = Fx.spreadShoot; - roundrobin = true; - } - }, - clustergun = new Weapon("clustergun", 26f, BulletType.cluster){ - { - effect = Fx.clusterShoot; - inaccuracy = 17f; - roundrobin = true; - shots = 2; - spacing = 0; - } - }, - beam = new Weapon("beam", 30f, BulletType.beamlaser){ - { - effect = Fx.beamShoot; - inaccuracy = 0; - roundrobin = true; - shake = 2f; - } - }, - vulcan = new Weapon("vulcan", 5, BulletType.vulcan){ - { - effect = Fx.vulcanShoot; - inaccuracy = 5; - roundrobin = true; - shake = 1f; - inaccuracy = 4f; - } - }, - shockgun = new Weapon("shockgun", 36, BulletType.shockshell){ - { - shootsound = "bigshot"; - effect = Fx.shockShoot; - shake = 2f; - roundrobin = true; - shots = 7; - inaccuracy = 15f; - length = 3.5f; - } - }; /**weapon reload in frames*/ - float reload; + protected float reload; /**type of bullet shot*/ - BulletType type; + protected BulletType type; /**sound made when shooting*/ - String shootsound = "shoot"; + protected String shootsound = "shoot"; /**amount of shots per fire*/ - int shots = 1; + protected int shots = 1; /**spacing in degrees between multiple shots, if applicable*/ - float spacing = 12f; + protected float spacing = 12f; /**inaccuracy of degrees of each shot*/ - float inaccuracy = 0f; + protected float inaccuracy = 0f; /**intensity and duration of each shot's screen shake*/ - float shake = 0f; + protected float shake = 0f; /**effect displayed when shooting*/ - Effect effect; + protected Effect effect; /**shoot barrel length*/ - float length = 3f; + protected float length = 3f; /**whether to shoot the weapons in different arms one after another, rather an all at once*/ - boolean roundrobin = false; + protected boolean roundrobin = false; /**translator for vector calulations*/ - Translator tr = new Translator(); - - private Weapon(String name, float reload, BulletType type){ + protected Translator tr = new Translator(); + + protected Weapon(String name, float reload, BulletType type){ super(name); this.reload = reload; this.type = type; diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlockConfigFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlockConfigFragment.java index d9e76f04a3..4cd8ee0cf4 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlockConfigFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlockConfigFragment.java @@ -5,7 +5,7 @@ import com.badlogic.gdx.math.Interpolation; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Align; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.ucore.core.Core; import io.anuke.ucore.core.Graphics; import io.anuke.ucore.scene.Element; diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java index 71b396f051..9f7f316764 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java @@ -5,6 +5,7 @@ import com.badlogic.gdx.graphics.Colors; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.math.Interpolation; import com.badlogic.gdx.utils.Array; +import io.anuke.mindustry.content.Recipes; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.input.InputHandler; import io.anuke.mindustry.resource.*; @@ -81,7 +82,7 @@ public class BlocksFragment implements Fragment{ for (Section sec : Section.values()) { recipes.clear(); - Recipes.getBy(sec, recipes); + io.anuke.mindustry.content.Recipes.getBy(sec, recipes); maxcol = Math.max((int) ((float) recipes.size / rows + 1), maxcol); } diff --git a/core/src/io/anuke/mindustry/ui/fragments/DebugFragment.java b/core/src/io/anuke/mindustry/ui/fragments/DebugFragment.java index 6b3461bd46..a314a841e4 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/DebugFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/DebugFragment.java @@ -4,7 +4,7 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.files.FileHandle; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.units.BaseUnit; -import io.anuke.mindustry.entities.units.UnitTypes; +import io.anuke.mindustry.content.UnitTypes; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.net.Net; import io.anuke.ucore.core.Timers; diff --git a/core/src/io/anuke/mindustry/world/blocks/BaseBlock.java b/core/src/io/anuke/mindustry/world/BaseBlock.java similarity index 98% rename from core/src/io/anuke/mindustry/world/blocks/BaseBlock.java rename to core/src/io/anuke/mindustry/world/BaseBlock.java index 46f7151a73..6e3de43087 100644 --- a/core/src/io/anuke/mindustry/world/blocks/BaseBlock.java +++ b/core/src/io/anuke/mindustry/world/BaseBlock.java @@ -1,10 +1,8 @@ -package io.anuke.mindustry.world.blocks; +package io.anuke.mindustry.world; import com.badlogic.gdx.math.GridPoint2; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.Liquid; -import io.anuke.mindustry.world.Edges; -import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Timers; public abstract class BaseBlock { diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 0a6e14b397..a4c8bd2fd1 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -13,7 +13,6 @@ import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.NetEvents; import io.anuke.mindustry.resource.ItemStack; import io.anuke.mindustry.resource.Liquid; -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; @@ -47,6 +46,8 @@ public class Block extends BaseBlock { public boolean update; /**whether this block has health and can be destroyed*/ public boolean destructible; + /**if true, this block cannot be broken by normal means.*/ + public boolean unbreakable; /**whether this is solid*/ public boolean solid; /**whether this block CAN be solid.*/ diff --git a/core/src/io/anuke/mindustry/world/ColorMapper.java b/core/src/io/anuke/mindustry/world/ColorMapper.java index 58fa795668..01b1195679 100644 --- a/core/src/io/anuke/mindustry/world/ColorMapper.java +++ b/core/src/io/anuke/mindustry/world/ColorMapper.java @@ -6,7 +6,7 @@ import com.badlogic.gdx.utils.IntIntMap; import com.badlogic.gdx.utils.IntMap; import com.badlogic.gdx.utils.IntMap.Entry; import com.badlogic.gdx.utils.ObjectIntMap; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; public class ColorMapper{ /**maps color IDs to their actual RGBA8888 colors*/ diff --git a/core/src/io/anuke/mindustry/world/Placement.java b/core/src/io/anuke/mindustry/world/Placement.java index 5aae07397e..234f8c8f82 100644 --- a/core/src/io/anuke/mindustry/world/Placement.java +++ b/core/src/io/anuke/mindustry/world/Placement.java @@ -3,15 +3,14 @@ package io.anuke.mindustry.world; import com.badlogic.gdx.math.Rectangle; import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Array; +import io.anuke.mindustry.content.Recipes; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.entities.Player; import io.anuke.mindustry.entities.Units; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.graphics.Fx; import io.anuke.mindustry.resource.ItemStack; import io.anuke.mindustry.resource.Recipe; -import io.anuke.mindustry.resource.Recipes; -import io.anuke.mindustry.world.blocks.Blocks; -import io.anuke.mindustry.world.blocks.ProductionBlocks; import io.anuke.ucore.core.Effects; import io.anuke.ucore.entities.Entities; @@ -157,9 +156,9 @@ public class Placement { public static boolean validBreak(Team team, int x, int y){ Tile tile = world.tile(x, y); - if(tile == null || tile.block() == ProductionBlocks.core) return false; + if(tile == null || tile.block().unbreakable) return false; - if(tile.isLinked() && tile.getLinked().block() == ProductionBlocks.core){ + if(tile.isLinked() && tile.getLinked().block().unbreakable){ return false; } diff --git a/core/src/io/anuke/mindustry/world/Tile.java b/core/src/io/anuke/mindustry/world/Tile.java index a0c68f0b11..470a6179d4 100644 --- a/core/src/io/anuke/mindustry/world/Tile.java +++ b/core/src/io/anuke/mindustry/world/Tile.java @@ -5,7 +5,7 @@ import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.reflect.ClassReflection; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.game.Team; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.world.blocks.types.modules.InventoryModule; import io.anuke.mindustry.world.blocks.types.modules.LiquidModule; import io.anuke.mindustry.world.blocks.types.modules.PowerModule; @@ -50,8 +50,8 @@ public class Tile{ this.floor = floor; this.wall = wall; this.rotation = rotation; - this.team = team; changed(); + this.team = team; } public int packedPosition(){ @@ -115,7 +115,6 @@ public class Tile{ return Block.getByID(getWallID()); } - //TODO save team public Team getTeam(){ return Team.values()[team]; } diff --git a/core/src/io/anuke/mindustry/world/WorldGenerator.java b/core/src/io/anuke/mindustry/world/WorldGenerator.java index d4ed1516b1..980648b6b7 100644 --- a/core/src/io/anuke/mindustry/world/WorldGenerator.java +++ b/core/src/io/anuke/mindustry/world/WorldGenerator.java @@ -1,15 +1,16 @@ package io.anuke.mindustry.world; -import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.IntArray; import com.badlogic.gdx.utils.ObjectMap; +import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.blocks.StorageBlocks; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.io.MapTileData; import io.anuke.mindustry.io.MapTileData.TileDataMarker; -import io.anuke.mindustry.world.blocks.Blocks; -import io.anuke.mindustry.world.blocks.ProductionBlocks; import io.anuke.ucore.noise.Noise; +import io.anuke.ucore.util.Log; +import static io.anuke.mindustry.Vars.state; import static io.anuke.mindustry.Vars.world; @@ -22,7 +23,7 @@ public class WorldGenerator { }}; /**Should fill spawns with the correct spawnpoints.*/ - public static void generate(Tile[][] tiles, MapTileData data, Array cores){ + public static void generate(Tile[][] tiles, MapTileData data){ Noise.setSeed(world.getSeed()); IntArray multiblocks = new IntArray(); @@ -32,12 +33,15 @@ public class WorldGenerator { TileDataMarker tile = data.read(); tiles[x][y] = new Tile(x, y, tile.floor, tile.wall, tile.rotation, tile.team); + Team team = Team.values()[tile.team]; + if(tiles[x][y].block().isMultiblock()){ multiblocks.add(tiles[x][y].packedPosition()); } - if(tiles[x][y].block() == ProductionBlocks.core){ - cores.add(tiles[x][y]); + if(tiles[x][y].block() == StorageBlocks.core && + state.teams.has(team)){ + state.teams.get(team).cores.add(tiles[x][y]); } //TODO ores, plants, extra decoration? diff --git a/core/src/io/anuke/mindustry/world/blocks/Blocks.java b/core/src/io/anuke/mindustry/world/blocks/Blocks.java deleted file mode 100644 index bf29b35ece..0000000000 --- a/core/src/io/anuke/mindustry/world/blocks/Blocks.java +++ /dev/null @@ -1,160 +0,0 @@ -package io.anuke.mindustry.world.blocks; - -import io.anuke.mindustry.graphics.DrawLayer; -import io.anuke.mindustry.resource.Item; -import io.anuke.mindustry.resource.ItemStack; -import io.anuke.mindustry.resource.Liquid; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.types.*; - -public class Blocks{ - public static final Block - - air = new Block("air"){ - //no drawing here - public void drawCache(Tile tile){} - - //update floor blocks for effects, if needed - public void draw(Tile tile){} - }, - - //player/enemy spawnpoint - spawn = new Block("spawn"){}, - - blockpart = new BlockPart(){ - - }, - - deepwater = new Floor("deepwater"){{ - variants = 0; - solid = true; - liquidDrop = Liquid.water; - liquid = true; - drawLayer = DrawLayer.water; - }}, - - water = new Floor("water"){{ - variants = 0; - solid = true; - liquidDrop = Liquid.water; - liquid = true; - drawLayer = DrawLayer.water; - }}, - - lava = new Floor("lava"){ - { - variants = 0; - solid = true; - liquidDrop = Liquid.lava; - liquid = true; - drawLayer = DrawLayer.lava; - } - }, - - oil = new Floor("oil"){ - { - variants = 0; - solid = true; - liquidDrop = Liquid.oil; - liquid = true; - drawLayer = DrawLayer.oil; - } - }, - - stone = new Floor("stone"){{ - drops = new ItemStack(Item.stone, 1); - blends = block -> block != this && !(block instanceof Ore); - }}, - - blackstone = new Floor("blackstone"){{ - drops = new ItemStack(Item.stone, 1); - }}, - - iron = new Ore("iron"){{ - drops = new ItemStack(Item.iron, 1); - }}, - - lead = new Ore("lead"){{ - drops = new ItemStack(Item.lead, 1); - }}, - - coal = new Ore("coal"){{ - drops = new ItemStack(Item.coal, 1); - }}, - - titanium = new Ore("titanium"){{ - drops = new ItemStack(Item.titanium, 1); - }}, - - thorium = new Ore("thorium"){{ - drops = new ItemStack(Item.thorium, 1); - }}, - - dirt = new Floor("dirt"){}, - - sand = new Floor("sand"){{ - drops = new ItemStack(Item.silicon, 1); - }}, - - ice = new Floor("ice"){}, - - snow = new Floor("snow"){}, - - grass = new Floor("grass"){}, - - sandblock = new StaticBlock("sandblock"){{ - solid = true; - variants = 3; - }}, - - snowblock = new StaticBlock("snowblock"){{ - solid = true; - variants = 3; - }}, - - stoneblock = new StaticBlock("stoneblock"){{ - solid = true; - variants = 3; - }}, - - blackstoneblock = new StaticBlock("blackstoneblock"){{ - solid = true; - variants = 3; - }}, - - grassblock = new StaticBlock("grassblock"){{ - solid = true; - variants = 2; - }}, - - mossblock = new StaticBlock("mossblock"){{ - solid = true; - }}, - - shrub = new Rock("shrub"){ - - }, - - rock = new Rock("rock"){{ - variants = 2; - varyShadow = true; - drops = new ItemStack(Item.stone, 3); - }}, - - icerock = new Rock("icerock"){{ - variants = 2; - varyShadow = true; - drops = new ItemStack(Item.stone, 3); - }}, - - blackrock = new Rock("blackrock"){{ - variants = 1; - varyShadow = true; - drops = new ItemStack(Item.stone, 3); - }}, - - dirtblock = new StaticBlock("dirtblock"){{ - solid = true; - }}; -} diff --git a/core/src/io/anuke/mindustry/world/blocks/DefenseBlocks.java b/core/src/io/anuke/mindustry/world/blocks/DefenseBlocks.java deleted file mode 100644 index 01748db7a7..0000000000 --- a/core/src/io/anuke/mindustry/world/blocks/DefenseBlocks.java +++ /dev/null @@ -1,83 +0,0 @@ -package io.anuke.mindustry.world.blocks; - -import io.anuke.mindustry.graphics.Fx; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.types.Wall; -import io.anuke.mindustry.world.blocks.types.defense.*; - -public class DefenseBlocks{ - static final int wallHealthMultiplier = 4; - - public static final Block - - stonewall = new Wall("stonewall"){{ - health = 40*wallHealthMultiplier; - }}, - - ironwall = new Wall("ironwall"){{ - health = 80*wallHealthMultiplier; - }}, - - steelwall = new Wall("steelwall"){{ - health = 110*wallHealthMultiplier; - }}, - - titaniumwall = new Wall("titaniumwall"){{ - health = 150*wallHealthMultiplier; - }}, - diriumwall = new Wall("duriumwall"){{ - health = 190*wallHealthMultiplier; - }}, - compositewall = new Wall("compositewall"){{ - health = 270*wallHealthMultiplier; - }}, - steelwalllarge = new Wall("steelwall-large"){{ - health = 110*4*wallHealthMultiplier; - size = 2; - }}, - titaniumwalllarge = new Wall("titaniumwall-large"){{ - health = 150*4*wallHealthMultiplier; - size = 2; - }}, - diriumwalllarge = new Wall("duriumwall-large"){{ - health = 190*4*wallHealthMultiplier; - size = 2; - }}, - titaniumshieldwall = new ShieldedWallBlock("titaniumshieldwall"){{ - health = 150*wallHealthMultiplier; - }}, - - repairturret = new RepairTurret("repairturret"){ - { - range = 30; - reload = 20f; - health = 60; - powerUsed = 0.08f; - } - }, - - megarepairturret = new RepairTurret("megarepairturret"){ - { - range = 44; - reload = 12f; - health = 90; - powerUsed = 0.13f; - size = 2; - } - }, - - shieldgenerator = new ShieldBlock("shieldgenerator"){ - { - health = 100*wallHealthMultiplier; - } - }, - door = new Door("door"){{ - health = 90*wallHealthMultiplier; - }}, - largedoor = new Door("door-large"){{ - openfx = Fx.dooropenlarge; - closefx = Fx.doorcloselarge; - health = 90*4*wallHealthMultiplier; - size = 2; - }}; -} diff --git a/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java deleted file mode 100644 index b3d5837d23..0000000000 --- a/core/src/io/anuke/mindustry/world/blocks/DistributionBlocks.java +++ /dev/null @@ -1,94 +0,0 @@ -package io.anuke.mindustry.world.blocks; - -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.types.distribution.*; -import io.anuke.mindustry.world.blocks.types.generation.PowerDistributor; -import io.anuke.mindustry.world.blocks.types.generation.PowerGenerator; -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; - -public class DistributionBlocks{ - - public static final Block - - conduit = new Conduit("conduit"){{ - health = 45; - }}, - - pulseconduit = new Conduit("pulseconduit"){{ - liquidCapacity = 16f; - liquidFlowFactor = 4.9f; - health = 65; - }}, - - liquidrouter = new LiquidRouter("liquidrouter"){{ - liquidCapacity = 40f; - }}, - - liquidtank = new LiquidRouter("liquidtank"){{ - size = 3; - liquidCapacity = 1500f; - }}, - - conveyor = new Conveyor("conveyor"){{ - }}, - - steelconveyor = new Conveyor("steelconveyor"){{ - health = 55; - speed = 0.04f; - }}, - - pulseconveyor = new Conveyor("poweredconveyor"){{ - health = 75; - speed = 0.09f; - }}, - - router = new Router("router"){{ - - }}, - - multiplexer = new Router("multiplexer"){{ - size = 2; - itemCapacity = 80; - }}, - - vault = new Vault("vault"){{ - size = 3; - }}, - - unloader = new Unloader("unloader"){{ - - }}, - - sortedunloader = new SortedUnloader("sortedunloader"){{ - - }}, - - junction = new Junction("junction"){{ - - }}, - tunnel = new TunnelConveyor("conveyortunnel"){{ - }}, - conduittunnel = new TunnelConduit("conduittunnel"){{ - - }}, - liquidjunction = new LiquidJunction("liquidjunction"){{ - - }}, - powernode = new PowerDistributor("powernode"){{ - }}, - battery = new PowerGenerator("battery"){{ - powerCapacity = 320f; - }}, - batteryLarge = new PowerGenerator("batterylarge"){{ - size = 3; - powerCapacity = 2000f; - }}, - teleporter = new Teleporter("teleporter"){{ - }}, - sorter = new Sorter("sorter"){{ - }}, - splitter = new Splitter("splitter"){{ - }}; -} diff --git a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java deleted file mode 100644 index 9a4874b8c4..0000000000 --- a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java +++ /dev/null @@ -1,331 +0,0 @@ -package io.anuke.mindustry.world.blocks; - -import io.anuke.mindustry.graphics.Fx; -import io.anuke.mindustry.resource.Item; -import io.anuke.mindustry.resource.Liquid; -import io.anuke.mindustry.world.Block; -import io.anuke.mindustry.world.blocks.types.generation.ItemPowerGenerator; -import io.anuke.mindustry.world.blocks.types.generation.LiquidPowerGenerator; -import io.anuke.mindustry.world.blocks.types.generation.NuclearReactor; -import io.anuke.mindustry.world.blocks.types.generation.SolarGenerator; -import io.anuke.mindustry.world.blocks.types.production.*; -import io.anuke.mindustry.world.blocks.types.storage.CoreBlock; - -public class ProductionBlocks{ - public static final Block - - core = new CoreBlock("core"){}, - - pump = new Pump("pump"){ - { - pumpAmount = 0.8f; - } - }, - - fluxpump = new Pump("fluxpump"){ - { - pumpAmount = 1.2f; - } - }, - - smelter = new Smelter("smelter"){ - { - health = 70; - inputs = new Item[]{Item.iron}; - fuel = Item.coal; - result = Item.steel; - craftTime = 25f; - } - }, - - alloysmelter = new Smelter("alloysmelter"){ - { - health = 90; - inputs = new Item[]{Item.titanium, Item.steel}; - fuel = Item.coal; - result = Item.densealloy; - burnDuration = 45f; - craftTime = 25f; - } - }, - - powersmelter = new PowerSmelter("powersmelter"){ - { - /* - health = 90; - inputs = new Item[]{Item.titanium, Item.steel}; - fuel = Item.coal; - results = Item.dirium; - burnDuration = 45f; - craftTime = 25f; - size = 2;*/ - } - }, - - cryofluidmixer = new LiquidMixer("cryofluidmixer"){ - { - health = 200; - inputLiquid = Liquid.water; - outputLiquid = Liquid.cryofluid; - inputItem = Item.titanium; - liquidPerItem = 50f; - itemCapacity = 50; - powerUse = 0.1f; - size = 2; - } - }, - - coalextractor = new LiquidCrafter("coalextractor"){ - { - input = Item.stone; - inputAmount = 6; - inputLiquid = Liquid.water; - liquidAmount = 19f; - output = Item.coal; - health = 50; - purifyTime = 50; - health = 60; - } - }, - - titaniumextractor = new LiquidCrafter("titaniumextractor"){ - { - input = Item.stone; - inputAmount = 8; - inputLiquid = Liquid.water; - liquidAmount = 40f; - liquidCapacity = 41f; - purifyTime = 60; - output = Item.titanium; - health = 70; - } - }, - - oilrefinery = new LiquidCrafter("oilrefinery"){ - { - inputLiquid = Liquid.oil; - liquidAmount = 55f; - liquidCapacity = 56f; - purifyTime = 65; - output = Item.coal; - health = 80; - craftEffect = Fx.purifyoil; - } - }, - - stoneformer = new LiquidCrafter("stoneformer"){ - { - input = null; - inputLiquid = Liquid.lava; - liquidAmount = 16f; - liquidCapacity = 21f; - purifyTime = 12; - output = Item.stone; - health = 80; - craftEffect = Fx.purifystone; - } - }, - - lavasmelter = new LiquidCrafter("lavasmelter"){ - { - input = Item.iron; - inputAmount = 1; - inputLiquid = Liquid.lava; - liquidAmount = 40f; - liquidCapacity = 41f; - purifyTime = 30; - output = Item.steel; - health = 80; - craftEffect = Fx.purifystone; - } - }, - - siliconextractor = new LiquidCrafter("siliconextractor"){ - { - input = Item.stone; - inputAmount = 5; - inputLiquid = Liquid.water; - liquidAmount = 18.99f; - output = Item.silicon; - health = 50; - purifyTime = 50; - } - }, - - stonedrill = new Drill("stonedrill"){ - { - resource = Blocks.stone; - result = Item.stone; - drillTime = 240; - } - }, - - irondrill = new Drill("irondrill"){ - { - resource = Blocks.iron; - result = Item.iron; - drillTime = 360; - } - }, - - leaddrill = new Drill("leaddrill"){ - { - resource = Blocks.lead; - result = Item.lead; - drillTime = 400; - } - }, - - coaldrill = new Drill("coaldrill"){ - { - resource = Blocks.coal; - result = Item.coal; - drillTime = 420; - } - }, - - thoriumdrill = new Drill("thoriumdrill"){ - { - resource = Blocks.thorium; - result = Item.thorium; - drillTime = 600; - } - }, - - titaniumdrill = new Drill("titaniumdrill"){ - { - resource = Blocks.titanium; - result = Item.titanium; - drillTime = 540; - } - }, - - laserdrill = new GenericDrill("laserdrill"){ - { - drillTime = 200; - size = 2; - powerUse = 0.2f; - hasPower = true; - } - }, - - nucleardrill = new GenericDrill("nucleardrill"){ - { - drillTime = 240; - size = 3; - powerUse = 0.32f; - hasPower = true; - } - }, - - plasmadrill = new GenericDrill("plasmadrill"){ - { - inputLiquid = Liquid.plasma; - drillTime = 240; - size = 4; - powerUse = 0.16f; - hasLiquids = true; - hasPower = true; - } - }, - - quartzextractor = new GenericDrill("quartzextractor"){ - { - powerUse = 0.1f; - resource = Blocks.sand; - result = Item.silicon; - drillTime = 320; - size = 2; - } - }, - - waterextractor = new SolidPump("waterextractor"){ - { - result = Liquid.water; - powerUse = 0.1f; - pumpAmount = 0.4f; - size = 2; - liquidCapacity = 30f; - } - }, - - oilextractor = new SolidPump("oilextractor"){ - { - result = Liquid.oil; - powerUse = 0.5f; - pumpAmount = 0.4f; - size = 3; - liquidCapacity = 80f; - } - }, - - cultivator = new GenericDrill("cultivator"){ - { - resource = Blocks.grass; - result = Item.biomatter; - inputLiquid = Liquid.water; - liquidUse = 0.1f; - drillTime = 300; - size = 2; - hasLiquids = true; - hasPower = true; - } - }, - - coalgenerator = new ItemPowerGenerator("coalgenerator"){ - { - generateItem = Item.coal; - powerOutput = 0.04f; - powerCapacity = 40f; - } - }, - thermalgenerator = new LiquidPowerGenerator("thermalgenerator"){ - { - generateLiquid = Liquid.lava; - maxLiquidGenerate = 0.5f; - powerPerLiquid = 0.08f; - powerCapacity = 40f; - generateEffect = Fx.redgeneratespark; - } - }, - combustiongenerator = new LiquidPowerGenerator("combustiongenerator"){ - { - generateLiquid = Liquid.oil; - maxLiquidGenerate = 0.4f; - powerPerLiquid = 0.12f; - powerCapacity = 40f; - } - }, - rtgenerator = new ItemPowerGenerator("rtgenerator"){ - { - generateItem = Item.thorium; - powerCapacity = 40f; - powerOutput = 0.03f; - itemDuration = 240f; - } - }, - solarpanel = new SolarGenerator("solarpanel"){ - { - generation = 0.003f; - } - }, - largesolarpanel = new SolarGenerator("largesolarpanel"){ - { - size = 3; - generation = 0.012f; - } - }, - nuclearReactor = new NuclearReactor("nuclearreactor"){ - { - size = 3; - health = 600; - breaktime *= 2.3f; - } - }, - weaponFactory = new WeaponFactory("weaponfactory"){ - { - size = 2; - health = 250; - } - }; -} diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Ore.java b/core/src/io/anuke/mindustry/world/blocks/types/Ore.java index d4d11d2e0a..1dc567e078 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Ore.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/Ore.java @@ -1,6 +1,6 @@ package io.anuke.mindustry.world.blocks.types; -import io.anuke.mindustry.world.blocks.Blocks; +import io.anuke.mindustry.content.blocks.Blocks; public class Ore extends Floor{ diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/LiquidTurret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/LiquidTurret.java index 130001ce93..ba6d28644d 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/LiquidTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/LiquidTurret.java @@ -1,10 +1,11 @@ package io.anuke.mindustry.world.blocks.types.defense; +import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.resource.Liquid; import io.anuke.mindustry.world.Tile; public abstract class LiquidTurret extends Turret{ - public Liquid ammoLiquid = Liquid.water; + public Liquid ammoLiquid = Liquids.water; public float liquidCapacity = 60f; public float liquidPerShot = 1f; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java index a799543f44..fbf2d4d9e1 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Conveyor.java @@ -3,6 +3,7 @@ package io.anuke.mindustry.world.blocks.types.distribution; import com.badlogic.gdx.utils.LongArray; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.resource.Item; +import io.anuke.mindustry.content.Items; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.BlockGroup; import io.anuke.mindustry.world.Layer; @@ -32,7 +33,7 @@ public class Conveyor extends Block{ private final Translator tr1 = new Translator(); private final Translator tr2 = new Translator(); - public float speed = 0.02f; + public float speed = 0f; protected Conveyor(String name) { super(name); @@ -53,7 +54,7 @@ public class Conveyor extends Block{ byte rotation = tile.getRotation(); Draw.rect(name() + - (Timers.time() % ((20 / 100f) / speed) < (10 / 100f) / speed && acceptItem(Item.stone, tile, null) ? "" : "move"), + (Timers.time() % ((20 / 100f) / speed) < (10 / 100f) / speed && acceptItem(Items.stone, tile, null) ? "" : "move"), tile.worldx(), tile.worldy(), rotation * 90); } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidJunction.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidJunction.java index 610b9b31a4..fb92234ad3 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidJunction.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/LiquidJunction.java @@ -33,8 +33,8 @@ public class LiquidJunction extends LiquidBlock{ Tile to = tile.getNearby(dir); Timers.run(20f, () -> { - if(to.block() instanceof LiquidBlock && ((LiquidBlock)to.block()).acceptLiquid(to, tile, liquid, amount)) - ((LiquidBlock)to.block()).handleLiquid(to, tile, liquid, amount); + if(to.block().hasLiquids && to.block().acceptLiquid(to, tile, liquid, amount)) + to.block().handleLiquid(to, tile, liquid, amount); }); } @@ -43,7 +43,7 @@ public class LiquidJunction extends LiquidBlock{ int dir = source.relativeTo(dest.x, dest.y); dir = (dir+4)%4; Tile to = dest.getNearby(dir); - return to != null && to.block() instanceof LiquidBlock && - ((LiquidBlock)to.block()).acceptLiquid(to, dest, liquid, amount); + return to != null && to.block().hasLiquids && + to.block().acceptLiquid(to, dest, liquid, amount); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java index b1a9199af8..3c40dd146f 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/distribution/Sorter.java @@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.resource.Item; +import io.anuke.mindustry.content.Items; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.BlockGroup; import io.anuke.mindustry.world.Tile; @@ -143,7 +144,7 @@ public class Sorter extends Block{ } public static class SorterEntity extends TileEntity{ - public Item sortItem = Item.iron; + public Item sortItem = Items.iron; @Override public void write(DataOutputStream stream) throws IOException{ 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 984ae9fe81..cdfc9c19d0 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 @@ -1,10 +1,12 @@ package io.anuke.mindustry.world.blocks.types.generation; import com.badlogic.gdx.graphics.Color; +import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.effect.DamageArea; import io.anuke.mindustry.graphics.Fx; import io.anuke.mindustry.resource.Item; +import io.anuke.mindustry.content.Items; import io.anuke.mindustry.resource.Liquid; import io.anuke.mindustry.world.BarType; import io.anuke.mindustry.world.BlockBar; @@ -41,8 +43,8 @@ public class NuclearReactor extends LiquidPowerGenerator{ public NuclearReactor(String name) { super(name); - generateItem = Item.thorium; - generateLiquid = Liquid.water; + generateItem = Items.thorium; + generateLiquid = Liquids.water; itemCapacity = 30; liquidCapacity = 50; explosionEffect = Fx.nuclearShockwave; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/modules/LiquidModule.java b/core/src/io/anuke/mindustry/world/blocks/types/modules/LiquidModule.java index a0104e6220..6ff00cc741 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/modules/LiquidModule.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/modules/LiquidModule.java @@ -1,5 +1,6 @@ package io.anuke.mindustry.world.blocks.types.modules; +import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.resource.Liquid; import io.anuke.mindustry.world.blocks.types.BlockModule; @@ -9,7 +10,7 @@ import java.io.IOException; public class LiquidModule extends BlockModule { public float amount; - public Liquid liquid = Liquid.none; + public Liquid liquid = Liquids.none; @Override public void write(DataOutputStream stream) throws IOException { diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/GenericDrill.java b/core/src/io/anuke/mindustry/world/blocks/types/production/GenericDrill.java index d01f84c4ad..94742a30d1 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/GenericDrill.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/GenericDrill.java @@ -1,6 +1,7 @@ package io.anuke.mindustry.world.blocks.types.production; import com.badlogic.gdx.utils.Array; +import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.Liquid; @@ -14,7 +15,7 @@ public class GenericDrill extends Drill{ public float powerUse = 0.08f; /**liquid use per frame.*/ protected float liquidUse = 0.1f; - protected Liquid inputLiquid = Liquid.water; + protected Liquid inputLiquid = Liquids.water; private Array toAdd = new Array<>(); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/LiquidMixer.java b/core/src/io/anuke/mindustry/world/blocks/types/production/LiquidMixer.java index c4d0a0aded..aac38831a3 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/LiquidMixer.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/LiquidMixer.java @@ -1,5 +1,6 @@ package io.anuke.mindustry.world.blocks.types.production; +import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.resource.Liquid; @@ -8,8 +9,8 @@ import io.anuke.mindustry.world.blocks.types.LiquidBlock; import io.anuke.ucore.core.Timers; public class LiquidMixer extends LiquidBlock{ - protected Liquid inputLiquid = Liquid.none; - protected Liquid outputLiquid = Liquid.none; + protected Liquid inputLiquid = Liquids.none; + protected Liquid outputLiquid = Liquids.none; protected Item inputItem = null; protected float liquidPerItem = 50f; protected float powerUse = 0f; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/SolidPump.java b/core/src/io/anuke/mindustry/world/blocks/types/production/SolidPump.java index 33bd73ba2d..93d12faad6 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/SolidPump.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/SolidPump.java @@ -1,13 +1,14 @@ package io.anuke.mindustry.world.blocks.types.production; import com.badlogic.gdx.utils.Array; +import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.resource.Liquid; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Timers; /**Pump that makes liquid from solids and takes in power. Only works on solid floor blocks.*/ public class SolidPump extends Pump { - protected Liquid result = Liquid.water; + protected Liquid result = Liquids.water; /**Power use per liquid unit.*/ protected float powerUse = 0.1f; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/WeaponFactory.java b/core/src/io/anuke/mindustry/world/blocks/types/production/WeaponFactory.java index 11b55a631c..11f744cdfb 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/WeaponFactory.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/WeaponFactory.java @@ -5,7 +5,7 @@ import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.NetEvents; import io.anuke.mindustry.resource.ItemStack; import io.anuke.mindustry.resource.Upgrade; -import io.anuke.mindustry.resource.UpgradeRecipes; +import io.anuke.mindustry.content.UpgradeRecipes; import io.anuke.mindustry.resource.Weapon; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/storage/CoreBlock.java b/core/src/io/anuke/mindustry/world/blocks/types/storage/CoreBlock.java index a403292aff..2392a215ba 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/storage/CoreBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/storage/CoreBlock.java @@ -5,7 +5,6 @@ import io.anuke.mindustry.resource.Item; import io.anuke.mindustry.world.Tile; import static io.anuke.mindustry.Vars.state; -import static io.anuke.mindustry.Vars.world; public class CoreBlock extends StorageBlock { protected int capacity = 1000; @@ -13,9 +12,9 @@ public class CoreBlock extends StorageBlock { public CoreBlock(String name) { super(name); - health = 800; solid = true; destructible = true; + unbreakable = true; size = 3; hasInventory = false; } @@ -23,7 +22,10 @@ public class CoreBlock extends StorageBlock { public void onDestroyed(Tile tile){ //TODO more dramatic effects super.onDestroyed(tile); - world.getAllyCores().removeValue(tile, true); + + if(state.teams.has(tile.getTeam())){ + state.teams.get(tile.getTeam()).cores.removeValue(tile, true); + } } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/types/storage/SortedUnloader.java b/core/src/io/anuke/mindustry/world/blocks/types/storage/SortedUnloader.java index c50cdc165f..5c917e94e7 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/storage/SortedUnloader.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/storage/SortedUnloader.java @@ -4,6 +4,7 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.resource.Item; +import io.anuke.mindustry.content.Items; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.scene.style.TextureRegionDrawable; @@ -26,7 +27,7 @@ public class SortedUnloader extends Unloader { public void update(Tile tile){ SortedUnloaderEntity entity = tile.entity(); - if(entity.inventory.totalItems() == 0 && entity.timer.get(timerUnload, 5)){ + if(entity.inventory.totalItems() == 0 && entity.timer.get(timerUnload, speed)){ tile.allNearby(other -> { if(other.block() instanceof StorageBlock && entity.inventory.totalItems() == 0 && ((StorageBlock)other.block()).hasItem(other, entity.sortItem)){ @@ -103,7 +104,7 @@ public class SortedUnloader extends Unloader { } public static class SortedUnloaderEntity extends TileEntity{ - public Item sortItem = Item.iron; + public Item sortItem = Items.iron; @Override public void write(DataOutputStream stream) throws IOException { diff --git a/core/src/io/anuke/mindustry/world/blocks/types/storage/Unloader.java b/core/src/io/anuke/mindustry/world/blocks/types/storage/Unloader.java index 338f715e68..1f12d73352 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/storage/Unloader.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/storage/Unloader.java @@ -7,6 +7,7 @@ import io.anuke.mindustry.world.Tile; public class Unloader extends Block { protected final int timerUnload = timers++; + protected int speed = 5; public Unloader(String name){ super(name); @@ -18,7 +19,7 @@ public class Unloader extends Block { @Override public void update(Tile tile){ - if(tile.entity.inventory.totalItems() == 0 && tile.entity.timer.get(timerUnload, 5)){ + if(tile.entity.inventory.totalItems() == 0 && tile.entity.timer.get(timerUnload, speed)){ tile.allNearby(other -> { if(other.block() instanceof StorageBlock && tile.entity.inventory.totalItems() == 0 && ((StorageBlock)other.block()).hasItem(other, null)){ diff --git a/kryonet/src/io/anuke/kryonet/KryoServer.java b/kryonet/src/io/anuke/kryonet/KryoServer.java index 876f0ac3a3..c7aa93921b 100644 --- a/kryonet/src/io/anuke/kryonet/KryoServer.java +++ b/kryonet/src/io/anuke/kryonet/KryoServer.java @@ -71,7 +71,7 @@ public class KryoServer implements ServerProvider { Log.info("&bRecieved connection: {0} / {1}. Kryonet ID: {2}", c.id, c.addressTCP, connection.getID()); connections.add(kn); - Gdx.app.postRunnable(() -> Net.handleServerReceived(kn.id, c)); + Gdx.app.postRunnable(() -> Net.handleServerReceived(kn.id, c)); } @Override diff --git a/server/src/io/anuke/mindustry/server/MindustryServer.java b/server/src/io/anuke/mindustry/server/MindustryServer.java index 8ab8e82e0c..0842c25dfd 100644 --- a/server/src/io/anuke/mindustry/server/MindustryServer.java +++ b/server/src/io/anuke/mindustry/server/MindustryServer.java @@ -4,7 +4,7 @@ import io.anuke.mindustry.core.Logic; import io.anuke.mindustry.core.NetCommon; import io.anuke.mindustry.core.NetServer; import io.anuke.mindustry.core.World; -import io.anuke.mindustry.io.BlockLoader; +import io.anuke.mindustry.core.ContentLoader; import io.anuke.mindustry.io.BundleLoader; import io.anuke.ucore.modules.ModuleCore; @@ -17,7 +17,7 @@ public class MindustryServer extends ModuleCore { headless = true; BundleLoader.load(); - BlockLoader.load(); + ContentLoader.load(); module(logic = new Logic()); module(world = new World());