Package megamek.common

Examples of megamek.common.IHex.terrainLevel()


        // The hex must contain woods or rubble from
        // a medium, heavy, or hardened building,
        // or a blown off limb
        if (hex.terrainLevel(Terrains.WOODS) < 1
                && hex.terrainLevel(Terrains.JUNGLE) < 1
                && hex.terrainLevel(Terrains.RUBBLE) < Building.MEDIUM
                && hex.terrainLevel(Terrains.ARMS) < 1
                && hex.terrainLevel(Terrains.LEGS) < 1) {
            return false;
        }
View Full Code Here


        // The hex must contain woods or rubble from
        // a medium, heavy, or hardened building,
        // or a blown off limb
        if (hex.terrainLevel(Terrains.WOODS) < 1
                && hex.terrainLevel(Terrains.JUNGLE) < 1
                && hex.terrainLevel(Terrains.RUBBLE) < Building.MEDIUM
                && hex.terrainLevel(Terrains.ARMS) < 1
                && hex.terrainLevel(Terrains.LEGS) < 1) {
            return false;
        }
View Full Code Here

        // a medium, heavy, or hardened building,
        // or a blown off limb
        if (hex.terrainLevel(Terrains.WOODS) < 1
                && hex.terrainLevel(Terrains.JUNGLE) < 1
                && hex.terrainLevel(Terrains.RUBBLE) < Building.MEDIUM
                && hex.terrainLevel(Terrains.ARMS) < 1
                && hex.terrainLevel(Terrains.LEGS) < 1) {
            return false;
        }

        // also, need shoulders and hands
View Full Code Here

        // or a blown off limb
        if (hex.terrainLevel(Terrains.WOODS) < 1
                && hex.terrainLevel(Terrains.JUNGLE) < 1
                && hex.terrainLevel(Terrains.RUBBLE) < Building.MEDIUM
                && hex.terrainLevel(Terrains.ARMS) < 1
                && hex.terrainLevel(Terrains.LEGS) < 1) {
            return false;
        }

        // also, need shoulders and hands
        // Claws can subtitue as hands --Torren
View Full Code Here

            if (mhex.containsTerrain(Terrains.FUEL_TANK)) {
                // Get the building.
                Building bldg = game.getBoard().getBuildingAt(mcoords);
                StringBuffer buf = new StringBuffer(Messages.getString("BoardView1.Height")); //$NON-NLS-1$
                // Each hex of a building has its own elevation.
                buf.append(mhex.terrainLevel(Terrains.FUEL_TANK_ELEV));
                buf.append(" "); //$NON-NLS-1$
                buf.append(bldg.toString());
                buf.append(Messages.getString("BoardView1.CF")); //$NON-NLS-1$
                buf.append(bldg.getCurrentCF(mcoords));
                strings[stringsIndex] = buf.toString();
View Full Code Here

            if (mhex.containsTerrain(Terrains.BUILDING)) {
                // Get the building.
                Building bldg = game.getBoard().getBuildingAt(mcoords);
                StringBuffer buf = new StringBuffer(Messages.getString("BoardView1.Height")); //$NON-NLS-1$
                // Each hex of a building has its own elevation.
                buf.append(mhex.terrainLevel(Terrains.BLDG_ELEV));
                buf.append(" "); //$NON-NLS-1$
                buf.append(bldg.toString());
                buf.append(Messages.getString("BoardView1.CF")); //$NON-NLS-1$
                buf.append(bldg.getCurrentCF(mcoords));
                strings[stringsIndex] = buf.toString();
View Full Code Here

            if (mhex.containsTerrain(Terrains.BRIDGE)) {
                // Get the building.
                Building bldg = game.getBoard().getBuildingAt(mcoords);
                StringBuffer buf = new StringBuffer(Messages.getString("BoardView1.Height")); //$NON-NLS-1$
                // Each hex of a building has its own elevation.
                buf.append(mhex.terrainLevel(Terrains.BRIDGE_ELEV));
                buf.append(" "); //$NON-NLS-1$
                buf.append(bldg.toString());
                buf.append(Messages.getString("BoardView1.CF")); //$NON-NLS-1$
                buf.append(bldg.getCurrentCF(mcoords));
                strings[stringsIndex] = buf.toString();
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));
                        }
                    } else {
                        if(!hex.containsTerrain(Terrains.RAPIDS)) {
                            hex.addTerrain(tf.createTerrain(Terrains.RAPIDS, 1));
View Full Code Here

        IHex field;
        ITerrainFactory f = Terrains.getTerrainFactory();
        for (n = 0; n < hexSet.length; n++) {
            field = hexSet[n];
            if (field.containsTerrain(Terrains.WATER)) {
                int level = field.terrainLevel(Terrains.WATER);
                if (modifier != 0) {
                    level -= modifier;
                    field.removeTerrain(Terrains.WATER);
                    if (level > 0) {
                        field.addTerrain(f.createTerrain(Terrains.WATER,
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.