MechPad deselect / Flyer patrol tweak
This commit is contained in:
@@ -84,7 +84,7 @@ public abstract class FlyingUnit extends BaseUnit{
|
|||||||
});
|
});
|
||||||
|
|
||||||
if(target != null){
|
if(target != null){
|
||||||
circle(60f + Mathf.absin(Time.time() + id * 23525, 70f, 1200f));
|
circle(60f + Mathf.absin(Time.time() + Mathf.randomSeed(id) * 1200f, 70f, 1200f));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -76,8 +76,9 @@ public abstract class GroundUnit extends BaseUnit{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void move(float x, float y){
|
public void move(float x, float y){
|
||||||
if(Mathf.dst(x, y) > 0.01f){
|
float dst = Mathf.dst(x, y);
|
||||||
baseRotation = Mathf.slerpDelta(baseRotation, Mathf.angle(x, y), type.baseRotateSpeed);
|
if(dst > 0.01f){
|
||||||
|
baseRotation = Mathf.slerp(baseRotation, Mathf.angle(x, y), type.baseRotateSpeed * (dst / type.speed));
|
||||||
}
|
}
|
||||||
super.move(x, y);
|
super.move(x, y);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ import io.anuke.arc.graphics.g2d.TextureRegion;
|
|||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.arc.math.geom.Geometry;
|
import io.anuke.arc.math.geom.Geometry;
|
||||||
import io.anuke.arc.math.geom.Vector2;
|
import io.anuke.arc.math.geom.Vector2;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.arc.util.Tmp;
|
|
||||||
import io.anuke.mindustry.content.Blocks;
|
import io.anuke.mindustry.content.Blocks;
|
||||||
import io.anuke.mindustry.content.Fx;
|
import io.anuke.mindustry.content.Fx;
|
||||||
import io.anuke.mindustry.entities.Damage;
|
import io.anuke.mindustry.entities.Damage;
|
||||||
@@ -250,6 +249,7 @@ public abstract class Unit extends DestructibleEntity implements SaveTrait, Targ
|
|||||||
|
|
||||||
final int rad = 2;
|
final int rad = 2;
|
||||||
|
|
||||||
|
//TODO fix units getting trapped on tile corners
|
||||||
moveVector.setZero();
|
moveVector.setZero();
|
||||||
for(int cx = -rad; cx <= rad; cx++){
|
for(int cx = -rad; cx <= rad; cx++){
|
||||||
for(int cy = -rad; cy <= rad; cy++){
|
for(int cy = -rad; cy <= rad; cy++){
|
||||||
|
|||||||
@@ -126,7 +126,8 @@ public class MechPad extends Block{
|
|||||||
if(checkValidTap(tile, player)){
|
if(checkValidTap(tile, player)){
|
||||||
Call.onMechFactoryTap(player, tile);
|
Call.onMechFactoryTap(player, tile);
|
||||||
}else if(player.isLocal && mobile && !player.isDead() && (entity.power.satisfaction >= requiredSatisfaction) && entity.player == null){
|
}else if(player.isLocal && mobile && !player.isDead() && (entity.power.satisfaction >= requiredSatisfaction) && entity.player == null){
|
||||||
player.moveTarget = tile.entity;
|
//deselect on double taps
|
||||||
|
player.moveTarget = player.moveTarget == tile.entity ? null : tile.entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -77,8 +77,13 @@ public class ArcNetServer implements ServerProvider{
|
|||||||
Core.app.post(() -> {
|
Core.app.post(() -> {
|
||||||
try{
|
try{
|
||||||
Net.handleServerReceived(k.id, object);
|
Net.handleServerReceived(k.id, object);
|
||||||
}catch(ValidateException e){
|
}catch(RuntimeException e){
|
||||||
Log.err("Validation failed: {0} ({1})", e.player.name, e.getMessage());
|
if(e.getCause() instanceof ValidateException){
|
||||||
|
ValidateException v = (ValidateException)e.getCause();
|
||||||
|
Log.err("Validation failed: {0} ({1})", v.player.name, v.getMessage());
|
||||||
|
}else{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user