mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
Cloud Key - fixed that it doesn't allow to cast cards without full mana available (#6698);
This commit is contained in:
parent
74ceac7322
commit
f9a9a55f7b
6 changed files with 87 additions and 211 deletions
|
|
@ -5,24 +5,38 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.choices.Choice;
|
||||
import mage.choices.ChoiceCardType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author emerald000
|
||||
*/
|
||||
public class ChooseCardTypeEffect extends OneShotEffect {
|
||||
|
||||
List<CardType> cardTypes = Arrays.stream(CardType.values()).collect(Collectors.toList());
|
||||
|
||||
public ChooseCardTypeEffect(Outcome outcome) {
|
||||
this(outcome, Arrays.stream(CardType.values()).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
public ChooseCardTypeEffect(Outcome outcome, List<CardType> cardTypes) {
|
||||
super(outcome);
|
||||
staticText = "choose a card type";
|
||||
this.staticText = "choose a card type";
|
||||
this.cardTypes = new ArrayList<>(cardTypes);
|
||||
}
|
||||
|
||||
private ChooseCardTypeEffect(final ChooseCardTypeEffect effect) {
|
||||
super(effect);
|
||||
this.cardTypes = new ArrayList<>(effect.cardTypes);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package mage.choices;
|
|||
import mage.constants.CardType;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -11,12 +12,12 @@ import java.util.stream.Collectors;
|
|||
public class ChoiceCardType extends ChoiceImpl {
|
||||
|
||||
public ChoiceCardType() {
|
||||
this(true);
|
||||
this(true, Arrays.stream(CardType.values()).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
public ChoiceCardType(boolean required) {
|
||||
public ChoiceCardType(boolean required, List<CardType> cardTypes) {
|
||||
super(required);
|
||||
this.choices.addAll(Arrays.stream(CardType.values()).map(CardType::toString).collect(Collectors.toList()));
|
||||
this.choices.addAll(cardTypes.stream().map(CardType::toString).collect(Collectors.toList()));
|
||||
this.message = "Choose a card type";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue