Package megamek.common

Examples of megamek.common.ToHitData.addModifier()


                if ((ammo != null) && (ammo.getMunitionType() == AmmoType.M_CLUSTER) && attackSource.equals(coords)) {
                    if (entity instanceof Mech) {
                        toHit.setHitTable(ToHitData.HIT_ABOVE);
                    } else if (entity instanceof Tank) {
                        toHit.setSideTable(ToHitData.SIDE_FRONT);
                        toHit.addModifier(2, "cluster artillery hitting a Tank");
                    }
                }
            }

            // convention infantry take x2 damage from AE weapons
View Full Code Here


        addReport(r);

        // add some stuff to the to hit value
        // need to add damage done modifier
        if (ae.damageThisRound > 10) {
            toHit.addModifier((int) (Math.floor(ae.damageThisRound / 10.0)), "damage taken");
        }

        // add modifiers for the originating unit missing CIC, FCS, or sensors
        Entity ride = game.getEntity(tm.getOriginalRideId());
        if ((null != ride) && (ride instanceof Aero)) {
View Full Code Here

        Entity ride = game.getEntity(tm.getOriginalRideId());
        if ((null != ride) && (ride instanceof Aero)) {
            Aero aride = (Aero) ride;
            int cic = aride.getCICHits();
            if (cic > 0) {
                toHit.addModifier(cic * 2, "CIC damage");
            }

            // sensor hits
            int sensors = aride.getSensorHits();
            if ((sensors > 0) && (sensors < 3)) {
View Full Code Here

            }

            // sensor hits
            int sensors = aride.getSensorHits();
            if ((sensors > 0) && (sensors < 3)) {
                toHit.addModifier(sensors, "sensor damage");
            }
            if (sensors > 2) {
                toHit.addModifier(+5, "sensors destroyed");
            }
View Full Code Here

            int sensors = aride.getSensorHits();
            if ((sensors > 0) && (sensors < 3)) {
                toHit.addModifier(sensors, "sensor damage");
            }
            if (sensors > 2) {
                toHit.addModifier(+5, "sensors destroyed");
            }

            // FCS hits
            int fcs = aride.getFCSHits();
            if (fcs > 0) {
View Full Code Here

            }

            // FCS hits
            int fcs = aride.getFCSHits();
            if (fcs > 0) {
                toHit.addModifier(fcs * 2, "fcs damage");
            }
        }

        if (toHit.getValue() == TargetRoll.AUTOMATIC_SUCCESS) {
            roll = Integer.MAX_VALUE;
View Full Code Here

        TeleMissile tm = (TeleMissile)ae;
       
        //thrust used
        if(ae.mpUsed > 0)
            toHit.addModifier(ae.mpUsed, "thrust used");
       
        //out of fuel
        if(tm.getFuel() <= 0)
            toHit.addModifier(+6, "out of fuel");
       
View Full Code Here

        if(ae.mpUsed > 0)
            toHit.addModifier(ae.mpUsed, "thrust used");
       
        //out of fuel
        if(tm.getFuel() <= 0)
            toHit.addModifier(+6, "out of fuel");
       
        //modifiers for the originating unit need to be added later, because
        //they may change as a result of damage
       
        // done!
View Full Code Here

        toHit = new ToHitData(base, "base");

        PhysicalAttackAction.setCommonModifiers(toHit, game, ae, target);

        if (ae.isGrappleAttacker()) {
            toHit.addModifier(TargetRoll.AUTOMATIC_SUCCESS, "original attacker");
            return toHit;
        }

        setCommonModifiers(toHit, game, ae, target);
View Full Code Here

        setCommonModifiers(toHit, game, ae, target);

        if (ae instanceof Mech) {
            // damaged or missing actuators
            if (!ae.hasWorkingSystem(Mech.ACTUATOR_SHOULDER, Mech.LOC_LARM)) {
                toHit.addModifier(2, "Left shoulder actuator destroyed");
            }
            if (!ae.hasWorkingSystem(Mech.ACTUATOR_UPPER_ARM, Mech.LOC_LARM)) {
                toHit.addModifier(2, "Left upper arm actuator destroyed");
            }
            if (!ae.hasWorkingSystem(Mech.ACTUATOR_LOWER_ARM, Mech.LOC_LARM)) {
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.