diff --git a/core/assets-raw/sprites_replacement/items/item-sand.png b/core/assets-raw/sprites_replacement/items/item-sand.png index ec9c497fd3..0acb132b0d 100644 Binary files a/core/assets-raw/sprites_replacement/items/item-sand.png and b/core/assets-raw/sprites_replacement/items/item-sand.png differ diff --git a/core/assets-raw/sprites_replacement/items/item-thorium.png b/core/assets-raw/sprites_replacement/items/item-thorium.png index 80bd29633c..ebb385b40d 100644 Binary files a/core/assets-raw/sprites_replacement/items/item-thorium.png and b/core/assets-raw/sprites_replacement/items/item-thorium.png differ diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index c57663cc56..a39b2abb29 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -376,6 +376,7 @@ blocks.drillspeed = Base Drill Speed blocks.boosteffect = Boost Effect blocks.maxunits = Max Active Units blocks.health = Health +blocks.buildtime = Build Time blocks.inaccuracy = Inaccuracy blocks.shots = Shots blocks.reload = Shots/Second @@ -447,7 +448,7 @@ setting.sensitivity.name = Controller Sensitivity setting.saveinterval.name = Save Interval setting.seconds = {0} Seconds setting.fullscreen.name = Fullscreen -setting.borderless.name = Borderless Window +setting.borderlesswindow.name = Borderless Window[LIGHT_GRAY] (may require restart) setting.fps.name = Show FPS setting.vsync.name = VSync setting.lasers.name = Show Power Lasers diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 23fb474283..81a49984a7 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/assets/sprites/sprites_fallback4.png b/core/assets/sprites/sprites_fallback4.png index 55ebd4a1e9..8f535d5f0d 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 ce68c0c782..446c926ff3 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 466a3dba3b..fb9465cdd0 100644 --- a/core/src/io/anuke/mindustry/content/Blocks.java +++ b/core/src/io/anuke/mindustry/content/Blocks.java @@ -899,7 +899,7 @@ public class Blocks implements ContentList{ itemBridge = new BufferedItemBridge("bridge-conveyor"){{ requirements(Category.distribution, ItemStack.with(Items.lead, 8, Items.copper, 8)); range = 4; - speed = 60f; + speed = 70f; bufferCapacity = 15; }}; @@ -1104,7 +1104,7 @@ public class Blocks implements ContentList{ size = 4; health = 900; powerProduction = 110f; - itemDuration = 40f; + itemDuration = 60f; consumes.power(25f); consumes.item(Items.blastCompound); consumes.liquid(Liquids.cryofluid, 0.26f); diff --git a/core/src/io/anuke/mindustry/entities/effect/Fire.java b/core/src/io/anuke/mindustry/entities/effect/Fire.java index 18c5c48ebe..fe447c1dcd 100644 --- a/core/src/io/anuke/mindustry/entities/effect/Fire.java +++ b/core/src/io/anuke/mindustry/entities/effect/Fire.java @@ -1,7 +1,5 @@ package io.anuke.mindustry.entities.effect; -import io.anuke.annotations.Annotations.Loc; -import io.anuke.annotations.Annotations.Remote; import io.anuke.arc.collection.IntMap; import io.anuke.arc.math.Mathf; import io.anuke.arc.math.geom.Geometry; @@ -74,11 +72,6 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{ } } - @Remote(called = Loc.server) - public static void onFireRemoved(int fireid){ - fireGroup.removeByID(fireid); - } - @Override public float lifetime(){ return lifetime; @@ -94,18 +87,17 @@ public class Fire extends TimedEntity implements SaveTrait, SyncTrait, Poolable{ Effects.effect(Fx.fireSmoke, x + Mathf.range(4f), y + Mathf.range(4f)); } - if(Net.client()){ - return; - } - time = Mathf.clamp(time + Time.delta(), 0, lifetime()); if(time >= lifetime() || tile == null){ - Call.onFireRemoved(getID()); remove(); return; } + if(Net.client()){ + return; + } + TileEntity entity = tile.target().entity; boolean damage = entity != null; diff --git a/core/src/io/anuke/mindustry/ui/dialogs/SettingsMenuDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/SettingsMenuDialog.java index 9049435f3f..919b4dfe31 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/SettingsMenuDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/SettingsMenuDialog.java @@ -190,10 +190,16 @@ public class SettingsMenuDialog extends SettingsDialog{ } }); + graphics.checkPref("borderlesswindow", false, b -> Core.graphics.setUndecorated(b)); + Core.graphics.setVSync(Core.settings.getBool("vsync")); if(Core.settings.getBool("fullscreen")){ Core.graphics.setFullscreenMode(Core.graphics.getDisplayMode()); } + + if(Core.settings.getBool("borderlesswindow")){ + Core.graphics.setUndecorated(true); + } }else{ graphics.checkPref("landscape", false, b -> { if(b){ diff --git a/core/src/io/anuke/mindustry/world/Block.java b/core/src/io/anuke/mindustry/world/Block.java index f3d37565c4..b3a3d723db 100644 --- a/core/src/io/anuke/mindustry/world/Block.java +++ b/core/src/io/anuke/mindustry/world/Block.java @@ -409,6 +409,7 @@ public class Block extends BlockStorage{ public void setStats(){ stats.add(BlockStat.size, "{0}x{0}", size); stats.add(BlockStat.health, health, StatUnit.none); + stats.add(BlockStat.buildTime, buildCost / 60, StatUnit.seconds); consumes.display(stats); diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/Junction.java b/core/src/io/anuke/mindustry/world/blocks/distribution/Junction.java index cdae6e25e0..569393af18 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/Junction.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/Junction.java @@ -72,7 +72,7 @@ public class Junction extends Block{ if(entity == null || relative == -1 || entity.buffers[relative].full()) return false; Tile to = tile.getNearby(relative); - return to != null; + return to != null && to.target().block().hasItems; } @Override diff --git a/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidJunction.java b/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidJunction.java index 8e57c24777..a160348107 100644 --- a/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidJunction.java +++ b/core/src/io/anuke/mindustry/world/blocks/distribution/LiquidJunction.java @@ -43,8 +43,8 @@ public class LiquidJunction extends LiquidBlock{ dir = (dir + 4) % 4; Tile to = tile.getNearby(dir).target(); - if(to.block().hasLiquids && to.block().acceptLiquid(to, tile, liquid, Math.min(to.block().liquidCapacity - to.entity.liquids.get(liquid) - 0.00001f, amount))){ - to.block().handleLiquid(to, tile, liquid, Math.min(to.block().liquidCapacity - to.entity.liquids.get(liquid) - 0.00001f, amount)); + if(to.block().hasLiquids && to.block().acceptLiquid(to, tile, liquid, amount)){ + to.block().handleLiquid(to, tile, liquid, amount); } } @@ -55,6 +55,6 @@ public class LiquidJunction extends LiquidBlock{ Tile to = dest.getNearby(dir); if(to == null) return false; to = to.target(); - return to != null && to.entity != null && to.block().hasLiquids && to.block().acceptLiquid(to, dest, liquid, Math.min(to.block().liquidCapacity - to.entity.liquids.get(liquid) - 0.00001f, amount)); + return to != null && to.entity != null && to.block().hasLiquids && to.block().acceptLiquid(to, dest, liquid, amount); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/production/Drill.java b/core/src/io/anuke/mindustry/world/blocks/production/Drill.java index 93d9857012..6cce3928d7 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/Drill.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/Drill.java @@ -258,6 +258,10 @@ public class Drill extends Block{ return new DrillEntity(); } + public int tier(){ + return tier; + } + public Item getDrop(Tile tile){ return tile.drop(); } diff --git a/core/src/io/anuke/mindustry/world/blocks/production/GenericCrafter.java b/core/src/io/anuke/mindustry/world/blocks/production/GenericCrafter.java index 7376b0738b..3b1f50544e 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/GenericCrafter.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/GenericCrafter.java @@ -135,6 +135,14 @@ public class GenericCrafter extends Block{ return itemCapacity; } + public Item outputItem(){ + return outputItem == null ? null : outputItem.item; + } + + public Liquid outputLiquid(){ + return outputLiquid == null ? null : outputLiquid.liquid; + } + public static class GenericCrafterEntity extends TileEntity{ public float progress; public float totalProgress; diff --git a/core/src/io/anuke/mindustry/world/blocks/units/UnitFactory.java b/core/src/io/anuke/mindustry/world/blocks/units/UnitFactory.java index afe5e8daaf..bb4075e762 100644 --- a/core/src/io/anuke/mindustry/world/blocks/units/UnitFactory.java +++ b/core/src/io/anuke/mindustry/world/blocks/units/UnitFactory.java @@ -25,11 +25,6 @@ import io.anuke.mindustry.world.meta.*; import java.io.*; public class UnitFactory extends Block{ - //for attack mode - protected float gracePeriodMultiplier = 15f; - protected float speedupTime = 60f * 60f * 20; - protected float maxSpeedup = 2f; - protected UnitType type; protected float produceTime = 1000f; protected float launchVelocity = 0f; @@ -164,26 +159,16 @@ public class UnitFactory extends Block{ entity.warmup += entity.delta(); } - if(!tile.isEnemyCheat()){ - //player-made spawners have default behavior - if(entity.cons.valid()){ - entity.time += entity.delta() * entity.speedScl * Vars.state.rules.unitBuildSpeedMultiplier; - entity.buildTime += entity.delta() * entity.power.satisfaction * Vars.state.rules.unitBuildSpeedMultiplier; - entity.speedScl = Mathf.lerpDelta(entity.speedScl, 1f, 0.05f); - }else{ - entity.speedScl = Mathf.lerpDelta(entity.speedScl, 0f, 0.05f); - } - //check if grace period had passed - }else if(entity.warmup > produceTime * gracePeriodMultiplier){ - float speedMultiplier = Math.min(0.1f + (entity.warmup - produceTime * gracePeriodMultiplier) / speedupTime, maxSpeedup); - entity.time += entity.delta() * entity.speedScl; - //otherwise, it's an enemy, cheat by not requiring resources - entity.buildTime += entity.delta() * speedMultiplier; + //player-made spawners have default behavior + if(entity.cons.valid() || tile.isEnemyCheat()){ + entity.time += entity.delta() * entity.speedScl * Vars.state.rules.unitBuildSpeedMultiplier; + entity.buildTime += entity.delta() * entity.power.satisfaction * Vars.state.rules.unitBuildSpeedMultiplier; entity.speedScl = Mathf.lerpDelta(entity.speedScl, 1f, 0.05f); }else{ entity.speedScl = Mathf.lerpDelta(entity.speedScl, 0f, 0.05f); } + if(entity.buildTime >= produceTime){ entity.buildTime = 0f; diff --git a/core/src/io/anuke/mindustry/world/meta/BlockStat.java b/core/src/io/anuke/mindustry/world/meta/BlockStat.java index 705c19ac3c..364f0cd3c3 100644 --- a/core/src/io/anuke/mindustry/world/meta/BlockStat.java +++ b/core/src/io/anuke/mindustry/world/meta/BlockStat.java @@ -8,6 +8,7 @@ import java.util.Locale; public enum BlockStat{ health(StatCategory.general), size(StatCategory.general), + buildTime(StatCategory.general), itemCapacity(StatCategory.items), itemsMoved(StatCategory.items), diff --git a/core/src/io/anuke/mindustry/world/meta/StatCategory.java b/core/src/io/anuke/mindustry/world/meta/StatCategory.java index 5a498f0a45..fa7944c55f 100644 --- a/core/src/io/anuke/mindustry/world/meta/StatCategory.java +++ b/core/src/io/anuke/mindustry/world/meta/StatCategory.java @@ -1,5 +1,7 @@ package io.anuke.mindustry.world.meta; +import io.anuke.arc.Core; + /** A specific category for a stat. */ public enum StatCategory{ general, @@ -8,5 +10,9 @@ public enum StatCategory{ items, crafting, shooting, - optional, + optional; + + public String localized(){ + return Core.bundle.get("category." + name()); + } }