Fixed many various bugs
This commit is contained in:
@@ -11,13 +11,20 @@ public class DefaultWaves{
|
|||||||
if(spawns == null && UnitTypes.dagger != null){
|
if(spawns == null && UnitTypes.dagger != null){
|
||||||
spawns = Array.with(
|
spawns = Array.with(
|
||||||
new SpawnGroup(UnitTypes.dagger){{
|
new SpawnGroup(UnitTypes.dagger){{
|
||||||
end = 8;
|
end = 10;
|
||||||
|
unitScaling = 2f;
|
||||||
|
}},
|
||||||
|
|
||||||
|
new SpawnGroup(UnitTypes.crawler){{
|
||||||
|
begin = 5;
|
||||||
|
end = 13;
|
||||||
|
unitAmount = 2;
|
||||||
unitScaling = 1.5f;
|
unitScaling = 1.5f;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
new SpawnGroup(UnitTypes.wraith){{
|
new SpawnGroup(UnitTypes.wraith){{
|
||||||
begin = 12;
|
begin = 12;
|
||||||
end = 14;
|
end = 16;
|
||||||
unitScaling = 1f;
|
unitScaling = 1f;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
@@ -39,7 +46,7 @@ public class DefaultWaves{
|
|||||||
new SpawnGroup(UnitTypes.dagger){{
|
new SpawnGroup(UnitTypes.dagger){{
|
||||||
begin = 8;
|
begin = 8;
|
||||||
unitScaling = 1;
|
unitScaling = 1;
|
||||||
unitAmount = 1;
|
unitAmount = 4;
|
||||||
spacing = 2;
|
spacing = 2;
|
||||||
}},
|
}},
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class Rules{
|
|||||||
/** Whether this is the editor gamemode. */
|
/** Whether this is the editor gamemode. */
|
||||||
public boolean editor = false;
|
public boolean editor = false;
|
||||||
/** Items that the player starts with here. Not applicable to zones.*/
|
/** Items that the player starts with here. Not applicable to zones.*/
|
||||||
public Array<ItemStack> startingItems = Array.with(new ItemStack(Items.copper, 100));
|
public Array<ItemStack> startingItems = Array.with(new ItemStack(Items.copper, 200));
|
||||||
|
|
||||||
/** Copies this ruleset exactly. Not very efficient at all, do not use often. */
|
/** Copies this ruleset exactly. Not very efficient at all, do not use often. */
|
||||||
public Rules copy(){
|
public Rules copy(){
|
||||||
|
|||||||
@@ -11,6 +11,11 @@ public class ItemStack implements Comparable<ItemStack>{
|
|||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//serialization only
|
||||||
|
public ItemStack(){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public boolean equals(ItemStack other){
|
public boolean equals(ItemStack other){
|
||||||
return other != null && other.item == item && other.amount == amount;
|
return other != null && other.item == item && other.amount == amount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package io.anuke.mindustry.world.blocks;
|
package io.anuke.mindustry.world.blocks;
|
||||||
|
|
||||||
|
import io.anuke.mindustry.type.Item;
|
||||||
|
import io.anuke.mindustry.type.Liquid;
|
||||||
import io.anuke.mindustry.world.Block;
|
import io.anuke.mindustry.world.Block;
|
||||||
import io.anuke.mindustry.world.Tile;
|
import io.anuke.mindustry.world.Tile;
|
||||||
|
|
||||||
@@ -28,6 +30,28 @@ public class BlockPart extends Block{
|
|||||||
return parts[dx + maxSize/2][dy + maxSize/2];
|
return parts[dx + maxSize/2][dy + maxSize/2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean acceptItem(Item item, Tile tile, Tile source){
|
||||||
|
return tile.link().block().acceptItem(item, tile.link(), source);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleItem(Item item, Tile tile, Tile source){
|
||||||
|
tile.link().block().handleItem(item, tile.link(), source);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||||
|
Block block = tile.link().block();
|
||||||
|
block.handleLiquid(tile.link(), source, liquid, amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean acceptLiquid(Tile tile, Tile source, Liquid liquid, float amount){
|
||||||
|
Block block = tile.link().block();
|
||||||
|
return block.hasLiquids && block.acceptLiquid(tile.link(), source, liquid, amount);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Tile linked(Tile tile){
|
public Tile linked(Tile tile){
|
||||||
return tile.getNearby(-dx, -dy);
|
return tile.getNearby(-dx, -dy);
|
||||||
|
|||||||
@@ -60,6 +60,11 @@ public class ForceProjector extends Block{
|
|||||||
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.1f)).boost().update(false);
|
consumes.add(new ConsumeLiquidFilter(liquid -> liquid.temperature <= 0.5f && liquid.flammability < 0.1f, 0.1f)).boost().update(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean outputsItems(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
super.load();
|
super.load();
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ public class MendProjector extends Block{
|
|||||||
hasItems = true;
|
hasItems = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean outputsItems(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
super.load();
|
super.load();
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ public class OverdriveProjector extends Block{
|
|||||||
canOverdrive = false;
|
canOverdrive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean outputsItems(){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void load(){
|
public void load(){
|
||||||
super.load();
|
super.load();
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ public class Junction extends Block{
|
|||||||
|
|
||||||
Item item = content.item(BufferItem.item(l));
|
Item item = content.item(BufferItem.item(l));
|
||||||
Tile dest = tile.getNearby(i);
|
Tile dest = tile.getNearby(i);
|
||||||
|
if(dest != null) dest = dest.link();
|
||||||
|
|
||||||
//skip blocks that don't want the item, keep waiting until they do
|
//skip blocks that don't want the item, keep waiting until they do
|
||||||
if(dest == null || !dest.block().acceptItem(item, dest, tile)){
|
if(dest == null || !dest.block().acceptItem(item, dest, tile)){
|
||||||
|
|||||||
Reference in New Issue
Block a user