(Kit aKit, PlayerCharacter aPC, List<String> warnings)
| 165 | } |
| 166 | |
| 167 | @Override |
| 168 | public boolean testApply(Kit aKit, PlayerCharacter aPC, List<String> warnings) |
| 169 | { |
| 170 | actingQuantity = quantity; |
| 171 | actingCost = maxCost; |
| 172 | actingMods = mods == null ? null : new ArrayList<>(mods); |
| 173 | actingLocation = theLocationStr; |
| 174 | if (size != null) |
| 175 | { |
| 176 | actingSize = size.get(); |
| 177 | } |
| 178 | |
| 179 | theEquipment = null; |
| 180 | theQty = 0; |
| 181 | theLocation = ""; |
| 182 | theCost = BigDecimal.ZERO; |
| 183 | |
| 184 | processLookups(aKit, aPC); |
| 185 | |
| 186 | int aBuyRate = aKit.getBuyRate(aPC); |
| 187 | BigDecimal pcGold = new BigDecimal(ChannelUtilities |
| 188 | .readControlledChannel(aPC.getCharID(), CControl.GOLDINPUT).toString()); |
| 189 | final BigDecimal fixedTotalCost = aKit.getTotalCost(aPC); |
| 190 | if (fixedTotalCost != null) |
| 191 | { |
| 192 | // We are going to charge fr the kit once, rather than for every piece of gear |
| 193 | aBuyRate = 0; |
| 194 | } |
| 195 | |
| 196 | List<Equipment> eqList = new ArrayList<>(equip.getContainedObjects()); |
| 197 | if (actingCost != null) |
| 198 | { |
| 199 | final BigDecimal bdMaxCost = new BigDecimal(Integer.toString(actingCost)); |
| 200 | eqList.removeIf(equipment -> equipment.getCost(aPC).compareTo(bdMaxCost) > 0); |
| 201 | } |
| 202 | if (eqList.size() == 1) |
| 203 | { |
| 204 | theEquipment = eqList.get(0); |
| 205 | } |
| 206 | else |
| 207 | { |
| 208 | List<Equipment> selected = new ArrayList<>(1); |
| 209 | selected = Globals.getChoiceFromList("Choose equipment", eqList, selected, 1, aPC); |
| 210 | if (selected.size() == 1) |
| 211 | { |
| 212 | theEquipment = selected.get(0); |
| 213 | } |
| 214 | } |
| 215 | |
| 216 | // |
| 217 | // TODO: Check to see if the user has selected an item that |
| 218 | // requires modification (MOD:R) |
| 219 | |
| 220 | theEquipment = theEquipment.clone(); |
| 221 | |
| 222 | // |
| 223 | // Resize item for character--never resize weapons or ammo, unless it's a |
| 224 | // natural (weapon) |
nothing calls this directly
no test coverage detected