diff --git a/core/assets-raw/ui/button-map-down.9.png b/core/assets-raw/ui/button-map-down.9.png index b34035f63c..2b8810da55 100644 Binary files a/core/assets-raw/ui/button-map-down.9.png and b/core/assets-raw/ui/button-map-down.9.png differ diff --git a/core/assets-raw/ui/button-map-over.9.png b/core/assets-raw/ui/button-map-over.9.png index 02b2542e97..aae6c254f3 100644 Binary files a/core/assets-raw/ui/button-map-over.9.png and b/core/assets-raw/ui/button-map-over.9.png differ diff --git a/core/assets-raw/ui/button-map.9.png b/core/assets-raw/ui/button-map.9.png index 0162270254..9e899d721e 100644 Binary files a/core/assets-raw/ui/button-map.9.png and b/core/assets-raw/ui/button-map.9.png differ diff --git a/core/assets-raw/ui/button-select.9.png b/core/assets-raw/ui/button-select.9.png index 4d793ce8fe..21fe14ac54 100644 Binary files a/core/assets-raw/ui/button-select.9.png and b/core/assets-raw/ui/button-select.9.png differ diff --git a/core/assets-raw/ui/icon-play.png b/core/assets-raw/ui/icon-play.png new file mode 100644 index 0000000000..7d0cb2d206 Binary files /dev/null and b/core/assets-raw/ui/icon-play.png differ diff --git a/core/assets/ui/uiskin.atlas b/core/assets/ui/uiskin.atlas index 6bebf127aa..5d7a2ea96d 100644 --- a/core/assets/ui/uiskin.atlas +++ b/core/assets/ui/uiskin.atlas @@ -13,7 +13,7 @@ blank index: -1 border rotate: false - xy: 336, 2 + xy: 344, 25 size: 12, 12 split: 4, 4, 4, 4 orig: 12, 12 @@ -35,7 +35,7 @@ border-circle-error index: -1 border-dark-blue rotate: false - xy: 324, 11 + xy: 500, 42 size: 3, 3 split: 1, 1, 1, 1 orig: 3, 3 @@ -43,7 +43,7 @@ border-dark-blue index: -1 border-error rotate: false - xy: 500, 42 + xy: 43, 7 size: 3, 3 split: 1, 1, 1, 1 orig: 3, 3 @@ -59,7 +59,7 @@ border-white index: -1 button rotate: false - xy: 238, 2 + xy: 212, 2 size: 24, 40 split: 10, 10, 6, 10 orig: 24, 40 @@ -128,9 +128,9 @@ button-gray-over index: -1 button-map rotate: false - xy: 238, 44 + xy: 212, 44 size: 24, 40 - split: 10, 10, 8, 8 + split: 10, 10, 5, 10 orig: 24, 40 offset: 0, 0 index: -1 @@ -138,21 +138,21 @@ button-map-down rotate: false xy: 186, 40 size: 24, 40 - split: 10, 10, 8, 8 + split: 10, 10, 5, 10 orig: 24, 40 offset: 0, 0 index: -1 button-map-over rotate: false - xy: 212, 44 + xy: 186, 40 size: 24, 40 - split: 10, 10, 8, 8 + split: 10, 10, 5, 10 orig: 24, 40 offset: 0, 0 index: -1 button-red rotate: false - xy: 264, 44 + xy: 238, 44 size: 24, 40 split: 10, 10, 10, 8 pad: 8, 8, 2, 2 @@ -161,7 +161,7 @@ button-red index: -1 button-select rotate: false - xy: 354, 39 + xy: 330, 39 size: 24, 24 split: 4, 4, 4, 4 orig: 24, 24 @@ -169,7 +169,7 @@ button-select index: -1 button-window-bg rotate: false - xy: 290, 44 + xy: 264, 44 size: 24, 40 split: 10, 10, 10, 8 pad: 8, 8, 2, 2 @@ -178,7 +178,7 @@ button-window-bg index: -1 button-window-over rotate: false - xy: 212, 2 + xy: 290, 44 size: 24, 40 split: 10, 10, 10, 8 pad: 8, 8, 2, 2 @@ -194,14 +194,14 @@ check-off index: -1 check-on rotate: false - xy: 264, 10 + xy: 238, 10 size: 28, 32 orig: 28, 32 offset: 0, 0 index: -1 check-over rotate: false - xy: 294, 10 + xy: 268, 10 size: 28, 32 orig: 28, 32 offset: 0, 0 @@ -222,7 +222,7 @@ color-picker-bar-selector index: -1 color-picker-cross rotate: false - xy: 402, 30 + xy: 332, 11 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -250,14 +250,14 @@ cursor index: -1 cursor-normal rotate: false - xy: 350, 4 + xy: 344, 13 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 default-pane rotate: false - xy: 324, 81 + xy: 382, 44 size: 5, 3 split: 1, 1, 1, 1 orig: 5, 3 @@ -265,7 +265,7 @@ default-pane index: -1 default-pane-no-border rotate: false - xy: 386, 42 + xy: 75, 2 size: 1, 1 split: 0, 0, 0, 0 orig: 1, 1 @@ -281,7 +281,7 @@ default-select index: -1 default-select-selection rotate: false - xy: 324, 76 + xy: 43, 2 size: 3, 3 split: 1, 1, 1, 1 orig: 3, 3 @@ -289,28 +289,28 @@ default-select-selection index: -1 grey rotate: false - xy: 72, 10 + xy: 78, 2 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 menu-bg rotate: false - xy: 72, 10 + xy: 78, 2 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 icon-cancel rotate: false - xy: 324, 16 + xy: 356, 49 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-check rotate: false - xy: 340, 16 + xy: 372, 49 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -338,49 +338,56 @@ icon-close-over index: -1 icon-defense rotate: false - xy: 402, 18 + xy: 358, 37 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-distribution rotate: false - xy: 414, 23 + xy: 358, 25 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-menu rotate: false - xy: 426, 23 + xy: 356, 13 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-pause rotate: false - xy: 414, 11 + xy: 370, 37 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +icon-play + rotate: false + xy: 370, 25 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-production rotate: false - xy: 426, 11 + xy: 368, 13 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 icon-rotate rotate: false - xy: 386, 26 + xy: 328, 23 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 icon-settings rotate: false - xy: 358, 27 + xy: 382, 30 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -424,14 +431,14 @@ pane index: -1 progressbar rotate: false - xy: 380, 31 + xy: 324, 52 size: 1, 32 orig: 1, 32 offset: 0, 0 index: -1 progressbar-filled rotate: false - xy: 383, 31 + xy: 327, 52 size: 1, 32 orig: 1, 32 offset: 0, 0 @@ -445,7 +452,7 @@ progressbar-filled-vertical index: -1 progressbar-vertical rotate: false - xy: 324, 32 + xy: 298, 11 size: 32, 1 orig: 32, 1 offset: 0, 0 @@ -466,7 +473,7 @@ radio-on index: -1 scroll rotate: false - xy: 300, 2 + xy: 274, 2 size: 34, 6 split: 4, 4, 2, 2 orig: 34, 6 @@ -492,7 +499,7 @@ scroll-knob-horizontal index: -1 scroll-knob-vertical rotate: false - xy: 264, 2 + xy: 238, 2 size: 34, 6 split: 12, 12, 2, 2 orig: 34, 6 @@ -500,14 +507,14 @@ scroll-knob-vertical index: -1 select-box-list-bg rotate: false - xy: 414, 39 + xy: 328, 20 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 window-bg rotate: false - xy: 414, 39 + xy: 328, 20 size: 1, 1 orig: 1, 1 offset: 0, 0 @@ -528,35 +535,35 @@ select-up index: -1 selection rotate: false - xy: 354, 36 + xy: 495, 92 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 separator rotate: false - xy: 495, 92 + xy: 505, 44 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 tree-over rotate: false - xy: 495, 92 + xy: 505, 44 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 separator-menu rotate: false - xy: 75, 10 + xy: 508, 44 size: 1, 1 orig: 1, 1 offset: 0, 0 index: -1 slider rotate: false - xy: 386, 55 + xy: 34, 2 size: 1, 8 orig: 1, 8 offset: 0, 0 @@ -613,21 +620,21 @@ splitpane index: -1 splitpane-over rotate: false - xy: 438, 32 + xy: 72, 10 size: 8, 1 orig: 8, 1 offset: 0, 0 index: -1 splitpane-vertical rotate: false - xy: 386, 45 + xy: 37, 2 size: 1, 8 orig: 1, 8 offset: 0, 0 index: -1 splitpane-vertical-over rotate: false - xy: 34, 2 + xy: 40, 2 size: 1, 8 orig: 1, 8 offset: 0, 0 @@ -641,7 +648,7 @@ sub-menu index: -1 textfield rotate: false - xy: 324, 35 + xy: 298, 14 size: 28, 28 split: 6, 6, 6, 6 orig: 28, 28 @@ -657,7 +664,7 @@ textfield-over index: -1 tooltip-bg rotate: false - xy: 438, 27 + xy: 75, 5 size: 3, 3 split: 1, 1, 1, 1 orig: 3, 3 @@ -672,7 +679,7 @@ touchpad-knob index: -1 tree-minus rotate: false - xy: 362, 6 + xy: 394, 30 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -686,7 +693,7 @@ tree-plus index: -1 tree-selection rotate: false - xy: 443, 27 + xy: 382, 25 size: 3, 3 split: 1, 1, 1, 1 orig: 3, 3 @@ -694,7 +701,7 @@ tree-selection index: -1 white rotate: false - xy: 37, 7 + xy: 380, 20 size: 3, 3 orig: 3, 3 offset: 0, 0 @@ -709,7 +716,7 @@ window index: -1 window-border-bg rotate: false - xy: 37, 2 + xy: 406, 37 size: 3, 3 split: 1, 1, 1, 1 orig: 3, 3 diff --git a/core/assets/ui/uiskin.png b/core/assets/ui/uiskin.png index a8a3fc5905..83be1eb604 100644 Binary files a/core/assets/ui/uiskin.png and b/core/assets/ui/uiskin.png differ diff --git a/core/src/io/anuke/mindustry/Control.java b/core/src/io/anuke/mindustry/Control.java index 77ad2c7df2..902be9be7f 100644 --- a/core/src/io/anuke/mindustry/Control.java +++ b/core/src/io/anuke/mindustry/Control.java @@ -41,6 +41,7 @@ public class Control extends Module{ Array spawns = new Array<>(); int wave = 1; float wavetime; + float extrawavetime; int enemies = 0; float respawntime; @@ -79,7 +80,8 @@ public class Control extends Module{ "down", Keys.S, "right", Keys.D, "rotate", Keys.R, - "menu", Gdx.app.getType() == ApplicationType.Android ? Keys.BACK : Keys.ESCAPE + "menu", Gdx.app.getType() == ApplicationType.Android ? Keys.BACK : Keys.ESCAPE, + "pause", Keys.SPACE ); Settings.loadAll("io.anuke.moment"); @@ -127,6 +129,7 @@ public class Control extends Module{ ); + //TODO remove this debugging for(int i = 1; i < 60; i ++){ UCore.log("\n\n--WAVE " + i); printEnemies(i); @@ -143,6 +146,7 @@ public class Control extends Module{ player.weapon = weapons.first(); wave = 1; + extrawavetime = maxwavespace; wavetime = waveSpacing(); Entities.clear(); enemies = 0; @@ -196,6 +200,7 @@ public class Control extends Module{ this.wave = wave; this.wavetime = wavetime; this.enemies = enemies; + this.extrawavetime = maxwavespace; } void runWave(){ @@ -241,6 +246,7 @@ public class Control extends Module{ } wavetime = waveSpacing(); + extrawavetime = maxwavespace; } void printEnemies(int wave){ @@ -320,10 +326,6 @@ public class Control extends Module{ public void update(){ if(debug){ - - if(Inputs.keyUp(Keys.SPACE)) - Effects.sound("shoot", World.core.worldx(), World.core.worldy()); - if(Inputs.keyUp(Keys.O)){ Timers.mark(); SaveIO.write(Gdx.files.local("mapsave.mins")); @@ -339,23 +341,23 @@ public class Control extends Module{ if(Inputs.keyUp(Keys.C)){ for(Entity entity : Entities.all()){ - if(entity instanceof Enemy) + if(entity instanceof Enemy){ entity.remove(); + } } } - if(Inputs.keyDown(Keys.SPACE)){ - Effects.shake(6, 4, Graphics.mouseWorld().x, Graphics.mouseWorld().y); - } - if(Inputs.keyDown(Keys.Y)){ new TestEnemy(0).set(player.x, player.y).add(); } } - if(!GameState.is(State.menu)){ + if(Inputs.keyUp("pause") && (GameState.is(State.paused) || GameState.is(State.playing))){ + GameState.set(GameState.is(State.playing) ? State.paused : State.playing); + } + if(Inputs.keyUp("menu")){ if(GameState.is(State.paused)){ ui.hideMenu(); @@ -381,21 +383,23 @@ public class Control extends Module{ } } + extrawavetime -= delta(); + if(enemies <= 0){ wavetime -= delta(); } - if(wavetime <= 0 || (debug && Inputs.keyUp(Keys.F))){ + if(wavetime <= 0 || (debug && Inputs.keyUp(Keys.F)) || extrawavetime <= 0){ runWave(); } Entities.update(); - - if(!android){ - Input.doInput(); - }else{ - AndroidInput.doInput(); - } + } + + if(!android){ + Input.doInput(); + }else{ + AndroidInput.doInput(); } } } diff --git a/core/src/io/anuke/mindustry/EffectLoader.java b/core/src/io/anuke/mindustry/EffectLoader.java index 54a1f3381e..a9d41e5e53 100644 --- a/core/src/io/anuke/mindustry/EffectLoader.java +++ b/core/src/io/anuke/mindustry/EffectLoader.java @@ -145,6 +145,13 @@ public class EffectLoader{ Draw.reset(); }); + Effects.create("railsmoke", 30, e -> { + Draw.color(Color.LIGHT_GRAY, Color.WHITE, e.ifract()); + float size = e.fract()*4f; + Draw.rect("circle", e.x, e.y, size, size); + Draw.reset(); + }); + Effects.create("spawn", 23, e -> { Draw.thickness(2f); Draw.color(Hue.mix(Color.DARK_GRAY, Color.SCARLET, e.ifract())); diff --git a/core/src/io/anuke/mindustry/Mindustry.java b/core/src/io/anuke/mindustry/Mindustry.java index 06b1eda379..c98842a851 100644 --- a/core/src/io/anuke/mindustry/Mindustry.java +++ b/core/src/io/anuke/mindustry/Mindustry.java @@ -32,8 +32,9 @@ public class Mindustry extends ModuleCore { } if(!GameState.is(State.paused)){ - Inputs.update(); Timers.update(); } + + Inputs.update(); } } diff --git a/core/src/io/anuke/mindustry/UI.java b/core/src/io/anuke/mindustry/UI.java index 38ddc06645..2230735bc2 100644 --- a/core/src/io/anuke/mindustry/UI.java +++ b/core/src/io/anuke/mindustry/UI.java @@ -26,6 +26,7 @@ import io.anuke.ucore.modules.SceneModule; import io.anuke.ucore.scene.actions.Actions; import io.anuke.ucore.scene.builders.*; import io.anuke.ucore.scene.ui.*; +import io.anuke.ucore.scene.ui.Window.WindowStyle; import io.anuke.ucore.scene.ui.layout.*; import io.anuke.ucore.util.Mathf; @@ -112,6 +113,7 @@ public class UI extends SceneModule{ levels = new LevelDialog(); prefs = new SettingsDialog(); + prefs.setStyle(Core.skin.get("dialog", WindowStyle.class)); menu = new MenuDialog(); @@ -125,6 +127,15 @@ public class UI extends SceneModule{ prefs.checkPref("tutorial", "Show tutorial Window", true); prefs.checkPref("fps", "Show FPS", false); prefs.checkPref("noshadows", "Disable shadows", false); + + prefs.hidden(()->{ + GameState.set(State.playing); + }); + + prefs.shown(()->{ + GameState.set(State.paused); + menu.hide(); + }); keys = new KeybindDialog(); @@ -216,7 +227,9 @@ public class UI extends SceneModule{ ImageButton image = new ImageButton(Draw.region(r.result.name()), "select"); image.clicked(()->{ - if(Inventory.hasItems(r.requirements)){ + if(player.recipe == r){ + player.recipe = null; + }else{ player.recipe = r; updateRecipe(); } @@ -228,8 +241,8 @@ public class UI extends SceneModule{ image.update(()->{ boolean has = Inventory.hasItems(r.requirements); - image.setDisabled(!has); - image.setChecked(player.recipe == r && has); + //image.setDisabled(!has); + image.setChecked(player.recipe == r); //image.setTouchable(has ? Touchable.enabled : Touchable.disabled); image.getImage().setColor(has ? Color.WHITE : Color.GRAY); }); @@ -283,16 +296,23 @@ public class UI extends SceneModule{ float isize = Unit.dp.inPixels(40); new imagebutton("icon-menu", isize, ()->{ + GameState.set(State.paused); showMenu(); }); new imagebutton("icon-settings", isize, ()->{ + GameState.set(State.paused); prefs.show(); }); new imagebutton("icon-pause", isize, ()->{ //TODO pause - }); + GameState.set(GameState.is(State.paused) ? State.playing : State.paused); + }){{ + get().update(()->{ + get().getStyle().imageUp = Core.skin.getDrawable(GameState.is(State.paused) ? "icon-play" : "icon-pause"); + }); + }}; }}.end(); row(); @@ -306,6 +326,16 @@ public class UI extends SceneModule{ add(fps).size(-1); }}.end(); + + //paused table + new table(){{ + visible(()->GameState.is(State.paused)); + atop(); + + new table("pane"){{ + new label("[orange]< paused >").scale(0.75f).pad(6); + }}.end(); + }}.end(); //wave table... new table(){{ @@ -431,7 +461,7 @@ public class UI extends SceneModule{ scene.add(tools); tools.setVisible(()->{ - return !GameState.is(State.menu) && android && player.recipe != null; + return !GameState.is(State.menu) && android && player.recipe != null && Inventory.hasItems(player.recipe.requirements); }); tools.update(()->{ @@ -488,7 +518,7 @@ public class UI extends SceneModule{ reqlabel.setText(text); }); - requirements.add(reqlabel); + requirements.add(reqlabel).left(); requirements.row(); } @@ -512,7 +542,7 @@ public class UI extends SceneModule{ if(weapon != player.weapon) button.setColor(Color.GRAY); - weapontable.add(button).size(48, 52); + weapontable.add(button).size(52, 56); Table tiptable = new Table(); String description = weapon.description; @@ -532,6 +562,10 @@ public class UI extends SceneModule{ button.addListener(tip); } + + weapontable.addIButton("icon-menu", 8*3, ()->{ + upgrades.show(); + }).size(52, 56); } public void showLoading(){ diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index 64154783d6..7fad0ae946 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -15,6 +15,8 @@ public class Vars{ public static final float respawnduration = 60*4; //time between waves in frames public static final float wavespace = 35*60*(android ? 2 : 1); + //waves can last no longer than 6 minutes, otherwise the next one spawns + public static final float maxwavespace = 60*60*6; //how far away from spawn points the player can't place blocks public static final float enemyspawnspace = 65; //scale of the font diff --git a/core/src/io/anuke/mindustry/entities/BulletType.java b/core/src/io/anuke/mindustry/entities/BulletType.java index 396eb8531a..40ddf23f25 100644 --- a/core/src/io/anuke/mindustry/entities/BulletType.java +++ b/core/src/io/anuke/mindustry/entities/BulletType.java @@ -34,9 +34,16 @@ public abstract class BulletType extends BaseBulletType{ sniper = new BulletType(3f, 20){ public void draw(Bullet b){ Draw.color(Color.LIGHT_GRAY); - Draw.rect("bullet", b.x, b.y, b.angle()); + Draw.thick(1f); + Draw.lineAngleCenter(b.x, b.y, b.angle(), 3f); Draw.reset(); } + + public void update(Bullet b){ + if(Timers.get(b, "smoke", 4)){ + Effects.effect("railsmoke", b.x, b.y); + } + } }, shell = new BulletType(1.1f, 80){ { diff --git a/core/src/io/anuke/mindustry/input/AndroidInput.java b/core/src/io/anuke/mindustry/input/AndroidInput.java index 474fb0bb77..15e5fce27a 100644 --- a/core/src/io/anuke/mindustry/input/AndroidInput.java +++ b/core/src/io/anuke/mindustry/input/AndroidInput.java @@ -14,7 +14,6 @@ import io.anuke.mindustry.world.World; import io.anuke.mindustry.world.blocks.Blocks; import io.anuke.mindustry.world.blocks.ProductionBlocks; import io.anuke.ucore.core.*; -import io.anuke.ucore.scene.utils.Cursors; import io.anuke.ucore.util.Mathf; public class AndroidInput extends InputAdapter{ @@ -87,11 +86,6 @@ public class AndroidInput extends InputAdapter{ for(ItemStack stack : player.recipe.requirements){ Inventory.removeItem(stack); } - - if(!Inventory.hasItems(player.recipe.requirements)){ - player.recipe = null; - Cursors.restoreCursor(); - } } } diff --git a/core/src/io/anuke/mindustry/input/GestureHandler.java b/core/src/io/anuke/mindustry/input/GestureHandler.java index b2a1bba83f..22e2af2dd7 100644 --- a/core/src/io/anuke/mindustry/input/GestureHandler.java +++ b/core/src/io/anuke/mindustry/input/GestureHandler.java @@ -6,6 +6,9 @@ import com.badlogic.gdx.Gdx; import com.badlogic.gdx.input.GestureDetector.GestureAdapter; import com.badlogic.gdx.math.Vector2; +import io.anuke.mindustry.GameState; +import io.anuke.mindustry.GameState.State; +import io.anuke.mindustry.Inventory; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.World; import io.anuke.mindustry.world.blocks.Blocks; @@ -22,7 +25,7 @@ public class GestureHandler extends GestureAdapter{ public boolean longPress(float x, float y){ Tile tile = World.cursorTile(); player.breaktime += Timers.delta(); - if(player.breaktime >= tile.block().breaktime){ + if(!GameState.is(State.menu) && player.breaktime >= tile.block().breaktime){ Effects.effect("break", tile.worldx(), tile.worldy()); Effects.shake(3f, 1f); tile.setBlock(Blocks.air); @@ -34,7 +37,7 @@ public class GestureHandler extends GestureAdapter{ @Override public boolean pan(float x, float y, float deltaX, float deltaY){ - if(player.recipe == null){ + if(player.recipe == null || !Inventory.hasItems(player.recipe.requirements)){ player.x -= deltaX*Core.camera.zoom/Core.cameraScale; player.y += deltaY*Core.camera.zoom/Core.cameraScale; }else{ diff --git a/core/src/io/anuke/mindustry/input/Input.java b/core/src/io/anuke/mindustry/input/Input.java index c208e734e6..255f267cd3 100644 --- a/core/src/io/anuke/mindustry/input/Input.java +++ b/core/src/io/anuke/mindustry/input/Input.java @@ -42,11 +42,12 @@ public class Input{ //TODO restore cursor when requirements are back - for(int i = 0; i < 9; i ++) + for(int i = 0; i < 9; i ++){ if(Inputs.keyUp(Keys.valueOf(""+(i+1))) && i < control.getWeapons().size){ player.weapon = control.getWeapons().get(i); ui.updateWeapons(); } + } if(Inputs.buttonUp(Buttons.LEFT) && player.recipe != null && World.validPlace(World.tilex(), World.tiley(), player.recipe.result) && !ui.hasMouse() && diff --git a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java index 203d11f4cf..e2cce7aca2 100644 --- a/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/ProductionBlocks.java @@ -119,6 +119,7 @@ public class ProductionBlocks{ input = Item.stone; inputLiquid = Liquid.water; output = Item.coal; + health = 50; } @Override @@ -137,6 +138,7 @@ public class ProductionBlocks{ liquidCapacity = 41f; purifyTime = 90; output = Item.titanium; + health = 70; } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java b/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java index b94fea9a15..23286e2abc 100644 --- a/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java +++ b/core/src/io/anuke/mindustry/world/blocks/WeaponBlocks.java @@ -113,7 +113,8 @@ public class WeaponBlocks{ range = 120; reload = 120f; bullet = BulletType.shell; - ammo = Item.stone; + ammo = Item.coal; + ammoMultiplier = 5; health = 110; } }, @@ -128,7 +129,7 @@ public class WeaponBlocks{ range = 60; reload = 4f; damage = 9; - ammo = Item.stone; + ammo = Item.coal; health = 110; } }, @@ -140,7 +141,7 @@ public class WeaponBlocks{ range = 70; reload = 20f; bullet = BulletType.shell; - ammo = Item.stone; + ammo = Item.coal; health = 140; } @@ -162,8 +163,9 @@ public class WeaponBlocks{ range = 60f; reload = 3f; bullet = BulletType.plasmaflame; - ammo = Item.stone; + ammo = Item.coal; health = 180; + ammoMultiplier = 40; } }, diff --git a/core/src/io/anuke/mindustry/world/blocks/types/Drill.java b/core/src/io/anuke/mindustry/world/blocks/types/Drill.java index beab1b726c..54d0374b91 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/Drill.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/Drill.java @@ -39,7 +39,6 @@ public class Drill extends Block{ @Override public void drawOver(Tile tile){ - if(tile.floor() != resource && resource != null){ Draw.colorl(0.85f + Mathf.absin(Timers.time(), 6f, 0.15f)); Draw.rect("cross", tile.worldx(), tile.worldy());