Wave editor clipboard save+load / Bugfixes / Balancing
This commit is contained in:
@@ -203,6 +203,12 @@ waves.waves = wave(s)
|
|||||||
waves.perspawn = per spawn
|
waves.perspawn = per spawn
|
||||||
waves.to = to
|
waves.to = to
|
||||||
waves.boss = Boss
|
waves.boss = Boss
|
||||||
|
waves.preview = Preview
|
||||||
|
waves.edit = Edit...
|
||||||
|
waves.copy = Copy to Clipboard
|
||||||
|
waves.load = Load from Clipboard
|
||||||
|
waves.invalid = Invalid waves in clipboard.
|
||||||
|
waves.copied = Waves copied.
|
||||||
editor.default = [LIGHT_GRAY]<Default>
|
editor.default = [LIGHT_GRAY]<Default>
|
||||||
edit = Edit...
|
edit = Edit...
|
||||||
editor.name = Name:
|
editor.name = Name:
|
||||||
@@ -256,6 +262,7 @@ filter.option.threshold = Threshold
|
|||||||
filter.option.circle-scale = Circle Scale
|
filter.option.circle-scale = Circle Scale
|
||||||
filter.option.octaves = Octaves
|
filter.option.octaves = Octaves
|
||||||
filter.option.falloff = Falloff
|
filter.option.falloff = Falloff
|
||||||
|
filter.option.block = Block
|
||||||
filter.option.floor = Floor
|
filter.option.floor = Floor
|
||||||
filter.option.wall = Wall
|
filter.option.wall = Wall
|
||||||
filter.option.ore = Ore
|
filter.option.ore = Ore
|
||||||
|
|||||||
Binary file not shown.
@@ -1069,7 +1069,7 @@ public class Blocks implements ContentList{
|
|||||||
range = 95f;
|
range = 95f;
|
||||||
shootCone = 15f;
|
shootCone = 15f;
|
||||||
ammoUseEffect = Fx.shellEjectSmall;
|
ammoUseEffect = Fx.shellEjectSmall;
|
||||||
health = 210;
|
health = 250;
|
||||||
inaccuracy = 2f;
|
inaccuracy = 2f;
|
||||||
rotatespeed = 10f;
|
rotatespeed = 10f;
|
||||||
}};
|
}};
|
||||||
@@ -1092,7 +1092,7 @@ public class Blocks implements ContentList{
|
|||||||
inaccuracy = 17f;
|
inaccuracy = 17f;
|
||||||
shootCone = 35f;
|
shootCone = 35f;
|
||||||
|
|
||||||
health = 220*size*size;
|
health = 260*size*size;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
hail = new ArtilleryTurret("hail"){{
|
hail = new ArtilleryTurret("hail"){{
|
||||||
@@ -1107,7 +1107,7 @@ public class Blocks implements ContentList{
|
|||||||
range = 230f;
|
range = 230f;
|
||||||
inaccuracy = 1f;
|
inaccuracy = 1f;
|
||||||
shootCone = 10f;
|
shootCone = 10f;
|
||||||
health = 120;
|
health = 260;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
wave = new LiquidTurret("wave"){{
|
wave = new LiquidTurret("wave"){{
|
||||||
@@ -1125,7 +1125,7 @@ public class Blocks implements ContentList{
|
|||||||
shootCone = 50f;
|
shootCone = 50f;
|
||||||
shootEffect = Fx.shootLiquid;
|
shootEffect = Fx.shootLiquid;
|
||||||
range = 100f;
|
range = 100f;
|
||||||
health = 360;
|
health = 250*size*size;
|
||||||
|
|
||||||
drawer = (tile, entity) -> {
|
drawer = (tile, entity) -> {
|
||||||
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
|
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;
|
chargeBeginEffect = Fx.lancerLaserChargeBegin;
|
||||||
heatColor = Color.RED;
|
heatColor = Color.RED;
|
||||||
size = 2;
|
size = 2;
|
||||||
health = 320;
|
health = 280*size*size;
|
||||||
targetAir = false;
|
targetAir = false;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
@@ -1174,6 +1174,7 @@ public class Blocks implements ContentList{
|
|||||||
heatColor = Color.RED;
|
heatColor = Color.RED;
|
||||||
recoil = 1f;
|
recoil = 1f;
|
||||||
size = 1;
|
size = 1;
|
||||||
|
health = 260;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
swarmer = new BurstTurret("swarmer"){{
|
swarmer = new BurstTurret("swarmer"){{
|
||||||
@@ -1190,7 +1191,7 @@ public class Blocks implements ContentList{
|
|||||||
range = 140f;
|
range = 140f;
|
||||||
xRand = 6f;
|
xRand = 6f;
|
||||||
size = 2;
|
size = 2;
|
||||||
health = 380;
|
health = 300*size*size;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
salvo = new BurstTurret("salvo"){{
|
salvo = new BurstTurret("salvo"){{
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class Mechs implements ContentList{
|
|||||||
speed = 0.5f;
|
speed = 0.5f;
|
||||||
boostSpeed = 0.85f;
|
boostSpeed = 0.85f;
|
||||||
engineColor = Color.valueOf("ffd37f");
|
engineColor = Color.valueOf("ffd37f");
|
||||||
health = 250f;
|
health = 300f;
|
||||||
|
|
||||||
weapon = new Weapon("blaster"){{
|
weapon = new Weapon("blaster"){{
|
||||||
length = 1.5f;
|
length = 1.5f;
|
||||||
@@ -62,7 +62,7 @@ public class Mechs implements ContentList{
|
|||||||
boostSpeed = 0.95f;
|
boostSpeed = 0.95f;
|
||||||
itemCapacity = 15;
|
itemCapacity = 15;
|
||||||
mass = 0.9f;
|
mass = 0.9f;
|
||||||
health = 220f;
|
health = 250f;
|
||||||
weaponOffsetX = -1;
|
weaponOffsetX = -1;
|
||||||
weaponOffsetY = -1;
|
weaponOffsetY = -1;
|
||||||
engineColor = Color.valueOf("d3ddff");
|
engineColor = Color.valueOf("d3ddff");
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class Zones implements ContentList{
|
|||||||
alwaysUnlocked = true;
|
alwaysUnlocked = true;
|
||||||
conditionWave = 5;
|
conditionWave = 5;
|
||||||
launchPeriod = 5;
|
launchPeriod = 5;
|
||||||
resources = new Item[]{Items.copper, Items.scrap};
|
resources = new Item[]{Items.copper, Items.scrap, Items.lead};
|
||||||
rules = () -> new Rules(){{
|
rules = () -> new Rules(){{
|
||||||
waves = true;
|
waves = true;
|
||||||
waveTimer = true;
|
waveTimer = true;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package io.anuke.mindustry.editor;
|
|||||||
import io.anuke.arc.Core;
|
import io.anuke.arc.Core;
|
||||||
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.Mathf;
|
import io.anuke.arc.math.Mathf;
|
||||||
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;
|
||||||
@@ -45,11 +46,41 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
keyDown(key -> {
|
||||||
|
if(key == KeyCode.ESCAPE || key == KeyCode.BACK) {
|
||||||
|
Core.app.post(this::hide);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
addCloseButton();
|
addCloseButton();
|
||||||
buttons.addButton("$settings.reset", () -> ui.showConfirm("$confirm", "$settings.clear.confirm", () ->{
|
buttons.addButton("$waves.edit", () -> {
|
||||||
groups = null;
|
FloatingDialog dialog = new FloatingDialog("$waves.edit");
|
||||||
buildGroups();
|
dialog.addCloseButton();
|
||||||
})).size(270f, 64f);
|
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(){
|
void setup(){
|
||||||
@@ -67,7 +98,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
}).growX().height(70f);
|
}).growX().height(70f);
|
||||||
}).width(390f).growY();
|
}).width(390f).growY();
|
||||||
cont.table("clear", m -> {
|
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.row();
|
||||||
m.addButton("-", () -> {}).update(t -> {
|
m.addButton("-", () -> {}).update(t -> {
|
||||||
if(t.getClickListener().isPressed()){
|
if(t.getClickListener().isPressed()){
|
||||||
@@ -114,16 +145,16 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
|
|
||||||
t.row();
|
t.row();
|
||||||
t.table(spawns -> {
|
t.table(spawns -> {
|
||||||
spawns.addField("" + group.begin, TextFieldFilter.digitsOnly, text -> {
|
spawns.addField("" + (group.begin + 1), TextFieldFilter.digitsOnly, text -> {
|
||||||
if(Strings.canParsePostiveInt(text)){
|
if(Strings.canParsePostiveInt(text)){
|
||||||
group.begin = Strings.parseInt(text);
|
group.begin = Strings.parseInt(text) - 1;
|
||||||
updateWaves();
|
updateWaves();
|
||||||
}
|
}
|
||||||
}).width(100f);
|
}).width(100f);
|
||||||
spawns.add("$waves.to").padLeft(4).padRight(4);
|
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)){
|
if(Strings.canParsePostiveInt(text)){
|
||||||
group.end = Strings.parseInt(text);
|
group.end = Strings.parseInt(text) - 1;
|
||||||
updateWaves();
|
updateWaves();
|
||||||
}else if(text.isEmpty()){
|
}else if(text.isEmpty()){
|
||||||
group.end = never;
|
group.end = never;
|
||||||
@@ -211,7 +242,7 @@ public class WaveInfoDialog extends FloatingDialog{
|
|||||||
for(int i = start; i < displayed + start; i ++){
|
for(int i = start; i < displayed + start; i ++){
|
||||||
int wave = i;
|
int wave = i;
|
||||||
preview.table("underline", table -> {
|
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();
|
table.row();
|
||||||
|
|
||||||
int[] spawned = new int[Vars.content.getBy(ContentType.unit).size];
|
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'
|
//each new launch period adds onto the rank 'points'
|
||||||
if(wavesLasted >= zone.conditionWave){
|
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;
|
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;
|
frac += Mathf.clamp((float)itemsDelivered.get(item, 0) / capacity) / (float)obtainable.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
score += frac*2.0f;
|
score += frac*1.6f;
|
||||||
|
|
||||||
if(!launched){
|
if(!launched){
|
||||||
score *= 0.5f;
|
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.math.geom.Vector2;
|
||||||
import io.anuke.arc.scene.ui.layout.Table;
|
import io.anuke.arc.scene.ui.layout.Table;
|
||||||
import io.anuke.arc.util.Time;
|
import io.anuke.arc.util.Time;
|
||||||
|
import io.anuke.arc.util.Tmp;
|
||||||
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.entities.Effects;
|
import io.anuke.mindustry.entities.Effects;
|
||||||
@@ -378,14 +379,23 @@ public abstract class InputHandler implements InputProcessor{
|
|||||||
float angle = Angles.angle(startX, startY, endX, endY);
|
float angle = Angles.angle(startX, startY, endX, endY);
|
||||||
int baseRotation = (startX == endX && startY == endY) ? rotation : ((int)((angle + 45) / 90f)) % 4;
|
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++){
|
for(int i = 0; i < points.size; i++){
|
||||||
Point2 point = points.get(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);
|
Point2 next = i == points.size - 1 ? null : points.get(i + 1);
|
||||||
line.x = point.x;
|
line.x = point.x;
|
||||||
line.y = point.y;
|
line.y = point.y;
|
||||||
line.rotation = next != null ? Tile.relativeTo(point.x, point.y, next.x, next.y) : baseRotation;
|
line.rotation = next != null ? Tile.relativeTo(point.x, point.y, next.x, next.y) : baseRotation;
|
||||||
line.last = next == null;
|
line.last = next == null;
|
||||||
cons.accept(line);
|
cons.accept(line);
|
||||||
|
|
||||||
|
Tmp.r3.setSize(block.size * tilesize).setCenter(point.x*tilesize + block.offset(), point.y*tilesize + block.offset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ package io.anuke.mindustry.desktop;
|
|||||||
import io.anuke.arc.ApplicationListener;
|
import io.anuke.arc.ApplicationListener;
|
||||||
import io.anuke.arc.backends.lwjgl3.Lwjgl3Application;
|
import io.anuke.arc.backends.lwjgl3.Lwjgl3Application;
|
||||||
import io.anuke.arc.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
|
import io.anuke.arc.backends.lwjgl3.Lwjgl3ApplicationConfiguration;
|
||||||
import io.anuke.net.KryoClient;
|
|
||||||
import io.anuke.net.KryoServer;
|
|
||||||
import io.anuke.mindustry.Mindustry;
|
import io.anuke.mindustry.Mindustry;
|
||||||
import io.anuke.mindustry.core.Platform;
|
import io.anuke.mindustry.core.Platform;
|
||||||
import io.anuke.mindustry.net.Net;
|
import io.anuke.mindustry.net.Net;
|
||||||
|
import io.anuke.net.KryoClient;
|
||||||
|
import io.anuke.net.KryoServer;
|
||||||
|
|
||||||
public class DesktopLauncher extends Lwjgl3Application{
|
public class DesktopLauncher extends Lwjgl3Application{
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user