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) {
|
if (controller != null) {
|
||||||
Cards cards = new CardsImpl(controller.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game));
|
Cards cards = new CardsImpl(controller.getGraveyard().getCards(StaticFilters.FILTER_CARD_CREATURE, game));
|
||||||
if (!cards.isEmpty()) {
|
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<>();
|
List<Card> pile1 = new ArrayList<>();
|
||||||
if (controller.choose(Outcome.Neutral, cards, targetCards, game)) {
|
if (controller.choose(Outcome.Neutral, cards, targetCards, game)) {
|
||||||
List<UUID> targets = targetCards.getTargets();
|
List<UUID> targets = targetCards.getTargets();
|
||||||
|
|
@ -73,8 +73,7 @@ class DeathOrGloryEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List<Card> pile2 = new ArrayList<>();
|
List<Card> pile2 = new ArrayList<>(cards.getCards(game));
|
||||||
pile2.addAll(cards.getCards(game));
|
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder("First pile of ").append(controller.getLogName()).append(": ");
|
StringBuilder sb = new StringBuilder("First pile of ").append(controller.getLogName()).append(": ");
|
||||||
sb.append(pile1.stream().map(Card::getLogName).collect(Collectors.joining(", ")));
|
sb.append(pile1.stream().map(Card::getLogName).collect(Collectors.joining(", ")));
|
||||||
|
|
@ -103,10 +102,8 @@ class DeathOrGloryEffect extends OneShotEffect {
|
||||||
pile1Zone = Zone.BATTLEFIELD;
|
pile1Zone = Zone.BATTLEFIELD;
|
||||||
pile2Zone = Zone.EXILED;
|
pile2Zone = Zone.EXILED;
|
||||||
}
|
}
|
||||||
Set<Card> pile1Set = new HashSet<>();
|
Set<Card> pile1Set = new HashSet<>(pile1);
|
||||||
Set<Card> pile2Set = new HashSet<>();
|
Set<Card> pile2Set = new HashSet<>(pile2);
|
||||||
pile1Set.addAll(pile1);
|
|
||||||
pile2Set.addAll(pile2);
|
|
||||||
controller.moveCards(pile1Set, pile1Zone, source, game, false, false, false, null);
|
controller.moveCards(pile1Set, pile1Zone, source, game, false, false, false, null);
|
||||||
controller.moveCards(pile2Set, pile2Zone, source, game, false, false, false, null);
|
controller.moveCards(pile2Set, pile2Zone, source, game, false, false, false, null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,8 @@
|
||||||
|
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import java.util.LinkedHashSet;
|
import java.util.*;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.UUID;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
|
@ -66,25 +65,18 @@ class TundraKavuEffect extends BecomesBasicLandTargetEffect {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Ability source, Game game) {
|
protected void chooseLandType(Ability source, Game game) {
|
||||||
landTypes.clear();
|
landTypes.clear();
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
|
||||||
Set<String> choiceSet = new LinkedHashSet<>();
|
ChoiceImpl choice = new ChoiceImpl(true, ChoiceHintType.CARD);
|
||||||
choiceSet.add("Island");
|
choice.setChoices(new HashSet<>(Arrays.asList("Plains", "Island")));
|
||||||
choiceSet.add("Plains");
|
choice.setMessage("Choose a basic land type");
|
||||||
ChoiceImpl choice = new ChoiceImpl(true, ChoiceHintType.CARD);
|
|
||||||
choice.setChoices(choiceSet);
|
if (controller != null && controller.choose(outcome, choice, game)) {
|
||||||
choice.setMessage("Choose a basic land type");
|
|
||||||
if (!controller.choose(outcome, choice, game)) {
|
|
||||||
discard();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
landTypes.add(SubType.byDescription(choice.getChoice()));
|
landTypes.add(SubType.byDescription(choice.getChoice()));
|
||||||
} else {
|
} else {
|
||||||
this.discard();
|
this.discard();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.init(source, game);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,16 +79,19 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public void init(Ability source, Game game) {
|
public void init(Ability source, Game game) {
|
||||||
super.init(source, game);
|
super.init(source, game);
|
||||||
// choose land type
|
|
||||||
if (chooseLandType) {
|
if (chooseLandType) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
this.chooseLandType(source, game);
|
||||||
Choice choice = new ChoiceBasicLandType();
|
}
|
||||||
if (controller != null && controller.choose(outcome, choice, game)) {
|
}
|
||||||
landTypes.add(SubType.byDescription(choice.getChoice()));
|
|
||||||
} else {
|
protected void chooseLandType(Ability source, Game game) {
|
||||||
this.discard();
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
return;
|
Choice choice = new ChoiceBasicLandType();
|
||||||
}
|
if (controller != null && controller.choose(outcome, choice, game)) {
|
||||||
|
landTypes.add(SubType.byDescription(choice.getChoice()));
|
||||||
|
} else {
|
||||||
|
this.discard();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue