mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-10 18:57:39 +07:00
impact drill wip
This commit is contained in:
parent
38f7d2dcd0
commit
1a8a2c326e
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
|
||||
63290=build-tower|block-build-tower-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
|
||||
oreCopper, oreLead, oreScrap, oreCoal, oreTitanium, oreThorium,
|
||||
oreTungsten,
|
||||
|
||||
//wall ores
|
||||
wallOreBeryl, graphiticWall,
|
||||
@ -84,7 +85,7 @@ public class Blocks implements ContentList{
|
||||
|
||||
//production
|
||||
mechanicalDrill, pneumaticDrill, laserDrill, blastDrill, waterExtractor, oilExtractor, cultivator,
|
||||
cliffCrusher, plasmaBore,
|
||||
cliffCrusher, plasmaBore, impactDrill,
|
||||
|
||||
//storage
|
||||
coreShard, coreFoundation, coreNucleus, vault, container, unloader,
|
||||
@ -635,6 +636,8 @@ public class Blocks implements ContentList{
|
||||
oreScale = 25.380953f;
|
||||
}};
|
||||
|
||||
oreTungsten = new OreBlock(Items.tungsten);
|
||||
|
||||
//endregion
|
||||
//region wall ore
|
||||
|
||||
@ -1272,17 +1275,17 @@ public class Blocks implements ContentList{
|
||||
//special transport blocks
|
||||
|
||||
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;
|
||||
}};
|
||||
|
||||
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;
|
||||
}};
|
||||
|
||||
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;
|
||||
}};
|
||||
|
||||
@ -1596,6 +1599,21 @@ public class Blocks implements ContentList{
|
||||
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"){{
|
||||
requirements(Category.production, with(Items.metaglass, 30, Items.graphite, 30, Items.lead, 30, Items.copper, 30));
|
||||
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){
|
||||
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
|
||||
public void drawCracks(){}
|
||||
|
||||
public void drawDefaultCracks(){
|
||||
super.drawCracks();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
float s = 0.3f;
|
||||
float ts = 0.6f;
|
||||
|
||||
Draw.rect(region, x, y);
|
||||
super.drawCracks();
|
||||
drawDefaultCracks();
|
||||
|
||||
if(drawRim){
|
||||
Draw.color(heatColor);
|
||||
|
Loading…
Reference in New Issue
Block a user