(String tokenSource, PlayerCharacter pc, ExportHandler eh)
| 64 | } |
| 65 | |
| 66 | @Override |
| 67 | public String getToken(String tokenSource, PlayerCharacter pc, ExportHandler eh) |
| 68 | { |
| 69 | String retString = ""; |
| 70 | StringTokenizer aTok = new StringTokenizer(tokenSource, "."); |
| 71 | aTok.nextToken(); |
| 72 | |
| 73 | if (aTok.hasMoreTokens()) |
| 74 | { |
| 75 | String attackTypeString = aTok.nextToken(); |
| 76 | String modifier = aTok.hasMoreTokens() ? aTok.nextToken() : ""; |
| 77 | String format = aTok.hasMoreTokens() ? aTok.nextToken() : ""; |
| 78 | |
| 79 | AttackType attackType = AttackType.valueOf(attackTypeString); |
| 80 | retString = AttackInfo.getAttackInfo(pc, attackType, modifier); |
| 81 | |
| 82 | // SHORT means we only return the first attack bonus |
| 83 | if ("SHORT".equalsIgnoreCase(format)) |
| 84 | { |
| 85 | int sepPos = retString.indexOf('/'); |
| 86 | if (sepPos >= 0) |
| 87 | { |
| 88 | retString = retString.substring(0, sepPos); |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | return retString; |
| 94 | } |
| 95 | } |
nothing calls this directly
no test coverage detected