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

Method getRollToken

code/src/java/plugin/exporttokens/HPRollToken.java:90–106  ·  view source on GitHub ↗

Get the HPROLL.ROLL token @param pc @param level @return the HPROLL.ROLL token

(PlayerCharacter pc, int level)

Source from the content-addressed store, hash-verified

88 * @return the HPROLL.ROLL token
89 */
90 public static int getRollToken(PlayerCharacter pc, int level)
91 {
92 CharacterDisplay display = pc.getDisplay();
93 int classLevel = display.getLevelInfoClassLevel(level) - 1;
94 int hpRoll = 0;
95
96 PCClass pcClass = pc.getClassKeyed(display.getLevelInfoClassKeyName(level));
97
98 if (pcClass != null)
99 {
100 PCClassLevel pcl = display.getActiveClassLevel(pcClass, classLevel);
101 Integer hp = display.getHP(pcl);
102 hpRoll = hp == null ? 0 : hp;
103 }
104
105 return hpRoll;
106 }
107
108 /**
109 * Get the HPROLL.STAT token

Callers 2

getTokenMethod · 0.95
getTotalTokenMethod · 0.95

Calls 6

getActiveClassLevelMethod · 0.95
getHPMethod · 0.95
getDisplayMethod · 0.45
getClassKeyedMethod · 0.45

Tested by

no test coverage detected