Where a magic eqmod is present, remove the masterwork eqmod from the list. @param commonList The list of eqmods on both heads (or only head)
(Collection<EquipmentModifier> commonList)
| 1200 | * The list of eqmods on both heads (or only head) |
| 1201 | */ |
| 1202 | private void suppressMasterwork(Collection<EquipmentModifier> commonList) |
| 1203 | { |
| 1204 | // Look for a modifier named "masterwork" (assumption: this is marked as |
| 1205 | // "assigntoall") |
| 1206 | EquipmentModifier eqMaster = commonList.stream() |
| 1207 | .filter(eqMod -> "MASTERWORK".equalsIgnoreCase(eqMod.getDisplayName()) || eqMod.isIType(Type.MASTERWORK)) |
| 1208 | .findFirst().orElse(null); |
| 1209 | |
| 1210 | if (eqMaster == null) |
| 1211 | { |
| 1212 | return; |
| 1213 | } |
| 1214 | if (heads.stream().anyMatch(head -> getMagicBonus(head.getListFor(ListKey.EQMOD)) != null)) |
| 1215 | { |
| 1216 | commonList.remove(eqMaster); |
| 1217 | } |
| 1218 | } |
| 1219 | /** |
| 1220 | * Build up the description of the listed equipmods for this equipment item. |
| 1221 | * Takes into account if the item is a double weapon or not. |
no test coverage detected