Examples of Aero


Examples of megamek.common.Aero

    public Vector<BackGroundDrawer> getBackgroundDrawers(){
        return bgDrawers;
    }
   
    public void setEntity(Entity e){
      Aero t = (Aero) 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);
            
      }
      a = t.getSI();
      a0 = t.get0SI();
      vLabels[4].setValue(Integer.toString(t.getSI()));
      WidgetUtils.setAreaColor(areas[4], vLabels[4], (double)a/(double)a0);
     
      //now for the vitals
      vLabels[5].setValue(getCriticalHitTally(t.getAvionicsHits(),3));
      vLabels[6].setValue(getCriticalHitTally(t.getEngineHits(),t.getMaxEngineHits()));
      vLabels[7].setValue(getCriticalHitTally(t.getFCSHits(),3));
      vLabels[8].setValue(getCriticalHitTally(t.getSensorHits(),3));
      if(t instanceof SmallCraft) {
          //add in thrusters
          SmallCraft sc = (SmallCraft)t;
          vLabels[9].setValue(getCriticalHitTally(sc.getLeftThrustHits(),3));
          vLabels[10].setValue(getCriticalHitTally(sc.getRightThrustHits(),3));
View Full Code Here

Examples of megamek.common.Aero

    public Vector<BackGroundDrawer> getBackgroundDrawers(){
        return bgDrawers;
    }

    public void setEntity(Entity e){
        Aero t = (Aero) 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);

        }
        a = t.getSI();
        a0 = t.get0SI();
        vLabels[4].setValue(Integer.toString(t.getSI()));
        WidgetUtils.setAreaColor(areas[4], vLabels[4], (double)a/(double)a0);

        //now for the vitals
        vLabels[5].setValue(getCriticalHitTally(t.getAvionicsHits(),3));
        vLabels[6].setValue(getCriticalHitTally(t.getEngineHits(),t.getMaxEngineHits()));
        vLabels[7].setValue(getCriticalHitTally(t.getFCSHits(),3));
        vLabels[8].setValue(getCriticalHitTally(t.getSensorHits(),3));
        if(t instanceof SmallCraft) {
            //add in thrusters
            SmallCraft sc = (SmallCraft)t;
            vLabels[9].setValue(getCriticalHitTally(sc.getLeftThrustHits(),3));
            vLabels[10].setValue(getCriticalHitTally(sc.getRightThrustHits(),3));
View Full Code Here

Examples of megamek.common.Aero

    public void setEntity(Entity e){
        FighterSquadron fs = (FighterSquadron) e;
       
        for(int i = 0; i < fs.getN0Fighters(); i++) {
            Aero fighter = fs.getFighter(i);
            int armor = fighter.getCapArmor();
            int armorO = fighter.getCap0Armor();
           
            drawArmorImage(armorImage[i], armor, armorO);
            armorVLabel[i].setValue(Integer.toString(armor));
            drawCrits(avCritImage[i], fighter.getAvionicsHits());
            drawCrits(engineCritImage[i], fighter.getEngineHits());
            drawCrits(fcsCritImage[i], fighter.getFCSHits());
            drawCrits(sensorCritImage[i], fighter.getSensorHits());
            drawCrits(pilotCritImage[i], fighter.getCrew().getHits());
           
            nameLabel[i].setString(fighter.getDisplayName());
           
            armorArea[i].setVisible(true);
            armorVLabel[i].setVisible(true);
            avCritArea[i].setVisible(true);
            engineCritArea[i].setVisible(true);
View Full Code Here

Examples of megamek.common.Aero

    public void setEntity(Entity e){
        FighterSquadron fs = (FighterSquadron) e;
       
        for(int i = 0; i < fs.getN0Fighters(); i++) {
            Aero fighter = fs.getFighter(i);
            int armor = fighter.getCapArmor();
            int armorO = fighter.getCap0Armor();
           
            drawArmorImage(armorImage[i], armor, armorO);
            armorVLabel[i].setValue(Integer.toString(armor));
            drawCrits(avCritImage[i], fighter.getAvionicsHits());
            drawCrits(engineCritImage[i], fighter.getEngineHits());
            drawCrits(fcsCritImage[i], fighter.getFCSHits());
            drawCrits(sensorCritImage[i], fighter.getSensorHits());
            drawCrits(pilotCritImage[i], fighter.getCrew().getHits());
           
            nameLabel[i].setString(fighter.getDisplayName());
           
            armorArea[i].setVisible(true);
            armorVLabel[i].setVisible(true);
            avCritArea[i].setVisible(true);
            engineCritArea[i].setVisible(true);
View Full Code Here

Examples of megamek.common.Aero

            }
        }

        // Aeros may suffer from criticals
        if (ae instanceof Aero) {
            Aero aero = (Aero) ae;

            // sensor hits
            int sensors = aero.getSensorHits();

            if(!aero.isCapitalFighter()) {
                if ((sensors > 0) && (sensors < 3)) {
                    toHit.addModifier(sensors, "sensor damage");
                }
                if (sensors > 2) {
                    toHit.addModifier(+5, "sensors destroyed");
                }
            }

            // FCS hits
            int fcs = aero.getFCSHits();

            if ((fcs > 0) && !aero.isCapitalFighter()) {
                toHit.addModifier(fcs * 2, "fcs damage");
            }

            // pilot hits
            int pilothits = aero.getCrew().getHits();
            if ((pilothits > 0) && !aero.isCapitalFighter()) {
                toHit.addModifier(pilothits, "pilot hits");
            }

            // out of control
            if (aero.isOutControlTotal()) {
                toHit.addModifier(+2, "out-of-control");
            }

            if (aero instanceof Jumpship) {
                Jumpship js = (Jumpship) aero;
                int cic = js.getCICHits();
                if (cic > 0) {
                    toHit.addModifier(cic * 2, "CIC damage");
                }
            }

            // targeting mods for evasive action by large craft
            if (aero.isEvading()) {
                toHit.addModifier(+2, "attacker is evading");
            }



            // check for heavy gauss rifle on fighter of small craft
            if ((weapon.getType() instanceof ISHGaussRifle) && (ae instanceof Aero)
                    && !(ae instanceof Dropship) && !(ae instanceof Jumpship)) {
                toHit.addModifier(+1, "weapon to-hit modifier");
            }

            // check for NOE
            // if the target is NOE in atmosphere
            if (game.getBoard().inAtmosphere()
                    && (1 == (ae.getElevation() - game.getBoard().getHex(
                            ae.getPosition()).ceiling()))) {
                if (ae.isOmni()) {
                    toHit.addModifier(+1, "attacker is flying at NOE (omni)");
                } else {
                    toHit.addModifier(+2, "attacker is flying at NOE");
                }
            }

            // check for particular kinds of weapons in weapon bays
            if (ae.usesWeaponBays()) {

                // any heavy lasers
                if (wtype.getAtClass() == WeaponType.CLASS_LASER) {
                    for (int wId : weapon.getBayWeapons()) {
                        Mounted bweap = ae.getEquipment(wId);
                        WeaponType bwtype = (WeaponType) bweap.getType();
                        if ((bwtype.getInternalName().indexOf("Heavy") != -1)
                                && (bwtype.getInternalName().indexOf("Laser") != -1)) {
                            toHit.addModifier(+1, "bay contains heavy laser");
                            break;
                        }
                    }
                }
                // barracuda and piranha missiles
                else if (wtype.getAtClass() == WeaponType.CLASS_CAPITAL_MISSILE) {
                    boolean onlyBarracuda = true;
                    boolean onlyPiranha = true;
                    for (int wId : weapon.getBayWeapons()) {
                        Mounted bweap = ae.getEquipment(wId);
                        Mounted bammo = bweap.getLinked();
                        if (bammo != null) {
                            AmmoType batype = (AmmoType) bammo.getType();
                            if (batype.getAmmoType() != AmmoType.T_BARRACUDA) {
                                onlyBarracuda = false;
                            }
                            if ((batype.getAmmoType() != AmmoType.T_PIRANHA) && (batype.getAmmoType() != AmmoType.T_BARRACUDA)) {
                                onlyPiranha = false;
                            }
                        }
                    }
                    if (onlyBarracuda) {
                        toHit.addModifier(-2, "barracuda missile");
                    } else if (onlyPiranha) {
                        toHit.addModifier(-1, "piranha missile");
                    }
                }
                // barracuda missiles in an AR10 launcher (must all be
                // barracuda)
                else if (wtype.getAtClass() == WeaponType.CLASS_AR10) {
                    boolean onlyBarracuda = true;
                    for (int wId : weapon.getBayWeapons()) {
                        Mounted bweap = ae.getEquipment(wId);
                        Mounted bammo = bweap.getLinked();
                        if (bammo != null) {
                            AmmoType batype = (AmmoType) bammo.getType();
                            if (!batype.hasFlag(AmmoType.F_AR10_BARRACUDA)) {
                                onlyBarracuda = false;
                            }
                        }
                    }
                    if (onlyBarracuda) {
                        toHit.addModifier(-2, "barracuda missile");
                    }
                }
                // LBX cluster
                else if (wtype.getAtClass() == WeaponType.CLASS_LBX_AC) {
                    boolean onlyCluster = true;
                    for (int wId : weapon.getBayWeapons()) {
                        Mounted bweap = ae.getEquipment(wId);
                        Mounted bammo = bweap.getLinked();
                        if (bammo != null) {
                            AmmoType batype = (AmmoType) bammo.getType();
                            if (batype.getMunitionType() != AmmoType.M_CLUSTER) {
                                onlyCluster = false;
                                break;
                            }
                        }
                    }
                    if (onlyCluster) {
                        toHit.addModifier(-1, "cluster ammo");
                    }
                }
            }
        }

        if(wtype.hasFlag(WeaponType.F_ANTI_SHIP) && (target instanceof Entity) && (te.getWeight() < 500)) {
            toHit.addModifier(4, "Anti-ship missile at a small target");
        }

        if (target instanceof Aero) {

            Aero a = (Aero) target;

            // is the target at zero velocity
            if (a.getCurrentVelocity() == 0) {
                toHit.addModifier(-2, "target is not moving");
            }

            // capital weapon (except missiles) penalties at small targets
            if (wtype.isCapital()
                    && (wtype.getAtClass() != WeaponType.CLASS_CAPITAL_MISSILE)
                    && (wtype.getAtClass() != WeaponType.CLASS_AR10)
                    && !te.isLargeCraft()) {
                //check to see if we are using AAA mode
                int aaaMod = 0;
                if(wtype.hasModes() && weapon.curMode().equals("AAA")) {
                    aaaMod = 2;
                }
                if(wtype.isSubCapital()) {
                    toHit.addModifier(3-aaaMod, "sub-capital weapon at small target");
                } else {
                    toHit.addModifier(5-aaaMod, "capital weapon at small target");
                }
            }

            //AAA mode makes targeting large craft more difficult
            if(wtype.hasModes() && weapon.curMode().equals("AAA") && te.isLargeCraft()) {
                toHit.addModifier(+1, "AAA mode at large craft");
            }

            //check for bracketing mode
            if(wtype.hasModes() && weapon.curMode().equals("Bracket 80%")) {
                toHit.addModifier(-1, "Bracketing 80%");
            }
            if(wtype.hasModes() && weapon.curMode().equals("Bracket 60%")) {
                toHit.addModifier(-2, "Bracketing 60%");
            }
            if(wtype.hasModes() && weapon.curMode().equals("Bracket 40%")) {
                toHit.addModifier(-3, "Bracketing 40%");
            }

            //sensor shadows
            if(game.getOptions().booleanOption("stratops_sensor_shadow") && game.getBoard().inSpace()) {
                for(Entity en : Compute.getAdjacentEntitiesAlongAttack(ae.getPosition(), target.getPosition(), game)) {
                    if(!en.isEnemyOf(a) && en.isLargeCraft()
                            && ((en.getWeight() - a.getWeight()) >= -100000.0)) {
                        toHit.addModifier(+1, "Sensor Shadow");
                        break;
                    }
                }
                for (Enumeration<Entity> i = game.getEntities(target.getPosition()); i.hasMoreElements();) {
                    Entity en = i.nextElement();
                    if(!en.isEnemyOf(a) && en.isLargeCraft() && !en.equals(a)
                            && ((en.getWeight() - a.getWeight()) >= -100000.0)) {
                        toHit.addModifier(+1, "Sensor Shadow");
                        break;
                    }
                }
            }
View Full Code Here

Examples of megamek.common.Aero

        } else {
            mpR3.setString(Integer.toString(en.getJumpMPWithTerrain()));
        }

        if(en instanceof Aero) {
            Aero a = (Aero)en;
            curMoveR.setString(Integer.toString(a.getCurrentVelocity()));
            fuelR.setString(Integer.toString(a.getFuel()));
        } else {
            curMoveR.setString(en.getMovementString(en.moved) + (en.moved == IEntityMovementType.MOVE_NONE ? "" : " " + en.delta_distance)); //$NON-NLS-1$ //$NON-NLS-2$
        }

        int heatCap = en.getHeatCapacity();
View Full Code Here

Examples of megamek.common.Aero

        } else {
            mpR3.setString(Integer.toString(en.getJumpMPWithTerrain()));
        }

        if(en instanceof Aero) {
            Aero a = (Aero)en;
            curMoveR.setString(Integer.toString(a.getCurrentVelocity()));
            fuelR.setString(Integer.toString(a.getFuel()));
        } else {
            curMoveR.setString(en.getMovementString(en.moved) + (en.moved == IEntityMovementType.MOVE_NONE ? "" : " " + en.delta_distance)); //$NON-NLS-1$ //$NON-NLS-2$
        }

        int heatCap = en.getHeatCapacity();
View Full Code Here

Examples of megamek.common.Aero

        if(ae.isEvading() && !(ae instanceof Dropship) && !(ae instanceof Jumpship)) {
            return "Attacker is evading.";
        }

        if (ae instanceof Aero) {
            Aero aero = (Aero)ae;
            //FCS hits
            int fcs = aero.getFCSHits();
            if(fcs > 2 ) {
                return "Fire control system destroyed.";
            }

            if(aero instanceof Jumpship) {
View Full Code Here

Examples of megamek.common.Aero

    public Vector<BackGroundDrawer> getBackgroundDrawers(){
        return bgDrawers;
    }

    public void setEntity(Entity e){
        Aero t = (Aero) 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);

        }
        a = t.getSI();
        a0 = t.get0SI();
        vLabels[4].setValue(Integer.toString(t.getSI()));
        WidgetUtils.setAreaColor(areas[4], vLabels[4], (double)a/(double)a0);

        //now for the vitals
        vLabels[5].setValue(getCriticalHitTally(t.getAvionicsHits(),3));
        vLabels[6].setValue(getCriticalHitTally(t.getEngineHits(),t.getMaxEngineHits()));
        vLabels[7].setValue(getCriticalHitTally(t.getFCSHits(),3));
        vLabels[8].setValue(getCriticalHitTally(t.getSensorHits(),3));
        if(t instanceof SmallCraft) {
            //add in thrusters
            SmallCraft sc = (SmallCraft)t;
            vLabels[9].setValue(getCriticalHitTally(sc.getLeftThrustHits(),3));
            vLabels[10].setValue(getCriticalHitTally(sc.getRightThrustHits(),3));
View Full Code Here

Examples of megamek.common.Aero

    public Vector<BackGroundDrawer> getBackgroundDrawers(){
        return bgDrawers;
    }

    public void setEntity(Entity e){
        Aero t = (Aero) 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);

        }
        a = t.getSI();
        a0 = t.get0SI();
        vLabels[4].setValue(Integer.toString(t.getSI()));
        WidgetUtils.setAreaColor(areas[4], vLabels[4], (double)a/(double)a0);

        //now for the vitals
        vLabels[5].setValue(getCriticalHitTally(t.getAvionicsHits(),3));
        vLabels[6].setValue(getCriticalHitTally(t.getEngineHits(),t.getMaxEngineHits()));
        vLabels[7].setValue(getCriticalHitTally(t.getFCSHits(),3));
        vLabels[8].setValue(getCriticalHitTally(t.getSensorHits(),3));
        if(t instanceof SmallCraft) {
            //add in thrusters
            SmallCraft sc = (SmallCraft)t;
            vLabels[9].setValue(getCriticalHitTally(sc.getLeftThrustHits(),3));
            vLabels[10].setValue(getCriticalHitTally(sc.getRightThrustHits(),3));
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.