Fixed extremely suicidal enemies / Conveyor tile fixes

This commit is contained in:
Anuken 2018-08-06 10:54:56 -04:00
parent 635e299464
commit dcc29c0c48
7 changed files with 22 additions and 9 deletions

View file

@ -143,7 +143,7 @@ public class Recipes implements ContentList{
new Recipe(units, UnitBlocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 30));
new Recipe(units, UnitBlocks.resupplyPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 30));
new Recipe(units, UnitBlocks.commandCenter, new ItemStack(Items.lead, 30), new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 30));
new Recipe(units, UnitBlocks.commandCenter, new ItemStack(Items.lead, 100), new ItemStack(Items.carbide, 140), new ItemStack(Items.silicon, 250));
//LIQUIDS
new Recipe(liquid, LiquidBlocks.conduit, new ItemStack(Items.lead, 1))

View file

@ -57,7 +57,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
protected boolean isWave;
protected Squad squad;
protected int spawner;
protected int spawner = -1;
/**internal constructor used for deserialization, DO NOT USE*/
public BaseUnit(){

View file

@ -140,7 +140,7 @@ public class Sectors{
if(sector.difficulty == 0){
sector.missions.add(new WaveMission(10));
}else{
sector.missions.add(Mathf.randomSeed(sector.getSeed() + 1) < waveChance ? new WaveMission(Math.min(10 + sector.difficulty*5 + Mathf.randomSeed(sector.getSeed(), 0, 5)*5, 100))
sector.missions.add(Mathf.randomSeed(sector.getSeed() + 1) < waveChance ? new WaveMission(Math.min(sector.difficulty*5 + Mathf.randomSeed(sector.getSeed(), 0, 3)*5, 100))
: new BattleMission());
}

View file

@ -18,6 +18,7 @@ import io.anuke.mindustry.type.Item;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.mindustry.world.blocks.Floor;
import io.anuke.mindustry.world.blocks.OreBlock;
import io.anuke.ucore.noise.RidgedPerlin;
import io.anuke.ucore.noise.Simplex;
import io.anuke.ucore.noise.VoronoiNoise;
@ -133,6 +134,10 @@ public class WorldGenerator{
if(tile.block() != Blocks.air && tile.hasCliffs() && !tile.block().isMultiblock() && tile.block() != Blocks.blockpart){
tile.setBlock(Blocks.air);
}
if(tile.floor() instanceof OreBlock && tile.hasCliffs()){
tile.setFloor(((OreBlock)tile.floor()).base);
}
}
}
}
@ -205,7 +210,7 @@ public class WorldGenerator{
if(!Mathf.inBounds(x + point.x, y + point.y, width, height)) continue;
if(tiles[x + point.x][y + point.y].getElevation() < elevation){
if(rnd.chance(0.06)){
if(sim2.octaveNoise2D(1, 1, 1.0 / 8, x, y) > 0.8){
tile.setElevation(-1);
}
break;

View file

@ -132,7 +132,7 @@ public class SettingsMenuDialog extends SettingsDialog{
//game.checkPref("smoothcam", true);
game.checkPref("effects", true);
//game.sliderPref("sensitivity", 100, 10, 300, i -> i + "%");
game.sliderPref("saveinterval", 90, 10, 5 * 120, i -> Bundles.format("setting.seconds", i));
game.sliderPref("saveinterval", 60, 10, 5 * 120, i -> Bundles.format("setting.seconds", i));
if(!gwt){
graphics.sliderPref("fpscap", 125, 5, 125, 5, s -> (s > 120 ? Bundles.get("setting.fpscap.none") : Bundles.format("setting.fpscap.text", s)));

View file

@ -299,16 +299,19 @@ public class Conveyor extends Block{
@Override
public synchronized int acceptStack(Item item, int amount, Tile tile, Unit source){
ConveyorEntity entity = tile.entity();
return entity.minitem > itemSpace ? 1 : 0;
return (int)(entity.minitem / itemSpace);
}
@Override
public synchronized void handleStack(Item item, int amount, Tile tile, Unit source){
ConveyorEntity entity = tile.entity();
long result = ItemPos.packItem(item, 0f, 0f, (byte) Mathf.random(255));
entity.convey.insert(0, result);
entity.items.add(item, 1);
for(int i = amount - 1; i >= 0; i--){
long result = ItemPos.packItem(item, 0f, i * itemSpace, (byte) Mathf.random(255));
entity.convey.insert(0, result);
entity.items.add(item, 1);
}
entity.noSleep();
}

View file

@ -12,6 +12,11 @@ public abstract class StorageBlock extends Block{
hasItems = true;
}
@Override
public boolean outputsItems(){
return false;
}
/**
* Removes an item and returns it. If item is not null, it should return the item.
* Returns null if no items are there.