From 353433a3838c68ef959e310468c9128a6ecd4493 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 9 Aug 2021 14:19:34 -0400 Subject: [PATCH] Fine, I'll do it myself (#5717) --- core/src/mindustry/ai/types/FlyingAI.java | 9 ++++++++- .../entities/abilities/MoveLightningAbility.java | 8 +++++++- gradle.properties | 4 +++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/ai/types/FlyingAI.java b/core/src/mindustry/ai/types/FlyingAI.java index 0f2cb8c5e8..db5ae84dab 100644 --- a/core/src/mindustry/ai/types/FlyingAI.java +++ b/core/src/mindustry/ai/types/FlyingAI.java @@ -41,6 +41,12 @@ public class FlyingAI extends AIController{ @Override protected Teamc findMainTarget(float x, float y, float range, boolean air, boolean ground){ + var core = targetFlag(x, y, BlockFlag.core, true); + + if(core != null && Mathf.within(x, y, core.getX(), core.getY(), range)){ + return core; + } + for(var flag : unit.team.isAI() ? unit.type.targetFlags : unit.type.playerTargetFlags){ if(flag == null){ Teamc result = target(x, y, range, air, ground); @@ -50,7 +56,8 @@ public class FlyingAI extends AIController{ if(result != null) return result; } } - return targetFlag(x, y, BlockFlag.core, true); + + return core; } protected void attack(float circleLength){ diff --git a/core/src/mindustry/entities/abilities/MoveLightningAbility.java b/core/src/mindustry/entities/abilities/MoveLightningAbility.java index 4cc62b7172..0a56d3bd15 100644 --- a/core/src/mindustry/entities/abilities/MoveLightningAbility.java +++ b/core/src/mindustry/entities/abilities/MoveLightningAbility.java @@ -24,6 +24,8 @@ public class MoveLightningAbility extends Ability{ public Color color = Color.valueOf("a9d8ff"); /** Shifts where the lightning spawns along the Y axis */ public float offset = 0f; + /** Offset along the X axis. */ + public float width = 0f; /** Jittering heat sprite like the shield on v5 Javelin */ public String heatRegion = "error"; /** Bullet type that is fired. Can be null */ @@ -33,6 +35,8 @@ public class MoveLightningAbility extends Ability{ public Effect shootEffect = Fx.sparkShoot; public Sound shootSound = Sounds.spark; + + protected float side = 1f; MoveLightningAbility(){} @@ -61,7 +65,7 @@ public class MoveLightningAbility extends Ability{ public void update(Unit unit){ float scl = Mathf.clamp((unit.vel().len() - minSpeed) / (maxSpeed - minSpeed)); if(Mathf.chance(Time.delta * chance * scl)){ - float x = unit.x + Angles.trnsx(unit.rotation, offset, 0), y = unit.y + Angles.trnsy(unit.rotation, offset, 0); + float x = unit.x + Angles.trnsx(unit.rotation, offset, width * side), y = unit.y + Angles.trnsy(unit.rotation, offset, width * side); shootEffect.at(x, y, unit.rotation, color); shootSound.at(unit); @@ -73,6 +77,8 @@ public class MoveLightningAbility extends Ability{ if(bullet != null){ bullet.create(unit, unit.team, x, y, unit.rotation + bulletAngle + Mathf.range(bulletSpread)); } + + side *= -1f; } } diff --git a/gradle.properties b/gradle.properties index 3c125e34d9..d0b05818da 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,4 +8,6 @@ kapt.include.compile.classpath=false kotlin.stdlib.default.dependency=false #needed for android compilation android.useAndroidX=true -archash=40c21b302ccc1e74f4c2a37f937c88acaec99254 +#used for slow jitpack builds; TODO see if this actually works +http.socketTimeout=80000 +http.connectionTimeout=80000archash=40c21b302ccc1e74f4c2a37f937c88acaec99254