@@ -13,6 +13,7 @@ import mindustry.entities.*;
|
|||||||
import mindustry.game.EventType.*;
|
import mindustry.game.EventType.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
import mindustry.gen.*;
|
import mindustry.gen.*;
|
||||||
|
import mindustry.type.*;
|
||||||
import mindustry.world.*;
|
import mindustry.world.*;
|
||||||
|
|
||||||
import static mindustry.Vars.*;
|
import static mindustry.Vars.*;
|
||||||
@@ -177,10 +178,11 @@ public class WaveSpawner{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void spawnEffect(Unit unit){
|
private void spawnEffect(Unit unit){
|
||||||
Call.spawnEffect(unit.x, unit.y, unit);
|
|
||||||
unit.rotation = unit.angleTo(world.width()/2f * tilesize, world.height()/2f * tilesize);
|
unit.rotation = unit.angleTo(world.width()/2f * tilesize, world.height()/2f * tilesize);
|
||||||
unit.apply(StatusEffects.unmoving, 30f);
|
unit.apply(StatusEffects.unmoving, 30f);
|
||||||
unit.add();
|
unit.add();
|
||||||
|
|
||||||
|
Call.spawnEffect(unit.x, unit.y, unit.rotation, unit.type);
|
||||||
}
|
}
|
||||||
|
|
||||||
private interface SpawnConsumer{
|
private interface SpawnConsumer{
|
||||||
@@ -188,8 +190,8 @@ public class WaveSpawner{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Remote(called = Loc.server, unreliable = true)
|
@Remote(called = Loc.server, unreliable = true)
|
||||||
public static void spawnEffect(float x, float y, Unit u){
|
public static void spawnEffect(float x, float y, float rotation, UnitType u){
|
||||||
Fx.unitSpawn.at(x, y, 0f, u);
|
Fx.unitSpawn.at(x, y, rotation, u);
|
||||||
|
|
||||||
Time.run(30f, () -> Fx.spawn.at(x, y));
|
Time.run(30f, () -> Fx.spawn.at(x, y));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,23 +26,23 @@ public class Fx{
|
|||||||
none = new Effect(0, 0f, e -> {}),
|
none = new Effect(0, 0f, e -> {}),
|
||||||
|
|
||||||
unitSpawn = new Effect(30f, e -> {
|
unitSpawn = new Effect(30f, e -> {
|
||||||
if(!(e.data instanceof Unit unit)) return;
|
if(!(e.data instanceof UnitType unit)) return;
|
||||||
|
|
||||||
float scl = 1f + e.fout() * 2f;
|
float scl = 1f + e.fout() * 2f;
|
||||||
|
|
||||||
TextureRegion region = unit.type.icon(Cicon.full);
|
TextureRegion region = unit.icon(Cicon.full);
|
||||||
|
|
||||||
alpha(e.fout());
|
alpha(e.fout());
|
||||||
mixcol(Color.white, e.fin());
|
mixcol(Color.white, e.fin());
|
||||||
|
|
||||||
rect(region, unit.x, unit.y, 180f);
|
rect(region, e.x, e.y, 180f);
|
||||||
|
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
alpha(e.fin());
|
alpha(e.fin());
|
||||||
|
|
||||||
rect(region, unit.x, unit.y,
|
rect(region, e.x, e.y,
|
||||||
region.width * Draw.scl * scl, region.height * Draw.scl * scl, unit.rotation - 90);
|
region.width * Draw.scl * scl, region.height * Draw.scl * scl, e.rotation - 90);
|
||||||
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
|||||||
@@ -283,13 +283,13 @@ public class LCanvas extends Table{
|
|||||||
t.add().growX();
|
t.add().growX();
|
||||||
|
|
||||||
t.button(Icon.copy, Styles.logici, () -> {
|
t.button(Icon.copy, Styles.logici, () -> {
|
||||||
}).padRight(6).get().tapped(this::copy);
|
}).size(24f).padRight(6).get().tapped(this::copy);
|
||||||
|
|
||||||
t.button(Icon.cancel, Styles.logici, () -> {
|
t.button(Icon.cancel, Styles.logici, () -> {
|
||||||
remove();
|
remove();
|
||||||
dragging = null;
|
dragging = null;
|
||||||
statements.layout();
|
statements.layout();
|
||||||
});
|
}).size(24f);
|
||||||
|
|
||||||
t.addListener(new InputListener(){
|
t.addListener(new InputListener(){
|
||||||
float lastx, lasty;
|
float lastx, lasty;
|
||||||
|
|||||||
Reference in New Issue
Block a user