Tabnine Logo
LAMPilot
Code IndexAdd Tabnine to your IDE (free)

How to use
LAMPilot
in
megamek.common

Best Java code snippets using megamek.common.LAMPilot (Showing top 18 results out of 315)

origin: MegaMek/megamek

/**
 * Returns the BV multiplier for this pilot's gunnery/piloting
 *
 * @param usePiloting
 *            whether or not to use the default value non-anti-mech
 *            infantry/BA should not use the anti-mech skill
 * @param game
 */
@Override
public double getBVSkillMultiplier(boolean usePiloting, IGame game) {
  int pilotVal = (getPilotingMech() + getPilotingAero()) / 2;
  if (!usePiloting) {
    pilotVal = 5;
  }
  return getBVImplantMultiplier()
      * getBVSkillMultiplier((getGunneryMech() + getGunneryAero()) / 2, pilotVal, game);
}
origin: MegaMek/megamek

private static void writeLAMAeroAttributes(Writer output, final LAMPilot crew,
    boolean rpgGunnery) throws IOException {
  output.write("\" gunneryAero=\"");
  output.write(String.valueOf(crew.getGunneryAero()));
  if (rpgGunnery) {
    output.write("\" gunneryAeroL=\"");
    output.write(String.valueOf(crew.getGunneryAeroL()));
    output.write("\" gunneryAeroM=\"");
    output.write(String.valueOf(crew.getGunneryAeroM()));
    output.write("\" gunneryAeroB=\"");
    output.write(String.valueOf(crew.getGunneryAeroB()));
  }
  output.write("\" pilotingAero=\"");
  output.write(String.valueOf(crew.getPilotingAero()));
}    
origin: MegaMek/megamek

@Override
public int getGunneryL() {
  return useAeroGunnery() ? getGunneryAeroL() : getGunneryMechL();
}
origin: MegaMek/megamek

/**
 * @return a String showing the overall skills in the format gunnery
 *         (Mech)/piloting (Mech)/gunnery (Aero)/piloting (Aero)
 */
@Override
public String getSkillsAsString(int pos, boolean showPiloting) {
  return getGunneryMech() + "/" + getPilotingMech() + "/" + getGunneryAero() + "/" + getPilotingAero();
}
origin: MegaMek/megamek

@Override
public int getGunneryB() {
  return useAeroGunnery() ? getGunneryAeroB() : getGunneryMechB();
}
origin: MegaMek/megamek

LAMPilot pilot = new LAMPilot(lam, crew.getName(), crew.getGunnery(), crew.getPiloting(), crew.getGunnery(),
    crew.getPiloting());
