diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index f88ba0b43d..f7e10f1a67 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -253,7 +253,7 @@ bestwave = [LIGHT_GRAY]Best Wave: {0} launch = < LAUNCH > launch.title = Launch Successful launch.next = [LIGHT_GRAY]next opportunity at wave {0} -launch.unable = [scarlet]Unable to LAUNCH.[] Enemies. +launch.unable = [scarlet]Unable to LAUNCH.[] {0} Enemies. launch.confirm = This will launch all resources in your core.\nYou will not be able to return to this base. uncover = Uncover configure = Configure Loadout diff --git a/core/src/io/anuke/mindustry/content/Fx.java b/core/src/io/anuke/mindustry/content/Fx.java index d920f38b43..6e41397b33 100644 --- a/core/src/io/anuke/mindustry/content/Fx.java +++ b/core/src/io/anuke/mindustry/content/Fx.java @@ -34,7 +34,7 @@ public class Fx implements ContentList{ bigShockwave, nuclearShockwave, explosion, blockExplosion, blockExplosionSmoke, shootSmall, shootHeal, shootSmallSmoke, shootBig, shootBig2, shootBigSmoke, shootBigSmoke2, shootSmallFlame, shootLiquid, shellEjectSmall, shellEjectMedium, shellEjectBig, lancerLaserShoot, lancerLaserShootSmoke, lancerLaserCharge, lancerLaserChargeBegin, lightningCharge, lightningShoot, - launchFull, unitSpawn, spawnShockwave, magmasmoke, impactShockwave, impactcloud, impactsmoke; + unitSpawn, spawnShockwave, magmasmoke, impactShockwave, impactcloud, impactsmoke; @Override public void load(){ @@ -1160,12 +1160,5 @@ public class Fx implements ContentList{ Lines.poly(e.x, e.y, 6, e.rotation + e.fin(), 90); Draw.reset(); }); - - launchFull = new Effect(60, 9999999999f, e -> { - Draw.color(); - Draw.alpha(e.fslope()); - Fill.rect(Core.camera.position.x, Core.camera.position.y, Core.camera.width + 10, Core.camera.height + 10); - Draw.reset(); - }); } } diff --git a/core/src/io/anuke/mindustry/core/Logic.java b/core/src/io/anuke/mindustry/core/Logic.java index 77f0f21cfa..f53b02054d 100644 --- a/core/src/io/anuke/mindustry/core/Logic.java +++ b/core/src/io/anuke/mindustry/core/Logic.java @@ -111,7 +111,9 @@ public class Logic implements ApplicationListener{ @Remote(called = Loc.both) public static void launchZone(){ - Effects.effect(Fx.launchFull, 0, 0); + if(!headless){ + ui.hudfrag.showLaunch(); + } for(Tile tile : new ObjectSetIterator<>(state.teams.get(defaultTeam).cores)){ Effects.effect(Fx.launch, tile); diff --git a/core/src/io/anuke/mindustry/game/Stats.java b/core/src/io/anuke/mindustry/game/Stats.java index 1faedb77af..989f5f741f 100644 --- a/core/src/io/anuke/mindustry/game/Stats.java +++ b/core/src/io/anuke/mindustry/game/Stats.java @@ -33,11 +33,6 @@ public class Stats{ score += (float)((zone.conditionWave - wavesLasted) / zone.launchPeriod + 1) * 1.5f; } - //building more stuff gives a better score slightly - score += (buildingsBuilt - buildingsDeconstructed)*0.001f; - //destroyed buildings penalize score - score -= buildingsDestroyed * 0.003f; - int capacity = zone.generator.coreBlock.itemCapacity; //weigh used fractions of diff --git a/core/src/io/anuke/mindustry/maps/MapTileData.java b/core/src/io/anuke/mindustry/maps/MapTileData.java index 15d6e30506..e7c550e919 100644 --- a/core/src/io/anuke/mindustry/maps/MapTileData.java +++ b/core/src/io/anuke/mindustry/maps/MapTileData.java @@ -11,7 +11,7 @@ import java.nio.ByteBuffer; public class MapTileData{ /** - * Tile size: 4 bytes.
+ * Tile size: 5 bytes.
* 0: ground tile
* 1: wall tile
* 2: rotation + team
diff --git a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java index 0b1580d5b9..a09eee83c7 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java @@ -17,7 +17,10 @@ import io.anuke.arc.scene.ui.layout.Stack; import io.anuke.arc.scene.ui.layout.Table; import io.anuke.arc.scene.ui.layout.Unit; import io.anuke.arc.scene.utils.Elements; -import io.anuke.arc.util.*; +import io.anuke.arc.util.Align; +import io.anuke.arc.util.Scaling; +import io.anuke.arc.util.Time; +import io.anuke.arc.util.Tmp; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.game.EventType.StateChangeEvent; import io.anuke.mindustry.game.Team; @@ -28,9 +31,6 @@ import io.anuke.mindustry.input.Binding; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.net.Packets.AdminAction; import io.anuke.mindustry.ui.IntFormat; -import io.anuke.mindustry.ui.dialogs.FloatingDialog; - -import java.lang.StringBuilder; import static io.anuke.mindustry.Vars.*; @@ -235,7 +235,7 @@ public class HudFragment extends Fragment{ return; } - button.setText(Core.bundle.get(state.enemies() > 0 ? "launch.unable" : "launch") + "\n" + + button.setText(state.enemies() > 0 ? Core.bundle.format("launch.unable", state.enemies()) : Core.bundle.get("launch") + "\n" + Core.bundle.format("launch.next", state.wave + world.getZone().launchPeriod)); button.getLabel().setColor(Tmp.c1.set(Color.WHITE).lerp(state.enemies() > 0 ? Color.WHITE : Pal.accent, @@ -370,14 +370,17 @@ public class HudFragment extends Fragment{ } } - public void showTextDialog(String str){ - new FloatingDialog("$mission.info"){{ - shouldPause = true; - setFillParent(false); - getCell(cont).growX(); - cont.margin(15).add(str).width(400f).wrap().get().setAlignment(Align.left, Align.left); - buttons.addButton("$continue", this::hide).size(140, 60).pad(4); - }}.show(); + public void showLaunch(){ + Image image = new Image("white"); + image.getColor().a = 0f; + image.setFillParent(true); + image.actions(Actions.fadeIn(40f / 60f)); + image.update(() -> { + if(state.is(State.menu)){ + image.remove(); + } + }); + Core.scene.add(image); } private void toggleMenus(){ diff --git a/core/src/io/anuke/mindustry/world/Build.java b/core/src/io/anuke/mindustry/world/Build.java index a5664dae38..cb7785e980 100644 --- a/core/src/io/anuke/mindustry/world/Build.java +++ b/core/src/io/anuke/mindustry/world/Build.java @@ -25,10 +25,15 @@ public class Build{ } Tile tile = world.tile(x, y); + float prevPercent = 1f; //just in case if(tile == null) return; + if(tile.entity != null){ + prevPercent = tile.entity.health(); + } + tile = tile.target(); Block previous = tile.block(); @@ -38,6 +43,7 @@ public class Build{ tile.setBlock(sub); tile.entity().setDeconstruct(previous); tile.setTeam(team); + tile.entity.health = tile.entity.maxHealth() * prevPercent; if(previous.isMultiblock()){ int offsetx = -(previous.size - 1) / 2; diff --git a/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java b/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java index 4b45976bff..2eaba1415a 100644 --- a/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/BuildBlock.java @@ -39,7 +39,7 @@ public class BuildBlock extends Block{ super(name); update = true; size = Integer.parseInt(name.charAt(name.length() - 1) + ""); - health = 10; + health = 20; layer = Layer.placement; consumesTap = true; solidifes = true; diff --git a/core/src/io/anuke/mindustry/world/blocks/power/DifferentialGenerator.java b/core/src/io/anuke/mindustry/world/blocks/power/DifferentialGenerator.java index 2313d1e429..38f20f53db 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/DifferentialGenerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/DifferentialGenerator.java @@ -11,6 +11,7 @@ public class DifferentialGenerator extends TurbineGenerator{ public DifferentialGenerator(String name){ super(name); + hasLiquids = true; consumes.require(ConsumeItem.class); consumes.require(ConsumeLiquid.class); }