Difficulty balance / Better map display / UI fixes
This commit is contained in:
@@ -54,7 +54,7 @@ public class MapIO{
|
||||
byte elev = y >= data.height() - 1 ? 0 : data.read(x, y + 1, DataPosition.elevation);
|
||||
Block floor = content.block(marker.floor);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package io.anuke.mindustry.maps;
|
||||
|
||||
import com.badlogic.gdx.utils.IntIntMap;
|
||||
import com.badlogic.gdx.utils.ObjectMap;
|
||||
import io.anuke.ucore.util.Bundles;
|
||||
|
||||
public class MapMeta{
|
||||
public final int version;
|
||||
@@ -18,15 +19,19 @@ public class MapMeta{
|
||||
}
|
||||
|
||||
public String author(){
|
||||
return tags.get("author", "unknown");
|
||||
return tag("author");
|
||||
}
|
||||
|
||||
public String description(){
|
||||
return tags.get("description", "unknown");
|
||||
return tag("description");
|
||||
}
|
||||
|
||||
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(){
|
||||
|
||||
@@ -57,6 +57,7 @@ public class FortressGenerator{
|
||||
|
||||
void gen(){
|
||||
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 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;
|
||||
|
||||
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. */
|
||||
private final GridPoint2 customStartingPoint;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public class SectorsDialog extends FloatingDialog{
|
||||
margin(0);
|
||||
getTitleTable().clear();
|
||||
clear();
|
||||
stack(content(), buttons(), container).grow();
|
||||
stack(content(), container, buttons()).grow();
|
||||
|
||||
shown(this::setup);
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public class SectorsDialog extends FloatingDialog{
|
||||
class SectorView extends Element{
|
||||
float lastX, lastY;
|
||||
boolean clicked = false;
|
||||
float panX = 0, panY = -sectorSize/2f;
|
||||
float panX = sectorSize/2f, panY = sectorSize/2f;
|
||||
|
||||
SectorView(){
|
||||
addListener(new InputListener(){
|
||||
|
||||
@@ -14,11 +14,7 @@ public class ColorMapper implements ContentList{
|
||||
private static ObjectIntMap<Block> colorMap = new ObjectIntMap<>();
|
||||
private static ThreadLocal<Color> tmpColors = new ThreadLocal<>();
|
||||
|
||||
public static Block getByColor(int color){
|
||||
return blockMap.get(color);
|
||||
}
|
||||
|
||||
public static int getBlockColor(Block block){
|
||||
private static int getBlockColor(Block block){
|
||||
return colorMap.get(block, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user