Bugfixes / Balancing

This commit is contained in:
Anuken 2019-03-19 12:47:09 -04:00
parent cd752209ad
commit f36eed32b9
6 changed files with 53 additions and 18 deletions

View File

@ -292,7 +292,7 @@ uncover = Uncover
configure = Configure Loadout
configure.locked = [LIGHT_GRAY]Unlock configuring loadout:\nWave {0}.
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.resources = Resources Detected:
add = Add...

View File

@ -27,6 +27,7 @@ public class WaveSpawner{
private Array<FlyerSpawn> flySpawns = new Array<>();
private Array<GroundSpawn> groundSpawns = new Array<>();
private IntArray loadedSpawns = new IntArray();
private boolean spawning = false;
public WaveSpawner(){
Events.on(WorldLoadEvent.class, e -> reset());
@ -57,6 +58,7 @@ public class WaveSpawner{
}
public void spawnEnemies(){
spawning = true;
for(SpawnGroup group : state.rules.spawns){
int spawned = group.getUnitsSpawned(state.wave);
@ -90,7 +92,7 @@ public class WaveSpawner{
BaseUnit unit = group.createUnit(waveTeam);
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));
//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(){

View File

@ -43,20 +43,22 @@ public class TechTree implements ContentList{
});
node(duo, () -> {
node(hail, () -> {
node(scatter, () -> {
node(hail, () -> {
node(salvo, () -> {
node(swarmer, () -> {
node(cyclone, () -> {
node(spectre, () -> {
node(salvo, () -> {
node(swarmer, () -> {
node(cyclone, () -> {
node(spectre, () -> {
});
});
});
});
node(ripple, () -> {
node(fuse, () -> {
node(ripple, () -> {
node(fuse, () -> {
});
});
});
});
@ -257,7 +259,7 @@ public class TechTree implements ContentList{
private TechNode node(Block block, Runnable children){
ItemStack[] requirements = new ItemStack[block.buildRequirements.length];
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);

View File

@ -579,6 +579,8 @@ public class Player extends Unit implements BuilderTrait, ShooterTrait{
if(!ui.chatfrag.chatOpen()){
velocity.add(movement.x, movement.y);
}else{
isShooting = false;
}
float prex = x, prey = y;
updateVelocityStatus();

View File

@ -4,6 +4,7 @@ import io.anuke.arc.Core;
import io.anuke.arc.Events;
import io.anuke.arc.collection.Array;
import io.anuke.arc.graphics.Color;
import io.anuke.arc.input.KeyCode;
import io.anuke.arc.math.Interpolation;
import io.anuke.arc.math.Mathf;
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.ui.Bar;
import io.anuke.mindustry.ui.IntFormat;
import io.anuke.mindustry.ui.dialogs.FloatingDialog;
import static io.anuke.mindustry.Vars.*;
@ -222,16 +224,37 @@ public class HudFragment extends Fragment{
//launch button
parent.fill(t -> {
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.visible(() ->
world.isZone() &&
world.getZone().metCondition() &&
!Net.client() &&
state.wave % world.getZone().launchPeriod == 0 &&
state.wavetime < state.rules.waveSpacing * launchWaveMultiplier - 70);
state.wave % world.getZone().launchPeriod == 0 && !world.spawner.isSpawning());
button.update(() -> {
if(world.getZone() == null){
@ -444,6 +467,6 @@ public class HudFragment extends Fragment{
}
}).growY().fillX().right().width(40f)
.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));
}
}

View File

@ -7,7 +7,6 @@ import io.anuke.arc.graphics.g2d.TextureRegion;
import io.anuke.arc.math.Mathf;
import io.anuke.arc.math.geom.Geometry;
import io.anuke.arc.math.geom.Point2;
import io.anuke.arc.util.Log;
import io.anuke.mindustry.content.Blocks;
import io.anuke.mindustry.content.Fx;
import io.anuke.mindustry.content.StatusEffects;
@ -110,12 +109,13 @@ public class Floor extends Block{
Mathf.random.setSeed(tile.pos());
Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.worldx(), tile.worldy());
drawEdges(tile);
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
floor.draw(tile);
}
drawEdges(tile);
}