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

Method calcSR

code/src/java/pcgen/core/PlayerCharacter.java:4553–4588  ·  view source on GitHub ↗
(final boolean includeEquipment)

Source from the content-addressed store, hash-verified

4551 }
4552
4553 public int calcSR(final boolean includeEquipment)
4554 {
4555 int SR = srFacet.getSR(id);
4556
4557 if (includeEquipment)
4558 {
4559 for (Equipment eq : getEquippedEquipmentSet())
4560 {
4561 SR = Math.max(SR,
4562 eq.getSafe(ObjectKey.SR).getReduction().resolve(this, eq.getQualifiedKey()).intValue());
4563
4564 for (EquipmentModifier eqMod : eq.getEqModifierList(true))
4565 {
4566 SR = Math.max(SR, eqMod.getSR(eq, this));
4567 }
4568
4569 for (EquipmentModifier eqMod : eq.getEqModifierList(false))
4570 {
4571 SR = Math.max(SR, eqMod.getSR(eq, this));
4572 }
4573 }
4574 }
4575
4576 SR += (int) getTotalBonusTo("MISC", "SR");
4577 // SR += (int) getBonusValue("MISC", "SR");
4578
4579 //
4580 // This would make more sense to just not add in the first place...
4581 //
4582 if (!includeEquipment)
4583 {
4584 SR -= (int) getEquipmentBonusTo("MISC", "SR");
4585 }
4586
4587 return SR;
4588 }
4589
4590 /**
4591 * Method will go through the list of classes that the PC has and see if

Callers 2

getSRMethod · 0.95
passesMethod · 0.80

Calls 11

getTotalBonusToMethod · 0.95
getEquipmentBonusToMethod · 0.95
intValueMethod · 0.80
getSafeMethod · 0.80
getEqModifierListMethod · 0.80
resolveMethod · 0.65
getSRMethod · 0.45
maxMethod · 0.45
getReductionMethod · 0.45
getQualifiedKeyMethod · 0.45

Tested by 1

passesMethod · 0.64