diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 0f1077b6ad..06d116d4ea 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -48,7 +48,6 @@ text.loadgame=Load Game text.joingame=Join Game text.addplayers=Add/Remove Players text.customgame=Custom Game -text.campaign=Campaign text.sectors=Sectors text.sector=Sector: [LIGHT_GRAY]{0} text.sector.time=Time: [LIGHT_GRAY]{0} diff --git a/core/src/io/anuke/mindustry/content/Recipes.java b/core/src/io/anuke/mindustry/content/Recipes.java index a34b84588d..fc1796bd96 100644 --- a/core/src/io/anuke/mindustry/content/Recipes.java +++ b/core/src/io/anuke/mindustry/content/Recipes.java @@ -132,11 +132,11 @@ public class Recipes implements ContentList{ //new Recipe(units, UpgradeBlocks.deltaFactory, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 30)); //actual unit related stuff - new Recipe(units, UnitBlocks.dronePad, new ItemStack(Items.tungsten, 50), new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 130)); - new Recipe(units, UnitBlocks.fabricatorPad, new ItemStack(Items.carbide, 70), new ItemStack(Items.thorium, 60), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 200)); + new Recipe(units, UnitBlocks.dronePad, new ItemStack(Items.tungsten, 50), new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 90)); + new Recipe(units, UnitBlocks.fabricatorPad, new ItemStack(Items.carbide, 70), new ItemStack(Items.thorium, 60), new ItemStack(Items.lead, 90), new ItemStack(Items.silicon, 200)); new Recipe(units, UnitBlocks.daggerPad, new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 70)); - new Recipe(units, UnitBlocks.titanPad, new ItemStack(Items.thorium, 90), new ItemStack(Items.lead, 140), new ItemStack(Items.silicon, 180)); + new Recipe(units, UnitBlocks.titanPad, new ItemStack(Items.thorium, 90), new ItemStack(Items.lead, 140), new ItemStack(Items.silicon, 100)); new Recipe(units, UnitBlocks.interceptorPad, new ItemStack(Items.titanium, 40), new ItemStack(Items.lead, 80), new ItemStack(Items.silicon, 90)); new Recipe(units, UnitBlocks.monsoonPad, new ItemStack(Items.plastanium, 70), new ItemStack(Items.titanium, 100), new ItemStack(Items.lead, 130), new ItemStack(Items.silicon, 220)); diff --git a/core/src/io/anuke/mindustry/core/World.java b/core/src/io/anuke/mindustry/core/World.java index eb7a69b46c..ba0dfd1cc1 100644 --- a/core/src/io/anuke/mindustry/core/World.java +++ b/core/src/io/anuke/mindustry/core/World.java @@ -220,7 +220,7 @@ public class World extends Module{ public void loadSector(Sector sector){ currentSector = sector; state.mode = sector.missions.peek().getMode(); - state.difficulty = sector.missions.peek().getDifficulty(sector); + state.difficulty = sector.getDifficulty(); Timers.mark(); Timers.mark(); diff --git a/core/src/io/anuke/mindustry/maps/Sector.java b/core/src/io/anuke/mindustry/maps/Sector.java index 65847df630..9fd344d954 100644 --- a/core/src/io/anuke/mindustry/maps/Sector.java +++ b/core/src/io/anuke/mindustry/maps/Sector.java @@ -2,6 +2,7 @@ package io.anuke.mindustry.maps; import com.badlogic.gdx.graphics.Texture; import com.badlogic.gdx.utils.Array; +import io.anuke.mindustry.game.Difficulty; import io.anuke.mindustry.game.Saves.SaveSlot; import io.anuke.mindustry.game.SpawnGroup; import io.anuke.mindustry.maps.missions.Mission; @@ -35,6 +36,19 @@ public class Sector{ /**Items the player starts with on this sector.*/ public transient Array startingItems; + /**Returns scaled difficulty. This is not just the difficulty ordinal.*/ + public Difficulty getDifficulty(){ + if(difficulty == 0){ + return Difficulty.easy; + }else if(difficulty < 4){ + return Difficulty.normal; + }else if(difficulty < 9){ + return Difficulty.hard; + }else{ + return Difficulty.insane; + } + } + public Mission currentMission(){ return missions.get(Math.min(completedMissions, missions.size - 1)); } diff --git a/core/src/io/anuke/mindustry/maps/Sectors.java b/core/src/io/anuke/mindustry/maps/Sectors.java index 9d6d4752f8..0982c20fc4 100644 --- a/core/src/io/anuke/mindustry/maps/Sectors.java +++ b/core/src/io/anuke/mindustry/maps/Sectors.java @@ -149,18 +149,19 @@ public class Sectors{ //add all ores for now since material differences aren't well handled yet sector.ores.addAll(Items.tungsten, Items.coal, Items.lead, Items.thorium, Items.titanium); + //set starter items if(sector.difficulty > 12){ //now with titanium - sector.startingItems = Array.with(new ItemStack(Items.tungsten, 600), new ItemStack(Items.lead, 450), new ItemStack(Items.carbide, 400), new ItemStack(Items.silicon, 250), new ItemStack(Items.titanium, 150)); + sector.startingItems = Array.with(new ItemStack(Items.tungsten, 150), new ItemStack(Items.lead, 460), new ItemStack(Items.carbide, 440), new ItemStack(Items.silicon, 440), new ItemStack(Items.titanium, 200)); }else if(sector.difficulty > 8){ //just more resources - sector.startingItems = Array.with(new ItemStack(Items.tungsten, 450), new ItemStack(Items.lead, 350), new ItemStack(Items.carbide, 250), new ItemStack(Items.silicon, 160)); + sector.startingItems = Array.with(new ItemStack(Items.tungsten, 1200), new ItemStack(Items.lead, 360), new ItemStack(Items.carbide, 280), new ItemStack(Items.silicon, 220)); }else if(sector.difficulty > 5){ //now with silicon - sector.startingItems = Array.with(new ItemStack(Items.tungsten, 350), new ItemStack(Items.lead, 250), new ItemStack(Items.carbide, 150), new ItemStack(Items.silicon, 80)); + sector.startingItems = Array.with(new ItemStack(Items.tungsten, 800), new ItemStack(Items.lead, 260), new ItemStack(Items.carbide, 160), new ItemStack(Items.silicon, 110)); }else if(sector.difficulty > 3){ //now with carbide - sector.startingItems = Array.with(new ItemStack(Items.tungsten, 220), new ItemStack(Items.lead, 160), new ItemStack(Items.carbide, 70)); + sector.startingItems = Array.with(new ItemStack(Items.tungsten, 500), new ItemStack(Items.lead, 170), new ItemStack(Items.carbide, 80)); }else if(sector.difficulty > 1){ //more starter items for faster start - sector.startingItems = Array.with(new ItemStack(Items.tungsten, 170), new ItemStack(Items.lead, 110)); + sector.startingItems = Array.with(new ItemStack(Items.tungsten, 300), new ItemStack(Items.lead, 130)); }else{ //base starting items to prevent grinding much - sector.startingItems = Array.with(new ItemStack(Items.tungsten, 50), new ItemStack(Items.lead, 50)); + sector.startingItems = Array.with(new ItemStack(Items.tungsten, 100), new ItemStack(Items.lead, 50)); } } diff --git a/core/src/io/anuke/mindustry/maps/missions/BattleMission.java b/core/src/io/anuke/mindustry/maps/missions/BattleMission.java index 0cfd895e9b..c6544a5675 100644 --- a/core/src/io/anuke/mindustry/maps/missions/BattleMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/BattleMission.java @@ -3,10 +3,8 @@ package io.anuke.mindustry.maps.missions; import com.badlogic.gdx.math.GridPoint2; import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.game.Difficulty; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.Team; -import io.anuke.mindustry.maps.Sector; import io.anuke.mindustry.maps.generation.FortressGenerator; import io.anuke.mindustry.maps.generation.Generation; import io.anuke.ucore.scene.ui.layout.Table; @@ -14,12 +12,6 @@ import io.anuke.ucore.util.Bundles; public class BattleMission implements Mission{ private final static int coreX = 60, coreY = 60; - - @Override - public Difficulty getDifficulty(Sector sector){ - return Difficulty.normal; - } - @Override public void display(Table table){ table.add("$text.mission.battle"); diff --git a/core/src/io/anuke/mindustry/maps/missions/Mission.java b/core/src/io/anuke/mindustry/maps/missions/Mission.java index 86d0a5887e..5c20056d27 100644 --- a/core/src/io/anuke/mindustry/maps/missions/Mission.java +++ b/core/src/io/anuke/mindustry/maps/missions/Mission.java @@ -3,7 +3,6 @@ package io.anuke.mindustry.maps.missions; import com.badlogic.gdx.math.GridPoint2; import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.content.blocks.StorageBlocks; -import io.anuke.mindustry.game.Difficulty; import io.anuke.mindustry.game.GameMode; import io.anuke.mindustry.game.SpawnGroup; import io.anuke.mindustry.game.Team; @@ -15,7 +14,6 @@ public interface Mission{ boolean isComplete(); String displayString(); GameMode getMode(); - Difficulty getDifficulty(Sector sector); void display(Table table); default Array getWaves(Sector sector){ diff --git a/core/src/io/anuke/mindustry/maps/missions/ResourceMission.java b/core/src/io/anuke/mindustry/maps/missions/ResourceMission.java index ba9197fcf5..b8f6ff7ca8 100644 --- a/core/src/io/anuke/mindustry/maps/missions/ResourceMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/ResourceMission.java @@ -1,9 +1,7 @@ package io.anuke.mindustry.maps.missions; import io.anuke.mindustry.Vars; -import io.anuke.mindustry.game.Difficulty; import io.anuke.mindustry.game.GameMode; -import io.anuke.mindustry.maps.Sector; import io.anuke.mindustry.type.Item; import io.anuke.ucore.scene.ui.layout.Table; import io.anuke.ucore.util.Bundles; @@ -17,11 +15,6 @@ public class ResourceMission implements Mission{ this.amount = amount; } - @Override - public Difficulty getDifficulty(Sector sector){ - return Difficulty.normal; - } - @Override public void display(Table table){ diff --git a/core/src/io/anuke/mindustry/maps/missions/WaveMission.java b/core/src/io/anuke/mindustry/maps/missions/WaveMission.java index 9843f3b01e..8a2441d1f7 100644 --- a/core/src/io/anuke/mindustry/maps/missions/WaveMission.java +++ b/core/src/io/anuke/mindustry/maps/missions/WaveMission.java @@ -17,19 +17,6 @@ public class WaveMission implements Mission{ this.target = target; } - @Override - public Difficulty getDifficulty(Sector sector){ - if(sector.difficulty == 0){ - return Difficulty.easy; - }else if(sector.difficulty < 4){ - return Difficulty.normal; - }else if(sector.difficulty < 9){ - return Difficulty.hard; - }else{ - return Difficulty.insane; - } - } - @Override public Array getWaves(Sector sector){ Array spawns = new Array<>(); diff --git a/core/src/io/anuke/mindustry/ui/dialogs/SectorsDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/SectorsDialog.java index c33cdf4ab6..4dfb5c0965 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/SectorsDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/SectorsDialog.java @@ -41,7 +41,8 @@ public class SectorsDialog extends FloatingDialog{ + (selected.saveID == -1 ? " " + Bundles.get("text.sector.unexplored") : (selected.hasSave() ? " [accent]/[white] " + Bundles.format("text.sector.time", selected.getSave().getPlayTime()) : "")))); content().row(); - content().label(() -> Bundles.format("text.mission", selected == null || selected.completedMissions >= selected.missions.size ? Bundles.get("text.none") : selected.missions.get(selected.completedMissions).displayString())); + content().label(() -> Bundles.format("text.mission", selected == null || selected.completedMissions >= selected.missions.size ? Bundles.get("text.none") : selected.missions.get(selected.completedMissions).displayString()) + + " [WHITE]" + (selected == null ? "" : Bundles.format("text.save.difficulty", "[LIGHT_GRAY]" + selected.getDifficulty().toString()))); content().row(); content().add(new SectorView()).grow(); content().row(); diff --git a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java index 74ca174ba9..0fb7ea9d2e 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java @@ -146,7 +146,7 @@ public class MenuFragment extends Fragment{ dialog.addCloseButton(); dialog.content().defaults().height(66f).width(w).padRight(5f); - dialog.content().add(new MenuButton("icon-play-2", "$text.campaign", () -> { + dialog.content().add(new MenuButton("icon-play-2", "$text.sectors", () -> { dialog.hide(); ui.sectors.show(); })).width(bw).colspan(2);