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

Method applyChoice

code/src/java/plugin/lsttokens/add/AbilityToken.java:347–363  ·  view source on GitHub ↗
(CDOMObject owner, CNAbilitySelection choice, PlayerCharacter pc)

Source from the content-addressed store, hash-verified

345 }
346
347 @Override
348 public void applyChoice(CDOMObject owner, CNAbilitySelection choice, PlayerCharacter pc)
349 {
350 CNAbility cna = choice.getCNAbility();
351 Ability ab = cna.getAbility();
352 AbilityCategory cat = (AbilityCategory) cna.getAbilityCategory();
353 boolean isVirtual = Nature.VIRTUAL.equals(cna.getNature());
354 if (isVirtual)
355 {
356 pc.addSavedAbility(choice, UserSelection.getInstance(), UserSelection.getInstance());
357 }
358 else
359 {
360 pc.addAbility(choice, UserSelection.getInstance(), UserSelection.getInstance());
361 pc.adjustAbilities(cat, ab.getSafe(ObjectKey.SELECTION_COST));
362 }
363 }
364
365 @Override
366 public boolean allow(CNAbilitySelection choice, PlayerCharacter pc, boolean allowStack)

Callers

nothing calls this directly

Calls 10

getAbilityMethod · 0.95
getAbilityCategoryMethod · 0.95
getNatureMethod · 0.95
getInstanceMethod · 0.95
addSavedAbilityMethod · 0.80
adjustAbilitiesMethod · 0.80
getSafeMethod · 0.80
equalsMethod · 0.65
addAbilityMethod · 0.65
getCNAbilityMethod · 0.45

Tested by

no test coverage detected