Biomass compressor fix / Crash fix / Removed spawners in waves

This commit is contained in:
Anuken
2018-08-08 10:43:03 -04:00
parent aa00a1b8d1
commit 81c78eafa6
7 changed files with 22 additions and 13 deletions

View File

@@ -3,6 +3,7 @@ package io.anuke.mindustry.content;
import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.content.blocks.*; import io.anuke.mindustry.content.blocks.*;
import io.anuke.mindustry.game.Content; import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.game.GameMode;
import io.anuke.mindustry.type.ContentList; import io.anuke.mindustry.type.ContentList;
import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.type.Recipe; import io.anuke.mindustry.type.Recipe;
@@ -131,15 +132,15 @@ public class Recipes implements ContentList{
new Recipe(units, UnitBlocks.dronePad, new ItemStack(Items.tungsten, 70), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 130)); new Recipe(units, UnitBlocks.dronePad, new ItemStack(Items.tungsten, 70), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 130));
new Recipe(units, UnitBlocks.fabricatorPad, new ItemStack(Items.carbide, 90), new ItemStack(Items.thorium, 80), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 210)); new Recipe(units, UnitBlocks.fabricatorPad, new ItemStack(Items.carbide, 90), new ItemStack(Items.thorium, 80), new ItemStack(Items.lead, 110), new ItemStack(Items.silicon, 210));
new Recipe(units, UnitBlocks.daggerPad, new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 80)); new Recipe(units, UnitBlocks.daggerPad, new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 80)).setMode(GameMode.noWaves);
new Recipe(units, UnitBlocks.titanPad, new ItemStack(Items.thorium, 90), new ItemStack(Items.lead, 140), new ItemStack(Items.silicon, 90)); new Recipe(units, UnitBlocks.titanPad, new ItemStack(Items.thorium, 90), new ItemStack(Items.lead, 140), new ItemStack(Items.silicon, 90)).setMode(GameMode.noWaves);
new Recipe(units, UnitBlocks.interceptorPad, new ItemStack(Items.titanium, 60), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 90)); new Recipe(units, UnitBlocks.interceptorPad, new ItemStack(Items.titanium, 60), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 90)).setMode(GameMode.noWaves);
new Recipe(units, UnitBlocks.monsoonPad, new ItemStack(Items.plastanium, 80), new ItemStack(Items.titanium, 100), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 220)); new Recipe(units, UnitBlocks.monsoonPad, new ItemStack(Items.plastanium, 80), new ItemStack(Items.titanium, 100), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 220)).setMode(GameMode.noWaves);
new Recipe(units, UnitBlocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 30)); 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.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, 100), new ItemStack(Items.carbide, 100), new ItemStack(Items.silicon, 200)); new Recipe(units, UnitBlocks.commandCenter, new ItemStack(Items.lead, 100), new ItemStack(Items.carbide, 100), new ItemStack(Items.silicon, 200)).setMode(GameMode.noWaves);
//LIQUIDS //LIQUIDS
new Recipe(liquid, LiquidBlocks.conduit, new ItemStack(Items.lead, 1)) new Recipe(liquid, LiquidBlocks.conduit, new ItemStack(Items.lead, 1))

View File

@@ -133,7 +133,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
} }
public boolean targetHasFlag(BlockFlag flag){ public boolean targetHasFlag(BlockFlag flag){
return target instanceof TileEntity && return target instanceof TileEntity && ((TileEntity) target).tile.block().flags != null &&
((TileEntity) target).tile.block().flags.contains(flag); ((TileEntity) target).tile.block().flags.contains(flag);
} }

View File

