if (hex.contains(Terrain.SMOKE)) { toHit.addModifier(2, "target in smoke");
if (!game.getOptions().booleanOption("maxtech_fire")) { if (hex.contains(Terrain.SMOKE)) { toHit.addModifier(2, "target in smoke"); } else if (hex.levelOf(Terrain.WOODS) == 1) { toHit.addModifier(1, "target in light woods"); } else if (hex.levelOf(Terrain.WOODS) > 1) { toHit.addModifier(2, "target in heavy woods"); } return toHit; } else { if (hex.levelOf(Terrain.SMOKE) == 1) { toHit.addModifier(1, "target in light smoke"); } else if (hex.levelOf(Terrain.SMOKE) > 1) { toHit.addModifier(2, "target in heavy smoke"); }  if (hex.levelOf(Terrain.WOODS) == 1) { toHit.addModifier(1, "target in light woods"); } else if (hex.levelOf(Terrain.WOODS) > 1) { toHit.addModifier(2, "target in heavy woods"); } return toHit;
    public static ToHitData getTargetTerrainModifier(Game game, Targetable t) {        Entity entityTarget = null;        if (t.getTargetType() == Targetable.TYPE_ENTITY) {            entityTarget = (Entity) t;        }        final Hex hex = game.board.getHex(t.getPosition());        // 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.levelOf(Terrain.WATER) > 0        && entityTarget.getMovementType() != Entity.MovementType.HOVER) {            toHit.addModifier(-1, "target in water");        }        if (hex.contains(Terrain.SMOKE)) {            toHit.addModifier(2, "target in smoke");        }        else if (hex.levelOf(Terrain.WOODS) == 1) {            toHit.addModifier(1, "target in light woods");        } else if (hex.levelOf(Terrain.WOODS) > 1) {            toHit.addModifier(2, "target in heavy woods");        }        return toHit;    }