Fixed black blocks/units after quit / Fixed intense wave spawn lag
This commit is contained in:
@@ -210,6 +210,7 @@ waves.copy = Copy to Clipboard
|
|||||||
waves.load = Load from Clipboard
|
waves.load = Load from Clipboard
|
||||||
waves.invalid = Invalid waves in clipboard.
|
waves.invalid = Invalid waves in clipboard.
|
||||||
waves.copied = Waves copied.
|
waves.copied = Waves copied.
|
||||||
|
waves.none = No enemies defined.\nNote that empty wave layouts will automatically be replaced with the default layout.
|
||||||
editor.default = [LIGHT_GRAY]<Default>
|
editor.default = [LIGHT_GRAY]<Default>
|
||||||
edit = Edit...
|
edit = Edit...
|
||||||
editor.name = Name:
|
editor.name = Name:
|
||||||
|
|||||||
@@ -1,73 +0,0 @@
|
|||||||
Prosta4okua
|
|
||||||
Timmeey86
|
|
||||||
Epowerj
|
|
||||||
Baltazár Radics
|
|
||||||
Dexapnow
|
|
||||||
Milinai
|
|
||||||
키에르
|
|
||||||
Luxray5474
|
|
||||||
Leone25
|
|
||||||
Gureumi
|
|
||||||
VizardAlpha
|
|
||||||
LQ
|
|
||||||
Commodore64x
|
|
||||||
iczero
|
|
||||||
Krzysztof Skrzętnicki
|
|
||||||
Baramos666
|
|
||||||
theshadowknight
|
|
||||||
elmenda452
|
|
||||||
Predator127
|
|
||||||
Sonnicon
|
|
||||||
CinExPL
|
|
||||||
toushangyouxiang
|
|
||||||
xgamezs
|
|
||||||
Skybbles // L5474
|
|
||||||
William So
|
|
||||||
beito
|
|
||||||
BeefEX
|
|
||||||
Lorex
|
|
||||||
laohuaji233
|
|
||||||
CrazyBearTR
|
|
||||||
Zachary
|
|
||||||
Fenr1r
|
|
||||||
Jaiun Lee
|
|
||||||
Gab_351
|
|
||||||
Carter Gale
|
|
||||||
Jan Polák
|
|
||||||
JustYanns
|
|
||||||
BasedUser
|
|
||||||
BLucky-gh
|
|
||||||
DinoWattz
|
|
||||||
Jae
|
|
||||||
angelickite
|
|
||||||
ScriptHosT12
|
|
||||||
Senventise
|
|
||||||
SkeptiC
|
|
||||||
Deyvid67
|
|
||||||
Damlon
|
|
||||||
DaGamerFiles
|
|
||||||
Trigg
|
|
||||||
Uriel
|
|
||||||
VXF
|
|
||||||
Valen. H
|
|
||||||
Valentin Sonin
|
|
||||||
Clarence "Sparr" Risher
|
|
||||||
bei2
|
|
||||||
AceEllysium
|
|
||||||
Cedric L'homme
|
|
||||||
indielm
|
|
||||||
Ameb
|
|
||||||
player20033
|
|
||||||
Ignacy
|
|
||||||
J-VdS
|
|
||||||
Kenny
|
|
||||||
L5474
|
|
||||||
Franciszek Zaranowicz
|
|
||||||
Andreas Heiskanen
|
|
||||||
Doyoung Gwak
|
|
||||||
MMG
|
|
||||||
Math2128
|
|
||||||
Michael Plotke
|
|
||||||
Niko
|
|
||||||
Paul T
|
|
||||||
Dominik
|
|
||||||
@@ -124,6 +124,7 @@ public class Vars{
|
|||||||
public static GameState state;
|
public static GameState state;
|
||||||
public static GlobalData data;
|
public static GlobalData data;
|
||||||
public static EntityCollisions collisions;
|
public static EntityCollisions collisions;
|
||||||
|
public static DefaultWaves defaultWaves;
|
||||||
|
|
||||||
public static Control control;
|
public static Control control;
|
||||||
public static Logic logic;
|
public static Logic logic;
|
||||||
@@ -172,6 +173,7 @@ public class Vars{
|
|||||||
content.setVerbose();
|
content.setVerbose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defaultWaves = new DefaultWaves();
|
||||||
collisions = new EntityCollisions();
|
collisions = new EntityCollisions();
|
||||||
|
|
||||||
playerGroup = Entities.addGroup(Player.class).enableMapping();
|
playerGroup = Entities.addGroup(Player.class).enableMapping();
|
||||||
|
|||||||
@@ -72,15 +72,17 @@ public class WaveSpawner{
|
|||||||
|
|
||||||
Time.run(Math.min(i * 5, 60 * 2), () -> spawnEffect(unit));
|
Time.run(Math.min(i * 5, 60 * 2), () -> spawnEffect(unit));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(doShockwave){
|
|
||||||
Time.run(20f, () -> Effects.effect(Fx.spawnShockwave, spawnX, spawnY, state.rules.dropZoneRadius));
|
|
||||||
Time.run(40f, () -> Damage.damage(waveTeam, spawnX, spawnY, state.rules.dropZoneRadius, 99999999f, true));
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eachGroundSpawn((spawnX, spawnY, doShockwave) -> {
|
||||||
|
if(doShockwave){
|
||||||
|
Time.run(20f, () -> Effects.effect(Fx.spawnShockwave, spawnX, spawnY, state.rules.dropZoneRadius));
|
||||||
|
Time.run(40f, () -> Damage.damage(waveTeam, spawnX, spawnY, state.rules.dropZoneRadius, 99999999f, true));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Time.runTask(121f, () -> spawning = false);
|
Time.runTask(121f, () -> spawning = false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -583,7 +583,7 @@ public class Fx implements ContentList{
|
|||||||
spawnShockwave = new Effect(20f, 400f, e -> {
|
spawnShockwave = new Effect(20f, 400f, e -> {
|
||||||
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
|
Draw.color(Color.WHITE, Color.LIGHT_GRAY, e.fin());
|
||||||
Lines.stroke(e.fout() * 3f + 0.5f);
|
Lines.stroke(e.fout() * 3f + 0.5f);
|
||||||
Lines.poly(e.x, e.y, 60, e.fin() * (e.rotation + 50f));
|
Lines.poly(e.x, e.y, 40, e.fin() * (e.rotation + 50f));
|
||||||
Draw.reset();
|
Draw.reset();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import io.anuke.arc.collection.Array;
|
|||||||
import io.anuke.arc.graphics.Color;
|
import io.anuke.arc.graphics.Color;
|
||||||
import io.anuke.arc.input.KeyCode;
|
import io.anuke.arc.input.KeyCode;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
|
import io.anuke.arc.scene.event.Touchable;
|
||||||
|
import io.anuke.arc.scene.ui.Label;
|
||||||
import io.anuke.arc.scene.ui.TextField.TextFieldFilter;
|
import io.anuke.arc.scene.ui.TextField.TextFieldFilter;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
@@ -21,7 +23,7 @@ import static io.anuke.mindustry.game.SpawnGroup.never;
|
|||||||
|
|
||||||
public class WaveInfoDialog extends FloatingDialog{
|
public class WaveInfoDialog extends FloatingDialog{
|
||||||
private final static int displayed = 20;
|
private final static int displayed = 20;
|
||||||
private Array<SpawnGroup> groups;
|
private Array<SpawnGroup> groups = new Array<>();
|
||||||
|
|
||||||
private Table table, preview;
|
private Table table, preview;
|
||||||
private int start = 0;
|
private int start = 0;
|
||||||
@@ -65,7 +67,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
}).disabled(b -> Core.app.getClipboard().getContents() == null || Core.app.getClipboard().getContents().isEmpty());
|
}).disabled(b -> Core.app.getClipboard().getContents() == null || Core.app.getClipboard().getContents().isEmpty());
|
||||||
dialog.cont.row();
|
dialog.cont.row();
|
||||||
dialog.cont.addButton("$settings.reset", () -> ui.showConfirm("$confirm", "$settings.clear.confirm", () -> {
|
dialog.cont.addButton("$settings.reset", () -> ui.showConfirm("$confirm", "$settings.clear.confirm", () -> {
|
||||||
groups = JsonIO.copy(DefaultWaves.get());
|
groups = JsonIO.copy(defaultWaves.get());
|
||||||
buildGroups();
|
buildGroups();
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
}));
|
}));
|
||||||
@@ -74,10 +76,10 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setup(){
|
void setup(){
|
||||||
groups = JsonIO.copy(state.rules.spawns);
|
groups = JsonIO.copy(state.rules.spawns.isEmpty() ? defaultWaves.get() : state.rules.spawns);
|
||||||
|
|
||||||
cont.clear();
|
cont.clear();
|
||||||
cont.table("clear", main -> {
|
cont.stack(new Table("clear", main -> {
|
||||||
main.pane(t -> table = t).growX().growY().get().setScrollingDisabled(true, false);
|
main.pane(t -> table = t).growX().growY().get().setScrollingDisabled(true, false);
|
||||||
main.row();
|
main.row();
|
||||||
main.addButton("$add", () -> {
|
main.addButton("$add", () -> {
|
||||||
@@ -85,7 +87,13 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
groups.add(new SpawnGroup(lastType));
|
groups.add(new SpawnGroup(lastType));
|
||||||
buildGroups();
|
buildGroups();
|
||||||
}).growX().height(70f);
|
}).growX().height(70f);
|
||||||
}).width(390f).growY();
|
}), new Label("$waves.none"){{
|
||||||
|
visible(groups::isEmpty);
|
||||||
|
touchable(Touchable.disabled);
|
||||||
|
setWrap(true);
|
||||||
|
setAlignment(Align.center, Align.center);
|
||||||
|
}}).width(390f).growY();
|
||||||
|
|
||||||
cont.table("clear", m -> {
|
cont.table("clear", m -> {
|
||||||
m.add("$waves.preview").color(Color.LIGHT_GRAY).growX().center().get().setAlignment(Align.center, Align.center);
|
m.add("$waves.preview").color(Color.LIGHT_GRAY).growX().center().get().setAlignment(Align.center, Align.center);
|
||||||
m.row();
|
m.row();
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import io.anuke.mindustry.content.*;
|
|||||||
import io.anuke.mindustry.type.ItemStack;
|
import io.anuke.mindustry.type.ItemStack;
|
||||||
|
|
||||||
public class DefaultWaves{
|
public class DefaultWaves{
|
||||||
private static Array<SpawnGroup> spawns;
|
private Array<SpawnGroup> spawns;
|
||||||
|
|
||||||
public static Array<SpawnGroup> get(){
|
public Array<SpawnGroup> get(){
|
||||||
if(spawns == null && UnitTypes.dagger != null){
|
if(spawns == null && UnitTypes.dagger != null){
|
||||||
spawns = Array.with(
|
spawns = Array.with(
|
||||||
new SpawnGroup(UnitTypes.dagger){{
|
new SpawnGroup(UnitTypes.dagger){{
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ public class Rules{
|
|||||||
public float launchWaveMultiplier = 2f;
|
public float launchWaveMultiplier = 2f;
|
||||||
/** Zone for saves that have them.*/
|
/** Zone for saves that have them.*/
|
||||||
public Zone zone;
|
public Zone zone;
|
||||||
/** Spawn layout. Should be assigned on save load based on map or zone. */
|
/** Spawn layout. */
|
||||||
public Array<SpawnGroup> spawns = DefaultWaves.get();
|
public Array<SpawnGroup> spawns = new Array<>();
|
||||||
/** Determines if there should be limited respawns. */
|
/** Determines if there should be limited respawns. */
|
||||||
public boolean limitedRespawns = false;
|
public boolean limitedRespawns = false;
|
||||||
/** How many times player can respawn during one wave. */
|
/** How many times player can respawn during one wave. */
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public abstract class SaveVersion extends SaveFileReader{
|
|||||||
state.wavetime = map.getFloat("wavetime", state.rules.waveSpacing);
|
state.wavetime = map.getFloat("wavetime", state.rules.waveSpacing);
|
||||||
state.stats = JsonIO.read(Stats.class, map.get("stats", "{}"));
|
state.stats = JsonIO.read(Stats.class, map.get("stats", "{}"));
|
||||||
state.rules = JsonIO.read(Rules.class, map.get("rules", "{}"));
|
state.rules = JsonIO.read(Rules.class, map.get("rules", "{}"));
|
||||||
if(state.rules.spawns.isEmpty()) state.rules.spawns = DefaultWaves.get();
|
if(state.rules.spawns.isEmpty()) state.rules.spawns = defaultWaves.get();
|
||||||
Map worldmap = world.maps.byName(map.get("mapname", "\\\\\\"));
|
Map worldmap = world.maps.byName(map.get("mapname", "\\\\\\"));
|
||||||
world.setMap(worldmap == null ? new Map(StringMap.of(
|
world.setMap(worldmap == null ? new Map(StringMap.of(
|
||||||
"name", map.get("mapname", "Unknown"),
|
"name", map.get("mapname", "Unknown"),
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import io.anuke.arc.collection.StringMap;
|
|||||||
import io.anuke.arc.files.FileHandle;
|
import io.anuke.arc.files.FileHandle;
|
||||||
import io.anuke.arc.graphics.Texture;
|
import io.anuke.arc.graphics.Texture;
|
||||||
import io.anuke.mindustry.Vars;
|
import io.anuke.mindustry.Vars;
|
||||||
import io.anuke.mindustry.game.DefaultWaves;
|
|
||||||
import io.anuke.mindustry.game.Rules;
|
import io.anuke.mindustry.game.Rules;
|
||||||
import io.anuke.mindustry.io.JsonIO;
|
import io.anuke.mindustry.io.JsonIO;
|
||||||
|
|
||||||
@@ -59,7 +58,7 @@ public class Map implements Comparable<Map>{
|
|||||||
/** This creates a new instance.*/
|
/** This creates a new instance.*/
|
||||||
public Rules rules(){
|
public Rules rules(){
|
||||||
Rules result = JsonIO.read(Rules.class, tags.get("rules", "{}"));
|
Rules result = JsonIO.read(Rules.class, tags.get("rules", "{}"));
|
||||||
if(result.spawns.isEmpty()) result.spawns = DefaultWaves.get();
|
if(result.spawns.isEmpty()) result.spawns = Vars.defaultWaves.get();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ import static io.anuke.mindustry.Vars.defaultTeam;
|
|||||||
import static io.anuke.mindustry.Vars.world;
|
import static io.anuke.mindustry.Vars.world;
|
||||||
|
|
||||||
public class Loadout extends Content{
|
public class Loadout extends Content{
|
||||||
private final static Array<Tile> outArray = new Array<>();
|
private final Array<Tile> outArray = new Array<>();
|
||||||
private final static IntMap<BlockEntry> entries = new IntMap<BlockEntry>(){{
|
private final IntMap<BlockEntry> entries = new IntMap<BlockEntry>(){{
|
||||||
put('>', new BlockEntry(Blocks.conveyor, 0));
|
put('>', new BlockEntry(Blocks.conveyor, 0));
|
||||||
put('^', new BlockEntry(Blocks.conveyor, 1));
|
put('^', new BlockEntry(Blocks.conveyor, 1));
|
||||||
put('<', new BlockEntry(Blocks.conveyor, 2));
|
put('<', new BlockEntry(Blocks.conveyor, 2));
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public class CustomRulesDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void check(String text, BooleanConsumer cons, BooleanProvider prov, BooleanProvider condition){
|
void check(String text, BooleanConsumer cons, BooleanProvider prov, BooleanProvider condition){
|
||||||
main.addCheck(text, cons).checked(prov.get()).update(a -> a.setDisabled(!condition.get())).padRight(100f);
|
main.addCheck(text, cons).checked(prov.get()).update(a -> a.setDisabled(!condition.get())).padRight(100f).get().left();
|
||||||
main.row();
|
main.row();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class MapsDialog extends FloatingDialog{
|
|||||||
ScrollPane pane = new ScrollPane(maps);
|
ScrollPane pane = new ScrollPane(maps);
|
||||||
pane.setFadeScrollBars(false);
|
pane.setFadeScrollBars(false);
|
||||||
|
|
||||||
int maxwidth = 4;
|
int maxwidth = Core.graphics.isPortrait() ? 2 : 4;
|
||||||
float mapsize = 200f;
|
float mapsize = 200f;
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|||||||
@@ -331,7 +331,7 @@ public class ApplicationTests{
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
void allBlockTest(){
|
void allBlockTest(){
|
||||||
Tile[][] tiles = world.createTiles(256 + 20, 10);
|
Tile[][] tiles = world.createTiles(256*2 + 20, 10);
|
||||||
|
|
||||||
world.beginMapLoad();
|
world.beginMapLoad();
|
||||||
for(int x = 0; x < tiles.length; x++){
|
for(int x = 0; x < tiles.length; x++){
|
||||||
@@ -344,6 +344,7 @@ public class ApplicationTests{
|
|||||||
for(int x = 5; x < tiles.length && i < content.blocks().size; ){
|
for(int x = 5; x < tiles.length && i < content.blocks().size; ){
|
||||||
Block block = content.block(i++);
|
Block block = content.block(i++);
|
||||||
if(block.buildVisibility.get()){
|
if(block.buildVisibility.get()){
|
||||||
|
x += block.size;
|
||||||
tiles[x][5].setBlock(block);
|
tiles[x][5].setBlock(block);
|
||||||
x += block.size;
|
x += block.size;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user