Exemplo n.º 1
0
 @Override
 public void applyChoice(
     CDOMObject owner, CategorizedAbilitySelection choice, PlayerCharacter pc) {
   double cost = choice.getAbility().getSafe(ObjectKey.SELECTION_COST).doubleValue();
   if (cost > 0.0001) {
     pc.adjustFeats(cost);
   }
   AbilityUtilities.modAbility(
       pc, choice.getAbility(), choice.getSelection(), AbilityCategory.FEAT);
   pc.addAssoc(owner, AssociationListKey.TEMPLATE_FEAT, choice);
 }
 @Override
 public void restoreChoice(PlayerCharacter pc, CDOMObject owner, T choice) {
   pc.addAssoc(owner, getListKey(), choice);
   pc.addAssociation(owner, encodeChoice(choice));
   List<ChooseSelectionActor<?>> actors = owner.getListFor(ListKey.NEW_CHOOSE_ACTOR);
   if (actors != null) {
     for (ChooseSelectionActor ca : actors) {
       applyChoice(owner, choice, pc, ca);
     }
   }
 }