PointDefenseWeapon no longer affects range

This commit is contained in:
Anuken
2023-04-28 14:39:28 -04:00
parent 681bd19866
commit 5e8f5f1d62
4 changed files with 8 additions and 1 deletions

View File

@@ -715,6 +715,8 @@ public class UnitType extends UnlockableContent{
if(range < 0){
range = Float.MAX_VALUE;
for(Weapon weapon : weapons){
if(!weapon.useAttackRange) continue;
range = Math.min(range, weapon.range() - margin);
maxRange = Math.max(maxRange, weapon.range() - margin);
}
@@ -724,6 +726,8 @@ public class UnitType extends UnlockableContent{
maxRange = Math.max(0f, range);
for(Weapon weapon : weapons){
if(!weapon.useAttackRange) continue;
maxRange = Math.max(maxRange, weapon.range() - margin);
}
}

View File

@@ -63,6 +63,8 @@ public class Weapon implements Cloneable{
public boolean autoTarget = false;
/** whether to perform target trajectory prediction */
public boolean predictTarget = true;
/** if true, this weapon is used for attack range calculations */
public boolean useAttackRange = true;
/** ticks to wait in-between targets */
public float targetInterval = 40f, targetSwitchInterval = 70f;
/** rotation speed of weapon when rotation is enabled, in degrees/t*/

View File

@@ -32,6 +32,7 @@ public class PointDefenseWeapon extends Weapon{
controllable = false;
rotate = true;
useAmmo = false;
useAttackRange = false;
}
@Override