/** * Finds the effective distance between an attacker and a target. Includes * the distance bonus if the attacker and target are in the same building * and on different levels. Also takes account of altitude differences * * @return the effective distance */ public static int effectiveDistance(IGame game, Entity attacker, Targetable target) { return Compute.effectiveDistance(game, attacker, target, false); }
@Override public void updateTurnsTilHit(IGame game) { int distance = Compute.effectiveDistance(game, getEntity(game), getTarget(game)); // adjust distance for gravity distance = (int)Math.floor((double)distance/game.getPlanetaryConditions().getGravity()); this.turnsTilHit = (int) (distance / launchVelocity); }
public static boolean inDeadZone(IGame game, Entity ae, Targetable target) { if (ae.isSpaceborne()) { return false; } // Account for "dead zones" between Aeros at different altitudes if (Compute.isAirToAir(ae, target)) { int distance = Compute.effectiveDistance(game, ae, target, target.isAirborneVTOLorWIGE()); int aAlt = ae.getAltitude(); int tAlt = target.getAltitude(); if (target.isAirborneVTOLorWIGE()) { tAlt++; } int altDiff = Math.abs(aAlt - tAlt); if (altDiff >= (distance - altDiff)) { return true; } } return false; }
int buddyRange = Compute.effectiveDistance(game, friend, target, false); if (Compute.effectiveDistance(game, network.get(pos), target, false) >= buddyRange) { network.add(pos, friend);
int distance = Compute.effectiveDistance(game, ce(), target); if (m.isUsedThisRound()) {
clientgui.mechD.wPan.wTargetR.setText(target.getDisplayName()); int effectiveDistance = Compute.effectiveDistance( game, ce(), target); clientgui.mechD.wPan.wRangeR.setText("" + effectiveDistance); //$NON-NLS-1$
int rollTarget = 0; int dieRoll = Compute.d6(2); int distance = Compute.effectiveDistance(game, ae, target);
clientgui.mechD.wPan.wTargetR.setText(target.getDisplayName()); int effectiveDistance = Compute.effectiveDistance( game, ce(), target); clientgui.mechD.wPan.wRangeR.setText("" + effectiveDistance); //$NON-NLS-1$
&& (Compute.effectiveDistance(game, this, target) > 1)) { continue;
int distance = Compute.effectiveDistance(game,this,e,false);
server = s; subjectId = getAttackerId(); nRange = Compute.effectiveDistance(game, ae, target); if (target instanceof Mech) { throughFront = Compute.isThroughFrontHex(game, ae.getPosition(),
.calculateBattleValue(); known_range += Compute .effectiveDistance(game, check_ent, test_ent);
this.playerId = game.getEntity(entityId).getOwnerId(); this.firingCoords = game.getEntity(entityId).getPosition(); int distance = Compute.effectiveDistance(game, getEntity(game), getTarget(game));
continue; if (Compute.effectiveDistance(game, entity, target) > 1) { continue;
target.getTargetType(), target.getTargetId(), weaponNum); IGame game = clientgui.getClient().getGame(); int distance = Compute.effectiveDistance(game, waa.getEntity(game), waa.getTarget(game)); if ((mounted.getType().hasFlag(WeaponType.F_ARTILLERY))
if (Compute.effectiveDistance(game, ae, target) > 1) { return "Target not in range";
if (isArtilleryDirect && (Compute.effectiveDistance(game, ae, target) <= 6)) { return "Direct-Fire artillery attacks impossible at range <= 6"; int distance = Compute.effectiveDistance(game, ae, target, false); if (!ae.isAirborne() && (distance == 0) && (weapon.getLocation() != Aero.LOC_AFT)) { return "Only aft weapons may target units at zero range"; int distance = Compute.effectiveDistance(game, ae, target);
int distance = Compute.effectiveDistance(game, ae, target, false); int range = RangeType.rangeBracket(distance, weaponRanges, useExtremeRange, useLOSRange); int c3dist = Compute.effectiveDistance(game, c3spotter, target, false);
&& (ae.getBAPRange() >= Compute.effectiveDistance(game, ae, te)) && !ComputeECM.isAffectedByECM(ae, ae.getPosition(), te.getPosition()) && (game.getBoard().getHex(te.getPosition()).containsTerrain(Terrains.WOODS) int distance = Compute.effectiveDistance(game, ae, target);
&& ae.hasBAP() && (ae.getBAPRange() >= Compute.effectiveDistance(game, ae, te)) && !ComputeECM.isAffectedByECM(ae, ae.getPosition(), te.getPosition()) && (game.getBoard().getHex(te.getPosition()).containsTerrain(Terrains.WOODS) int aAlt = ae.getAltitude(); int tAlt = target.getAltitude(); int distance = Compute.effectiveDistance(game, ae, target); inSameBuilding, underWater)); toHit.setCover(LosEffects.COVER_NONE); distance = Compute.effectiveDistance(game, ae, swarmSecondaryTarget);