Additional tests, inventory fixes

This commit is contained in:
Anuken
2018-11-23 12:40:36 -05:00
parent 30b5dd63e4
commit e5d6740555
10 changed files with 55 additions and 15 deletions

View File

@@ -106,7 +106,7 @@ public class TurretBlocks extends BlockList implements ContentList{
arc = new PowerTurret("arc"){{
shootType = AmmoTypes.arc;
reload = 80f;
reload = 75f;
shootShake = 1f;
shootCone = 40f;
rotatespeed = 8f;

View File

@@ -304,7 +304,7 @@ public class TurretBullets extends BulletList implements ContentList{
}
};
arc = new BulletType(0.001f, 30){
arc = new BulletType(0.001f, 26){
{
lifetime = 1;
despawneffect = Fx.none;

View File

@@ -193,7 +193,7 @@ public abstract class InputHandler extends InputAdapter{
}
//call tapped event
if(tile.getTeam() == player.getTeam()){
if(!consumed && tile.getTeam() == player.getTeam()){
Call.onTileTapped(player, tile);
}

View File

@@ -32,4 +32,13 @@ public class Map{
public String getDisplayName(){
return meta.tags.get("name", name);
}
@Override
public String toString(){
return "Map{" +
"name='" + name + '\'' +
", custom=" + custom +
", meta=" + meta +
'}';
}
}

View File

@@ -37,4 +37,13 @@ public class MapMeta{
public boolean hasOreGen(){
return !tags.get("oregen", "0").equals("0");
}
@Override
public String toString(){
return "MapMeta{" +
"tags=" + tags +
", width=" + width +
", height=" + height +
'}';
}
}

View File

@@ -1,8 +1,6 @@
package io.anuke.mindustry.type;
/**
* Used to store ammo amounts in units and turrets.
*/
/**Used to store ammo amounts in turrets.*/
public class AmmoEntry{
public AmmoType type;
public int amount;

View File

@@ -43,7 +43,7 @@ public abstract class BaseBlock extends MappableContent{
/**Returns the amount of items this block can accept.*/
public int acceptStack(Item item, int amount, Tile tile, Unit source){
if(acceptItem(item, tile, tile) && hasItems && (source == null || source.getTeam() == tile.getTeam())){
return Math.min(getMaximumAccepted(tile, item), amount);
return Math.min(getMaximumAccepted(tile, item) - tile.entity.items.get(item), amount);
}else{
return 0;
}

View File

@@ -152,11 +152,6 @@ public class Smelter extends Block{
Effects.effect(craftEffect, flameColor, tile.drawx(), tile.drawy());
}
@Override
public int getMaximumAccepted(Tile tile, Item item){
return itemCapacity;
}
@Override
public boolean acceptItem(Item item, Tile tile, Tile source){
boolean isInput = false;