Get the MULT token @param pc @param eq @return MULT token
(PlayerCharacter pc, Equipment eq)
| 672 | * @return MULT token |
| 673 | */ |
| 674 | private static String getMultToken(PlayerCharacter pc, Equipment eq) |
| 675 | { |
| 676 | String critMultVar = ControlUtilities.getControlToken(Globals.getContext(), CControl.CRITMULT); |
| 677 | if (critMultVar != null) |
| 678 | { |
| 679 | return WeaponToken.getNewCritMultString(pc, eq, critMultVar); |
| 680 | } |
| 681 | String profName = getProfName(eq); |
| 682 | StringBuilder sb = new StringBuilder(); |
| 683 | boolean isDouble = (eq.isDouble() && (eq.getLocation() == EquipmentLocation.EQUIPPED_TWO_HANDS)); |
| 684 | int mult = (int) pc.getTotalBonusTo("WEAPONPROF=" + profName, "CRITMULTADD") |
| 685 | + getWeaponProfTypeBonuses(pc, eq, "CRITMULTADD", WPTYPEBONUS_PC); |
| 686 | |
| 687 | int critMult = eq.getCritMultiplier(); |
| 688 | if (critMult <= 0) |
| 689 | { |
| 690 | sb.append(mult); |
| 691 | } |
| 692 | else |
| 693 | { |
| 694 | sb.append(critMult + mult); |
| 695 | } |
| 696 | |
| 697 | int altCrit = eq.getAltCritMultiplier(); |
| 698 | |
| 699 | if (isDouble && (altCrit > 0)) |
| 700 | { |
| 701 | sb.append('/').append(altCrit + mult); |
| 702 | } |
| 703 | return sb.toString(); |
| 704 | } |
| 705 | |
| 706 | public static String getNewCritMultString(PlayerCharacter pc, Equipment eq, String critMultVar) |
| 707 | { |
no test coverage detected