/** * 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); }
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())); }
@Override public int getGunneryL() { return useAeroGunnery() ? getGunneryAeroL() : getGunneryMechL(); }
/** * @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(); }
@Override public int getGunneryB() { return useAeroGunnery() ? getGunneryAeroB() : getGunneryMechB(); }
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);
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)) {
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);
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());
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);
if (e.getCrew() instanceof LAMPilot) { skills = c.getRandomSkillsGenerator().getRandomSkills(e, true); ((LAMPilot)e.getCrew()).setGunneryAero(skills[0]); ((LAMPilot)e.getCrew()).setPilotingAero(skills[1]);
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);
@Override public int getGunnery() { return useAeroGunnery() ? getGunneryAero() : getGunneryMech(); }
@Override public void setCrew(Crew newCrew) { if (newCrew instanceof LAMPilot) { super.setCrew(newCrew); } else { super.setCrew(LAMPilot.convertToLAMPilot(this, newCrew)); } }
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)); }
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); } } }
/** * Returns whether this pilot has non-standard piloting or gunnery values */ @Override public boolean isCustom() { return getGunneryMech() != 4 || getGunneryAero() != 4 || getPilotingMech() != 5 || getPilotingAero() != 5; }
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(); }