diff --git a/core/src/mindustry/ai/WaveSpawner.java b/core/src/mindustry/ai/WaveSpawner.java index afc8ab30db..947e13b48b 100644 --- a/core/src/mindustry/ai/WaveSpawner.java +++ b/core/src/mindustry/ai/WaveSpawner.java @@ -13,7 +13,6 @@ import mindustry.entities.*; import mindustry.game.EventType.*; import mindustry.game.*; import mindustry.gen.*; -import mindustry.type.*; import mindustry.world.*; import static mindustry.Vars.*; @@ -73,7 +72,7 @@ public class WaveSpawner{ for(int i = 0; i < spawned; i++){ Unit unit = group.createUnit(state.rules.waveTeam, state.wave - 1); unit.set(spawnX + Mathf.range(spread), spawnY + Mathf.range(spread)); - unit.add(); + spawnEffect(unit); } }); }else{ @@ -178,8 +177,10 @@ public class WaveSpawner{ } private void spawnEffect(Unit unit){ - Call.spawnEffect(unit.x, unit.y, unit.type); - Time.run(30f, unit::add); + Call.spawnEffect(unit.x, unit.y, unit); + unit.rotation = unit.angleTo(world.width()/2f * tilesize, world.height()/2f * tilesize); + unit.apply(StatusEffects.unmoving, 30f); + unit.add(); } private interface SpawnConsumer{ @@ -187,8 +188,8 @@ public class WaveSpawner{ } @Remote(called = Loc.server, unreliable = true) - public static void spawnEffect(float x, float y, UnitType type){ - Fx.unitSpawn.at(x, y, 0f, type); + public static void spawnEffect(float x, float y, Unit u){ + Fx.unitSpawn.at(x, y, 0f, u); Time.run(30f, () -> Fx.spawn.at(x, y)); } diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index b2f21d732d..00b714c26b 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -26,17 +26,23 @@ public class Fx{ none = new Effect(0, 0f, e -> {}), unitSpawn = new Effect(30f, e -> { - if(!(e.data instanceof UnitType)) return; - - alpha(e.fin()); + if(!(e.data instanceof Unit unit)) return; float scl = 1f + e.fout() * 2f; - UnitType unit = e.data(); - TextureRegion region = unit.icon(Cicon.full); + TextureRegion region = unit.type.icon(Cicon.full); - rect(region, e.x, e.y, - region.width * Draw.scl * scl, region.height * Draw.scl * scl, 180f); + alpha(e.fout()); + mixcol(Color.white, e.fin()); + + rect(region, unit.x, unit.y, 180f); + + reset(); + + alpha(e.fin()); + + rect(region, unit.x, unit.y, + region.width * Draw.scl * scl, region.height * Draw.scl * scl, unit.rotation - 90); }), diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index 6263782b51..aa6b19e2b5 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -200,7 +200,7 @@ public class Logic implements ApplicationListener{ } public void skipWave(){ - state.wavetime = 0; + runWave(); } public void runWave(){ diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 203108f036..592869b4d1 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -204,7 +204,6 @@ public class DesktopInput extends InputHandler{ if(input.keyDown(Binding.mouse_move)){ panCam = true; } - panning = false; Core.camera.position.add(Tmp.v1.setZero().add(Core.input.axis(Binding.move_x), Core.input.axis(Binding.move_y)).nor().scl(camSpeed)); }else if(!player.dead() && !panning){ diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index ffbee6cdf3..843d2600ab 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -888,6 +888,7 @@ public class LExecutor{ String strValue = v.objval == null ? "null" : v.objval instanceof String s ? s : + v.objval == Blocks.stoneWall ? "solid" : //special alias v.objval instanceof MappableContent content ? content.name : v.objval instanceof Content ? "[content]" : v.objval instanceof Building build ? build.block.name :