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

Method getMonkUnarmed

code/src/java/pcgen/io/exporttoken/WeaponToken.java:2363–2415  ·  view source on GitHub ↗
(PlayerCharacter pc, Equipment eq, String damString)

Source from the content-addressed store, hash-verified

2361 }
2362
2363 private static String getMonkUnarmed(PlayerCharacter pc, Equipment eq, String damString)
2364 {
2365 if (eq.isMonk() && eq.isUnarmed())
2366 {
2367 int eqSize = pc.getDisplay().getRace().getSafe(FormulaKey.SIZE).resolve(pc, "").intValue();
2368 int iMod = pc.sizeInt();
2369
2370 /* This modifies damage (by size) from the default when the race is
2371 * not the default size and the character is the default size for
2372 * their race */
2373 boolean applySize = (eqSize == iMod);
2374 String uDamString = UnarmedDamageDisplay.getUnarmedDamageString(pc, false, applySize);
2375
2376 StringTokenizer bTok = new StringTokenizer(damString, " d+-", false);
2377 bTok.nextToken();
2378 String b1String = bTok.nextToken();
2379
2380 StringTokenizer cTok = new StringTokenizer(uDamString, " d+-", false);
2381 cTok.nextToken();
2382 String c1String = cTok.nextToken();
2383
2384 if (Integer.parseInt(b1String) < Integer.parseInt(c1String))
2385 {
2386 damString = uDamString;
2387 }
2388
2389 /*
2390 * This modifies damage by size when the character is a different size
2391 * than the race. It also modifies it by applying any Bonuses to damage
2392 * size.
2393 */
2394
2395 iMod += (int) pc.getTotalBonusTo("WEAPONPROF=Unarmed Strike", "DAMAGESIZE");
2396 iMod += (int) pc.getTotalBonusTo("COMBAT", "DAMAGESIZE");
2397
2398 /* If not applying the race size modifier, then damString will
2399 * represent the damage as if this Character were the default
2400 * size. Set eqSize to adjust from damage for the default size,
2401 * not the race's actual size.
2402 */
2403 if (!applySize)
2404 {
2405 final SizeAdjustment defAdj = SizeUtilities.getDefaultSizeAdjustment();
2406 if (defAdj != null)
2407 {
2408 eqSize = defAdj.get(IntegerKey.SIZEORDER);
2409 }
2410 }
2411
2412 damString = Globals.adjustDamage(damString, iMod - eqSize);
2413 }
2414 return damString;
2415 }
2416
2417 private static String getEqDamage(PlayerCharacter pc, Equipment eq)
2418 {

Callers 1

getDamageMethod · 0.95

Calls 15

adjustDamageMethod · 0.95
isMonkMethod · 0.80
isUnarmedMethod · 0.80
intValueMethod · 0.80
getSafeMethod · 0.80
nextTokenMethod · 0.80
parseIntMethod · 0.80
resolveMethod · 0.65
getMethod · 0.65
getRaceMethod · 0.45

Tested by

no test coverage detected