diff --git a/core/assets-raw/sprites/blocks/turrets/fuse.png b/core/assets-raw/sprites/blocks/turrets/fuse.png index d142523a22..39fedd6b51 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/fuse.png and b/core/assets-raw/sprites/blocks/turrets/fuse.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/salvo.png b/core/assets-raw/sprites/blocks/turrets/salvo.png index 2f222833c1..9eb8907646 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/salvo.png and b/core/assets-raw/sprites/blocks/turrets/salvo.png differ diff --git a/core/assets-raw/sprites/blocks/turrets/swarmer.png b/core/assets-raw/sprites/blocks/turrets/swarmer.png index 1672cd8e8e..60aeb73158 100644 Binary files a/core/assets-raw/sprites/blocks/turrets/swarmer.png and b/core/assets-raw/sprites/blocks/turrets/swarmer.png differ diff --git a/core/assets/sprites/block_colors.png b/core/assets/sprites/block_colors.png index abf8ce2704..05681a5253 100644 Binary files a/core/assets/sprites/block_colors.png and b/core/assets/sprites/block_colors.png differ diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index df518b8fdc..402abe2126 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/assets/sprites/sprites2.png b/core/assets/sprites/sprites2.png index 79857b3b36..c5b037536a 100644 Binary files a/core/assets/sprites/sprites2.png and b/core/assets/sprites/sprites2.png differ diff --git a/core/assets/sprites/sprites_fallback2.png b/core/assets/sprites/sprites_fallback2.png index 142dfcffe0..10e9edeb1c 100644 Binary files a/core/assets/sprites/sprites_fallback2.png and b/core/assets/sprites/sprites_fallback2.png differ diff --git a/core/assets/sprites/sprites_fallback3.png b/core/assets/sprites/sprites_fallback3.png index b54e392254..8e41b78855 100644 Binary files a/core/assets/sprites/sprites_fallback3.png and b/core/assets/sprites/sprites_fallback3.png differ diff --git a/core/assets/sprites/sprites_fallback4.png b/core/assets/sprites/sprites_fallback4.png index 94f3c42c50..d7c5716e78 100644 Binary files a/core/assets/sprites/sprites_fallback4.png and b/core/assets/sprites/sprites_fallback4.png differ diff --git a/core/assets/sprites/sprites_fallback5.png b/core/assets/sprites/sprites_fallback5.png index 03046ffb6e..211198b8fa 100644 Binary files a/core/assets/sprites/sprites_fallback5.png and b/core/assets/sprites/sprites_fallback5.png differ diff --git a/core/src/io/anuke/mindustry/content/Blocks.java b/core/src/io/anuke/mindustry/content/Blocks.java index 5cede5b6bf..2677d733ed 100644 --- a/core/src/io/anuke/mindustry/content/Blocks.java +++ b/core/src/io/anuke/mindustry/content/Blocks.java @@ -5,7 +5,11 @@ import io.anuke.arc.function.BooleanProvider; import io.anuke.arc.graphics.Color; import io.anuke.arc.graphics.g2d.*; import io.anuke.arc.math.Mathf; +import io.anuke.arc.util.Tmp; import io.anuke.mindustry.Vars; +import io.anuke.mindustry.entities.Damage; +import io.anuke.mindustry.entities.bullet.Bullet; +import io.anuke.mindustry.entities.bullet.BulletType; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.graphics.*; import io.anuke.mindustry.type.*; @@ -1292,7 +1296,7 @@ public class Blocks implements ContentList{ Items.lead, Bullets.flakLead ); reload = 18f; - range = 175f; + range = 170f; size = 2; burstSpacing = 5f; shots = 2; @@ -1408,11 +1412,11 @@ public class Blocks implements ContentList{ Items.pyratite, Bullets.missileIncendiary, Items.surgealloy, Bullets.missileSurge ); - reload = 50f; + reload = 40f; shots = 4; burstSpacing = 5; inaccuracy = 10f; - range = 140f; + range = 185f; xRand = 6f; size = 2; health = 300 * size * size; @@ -1442,6 +1446,58 @@ public class Blocks implements ContentList{ health = 360; }}; + fuse = new ItemTurret("fuse"){{ + requirements(Category.turret, ItemStack.with(Items.copper, 450, Items.graphite, 450, Items.thorium, 200)); + + reload = 35f; + shootShake = 4f; + range = 95f; + recoil = 5f; + shots = 3; + spread = 20f; + restitution = 0.1f; + shootCone = 30; + size = 3; + + health = 220 * size * size; + + ammo(Items.graphite, new BulletType(0.01f, 105){ + int rays = 1; + float rayLength = range + 10f; + + { + hitEffect = Fx.hitLancer; + shootEffect = smokeEffect = Fx.lightningShoot; + lifetime = 10f; + despawnEffect = Fx.none; + pierce = true; + } + + @Override + public void init(Bullet b){ + for(int i = 0; i < rays; i++){ + Damage.collideLine(b, b.getTeam(), hitEffect, b.x, b.y, b.rot(), rayLength - Math.abs(i - (rays / 2)) * 20f); + } + } + + @Override + public void draw(Bullet b){ + super.draw(b); + Draw.color(Color.WHITE, Pal.lancerLaser, b.fin()); + //Draw.alpha(b.fout()); + for(int i = 0; i < 7; i++){ + Tmp.v1.trns(b.rot(), i * 8f); + float sl = Mathf.clamp(b.fout() - 0.5f) * (80f - i * 10); + Shapes.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, 4f, sl, b.rot() + 90); + Shapes.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, 4f, sl, b.rot() - 90); + } + Shapes.tri(b.x, b.y, 20f * b.fout(), (rayLength + 50), b.rot()); + Shapes.tri(b.x, b.y, 20f * b.fout(), 10f, b.rot() + 180f); + Draw.reset(); + } + }); + }}; + ripple = new ArtilleryTurret("ripple"){{ requirements(Category.turret, ItemStack.with(Items.copper, 300, Items.graphite, 270, Items.titanium, 120)); ammo( @@ -1486,19 +1542,6 @@ public class Blocks implements ContentList{ health = 145 * size * size; }}; - fuse = new ItemTurret("fuse"){{ - requirements(Category.turret, ItemStack.with(Items.copper, 450, Items.graphite, 450, Items.surgealloy, 250)); - ammo(Items.graphite, Bullets.fuseShot); - reload = 40f; - shootShake = 4f; - range = 110f; - recoil = 5f; - restitution = 0.1f; - size = 3; - - health = 165 * size * size; - }}; - spectre = new DoubleTurret("spectre"){{ requirements(Category.turret, ItemStack.with(Items.copper, 700, Items.graphite, 600, Items.surgealloy, 500, Items.plastanium, 350, Items.thorium, 500)); ammo( diff --git a/core/src/io/anuke/mindustry/content/Bullets.java b/core/src/io/anuke/mindustry/content/Bullets.java index c1782c3568..37c84c7898 100644 --- a/core/src/io/anuke/mindustry/content/Bullets.java +++ b/core/src/io/anuke/mindustry/content/Bullets.java @@ -12,7 +12,6 @@ import io.anuke.mindustry.entities.effect.*; import io.anuke.mindustry.entities.type.Unit; import io.anuke.mindustry.game.ContentList; import io.anuke.mindustry.graphics.Pal; -import io.anuke.mindustry.graphics.Shapes; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.BuildBlock; @@ -41,7 +40,7 @@ public class Bullets implements ContentList{ waterShot, cryoShot, slagShot, oilShot, //environment, misc. - fireball, basicFlame, pyraFlame, fuseShot, driverBolt, healBullet, frag, eruptorShot, + fireball, basicFlame, pyraFlame, driverBolt, healBullet, frag, eruptorShot, //bombs bombExplosive, bombIncendiary, bombOil, explode; @@ -142,7 +141,7 @@ public class Bullets implements ContentList{ bulletWidth = 6f; bulletHeight = 8f; hitEffect = Fx.flakExplosion; - splashDamage = 30f; + splashDamage = 27f; splashDamageRadius = 15f; }}; @@ -154,7 +153,7 @@ public class Bullets implements ContentList{ bulletWidth = 6f; bulletHeight = 8f; hitEffect = Fx.flakExplosion; - splashDamage = 24f; + splashDamage = 22f; splashDamageRadius = 24f; }}; @@ -180,7 +179,7 @@ public class Bullets implements ContentList{ shootEffect = Fx.shootBig; }}; - missileExplosive = new MissileBulletType(1.8f, 10, "missile"){{ + missileExplosive = new MissileBulletType(2.7f, 10, "missile"){{ bulletWidth = 8f; bulletHeight = 8f; bulletShrink = 0f; @@ -192,7 +191,7 @@ public class Bullets implements ContentList{ despawnEffect = Fx.blastExplosion; }}; - missileIncendiary = new MissileBulletType(2f, 12, "missile"){{ + missileIncendiary = new MissileBulletType(2.9f, 12, "missile"){{ frontColor = Pal.lightishOrange; backColor = Pal.lightOrange; bulletWidth = 7f; @@ -208,7 +207,7 @@ public class Bullets implements ContentList{ incendAmount = 3; }}; - missileSurge = new MissileBulletType(3.5f, 15, "bullet"){{ + missileSurge = new MissileBulletType(4.4f, 15, "bullet"){{ bulletWidth = 8f; bulletHeight = 8f; bulletShrink = 0f; @@ -577,42 +576,6 @@ public class Bullets implements ContentList{ } }; - fuseShot = new BulletType(0.01f, 70){ - int rays = 3; - float rayLength = 120f; - - { - hitEffect = Fx.hitFuse; - shootEffect = smokeEffect = Fx.none; - lifetime = 10f; - despawnEffect = Fx.none; - pierce = true; - } - - @Override - public void init(Bullet b){ - for(int i = 0; i < rays; i++){ - Damage.collideLine(b, b.getTeam(), hitEffect, b.x, b.y, b.rot(), rayLength - Math.abs(i - (rays / 2)) * 20f); - } - } - - @Override - public void draw(Bullet b){ - super.draw(b); - Draw.color(Color.WHITE, Pal.surge, b.fin()); - //Draw.alpha(b.fout()); - for(int i = 0; i < 7; i++){ - Tmp.v1.trns(b.rot(), i * 8f); - float sl = Mathf.clamp(b.fout() - 0.5f) * (80f - i * 10); - Shapes.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, 4f, sl, b.rot() + 90); - Shapes.tri(b.x + Tmp.v1.x, b.y + Tmp.v1.y, 4f, sl, b.rot() - 90); - } - Shapes.tri(b.x, b.y, 20f * b.fout(), (rayLength + 50), b.rot()); - Shapes.tri(b.x, b.y, 20f * b.fout(), 10f, b.rot() + 180f); - Draw.reset(); - } - }; - waterShot = new LiquidBulletType(Liquids.water){{ knockback = 0.7f; }}; diff --git a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java index fbee21cea9..080374b051 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java @@ -111,6 +111,7 @@ public class HudFragment extends Fragment{ float size = Unit.dp.scl(dsize); Array children = new Array<>(select.getChildren()); + //now, you may be wondering, why is this necessary? the answer is, I don't know, but it fixes layout issues somehow int index = 0; for(Element elem : children){ int fi = index++; @@ -119,7 +120,7 @@ public class HudFragment extends Fragment{ if(fi < 4){ elem.setSize(size); }else{ - elem.setSize(3f, size); + elem.setSize(Unit.dp.scl(3f), size); } elem.setPosition(fi * size, Core.graphics.getHeight(), Align.topLeft); return !state.is(State.menu); @@ -135,7 +136,7 @@ public class HudFragment extends Fragment{ } cont.update(() -> { - if(!Core.input.keyDown(Binding.gridMode) && Core.input.keyTap(Binding.toggle_menus) && !ui.chatfrag.chatOpen()){ + if(!Core.input.keyDown(Binding.gridMode) && Core.input.keyTap(Binding.toggle_menus) && !ui.chatfrag.chatOpen() && !Core.scene.hasDialog() && !(Core.scene.getKeyboardFocus() instanceof TextField)){ toggleMenus(); } }); diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index 76fa59c63d..1c44841832 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -345,7 +345,7 @@ public class Block extends BlockStorage{ cacheRegions[i] = Core.atlas.find(cacheRegionStrings.get(i)); } - if(cracks == null || cracks[0][0].getTexture().isDisposed()){ + if(cracks == null || (cracks[0][0].getTexture() != null && cracks[0][0].getTexture().isDisposed())){ cracks = new TextureRegion[maxCrackSize][crackRegions]; for(int size = 1; size <= maxCrackSize; size++){ for(int i = 0; i < crackRegions; i++){ diff --git a/core/src/io/anuke/mindustry/world/blocks/production/Fracker.java b/core/src/io/anuke/mindustry/world/blocks/production/Fracker.java index a792a1c334..6f0051c999 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/Fracker.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/Fracker.java @@ -39,6 +39,11 @@ public class Fracker extends SolidPump{ @Override public void drawCracks(Tile tile){} + @Override + public boolean canProduce(Tile tile){ + return tile.entity.liquids.get(result) < liquidCapacity; + } + @Override public void draw(Tile tile){ FrackerEntity entity = tile.entity(); diff --git a/core/src/io/anuke/mindustry/world/blocks/production/Separator.java b/core/src/io/anuke/mindustry/world/blocks/production/Separator.java index e29f2fe218..37199f6c61 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/Separator.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/Separator.java @@ -57,7 +57,11 @@ public class Separator extends Block{ })); stats.add(BlockStat.productionTime, craftTime / 60f, StatUnit.seconds); + } + @Override + public boolean canProduce(Tile tile){ + return tile.entity.items.total() < itemCapacity; } @Override