Fixed revenant never shooting

This commit is contained in:
Anuken
2018-10-26 00:09:09 -04:00
parent 2094bc3d80
commit ddb6e74955
6 changed files with 5 additions and 7 deletions

View File

@@ -52,7 +52,6 @@ public class UnitTypes implements ContentList{
drag = 0.4f;
hitsize = 8f;
mass = 1.75f;
range = 40f;
weapon = Weapons.chainBlaster;
health = 130;
}};
@@ -62,7 +61,6 @@ public class UnitTypes implements ContentList{
speed = 0.18f;
drag = 0.4f;
mass = 3.5f;
range = 10f;
hitsize = 9f;
rotatespeed = 0.1f;
weapon = Weapons.flamethrower;
@@ -75,7 +73,6 @@ public class UnitTypes implements ContentList{
drag = 0.4f;
mass = 5f;
hitsize = 10f;
range = 10f;
rotatespeed = 0.06f;
weaponOffsetX = 1;
targetAir = false;
@@ -111,6 +108,7 @@ public class UnitTypes implements ContentList{
speed = 0.14f;
maxVelocity = 1.3f;
drag = 0.01f;
range = 80f;
isFlying = true;
weapon = Weapons.laserBurster;
}};

View File

@@ -190,7 +190,7 @@ public abstract class BaseUnit extends Unit implements ShooterTrait{
}
public void targetClosest(){
target = Units.getClosestTarget(team, x, y, getWeapon().getAmmo().getRange(), u -> type.targetAir || !u.isFlying());
target = Units.getClosestTarget(team, x, y, Math.max(getWeapon().getAmmo().getRange(), type.range), u -> type.targetAir || !u.isFlying());
}
public TileEntity getClosestEnemyCore(){

View File

@@ -76,7 +76,7 @@ public abstract class FlyingUnit extends BaseUnit implements CarryTrait{
attack(150f);
if((Mathf.angNear(angleTo(target), rotation, 15f) || !getWeapon().getAmmo().bullet.keepVelocity) //bombers don't care about rotation
&& distanceTo(target) < getWeapon().getAmmo().getRange()){
&& distanceTo(target) < Math.max(getWeapon().getAmmo().getRange(), type.range)){
AmmoType ammo = getWeapon().getAmmo();
Vector2 to = Predict.intercept(FlyingUnit.this, target, ammo.bullet.speed);

View File

@@ -29,7 +29,7 @@ public class UnitType extends UnlockableContent{
public float hitsize = 7f;
public float hitsizeTile = 4f;
public float speed = 0.4f;
public float range = 160;
public float range = 0;
public float rotatespeed = 0.2f;
public float baseRotateSpeed = 0.1f;
public float mass = 1f;