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

Method getStatMod

code/src/java/pcgen/core/analysis/SkillModifier.java:120–141  ·  view source on GitHub ↗

Get the modifier to the skill granted by the key attribute @param pc @return modifier

(Skill sk, PlayerCharacter pc)

Source from the content-addressed store, hash-verified

118 * @return modifier
119 */
120 public static int getStatMod(Skill sk, PlayerCharacter pc)
121 {
122 CDOMSingleRef<PCStat> stat = sk.get(ObjectKey.KEY_STAT);
123 if (stat == null)
124 {
125 int statMod = 0;
126 if (Globals.getGameModeHasPointPool())
127 {
128 ArrayList<Type> typeList = new ArrayList<>();
129 SkillInfoUtilities.getKeyStatList(pc, sk, typeList);
130 for (Type type : typeList)
131 {
132 statMod += pc.getTotalBonusTo("SKILL", "TYPE." + type);
133 }
134 }
135 return statMod;
136 }
137 else
138 {
139 return pc.getStatModFor(stat.get());
140 }
141 }
142}

Callers 4

runMethod · 0.95
getSkillPropValueMethod · 0.95
includeSkillMethod · 0.95
getSkillPropValueMethod · 0.95

Calls 5

getKeyStatListMethod · 0.95
getMethod · 0.65
getTotalBonusToMethod · 0.45
getStatModForMethod · 0.45

Tested by

no test coverage detected