private static void createAnvilLance() { FormationType ft = new FormationType("Anvil", "Assault"); ft.allowedUnitTypes = FLAG_GROUND_NO_LIGHT; ft.exclusiveFaction = "FWL"; ft.minWeightClass = EntityWeightClass.WEIGHT_MEDIUM; ft.mainCriteria = ms -> ms.getTotalArmor() >= 40; ft.mainDescription = "Armor 40+"; ft.otherCriteria.add(new PercentConstraint(0.5, ms -> ms.getEquipmentNames().stream().map(name -> EquipmentType.get(name)) .anyMatch(eq -> eq instanceof ACWeapon || eq instanceof LBXACWeapon || eq instanceof UACWeapon || eq instanceof SRMWeapon || eq instanceof LRMWeapon), "AC, SRM, or LRM")); ft.reportMetrics.put("AC/SRM/LRM", ms -> ft.otherCriteria.get(0).criterion.test(ms)); allFormationTypes.put(ft.name, ft); }
private static void createFastAssaultLance() { FormationType ft = new FormationType("Fast Assault", "Assault"); ft.allowedUnitTypes = FLAG_GROUND_NO_LIGHT; ft.minWeightClass = EntityWeightClass.WEIGHT_MEDIUM; ft.mainCriteria = ms -> ms.getTotalArmor() >= 135 && (ms.getWalkMp() >= 5 || ms.getJumpMp() > 0); ft.mainDescription = "Walk 5+ or Jump 1+"; ft.otherCriteria.add(new PercentConstraint(0.75, ms -> getDamageAtRange(ms, 7) >= 25, "Damage 25+ at range 7")); ft.otherCriteria.add(new CountConstraint(3, ms -> ms.getWeightClass() >= EntityWeightClass.WEIGHT_HEAVY, "Heavy+")); //FIXME: The actual requirement is one juggernaut or two snipers; there needs to be // a way to combine constraints with ||. ft.otherCriteria.add(new CountConstraint(2, ms -> EnumSet.of(UnitRole.JUGGERNAUT, UnitRole.SNIPER).contains(UnitRoleHandler.getRoleFor(ms)), "Juggernaut or Sniper")); ft.reportMetrics.put("Damage @ 7", ms -> getDamageAtRange(ms, 7)); allFormationTypes.put(ft.name, ft); }
private static void createAssaultLance() { FormationType ft = new FormationType("Assault"); ft.allowedUnitTypes = FLAG_GROUND_NO_LIGHT; ft.idealRole = UnitRole.JUGGERNAUT; ft.minWeightClass = EntityWeightClass.WEIGHT_MEDIUM; ft.mainCriteria = ms -> ms.getTotalArmor() >= 135; ft.mainDescription = "Armor 135+"; ft.otherCriteria.add(new PercentConstraint(0.75, ms -> getDamageAtRange(ms, 7) >= 25, "25 damage at range 7")); ft.otherCriteria.add(new CountConstraint(3, ms -> ms.getWeightClass() >= EntityWeightClass.WEIGHT_HEAVY, "Heavy+")); Constraint c = new CountConstraint(1, ms -> UnitRoleHandler.getRoleFor(ms).equals(UnitRole.JUGGERNAUT), "Juggernaut"); c.setPairedWithNext(true); ft.otherCriteria.add(c); c = new CountConstraint(2, ms -> UnitRoleHandler.getRoleFor(ms).equals(UnitRole.SNIPER), "Sniper"); c.setPairedWithPrevious(true); ft.otherCriteria.add(c); ft.reportMetrics.put("Armor", ms -> ms.getTotalArmor()); ft.reportMetrics.put("Damage @ 7", ms -> getDamageAtRange(ms, 7)); allFormationTypes.put(ft.name, ft); }
int armor = mech.getTotalArmor(); int maxArmor = mech.getTotalInternal() * 2 + 3; if (sel == 1) {