mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
parent
abed4219e0
commit
a9d1a92abc
3 changed files with 25 additions and 33 deletions
|
|
@ -61,7 +61,7 @@ class DeathOrGloryEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Cards cards = new CardsImpl(controller.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game));
|
||||
if (!cards.isEmpty()) {
|
||||
TargetCard targetCards = new TargetCard(0, cards.size(), Zone.EXILED, new FilterCard("cards to put in the first pile"));
|
||||
TargetCard targetCards = new TargetCard(0, cards.size(), Zone.GRAVEYARD, new FilterCard("cards to put in the first pile"));
|
||||
List<Card> pile1 = new ArrayList<>();
|
||||
if (controller.choose(Outcome.Neutral, cards, targetCards, game)) {
|
||||
List<UUID> targets = targetCards.getTargets();
|
||||
|
|
@ -73,8 +73,7 @@ class DeathOrGloryEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
}
|
||||
List<Card> pile2 = new ArrayList<>();
|
||||
pile2.addAll(cards.getCards(game));
|
||||
List<Card> pile2 = new ArrayList<>(cards.getCards(game));
|
||||
|
||||
StringBuilder sb = new StringBuilder("First pile of ").append(controller.getLogName()).append(": ");
|
||||
sb.append(pile1.stream().map(Card::getLogName).collect(Collectors.joining(", ")));
|
||||
|
|
@ -103,10 +102,8 @@ class DeathOrGloryEffect extends OneShotEffect {
|
|||
pile1Zone = Zone.BATTLEFIELD;
|
||||
pile2Zone = Zone.EXILED;
|
||||
}
|
||||
Set<Card> pile1Set = new HashSet<>();
|
||||
Set<Card> pile2Set = new HashSet<>();
|
||||
pile1Set.addAll(pile1);
|
||||
pile2Set.addAll(pile2);
|
||||
Set<Card> pile1Set = new HashSet<>(pile1);
|
||||
Set<Card> pile2Set = new HashSet<>(pile2);
|
||||
controller.moveCards(pile1Set, pile1Zone, source, game, false, false, false, null);
|
||||
controller.moveCards(pile2Set, pile2Zone, source, game, false, false, false, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
|
||||
package mage.cards.t;
|
||||
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
|
@ -66,25 +65,18 @@ class TundraKavuEffect extends BecomesBasicLandTargetEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
protected void chooseLandType(Ability source, Game game) {
|
||||
landTypes.clear();
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Set<String> choiceSet = new LinkedHashSet<>();
|
||||
choiceSet.add("Island");
|
||||
choiceSet.add("Plains");
|
||||
|
||||
ChoiceImpl choice = new ChoiceImpl(true, ChoiceHintType.CARD);
|
||||
choice.setChoices(choiceSet);
|
||||
choice.setChoices(new HashSet<>(Arrays.asList("Plains", "Island")));
|
||||
choice.setMessage("Choose a basic land type");
|
||||
if (!controller.choose(outcome, choice, game)) {
|
||||
discard();
|
||||
return;
|
||||
}
|
||||
|
||||
if (controller != null && controller.choose(outcome, choice, game)) {
|
||||
landTypes.add(SubType.byDescription(choice.getChoice()));
|
||||
} else {
|
||||
this.discard();
|
||||
}
|
||||
|
||||
super.init(source, game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,16 +79,19 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl {
|
|||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
// choose land type
|
||||
|
||||
if (chooseLandType) {
|
||||
this.chooseLandType(source, game);
|
||||
}
|
||||
}
|
||||
|
||||
protected void chooseLandType(Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Choice choice = new ChoiceBasicLandType();
|
||||
if (controller != null && controller.choose(outcome, choice, game)) {
|
||||
landTypes.add(SubType.byDescription(choice.getChoice()));
|
||||
} else {
|
||||
this.discard();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue