public static boolean isInArc(Coords src, int facing, Coords dest, int arc) { Vector<Coords> destV = new Vector<Coords>(); destV.add(dest); return isInArc(src, facing, destV, arc); }
/** * Returns the value of {@link Compute#isInArc(Coords, int, Targetable, int)}. * * @param shooterPosition The current {@link Coords} of the shooter. * @param shooterFacing The shooter's current facing. * @param targetPosition The current {@link Coords} of the target. * @param weaponArc The arc of the weapon being fired. * @return TRUE if the target falls within the weapon's firing arc. */ @StaticWrapper protected boolean isInArc(final Coords shooterPosition, final int shooterFacing, final Coords targetPosition, final int weaponArc) { return Compute.isInArc(shooterPosition, shooterFacing, targetPosition, weaponArc); }
public static boolean isInArc(Coords src, int facing, Targetable target, int arc) { Vector<Coords> tPosV = new Vector<Coords>(); tPosV.add(target.getPosition()); // check for secondary positions if ((target instanceof Entity) && (null != ((Entity) target).getSecondaryPositions())) { for (int key : ((Entity) target).getSecondaryPositions().keySet()) { tPosV.add(((Entity) target).getSecondaryPositions().get(key)); } } return isInArc(src, facing, tPosV, arc); }
|| Compute.isInArc(friendlyBAPCoords, facing, c, Compute.ARC_NOSE)) { ecmStatus = ecmStatus - 2;
Coords h = iterator.next(); if (!game.getBoard().contains(h) || !Compute.isInArc(c, fac, h, fieldofFireWpArc)) { iterator.remove();
&& Compute.isInArc(game, getId(), getEquipmentNum(ams), game.getEntity(taa.getEntityId()))) { vTMAttacksInArc.addElement(taa);
return false; if (!Compute.isInArc(attacker.getPosition(), attacker .getSecondaryFacing(), target, attacker.getForwardArc())) {
if (wr instanceof CapitalMissileBearingsOnlyHandler) { if (!targets.contains(wr.waa) && Compute.isInArc(game, getId(), getEquipmentNum(ams), game.getTarget(wr.waa.getOriginalTargetType(), wr.waa.getOriginalTargetId()))) { vAttacksInArc.addElement(wr.waa); && Compute.isInArc(game, getId(), getEquipmentNum(ams), game.getEntity(wr.waa.getEntityId()))) { vAttacksInArc.addElement(wr.waa);
.isInArc(ecmPos, dir, c, Compute.ARC_NOSE); if ((dist > range) || !inArc) { continue;
Entity attacker = waa.getEntity(getClient().getGame()); Targetable target = waa.getTarget(getClient().getGame()); boolean curInFrontArc = Compute.isInArc(attacker.getPosition(), attacker.getSecondaryFacing(), target, attacker.getForwardArc()); Entity attacker = waa.getEntity(getClient().getGame()); Targetable target = waa.getTarget(getClient().getGame()); boolean curInFrontArc = Compute.isInArc(attacker.getPosition(), attacker.getSecondaryFacing(), target, attacker.getForwardArc());
/** * Assign APDS systems to the most dangerous incoming missile attacks. This * should only be called once per turn, or AMS will get extra attacks */ public WeaponAttackAction assignAPDS(List<WeaponHandler> vAttacks) { // Shouldn't have null entity, but if we do... if (getEntity() == null) { return null; } // Ensure we only target attacks in our arc & range List<WeaponAttackAction> vAttacksInArc = new Vector<>(vAttacks.size()); for (WeaponHandler wr : vAttacks) { boolean isInArc = Compute.isInArc(getEntity().getGame(), getEntity().getId(), getEntity().getEquipmentNum(this), getEntity().getGame().getEntity(wr.waa.getEntityId())); boolean isInRange = getEntity().getPosition().distance( wr.getWaa().getTarget(getEntity().getGame()).getPosition()) <= 3; if (isInArc && isInRange) { vAttacksInArc.add(wr.waa); } } // find the most dangerous salvo by expected damage WeaponAttackAction waa = Compute.getHighestExpectedDamage(getEntity() .getGame(), vAttacksInArc, true); if (waa != null) { waa.addCounterEquipment(this); return waa; } return null; }
.isInArc(attacker.getPosition(), attacker.getSecondaryFacing(), target, attacker.getForwardArc()); boolean curInRearArc = Compute.isInArc(attacker.getPosition(), attacker.getSecondaryFacing(), target, attacker.getRearArc()); if (!curInRearArc && attacker.hasQuirk(OptionsConstants.QUIRK_POS_MULTI_TRAC)) { && Compute.isInArc(attacker.getPosition(), attacker.getSecondaryFacing(), pte, attacker.getForwardArc())) {
Coords vertex = movableArea.getVertexNum(vertexNum); if(vertex != null && Compute.isInArc(finalCoords, path.getFinalFacing(), vertex, arcToUse)) { inArcVertexCount++;
isInArc = Compute.isInArc(game, apdsEnt.getId(), apdsEnt.getEquipmentNum(counter), ae); } else { // Otherwise, the attack target must be in arc isInArc = Compute.isInArc(game, apdsEnt.getId(), apdsEnt.getEquipmentNum(counter), entityTarget); || !Compute.isInArc(game, entityTarget.getId(), entityTarget.getEquipmentNum(counter), ae)) { continue;
return Compute.isInArc(aPos, facing, tPosV, ae.getWeaponArc(weaponId));
Targetable target1 = waa.getTarget(clientgui.getClient() .getGame()); boolean curInFrontArc = Compute.isInArc(attacker.getPosition(), attacker.getSecondaryFacing(), target1, attacker.getForwardArc()); Targetable target1 = waa.getTarget(clientgui.getClient() .getGame()); boolean curInFrontArc = Compute.isInArc(attacker.getPosition(), attacker.getSecondaryFacing(), target1, attacker.getForwardArc());
&& (en instanceof BipedMech) && ((BipedMech)en).canZweihander() && Compute.isInArc(en.getPosition(), en.getSecondaryFacing(), target, en.getForwardArc());
if (!Compute.isInArc(ae.getPosition(), ae.getFacing(), target, Compute.ARC_FORWARD)) { return new ToHitData(TargetRoll.IMPOSSIBLE, "Target not in arc");