From ec1afdfdc48d1c30abcbae217a9792ab5689fc07 Mon Sep 17 00:00:00 2001 From: Sunny Kim <58885089+sk7725@users.noreply.github.com> Date: Sun, 22 Aug 2021 00:29:16 +0900 Subject: [PATCH 01/10] Hidden blocks only in the Placement UI (#5806) * placeablePlayer * placeablePlayer unlocked --- core/src/mindustry/ui/fragments/PlacementFragment.java | 2 +- core/src/mindustry/world/Block.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/ui/fragments/PlacementFragment.java b/core/src/mindustry/ui/fragments/PlacementFragment.java index 04684a2b70..f63ed7b45b 100644 --- a/core/src/mindustry/ui/fragments/PlacementFragment.java +++ b/core/src/mindustry/ui/fragments/PlacementFragment.java @@ -443,7 +443,7 @@ public class PlacementFragment extends Fragment{ } boolean unlocked(Block block){ - return block.unlockedNow(); + return block.unlockedNow() && block.placeablePlayer; } boolean hasInfoBox(){ diff --git a/core/src/mindustry/world/Block.java b/core/src/mindustry/world/Block.java index d6e7605f76..37595ee0d6 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -100,6 +100,8 @@ public class Block extends UnlockableContent{ public boolean requiresWater = false; /** whether this block can be placed on any liquids, anywhere */ public boolean placeableLiquid = false; + /** whether this block can be placed directly by the player via PlacementFragment */ + public boolean placeablePlayer = true; /** whether this floor can be placed on. */ public boolean placeableOn = true; /** whether this block has insulating properties. */ From 9cc08ada22daf7c1ae3ec180d2d7321eaa46df11 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Sat, 21 Aug 2021 08:33:20 -0700 Subject: [PATCH 02/10] Heal Targetting on Turrets (#5820) * Heal Targetting on Turrets * Just in case --- .../world/blocks/defense/turrets/Turret.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index 308746919e..d4d823c3a0 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -16,6 +16,7 @@ import mindustry.core.*; import mindustry.entities.*; import mindustry.entities.Units.*; import mindustry.entities.bullet.*; +import mindustry.game.*; import mindustry.game.EventType.*; import mindustry.gen.*; import mindustry.graphics.*; @@ -64,6 +65,7 @@ public class Turret extends ReloadTurret{ public boolean accurateDelay = false; public boolean targetAir = true; public boolean targetGround = true; + public boolean targetHealing = false; //charging public float chargeTime = -1f; @@ -320,7 +322,11 @@ public class Turret extends ReloadTurret{ } protected boolean validateTarget(){ - return !Units.invalidateTarget(target, team, x, y) || isControlled() || logicControlled(); + return !Units.invalidateTarget(target, canHeal() ? Team.derelict : team, x, y) || isControlled() || logicControlled(); + } + + protected boolean canHeal(){ + return hasAmmo() && targetHealing && peekAmmo().collidesTeam && peekAmmo().healPercent > 0; } protected void findTarget(){ @@ -328,6 +334,10 @@ public class Turret extends ReloadTurret{ target = Units.bestEnemy(team, x, y, range, e -> !e.dead() && !e.isGrounded(), unitSort); }else{ target = Units.bestTarget(team, x, y, range, e -> !e.dead() && (e.isGrounded() || targetAir) && (!e.isGrounded() || targetGround), b -> true, unitSort); + + if(target == null && canHeal()){ + target = Units.findAllyTile(team, x, y, range, b -> b.damaged() && b != self()); + } } } From f85c078de8be1df87ccf00855ad666bc78a22b13 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sat, 21 Aug 2021 11:34:05 -0400 Subject: [PATCH 03/10] PR cleanup --- core/src/mindustry/world/blocks/defense/turrets/Turret.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index d4d823c3a0..5f26af42d8 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -326,7 +326,7 @@ public class Turret extends ReloadTurret{ } protected boolean canHeal(){ - return hasAmmo() && targetHealing && peekAmmo().collidesTeam && peekAmmo().healPercent > 0; + return targetHealing && hasAmmo() && peekAmmo().collidesTeam && peekAmmo().healPercent > 0; } protected void findTarget(){ @@ -336,7 +336,7 @@ public class Turret extends ReloadTurret{ target = Units.bestTarget(team, x, y, range, e -> !e.dead() && (e.isGrounded() || targetAir) && (!e.isGrounded() || targetGround), b -> true, unitSort); if(target == null && canHeal()){ - target = Units.findAllyTile(team, x, y, range, b -> b.damaged() && b != self()); + target = Units.findAllyTile(team, x, y, range, b -> b.damaged() && b != this); } } } From 6847d2f373cd78b61cc2b01c129211d5a68cd963 Mon Sep 17 00:00:00 2001 From: Darkness6030 <79508138+Darkness6030@users.noreply.github.com> Date: Sat, 21 Aug 2021 21:55:41 +0300 Subject: [PATCH 04/10] Add HexedPvP server to Global v7 list (#5829) --- servers_v7.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers_v7.json b/servers_v7.json index d563e943b9..45d2725533 100644 --- a/servers_v7.json +++ b/servers_v7.json @@ -21,7 +21,7 @@ }, { "name": "[cyan]DarkDustry", - "address": ["darkdustry.ml", "darkdustry.ml:7000", "darkdustry.ml:8000"] + "address": ["darkdustry.ml", "darkdustry.ml:3000", "darkdustry.ml:7000", "darkdustry.ml:8000"] }, { "name": "Chaotic Neutral", From 8117aa8046f727d59b99186b5d4277ec1158139c Mon Sep 17 00:00:00 2001 From: fuzzbuck <54221024+fuzzbuck@users.noreply.github.com> Date: Sun, 22 Aug 2021 00:05:43 +0200 Subject: [PATCH 05/10] add 2 new io servers (#5830) 1 new gamemode which will soon come to existance & placeholder slot for events & possible future gamemode --- servers_v7.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers_v7.json b/servers_v7.json index 45d2725533..217026029a 100644 --- a/servers_v7.json +++ b/servers_v7.json @@ -37,7 +37,7 @@ }, { "name": "io", - "address": ["mindustry.io.community", "mindustry.io.community:1000", "mindustry.io.community:2000", "mindustry.io.community:3000"] + "address": ["mindustry.io.community", "mindustry.io.community:1000", "mindustry.io.community:2000", "mindustry.io.community:3000", "mindustry.io.community:4000", "mindustry.io.community:5000"] }, { "name": "Korea", From 466118319f2c092b13e6ea4aaa01f368f8c9c13c Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 22 Aug 2021 00:35:40 -0400 Subject: [PATCH 06/10] Fixed naval units with canBoost = true --- core/src/mindustry/entities/comp/WaterMoveComp.java | 10 +++++++++- gradle.properties | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/mindustry/entities/comp/WaterMoveComp.java b/core/src/mindustry/entities/comp/WaterMoveComp.java index 36364b2168..06434ccecb 100644 --- a/core/src/mindustry/entities/comp/WaterMoveComp.java +++ b/core/src/mindustry/entities/comp/WaterMoveComp.java @@ -27,13 +27,14 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{ @Override public void update(){ + boolean flying = isFlying(); for(int i = 0; i < 2; i++){ Trail t = i == 0 ? tleft : tright; t.length = type.trailLength; int sign = i == 0 ? -1 : 1; float cx = Angles.trnsx(rotation - 90, type.trailX * sign, type.trailY) + x, cy = Angles.trnsy(rotation - 90, type.trailX * sign, type.trailY) + y; - t.update(cx, cy, world.floorWorld(cx, cy).isLiquid ? 1 : 0); + t.update(cx, cy, world.floorWorld(cx, cy).isLiquid && !flying ? 1 : 0); } } @@ -71,6 +72,13 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{ return isFlying() ? null : EntityCollisions::waterSolid; } + @Replace + @Override + public boolean onSolid(){ + Tile tile = tileOn(); + return tile == null || tile.solid() || EntityCollisions.waterSolid(tile.x, tile.y); + } + @Replace public float floorSpeedMultiplier(){ Floor on = isFlying() ? Blocks.air.asFloor() : floorOn(); diff --git a/gradle.properties b/gradle.properties index 5bd4e7119e..7d294adaf4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,4 +11,4 @@ android.useAndroidX=true #used for slow jitpack builds; TODO see if this actually works http.socketTimeout=80000 http.connectionTimeout=80000 -archash=4410a18d881622cb655c9d48e4cb0ff2ec40782f +archash=f9d704c4e88dfc9772e1e956268cfe8414f7b133 From 55270996ff189e943246147cbe5cae4f9e7efcbf Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 22 Aug 2021 00:36:25 -0400 Subject: [PATCH 07/10] Cleanup --- core/src/mindustry/entities/EntityCollisions.java | 2 +- core/src/mindustry/entities/comp/WaterMoveComp.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/entities/EntityCollisions.java b/core/src/mindustry/entities/EntityCollisions.java index e6651a420f..a503241116 100644 --- a/core/src/mindustry/entities/EntityCollisions.java +++ b/core/src/mindustry/entities/EntityCollisions.java @@ -135,7 +135,7 @@ public class EntityCollisions{ public static boolean waterSolid(int x, int y){ Tile tile = world.tile(x, y); - return tile == null || (tile.solid() || !tile.floor().isLiquid); + return tile == null || tile.solid() || !tile.floor().isLiquid; } public static boolean solid(int x, int y){ diff --git a/core/src/mindustry/entities/comp/WaterMoveComp.java b/core/src/mindustry/entities/comp/WaterMoveComp.java index 06434ccecb..ce008279cf 100644 --- a/core/src/mindustry/entities/comp/WaterMoveComp.java +++ b/core/src/mindustry/entities/comp/WaterMoveComp.java @@ -75,8 +75,7 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{ @Replace @Override public boolean onSolid(){ - Tile tile = tileOn(); - return tile == null || tile.solid() || EntityCollisions.waterSolid(tile.x, tile.y); + return EntityCollisions.waterSolid(tileX(), tileY()); } @Replace From c605418e3392ead353a3342688bc68aea1bab073 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 22 Aug 2021 09:40:55 -0400 Subject: [PATCH 08/10] public Setting constructor --- core/src/mindustry/ui/dialogs/SettingsMenuDialog.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java index 66ec8f64d7..0f8820bc2a 100644 --- a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java +++ b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java @@ -605,7 +605,7 @@ public class SettingsMenuDialog extends Dialog{ rebuild(); } - void rebuild(){ + public void rebuild(){ clearChildren(); for(Setting setting : list){ @@ -626,7 +626,7 @@ public class SettingsMenuDialog extends Dialog{ public String title; public @Nullable String description; - Setting(String name){ + public Setting(String name){ this.name = name; String winkey = "setting." + name + ".name.windows"; title = OS.isWindows && bundle.has(winkey) ? bundle.get(winkey) : bundle.get("setting." + name + ".name"); @@ -658,7 +658,7 @@ public class SettingsMenuDialog extends Dialog{ boolean def; Boolc changed; - CheckSetting(String name, boolean def, Boolc changed){ + public CheckSetting(String name, boolean def, Boolc changed){ super(name); this.def = def; this.changed = changed; @@ -687,7 +687,7 @@ public class SettingsMenuDialog extends Dialog{ int def, min, max, step; StringProcessor sp; - SliderSetting(String name, int def, int min, int max, int step, StringProcessor s){ + public SliderSetting(String name, int def, int min, int max, int step, StringProcessor s){ super(name); this.def = def; this.min = min; From 7773a3b17bf7bef4b572acf088bd7ccaa5b1ba2f Mon Sep 17 00:00:00 2001 From: JrTRinny <85090668+JrTRinny@users.noreply.github.com> Date: Sun, 22 Aug 2021 20:45:05 +0700 Subject: [PATCH 09/10] let payload source/void replace each other (#5835) --- core/src/mindustry/content/Blocks.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index b783221cbc..97fc58517a 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2083,11 +2083,15 @@ public class Blocks implements ContentList{ payloadSource = new PayloadSource("payload-source"){{ requirements(Category.units, BuildVisibility.sandboxOnly, with()); size = 5; + alwaysUnlocked = true; + group = BlockGroup.units; }}; payloadVoid = new PayloadVoid("payload-void"){{ requirements(Category.units, BuildVisibility.sandboxOnly, with()); size = 5; + alwaysUnlocked = true; + group = BlockGroup.units; }}; //TODO move From b860b2bbfb81f0f504e55a5b1bffe65187fedce7 Mon Sep 17 00:00:00 2001 From: Matthew Peng <54301439+MEEPofFaith@users.noreply.github.com> Date: Sun, 22 Aug 2021 06:45:17 -0700 Subject: [PATCH 10/10] Don't show core ghosts (#5834) --- core/src/mindustry/world/blocks/storage/CoreBlock.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 24f5b6a652..20c42d8743 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -55,6 +55,7 @@ public class CoreBlock extends StorageBlock{ envEnabled = Env.any; drawDisabled = false; replaceable = false; + rebuildable = false; } @Remote(called = Loc.server)