Package megamek.common

Examples of megamek.common.IHex.depth()


        final IHex hex = game.getBoard().getHex(c);
        final Point hexLoc = getHexLocation(c);

        int level = hex.getElevation();
        int depth = hex.depth();
        int height = Math.max(hex.terrainLevel(Terrains.BLDG_ELEV), hex
                .terrainLevel(Terrains.BRIDGE_ELEV));
        height = Math.max(height, hex.terrainLevel(Terrains.INDUSTRIAL));

        // offset drawing point
View Full Code Here


                fallHex.containsTerrainExit(Terrains.BRIDGE,
                        fallPos.direction(entity.getPosition()))) ||
                        (entity.getElevation() == fallHex.terrainLevel(Terrains.BRIDGE_ELEV))) {
            fallOntoBridge = true;
        }
        int bridgeHeight = fallHex.terrainLevel(Terrains.BRIDGE_ELEV) + fallHex.depth();
        int buildingHeight = fallHex.terrainLevel(Terrains.BLDG_ELEV);
        int damageHeight = height;
        int newElevation;

        if ((height >= buildingHeight) && (buildingHeight >= 0)) {
View Full Code Here

                }
               
                //check for rapids/torrents created by wind
                //FIXME: This doesn't seem to be doing anything
                if(conditions.getWindStrength() > PlanetaryConditions.WI_MOD_GALE
                        && currentHex.containsTerrain(Terrains.WATER) && currentHex.depth() > 0) {
                   
                    if(conditions.getWindStrength() > PlanetaryConditions.WI_STORM) {
                        if(!(currentHex.terrainLevel(Terrains.RAPIDS) > 1)) {
                            currentHex.addTerrain(tf.createTerrain(Terrains.RAPIDS, 2));
                        }
View Full Code Here

            } else if (game.getBoard().getBuildingAt(pos) != null) {
                // non-flying unit onloaded from a flying onto a building
                // -> sit on the roff
                unit.setElevation(hex.terrainLevel(Terrains.BLDG_ELEV));
            } else {
                while (elevation >= -hex.depth()) {
                    if (unit.isElevationValid(elevation, hex)) {
                        unit.setElevation(elevation);
                        break;
                    }
                    elevation--;
View Full Code Here

        final IHex hex = game.getBoard().getHex(c);
        final Point hexLoc = getHexLocation(c);

        int level = hex.getElevation();
        int depth = hex.depth();
        int height = Math.max(hex.terrainLevel(Terrains.BLDG_ELEV), hex
                .terrainLevel(Terrains.BRIDGE_ELEV));
        height = Math.max(height, hex.terrainLevel(Terrains.INDUSTRIAL));

        // offset drawing point
View Full Code Here

                Coords c = new Coords(x, y);
                IHex hex = board.getHex(c);
               
                //moderate rain - mud in clear hexes, depth 0 water, and dirt roads (not implemented yet)
                if(weatherCond == PlanetaryConditions.WE_MOD_RAIN) {
                    if(hex.terrainsPresent() == 0 || (hex.containsTerrain(Terrains.WATER) && hex.depth() == 0)) {
                        hex.addTerrain(tf.createTerrain(Terrains.MUD, 1));
                        if(hex.containsTerrain(Terrains.WATER)) {
                            hex.removeTerrain(Terrains.WATER);
                        }
                    }
View Full Code Here

                }  
               
                //heavy rain - mud in all hexes except buildings, depth 1+ water, and non-dirt roads
                //rapids in all depth 1+ water
                if(weatherCond == PlanetaryConditions.WE_HEAVY_RAIN) {
                    if(hex.containsTerrain(Terrains.WATER) && !hex.containsTerrain(Terrains.RAPIDS) && hex.depth() > 0) {
                        hex.addTerrain(tf.createTerrain(Terrains.RAPIDS, 1));
                    }
                    else if(!hex.containsTerrain(Terrains.BUILDING) && !hex.containsTerrain(Terrains.ROAD)) {
                        hex.addTerrain(tf.createTerrain(Terrains.MUD, 1));
                        if(hex.containsTerrain(Terrains.WATER)) {
View Full Code Here

                }
               
                //torrential downpour - mud in all hexes except buildings, depth 1+ water, and non-dirt roads
                //torrent in all depth 1+ water, swamps in all depth 0 water hexes
                if(weatherCond == PlanetaryConditions.WE_DOWNPOUR) {
                    if(hex.containsTerrain(Terrains.WATER) && !(hex.terrainLevel(Terrains.RAPIDS) > 1) && hex.depth() > 0) {
                        hex.addTerrain(tf.createTerrain(Terrains.RAPIDS, 2));
                    }
                    else if(hex.containsTerrain(Terrains.WATER)) {
                        hex.addTerrain(tf.createTerrain(Terrains.SWAMP, 1));
                        hex.removeTerrain(Terrains.WATER);
View Full Code Here

                    }
                }
               
                //check for rapids/torrents created by wind
                if(windCond > PlanetaryConditions.WI_MOD_GALE
                        && hex.containsTerrain(Terrains.WATER) && hex.depth() > 0) {
                   
                    if(windCond > PlanetaryConditions.WI_STORM) {
                        if(!(hex.terrainLevel(Terrains.RAPIDS) > 1)) {
                            hex.addTerrain(tf.createTerrain(Terrains.RAPIDS, 2));
                        }
View Full Code Here

            }
            int depth = 0;
            if (deployM) {
                if (sea) {
                    SeaMineDepthDialog smd = new SeaMineDepthDialog(
                            clientgui.frame, hex.depth());
                    smd.setVisible(true);

                    depth = smd.getDepth();
                }
                MineDensityDialog mfd = new MineDensityDialog(clientgui.frame);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.