impact drill wip
This commit is contained in:
BIN
core/assets-raw/sprites/blocks/drills/impact-drill-rotator.png
Normal file
BIN
core/assets-raw/sprites/blocks/drills/impact-drill-rotator.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
BIN
core/assets-raw/sprites/blocks/drills/impact-drill-top.png
Normal file
BIN
core/assets-raw/sprites/blocks/drills/impact-drill-top.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 367 B |
BIN
core/assets-raw/sprites/blocks/drills/impact-drill.png
Normal file
BIN
core/assets-raw/sprites/blocks/drills/impact-drill.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
BIN
core/assets-raw/sprites/blocks/environment/tungsten1.png
Normal file
BIN
core/assets-raw/sprites/blocks/environment/tungsten1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 399 B |
BIN
core/assets-raw/sprites/blocks/environment/tungsten2.png
Normal file
BIN
core/assets-raw/sprites/blocks/environment/tungsten2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 327 B |
BIN
core/assets-raw/sprites/blocks/environment/tungsten3.png
Normal file
BIN
core/assets-raw/sprites/blocks/environment/tungsten3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 331 B |
@@ -417,3 +417,5 @@
|
|||||||
63291=beam-tower|block-beam-tower-ui
|
63291=beam-tower|block-beam-tower-ui
|
||||||
63290=build-tower|block-build-tower-ui
|
63290=build-tower|block-build-tower-ui
|
||||||
63289=tungsten|item-tungsten-ui
|
63289=tungsten|item-tungsten-ui
|
||||||
|
63288=ore-tungsten|block-ore-tungsten-ui
|
||||||
|
63287=impact-drill|block-impact-drill-ui
|
||||||
|
|||||||
Binary file not shown.
@@ -50,6 +50,7 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
//ores
|
//ores
|
||||||
oreCopper, oreLead, oreScrap, oreCoal, oreTitanium, oreThorium,
|
oreCopper, oreLead, oreScrap, oreCoal, oreTitanium, oreThorium,
|
||||||
|
oreTungsten,
|
||||||
|
|
||||||
//wall ores
|
//wall ores
|
||||||
wallOreBeryl, graphiticWall,
|
wallOreBeryl, graphiticWall,
|
||||||
@@ -84,7 +85,7 @@ public class Blocks implements ContentList{
|
|||||||
|
|
||||||
//production
|
//production
|
||||||
mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, waterExtractor, oilExtractor, cultivator,
|
mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, waterExtractor, oilExtractor, cultivator,
|
||||||
cliffCrusher, plasmaBore,
|
cliffCrusher, plasmaBore, impactDrill,
|
||||||
|
|
||||||
//storage
|
//storage
|
||||||
coreShard, coreFoundation, coreNucleus, vault, container, unloader,
|
coreShard, coreFoundation, coreNucleus, vault, container, unloader,
|
||||||
@@ -635,6 +636,8 @@ public class Blocks implements ContentList{
|
|||||||
oreScale = 25.380953f;
|
oreScale = 25.380953f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
oreTungsten = new OreBlock(Items.tungsten);
|
||||||
|
|
||||||
//endregion
|
//endregion
|
||||||
//region wall ore
|
//region wall ore
|
||||||
|
|
||||||
@@ -1272,17 +1275,17 @@ public class Blocks implements ContentList{
|
|||||||
//special transport blocks
|
//special transport blocks
|
||||||
|
|
||||||
duct = new Duct("duct"){{
|
duct = new Duct("duct"){{
|
||||||
requirements(Category.distribution, BuildVisibility.debugOnly, with(Items.graphite, 5, Items.metaglass, 2));
|
requirements(Category.distribution, BuildVisibility.debugOnly, with(Items.graphite, 5));
|
||||||
speed = 4f;
|
speed = 4f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
ductRouter = new DuctRouter("duct-router"){{
|
ductRouter = new DuctRouter("duct-router"){{
|
||||||
requirements(Category.distribution, BuildVisibility.debugOnly, with(Items.graphite, 10, Items.metaglass, 4));
|
requirements(Category.distribution, BuildVisibility.debugOnly, with(Items.graphite, 10));
|
||||||
speed = 4f;
|
speed = 4f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
ductBridge = new DuctBridge("duct-bridge"){{
|
ductBridge = new DuctBridge("duct-bridge"){{
|
||||||
requirements(Category.distribution, BuildVisibility.debugOnly, with(Items.graphite, 20, Items.metaglass, 8));
|
requirements(Category.distribution, BuildVisibility.debugOnly, with(Items.graphite, 20));
|
||||||
speed = 4f;
|
speed = 4f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1596,6 +1599,21 @@ public class Blocks implements ContentList{
|
|||||||
consumes.liquid(Liquids.water, 0.1f).boost();
|
consumes.liquid(Liquids.water, 0.1f).boost();
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
//TODO should be crusher or something
|
||||||
|
impactDrill = new BurstDrill("impact-drill"){{
|
||||||
|
requirements(Category.production, with(Items.silicon, 60, Items.beryllium, 90, Items.graphite, 50));
|
||||||
|
drillTime = 60f * 10f;
|
||||||
|
size = 4;
|
||||||
|
drawRim = false;
|
||||||
|
hasPower = true;
|
||||||
|
tier = 6;
|
||||||
|
drillEffect = Fx.mineHuge;
|
||||||
|
itemCapacity = 30;
|
||||||
|
|
||||||
|
consumes.power(3f);
|
||||||
|
consumes.liquid(Liquids.water, 0.2f);
|
||||||
|
}};
|
||||||
|
|
||||||
waterExtractor = new SolidPump("water-extractor"){{
|
waterExtractor = new SolidPump("water-extractor"){{
|
||||||
requirements(Category.production, with(Items.metaglass, 30, Items.graphite, 30, Items.lead, 30, Items.copper, 30));
|
requirements(Category.production, with(Items.metaglass, 30, Items.graphite, 30, Items.lead, 30, Items.copper, 30));
|
||||||
result = Liquids.water;
|
result = Liquids.water;
|
||||||
|
|||||||
@@ -172,6 +172,19 @@ public class ErekirPlanetGenerator extends PlanetGenerator{
|
|||||||
}else if(empty && noise(x + 782, y, 4, 0.8f, 40f, 1f) > 0.7f && block != Blocks.carbonWall){
|
}else if(empty && noise(x + 782, y, 4, 0.8f, 40f, 1f) > 0.7f && block != Blocks.carbonWall){
|
||||||
ore = Blocks.wallOreBeryl;
|
ore = Blocks.wallOreBeryl;
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
boolean empty = true;
|
||||||
|
for(Point2 p : Geometry.d8){
|
||||||
|
Tile other = tiles.get(x + p.x, y + p.y);
|
||||||
|
if(other != null && other.block() != Blocks.air){
|
||||||
|
empty = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(empty && noise(x + 150, y + x*2 + 100, 4, 0.8f, 42f, 1f) > 0.73f/* && floor == Blocks.yellowStone*/){
|
||||||
|
ore = Blocks.oreTungsten;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
72
core/src/mindustry/world/blocks/production/BurstDrill.java
Normal file
72
core/src/mindustry/world/blocks/production/BurstDrill.java
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
package mindustry.world.blocks.production;
|
||||||
|
|
||||||
|
import arc.graphics.g2d.*;
|
||||||
|
import arc.math.*;
|
||||||
|
import mindustry.graphics.*;
|
||||||
|
|
||||||
|
public class BurstDrill extends Drill{
|
||||||
|
public int outputAmount = 5;
|
||||||
|
|
||||||
|
public BurstDrill(String name){
|
||||||
|
super(name);
|
||||||
|
|
||||||
|
itemCapacity = 20;
|
||||||
|
//does not drill in the traditional sense, so this is not even used
|
||||||
|
hardnessDrillMultiplier = 0f;
|
||||||
|
//generally at center
|
||||||
|
drillEffectRnd = 0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BurstDrillBuild extends DrillBuild{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateTile(){
|
||||||
|
if(dominantItem == null){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(timer(timerDump, dumpTime)){
|
||||||
|
dump(items.has(dominantItem) ? dominantItem : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(items.total() <= itemCapacity - outputAmount && dominantItems > 0 && consValid()){
|
||||||
|
|
||||||
|
float speed = efficiency();
|
||||||
|
|
||||||
|
timeDrilled += speed;
|
||||||
|
|
||||||
|
lastDrillSpeed = dominantItems / drillTime * speed;
|
||||||
|
progress += delta() * dominantItems * speed;
|
||||||
|
}else{
|
||||||
|
lastDrillSpeed = 0f;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(dominantItems > 0 && progress >= drillTime && items.total() < itemCapacity){
|
||||||
|
for(int i = 0; i < outputAmount; i++){
|
||||||
|
offload(dominantItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
progress %= drillTime;
|
||||||
|
drillEffect.at(x + Mathf.range(drillEffectRnd), y + Mathf.range(drillEffectRnd), dominantItem.color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(){
|
||||||
|
Draw.rect(region, x, y);
|
||||||
|
drawDefaultCracks();
|
||||||
|
|
||||||
|
//TODO charge
|
||||||
|
|
||||||
|
if(dominantItem != null && drawMineItem){
|
||||||
|
Draw.color(dominantItem.color);
|
||||||
|
Draw.rect(itemRegion, x, y);
|
||||||
|
Draw.color();
|
||||||
|
}
|
||||||
|
|
||||||
|
Drawf.spinSprite(rotatorRegion, x, y, timeDrilled * rotateSpeed);
|
||||||
|
Draw.rect(topRegion, x, y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -311,13 +311,17 @@ public class Drill extends Block{
|
|||||||
@Override
|
@Override
|
||||||
public void drawCracks(){}
|
public void drawCracks(){}
|
||||||
|
|
||||||
|
public void drawDefaultCracks(){
|
||||||
|
super.drawCracks();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(){
|
public void draw(){
|
||||||
float s = 0.3f;
|
float s = 0.3f;
|
||||||
float ts = 0.6f;
|
float ts = 0.6f;
|
||||||
|
|
||||||
Draw.rect(region, x, y);
|
Draw.rect(region, x, y);
|
||||||
super.drawCracks();
|
drawDefaultCracks();
|
||||||
|
|
||||||
if(drawRim){
|
if(drawRim){
|
||||||
Draw.color(heatColor);
|
Draw.color(heatColor);
|
||||||
|
|||||||
Reference in New Issue
Block a user