/** * Set the anti-mek skill for this unit. Since Infantry don't have piloting * the crew's piloting skill is treated as the anti-mek skill. This is * largely just a convenience method for setting the Crew's piloting skill. * @param amSkill */ public void setAntiMekSkill(int amSkill) { if (getCrew() == null) { return; } getCrew().setPiloting(amSkill, 0); }
/** * Returns the anti-mek skill for this unit. Since Infantry don't have * piloting the crew's piloting skill is treated as the anti-mek skill. * This is largely just a convenience method for setting the Crew's piloting * skill. * @return */ public int getAntiMekSkill() { if (getCrew() == null) { return ANTI_MECH_SKILL_UNTRAINED; } else { return getCrew().getPiloting(); } }
/** * Convenience method for setting the anti-mek skill of the unit based on * whether or not they have anti-mek training. If the input is false, the * anti-mek skill is set to the default untrained value, otherwise it's * set to the default value based on motive type. * * @param amTraining */ public void setAntiMekSkill(boolean amTraining) { if (getCrew() == null) { return; } if (amTraining) { if ((getMovementMode() == EntityMovementMode.INF_MOTORIZED) || getMovementMode() == EntityMovementMode.INF_JUMP) { getCrew().setPiloting(ANTI_MECH_SKILL_JUMP, 0); } else { getCrew().setPiloting(ANTI_MECH_SKILL_FOOT, 0); } } else { getCrew().setPiloting(ANTI_MECH_SKILL_UNTRAINED, 0); } }
private void addAugmentationNotes(List<String> notes) { final List<IOption> options = new ArrayList<>(); for (final Enumeration<IOption> e = inf.getCrew().getOptions().getOptions(); e.hasMoreElements();) { final IOption option = e.nextElement(); if (option.booleanValue()) { options.add(option); } } if (!options.isEmpty()) { notes.add(Messages.getString("TROView.InfantryNote.Augmented")); options.forEach(o -> { notes.add(o.getDisplayableName().replaceAll("\\s+\\(Not Implemn?ented\\)", "") + ": " + o.getDescription().replaceAll("See IO.*", "")); }); } } }
private void updateTotalSkill(Infantry infantry) { Crew crew = infantry.getCrew(); if (null == crew) { return; } int gunnery = crew.getGunnery(); int antiMek = infantry.getAntiMekSkill(); if (antiMek == 0 || antiMek == 8) { antiMek = gunnery + 1; } BigDecimal skillLevel = BigDecimal.valueOf(gunnery) .add(BigDecimal.valueOf(antiMek)); incrementSkillRatingCounts(getExperienceLevelName(skillLevel)); setTotalSkillLevels(getTotalSkillLevels(false).add(skillLevel)); }
pilotFactor = getCrew().getBVSkillMultiplier(isAntiMekTrained(), game);
&& ((null == getCrew()) || !hasAbility(OptionsConstants.MD_TSM_IMPLANT)) && ((null == getCrew()) || !hasAbility(OptionsConstants.MD_DERMAL_ARMOR)) && (null != secondW) && secondW.hasFlag(WeaponType.F_INF_SUPPORT) && (getMovementMode() != EntityMovementMode.TRACKED) mp = Math.max(mp - 1, 0); if((null != getCrew()) && hasAbility(OptionsConstants.MD_PL_MASC) && ((getMovementMode() == EntityMovementMode.INF_LEG) mp += 1; if ((null != getCrew()) && hasAbility(OptionsConstants.INFANTRY_FOOT_CAV) && ((getMovementMode() == EntityMovementMode.INF_LEG) || (getMovementMode() == EntityMovementMode.INF_JUMP))) {
r.add(getCrew().getGunnery()); r.newlines = 0; vDesc.addElement(r);
if (inf.getCrew() != null) { if (inf.hasAbility(OptionsConstants.MD_TSM_IMPLANT)) { secondaryCrew--;
public static int maxSecondaryWeapons(Infantry inf) { int max = 2; if (inf.getMovementMode() == EntityMovementMode.VTOL) { max = inf.hasMicrolite()?0 : 1; } else if (inf.getMovementMode() == EntityMovementMode.INF_UMU) { max = inf.getAllUMUCount(); } if (inf.hasSpecialization(Infantry.COMBAT_ENGINEERS)) { max = 0; } if (inf.hasSpecialization(Infantry.MOUNTAIN_TROOPS | Infantry.PARAMEDICS)) { max = 1; } if (inf.getCrew() != null) { if (inf.hasAbility(OptionsConstants.MD_DERMAL_ARMOR)) { max++; } if (inf.hasAbility(OptionsConstants.MD_TSM_IMPLANT)) { max++; } } return max; }
Crew mockLaserPlatoonCrew = mock(Crew.class); doReturn(mockInfantryGunnery.getLevel()).when(mockLaserPlatoonCrew).getGunnery(); when(mockLaserPlatoon.getCrew()).thenReturn(mockLaserPlatoonCrew); personnelList.addAll(infantryPersonnel);
toReturn = new ToHitData(inf.getCrew().getPiloting(), "anti-mech skill", ToHitData.HIT_KICK, ToHitData.SIDE_FRONT); int men = inf.getShootingStrength();
toReturn = new ToHitData(inf.getCrew().getPiloting(), "anti-mech skill"); int men = inf.getShootingStrength(); int modifier = TargetRoll.IMPOSSIBLE;
for (Enumeration<IOption> e = infantry.getCrew().getOptions(PilotOptions.MD_ADVANTAGES); e.hasMoreElements();) { final IOption o = e.nextElement();
for (String aug : augmentations) { try { t.getCrew().getOptions().getOption(aug).setValue(true); } catch (NullPointerException ex) { throw new EntityLoadingException("Could not locate pilot option " + aug);