From 3b1e5eadd98509ec4e4850e3568540e60bce2b05 Mon Sep 17 00:00:00 2001 From: L0615T1C5-216AC-9437 <60281819+L0615T1C5-216AC-9437@users.noreply.github.com> Date: Sun, 9 Apr 2023 16:08:04 -0400 Subject: [PATCH 1/2] Update CN Ports (#8499) --- servers_v7.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers_v7.json b/servers_v7.json index f24ad3b19f..62d1ddd28a 100644 --- a/servers_v7.json +++ b/servers_v7.json @@ -65,7 +65,7 @@ }, { "name": "Chaotic Neutral", - "address": ["c-n.ddns.net:1111", "c-n.ddns.net:2222", "c-n.ddns.net:3333", "c-n.ddns.net:4444", "c-n.ddns.net:5555", "c-n.ddns.net:6666", "c-n.ddns.net:7777", "c-n.ddns.net:8888"] + "address": ["c-n.ddns.net:1111", "c-n.ddns.net:2222", "c-n.ddns.net:3333", "c-n.ddns.net:4444", "c-n.ddns.net:5555", "c-n.ddns.net:6666", "c-n.ddns.net:7777", "c-n.ddns.net:9999", "c-n.ddns.net:1000"] }, { "name": "io", From 1629afe49181be233bc81d370f2aa1fd0b13c24b Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Sun, 9 Apr 2023 13:12:24 -0700 Subject: [PATCH 2/2] Ammo obliteration (#8498) * alwaysShooting for turrets similar to alwaysShooting for weapons * Weapon alwaysShooting takes shootCone into account Speaking of untested PRs... --- core/src/mindustry/type/Weapon.java | 2 +- .../world/blocks/defense/turrets/Turret.java | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index 201a071c1d..7b9c341fb9 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -396,7 +396,7 @@ public class Weapon implements Cloneable{ mount.warmup >= minWarmup && //must be warmed up unit.vel.len() >= minShootVelocity && //check velocity requirements (mount.reload <= 0.0001f || (alwaysContinuous && mount.bullet == null)) && //reload has to be 0, or it has to be an always-continuous weapon - Angles.within(rotate ? mount.rotation : unit.rotation + baseRotation, mount.targetRotation, shootCone) //has to be within the cone + (alwaysShooting || Angles.within(rotate ? mount.rotation : unit.rotation + baseRotation, mount.targetRotation, shootCone)) //has to be within the cone ){ shoot(unit, mount, bulletX, bulletY, shootAngle); diff --git a/core/src/mindustry/world/blocks/defense/turrets/Turret.java b/core/src/mindustry/world/blocks/defense/turrets/Turret.java index ff35b122f9..6fc1f5ae10 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/Turret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/Turret.java @@ -83,6 +83,8 @@ public class Turret extends ReloadTurret{ public boolean displayAmmoMultiplier = true; /** If false, 'under' blocks like conveyors are not targeted. */ public boolean targetUnderBlocks = true; + /** If true, the turret will always shoot when it has ammo, regardless of targets in range or any control. */ + public boolean alwaysShooting = false; /** Function for choosing which unit to target. */ public Sortf unitSort = UnitSorts.closest; /** Filter for types of units to attack. */ @@ -304,7 +306,7 @@ public class Turret extends ReloadTurret{ } public boolean isShooting(){ - return (isControlled() ? unit.isShooting() : logicControlled() ? logicShooting : target != null); + return alwaysShooting || (isControlled() ? unit.isShooting() : logicControlled() ? logicShooting : target != null); } @Override @@ -425,11 +427,16 @@ public class Turret extends ReloadTurret{ turnToTarget(targetRot); } - if(Angles.angleDist(rotation, targetRot) < shootCone && canShoot){ + if(!alwaysShooting && Angles.angleDist(rotation, targetRot) < shootCone && canShoot){ wasShooting = true; updateShooting(); } } + + if(alwaysShooting){ + wasShooting = true; + updateShooting(); + } } if(coolant != null){