mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
CloneEffect: add ChoiceZone and make the choice there mandatory
This commit is contained in:
@@ -64,11 +64,15 @@ public class CloneEffect extends SpellAbilityEffect {
|
|||||||
Card cardToCopy = null;
|
Card cardToCopy = null;
|
||||||
|
|
||||||
if (sa.hasParam("Choices")) {
|
if (sa.hasParam("Choices")) {
|
||||||
CardCollectionView choices = game.getCardsIn(ZoneType.Battlefield);
|
ZoneType choiceZone = ZoneType.Battlefield;
|
||||||
|
if (sa.hasParam("ChoiceZone")) {
|
||||||
|
choiceZone = ZoneType.smartValueOf(sa.getParam("ChoiceZone"));
|
||||||
|
}
|
||||||
|
CardCollectionView choices = game.getCardsIn(choiceZone);
|
||||||
choices = CardLists.getValidCards(choices, sa.getParam("Choices"), activator, host);
|
choices = CardLists.getValidCards(choices, sa.getParam("Choices"), activator, host);
|
||||||
|
|
||||||
String title = sa.hasParam("ChoiceTitle") ? sa.getParam("ChoiceTitle") : "Choose a card ";
|
String title = sa.hasParam("ChoiceTitle") ? sa.getParam("ChoiceTitle") : "Choose a card ";
|
||||||
cardToCopy = activator.getController().chooseSingleEntityForEffect(choices, sa, title, true);
|
cardToCopy = activator.getController().chooseSingleEntityForEffect(choices, sa, title, false);
|
||||||
} else if (sa.hasParam("Defined")) {
|
} else if (sa.hasParam("Defined")) {
|
||||||
List<Card> cloneSources = AbilityUtils.getDefinedCards(host, sa.getParam("Defined"), sa);
|
List<Card> cloneSources = AbilityUtils.getDefinedCards(host, sa.getParam("Defined"), sa);
|
||||||
if (!cloneSources.isEmpty()) {
|
if (!cloneSources.isEmpty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user