'Added' attack mode / Core inventory sharing
This commit is contained in:
@@ -13,7 +13,6 @@ public enum GameMode{
|
||||
}},
|
||||
attack{{
|
||||
disableWaves = true;
|
||||
hidden = true;
|
||||
enemyCheat = true;
|
||||
}},
|
||||
victory{{
|
||||
|
||||
@@ -221,11 +221,6 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
}
|
||||
}).update(l -> l.setChecked(mode == breaking));
|
||||
|
||||
//rotate button
|
||||
table.addImageButton("icon-arrow", "clear-partial", 16 * 2f, () -> rotation = Mathf.mod(rotation + 1, 4))
|
||||
.update(i -> i.getImage().setRotationOrigin(rotation * 90, Align.center))
|
||||
.visible(() -> recipe != null && recipe.result.rotate);
|
||||
|
||||
//cancel button
|
||||
table.addImageButton("icon-cancel", "clear-partial", 16 * 2f, () -> {
|
||||
player.clearBuilding();
|
||||
@@ -233,6 +228,11 @@ public class MobileInput extends InputHandler implements GestureListener{
|
||||
recipe = null;
|
||||
}).visible(() -> player.isBuilding() || recipe != null || mode == breaking);
|
||||
|
||||
//rotate button
|
||||
table.addImageButton("icon-arrow", "clear-partial", 16 * 2f, () -> rotation = Mathf.mod(rotation + 1, 4))
|
||||
.update(i -> i.getImage().setRotationOrigin(rotation * 90, Align.center))
|
||||
.visible(() -> recipe != null && recipe.result.rotate);
|
||||
|
||||
//confirm button
|
||||
table.addImageButton("icon-check", "clear-partial", 16 * 2f, () -> {
|
||||
for(PlaceRequest request : selection){
|
||||
|
||||
@@ -82,6 +82,11 @@ public class CoreBlock extends StorageBlock{
|
||||
if(entity != null) entity.solid = solid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaximumAccepted(Tile tile, Item item){
|
||||
return itemCapacity * state.teams.get(tile.getTeam()).cores.size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onProximityUpdate(Tile tile) {
|
||||
for(Tile other : state.teams.get(tile.getTeam()).cores){
|
||||
@@ -100,6 +105,11 @@ public class CoreBlock extends StorageBlock{
|
||||
@Override
|
||||
public void removed(Tile tile){
|
||||
state.teams.get(tile.getTeam()).cores.remove(tile);
|
||||
|
||||
int max = itemCapacity * state.teams.get(tile.getTeam()).cores.size;
|
||||
for(Item item : content.items()){
|
||||
tile.entity.items.set(item, Math.min(tile.entity.items.get(item), max));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,7 +15,7 @@ public abstract class StorageBlock extends Block{
|
||||
|
||||
@Override
|
||||
public boolean acceptItem(Item item, Tile tile, Tile source){
|
||||
return tile.entity.items.get(item) < itemCapacity;
|
||||
return tile.entity.items.get(item) < getMaximumAccepted(tile, item);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user