Package megamek.common

Examples of megamek.common.IHex.terrainLevel()


                    if(!currentHex.containsTerrain(Terrains.MUD) && !currentHex.containsTerrain(Terrains.WATER)) {
                        currentHex.addTerrain(tf.createTerrain(Terrains.MUD, 1));
                    }
                }
               
                if(currentHex.terrainLevel(Terrains.SNOW) == 1
                        && currentHex.containsTerrain(Terrains.FIRE) && currentHex.getFireTurn() == 1) {
                    currentHex.removeTerrain(Terrains.SNOW);
                    if(!currentHex.containsTerrain(Terrains.MUD) && !currentHex.containsTerrain(Terrains.WATER)) {
                        currentHex.addTerrain(tf.createTerrain(Terrains.MUD, 1));
                    }
View Full Code Here


                //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));
                        }
                    } else {
                        if(!currentHex.containsTerrain(Terrains.RAPIDS)) {
                            currentHex.addTerrain(tf.createTerrain(Terrains.RAPIDS, 1));
View Full Code Here

                IHex currentHex = board.getHex(currentXCoord, currentYCoord);

                if(currentHex.containsTerrain(Terrains.FIRE)) {
                    //If the woods has been cleared, or the building
                    // has collapsed put non-inferno fires out.
                    if ((currentHex.terrainLevel(Terrains.FIRE) == 1) && !currentHex.isIgnitable()) {
                        server.removeFire(currentCoords, "lack of fuel");
                        continue;
                    }

                    //only check spread for fires that didn't start this turn
View Full Code Here

                                && game.getOptions().booleanOption("woods_burn_down")) {
                            burnDownWoods(currentCoords);
                        }
                        //report and check for fire spread
                        r = new Report(5125, Report.PUBLIC);
                        if (currentHex.terrainLevel(Terrains.FIRE) == 2) {
                            r.messageId = 5130;
                        }
                        r.add(currentCoords.getBoardNum());
                        vPhaseReport.addElement(r);
                        spreadFire(currentXCoord, currentYCoord, windDirection, windStrength);
View Full Code Here

                    //check for any explosions
                    server.checkExplodeIndustrialZone(currentCoords, vPhaseReport);

                    //Add smoke (unless we are in a tornado)
                    boolean bInferno = currentHex.terrainLevel(Terrains.FIRE) == 2;
                    if (game.getPlanetaryConditions().getWindStrength() < PlanetaryConditions.WI_TORNADO_F13) {
                        ArrayList<Coords> smokeList = new ArrayList<Coords>();

                        smokeList.add(new Coords(Coords.xInDir(currentXCoord, currentYCoord, windDirection), Coords.yInDir(currentXCoord, currentYCoord, windDirection)));
                        smokeList.add(new Coords(Coords.xInDir(currentXCoord, currentYCoord, (windDirection+1)%6), Coords.yInDir(currentXCoord, currentYCoord, (windDirection+1)%6)));
View Full Code Here

                // transport
                unit.setElevation(elevation);
            } 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;
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
        int drawX = hexLoc.x; // - boardRect.x;
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
        int drawX = hexLoc.x; // - boardRect.x;
View Full Code Here

        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
        int drawX = hexLoc.x; // - boardRect.x;
        int drawY = hexLoc.y; // - boardRect.y;
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

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.