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

Method getWeaponToken

code/src/java/pcgen/io/exporttoken/WeaponToken.java:206–469  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 4

getTokenMethod · 0.95
getTokenMethod · 0.80
getTokenMethod · 0.80
getTokenMethod · 0.80

Calls 15

getNameTokenMethod · 0.95
getOutputNameTokenMethod · 0.95
getLongNameTokenMethod · 0.95
getAttacksTokenMethod · 0.95
getAmmunitionTokenMethod · 0.95
getContentsCountTokenMethod · 0.95
getContentsTokenMethod · 0.95
getNumAttacksTokenMethod · 0.95
getHeftMethod · 0.95
getIsTypeTokenMethod · 0.95
getCritTokenMethod · 0.95

Tested by

no test coverage detected