pilot.setNickname(crew.getNickname(), 0);
pilot.setGunneryL(crew.getGunneryL(), 0);
pilot.setGunneryB(crew.getGunneryB(), 0);
pilot.setGunneryM(crew.getGunneryM(), 0);
pilot.setGunneryAeroL(crew.getGunneryL());
pilot.setGunneryAeroB(crew.getGunneryB());
pilot.setGunneryAeroM(crew.getGunneryM());
pilot.setHits(crew.getHits(0), 0);
pilot.setUnconscious(crew.isUnconscious(0), 0);
pilot.setDead(crew.isDead(0), 0);
pilot.setDoomed(crew.isDoomed());
pilot.setEjected(crew.isEjected());
pilot.setFatigue(crew.getFatigue());
pilot.setArtillery(crew.getArtillery(), 0);
pilot.setInitBonus(crew.getInitBonus());
pilot.setCommandBonus(crew.getCommandBonus());
pilot.setToughness(crew.getToughness(0), 0);
pilot.setPortraitCategory(crew.getPortraitCategory(0), 0);
pilot.setPortraitFileName(crew.getPortraitFileName(0), 0);
pilot.setOptions(crew.getOptions());
pilot.setExternalIdAsString(crew.getExternalIdAsString(0), 0);
origin: MegaMek/megamek

  LAMPilot pilot = (LAMPilot)entity.getCrew();
  if (client.getGame().getOptions().booleanOption(OptionsConstants.RPG_RPG_GUNNERY)) {
    pilot.setGunneryMechL(gunneryL);
    pilot.setGunneryMechB(gunneryB);
    pilot.setGunneryMechM(gunneryM);
    pilot.setGunneryMech((int)Math.round((gunneryL + gunneryB + gunneryM) / 3.0));
    pilot.setGunneryAeroL(gunneryAeroL);
    pilot.setGunneryAeroB(gunneryAeroB);
    pilot.setGunneryAeroM(gunneryAeroM);
    pilot.setGunneryAero((int)Math.round((gunneryAeroL + gunneryAeroB + gunneryAeroM) / 3.0));
  } else {
    pilot.setGunneryMechL(gunnery);
    pilot.setGunneryMechB(gunnery);
    pilot.setGunneryMechM(gunnery);
    pilot.setGunneryMech(gunnery);
    pilot.setGunneryAeroL(gunneryAero);
    pilot.setGunneryAeroB(gunneryAero);
    pilot.setGunneryAeroM(gunneryAero);
    pilot.setGunneryAero(gunneryAero);
  pilot.setPilotingMech(piloting);
  pilot.setPilotingAero(pilotingAero);
} else {
  if (client.getGame().getOptions().booleanOption(OptionsConstants.RPG_RPG_GUNNERY)) {
origin: MegaMek/megamek

r.add(getName(0));
if (getSlotCount() > 1) {
  r.add(" (" + getCrewType().getRoleName(0) + ")");
r.add(getGunneryMech() + "/" + getGunneryAero());
r.add(getPilotingMech() + "/" + getPilotingAero());
if (getHits(0) > 0 || isUnconscious(0) || isDead(0)) {
  Report r2 = new Report();
  r2.type = Report.PUBLIC;
  if (getHits(0) > 0) {
    r2.messageId = 7055;
    r2.add(getHits(0));
    if (isUnconscious(0)) {
      r2.messageId = 7060;
      r2.choose(true);
    } else if (isDead(0)) {
      r2.messageId = 7060;
      r2.choose(false);
  } else if (isUnconscious(0)) {
    r2.messageId = 7065;
    r2.choose(true);
  } else if (isDead(0)) {
    r2.messageId = 7065;
    r2.choose(false);
origin: MegaMek/megamek

  fldGunneryL.setText(Integer.toString(pilot.getGunneryMechL()));
  fldGunneryM.setText(Integer.toString(pilot.getGunneryMechM()));
  fldGunneryB.setText(Integer.toString(pilot.getGunneryMechB()));
  fldGunnery.setText(Integer.toString(pilot.getGunneryMech()));
  fldGunneryAeroL.setText(Integer.toString(pilot.getGunneryAeroL()));
  fldGunneryAeroM.setText(Integer.toString(pilot.getGunneryAeroM()));
  fldGunneryAeroB.setText(Integer.toString(pilot.getGunneryAeroB()));
  fldGunneryAero.setText(Integer.toString(pilot.getGunneryAero()));
} else {
  fldGunneryL.setText(Integer.toString(entity.getCrew().getGunneryL(slot)));
  add(label, GBC.std());
  add(fldPiloting, GBC.eol());
  fldPiloting.setText(Integer.toString(((LAMPilot)entity.getCrew()).getPilotingMech()));
  label = new JLabel(Messages.getString("CustomMechDialog.labPilotingAero"), SwingConstants.RIGHT); //$NON-NLS-1$
  add(label, GBC.std());
  add(fldPilotingAero, GBC.eop());
  fldPilotingAero.setText(Integer.toString(((LAMPilot)entity.getCrew()).getPilotingAero()));
} else {
  add(label, GBC.std());
origin: MegaMek/megamek

crew = LAMPilot.convertToLAMPilot((LandAirMech)entity, crew);
Crew aeroCrew = new Crew(CrewType.SINGLE);
Map<String,String> aeroAttributes = new HashMap<>(attributes);
((LAMPilot)crew).setGunneryAero(aeroCrew.getGunnery());
((LAMPilot)crew).setGunneryAeroM(aeroCrew.getGunneryM());
((LAMPilot)crew).setGunneryAeroB(aeroCrew.getGunneryB());
((LAMPilot)crew).setGunneryAeroL(aeroCrew.getGunneryL());
((LAMPilot)crew).setPilotingAero(aeroCrew.getPiloting());
entity.setCrew(crew);
origin: MegaMek/megamek

if (e.getCrew() instanceof LAMPilot) {
  skills = c.getRandomSkillsGenerator().getRandomSkills(e, true);
  ((LAMPilot)e.getCrew()).setGunneryAero(skills[0]);
  ((LAMPilot)e.getCrew()).setPilotingAero(skills[1]);
origin: MegaMek/mekhq

crew.setPiloting(Math.min(Math.max(pilotingMech, 0), 8));
crew.setGunnery(Math.min(Math.max(gunneryMech, 0), 7));
crew.setPilotingAero(Math.min(Math.max(pilotingAero, 0), 8));
crew.setGunneryAero(Math.min(Math.max(gunneryAero, 0), 7));
entity.getCrew().setArtillery(Math.min(Math.max(artillery, 0), 8), 0);
entity.getCrew().setSize(1);
origin: MegaMek/megamek

@Override
public int getGunnery() {
  return useAeroGunnery() ? getGunneryAero() : getGunneryMech();
}
origin: MegaMek/megamek

@Override
public void setCrew(Crew newCrew) {
  if (newCrew instanceof LAMPilot) {
    super.setCrew(newCrew);
  } else {
    super.setCrew(LAMPilot.convertToLAMPilot(this, newCrew));
  }
}
origin: MegaMek/megamek

public LandAirMech(int inGyroType, int inCockpitType, int inLAMType) {
  super(inGyroType, inCockpitType);
  lamType = inLAMType;
  setTechLevel(TechConstants.T_IS_ADVANCED);
  setCritical(Mech.LOC_HEAD, 3, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, LAM_AVIONICS));
  setCritical(Mech.LOC_LT, 1, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, LAM_AVIONICS));
  setCritical(Mech.LOC_RT, 1, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, LAM_AVIONICS));
  setCritical(Mech.LOC_LT, 0, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, LAM_LANDING_GEAR));
  setCritical(Mech.LOC_RT, 0, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, LAM_LANDING_GEAR));
  for (int i = 0; i < getNumberOfCriticals(Mech.LOC_CT); i++) {
    if (null == getCritical(Mech.LOC_CT, i)) {
      setCritical(Mech.LOC_CT, i, new CriticalSlot(CriticalSlot.TYPE_SYSTEM, LAM_LANDING_GEAR));
      break;
    }
  }
  previousMovementMode = movementMode;
  setFuel(80);
  setCrew(new LAMPilot(this));
}
origin: MegaMek/megamek

private void autoSetSkillsAndName(Entity e) {
  IClientPreferences cs = PreferenceManager.getClientPreferences();
  for (int i = 0; i < e.getCrew().getSlotCount(); i++) {
    if(cs.useAverageSkills()) {
      int skills[] = m_client.getRandomSkillsGenerator().getRandomSkills(e, true);

      int gunnery = skills[0];
      int piloting = skills[1];

      e.getCrew().setGunnery(gunnery, i);
      e.getCrew().setPiloting(piloting, i);
      if (e.getCrew() instanceof LAMPilot) {
        skills = m_client.getRandomSkillsGenerator().getRandomSkills(e, true);
        ((LAMPilot)e.getCrew()).setGunneryAero(skills[0]);
        ((LAMPilot)e.getCrew()).setPilotingAero(skills[1]);
      }
    }
    e.getCrew().sortRandomSkills();
    if(cs.generateNames()) {
      e.getCrew().setName(m_client.getRandomNameGenerator().generate(), i);
    }
  }
}
origin: MegaMek/megamek

/**
 * Returns whether this pilot has non-standard piloting or gunnery values
 */
@Override
public boolean isCustom() {
  return getGunneryMech() != 4 || getGunneryAero() != 4 || getPilotingMech() != 5 || getPilotingAero() != 5;
}
origin: MegaMek/megamek

private void autoSetSkillsAndName(Entity e) {
  IClientPreferences cs = PreferenceManager.getClientPreferences();
  for (int i = 0; i < e.getCrew().getSlotCount(); i++) {
    if (cs.useAverageSkills()) {
      int skills[] = client.getRandomSkillsGenerator().getRandomSkills(e,
          true);

      int gunnery = skills[0];
      int piloting = skills[1];

      e.getCrew().setGunnery(gunnery, i);
      // For infantry, piloting doubles as antimek skill, and this is
      // set based on whether the unit has antimek training, which gets
      // set in the BLK file, so we should ignore the defaults
      if (!(e instanceof Infantry)) {
        e.getCrew().setPiloting(piloting, i);
      }
      if (e.getCrew() instanceof LAMPilot) {
        skills = client.getRandomSkillsGenerator().getRandomSkills(e, true);
        ((LAMPilot)e.getCrew()).setGunneryAero(skills[0]);
        ((LAMPilot)e.getCrew()).setPilotingAero(skills[1]);
      }
    }
    if(cs.generateNames()) {
      e.getCrew().setName(client.getRandomNameGenerator().generate(), i);
    }
  }
  e.getCrew().sortRandomSkills();
}
megamek.commonLAMPilot

Javadoc

Crew class for LAMs which tracks separate skills for 'Mech and Fighter modes, and chooses the correct one based on the LAM's current movement mode.

Most used methods

  • setGunneryAero
  • setPilotingAero
  • <init>
  • convertToLAMPilot
    Used by LandAirMech.setCrew to convert a Crew instance into a LAMPilot instance.
  • getBVImplantMultiplier
  • getBVSkillMultiplier
    Returns the BV multiplier for this pilot's gunnery/piloting
  • getCrewType
  • getGunneryAero
  • getGunneryAeroB
  • getGunneryAeroL
  • getGunneryAeroM
  • getGunneryMech
  • getGunneryAeroM,
  • getGunneryMech,
  • getGunneryMechB,
  • getGunneryMechL,
  • getGunneryMechM,
  • getHits,
  • getName,
  • getPilotingAero,
  • getPilotingMech,
  • getSkillsAsString

Popular in Java

  • Reading from database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • putExtra (Intent)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Kernel (java.awt.image)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now