Examples of Mech


Examples of megamek.common.Mech

        }
    }

    private void parseAutoEject(Entity entity, String eject) {
        if (entity instanceof Mech) {
            Mech mech = (Mech) entity;
            mech.setAutoEject(Boolean.valueOf(eject).booleanValue());
        }
    }
View Full Code Here

Examples of megamek.common.Mech

            }
        }

        if (md.hasActiveMASC() && GUIPreferences.getInstance().getNagForMASC()) {
            // pop up are you sure dialog
            Mech m = (Mech) ce();
            ConfirmDialog nag = new ConfirmDialog(clientgui.frame,
                    Messages.getString("MovementDisplay.areYouSure"), //$NON-NLS-1$
                    Messages
                            .getString(
                                    "MovementDisplay.ConfirmMoveRoll", new Object[] { new Integer(m.getMASCTarget()) }), //$NON-NLS-1$
                    true);
            nag.setVisible(true);
            if (nag.getAnswer()) {
                // do they want to be bothered again?
                if (!nag.getShowAgain()) {
View Full Code Here

Examples of megamek.common.Mech

            }
        }

        if (md.hasActiveMASC() && GUIPreferences.getInstance().getNagForMASC()) {
            // pop up are you sure dialog
            Mech m = (Mech) ce();
            ConfirmDialog nag = new ConfirmDialog(clientgui.frame, Messages.getString("MovementDisplay.areYouSure"), //$NON-NLS-1$
                    Messages.getString("MovementDisplay.ConfirmMoveRoll", new Object[] { new Integer(m.getMASCTarget()) }), //$NON-NLS-1$
                    true);
            nag.setVisible(true);
            if (nag.getAnswer()) {
                // do they want to be bothered again?
                if (!nag.getShowAgain()) {
View Full Code Here

Examples of megamek.common.Mech

    public Vector<BackGroundDrawer> getBackgroundDrawers() {
        return bgDrawers;
    }

    public void setEntity(Entity e) {
        Mech m = (Mech) e;
        boolean mtHeat = false;
        if (e.getGame() != null
                && e.getGame().getOptions().booleanOption("tacops_heat")) {
            mtHeat = true;
        }
        int a = 1;
        int a0 = 1;
        for (int i = 0; i < m.locations(); i++) {
            a = m.getArmor(i);
            a0 = m.getOArmor(i);
            vLabels[i].setValue(m.getArmorString(i));
            WidgetUtils.setAreaColor(areas[i], vLabels[i], (double) a
                    / (double) a0);
            if (m.hasRearArmor(i)) {
                a = m.getArmor(i, true);
                a0 = m.getOArmor(i, true);
                vLabels[i + REAR_AREA_OFFSET].setValue(m
                        .getArmorString(i, true));
                WidgetUtils.setAreaColor(areas[i + REAR_AREA_OFFSET], vLabels[i
                        + REAR_AREA_OFFSET], (double) a / (double) a0);
            }
            a = m.getInternal(i);
            a0 = m.getOInternal(i);
            vLabels[i + INT_STRUCTURE_OFFSET].setValue(m.getInternalString(i));
            WidgetUtils.setAreaColor(areas[i + INT_STRUCTURE_OFFSET], vLabels[i
                    + INT_STRUCTURE_OFFSET], (double) a / (double) a0);
        }

        // heat
View Full Code Here

Examples of megamek.common.Mech

    public Vector<BackGroundDrawer> getBackgroundDrawers() {
        return bgDrawers;
    }

    public void setEntity(Entity e) {
        Mech m = (Mech) e;
        boolean mtHeat = false;
        if (e.getGame() != null
                && e.getGame().getOptions().booleanOption("tacops_heat")) {
            mtHeat = true;
        }
        int a = 1;
        int a0 = 1;
        for (int i = 0; i < m.locations(); i++) {
            a = m.getArmor(i);
            a0 = m.getOArmor(i);
            vLabels[i].setValue(m.getArmorString(i));
            WidgetUtils.setAreaColor(areas[i], vLabels[i], (double) a
                    / (double) a0);
            if (m.hasRearArmor(i)) {
                a = m.getArmor(i, true);
                a0 = m.getOArmor(i, true);
                vLabels[i + REAR_AREA_OFFSET].setValue(m
                        .getArmorString(i, true));
                WidgetUtils.setAreaColor(areas[i + REAR_AREA_OFFSET], vLabels[i
                        + REAR_AREA_OFFSET], (double) a / (double) a0);
            }
            a = m.getInternal(i);
            a0 = m.getOInternal(i);
            vLabels[i + INT_STRUCTURE_OFFSET].setValue(m.getInternalString(i));
            WidgetUtils.setAreaColor(areas[i + INT_STRUCTURE_OFFSET], vLabels[i
                    + INT_STRUCTURE_OFFSET], (double) a / (double) a0);
        }

        // heat
View Full Code Here

Examples of megamek.common.Mech

    public Vector<BackGroundDrawer> getBackgroundDrawers() {
        return bgDrawers;
    }

    public void setEntity(Entity e) {
        Mech m = (Mech) e;
        boolean mtHeat = false;
        if (e.getGame() != null
                && e.getGame().getOptions().booleanOption("tacops_heat")) {
            mtHeat = true;
        }
        int a = 1;
        int a0 = 1;
        for (int i = 0; i < m.locations(); i++) {
            if (i == Mech.LOC_LARM || i == Mech.LOC_RARM) {
                continue;
            }
            a = m.getArmor(i);
            a0 = m.getOArmor(i);
            vLabels[i].setValue(m.getArmorString(i));
            WidgetUtils.setAreaColor(areas[i], vLabels[i], (double) a
                    / (double) a0);
            if (m.hasRearArmor(i)) {
                a = m.getArmor(i, true);
                a0 = m.getOArmor(i, true);
                vLabels[i + REAR_AREA_OFFSET].setValue(m
                        .getArmorString(i, true));
                WidgetUtils.setAreaColor(areas[i + REAR_AREA_OFFSET], vLabels[i
                        + REAR_AREA_OFFSET], (double) a / (double) a0);
            }
            a = m.getInternal(i);
            a0 = m.getOInternal(i);
            vLabels[i + INT_STRUCTURE_OFFSET].setValue(m.getInternalString(i));
            WidgetUtils.setAreaColor(areas[i + INT_STRUCTURE_OFFSET], vLabels[i
                    + INT_STRUCTURE_OFFSET], (double) a / (double) a0);
        }

        // heat
View Full Code Here

Examples of megamek.common.Mech

    public Vector<BackGroundDrawer> getBackgroundDrawers() {
        return bgDrawers;
    }

    public void setEntity(Entity e) {
        Mech m = (Mech) e;
        boolean mtHeat = false;
        if (e.getGame() != null
                && e.getGame().getOptions().booleanOption("tacops_heat")) {
            mtHeat = true;
        }
        int a = 1;
        int a0 = 1;
        for (int i = 0; i < m.locations(); i++) {
            if (i == Mech.LOC_LARM || i == Mech.LOC_RARM) {
                continue;
            }
            a = m.getArmor(i);
            a0 = m.getOArmor(i);
            vLabels[i].setValue(m.getArmorString(i));
            WidgetUtils.setAreaColor(areas[i], vLabels[i], (double) a
                    / (double) a0);
            if (m.hasRearArmor(i)) {
                a = m.getArmor(i, true);
                a0 = m.getOArmor(i, true);
                vLabels[i + REAR_AREA_OFFSET].setValue(m
                        .getArmorString(i, true));
                WidgetUtils.setAreaColor(areas[i + REAR_AREA_OFFSET], vLabels[i
                        + REAR_AREA_OFFSET], (double) a / (double) a0);
            }
            a = m.getInternal(i);
            a0 = m.getOInternal(i);
            vLabels[i + INT_STRUCTURE_OFFSET].setValue(m.getInternalString(i));
            WidgetUtils.setAreaColor(areas[i + INT_STRUCTURE_OFFSET], vLabels[i
                    + INT_STRUCTURE_OFFSET], (double) a / (double) a0);
        }

        // heat
View Full Code Here

Examples of megamek.common.Mech

            }

        }

        if ( grappleSide != Entity.GRAPPLE_BOTH && ae instanceof Mech ) {
            Mech attacker = (Mech)ae;
           
            if ( attacker.hasTSM() && attacker.heat >= 9
                    && ( !(te instanceof Mech) || !((Mech)te).hasTSM() || (((Mech)te).hasTSM() && te.heat < 9))) {
                toHit.addModifier(-2, "TSM Active Bonus");
            }
        }
       
View Full Code Here

Examples of megamek.common.Mech

    public Vector<BackGroundDrawer> getBackgroundDrawers() {
        return bgDrawers;
    }

    public void setEntity(Entity e) {
        Mech m = (Mech) e;
        boolean mtHeat = false;
        if ((e.getGame() != null)
                && e.getGame().getOptions().booleanOption("tacops_heat")) {
            mtHeat = true;
        }
        int a = 1;
        int a0 = 1;
        for (int i = 0; i < m.locations(); i++) {
            a = m.getArmor(i);
            a0 = m.getOArmor(i);
            vLabels[i].setValue(m.getArmorString(i));
            WidgetUtils.setAreaColor(areas[i], vLabels[i], (double) a
                    / (double) a0);
            if (m.hasRearArmor(i)) {
                a = m.getArmor(i, true);
                a0 = m.getOArmor(i, true);
                vLabels[i + REAR_AREA_OFFSET].setValue(m
                        .getArmorString(i, true));
                WidgetUtils.setAreaColor(areas[i + REAR_AREA_OFFSET], vLabels[i
                        + REAR_AREA_OFFSET], (double) a / (double) a0);
            }
            a = m.getInternal(i);
            a0 = m.getOInternal(i);
            vLabels[i + INT_STRUCTURE_OFFSET].setValue(m.getInternalString(i));
            WidgetUtils.setAreaColor(areas[i + INT_STRUCTURE_OFFSET], vLabels[i
                    + INT_STRUCTURE_OFFSET], (double) a / (double) a0);
        }

        // heat
        vLabels[19].setValue(Integer.toString(m.heat));
        drawHeatControl(m.heat, mtHeat);
        //TODO: this messes up the layout a bit, but only for industrial
        // mechs FIXME
        if (m.hasBARArmor()) {
            content.addArea(labels[19]);
            content.addArea(vLabels[20]);
            vLabels[20].setValue(String.valueOf(m.getBARRating()));
        } else {
            content.removeArea(labels[19]);
            content.removeArea(vLabels[20]);
        }
    }
View Full Code Here

Examples of megamek.common.Mech

        if (tagCount > 1) {
            buff.append("Unit has more than one TAG\n");
            illegal = true;
        }
        if (getEntity() instanceof Mech) {
            Mech mech = (Mech)getEntity();
            //TODO: disallow the weapons on quads, except unless it's one per
            // side torso
            for (int loc = Mech.LOC_RARM; loc <= Mech.LOC_LARM; loc++) {
                if (mech.hasSystem(Mech.ACTUATOR_HAND, loc)) {
                    for (Mounted m : mech.getMisc()) {
                        EquipmentType et = m.getType();
                        if ((m.getLocation() == loc) &&
                                (et.hasSubType(MiscType.S_CHAINSAW)
                                || et.hasSubType(MiscType.S_BACKHOE)
                                || et.hasSubType(MiscType.S_DUAL_SAW)
                                || et.hasSubType(MiscType.S_COMBINE)
                                || et.hasSubType(MiscType.S_PILE_DRIVER)
                                || et.hasSubType(MiscType.S_MINING_DRILL)
                                || et.hasSubType(MiscType.S_ROCK_CUTTER)
                                || et.hasSubType(MiscType.S_SPOT_WELDER)
                                || et.hasSubType(MiscType.S_WRECKING_BALL)
                                || et.hasFlag(MiscType.F_SALVAGE_ARM))) {
                            buff.append("Unit mounts hand-actuator incompatible system in arm with hand\n");
                            illegal = true;
                        }
                    }
                }
            }

            if (mech.hasNullSig()) {
                if (mech.hasStealth()) {
                    buff.append("Unit mounts both null-signature-system and stealth armor\n");
                    illegal = true;
                }
                if (mech.hasTargComp()) {
                    buff.append("Unit mounts both null-signature-system and targeting computer\n");
                    illegal = true;
                }
                if (mech.hasVoidSig()) {
                    buff.append("Unit mounts both null-signature-system and void-signature-system\n");
                    illegal = true;
                }
                if (mech.hasC3()) {
                    buff.append("Unit mounts both null-signature-system and a c3 system\n");
                    illegal = true;
                }
            }
            if (mech.hasVoidSig()) {
                if (mech.hasStealth()) {
                    buff.append("Unit mounts both void-signature-system and stealth armor\n");
                    illegal = true;
                }
                if (mech.hasTargComp()) {
                    buff.append("Unit mounts both void-signature-system and targeting computer\n");
                    illegal = true;
                }
                if (mech.hasC3()) {
                    buff.append("Unit mounts both void-signature-system and a c3 system\n");
                    illegal = true;
                }
                if (mech.hasChameleonShield()) {
                    buff.append("Unit mounts both void-signature-system and a chameleon light polarisation shield\n");
                    illegal = true;
                }
            }
            if (mech.hasChameleonShield() && mech.hasStealth()) {
                buff.append("Unit mounts both chameleon-light-polarization-system and stealth armor\n");
                illegal = true;
            }
            if (mech.isIndustrial()) {
                if (mech.hasTSM()) {
                    buff.append("industrial mech can't mount normal TSM");
                    illegal = true;
                }
                if (mech.hasMASC()) {
                    buff.append("industrial mech can't mount MASC");
                    illegal = true;
                }
                if ((mech.getCockpitType() == Mech.COCKPIT_INDUSTRIAL) || (mech.getCockpitType() == Mech.COCKPIT_PRIMITIVE_INDUSTRIAL)) {
                    if (mech.hasC3()) {
                        buff.append("industrial mech without advanced fire control can't use c3 computer");
                        illegal = true;
                    }
                    if (mech.hasTargComp()) {
                        buff.append("industrial mech without advanced fire control can't use targeting computer");
                        illegal = true;
                    }
                    if (mech.hasBAP()) {
                        buff.append("industrial mech without advanced fire control can't use BAP");
                        illegal = true;
                    }
                    for (Mounted mounted : mech.getMisc()) {
                        if (mounted.getType().hasFlag(MiscType.F_ARTEMIS)) {
                            buff.append("industrial mech without advanced fire control can't use artemis");
                            illegal = true;
                        }
                    }
                    if ((mech.getJumpType() != Mech.JUMP_STANDARD) && (mech.getJumpType() != Mech.JUMP_NONE)) {
                        buff.append("industrial mechs can only mount standard jump jets");
                        illegal = true;
                    }
                    if (mech.getGyroType() != Mech.GYRO_STANDARD) {
                        buff.append("industrial mechs can only mount standard gyros");
                        illegal = true;
                    }
                }
            } else {
                if (mech.hasIndustrialTSM()) {
                    buff.append("standard mech can't mount industrial TSM");
                    illegal = true;
                }
                if (mech.hasEnvironmentalSealing()) {
                    buff.append("standard mech can't mount environmental sealing");
                    illegal = true;
                }
            }
            if (mech.isPrimitive()) {
                if (mech.isOmni()) {
                    buff.append("primitive mechs can't be omnis");
                    illegal = true;
                }
                if (!((mech.getStructureType() == EquipmentType.T_STRUCTURE_STANDARD) || (mech.getStructureType() == EquipmentType.T_STRUCTURE_INDUSTRIAL))) {
                    buff.append("primitive mechs can't mount advanced inner structure");
                    illegal = true;
                }
                if ((mech.getEngine().getEngineType() == Engine.XL_ENGINE) ||
                        (mech.getEngine().getEngineType() == Engine.LIGHT_ENGINE) ||
                        (mech.getEngine().getEngineType() == Engine.COMPACT_ENGINE) ||
                        mech.getEngine().hasFlag(Engine.LARGE_ENGINE) ||
                        (mech.getEngine().getEngineType() == Engine.XXL_ENGINE)) {
                    buff.append("primitive mechs can't mount XL, Light, Compact, XXL or Large Engines");
                    illegal = true;
                }
                if (mech.hasMASC() || mech.hasTSM()) {
                    buff.append("primitive mechs can't mount advanced myomers");
                    illegal = true;
                }
                if (mech.isIndustrial()) {
                    if (mech.getArmorType() != EquipmentType.T_ARMOR_COMMERCIAL) {
                        buff.append("primitive industrialmechs must mount commercial armor");
                        illegal = true;
                    }
                } else {
                    if (mech.getArmorType() != EquipmentType.T_ARMOR_INDUSTRIAL) {
                        buff.append("primitive battlemechs must mount primitive battlemech (industrial) armor");
                        illegal = true;
                    }
                }
            }
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.