diff --git a/core/assets-raw/sprites/blocks/turrets/flameturret-shoot.png b/core/assets-raw/sprites/blocks/turrets/flameturret-shoot.png new file mode 100644 index 0000000000..c03ba1b198 Binary files /dev/null and b/core/assets-raw/sprites/blocks/turrets/flameturret-shoot.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/flameturret.png b/core/assets-raw/sprites/blocks/turrets/flameturret.png index 4f92d30ec7..91338f693f 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/flameturret.png and b/core/assets-raw/sprites/blocks/turrets/flameturret.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/railgunturret-heat.png b/core/assets-raw/sprites/blocks/turrets/railgunturret-heat.png new file mode 100644 index 0000000000..032e16f283 Binary files /dev/null and b/core/assets-raw/sprites/blocks/turrets/railgunturret-heat.png differ diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index 2edea49d09..5ec505a637 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -13,42 +13,42 @@ background index: -1 conduit-bottom rotate: false - xy: 897, 417 + xy: 917, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduit-top rotate: false - xy: 917, 417 + xy: 937, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduittunnel rotate: false - xy: 927, 417 + xy: 947, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyor rotate: false - xy: 937, 417 + xy: 957, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyormove rotate: false - xy: 947, 417 + xy: 967, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyortunnel rotate: false - xy: 957, 417 + xy: 658, 207 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -62,42 +62,42 @@ core index: -1 junction rotate: false - xy: 936, 397 + xy: 956, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidjunction rotate: false - xy: 373, 114 + xy: 393, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter rotate: false - xy: 383, 114 + xy: 403, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-bottom rotate: false - xy: 393, 113 + xy: 413, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-liquid rotate: false - xy: 403, 113 + xy: 363, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidrouter-top rotate: false - xy: 413, 113 + xy: 373, 104 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -132,70 +132,70 @@ multiplexer index: -1 poweredconveyor rotate: false - xy: 572, 161 + xy: 572, 151 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 poweredconveyormove rotate: false - xy: 582, 165 + xy: 582, 155 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-bottom rotate: false - xy: 592, 150 + xy: 592, 140 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulseconduit-top rotate: false - xy: 582, 145 + xy: 677, 281 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 router rotate: false - xy: 766, 384 + xy: 806, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sortedunloader rotate: false - xy: 433, 144 + xy: 433, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sorter rotate: false - xy: 443, 144 + xy: 443, 134 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 splitter rotate: false - xy: 433, 134 + xy: 463, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyor rotate: false - xy: 453, 144 + xy: 433, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelconveyormove rotate: false - xy: 433, 124 + xy: 443, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -209,7 +209,7 @@ teleporter-top index: -1 unloader rotate: false - xy: 483, 104 + xy: 513, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -223,7 +223,7 @@ vault index: -1 vault-icon rotate: false - xy: 493, 114 + xy: 503, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -272,21 +272,21 @@ blackstone3 index: -1 blackstoneblock1 rotate: false - xy: 713, 311 + xy: 713, 287 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock2 rotate: false - xy: 713, 301 + xy: 777, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blackstoneblock3 rotate: false - xy: 713, 291 + xy: 787, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -300,49 +300,49 @@ blackstoneedge index: -1 coal1 rotate: false - xy: 837, 417 + xy: 857, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coal2 rotate: false - xy: 847, 417 + xy: 867, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 coal3 rotate: false - xy: 857, 417 + xy: 877, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 deepwater rotate: false - xy: 658, 207 + xy: 777, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt1 rotate: false - xy: 668, 207 + xy: 787, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt2 rotate: false - xy: 777, 407 + xy: 797, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt3 rotate: false - xy: 787, 407 + xy: 807, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -356,35 +356,35 @@ dirtedge index: -1 grass1 rotate: false - xy: 867, 407 + xy: 887, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass2 rotate: false - xy: 877, 407 + xy: 897, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass3 rotate: false - xy: 887, 407 + xy: 907, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock1 rotate: false - xy: 897, 407 + xy: 917, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grassblock2 rotate: false - xy: 907, 407 + xy: 927, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -398,21 +398,21 @@ grassedge index: -1 ice1 rotate: false - xy: 917, 407 + xy: 937, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice2 rotate: false - xy: 927, 407 + xy: 947, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice3 rotate: false - xy: 937, 407 + xy: 957, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -426,70 +426,70 @@ iceedge index: -1 icerock1 rotate: false - xy: 947, 407 + xy: 967, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerock2 rotate: false - xy: 957, 407 + xy: 716, 389 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow1 rotate: false - xy: 967, 407 + xy: 726, 390 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow1 rotate: false - xy: 967, 407 + xy: 726, 390 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerockshadow2 rotate: false - xy: 716, 389 + xy: 736, 390 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rockshadow2 rotate: false - xy: 716, 389 + xy: 736, 390 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron1 rotate: false - xy: 726, 390 + xy: 746, 390 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron2 rotate: false - xy: 736, 390 + xy: 756, 394 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 iron3 rotate: false - xy: 746, 390 + xy: 766, 394 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lava rotate: false - xy: 946, 397 + xy: 966, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -503,35 +503,35 @@ lavaedge index: -1 lead1 rotate: false - xy: 966, 397 + xy: 1013, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lead2 rotate: false - xy: 1003, 411 + xy: 363, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lead3 rotate: false - xy: 1013, 411 + xy: 373, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 mossblock rotate: false - xy: 383, 104 + xy: 403, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 oil rotate: false - xy: 393, 103 + xy: 413, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -545,56 +545,56 @@ oiledge index: -1 rock1 rotate: false - xy: 678, 207 + xy: 786, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rock2 rotate: false - xy: 756, 384 + xy: 796, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand1 rotate: false - xy: 796, 387 + xy: 836, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand2 rotate: false - xy: 806, 387 + xy: 846, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand3 rotate: false - xy: 816, 387 + xy: 856, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock1 rotate: false - xy: 826, 387 + xy: 866, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock2 rotate: false - xy: 836, 387 + xy: 876, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sandblock3 rotate: false - xy: 846, 387 + xy: 886, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -608,56 +608,56 @@ sandedge index: -1 shrub rotate: false - xy: 936, 387 + xy: 681, 231 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shrubshadow rotate: false - xy: 946, 387 + xy: 682, 221 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow1 rotate: false - xy: 681, 231 + xy: 423, 123 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow2 rotate: false - xy: 682, 221 + xy: 423, 113 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow3 rotate: false - xy: 423, 143 + xy: 423, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock1 rotate: false - xy: 423, 133 + xy: 433, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock2 rotate: false - xy: 423, 123 + xy: 443, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snowblock3 rotate: false - xy: 423, 113 + xy: 433, 134 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -671,42 +671,42 @@ snowedge index: -1 stone1 rotate: false - xy: 453, 134 + xy: 453, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone2 rotate: false - xy: 473, 144 + xy: 463, 134 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone3 rotate: false - xy: 433, 104 + xy: 483, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock1 rotate: false - xy: 443, 114 + xy: 443, 104 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock2 rotate: false - xy: 453, 124 + xy: 453, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneblock3 rotate: false - xy: 463, 134 + xy: 463, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -720,49 +720,49 @@ stoneedge index: -1 thorium1 rotate: false - xy: 473, 134 + xy: 473, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium2 rotate: false - xy: 493, 144 + xy: 483, 134 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium3 rotate: false - xy: 453, 104 + xy: 463, 104 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium1 rotate: false - xy: 463, 114 + xy: 473, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium2 rotate: false - xy: 473, 124 + xy: 483, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanium3 rotate: false - xy: 483, 134 + xy: 493, 134 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 water rotate: false - xy: 513, 143 + xy: 513, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -776,28 +776,28 @@ wateredge index: -1 block-middle rotate: false - xy: 807, 417 + xy: 827, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pump-liquid rotate: false - xy: 807, 417 + xy: 827, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conduit-liquid rotate: false - xy: 907, 417 + xy: 927, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 cross-1 rotate: false - xy: 967, 417 + xy: 668, 207 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -825,28 +825,28 @@ cross-4 index: -1 enemyspawn rotate: false - xy: 837, 407 + xy: 857, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 playerspawn rotate: false - xy: 413, 103 + xy: 582, 165 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ripples rotate: false - xy: 669, 229 + xy: 713, 333 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 shadow rotate: false - xy: 670, 217 + xy: 713, 321 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -867,14 +867,14 @@ batterylarge index: -1 combustiongenerator rotate: false - xy: 867, 417 + xy: 887, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 combustiongenerator-top rotate: false - xy: 877, 417 + xy: 897, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -944,7 +944,7 @@ largesolarpanel index: -1 liquidcombustiongenerator rotate: false - xy: 363, 113 + xy: 383, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -972,14 +972,14 @@ nuclearreactor-lights index: -1 powerinfinite rotate: false - xy: 572, 151 + xy: 592, 160 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 powernode rotate: false - xy: 582, 155 + xy: 592, 150 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -993,28 +993,28 @@ powernodelarge index: -1 powervoid rotate: false - xy: 592, 160 + xy: 582, 145 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rtgenerator rotate: false - xy: 776, 387 + xy: 816, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rtgenerator-top rotate: false - xy: 786, 387 + xy: 826, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shieldgenerator rotate: false - xy: 886, 387 + xy: 926, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1028,7 +1028,7 @@ shieldprojector index: -1 solarpanel rotate: false - xy: 423, 103 + xy: 453, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1042,7 +1042,7 @@ teleporter index: -1 thermalgenerator rotate: false - xy: 463, 124 + xy: 463, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1154,56 +1154,56 @@ cultivator-top index: -1 extractor rotate: false - xy: 847, 407 + xy: 867, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 fluxpump rotate: false - xy: 857, 407 + xy: 877, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill rotate: false - xy: 756, 394 + xy: 776, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill-rotator rotate: false - xy: 766, 394 + xy: 786, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill-rotator rotate: false - xy: 766, 394 + xy: 786, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 irondrill-top rotate: false - xy: 776, 397 + xy: 796, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 itemsource rotate: false - xy: 916, 397 + xy: 936, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 itemvoid rotate: false - xy: 926, 397 + xy: 946, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1231,21 +1231,21 @@ laserdrill-top index: -1 lavasmelter rotate: false - xy: 956, 397 + xy: 1003, 411 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidsource rotate: false - xy: 363, 103 + xy: 383, 104 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 melter rotate: false - xy: 373, 104 + xy: 393, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1308,7 +1308,7 @@ oilextractor-top index: -1 oilrefinery rotate: false - xy: 403, 103 + xy: 572, 161 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1392,63 +1392,63 @@ siliconsmelter-top index: -1 pulverizer rotate: false - xy: 592, 140 + xy: 687, 281 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pulverizer-rotator rotate: false - xy: 677, 281 + xy: 697, 281 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 pump rotate: false - xy: 687, 281 + xy: 678, 207 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 reinforceddrill rotate: false - xy: 697, 281 + xy: 756, 384 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 reinforceddrill-rotator rotate: false - xy: 707, 281 + xy: 766, 384 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 reinforceddrill-top rotate: false - xy: 717, 281 + xy: 776, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 separator rotate: false - xy: 856, 387 + xy: 896, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 separator-liquid rotate: false - xy: 866, 387 + xy: 906, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 siliconextractor rotate: false - xy: 956, 387 + xy: 423, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1462,56 +1462,56 @@ siliconsmelter index: -1 smelter rotate: false - xy: 966, 387 + xy: 423, 133 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steeldrill rotate: false - xy: 443, 134 + xy: 453, 134 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steeldrill-rotator rotate: false - xy: 463, 144 + xy: 473, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steeldrill-top rotate: false - xy: 433, 114 + xy: 433, 104 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stonedrill rotate: false - xy: 483, 144 + xy: 473, 134 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneformer rotate: false - xy: 443, 104 + xy: 493, 144 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill rotate: false - xy: 463, 104 + xy: 473, 104 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumdrill-top rotate: false - xy: 473, 114 + xy: 483, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1546,7 +1546,7 @@ waterextractor-top index: -1 block-1 rotate: false - xy: 797, 417 + xy: 817, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1588,7 +1588,7 @@ chainturret index: -1 doubleturret rotate: false - xy: 817, 407 + xy: 837, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1607,6 +1607,13 @@ flameturret orig: 10, 10 offset: 0, 0 index: -1 +flameturret-shoot + rotate: false + xy: 93, 1 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 fornaxcannon rotate: false xy: 927, 453 @@ -1616,14 +1623,14 @@ fornaxcannon index: -1 gatlingturret rotate: false - xy: 93, 1 + xy: 105, 1 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 laserturret rotate: false - xy: 666, 253 + xy: 658, 217 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1651,28 +1658,35 @@ missileturret index: -1 railgunturret rotate: false - xy: 658, 217 + xy: 672, 241 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +railgunturret-heat + rotate: false + xy: 669, 229 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 repairturret rotate: false - xy: 672, 241 + xy: 670, 217 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 shotgunturret rotate: false - xy: 713, 333 + xy: 713, 309 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 teslaturret rotate: false - xy: 713, 321 + xy: 713, 297 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1728,14 +1742,14 @@ walkerfactory-top-open index: -1 compositewall rotate: false - xy: 887, 417 + xy: 907, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 door rotate: false - xy: 797, 407 + xy: 817, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1756,14 +1770,14 @@ door-large-open index: -1 door-open rotate: false - xy: 807, 407 + xy: 827, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 duriumwall rotate: false - xy: 827, 407 + xy: 847, 407 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1777,14 +1791,14 @@ duriumwall-large index: -1 ironwall rotate: false - xy: 786, 397 + xy: 806, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 steelwall rotate: false - xy: 443, 124 + xy: 443, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1798,21 +1812,21 @@ steelwall-large index: -1 stonewall rotate: false - xy: 453, 114 + xy: 453, 104 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumshieldwall rotate: false - xy: 483, 124 + xy: 493, 124 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titaniumwall rotate: false - xy: 493, 134 + xy: 483, 104 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1875,112 +1889,112 @@ laserfull index: -1 shell rotate: false - xy: 876, 387 + xy: 916, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot rotate: false - xy: 916, 387 + xy: 956, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot-long rotate: false - xy: 926, 387 + xy: 966, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanshell rotate: false - xy: 473, 104 + xy: 493, 114 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-biomatter rotate: false - xy: 796, 397 + xy: 816, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-coal rotate: false - xy: 806, 397 + xy: 826, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-densealloy rotate: false - xy: 816, 397 + xy: 836, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-iron rotate: false - xy: 826, 397 + xy: 846, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-lead rotate: false - xy: 836, 397 + xy: 856, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-plastic rotate: false - xy: 846, 397 + xy: 866, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-sand rotate: false - xy: 856, 397 + xy: 876, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-silicon rotate: false - xy: 866, 397 + xy: 886, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-steel rotate: false - xy: 876, 397 + xy: 896, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-stone rotate: false - xy: 886, 397 + xy: 906, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-thorium rotate: false - xy: 896, 397 + xy: 916, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 item-titanium rotate: false - xy: 906, 397 + xy: 926, 397 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2198,7 +2212,7 @@ icon-admin-small index: -1 icon-areaDelete rotate: false - xy: 105, 1 + xy: 117, 1 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2212,28 +2226,28 @@ icon-arrow index: -1 icon-arrow-down rotate: false - xy: 117, 1 + xy: 572, 244 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-arrow-left rotate: false - xy: 572, 244 + xy: 606, 184 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-arrow-right rotate: false - xy: 606, 184 + xy: 620, 198 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-arrow-up rotate: false - xy: 620, 198 + xy: 634, 212 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2261,7 +2275,7 @@ icon-cancel index: -1 icon-chat rotate: false - xy: 634, 212 + xy: 646, 212 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2296,21 +2310,21 @@ icon-close-over index: -1 icon-crafting rotate: false - xy: 646, 212 + xy: 224, 91 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-cursor rotate: false - xy: 224, 91 + xy: 224, 79 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-defense rotate: false - xy: 224, 79 + xy: 592, 170 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2331,7 +2345,7 @@ icon-discord index: -1 icon-distribution rotate: false - xy: 592, 170 + xy: 189, 2 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2429,14 +2443,14 @@ icon-grid index: -1 icon-hold rotate: false - xy: 189, 2 + xy: 201, 2 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-holdDelete rotate: false - xy: 201, 2 + xy: 213, 2 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2457,7 +2471,7 @@ icon-host index: -1 icon-info rotate: false - xy: 213, 2 + xy: 225, 2 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2485,7 +2499,7 @@ icon-link index: -1 icon-liquid rotate: false - xy: 225, 2 + xy: 638, 304 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2520,14 +2534,14 @@ icon-loading index: -1 icon-logic rotate: false - xy: 638, 304 + xy: 638, 292 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-menu rotate: false - xy: 638, 292 + xy: 650, 289 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2541,14 +2555,14 @@ icon-menu-large index: -1 icon-none rotate: false - xy: 650, 289 + xy: 662, 289 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-pause rotate: false - xy: 662, 289 + xy: 237, 2 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2576,7 +2590,7 @@ icon-pick index: -1 icon-play rotate: false - xy: 237, 2 + xy: 644, 277 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2590,21 +2604,21 @@ icon-play-2 index: -1 icon-players rotate: false - xy: 644, 277 + xy: 644, 265 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-power rotate: false - xy: 644, 265 + xy: 656, 277 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-production rotate: false - xy: 656, 277 + xy: 656, 265 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2695,7 +2709,7 @@ icon-save-map index: -1 icon-settings rotate: false - xy: 656, 265 + xy: 654, 253 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2716,14 +2730,14 @@ icon-tools index: -1 icon-touch rotate: false - xy: 654, 253 + xy: 648, 241 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-touchDelete rotate: false - xy: 648, 241 + xy: 660, 241 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -2765,14 +2779,14 @@ icon-undo index: -1 icon-units rotate: false - xy: 660, 241 + xy: 657, 229 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-weapon rotate: false - xy: 657, 229 + xy: 666, 253 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -3022,70 +3036,70 @@ beam-equip index: -1 blaster rotate: false - xy: 777, 417 + xy: 797, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blaster-equip rotate: false - xy: 787, 417 + xy: 807, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 clustergun rotate: false - xy: 817, 417 + xy: 837, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 clustergun-equip rotate: false - xy: 827, 417 + xy: 847, 417 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun rotate: false - xy: 896, 387 + xy: 936, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shockgun-equip rotate: false - xy: 906, 387 + xy: 946, 387 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster rotate: false - xy: 483, 114 + xy: 493, 104 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 triblaster-equip rotate: false - xy: 493, 124 + xy: 503, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan rotate: false - xy: 493, 104 + xy: 523, 143 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 vulcan-equip rotate: false - xy: 503, 143 + xy: 503, 123 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 1277ca2b79..4f62ecaf5b 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 2946be863e..222d55e10a 100644 --- a/core/assets/version.properties +++ b/core/assets/version.properties @@ -1,7 +1,7 @@ #Autogenerated file. Do not modify. -#Tue Apr 03 22:20:20 EDT 2018 +#Wed Apr 04 16:43:10 EDT 2018 version=release -androidBuildCode=816 +androidBuildCode=822 name=Mindustry code=3.4 build=custom build diff --git a/core/src/io/anuke/mindustry/content/AmmoTypes.java b/core/src/io/anuke/mindustry/content/AmmoTypes.java index 5cfecd7a72..71da715fc4 100644 --- a/core/src/io/anuke/mindustry/content/AmmoTypes.java +++ b/core/src/io/anuke/mindustry/content/AmmoTypes.java @@ -8,5 +8,7 @@ public class AmmoTypes { basicIron = new AmmoType(Items.iron, TurretBullets.basicIron, 5, 0.9f), + basicSteel = new AmmoType(Items.steel, TurretBullets.basicSteel, 5, 0.8f), + basicFlame = new AmmoType(Liquids.oil, TurretBullets.basicFlame, 0.3f, 0.9f); } diff --git a/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java b/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java index d28639832a..2333425c6d 100644 --- a/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/WeaponBlocks.java @@ -6,10 +6,7 @@ import io.anuke.mindustry.resource.AmmoType; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.blocks.types.defense.LaserTurret; import io.anuke.mindustry.world.blocks.types.defense.Turret; -import io.anuke.mindustry.world.blocks.types.defense.turrets.BurstTurret; -import io.anuke.mindustry.world.blocks.types.defense.turrets.DoubleTurret; -import io.anuke.mindustry.world.blocks.types.defense.turrets.LiquidTurret; -import io.anuke.mindustry.world.blocks.types.defense.turrets.PowerTurret; +import io.anuke.mindustry.world.blocks.types.defense.turrets.*; public class WeaponBlocks{ public static Block @@ -44,13 +41,31 @@ public class WeaponBlocks{ ammoUseEffect = BulletFx.shellEjectSmall; }}, - railgunturret = new Turret("railgunturret"){ - - }, + railgunturret = new ItemTurret("railgunturret"){{ + range = 100f; + ammoTypes = new AmmoType[]{AmmoTypes.basicSteel}; + reload = 100f; + restitution = 0.03f; + ammoEjectBack = 2f; + recoil = 3f; + shootShake = 2f; + shootEffect = BulletFx.shootBig; + smokeEffect = BulletFx.shootBigSmoke; + ammoUseEffect = BulletFx.shellEjectBig; + }}, - flakturret = new Turret("flakturret"){ - - }, + flakturret = new ItemTurret("flakturret"){{ + range = 100f; + ammoTypes = new AmmoType[]{AmmoTypes.basicSteel}; + reload = 100f; + restitution = 0.03f; + ammoEjectBack = 2f; + recoil = 3f; + shootShake = 2f; + shootEffect = BulletFx.shootBig; + smokeEffect = BulletFx.shootBigSmoke; + ammoUseEffect = BulletFx.shellEjectBig; + }}, laserturret = new LaserTurret("laserturret"){ diff --git a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java index 371bc620e4..fda9357b7d 100644 --- a/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java +++ b/core/src/io/anuke/mindustry/content/bullets/TurretBullets.java @@ -1,24 +1,39 @@ package io.anuke.mindustry.content.bullets; -import com.badlogic.gdx.graphics.Color; import io.anuke.mindustry.entities.Bullet; import io.anuke.mindustry.entities.BulletType; +import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.graphics.fx.BulletFx; import io.anuke.mindustry.graphics.fx.Fx; import io.anuke.ucore.graphics.Draw; public class TurretBullets { + public static final BulletType basicIron = new BulletType(3f, 0) { @Override public void draw(Bullet b) { - Draw.color(Color.valueOf("f3d47f")); + Draw.color(Palette.bulletYellow); Draw.rect("bullet", b.x, b.y, 9f, 5f + b.fract()*7f, b.angle() - 90); Draw.color(); } }, + basicSteel = new BulletType(6f, 0) { + { + hiteffect = BulletFx.hitBulletBig; + knockback = 0.5f; + } + + @Override + public void draw(Bullet b) { + Draw.color(Palette.bulletYellow); + Draw.rect("bullet", b.x, b.y, 11f, 9f + b.fract()*8f, b.angle() - 90); + Draw.color(); + } + }, + basicFlame = new BulletType(2f, 4) { { hitsize = 7f; diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index 76d7f24c96..490d3de2f2 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -223,10 +223,8 @@ public class Renderer extends RendererModule{ Graphics.beginShaders(Shaders.outline); Graphics.shader(Shaders.hit, false); drawTeam(team, flying); - Draw.alpha(0f); - blocks.drawTeamBlocks(Layer.turret, team); - Draw.alpha(1f); Graphics.shader(); + blocks.drawTeamBlocks(Layer.turret, team); Graphics.endShaders(); } } diff --git a/core/src/io/anuke/mindustry/entities/Bullet.java b/core/src/io/anuke/mindustry/entities/Bullet.java index 38cc0472a1..448a72666a 100644 --- a/core/src/io/anuke/mindustry/entities/Bullet.java +++ b/core/src/io/anuke/mindustry/entities/Bullet.java @@ -1,5 +1,6 @@ package io.anuke.mindustry.entities; +import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.IntSet; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.world.Tile; @@ -11,6 +12,8 @@ import io.anuke.ucore.util.Timer; import static io.anuke.mindustry.Vars.*; public class Bullet extends BulletEntity{ + private static Vector2 vector = new Vector2(); + public IntSet collided; public Timer timer = new Timer(3); public Team team; @@ -68,6 +71,11 @@ public class Bullet extends BulletEntity{ super.collision(other, x, y); if(type.pierce) collided.add(other.id); + + if(other instanceof Unit){ + float k = ((BulletType)type).knockback; + ((Unit) other).velocity.add(vector.set(other.x, other.y).sub(x, y).setLength(k)); + } } @Override diff --git a/core/src/io/anuke/mindustry/entities/BulletType.java b/core/src/io/anuke/mindustry/entities/BulletType.java index 292d795122..a52cc789e6 100644 --- a/core/src/io/anuke/mindustry/entities/BulletType.java +++ b/core/src/io/anuke/mindustry/entities/BulletType.java @@ -5,6 +5,7 @@ import io.anuke.ucore.core.Effects; import io.anuke.ucore.entities.BaseBulletType; public abstract class BulletType extends BaseBulletType{ + public float knockback; public BulletType(float speed, int damage){ this.speed = speed; diff --git a/core/src/io/anuke/mindustry/graphics/Palette.java b/core/src/io/anuke/mindustry/graphics/Palette.java new file mode 100644 index 0000000000..943ea44061 --- /dev/null +++ b/core/src/io/anuke/mindustry/graphics/Palette.java @@ -0,0 +1,15 @@ +package io.anuke.mindustry.graphics; + +import com.badlogic.gdx.graphics.Color; + +public class Palette { + public static final Color bulletYellow = Color.valueOf("f3d47f"); + + public static final Color lightFlame = Color.valueOf("ffdd55"); + public static final Color darkFlame = Color.valueOf("db401c"); + + public static final Color turretHeat = Color.valueOf("ab3400"); + + public static final Color lightOrange = Color.valueOf("f68021"); + public static final Color lighterOrange = Color.valueOf("f6e096"); +} diff --git a/core/src/io/anuke/mindustry/graphics/fx/BulletFx.java b/core/src/io/anuke/mindustry/graphics/fx/BulletFx.java index add10707b3..08f8b8e5bc 100644 --- a/core/src/io/anuke/mindustry/graphics/fx/BulletFx.java +++ b/core/src/io/anuke/mindustry/graphics/fx/BulletFx.java @@ -1,6 +1,7 @@ package io.anuke.mindustry.graphics.fx; import com.badlogic.gdx.graphics.Color; +import io.anuke.mindustry.graphics.Palette; import io.anuke.ucore.core.Effects.Effect; import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.Fill; @@ -10,15 +11,11 @@ import io.anuke.ucore.util.Angles; import io.anuke.ucore.util.Mathf; public class BulletFx { - public static Color lightFlame = Color.valueOf("ffdd55"); - public static Color darkFlame = Color.valueOf("db401c"); - public static Color lightOrange = Color.valueOf("f68021"); - public static Color lighterOrange = Color.valueOf("f6e096"); public static final Effect shootSmall = new Effect(8, e -> { - Draw.color(lighterOrange, lightOrange, e.ifract()); + Draw.color(Palette.lighterOrange, Palette.lightOrange, e.ifract()); float w = 1f + 5 * e.fract(); Shapes.tri(e.x, e.y, w, 15f * e.fract(), e.rotation); Shapes.tri(e.x, e.y, w, 3f * e.fract(), e.rotation + 180f); @@ -26,7 +23,7 @@ public class BulletFx { }), shootSmallSmoke = new Effect(20f, e -> { - Draw.color(lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.ifract()); + Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.ifract()); Angles.randLenVectors(e.id, 5, e.powfract()*6f, e.rotation, 20f, (x, y) -> { Fill.circle(e.x + x, e.y + y, e.fract()*1.5f); @@ -35,8 +32,26 @@ public class BulletFx { Draw.reset(); }), + shootBig = new Effect(9, e -> { + Draw.color(Palette.lighterOrange, Palette.lightOrange, e.ifract()); + float w = 1.2f + 7 * e.fract(); + Shapes.tri(e.x, e.y, w, 25f * e.fract(), e.rotation); + Shapes.tri(e.x, e.y, w, 4f * e.fract(), e.rotation + 180f); + Draw.reset(); + }), + + shootBigSmoke = new Effect(17f, e -> { + Draw.color(Palette.lighterOrange, Color.LIGHT_GRAY, Color.GRAY, e.ifract()); + + Angles.randLenVectors(e.id, 8, e.powfract()*19f, e.rotation, 10f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fract()*2f + 0.2f); + }); + + Draw.reset(); + }), + shootSmallFlame = new Effect(30f, e -> { - Draw.color(lightFlame, darkFlame, Color.GRAY, e.ifract()); + Draw.color(Palette.lightFlame, Palette.darkFlame, Color.GRAY, e.ifract()); Angles.randLenVectors(e.id, 8, e.powfract()*26f, e.rotation, 10f, (x, y) -> { Fill.circle(e.x + x, e.y + y, 0.65f + e.fract()*1.5f); @@ -46,7 +61,7 @@ public class BulletFx { }), shellEjectSmall = new Effect(30f, e -> { - Draw.color(lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.ifract()); + Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.ifract()); Draw.alpha(e.fract()); float rot = e.rotation + 90f; for(int i : Mathf.signs){ @@ -54,11 +69,32 @@ public class BulletFx { float lr = rot + e.ifract()*30f*i; Draw.rect("white", e.x + Angles.trnsx(lr, len), e.y + Angles.trnsy(lr, len), 1f, 2f, rot + e.ifract()*50f*i); } + + Draw.color(); + }), + + shellEjectBig = new Effect(30f, e -> { + Draw.color(Palette.lightOrange, Color.LIGHT_GRAY, Color.GRAY, e.ifract()); + float rot = e.rotation + 90f; + for(int i : Mathf.signs){ + float len = (2f + e.powfract()*10f) * i; + float lr = rot + e.ifract()*20f*i; + Draw.rect("white", e.x + Angles.trnsx(lr, len), e.y + Angles.trnsy(lr, len), 2f, 3f, rot); + } + + Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.ifract()); + + for(int i : Mathf.signs){ + Angles.randLenVectors(e.id, 4, 1f + e.powfract()*11f, e.rotation + 90f*i, 20f, (x, y) -> { + Fill.circle(e.x + x, e.y + y, e.fract()*1.5f); + }); + } + Draw.color(); }), hitBulletSmall = new Effect(14, e -> { - Draw.color(Color.WHITE, lightOrange, e.ifract()); + Draw.color(Color.WHITE, Palette.lightOrange, e.ifract()); Lines.stroke(0.5f + e.fract()); Angles.randLenVectors(e.id, 5, e.ifract()*15f, e.rotation, 50f, (x, y) -> { @@ -69,8 +105,20 @@ public class BulletFx { Draw.reset(); }), + hitBulletBig = new Effect(13, e -> { + Draw.color(Color.WHITE, Palette.lightOrange, e.ifract()); + Lines.stroke(0.5f + e.fract()*1.5f); + + Angles.randLenVectors(e.id, 8, e.powfract()*30f, e.rotation, 50f, (x, y) -> { + float ang = Mathf.atan2(x, y); + Lines.lineAngle(e.x + x, e.y + y, ang, e.fract()*4 + 1.5f); + }); + + Draw.reset(); + }), + hitFlameSmall = new Effect(14, e -> { - Draw.color(lightFlame, darkFlame, e.ifract()); + Draw.color(Palette.lightFlame, Palette.darkFlame, e.ifract()); Lines.stroke(0.5f + e.fract()); Angles.randLenVectors(e.id, 5, e.ifract()*15f, e.rotation, 50f, (x, y) -> { @@ -82,7 +130,7 @@ public class BulletFx { }), despawn = new Effect(12, e -> { - Draw.color(lighterOrange, Color.GRAY, e.ifract()); + Draw.color(Palette.lighterOrange, Color.GRAY, e.ifract()); Lines.stroke(e.fract()); Angles.randLenVectors(e.id, 7, e.ifract()*7f, e.rotation, 40f, (x, y) -> { diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java index e3af00adbe..16c0ec4d1a 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/Turret.java @@ -2,19 +2,24 @@ package io.anuke.mindustry.world.blocks.types.defense; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.utils.Array; -import com.badlogic.gdx.utils.ObjectMap; import io.anuke.mindustry.entities.*; import io.anuke.mindustry.graphics.Layer; +import io.anuke.mindustry.graphics.Palette; import io.anuke.mindustry.graphics.fx.Fx; import io.anuke.mindustry.resource.AmmoType; -import io.anuke.mindustry.resource.Item; -import io.anuke.mindustry.world.*; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.BlockGroup; +import io.anuke.mindustry.world.Tile; import io.anuke.ucore.core.Effects; import io.anuke.ucore.core.Effects.Effect; +import io.anuke.ucore.core.Graphics; import io.anuke.ucore.core.Timers; import io.anuke.ucore.graphics.Draw; import io.anuke.ucore.graphics.Lines; -import io.anuke.ucore.util.*; +import io.anuke.ucore.util.Angles; +import io.anuke.ucore.util.Mathf; +import io.anuke.ucore.util.Strings; +import io.anuke.ucore.util.Translator; import java.io.DataInputStream; import java.io.DataOutputStream; @@ -22,17 +27,11 @@ import java.io.IOException; import static io.anuke.mindustry.Vars.tilesize; -public class Turret extends Block{ +public abstract class Turret extends Block{ protected static final int targetInterval = 15; protected final int timerTarget = timers++; - protected int maxammo = 100; - //TODO implement this! - /**A value of 'null' means this turret does not need ammo.*/ - protected AmmoType[] ammoTypes; - protected ObjectMap ammoMap = new ObjectMap<>(); - protected int ammoPerShot = 1; protected float ammoEjectBack = 1f; protected float range = 50f; @@ -41,6 +40,7 @@ public class Turret extends Block{ protected int shots = 1; protected float recoil = 1f; protected float restitution = 0.02f; + protected float cooldown = 0.02f; protected float rotatespeed = 0.2f; protected float shootCone = 5f; protected float shootShake = 0f; @@ -61,27 +61,6 @@ public class Turret extends Block{ group = BlockGroup.turrets; hasInventory = false; } - - @Override - public void init(){ - super.init(); - - if(ammoTypes != null) { - for (AmmoType type : ammoTypes) { - if(type.item == null) continue; - if (ammoMap.containsKey(type.item)) { - throw new RuntimeException("Turret \"" + name + "\" has two conflicting ammo entries on item type " + type.item + "!"); - } else { - ammoMap.put(type.item, type); - } - } - } - } - - @Override - public void setBars(){ - bars.replace(new BlockBar(BarType.inventory, true, tile -> (float)tile.entity().totalAmmo / maxammo)); - } @Override public void setStats(){ @@ -117,7 +96,19 @@ public class Turret extends Block{ tr2.trns(entity.rotation, -entity.recoil); - Draw.rect(name(), tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90); + String region = entity.target != null && Draw.hasRegion(name + "-shoot") ? name + "-shoot" : name; + + Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90); + + if(Draw.hasRegion(name + "-heat")){ + Graphics.setAdditiveBlending(); + Draw.color(Palette.turretHeat); + Draw.alpha(entity.heat); + Draw.rect(name + "-heat", tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90); + Graphics.setNormalBlending(); + } + + Draw.color(); } @Override @@ -134,37 +125,6 @@ public class Turret extends Block{ Lines.dashCircle(x * tilesize, y * tilesize, range); } - @Override - public void handleItem(Item item, Tile tile, Tile source) { - TurretEntity entity = tile.entity(); - - AmmoType type = ammoMap.get(item); - entity.totalAmmo += type.quantityMultiplier; - - //find ammo entry by type - for(int i = 0; i < entity.ammo.size; i ++){ - AmmoEntry entry = entity.ammo.get(i); - - //if found, put it to the right - if(entry.type == type){ - entry.amount += type.quantityMultiplier; - entity.ammo.swap(i, entity.ammo.size-1); - return; - } - } - - //must not be found - AmmoEntry entry = new AmmoEntry(type, (int)type.quantityMultiplier); - entity.ammo.add(entry); - } - - @Override - public boolean acceptItem(Item item, Tile tile, Tile source){ - TurretEntity entity = tile.entity(); - - return ammoMap != null && ammoMap.get(item) != null && entity.totalAmmo + ammoMap.get(item).quantityMultiplier <= maxammo; - } - @Override public void update(Tile tile){ TurretEntity entity = tile.entity(); @@ -173,6 +133,7 @@ public class Turret extends Block{ entity.target = null; entity.recoil = Mathf.lerpDelta(entity.recoil, 0f, restitution); + entity.heat = Mathf.lerpDelta(entity.heat, 0f, cooldown); if(hasAmmo(tile)){ @@ -207,7 +168,7 @@ public class Turret extends Block{ entry.amount -= ammoPerShot; if(entry.amount == 0) entity.ammo.pop(); entity.totalAmmo -= ammoPerShot; - ejectEffects(tile); + Timers.run(reload/2f, () -> ejectEffects(tile)); return entry.type; } @@ -241,6 +202,7 @@ public class Turret extends Block{ TurretEntity entity = tile.entity(); entity.recoil = recoil; + entity.heat = 1f; useAmmo(tile); @@ -248,12 +210,7 @@ public class Turret extends Block{ bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy)); - Effects.effect(shootEffect, tile.drawx() + tr.x, - tile.drawy() + tr.y, entity.rotation); - - if (shootShake > 0) { - Effects.shake(shootShake, shootShake, tile.entity); - } + effects(tile); } protected void bullet(Tile tile, BulletType type, float angle){ @@ -274,6 +231,7 @@ public class Turret extends Block{ } protected void ejectEffects(Tile tile){ + if(!(tile.entity instanceof TurretEntity)) return; TurretEntity entity = tile.entity(); Effects.effect(ammoUseEffect, tile.drawx() - Angles.trnsx(entity.rotation, ammoEjectBack), @@ -302,6 +260,7 @@ public class Turret extends Block{ public float reload; public float rotation = 90; public float recoil = 0f; + public float heat; public int shots; public Unit target; diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/BurstTurret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/BurstTurret.java index ae409858ea..62474fbf27 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/BurstTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/BurstTurret.java @@ -2,13 +2,12 @@ package io.anuke.mindustry.world.blocks.types.defense.turrets; import io.anuke.mindustry.resource.AmmoType; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.types.defense.Turret; import io.anuke.ucore.core.Timers; import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.tilesize; -public class BurstTurret extends Turret { +public class BurstTurret extends ItemTurret { protected float burstSpacing = 5; public BurstTurret(String name) { @@ -19,11 +18,15 @@ public class BurstTurret extends Turret { protected void shoot(Tile tile, AmmoType ammo){ TurretEntity entity = tile.entity(); + entity.heat = 1f; + for (int i = 0; i < shots; i++) { Timers.run(burstSpacing * i, () -> { if(!(tile.entity instanceof TurretEntity) || !hasAmmo(tile)) return; + entity.recoil = recoil; + tr.trns(entity.rotation, size * tilesize / 2); useAmmo(tile); bullet(tile, ammo.bullet, entity.rotation + Mathf.range(inaccuracy)); diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/DoubleTurret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/DoubleTurret.java index f7ba722275..8bb2c107d9 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/DoubleTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/DoubleTurret.java @@ -2,12 +2,11 @@ package io.anuke.mindustry.world.blocks.types.defense.turrets; import io.anuke.mindustry.resource.AmmoType; import io.anuke.mindustry.world.Tile; -import io.anuke.mindustry.world.blocks.types.defense.Turret; import io.anuke.ucore.util.Mathf; import static io.anuke.mindustry.Vars.tilesize; -public class DoubleTurret extends Turret { +public class DoubleTurret extends ItemTurret { protected float shotWidth = 2f; public DoubleTurret(String name) { diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/ItemTurret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/ItemTurret.java index 672a745d74..2860137838 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/ItemTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/ItemTurret.java @@ -1,9 +1,73 @@ package io.anuke.mindustry.world.blocks.types.defense.turrets; +import com.badlogic.gdx.utils.ObjectMap; +import io.anuke.mindustry.resource.AmmoType; +import io.anuke.mindustry.resource.Item; +import io.anuke.mindustry.world.BarType; +import io.anuke.mindustry.world.BlockBar; +import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.defense.Turret; public class ItemTurret extends Turret { + protected int maxammo = 100; + //TODO implement this! + /**A value of 'null' means this turret does not need ammo.*/ + protected AmmoType[] ammoTypes; + protected ObjectMap ammoMap = new ObjectMap<>(); + public ItemTurret(String name) { super(name); } + + @Override + public void handleItem(Item item, Tile tile, Tile source) { + TurretEntity entity = tile.entity(); + + AmmoType type = ammoMap.get(item); + entity.totalAmmo += type.quantityMultiplier; + + //find ammo entry by type + for(int i = 0; i < entity.ammo.size; i ++){ + AmmoEntry entry = entity.ammo.get(i); + + //if found, put it to the right + if(entry.type == type){ + entry.amount += type.quantityMultiplier; + entity.ammo.swap(i, entity.ammo.size-1); + return; + } + } + + //must not be found + AmmoEntry entry = new AmmoEntry(type, (int)type.quantityMultiplier); + entity.ammo.add(entry); + } + + @Override + public boolean acceptItem(Item item, Tile tile, Tile source){ + TurretEntity entity = tile.entity(); + + return ammoMap != null && ammoMap.get(item) != null && entity.totalAmmo + ammoMap.get(item).quantityMultiplier <= maxammo; + } + + @Override + public void setBars(){ + bars.add(new BlockBar(BarType.inventory, true, tile -> (float)tile.entity().totalAmmo / maxammo)); + } + + @Override + public void init(){ + super.init(); + + if(ammoTypes != null) { + for (AmmoType type : ammoTypes) { + if(type.item == null) continue; + if (ammoMap.containsKey(type.item)) { + throw new RuntimeException("Turret \"" + name + "\" has two conflicting ammo entries on item type " + type.item + "!"); + } else { + ammoMap.put(type.item, type); + } + } + } + } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/LiquidTurret.java b/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/LiquidTurret.java index 50fe09e401..a73c441f64 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/LiquidTurret.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/defense/turrets/LiquidTurret.java @@ -10,6 +10,7 @@ import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.types.defense.Turret; public abstract class LiquidTurret extends Turret { + protected AmmoType[] ammoTypes; protected ObjectMap liquidAmmoMap = new ObjectMap<>(); public LiquidTurret(String name) {