Calculate the parts of the cost for the equipment's head that are not affected by size. @param aPC The character who owns the equipment. @param modifierCosts The array of costs to be doubled if the location demands it @param primaryHead Are we calculating for the primary or alternate head. @return
(final PlayerCharacter aPC, final List<BigDecimal> modifierCosts, boolean primaryHead)
| 801 | * @return The cost, non doubling cost and total plus of the head |
| 802 | */ |
| 803 | private EquipmentHeadCostSummary getPostSizingCostForHead(final PlayerCharacter aPC, |
| 804 | final List<BigDecimal> modifierCosts, boolean primaryHead) |
| 805 | { |
| 806 | EquipmentHeadCostSummary costSum = new EquipmentHeadCostSummary(); |
| 807 | EquipmentHead head = getEquipmentHeadReference(primaryHead ? 1 : 2); |
| 808 | |
| 809 | if (head != null) |
| 810 | { |
| 811 | for (EquipmentModifier eqMod : head.getSafeListFor(ListKey.EQMOD)) |
| 812 | { |
| 813 | int iCount = getSelectCorrectedAssociationCount(eqMod); |
| 814 | |
| 815 | if (iCount < 1) |
| 816 | { |
| 817 | iCount = 1; |
| 818 | } |
| 819 | |
| 820 | BigDecimal eqModCost; |
| 821 | Formula cost = eqMod.getSafe(FormulaKey.COST); |
| 822 | String costFormula = cost.toString(); |
| 823 | |
| 824 | if (hasAssociations(eqMod) && !costFormula.equals(EqModCost.getCost(eqMod, getFirstAssociation(eqMod)))) |
| 825 | { |
| 826 | eqModCost = BigDecimal.ZERO; |
| 827 | |
| 828 | for (String assoc : getAssociationList(eqMod)) |
| 829 | { |
| 830 | String v = calcEqModCost(aPC, EqModCost.getCost(eqMod, assoc), primaryHead); |
| 831 | final BigDecimal thisModCost = new BigDecimal(v); |
| 832 | eqModCost = eqModCost.add(thisModCost); |
| 833 | |
| 834 | if (!EqModCost.getCostDouble(eqMod)) |
| 835 | { |
| 836 | costSum.nonDoubleCost = costSum.nonDoubleCost.add(thisModCost); |
| 837 | } |
| 838 | else |
| 839 | { |
| 840 | modifierCosts.add(thisModCost); |
| 841 | } |
| 842 | } |
| 843 | |
| 844 | iCount = 1; |
| 845 | } |
| 846 | else |
| 847 | { |
| 848 | String v = calcEqModCost(aPC, cost.toString(), primaryHead); |
| 849 | eqModCost = new BigDecimal(v); |
| 850 | |
| 851 | if (EqModCost.getCostDouble(eqMod)) |
| 852 | { |
| 853 | modifierCosts.add(eqModCost); |
| 854 | } |
| 855 | else |
| 856 | { |
| 857 | costSum.nonDoubleCost = costSum.nonDoubleCost.add(eqModCost); |
| 858 | } |
| 859 | } |
| 860 |
no test coverage detected