MCPcopy Create free account
hub / github.com/PCGen/pcgen / getMultToken

Method getMultToken

code/src/java/pcgen/io/exporttoken/WeaponToken.java:674–704  ·  view source on GitHub ↗

Get the MULT token @param pc @param eq @return MULT token

(PlayerCharacter pc, Equipment eq)

Source from the content-addressed store, hash-verified

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 {

Callers 1

getWeaponTokenMethod · 0.95

Calls 12

getControlTokenMethod · 0.95
getContextMethod · 0.95
getNewCritMultStringMethod · 0.95
getProfNameMethod · 0.95
isDoubleMethod · 0.80
getCritMultiplierMethod · 0.80
getAltCritMultiplierMethod · 0.80
getLocationMethod · 0.65
toStringMethod · 0.65
getTotalBonusToMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected