diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 611a5e763c..c21e6fc0ab 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -33,6 +33,7 @@ deconstruction.title = Block Deconstruction Guide deconstruction = You've just selected [accent]block deconstruction mode[].\n\nTo begin breaking, simply tap a block near your ship.\nOnce you have selected some blocks, press the checkbox to confirm, and your ship will begin de-constructing them.\n\n- [accent]Remove blocks[] from your selection by tapping them.\n- [accent]Remove blocks in an area[] by tapping and holding an empty spot, then dragging in a direction.\n- [accent]Cancel deconstruction or selection[] by pressing the X at the bottom left. showagain = Don't show again next session coreattack = < Core is under attack! > +nearpoint = [[ [scarlet]LEAVE DROP POINT IMMEDIATELY[] ]\nannihilation imminent database = Core Database savegame = Save Game loadgame = Load Game diff --git a/core/assets/maps/frozenForest.mmap b/core/assets/maps/frozenForest.mmap index b278230aed..3adbfe571d 100644 Binary files a/core/assets/maps/frozenForest.mmap and b/core/assets/maps/frozenForest.mmap differ diff --git a/core/src/io/anuke/mindustry/ai/WaveSpawner.java b/core/src/io/anuke/mindustry/ai/WaveSpawner.java index f510cf2eca..e32e107e5b 100644 --- a/core/src/io/anuke/mindustry/ai/WaveSpawner.java +++ b/core/src/io/anuke/mindustry/ai/WaveSpawner.java @@ -24,6 +24,7 @@ import java.io.IOException; import static io.anuke.mindustry.Vars.*; public class WaveSpawner{ + private static final float shockwaveBase = 350f, shockwaveRand = 10f, maxShockwaveDst = shockwaveBase + shockwaveRand; private Array groups; private Array flySpawns = new Array<>(); private Array groundSpawns = new Array<>(); @@ -52,6 +53,11 @@ public class WaveSpawner{ } } + /**@return true if the player is near a ground spawn point.*/ + public boolean playerNear(){ + return groundSpawns.count(g -> Mathf.dst(g.x * tilesize, g.y * tilesize, players[0].x, players[0].y) < maxShockwaveDst) > 0; + } + public void spawnEnemies(){ for(SpawnGroup group : groups){ @@ -98,7 +104,7 @@ public class WaveSpawner{ } Time.run(20f, () -> Effects.effect(Fx.spawnShockwave, spawn.x * tilesize, spawn.y * tilesize)); //would be interesting to see player structures survive this without hacks - Time.run(40f, () -> Damage.damage(waveTeam, spawn.x * tilesize, spawn.y * tilesize, 350f + Mathf.random(80f), 99999999f)); + Time.run(40f, () -> Damage.damage(waveTeam, spawn.x * tilesize, spawn.y * tilesize, shockwaveBase + Mathf.random(shockwaveRand), 99999999f)); } } } diff --git a/core/src/io/anuke/mindustry/content/Zones.java b/core/src/io/anuke/mindustry/content/Zones.java index 43b3a28d85..3b9325a98a 100644 --- a/core/src/io/anuke/mindustry/content/Zones.java +++ b/core/src/io/anuke/mindustry/content/Zones.java @@ -107,8 +107,8 @@ public class Zones implements ContentList{ }}; }}; - frozenForest = new Zone("frozenForest", new MapGenerator("frozenForest") - .decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.05))){{ + frozenForest = new Zone("frozenForest", new MapGenerator("frozenForest", 2) + .decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.02))){{ alwaysUnlocked = true; deployCost = ItemStack.with(Items.copper, 300); startingItems = ItemStack.with(Items.copper, 200); @@ -119,6 +119,11 @@ public class Zones implements ContentList{ waves = true; waveTimer = true; waveSpacing = 60 * 60 * 2; + spawns = Array.with( + new SpawnGroup(UnitTypes.dagger){{ + unitScaling = 2; + }} + ); }}; }}; diff --git a/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java index a4ad93472f..ff2df1d31b 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java @@ -152,7 +152,7 @@ public class DeployDialog extends FloatingDialog{ } void buildButton(Zone zone, TextButton button){ - button.setDisabled(() -> !canUnlock(zone)); + button.setDisabled(() -> !canUnlock(zone) || !data.hasItems(zone.itemRequirements)); button.clicked(() -> { if(!data.isUnlocked(zone)){ data.removeItems(zone.itemRequirements); diff --git a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java index 08466fbe7e..e7aae6cb0c 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java @@ -154,6 +154,16 @@ public class HudFragment extends Fragment{ t.table("button", top -> top.add("$paused").pad(6f)); }); + parent.fill(t -> { + t.visible(() -> !state.is(State.menu)); + t.table("flat", c -> c.add("$nearpoint") + .update(l -> l.setColor(Tmp.c1.set(Color.WHITE).lerp(Color.SCARLET, Mathf.absin(Time.time(), 10f, 1f)))) + .get().setAlignment(Align.center, Align.center)) + .margin(6).update(u -> { + u.color.a = Mathf.lerpDelta(u.color.a, Mathf.num(world.spawner.playerNear()), 0.1f); + }).get().color.a = 0f; + }); + parent.fill(t -> { t.visible(() -> netServer.isWaitingForPlayers() && !state.is(State.menu)); t.table("button", c -> c.add("$waiting.players")); @@ -199,7 +209,7 @@ public class HudFragment extends Fragment{ }); parent.fill(t -> { - t.top().right(); + t.top().right().visible(() -> !state.is(State.menu)); TextButton button = Elements.newButton("$launch", Call::launchZone); diff --git a/core/src/io/anuke/mindustry/world/blocks/Floor.java b/core/src/io/anuke/mindustry/world/blocks/Floor.java index d6356b01b5..361b9c4c6f 100644 --- a/core/src/io/anuke/mindustry/world/blocks/Floor.java +++ b/core/src/io/anuke/mindustry/world/blocks/Floor.java @@ -113,12 +113,10 @@ public class Floor extends Block{ protected void drawEdges(Tile tile){ eq = 0; - Floor floor = tile.floor(); - for(int i = 0; i < 8; i++){ Point2 point = Geometry.d8[i]; Tile other = tile.getNearby(point); - if(other != null && other.floor().id < floor.id && other.floor().edges != null){ + if(other != null && doEdge(other.floor()) && other.floor().edges != null){ eq |= (1 << i); } } @@ -134,6 +132,14 @@ public class Floor extends Block{ } } + protected boolean doEdge(Floor other){ + return (other.id < id || edges == null) && other.edgeOnto(this); + } + + protected boolean edgeOnto(Floor other){ + return true; + } + int type(int i){ if(!eq(i - 1) && !eq(i + 1)){ //case 0: touching diff --git a/core/src/io/anuke/mindustry/world/blocks/OreBlock.java b/core/src/io/anuke/mindustry/world/blocks/OreBlock.java index 3d64d8509a..d5a1b83cc5 100644 --- a/core/src/io/anuke/mindustry/world/blocks/OreBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/OreBlock.java @@ -32,6 +32,18 @@ public class OreBlock extends Floor{ @Override public void draw(Tile tile){ Draw.rect(variantRegions[Mathf.randomSeed(tile.pos(), 0, Math.max(0, variantRegions.length - 1))], tile.worldx(), tile.worldy()); + + drawEdges(tile); + } + + @Override + public boolean doEdge(Floor floor){ + return floor != base && super.doEdge(floor); + } + + @Override + protected boolean edgeOnto(Floor other){ + return other != base; } public static Block get(Block floor, Item item){