Unit wall mining
This commit is contained in:
Binary file not shown.
@@ -18,7 +18,7 @@ public class ErekirTechTree{
|
|||||||
costMultipliers.put(Items.surgeAlloy, 4);
|
costMultipliers.put(Items.surgeAlloy, 4);
|
||||||
costMultipliers.put(Items.phaseFabric, 4);
|
costMultipliers.put(Items.phaseFabric, 4);
|
||||||
costMultipliers.put(Items.thorium, 9);
|
costMultipliers.put(Items.thorium, 9);
|
||||||
costMultipliers.put(Items.graphite, 8);
|
costMultipliers.put(Items.graphite, 9);
|
||||||
|
|
||||||
Planets.erekir.techTree = nodeRoot("erekir", coreBastion, true, () -> {
|
Planets.erekir.techTree = nodeRoot("erekir", coreBastion, true, () -> {
|
||||||
context().researchCostMultipliers = costMultipliers;
|
context().researchCostMultipliers = costMultipliers;
|
||||||
@@ -71,6 +71,18 @@ public class ErekirTechTree{
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//TODO move into turbine condenser?
|
||||||
|
node(plasmaBore, () -> {
|
||||||
|
|
||||||
|
node(impactDrill, erekirSector, () -> {
|
||||||
|
node(largePlasmaBore, () -> {
|
||||||
|
node(eruptionDrill, () -> {
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
node(turbineCondenser, () -> {
|
node(turbineCondenser, () -> {
|
||||||
node(beamNode, () -> {
|
node(beamNode, () -> {
|
||||||
node(ventCondenser, erekirSector, () -> {
|
node(ventCondenser, erekirSector, () -> {
|
||||||
@@ -93,75 +105,63 @@ public class ErekirTechTree{
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
node(siliconArcFurnace, () -> {
|
node(reinforcedConduit, erekirSector, () -> {
|
||||||
node(cliffCrusher, () -> {
|
node(reinforcedPump, () -> {
|
||||||
node(electrolyzer, erekirSector, () -> {
|
//TODO T2 pump
|
||||||
node(oxidationChamber, () -> {
|
});
|
||||||
node(electricHeater, () -> {
|
|
||||||
node(heatRedirector, () -> {
|
node(reinforcedLiquidJunction, () -> {
|
||||||
|
node(reinforcedBridgeConduit, () -> {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
node(reinforcedLiquidRouter, () -> {
|
||||||
|
node(reinforcedLiquidContainer, () -> {
|
||||||
|
node(reinforcedLiquidTank, () -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
node(atmosphericConcentrator, () -> {
|
node(siliconArcFurnace, () -> {
|
||||||
node(cyanogenSynthesizer, () -> {
|
node(cliffCrusher, () -> {
|
||||||
|
node(electrolyzer, erekirSector, () -> {
|
||||||
|
node(oxidationChamber, () -> {
|
||||||
|
node(electricHeater, () -> {
|
||||||
|
node(heatRedirector, () -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
node(carbideCrucible, () -> {
|
node(atmosphericConcentrator, () -> {
|
||||||
node(surgeCrucible, () -> {
|
node(cyanogenSynthesizer, () -> {
|
||||||
node(phaseSynthesizer, () -> {
|
|
||||||
node(phaseHeater, () -> {
|
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
node(carbideCrucible, () -> {
|
||||||
|
node(surgeCrucible, () -> {
|
||||||
|
node(phaseSynthesizer, () -> {
|
||||||
|
node(phaseHeater, () -> {
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
node(slagIncinerator, () -> {
|
node(slagIncinerator, () -> {
|
||||||
|
|
||||||
node(slagCentrifuge, () -> {
|
node(slagCentrifuge, () -> {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
node(heatReactor, () -> {
|
node(heatReactor, () -> {
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
//TODO move into turbine condenser?
|
|
||||||
node(plasmaBore, () -> {
|
|
||||||
|
|
||||||
node(impactDrill, erekirSector, () -> {
|
|
||||||
node(largePlasmaBore, () -> {
|
|
||||||
node(eruptionDrill, () -> {
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
node(reinforcedConduit, erekirSector, () -> {
|
|
||||||
node(reinforcedPump, () -> {
|
|
||||||
//TODO T2 pump
|
|
||||||
});
|
|
||||||
|
|
||||||
node(reinforcedLiquidJunction, () -> {
|
|
||||||
node(reinforcedBridgeConduit, () -> {
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
node(reinforcedLiquidRouter, () -> {
|
|
||||||
node(reinforcedLiquidContainer, () -> {
|
|
||||||
node(reinforcedLiquidTank, () -> {
|
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -57,12 +57,6 @@ public class Planets{
|
|||||||
totalRadius += 2.6f;
|
totalRadius += 2.6f;
|
||||||
lightSrcTo = 0.5f;
|
lightSrcTo = 0.5f;
|
||||||
lightDstFrom = 0.2f;
|
lightDstFrom = 0.2f;
|
||||||
|
|
||||||
unlockedOnLand.addAll(
|
|
||||||
Blocks.plasmaBore, Blocks.duct,
|
|
||||||
Blocks.turbineCondenser, Blocks.breach,
|
|
||||||
Blocks.coreCitadel
|
|
||||||
);
|
|
||||||
}};
|
}};
|
||||||
|
|
||||||
//TODO names
|
//TODO names
|
||||||
|
|||||||
@@ -2700,9 +2700,11 @@ public class UnitTypes{
|
|||||||
|
|
||||||
outlineColor = Pal.darkOutline;
|
outlineColor = Pal.darkOutline;
|
||||||
lowAltitude = false;
|
lowAltitude = false;
|
||||||
|
mineWalls = true;
|
||||||
|
mineFloor = false;
|
||||||
flying = true;
|
flying = true;
|
||||||
mineSpeed = 6.5f;
|
mineSpeed = 4f;
|
||||||
mineTier = 1;
|
mineTier = 4;
|
||||||
buildSpeed = 0.8f;
|
buildSpeed = 0.8f;
|
||||||
drag = 0.06f;
|
drag = 0.06f;
|
||||||
speed = 2.9f;
|
speed = 2.9f;
|
||||||
@@ -2758,9 +2760,11 @@ public class UnitTypes{
|
|||||||
outlineColor = Pal.darkOutline;
|
outlineColor = Pal.darkOutline;
|
||||||
lowAltitude = false;
|
lowAltitude = false;
|
||||||
flying = true;
|
flying = true;
|
||||||
|
mineWalls = true;
|
||||||
targetAir = false;
|
targetAir = false;
|
||||||
mineSpeed = 8f;
|
mineFloor = false;
|
||||||
mineTier = 2;
|
mineSpeed = 5f;
|
||||||
|
mineTier = 4;
|
||||||
buildSpeed = 1.4f;
|
buildSpeed = 1.4f;
|
||||||
drag = 0.06f;
|
drag = 0.06f;
|
||||||
speed = 2.8f;
|
speed = 2.8f;
|
||||||
@@ -2816,8 +2820,10 @@ public class UnitTypes{
|
|||||||
lowAltitude = false;
|
lowAltitude = false;
|
||||||
flying = true;
|
flying = true;
|
||||||
targetAir = false;
|
targetAir = false;
|
||||||
mineSpeed = 8f;
|
mineWalls = true;
|
||||||
mineTier = 3;
|
mineFloor = false;
|
||||||
|
mineSpeed = 6f;
|
||||||
|
mineTier = 4;
|
||||||
buildSpeed = 2f;
|
buildSpeed = 2f;
|
||||||
drag = 0.06f;
|
drag = 0.06f;
|
||||||
speed = 2.6f;
|
speed = 2.6f;
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{
|
|||||||
transient float mineTimer;
|
transient float mineTimer;
|
||||||
@Nullable @SyncLocal Tile mineTile;
|
@Nullable @SyncLocal Tile mineTile;
|
||||||
|
|
||||||
public boolean canMine(Item item){
|
public boolean canMine(@Nullable Item item){
|
||||||
|
if(item == null) return false;
|
||||||
return type.mineTier >= item.hardness;
|
return type.mineTier >= item.hardness;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,9 +36,28 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{
|
|||||||
return mineTile != null && !this.<Unit>self().activelyBuilding();
|
return mineTile != null && !this.<Unit>self().activelyBuilding();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public @Nullable Item getMineResult(@Nullable Tile tile){
|
||||||
|
if(tile == null) return null;
|
||||||
|
Item result;
|
||||||
|
if(type.mineFloor && tile.block() == Blocks.air){
|
||||||
|
result = tile.drop();
|
||||||
|
}else if(type.mineWalls){
|
||||||
|
result = tile.wallDrop();
|
||||||
|
}else{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return canMine(result) ? result : null;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean validMine(Tile tile, boolean checkDst){
|
public boolean validMine(Tile tile, boolean checkDst){
|
||||||
return !(tile == null || tile.block() != Blocks.air || (!within(tile.worldx(), tile.worldy(), type.miningRange) && checkDst)
|
if(tile == null) return false;
|
||||||
|| tile.drop() == null || !canMine(tile.drop()));
|
|
||||||
|
if(checkDst && !within(tile.worldx(), tile.worldy(), type.miningRange)){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return getMineResult(tile) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean validMine(Tile tile){
|
public boolean validMine(Tile tile){
|
||||||
@@ -50,9 +70,12 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void update(){
|
public void update(){
|
||||||
Building core = closestCore();
|
if(mineTile == null) return;
|
||||||
|
|
||||||
if(core != null && mineTile != null && mineTile.drop() != null && !acceptsItem(mineTile.drop()) && within(core, mineTransferRange) && !offloadImmediately()){
|
Building core = closestCore();
|
||||||
|
Item item = getMineResult(mineTile);
|
||||||
|
|
||||||
|
if(core != null && item != null && !acceptsItem(item) && within(core, mineTransferRange) && !offloadImmediately()){
|
||||||
int accepted = core.acceptStack(item(), stack().amount, this);
|
int accepted = core.acceptStack(item(), stack().amount, this);
|
||||||
if(accepted > 0){
|
if(accepted > 0){
|
||||||
Call.transferItemTo(self(), item(), accepted,
|
Call.transferItemTo(self(), item(), accepted,
|
||||||
@@ -65,8 +88,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{
|
|||||||
if((!net.client() || isLocal()) && !validMine(mineTile)){
|
if((!net.client() || isLocal()) && !validMine(mineTile)){
|
||||||
mineTile = null;
|
mineTile = null;
|
||||||
mineTimer = 0f;
|
mineTimer = 0f;
|
||||||
}else if(mining()){
|
}else if(mining() && item != null){
|
||||||
Item item = mineTile.drop();
|
|
||||||
mineTimer += Time.delta *type.mineSpeed;
|
mineTimer += Time.delta *type.mineSpeed;
|
||||||
|
|
||||||
if(Mathf.chance(0.06 * Time.delta)){
|
if(Mathf.chance(0.06 * Time.delta)){
|
||||||
|
|||||||
@@ -1048,11 +1048,9 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
|
|||||||
|
|
||||||
boolean canMine(Tile tile){
|
boolean canMine(Tile tile){
|
||||||
return !Core.scene.hasMouse()
|
return !Core.scene.hasMouse()
|
||||||
&& tile.drop() != null
|
|
||||||
&& player.unit().validMine(tile)
|
&& player.unit().validMine(tile)
|
||||||
&& !((!Core.settings.getBool("doubletapmine") && tile.floor().playerUnmineable) && tile.overlay().itemDrop == null)
|
&& player.unit().acceptsItem(player.unit().getMineResult(tile))
|
||||||
&& player.unit().acceptsItem(tile.drop())
|
&& !((!Core.settings.getBool("doubletapmine") && tile.floor().playerUnmineable) && tile.overlay().itemDrop == null);
|
||||||
&& tile.block() == Blocks.air;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the tile at the specified MOUSE coordinates. */
|
/** Returns the tile at the specified MOUSE coordinates. */
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ public class UnitType extends UnlockableContent{
|
|||||||
public int ammoCapacity = -1;
|
public int ammoCapacity = -1;
|
||||||
public AmmoType ammoType = new ItemAmmoType(Items.copper);
|
public AmmoType ammoType = new ItemAmmoType(Items.copper);
|
||||||
public int mineTier = -1;
|
public int mineTier = -1;
|
||||||
|
public boolean mineWalls = false, mineFloor = true;
|
||||||
public float buildSpeed = -1f, mineSpeed = 1f;
|
public float buildSpeed = -1f, mineSpeed = 1f;
|
||||||
public Sound mineSound = Sounds.minebeam;
|
public Sound mineSound = Sounds.minebeam;
|
||||||
public float mineSoundVolume = 0.6f;
|
public float mineSoundVolume = 0.6f;
|
||||||
|
|||||||
@@ -761,7 +761,7 @@ public class PlanetDialog extends BaseDialog implements PlanetInterfaceRenderer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(state.planet.hasGrid()){
|
if(state.planet.hasGrid()){
|
||||||
hovered = state.planet.getSector(planets.cam.getMouseRay(), PlanetRenderer.outlineRad);
|
hovered = Core.scene.getDialog() == this ? state.planet.getSector(planets.cam.getMouseRay(), PlanetRenderer.outlineRad) : null;
|
||||||
}else if(state.planet.isLandable()){
|
}else if(state.planet.isLandable()){
|
||||||
boolean wasNull = selected == null;
|
boolean wasNull = selected == null;
|
||||||
//always have the first sector selected.
|
//always have the first sector selected.
|
||||||
|
|||||||
Reference in New Issue
Block a user