Examples of containsTerrain()


Examples of megamek.common.IHex.containsTerrain()

                    // ANY non-water hex that takes 200 becomes rough.
                    if ((damageAtRange >= 200) && (!myHex.containsTerrain(Terrains.WATER))) {
                        myHex.removeAllTerrains();
                        myHex.clearExits();
                        myHex.addTerrain(new Terrain(Terrains.ROUGH, 1));
                    } else if ((damageAtRange >= 20) && ((myHex.containsTerrain(Terrains.WOODS)) || (myHex.containsTerrain(Terrains.JUNGLE)))) {
                        // Each 20 clears woods by 1 level.
                        int numCleared = damageAtRange / 20;
                        int terrainType = (myHex.containsTerrain(Terrains.WOODS) ? Terrains.WOODS : Terrains.JUNGLE);
                        int oldLevel = myHex.terrainLevel(terrainType);
                        myHex.removeTerrain(terrainType);
View Full Code Here

Examples of megamek.common.IHex.containsTerrain()

                    // ANY non-water hex that takes 200 becomes rough.
                    if ((damageAtRange >= 200) && (!myHex.containsTerrain(Terrains.WATER))) {
                        myHex.removeAllTerrains();
                        myHex.clearExits();
                        myHex.addTerrain(new Terrain(Terrains.ROUGH, 1));
                    } else if ((damageAtRange >= 20) && ((myHex.containsTerrain(Terrains.WOODS)) || (myHex.containsTerrain(Terrains.JUNGLE)))) {
                        // Each 20 clears woods by 1 level.
                        int numCleared = damageAtRange / 20;
                        int terrainType = (myHex.containsTerrain(Terrains.WOODS) ? Terrains.WOODS : Terrains.JUNGLE);
                        int oldLevel = myHex.terrainLevel(terrainType);
                        myHex.removeTerrain(terrainType);
View Full Code Here

Examples of megamek.common.IHex.containsTerrain()

                        myHex.clearExits();
                        myHex.addTerrain(new Terrain(Terrains.ROUGH, 1));
                    } else if ((damageAtRange >= 20) && ((myHex.containsTerrain(Terrains.WOODS)) || (myHex.containsTerrain(Terrains.JUNGLE)))) {
                        // Each 20 clears woods by 1 level.
                        int numCleared = damageAtRange / 20;
                        int terrainType = (myHex.containsTerrain(Terrains.WOODS) ? Terrains.WOODS : Terrains.JUNGLE);
                        int oldLevel = myHex.terrainLevel(terrainType);
                        myHex.removeTerrain(terrainType);
                        if (oldLevel > numCleared) {
                            myHex.addTerrain(new Terrain(terrainType, oldLevel - numCleared));
                        }
View Full Code Here

Examples of megamek.common.IHex.containsTerrain()

     */
    public void deliverArtilleryInferno(Coords coords, Entity ae, int subjectId, Vector<Report> vPhaseReport) {
        IHex h = game.getBoard().getHex(coords);
        Report r;
        // Unless there is a fire in the hex already, start one.
        if (!h.containsTerrain(Terrains.FIRE)) {
            ignite(coords, true, vPhaseReport);
        }
        //possibly melt ice and snow
        if(h.containsTerrain(Terrains.ICE) || h.containsTerrain(Terrains.SNOW)) {
            vPhaseReport.addAll(meltIceAndSnow(coords, subjectId));
View Full Code Here

Examples of megamek.common.IHex.containsTerrain()

        // Unless there is a fire in the hex already, start one.
        if (!h.containsTerrain(Terrains.FIRE)) {
            ignite(coords, true, vPhaseReport);
        }
        //possibly melt ice and snow
        if(h.containsTerrain(Terrains.ICE) || h.containsTerrain(Terrains.SNOW)) {
            vPhaseReport.addAll(meltIceAndSnow(coords, subjectId));
        }
        for (Enumeration<Entity> impactHexHits = game.getEntities(coords); impactHexHits.hasMoreElements();) {
            Entity entity = impactHexHits.nextElement();
            //TacOps, p. 356 - treat as if hit by 5 inferno missiles
View Full Code Here

Examples of megamek.common.IHex.containsTerrain()

        // Unless there is a fire in the hex already, start one.
        if (!h.containsTerrain(Terrains.FIRE)) {
            ignite(coords, true, vPhaseReport);
        }
        //possibly melt ice and snow
        if(h.containsTerrain(Terrains.ICE) || h.containsTerrain(Terrains.SNOW)) {
            vPhaseReport.addAll(meltIceAndSnow(coords, subjectId));
        }
        for (Enumeration<Entity> impactHexHits = game.getEntities(coords); impactHexHits.hasMoreElements();) {
            Entity entity = impactHexHits.nextElement();
            //TacOps, p. 356 - treat as if hit by 5 inferno missiles
View Full Code Here

Examples of megamek.common.IHex.containsTerrain()

            if (coords.equals(tempcoords)) {
                continue;
            }
            h = game.getBoard().getHex(tempcoords);
            // Unless there is a fire in the hex already, start one.
            if (!h.containsTerrain(Terrains.FIRE)) {
                ignite(tempcoords, true, vPhaseReport);
            }
            //possibly melt ice and snow
            if(h.containsTerrain(Terrains.ICE) || h.containsTerrain(Terrains.SNOW)) {
                vPhaseReport.addAll(meltIceAndSnow(tempcoords, subjectId));
View Full Code Here

Examples of megamek.common.IHex.containsTerrain()

            // Unless there is a fire in the hex already, start one.
            if (!h.containsTerrain(Terrains.FIRE)) {
                ignite(tempcoords, true, vPhaseReport);
            }
            //possibly melt ice and snow
            if(h.containsTerrain(Terrains.ICE) || h.containsTerrain(Terrains.SNOW)) {
                vPhaseReport.addAll(meltIceAndSnow(tempcoords, subjectId));
            }
            for (Enumeration<Entity> splashHexHits = game.getEntities(tempcoords); splashHexHits.hasMoreElements();) {
                Entity entity = splashHexHits.nextElement();
                r = new Report(6695);
View Full Code Here

Examples of megamek.common.IHex.containsTerrain()

            // Unless there is a fire in the hex already, start one.
            if (!h.containsTerrain(Terrains.FIRE)) {
                ignite(tempcoords, true, vPhaseReport);
            }
            //possibly melt ice and snow
            if(h.containsTerrain(Terrains.ICE) || h.containsTerrain(Terrains.SNOW)) {
                vPhaseReport.addAll(meltIceAndSnow(tempcoords, subjectId));
            }
            for (Enumeration<Entity> splashHexHits = game.getEntities(tempcoords); splashHexHits.hasMoreElements();) {
                Entity entity = splashHexHits.nextElement();
                r = new Report(6695);
View Full Code Here

Examples of megamek.common.IHex.containsTerrain()

        // Start a fire in the hex?
        IHex hex = game.getBoard().getHex(coords);
        Report r = new Report(2170);
        r.subject = entity.getId();
        r.addDesc(entity);
        if (!hex.containsTerrain(Terrains.FIRE)) {
            r.messageId = 2175;
            ignite(coords, true, null);
        }
        addReport(r);
    }
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.