diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 83aa948744..1c6126996a 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -34,6 +34,7 @@ jobs: git push fi - name: Update JITpack repo + if: ${{ github.repository == 'Anuken/Mindustry' }} run: | cd ../ cp -r ./Mindustry ./MindustryJitpack diff --git a/core/src/mindustry/ai/RtsAI.java b/core/src/mindustry/ai/RtsAI.java index 877ed38abc..23f22e92c9 100644 --- a/core/src/mindustry/ai/RtsAI.java +++ b/core/src/mindustry/ai/RtsAI.java @@ -277,9 +277,9 @@ public class RtsAI{ float extraRadius = 50f; for(var turret : Vars.indexer.getEnemy(data.team, BlockFlag.turret)){ - if(Intersector.distanceSegmentPoint(fromX, fromY, x, y, turret.x, turret.y) <= ((TurretBuild)turret).range() + extraRadius){ - health[0] += turret.health; - dps[0] += ((TurretBuild)turret).estimateDps(); + if(turret instanceof TurretBuild t && Intersector.distanceSegmentPoint(fromX, fromY, x, y, t.x, t.y) <= t.range() + extraRadius){ + health[0] += t.health; + dps[0] += t.estimateDps(); } } diff --git a/core/src/mindustry/type/weapons/BuildWeapon.java b/core/src/mindustry/type/weapons/BuildWeapon.java index 46ac7db195..4ca1e55483 100644 --- a/core/src/mindustry/type/weapons/BuildWeapon.java +++ b/core/src/mindustry/type/weapons/BuildWeapon.java @@ -20,6 +20,8 @@ public class BuildWeapon extends Weapon{ { rotate = true; + noAttack = true; + predictTarget = false; bullet = new BulletType(); } @@ -30,9 +32,7 @@ public class BuildWeapon extends Weapon{ @Override public void update(Unit unit, WeaponMount mount){ - //no mount.shoot = false; - //yes mount.rotate = true; //always aim at build plan diff --git a/core/src/mindustry/world/blocks/defense/turrets/ContinuousLiquidTurret.java b/core/src/mindustry/world/blocks/defense/turrets/ContinuousLiquidTurret.java index 533cafbe40..de7798e28e 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/ContinuousLiquidTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/ContinuousLiquidTurret.java @@ -83,6 +83,11 @@ public class ContinuousLiquidTurret extends ContinuousTurret{ return ammoTypes.get(liquids.current()); } + @Override + public boolean hasAmmo(){ + return ammoTypes.get(liquids.current()) != null && liquids.currentAmount() >= 1f / ammoTypes.get(liquids.current()).ammoMultiplier; + } + @Override public boolean acceptItem(Building source, Item item){ return false; diff --git a/core/src/mindustry/world/blocks/power/ImpactReactor.java b/core/src/mindustry/world/blocks/power/ImpactReactor.java index 0eadcfc609..e256f4ba56 100644 --- a/core/src/mindustry/world/blocks/power/ImpactReactor.java +++ b/core/src/mindustry/world/blocks/power/ImpactReactor.java @@ -50,7 +50,7 @@ public class ImpactReactor extends PowerGenerator{ public void setBars(){ super.setBars(); - addBar("poweroutput", (GeneratorBuild entity) -> new Bar(() -> + addBar("power", (GeneratorBuild entity) -> new Bar(() -> Core.bundle.format("bar.poweroutput", Strings.fixed(Math.max(entity.getPowerProduction() - consPower.usage, 0) * 60 * entity.timeScale(), 1)), () -> Pal.powerBar, diff --git a/core/src/mindustry/world/blocks/power/PowerGenerator.java b/core/src/mindustry/world/blocks/power/PowerGenerator.java index cfab097ec4..d534454e69 100644 --- a/core/src/mindustry/world/blocks/power/PowerGenerator.java +++ b/core/src/mindustry/world/blocks/power/PowerGenerator.java @@ -47,7 +47,7 @@ public class PowerGenerator extends PowerDistributor{ public void setBars(){ super.setBars(); - if(hasPower && outputsPower && consPower != null){ + if(hasPower && outputsPower){ addBar("power", (GeneratorBuild entity) -> new Bar(() -> Core.bundle.format("bar.poweroutput", Strings.fixed(entity.getPowerProduction() * 60 * entity.timeScale(), 1)), diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 1446851c04..e1e251d0cb 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -130,15 +130,16 @@ public class CoreBlock extends StorageBlock{ //in the editor, you can place them anywhere for convenience if(state.isEditor()) return true; + CoreBuild core = team.core(); + //must have all requirements + if(core == null || (!state.rules.infiniteResources && !core.items.has(requirements, state.rules.buildCostMultiplier))) return false; + //special floor upon which cores can be placed tile.getLinkedTilesAs(this, tempTiles); if(!tempTiles.contains(o -> !o.floor().allowCorePlacement)){ return true; } - CoreBuild core = team.core(); - //must have all requirements - if(core == null || (!state.rules.infiniteResources && !core.items.has(requirements, state.rules.buildCostMultiplier))) return false; return tile.block() instanceof CoreBlock && size > tile.block().size; }