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

Method getDC

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

Returns DC for a spell and SpellInfo. @param sp the spell @param cs TODO @param si the spell info @return DC for a spell and SpellInfo

(final Spell sp, CharacterSpell cs, final SpellInfo si)

Source from the content-addressed store, hash-verified

8186 * @return DC for a spell and SpellInfo
8187 */
8188 public int getDC(final Spell sp, CharacterSpell cs, final SpellInfo si)
8189 {
8190 CDOMObject ow;
8191 int spellLevel;
8192 int metaDC = 0;
8193
8194 spellLevel = si.getActualLevel();
8195 ow = cs.getOwner();
8196
8197 String fixedDC = si.getFixedDC();
8198 // TODO Temp fix for 1223858, better fix would be to move fixedDC to
8199 // spellInfo
8200 /*
8201 * TODO Need to evaluate how duplicative this logic is and what is
8202 * really necessary
8203 */
8204 if (fixedDC != null && "INNATE".equalsIgnoreCase(si.getBook()))
8205 {
8206 return getVariableValue(fixedDC, "").intValue();
8207 }
8208
8209 // Check for a non class based fixed DC
8210 if (fixedDC != null && ow != null && !(ow instanceof PCClass))
8211 {
8212 return getVariableValue(fixedDC, "").intValue();
8213 }
8214
8215 if (si.getFeatList() != null)
8216 {
8217 for (Ability metaFeat : si.getFeatList())
8218 {
8219 spellLevel -= metaFeat.getSafe(IntegerKey.ADD_SPELL_LEVEL);
8220 metaDC = (int) (metaDC + BonusCalc.charBonusTo(metaFeat, "DC", "FEATBONUS", this));
8221 }
8222 }
8223
8224 return getDC(sp, null, spellLevel, metaDC, ow);
8225 }
8226
8227 public int getDC(final Spell sp, PCClass aClass, int spellLevel, int metaDC, CDOMObject ow)
8228 {

Callers 2

getTokenMethod · 0.45
getTokenMethod · 0.45

Calls 15

getVariableValueMethod · 0.95
charBonusToMethod · 0.95
getDomainSourceMethod · 0.95
getClassKeyedMethod · 0.95
getPcclassMethod · 0.95
getGameAsPropertyMethod · 0.95
getTotalBonusToMethod · 0.95
getStatModForMethod · 0.95
getActualLevelMethod · 0.80
getFixedDCMethod · 0.80
equalsIgnoreCaseMethod · 0.80
getBookMethod · 0.80

Tested by

no test coverage detected