diff --git a/.travis.yml b/.travis.yml index 997046ee8b..2c226bdf10 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,14 +5,15 @@ script: - "./gradlew test" - "./gradlew desktop:dist -Pbuildversion=${TRAVIS_TAG:1}" - "./gradlew server:dist -Pbuildversion=${TRAVIS_TAG:1}" -- git clone --depth=1 --branch=master https://github.com/mindustrygame/wiki ../wiki + git config --global user.name "Wiki Updater" +- git clone --depth=1 --branch=master https://github.com/MindustryGame/wiki ../wiki - git clone --depth=1 --branch=master https://github.com/Anuken/Mindustry-Wiki-Generator ../Mindustry-Wiki-Generator - cd ../Mindustry-Wiki-Generator - "./gradlew run" - cd ../wiki - git add . - git commit -m "Update to match commit ${TRAVIS_COMMIT}" -- git push https://Anuken:${GH_PUSH_TOKEN}@github.com/mindustrygame/wiki +- git push https://Anuken:${GH_PUSH_TOKEN}@github.com/MindustryGame/wiki deploy: provider: releases skip_cleanup: true diff --git a/core/assets/maps/craters.msav b/core/assets/maps/craters.msav index 08435d2896..25102a3944 100644 Binary files a/core/assets/maps/craters.msav and b/core/assets/maps/craters.msav differ diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index 974c262ffc..c969aa4006 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -47,6 +47,8 @@ public class Vars{ public static final Team defaultTeam = Team.blue; /** team of the enemy in waves/sectors */ public static final Team waveTeam = Team.red; + /** whether to enable editing of units in the editor */ + public static final boolean enableUnitEditing = false; /** max chat message length */ public static final int maxTextLength = 150; /** max player name length in bytes */ diff --git a/core/src/io/anuke/mindustry/content/Zones.java b/core/src/io/anuke/mindustry/content/Zones.java index 1f3f4088da..7f5cbaabb9 100644 --- a/core/src/io/anuke/mindustry/content/Zones.java +++ b/core/src/io/anuke/mindustry/content/Zones.java @@ -88,12 +88,12 @@ public class Zones implements ContentList{ resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand}; }}; - craters = new Zone("craters", new MapGenerator("craters", 1).dist(0).decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.011))){{ + craters = new Zone("craters", new MapGenerator("craters", 1).dist(0).decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.004))){{ startingItems = ItemStack.list(Items.copper, 200); conditionWave = 10; zoneRequirements = ZoneRequirement.with(groundZero, 10); blockRequirements = new Block[]{Blocks.router}; - resources = new Item[]{Items.copper, Items.lead, Items.coal}; + resources = new Item[]{Items.copper, Items.lead, Items.coal, Items.sand, Items.scrap}; }}; frozenForest = new Zone("frozenForest", new MapGenerator("frozenForest", 1) diff --git a/core/src/io/anuke/mindustry/core/GameState.java b/core/src/io/anuke/mindustry/core/GameState.java index fcf4d6646c..1e755de6c6 100644 --- a/core/src/io/anuke/mindustry/core/GameState.java +++ b/core/src/io/anuke/mindustry/core/GameState.java @@ -2,6 +2,7 @@ package io.anuke.mindustry.core; import io.anuke.arc.Events; import io.anuke.mindustry.entities.type.BaseUnit; +import io.anuke.mindustry.entities.type.base.BaseDrone; import io.anuke.mindustry.game.EventType.StateChangeEvent; import io.anuke.mindustry.game.*; import io.anuke.mindustry.net.Net; @@ -28,7 +29,7 @@ public class GameState{ private State state = State.menu; public int enemies(){ - return Net.client() ? enemies : unitGroups[waveTeam.ordinal()].size(); + return Net.client() ? enemies : unitGroups[waveTeam.ordinal()].count(b -> !(b instanceof BaseDrone)); } public BaseUnit boss(){ diff --git a/core/src/io/anuke/mindustry/core/Logic.java b/core/src/io/anuke/mindustry/core/Logic.java index 2b8a61e685..b4a2fd9b76 100644 --- a/core/src/io/anuke/mindustry/core/Logic.java +++ b/core/src/io/anuke/mindustry/core/Logic.java @@ -198,7 +198,7 @@ public class Logic implements ApplicationListener{ Entities.update(tileGroup); Entities.update(fireGroup); }else{ - for(EntityGroup group : unitGroups){ + for(EntityGroup group : unitGroups){ group.updateEvents(); collisions.updatePhysics(group); } diff --git a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java index 0392442a86..3a10063236 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java @@ -194,57 +194,60 @@ public class HudFragment extends Fragment{ } }).left(); - t.row(); - t.addImageTextButton("$editor.spawn", "icon-add", 8*3, () -> { - FloatingDialog dialog = new FloatingDialog("$editor.spawn"); - int i = 0; - for(UnitType type : content.getBy(ContentType.unit)){ - dialog.cont.addImageButton("white", 48, () -> { - Call.spawnUnitEditor(player, type); - dialog.hide(); - }).get().getStyle().imageUp = new TextureRegionDrawable(type.iconRegion); - if(++i % 4 == 0) dialog.cont.row(); - } - dialog.addCloseButton(); - dialog.setFillParent(false); - dialog.show(); - }).fillX(); + if(enableUnitEditing){ - float[] size = {0}; - float[] position = {0, 0}; - - t.row(); - t.addImageTextButton("$editor.removeunit", "icon-quit", "toggle", 8*3, () -> { - - }).fillX().update(b -> { - boolean[] found = {false}; - if(b.isChecked()){ - Element e = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true); - if(e == null){ - Vector2 world = Core.input.mouseWorld(); - Units.nearby(world.x, world.y, 1f, 1f, unit -> { - if(!found[0] && unit instanceof BaseUnit){ - if(Core.input.keyTap(KeyCode.MOUSE_LEFT)){ - Call.removeUnitEditor(player, (BaseUnit)unit); - } - found[0] = true; - unit.hitbox(Tmp.r1); - size[0] = Mathf.lerpDelta(size[0], Tmp.r1.width*2f + Mathf.absin(Time.time(), 10f, 5f), 0.1f); - position[0] = unit.x; - position[1] = unit.y; - } - }); + t.row(); + t.addImageTextButton("$editor.spawn", "icon-add", 8 * 3, () -> { + FloatingDialog dialog = new FloatingDialog("$editor.spawn"); + int i = 0; + for(UnitType type : content.getBy(ContentType.unit)){ + dialog.cont.addImageButton("white", 48, () -> { + Call.spawnUnitEditor(player, type); + dialog.hide(); + }).get().getStyle().imageUp = new TextureRegionDrawable(type.iconRegion); + if(++i % 4 == 0) dialog.cont.row(); } - } + dialog.addCloseButton(); + dialog.setFillParent(false); + dialog.show(); + }).fillX(); - Draw.color(Pal.accent, Color.WHITE, Mathf.absin(Time.time(), 8f, 1f)); - Lines.poly(position[0], position[1], 4, size[0]/2f); - Draw.reset(); + float[] size = {0}; + float[] position = {0, 0}; - if(!found[0]){ - size[0] = Mathf.lerpDelta(size[0], 0f, 0.2f); - } - }); + t.row(); + t.addImageTextButton("$editor.removeunit", "icon-quit", "toggle", 8 * 3, () -> { + + }).fillX().update(b -> { + boolean[] found = {false}; + if(b.isChecked()){ + Element e = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true); + if(e == null){ + Vector2 world = Core.input.mouseWorld(); + Units.nearby(world.x, world.y, 1f, 1f, unit -> { + if(!found[0] && unit instanceof BaseUnit){ + if(Core.input.keyTap(KeyCode.MOUSE_LEFT)){ + Call.removeUnitEditor(player, (BaseUnit)unit); + } + found[0] = true; + unit.hitbox(Tmp.r1); + size[0] = Mathf.lerpDelta(size[0], Tmp.r1.width * 2f + Mathf.absin(Time.time(), 10f, 5f), 0.1f); + position[0] = unit.x; + position[1] = unit.y; + } + }); + } + } + + Draw.color(Pal.accent, Color.WHITE, Mathf.absin(Time.time(), 8f, 1f)); + Lines.poly(position[0], position[1], 4, size[0] / 2f); + Draw.reset(); + + if(!found[0]){ + size[0] = Mathf.lerpDelta(size[0], 0f, 0.2f); + } + }); + } }).width(dsize * 4 + 3f); editorMain.visible(() -> shown && state.isEditor()); }