diff --git a/assets/sprites/blocks/defense/bauxite-wall.png b/assets/sprites/blocks/defense/bauxite-wall.png index 505b3636..837e68ea 100644 Binary files a/assets/sprites/blocks/defense/bauxite-wall.png and b/assets/sprites/blocks/defense/bauxite-wall.png differ diff --git a/assets/sprites/blocks/defense/duralumin-wall.png b/assets/sprites/blocks/defense/duralumin-wall.png index 20f7e1b8..936072c1 100644 Binary files a/assets/sprites/blocks/defense/duralumin-wall.png and b/assets/sprites/blocks/defense/duralumin-wall.png differ diff --git a/assets/sprites/blocks/defense/gallium-wall-normal.png b/assets/sprites/blocks/defense/gallium-wall-normal.png deleted file mode 100644 index 5cbd21d4..00000000 Binary files a/assets/sprites/blocks/defense/gallium-wall-normal.png and /dev/null differ diff --git a/assets/sprites/blocks/defense/gallium-wall.png b/assets/sprites/blocks/defense/gallium-wall.png index 44053c75..bb86c129 100644 Binary files a/assets/sprites/blocks/defense/gallium-wall.png and b/assets/sprites/blocks/defense/gallium-wall.png differ diff --git a/assets/sprites/blocks/defense/gallium-walle.png b/assets/sprites/blocks/defense/gallium-walle.png deleted file mode 100644 index bb86c129..00000000 Binary files a/assets/sprites/blocks/defense/gallium-walle.png and /dev/null differ diff --git a/assets/sprites/blocks/defense/manganese-wall.png b/assets/sprites/blocks/defense/manganese-wall.png index c75a54cd..157eeb10 100644 Binary files a/assets/sprites/blocks/defense/manganese-wall.png and b/assets/sprites/blocks/defense/manganese-wall.png differ diff --git a/assets/sprites/blocks/defense/small-bauxite-wall.png b/assets/sprites/blocks/defense/small-bauxite-wall.png index c4f7ee02..00b7e617 100644 Binary files a/assets/sprites/blocks/defense/small-bauxite-wall.png and b/assets/sprites/blocks/defense/small-bauxite-wall.png differ diff --git a/assets/sprites/blocks/defense/small-duralumin-wall.png b/assets/sprites/blocks/defense/small-duralumin-wall.png index 0f5f391e..4a4f0357 100644 Binary files a/assets/sprites/blocks/defense/small-duralumin-wall.png and b/assets/sprites/blocks/defense/small-duralumin-wall.png differ diff --git a/assets/sprites/blocks/defense/small-gallium-wall.png b/assets/sprites/blocks/defense/small-gallium-wall.png index 07406ef6..8046c021 100644 Binary files a/assets/sprites/blocks/defense/small-gallium-wall.png and b/assets/sprites/blocks/defense/small-gallium-wall.png differ diff --git a/assets/sprites/blocks/defense/small-manganese-wall.png b/assets/sprites/blocks/defense/small-manganese-wall.png index a9e20801..bb4b1e6f 100644 Binary files a/assets/sprites/blocks/defense/small-manganese-wall.png and b/assets/sprites/blocks/defense/small-manganese-wall.png differ diff --git a/src/aquarion/blocks/AquaDefense.java b/src/aquarion/blocks/AquaDefense.java index 0edbe104..7b0d9879 100644 --- a/src/aquarion/blocks/AquaDefense.java +++ b/src/aquarion/blocks/AquaDefense.java @@ -1,5 +1,6 @@ package aquarion.blocks; +import aquarion.world.blocks.defense.BlockingForceProjector; import mindustry.type.ItemStack; import mindustry.world.Block; import mindustry.world.blocks.defense.ForceProjector; @@ -130,7 +131,7 @@ public static void loadContent() { }}; - forceBarrier = new ForceProjector("force-barrier"){{ + forceBarrier = new BlockingForceProjector("force-barrier"){{ requirements(Category.defense, ItemStack.with(lead,80, duralumin, 120, metaglass, 90, nitride, 150)); consumePower(3f / 60f); sides = 18; diff --git a/src/aquarion/world/blocks/defense/BlockingForceProjector.java b/src/aquarion/world/blocks/defense/BlockingForceProjector.java new file mode 100644 index 00000000..abb494fa --- /dev/null +++ b/src/aquarion/world/blocks/defense/BlockingForceProjector.java @@ -0,0 +1,68 @@ +package aquarion.world.blocks.defense; + +import arc.math.*; +import arc.util.Time; +import arc.util.Tmp; +import arc.util.io.Reads; +import arc.util.io.Writes; +import mindustry.content.Fx; +import mindustry.entities.Units; +import mindustry.gen.*; +import mindustry.type.UnitType; +import mindustry.world.*; +import mindustry.world.blocks.defense.ForceProjector; + +public class BlockingForceProjector extends ForceProjector { + public BlockingForceProjector(String name) { + super(name); + } + + @Override + public void init() { + super.init(); + } + + public class BlockingForceBuild extends ForceBuild { + @Override + public void updateTile() { + super.updateTile(); + float effectiveRadius = radius(); // Get the correct shield radius + + if (!broken && effectiveRadius > 1) { + Units.nearbyEnemies(team, x, y, effectiveRadius + 10f, unit -> { + float overlapDst = (unit.hitSize / 2f + effectiveRadius) - unit.dst(x, y); + if (!unit.isGrounded()){ + if (overlapDst > 0) { + unit.vel.setZero(); // Stop units + unit.move(Tmp.v1.set(unit).sub(x, y).setLength(overlapDst + 0.01f)); // Push units out + if (Mathf.chanceDelta(0.12f * Time.delta)) { + Fx.circleColorSpark.at(unit.x, unit.y, team.color); + } + } + } + }); + } + } + + @Override + public void draw() { + super.draw(); + drawShield(); // Draw the shield + } + + @Override + public void write(Writes write) { + super.write(write); + } + + @Override + public void read(Reads read, byte revision) { + super.read(read, revision); + } + + public float radius() { + // Override to ensure it returns the effective shield radius + return realRadius(); // Ensure this matches the logic for effective radius in ForceProjector + } + } +} \ No newline at end of file