if (entityTarget != null && entityTarget.isMakingDfa()) { return null; }
    public static ToHitData getTargetTerrainModifier(IGame game, Targetable t) {        Entity entityTarget = null;        if (t.getTargetType() == Targetable.TYPE_ENTITY) {            entityTarget = (Entity) t;        }        final IHex hex = game.getBoard().getHex(t.getPosition());                boolean isVTOL = entityTarget==null? false : (entityTarget instanceof VTOL);        // you don't get terrain modifiers in midair        // should be abstracted more into a 'not on the ground' flag for vtols and such        if (entityTarget != null && entityTarget.isMakingDfa()) {            return null;        }        ToHitData toHit = new ToHitData();        // only entities get terrain bonuses        // TODO: should this be changed for buildings???        if (entityTarget == null) {            return toHit;        }        if (hex.terrainLevel(Terrains.WATER) > 0        && entityTarget.getMovementMode() != IEntityMovementMode.HOVER) {            toHit.addModifier(-1, "target in water");        }                if (entityTarget.isStuck()) {            toHit.addModifier(-2, "target stuck in swamp");        }        // Smoke and woods. With L3, the effects STACK.        if (!game.getOptions().booleanOption("maxtech_fire")) { // L2            if (hex.containsTerrain(Terrains.SMOKE)) {                toHit.addModifier(2, "target in smoke");            } else if ((hex.terrainLevel(Terrains.WOODS) == 1) && !isVTOL) {                toHit.addModifier(1, "target in light woods");            } else if ((hex.terrainLevel(Terrains.WOODS) > 1) && !isVTOL) {                toHit.addModifier(2, "target in heavy woods");            }            return toHit;        } else { // L3            if (hex.terrainLevel(Terrains.SMOKE) == 1) {                toHit.addModifier(1, "target in light smoke");            } else if (hex.terrainLevel(Terrains.SMOKE) > 1) {                toHit.addModifier(2, "target in heavy smoke");            }                        if(!isVTOL) {                        if (hex.terrainLevel(Terrains.WOODS) == 1) {                toHit.addModifier(1, "target in light woods");            } else if (hex.terrainLevel(Terrains.WOODS) > 1) {                toHit.addModifier(2, "target in heavy woods");            }            }            return toHit;        }    }