コード例 #1
0
  ShipAPI findTarget() {
    target = IceUtils.getShipInLineOfFire(weapon);

    if (target != null && target.getOwner() != ship.getOwner()) {
      return target;
    } else return target = null;
  }
コード例 #2
0
  @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;
  }
コード例 #3
0
 @Override
 public Vector2f getTarget() {
   return ship.getMouseTarget();
 }