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

Method getAmmoUser

code/src/java/pcgen/io/exporttoken/WeaponToken.java:2447–2474  ·  view source on GitHub ↗
(PlayerCharacter pc, Equipment eq, int ammo)

Source from the content-addressed store, hash-verified

2445 }
2446
2447 private static Equipment getAmmoUser(PlayerCharacter pc, Equipment eq, int ammo)
2448 {
2449 int ammoCount = 0;
2450
2451 if (ammo < 0)
2452 {
2453 return null;
2454 }
2455 String containerCapacity = eq.getContainerCapacityString();
2456
2457 for (Equipment equip : pc.getEquipmentListInOutputOrder())
2458 {
2459 for (String type : equip.typeList())
2460 {
2461 if (containerCapacity.contains(type))
2462 {
2463 ++ammoCount;
2464
2465 break;
2466 }
2467 }
2468 if (ammoCount == (ammo + 1))
2469 {
2470 return equip;
2471 }
2472 }
2473 return null;
2474 }
2475
2476 private static int getWeaponProfTypeBonuses(PlayerCharacter pc, Equipment eq, String bonusType, int index)
2477 {

Callers 3

getAmmunitionTokenMethod · 0.95
getToHitMethod · 0.95
getEqBonusMethod · 0.95

Calls 4

typeListMethod · 0.80
containsMethod · 0.65

Tested by

no test coverage detected