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

Method allow

code/src/java/plugin/lsttokens/add/AbilityToken.java:365–382  ·  view source on GitHub ↗
(CNAbilitySelection choice, PlayerCharacter pc, boolean allowStack)

Source from the content-addressed store, hash-verified

363 }
364
365 @Override
366 public boolean allow(CNAbilitySelection choice, PlayerCharacter pc, boolean allowStack)
367 {
368 CNAbility cna = choice.getCNAbility();
369 Ability ability = cna.getAbility();
370 if (!ability.getSafe(ObjectKey.VISIBILITY).equals(Visibility.DEFAULT))
371 {
372 return false;
373 }
374 boolean isVirtual = Nature.VIRTUAL.equals(cna.getNature());
375 if (!isVirtual && !ability.qualifies(pc, ability))
376 {
377 return false;
378 }
379 String selection = choice.getSelection();
380 // Avoid any already selected
381 return !AbilityUtilities.alreadySelected(pc, ability, selection, allowStack);
382 }
383
384 @Override
385 public CNAbilitySelection decodeChoice(LoadContext context, String s)

Callers

nothing calls this directly

Calls 8

getAbilityMethod · 0.95
getNatureMethod · 0.95
alreadySelectedMethod · 0.95
getSafeMethod · 0.80
equalsMethod · 0.65
qualifiesMethod · 0.65
getCNAbilityMethod · 0.45
getSelectionMethod · 0.45

Tested by

no test coverage detected