Fixed #2282
This commit is contained in:
@@ -575,23 +575,6 @@ public class UnitTypes implements ContentList{
|
|||||||
|
|
||||||
mineTier = 1;
|
mineTier = 1;
|
||||||
mineSpeed = 2.5f;
|
mineSpeed = 2.5f;
|
||||||
|
|
||||||
//no weapon, mining only
|
|
||||||
/*
|
|
||||||
weapons.add(new Weapon(){{
|
|
||||||
y = 1.5f;
|
|
||||||
x = 0f;
|
|
||||||
|
|
||||||
reload = 40f;
|
|
||||||
ejectEffect = Fx.none;
|
|
||||||
recoil = 2f;
|
|
||||||
shootSound = Sounds.pew;
|
|
||||||
mirror = false;
|
|
||||||
|
|
||||||
bullet = new HealBulletType(5.2f, 10){{
|
|
||||||
healPercent = 4f;
|
|
||||||
}};
|
|
||||||
}});*/
|
|
||||||
}};
|
}};
|
||||||
|
|
||||||
poly = new UnitType("poly"){{
|
poly = new UnitType("poly"){{
|
||||||
|
|||||||
@@ -76,6 +76,9 @@ public class ResearchDialog extends BaseDialog{
|
|||||||
if(amount < 0){
|
if(amount < 0){
|
||||||
//remove items from each sector's storage, one by one
|
//remove items from each sector's storage, one by one
|
||||||
|
|
||||||
|
//negate amount since it's being *removed*
|
||||||
|
amount = -amount;
|
||||||
|
|
||||||
//% that gets removed from each sector
|
//% that gets removed from each sector
|
||||||
double percentage = (double)amount / get(item);
|
double percentage = (double)amount / get(item);
|
||||||
int[] counter = {amount};
|
int[] counter = {amount};
|
||||||
@@ -90,6 +93,9 @@ public class ResearchDialog extends BaseDialog{
|
|||||||
seq.remove(item, toRemove);
|
seq.remove(item, toRemove);
|
||||||
counter[0] -= toRemove;
|
counter[0] -= toRemove;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//negate again to display correct number
|
||||||
|
amount = -amount;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.add(item, amount);
|
super.add(item, amount);
|
||||||
@@ -402,6 +408,9 @@ public class ResearchDialog extends BaseDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
node.save();
|
node.save();
|
||||||
|
|
||||||
|
//??????
|
||||||
|
Core.scene.act();
|
||||||
rebuild(shine);
|
rebuild(shine);
|
||||||
itemDisplay.rebuild(items, usedShine);
|
itemDisplay.rebuild(items, usedShine);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,17 +146,16 @@ public class ItemBridge extends Block{
|
|||||||
public void drawSelect(){
|
public void drawSelect(){
|
||||||
if(linkValid(tile, world.tile(link))){
|
if(linkValid(tile, world.tile(link))){
|
||||||
drawInput(world.tile(link));
|
drawInput(world.tile(link));
|
||||||
}else{
|
|
||||||
incoming.each(pos -> drawInput(world.tile(pos)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
incoming.each(pos -> drawInput(world.tile(pos)));
|
||||||
|
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void drawInput(Tile other){
|
private void drawInput(Tile other){
|
||||||
if(!linkValid(tile, other, false)) return;
|
if(!linkValid(tile, other, false)) return;
|
||||||
boolean linked = other.pos() == link;
|
boolean linked = other.pos() == link;
|
||||||
if(!linked && !(other.<ItemBridgeEntity>bc().link == tile.pos())) return;
|
|
||||||
|
|
||||||
Tmp.v2.trns(tile.angleTo(other), 2f);
|
Tmp.v2.trns(tile.angleTo(other), 2f);
|
||||||
float tx = tile.drawx(), ty = tile.drawy();
|
float tx = tile.drawx(), ty = tile.drawy();
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ public class CoreBlock extends StorageBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canPlaceOn(Tile tile, Team team){
|
public boolean canPlaceOn(Tile tile, Team team){
|
||||||
|
if(tile == null) return false;
|
||||||
CoreEntity core = team.core();
|
CoreEntity core = team.core();
|
||||||
//must have all requirements
|
//must have all requirements
|
||||||
if(core == null || (!state.rules.infiniteResources && !core.items.has(requirements))) return false;
|
if(core == null || (!state.rules.infiniteResources && !core.items.has(requirements))) return false;
|
||||||
@@ -138,6 +139,8 @@ public class CoreBlock extends StorageBlock{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawPlace(int x, int y, int rotation, boolean valid){
|
public void drawPlace(int x, int y, int rotation, boolean valid){
|
||||||
|
if(world.tile(x, y) == null) return;
|
||||||
|
|
||||||
if(!canPlaceOn(world.tile(x, y), player.team())){
|
if(!canPlaceOn(world.tile(x, y), player.team())){
|
||||||
|
|
||||||
drawPlaceText(Core.bundle.get((player.team().core() != null && player.team().core().items.has(requirements) && !state.rules.infiniteResources) ?
|
drawPlaceText(Core.bundle.get((player.team().core() != null && player.team().core().items.has(requirements) && !state.rules.infiniteResources) ?
|
||||||
|
|||||||
Reference in New Issue
Block a user