Skip to content

Commit

Permalink
Insect AI tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
Slotterleet committed Apr 20, 2024
1 parent c378351 commit aea1824
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/fos/ai/BugAI.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import arc.math.Mathf;
import fos.core.FOSVars;
import fos.gen.Bugc;
import fos.type.blocks.units.BugSpawn;
import mindustry.Vars;
import mindustry.content.Blocks;
import mindustry.entities.Units;
import mindustry.entities.units.AIController;
import mindustry.gen.Teamc;
import mindustry.gen.*;
import mindustry.world.Tile;
import mindustry.world.meta.BlockFlag;

Expand Down Expand Up @@ -45,7 +46,7 @@ public void updateMovement() {
Tile tile = unit.tileOn();
Tile targetTile = tile;

if (bug.invading() && evo() >= 0.05f) {
if ((bug.invading() && evo() >= 0.05f) || !hasNests()) {
target = target(unit.x, unit.y, 25f * tilesize, false, true);

if (target != null) {
Expand Down Expand Up @@ -112,4 +113,8 @@ public boolean keepState() {
private float evo() {
return FOSVars.evoController.getTotalEvo();
}

private boolean hasNests() {
return Groups.build.contains(b -> b instanceof BugSpawn.BugSpawnBuild && b.enabled());
}
}

0 comments on commit aea1824

Please sign in to comment.