Multi-target zenith AI

This commit is contained in:
Anuken
2021-08-06 11:07:30 -04:00
parent 588523b311
commit 316adf63ee
3 changed files with 9 additions and 3 deletions
@@ -935,6 +935,8 @@ public class UnitTypes implements ContentList{
engineOffset = 5.5f; engineOffset = 5.5f;
range = 140f; range = 140f;
targetAir = false; targetAir = false;
//as default AI, flares are not very useful in core rushes, they attack nothing in the way
playerTargetFlags = new BlockFlag[]{null};
targetFlags = new BlockFlag[]{BlockFlag.generator, null}; targetFlags = new BlockFlag[]{BlockFlag.generator, null};
commandLimit = 4; commandLimit = 4;
circleTarget = true; circleTarget = true;
@@ -969,6 +971,8 @@ public class UnitTypes implements ContentList{
range = 140f; range = 140f;
faceTarget = false; faceTarget = false;
armor = 3f; armor = 3f;
//do not rush core, attack closest
playerTargetFlags = new BlockFlag[]{null};
targetFlags = new BlockFlag[]{BlockFlag.factory, null}; targetFlags = new BlockFlag[]{BlockFlag.factory, null};
commandLimit = 5; commandLimit = 5;
circleTarget = true; circleTarget = true;
@@ -1006,6 +1010,7 @@ public class UnitTypes implements ContentList{
range = 140f; range = 140f;
hitSize = 20f; hitSize = 20f;
lowAltitude = true; lowAltitude = true;
forceMultiTarget = true;
armor = 5f; armor = 5f;
targetFlags = new BlockFlag[]{BlockFlag.launchPad, BlockFlag.storage, BlockFlag.battery, null}; targetFlags = new BlockFlag[]{BlockFlag.launchPad, BlockFlag.storage, BlockFlag.battery, null};
@@ -41,7 +41,7 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{
@Import int id; @Import int id;
@Import float x, y; @Import float x, y;
transient float accepting, updateTime, lastRipple; transient float accepting, updateTime, lastRipple = Time.time + Mathf.random(40f);
float amount; float amount;
Tile tile; Tile tile;
Liquid liquid; Liquid liquid;
@@ -73,7 +73,7 @@ abstract class PuddleComp implements Posc, Puddlec, Drawc{
amount = Mathf.clamp(amount, 0, maxLiquid); amount = Mathf.clamp(amount, 0, maxLiquid);
if(amount <= 0f){ if(amount <= 0f || Puddles.get(tile) != self()){
remove(); remove();
} }
+2 -1
View File
@@ -121,6 +121,7 @@ public class UnitType extends UnlockableContent{
public boolean canHeal = false; public boolean canHeal = false;
/** If true, all weapons will attack the same target. */ /** If true, all weapons will attack the same target. */
public boolean singleTarget = false; public boolean singleTarget = false;
public boolean forceMultiTarget = false;
public ObjectSet<StatusEffect> immunities = new ObjectSet<>(); public ObjectSet<StatusEffect> immunities = new ObjectSet<>();
public Sound deathSound = Sounds.bang; public Sound deathSound = Sounds.bang;
@@ -319,7 +320,7 @@ public class UnitType extends UnlockableContent{
} }
clipSize = Math.max(clipSize, lightRadius * 1.1f); clipSize = Math.max(clipSize, lightRadius * 1.1f);
singleTarget = weapons.size <= 1; singleTarget = weapons.size <= 1 && !forceMultiTarget;
if(itemCapacity < 0){ if(itemCapacity < 0){
itemCapacity = Math.max(Mathf.round((int)(hitSize * 4.3), 10), 10); itemCapacity = Math.max(Mathf.round((int)(hitSize * 4.3), 10), 10);