From 122fbbed22b6b5b83b216fb84f5424adb07acf86 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 7 Nov 2018 19:23:40 -0500 Subject: [PATCH] Added a 'tutorial' / Bugfixes --- core/src/io/anuke/mindustry/core/Logic.java | 2 +- .../anuke/mindustry/maps/SectorPresets.java | 6 ++-- core/src/io/anuke/mindustry/maps/Sectors.java | 2 +- .../anuke/mindustry/maps/TutorialSector.java | 31 ++++++++++++++----- core/src/io/anuke/mindustry/world/Tile.java | 3 +- 5 files changed, 30 insertions(+), 14 deletions(-) diff --git a/core/src/io/anuke/mindustry/core/Logic.java b/core/src/io/anuke/mindustry/core/Logic.java index fb1feb196d..4dd94aa2b8 100644 --- a/core/src/io/anuke/mindustry/core/Logic.java +++ b/core/src/io/anuke/mindustry/core/Logic.java @@ -167,7 +167,7 @@ public class Logic extends Module{ if(!state.isPaused()){ Timers.update(); - if(!state.mode.disableWaveTimer && !state.mode.disableWaves){ + if(!state.mode.disableWaveTimer && !state.mode.disableWaves && !state.gameOver){ state.wavetime -= Timers.delta(); } diff --git a/core/src/io/anuke/mindustry/maps/SectorPresets.java b/core/src/io/anuke/mindustry/maps/SectorPresets.java index 24368e333c..29540e1d5b 100644 --- a/core/src/io/anuke/mindustry/maps/SectorPresets.java +++ b/core/src/io/anuke/mindustry/maps/SectorPresets.java @@ -23,10 +23,10 @@ public class SectorPresets{ public SectorPresets(){ - //base tutorial mission (disabled) - /*add(new SectorPreset(0, 0, + //base tutorial mission + add(new SectorPreset(0, 0, TutorialSector.getMissions(), - Array.with(Items.copper, Items.coal, Items.lead)));*/ + Array.with(Items.copper, Items.coal, Items.lead))); //command center mission add(new SectorPreset(0, 1, diff --git a/core/src/io/anuke/mindustry/maps/Sectors.java b/core/src/io/anuke/mindustry/maps/Sectors.java index 140be792ed..1599dd8092 100644 --- a/core/src/io/anuke/mindustry/maps/Sectors.java +++ b/core/src/io/anuke/mindustry/maps/Sectors.java @@ -229,7 +229,7 @@ public class Sectors{ private void generate(Sector sector){ //50% chance to get a wave mission - if(Mathf.randomSeed(sector.getSeed() + 6) < 0.5){ + if(Mathf.randomSeed(sector.getSeed() + 7) < 0.5){ //recipe mission (maybe) addRecipeMission(sector, 3); sector.missions.add(new WaveMission(sector.difficulty*5 + Mathf.randomSeed(sector.getSeed(), 1, 4)*5)); diff --git a/core/src/io/anuke/mindustry/maps/TutorialSector.java b/core/src/io/anuke/mindustry/maps/TutorialSector.java index 81937c9973..ccc75b38db 100644 --- a/core/src/io/anuke/mindustry/maps/TutorialSector.java +++ b/core/src/io/anuke/mindustry/maps/TutorialSector.java @@ -2,12 +2,15 @@ package io.anuke.mindustry.maps; import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.content.Items; -import io.anuke.mindustry.content.UnitTypes; -import io.anuke.mindustry.content.blocks.*; -import io.anuke.mindustry.maps.generation.Generation; -import io.anuke.mindustry.maps.missions.*; +import io.anuke.mindustry.content.blocks.CraftingBlocks; +import io.anuke.mindustry.content.blocks.ProductionBlocks; +import io.anuke.mindustry.content.blocks.StorageBlocks; +import io.anuke.mindustry.content.blocks.UnitBlocks; +import io.anuke.mindustry.maps.missions.BlockMission; +import io.anuke.mindustry.maps.missions.ItemMission; +import io.anuke.mindustry.maps.missions.Mission; +import io.anuke.mindustry.maps.missions.WaveMission; import io.anuke.mindustry.world.Block; -import io.anuke.ucore.util.Bundles; import static io.anuke.mindustry.Vars.*; @@ -16,7 +19,7 @@ public class TutorialSector{ private static int droneIndex; public static Array getMissions(){ - +/* Array missions = Array.with( new ItemMission(Items.copper, 60).setMessage("$tutorial.begin"), @@ -83,9 +86,21 @@ public class TutorialSector{ droneIndex = i; break; } - } + }*/ - return missions; + return Array.with( + //intentionally unlocalized + new ItemMission(Items.copper, 10).setMessage("An updated tutorial will return next build.\nFor now, you'll have to deal with... this."), + + new BlockMission(ProductionBlocks.mechanicalDrill), + + new ItemMission(Items.copper, 100), + new ItemMission(Items.lead, 50), + + new BlockMission(CraftingBlocks.smelter), + new ItemMission(Items.densealloy, 10), + new WaveMission(5) + ); } public static boolean supressDrone(){ diff --git a/core/src/io/anuke/mindustry/world/Tile.java b/core/src/io/anuke/mindustry/world/Tile.java index f3fad923ef..f6ea510048 100644 --- a/core/src/io/anuke/mindustry/world/Tile.java +++ b/core/src/io/anuke/mindustry/world/Tile.java @@ -133,8 +133,9 @@ public class Tile implements PosTrait, TargetTrait{ return wall; } + @Override public Team getTeam(){ - return Team.all[team]; + return Team.all[target().team]; } public void setTeam(Team team){