mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-25 22:17:59 +07:00
Fixed missile distraction / Easier three
This commit is contained in:
parent
48538d28b8
commit
46a58c7965
Binary file not shown.
@ -19,7 +19,7 @@ import static mindustry.Vars.*;
|
||||
public class Units{
|
||||
private static final Rect hitrect = new Rect();
|
||||
private static Unit result;
|
||||
private static float cdist;
|
||||
private static float cdist, cpriority;
|
||||
private static boolean boolResult;
|
||||
private static int intResult;
|
||||
private static Building buildResult;
|
||||
@ -271,14 +271,16 @@ public class Units{
|
||||
|
||||
result = null;
|
||||
cdist = 0f;
|
||||
cpriority = -99999f;
|
||||
|
||||
nearbyEnemies(team, x - range, y - range, range*2f, range*2f, e -> {
|
||||
if(e.dead() || !predicate.get(e) || e.team == Team.derelict || !e.within(x, y, range + e.hitSize/2f)) return;
|
||||
|
||||
float cost = sort.cost(e, x, y);
|
||||
if(result == null || cost < cdist){
|
||||
if((result == null || cost < cdist) && e.type.targetPriority >= cpriority){
|
||||
result = e;
|
||||
cdist = cost;
|
||||
cpriority = e.type.targetPriority;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -79,6 +79,8 @@ public class UnitType extends UnlockableContent{
|
||||
public float payloadCapacity = 8;
|
||||
public float aimDst = -1f;
|
||||
public float buildBeamOffset = 3.8f;
|
||||
/** WIP: Units of low priority will always be ignored in favor of those with higher priority, regardless of distance. */
|
||||
public float targetPriority = 0f;
|
||||
public boolean drawBuildBeam = true;
|
||||
public boolean rotateToBuilding = true;
|
||||
public int commandLimit = 8;
|
||||
|
@ -30,6 +30,7 @@ public class MissileUnitType extends UnitType{
|
||||
lifetime = 60f * 1.7f;
|
||||
rotateSpeed = 2.5f;
|
||||
range = 30f;
|
||||
targetPriority = -1f;
|
||||
//TODO weapons, etc
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user