public int getPilotingMech() { return super.getPiloting(0); }
private int getGunneryFatigueTurn() { int turn = 20; if (getPiloting() > 5) { turn = 14; } else if (getPiloting() > 3) { turn = 17; } // get fatigue point modifiers int mod = (int) Math.min(Math.max(0, Math.ceil(fatigue / 4.0) - 1), 4); turn = turn - mod; return turn; }
private int getPilotingFatigueTurn() { int turn = 20; if (getPiloting() > 5) { turn = 10; } else if (getPiloting() > 3) { turn = 14; } else if (getPiloting() > 1) { turn = 17; } // get fatigue point modifiers int mod = (int) Math.min(Math.max(0, Math.ceil(fatigue / 4.0) - 1), 4); turn = turn - mod; return turn; }
/** * for sensor ops, so these might be easily expanded later for rpg */ public int getSensorOps() { if (getPiloting() > -1) { return getPiloting(); } return getGunnery(); }
/** * Returns whether this pilot has non-standard piloting or gunnery values */ public boolean isCustom() { return (getGunnery() != 4) || (getPiloting() != 5); }
public boolean isGunneryFatigued() { if (getPiloting() < 2) { return false; } return fatigueCount >= getGunneryFatigueTurn(); }
/** * @param showPiloting if false, only the gunnery skill is shown (used for protomechs; may be ignored * for other unit types) * @return a String showing the skills for a particular slot in the format gunnery/piloting */ public String getSkillsAsString(int pos, boolean showPiloting) { StringBuilder sb = new StringBuilder(); sb.append(getGunnery(pos)); if (showPiloting) { sb.append("/").append(getPiloting(pos)); } return sb.toString(); }
/** * @param showPiloting if false, only the gunnery skill is shown (used for protomechs; may be ignored * for other unit types) * @return a String showing the overall skills in the format gunnery/piloting */ public String getSkillsAsString(boolean showPiloting) { StringBuilder sb = new StringBuilder(); sb.append(getGunnery()); if (showPiloting) { sb.append("/").append(getPiloting()); } return sb.toString(); }
@Override public int getPiloting(EntityMovementType moveType) { if (lam.getConversionMode() == LandAirMech.CONV_MODE_FIGHTER || (lam .getConversionMode() == LandAirMech.CONV_MODE_AIRMECH && (moveType == EntityMovementType.MOVE_VTOL_WALK || moveType == EntityMovementType.MOVE_VTOL_RUN))) { return pilotingAero; } else { return super.getPiloting(); } }
/** * 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(); } }
@Override public int getPiloting() { if (lam.getConversionMode() == LandAirMech.CONV_MODE_FIGHTER || (lam.getConversionMode() == LandAirMech.CONV_MODE_AIRMECH && lam.isAirborneVTOLorWIGE())) { return pilotingAero; } else { return super.getPiloting(); } }
private static String formatHeader(Entity e) { StringBuffer sb = new StringBuffer(1024); sb.append("Model: ").append(e.getChassis()).append(" - ") .append(e.getModel()).append(CommonConstants.NL); for (int i = 0; i < e.getCrew().getSlotCount(); i++) { if (e.getCrew().isMissing(i)) { sb.append("No ").append(e.getCrew().getCrewType().getRoleName(i)); } else { sb.append(e.getCrew().getCrewType().getRoleName(i)).append(": ") .append(e.getCrew().getName(i)); sb.append(" (").append(e.getCrew().getGunnery(i)).append("/") .append(e.getCrew().getPiloting(i)).append(")"); } sb.append(CommonConstants.NL); } if (e.isCaptured()) { sb.append(" *** CAPTURED BY THE ENEMY ***"); sb.append(CommonConstants.NL); } return sb.toString(); }
/** * 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 */ public double getBVSkillMultiplier(boolean usePiloting, IGame game) { int pilotVal = getPiloting(); if (!usePiloting) { pilotVal = 5; } return getBVImplantMultiplier() * getBVSkillMultiplier(getGunnery(), pilotVal, game); }
private int calcExperienceMod(Entity unit, StringBuilder logMsg) { final float greenThreshold = 5.5F; final float regularThreshold = 4.0F; final float veteranThreshold = 2.5F; float skillAverage; if (unit instanceof Infantry || unit instanceof Protomech) { skillAverage = unit.getCrew().getGunnery(); } else { skillAverage = (unit.getCrew().getGunnery() + unit.getCrew().getPiloting()) / 2F; } if (skillAverage >= greenThreshold) { logMsg.append("\n\t\tGreen unit (+0)"); return 0; } if (skillAverage >= regularThreshold) { logMsg.append("\n\t\tRegular unit (-1)"); return -1; } if (skillAverage >= veteranThreshold) { logMsg.append("\n\t\tVeteran unit (-2)"); return -2; } logMsg.append("\n\t\tElite unit (-3)"); return -3; }
public ArrayList<String> generateEntityStub(ArrayList<Entity> entities) { ArrayList<String> stub = new ArrayList<String>(); for (Entity en : entities) { if (null == en) { stub.add("<html><font color='red'>No random assignment table found for faction</font></html>"); } else { stub.add("<html>" + en.getCrew().getName() + " (" + en.getCrew().getGunnery() + "/" + en.getCrew().getPiloting() + "), " + "<i>" + en.getShortName() + "</i>" + "</html>"); } } return stub; }
public int getECCMTarget() { return getCrew().getPiloting() + getSensorHits() + getCICHits() + getFCSHits(); }
/** * calculate any changes to the PSR modifier for entering difficult terrain */ private void adjustDifficultTerrainPSRModifier(PilotingRollData psr) { if (hasQuirk(OptionsConstants.QUIRK_POS_EASY_PILOT) && (getCrew().getPiloting() > 3)) { psr.addModifier(-1, "easy to pilot"); } if (hasQuirk(OptionsConstants.QUIRK_NEG_UNBALANCED)) { psr.addModifier(+1, "unbalanced"); } }
private double potentialBuildingDamage(int x, int y, Entity entity) { Coords coords = new Coords(x, y); Building building = game.getBoard().getBuildingAt(coords); if (building == null) { return 0; } int potentialDmg = (int) Math.ceil((double) building.getCurrentCF(coords) / 10); boolean aptGunnery = entity.hasAbility(OptionsConstants.PILOT_APTITUDE_GUNNERY); double oddsTakeDmg = 1 - (Compute.oddsAbove(entity.getCrew().getPiloting(), aptGunnery) / 100); return potentialDmg * oddsTakeDmg; }
public String getPilotDesc() { if (hasPilot()) { return entity.getCrew().getName() + " " + entity.getCrew().getGunnery() + "/" + entity.getCrew().getPiloting(); } return "NO PILOT"; }
private String getUnitDescription(Unit u) { String name = "<font color='red'>No Crew</font>"; String uname = ""; Person pp = u.getCommander(); if(null != pp) { name = pp.getFullTitle(); name += " (" + u.getEntity().getCrew().getGunnery() + "/" + u.getEntity().getCrew().getPiloting() + ")"; if(pp.needsFixing()) { name = "<font color='red'>" + name + "</font>"; } } uname = "<i>" + u.getName() + "</i>"; if(u.isDamaged()) { uname = "<font color='red'>" + uname + "</font>"; } return "<html>" + name + ", " + uname + "</html>"; }