Examples of locations()


Examples of megamek.common.Entity.locations()

        if (attackerElevation != targetElevation){
            return new ToHitData(TargetRoll.IMPOSSIBLE, "Attacker and Target must be at the same elevation");
        }

        // check if attacker has fired leg-mounted weapons
        boolean usedWeapons[] = new boolean[ae.locations()];
        for (int i = 0; i < ae.locations(); i++) {
            usedWeapons[i] = false;
        }

        for (Mounted mounted : ae.getWeaponList()) {
View Full Code Here

Examples of megamek.common.Entity.locations()

            return new ToHitData(TargetRoll.IMPOSSIBLE, "Attacker and Target must be at the same elevation");
        }

        // check if attacker has fired leg-mounted weapons
        boolean usedWeapons[] = new boolean[ae.locations()];
        for (int i = 0; i < ae.locations(); i++) {
            usedWeapons[i] = false;
        }

        for (Mounted mounted : ae.getWeaponList()) {
            if (mounted.isUsedThisRound()) {
View Full Code Here

Examples of megamek.common.Entity.locations()

            throw new IllegalStateException(
                    "Couldn't locate the pilot for an Entity node.");
        } else if (null == equipNode) {
            throw new IllegalStateException(
                    "Couldn't locate the entityEquipment for an Entity node.");
        } else if (locations.size() != entity.locations()) {
            StringBuffer msgBuf = new StringBuffer();
            msgBuf.append("Found ").append(locations.size()).append(
                    " locations for an Entity node. ").append(
                    "Was expecting to find ").append(entity.locations())
                    .append(".");
View Full Code Here

Examples of megamek.common.Entity.locations()

                    "Couldn't locate the entityEquipment for an Entity node.");
        } else if (locations.size() != entity.locations()) {
            StringBuffer msgBuf = new StringBuffer();
            msgBuf.append("Found ").append(locations.size()).append(
                    " locations for an Entity node. ").append(
                    "Was expecting to find ").append(entity.locations())
                    .append(".");
            throw new IllegalStateException(msgBuf.toString());
        }

        // Decode the entity node's chassis.
View Full Code Here

Examples of megamek.common.Entity.locations()

                        damage = Compute.d6(2);
                    }
                    HitData hit = en.rollHitLocation(ToHitData.HIT_NORMAL, ToHitData.SIDE_FRONT);
                    if(en instanceof BattleArmor) {
                        //ugly - I have to apply damage to each trooper separately
                        for(int loc = 0; loc < en.locations(); loc++) {
                            if((IArmorState.ARMOR_NA != en.getInternal(loc))
                                    && (IArmorState.ARMOR_DESTROYED != en.getInternal(loc))
                                    && (IArmorState.ARMOR_DOOMED != en.getInternal(loc))) {
                                vDesc.addAll( damageEntity(en, new HitData(loc), damage) );
                            }
View Full Code Here

Examples of megamek.common.Entity.locations()

            r.add(toHit.getTableDesc());
            r.add(hits);
            vPhaseReport.add(r);
            if (entity instanceof BattleArmor) {
                // BA take full damage to each trooper, ouch!
                for (int loc = 0; loc < entity.locations(); loc++) {
                    if (entity.getInternal(loc) > 0) {
                        HitData hit = new HitData(loc);
                        vPhaseReport.addAll(damageEntity(entity, hit, hits, false, DamageType.NONE, false, true, false));
                    }
                }
View Full Code Here

Examples of megamek.common.Entity.locations()

                if(!(target instanceof Infantry)) {
                    addNewLines();
                    addReport(criticalEntity(te, hit.getLocation(), 0, true, false));
                }
                if((target instanceof BattleArmor)
                        && (hit.getLocation() < te.locations()) && (te.getInternal(hit.getLocation()) > 0)) {
                    //TODO: we should really apply BA criticals through the critical
                    //hits methods. Right now they are applied in damageentity
                    HitData bahit = new HitData(hit.getLocation(), false, HitData.EFFECT_CRITICAL);
                    addReport(damageEntity(te,bahit,0));
                }
View Full Code Here

Examples of megamek.common.Entity.locations()

            r.add(toHit.getTableDesc());
            r.newlines = 0;
            addReport(r);

            // work out which locations have spikes
            int[] spikes = new int[te.locations()];
            for (int i = 0; i < te.locations(); i++) {
                spikes[i] = 0;
            }
            for (Mounted m : te.getMisc()) {
                if ((m.getLocation() != Entity.LOC_NONE) && m.getType().hasFlag(MiscType.F_SPIKES)) {
View Full Code Here

Examples of megamek.common.Entity.locations()

            r.newlines = 0;
            addReport(r);

            // work out which locations have spikes
            int[] spikes = new int[te.locations()];
            for (int i = 0; i < te.locations(); i++) {
                spikes[i] = 0;
            }
            for (Mounted m : te.getMisc()) {
                if ((m.getLocation() != Entity.LOC_NONE) && m.getType().hasFlag(MiscType.F_SPIKES)) {
                    spikes[m.getLocation()] = 1;
View Full Code Here

Examples of megamek.common.Jumpship.locations()

    public void setEntity(Entity e){
        Jumpship t = (Jumpship) e;
        int a = 1;
        int a0 = 1;
        //TODO: change this back to locations
        for(int i = 0; i < t.locations(); i++){
            a = t.getArmor(i);
            a0 = t.getOArmor(i);
            vLabels[i].setValue(t.getArmorString(i));
            WidgetUtils.setAreaColor(areas[i], vLabels[i], (double)a/(double)a0);
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.