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

Method getEqBonus

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

Source from the content-addressed store, hash-verified

2330 }
2331
2332 private static int getEqBonus(PlayerCharacter pc, Equipment eq, int content, int ammo)
2333 {
2334 int eqbonus = eq.getBonusToDamage(pc, true);
2335
2336 //Ammunition & Contents Modifier
2337 Equipment containedEq = null;
2338 if (content > -1)
2339 {
2340 if (content < eq.getContainedEquipmentCount())
2341 {
2342 containedEq = eq.getContainedEquipment(content);
2343 eqbonus += containedEq.getBonusToDamage(pc, true);
2344 }
2345 }
2346
2347 Equipment ammoUser = getAmmoUser(pc, eq, ammo);
2348
2349 if (ammoUser != null)
2350 {
2351 eqbonus += ammoUser.getBonusToDamage(pc, true);
2352 }
2353
2354 // If not using ammo stacking, correct for stacked enhancement bonus
2355 if (!Globals.checkRule(RuleConstants.AMMOSTACKSWITHWEAPON))
2356 {
2357 eqbonus += calcAmmoEqCorrection("WEAPON.DAMAGE.ENHANCEMENT", eq, containedEq, ammoUser);
2358 }
2359
2360 return eqbonus;
2361 }
2362
2363 private static String getMonkUnarmed(PlayerCharacter pc, Equipment eq, String damString)
2364 {

Callers 1

getDamageMethod · 0.95

Calls 6

getBonusToDamageMethod · 0.95
getAmmoUserMethod · 0.95
checkRuleMethod · 0.95
calcAmmoEqCorrectionMethod · 0.95
getContainedEquipmentMethod · 0.80

Tested by

no test coverage detected