mirror of
https://github.com/correl/mage.git
synced 2025-03-12 17:00:08 -09:00
Merge pull request #6716 from johnmeat/VoidUI
Alter UI for choosing a number for Void.
This commit is contained in:
commit
b2bc9ee6d1
1 changed files with 5 additions and 16 deletions
|
@ -5,8 +5,6 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.choices.Choice;
|
||||
import mage.choices.ChoiceImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.Outcome;
|
||||
|
@ -18,8 +16,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
@ -46,7 +42,7 @@ public final class Void extends CardImpl {
|
|||
}
|
||||
|
||||
class VoidEffect extends OneShotEffect {
|
||||
|
||||
|
||||
VoidEffect() {
|
||||
super(Outcome.DestroyPermanent);
|
||||
this.staticText = "Choose a number. Destroy all artifacts and creatures with converted mana cost equal to that number. Then target player reveals their hand and discards all nonland cards with converted mana cost equal to the number";
|
||||
|
@ -67,17 +63,10 @@ class VoidEffect extends OneShotEffect {
|
|||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
Choice numberChoice = new ChoiceImpl();
|
||||
Set<String> numbers = new HashSet<>(16);
|
||||
for (int i = 0; i <= 15; i++) {
|
||||
numbers.add(Integer.toString(i));
|
||||
}
|
||||
numberChoice.setChoices(numbers);
|
||||
numberChoice.setMessage("Choose a number");
|
||||
if (!controller.choose(Outcome.DestroyPermanent, numberChoice, game)) {
|
||||
return false;
|
||||
}
|
||||
int number = Integer.parseInt(numberChoice.getChoice());
|
||||
|
||||
int number = controller.announceXMana(0, Integer.MAX_VALUE, this.staticText, game, source);
|
||||
game.informPlayers(controller.getLogName() + " chooses " + number + '.');
|
||||
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
||||
if ((permanent.isArtifact() || permanent.isCreature())
|
||||
&& permanent.getConvertedManaCost() == number) {
|
||||
|
|
Loading…
Add table
Reference in a new issue