Package megamek.common

Examples of megamek.common.Entity.height()


                toHit.addModifier(-2, "target prone and adjacent");
            }

            IHex targHex = game.getBoard().getHex(te.getPosition());
            // water partial cover?
            if ((te.height() > 0) && (te.getElevation() == -1)
                    && (targHex.terrainLevel(Terrains.WATER) == te.height())) {
                toHit.addModifier(1, "target has partial cover");
            }

            // Pilot skills
View Full Code Here


            }

            IHex targHex = game.getBoard().getHex(te.getPosition());
            // water partial cover?
            if ((te.height() > 0) && (te.getElevation() == -1)
                    && (targHex.terrainLevel(Terrains.WATER) == te.height())) {
                toHit.addModifier(1, "target has partial cover");
            }

            // Pilot skills
            Compute.modifyPhysicalBTHForAdvantages(ae, te, toHit, game);
View Full Code Here

        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

        LosEffects.AttackInfo ai = new LosEffects.AttackInfo();
        ai.attackPos = src;
        ai.targetPos = coords;
        boolean mechInFirst  = (s != null? s.height() == 1 : GUIPreferences.getInstance().getMechInFirst());
        boolean mechInSecond = (t != null? t.height() == 1 : GUIPreferences.getInstance().getMechInSecond());
        ai.attackHeight = s != null? s.height() : mechInFirst?  1 : 0;
        ai.targetHeight = t != null? t.height() : mechInSecond? 1 : 0;
        if (los == null && s != null) {
            // no need to mention the attacker: it's the unit showing in the MechDisplay
            ai.attackAbsHeight = game.getBoard().getHex(src).floor() + s.absHeight();
View Full Code Here

        ai.attackPos = src;
        ai.targetPos = coords;
        boolean mechInFirst  = (s != null? s.height() == 1 : GUIPreferences.getInstance().getMechInFirst());
        boolean mechInSecond = (t != null? t.height() == 1 : GUIPreferences.getInstance().getMechInSecond());
        ai.attackHeight = s != null? s.height() : mechInFirst?  1 : 0;
        ai.targetHeight = t != null? t.height() : mechInSecond? 1 : 0;
        if (los == null && s != null) {
            // no need to mention the attacker: it's the unit showing in the MechDisplay
            ai.attackAbsHeight = game.getBoard().getHex(src).floor() + s.absHeight();
            ai.targetAbsHeight = game.getBoard().getHex(coords).floor() + (t == null? 0 : t.absHeight());
        } else {
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.