Wave editor clipboard save+load / Bugfixes / Balancing
This commit is contained in:
@@ -1069,7 +1069,7 @@ public class Blocks implements ContentList{
|
||||
range = 95f;
|
||||
shootCone = 15f;
|
||||
ammoUseEffect = Fx.shellEjectSmall;
|
||||
health = 210;
|
||||
health = 250;
|
||||
inaccuracy = 2f;
|
||||
rotatespeed = 10f;
|
||||
}};
|
||||
@@ -1092,7 +1092,7 @@ public class Blocks implements ContentList{
|
||||
inaccuracy = 17f;
|
||||
shootCone = 35f;
|
||||
|
||||
health = 220*size*size;
|
||||
health = 260*size*size;
|
||||
}};
|
||||
|
||||
hail = new ArtilleryTurret("hail"){{
|
||||
@@ -1107,7 +1107,7 @@ public class Blocks implements ContentList{
|
||||
range = 230f;
|
||||
inaccuracy = 1f;
|
||||
shootCone = 10f;
|
||||
health = 120;
|
||||
health = 260;
|
||||
}};
|
||||
|
||||
wave = new LiquidTurret("wave"){{
|
||||
@@ -1125,7 +1125,7 @@ public class Blocks implements ContentList{
|
||||
shootCone = 50f;
|
||||
shootEffect = Fx.shootLiquid;
|
||||
range = 100f;
|
||||
health = 360;
|
||||
health = 250*size*size;
|
||||
|
||||
drawer = (tile, entity) -> {
|
||||
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
||||
@@ -1156,7 +1156,7 @@ public class Blocks implements ContentList{
|
||||
chargeBeginEffect = Fx.lancerLaserChargeBegin;
|
||||
heatColor = Color.RED;
|
||||
size = 2;
|
||||
health = 320;
|
||||
health = 280*size*size;
|
||||
targetAir = false;
|
||||
}};
|
||||
|
||||
@@ -1174,6 +1174,7 @@ public class Blocks implements ContentList{
|
||||
heatColor = Color.RED;
|
||||
recoil = 1f;
|
||||
size = 1;
|
||||
health = 260;
|
||||
}};
|
||||
|
||||
swarmer = new BurstTurret("swarmer"){{
|
||||
@@ -1190,7 +1191,7 @@ public class Blocks implements ContentList{
|
||||
range = 140f;
|
||||
xRand = 6f;
|
||||
size = 2;
|
||||
health = 380;
|
||||
health = 300*size*size;
|
||||
}};
|
||||
|
||||
salvo = new BurstTurret("salvo"){{
|
||||
|
||||
@@ -36,7 +36,7 @@ public class Mechs implements ContentList{
|
||||
speed = 0.5f;
|
||||
boostSpeed = 0.85f;
|
||||
engineColor = Color.valueOf("ffd37f");
|
||||
health = 250f;
|
||||
health = 300f;
|
||||
|
||||
weapon = new Weapon("blaster"){{
|
||||
length = 1.5f;
|
||||
@@ -62,7 +62,7 @@ public class Mechs implements ContentList{
|
||||
boostSpeed = 0.95f;
|
||||
itemCapacity = 15;
|
||||
mass = 0.9f;
|
||||
health = 220f;
|
||||
health = 250f;
|
||||
weaponOffsetX = -1;
|
||||
weaponOffsetY = -1;
|
||||
engineColor = Color.valueOf("d3ddff");
|
||||
|
||||
@@ -22,7 +22,7 @@ public class Zones implements ContentList{
|
||||
alwaysUnlocked = true;
|
||||
conditionWave = 5;
|
||||
launchPeriod = 5;
|
||||
resources = new Item[]{Items.copper, Items.scrap};
|
||||
resources = new Item[]{Items.copper, Items.scrap, Items.lead};
|
||||
rules = () -> new Rules(){{
|
||||
waves = true;
|
||||
waveTimer = true;
|
||||
|
||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.editor;
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.arc.graphics.Color;
|
||||
import io.anuke.arc.input.KeyCode;
|
||||
import io.anuke.arc.math.Mathf;
|
||||
import io.anuke.arc.scene.ui.TextField.TextFieldFilter;
|
||||
import io.anuke.arc.scene.ui.layout.Table;
|
||||
@@ -45,11 +46,41 @@ public class WaveInfoDialog extends FloatingDialog{
|
||||
}
|
||||
});
|
||||
|
||||
keyDown(key -> {
|
||||
if(key == KeyCode.ESCAPE || key == KeyCode.BACK) {
|
||||
Core.app.post(this::hide);
|
||||
}
|
||||
});
|
||||
|
||||
addCloseButton();
|
||||
buttons.addButton("$settings.reset", () -> ui.showConfirm("$confirm", "$settings.clear.confirm", () ->{
|
||||
groups = null;
|
||||
buildGroups();
|
||||
})).size(270f, 64f);
|
||||
buttons.addButton("$waves.edit", () -> {
|
||||
FloatingDialog dialog = new FloatingDialog("$waves.edit");
|
||||
dialog.addCloseButton();
|
||||
dialog.setFillParent(false);
|
||||
dialog.cont.defaults().size(210f, 64f);
|
||||
dialog.cont.addButton("$waves.copy", () -> {
|
||||
ui.showInfoFade("$waves.copied");
|
||||
Core.app.getClipboard().setContents(world.maps.writeWaves(groups));
|
||||
dialog.hide();
|
||||
}).disabled(b -> groups == null);
|
||||
dialog.cont.row();
|
||||
dialog.cont.addButton("$waves.load", () -> {
|
||||
try{
|
||||
groups = world.maps.readWaves(Core.app.getClipboard().getContents());
|
||||
buildGroups();
|
||||
}catch(Exception e){
|
||||
ui.showError("$waves.invalid");
|
||||
}
|
||||
dialog.hide();
|
||||
}).disabled(b -> Core.app.getClipboard().getContents() == null || Core.app.getClipboard().getContents().isEmpty());
|
||||
dialog.cont.row();
|
||||
dialog.cont.addButton("$settings.reset", () -> ui.showConfirm("$confirm", "$settings.clear.confirm", () ->{
|
||||
groups = null;
|
||||
buildGroups();
|
||||
dialog.hide();
|
||||
}));
|
||||
dialog.show();
|
||||
}).size(270f, 64f);
|
||||
}
|
||||
|
||||
void setup(){
|
||||
@@ -67,7 +98,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
||||
}).growX().height(70f);
|
||||
}).width(390f).growY();
|
||||
cont.table("clear", m -> {
|
||||
m.add("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.addButton("-", () -> {}).update(t -> {
|
||||
if(t.getClickListener().isPressed()){
|
||||
@@ -114,16 +145,16 @@ public class WaveInfoDialog extends FloatingDialog{
|
||||
|
||||
t.row();
|
||||
t.table(spawns -> {
|
||||
spawns.addField("" + group.begin, TextFieldFilter.digitsOnly, text -> {
|
||||
spawns.addField("" + (group.begin + 1), TextFieldFilter.digitsOnly, text -> {
|
||||
if(Strings.canParsePostiveInt(text)){
|
||||
group.begin = Strings.parseInt(text);
|
||||
group.begin = Strings.parseInt(text) - 1;
|
||||
updateWaves();
|
||||
}
|
||||
}).width(100f);
|
||||
spawns.add("$waves.to").padLeft(4).padRight(4);
|
||||
spawns.addField(group.end == never ? "" : group.end + "", TextFieldFilter.digitsOnly, text -> {
|
||||
spawns.addField(group.end == never ? "" : (group.end + 1) + "", TextFieldFilter.digitsOnly, text -> {
|
||||
if(Strings.canParsePostiveInt(text)){
|
||||
group.end = Strings.parseInt(text);
|
||||
group.end = Strings.parseInt(text) - 1;
|
||||
updateWaves();
|
||||
}else if(text.isEmpty()){
|
||||
group.end = never;
|
||||
@@ -211,7 +242,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
||||
for(int i = start; i < displayed + start; i ++){
|
||||
int wave = i;
|
||||
preview.table("underline", table -> {
|
||||
table.add(wave + "").color(Pal.accent).center().colspan(2).get().setAlignment(Align.center, Align.center);
|
||||
table.add((wave+1) + "").color(Pal.accent).center().colspan(2).get().setAlignment(Align.center, Align.center);
|
||||
table.row();
|
||||
|
||||
int[] spawned = new int[Vars.content.getBy(ContentType.unit).size];
|
||||
|
||||
@@ -30,7 +30,7 @@ public class Stats{
|
||||
|
||||
//each new launch period adds onto the rank 'points'
|
||||
if(wavesLasted >= zone.conditionWave){
|
||||
score += (float)((wavesLasted - zone.conditionWave) / zone.launchPeriod + 1) * 1.3f;
|
||||
score += (float)((wavesLasted - zone.conditionWave) / zone.launchPeriod + 1) * 1.2f;
|
||||
}
|
||||
|
||||
int capacity = zone.loadout.core().itemCapacity;
|
||||
@@ -42,7 +42,7 @@ public class Stats{
|
||||
frac += Mathf.clamp((float)itemsDelivered.get(item, 0) / capacity) / (float)obtainable.size;
|
||||
}
|
||||
|
||||
score += frac*2.0f;
|
||||
score += frac*1.6f;
|
||||
|
||||
if(!launched){
|
||||
score *= 0.5f;
|
||||
|
||||
@@ -15,6 +15,7 @@ import io.anuke.arc.math.geom.Point2;
|
||||
import io.anuke.arc.math.geom.Vector2;
|
||||
import io.anuke.arc.scene.ui.layout.Table;
|
||||
import io.anuke.arc.util.Time;
|
||||
import io.anuke.arc.util.Tmp;
|
||||
import io.anuke.mindustry.content.Blocks;
|
||||
import io.anuke.mindustry.content.Fx;
|
||||
import io.anuke.mindustry.entities.Effects;
|
||||
@@ -378,14 +379,23 @@ public abstract class InputHandler implements InputProcessor{
|
||||
float angle = Angles.angle(startX, startY, endX, endY);
|
||||
int baseRotation = (startX == endX && startY == endY) ? rotation : ((int)((angle + 45) / 90f)) % 4;
|
||||
|
||||
Tmp.r3.set(-1, -1, 0, 0);
|
||||
|
||||
for(int i = 0; i < points.size; i++){
|
||||
Point2 point = points.get(i);
|
||||
|
||||
if(block != null && Tmp.r2.setSize(block.size * tilesize).setCenter(point.x*tilesize + block.offset(), point.y*tilesize + block.offset()).overlaps(Tmp.r3)){
|
||||
continue;
|
||||
}
|
||||
|
||||
Point2 next = i == points.size - 1 ? null : points.get(i + 1);
|
||||
line.x = point.x;
|
||||
line.y = point.y;
|
||||
line.rotation = next != null ? Tile.relativeTo(point.x, point.y, next.x, next.y) : baseRotation;
|
||||
line.last = next == null;
|
||||
cons.accept(line);
|
||||
|
||||
Tmp.r3.setSize(block.size * tilesize).setCenter(point.x*tilesize + block.offset(), point.y*tilesize + block.offset());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user