Search in sources :

Example 1 with LAMPilot

use of megamek.common.LAMPilot in project megameklab by MegaMek.

the class PrintMech method writeTextFields.

@Override
protected void writeTextFields() {
    super.writeTextFields();
    if (mech.hasUMU()) {
        Element svgEle = getSVGDocument().getElementById("mpJumpLabel");
        if (null != svgEle) {
            svgEle.setTextContent("Underwater:");
        }
    }
    hideElement("warriorDataSingle", mech.getCrew().getSlotCount() != 1);
    hideElement("warriorDataDual", mech.getCrew().getSlotCount() != 2);
    hideElement("warriorDataTriple", mech.getCrew().getSlotCount() != 3);
    setTextField("hsType", formatHeatSinkType());
    setTextField("hsCount", formatHeatSinkCount());
    if (mech instanceof LandAirMech) {
        LandAirMech lam = (LandAirMech) mech;
        if (lam.getLAMType() == LandAirMech.LAM_BIMODAL) {
            // em dash
            setTextField("mpAirMechWalk", "\u2014");
            setTextField("mpAirMechRun", "\u2014");
            setTextField("mpAirMechCruise", "\u2014");
            setTextField("mpAirMechFlank", "\u2014");
        } else {
            setTextField("mpAirMechWalk", Integer.toString(lam.getAirMechWalkMP()));
            setTextField("mpAirMechRun", Integer.toString(lam.getAirMechRunMP()));
            setTextField("mpAirMechCruise", Integer.toString(lam.getAirMechCruiseMP()));
            setTextField("mpAirMechFlank", Integer.toString(lam.getAirMechFlankMP()));
        }
        setTextField("mpSafeThrust", Integer.toString(lam.getJumpMP()));
        setTextField("mpMaxThrust", Integer.toString((int) Math.ceil(lam.getJumpMP() * 1.5)));
        if (!lam.getCrew().getName().equalsIgnoreCase("unnamed") && (lam.getCrew() instanceof LAMPilot)) {
            setTextField("asfGunnerySkill", Integer.toString(((LAMPilot) mech.getCrew()).getGunneryAero()));
            setTextField("asfPilotingSkill", Integer.toString(((LAMPilot) mech.getCrew()).getPilotingAero()));
        } else {
            hideElement("asfGunnerySkill");
            hideElement("asfPilotingSkill");
        }
    } else if (mech instanceof QuadVee) {
        setTextField("mpCruise", Integer.toString(((QuadVee) mech).getCruiseMP(false, false, false)));
        setTextField("mpFlank", formatQuadVeeFlank());
        setTextField("lblVeeMode", ((QuadVee) mech).getMotiveTypeString() + "s");
    }
}
Also used : SVGRectElement(org.w3c.dom.svg.SVGRectElement) Element(org.w3c.dom.Element) QuadVee(megamek.common.QuadVee) LAMPilot(megamek.common.LAMPilot) LandAirMech(megamek.common.LandAirMech)

Aggregations

LAMPilot (megamek.common.LAMPilot)1 LandAirMech (megamek.common.LandAirMech)1 QuadVee (megamek.common.QuadVee)1 Element (org.w3c.dom.Element)1 SVGRectElement (org.w3c.dom.svg.SVGRectElement)1