Bugfixes / Balancing
This commit is contained in:
@@ -292,7 +292,7 @@ uncover = Uncover
|
|||||||
configure = Configure Loadout
|
configure = Configure Loadout
|
||||||
configure.locked = [LIGHT_GRAY]Unlock configuring loadout:\nWave {0}.
|
configure.locked = [LIGHT_GRAY]Unlock configuring loadout:\nWave {0}.
|
||||||
zone.unlocked = [LIGHT_GRAY]{0} unlocked.
|
zone.unlocked = [LIGHT_GRAY]{0} unlocked.
|
||||||
zone.complete = Wave {0} reached:\nNew zone requirements met.
|
zone.complete = Wave {0} reached:\nNext zone requirements met.
|
||||||
zone.config.complete = Wave {0} reached:\nLoadout config unlocked.
|
zone.config.complete = Wave {0} reached:\nLoadout config unlocked.
|
||||||
zone.resources = Resources Detected:
|
zone.resources = Resources Detected:
|
||||||
add = Add...
|
add = Add...
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public class WaveSpawner{
|
|||||||
private Array<FlyerSpawn> flySpawns = new Array<>();
|
private Array<FlyerSpawn> flySpawns = new Array<>();
|
||||||
private Array<GroundSpawn> groundSpawns = new Array<>();
|
private Array<GroundSpawn> groundSpawns = new Array<>();
|
||||||
private IntArray loadedSpawns = new IntArray();
|
private IntArray loadedSpawns = new IntArray();
|
||||||
|
private boolean spawning = false;
|
||||||
|
|
||||||
public WaveSpawner(){
|
public WaveSpawner(){
|
||||||
Events.on(WorldLoadEvent.class, e -> reset());
|
Events.on(WorldLoadEvent.class, e -> reset());
|
||||||
@@ -57,6 +58,7 @@ public class WaveSpawner{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void spawnEnemies(){
|
public void spawnEnemies(){
|
||||||
|
spawning = true;
|
||||||
|
|
||||||
for(SpawnGroup group : state.rules.spawns){
|
for(SpawnGroup group : state.rules.spawns){
|
||||||
int spawned = group.getUnitsSpawned(state.wave);
|
int spawned = group.getUnitsSpawned(state.wave);
|
||||||
@@ -90,7 +92,7 @@ public class WaveSpawner{
|
|||||||
BaseUnit unit = group.createUnit(waveTeam);
|
BaseUnit unit = group.createUnit(waveTeam);
|
||||||
unit.set(spawnX + Tmp.v1.x, spawnY + Tmp.v1.y);
|
unit.set(spawnX + Tmp.v1.x, spawnY + Tmp.v1.y);
|
||||||
|
|
||||||
Time.run(i*5, () -> shockwave(unit));
|
Time.run(Math.min(i*5, 60*2), () -> shockwave(unit));
|
||||||
}
|
}
|
||||||
Time.run(20f, () -> Effects.effect(Fx.spawnShockwave, spawn.x * tilesize, spawn.y * tilesize));
|
Time.run(20f, () -> Effects.effect(Fx.spawnShockwave, spawn.x * tilesize, spawn.y * tilesize));
|
||||||
//would be interesting to see player structures survive this without hacks
|
//would be interesting to see player structures survive this without hacks
|
||||||
@@ -98,6 +100,12 @@ public class WaveSpawner{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Time.runTask(121f, () -> spawning = false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSpawning(){
|
||||||
|
return spawning;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reset(){
|
private void reset(){
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public class TechTree implements ContentList{
|
|||||||
});
|
});
|
||||||
|
|
||||||
node(duo, () -> {
|
node(duo, () -> {
|
||||||
|
node(scatter, () -> {
|
||||||
node(hail, () -> {
|
node(hail, () -> {
|
||||||
|
|
||||||
node(salvo, () -> {
|
node(salvo, () -> {
|
||||||
@@ -61,6 +62,7 @@ public class TechTree implements ContentList{
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
node(arc, () -> {
|
node(arc, () -> {
|
||||||
node(wave, () -> {
|
node(wave, () -> {
|
||||||
@@ -257,7 +259,7 @@ public class TechTree implements ContentList{
|
|||||||
private TechNode node(Block block, Runnable children){
|
private TechNode node(Block block, Runnable children){
|
||||||
ItemStack[] requirements = new ItemStack[block.buildRequirements.length];
|
ItemStack[] requirements = new ItemStack[block.buildRequirements.length];
|
||||||
for(int i = 0; i < requirements.length; i++){
|
for(int i = 0; i < requirements.length; i++){
|
||||||
requirements[i] = new ItemStack(block.buildRequirements[i].item, block.buildRequirements[i].amount * 10);
|
requirements[i] = new ItemStack(block.buildRequirements[i].item, block.buildRequirements[i].amount * 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new TechNode(block, requirements, children);
|
return new TechNode(block, requirements, children);
|
||||||
|
|||||||
@@ -579,6 +579,8 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
|
|||||||
|
|
||||||
if(!ui.chatfrag.chatOpen()){
|
if(!ui.chatfrag.chatOpen()){
|
||||||
velocity.add(movement.x, movement.y);
|
velocity.add(movement.x, movement.y);
|
||||||
|
}else{
|
||||||
|
isShooting = false;
|
||||||
}
|
}
|
||||||
float prex = x, prey = y;
|
float prex = x, prey = y;
|
||||||
updateVelocityStatus();
|
updateVelocityStatus();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import io.anuke.arc.Core;
|
|||||||
import io.anuke.arc.Events;
|
import io.anuke.arc.Events;
|
||||||
import io.anuke.arc.collection.Array;
|
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.math.Interpolation;
|
import io.anuke.arc.math.Interpolation;
|
||||||
import io.anuke.arc.math.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
import io.anuke.arc.scene.Element;
|
import io.anuke.arc.scene.Element;
|
||||||
@@ -31,6 +32,7 @@ import io.anuke.mindustry.net.Net;
|
|||||||
import io.anuke.mindustry.net.Packets.AdminAction;
|
import io.anuke.mindustry.net.Packets.AdminAction;
|
||||||
import io.anuke.mindustry.ui.Bar;
|
import io.anuke.mindustry.ui.Bar;
|
||||||
import io.anuke.mindustry.ui.IntFormat;
|
import io.anuke.mindustry.ui.IntFormat;
|
||||||
|
import io.anuke.mindustry.ui.dialogs.FloatingDialog;
|
||||||
|
|
||||||
import static io.anuke.mindustry.Vars.*;
|
import static io.anuke.mindustry.Vars.*;
|
||||||
|
|
||||||
@@ -222,16 +224,37 @@ public class HudFragment extends Fragment{
|
|||||||
//launch button
|
//launch button
|
||||||
parent.fill(t -> {
|
parent.fill(t -> {
|
||||||
t.top().visible(() -> !state.is(State.menu));
|
t.top().visible(() -> !state.is(State.menu));
|
||||||
|
TextButton[] testb = {null};
|
||||||
|
|
||||||
TextButton button = Elements.newButton("$launch", () -> ui.showConfirm("$launch", "$launch.confirm", Call::launchZone));
|
TextButton button = Elements.newButton("$launch", () -> {
|
||||||
|
FloatingDialog dialog = new FloatingDialog("$launch");
|
||||||
|
dialog.update(() -> {
|
||||||
|
if(!testb[0].isVisible()){
|
||||||
|
dialog.hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dialog.cont.add("$launch.confirm").width(500f).wrap().pad(4f).get().setAlignment(Align.center, Align.center);
|
||||||
|
dialog.buttons.defaults().size(200f, 54f).pad(2f);
|
||||||
|
dialog.setFillParent(false);
|
||||||
|
dialog.buttons.addButton("$cancel", dialog::hide);
|
||||||
|
dialog.buttons.addButton("$ok", () -> {
|
||||||
|
dialog.hide();
|
||||||
|
Call.launchZone();
|
||||||
|
});
|
||||||
|
dialog.keyDown(KeyCode.ESCAPE, dialog::hide);
|
||||||
|
dialog.keyDown(KeyCode.BACK, dialog::hide);
|
||||||
|
dialog.show();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
testb[0] = button;
|
||||||
|
|
||||||
button.getStyle().disabledFontColor = Color.WHITE;
|
button.getStyle().disabledFontColor = Color.WHITE;
|
||||||
button.visible(() ->
|
button.visible(() ->
|
||||||
world.isZone() &&
|
world.isZone() &&
|
||||||
world.getZone().metCondition() &&
|
world.getZone().metCondition() &&
|
||||||
!Net.client() &&
|
!Net.client() &&
|
||||||
state.wave % world.getZone().launchPeriod == 0 &&
|
state.wave % world.getZone().launchPeriod == 0 && !world.spawner.isSpawning());
|
||||||
state.wavetime < state.rules.waveSpacing * launchWaveMultiplier - 70);
|
|
||||||
|
|
||||||
button.update(() -> {
|
button.update(() -> {
|
||||||
if(world.getZone() == null){
|
if(world.getZone() == null){
|
||||||
@@ -444,6 +467,6 @@ public class HudFragment extends Fragment{
|
|||||||
}
|
}
|
||||||
}).growY().fillX().right().width(40f)
|
}).growY().fillX().right().width(40f)
|
||||||
.visible(() -> state.rules.waves && ((Net.server() || players[0].isAdmin) || !Net.active()) && state.enemies() == 0
|
.visible(() -> state.rules.waves && ((Net.server() || players[0].isAdmin) || !Net.active()) && state.enemies() == 0
|
||||||
&& (state.wavetime < state.rules.waveSpacing - 60 || !state.rules.waveTimer));
|
&& (!world.spawner.isSpawning() || !state.rules.waveTimer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ 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.Point2;
|
import io.anuke.arc.math.geom.Point2;
|
||||||
import io.anuke.arc.util.Log;
|
|
||||||
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.content.StatusEffects;
|
import io.anuke.mindustry.content.StatusEffects;
|
||||||
@@ -110,12 +109,13 @@ public class Floor extends Block{
|
|||||||
Mathf.random.setSeed(tile.pos());
|
Mathf.random.setSeed(tile.pos());
|
||||||
|
|
||||||
Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.worldx(), tile.worldy());
|
Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.worldx(), tile.worldy());
|
||||||
|
|
||||||
|
drawEdges(tile);
|
||||||
|
|
||||||
Floor floor = tile.ore();
|
Floor floor = tile.ore();
|
||||||
if(floor != Blocks.air && floor != this){ //ore should never have itself on top, but it's possible, so prevent a crash in that case
|
if(floor != Blocks.air && floor != this){ //ore should never have itself on top, but it's possible, so prevent a crash in that case
|
||||||
floor.draw(tile);
|
floor.draw(tile);
|
||||||
}
|
}
|
||||||
|
|
||||||
drawEdges(tile);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user