Difficulty balance / Better map display / UI fixes

This commit is contained in:
Anuken
2018-11-07 18:51:27 -05:00
parent 38fdc11917
commit 042c671bd4
10 changed files with 13 additions and 13 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 B

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 100 KiB

+1 -1
View File
@@ -54,7 +54,7 @@ public class MapIO{
byte elev = y >= data.height() - 1 ? 0 : data.read(x, y + 1, DataPosition.elevation); byte elev = y >= data.height() - 1 ? 0 : data.read(x, y + 1, DataPosition.elevation);
Block floor = content.block(marker.floor); Block floor = content.block(marker.floor);
Block wall = content.block(marker.wall); Block wall = content.block(marker.wall);
int color = ColorMapper.colorFor(floor, wall, Team.all[marker.team], marker.elevation, elev > marker.elevation ? (byte)(1 << 6) : (byte)0); int color = ColorMapper.colorFor(floor, wall, Team.all[marker.team], marker.elevation + 1, elev > marker.elevation ? (byte)(1 << 6) : (byte)0);
pixmap.drawPixel(x, pixmap.getHeight() - 1 - y, color); pixmap.drawPixel(x, pixmap.getHeight() - 1 - y, color);
} }
} }
@@ -2,6 +2,7 @@ package io.anuke.mindustry.maps;
import com.badlogic.gdx.utils.IntIntMap; import com.badlogic.gdx.utils.IntIntMap;
import com.badlogic.gdx.utils.ObjectMap; import com.badlogic.gdx.utils.ObjectMap;
import io.anuke.ucore.util.Bundles;
public class MapMeta{ public class MapMeta{
public final int version; public final int version;
@@ -18,15 +19,19 @@ public class MapMeta{
} }
public String author(){ public String author(){
return tags.get("author", "unknown"); return tag("author");
} }
public String description(){ public String description(){
return tags.get("description", "unknown"); return tag("description");
} }
public String name(){ public String name(){
return tags.get("name", "unknown"); return tag("name");
}
public String tag(String name){
return tags.containsKey(name) && !tags.get(name).trim().isEmpty() ? tags.get(name): Bundles.get("text.unknown");
} }
public boolean hasOreGen(){ public boolean hasOreGen(){
@@ -57,6 +57,7 @@ public class FortressGenerator{
void gen(){ void gen(){
gen.setBlock(enemyX, enemyY, StorageBlocks.core, team); gen.setBlock(enemyX, enemyY, StorageBlocks.core, team);
gen.random.nextBoolean();
float difficultyScl = Mathf.clamp(gen.sector.difficulty / 20f + gen.random.range(0.25f), 0f, 0.9999f); float difficultyScl = Mathf.clamp(gen.sector.difficulty / 20f + gen.random.range(0.25f), 0f, 0.9999f);
float dscl2 = Mathf.clamp(0.5f + gen.sector.difficulty / 20f + gen.random.range(0.1f), 0f, 1.5f); float dscl2 = Mathf.clamp(0.5f + gen.sector.difficulty / 20f + gen.random.range(0.1f), 0f, 1.5f);
@@ -10,8 +10,6 @@ import io.anuke.mindustry.world.Tile;
import static io.anuke.mindustry.Vars.state; import static io.anuke.mindustry.Vars.state;
public abstract class MissionWithStartingCore extends Mission{ public abstract class MissionWithStartingCore extends Mission{
/** Stores a custom starting location for the core, or null if the default calculation (map center) shall be used. */ /** Stores a custom starting location for the core, or null if the default calculation (map center) shall be used. */
private final GridPoint2 customStartingPoint; private final GridPoint2 customStartingPoint;
@@ -60,7 +60,7 @@ public class SectorsDialog extends FloatingDialog{
margin(0); margin(0);
getTitleTable().clear(); getTitleTable().clear();
clear(); clear();
stack(content(), buttons(), container).grow(); stack(content(), container, buttons()).grow();
shown(this::setup); shown(this::setup);
} }
@@ -128,7 +128,7 @@ public class SectorsDialog extends FloatingDialog{
class SectorView extends Element{ class SectorView extends Element{
float lastX, lastY; float lastX, lastY;
boolean clicked = false; boolean clicked = false;
float panX = 0, panY = -sectorSize/2f; float panX = sectorSize/2f, panY = sectorSize/2f;
SectorView(){ SectorView(){
addListener(new InputListener(){ addListener(new InputListener(){
@@ -14,11 +14,7 @@ public class ColorMapper implements ContentList{
private static ObjectIntMap<Block> colorMap = new ObjectIntMap<>(); private static ObjectIntMap<Block> colorMap = new ObjectIntMap<>();
private static ThreadLocal<Color> tmpColors = new ThreadLocal<>(); private static ThreadLocal<Color> tmpColors = new ThreadLocal<>();
public static Block getByColor(int color){ private static int getBlockColor(Block block){
return blockMap.get(color);
}
public static int getBlockColor(Block block){
return colorMap.get(block, 0); return colorMap.get(block, 0);
} }