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

Method baseAttackBonus

code/src/java/pcgen/core/PlayerCharacter.java:4458–4483  ·  view source on GitHub ↗

@return Total base attack bonus as an int

()

Source from the content-addressed store, hash-verified

4456 * @return Total base attack bonus as an int
4457 */
4458 public int baseAttackBonus()
4459 {
4460 // check for cached version
4461 final String cacheLookup = "BaseAttackBonus";
4462 Float total = variableProcessor.getCachedVariable(cacheLookup);
4463 if (total != null)
4464 {
4465 return total.intValue();
4466 }
4467
4468 // get Master's BAB
4469 final PlayerCharacter nPC = getMasterPC();
4470
4471 if ((nPC != null) && (!masterFacet.getCopyMasterBAB(id).isEmpty()))
4472 {
4473 int masterBAB = nPC.baseAttackBonus();
4474 final String copyMasterBAB = replaceMasterString(masterFacet.getCopyMasterBAB(id), masterBAB);
4475 masterBAB = getVariableValue(copyMasterBAB, "").intValue();
4476
4477 variableProcessor.addCachedVariable(cacheLookup, (float) masterBAB);
4478 return masterBAB;
4479 }
4480 int bab = (int) getTotalBonusTo("COMBAT", "BASEAB");
4481 variableProcessor.addCachedVariable(cacheLookup, (float) bab);
4482 return bab;
4483 }
4484
4485 /**
4486 * Creates the activeBonusList which is used to calculate all the bonuses to

Callers 3

getAttackStringMethod · 0.95
getNumAttacksMethod · 0.95

Calls 9

getMasterPCMethod · 0.95
replaceMasterStringMethod · 0.95
getVariableValueMethod · 0.95
getTotalBonusToMethod · 0.95
getCachedVariableMethod · 0.80
intValueMethod · 0.80
getCopyMasterBABMethod · 0.80
addCachedVariableMethod · 0.80
isEmptyMethod · 0.65

Tested by 1