Get the Weapon Token output @param pc The character being exported @param eq The weapon being exported @param aTok The exporttoken split by . and up to the weapon property @param tokenSource The original source of the export token (for error reporting.) @return The output for the token for the weap
(PlayerCharacter pc, Equipment eq, StringTokenizer aTok, String tokenSource)
| 204 | * @return The output for the token for the weapon and character. |
| 205 | */ |
| 206 | protected String getWeaponToken(PlayerCharacter pc, Equipment eq, StringTokenizer aTok, String tokenSource) |
| 207 | { |
| 208 | String token = ""; |
| 209 | if (aTok.hasMoreTokens()) |
| 210 | { |
| 211 | token = aTok.nextToken(); |
| 212 | } |
| 213 | |
| 214 | int range = -1; |
| 215 | int content = -1; |
| 216 | int ammo = -1; |
| 217 | |
| 218 | if (token.equals("RANGELIST")) |
| 219 | { |
| 220 | range = getIntToken(aTok, -1); |
| 221 | |
| 222 | if (aTok.hasMoreTokens()) |
| 223 | { |
| 224 | token = aTok.nextToken(); |
| 225 | } |
| 226 | else |
| 227 | { |
| 228 | token = "RANGELIST"; |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | if (token.equals("CONTENTS")) |
| 233 | { |
| 234 | if (aTok.hasMoreTokens()) |
| 235 | { |
| 236 | content = getIntToken(aTok, -1); |
| 237 | |
| 238 | if (aTok.hasMoreTokens()) |
| 239 | { |
| 240 | token = aTok.nextToken(); |
| 241 | } |
| 242 | else |
| 243 | { |
| 244 | token = "CONTENTS"; |
| 245 | } |
| 246 | } |
| 247 | else |
| 248 | { |
| 249 | token = "CONTENTSCOUNT"; |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | if (token.equals("AMMUNITION")) |
| 254 | { |
| 255 | if (aTok.hasMoreTokens()) |
| 256 | { |
| 257 | ammo = getIntToken(aTok, -1); |
| 258 | |
| 259 | if (aTok.hasMoreTokens()) |
| 260 | { |
| 261 | token = aTok.nextToken(); |
| 262 | } |
| 263 | else |
no test coverage detected