More Target varieties for energy field ability (#5828)

* more targets for energy field ability

* group booleans
This commit is contained in:
JrTRinny
2021-09-13 01:55:26 +07:00
committed by GitHub
parent f64d078f29
commit d33a4f9f87

View File

@@ -26,7 +26,7 @@ public class EnergyFieldAbility extends Ability{
public Sound shootSound = Sounds.spark; public Sound shootSound = Sounds.spark;
public float statusDuration = 60f * 6f; public float statusDuration = 60f * 6f;
public float x, y; public float x, y;
public boolean hitBuildings = true; public boolean targetGround = true, targetAir = true, hitBuildings = true, hitUnits = true;
public int maxTargets = 25; public int maxTargets = 25;
public float healPercent = 2.5f; public float healPercent = 2.5f;
@@ -99,13 +99,15 @@ public class EnergyFieldAbility extends Ability{
all.clear(); all.clear();
Units.nearby(null, rx, ry, range, other -> { if(hitUnits){
if(other != unit){ Units.nearby(null, rx, ry, range, other -> {
all.add(other); if(other != unit && (other.isFlying() ? targetAir : targetGround)){
} all.add(other);
}); }
});
}
if(hitBuildings){ if(hitBuildings && targetGround){
Units.nearbyBuildings(rx, ry, range, b -> { Units.nearbyBuildings(rx, ry, range, b -> {
if(b.team != Team.derelict || state.rules.coreCapture){ if(b.team != Team.derelict || state.rules.coreCapture){
all.add(b); all.add(b);