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

Method getAttackInfo

code/src/java/pcgen/core/analysis/AttackInfo.java:45–68  ·  view source on GitHub ↗

Get Attack Information for a PC. This will return the attack token value requested for the supplied character. Note the return value is always a formatted string such as +8 or +8/+3 @param pc The character to retrieve the attack value for. @param attackType The type of attack to be returned

(PlayerCharacter pc, AttackType attackType, String modifier)

Source from the content-addressed store, hash-verified

43 * @return The token value.
44 */
45 public static String getAttackInfo(PlayerCharacter pc, AttackType attackType, String modifier)
46 {
47 if (modifier.equals("TOTAL"))
48 {
49 if (attackType.equals(AttackType.RANGED))
50 {
51 int total = getTotalToken(pc, attackType);
52 return pc.getAttackString(AttackType.RANGED, total);
53 }
54 else if (attackType.equals(AttackType.UNARMED))
55 {
56 int total = getTotalToken(pc, AttackType.MELEE);
57 // TODO: Is this correct for 3.0 also?
58 return pc.getAttackString(AttackType.MELEE, total);
59 //return pc.getAttackString(Constants.ATTACKSTRING_UNARMED, total);
60 }
61 else
62 {
63 int total = getTotalToken(pc, attackType);
64 return pc.getAttackString(AttackType.MELEE, total);
65 }
66 }
67 return getSubToken(pc, attackType, modifier);
68 }
69
70 /**
71 * Get total ATTACK token

Callers 1

getTokenMethod · 0.95

Calls 4

getTotalTokenMethod · 0.95
getSubTokenMethod · 0.95
getAttackStringMethod · 0.80
equalsMethod · 0.65

Tested by

no test coverage detected