Examples of terrainsPresent()


Examples of megamek.common.IHex.terrainsPresent()

                if(entity instanceof Mech) {
                    doSkillCheckWhileMoving(entity, lastPos, curPos, rollTarget, true);
                } else if (entity instanceof Tank) {
                    if(0 < doSkillCheckWhileMoving(entity, lastPos, curPos, rollTarget, false)) {
                        //assume VTOLs in flight are always in clear terrain
                        if((0 == curHex.terrainsPresent()) || (step.getElevation() > 0)) {
                            r = new Report(2206);
                            r.addDesc(entity);
                            r.subject = entity.getId();
                            addReport(r);
                            mpUsed = step.getMpUsed() + 1;
View Full Code Here

Examples of megamek.common.IHex.terrainsPresent()

                    r.addDesc(entity);
                    r.subject = entity.getId();
                    vPhaseReport.add(r);
                    // when no clear or pavement, crash
                    IHex hex = game.getBoard().getHex(curPos);
                    if (!hex.hasPavement() && (hex.terrainsPresent() > 0)) {
                        // crash
                        r = new Report(2124);
                        r.addDesc(entity);
                        r.subject = entity.getId();
                        vPhaseReport.add(r);
View Full Code Here

Examples of megamek.common.IHex.terrainsPresent()

                    }
                }
                field.addTerrain(f.createTerrain(Terrains.ICE, 1));
            } else if (field.containsTerrain(Terrains.SWAMP)) {
                field.removeTerrain(Terrains.SWAMP);
                if (field.terrainsPresent() == 0) {
                    if (Compute.randomInt(100) < 30) {
                        // if no other terrains present, 30% chance to change to
                        // rough
                        field.addTerrain(f.createTerrain(Terrains.ROUGH, 1));
                    } else {
View Full Code Here

Examples of megamek.common.IHex.terrainsPresent()

        for (n = 0; n < hexSet.length; n++) {
            field = hexSet[n];
            if (field.containsTerrain(Terrains.SWAMP)) {
                field.removeTerrain(Terrains.SWAMP); // any swamps are dried
                                                        // up to hardened mud
                if (field.terrainsPresent() == 0 && Compute.randomInt(100) < 30) {
                    // if no other terrains present, 30% chance to change to
                    // rough
                    field.addTerrain(f.createTerrain(Terrains.ROUGH, 1));
                }
            }
View Full Code Here

Examples of megamek.common.IHex.terrainsPresent()

                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
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.