if ((hexEl + 2 > attEl && hexEl + 2 > targEl) || (hexEl + 2 > attEl && ae.getPosition().distance(coords) == 1) || (hexEl + 2 > targEl && target.getPosition().distance(coords) == 1)) {  if (hex.contains(Terrain.SMOKE)) { los.smoke++; } else if (hex.levelOf(Terrain.WOODS) == 1) { los.lightWoods++; } else if (hex.levelOf(Terrain.WOODS) > 1) { los.heavyWoods++; } }
if (!underWaterCombat) { if ((hexEl + 2 > attEl && hexEl + 2 > targEl) || (hexEl + 2 > attEl && ae.getPosition().distance(coords) == 1) || (hexEl + 2 > targEl && target.getPosition().distance(coords) == 1)) {  if (hex.contains(Terrain.SMOKE)) { los.smoke++; } else if (hex.levelOf(Terrain.WOODS) == 1) { los.lightWoods++; } else if (hex.levelOf(Terrain.WOODS) > 1) { los.heavyWoods++; } } }
    private static LosEffects losForCoords(Game game, int attackerId,                                           Targetable target, Coords coords,                                           Building thruBldg) {        LosEffects los = new LosEffects();                // ignore hexes not on board        if (!game.board.contains(coords)) {            return los;        }        // Is there a building in this hex?        Building bldg = game.board.getBuildingAt(coords);        // We're only tracing thru a single building if there        // is a building in this hex, and if it isn't the same        // building that we'be been tracing LOS thru.        if ( bldg != null && bldg.equals(thruBldg) ) {            los.setThruBldg( thruBldg );        }        final Entity ae = game.getEntity(attackerId);        // ignore hexes the attacker or target are in        if ( coords.equals(ae.getPosition()) ||             coords.equals(target.getPosition()) ) {            return los;        }        int attEl = ae.absHeight();        int targEl;        if ( target.getTargetType() == Targetable.TYPE_ENTITY ||             target.getTargetType() == Targetable.TYPE_BUILDING ||             target.getTargetType() == Targetable.TYPE_BLDG_IGNITE ) {            targEl = target.absHeight();        } else {            targEl = game.board.getHex(target.getPosition()).floor();        }        Hex hex = game.board.getHex(coords);        int hexEl = hex.surface() - hex.depth(); //depth accomodates water and basements        // Handle building elevation.        // Attacks thru a building are not blocked by that building.        // ASSUMPTION: bridges don't block LOS.        int bldgEl = 0;        if ( null == los.getThruBldg() &&             hex.contains( Terrain.BLDG_ELEV ) ) {            bldgEl = hex.levelOf( Terrain.BLDG_ELEV );        }        // TODO: Identify when LOS travels *above* a building's hex.        //       Alternatively, force all building hexes to be same height.        // check for block by terrain        if ((hexEl + bldgEl > attEl && hexEl + bldgEl > targEl)        || (hexEl + bldgEl > attEl && ae.getPosition().distance(coords) == 1)        || (hexEl + bldgEl > targEl && target.getPosition().distance(coords) == 1)) {            los.blocked = true;        }        // check for woods or smoke        if ((hexEl + 2 > attEl && hexEl + 2 > targEl)        || (hexEl + 2 > attEl && ae.getPosition().distance(coords) == 1)        || (hexEl + 2 > targEl && target.getPosition().distance(coords) == 1)) {            // smoke overrides any woods in the hex            if (hex.contains(Terrain.SMOKE)) {                los.smoke++;            } else if (hex.levelOf(Terrain.WOODS) == 1) {                los.lightWoods++;            } else if (hex.levelOf(Terrain.WOODS) > 1) {                los.heavyWoods++;            }        }                // check for target partial cover        if ( target.getPosition().distance(coords) == 1 &&             hexEl + bldgEl == targEl &&             attEl <= targEl && target.getHeight() > 0) {            los.targetCover = true;        }        // check for attacker partial cover        if (ae.getPosition().distance(coords) == 1 &&            hexEl + bldgEl == attEl &&            attEl >= targEl && ae.height() > 0) {            los.attackerCover = true;        }                return los;    }