This commit is contained in:
Anuken
2025-08-24 16:39:16 -04:00
parent c07d570991
commit ee38bb2857
2 changed files with 6 additions and 6 deletions

View File

@@ -2177,6 +2177,7 @@ public class UnitTypes{
buildSpeed = 3f;
rotateToBuilding = false;
range = maxRange = 180f;
abilities.add(new EnergyFieldAbility(40f, 65f, 180f){{
statusDuration = 60f * 6f;

View File

@@ -904,13 +904,11 @@ public class UnitType extends UnlockableContent implements Senseable{
//assume slight range margin
float margin = 4f;
boolean skipWeapons = weapons.contains(w -> !w.useAttackRange);
//set up default range
if(range < 0){
range = Float.MAX_VALUE;
for(Weapon weapon : weapons){
if(!weapon.useAttackRange && skipWeapons) continue;
if(!weapon.useAttackRange) continue;
range = Math.min(range, weapon.range() - margin);
maxRange = Math.max(maxRange, weapon.range() - margin);
@@ -921,7 +919,7 @@ public class UnitType extends UnlockableContent implements Senseable{
maxRange = Math.max(0f, range);
for(Weapon weapon : weapons){
if(!weapon.useAttackRange && skipWeapons) continue;
if(!weapon.useAttackRange) continue;
maxRange = Math.max(maxRange, weapon.range() - margin);
}
@@ -932,8 +930,9 @@ public class UnitType extends UnlockableContent implements Senseable{
fogRadius = Math.max(58f * 3f, hitSize * 2f) / 8f;
}
if(weapons.isEmpty()){
range = maxRange = mineRange;
if(!weapons.contains(w -> w.useAttackRange)){
if(range < 0 || range == Float.MAX_VALUE) range = mineRange;
if(maxRange < 0 || maxRange == Float.MAX_VALUE) maxRange = mineRange;
}
if(mechStride < 0){