diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 5afd856959..80082b37d4 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -287,7 +287,8 @@ donate = Donate abandon = Abandon abandon.text = This zone and all its resources will be lost to the enemy. locked = Locked -complete = [LIGHT_GRAY]Complete: +complete = [LIGHT_GRAY]Reach: +zone.requirement = Wave {0} in zone {1} resume = Resume Zone:\n[LIGHT_GRAY]{0} bestwave = [LIGHT_GRAY]Best Wave: {0} launch = < LAUNCH > diff --git a/core/assets/shaders/water.fragment b/core/assets/shaders/water.fragment index 83910bbe5f..bd3e2103e6 100644 --- a/core/assets/shaders/water.fragment +++ b/core/assets/shaders/water.fragment @@ -61,14 +61,14 @@ void main() { float n2 = snoise((coords + vec2(632.0)) / 25.0 + vec2(0.0, -time) / 190.0); float r = (n1 + n2) * 3.0; + float tester = mod(float(int(coords.x + coords.y*1.1 + sin(stime / 8.0 + coords.x/5.0 - coords.y/100.0)*2.0)) + + sin(stime / 20.0 + coords.y/3.0) * 1.0 + + sin(stime / 10.0 + coords.y/2.0) * 2.0 + + sin(stime / 7.0 + coords.y/1.0) * 0.5 + + sin(coords.x + coords.y) + + sin(stime / 20.0 + coords.x/4.0) * 1.0, mscl) + r; - if(mod(float(int(coords.x + coords.y*1.1 + sin(stime / 8.0 + coords.x/5.0 - coords.y/100.0)*2.0)) + - sin(stime / 20.0 + coords.y/3.0) * 1.0 + - sin(stime / 10.0 + coords.y/2.0) * 2.0 + - sin(stime / 7.0 + coords.y/1.0) * 0.5 + - sin(coords.x + coords.y) + - sin(stime / 20.0 + coords.x/4.0) * 1.0, mscl) + r < mth){ - + if(tester < mth){ color *= 1.2; color.a = 1.0; } diff --git a/core/src/io/anuke/mindustry/content/Blocks.java b/core/src/io/anuke/mindustry/content/Blocks.java index 8e3cb76916..07c038ad4c 100644 --- a/core/src/io/anuke/mindustry/content/Blocks.java +++ b/core/src/io/anuke/mindustry/content/Blocks.java @@ -199,6 +199,21 @@ public class Blocks implements ContentList{ blendGroup = stone; }}; + ignarock = new Floor("ignarock"){{ + + }}; + + hotrock = new Floor("hotrock"){{ + attributes.set(Attribute.heat, 0.5f); + blendGroup = ignarock; + }}; + + magmarock = new Floor("magmarock"){{ + attributes.set(Attribute.heat, 0.75f); + updateEffect = Fx.magmasmoke; + blendGroup = ignarock; + }}; + sand = new Floor("sand"){{ itemDrop = Items.sand; playerUnmineable = true; @@ -338,21 +353,6 @@ public class Blocks implements ContentList{ variants = 0; }}; - ignarock = new Floor("ignarock"){{ - blendGroup = darksand; - }}; - - hotrock = new Floor("hotrock"){{ - attributes.set(Attribute.heat, 0.5f); - blendGroup = ignarock; - }}; - - magmarock = new Floor("magmarock"){{ - attributes.set(Attribute.heat, 0.75f); - updateEffect = Fx.magmasmoke; - blendGroup = ignarock; - }}; - //endregion //region ore @@ -1234,13 +1234,13 @@ public class Blocks implements ContentList{ arc = new PowerTurret("arc"){{ requirements(Category.turret, ItemStack.with(Items.copper, 70, Items.lead, 70)); shootType = Bullets.arc; - reload = 25f; + reload = 24f; shootCone = 40f; rotatespeed = 8f; powerUsed = 1f / 2f; targetAir = false; - consumes.powerBuffered(80f); - range = 80f; + consumes.powerBuffered(60f, 60f); + range = 95f; shootEffect = Fx.lightningShoot; heatColor = Color.RED; recoil = 1f; diff --git a/core/src/io/anuke/mindustry/content/Bullets.java b/core/src/io/anuke/mindustry/content/Bullets.java index bd07773687..8bf7b52939 100644 --- a/core/src/io/anuke/mindustry/content/Bullets.java +++ b/core/src/io/anuke/mindustry/content/Bullets.java @@ -664,7 +664,7 @@ public class Bullets implements ContentList{ } }; - arc = new BulletType(0.001f, 21){{ + arc = new BulletType(0.001f, 25){{ lifetime = 1; despawnEffect = Fx.none; hitEffect = Fx.hitLancer; @@ -675,7 +675,7 @@ public class Bullets implements ContentList{ @Override public void init(Bullet b){ - Lightning.create(b.getTeam(), Pal.lancerLaser, damage, b.x, b.y, b.rot(), 15); + Lightning.create(b.getTeam(), Pal.lancerLaser, damage, b.x, b.y, b.rot(), 25); } }; diff --git a/core/src/io/anuke/mindustry/content/Zones.java b/core/src/io/anuke/mindustry/content/Zones.java index 6ec9968c15..0e6f2466b6 100644 --- a/core/src/io/anuke/mindustry/content/Zones.java +++ b/core/src/io/anuke/mindustry/content/Zones.java @@ -33,8 +33,7 @@ public class Zones implements ContentList{ craters = new Zone("craters", new MapGenerator("craters", 1).dist(0).decor(new Decoration(Blocks.snow, Blocks.sporeCluster, 0.01))){{ startingItems = ItemStack.list(Items.copper, 200); conditionWave = 10; - itemRequirements = ItemStack.with(Items.copper, 2000); - zoneRequirements = new Zone[]{groundZero}; + zoneRequirements = ZoneRequirement.with(groundZero, 10); blockRequirements = new Block[]{Blocks.router}; resources = new Item[]{Items.copper, Items.lead}; rules = () -> new Rules(){{ @@ -50,8 +49,7 @@ public class Zones implements ContentList{ baseLaunchCost = ItemStack.with(); startingItems = ItemStack.list(Items.copper, 400); conditionWave = 10; - zoneRequirements = new Zone[]{craters}; - itemRequirements = ItemStack.with(Items.copper, 4000, Items.lead, 2000); + zoneRequirements = ZoneRequirement.with(craters, 10); resources = new Item[]{Items.copper, Items.lead, Items.coal}; rules = () -> new Rules(){{ waves = true; @@ -66,8 +64,7 @@ public class Zones implements ContentList{ startingItems = ItemStack.list(Items.copper, 400); conditionWave = 20; launchPeriod = 20; - zoneRequirements = new Zone[]{frozenForest}; - itemRequirements = ItemStack.with(Items.lead, 6000, Items.graphite, 2000); + zoneRequirements = ZoneRequirement.with(frozenForest, 10, craters, 15); blockRequirements = new Block[]{Blocks.graphitePress, Blocks.combustionGenerator}; resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.sand}; rules = () -> new Rules(){{ @@ -99,9 +96,8 @@ public class Zones implements ContentList{ startingItems = ItemStack.list(Items.copper, 400, Items.lead, 100); conditionWave = 10; launchPeriod = 10; - zoneRequirements = new Zone[]{frozenForest}; + zoneRequirements = ZoneRequirement.with(frozenForest, 15); blockRequirements = new Block[]{Blocks.pneumaticDrill}; - itemRequirements = ItemStack.with(Items.copper, 8000, Items.silicon, 2000); resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium}; rules = () -> new Rules(){{ waves = true; @@ -114,10 +110,9 @@ public class Zones implements ContentList{ loadout = Loadouts.basicNucleus; baseLaunchCost = ItemStack.with(); startingItems = ItemStack.list(Items.copper, 1500); - itemRequirements = ItemStack.with(Items.copper, 8000, Items.metaglass, 2000, Items.graphite, 3000); conditionWave = 10; launchPeriod = 20; - zoneRequirements = new Zone[]{ruinousShores}; + zoneRequirements = ZoneRequirement.with(stainedMountains, 20); blockRequirements = new Block[]{Blocks.thermalGenerator}; resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.sand}; rules = () -> new Rules(){{ @@ -133,10 +128,9 @@ public class Zones implements ContentList{ loadout = Loadouts.basicNucleus; baseLaunchCost = ItemStack.with(); startingItems = ItemStack.list(Items.copper, 2500, Items.lead, 3000, Items.silicon, 800, Items.metaglass, 400); - itemRequirements = ItemStack.with(Items.copper, 10000, Items.titanium, 8000, Items.metaglass, 6000, Items.plastanium, 2000); conditionWave = 30; launchPeriod = 15; - zoneRequirements = new Zone[]{desolateRift}; + zoneRequirements = ZoneRequirement.with(desolateRift, 20); blockRequirements = new Block[]{Blocks.thermalGenerator}; resources = new Item[]{Items.copper, Items.scrap, Items.lead, Items.coal, Items.titanium, Items.thorium, Items.sand}; rules = () -> new Rules(){{ diff --git a/core/src/io/anuke/mindustry/core/Renderer.java b/core/src/io/anuke/mindustry/core/Renderer.java index 0f2f32e57b..1e7fbad2d1 100644 --- a/core/src/io/anuke/mindustry/core/Renderer.java +++ b/core/src/io/anuke/mindustry/core/Renderer.java @@ -169,6 +169,7 @@ public class Renderer implements ApplicationListener{ blocks.processBlocks(); blocks.drawShadows(); + Draw.color(); blocks.floor.beginDraw(); blocks.floor.drawLayer(CacheLayer.walls); diff --git a/core/src/io/anuke/mindustry/input/MobileInput.java b/core/src/io/anuke/mindustry/input/MobileInput.java index 42d4868e05..d3a65ac531 100644 --- a/core/src/io/anuke/mindustry/input/MobileInput.java +++ b/core/src/io/anuke/mindustry/input/MobileInput.java @@ -491,6 +491,11 @@ public class MobileInput extends InputHandler implements GestureListener{ if(mode == placing && isPlacing()){ iterateLine(lineStartX, lineStartY, tileX, tileY, l -> { + Tile tile = world.tile(l.x, l.y); + if(tile != null && hasRequest(tile)){ + return; + } + PlaceRequest request = new PlaceRequest(l.x, l.y, block, l.rotation); request.scale = 1f; selection.add(request); diff --git a/core/src/io/anuke/mindustry/type/Zone.java b/core/src/io/anuke/mindustry/type/Zone.java index b6e88a7574..24f2951edf 100644 --- a/core/src/io/anuke/mindustry/type/Zone.java +++ b/core/src/io/anuke/mindustry/type/Zone.java @@ -9,7 +9,6 @@ import io.anuke.arc.graphics.g2d.TextureRegion; import io.anuke.arc.scene.ui.layout.Table; import io.anuke.mindustry.content.Loadouts; import io.anuke.mindustry.game.EventType.ZoneCompleteEvent; -import io.anuke.mindustry.game.EventType.ZoneConfigureCompleteEvent; import io.anuke.mindustry.game.Rules; import io.anuke.mindustry.game.UnlockableContent; import io.anuke.mindustry.maps.generators.Generator; @@ -24,8 +23,8 @@ import static io.anuke.mindustry.Vars.state; public class Zone extends UnlockableContent{ public final Generator generator; public Block[] blockRequirements = {}; - public ItemStack[] itemRequirements = {}; - public Zone[] zoneRequirements = {}; + public ZoneRequirement[] zoneRequirements = {}; + //TODO debug verify resources. public Item[] resources = {}; public Supplier rules = Rules::new; public boolean alwaysUnlocked; @@ -73,7 +72,7 @@ public class Zone extends UnlockableContent{ } if(wave == configureWave + 1){ - Events.fire(new ZoneConfigureCompleteEvent(this)); + // Events.fire(new ZoneConfigureCompleteEvent(this)); } } } @@ -159,4 +158,22 @@ public class Zone extends UnlockableContent{ return ContentType.zone; } + public static class ZoneRequirement{ + public final Zone zone; + public final int wave; + + public ZoneRequirement(Zone zone, int wave){ + this.zone = zone; + this.wave = wave; + } + + public static ZoneRequirement[] with(Object... objects){ + ZoneRequirement[] out = new ZoneRequirement[objects.length/2]; + for(int i = 0; i < objects.length; i+= 2){ + out[i/2] = new ZoneRequirement((Zone)objects[i], (Integer)objects[i + 1]); + } + return out; + } + } + } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java index 617ad236dc..68f143bec5 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/DeployDialog.java @@ -17,6 +17,7 @@ import io.anuke.mindustry.game.Saves.SaveSlot; import io.anuke.mindustry.graphics.Pal; import io.anuke.mindustry.io.SaveIO.SaveException; import io.anuke.mindustry.type.Zone; +import io.anuke.mindustry.type.Zone.ZoneRequirement; import io.anuke.mindustry.ui.ItemsDisplay; import io.anuke.mindustry.ui.TreeLayout; import io.anuke.mindustry.ui.TreeLayout.TreeNode; @@ -100,8 +101,8 @@ public class DeployDialog extends FloatingDialog{ } boolean hidden(Zone zone){ - for(Zone other : zone.zoneRequirements){ - if(!data.isUnlocked(other)){ + for(ZoneRequirement other : zone.zoneRequirements){ + if(!data.isUnlocked(other.zone)){ return true; } } @@ -177,7 +178,7 @@ public class DeployDialog extends FloatingDialog{ this.height /= 2f; nodes.add(this); - arr.selectFrom(content.zones(), other -> Structs.contains(other.zoneRequirements, zone)); + arr.selectFrom(content.zones(), other -> Structs.find(other.zoneRequirements, f -> f.zone == zone) != null); children = new ZoneNode[arr.size]; for(int i = 0; i < children.length; i++){ diff --git a/core/src/io/anuke/mindustry/ui/dialogs/ZoneInfoDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/ZoneInfoDialog.java index f26f391602..52b18a6b89 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/ZoneInfoDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/ZoneInfoDialog.java @@ -10,6 +10,7 @@ import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.ItemStack; import io.anuke.mindustry.type.ItemType; import io.anuke.mindustry.type.Zone; +import io.anuke.mindustry.type.Zone.ZoneRequirement; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.Block.Icon; @@ -41,7 +42,10 @@ public class ZoneInfoDialog extends FloatingDialog{ Runnable rebuildItems = () -> { int i = 0; iteminfo.clear(); - ItemStack[] stacks = zone.unlocked() ? zone.getLaunchCost() : zone.itemRequirements; + + if(!zone.unlocked()) return; + + ItemStack[] stacks = zone.getLaunchCost(); for(ItemStack stack : stacks){ if(stack.amount == 0) continue; @@ -69,11 +73,11 @@ public class ZoneInfoDialog extends FloatingDialog{ req.table(r -> { r.add("$complete").colspan(2).left(); r.row(); - for(Zone other : zone.zoneRequirements){ + for(ZoneRequirement other : zone.zoneRequirements){ r.addImage("icon-zone").padRight(4); - r.add(other.localizedName()).color(Color.LIGHT_GRAY); - r.addImage(other.isCompleted() ? "icon-check-2" : "icon-cancel-2") - .color(other.isCompleted() ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3); + r.add(Core.bundle.format("zone.requirement", other.wave, other.zone.localizedName())).color(Color.LIGHT_GRAY); + r.addImage(other.zone.bestWave() >= other.wave ? "icon-check-2" : "icon-cancel-2") + .color(other.zone.bestWave() >= other.wave ? Color.LIGHT_GRAY : Color.SCARLET).padLeft(3); r.row(); } }); @@ -190,7 +194,6 @@ public class ZoneInfoDialog extends FloatingDialog{ Button button = cont.addButton(zone.locked() ? "$uncover" : "$launch", () -> { if(!data.isUnlocked(zone)){ - data.removeItems(zone.itemRequirements); data.unlockContent(zone); ui.deploy.setup(); setup(zone); @@ -211,8 +214,8 @@ public class ZoneInfoDialog extends FloatingDialog{ return true; } - for(Zone other : zone.zoneRequirements){ - if(!other.isCompleted()){ + for(ZoneRequirement other : zone.zoneRequirements){ + if(other.zone.bestWave() < other.wave){ return false; } } @@ -223,6 +226,6 @@ public class ZoneInfoDialog extends FloatingDialog{ } } - return data.hasItems(zone.itemRequirements); + return true; } }