Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken 2023-04-09 18:16:30 -04:00
commit e8fbfe536e
3 changed files with 11 additions and 4 deletions

View File

@ -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);

View File

@ -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){

View File

@ -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",