The method that actually adds the various items in this Kit to the PC. Takes account of Kit Number @param pc The Player Character object that we will be applying the kit to. @param thingsToAdd The list of things that will be added by this kit w
(final PlayerCharacter pc, final Collection<BaseKit> thingsToAdd)
| 129 | * wrapped in KitWrapper objects |
| 130 | */ |
| 131 | public void processKit(final PlayerCharacter pc, final Collection<BaseKit> thingsToAdd) |
| 132 | { |
| 133 | BigDecimal totalCostToBeCharged = getTotalCostToBeCharged(pc); |
| 134 | if (totalCostToBeCharged != null) |
| 135 | { |
| 136 | Number currentGold = (Number) ChannelUtilities |
| 137 | .readControlledChannel(pc.getCharID(), CControl.GOLDINPUT); |
| 138 | ChannelUtilities.setControlledChannel(pc.getCharID(), |
| 139 | CControl.GOLDINPUT, new BigDecimal(currentGold.toString()).subtract(totalCostToBeCharged)); |
| 140 | } |
| 141 | |
| 142 | for (KitStat kStat : getStats()) |
| 143 | { |
| 144 | kStat.apply(pc); |
| 145 | } |
| 146 | |
| 147 | for (BaseKit bk : thingsToAdd) |
| 148 | { |
| 149 | bk.apply(pc); |
| 150 | } |
| 151 | pc.setCalcEquipmentList(); |
| 152 | |
| 153 | if (getSafe(ObjectKey.APPLY_MODE) == KitApply.PERMANENT) |
| 154 | { |
| 155 | pc.addKit(this); |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * Gets the buy rate of the kit. |
no test coverage detected