This commit is contained in:
Anuken
2022-03-06 16:22:37 -05:00
parent d3a919b5f4
commit 46489f9893
3 changed files with 11 additions and 6 deletions
+6 -3
View File
@@ -39,7 +39,8 @@ public class Pathfinder implements Runnable{
public static final Seq<PathCost> costTypes = Seq.with( public static final Seq<PathCost> costTypes = Seq.with(
//ground //ground
(team, tile) -> (PathTile.allDeep(tile) || (PathTile.team(tile) == team || PathTile.team(tile) == 0) && PathTile.solid(tile)) ? impassable : 1 + (team, tile) ->
(PathTile.allDeep(tile) || (PathTile.team(tile) == team || PathTile.team(tile) == 0) && PathTile.solid(tile)) ? impassable : 1 +
PathTile.health(tile) * 5 + PathTile.health(tile) * 5 +
(PathTile.nearSolid(tile) ? 2 : 0) + (PathTile.nearSolid(tile) ? 2 : 0) +
(PathTile.nearLiquid(tile) ? 6 : 0) + (PathTile.nearLiquid(tile) ? 6 : 0) +
@@ -47,12 +48,14 @@ public class Pathfinder implements Runnable{
(PathTile.damages(tile) ? 30 : 0), (PathTile.damages(tile) ? 30 : 0),
//legs //legs
(team, tile) -> PathTile.legSolid(tile) ? impassable : 1 + (team, tile) ->
PathTile.legSolid(tile) ? impassable : 1 +
(PathTile.deep(tile) ? 6000 : 0) + //leg units can now drown (PathTile.deep(tile) ? 6000 : 0) + //leg units can now drown
(PathTile.solid(tile) ? 5 : 0), (PathTile.solid(tile) ? 5 : 0),
//water //water
(team, tile) -> (PathTile.solid(tile) || !PathTile.liquid(tile) ? 6000 : 1) + (team, tile) ->
(PathTile.solid(tile) || !PathTile.liquid(tile) ? 6000 : 1) +
(PathTile.nearGround(tile) || PathTile.nearSolid(tile) ? 14 : 0) + (PathTile.nearGround(tile) || PathTile.nearSolid(tile) ? 14 : 0) +
(PathTile.deep(tile) ? 0 : 1) + (PathTile.deep(tile) ? 0 : 1) +
(PathTile.damages(tile) ? 35 : 0) (PathTile.damages(tile) ? 35 : 0)
@@ -27,7 +27,6 @@ public class LoadDialog extends BaseDialog{
Gamemode filteredMode; Gamemode filteredMode;
TextField searchField; TextField searchField;
ScrollPane pane; ScrollPane pane;
BaseDialog dialog;
public LoadDialog(){ public LoadDialog(){
this("@loadgame"); this("@loadgame");
@@ -37,7 +36,10 @@ public class LoadDialog extends BaseDialog{
super(title); super(title);
setup(); setup();
shown(this::setup); shown(() -> {
searchString = "";
setup();
});
onResize(this::setup); onResize(this::setup);
addCloseButton(); addCloseButton();
@@ -33,7 +33,7 @@ public class ReloadTurret extends BaseTurret{
} }
protected void updateCooling(){ protected void updateCooling(){
if(reloadCounter < reload && coolant != null && coolant.efficiency(this) > 0){ if(reloadCounter < reload && coolant != null && coolant.efficiency(this) > 0 && efficiency > 0){
float capacity = coolant instanceof ConsumeLiquidFilter filter ? filter.getConsumed(this).heatCapacity : 1f; float capacity = coolant instanceof ConsumeLiquidFilter filter ? filter.getConsumed(this).heatCapacity : 1f;
coolant.update(this); coolant.update(this);
reloadCounter += coolant.amount * edelta() * capacity * coolantMultiplier; reloadCounter += coolant.amount * edelta() * capacity * coolantMultiplier;