ShipAPI findTarget() { target = IceUtils.getShipInLineOfFire(weapon); if (target != null && target.getOwner() != ship.getOwner()) { return target; } else return target = null; }
@Override public boolean shouldFire() { if (target == null || !target.isAlive() || targetWillDieSoonAnyway || ((target.getPhaseCloak() != null) && !target.getFluxTracker().isOverloadedOrVenting())) return false; float shouldFire = -danger; if (target.getShield() != null && target.getShield().isWithinArc(weapon.getLocation())) { shouldFire += overloadBalance * 8 * fpRatio; } else { shouldFire += Math.min(1, weapon.getDerivedStats().getDamagePerShot() / target.getHitpoints()) * 16 * fpRatio; } shouldFire *= hitChance; return shouldFire > SHOULD_FIRE_THRESHOLD; }
@Override public Vector2f getTarget() { return ship.getMouseTarget(); }