Fine, I'll do it myself (#5717)
This commit is contained in:
@@ -41,6 +41,12 @@ public class FlyingAI extends AIController{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Teamc findMainTarget(float x, float y, float range, boolean air, boolean ground){
|
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){
|
for(var flag : unit.team.isAI() ? unit.type.targetFlags : unit.type.playerTargetFlags){
|
||||||
if(flag == null){
|
if(flag == null){
|
||||||
Teamc result = target(x, y, range, air, ground);
|
Teamc result = target(x, y, range, air, ground);
|
||||||
@@ -50,7 +56,8 @@ public class FlyingAI extends AIController{
|
|||||||
if(result != null) return result;
|
if(result != null) return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return targetFlag(x, y, BlockFlag.core, true);
|
|
||||||
|
return core;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void attack(float circleLength){
|
protected void attack(float circleLength){
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ public class MoveLightningAbility extends Ability{
|
|||||||
public Color color = Color.valueOf("a9d8ff");
|
public Color color = Color.valueOf("a9d8ff");
|
||||||
/** Shifts where the lightning spawns along the Y axis */
|
/** Shifts where the lightning spawns along the Y axis */
|
||||||
public float offset = 0f;
|
public float offset = 0f;
|
||||||
|
/** Offset along the X axis. */
|
||||||
|
public float width = 0f;
|
||||||
/** Jittering heat sprite like the shield on v5 Javelin */
|
/** Jittering heat sprite like the shield on v5 Javelin */
|
||||||
public String heatRegion = "error";
|
public String heatRegion = "error";
|
||||||
/** Bullet type that is fired. Can be null */
|
/** Bullet type that is fired. Can be null */
|
||||||
@@ -34,6 +36,8 @@ public class MoveLightningAbility extends Ability{
|
|||||||
public Effect shootEffect = Fx.sparkShoot;
|
public Effect shootEffect = Fx.sparkShoot;
|
||||||
public Sound shootSound = Sounds.spark;
|
public Sound shootSound = Sounds.spark;
|
||||||
|
|
||||||
|
protected float side = 1f;
|
||||||
|
|
||||||
MoveLightningAbility(){}
|
MoveLightningAbility(){}
|
||||||
|
|
||||||
public MoveLightningAbility(float damage, int length, float chance, float offset, float minSpeed, float maxSpeed, Color color, String heatRegion){
|
public MoveLightningAbility(float damage, int length, float chance, float offset, float minSpeed, float maxSpeed, Color color, String heatRegion){
|
||||||
@@ -61,7 +65,7 @@ public class MoveLightningAbility extends Ability{
|
|||||||
public void update(Unit unit){
|
public void update(Unit unit){
|
||||||
float scl = Mathf.clamp((unit.vel().len() - minSpeed) / (maxSpeed - minSpeed));
|
float scl = Mathf.clamp((unit.vel().len() - minSpeed) / (maxSpeed - minSpeed));
|
||||||
if(Mathf.chance(Time.delta * chance * scl)){
|
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);
|
shootEffect.at(x, y, unit.rotation, color);
|
||||||
shootSound.at(unit);
|
shootSound.at(unit);
|
||||||
@@ -73,6 +77,8 @@ public class MoveLightningAbility extends Ability{
|
|||||||
if(bullet != null){
|
if(bullet != null){
|
||||||
bullet.create(unit, unit.team, x, y, unit.rotation + bulletAngle + Mathf.range(bulletSpread));
|
bullet.create(unit, unit.team, x, y, unit.rotation + bulletAngle + Mathf.range(bulletSpread));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
side *= -1f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -8,4 +8,6 @@ kapt.include.compile.classpath=false
|
|||||||
kotlin.stdlib.default.dependency=false
|
kotlin.stdlib.default.dependency=false
|
||||||
#needed for android compilation
|
#needed for android compilation
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
archash=40c21b302ccc1e74f4c2a37f937c88acaec99254
|
#used for slow jitpack builds; TODO see if this actually works
|
||||||
|
http.socketTimeout=80000
|
||||||
|
http.connectionTimeout=80000archash=40c21b302ccc1e74f4c2a37f937c88acaec99254
|
||||||
|
|||||||
Reference in New Issue
Block a user