Returns the "Base" check value for the check at the index specified. @param check The index of the check to get @return The base check value.
(final PCCheck check)
| 2734 | * @return The base check value. |
| 2735 | */ |
| 2736 | public int getBaseCheck(final PCCheck check) |
| 2737 | { |
| 2738 | String checkVar = ControlUtilities.getControlToken(Globals.getContext(), CControl.BASESAVE); |
| 2739 | if (checkVar != null) |
| 2740 | { |
| 2741 | return ((Number) this.getLocal(check, checkVar)).intValue(); |
| 2742 | } |
| 2743 | |
| 2744 | final String cacheLookup = "getBaseCheck:" + check.getKeyName(); //$NON-NLS-1$ |
| 2745 | |
| 2746 | Float total = variableProcessor.getCachedVariable(cacheLookup); |
| 2747 | |
| 2748 | if (total != null) |
| 2749 | { |
| 2750 | return total.intValue(); |
| 2751 | } |
| 2752 | |
| 2753 | double bonus = 0; |
| 2754 | |
| 2755 | final String checkName = check.getKeyName(); |
| 2756 | |
| 2757 | //Apply non-magical bonuses |
| 2758 | bonus += getTotalBonusTo("SAVE", "BASE." + checkName); |
| 2759 | |
| 2760 | // |
| 2761 | // now we see if this PC is a Familiar/Mount |
| 2762 | final PlayerCharacter nPC = getMasterPC(); |
| 2763 | if ((nPC != null) && (!masterFacet.getCopyMasterCheck(id).isEmpty())) |
| 2764 | { |
| 2765 | int masterBonus = nPC.getBaseCheck(check); |
| 2766 | |
| 2767 | final String copyMasterCheck = replaceMasterString(masterFacet.getCopyMasterCheck(id), masterBonus); |
| 2768 | masterBonus = getVariableValue(copyMasterCheck, Constants.EMPTY_STRING).intValue(); |
| 2769 | |
| 2770 | // use masters save if better |
| 2771 | bonus = Math.max(bonus, masterBonus); |
| 2772 | } |
| 2773 | |
| 2774 | variableProcessor.addCachedVariable(cacheLookup, (float) bonus); |
| 2775 | return (int) bonus; |
| 2776 | } |
| 2777 | |
| 2778 | /** |
| 2779 | * Returns the total check value for the check specified for the character. |