diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 5a35f31d1d..8ad0e4033c 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -2329,11 +2329,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 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 36364b2168..ce008279cf 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,12 @@ abstract class WaterMoveComp implements Posc, Velc, Hitboxc, Flyingc, Unitc{ return isFlying() ? null : EntityCollisions::waterSolid; } + @Replace + @Override + public boolean onSolid(){ + return EntityCollisions.waterSolid(tileX(), tileY()); + } + @Replace public float floorSpeedMultiplier(){ Floor on = isFlying() ? Blocks.air.asFloor() : floorOn(); 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; 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 308f937dd8..8d30819602 100644 --- a/core/src/mindustry/world/Block.java +++ b/core/src/mindustry/world/Block.java @@ -101,6 +101,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. */ diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index 308746919e..5f26af42d8 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 targetHealing && hasAmmo() && 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 != this); + } } } diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 0fab6fc94d..7f3e67e5ce 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) diff --git a/servers_v7.json b/servers_v7.json index d563e943b9..217026029a 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", @@ -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",