Package megamek.common

Examples of megamek.common.Report


   
    protected void handleClearDamage(Vector<Report> vPhaseReport,
            Building bldg, int nDamage, boolean bSalvo) {
        if (!bSalvo) {
            // hits!
            r = new Report(2270);
            r.subject = subjectId;
            r.newlines = 0;
            vPhaseReport.addElement(r);
        }
        // report that damage was "applied" to terrain
        r = new Report(3385);
        r.indent();
        r.subject = subjectId;
        r.add(nDamage);
        vPhaseReport.addElement(r);
View Full Code Here


    
        //same as ScreenLauncher handler, except run multiple times depending on
        //how many screen launchers in bay
       
        //Report weapon attack and its to-hit value.
        r = new Report(3115);
        r.indent();
        r.newlines = 0;
        r.subject = subjectId;
        r.add(wtype.getName());
        r.messageId = 3120;
        r.add(target.getDisplayName(), true);
        vPhaseReport.addElement(r);
        if (toHit.getValue() == ToHitData.IMPOSSIBLE) {
            r = new Report(3135);
            r.subject = subjectId;
            r.add(toHit.getDesc());
            vPhaseReport.addElement(r);
            return false;
        } else if (toHit.getValue() == ToHitData.AUTOMATIC_FAIL) {
            r = new Report(3140);
            r.newlines = 0;
            r.subject = subjectId;
            r.add(toHit.getDesc());
            vPhaseReport.addElement(r);
        } else if (toHit.getValue() == ToHitData.AUTOMATIC_SUCCESS) {
            r = new Report(3145);
            r.newlines = 0;
            r.subject = subjectId;
            r.add(toHit.getDesc());
            vPhaseReport.addElement(r);
        }
View Full Code Here

                            .getAimingMode());

            if (entityTarget.removePartialCoverHits(hit.getLocation(), toHit
                    .getCover(), Compute.targetSideTable(ae, entityTarget))) {
                // Weapon strikes Partial Cover.
                r = new Report(3460);
                r.subject = subjectId;
                r.add(entityTarget.getShortName());
                r.add(entityTarget.getLocationAbbr(hit));
                r.newlines = 0;
                r.indent(2);
                vPhaseReport.addElement(r);
                missed = true;
                return;
            }
            r = new Report(3400);
            r.subject = subjectId;
            r.indent(2);
            r.add(2);
            r.newlines = 0;
            r.choose(true);
View Full Code Here

   
    protected void handleIgnitionDamage(Vector<Report> vPhaseReport,
            Building bldg, boolean bSalvo, int hits) {
        if (!bSalvo) {
            // hits!
            r = new Report(2270);
            r.subject = subjectId;
            r.newlines = 0;
            vPhaseReport.addElement(r);
        }
        TargetRoll tn = new TargetRoll(wtype.getFireTN(), wtype.getName());
View Full Code Here

   
    protected void handleClearDamage(Vector<Report> vPhaseReport,
            Building bldg, int nDamage, boolean bSalvo) {
        if (!bSalvo) {
            // hits!
            r = new Report(2270);
            r.subject = subjectId;
            r.newlines = 0;
            vPhaseReport.addElement(r);
        }
        // report that damage was "applied" to terrain
        r = new Report(3385);
        r.indent();
        r.subject = subjectId;
        r.add(nDamage);
        vPhaseReport.addElement(r);
View Full Code Here

            }
            ebv = getEnemyBV(game, player);
            eibv = getEnemyInitialBV(game, player);

            if (eibv != 0 && (ebv * 100) / eibv <= 100 - destroyedPercent) {
                Report r = new Report(7105, Report.PUBLIC);
                victory = true;
                if (team == Player.TEAM_NONE) {
                    r.add(player.getName());
                    vr.addPlayerScore(player.getId(), 1.0);
                } else {
                    r.add("Team " + team);
                    vr.addTeamScore(team, 1.0);
                }
                r.add(100 - ((ebv * 100) / eibv));
                vr.addReport(r);
            }
        }// end for
        if (victory)
            return vr;
View Full Code Here

                }
            }
            // all enemy commanders are dead
            if (killedAll) {
                if (team == Player.TEAM_NONE) {
                    Report r = new Report(7110, Report.PUBLIC);
                    r.add(player.getName());
                    vr.addPlayerScore(player.getId(), 1);
                    vr.addReport(r);
                } else {
                    Report r = new Report(7110, Report.PUBLIC);
                    r.add("Team " + team);
                    vr.addTeamScore(team, 1);
                    vr.addReport(r);
                }
                victory = true;
            }
View Full Code Here

        int roll = Compute.d6() - 1;
        if (elevators[roll].positions.size() == 0)
            return;

        Report r = new Report(5290);
        vPhaseReport.add(r);

        ITerrainFactory tf = Terrains.getTerrainFactory();
        for (Iterator<Coords> i = elevators[roll].positions.iterator(); i
                .hasNext();) {
View Full Code Here

                ice = true;
            }
        }
       
        if(lightSnow) {
            Report r = new Report(5505, Report.PUBLIC);
            vPhaseReport.addElement(r);
        }
        if(deepSnow) {
            Report r = new Report(5510, Report.PUBLIC);
            vPhaseReport.addElement(r);
        }
        if(ice) {
            Report r = new Report(5515, Report.PUBLIC);
            vPhaseReport.addElement(r);
        }
           
        // Cycle through all hexes, checking for the appropriate weather changes
        for (int currentXCoord = 0; currentXCoord < width; currentXCoord++ ) {
View Full Code Here

            fbv = getFriendlyBV(game, player);
            ebv = getEnemyBV(game, player);
            // eibv=getEnemyInitialBV(game,player);

            if (ebv == 0 || (100 * fbv) / ebv >= ratio) {
                Report r = new Report(7100, Report.PUBLIC);
                victory = true;
                if (team == Player.TEAM_NONE) {
                    r.add(player.getName());
                    vr.addPlayerScore(player.getId(), 1.0);
                } else {
                    r.add("Team " + team);
                    vr.addTeamScore(team, 1.0);
                }
                r.add(ebv == 0 ? 9999 : (100 * fbv) / ebv);
                vr.addReport(r);
            }
        }// end for
        if (victory)
            return vr;
View Full Code Here

TOP

Related Classes of megamek.common.Report

Copyright © 2018 www.massapicom. 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.