WIP small unit fabricator
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 565 B |
BIN
core/assets-raw/sprites/blocks/units/fabricator-out.png
Normal file
BIN
core/assets-raw/sprites/blocks/units/fabricator-out.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 565 B |
BIN
core/assets-raw/sprites/blocks/units/fabricator-top.png
Normal file
BIN
core/assets-raw/sprites/blocks/units/fabricator-top.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1015 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -542,3 +542,4 @@
|
|||||||
63161=prime-control-core|block-prime-control-core-ui
|
63161=prime-control-core|block-prime-control-core-ui
|
||||||
63160=ore-wall-thorium|block-ore-wall-thorium-ui
|
63160=ore-wall-thorium|block-ore-wall-thorium-ui
|
||||||
63159=core-zone|block-core-zone-ui
|
63159=core-zone|block-core-zone-ui
|
||||||
|
63158=fabricator|block-fabricator-ui
|
||||||
|
|||||||
Binary file not shown.
@@ -136,6 +136,7 @@ public class Blocks{
|
|||||||
repairPoint, repairTurret,
|
repairPoint, repairTurret,
|
||||||
|
|
||||||
//unit - erekir
|
//unit - erekir
|
||||||
|
fabricator,
|
||||||
tankAssembler, shipAssembler, mechAssembler,
|
tankAssembler, shipAssembler, mechAssembler,
|
||||||
//TODO maybe making it 5x5 would be more appropriate, seems kinda cheap.
|
//TODO maybe making it 5x5 would be more appropriate, seems kinda cheap.
|
||||||
basicAssemblerModule,
|
basicAssemblerModule,
|
||||||
@@ -3598,6 +3599,14 @@ public class Blocks{
|
|||||||
researchCostMultiplier = 0f;
|
researchCostMultiplier = 0f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
fabricator = new UnitFactory("fabricator"){{
|
||||||
|
requirements(Category.units, with(Items.silicon, 230, Items.oxide, 50, Items.beryllium, 230));
|
||||||
|
size = 3;
|
||||||
|
configurable = false;
|
||||||
|
plans.add(new UnitPlan(UnitTypes.dagger, 60f * 60f, with(Items.oxide, 15f, Items.silicon, 50f)));
|
||||||
|
consumePower(2f);
|
||||||
|
}};
|
||||||
|
|
||||||
tankAssembler = new UnitAssembler("tank-assembler"){{
|
tankAssembler = new UnitAssembler("tank-assembler"){{
|
||||||
requirements(Category.units, with(Items.graphite, 600, Items.beryllium, 600, Items.oxide, 250, Items.tungsten, 400, Items.silicon, 500));
|
requirements(Category.units, with(Items.graphite, 600, Items.beryllium, 600, Items.oxide, 250, Items.tungsten, 400, Items.silicon, 500));
|
||||||
size = 5;
|
size = 5;
|
||||||
@@ -3635,7 +3644,8 @@ public class Blocks{
|
|||||||
consumeLiquid(Liquids.nitrogen, 24f / 60f);
|
consumeLiquid(Liquids.nitrogen, 24f / 60f);
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//TODO requirements
|
//TODO 5x5
|
||||||
|
if(false)
|
||||||
basicAssemblerModule = new UnitAssemblerModule("basic-assembler-module"){{
|
basicAssemblerModule = new UnitAssemblerModule("basic-assembler-module"){{
|
||||||
requirements(Category.units, with(Items.graphite, 10));
|
requirements(Category.units, with(Items.graphite, 10));
|
||||||
consumePower(0.5f);
|
consumePower(0.5f);
|
||||||
|
|||||||
@@ -296,40 +296,17 @@ public class Maps{
|
|||||||
public Seq<GenerateFilter> readFilters(String str){
|
public Seq<GenerateFilter> readFilters(String str){
|
||||||
if(str == null || str.isEmpty()){
|
if(str == null || str.isEmpty()){
|
||||||
//create default filters list
|
//create default filters list
|
||||||
Seq<GenerateFilter> filters = Seq.with(
|
|
||||||
new ScatterFilter(){{
|
Seq<GenerateFilter> filters = new Seq<>();
|
||||||
flooronto = Blocks.snow;
|
|
||||||
block = Blocks.snowBoulder;
|
for(Block block : content.blocks()){
|
||||||
}},
|
if(block.isFloor() && block.inEditor && block.asFloor().decoration != Blocks.air){
|
||||||
new ScatterFilter(){{
|
var filter = new ScatterFilter();
|
||||||
flooronto = Blocks.ice;
|
filter.flooronto = block.asFloor();
|
||||||
block = Blocks.snowBoulder;
|
filter.block = block.asFloor().decoration;
|
||||||
}},
|
filters.add(filter);
|
||||||
new ScatterFilter(){{
|
}
|
||||||
flooronto = Blocks.sand;
|
}
|
||||||
block = Blocks.sandBoulder;
|
|
||||||
}},
|
|
||||||
new ScatterFilter(){{
|
|
||||||
flooronto = Blocks.darksand;
|
|
||||||
block = Blocks.basaltBoulder;
|
|
||||||
}},
|
|
||||||
new ScatterFilter(){{
|
|
||||||
flooronto = Blocks.basalt;
|
|
||||||
block = Blocks.basaltBoulder;
|
|
||||||
}},
|
|
||||||
new ScatterFilter(){{
|
|
||||||
flooronto = Blocks.dacite;
|
|
||||||
block = Blocks.daciteBoulder;
|
|
||||||
}},
|
|
||||||
new ScatterFilter(){{
|
|
||||||
flooronto = Blocks.stone;
|
|
||||||
block = Blocks.boulder;
|
|
||||||
}},
|
|
||||||
new ScatterFilter(){{
|
|
||||||
flooronto = Blocks.shale;
|
|
||||||
block = Blocks.shaleBoulder;
|
|
||||||
}}
|
|
||||||
);
|
|
||||||
|
|
||||||
addDefaultOres(filters);
|
addDefaultOres(filters);
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import mindustry.world.*;
|
|||||||
import static mindustry.maps.filters.FilterOption.*;
|
import static mindustry.maps.filters.FilterOption.*;
|
||||||
|
|
||||||
public class ScatterFilter extends GenerateFilter{
|
public class ScatterFilter extends GenerateFilter{
|
||||||
protected float chance = 0.013f;
|
public float chance = 0.013f;
|
||||||
protected Block flooronto = Blocks.air, floor = Blocks.air, block = Blocks.air;
|
public Block flooronto = Blocks.air, floor = Blocks.air, block = Blocks.air;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FilterOption[] options(){
|
public FilterOption[] options(){
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ public class PowerGraph{
|
|||||||
batteries.add(build);
|
batteries.add(build);
|
||||||
}else if(build.block.outputsPower){
|
}else if(build.block.outputsPower){
|
||||||
producers.add(build);
|
producers.add(build);
|
||||||
}else if(build.block.consumesPower){
|
}else if(build.block.consumesPower && build.block.consPower != null){
|
||||||
consumers.add(build);
|
consumers.add(build);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,12 +41,16 @@ public class UnitFactory extends UnitBlock{
|
|||||||
regionRotated1 = 1;
|
regionRotated1 = 1;
|
||||||
|
|
||||||
config(Integer.class, (UnitFactoryBuild tile, Integer i) -> {
|
config(Integer.class, (UnitFactoryBuild tile, Integer i) -> {
|
||||||
|
if(!configurable) return;
|
||||||
|
|
||||||
if(tile.currentPlan == i) return;
|
if(tile.currentPlan == i) return;
|
||||||
tile.currentPlan = i < 0 || i >= plans.size ? -1 : i;
|
tile.currentPlan = i < 0 || i >= plans.size ? -1 : i;
|
||||||
tile.progress = 0;
|
tile.progress = 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
config(UnitType.class, (UnitFactoryBuild tile, UnitType val) -> {
|
config(UnitType.class, (UnitFactoryBuild tile, UnitType val) -> {
|
||||||
|
if(!configurable) return;
|
||||||
|
|
||||||
int next = plans.indexOf(p -> p.unit == val);
|
int next = plans.indexOf(p -> p.unit == val);
|
||||||
if(tile.currentPlan == next) return;
|
if(tile.currentPlan == next) return;
|
||||||
tile.currentPlan = next;
|
tile.currentPlan = next;
|
||||||
@@ -218,6 +222,10 @@ public class UnitFactory extends UnitBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateTile(){
|
public void updateTile(){
|
||||||
|
if(!configurable){
|
||||||
|
currentPlan = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if(currentPlan < 0 || currentPlan >= plans.size){
|
if(currentPlan < 0 || currentPlan >= plans.size){
|
||||||
currentPlan = -1;
|
currentPlan = -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user