Package megamek.common

Examples of megamek.common.Report.choose()


        r.newlines = 0;
        r.addDesc(entity);
        r.add(boomroll);
        if (boomroll >= 8) {
            // phew!
            r.choose(true);
               addReport(r);
        } else {
            // eek
            r.choose(false);
            r.newlines = 1;


            // phew!
            r.choose(true);
               addReport(r);
        } else {
            // eek
            r.choose(false);
            r.newlines = 1;
            addReport(r);
            // Taharqa: TacOps rules, protos and vees no longer die instantly
            // (hurray!)
            if (entity instanceof Tank) {

            r.subject = entity.getId();
            r.add(rollTarget.getValueAsString());
            r.add(rollTarget.getDesc());
            r.add(diceRoll);
            if (diceRoll < rollTarget.getValue()) {
                r.choose(false);
                vPhaseReport.add(r);
                // walking and running, 1 damage per MP used more than we would
                // have normally
                if ((entity.moved == IEntityMovementType.MOVE_WALK) || (entity.moved == IEntityMovementType.MOVE_VTOL_WALK) || (entity.moved == IEntityMovementType.MOVE_RUN) || (entity.moved == IEntityMovementType.MOVE_VTOL_RUN)) {
                    if (entity instanceof Mech) {

                    }
                }
                // failed a PSR, check for ICE engine stalling
                entity.doCheckEngineStallRoll(vPhaseReport);
            } else {
                r.choose(true);
                vPhaseReport.add(r);
            }
        }
        // non mechs and prone mechs can now return
        if (!(entity instanceof Mech) || entity.isProne() || (entity.isHullDown() && entity.canGoHullDown()) ) {

                r.indent(3);
                r.add(entity.getLocationAbbr(loc));
                r.add(breachroll);
                r.newlines = 0;
                if (breachroll >= target) {
                    r.choose(false);
                } else {
                    r.choose(true);
                }
                vDesc.addElement(r);
            }

                r.add(breachroll);
                r.newlines = 0;
                if (breachroll >= target) {
                    r.choose(false);
                } else {
                    r.choose(true);
                }
                vDesc.addElement(r);
            }
            // Breach by damage or lack of armor.
            if ((breachroll >= target) || !(entity.getArmor(loc) > 0) || (dumping && (!(entity instanceof Mech) || (loc == Mech.LOC_CT) || (loc == Mech.LOC_RT) || (loc == Mech.LOC_LT))) || !(entity instanceof Mech ? entity.getArmor(loc, true) > 0 : true)) {

                r.addDesc(entity);
                r.add(entity.crew.getName());
                r.add(roll.getValueAsString());
                r.add(diceRoll);
                if (diceRoll >= roll.getValue()) {
                    r.choose(true);
                    vPhaseReport.add(r);
                } else {
                    r.choose(false);
                    vPhaseReport.add(r);
                    vPhaseReport.addAll(damageCrew(entity, 1));

                r.add(diceRoll);
                if (diceRoll >= roll.getValue()) {
                    r.choose(true);
                    vPhaseReport.add(r);
                } else {
                    r.choose(false);
                    vPhaseReport.add(r);
                    vPhaseReport.addAll(damageCrew(entity, 1));
                    Report.addNewline(vPhaseReport);
                }
            }

        r.indent(2);
        int effect = Compute.d6(2);
        r.add(8);
        r.add(effect);
        if(effect > 7) {
            r.choose(true);
            r.newlines = 0;
            vDesc.add(r);
            boolean onFire = false;
            boolean powerLine = false;
            boolean minorExp = false;

            if(onFire && !hex.containsTerrain(Terrains.FIRE)) {
                ignite(c, false, vDesc);
            }
        } else {
            //report no explosion
            r.choose(false);
            vDesc.add(r);
        }
    }

    /**
 

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.