diff --git a/core/assets-raw/sprites/blocks/environment/coal1.png b/core/assets-raw/sprites/blocks/environment/coal1.png index 5063fac253..e020bccd84 100644 Binary files a/core/assets-raw/sprites/blocks/environment/coal1.png and b/core/assets-raw/sprites/blocks/environment/coal1.png differ diff --git a/core/assets-raw/sprites/blocks/environment/coal2.png b/core/assets-raw/sprites/blocks/environment/coal2.png index 89523f024e..0bf575e71f 100644 Binary files a/core/assets-raw/sprites/blocks/environment/coal2.png and b/core/assets-raw/sprites/blocks/environment/coal2.png differ diff --git a/core/assets-raw/sprites/blocks/environment/coal3.png b/core/assets-raw/sprites/blocks/environment/coal3.png index 5448a53806..ed88d039fd 100644 Binary files a/core/assets-raw/sprites/blocks/environment/coal3.png and b/core/assets-raw/sprites/blocks/environment/coal3.png differ diff --git a/core/assets-raw/sprites/blocks/environment/lead1.png b/core/assets-raw/sprites/blocks/environment/lead1.png index 0098e0cbcd..50b937bc47 100644 Binary files a/core/assets-raw/sprites/blocks/environment/lead1.png and b/core/assets-raw/sprites/blocks/environment/lead1.png differ diff --git a/core/assets-raw/sprites/blocks/environment/lead2.png b/core/assets-raw/sprites/blocks/environment/lead2.png index e41fd23c79..8f6be87470 100644 Binary files a/core/assets-raw/sprites/blocks/environment/lead2.png and b/core/assets-raw/sprites/blocks/environment/lead2.png differ diff --git a/core/assets-raw/sprites/blocks/environment/lead3.png b/core/assets-raw/sprites/blocks/environment/lead3.png index 061eb04e00..55effab148 100644 Binary files a/core/assets-raw/sprites/blocks/environment/lead3.png and b/core/assets-raw/sprites/blocks/environment/lead3.png differ diff --git a/core/assets-raw/sprites/blocks/environment/thorium1.png b/core/assets-raw/sprites/blocks/environment/thorium1.png index 181d5a2c99..af0c3945cf 100644 Binary files a/core/assets-raw/sprites/blocks/environment/thorium1.png and b/core/assets-raw/sprites/blocks/environment/thorium1.png differ diff --git a/core/assets-raw/sprites/blocks/environment/thorium2.png b/core/assets-raw/sprites/blocks/environment/thorium2.png index dade930e34..3770ac936e 100644 Binary files a/core/assets-raw/sprites/blocks/environment/thorium2.png and b/core/assets-raw/sprites/blocks/environment/thorium2.png differ diff --git a/core/assets-raw/sprites/blocks/environment/thorium3.png b/core/assets-raw/sprites/blocks/environment/thorium3.png index 1485d7638e..c81886a2ff 100644 Binary files a/core/assets-raw/sprites/blocks/environment/thorium3.png and b/core/assets-raw/sprites/blocks/environment/thorium3.png differ diff --git a/core/assets-raw/sprites/blocks/environment/titanium1.png b/core/assets-raw/sprites/blocks/environment/titanium1.png index 5cf051540b..bf8cd3bcb6 100644 Binary files a/core/assets-raw/sprites/blocks/environment/titanium1.png and b/core/assets-raw/sprites/blocks/environment/titanium1.png differ diff --git a/core/assets-raw/sprites/blocks/environment/titanium2.png b/core/assets-raw/sprites/blocks/environment/titanium2.png index 9aad0c978f..de9581ffe6 100644 Binary files a/core/assets-raw/sprites/blocks/environment/titanium2.png and b/core/assets-raw/sprites/blocks/environment/titanium2.png differ diff --git a/core/assets-raw/sprites/blocks/environment/titanium3.png b/core/assets-raw/sprites/blocks/environment/titanium3.png index f8f1ed80a3..6053a3bcdb 100644 Binary files a/core/assets-raw/sprites/blocks/environment/titanium3.png and b/core/assets-raw/sprites/blocks/environment/titanium3.png differ diff --git a/core/assets-raw/sprites/blocks/environment/tungsten1.png b/core/assets-raw/sprites/blocks/environment/tungsten1.png index 0dd0dbe685..2f6d753e74 100644 Binary files a/core/assets-raw/sprites/blocks/environment/tungsten1.png and b/core/assets-raw/sprites/blocks/environment/tungsten1.png differ diff --git a/core/assets-raw/sprites/blocks/environment/tungsten2.png b/core/assets-raw/sprites/blocks/environment/tungsten2.png index 4928d57830..871d73abcc 100644 Binary files a/core/assets-raw/sprites/blocks/environment/tungsten2.png and b/core/assets-raw/sprites/blocks/environment/tungsten2.png differ diff --git a/core/assets-raw/sprites/blocks/environment/tungsten3.png b/core/assets-raw/sprites/blocks/environment/tungsten3.png index 03dab54d7b..2c922c8b67 100644 Binary files a/core/assets-raw/sprites/blocks/environment/tungsten3.png and b/core/assets-raw/sprites/blocks/environment/tungsten3.png differ diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index 4edfa01062..13d86dc936 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -1887,51 +1887,37 @@ centrifuge orig: 16, 16 offset: 0, 0 index: -1 -block-icon-coal - rotate: false - xy: 679, 229 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -coal1 - rotate: false - xy: 679, 229 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 block-icon-combustion-generator rotate: false - xy: 689, 229 + xy: 679, 229 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 combustion-generator rotate: false - xy: 689, 229 + xy: 679, 229 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-conduit rotate: false - xy: 263, 31 + xy: 689, 229 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-conveyor rotate: false - xy: 263, 21 + xy: 263, 31 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 conveyor rotate: false - xy: 263, 21 + xy: 263, 31 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1966,42 +1952,42 @@ block-icon-cultivator index: -1 block-icon-deepwater rotate: false - xy: 263, 11 + xy: 263, 21 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 deepwater rotate: false - xy: 263, 11 + xy: 263, 21 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-deflector-wall rotate: false - xy: 263, 1 + xy: 263, 11 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 deflector-wall rotate: false - xy: 263, 1 + xy: 263, 11 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 phase-wall rotate: false - xy: 263, 1 + xy: 263, 11 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-phase-wall rotate: false - xy: 263, 1 + xy: 263, 11 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2036,28 +2022,28 @@ block-icon-phase-wall-large index: -1 block-icon-dirt rotate: false - xy: 273, 33 + xy: 263, 1 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 dirt1 rotate: false - xy: 273, 33 + xy: 263, 1 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-door rotate: false - xy: 273, 23 + xy: 273, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 door rotate: false - xy: 273, 23 + xy: 273, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2085,21 +2071,21 @@ block-icon-dronefactory index: -1 block-icon-droppoint rotate: false - xy: 283, 33 + xy: 273, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 droppoint rotate: false - xy: 283, 33 + xy: 273, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-duo rotate: false - xy: 273, 13 + xy: 283, 33 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2120,105 +2106,105 @@ block-icon-fusion-reactor index: -1 block-icon-grass rotate: false - xy: 283, 23 + xy: 273, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 grass1 rotate: false - xy: 283, 23 + xy: 273, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-hail rotate: false - xy: 273, 3 + xy: 283, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-ice rotate: false - xy: 283, 13 + xy: 273, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 ice1 rotate: false - xy: 283, 13 + xy: 273, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-icerock rotate: false - xy: 283, 3 + xy: 283, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icerock1 rotate: false - xy: 283, 3 + xy: 283, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-incinerator rotate: false - xy: 293, 23 + xy: 283, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 incinerator rotate: false - xy: 293, 23 + xy: 283, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-itemsource rotate: false - xy: 293, 13 + xy: 293, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 itemsource rotate: false - xy: 293, 13 + xy: 293, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-itemvoid rotate: false - xy: 303, 23 + xy: 293, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 itemvoid rotate: false - xy: 303, 23 + xy: 293, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-junction rotate: false - xy: 293, 3 + xy: 303, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 junction rotate: false - xy: 293, 3 + xy: 303, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2253,91 +2239,77 @@ block-icon-laser-drill index: -1 block-icon-laserconduit rotate: false - xy: 303, 13 + xy: 293, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconduit rotate: false - xy: 303, 13 + xy: 293, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-laserconveyor rotate: false - xy: 313, 23 + xy: 303, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 laserconveyor rotate: false - xy: 313, 23 + xy: 303, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-lava rotate: false - xy: 303, 3 + xy: 313, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 lava rotate: false - xy: 303, 3 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-lead - rotate: false - xy: 313, 13 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -lead1 - rotate: false - xy: 313, 13 + xy: 313, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-liquidjunction rotate: false - xy: 323, 23 + xy: 303, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidjunction rotate: false - xy: 323, 23 + xy: 303, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-liquidrouter rotate: false - xy: 313, 3 + xy: 313, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-liquidsource rotate: false - xy: 323, 13 + xy: 323, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 liquidsource rotate: false - xy: 323, 13 + xy: 323, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2372,14 +2344,14 @@ core-top index: -1 block-icon-mechanical-pump rotate: false - xy: 333, 23 + xy: 313, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 mechanical-pump rotate: false - xy: 333, 23 + xy: 313, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2393,28 +2365,28 @@ block-icon-meltdown index: -1 block-icon-melter rotate: false - xy: 323, 3 + xy: 323, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 melter rotate: false - xy: 323, 3 + xy: 323, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-metalfloor rotate: false - xy: 333, 13 + xy: 333, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 metalfloor1 rotate: false - xy: 333, 13 + xy: 333, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2449,14 +2421,14 @@ nuclear-reactor index: -1 block-icon-oil rotate: false - xy: 343, 23 + xy: 323, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 oil rotate: false - xy: 343, 23 + xy: 323, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2470,28 +2442,133 @@ block-icon-oil-extractor index: -1 block-icon-oilrefinery rotate: false - xy: 333, 3 + xy: 333, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 oilrefinery + rotate: false + xy: 333, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +block-icon-ore-coal-grass + rotate: false + xy: 343, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +coal1 + rotate: false + xy: 343, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +block-icon-ore-coal-stone + rotate: false + xy: 343, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +block-icon-ore-lead-grass rotate: false xy: 333, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 +lead1 + rotate: false + xy: 333, 3 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +block-icon-ore-lead-stone + rotate: false + xy: 333, 3 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +block-icon-ore-thorium-grass + rotate: false + xy: 343, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +thorium1 + rotate: false + xy: 343, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +block-icon-ore-thorium-stone + rotate: false + xy: 343, 13 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +block-icon-ore-titanium-grass + rotate: false + xy: 353, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +titanium1 + rotate: false + xy: 353, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +block-icon-ore-titanium-stone + rotate: false + xy: 353, 23 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +block-icon-ore-tungsten-grass + rotate: false + xy: 343, 3 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +tungsten1 + rotate: false + xy: 343, 3 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 +block-icon-ore-tungsten-stone + rotate: false + xy: 343, 3 + size: 8, 8 + orig: 8, 8 + offset: 0, 0 + index: -1 block-icon-overflowgate rotate: false - xy: 343, 13 + xy: 353, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 overflowgate rotate: false - xy: 343, 13 + xy: 353, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2519,14 +2596,14 @@ plasteel-compressor index: -1 block-icon-power-node rotate: false - xy: 353, 23 + xy: 363, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 power-node rotate: false - xy: 353, 23 + xy: 363, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2547,42 +2624,42 @@ power-node-large index: -1 block-icon-powerinfinite rotate: false - xy: 343, 3 + xy: 353, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 powerinfinite rotate: false - xy: 343, 3 + xy: 353, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-powervoid rotate: false - xy: 353, 13 + xy: 363, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 powervoid rotate: false - xy: 353, 13 + xy: 363, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-pulseconduit rotate: false - xy: 363, 23 + xy: 373, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-pulverizer rotate: false - xy: 353, 3 + xy: 363, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2617,28 +2694,28 @@ walkerfactory index: -1 block-icon-repairpoint rotate: false - xy: 363, 13 + xy: 373, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 repairpoint rotate: false - xy: 363, 13 + xy: 373, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-resupplypoint rotate: false - xy: 373, 23 + xy: 383, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 resupplypoint rotate: false - xy: 373, 23 + xy: 383, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2652,14 +2729,14 @@ block-icon-ripple index: -1 block-icon-rock rotate: false - xy: 363, 3 + xy: 373, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rock1 rotate: false - xy: 363, 3 + xy: 373, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2680,77 +2757,77 @@ rotary-pump index: -1 block-icon-router rotate: false - xy: 373, 13 + xy: 383, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 router rotate: false - xy: 373, 13 + xy: 383, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-rtg-generator rotate: false - xy: 383, 23 + xy: 393, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 rtg-generator rotate: false - xy: 383, 23 + xy: 393, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-sand rotate: false - xy: 373, 3 + xy: 383, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sand1 rotate: false - xy: 373, 3 + xy: 383, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-scorch rotate: false - xy: 383, 13 + xy: 393, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-separator rotate: false - xy: 393, 23 + xy: 403, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 separator rotate: false - xy: 393, 23 + xy: 403, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-shrub rotate: false - xy: 383, 3 + xy: 393, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shrub rotate: false - xy: 383, 3 + xy: 393, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2771,126 +2848,126 @@ silicon-smelter index: -1 block-icon-smelter rotate: false - xy: 393, 13 + xy: 403, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 smelter rotate: false - xy: 393, 13 + xy: 403, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-snow rotate: false - xy: 403, 23 + xy: 413, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 snow1 rotate: false - xy: 403, 23 + xy: 413, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-solar-panel rotate: false - xy: 393, 3 + xy: 403, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 solar-panel rotate: false - xy: 393, 3 + xy: 403, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-sortedunloader rotate: false - xy: 403, 13 + xy: 413, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sortedunloader rotate: false - xy: 403, 13 + xy: 413, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-sorter rotate: false - xy: 413, 23 + xy: 423, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 sorter rotate: false - xy: 413, 23 + xy: 423, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-space rotate: false - xy: 403, 3 + xy: 413, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 space rotate: false - xy: 403, 3 + xy: 413, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-splitter rotate: false - xy: 413, 13 + xy: 423, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 splitter rotate: false - xy: 413, 13 + xy: 423, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-stone rotate: false - xy: 423, 23 + xy: 433, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stone1 rotate: false - xy: 423, 23 + xy: 433, 23 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 block-icon-stoneformer rotate: false - xy: 413, 3 + xy: 423, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 stoneformer rotate: false - xy: 413, 3 + xy: 423, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2944,30 +3021,16 @@ thermite-mixer orig: 16, 16 offset: 0, 0 index: -1 -block-icon-thorium - rotate: false - xy: 423, 13 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -thorium1 - rotate: false - xy: 423, 13 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 block-icon-thorium-wall rotate: false - xy: 433, 23 + xy: 433, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 thorium-wall rotate: false - xy: 433, 23 + xy: 433, 13 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -2986,42 +3049,14 @@ thorium-wall-large orig: 16, 16 offset: 0, 0 index: -1 -block-icon-titanium - rotate: false - xy: 423, 3 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -titanium1 - rotate: false - xy: 423, 3 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 block-icon-titanium-conveyor - rotate: false - xy: 433, 13 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -titanium-conveyor - rotate: false - xy: 433, 13 - size: 8, 8 - orig: 8, 8 - offset: 0, 0 - index: -1 -block-icon-tungsten rotate: false xy: 433, 3 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 -tungsten1 +titanium-conveyor rotate: false xy: 433, 3 size: 8, 8 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index d2b74f19cf..05287f9d3b 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/src/io/anuke/mindustry/content/blocks/Blocks.java b/core/src/io/anuke/mindustry/content/blocks/Blocks.java index bc662bd5a0..38cb38f5e3 100644 --- a/core/src/io/anuke/mindustry/content/blocks/Blocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/Blocks.java @@ -12,7 +12,9 @@ import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.*; public class Blocks extends BlockList implements ContentList{ - public static Block air, spawn, blockpart, space, metalfloor, deepwater, water, lava, oil, stone, blackstone, iron, lead, coal, titanium, thorium, dirt, sand, ice, snow, grass, shrub, rock, icerock, blackrock; + public static Block air, spawn, blockpart, space, metalfloor, deepwater, water, lava, oil, stone, blackstone, dirt, sand, ice, snow, grass, shrub, rock, icerock, blackrock; + + @Override public void load() { @@ -39,6 +41,7 @@ public class Blocks extends BlockList implements ContentList{ cacheLayer = CacheLayer.space; solid = true; blend = false; + minimapColor = Color.valueOf("000001"); }}; metalfloor = new Floor("metalfloor") {{ @@ -55,6 +58,7 @@ public class Blocks extends BlockList implements ContentList{ statusIntensity = 1f; drownTime = 140f; cacheLayer = CacheLayer.water; + minimapColor = Color.valueOf("465a96"); }}; water = new Floor("water") {{ @@ -66,6 +70,7 @@ public class Blocks extends BlockList implements ContentList{ liquidDrop = Liquids.water; isLiquid = true; cacheLayer = CacheLayer.water; + minimapColor = Color.valueOf("506eb4"); }}; lava = new Floor("lava") {{ @@ -78,6 +83,7 @@ public class Blocks extends BlockList implements ContentList{ liquidDrop = Liquids.lava; isLiquid = true; cacheLayer = CacheLayer.lava; + minimapColor = Color.valueOf("ed5334"); }}; oil = new Floor("oil") {{ @@ -89,52 +95,42 @@ public class Blocks extends BlockList implements ContentList{ liquidDrop = Liquids.oil; isLiquid = true; cacheLayer = CacheLayer.oil; + minimapColor = Color.valueOf("292929"); }}; stone = new Floor("stone") {{ hasOres = true; drops = new ItemStack(Items.stone, 1); blends = block -> block != this && !(block instanceof Ore); + minimapColor = Color.valueOf("323232"); }}; blackstone = new Floor("blackstone") {{ drops = new ItemStack(Items.stone, 1); + minimapColor = Color.valueOf("252525"); }}; - iron = new Ore("tungsten") {{ - drops = new ItemStack(Items.tungsten, 1); + dirt = new Floor("dirt"){{ + minimapColor = Color.valueOf("6e501e"); }}; - 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.sand, 1); + minimapColor = Color.valueOf("988a67"); }}; ice = new Floor("ice") {{ dragMultiplier = 0.2f; + minimapColor = Color.valueOf("c4e3e7"); }}; - snow = new Floor("snow"); + snow = new Floor("snow"){{ + minimapColor = Color.valueOf("c2d1d2"); + }}; grass = new Floor("grass"){{ hasOres = true; + minimapColor = Color.valueOf("549d5b"); }}; shrub = new Rock("shrub"); diff --git a/core/src/io/anuke/mindustry/content/blocks/OreBlocks.java b/core/src/io/anuke/mindustry/content/blocks/OreBlocks.java new file mode 100644 index 0000000000..cd1764586b --- /dev/null +++ b/core/src/io/anuke/mindustry/content/blocks/OreBlocks.java @@ -0,0 +1,34 @@ +package io.anuke.mindustry.content.blocks; + +import com.badlogic.gdx.utils.ObjectMap; +import io.anuke.mindustry.content.Items; +import io.anuke.mindustry.type.Item; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.blocks.Floor; +import io.anuke.mindustry.world.blocks.OreBlock; + +public class OreBlocks extends BlockList { + private static final ObjectMap> oreBlockMap = new ObjectMap<>(); + + @Override + public void load() { + Item[] ores = {Items.tungsten, Items.lead, Items.coal, Items.titanium, Items.thorium}; + + for(Item item : ores){ + ObjectMap map = new ObjectMap<>(); + oreBlockMap.put(item, map); + + for(Block block : Block.all()){ + if(block instanceof Floor && ((Floor) block).hasOres){ + map.put(block, new OreBlock(item, (Floor) block)); + } + } + } + } + + public static Block get(Block floor, Item item){ + if(!oreBlockMap.containsKey(item)) throw new IllegalArgumentException("Item '" + item + "' is not an ore!"); + if(!oreBlockMap.get(item).containsKey(floor)) throw new IllegalArgumentException("Block '" + floor.name + "' does not support ores!"); + return oreBlockMap.get(item).get(floor); + } +} diff --git a/core/src/io/anuke/mindustry/core/ContentLoader.java b/core/src/io/anuke/mindustry/core/ContentLoader.java index c4feb49fba..ac2d7613e5 100644 --- a/core/src/io/anuke/mindustry/core/ContentLoader.java +++ b/core/src/io/anuke/mindustry/core/ContentLoader.java @@ -23,6 +23,7 @@ import io.anuke.mindustry.type.ContentList; import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.type.StatusEffect; import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.ColorMapper; import io.anuke.ucore.core.Effects; import io.anuke.ucore.function.Consumer; import io.anuke.ucore.util.Log; @@ -83,6 +84,10 @@ public class ContentLoader { new PowerBlocks(), new CraftingBlocks(), new UpgradeBlocks(), + new OreBlocks(), + + //not really a content class, but this makes initialization easier + new ColorMapper(), //recipes new Recipes(), diff --git a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java index 940bd2cf14..f2c5757f74 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditorDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapEditorDialog.java @@ -9,7 +9,6 @@ import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Align; import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.ObjectMap; -import io.anuke.mindustry.content.blocks.Blocks; import io.anuke.mindustry.core.Platform; import io.anuke.mindustry.game.Team; import io.anuke.mindustry.io.Map; @@ -18,8 +17,6 @@ import io.anuke.mindustry.io.MapMeta; import io.anuke.mindustry.io.MapTileData; 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.ucore.core.Core; import io.anuke.ucore.core.Graphics; import io.anuke.ucore.core.Inputs; @@ -365,8 +362,8 @@ public class MapEditorDialog extends Dialog implements Disposable{ public void updateSelectedBlock(){ Block block = editor.getDrawBlock(); int i = 0; - for(BlockPair pair : ColorMapper.getPairs()){ - if(pair.wall == block || (pair.wall == Blocks.air && pair.floor == block)){ + for(Block test : Block.all()){ + if(block == test){ blockgroup.getButtons().get(i).setChecked(true); break; } diff --git a/core/src/io/anuke/mindustry/editor/MapFilter.java b/core/src/io/anuke/mindustry/editor/MapFilter.java deleted file mode 100644 index 1faa5c71ea..0000000000 --- a/core/src/io/anuke/mindustry/editor/MapFilter.java +++ /dev/null @@ -1,218 +0,0 @@ -package io.anuke.mindustry.editor; - -import com.badlogic.gdx.graphics.Pixmap; -import com.badlogic.gdx.math.Vector2; -import com.badlogic.gdx.utils.ObjectMap; -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.content.blocks.Blocks; -import io.anuke.mindustry.world.blocks.Floor; -import io.anuke.ucore.graphics.Pixmaps; -import io.anuke.ucore.noise.RidgedPerlin; -import io.anuke.ucore.noise.Simplex; -import io.anuke.ucore.util.Mathf; - -public class MapFilter{ - private ObjectMap prefs = map( - pref("replace", "whether to replace blocks"), - pref("terrain", "generate new terrain"), - pref("circle", "generate terrain in a circle"), - pref("distort", "distort the map image"), - pref("sand", "add patches of sand"), - pref("grass", "add patches of grass"), - pref("stone", "add patches of stone"), - pref("blackstone", "add patches of black stone"), - pref("allgrass", "fill map with grass"), - pref("allsnow", "fill map with snow"), - pref("allsand", "fill map with sand"), - pref("water", "add lakes"), - pref("oil", "add oil lakes"), - pref("lavariver", "add lava rivers"), - pref("slavariver", "ad small lava rivers"), - pref("river", "add rivers"), - pref("iceriver", "add frozen rivers"), - pref("oilriver", "add oil rivers") - ); - - private Simplex sim = new Simplex(); - private RidgedPerlin rid = new RidgedPerlin(1, 10); - private RidgedPerlin rid2 = new RidgedPerlin(1, 6); - private RidgedPerlin rid3 = new RidgedPerlin(1, 6); - - public MapFilter(){ - prefs.get("replace").enabled = true; - prefs.get("terrain").enabled = true; - randomize(); - } - - public void randomize(){ - sim.setSeed(Mathf.random(999999)); - rid.setSeed(Mathf.random(999999)); - rid2.setSeed(Mathf.random(999999)); - rid3.setSeed(Mathf.random(999999)); - } - - public ObjectMap getPrefs(){ - return prefs; - } - - public Pixmap process(Pixmap pixmap){ - if(prefs.get("terrain").enabled){ - for(int x = 0; x < pixmap.getWidth(); x++){ - for(int y = 0; y < pixmap.getHeight(); y++){ - float dist = Vector2.dst((float) x / pixmap.getWidth(), (float) y / pixmap.getHeight(), 0.5f, 0.5f) * 2f; - double noise = sim.octaveNoise2D(6, 0.6, 1 / 180.0, x, y + 9999) / (prefs.get("circle").enabled ? 1.7 : 1f) + dist / 10f; - - if(dist > 0.8){ - noise += 2 * (dist - 0.8); - } - - Block block = Blocks.stone; - - pixmap.drawPixel(x, y, ColorMapper.getColor(block)); - } - } - } - - Pixmap src = Pixmaps.copy(pixmap); - - for(int x = 0; x < pixmap.getWidth(); x++){ - for(int y = 0; y < pixmap.getHeight(); y++){ - int dx = 0, dy = 0; - - if(prefs.get("distort").enabled){ - double intensity = 12; - double scale = 80; - double octaves = 4; - double falloff = 0.6; - double nx = (sim.octaveNoise2D(octaves, falloff, 1 / scale, x, y) - 0.5f) * intensity; - double ny = (sim.octaveNoise2D(octaves, falloff, 1 / scale, x, y + 99999) - 0.5f) * intensity; - dx = (int) nx; - dy = (int) ny; - } - - int pix = src.getPixel(x + dx, y + dy); - - BlockPair pair = ColorMapper.get(pix); - Block block = pair == null ? null : pair.wall == Blocks.air ? pair.floor : pair.wall; - - if(block == null) - continue; - - boolean floor = block instanceof Floor; - - double noise = sim.octaveNoise2D(4, 0.6, 1 / 170.0, x, y) + sim.octaveNoise2D(1, 1.0, 1 / 5.0, x, y) / 18.0; - double nwater = sim.octaveNoise2D(1, 1.0, 1 / 130.0, x, y); - noise += nwater / 5.0; - - double noil = sim.octaveNoise2D(1, 1.0, 1 / 150.0, x + 9999, y) + sim.octaveNoise2D(1, 1.0, 1 / 2.0, x, y) / 290.0; - - if(floor){ - if(nwater > 0.93 && prefs.get("water").enabled){ - block = Blocks.water; - if(nwater > 0.943){ - block = Blocks.deepwater; - } - } - - if(noil > 0.95 && prefs.get("oil").enabled){ - block = Blocks.dirt; - if(noil > 0.955){ - block = Blocks.oil; - } - } - } - - if(floor && prefs.get("lavariver").enabled){ - double lava = rid.getValue(x, y, 1 / 100f); - double t = 0.6; - if(lava > t){ - block = Blocks.lava; - }else if(lava > t - 0.2){ - block = Blocks.blackstone; - } - } - - if(floor && prefs.get("slavariver").enabled){ - double lava = rid.getValue(x, y, 1 / 40f); - double t = 0.7; - if(lava > t){ - block = Blocks.lava; - }else if(lava > t - 0.3){ - block = Blocks.blackstone; - } - } - - if(floor && prefs.get("oilriver").enabled){ - double lava = rid3.getValue(x, y, 1 / 100f); - double t = 0.9; - if(lava > t){ - block = Blocks.oil; - }else if(lava > t - 0.2){ - block = Blocks.dirt; - } - } - - if(floor && prefs.get("river").enabled){ - double riv = rid2.getValue(x, y, 1 / 140f); - double t = 0.4; - - if(riv > t + 0.1){ - block = Blocks.deepwater; - }else if(riv > t){ - block = Blocks.water; - }else if(riv > t - 0.2){ - block = Blocks.grass; - } - } - - if(floor && prefs.get("iceriver").enabled){ - double riv = rid2.getValue(x, y, 1 / 140f); - double t = 0.4; - - if(riv > t + 0.1){ - block = Blocks.ice; - }else if(riv > t){ - block = Blocks.ice; - }else if(riv > t - 0.2){ - block = Blocks.snow; - } - } - - pixmap.drawPixel(x, y, ColorMapper.getColor(block)); - } - } - - src.dispose(); - - return pixmap; - } - - private static OrderedMap map(GenPref...objects){ - OrderedMap prefs = new OrderedMap<>(); - - for(int i = 0; i < objects.length; i ++){ - GenPref pref = objects[i]; - prefs.put(pref.name, pref); - } - return prefs; - } - - private GenPref pref(String name, String desc){ - return new GenPref(name, desc); - } - - class GenPref{ - public final String name; - public final String description; - public boolean enabled; - - GenPref(String name, String description){ - this.name = name; - this.description = description; - } - } -} diff --git a/core/src/io/anuke/mindustry/graphics/MinimapRenderer.java b/core/src/io/anuke/mindustry/graphics/MinimapRenderer.java index af990b8ece..ede722a8ab 100644 --- a/core/src/io/anuke/mindustry/graphics/MinimapRenderer.java +++ b/core/src/io/anuke/mindustry/graphics/MinimapRenderer.java @@ -138,8 +138,8 @@ public class MinimapRenderer implements Disposable{ } private int colorFor(Tile tile){ - int color = tile.breakable() ? tile.target().getTeam().intColor : ColorMapper.getColor(tile.block()); - if(color == 0) color = ColorMapper.getColor(tile.floor()); + int color = tile.breakable() ? tile.target().getTeam().intColor : ColorMapper.getBlockColor(tile.block()); + if(color == 0) color = ColorMapper.getBlockColor(tile.floor()); if(tile.cliffs != 0){ tmpColor.set(color); tmpColor.mul(1.5f, 1.5f, 1.5f, 1f); diff --git a/core/src/io/anuke/mindustry/io/MapIO.java b/core/src/io/anuke/mindustry/io/MapIO.java index 55c560e520..db9bf5c14c 100644 --- a/core/src/io/anuke/mindustry/io/MapIO.java +++ b/core/src/io/anuke/mindustry/io/MapIO.java @@ -12,7 +12,6 @@ import io.anuke.mindustry.io.MapTileData.DataPosition; 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 java.io.DataInputStream; import java.io.DataOutputStream; @@ -42,9 +41,9 @@ public class MapIO { data.read(marker); Block floor = Block.getByID(marker.floor); Block wall = Block.getByID(marker.wall); - int wallc = ColorMapper.getColor(wall); - if(wallc == 0 && (wall.update || wall.solid || wall.breakable)) wallc = Color.rgba8888(Team.values()[marker.team].color); - wallc = wallc == 0 ? ColorMapper.getColor(floor) : wallc; + int wallc = ColorMapper.getBlockColor(wall); + if(wallc == 0 && (wall.update || wall.solid || wall.breakable)) wallc = Team.values()[marker.team].intColor; + wallc = wallc == 0 ? ColorMapper.getBlockColor(floor) : wallc; if(marker.elevation > 0){ float scaling = 1f + marker.elevation/8f; color.set(wallc); @@ -65,15 +64,15 @@ public class MapIO { for(int x = 0; x < data.width(); x ++){ for(int y = 0; y < data.height(); y ++){ - BlockPair pair = ColorMapper.get(pixmap.getPixel(y, pixmap.getWidth() - 1 - x)); + Block block = ColorMapper.getByColor(pixmap.getPixel(y, pixmap.getWidth() - 1 - x)); - if(pair == null){ + if(block == null){ data.write(x, y, DataPosition.floor, (byte)Blocks.stone.id); - data.write(x, y, DataPosition.wall, (byte)Blocks.air.id); }else{ - data.write(x, y, DataPosition.floor, (byte)pair.floor.id); - data.write(x, y, DataPosition.wall, (byte)pair.wall.id); + data.write(x, y, DataPosition.floor, (byte)block.id); } + + data.write(x, y, DataPosition.wall, (byte)Blocks.air.id); } } diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 3a09313158..54151b87b2 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -118,6 +118,8 @@ public class Block extends BaseBlock implements UnlockableContent{ public boolean configurable; /**Whether this block consumes touchDown events when tapped.*/ public boolean consumesTap; + /**The color of this block when displayed on the minimap or map preview.*/ + public Color minimapColor = Color.CLEAR; public Block(String name) { this.name = name; diff --git a/core/src/io/anuke/mindustry/world/ColorMapper.java b/core/src/io/anuke/mindustry/world/ColorMapper.java index 1b82253031..74b20c6308 100644 --- a/core/src/io/anuke/mindustry/world/ColorMapper.java +++ b/core/src/io/anuke/mindustry/world/ColorMapper.java @@ -2,95 +2,36 @@ package io.anuke.mindustry.world; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.utils.Array; -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.content.blocks.Blocks; +import io.anuke.mindustry.game.Content; +import io.anuke.mindustry.type.ContentList; -public class ColorMapper{ - /**maps color IDs to their actual RGBA8888 colors*/ - private static int[] colorIDS; - /**Maps RGBA8888 colors to pair IDs.*/ - private static IntIntMap reverseIDs = new IntIntMap(); +public class ColorMapper implements ContentList{ + private static IntMap blockMap = new IntMap<>(); + private static ObjectIntMap colorMap = new ObjectIntMap<>(); - private static ObjectIntMap reverseColors = new ObjectIntMap<>(); - private static Array pairs = new Array<>(); - private static IntMap colors; + @Override + public void load() { + for(Block block : Block.all()){ + int color = Color.rgba8888(block.minimapColor); + if(color == 0) continue; //skip blocks that are not mapped - private static void init(){ - if(colors != null) return; + blockMap.put(color, block); + colorMap.put(block, color); + } + } - colors = map( - "323232", pair(Blocks.stone), - "50965a", pair(Blocks.grass), - "506eb4", pair(Blocks.water), - "465a96", pair(Blocks.deepwater), - "252525", pair(Blocks.blackstone), - "988a67", pair(Blocks.sand), - "c2d1d2", pair(Blocks.snow), - "c4e3e7", pair(Blocks.ice), - "6e501e", pair(Blocks.dirt), - "ed5334", pair(Blocks.lava), - "292929", pair(Blocks.oil), - "a0b0c8", pair(Blocks.iron), - "161616", pair(Blocks.coal), - "6277bc", pair(Blocks.titanium), - "c594dc", pair(Blocks.thorium), - "9790b5", pair(Blocks.lead), - "000000", pair(Blocks.space) - ); + @Override + public Array getAll() { + return new Array<>(); } - - public static BlockPair get(int color){ - init(); - return colors.get(color); + + public static Block getByColor(int color){ + return blockMap.get(color); } - - public static Array getPairs(){ - init(); - return pairs; - } - - public static int getColor(Block block){ - init(); - return reverseColors.get(block, 0); - } - - private static BlockPair pair(Block floor, Block wall){ - return new BlockPair(floor, wall); - } - - private static BlockPair pair(Block floor){ - return new BlockPair(floor, Blocks.air); - } - - private static IntMap map(Object...objects){ - colorIDS = new int[objects.length/2]; - IntMap colors = new IntMap<>(); - for(int i = 0; i < objects.length/2; i ++){ - int color = Color.rgba8888(Color.valueOf((String)objects[i*2])); - colors.put(color, (BlockPair)objects[i*2+1]); - pairs.add((BlockPair)objects[i*2+1]); - colorIDS[i] = color; - reverseIDs.put(color, i); - } - for(Entry e : colors.entries()){ - reverseColors.put(e.value.wall == Blocks.air ? e.value.floor : e.value.wall, e.key); - } - return colors; - } - - public static class BlockPair{ - public final Block floor, wall; - - public Block dominant(){ - return wall == Blocks.air ? floor : wall; - } - - private BlockPair(Block floor, Block wall){ - this.floor = floor; - this.wall = wall; - } + + public static int getBlockColor(Block block){ + return colorMap.get(block, 0); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/Floor.java b/core/src/io/anuke/mindustry/world/blocks/Floor.java index 21671cec59..1e8c699ac7 100644 --- a/core/src/io/anuke/mindustry/world/blocks/Floor.java +++ b/core/src/io/anuke/mindustry/world/blocks/Floor.java @@ -32,7 +32,7 @@ public class Floor extends Block{ protected TextureRegion[] edgeRegions; protected TextureRegion[] cliffRegions; protected Vector2[] offsets; - protected Predicate blends = block -> block != this; + protected Predicate blends = block -> block != this && !block.blendOverride(this); protected boolean blend = true; /**edge fallback, used mainly for ores*/ @@ -157,7 +157,11 @@ public class Floor extends Block{ drawEdges(tile, false); } - private void drawEdges(Tile tile, boolean sameLayer){ + public boolean blendOverride(Block block){ + return false; + } + + protected void drawEdges(Tile tile, boolean sameLayer){ if(!blend || tile.cliffs > 0) return; for(int i = 0; i < 8; i ++){ diff --git a/core/src/io/anuke/mindustry/world/blocks/OreBlock.java b/core/src/io/anuke/mindustry/world/blocks/OreBlock.java new file mode 100644 index 0000000000..e614d9e903 --- /dev/null +++ b/core/src/io/anuke/mindustry/world/blocks/OreBlock.java @@ -0,0 +1,61 @@ +package io.anuke.mindustry.world.blocks; + +import com.badlogic.gdx.graphics.g2d.TextureRegion; +import com.badlogic.gdx.math.MathUtils; +import io.anuke.mindustry.type.Item; +import io.anuke.mindustry.type.ItemStack; +import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.Tile; +import io.anuke.ucore.graphics.Draw; + +public class OreBlock extends Floor { + protected Floor base; + + public OreBlock(Item ore, Floor base){ + super("ore-" + ore.name + "-" + base.name); + this.drops = new ItemStack(ore, 1); + this.base = base; + this.variants = 3; + this.minimapColor = ore.color; + this.blends = block -> false; + this.edge = base.name; + } + + @Override + public void draw(Tile tile){ + + Draw.rect(base.variants > 0 ? (base.name + MathUtils.random(1, base.variants)) : base.name, tile.worldx(), tile.worldy()); + + int rand = variants > 0 ? MathUtils.random(1, variants) : 0; + + Draw.color(0f, 0f, 0f, 0.2f); + Draw.rect(variants > 0 ? (drops.item.name + rand) : name, tile.worldx(), tile.worldy() - 1); + Draw.color(); + Draw.rect(variants > 0 ? (drops.item.name + rand) : name, tile.worldx(), tile.worldy()); + } + + @Override + public TextureRegion[] getIcon() { + if(icon == null){ + icon = new TextureRegion[]{Draw.region(drops.item.name + "1")}; + } + return icon; + } + + @Override + public void drawNonLayer(Tile tile){ + MathUtils.random.setSeed(tile.id()); + + base.drawEdges(tile, true); + } + + @Override + protected void drawEdges(Tile tile, boolean sameLayer){ + base.drawEdges(tile, sameLayer); + } + + @Override + public boolean blendOverride(Block block) { + return block == base; + } +} diff --git a/core/src/io/anuke/mindustry/world/mapgen/WorldGenerator.java b/core/src/io/anuke/mindustry/world/mapgen/WorldGenerator.java index 085e3cff43..08404b236f 100644 --- a/core/src/io/anuke/mindustry/world/mapgen/WorldGenerator.java +++ b/core/src/io/anuke/mindustry/world/mapgen/WorldGenerator.java @@ -2,11 +2,14 @@ package io.anuke.mindustry.world.mapgen; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.IntArray; +import io.anuke.mindustry.content.Items; import io.anuke.mindustry.content.blocks.Blocks; +import io.anuke.mindustry.content.blocks.OreBlocks; 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.type.Item; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Tile; import io.anuke.ucore.noise.RidgedPerlin; @@ -24,11 +27,11 @@ public class WorldGenerator { oreIndex = 0; Array ores = Array.with( - new OreEntry(Blocks.iron, 0.3f, seed), - new OreEntry(Blocks.coal, 0.284f, seed), - new OreEntry(Blocks.lead, 0.28f, seed), - new OreEntry(Blocks.titanium, 0.27f, seed), - new OreEntry(Blocks.thorium, 0.26f, seed) + new OreEntry(Items.tungsten, 0.3f, seed), + new OreEntry(Items.coal, 0.284f, seed), + new OreEntry(Items.lead, 0.28f, seed), + new OreEntry(Items.titanium, 0.27f, seed), + new OreEntry(Items.thorium, 0.26f, seed) ); IntArray multiblocks = new IntArray(); @@ -110,7 +113,8 @@ public class WorldGenerator { if(entry.noise.octaveNoise2D(2, 0.7, 1f / (2 + i*2), x, y)/2f + entry.ridge.getValue(x, y, 1f / (28 + i*4)) >= 2.0f - entry.frequency*4.0f && entry.ridge.getValue(x+9999, y+9999, 1f/100f) > 0.4){ - tile.setFloor(entry.block); + tile.setFloor(OreBlocks.get(tile.floor(), entry.item)); + break; } } } @@ -120,14 +124,14 @@ public class WorldGenerator { static class OreEntry{ final float frequency; - final Block block; + final Item item; final Simplex noise; final RidgedPerlin ridge; final int index; - OreEntry(Block block, float frequency, int seed) { + OreEntry(Item item, float frequency, int seed) { this.frequency = frequency; - this.block = block; + this.item = item; this.noise = new Simplex(seed + oreIndex); this.ridge = new RidgedPerlin(seed + oreIndex, 2); this.index = oreIndex ++;