From 50cc340b20c7d3d0d6445e14bbe3af6d3512dab0 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Fri, 24 Sep 2021 18:28:20 -0700 Subject: [PATCH 1/5] Customizable Block Place Sound (#6043) --- core/src/mindustry/world/Block.java | 10 ++++++++-- core/src/mindustry/world/blocks/ConstructBlock.java | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index e03ed2c0b0..d0e900e479 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -202,10 +202,16 @@ public class Block extends UnlockableContent{ public int outlinedIcon = -1; /** Whether this block has a shadow under it. */ public boolean hasShadow = true; - /** Sounds made when this block is destroyed.*/ - public Sound destroySound = Sounds.boom; + /** Should the sound made when this block is built change in pitch. */ + public boolean placePitchChange = true; + /** Should the sound made when this block is deconstructed change in pitch. */ + public boolean breakPitchChange = true; + /** Sound made when this block is built. */ + public Sound placeSound = Sounds.place; /** Sound made when this block is deconstructed. */ public Sound breakSound = Sounds.breaks; + /** Sounds made when this block is destroyed.*/ + public Sound destroySound = Sounds.boom; /** How reflective this block is. */ public float albedo = 0f; /** Environmental passive light color. */ diff --git a/core/src/mindustry/world/blocks/ConstructBlock.java b/core/src/mindustry/world/blocks/ConstructBlock.java index 9113a840a1..ee42782485 100644 --- a/core/src/mindustry/world/blocks/ConstructBlock.java +++ b/core/src/mindustry/world/blocks/ConstructBlock.java @@ -58,7 +58,7 @@ public class ConstructBlock extends Block{ block.breakEffect.at(tile.drawx(), tile.drawy(), block.size, block.mapColor); Events.fire(new BlockBuildEndEvent(tile, builder, team, true, null)); tile.remove(); - if(shouldPlay()) block.breakSound.at(tile, calcPitch(false)); + if(shouldPlay()) block.breakSound.at(tile, block.breakPitchChange ? calcPitch(false) : 1f); } @Remote(called = Loc.server) @@ -97,7 +97,7 @@ public class ConstructBlock extends Block{ } Fx.placeBlock.at(tile.drawx(), tile.drawy(), block.size); - if(shouldPlay()) Sounds.place.at(tile, calcPitch(true)); + if(shouldPlay()) block.placeSound.at(tile, block.placePitchChange ? calcPitch(true) : 1f); Events.fire(new BlockBuildEndEvent(tile, builder, team, false, config)); } From d79ab3ec3ee68c738e612942befddfca7106712b Mon Sep 17 00:00:00 2001 From: Darkness#3729 <79508138+Darkness6030@users.noreply.github.com> Date: Sat, 25 Sep 2021 15:50:20 +0300 Subject: [PATCH 2/5] Make thruster cost some scrap (#6045) --- core/src/mindustry/content/Blocks.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 06a14b95a8..d944f433f0 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -874,6 +874,7 @@ public class Blocks implements ContentList{ }}; thruster = new Thruster("thruster"){{ + requirements(Category.defense, BuildVisibility.sandboxOnly, with(Items.scrap, 96)); health = 55 * 16 * wallHealthMultiplier; size = 4; }}; From 94d9ca472758bbc65f0f8c73c2b210bcb9d05dd7 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Sun, 26 Sep 2021 05:31:21 -0700 Subject: [PATCH 3/5] Pull creating and dumping products out into their own methods (#6047) --- .../blocks/production/GenericCrafter.java | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/core/src/mindustry/world/blocks/production/GenericCrafter.java b/core/src/mindustry/world/blocks/production/GenericCrafter.java index c6c688ae18..6df7ff8eca 100644 --- a/core/src/mindustry/world/blocks/production/GenericCrafter.java +++ b/core/src/mindustry/world/blocks/production/GenericCrafter.java @@ -127,24 +127,32 @@ public class GenericCrafter extends Block{ } if(progress >= 1f){ - consume(); - - if(outputItems != null){ - for(ItemStack output : outputItems){ - for(int i = 0; i < output.amount; i++){ - offload(output.item); - } - } - } - - if(outputLiquid != null){ - handleLiquid(this, outputLiquid.liquid, outputLiquid.amount); - } - - craftEffect.at(x, y); - progress %= 1f; + craft(); } + dumpOutputs(); + } + + public void craft(){ + consume(); + + if(outputItems != null){ + for(ItemStack output : outputItems){ + for(int i = 0; i < output.amount; i++){ + offload(output.item); + } + } + } + + if(outputLiquid != null){ + handleLiquid(this, outputLiquid.liquid, outputLiquid.amount); + } + + craftEffect.at(x, y); + progress %= 1f; + } + + public void dumpOutputs(){ if(outputItems != null && timer(timerDump, dumpTime / timeScale)){ for(ItemStack output : outputItems){ dump(output.item); From 0185f8bc5a4851f2a573da14a38dcbc1f3e1d343 Mon Sep 17 00:00:00 2001 From: Misaka <63801085+misaka0954@users.noreply.github.com> Date: Sun, 26 Sep 2021 15:33:05 +0300 Subject: [PATCH 4/5] shizashizashiza epic comeback (#6050) No description provided. --- servers_v7.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/servers_v7.json b/servers_v7.json index 65d54ef732..3ac3890c61 100644 --- a/servers_v7.json +++ b/servers_v7.json @@ -46,5 +46,9 @@ { "name": "SubZero", "address": ["minty-server.ddns.net"] + }, + { + "name": "Shiza Minigames", + "address": ["shizashizashiza.ml"] } ] From 5e0f4046023ade724e5ccef09e5051823105e89f Mon Sep 17 00:00:00 2001 From: Pietro <47507131+Pietro303HD@users.noreply.github.com> Date: Sun, 26 Sep 2021 12:40:15 -0300 Subject: [PATCH 5/5] row mod content dialog in mobile (#6051) * Row mod content dialog in mobile It's as simple as `Math.floor()` * type casting (int) --- core/src/mindustry/ui/dialogs/ModsDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/ui/dialogs/ModsDialog.java b/core/src/mindustry/ui/dialogs/ModsDialog.java index d31aa1694c..5a7bf4d692 100644 --- a/core/src/mindustry/ui/dialogs/ModsDialog.java +++ b/core/src/mindustry/ui/dialogs/ModsDialog.java @@ -381,7 +381,7 @@ public class ModsDialog extends BaseDialog{ }).tooltip(c.localizedName); - if(++i % Math.min(Core.graphics.getWidth() / Scl.scl(110), 14) == 0) cs.row(); + if(++i % (int)Math.min(Core.graphics.getWidth() / Scl.scl(110), 14) == 0) cs.row(); } }).grow(); d.addCloseButton();