Tweaked spawn times / Liquid bridge fixes

This commit is contained in:
Anuken 2018-08-06 10:31:50 -04:00
parent 468e092422
commit 635e299464
5 changed files with 68 additions and 5 deletions

View File

@ -32,7 +32,7 @@ public class UnitBlocks extends BlockList implements ContentList{
interceptorPad = new UnitPad("interceptor-pad"){{
type = UnitTypes.interceptor;
produceTime = 800;
produceTime = 900;
size = 2;
consumes.power(0.08f);
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 20), new ItemStack(Items.titanium, 10)});
@ -40,7 +40,7 @@ public class UnitBlocks extends BlockList implements ContentList{
monsoonPad = new UnitPad("monsoon-pad"){{
type = UnitTypes.monsoon;
produceTime = 1400;
produceTime = 1500;
size = 3;
consumes.power(0.14f);
shadow = "shadow-round-3";
@ -49,7 +49,7 @@ public class UnitBlocks extends BlockList implements ContentList{
daggerPad = new UnitPad("dagger-pad"){{
type = UnitTypes.dagger;
produceTime = 600;
produceTime = 500;
size = 2;
consumes.power(0.06f);
consumes.items(new ItemStack[]{new ItemStack(Items.silicon, 10), new ItemStack(Items.tungsten, 20)});

View File

@ -136,7 +136,6 @@ public class Sectors{
double waveChance = 0.3;
sector.difficulty = (int)(Mathf.dst(sector.x, sector.y));
sector.spawns = sector.missions.first().getWaves(sector);
if(sector.difficulty == 0){
sector.missions.add(new WaveMission(10));
@ -145,6 +144,8 @@ public class Sectors{
: new BattleMission());
}
sector.spawns = sector.missions.first().getWaves(sector);
//add all ores for now since material differences aren't well handled yet
sector.ores.addAll(Items.tungsten, Items.coal, Items.lead, Items.thorium, Items.titanium);
}

View File

@ -121,7 +121,7 @@ public abstract class BaseBlock{
Tile other = proximity.get((i + dump) % proximity.size);
Tile in = Edges.getFacingEdge(tile, other);
if(other.block().hasLiquids){
if(other.block().hasLiquids && canDumpLiquid(tile, other, liquid)){
float ofract = other.entity.liquids.get(liquid) / other.block().liquidCapacity;
float fract = tile.entity.liquids.get(liquid) / liquidCapacity;
@ -131,6 +131,10 @@ public abstract class BaseBlock{
}
public boolean canDumpLiquid(Tile tile, Tile to, Liquid liquid){
return true;
}
public void tryMoveLiquid(Tile tile, Tile tileSource, Tile next, float amount, Liquid liquid){
float flow = Math.min(next.block().liquidCapacity - next.entity.liquids.get(liquid) - 0.001f, amount);

View File

@ -1,6 +1,8 @@
package io.anuke.mindustry.world.blocks.distribution;
import com.badlogic.gdx.utils.IntSet.IntSetIterator;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.util.Mathf;
@ -48,4 +50,31 @@ public class LiquidBridge extends ItemBridge{
public boolean acceptItem(Item item, Tile tile, Tile source){
return false;
}
@Override
public boolean canDumpLiquid(Tile tile, Tile to, Liquid liquid){
ItemBridgeEntity entity = tile.entity();
Tile other = world.tile(entity.link);
if(!linkValid(tile, other)){
int i = tile.absoluteRelativeTo(to.x, to.y);
IntSetIterator it = entity.incoming.iterator();
while(it.hasNext){
int v = it.next();
int x = v % world.width();
int y = v / world.width();
if(tile.absoluteRelativeTo(x, y) == i){
return false;
}
}
return true;
}
int rel = tile.absoluteRelativeTo(other.x, other.y);
int rel2 = tile.relativeTo(to.x, to.y);
return rel != rel2;
}
}

View File

@ -1,6 +1,8 @@
package io.anuke.mindustry.world.blocks.distribution;
import com.badlogic.gdx.utils.IntSet.IntSetIterator;
import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.type.Liquid;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.Timers;
import io.anuke.ucore.util.Mathf;
@ -48,4 +50,31 @@ public class LiquidExtendingBridge extends ExtendingItemBridge{
public boolean acceptItem(Item item, Tile tile, Tile source){
return false;
}
@Override
public boolean canDumpLiquid(Tile tile, Tile to, Liquid liquid){
ItemBridgeEntity entity = tile.entity();
Tile other = world.tile(entity.link);
if(!linkValid(tile, other)){
int i = tile.absoluteRelativeTo(to.x, to.y);
IntSetIterator it = entity.incoming.iterator();
while(it.hasNext){
int v = it.next();
int x = v % world.width();
int y = v / world.width();
if(tile.absoluteRelativeTo(x, y) == i){
return false;
}
}
return true;
}
int rel = tile.absoluteRelativeTo(other.x, other.y);
int rel2 = tile.relativeTo(to.x, to.y);
return rel != rel2;
}
}