This commit is contained in:
Anuken
2021-02-15 09:30:57 -05:00
parent e16622afcc
commit fa52255d04
3 changed files with 14 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
package mindustry.ai.types; package mindustry.ai.types;
import arc.math.geom.*;
import mindustry.*; import mindustry.*;
import mindustry.ai.*; import mindustry.ai.*;
import mindustry.entities.*; import mindustry.entities.*;
@@ -47,14 +48,17 @@ public class SuicideAI extends GroundAI{
//raycast for target //raycast for target
boolean blocked = Vars.world.raycast(unit.tileX(), unit.tileY(), target.tileX(), target.tileY(), (x, y) -> { boolean blocked = Vars.world.raycast(unit.tileX(), unit.tileY(), target.tileX(), target.tileY(), (x, y) -> {
Tile tile = Vars.world.tile(x, y); for(Point2 p : Geometry.d4c){
if(tile != null && tile.build == target) return false; Tile tile = Vars.world.tile(x + p.x, y + p.y);
if(tile != null && tile.build != null && tile.build.team != unit.team()){ if(tile != null && tile.build == target) return false;
blockedByBlock = true; if(tile != null && tile.build != null && tile.build.team != unit.team()){
return true; blockedByBlock = true;
}else{ return true;
return tile == null || tile.solid(); }else{
return tile == null || tile.solid();
}
} }
return false;
}); });
//shoot when there's an enemy block in the way //shoot when there's an enemy block in the way

View File

@@ -28,7 +28,8 @@ public class ConsumeLiquidFilter extends ConsumeLiquidBase{
public void build(Building build, Table table){ public void build(Building build, Table table){
Seq<Liquid> list = content.liquids().select(l -> !l.isHidden() && filter.get(l)); Seq<Liquid> list = content.liquids().select(l -> !l.isHidden() && filter.get(l));
MultiReqImage image = new MultiReqImage(); MultiReqImage image = new MultiReqImage();
list.each(liquid -> image.add(new ReqImage(liquid.icon(Cicon.medium), () -> build.liquids != null && build.liquids.get(liquid) >= Math.max(use(build), amount * build.delta())))); list.each(liquid -> image.add(new ReqImage(liquid.icon(Cicon.medium), () ->
build.liquids != null && build.liquids.current() == liquid && build.liquids.get(liquid) >= Math.max(use(build), amount * build.delta()))));
table.add(image).size(8 * 4); table.add(image).size(8 * 4);
} }

View File

@@ -1,3 +1,3 @@
org.gradle.daemon=true org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=f49f7c824adc556cba6b94579c6b0d4e24574b3e archash=40c4e9db40cb8fbe7daa091f20ca0bf5acfd8484