Wave spawner moved / Bundle tweaks / Blank name

This commit is contained in:
Anuken
2018-11-23 13:32:17 -05:00
parent e5d6740555
commit 66c29c49e5
10 changed files with 139 additions and 126 deletions

View File

@@ -182,7 +182,7 @@ public class Pathfinder{
}
}
state.spawner.checkAllQuadrants();
world.spawner.checkAllQuadrants();
}
class PathData{

View File

@@ -89,7 +89,7 @@ public class Control extends Module{
"color-1", Color.rgba8888(playerColors[11]),
"color-2", Color.rgba8888(playerColors[13]),
"color-3", Color.rgba8888(playerColors[9]),
"name", "player",
"name", "",
"lastBuild", 0
);

View File

@@ -1,6 +1,5 @@
package io.anuke.mindustry.core;
import io.anuke.mindustry.ai.WaveSpawner;
import io.anuke.mindustry.game.Difficulty;
import io.anuke.mindustry.game.EventType.StateChangeEvent;
import io.anuke.mindustry.game.GameMode;
@@ -12,14 +11,21 @@ import static io.anuke.mindustry.Vars.unitGroups;
import static io.anuke.mindustry.Vars.waveTeam;
public class GameState{
/**Current wave number, can be anything in non-wave modes.*/
public int wave = 1;
/**Wave countdown in ticks.*/
public float wavetime;
/**Whether the game is in game over state.*/
public boolean gameOver = false;
/**The current game mode.*/
public GameMode mode = GameMode.waves;
/**The current difficulty for wave modes.*/
public Difficulty difficulty = Difficulty.normal;
public WaveSpawner spawner = new WaveSpawner();
/**Team data. Gets reset every new game.*/
public Teams teams = new Teams();
/**Number of enemies in the game; only used clientside in servers.*/
public int enemies;
/**Current game state.*/
private State state = State.menu;
public int enemies(){

View File

@@ -93,7 +93,7 @@ public class Logic extends Module{
}
public void runWave(){
state.spawner.spawnEnemies();
world.spawner.spawnEnemies();
state.wave++;
state.wavetime = wavespace * state.difficulty.timeScaling;

View File

@@ -5,6 +5,7 @@ import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ObjectMap;
import io.anuke.mindustry.ai.BlockIndexer;
import io.anuke.mindustry.ai.Pathfinder;
import io.anuke.mindustry.ai.WaveSpawner;
import io.anuke.mindustry.content.blocks.Blocks;
import io.anuke.mindustry.core.GameState.State;
import io.anuke.mindustry.game.EventType.TileChangeEvent;
@@ -30,6 +31,7 @@ public class World extends Module{
public final WorldGenerator generator = new WorldGenerator();
public final BlockIndexer indexer = new BlockIndexer();
public final Pathfinder pathfinder = new Pathfinder();
public final WaveSpawner spawner = new WaveSpawner();
private Map currentMap;
private Sector currentSector;

View File

@@ -528,7 +528,7 @@ public class MobileInput extends InputHandler implements GestureListener{
//ignore off-screen taps
if(cursor == null || ui.hasMouse(x, y)) return false;
threads.run(() -> checkTargets(worldx, worldy));
checkTargets(worldx, worldy);
//remove if request present
if(hasRequest(cursor)){
@@ -548,14 +548,13 @@ public class MobileInput extends InputHandler implements GestureListener{
consumed = true;
player.dropCarry(); //drop off unit
}else{
threads.run(() -> {
Unit unit = Units.getClosest(player.getTeam(), Graphics.world(x, y).x, Graphics.world(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight);
Unit unit = Units.getClosest(player.getTeam(), Graphics.world(x, y).x, Graphics.world(x, y).y, 4f, u -> !u.isFlying() && u.getMass() <= player.mech.carryWeight);
if(unit != null){
player.moveTarget = unit;
Effects.effect(Fx.select, unit.getX(), unit.getY());
}
});
if(unit != null){
consumed = true;
player.moveTarget = unit;
Effects.effect(Fx.select, unit.getX(), unit.getY());
}
}
}

View File

@@ -45,7 +45,7 @@ public class Save16 extends SaveFileVersion{
content.setTemporaryMapper(readContentHeader(stream));
state.spawner.read(stream);
world.spawner.read(stream);
readEntities(stream);
@@ -71,7 +71,7 @@ public class Save16 extends SaveFileVersion{
writeContentHeader(stream);
state.spawner.write(stream); //spawnes
world.spawner.write(stream); //spawnes
//--ENTITIES--

View File

@@ -285,6 +285,11 @@ public class JoinDialog extends FloatingDialog{
}
void connect(String ip, int port){
if(Settings.getString("name").trim().isEmpty()){
ui.showInfo("$text.noname");
return;
}
ui.loadfrag.show("$text.connecting");
ui.loadfrag.setButton(() -> {