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

Method getReachToken

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

Get reach token Formula is as follows: REACH:(RACEREACH+(max(0,EQUIPREACH-5))) EQUIPREACHMULT @param pc the player @param eq the equipment @return reach token

(PlayerCharacter pc, Equipment eq)

Source from the content-addressed store, hash-verified

1046 * @return reach token
1047 */
1048 private static String getReachToken(PlayerCharacter pc, Equipment eq)
1049 {
1050 String eqReach = pc.getControl("EQREACH");
1051 int sum;
1052 if (eqReach == null)
1053 {
1054 int dist = eq.getVariableValue(SettingsHandler.getGameAsProperty().get().getWeaponReachFormula(), "", pc).intValue();
1055 String profName = getProfName(eq);
1056 int iAdd = (int) pc.getTotalBonusTo("WEAPONPROF=" + profName, "REACH")
1057 + getWeaponProfTypeBonuses(pc, eq, "REACH", WPTYPEBONUS_PC);
1058 sum = dist + iAdd;
1059 }
1060 else
1061 {
1062 sum = ((Number) eq.getLocalVariable(pc.getCharID(), eqReach)).intValue();
1063 }
1064 return Globals.getGameModeUnitSet().displayDistanceInUnitSet(sum);
1065 }
1066
1067 /**
1068 * Get weight in set token

Callers 1

getWeaponTokenMethod · 0.95

Calls 13

getGameAsPropertyMethod · 0.95
getProfNameMethod · 0.95
getGameModeUnitSetMethod · 0.95
getControlMethod · 0.80
intValueMethod · 0.80
getWeaponReachFormulaMethod · 0.80
getVariableValueMethod · 0.65
getMethod · 0.65
getCharIDMethod · 0.65
getTotalBonusToMethod · 0.45

Tested by

no test coverage detected