@@ -19,7 +19,6 @@ public class WaveMission implements Mission{
@Override @Override
public Array<SpawnGroup> getWaves(Sector sector){ public Array<SpawnGroup> getWaves(Sector sector){
Array<SpawnGroup> spawns = new Array<>();
return Waves.getSpawns(); return Waves.getSpawns();
} }

View File

@@ -6,6 +6,7 @@ import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.OrderedMap; import com.badlogic.gdx.utils.OrderedMap;
import io.anuke.mindustry.Vars; import io.anuke.mindustry.Vars;
import io.anuke.mindustry.game.Content; import io.anuke.mindustry.game.Content;
import io.anuke.mindustry.game.GameMode;
import io.anuke.mindustry.game.UnlockableContent; import io.anuke.mindustry.game.UnlockableContent;
import io.anuke.mindustry.ui.ContentDisplay; import io.anuke.mindustry.ui.ContentDisplay;
import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block;
@@ -33,6 +34,7 @@ public class Recipe implements UnlockableContent{
public final float cost; public final float cost;
public boolean desktopOnly = false, debugOnly = false; public boolean desktopOnly = false, debugOnly = false;
public GameMode targetMode;
private Block[] dependencies; private Block[] dependencies;
private Recipe[] recipeDependencies; private Recipe[] recipeDependencies;
@@ -101,6 +103,11 @@ public class Recipe implements UnlockableContent{
} }
} }
public Recipe setMode(GameMode mode){
this.targetMode = mode;
return this;
}
public Recipe setDesktop(){ public Recipe setDesktop(){
desktopOnly = true; desktopOnly = true;
return this; return this;

View File

@@ -7,11 +7,13 @@ import com.badlogic.gdx.math.Interpolation;
import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.Array;
import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.entities.TileEntity;
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
import io.anuke.mindustry.input.InputHandler; import io.anuke.mindustry.input.InputHandler;
import io.anuke.mindustry.type.Category; import io.anuke.mindustry.type.Category;
import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.type.ItemStack;
import io.anuke.mindustry.type.Recipe; import io.anuke.mindustry.type.Recipe;
import io.anuke.ucore.core.Core; import io.anuke.ucore.core.Core;
import io.anuke.ucore.core.Events;
import io.anuke.ucore.core.Graphics; import io.anuke.ucore.core.Graphics;
import io.anuke.ucore.scene.Element; import io.anuke.ucore.scene.Element;
import io.anuke.ucore.scene.Group; import io.anuke.ucore.scene.Group;
@@ -87,6 +89,8 @@ public class BlocksFragment extends Fragment{
}).bottom().right().get(); }).bottom().right().get();
}); });
Events.on(WorldLoadEvent.class, this::rebuild);
rebuild(); rebuild();
} }
@@ -165,7 +169,7 @@ public class BlocksFragment extends Fragment{
//add actual recipes //add actual recipes
for(Recipe r : recipes){ for(Recipe r : recipes){
if((r.debugOnly && !debug) || (r.desktopOnly && mobile)) continue; if((r.debugOnly && !debug) || (r.desktopOnly && mobile) || (r.targetMode != null && r.targetMode != state.mode)) continue;
ImageButton image = new ImageButton(new TextureRegion(), "select"); ImageButton image = new ImageButton(new TextureRegion(), "select");

View File

@@ -158,7 +158,7 @@ public class Drill extends Block{
} }
for(Tile other : tile.getLinkedTiles(tempTiles)){ for(Tile other : tile.getLinkedTiles(tempTiles)){
if(isValid(other) && other.floor().dropsItem(entity.dominantItem)){ if(isValid(other) && getDrop(other) == entity.dominantItem){
entity.dominantItems ++; entity.dominantItems ++;
} }
} }

View File

@@ -46,10 +46,8 @@ public class ServerControl extends Module{
mode = ShuffleMode.valueOf(Settings.getString("shufflemode")); mode = ShuffleMode.valueOf(Settings.getString("shufflemode"));
Effects.setScreenShakeProvider((a, b) -> { Effects.setScreenShakeProvider((a, b) -> {});
}); Effects.setEffectProvider((a, b, c, d, e, f) -> {});
Effects.setEffectProvider((a, b, c, d, e, f) -> {
});
Sounds.setHeadless(true); Sounds.setHeadless(true);
String[] commands = {}; String[] commands = {};