Examples of surface()


Examples of megamek.common.IHex.surface()

                        if (nextHex.containsTerrain(Terrains.WATER)) {
                            nextAltitude = nextHex.surface();
                        }
                    } else {
                        if (nextHex.containsTerrain(Terrains.ICE)) {
                            nextAltitude = nextHex.surface();
                        }
                    }
                }
            }
View Full Code Here

Examples of megamek.common.IHex.surface()

                    }
                }
            }

            // The elevation the skidding unit will occupy in next hex
            int nextElevation = nextAltitude - nextHex.surface();

            boolean crashedIntoTerrain = curAltitude < nextAltitude;
            if (entity.getMovementMode() == IEntityMovementMode.VTOL) {
                if ((nextElevation == 0) || ((nextElevation == 1) && (nextHex.containsTerrain(Terrains.WOODS) || nextHex.containsTerrain(Terrains.JUNGLE)))) {
                    crashedIntoTerrain = true;
View Full Code Here

Examples of megamek.common.IHex.surface()

        IHex hex = game.getBoard().getHex(coords);
        if (hex == null) {
            return; // not on board.
        }

        int flakElevation = altitude - hex.surface();

        Report r;

        if (!flak) {
            vPhaseReport.addAll(tryClearHex(coords, damage * 2, subjectId));
View Full Code Here

Examples of megamek.common.IHex.surface()

            return;
        }

        IHex eh = gboard.getHex(e);

        ruler = new ConnectionModel(s, e, sh.surface() + 1, eh.surface() + 1, null,
                new Color3f(ec), 0.5f);
        secondLOSCursor.move(e, eh);
        secondLOSCursor.setColor(new Color3f(ec));
        cursors.addChild(ruler);
    }
View Full Code Here

Examples of megamek.common.IHex.surface()

            adjustment *= self.overall_armor_percent * self.strategy.attack / enemy_array.size();
            // fix for hiding in level 2 water
            // To a greedy bot, it always seems nice to stay in here...
            IHex h = game.getBoard().getHex(option.getFinalCoords());
            if (h.containsTerrain(Terrains.WATER)
                    && h.surface() > (self.getEntity().getElevation() + ((option.getFinalProne()) ? 0
                            : 1))) {
                double mod = (self.getEntity().heat + option.getMovementheatBuildup() <= 7) ? 100
                        : 30;
                adjustment += self.bv / mod;
            }
View Full Code Here

Examples of megamek.common.IHex.surface()

            toHitd.append(Compute.getTargetTerrainModifier(game, ae));
        }
        toHitd.append(Compute.getAttackerTerrainModifier(game, te.getId()));

        IHex attHex = game.getBoard().getHex(ae.getPosition());
        if (attHex.containsTerrain(Terrains.WATER) && (attHex.surface() > attEl)) {
            toHita.addModifier(TargetRoll.IMPOSSIBLE,
                    "Attacker in depth 2+ water");
            toHitd.addModifier(TargetRoll.IMPOSSIBLE,
                    "Defender in depth 2+ water");
        } else if ((attHex.surface() == attEl) && (ae.height() > 0)) {
View Full Code Here

Examples of megamek.common.IHex.surface()

        if (attHex.containsTerrain(Terrains.WATER) && (attHex.surface() > attEl)) {
            toHita.addModifier(TargetRoll.IMPOSSIBLE,
                    "Attacker in depth 2+ water");
            toHitd.addModifier(TargetRoll.IMPOSSIBLE,
                    "Defender in depth 2+ water");
        } else if ((attHex.surface() == attEl) && (ae.height() > 0)) {
            apc = true;
        }
        IHex targHex = game.getBoard().getHex(te.getPosition());
        if (targHex.containsTerrain(Terrains.WATER)) {
            if ((targHex.surface() == targEl) && (te.height() > 0)) {
View Full Code Here

Examples of megamek.common.IHex.surface()

        } else if ((attHex.surface() == attEl) && (ae.height() > 0)) {
            apc = true;
        }
        IHex targHex = game.getBoard().getHex(te.getPosition());
        if (targHex.containsTerrain(Terrains.WATER)) {
            if ((targHex.surface() == targEl) && (te.height() > 0)) {
                pc = true;
            } else if (targHex.surface() > targEl) {
                toHita.addModifier(TargetRoll.IMPOSSIBLE,
                        "Attacker in depth 2+ water");
                toHitd.addModifier(TargetRoll.IMPOSSIBLE,
View Full Code Here

Examples of megamek.common.IHex.surface()

        }
        IHex targHex = game.getBoard().getHex(te.getPosition());
        if (targHex.containsTerrain(Terrains.WATER)) {
            if ((targHex.surface() == targEl) && (te.height() > 0)) {
                pc = true;
            } else if (targHex.surface() > targEl) {
                toHita.addModifier(TargetRoll.IMPOSSIBLE,
                        "Attacker in depth 2+ water");
                toHitd.addModifier(TargetRoll.IMPOSSIBLE,
                        "Defender in depth 2+ water");
            }
View Full Code Here

Examples of megamek.common.IHex.surface()

                scores[i] += 10;
            }
            if (hex.containsTerrain(Terrains.WATER)) {
                scores[i] += hex.terrainLevel(Terrains.WATER);
            }
            if (curHex.surface() - hex.surface() >= 2) {
                scores[i] += 2 * (curHex.surface() - hex.surface());
            }
        }

        int bestScore = 99999;
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.