Get the HPROLL.ROLL token @param pc @param level @return the HPROLL.ROLL token
(PlayerCharacter pc, int level)
| 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 |
no test coverage detected