mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 14:02:05 -08:00
* Biomancer's Familiar - Fixed cost reduction effect working wrongly for up to 2 mana and creating exceptions.
* Training Grounds - Fixed exception during get playable method.
This commit is contained in:
parent
5a17b9665e
commit
1ef8aeb7ba
2 changed files with 16 additions and 23 deletions
|
|
@ -86,19 +86,7 @@ class BiomancersFamiliarCostReductionEffect extends CostModificationEffectImpl {
|
|||
if (reduceMax <= 0) {
|
||||
return true;
|
||||
}
|
||||
ChoiceImpl choice = new ChoiceImpl(true);
|
||||
Set<String> set = new LinkedHashSet<>();
|
||||
|
||||
for (int i = 0; i <= reduceMax; i++) {
|
||||
set.add(String.valueOf(i));
|
||||
}
|
||||
choice.setChoices(set);
|
||||
choice.setMessage("Reduce ability cost");
|
||||
if (!controller.choose(Outcome.Benefit, choice, game)) {
|
||||
return false;
|
||||
}
|
||||
int reduce = Integer.parseInt(choice.getChoice());
|
||||
CardUtil.reduceCost(abilityToModify, reduce);
|
||||
CardUtil.reduceCost(abilityToModify, reduceMax);
|
||||
return true;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ public final class TrainingGrounds extends CardImpl {
|
|||
|
||||
class TrainingGroundsEffect extends CostModificationEffectImpl {
|
||||
|
||||
private static final String effectText = "Activated abilities of creatures you control cost {2} less to activate. " +
|
||||
"This effect can't reduce the mana in that cost to less than one mana";
|
||||
private static final String effectText = "Activated abilities of creatures you control cost up to {2} less to activate. "
|
||||
+ "This effect can't reduce the mana in that cost to less than one mana";
|
||||
|
||||
TrainingGroundsEffect() {
|
||||
super(Duration.Custom, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
|
|
@ -74,15 +74,20 @@ class TrainingGroundsEffect extends CostModificationEffectImpl {
|
|||
ChoiceImpl choice = new ChoiceImpl(true);
|
||||
Set<String> set = new LinkedHashSet<>();
|
||||
|
||||
for (int i = 0; i <= reduceMax; i++) {
|
||||
set.add(String.valueOf(i));
|
||||
int reduce;
|
||||
if (game.inCheckPlayableState()) {
|
||||
reduce = reduceMax;
|
||||
} else {
|
||||
for (int i = 0; i <= reduceMax; i++) {
|
||||
set.add(String.valueOf(i));
|
||||
}
|
||||
choice.setChoices(set);
|
||||
choice.setMessage("Reduce ability cost");
|
||||
if (!controller.choose(Outcome.Benefit, choice, game)) {
|
||||
return false;
|
||||
}
|
||||
reduce = Integer.parseInt(choice.getChoice());
|
||||
}
|
||||
choice.setChoices(set);
|
||||
choice.setMessage("Reduce ability cost");
|
||||
if (!controller.choose(Outcome.Benefit, choice, game)) {
|
||||
return false;
|
||||
}
|
||||
int reduce = Integer.parseInt(choice.getChoice());
|
||||
CardUtil.reduceCost(abilityToModify, reduce);
|
||||
return true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue