diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 223bf3e367..c6b07c292d 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -11,7 +11,7 @@ text.link.wiki.description=official Mindustry wiki text.linkfail=Failed to open link!\nThe URL has been copied to your cliboard. text.editor.web=The web version does not support the editor!\nDownload the game to use it. text.web.unsupported=The web version does not support this feature! Download the game to use it. -text.multiplayer.web=This version of the game does not support multiplayer!\nTo play multiplayer from your browser, use the "multiplayer web version" link at the itch.io page. +text.multiplayer.web=The web version of the game does not support multiplayer!\nUse the downloadable PC, Android or iOS versions. text.host.web=The web version does not support hosting games! Download the game to use this feature. text.gameover=The core was destroyed. text.highscore=[YELLOW]New highscore! diff --git a/core/src/io/anuke/mindustry/content/blocks/Blocks.java b/core/src/io/anuke/mindustry/content/blocks/Blocks.java index 1268255a74..4e4bfb9d05 100644 --- a/core/src/io/anuke/mindustry/content/blocks/Blocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/Blocks.java @@ -114,6 +114,7 @@ public class Blocks extends BlockList implements ContentList{ drops = new ItemStack(Items.stone, 1); minimapColor = Color.valueOf("252525"); playerUnmineable = true; + hasOres = true; }}; dirt = new Floor("dirt"){{ @@ -130,7 +131,7 @@ public class Blocks extends BlockList implements ContentList{ ice = new Floor("ice"){{ dragMultiplier = 0.3f; speedMultiplier = 0.4f; - minimapColor = Color.valueOf("c4e3e7"); + minimapColor = Color.valueOf("b8eef8"); hasOres = true; }}; diff --git a/core/src/io/anuke/mindustry/editor/MapInfoDialog.java b/core/src/io/anuke/mindustry/editor/MapInfoDialog.java index 2fc2427399..6f4a046d45 100644 --- a/core/src/io/anuke/mindustry/editor/MapInfoDialog.java +++ b/core/src/io/anuke/mindustry/editor/MapInfoDialog.java @@ -65,7 +65,7 @@ public class MapInfoDialog extends FloatingDialog{ content().add().padRight(8).left(); content().addCheck("$text.editor.oregen", enabled -> { tags.put("oregen", enabled ? "1" : "0"); - }).left(); + }).update(c -> c.setChecked(!tags.get("oregen", "0").equals("0"))).left(); name.change(); description.change(); diff --git a/core/src/io/anuke/mindustry/entities/Player.java b/core/src/io/anuke/mindustry/entities/Player.java index 6040e36df7..39161a9a8d 100644 --- a/core/src/io/anuke/mindustry/entities/Player.java +++ b/core/src/io/anuke/mindustry/entities/Player.java @@ -503,9 +503,8 @@ public class Player extends Unit implements BuilderTrait, CarryTrait, ShooterTra if(mech.flying){ //prevent strafing backwards, have a penalty for doing so - float angDist = Angles.angleDist(rotation, velocity.angle()) / 180f; float penalty = 0.2f; //when going 180 degrees backwards, reduce speed to 0.2x - speed *= Mathf.lerp(1f, penalty, angDist); + speed *= Mathf.lerp(1f, penalty, Angles.angleDist(rotation, velocity.angle()) / 180f); } //drop from carrier on key press diff --git a/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java b/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java index 3975a89cf2..e7f3007ca1 100644 --- a/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java +++ b/core/src/io/anuke/mindustry/maps/generation/WorldGenerator.java @@ -34,7 +34,7 @@ public class WorldGenerator{ private Simplex sim2 = new Simplex(seed + 1); private Simplex sim3 = new Simplex(seed + 2); private RidgedPerlin rid = new RidgedPerlin(seed + 4, 1); - private VoronoiNoise vn = new VoronoiNoise(seed + 2, (short)1); + private VoronoiNoise vn = new VoronoiNoise(seed + 2, (short)0); private SeedRandom random = new SeedRandom(seed + 3); @@ -42,6 +42,8 @@ public class WorldGenerator{ private ObjectMap decoration; public WorldGenerator(){ + vn.setUseDistance(true); + decoration = Mathf.map( Blocks.grass, Blocks.shrub, Blocks.stone, Blocks.rock, @@ -222,9 +224,11 @@ public class WorldGenerator{ Block floor = Blocks.stone; Block wall = Blocks.air; - double ridge = Mathf.clamp(rid.getValue(x, y, 1f / 400f))/3f; - double elevation = sim.octaveNoise2D(detailed ? 7 : 2, 0.5, 1f / 500, x, y) * 5.1 - 1 - ridge; - double temp = sim3.octaveNoise2D(detailed ? 2 : 1, 1, 1f / 13f, x, y)/13f + sim3.octaveNoise2D(detailed ? 12 : 6, 0.6, 1f / 620f, x, y) - ridge; + double ridge = rid.getValue(x, y, 1f / 400f); + double iceridge = rid.getValue(x+99999, y, 1f / 500f); + double elevation = sim.octaveNoise2D(detailed ? 7 : 2, 0.5, 1f / 500, x, y) * 6.1 - 1 - ridge; + double temp = vn.noise(x, y, 1f / 300f) * sim3.octaveNoise2D(detailed ? 2 : 1, 1, 1f / 13f, x, y)/13f + + sim3.octaveNoise2D(detailed ? 12 : 6, 0.6, 1f / 920f, x, y); double r = sim2.octaveNoise2D(1, 0.6, 1f / 70, x, y); double edgeDist = Math.max(sectorSize / 2, sectorSize / 2) - Math.max(Math.abs(x - sectorSize / 2), Math.abs(y - sectorSize / 2)); @@ -237,31 +241,43 @@ public class WorldGenerator{ // elevation += (border - edgeDist) / 6.0; } - if(temp < 0.35){ - floor = Blocks.snow; - }else if(temp < 0.45){ - floor = Blocks.stone; - }else if(temp < 0.65){ - floor = Blocks.grass; - }else if(temp < 0.8){ + if(elevation < 0.7){ + floor = Blocks.deepwater; + }else if(elevation < 0.79){ + floor = Blocks.water; + }else if(elevation < 0.85){ floor = Blocks.sand; - }else if(temp < 0.9){ + }else if(temp < 0.55){ + floor = Blocks.grass; + }else if(temp < 0.65){ + floor = Blocks.sand; + }else if(temp + ridge/2f < 0.8 || elevation < 1.3){ floor = Blocks.blackstone; - elevation = 0f; }else{ floor = Blocks.lava; } + if(elevation > 3.5){ + floor = Blocks.snow; + }else if(elevation > 3){ + floor = Blocks.stone; + } + + if(elevation > 2 && iceridge > 0.3){ + elevation ++; + floor = Blocks.ice; + } + //if(dst < elevDip){ // elevation -= (elevDip - dst) / elevDip * 3.0; - /*}else*/if(detailed && r > 0.9){ - floor = Blocks.water; - elevation = 0; + /*}else*///if(detailed && r > 0.9){ + //floor = Blocks.water; + //elevation = 0; - if(r > 0.94){ - floor = Blocks.deepwater; - } - } + //if(r > 0.94){ + // floor = Blocks.deepwater; + //} + //} if(((Floor)floor).liquidDrop != null){ elevation = 0; diff --git a/core/src/io/anuke/mindustry/world/ColorMapper.java b/core/src/io/anuke/mindustry/world/ColorMapper.java index 9941bd3b5a..1339a1c377 100644 --- a/core/src/io/anuke/mindustry/world/ColorMapper.java +++ b/core/src/io/anuke/mindustry/world/ColorMapper.java @@ -11,7 +11,7 @@ import io.anuke.mindustry.type.ContentList; public class ColorMapper implements ContentList{ private static IntMap blockMap = new IntMap<>(); private static ObjectIntMap colorMap = new ObjectIntMap<>(); - private static Color tmpColor = new Color(); + private static ThreadLocal tmpColors = new ThreadLocal<>(); public static Block getByColor(int color){ return blockMap.get(color); @@ -25,6 +25,8 @@ public class ColorMapper implements ContentList{ int color = wall.breakable ? team.intColor : getBlockColor(wall); if(color == 0) color = ColorMapper.getBlockColor(floor); if(elevation > 0){ + if(tmpColors.get() == null) tmpColors.set(new Color()); + Color tmpColor = tmpColors.get(); float mul = 1.1f + elevation / 4f; tmpColor.set(color); tmpColor.mul(mul, mul, mul, 1f);