Unit factory limit / Removed overdrive block effects / BlockFlag cleanup

This commit is contained in:
Anuken
2019-02-02 14:33:13 -05:00
parent c0d6618808
commit 636bfdb530
13 changed files with 38 additions and 368 deletions
@@ -129,11 +129,7 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
@Override
public boolean collidesGrid(int x, int y){
Tile tile = world.tile(x, y);
if(!isFlying()) return true;
if(!mech.flying && tile != null && !tile.block().synthetic() && tile.block().solid){
return true;
}
return false;
return !isFlying() || (!mech.flying && tile != null && !tile.block().synthetic() && tile.block().solid);
}
@Override
@@ -120,8 +120,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
}
public boolean targetHasFlag(BlockFlag flag){
return target instanceof TileEntity && ((TileEntity) target).tile.block().flags != null &&
((TileEntity) target).tile.block().flags.contains(flag);
return target instanceof TileEntity && ((TileEntity) target).tile.block().flags.contains(flag);
}
public void updateRespawning(){
@@ -324,6 +323,11 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
@Override
public void removed(){
Tile tile = world.tile(spawner);
if(tile != null){
tile.block().unitRemoved(tile, this);
}
spawner = noSpawner;
}