ai.attOffBoard = attOffBoard;
    public static LosEffects calculateLos(Game game, int attackerId, Targetable target) {        final Entity ae = game.getEntity(attackerId);                        // LOS fails if one of the entities is not deployed.        if (null == ae.getPosition() || null == target.getPosition()) {            LosEffects los = new LosEffects();            los.blocked = true; // TODO: come up with a better "impossible"            return los;        }                final AttackInfo ai = new AttackInfo();        ai.attackPos = ae.getPosition();        ai.targetPos = target.getPosition();        ai.targetEntity = target.getTargetType() == Targetable.TYPE_ENTITY;        ai.targetInfantry = target instanceof Infantry;    	ai.attackHeight = ae.getHeight();    	ai.targetHeight = target.getHeight();            Hex attHex = game.board.getHex(ae.getPosition());        Hex targetHex = game.board.getHex(target.getPosition());                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();        }    	        ai.attackAbsHeight = attEl;        ai.targetAbsHeight = targEl;                boolean attUnderWater = attHex.contains(Terrain.WATER) &&         						attHex.depth() > 0 &&         						attEl < attHex.surface();        boolean attInWater = attHex.contains(Terrain.WATER) &&        						attHex.depth() > 0 &&         						attEl == attHex.surface();        boolean attOnLand = !(attUnderWater || attInWater);                boolean targetUnderWater = targetHex.contains(Terrain.WATER) &&         						targetHex.depth() > 0 &&         						targEl < targetHex.surface();        boolean targetInWater = targetHex.contains(Terrain.WATER) &&        						targetHex.depth() > 0 &&         						targEl == targetHex.surface();        boolean targetOnLand = !(targetUnderWater || targetInWater);		        boolean underWaterCombat = targetUnderWater || attUnderWater;                ai.attUnderWater = attUnderWater;        ai.attInWater = attInWater;        ai.attOnLand = attOnLand;        ai.targetUnderWater = targetUnderWater;        ai.targetInWater = targetInWater;        ai.targetOnLand = targetOnLand;        ai.underWaterCombat = underWaterCombat;        		return calculateLos(game, ai);    }