Removed pointless playerTargetFlags field

This commit is contained in:
Anuken
2022-02-20 10:21:25 -05:00
parent 5fa28e6090
commit acb84a6114
4 changed files with 1 additions and 9 deletions

View File

@@ -44,7 +44,7 @@ public class FlyingAI extends AIController{
return core;
}
for(var flag : unit.team.isAI() ? unit.type.targetFlags : unit.type.playerTargetFlags){
for(var flag : unit.type.targetFlags){
if(flag == null){
Teamc result = target(x, y, range, air, ground);
if(result != null) return result;

View File

@@ -965,8 +965,6 @@ public class UnitTypes{
health = 70;
engineOffset = 5.75f;
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};
hitSize = 7;
itemCapacity = 15;
@@ -1000,8 +998,6 @@ public class UnitTypes{
range = 140f;
faceTarget = false;
armor = 3f;
//do not rush core, attack closest
playerTargetFlags = new BlockFlag[]{null};
targetFlags = new BlockFlag[]{BlockFlag.factory, null};
circleTarget = true;
ammoType = new ItemAmmoType(Items.graphite);

View File

@@ -107,8 +107,6 @@ public class UnitType extends UnlockableContent{
public Seq<Ability> abilities = new Seq<>();
/** Flags to target based on priority. Null indicates that the closest target should be found. The closest enemy core is used as a fallback. */
public BlockFlag[] targetFlags = {null};
/** targetFlags, as an override for "non-AI" teams. By default, units of this type will rush the core. */
public BlockFlag[] playerTargetFlags = {BlockFlag.core, null};
/** Target items to mine. Used in MinerAI */
public Seq<Item> mineItems = Seq.with(Items.copper, Items.lead, Items.titanium, Items.thorium);
@@ -116,7 +114,6 @@ public class UnitType extends UnlockableContent{
/** The default AI controller to assign on creation. */
public Prov<? extends UnitController> aiController = () -> !flying ? new GroundAI() : new FlyingAI();
/** Function that chooses AI controller based on unit entity. */
//TODO -name is too long
public Func<Unit, ? extends UnitController> defaultController = u -> !playerControllable || (u.team.isAI() && !u.team.rules().rtsAi) ? aiController.get() : new CommandAI();
public Color outlineColor = Pal.darkerMetal;

View File

@@ -110,7 +110,6 @@ public class PayloadLoader extends PayloadBlock{
return liquids.current() == liquid || liquids.currentAmount() < 0.2f;
}
@Override
public void draw(){
Draw.rect(region, x, y);