Calculate the parts of the cost for the equipment's head that are affected by size. @param aPC The character who owns the equipment. @param primaryHead Are we calculating for the primary or alternate head. @return The cost of the head
(final PlayerCharacter aPC, boolean primaryHead)
| 764 | * @return The cost of the head |
| 765 | */ |
| 766 | private BigDecimal getPreSizingCostForHead(final PlayerCharacter aPC, boolean primaryHead) |
| 767 | { |
| 768 | BigDecimal c = BigDecimal.ZERO; |
| 769 | EquipmentHead head = getEquipmentHeadReference(primaryHead ? 1 : 2); |
| 770 | if (head != null) |
| 771 | { |
| 772 | bonusPrimary = primaryHead; |
| 773 | for (EquipmentModifier eqMod : head.getSafeListFor(ListKey.EQMOD)) |
| 774 | { |
| 775 | int iCount = getSelectCorrectedAssociationCount(eqMod); |
| 776 | |
| 777 | if (iCount < 1) |
| 778 | { |
| 779 | iCount = 1; |
| 780 | } |
| 781 | |
| 782 | Formula baseCost = eqMod.getSafe(FormulaKey.BASECOST); |
| 783 | Number bc = baseCost.resolve(this, primaryHead, aPC, ""); |
| 784 | final BigDecimal eqModCost = new BigDecimal(bc.toString()); |
| 785 | c = c.add( |
| 786 | eqModCost.multiply(new BigDecimal(Integer.toString(getSafe(IntegerKey.BASE_QUANTITY) * iCount)))); |
| 787 | c = c.add( |
| 788 | EqModCost.addItemCosts(eqMod, aPC, "ITEMCOST", getSafe(IntegerKey.BASE_QUANTITY) * iCount, this)); |
| 789 | } |
| 790 | } |
| 791 | return c; |
| 792 | } |
| 793 | |
| 794 | /** |
| 795 | * Calculate the parts of the cost for the equipment's head that are not |
no test coverage detected